You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

154071 lines
5.1 MiB

  1. #!/usr/bin/env node
  2. module.exports =
  3. /******/ (function(modules) { // webpackBootstrap
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ // expose the modules object (__webpack_modules__)
  33. /******/ __webpack_require__.m = modules;
  34. /******/
  35. /******/ // expose the module cache
  36. /******/ __webpack_require__.c = installedModules;
  37. /******/
  38. /******/ // identity function for calling harmony imports with the correct context
  39. /******/ __webpack_require__.i = function(value) { return value; };
  40. /******/
  41. /******/ // define getter function for harmony exports
  42. /******/ __webpack_require__.d = function(exports, name, getter) {
  43. /******/ if(!__webpack_require__.o(exports, name)) {
  44. /******/ Object.defineProperty(exports, name, {
  45. /******/ configurable: false,
  46. /******/ enumerable: true,
  47. /******/ get: getter
  48. /******/ });
  49. /******/ }
  50. /******/ };
  51. /******/
  52. /******/ // getDefaultExport function for compatibility with non-harmony modules
  53. /******/ __webpack_require__.n = function(module) {
  54. /******/ var getter = module && module.__esModule ?
  55. /******/ function getDefault() { return module['default']; } :
  56. /******/ function getModuleExports() { return module; };
  57. /******/ __webpack_require__.d(getter, 'a', getter);
  58. /******/ return getter;
  59. /******/ };
  60. /******/
  61. /******/ // Object.prototype.hasOwnProperty.call
  62. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  63. /******/
  64. /******/ // __webpack_public_path__
  65. /******/ __webpack_require__.p = "";
  66. /******/
  67. /******/ // Load entry module and return exports
  68. /******/ return __webpack_require__(__webpack_require__.s = 504);
  69. /******/ })
  70. /************************************************************************/
  71. /******/ ([
  72. /* 0 */
  73. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74. "use strict";
  75. /* harmony export (immutable) */ __webpack_exports__["a"] = __extends;
  76. /* unused harmony export __assign */
  77. /* unused harmony export __rest */
  78. /* unused harmony export __decorate */
  79. /* unused harmony export __param */
  80. /* unused harmony export __metadata */
  81. /* unused harmony export __awaiter */
  82. /* unused harmony export __generator */
  83. /* unused harmony export __exportStar */
  84. /* unused harmony export __values */
  85. /* unused harmony export __read */
  86. /* unused harmony export __spread */
  87. /* unused harmony export __await */
  88. /* unused harmony export __asyncGenerator */
  89. /* unused harmony export __asyncDelegator */
  90. /* unused harmony export __asyncValues */
  91. /* unused harmony export __makeTemplateObject */
  92. /* unused harmony export __importStar */
  93. /* unused harmony export __importDefault */
  94. /*! *****************************************************************************
  95. Copyright (c) Microsoft Corporation. All rights reserved.
  96. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  97. this file except in compliance with the License. You may obtain a copy of the
  98. License at http://www.apache.org/licenses/LICENSE-2.0
  99. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  100. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  101. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  102. MERCHANTABLITY OR NON-INFRINGEMENT.
  103. See the Apache Version 2.0 License for specific language governing permissions
  104. and limitations under the License.
  105. ***************************************************************************** */
  106. /* global Reflect, Promise */
  107. var extendStatics = function(d, b) {
  108. extendStatics = Object.setPrototypeOf ||
  109. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  110. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  111. return extendStatics(d, b);
  112. };
  113. function __extends(d, b) {
  114. extendStatics(d, b);
  115. function __() { this.constructor = d; }
  116. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117. }
  118. var __assign = function() {
  119. __assign = Object.assign || function __assign(t) {
  120. for (var s, i = 1, n = arguments.length; i < n; i++) {
  121. s = arguments[i];
  122. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  123. }
  124. return t;
  125. }
  126. return __assign.apply(this, arguments);
  127. }
  128. function __rest(s, e) {
  129. var t = {};
  130. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  131. t[p] = s[p];
  132. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  133. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  134. t[p[i]] = s[p[i]];
  135. return t;
  136. }
  137. function __decorate(decorators, target, key, desc) {
  138. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  139. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  140. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  141. return c > 3 && r && Object.defineProperty(target, key, r), r;
  142. }
  143. function __param(paramIndex, decorator) {
  144. return function (target, key) { decorator(target, key, paramIndex); }
  145. }
  146. function __metadata(metadataKey, metadataValue) {
  147. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  148. }
  149. function __awaiter(thisArg, _arguments, P, generator) {
  150. return new (P || (P = Promise))(function (resolve, reject) {
  151. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  152. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  153. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  154. step((generator = generator.apply(thisArg, _arguments || [])).next());
  155. });
  156. }
  157. function __generator(thisArg, body) {
  158. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  159. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  160. function verb(n) { return function (v) { return step([n, v]); }; }
  161. function step(op) {
  162. if (f) throw new TypeError("Generator is already executing.");
  163. while (_) try {
  164. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  165. if (y = 0, t) op = [op[0] & 2, t.value];
  166. switch (op[0]) {
  167. case 0: case 1: t = op; break;
  168. case 4: _.label++; return { value: op[1], done: false };
  169. case 5: _.label++; y = op[1]; op = [0]; continue;
  170. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  171. default:
  172. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  173. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  174. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  175. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  176. if (t[2]) _.ops.pop();
  177. _.trys.pop(); continue;
  178. }
  179. op = body.call(thisArg, _);
  180. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  181. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  182. }
  183. }
  184. function __exportStar(m, exports) {
  185. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  186. }
  187. function __values(o) {
  188. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  189. if (m) return m.call(o);
  190. return {
  191. next: function () {
  192. if (o && i >= o.length) o = void 0;
  193. return { value: o && o[i++], done: !o };
  194. }
  195. };
  196. }
  197. function __read(o, n) {
  198. var m = typeof Symbol === "function" && o[Symbol.iterator];
  199. if (!m) return o;
  200. var i = m.call(o), r, ar = [], e;
  201. try {
  202. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  203. }
  204. catch (error) { e = { error: error }; }
  205. finally {
  206. try {
  207. if (r && !r.done && (m = i["return"])) m.call(i);
  208. }
  209. finally { if (e) throw e.error; }
  210. }
  211. return ar;
  212. }
  213. function __spread() {
  214. for (var ar = [], i = 0; i < arguments.length; i++)
  215. ar = ar.concat(__read(arguments[i]));
  216. return ar;
  217. }
  218. function __await(v) {
  219. return this instanceof __await ? (this.v = v, this) : new __await(v);
  220. }
  221. function __asyncGenerator(thisArg, _arguments, generator) {
  222. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  223. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  224. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  225. function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  226. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  227. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  228. function fulfill(value) { resume("next", value); }
  229. function reject(value) { resume("throw", value); }
  230. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  231. }
  232. function __asyncDelegator(o) {
  233. var i, p;
  234. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  235. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  236. }
  237. function __asyncValues(o) {
  238. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  239. var m = o[Symbol.asyncIterator], i;
  240. return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  241. function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
  242. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  243. }
  244. function __makeTemplateObject(cooked, raw) {
  245. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  246. return cooked;
  247. };
  248. function __importStar(mod) {
  249. if (mod && mod.__esModule) return mod;
  250. var result = {};
  251. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  252. result.default = mod;
  253. return result;
  254. }
  255. function __importDefault(mod) {
  256. return (mod && mod.__esModule) ? mod : { default: mod };
  257. }
  258. /***/ }),
  259. /* 1 */
  260. /***/ (function(module, exports) {
  261. module.exports = require("path");
  262. /***/ }),
  263. /* 2 */
  264. /***/ (function(module, exports, __webpack_require__) {
  265. "use strict";
  266. exports.__esModule = true;
  267. var _promise = __webpack_require__(7);
  268. var _promise2 = _interopRequireDefault(_promise);
  269. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  270. exports.default = function (fn) {
  271. return function () {
  272. var gen = fn.apply(this, arguments);
  273. return new _promise2.default(function (resolve, reject) {
  274. function step(key, arg) {
  275. try {
  276. var info = gen[key](arg);
  277. var value = info.value;
  278. } catch (error) {
  279. reject(error);
  280. return;
  281. }
  282. if (info.done) {
  283. resolve(value);
  284. } else {
  285. return _promise2.default.resolve(value).then(function (value) {
  286. step("next", value);
  287. }, function (err) {
  288. step("throw", err);
  289. });
  290. }
  291. }
  292. return step("next");
  293. });
  294. };
  295. };
  296. /***/ }),
  297. /* 3 */
  298. /***/ (function(module, exports, __webpack_require__) {
  299. "use strict";
  300. exports.__esModule = true;
  301. exports.default = function (instance, Constructor) {
  302. if (!(instance instanceof Constructor)) {
  303. throw new TypeError("Cannot call a class as a function");
  304. }
  305. };
  306. /***/ }),
  307. /* 4 */
  308. /***/ (function(module, exports, __webpack_require__) {
  309. module.exports = { "default": __webpack_require__(591), __esModule: true };
  310. /***/ }),
  311. /* 5 */
  312. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  313. "use strict";
  314. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscriber; });
  315. /* unused harmony export SafeSubscriber */
  316. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  317. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isFunction__ = __webpack_require__(143);
  318. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(390);
  319. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(31);
  320. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__ = __webpack_require__(262);
  321. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config__ = __webpack_require__(176);
  322. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_hostReportError__ = __webpack_require__(264);
  323. /** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */
  324. var Subscriber = /*@__PURE__*/ (function (_super) {
  325. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subscriber, _super);
  326. function Subscriber(destinationOrNext, error, complete) {
  327. var _this = _super.call(this) || this;
  328. _this.syncErrorValue = null;
  329. _this.syncErrorThrown = false;
  330. _this.syncErrorThrowable = false;
  331. _this.isStopped = false;
  332. _this._parentSubscription = null;
  333. switch (arguments.length) {
  334. case 0:
  335. _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */];
  336. break;
  337. case 1:
  338. if (!destinationOrNext) {
  339. _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */];
  340. break;
  341. }
  342. if (typeof destinationOrNext === 'object') {
  343. if (destinationOrNext instanceof Subscriber) {
  344. _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
  345. _this.destination = destinationOrNext;
  346. destinationOrNext.add(_this);
  347. }
  348. else {
  349. _this.syncErrorThrowable = true;
  350. _this.destination = new SafeSubscriber(_this, destinationOrNext);
  351. }
  352. break;
  353. }
  354. default:
  355. _this.syncErrorThrowable = true;
  356. _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
  357. break;
  358. }
  359. return _this;
  360. }
  361. Subscriber.prototype[__WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () { return this; };
  362. Subscriber.create = function (next, error, complete) {
  363. var subscriber = new Subscriber(next, error, complete);
  364. subscriber.syncErrorThrowable = false;
  365. return subscriber;
  366. };
  367. Subscriber.prototype.next = function (value) {
  368. if (!this.isStopped) {
  369. this._next(value);
  370. }
  371. };
  372. Subscriber.prototype.error = function (err) {
  373. if (!this.isStopped) {
  374. this.isStopped = true;
  375. this._error(err);
  376. }
  377. };
  378. Subscriber.prototype.complete = function () {
  379. if (!this.isStopped) {
  380. this.isStopped = true;
  381. this._complete();
  382. }
  383. };
  384. Subscriber.prototype.unsubscribe = function () {
  385. if (this.closed) {
  386. return;
  387. }
  388. this.isStopped = true;
  389. _super.prototype.unsubscribe.call(this);
  390. };
  391. Subscriber.prototype._next = function (value) {
  392. this.destination.next(value);
  393. };
  394. Subscriber.prototype._error = function (err) {
  395. this.destination.error(err);
  396. this.unsubscribe();
  397. };
  398. Subscriber.prototype._complete = function () {
  399. this.destination.complete();
  400. this.unsubscribe();
  401. };
  402. Subscriber.prototype._unsubscribeAndRecycle = function () {
  403. var _a = this, _parent = _a._parent, _parents = _a._parents;
  404. this._parent = null;
  405. this._parents = null;
  406. this.unsubscribe();
  407. this.closed = false;
  408. this.isStopped = false;
  409. this._parent = _parent;
  410. this._parents = _parents;
  411. this._parentSubscription = null;
  412. return this;
  413. };
  414. return Subscriber;
  415. }(__WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */]));
  416. var SafeSubscriber = /*@__PURE__*/ (function (_super) {
  417. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SafeSubscriber, _super);
  418. function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
  419. var _this = _super.call(this) || this;
  420. _this._parentSubscriber = _parentSubscriber;
  421. var next;
  422. var context = _this;
  423. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(observerOrNext)) {
  424. next = observerOrNext;
  425. }
  426. else if (observerOrNext) {
  427. next = observerOrNext.next;
  428. error = observerOrNext.error;
  429. complete = observerOrNext.complete;
  430. if (observerOrNext !== __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]) {
  431. context = Object.create(observerOrNext);
  432. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(context.unsubscribe)) {
  433. _this.add(context.unsubscribe.bind(context));
  434. }
  435. context.unsubscribe = _this.unsubscribe.bind(_this);
  436. }
  437. }
  438. _this._context = context;
  439. _this._next = next;
  440. _this._error = error;
  441. _this._complete = complete;
  442. return _this;
  443. }
  444. SafeSubscriber.prototype.next = function (value) {
  445. if (!this.isStopped && this._next) {
  446. var _parentSubscriber = this._parentSubscriber;
  447. if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
  448. this.__tryOrUnsub(this._next, value);
  449. }
  450. else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
  451. this.unsubscribe();
  452. }
  453. }
  454. };
  455. SafeSubscriber.prototype.error = function (err) {
  456. if (!this.isStopped) {
  457. var _parentSubscriber = this._parentSubscriber;
  458. var useDeprecatedSynchronousErrorHandling = __WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling;
  459. if (this._error) {
  460. if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
  461. this.__tryOrUnsub(this._error, err);
  462. this.unsubscribe();
  463. }
  464. else {
  465. this.__tryOrSetError(_parentSubscriber, this._error, err);
  466. this.unsubscribe();
  467. }
  468. }
  469. else if (!_parentSubscriber.syncErrorThrowable) {
  470. this.unsubscribe();
  471. if (useDeprecatedSynchronousErrorHandling) {
  472. throw err;
  473. }
  474. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
  475. }
  476. else {
  477. if (useDeprecatedSynchronousErrorHandling) {
  478. _parentSubscriber.syncErrorValue = err;
  479. _parentSubscriber.syncErrorThrown = true;
  480. }
  481. else {
  482. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
  483. }
  484. this.unsubscribe();
  485. }
  486. }
  487. };
  488. SafeSubscriber.prototype.complete = function () {
  489. var _this = this;
  490. if (!this.isStopped) {
  491. var _parentSubscriber = this._parentSubscriber;
  492. if (this._complete) {
  493. var wrappedComplete = function () { return _this._complete.call(_this._context); };
  494. if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
  495. this.__tryOrUnsub(wrappedComplete);
  496. this.unsubscribe();
  497. }
  498. else {
  499. this.__tryOrSetError(_parentSubscriber, wrappedComplete);
  500. this.unsubscribe();
  501. }
  502. }
  503. else {
  504. this.unsubscribe();
  505. }
  506. }
  507. };
  508. SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
  509. try {
  510. fn.call(this._context, value);
  511. }
  512. catch (err) {
  513. this.unsubscribe();
  514. if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
  515. throw err;
  516. }
  517. else {
  518. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
  519. }
  520. }
  521. };
  522. SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
  523. if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
  524. throw new Error('bad call');
  525. }
  526. try {
  527. fn.call(this._context, value);
  528. }
  529. catch (err) {
  530. if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
  531. parent.syncErrorValue = err;
  532. parent.syncErrorThrown = true;
  533. return true;
  534. }
  535. else {
  536. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
  537. return true;
  538. }
  539. }
  540. return false;
  541. };
  542. SafeSubscriber.prototype._unsubscribe = function () {
  543. var _parentSubscriber = this._parentSubscriber;
  544. this._context = null;
  545. this._parentSubscriber = null;
  546. _parentSubscriber.unsubscribe();
  547. };
  548. return SafeSubscriber;
  549. }(Subscriber));
  550. //# sourceMappingURL=Subscriber.js.map
  551. /***/ }),
  552. /* 6 */
  553. /***/ (function(module, exports, __webpack_require__) {
  554. "use strict";
  555. Object.defineProperty(exports, "__esModule", {
  556. value: true
  557. });
  558. exports.OneTimePasswordError = exports.ResponseError = exports.ProcessTermError = exports.SecurityError = exports.ProcessSpawnError = exports.MessageError = undefined;
  559. var _create;
  560. function _load_create() {
  561. return _create = _interopRequireDefault(__webpack_require__(210));
  562. }
  563. var _getPrototypeOf;
  564. function _load_getPrototypeOf() {
  565. return _getPrototypeOf = _interopRequireDefault(__webpack_require__(550));
  566. }
  567. var _setPrototypeOf;
  568. function _load_setPrototypeOf() {
  569. return _setPrototypeOf = _interopRequireDefault(__webpack_require__(211));
  570. }
  571. var _from;
  572. function _load_from() {
  573. return _from = _interopRequireDefault(__webpack_require__(53));
  574. }
  575. var _construct;
  576. function _load_construct() {
  577. return _construct = _interopRequireDefault(__webpack_require__(552));
  578. }
  579. var _classCallCheck2;
  580. function _load_classCallCheck() {
  581. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  582. }
  583. var _possibleConstructorReturn2;
  584. function _load_possibleConstructorReturn() {
  585. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  586. }
  587. var _inherits2;
  588. function _load_inherits() {
  589. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  590. }
  591. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  592. function _extendableBuiltin5(cls) {
  593. function ExtendableBuiltin() {
  594. var instance = (0, (_construct || _load_construct()).default)(cls, (0, (_from || _load_from()).default)(arguments));
  595. (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(instance, (0, (_getPrototypeOf || _load_getPrototypeOf()).default)(this));
  596. return instance;
  597. }
  598. ExtendableBuiltin.prototype = (0, (_create || _load_create()).default)(cls.prototype, {
  599. constructor: {
  600. value: cls,
  601. enumerable: false,
  602. writable: true,
  603. configurable: true
  604. }
  605. });
  606. if ((_setPrototypeOf || _load_setPrototypeOf()).default) {
  607. (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(ExtendableBuiltin, cls);
  608. } else {
  609. ExtendableBuiltin.__proto__ = cls;
  610. }
  611. return ExtendableBuiltin;
  612. }
  613. function _extendableBuiltin3(cls) {
  614. function ExtendableBuiltin() {
  615. var instance = (0, (_construct || _load_construct()).default)(cls, (0, (_from || _load_from()).default)(arguments));
  616. (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(instance, (0, (_getPrototypeOf || _load_getPrototypeOf()).default)(this));
  617. return instance;
  618. }
  619. ExtendableBuiltin.prototype = (0, (_create || _load_create()).default)(cls.prototype, {
  620. constructor: {
  621. value: cls,
  622. enumerable: false,
  623. writable: true,
  624. configurable: true
  625. }
  626. });
  627. if ((_setPrototypeOf || _load_setPrototypeOf()).default) {
  628. (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(ExtendableBuiltin, cls);
  629. } else {
  630. ExtendableBuiltin.__proto__ = cls;
  631. }
  632. return ExtendableBuiltin;
  633. }
  634. function _extendableBuiltin(cls) {
  635. function ExtendableBuiltin() {
  636. var instance = (0, (_construct || _load_construct()).default)(cls, (0, (_from || _load_from()).default)(arguments));
  637. (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(instance, (0, (_getPrototypeOf || _load_getPrototypeOf()).default)(this));
  638. return instance;
  639. }
  640. ExtendableBuiltin.prototype = (0, (_create || _load_create()).default)(cls.prototype, {
  641. constructor: {
  642. value: cls,
  643. enumerable: false,
  644. writable: true,
  645. configurable: true
  646. }
  647. });
  648. if ((_setPrototypeOf || _load_setPrototypeOf()).default) {
  649. (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(ExtendableBuiltin, cls);
  650. } else {
  651. ExtendableBuiltin.__proto__ = cls;
  652. }
  653. return ExtendableBuiltin;
  654. }
  655. var MessageError = exports.MessageError = function (_extendableBuiltin2) {
  656. (0, (_inherits2 || _load_inherits()).default)(MessageError, _extendableBuiltin2);
  657. function MessageError(msg, code) {
  658. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, MessageError);
  659. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _extendableBuiltin2.call(this, msg));
  660. _this.code = code;
  661. return _this;
  662. }
  663. return MessageError;
  664. }(_extendableBuiltin(Error));
  665. var ProcessSpawnError = exports.ProcessSpawnError = function (_MessageError) {
  666. (0, (_inherits2 || _load_inherits()).default)(ProcessSpawnError, _MessageError);
  667. function ProcessSpawnError(msg, code, process) {
  668. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ProcessSpawnError);
  669. var _this2 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError.call(this, msg, code));
  670. _this2.process = process;
  671. return _this2;
  672. }
  673. return ProcessSpawnError;
  674. }(MessageError);
  675. var SecurityError = exports.SecurityError = function (_MessageError2) {
  676. (0, (_inherits2 || _load_inherits()).default)(SecurityError, _MessageError2);
  677. function SecurityError() {
  678. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, SecurityError);
  679. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError2.apply(this, arguments));
  680. }
  681. return SecurityError;
  682. }(MessageError);
  683. var ProcessTermError = exports.ProcessTermError = function (_MessageError3) {
  684. (0, (_inherits2 || _load_inherits()).default)(ProcessTermError, _MessageError3);
  685. function ProcessTermError() {
  686. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ProcessTermError);
  687. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError3.apply(this, arguments));
  688. }
  689. return ProcessTermError;
  690. }(MessageError);
  691. var ResponseError = exports.ResponseError = function (_extendableBuiltin4) {
  692. (0, (_inherits2 || _load_inherits()).default)(ResponseError, _extendableBuiltin4);
  693. function ResponseError(msg, responseCode) {
  694. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ResponseError);
  695. var _this5 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _extendableBuiltin4.call(this, msg));
  696. _this5.responseCode = responseCode;
  697. return _this5;
  698. }
  699. return ResponseError;
  700. }(_extendableBuiltin3(Error));
  701. var OneTimePasswordError = exports.OneTimePasswordError = function (_extendableBuiltin6) {
  702. (0, (_inherits2 || _load_inherits()).default)(OneTimePasswordError, _extendableBuiltin6);
  703. function OneTimePasswordError(notice) {
  704. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, OneTimePasswordError);
  705. var _this6 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _extendableBuiltin6.call(this));
  706. _this6.notice = notice;
  707. return _this6;
  708. }
  709. return OneTimePasswordError;
  710. }(_extendableBuiltin5(Error));
  711. /***/ }),
  712. /* 7 */
  713. /***/ (function(module, exports, __webpack_require__) {
  714. module.exports = { "default": __webpack_require__(600), __esModule: true };
  715. /***/ }),
  716. /* 8 */
  717. /***/ (function(module, exports, __webpack_require__) {
  718. "use strict";
  719. Object.defineProperty(exports, "__esModule", {
  720. value: true
  721. });
  722. exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.unlink = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.open = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined;
  723. var _map;
  724. function _load_map() {
  725. return _map = _interopRequireDefault(__webpack_require__(42));
  726. }
  727. var _getIterator2;
  728. function _load_getIterator() {
  729. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  730. }
  731. var _promise;
  732. function _load_promise() {
  733. return _promise = _interopRequireDefault(__webpack_require__(7));
  734. }
  735. var _set;
  736. function _load_set() {
  737. return _set = _interopRequireDefault(__webpack_require__(16));
  738. }
  739. var _asyncToGenerator2;
  740. function _load_asyncToGenerator() {
  741. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  742. }
  743. var buildActionsForCopy = function () {
  744. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) {
  745. //
  746. var build = function () {
  747. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
  748. var src = data.src,
  749. dest = data.dest,
  750. type = data.type;
  751. var onFresh = data.onFresh || noop;
  752. var onDone = data.onDone || noop;
  753. // TODO https://github.com/yarnpkg/yarn/issues/3751
  754. // related to bundled dependencies handling
  755. if (files.has(dest.toLowerCase())) {
  756. reporter.verbose(`The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy`);
  757. } else {
  758. files.add(dest.toLowerCase());
  759. }
  760. if (type === 'symlink') {
  761. yield mkdirp((_path2 || _load_path()).default.dirname(dest));
  762. onFresh();
  763. actions.symlink.push({
  764. dest,
  765. linkname: src
  766. });
  767. onDone();
  768. return;
  769. }
  770. if (events.ignoreBasenames.indexOf((_path2 || _load_path()).default.basename(src)) >= 0) {
  771. // ignored file
  772. return;
  773. }
  774. var srcStat = yield lstat(src);
  775. var srcFiles = void 0;
  776. if (srcStat.isDirectory()) {
  777. srcFiles = yield readdir(src);
  778. }
  779. var destStat = void 0;
  780. try {
  781. // try accessing the destination
  782. destStat = yield lstat(dest);
  783. } catch (e) {
  784. // proceed if destination doesn't exist, otherwise error
  785. if (e.code !== 'ENOENT') {
  786. throw e;
  787. }
  788. }
  789. // if destination exists
  790. if (destStat) {
  791. var bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink();
  792. var bothFolders = srcStat.isDirectory() && destStat.isDirectory();
  793. var bothFiles = srcStat.isFile() && destStat.isFile();
  794. // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving
  795. // us modes that aren't valid. investigate this, it's generally safe to proceed.
  796. /* if (srcStat.mode !== destStat.mode) {
  797. try {
  798. await access(dest, srcStat.mode);
  799. } catch (err) {}
  800. } */
  801. if (bothFiles && artifactFiles.has(dest)) {
  802. // this file gets changed during build, likely by a custom install script. Don't bother checking it.
  803. onDone();
  804. reporter.verbose(reporter.lang('verboseFileSkipArtifact', src));
  805. return;
  806. }
  807. if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) {
  808. // we can safely assume this is the same file
  809. onDone();
  810. reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.size, +srcStat.mtime));
  811. return;
  812. }
  813. if (bothSymlinks) {
  814. var srcReallink = yield readlink(src);
  815. if (srcReallink === (yield readlink(dest))) {
  816. // if both symlinks are the same then we can continue on
  817. onDone();
  818. reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink));
  819. return;
  820. }
  821. }
  822. if (bothFolders) {
  823. // mark files that aren't in this folder as possibly extraneous
  824. var destFiles = yield readdir(dest);
  825. invariant(srcFiles, 'src files not initialised');
  826. for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  827. var _ref6;
  828. if (_isArray4) {
  829. if (_i4 >= _iterator4.length) break;
  830. _ref6 = _iterator4[_i4++];
  831. } else {
  832. _i4 = _iterator4.next();
  833. if (_i4.done) break;
  834. _ref6 = _i4.value;
  835. }
  836. var _file2 = _ref6;
  837. if (srcFiles.indexOf(_file2) < 0) {
  838. var _loc = (_path2 || _load_path()).default.join(dest, _file2);
  839. possibleExtraneous.add(_loc);
  840. if ((yield lstat(_loc)).isDirectory()) {
  841. for (var _iterator5 = yield readdir(_loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  842. var _ref7;
  843. if (_isArray5) {
  844. if (_i5 >= _iterator5.length) break;
  845. _ref7 = _iterator5[_i5++];
  846. } else {
  847. _i5 = _iterator5.next();
  848. if (_i5.done) break;
  849. _ref7 = _i5.value;
  850. }
  851. var _file3 = _ref7;
  852. possibleExtraneous.add((_path2 || _load_path()).default.join(_loc, _file3));
  853. }
  854. }
  855. }
  856. }
  857. }
  858. }
  859. if (destStat && destStat.isSymbolicLink()) {
  860. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest);
  861. destStat = null;
  862. }
  863. if (srcStat.isSymbolicLink()) {
  864. onFresh();
  865. var _linkname = yield readlink(src);
  866. actions.symlink.push({
  867. dest,
  868. linkname: _linkname
  869. });
  870. onDone();
  871. } else if (srcStat.isDirectory()) {
  872. yield* function* () {
  873. if (!destStat) {
  874. reporter.verbose(reporter.lang('verboseFileFolder', dest));
  875. yield mkdirp(dest);
  876. }
  877. var destParts = dest.split((_path2 || _load_path()).default.sep);
  878. while (destParts.length) {
  879. files.add(destParts.join((_path2 || _load_path()).default.sep).toLowerCase());
  880. destParts.pop();
  881. }
  882. // push all files to queue
  883. invariant(srcFiles, 'src files not initialised');
  884. var remaining = srcFiles.length;
  885. if (!remaining) {
  886. onDone();
  887. }
  888. for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  889. var _ref8;
  890. if (_isArray6) {
  891. if (_i6 >= _iterator6.length) break;
  892. _ref8 = _iterator6[_i6++];
  893. } else {
  894. _i6 = _iterator6.next();
  895. if (_i6.done) break;
  896. _ref8 = _i6.value;
  897. }
  898. var _file4 = _ref8;
  899. queue.push({
  900. dest: (_path2 || _load_path()).default.join(dest, _file4),
  901. onFresh,
  902. onDone: function (_onDone) {
  903. function onDone() {
  904. return _onDone.apply(this, arguments);
  905. }
  906. onDone.toString = function () {
  907. return _onDone.toString();
  908. };
  909. return onDone;
  910. }(function () {
  911. if (--remaining === 0) {
  912. onDone();
  913. }
  914. }),
  915. src: (_path2 || _load_path()).default.join(src, _file4)
  916. });
  917. }
  918. }();
  919. } else if (srcStat.isFile()) {
  920. onFresh();
  921. actions.file.push({
  922. src,
  923. dest,
  924. atime: srcStat.atime,
  925. mtime: srcStat.mtime,
  926. mode: srcStat.mode
  927. });
  928. onDone();
  929. } else {
  930. throw new Error(`unsure how to copy this: ${src}`);
  931. }
  932. });
  933. return function build(_x5) {
  934. return _ref5.apply(this, arguments);
  935. };
  936. }();
  937. var artifactFiles = new (_set || _load_set()).default(events.artifactFiles || []);
  938. var files = new (_set || _load_set()).default();
  939. // initialise events
  940. var _loop = function _loop(item) {
  941. var onDone = item.onDone;
  942. item.onDone = function () {
  943. events.onProgress(item.dest);
  944. if (onDone) {
  945. onDone();
  946. }
  947. };
  948. };
  949. for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  950. var _ref2;
  951. if (_isArray) {
  952. if (_i >= _iterator.length) break;
  953. _ref2 = _iterator[_i++];
  954. } else {
  955. _i = _iterator.next();
  956. if (_i.done) break;
  957. _ref2 = _i.value;
  958. }
  959. var item = _ref2;
  960. _loop(item);
  961. }
  962. events.onStart(queue.length);
  963. // start building actions
  964. var actions = {
  965. file: [],
  966. symlink: [],
  967. link: []
  968. };
  969. // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items
  970. // at a time due to the requirement to push items onto the queue
  971. while (queue.length) {
  972. var items = queue.splice(0, CONCURRENT_QUEUE_ITEMS);
  973. yield (_promise || _load_promise()).default.all(items.map(build));
  974. }
  975. // simulate the existence of some files to prevent considering them extraneous
  976. for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  977. var _ref3;
  978. if (_isArray2) {
  979. if (_i2 >= _iterator2.length) break;
  980. _ref3 = _iterator2[_i2++];
  981. } else {
  982. _i2 = _iterator2.next();
  983. if (_i2.done) break;
  984. _ref3 = _i2.value;
  985. }
  986. var _file = _ref3;
  987. if (possibleExtraneous.has(_file)) {
  988. reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', _file));
  989. possibleExtraneous.delete(_file);
  990. }
  991. }
  992. for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  993. var _ref4;
  994. if (_isArray3) {
  995. if (_i3 >= _iterator3.length) break;
  996. _ref4 = _iterator3[_i3++];
  997. } else {
  998. _i3 = _iterator3.next();
  999. if (_i3.done) break;
  1000. _ref4 = _i3.value;
  1001. }
  1002. var loc = _ref4;
  1003. if (files.has(loc.toLowerCase())) {
  1004. possibleExtraneous.delete(loc);
  1005. }
  1006. }
  1007. return actions;
  1008. });
  1009. return function buildActionsForCopy(_x, _x2, _x3, _x4) {
  1010. return _ref.apply(this, arguments);
  1011. };
  1012. }();
  1013. var buildActionsForHardlink = function () {
  1014. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) {
  1015. //
  1016. var build = function () {
  1017. var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
  1018. var src = data.src,
  1019. dest = data.dest;
  1020. var onFresh = data.onFresh || noop;
  1021. var onDone = data.onDone || noop;
  1022. if (files.has(dest.toLowerCase())) {
  1023. // Fixes issue https://github.com/yarnpkg/yarn/issues/2734
  1024. // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1,
  1025. // package-linker passes that modules A1 and B1 need to be hardlinked,
  1026. // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case
  1027. // an exception.
  1028. onDone();
  1029. return;
  1030. }
  1031. files.add(dest.toLowerCase());
  1032. if (events.ignoreBasenames.indexOf((_path2 || _load_path()).default.basename(src)) >= 0) {
  1033. // ignored file
  1034. return;
  1035. }
  1036. var srcStat = yield lstat(src);
  1037. var srcFiles = void 0;
  1038. if (srcStat.isDirectory()) {
  1039. srcFiles = yield readdir(src);
  1040. }
  1041. var destExists = yield exists(dest);
  1042. if (destExists) {
  1043. var destStat = yield lstat(dest);
  1044. var bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink();
  1045. var bothFolders = srcStat.isDirectory() && destStat.isDirectory();
  1046. var bothFiles = srcStat.isFile() && destStat.isFile();
  1047. if (srcStat.mode !== destStat.mode) {
  1048. try {
  1049. yield access(dest, srcStat.mode);
  1050. } catch (err) {
  1051. // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving
  1052. // us modes that aren't valid. investigate this, it's generally safe to proceed.
  1053. reporter.verbose(err);
  1054. }
  1055. }
  1056. if (bothFiles && artifactFiles.has(dest)) {
  1057. // this file gets changed during build, likely by a custom install script. Don't bother checking it.
  1058. onDone();
  1059. reporter.verbose(reporter.lang('verboseFileSkipArtifact', src));
  1060. return;
  1061. }
  1062. // correct hardlink
  1063. if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) {
  1064. onDone();
  1065. reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.ino));
  1066. return;
  1067. }
  1068. if (bothSymlinks) {
  1069. var srcReallink = yield readlink(src);
  1070. if (srcReallink === (yield readlink(dest))) {
  1071. // if both symlinks are the same then we can continue on
  1072. onDone();
  1073. reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink));
  1074. return;
  1075. }
  1076. }
  1077. if (bothFolders) {
  1078. // mark files that aren't in this folder as possibly extraneous
  1079. var destFiles = yield readdir(dest);
  1080. invariant(srcFiles, 'src files not initialised');
  1081. for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
  1082. var _ref14;
  1083. if (_isArray10) {
  1084. if (_i10 >= _iterator10.length) break;
  1085. _ref14 = _iterator10[_i10++];
  1086. } else {
  1087. _i10 = _iterator10.next();
  1088. if (_i10.done) break;
  1089. _ref14 = _i10.value;
  1090. }
  1091. var _file6 = _ref14;
  1092. if (srcFiles.indexOf(_file6) < 0) {
  1093. var _loc2 = (_path2 || _load_path()).default.join(dest, _file6);
  1094. possibleExtraneous.add(_loc2);
  1095. if ((yield lstat(_loc2)).isDirectory()) {
  1096. for (var _iterator11 = yield readdir(_loc2), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
  1097. var _ref15;
  1098. if (_isArray11) {
  1099. if (_i11 >= _iterator11.length) break;
  1100. _ref15 = _iterator11[_i11++];
  1101. } else {
  1102. _i11 = _iterator11.next();
  1103. if (_i11.done) break;
  1104. _ref15 = _i11.value;
  1105. }
  1106. var _file7 = _ref15;
  1107. possibleExtraneous.add((_path2 || _load_path()).default.join(_loc2, _file7));
  1108. }
  1109. }
  1110. }
  1111. }
  1112. }
  1113. }
  1114. if (srcStat.isSymbolicLink()) {
  1115. onFresh();
  1116. var _linkname2 = yield readlink(src);
  1117. actions.symlink.push({
  1118. dest,
  1119. linkname: _linkname2
  1120. });
  1121. onDone();
  1122. } else if (srcStat.isDirectory()) {
  1123. yield* function* () {
  1124. reporter.verbose(reporter.lang('verboseFileFolder', dest));
  1125. yield mkdirp(dest);
  1126. var destParts = dest.split((_path2 || _load_path()).default.sep);
  1127. while (destParts.length) {
  1128. files.add(destParts.join((_path2 || _load_path()).default.sep).toLowerCase());
  1129. destParts.pop();
  1130. }
  1131. // push all files to queue
  1132. invariant(srcFiles, 'src files not initialised');
  1133. var remaining = srcFiles.length;
  1134. if (!remaining) {
  1135. onDone();
  1136. }
  1137. for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
  1138. var _ref16;
  1139. if (_isArray12) {
  1140. if (_i12 >= _iterator12.length) break;
  1141. _ref16 = _iterator12[_i12++];
  1142. } else {
  1143. _i12 = _iterator12.next();
  1144. if (_i12.done) break;
  1145. _ref16 = _i12.value;
  1146. }
  1147. var _file8 = _ref16;
  1148. queue.push({
  1149. onFresh,
  1150. src: (_path2 || _load_path()).default.join(src, _file8),
  1151. dest: (_path2 || _load_path()).default.join(dest, _file8),
  1152. onDone: function (_onDone2) {
  1153. function onDone() {
  1154. return _onDone2.apply(this, arguments);
  1155. }
  1156. onDone.toString = function () {
  1157. return _onDone2.toString();
  1158. };
  1159. return onDone;
  1160. }(function () {
  1161. if (--remaining === 0) {
  1162. onDone();
  1163. }
  1164. })
  1165. });
  1166. }
  1167. }();
  1168. } else if (srcStat.isFile()) {
  1169. onFresh();
  1170. actions.link.push({
  1171. src,
  1172. dest,
  1173. removeDest: destExists
  1174. });
  1175. onDone();
  1176. } else {
  1177. throw new Error(`unsure how to copy this: ${src}`);
  1178. }
  1179. });
  1180. return function build(_x10) {
  1181. return _ref13.apply(this, arguments);
  1182. };
  1183. }();
  1184. var artifactFiles = new (_set || _load_set()).default(events.artifactFiles || []);
  1185. var files = new (_set || _load_set()).default();
  1186. // initialise events
  1187. var _loop2 = function _loop2(item) {
  1188. var onDone = item.onDone || noop;
  1189. item.onDone = function () {
  1190. events.onProgress(item.dest);
  1191. onDone();
  1192. };
  1193. };
  1194. for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  1195. var _ref10;
  1196. if (_isArray7) {
  1197. if (_i7 >= _iterator7.length) break;
  1198. _ref10 = _iterator7[_i7++];
  1199. } else {
  1200. _i7 = _iterator7.next();
  1201. if (_i7.done) break;
  1202. _ref10 = _i7.value;
  1203. }
  1204. var item = _ref10;
  1205. _loop2(item);
  1206. }
  1207. events.onStart(queue.length);
  1208. // start building actions
  1209. var actions = {
  1210. file: [],
  1211. symlink: [],
  1212. link: []
  1213. };
  1214. // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items
  1215. // at a time due to the requirement to push items onto the queue
  1216. while (queue.length) {
  1217. var items = queue.splice(0, CONCURRENT_QUEUE_ITEMS);
  1218. yield (_promise || _load_promise()).default.all(items.map(build));
  1219. }
  1220. // simulate the existence of some files to prevent considering them extraneous
  1221. for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
  1222. var _ref11;
  1223. if (_isArray8) {
  1224. if (_i8 >= _iterator8.length) break;
  1225. _ref11 = _iterator8[_i8++];
  1226. } else {
  1227. _i8 = _iterator8.next();
  1228. if (_i8.done) break;
  1229. _ref11 = _i8.value;
  1230. }
  1231. var _file5 = _ref11;
  1232. if (possibleExtraneous.has(_file5)) {
  1233. reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', _file5));
  1234. possibleExtraneous.delete(_file5);
  1235. }
  1236. }
  1237. for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
  1238. var _ref12;
  1239. if (_isArray9) {
  1240. if (_i9 >= _iterator9.length) break;
  1241. _ref12 = _iterator9[_i9++];
  1242. } else {
  1243. _i9 = _iterator9.next();
  1244. if (_i9.done) break;
  1245. _ref12 = _i9.value;
  1246. }
  1247. var loc = _ref12;
  1248. if (files.has(loc.toLowerCase())) {
  1249. possibleExtraneous.delete(loc);
  1250. }
  1251. }
  1252. return actions;
  1253. });
  1254. return function buildActionsForHardlink(_x6, _x7, _x8, _x9) {
  1255. return _ref9.apply(this, arguments);
  1256. };
  1257. }();
  1258. var copyBulk = exports.copyBulk = function () {
  1259. var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) {
  1260. var events = {
  1261. onStart: _events && _events.onStart || noop,
  1262. onProgress: _events && _events.onProgress || noop,
  1263. possibleExtraneous: _events ? _events.possibleExtraneous : new (_set || _load_set()).default(),
  1264. ignoreBasenames: _events && _events.ignoreBasenames || [],
  1265. artifactFiles: _events && _events.artifactFiles || []
  1266. };
  1267. var actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter);
  1268. events.onStart(actions.file.length + actions.symlink.length + actions.link.length);
  1269. var fileActions = actions.file;
  1270. var currentlyWriting = new (_map || _load_map()).default();
  1271. yield (_promise2 || _load_promise2()).queue(fileActions, function () {
  1272. var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
  1273. var writePromise = void 0;
  1274. while (writePromise = currentlyWriting.get(data.dest)) {
  1275. yield writePromise;
  1276. }
  1277. reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest));
  1278. var copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function () {
  1279. return currentlyWriting.delete(data.dest);
  1280. });
  1281. currentlyWriting.set(data.dest, copier);
  1282. events.onProgress(data.dest);
  1283. return copier;
  1284. });
  1285. return function (_x14) {
  1286. return _ref18.apply(this, arguments);
  1287. };
  1288. }(), CONCURRENT_QUEUE_ITEMS);
  1289. // we need to copy symlinks last as they could reference files we were copying
  1290. var symlinkActions = actions.symlink;
  1291. yield (_promise2 || _load_promise2()).queue(symlinkActions, function (data) {
  1292. var linkname = (_path2 || _load_path()).default.resolve((_path2 || _load_path()).default.dirname(data.dest), data.linkname);
  1293. reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname));
  1294. return symlink(linkname, data.dest);
  1295. });
  1296. });
  1297. return function copyBulk(_x11, _x12, _x13) {
  1298. return _ref17.apply(this, arguments);
  1299. };
  1300. }();
  1301. var hardlinkBulk = exports.hardlinkBulk = function () {
  1302. var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) {
  1303. var events = {
  1304. onStart: _events && _events.onStart || noop,
  1305. onProgress: _events && _events.onProgress || noop,
  1306. possibleExtraneous: _events ? _events.possibleExtraneous : new (_set || _load_set()).default(),
  1307. artifactFiles: _events && _events.artifactFiles || [],
  1308. ignoreBasenames: []
  1309. };
  1310. var actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter);
  1311. events.onStart(actions.file.length + actions.symlink.length + actions.link.length);
  1312. var fileActions = actions.link;
  1313. yield (_promise2 || _load_promise2()).queue(fileActions, function () {
  1314. var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
  1315. reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest));
  1316. if (data.removeDest) {
  1317. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest);
  1318. }
  1319. yield link(data.src, data.dest);
  1320. });
  1321. return function (_x18) {
  1322. return _ref20.apply(this, arguments);
  1323. };
  1324. }(), CONCURRENT_QUEUE_ITEMS);
  1325. // we need to copy symlinks last as they could reference files we were copying
  1326. var symlinkActions = actions.symlink;
  1327. yield (_promise2 || _load_promise2()).queue(symlinkActions, function (data) {
  1328. var linkname = (_path2 || _load_path()).default.resolve((_path2 || _load_path()).default.dirname(data.dest), data.linkname);
  1329. reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname));
  1330. return symlink(linkname, data.dest);
  1331. });
  1332. });
  1333. return function hardlinkBulk(_x15, _x16, _x17) {
  1334. return _ref19.apply(this, arguments);
  1335. };
  1336. }();
  1337. var readFileAny = exports.readFileAny = function () {
  1338. var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) {
  1339. for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) {
  1340. var _ref22;
  1341. if (_isArray13) {
  1342. if (_i13 >= _iterator13.length) break;
  1343. _ref22 = _iterator13[_i13++];
  1344. } else {
  1345. _i13 = _iterator13.next();
  1346. if (_i13.done) break;
  1347. _ref22 = _i13.value;
  1348. }
  1349. var _file9 = _ref22;
  1350. if (yield exists(_file9)) {
  1351. return readFile(_file9);
  1352. }
  1353. }
  1354. return null;
  1355. });
  1356. return function readFileAny(_x19) {
  1357. return _ref21.apply(this, arguments);
  1358. };
  1359. }();
  1360. var readJson = exports.readJson = function () {
  1361. var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
  1362. return (yield readJsonAndFile(loc)).object;
  1363. });
  1364. return function readJson(_x20) {
  1365. return _ref23.apply(this, arguments);
  1366. };
  1367. }();
  1368. var readJsonAndFile = exports.readJsonAndFile = function () {
  1369. var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
  1370. var file = yield readFile(loc);
  1371. try {
  1372. return {
  1373. object: (0, (_map2 || _load_map2()).default)(JSON.parse(stripBOM(file))),
  1374. content: file
  1375. };
  1376. } catch (err) {
  1377. err.message = `${loc}: ${err.message}`;
  1378. throw err;
  1379. }
  1380. });
  1381. return function readJsonAndFile(_x21) {
  1382. return _ref24.apply(this, arguments);
  1383. };
  1384. }();
  1385. var find = exports.find = function () {
  1386. var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) {
  1387. var parts = dir.split((_path2 || _load_path()).default.sep);
  1388. while (parts.length) {
  1389. var loc = parts.concat(filename).join((_path2 || _load_path()).default.sep);
  1390. if (yield exists(loc)) {
  1391. return loc;
  1392. } else {
  1393. parts.pop();
  1394. }
  1395. }
  1396. return false;
  1397. });
  1398. return function find(_x22, _x23) {
  1399. return _ref25.apply(this, arguments);
  1400. };
  1401. }();
  1402. var symlink = exports.symlink = function () {
  1403. var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) {
  1404. if (process.platform !== 'win32') {
  1405. // use relative paths otherwise which will be retained if the directory is moved
  1406. src = (_path2 || _load_path()).default.relative((_path2 || _load_path()).default.dirname(dest), src);
  1407. // When path.relative returns an empty string for the current directory, we should instead use
  1408. // '.', which is a valid fs.symlink target.
  1409. src = src || '.';
  1410. }
  1411. try {
  1412. var stats = yield lstat(dest);
  1413. if (stats.isSymbolicLink()) {
  1414. var resolved = dest;
  1415. if (resolved === src) {
  1416. return;
  1417. }
  1418. }
  1419. } catch (err) {
  1420. if (err.code !== 'ENOENT') {
  1421. throw err;
  1422. }
  1423. }
  1424. // We use rimraf for unlink which never throws an ENOENT on missing target
  1425. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest);
  1426. if (process.platform === 'win32') {
  1427. // use directory junctions if possible on win32, this requires absolute paths
  1428. yield fsSymlink(src, dest, 'junction');
  1429. } else {
  1430. yield fsSymlink(src, dest);
  1431. }
  1432. });
  1433. return function symlink(_x24, _x25) {
  1434. return _ref26.apply(this, arguments);
  1435. };
  1436. }();
  1437. var walk = exports.walk = function () {
  1438. var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir) {
  1439. var ignoreBasenames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default();
  1440. var files = [];
  1441. var filenames = yield readdir(dir);
  1442. if (ignoreBasenames.size) {
  1443. filenames = filenames.filter(function (name) {
  1444. return !ignoreBasenames.has(name);
  1445. });
  1446. }
  1447. for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) {
  1448. var _ref28;
  1449. if (_isArray14) {
  1450. if (_i14 >= _iterator14.length) break;
  1451. _ref28 = _iterator14[_i14++];
  1452. } else {
  1453. _i14 = _iterator14.next();
  1454. if (_i14.done) break;
  1455. _ref28 = _i14.value;
  1456. }
  1457. var name = _ref28;
  1458. var _relative = relativeDir ? (_path2 || _load_path()).default.join(relativeDir, name) : name;
  1459. var loc = (_path2 || _load_path()).default.join(dir, name);
  1460. var _stat = yield lstat(loc);
  1461. files.push({
  1462. relative: _relative,
  1463. basename: name,
  1464. absolute: loc,
  1465. mtime: +_stat.mtime
  1466. });
  1467. if (_stat.isDirectory()) {
  1468. files = files.concat((yield walk(loc, _relative, ignoreBasenames)));
  1469. }
  1470. }
  1471. return files;
  1472. });
  1473. return function walk(_x26, _x27) {
  1474. return _ref27.apply(this, arguments);
  1475. };
  1476. }();
  1477. var getFileSizeOnDisk = exports.getFileSizeOnDisk = function () {
  1478. var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
  1479. var stat = yield lstat(loc);
  1480. var size = stat.size,
  1481. blockSize = stat.blksize;
  1482. return Math.ceil(size / blockSize) * blockSize;
  1483. });
  1484. return function getFileSizeOnDisk(_x29) {
  1485. return _ref29.apply(this, arguments);
  1486. };
  1487. }();
  1488. var getEolFromFile = function () {
  1489. var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) {
  1490. if (!(yield exists(path))) {
  1491. return undefined;
  1492. }
  1493. var buffer = yield readFileBuffer(path);
  1494. for (var i = 0; i < buffer.length; ++i) {
  1495. if (buffer[i] === cr) {
  1496. return '\r\n';
  1497. }
  1498. if (buffer[i] === lf) {
  1499. return '\n';
  1500. }
  1501. }
  1502. return undefined;
  1503. });
  1504. return function getEolFromFile(_x30) {
  1505. return _ref30.apply(this, arguments);
  1506. };
  1507. }();
  1508. var writeFilePreservingEol = exports.writeFilePreservingEol = function () {
  1509. var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) {
  1510. var eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL;
  1511. if (eol !== '\n') {
  1512. data = data.replace(/\n/g, eol);
  1513. }
  1514. yield writeFile(path, data);
  1515. });
  1516. return function writeFilePreservingEol(_x31, _x32) {
  1517. return _ref31.apply(this, arguments);
  1518. };
  1519. }();
  1520. var hardlinksWork = exports.hardlinksWork = function () {
  1521. var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) {
  1522. var filename = 'test-file' + Math.random();
  1523. var file = (_path2 || _load_path()).default.join(dir, filename);
  1524. var fileLink = (_path2 || _load_path()).default.join(dir, filename + '-link');
  1525. try {
  1526. yield writeFile(file, 'test');
  1527. yield link(file, fileLink);
  1528. } catch (err) {
  1529. return false;
  1530. } finally {
  1531. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file);
  1532. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink);
  1533. }
  1534. return true;
  1535. });
  1536. return function hardlinksWork(_x33) {
  1537. return _ref32.apply(this, arguments);
  1538. };
  1539. }();
  1540. // not a strict polyfill for Node's fs.mkdtemp
  1541. var makeTempDir = exports.makeTempDir = function () {
  1542. var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) {
  1543. var dir = (_path2 || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`);
  1544. yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir);
  1545. yield mkdirp(dir);
  1546. return dir;
  1547. });
  1548. return function makeTempDir(_x34) {
  1549. return _ref33.apply(this, arguments);
  1550. };
  1551. }();
  1552. var readFirstAvailableStream = exports.readFirstAvailableStream = function () {
  1553. var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) {
  1554. for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) {
  1555. var _ref35;
  1556. if (_isArray15) {
  1557. if (_i15 >= _iterator15.length) break;
  1558. _ref35 = _iterator15[_i15++];
  1559. } else {
  1560. _i15 = _iterator15.next();
  1561. if (_i15.done) break;
  1562. _ref35 = _i15.value;
  1563. }
  1564. var _path = _ref35;
  1565. try {
  1566. var fd = yield open(_path, 'r');
  1567. return (_fs || _load_fs()).default.createReadStream(_path, { fd });
  1568. } catch (err) {
  1569. // Try the next one
  1570. }
  1571. }
  1572. return null;
  1573. });
  1574. return function readFirstAvailableStream(_x35) {
  1575. return _ref34.apply(this, arguments);
  1576. };
  1577. }();
  1578. var getFirstSuitableFolder = exports.getFirstSuitableFolder = function () {
  1579. var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) {
  1580. var mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : constants.W_OK | constants.X_OK;
  1581. var result = {
  1582. skipped: [],
  1583. folder: null
  1584. };
  1585. for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) {
  1586. var _ref37;
  1587. if (_isArray16) {
  1588. if (_i16 >= _iterator16.length) break;
  1589. _ref37 = _iterator16[_i16++];
  1590. } else {
  1591. _i16 = _iterator16.next();
  1592. if (_i16.done) break;
  1593. _ref37 = _i16.value;
  1594. }
  1595. var _folder = _ref37;
  1596. try {
  1597. yield mkdirp(_folder);
  1598. yield access(_folder, mode);
  1599. result.folder = _folder;
  1600. return result;
  1601. } catch (error) {
  1602. result.skipped.push({
  1603. error,
  1604. folder: _folder
  1605. });
  1606. }
  1607. }
  1608. return result;
  1609. });
  1610. return function getFirstSuitableFolder(_x36) {
  1611. return _ref36.apply(this, arguments);
  1612. };
  1613. }();
  1614. exports.copy = copy;
  1615. exports.readFile = readFile;
  1616. exports.readFileRaw = readFileRaw;
  1617. exports.normalizeOS = normalizeOS;
  1618. var _fs;
  1619. function _load_fs() {
  1620. return _fs = _interopRequireDefault(__webpack_require__(12));
  1621. }
  1622. var _glob;
  1623. function _load_glob() {
  1624. return _glob = _interopRequireDefault(__webpack_require__(234));
  1625. }
  1626. var _os;
  1627. function _load_os() {
  1628. return _os = _interopRequireDefault(__webpack_require__(66));
  1629. }
  1630. var _path2;
  1631. function _load_path() {
  1632. return _path2 = _interopRequireDefault(__webpack_require__(1));
  1633. }
  1634. var _blockingQueue;
  1635. function _load_blockingQueue() {
  1636. return _blockingQueue = _interopRequireDefault(__webpack_require__(157));
  1637. }
  1638. var _promise2;
  1639. function _load_promise2() {
  1640. return _promise2 = _interopRequireWildcard(__webpack_require__(86));
  1641. }
  1642. var _promise3;
  1643. function _load_promise3() {
  1644. return _promise3 = __webpack_require__(86);
  1645. }
  1646. var _map2;
  1647. function _load_map2() {
  1648. return _map2 = _interopRequireDefault(__webpack_require__(51));
  1649. }
  1650. var _fsNormalized;
  1651. function _load_fsNormalized() {
  1652. return _fsNormalized = __webpack_require__(535);
  1653. }
  1654. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  1655. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1656. var constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : {
  1657. R_OK: (_fs || _load_fs()).default.R_OK,
  1658. W_OK: (_fs || _load_fs()).default.W_OK,
  1659. X_OK: (_fs || _load_fs()).default.X_OK
  1660. };
  1661. var lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock');
  1662. var readFileBuffer = exports.readFileBuffer = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readFile);
  1663. var open = exports.open = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.open);
  1664. var writeFile = exports.writeFile = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.writeFile);
  1665. var readlink = exports.readlink = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readlink);
  1666. var realpath = exports.realpath = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.realpath);
  1667. var readdir = exports.readdir = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readdir);
  1668. var rename = exports.rename = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.rename);
  1669. var access = exports.access = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.access);
  1670. var stat = exports.stat = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.stat);
  1671. var mkdirp = exports.mkdirp = (0, (_promise3 || _load_promise3()).promisify)(__webpack_require__(241));
  1672. var exists = exports.exists = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.exists, true);
  1673. var lstat = exports.lstat = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.lstat);
  1674. var chmod = exports.chmod = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.chmod);
  1675. var link = exports.link = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.link);
  1676. var glob = exports.glob = (0, (_promise3 || _load_promise3()).promisify)((_glob || _load_glob()).default);
  1677. exports.unlink = (_fsNormalized || _load_fsNormalized()).unlink;
  1678. // fs.copyFile uses the native file copying instructions on the system, performing much better
  1679. // than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the
  1680. // concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD.
  1681. var CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4;
  1682. var fsSymlink = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.symlink);
  1683. var invariant = __webpack_require__(15);
  1684. var stripBOM = __webpack_require__(429);
  1685. var noop = function noop() {};
  1686. function copy(src, dest, reporter) {
  1687. return copyBulk([{ src, dest }], reporter);
  1688. }
  1689. function _readFile(loc, encoding) {
  1690. return new (_promise || _load_promise()).default(function (resolve, reject) {
  1691. (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) {
  1692. if (err) {
  1693. reject(err);
  1694. } else {
  1695. resolve(content);
  1696. }
  1697. });
  1698. });
  1699. }
  1700. function readFile(loc) {
  1701. return _readFile(loc, 'utf8').then(normalizeOS);
  1702. }
  1703. function readFileRaw(loc) {
  1704. return _readFile(loc, 'binary');
  1705. }
  1706. function normalizeOS(body) {
  1707. return body.replace(/\r\n/g, '\n');
  1708. }
  1709. var cr = '\r'.charCodeAt(0);
  1710. var lf = '\n'.charCodeAt(0);
  1711. /***/ }),
  1712. /* 9 */
  1713. /***/ (function(module, exports) {
  1714. module.exports = require("util");
  1715. /***/ }),
  1716. /* 10 */
  1717. /***/ (function(module, exports, __webpack_require__) {
  1718. "use strict";
  1719. exports.__esModule = true;
  1720. var _setPrototypeOf = __webpack_require__(211);
  1721. var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
  1722. var _create = __webpack_require__(210);
  1723. var _create2 = _interopRequireDefault(_create);
  1724. var _typeof2 = __webpack_require__(316);
  1725. var _typeof3 = _interopRequireDefault(_typeof2);
  1726. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1727. exports.default = function (subClass, superClass) {
  1728. if (typeof superClass !== "function" && superClass !== null) {
  1729. throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
  1730. }
  1731. subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
  1732. constructor: {
  1733. value: subClass,
  1734. enumerable: false,
  1735. writable: true,
  1736. configurable: true
  1737. }
  1738. });
  1739. if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
  1740. };
  1741. /***/ }),
  1742. /* 11 */
  1743. /***/ (function(module, exports, __webpack_require__) {
  1744. "use strict";
  1745. exports.__esModule = true;
  1746. var _typeof2 = __webpack_require__(316);
  1747. var _typeof3 = _interopRequireDefault(_typeof2);
  1748. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1749. exports.default = function (self, call) {
  1750. if (!self) {
  1751. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1752. }
  1753. return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
  1754. };
  1755. /***/ }),
  1756. /* 12 */
  1757. /***/ (function(module, exports) {
  1758. module.exports = require("fs");
  1759. /***/ }),
  1760. /* 13 */
  1761. /***/ (function(module, exports, __webpack_require__) {
  1762. "use strict";
  1763. Object.defineProperty(exports, "__esModule", {
  1764. value: true
  1765. });
  1766. exports.getPathKey = getPathKey;
  1767. var os = __webpack_require__(66);
  1768. var path = __webpack_require__(1);
  1769. var userHome = __webpack_require__(101).default;
  1770. var _require = __webpack_require__(549),
  1771. getCacheDir = _require.getCacheDir,
  1772. getConfigDir = _require.getConfigDir,
  1773. getDataDir = _require.getDataDir;
  1774. var isWebpackBundle = __webpack_require__(792);
  1775. var DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies'];
  1776. var OWNED_DEPENDENCY_TYPES = exports.OWNED_DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies'];
  1777. var RESOLUTIONS = exports.RESOLUTIONS = 'resolutions';
  1778. var MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS].concat(DEPENDENCY_TYPES);
  1779. var SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0';
  1780. var YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com';
  1781. var NPM_REGISTRY_RE = exports.NPM_REGISTRY_RE = /https?:\/\/registry\.npmjs\.org/g;
  1782. var YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/';
  1783. var YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh';
  1784. var YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi';
  1785. var SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version';
  1786. // cache version, bump whenever we make backwards incompatible changes
  1787. var CACHE_VERSION = exports.CACHE_VERSION = 6;
  1788. // lockfile version, bump whenever we make backwards incompatible changes
  1789. var LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1;
  1790. // max amount of network requests to perform concurrently
  1791. var NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8;
  1792. // HTTP timeout used when downloading packages
  1793. var NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds
  1794. // max amount of child processes to execute concurrently
  1795. var CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5;
  1796. var REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid'];
  1797. function getPreferredCacheDirectories() {
  1798. var preferredCacheDirectories = [getCacheDir()];
  1799. if (process.getuid) {
  1800. // $FlowFixMe: process.getuid exists, dammit
  1801. preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache-${process.getuid()}`));
  1802. }
  1803. preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache`));
  1804. return preferredCacheDirectories;
  1805. }
  1806. var PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories();
  1807. var CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir();
  1808. var DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir();
  1809. var LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link');
  1810. var GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global');
  1811. var NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath;
  1812. var YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath();
  1813. // Webpack needs to be configured with node.__dirname/__filename = false
  1814. function getYarnBinPath() {
  1815. if (isWebpackBundle) {
  1816. return __filename;
  1817. } else {
  1818. return path.join(__dirname, '..', 'bin', 'yarn.js');
  1819. }
  1820. }
  1821. var NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules';
  1822. var NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json';
  1823. var PNP_FILENAME = exports.PNP_FILENAME = '.pnp.js';
  1824. var POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`;
  1825. var FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn');
  1826. var META_FOLDER = exports.META_FOLDER = '.yarn-meta';
  1827. var INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity';
  1828. var LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock';
  1829. var METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json';
  1830. var TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz';
  1831. var CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean';
  1832. var NPM_LOCK_FILENAME = exports.NPM_LOCK_FILENAME = 'package-lock.json';
  1833. var NPM_SHRINKWRAP_FILENAME = exports.NPM_SHRINKWRAP_FILENAME = 'npm-shrinkwrap.json';
  1834. var DEFAULT_INDENT = exports.DEFAULT_INDENT = ' ';
  1835. var SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997;
  1836. var SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance';
  1837. var ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env);
  1838. function getPathKey(platform, env) {
  1839. var pathKey = 'PATH';
  1840. // windows calls its path "Path" usually, but this is not guaranteed.
  1841. if (platform === 'win32') {
  1842. pathKey = 'Path';
  1843. for (var _key in env) {
  1844. if (_key.toLowerCase() === 'path') {
  1845. pathKey = _key;
  1846. }
  1847. }
  1848. }
  1849. return pathKey;
  1850. }
  1851. var VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = {
  1852. major: 'red',
  1853. premajor: 'red',
  1854. minor: 'yellow',
  1855. preminor: 'yellow',
  1856. patch: 'green',
  1857. prepatch: 'green',
  1858. prerelease: 'red',
  1859. unchanged: 'white',
  1860. unknown: 'red'
  1861. };
  1862. /***/ }),
  1863. /* 14 */
  1864. /***/ (function(module, exports, __webpack_require__) {
  1865. module.exports = { "default": __webpack_require__(597), __esModule: true };
  1866. /***/ }),
  1867. /* 15 */
  1868. /***/ (function(module, exports, __webpack_require__) {
  1869. "use strict";
  1870. /**
  1871. * Copyright (c) 2013-present, Facebook, Inc.
  1872. *
  1873. * This source code is licensed under the MIT license found in the
  1874. * LICENSE file in the root directory of this source tree.
  1875. */
  1876. /**
  1877. * Use invariant() to assert state which your program assumes to be true.
  1878. *
  1879. * Provide sprintf-style format (only %s is supported) and arguments
  1880. * to provide information about what broke and what you were
  1881. * expecting.
  1882. *
  1883. * The invariant message will be stripped in production, but the invariant
  1884. * will remain to ensure logic does not differ in production.
  1885. */
  1886. var NODE_ENV = process.env.NODE_ENV;
  1887. var invariant = function(condition, format, a, b, c, d, e, f) {
  1888. if (NODE_ENV !== 'production') {
  1889. if (format === undefined) {
  1890. throw new Error('invariant requires an error message argument');
  1891. }
  1892. }
  1893. if (!condition) {
  1894. var error;
  1895. if (format === undefined) {
  1896. error = new Error(
  1897. 'Minified exception occurred; use the non-minified dev environment ' +
  1898. 'for the full error message and additional helpful warnings.'
  1899. );
  1900. } else {
  1901. var args = [a, b, c, d, e, f];
  1902. var argIndex = 0;
  1903. error = new Error(
  1904. format.replace(/%s/g, function() { return args[argIndex++]; })
  1905. );
  1906. error.name = 'Invariant Violation';
  1907. }
  1908. error.framesToPop = 1; // we don't care about invariant's own frame
  1909. throw error;
  1910. }
  1911. };
  1912. module.exports = invariant;
  1913. /***/ }),
  1914. /* 16 */
  1915. /***/ (function(module, exports, __webpack_require__) {
  1916. module.exports = { "default": __webpack_require__(602), __esModule: true };
  1917. /***/ }),
  1918. /* 17 */
  1919. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1920. "use strict";
  1921. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Observable; });
  1922. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_canReportError__ = __webpack_require__(263);
  1923. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__ = __webpack_require__(1005);
  1924. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__ = __webpack_require__(112);
  1925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(265);
  1926. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(176);
  1927. /** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_internal_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */
  1928. var Observable = /*@__PURE__*/ (function () {
  1929. function Observable(subscribe) {
  1930. this._isScalar = false;
  1931. if (subscribe) {
  1932. this._subscribe = subscribe;
  1933. }
  1934. }
  1935. Observable.prototype.lift = function (operator) {
  1936. var observable = new Observable();
  1937. observable.source = this;
  1938. observable.operator = operator;
  1939. return observable;
  1940. };
  1941. Observable.prototype.subscribe = function (observerOrNext, error, complete) {
  1942. var operator = this.operator;
  1943. var sink = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__["a" /* toSubscriber */])(observerOrNext, error, complete);
  1944. if (operator) {
  1945. operator.call(sink, this.source);
  1946. }
  1947. else {
  1948. sink.add(this.source || (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
  1949. this._subscribe(sink) :
  1950. this._trySubscribe(sink));
  1951. }
  1952. if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
  1953. if (sink.syncErrorThrowable) {
  1954. sink.syncErrorThrowable = false;
  1955. if (sink.syncErrorThrown) {
  1956. throw sink.syncErrorValue;
  1957. }
  1958. }
  1959. }
  1960. return sink;
  1961. };
  1962. Observable.prototype._trySubscribe = function (sink) {
  1963. try {
  1964. return this._subscribe(sink);
  1965. }
  1966. catch (err) {
  1967. if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
  1968. sink.syncErrorThrown = true;
  1969. sink.syncErrorValue = err;
  1970. }
  1971. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_canReportError__["a" /* canReportError */])(sink)) {
  1972. sink.error(err);
  1973. }
  1974. else {
  1975. console.warn(err);
  1976. }
  1977. }
  1978. };
  1979. Observable.prototype.forEach = function (next, promiseCtor) {
  1980. var _this = this;
  1981. promiseCtor = getPromiseCtor(promiseCtor);
  1982. return new promiseCtor(function (resolve, reject) {
  1983. var subscription;
  1984. subscription = _this.subscribe(function (value) {
  1985. try {
  1986. next(value);
  1987. }
  1988. catch (err) {
  1989. reject(err);
  1990. if (subscription) {
  1991. subscription.unsubscribe();
  1992. }
  1993. }
  1994. }, reject, resolve);
  1995. });
  1996. };
  1997. Observable.prototype._subscribe = function (subscriber) {
  1998. var source = this.source;
  1999. return source && source.subscribe(subscriber);
  2000. };
  2001. Observable.prototype[__WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__["a" /* observable */]] = function () {
  2002. return this;
  2003. };
  2004. Observable.prototype.pipe = function () {
  2005. var operations = [];
  2006. for (var _i = 0; _i < arguments.length; _i++) {
  2007. operations[_i] = arguments[_i];
  2008. }
  2009. if (operations.length === 0) {
  2010. return this;
  2011. }
  2012. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["b" /* pipeFromArray */])(operations)(this);
  2013. };
  2014. Observable.prototype.toPromise = function (promiseCtor) {
  2015. var _this = this;
  2016. promiseCtor = getPromiseCtor(promiseCtor);
  2017. return new promiseCtor(function (resolve, reject) {
  2018. var value;
  2019. _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
  2020. });
  2021. };
  2022. Observable.create = function (subscribe) {
  2023. return new Observable(subscribe);
  2024. };
  2025. return Observable;
  2026. }());
  2027. function getPromiseCtor(promiseCtor) {
  2028. if (!promiseCtor) {
  2029. promiseCtor = __WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].Promise || Promise;
  2030. }
  2031. if (!promiseCtor) {
  2032. throw new Error('no Promise impl found');
  2033. }
  2034. return promiseCtor;
  2035. }
  2036. //# sourceMappingURL=Observable.js.map
  2037. /***/ }),
  2038. /* 18 */
  2039. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2040. "use strict";
  2041. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OuterSubscriber; });
  2042. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  2043. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  2044. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  2045. var OuterSubscriber = /*@__PURE__*/ (function (_super) {
  2046. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](OuterSubscriber, _super);
  2047. function OuterSubscriber() {
  2048. return _super !== null && _super.apply(this, arguments) || this;
  2049. }
  2050. OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  2051. this.destination.next(innerValue);
  2052. };
  2053. OuterSubscriber.prototype.notifyError = function (error, innerSub) {
  2054. this.destination.error(error);
  2055. };
  2056. OuterSubscriber.prototype.notifyComplete = function (innerSub) {
  2057. this.destination.complete();
  2058. };
  2059. return OuterSubscriber;
  2060. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  2061. //# sourceMappingURL=OuterSubscriber.js.map
  2062. /***/ }),
  2063. /* 19 */
  2064. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2065. "use strict";
  2066. /* harmony export (immutable) */ __webpack_exports__["a"] = subscribeToResult;
  2067. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__ = __webpack_require__(80);
  2068. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeTo__ = __webpack_require__(416);
  2069. /** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo PURE_IMPORTS_END */
  2070. function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, destination) {
  2071. if (destination === void 0) {
  2072. destination = new __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__["a" /* InnerSubscriber */](outerSubscriber, outerValue, outerIndex);
  2073. }
  2074. if (destination.closed) {
  2075. return;
  2076. }
  2077. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__subscribeTo__["a" /* subscribeTo */])(result)(destination);
  2078. }
  2079. //# sourceMappingURL=subscribeToResult.js.map
  2080. /***/ }),
  2081. /* 20 */
  2082. /***/ (function(module, exports, __webpack_require__) {
  2083. "use strict";
  2084. /* eslint-disable node/no-deprecated-api */
  2085. var buffer = __webpack_require__(94)
  2086. var Buffer = buffer.Buffer
  2087. var safer = {}
  2088. var key
  2089. for (key in buffer) {
  2090. if (!buffer.hasOwnProperty(key)) continue
  2091. if (key === 'SlowBuffer' || key === 'Buffer') continue
  2092. safer[key] = buffer[key]
  2093. }
  2094. var Safer = safer.Buffer = {}
  2095. for (key in Buffer) {
  2096. if (!Buffer.hasOwnProperty(key)) continue
  2097. if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue
  2098. Safer[key] = Buffer[key]
  2099. }
  2100. safer.Buffer.prototype = Buffer.prototype
  2101. if (!Safer.from || Safer.from === Uint8Array.from) {
  2102. Safer.from = function (value, encodingOrOffset, length) {
  2103. if (typeof value === 'number') {
  2104. throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value)
  2105. }
  2106. if (value && typeof value.length === 'undefined') {
  2107. throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)
  2108. }
  2109. return Buffer(value, encodingOrOffset, length)
  2110. }
  2111. }
  2112. if (!Safer.alloc) {
  2113. Safer.alloc = function (size, fill, encoding) {
  2114. if (typeof size !== 'number') {
  2115. throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
  2116. }
  2117. if (size < 0 || size >= 2 * (1 << 30)) {
  2118. throw new RangeError('The value "' + size + '" is invalid for option "size"')
  2119. }
  2120. var buf = Buffer(size)
  2121. if (!fill || fill.length === 0) {
  2122. buf.fill(0)
  2123. } else if (typeof encoding === 'string') {
  2124. buf.fill(fill, encoding)
  2125. } else {
  2126. buf.fill(fill)
  2127. }
  2128. return buf
  2129. }
  2130. }
  2131. if (!safer.kStringMaxLength) {
  2132. try {
  2133. safer.kStringMaxLength = process.binding('buffer').kStringMaxLength
  2134. } catch (e) {
  2135. // we can't determine kStringMaxLength in environments where process.binding
  2136. // is unsupported, so let's not set it
  2137. }
  2138. }
  2139. if (!safer.constants) {
  2140. safer.constants = {
  2141. MAX_LENGTH: safer.kMaxLength
  2142. }
  2143. if (safer.kStringMaxLength) {
  2144. safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength
  2145. }
  2146. }
  2147. module.exports = safer
  2148. /***/ }),
  2149. /* 21 */
  2150. /***/ (function(module, exports) {
  2151. module.exports = require("crypto");
  2152. /***/ }),
  2153. /* 22 */
  2154. /***/ (function(module, exports, __webpack_require__) {
  2155. // Copyright (c) 2012, Mark Cavage. All rights reserved.
  2156. // Copyright 2015 Joyent, Inc.
  2157. var assert = __webpack_require__(50);
  2158. var Stream = __webpack_require__(36).Stream;
  2159. var util = __webpack_require__(9);
  2160. ///--- Globals
  2161. /* JSSTYLED */
  2162. var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
  2163. ///--- Internal
  2164. function _capitalize(str) {
  2165. return (str.charAt(0).toUpperCase() + str.slice(1));
  2166. }
  2167. function _toss(name, expected, oper, arg, actual) {
  2168. throw new assert.AssertionError({
  2169. message: util.format('%s (%s) is required', name, expected),
  2170. actual: (actual === undefined) ? typeof (arg) : actual(arg),
  2171. expected: expected,
  2172. operator: oper || '===',
  2173. stackStartFunction: _toss.caller
  2174. });
  2175. }
  2176. function _getClass(arg) {
  2177. return (Object.prototype.toString.call(arg).slice(8, -1));
  2178. }
  2179. function noop() {
  2180. // Why even bother with asserts?
  2181. }
  2182. ///--- Exports
  2183. var types = {
  2184. bool: {
  2185. check: function (arg) { return typeof (arg) === 'boolean'; }
  2186. },
  2187. func: {
  2188. check: function (arg) { return typeof (arg) === 'function'; }
  2189. },
  2190. string: {
  2191. check: function (arg) { return typeof (arg) === 'string'; }
  2192. },
  2193. object: {
  2194. check: function (arg) {
  2195. return typeof (arg) === 'object' && arg !== null;
  2196. }
  2197. },
  2198. number: {
  2199. check: function (arg) {
  2200. return typeof (arg) === 'number' && !isNaN(arg);
  2201. }
  2202. },
  2203. finite: {
  2204. check: function (arg) {
  2205. return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);
  2206. }
  2207. },
  2208. buffer: {
  2209. check: function (arg) { return Buffer.isBuffer(arg); },
  2210. operator: 'Buffer.isBuffer'
  2211. },
  2212. array: {
  2213. check: function (arg) { return Array.isArray(arg); },
  2214. operator: 'Array.isArray'
  2215. },
  2216. stream: {
  2217. check: function (arg) { return arg instanceof Stream; },
  2218. operator: 'instanceof',
  2219. actual: _getClass
  2220. },
  2221. date: {
  2222. check: function (arg) { return arg instanceof Date; },
  2223. operator: 'instanceof',
  2224. actual: _getClass
  2225. },
  2226. regexp: {
  2227. check: function (arg) { return arg instanceof RegExp; },
  2228. operator: 'instanceof',
  2229. actual: _getClass
  2230. },
  2231. uuid: {
  2232. check: function (arg) {
  2233. return typeof (arg) === 'string' && UUID_REGEXP.test(arg);
  2234. },
  2235. operator: 'isUUID'
  2236. }
  2237. };
  2238. function _setExports(ndebug) {
  2239. var keys = Object.keys(types);
  2240. var out;
  2241. /* re-export standard assert */
  2242. if (process.env.NODE_NDEBUG) {
  2243. out = noop;
  2244. } else {
  2245. out = function (arg, msg) {
  2246. if (!arg) {
  2247. _toss(msg, 'true', arg);
  2248. }
  2249. };
  2250. }
  2251. /* standard checks */
  2252. keys.forEach(function (k) {
  2253. if (ndebug) {
  2254. out[k] = noop;
  2255. return;
  2256. }
  2257. var type = types[k];
  2258. out[k] = function (arg, msg) {
  2259. if (!type.check(arg)) {
  2260. _toss(msg, k, type.operator, arg, type.actual);
  2261. }
  2262. };
  2263. });
  2264. /* optional checks */
  2265. keys.forEach(function (k) {
  2266. var name = 'optional' + _capitalize(k);
  2267. if (ndebug) {
  2268. out[name] = noop;
  2269. return;
  2270. }
  2271. var type = types[k];
  2272. out[name] = function (arg, msg) {
  2273. if (arg === undefined || arg === null) {
  2274. return;
  2275. }
  2276. if (!type.check(arg)) {
  2277. _toss(msg, k, type.operator, arg, type.actual);
  2278. }
  2279. };
  2280. });
  2281. /* arrayOf checks */
  2282. keys.forEach(function (k) {
  2283. var name = 'arrayOf' + _capitalize(k);
  2284. if (ndebug) {
  2285. out[name] = noop;
  2286. return;
  2287. }
  2288. var type = types[k];
  2289. var expected = '[' + k + ']';
  2290. out[name] = function (arg, msg) {
  2291. if (!Array.isArray(arg)) {
  2292. _toss(msg, expected, type.operator, arg, type.actual);
  2293. }
  2294. var i;
  2295. for (i = 0; i < arg.length; i++) {
  2296. if (!type.check(arg[i])) {
  2297. _toss(msg, expected, type.operator, arg, type.actual);
  2298. }
  2299. }
  2300. };
  2301. });
  2302. /* optionalArrayOf checks */
  2303. keys.forEach(function (k) {
  2304. var name = 'optionalArrayOf' + _capitalize(k);
  2305. if (ndebug) {
  2306. out[name] = noop;
  2307. return;
  2308. }
  2309. var type = types[k];
  2310. var expected = '[' + k + ']';
  2311. out[name] = function (arg, msg) {
  2312. if (arg === undefined || arg === null) {
  2313. return;
  2314. }
  2315. if (!Array.isArray(arg)) {
  2316. _toss(msg, expected, type.operator, arg, type.actual);
  2317. }
  2318. var i;
  2319. for (i = 0; i < arg.length; i++) {
  2320. if (!type.check(arg[i])) {
  2321. _toss(msg, expected, type.operator, arg, type.actual);
  2322. }
  2323. }
  2324. };
  2325. });
  2326. /* re-export built-in assertions */
  2327. Object.keys(assert).forEach(function (k) {
  2328. if (k === 'AssertionError') {
  2329. out[k] = assert[k];
  2330. return;
  2331. }
  2332. if (ndebug) {
  2333. out[k] = noop;
  2334. return;
  2335. }
  2336. out[k] = assert[k];
  2337. });
  2338. /* export ourselves (for unit tests _only_) */
  2339. out._setExports = _setExports;
  2340. return out;
  2341. }
  2342. module.exports = _setExports(process.env.NODE_NDEBUG);
  2343. /***/ }),
  2344. /* 23 */
  2345. /***/ (function(module, exports, __webpack_require__) {
  2346. module.exports = { "default": __webpack_require__(594), __esModule: true };
  2347. /***/ }),
  2348. /* 24 */
  2349. /***/ (function(module, exports, __webpack_require__) {
  2350. "use strict";
  2351. exports.__esModule = true;
  2352. var _assign = __webpack_require__(23);
  2353. var _assign2 = _interopRequireDefault(_assign);
  2354. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2355. exports.default = _assign2.default || function (target) {
  2356. for (var i = 1; i < arguments.length; i++) {
  2357. var source = arguments[i];
  2358. for (var key in source) {
  2359. if (Object.prototype.hasOwnProperty.call(source, key)) {
  2360. target[key] = source[key];
  2361. }
  2362. }
  2363. }
  2364. return target;
  2365. };
  2366. /***/ }),
  2367. /* 25 */
  2368. /***/ (function(module, exports, __webpack_require__) {
  2369. "use strict";
  2370. Object.defineProperty(exports, "__esModule", {
  2371. value: true
  2372. });
  2373. exports.stringify = exports.parse = undefined;
  2374. var _getIterator2;
  2375. function _load_getIterator() {
  2376. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  2377. }
  2378. var _map;
  2379. function _load_map() {
  2380. return _map = _interopRequireDefault(__webpack_require__(42));
  2381. }
  2382. var _asyncToGenerator2;
  2383. function _load_asyncToGenerator() {
  2384. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  2385. }
  2386. var _classCallCheck2;
  2387. function _load_classCallCheck() {
  2388. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  2389. }
  2390. var _keys;
  2391. function _load_keys() {
  2392. return _keys = _interopRequireDefault(__webpack_require__(14));
  2393. }
  2394. var _parse;
  2395. function _load_parse() {
  2396. return _parse = __webpack_require__(301);
  2397. }
  2398. Object.defineProperty(exports, 'parse', {
  2399. enumerable: true,
  2400. get: function get() {
  2401. return _interopRequireDefault(_parse || _load_parse()).default;
  2402. }
  2403. });
  2404. var _stringify;
  2405. function _load_stringify() {
  2406. return _stringify = __webpack_require__(510);
  2407. }
  2408. Object.defineProperty(exports, 'stringify', {
  2409. enumerable: true,
  2410. get: function get() {
  2411. return _interopRequireDefault(_stringify || _load_stringify()).default;
  2412. }
  2413. });
  2414. exports.implodeEntry = implodeEntry;
  2415. exports.explodeEntry = explodeEntry;
  2416. var _misc;
  2417. function _load_misc() {
  2418. return _misc = __webpack_require__(28);
  2419. }
  2420. var _normalizePattern;
  2421. function _load_normalizePattern() {
  2422. return _normalizePattern = __webpack_require__(52);
  2423. }
  2424. var _parse2;
  2425. function _load_parse2() {
  2426. return _parse2 = _interopRequireDefault(__webpack_require__(301));
  2427. }
  2428. var _constants;
  2429. function _load_constants() {
  2430. return _constants = __webpack_require__(13);
  2431. }
  2432. var _fs;
  2433. function _load_fs() {
  2434. return _fs = _interopRequireWildcard(__webpack_require__(8));
  2435. }
  2436. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  2437. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2438. var invariant = __webpack_require__(15);
  2439. var path = __webpack_require__(1);
  2440. var ssri = __webpack_require__(93);
  2441. function getName(pattern) {
  2442. return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name;
  2443. }
  2444. function blankObjectUndefined(obj) {
  2445. return obj && (0, (_keys || _load_keys()).default)(obj).length ? obj : undefined;
  2446. }
  2447. function keyForRemote(remote) {
  2448. return remote.resolved || (remote.reference && remote.hash ? `${remote.reference}#${remote.hash}` : null);
  2449. }
  2450. function serializeIntegrity(integrity) {
  2451. // We need this because `Integrity.toString()` does not use sorting to ensure a stable string output
  2452. // See https://git.io/vx2Hy
  2453. return integrity.toString().split(' ').sort().join(' ');
  2454. }
  2455. function implodeEntry(pattern, obj) {
  2456. var inferredName = getName(pattern);
  2457. var integrity = obj.integrity ? serializeIntegrity(obj.integrity) : '';
  2458. var imploded = {
  2459. name: inferredName === obj.name ? undefined : obj.name,
  2460. version: obj.version,
  2461. uid: obj.uid === obj.version ? undefined : obj.uid,
  2462. resolved: obj.resolved,
  2463. registry: obj.registry === 'npm' ? undefined : obj.registry,
  2464. dependencies: blankObjectUndefined(obj.dependencies),
  2465. optionalDependencies: blankObjectUndefined(obj.optionalDependencies),
  2466. permissions: blankObjectUndefined(obj.permissions),
  2467. prebuiltVariants: blankObjectUndefined(obj.prebuiltVariants)
  2468. };
  2469. if (integrity) {
  2470. imploded.integrity = integrity;
  2471. }
  2472. return imploded;
  2473. }
  2474. function explodeEntry(pattern, obj) {
  2475. obj.optionalDependencies = obj.optionalDependencies || {};
  2476. obj.dependencies = obj.dependencies || {};
  2477. obj.uid = obj.uid || obj.version;
  2478. obj.permissions = obj.permissions || {};
  2479. obj.registry = obj.registry || 'npm';
  2480. obj.name = obj.name || getName(pattern);
  2481. var integrity = obj.integrity;
  2482. if (integrity && integrity.isIntegrity) {
  2483. obj.integrity = ssri.parse(integrity);
  2484. }
  2485. return obj;
  2486. }
  2487. var Lockfile = function () {
  2488. function Lockfile() {
  2489. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  2490. cache = _ref.cache,
  2491. source = _ref.source,
  2492. parseResultType = _ref.parseResultType;
  2493. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Lockfile);
  2494. this.source = source || '';
  2495. this.cache = cache;
  2496. this.parseResultType = parseResultType;
  2497. }
  2498. // source string if the `cache` was parsed
  2499. // if true, we're parsing an old yarn file and need to update integrity fields
  2500. Lockfile.prototype.hasEntriesExistWithoutIntegrity = function hasEntriesExistWithoutIntegrity() {
  2501. if (!this.cache) {
  2502. return false;
  2503. }
  2504. for (var _key in this.cache) {
  2505. // $FlowFixMe - `this.cache` is clearly defined at this point
  2506. if (!/^.*@(file:|http)/.test(_key) && this.cache[_key] && !this.cache[_key].integrity) {
  2507. return true;
  2508. }
  2509. }
  2510. return false;
  2511. };
  2512. Lockfile.fromDirectory = function () {
  2513. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, reporter) {
  2514. // read the manifest in this directory
  2515. var lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME);
  2516. var lockfile = void 0;
  2517. var rawLockfile = '';
  2518. var parseResult = void 0;
  2519. if (yield (_fs || _load_fs()).exists(lockfileLoc)) {
  2520. rawLockfile = yield (_fs || _load_fs()).readFile(lockfileLoc);
  2521. parseResult = (0, (_parse2 || _load_parse2()).default)(rawLockfile, lockfileLoc);
  2522. if (reporter) {
  2523. if (parseResult.type === 'merge') {
  2524. reporter.info(reporter.lang('lockfileMerged'));
  2525. } else if (parseResult.type === 'conflict') {
  2526. reporter.warn(reporter.lang('lockfileConflict'));
  2527. }
  2528. }
  2529. lockfile = parseResult.object;
  2530. } else if (reporter) {
  2531. reporter.info(reporter.lang('noLockfileFound'));
  2532. }
  2533. if (lockfile && lockfile.__metadata) {
  2534. var lockfilev2 = lockfile;
  2535. lockfile = {};
  2536. }
  2537. return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type });
  2538. });
  2539. function fromDirectory(_x2, _x3) {
  2540. return _ref2.apply(this, arguments);
  2541. }
  2542. return fromDirectory;
  2543. }();
  2544. Lockfile.prototype.getLocked = function getLocked(pattern) {
  2545. var cache = this.cache;
  2546. if (!cache) {
  2547. return undefined;
  2548. }
  2549. var shrunk = pattern in cache && cache[pattern];
  2550. if (typeof shrunk === 'string') {
  2551. return this.getLocked(shrunk);
  2552. } else if (shrunk) {
  2553. explodeEntry(pattern, shrunk);
  2554. return shrunk;
  2555. }
  2556. return undefined;
  2557. };
  2558. Lockfile.prototype.removePattern = function removePattern(pattern) {
  2559. var cache = this.cache;
  2560. if (!cache) {
  2561. return;
  2562. }
  2563. delete cache[pattern];
  2564. };
  2565. Lockfile.prototype.getLockfile = function getLockfile(patterns) {
  2566. var lockfile = {};
  2567. var seen = new (_map || _load_map()).default();
  2568. // order by name so that lockfile manifest is assigned to the first dependency with this manifest
  2569. // the others that have the same remoteKey will just refer to the first
  2570. // ordering allows for consistency in lockfile when it is serialized
  2571. var sortedPatternsKeys = (0, (_keys || _load_keys()).default)(patterns).sort((_misc || _load_misc()).sortAlpha);
  2572. for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  2573. var _ref3;
  2574. if (_isArray) {
  2575. if (_i >= _iterator.length) break;
  2576. _ref3 = _iterator[_i++];
  2577. } else {
  2578. _i = _iterator.next();
  2579. if (_i.done) break;
  2580. _ref3 = _i.value;
  2581. }
  2582. var pattern = _ref3;
  2583. var pkg = patterns[pattern];
  2584. var remote = pkg._remote,
  2585. ref = pkg._reference;
  2586. invariant(ref, 'Package is missing a reference');
  2587. invariant(remote, 'Package is missing a remote');
  2588. var remoteKey = keyForRemote(remote);
  2589. var pkgName = getName(pattern);
  2590. var seenKey = remoteKey ? `${remoteKey}#${pkgName}` : null;
  2591. var seenPattern = seenKey ? seen.get(seenKey) : null;
  2592. if (seenPattern) {
  2593. // no point in duplicating it
  2594. lockfile[pattern] = seenPattern;
  2595. continue;
  2596. }
  2597. var obj = implodeEntry(pattern, {
  2598. name: pkgName,
  2599. version: pkg.version,
  2600. uid: pkg._uid,
  2601. resolved: remote.resolved,
  2602. integrity: remote.integrity,
  2603. registry: remote.registry,
  2604. dependencies: pkg.dependencies,
  2605. peerDependencies: pkg.peerDependencies,
  2606. optionalDependencies: pkg.optionalDependencies,
  2607. permissions: ref.permissions,
  2608. prebuiltVariants: pkg.prebuiltVariants
  2609. });
  2610. lockfile[pattern] = obj;
  2611. if (seenKey) {
  2612. seen.set(seenKey, obj);
  2613. }
  2614. }
  2615. return lockfile;
  2616. };
  2617. return Lockfile;
  2618. }();
  2619. exports.default = Lockfile;
  2620. /***/ }),
  2621. /* 26 */
  2622. /***/ (function(module, exports) {
  2623. var core = module.exports = { version: '2.5.7' };
  2624. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  2625. /***/ }),
  2626. /* 27 */
  2627. /***/ (function(module, exports) {
  2628. exports = module.exports = SemVer;
  2629. // The debug function is excluded entirely from the minified version.
  2630. /* nomin */ var debug;
  2631. /* nomin */ if (typeof process === 'object' &&
  2632. /* nomin */ process.env &&
  2633. /* nomin */ process.env.NODE_DEBUG &&
  2634. /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG))
  2635. /* nomin */ debug = function() {
  2636. /* nomin */ var args = Array.prototype.slice.call(arguments, 0);
  2637. /* nomin */ args.unshift('SEMVER');
  2638. /* nomin */ console.log.apply(console, args);
  2639. /* nomin */ };
  2640. /* nomin */ else
  2641. /* nomin */ debug = function() {};
  2642. // Note: this is the semver.org version of the spec that it implements
  2643. // Not necessarily the package version of this code.
  2644. exports.SEMVER_SPEC_VERSION = '2.0.0';
  2645. var MAX_LENGTH = 256;
  2646. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
  2647. // Max safe segment length for coercion.
  2648. var MAX_SAFE_COMPONENT_LENGTH = 16;
  2649. // The actual regexps go on exports.re
  2650. var re = exports.re = [];
  2651. var src = exports.src = [];
  2652. var R = 0;
  2653. // The following Regular Expressions can be used for tokenizing,
  2654. // validating, and parsing SemVer version strings.
  2655. // ## Numeric Identifier
  2656. // A single `0`, or a non-zero digit followed by zero or more digits.
  2657. var NUMERICIDENTIFIER = R++;
  2658. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*';
  2659. var NUMERICIDENTIFIERLOOSE = R++;
  2660. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+';
  2661. // ## Non-numeric Identifier
  2662. // Zero or more digits, followed by a letter or hyphen, and then zero or
  2663. // more letters, digits, or hyphens.
  2664. var NONNUMERICIDENTIFIER = R++;
  2665. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*';
  2666. // ## Main Version
  2667. // Three dot-separated numeric identifiers.
  2668. var MAINVERSION = R++;
  2669. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2670. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2671. '(' + src[NUMERICIDENTIFIER] + ')';
  2672. var MAINVERSIONLOOSE = R++;
  2673. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2674. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2675. '(' + src[NUMERICIDENTIFIERLOOSE] + ')';
  2676. // ## Pre-release Version Identifier
  2677. // A numeric identifier, or a non-numeric identifier.
  2678. var PRERELEASEIDENTIFIER = R++;
  2679. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  2680. '|' + src[NONNUMERICIDENTIFIER] + ')';
  2681. var PRERELEASEIDENTIFIERLOOSE = R++;
  2682. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  2683. '|' + src[NONNUMERICIDENTIFIER] + ')';
  2684. // ## Pre-release Version
  2685. // Hyphen, followed by one or more dot-separated pre-release version
  2686. // identifiers.
  2687. var PRERELEASE = R++;
  2688. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  2689. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))';
  2690. var PRERELEASELOOSE = R++;
  2691. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  2692. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))';
  2693. // ## Build Metadata Identifier
  2694. // Any combination of digits, letters, or hyphens.
  2695. var BUILDIDENTIFIER = R++;
  2696. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+';
  2697. // ## Build Metadata
  2698. // Plus sign, followed by one or more period-separated build metadata
  2699. // identifiers.
  2700. var BUILD = R++;
  2701. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  2702. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))';
  2703. // ## Full Version String
  2704. // A main version, followed optionally by a pre-release version and
  2705. // build metadata.
  2706. // Note that the only major, minor, patch, and pre-release sections of
  2707. // the version string are capturing groups. The build metadata is not a
  2708. // capturing group, because it should not ever be used in version
  2709. // comparison.
  2710. var FULL = R++;
  2711. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  2712. src[PRERELEASE] + '?' +
  2713. src[BUILD] + '?';
  2714. src[FULL] = '^' + FULLPLAIN + '$';
  2715. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  2716. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  2717. // common in the npm registry.
  2718. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  2719. src[PRERELEASELOOSE] + '?' +
  2720. src[BUILD] + '?';
  2721. var LOOSE = R++;
  2722. src[LOOSE] = '^' + LOOSEPLAIN + '$';
  2723. var GTLT = R++;
  2724. src[GTLT] = '((?:<|>)?=?)';
  2725. // Something like "2.*" or "1.2.x".
  2726. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  2727. // Only the first item is strictly required.
  2728. var XRANGEIDENTIFIERLOOSE = R++;
  2729. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*';
  2730. var XRANGEIDENTIFIER = R++;
  2731. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*';
  2732. var XRANGEPLAIN = R++;
  2733. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  2734. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2735. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2736. '(?:' + src[PRERELEASE] + ')?' +
  2737. src[BUILD] + '?' +
  2738. ')?)?';
  2739. var XRANGEPLAINLOOSE = R++;
  2740. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2741. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2742. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2743. '(?:' + src[PRERELEASELOOSE] + ')?' +
  2744. src[BUILD] + '?' +
  2745. ')?)?';
  2746. var XRANGE = R++;
  2747. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$';
  2748. var XRANGELOOSE = R++;
  2749. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$';
  2750. // Coercion.
  2751. // Extract anything that could conceivably be a part of a valid semver
  2752. var COERCE = R++;
  2753. src[COERCE] = '(?:^|[^\\d])' +
  2754. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  2755. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2756. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2757. '(?:$|[^\\d])';
  2758. // Tilde ranges.
  2759. // Meaning is "reasonably at or greater than"
  2760. var LONETILDE = R++;
  2761. src[LONETILDE] = '(?:~>?)';
  2762. var TILDETRIM = R++;
  2763. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+';
  2764. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g');
  2765. var tildeTrimReplace = '$1~';
  2766. var TILDE = R++;
  2767. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';
  2768. var TILDELOOSE = R++;
  2769. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$';
  2770. // Caret ranges.
  2771. // Meaning is "at least and backwards compatible with"
  2772. var LONECARET = R++;
  2773. src[LONECARET] = '(?:\\^)';
  2774. var CARETTRIM = R++;
  2775. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+';
  2776. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g');
  2777. var caretTrimReplace = '$1^';
  2778. var CARET = R++;
  2779. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$';
  2780. var CARETLOOSE = R++;
  2781. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$';
  2782. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  2783. var COMPARATORLOOSE = R++;
  2784. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$';
  2785. var COMPARATOR = R++;
  2786. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$';
  2787. // An expression to strip any whitespace between the gtlt and the thing
  2788. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  2789. var COMPARATORTRIM = R++;
  2790. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  2791. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';
  2792. // this one has to use the /g flag
  2793. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');
  2794. var comparatorTrimReplace = '$1$2$3';
  2795. // Something like `1.2.3 - 1.2.4`
  2796. // Note that these all use the loose form, because they'll be
  2797. // checked against either the strict or loose comparator form
  2798. // later.
  2799. var HYPHENRANGE = R++;
  2800. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  2801. '\\s+-\\s+' +
  2802. '(' + src[XRANGEPLAIN] + ')' +
  2803. '\\s*$';
  2804. var HYPHENRANGELOOSE = R++;
  2805. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  2806. '\\s+-\\s+' +
  2807. '(' + src[XRANGEPLAINLOOSE] + ')' +
  2808. '\\s*$';
  2809. // Star ranges basically just allow anything at all.
  2810. var STAR = R++;
  2811. src[STAR] = '(<|>)?=?\\s*\\*';
  2812. // Compile to actual regexp objects.
  2813. // All are flag-free, unless they were created above with a flag.
  2814. for (var i = 0; i < R; i++) {
  2815. debug(i, src[i]);
  2816. if (!re[i])
  2817. re[i] = new RegExp(src[i]);
  2818. }
  2819. exports.parse = parse;
  2820. function parse(version, loose) {
  2821. if (version instanceof SemVer)
  2822. return version;
  2823. if (typeof version !== 'string')
  2824. return null;
  2825. if (version.length > MAX_LENGTH)
  2826. return null;
  2827. var r = loose ? re[LOOSE] : re[FULL];
  2828. if (!r.test(version))
  2829. return null;
  2830. try {
  2831. return new SemVer(version, loose);
  2832. } catch (er) {
  2833. return null;
  2834. }
  2835. }
  2836. exports.valid = valid;
  2837. function valid(version, loose) {
  2838. var v = parse(version, loose);
  2839. return v ? v.version : null;
  2840. }
  2841. exports.clean = clean;
  2842. function clean(version, loose) {
  2843. var s = parse(version.trim().replace(/^[=v]+/, ''), loose);
  2844. return s ? s.version : null;
  2845. }
  2846. exports.SemVer = SemVer;
  2847. function SemVer(version, loose) {
  2848. if (version instanceof SemVer) {
  2849. if (version.loose === loose)
  2850. return version;
  2851. else
  2852. version = version.version;
  2853. } else if (typeof version !== 'string') {
  2854. throw new TypeError('Invalid Version: ' + version);
  2855. }
  2856. if (version.length > MAX_LENGTH)
  2857. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  2858. if (!(this instanceof SemVer))
  2859. return new SemVer(version, loose);
  2860. debug('SemVer', version, loose);
  2861. this.loose = loose;
  2862. var m = version.trim().match(loose ? re[LOOSE] : re[FULL]);
  2863. if (!m)
  2864. throw new TypeError('Invalid Version: ' + version);
  2865. this.raw = version;
  2866. // these are actually numbers
  2867. this.major = +m[1];
  2868. this.minor = +m[2];
  2869. this.patch = +m[3];
  2870. if (this.major > MAX_SAFE_INTEGER || this.major < 0)
  2871. throw new TypeError('Invalid major version')
  2872. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0)
  2873. throw new TypeError('Invalid minor version')
  2874. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0)
  2875. throw new TypeError('Invalid patch version')
  2876. // numberify any prerelease numeric ids
  2877. if (!m[4])
  2878. this.prerelease = [];
  2879. else
  2880. this.prerelease = m[4].split('.').map(function(id) {
  2881. if (/^[0-9]+$/.test(id)) {
  2882. var num = +id;
  2883. if (num >= 0 && num < MAX_SAFE_INTEGER)
  2884. return num;
  2885. }
  2886. return id;
  2887. });
  2888. this.build = m[5] ? m[5].split('.') : [];
  2889. this.format();
  2890. }
  2891. SemVer.prototype.format = function() {
  2892. this.version = this.major + '.' + this.minor + '.' + this.patch;
  2893. if (this.prerelease.length)
  2894. this.version += '-' + this.prerelease.join('.');
  2895. return this.version;
  2896. };
  2897. SemVer.prototype.toString = function() {
  2898. return this.version;
  2899. };
  2900. SemVer.prototype.compare = function(other) {
  2901. debug('SemVer.compare', this.version, this.loose, other);
  2902. if (!(other instanceof SemVer))
  2903. other = new SemVer(other, this.loose);
  2904. return this.compareMain(other) || this.comparePre(other);
  2905. };
  2906. SemVer.prototype.compareMain = function(other) {
  2907. if (!(other instanceof SemVer))
  2908. other = new SemVer(other, this.loose);
  2909. return compareIdentifiers(this.major, other.major) ||
  2910. compareIdentifiers(this.minor, other.minor) ||
  2911. compareIdentifiers(this.patch, other.patch);
  2912. };
  2913. SemVer.prototype.comparePre = function(other) {
  2914. if (!(other instanceof SemVer))
  2915. other = new SemVer(other, this.loose);
  2916. // NOT having a prerelease is > having one
  2917. if (this.prerelease.length && !other.prerelease.length)
  2918. return -1;
  2919. else if (!this.prerelease.length && other.prerelease.length)
  2920. return 1;
  2921. else if (!this.prerelease.length && !other.prerelease.length)
  2922. return 0;
  2923. var i = 0;
  2924. do {
  2925. var a = this.prerelease[i];
  2926. var b = other.prerelease[i];
  2927. debug('prerelease compare', i, a, b);
  2928. if (a === undefined && b === undefined)
  2929. return 0;
  2930. else if (b === undefined)
  2931. return 1;
  2932. else if (a === undefined)
  2933. return -1;
  2934. else if (a === b)
  2935. continue;
  2936. else
  2937. return compareIdentifiers(a, b);
  2938. } while (++i);
  2939. };
  2940. // preminor will bump the version up to the next minor release, and immediately
  2941. // down to pre-release. premajor and prepatch work the same way.
  2942. SemVer.prototype.inc = function(release, identifier) {
  2943. switch (release) {
  2944. case 'premajor':
  2945. this.prerelease.length = 0;
  2946. this.patch = 0;
  2947. this.minor = 0;
  2948. this.major++;
  2949. this.inc('pre', identifier);
  2950. break;
  2951. case 'preminor':
  2952. this.prerelease.length = 0;
  2953. this.patch = 0;
  2954. this.minor++;
  2955. this.inc('pre', identifier);
  2956. break;
  2957. case 'prepatch':
  2958. // If this is already a prerelease, it will bump to the next version
  2959. // drop any prereleases that might already exist, since they are not
  2960. // relevant at this point.
  2961. this.prerelease.length = 0;
  2962. this.inc('patch', identifier);
  2963. this.inc('pre', identifier);
  2964. break;
  2965. // If the input is a non-prerelease version, this acts the same as
  2966. // prepatch.
  2967. case 'prerelease':
  2968. if (this.prerelease.length === 0)
  2969. this.inc('patch', identifier);
  2970. this.inc('pre', identifier);
  2971. break;
  2972. case 'major':
  2973. // If this is a pre-major version, bump up to the same major version.
  2974. // Otherwise increment major.
  2975. // 1.0.0-5 bumps to 1.0.0
  2976. // 1.1.0 bumps to 2.0.0
  2977. if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0)
  2978. this.major++;
  2979. this.minor = 0;
  2980. this.patch = 0;
  2981. this.prerelease = [];
  2982. break;
  2983. case 'minor':
  2984. // If this is a pre-minor version, bump up to the same minor version.
  2985. // Otherwise increment minor.
  2986. // 1.2.0-5 bumps to 1.2.0
  2987. // 1.2.1 bumps to 1.3.0
  2988. if (this.patch !== 0 || this.prerelease.length === 0)
  2989. this.minor++;
  2990. this.patch = 0;
  2991. this.prerelease = [];
  2992. break;
  2993. case 'patch':
  2994. // If this is not a pre-release version, it will increment the patch.
  2995. // If it is a pre-release it will bump up to the same patch version.
  2996. // 1.2.0-5 patches to 1.2.0
  2997. // 1.2.0 patches to 1.2.1
  2998. if (this.prerelease.length === 0)
  2999. this.patch++;
  3000. this.prerelease = [];
  3001. break;
  3002. // This probably shouldn't be used publicly.
  3003. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3004. case 'pre':
  3005. if (this.prerelease.length === 0)
  3006. this.prerelease = [0];
  3007. else {
  3008. var i = this.prerelease.length;
  3009. while (--i >= 0) {
  3010. if (typeof this.prerelease[i] === 'number') {
  3011. this.prerelease[i]++;
  3012. i = -2;
  3013. }
  3014. }
  3015. if (i === -1) // didn't increment anything
  3016. this.prerelease.push(0);
  3017. }
  3018. if (identifier) {
  3019. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3020. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3021. if (this.prerelease[0] === identifier) {
  3022. if (isNaN(this.prerelease[1]))
  3023. this.prerelease = [identifier, 0];
  3024. } else
  3025. this.prerelease = [identifier, 0];
  3026. }
  3027. break;
  3028. default:
  3029. throw new Error('invalid increment argument: ' + release);
  3030. }
  3031. this.format();
  3032. this.raw = this.version;
  3033. return this;
  3034. };
  3035. exports.inc = inc;
  3036. function inc(version, release, loose, identifier) {
  3037. if (typeof(loose) === 'string') {
  3038. identifier = loose;
  3039. loose = undefined;
  3040. }
  3041. try {
  3042. return new SemVer(version, loose).inc(release, identifier).version;
  3043. } catch (er) {
  3044. return null;
  3045. }
  3046. }
  3047. exports.diff = diff;
  3048. function diff(version1, version2) {
  3049. if (eq(version1, version2)) {
  3050. return null;
  3051. } else {
  3052. var v1 = parse(version1);
  3053. var v2 = parse(version2);
  3054. if (v1.prerelease.length || v2.prerelease.length) {
  3055. for (var key in v1) {
  3056. if (key === 'major' || key === 'minor' || key === 'patch') {
  3057. if (v1[key] !== v2[key]) {
  3058. return 'pre'+key;
  3059. }
  3060. }
  3061. }
  3062. return 'prerelease';
  3063. }
  3064. for (var key in v1) {
  3065. if (key === 'major' || key === 'minor' || key === 'patch') {
  3066. if (v1[key] !== v2[key]) {
  3067. return key;
  3068. }
  3069. }
  3070. }
  3071. }
  3072. }
  3073. exports.compareIdentifiers = compareIdentifiers;
  3074. var numeric = /^[0-9]+$/;
  3075. function compareIdentifiers(a, b) {
  3076. var anum = numeric.test(a);
  3077. var bnum = numeric.test(b);
  3078. if (anum && bnum) {
  3079. a = +a;
  3080. b = +b;
  3081. }
  3082. return (anum && !bnum) ? -1 :
  3083. (bnum && !anum) ? 1 :
  3084. a < b ? -1 :
  3085. a > b ? 1 :
  3086. 0;
  3087. }
  3088. exports.rcompareIdentifiers = rcompareIdentifiers;
  3089. function rcompareIdentifiers(a, b) {
  3090. return compareIdentifiers(b, a);
  3091. }
  3092. exports.major = major;
  3093. function major(a, loose) {
  3094. return new SemVer(a, loose).major;
  3095. }
  3096. exports.minor = minor;
  3097. function minor(a, loose) {
  3098. return new SemVer(a, loose).minor;
  3099. }
  3100. exports.patch = patch;
  3101. function patch(a, loose) {
  3102. return new SemVer(a, loose).patch;
  3103. }
  3104. exports.compare = compare;
  3105. function compare(a, b, loose) {
  3106. return new SemVer(a, loose).compare(new SemVer(b, loose));
  3107. }
  3108. exports.compareLoose = compareLoose;
  3109. function compareLoose(a, b) {
  3110. return compare(a, b, true);
  3111. }
  3112. exports.rcompare = rcompare;
  3113. function rcompare(a, b, loose) {
  3114. return compare(b, a, loose);
  3115. }
  3116. exports.sort = sort;
  3117. function sort(list, loose) {
  3118. return list.sort(function(a, b) {
  3119. return exports.compare(a, b, loose);
  3120. });
  3121. }
  3122. exports.rsort = rsort;
  3123. function rsort(list, loose) {
  3124. return list.sort(function(a, b) {
  3125. return exports.rcompare(a, b, loose);
  3126. });
  3127. }
  3128. exports.gt = gt;
  3129. function gt(a, b, loose) {
  3130. return compare(a, b, loose) > 0;
  3131. }
  3132. exports.lt = lt;
  3133. function lt(a, b, loose) {
  3134. return compare(a, b, loose) < 0;
  3135. }
  3136. exports.eq = eq;
  3137. function eq(a, b, loose) {
  3138. return compare(a, b, loose) === 0;
  3139. }
  3140. exports.neq = neq;
  3141. function neq(a, b, loose) {
  3142. return compare(a, b, loose) !== 0;
  3143. }
  3144. exports.gte = gte;
  3145. function gte(a, b, loose) {
  3146. return compare(a, b, loose) >= 0;
  3147. }
  3148. exports.lte = lte;
  3149. function lte(a, b, loose) {
  3150. return compare(a, b, loose) <= 0;
  3151. }
  3152. exports.cmp = cmp;
  3153. function cmp(a, op, b, loose) {
  3154. var ret;
  3155. switch (op) {
  3156. case '===':
  3157. if (typeof a === 'object') a = a.version;
  3158. if (typeof b === 'object') b = b.version;
  3159. ret = a === b;
  3160. break;
  3161. case '!==':
  3162. if (typeof a === 'object') a = a.version;
  3163. if (typeof b === 'object') b = b.version;
  3164. ret = a !== b;
  3165. break;
  3166. case '': case '=': case '==': ret = eq(a, b, loose); break;
  3167. case '!=': ret = neq(a, b, loose); break;
  3168. case '>': ret = gt(a, b, loose); break;
  3169. case '>=': ret = gte(a, b, loose); break;
  3170. case '<': ret = lt(a, b, loose); break;
  3171. case '<=': ret = lte(a, b, loose); break;
  3172. default: throw new TypeError('Invalid operator: ' + op);
  3173. }
  3174. return ret;
  3175. }
  3176. exports.Comparator = Comparator;
  3177. function Comparator(comp, loose) {
  3178. if (comp instanceof Comparator) {
  3179. if (comp.loose === loose)
  3180. return comp;
  3181. else
  3182. comp = comp.value;
  3183. }
  3184. if (!(this instanceof Comparator))
  3185. return new Comparator(comp, loose);
  3186. debug('comparator', comp, loose);
  3187. this.loose = loose;
  3188. this.parse(comp);
  3189. if (this.semver === ANY)
  3190. this.value = '';
  3191. else
  3192. this.value = this.operator + this.semver.version;
  3193. debug('comp', this);
  3194. }
  3195. var ANY = {};
  3196. Comparator.prototype.parse = function(comp) {
  3197. var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
  3198. var m = comp.match(r);
  3199. if (!m)
  3200. throw new TypeError('Invalid comparator: ' + comp);
  3201. this.operator = m[1];
  3202. if (this.operator === '=')
  3203. this.operator = '';
  3204. // if it literally is just '>' or '' then allow anything.
  3205. if (!m[2])
  3206. this.semver = ANY;
  3207. else
  3208. this.semver = new SemVer(m[2], this.loose);
  3209. };
  3210. Comparator.prototype.toString = function() {
  3211. return this.value;
  3212. };
  3213. Comparator.prototype.test = function(version) {
  3214. debug('Comparator.test', version, this.loose);
  3215. if (this.semver === ANY)
  3216. return true;
  3217. if (typeof version === 'string')
  3218. version = new SemVer(version, this.loose);
  3219. return cmp(version, this.operator, this.semver, this.loose);
  3220. };
  3221. Comparator.prototype.intersects = function(comp, loose) {
  3222. if (!(comp instanceof Comparator)) {
  3223. throw new TypeError('a Comparator is required');
  3224. }
  3225. var rangeTmp;
  3226. if (this.operator === '') {
  3227. rangeTmp = new Range(comp.value, loose);
  3228. return satisfies(this.value, rangeTmp, loose);
  3229. } else if (comp.operator === '') {
  3230. rangeTmp = new Range(this.value, loose);
  3231. return satisfies(comp.semver, rangeTmp, loose);
  3232. }
  3233. var sameDirectionIncreasing =
  3234. (this.operator === '>=' || this.operator === '>') &&
  3235. (comp.operator === '>=' || comp.operator === '>');
  3236. var sameDirectionDecreasing =
  3237. (this.operator === '<=' || this.operator === '<') &&
  3238. (comp.operator === '<=' || comp.operator === '<');
  3239. var sameSemVer = this.semver.version === comp.semver.version;
  3240. var differentDirectionsInclusive =
  3241. (this.operator === '>=' || this.operator === '<=') &&
  3242. (comp.operator === '>=' || comp.operator === '<=');
  3243. var oppositeDirectionsLessThan =
  3244. cmp(this.semver, '<', comp.semver, loose) &&
  3245. ((this.operator === '>=' || this.operator === '>') &&
  3246. (comp.operator === '<=' || comp.operator === '<'));
  3247. var oppositeDirectionsGreaterThan =
  3248. cmp(this.semver, '>', comp.semver, loose) &&
  3249. ((this.operator === '<=' || this.operator === '<') &&
  3250. (comp.operator === '>=' || comp.operator === '>'));
  3251. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3252. (sameSemVer && differentDirectionsInclusive) ||
  3253. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
  3254. };
  3255. exports.Range = Range;
  3256. function Range(range, loose) {
  3257. if (range instanceof Range) {
  3258. if (range.loose === loose) {
  3259. return range;
  3260. } else {
  3261. return new Range(range.raw, loose);
  3262. }
  3263. }
  3264. if (range instanceof Comparator) {
  3265. return new Range(range.value, loose);
  3266. }
  3267. if (!(this instanceof Range))
  3268. return new Range(range, loose);
  3269. this.loose = loose;
  3270. // First, split based on boolean or ||
  3271. this.raw = range;
  3272. this.set = range.split(/\s*\|\|\s*/).map(function(range) {
  3273. return this.parseRange(range.trim());
  3274. }, this).filter(function(c) {
  3275. // throw out any that are not relevant for whatever reason
  3276. return c.length;
  3277. });
  3278. if (!this.set.length) {
  3279. throw new TypeError('Invalid SemVer Range: ' + range);
  3280. }
  3281. this.format();
  3282. }
  3283. Range.prototype.format = function() {
  3284. this.range = this.set.map(function(comps) {
  3285. return comps.join(' ').trim();
  3286. }).join('||').trim();
  3287. return this.range;
  3288. };
  3289. Range.prototype.toString = function() {
  3290. return this.range;
  3291. };
  3292. Range.prototype.parseRange = function(range) {
  3293. var loose = this.loose;
  3294. range = range.trim();
  3295. debug('range', range, loose);
  3296. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3297. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE];
  3298. range = range.replace(hr, hyphenReplace);
  3299. debug('hyphen replace', range);
  3300. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3301. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace);
  3302. debug('comparator trim', range, re[COMPARATORTRIM]);
  3303. // `~ 1.2.3` => `~1.2.3`
  3304. range = range.replace(re[TILDETRIM], tildeTrimReplace);
  3305. // `^ 1.2.3` => `^1.2.3`
  3306. range = range.replace(re[CARETTRIM], caretTrimReplace);
  3307. // normalize spaces
  3308. range = range.split(/\s+/).join(' ');
  3309. // At this point, the range is completely trimmed and
  3310. // ready to be split into comparators.
  3311. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
  3312. var set = range.split(' ').map(function(comp) {
  3313. return parseComparator(comp, loose);
  3314. }).join(' ').split(/\s+/);
  3315. if (this.loose) {
  3316. // in loose mode, throw out any that are not valid comparators
  3317. set = set.filter(function(comp) {
  3318. return !!comp.match(compRe);
  3319. });
  3320. }
  3321. set = set.map(function(comp) {
  3322. return new Comparator(comp, loose);
  3323. });
  3324. return set;
  3325. };
  3326. Range.prototype.intersects = function(range, loose) {
  3327. if (!(range instanceof Range)) {
  3328. throw new TypeError('a Range is required');
  3329. }
  3330. return this.set.some(function(thisComparators) {
  3331. return thisComparators.every(function(thisComparator) {
  3332. return range.set.some(function(rangeComparators) {
  3333. return rangeComparators.every(function(rangeComparator) {
  3334. return thisComparator.intersects(rangeComparator, loose);
  3335. });
  3336. });
  3337. });
  3338. });
  3339. };
  3340. // Mostly just for testing and legacy API reasons
  3341. exports.toComparators = toComparators;
  3342. function toComparators(range, loose) {
  3343. return new Range(range, loose).set.map(function(comp) {
  3344. return comp.map(function(c) {
  3345. return c.value;
  3346. }).join(' ').trim().split(' ');
  3347. });
  3348. }
  3349. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3350. // already replaced the hyphen ranges
  3351. // turn into a set of JUST comparators.
  3352. function parseComparator(comp, loose) {
  3353. debug('comp', comp);
  3354. comp = replaceCarets(comp, loose);
  3355. debug('caret', comp);
  3356. comp = replaceTildes(comp, loose);
  3357. debug('tildes', comp);
  3358. comp = replaceXRanges(comp, loose);
  3359. debug('xrange', comp);
  3360. comp = replaceStars(comp, loose);
  3361. debug('stars', comp);
  3362. return comp;
  3363. }
  3364. function isX(id) {
  3365. return !id || id.toLowerCase() === 'x' || id === '*';
  3366. }
  3367. // ~, ~> --> * (any, kinda silly)
  3368. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3369. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3370. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3371. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3372. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3373. function replaceTildes(comp, loose) {
  3374. return comp.trim().split(/\s+/).map(function(comp) {
  3375. return replaceTilde(comp, loose);
  3376. }).join(' ');
  3377. }
  3378. function replaceTilde(comp, loose) {
  3379. var r = loose ? re[TILDELOOSE] : re[TILDE];
  3380. return comp.replace(r, function(_, M, m, p, pr) {
  3381. debug('tilde', comp, _, M, m, p, pr);
  3382. var ret;
  3383. if (isX(M))
  3384. ret = '';
  3385. else if (isX(m))
  3386. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
  3387. else if (isX(p))
  3388. // ~1.2 == >=1.2.0 <1.3.0
  3389. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
  3390. else if (pr) {
  3391. debug('replaceTilde pr', pr);
  3392. if (pr.charAt(0) !== '-')
  3393. pr = '-' + pr;
  3394. ret = '>=' + M + '.' + m + '.' + p + pr +
  3395. ' <' + M + '.' + (+m + 1) + '.0';
  3396. } else
  3397. // ~1.2.3 == >=1.2.3 <1.3.0
  3398. ret = '>=' + M + '.' + m + '.' + p +
  3399. ' <' + M + '.' + (+m + 1) + '.0';
  3400. debug('tilde return', ret);
  3401. return ret;
  3402. });
  3403. }
  3404. // ^ --> * (any, kinda silly)
  3405. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  3406. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  3407. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  3408. // ^1.2.3 --> >=1.2.3 <2.0.0
  3409. // ^1.2.0 --> >=1.2.0 <2.0.0
  3410. function replaceCarets(comp, loose) {
  3411. return comp.trim().split(/\s+/).map(function(comp) {
  3412. return replaceCaret(comp, loose);
  3413. }).join(' ');
  3414. }
  3415. function replaceCaret(comp, loose) {
  3416. debug('caret', comp, loose);
  3417. var r = loose ? re[CARETLOOSE] : re[CARET];
  3418. return comp.replace(r, function(_, M, m, p, pr) {
  3419. debug('caret', comp, _, M, m, p, pr);
  3420. var ret;
  3421. if (isX(M))
  3422. ret = '';
  3423. else if (isX(m))
  3424. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
  3425. else if (isX(p)) {
  3426. if (M === '0')
  3427. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
  3428. else
  3429. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0';
  3430. } else if (pr) {
  3431. debug('replaceCaret pr', pr);
  3432. if (pr.charAt(0) !== '-')
  3433. pr = '-' + pr;
  3434. if (M === '0') {
  3435. if (m === '0')
  3436. ret = '>=' + M + '.' + m + '.' + p + pr +
  3437. ' <' + M + '.' + m + '.' + (+p + 1);
  3438. else
  3439. ret = '>=' + M + '.' + m + '.' + p + pr +
  3440. ' <' + M + '.' + (+m + 1) + '.0';
  3441. } else
  3442. ret = '>=' + M + '.' + m + '.' + p + pr +
  3443. ' <' + (+M + 1) + '.0.0';
  3444. } else {
  3445. debug('no pr');
  3446. if (M === '0') {
  3447. if (m === '0')
  3448. ret = '>=' + M + '.' + m + '.' + p +
  3449. ' <' + M + '.' + m + '.' + (+p + 1);
  3450. else
  3451. ret = '>=' + M + '.' + m + '.' + p +
  3452. ' <' + M + '.' + (+m + 1) + '.0';
  3453. } else
  3454. ret = '>=' + M + '.' + m + '.' + p +
  3455. ' <' + (+M + 1) + '.0.0';
  3456. }
  3457. debug('caret return', ret);
  3458. return ret;
  3459. });
  3460. }
  3461. function replaceXRanges(comp, loose) {
  3462. debug('replaceXRanges', comp, loose);
  3463. return comp.split(/\s+/).map(function(comp) {
  3464. return replaceXRange(comp, loose);
  3465. }).join(' ');
  3466. }
  3467. function replaceXRange(comp, loose) {
  3468. comp = comp.trim();
  3469. var r = loose ? re[XRANGELOOSE] : re[XRANGE];
  3470. return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
  3471. debug('xRange', comp, ret, gtlt, M, m, p, pr);
  3472. var xM = isX(M);
  3473. var xm = xM || isX(m);
  3474. var xp = xm || isX(p);
  3475. var anyX = xp;
  3476. if (gtlt === '=' && anyX)
  3477. gtlt = '';
  3478. if (xM) {
  3479. if (gtlt === '>' || gtlt === '<') {
  3480. // nothing is allowed
  3481. ret = '<0.0.0';
  3482. } else {
  3483. // nothing is forbidden
  3484. ret = '*';
  3485. }
  3486. } else if (gtlt && anyX) {
  3487. // replace X with 0
  3488. if (xm)
  3489. m = 0;
  3490. if (xp)
  3491. p = 0;
  3492. if (gtlt === '>') {
  3493. // >1 => >=2.0.0
  3494. // >1.2 => >=1.3.0
  3495. // >1.2.3 => >= 1.2.4
  3496. gtlt = '>=';
  3497. if (xm) {
  3498. M = +M + 1;
  3499. m = 0;
  3500. p = 0;
  3501. } else if (xp) {
  3502. m = +m + 1;
  3503. p = 0;
  3504. }
  3505. } else if (gtlt === '<=') {
  3506. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  3507. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  3508. gtlt = '<';
  3509. if (xm)
  3510. M = +M + 1;
  3511. else
  3512. m = +m + 1;
  3513. }
  3514. ret = gtlt + M + '.' + m + '.' + p;
  3515. } else if (xm) {
  3516. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
  3517. } else if (xp) {
  3518. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
  3519. }
  3520. debug('xRange return', ret);
  3521. return ret;
  3522. });
  3523. }
  3524. // Because * is AND-ed with everything else in the comparator,
  3525. // and '' means "any version", just remove the *s entirely.
  3526. function replaceStars(comp, loose) {
  3527. debug('replaceStars', comp, loose);
  3528. // Looseness is ignored here. star is always as loose as it gets!
  3529. return comp.trim().replace(re[STAR], '');
  3530. }
  3531. // This function is passed to string.replace(re[HYPHENRANGE])
  3532. // M, m, patch, prerelease, build
  3533. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  3534. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  3535. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  3536. function hyphenReplace($0,
  3537. from, fM, fm, fp, fpr, fb,
  3538. to, tM, tm, tp, tpr, tb) {
  3539. if (isX(fM))
  3540. from = '';
  3541. else if (isX(fm))
  3542. from = '>=' + fM + '.0.0';
  3543. else if (isX(fp))
  3544. from = '>=' + fM + '.' + fm + '.0';
  3545. else
  3546. from = '>=' + from;
  3547. if (isX(tM))
  3548. to = '';
  3549. else if (isX(tm))
  3550. to = '<' + (+tM + 1) + '.0.0';
  3551. else if (isX(tp))
  3552. to = '<' + tM + '.' + (+tm + 1) + '.0';
  3553. else if (tpr)
  3554. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;
  3555. else
  3556. to = '<=' + to;
  3557. return (from + ' ' + to).trim();
  3558. }
  3559. // if ANY of the sets match ALL of its comparators, then pass
  3560. Range.prototype.test = function(version) {
  3561. if (!version)
  3562. return false;
  3563. if (typeof version === 'string')
  3564. version = new SemVer(version, this.loose);
  3565. for (var i = 0; i < this.set.length; i++) {
  3566. if (testSet(this.set[i], version))
  3567. return true;
  3568. }
  3569. return false;
  3570. };
  3571. function testSet(set, version) {
  3572. for (var i = 0; i < set.length; i++) {
  3573. if (!set[i].test(version))
  3574. return false;
  3575. }
  3576. if (version.prerelease.length) {
  3577. // Find the set of versions that are allowed to have prereleases
  3578. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  3579. // That should allow `1.2.3-pr.2` to pass.
  3580. // However, `1.2.4-alpha.notready` should NOT be allowed,
  3581. // even though it's within the range set by the comparators.
  3582. for (var i = 0; i < set.length; i++) {
  3583. debug(set[i].semver);
  3584. if (set[i].semver === ANY)
  3585. continue;
  3586. if (set[i].semver.prerelease.length > 0) {
  3587. var allowed = set[i].semver;
  3588. if (allowed.major === version.major &&
  3589. allowed.minor === version.minor &&
  3590. allowed.patch === version.patch)
  3591. return true;
  3592. }
  3593. }
  3594. // Version has a -pre, but it's not one of the ones we like.
  3595. return false;
  3596. }
  3597. return true;
  3598. }
  3599. exports.satisfies = satisfies;
  3600. function satisfies(version, range, loose) {
  3601. try {
  3602. range = new Range(range, loose);
  3603. } catch (er) {
  3604. return false;
  3605. }
  3606. return range.test(version);
  3607. }
  3608. exports.maxSatisfying = maxSatisfying;
  3609. function maxSatisfying(versions, range, loose) {
  3610. var max = null;
  3611. var maxSV = null;
  3612. try {
  3613. var rangeObj = new Range(range, loose);
  3614. } catch (er) {
  3615. return null;
  3616. }
  3617. versions.forEach(function (v) {
  3618. if (rangeObj.test(v)) { // satisfies(v, range, loose)
  3619. if (!max || maxSV.compare(v) === -1) { // compare(max, v, true)
  3620. max = v;
  3621. maxSV = new SemVer(max, loose);
  3622. }
  3623. }
  3624. })
  3625. return max;
  3626. }
  3627. exports.minSatisfying = minSatisfying;
  3628. function minSatisfying(versions, range, loose) {
  3629. var min = null;
  3630. var minSV = null;
  3631. try {
  3632. var rangeObj = new Range(range, loose);
  3633. } catch (er) {
  3634. return null;
  3635. }
  3636. versions.forEach(function (v) {
  3637. if (rangeObj.test(v)) { // satisfies(v, range, loose)
  3638. if (!min || minSV.compare(v) === 1) { // compare(min, v, true)
  3639. min = v;
  3640. minSV = new SemVer(min, loose);
  3641. }
  3642. }
  3643. })
  3644. return min;
  3645. }
  3646. exports.validRange = validRange;
  3647. function validRange(range, loose) {
  3648. try {
  3649. // Return '*' instead of '' so that truthiness works.
  3650. // This will throw if it's invalid anyway
  3651. return new Range(range, loose).range || '*';
  3652. } catch (er) {
  3653. return null;
  3654. }
  3655. }
  3656. // Determine if version is less than all the versions possible in the range
  3657. exports.ltr = ltr;
  3658. function ltr(version, range, loose) {
  3659. return outside(version, range, '<', loose);
  3660. }
  3661. // Determine if version is greater than all the versions possible in the range.
  3662. exports.gtr = gtr;
  3663. function gtr(version, range, loose) {
  3664. return outside(version, range, '>', loose);
  3665. }
  3666. exports.outside = outside;
  3667. function outside(version, range, hilo, loose) {
  3668. version = new SemVer(version, loose);
  3669. range = new Range(range, loose);
  3670. var gtfn, ltefn, ltfn, comp, ecomp;
  3671. switch (hilo) {
  3672. case '>':
  3673. gtfn = gt;
  3674. ltefn = lte;
  3675. ltfn = lt;
  3676. comp = '>';
  3677. ecomp = '>=';
  3678. break;
  3679. case '<':
  3680. gtfn = lt;
  3681. ltefn = gte;
  3682. ltfn = gt;
  3683. comp = '<';
  3684. ecomp = '<=';
  3685. break;
  3686. default:
  3687. throw new TypeError('Must provide a hilo val of "<" or ">"');
  3688. }
  3689. // If it satisifes the range it is not outside
  3690. if (satisfies(version, range, loose)) {
  3691. return false;
  3692. }
  3693. // From now on, variable terms are as if we're in "gtr" mode.
  3694. // but note that everything is flipped for the "ltr" function.
  3695. for (var i = 0; i < range.set.length; ++i) {
  3696. var comparators = range.set[i];
  3697. var high = null;
  3698. var low = null;
  3699. comparators.forEach(function(comparator) {
  3700. if (comparator.semver === ANY) {
  3701. comparator = new Comparator('>=0.0.0')
  3702. }
  3703. high = high || comparator;
  3704. low = low || comparator;
  3705. if (gtfn(comparator.semver, high.semver, loose)) {
  3706. high = comparator;
  3707. } else if (ltfn(comparator.semver, low.semver, loose)) {
  3708. low = comparator;
  3709. }
  3710. });
  3711. // If the edge version comparator has a operator then our version
  3712. // isn't outside it
  3713. if (high.operator === comp || high.operator === ecomp) {
  3714. return false;
  3715. }
  3716. // If the lowest version comparator has an operator and our version
  3717. // is less than it then it isn't higher than the range
  3718. if ((!low.operator || low.operator === comp) &&
  3719. ltefn(version, low.semver)) {
  3720. return false;
  3721. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  3722. return false;
  3723. }
  3724. }
  3725. return true;
  3726. }
  3727. exports.prerelease = prerelease;
  3728. function prerelease(version, loose) {
  3729. var parsed = parse(version, loose);
  3730. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null;
  3731. }
  3732. exports.intersects = intersects;
  3733. function intersects(r1, r2, loose) {
  3734. r1 = new Range(r1, loose)
  3735. r2 = new Range(r2, loose)
  3736. return r1.intersects(r2)
  3737. }
  3738. exports.coerce = coerce;
  3739. function coerce(version) {
  3740. if (version instanceof SemVer)
  3741. return version;
  3742. if (typeof version !== 'string')
  3743. return null;
  3744. var match = version.match(re[COERCE]);
  3745. if (match == null)
  3746. return null;
  3747. return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0'));
  3748. }
  3749. /***/ }),
  3750. /* 28 */
  3751. /***/ (function(module, exports, __webpack_require__) {
  3752. "use strict";
  3753. Object.defineProperty(exports, "__esModule", {
  3754. value: true
  3755. });
  3756. var _promise;
  3757. function _load_promise() {
  3758. return _promise = _interopRequireDefault(__webpack_require__(7));
  3759. }
  3760. exports.sortAlpha = sortAlpha;
  3761. exports.sortOptionsByFlags = sortOptionsByFlags;
  3762. exports.entries = entries;
  3763. exports.removePrefix = removePrefix;
  3764. exports.removeSuffix = removeSuffix;
  3765. exports.addSuffix = addSuffix;
  3766. exports.hyphenate = hyphenate;
  3767. exports.camelCase = camelCase;
  3768. exports.compareSortedArrays = compareSortedArrays;
  3769. exports.sleep = sleep;
  3770. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3771. var _camelCase = __webpack_require__(562);
  3772. function sortAlpha(a, b) {
  3773. // sort alphabetically in a deterministic way
  3774. var shortLen = Math.min(a.length, b.length);
  3775. for (var i = 0; i < shortLen; i++) {
  3776. var aChar = a.charCodeAt(i);
  3777. var bChar = b.charCodeAt(i);
  3778. if (aChar !== bChar) {
  3779. return aChar - bChar;
  3780. }
  3781. }
  3782. return a.length - b.length;
  3783. }
  3784. function sortOptionsByFlags(a, b) {
  3785. var aOpt = a.flags.replace(/-/g, '');
  3786. var bOpt = b.flags.replace(/-/g, '');
  3787. return sortAlpha(aOpt, bOpt);
  3788. }
  3789. function entries(obj) {
  3790. var entries = [];
  3791. if (obj) {
  3792. for (var _key in obj) {
  3793. entries.push([_key, obj[_key]]);
  3794. }
  3795. }
  3796. return entries;
  3797. }
  3798. function removePrefix(pattern, prefix) {
  3799. if (pattern.startsWith(prefix)) {
  3800. pattern = pattern.slice(prefix.length);
  3801. }
  3802. return pattern;
  3803. }
  3804. function removeSuffix(pattern, suffix) {
  3805. if (pattern.endsWith(suffix)) {
  3806. return pattern.slice(0, -suffix.length);
  3807. }
  3808. return pattern;
  3809. }
  3810. function addSuffix(pattern, suffix) {
  3811. if (!pattern.endsWith(suffix)) {
  3812. return pattern + suffix;
  3813. }
  3814. return pattern;
  3815. }
  3816. function hyphenate(str) {
  3817. return str.replace(/[A-Z]/g, function (match) {
  3818. return '-' + match.charAt(0).toLowerCase();
  3819. });
  3820. }
  3821. function camelCase(str) {
  3822. if (/[A-Z]/.test(str)) {
  3823. return null;
  3824. } else {
  3825. return _camelCase(str);
  3826. }
  3827. }
  3828. function compareSortedArrays(array1, array2) {
  3829. if (array1.length !== array2.length) {
  3830. return false;
  3831. }
  3832. for (var i = 0, len = array1.length; i < len; i++) {
  3833. if (array1[i] !== array2[i]) {
  3834. return false;
  3835. }
  3836. }
  3837. return true;
  3838. }
  3839. function sleep(ms) {
  3840. return new (_promise || _load_promise()).default(function (resolve) {
  3841. setTimeout(resolve, ms);
  3842. });
  3843. }
  3844. /***/ }),
  3845. /* 29 */
  3846. /***/ (function(module, exports) {
  3847. module.exports = require("url");
  3848. /***/ }),
  3849. /* 30 */
  3850. /***/ (function(module, exports, __webpack_require__) {
  3851. "use strict";
  3852. var YAMLException = __webpack_require__(132);
  3853. var TYPE_CONSTRUCTOR_OPTIONS = [
  3854. 'kind',
  3855. 'resolve',
  3856. 'construct',
  3857. 'instanceOf',
  3858. 'predicate',
  3859. 'represent',
  3860. 'defaultStyle',
  3861. 'styleAliases'
  3862. ];
  3863. var YAML_NODE_KINDS = [
  3864. 'scalar',
  3865. 'sequence',
  3866. 'mapping'
  3867. ];
  3868. function compileStyleAliases(map) {
  3869. var result = {};
  3870. if (map !== null) {
  3871. Object.keys(map).forEach(function (style) {
  3872. map[style].forEach(function (alias) {
  3873. result[String(alias)] = style;
  3874. });
  3875. });
  3876. }
  3877. return result;
  3878. }
  3879. function Type(tag, options) {
  3880. options = options || {};
  3881. Object.keys(options).forEach(function (name) {
  3882. if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
  3883. throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
  3884. }
  3885. });
  3886. // TODO: Add tag format check.
  3887. this.tag = tag;
  3888. this.kind = options['kind'] || null;
  3889. this.resolve = options['resolve'] || function () { return true; };
  3890. this.construct = options['construct'] || function (data) { return data; };
  3891. this.instanceOf = options['instanceOf'] || null;
  3892. this.predicate = options['predicate'] || null;
  3893. this.represent = options['represent'] || null;
  3894. this.defaultStyle = options['defaultStyle'] || null;
  3895. this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
  3896. if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
  3897. throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
  3898. }
  3899. }
  3900. module.exports = Type;
  3901. /***/ }),
  3902. /* 31 */
  3903. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3904. "use strict";
  3905. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; });
  3906. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(48);
  3907. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isObject__ = __webpack_require__(414);
  3908. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(143);
  3909. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(59);
  3910. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(55);
  3911. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__ = __webpack_require__(411);
  3912. /** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_tryCatch,_util_errorObject,_util_UnsubscriptionError PURE_IMPORTS_END */
  3913. var Subscription = /*@__PURE__*/ (function () {
  3914. function Subscription(unsubscribe) {
  3915. this.closed = false;
  3916. this._parent = null;
  3917. this._parents = null;
  3918. this._subscriptions = null;
  3919. if (unsubscribe) {
  3920. this._unsubscribe = unsubscribe;
  3921. }
  3922. }
  3923. Subscription.prototype.unsubscribe = function () {
  3924. var hasErrors = false;
  3925. var errors;
  3926. if (this.closed) {
  3927. return;
  3928. }
  3929. var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
  3930. this.closed = true;
  3931. this._parent = null;
  3932. this._parents = null;
  3933. this._subscriptions = null;
  3934. var index = -1;
  3935. var len = _parents ? _parents.length : 0;
  3936. while (_parent) {
  3937. _parent.remove(this);
  3938. _parent = ++index < len && _parents[index] || null;
  3939. }
  3940. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(_unsubscribe)) {
  3941. var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(_unsubscribe).call(this);
  3942. if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) {
  3943. hasErrors = true;
  3944. errors = errors || (__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */] ?
  3945. flattenUnsubscriptionErrors(__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e.errors) : [__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e]);
  3946. }
  3947. }
  3948. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(_subscriptions)) {
  3949. index = -1;
  3950. len = _subscriptions.length;
  3951. while (++index < len) {
  3952. var sub = _subscriptions[index];
  3953. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isObject__["a" /* isObject */])(sub)) {
  3954. var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(sub.unsubscribe).call(sub);
  3955. if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) {
  3956. hasErrors = true;
  3957. errors = errors || [];
  3958. var err = __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e;
  3959. if (err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) {
  3960. errors = errors.concat(flattenUnsubscriptionErrors(err.errors));
  3961. }
  3962. else {
  3963. errors.push(err);
  3964. }
  3965. }
  3966. }
  3967. }
  3968. }
  3969. if (hasErrors) {
  3970. throw new __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */](errors);
  3971. }
  3972. };
  3973. Subscription.prototype.add = function (teardown) {
  3974. if (!teardown || (teardown === Subscription.EMPTY)) {
  3975. return Subscription.EMPTY;
  3976. }
  3977. if (teardown === this) {
  3978. return this;
  3979. }
  3980. var subscription = teardown;
  3981. switch (typeof teardown) {
  3982. case 'function':
  3983. subscription = new Subscription(teardown);
  3984. case 'object':
  3985. if (subscription.closed || typeof subscription.unsubscribe !== 'function') {
  3986. return subscription;
  3987. }
  3988. else if (this.closed) {
  3989. subscription.unsubscribe();
  3990. return subscription;
  3991. }
  3992. else if (typeof subscription._addParent !== 'function') {
  3993. var tmp = subscription;
  3994. subscription = new Subscription();
  3995. subscription._subscriptions = [tmp];
  3996. }
  3997. break;
  3998. default:
  3999. throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
  4000. }
  4001. var subscriptions = this._subscriptions || (this._subscriptions = []);
  4002. subscriptions.push(subscription);
  4003. subscription._addParent(this);
  4004. return subscription;
  4005. };
  4006. Subscription.prototype.remove = function (subscription) {
  4007. var subscriptions = this._subscriptions;
  4008. if (subscriptions) {
  4009. var subscriptionIndex = subscriptions.indexOf(subscription);
  4010. if (subscriptionIndex !== -1) {
  4011. subscriptions.splice(subscriptionIndex, 1);
  4012. }
  4013. }
  4014. };
  4015. Subscription.prototype._addParent = function (parent) {
  4016. var _a = this, _parent = _a._parent, _parents = _a._parents;
  4017. if (!_parent || _parent === parent) {
  4018. this._parent = parent;
  4019. }
  4020. else if (!_parents) {
  4021. this._parents = [parent];
  4022. }
  4023. else if (_parents.indexOf(parent) === -1) {
  4024. _parents.push(parent);
  4025. }
  4026. };
  4027. Subscription.EMPTY = (function (empty) {
  4028. empty.closed = true;
  4029. return empty;
  4030. }(new Subscription()));
  4031. return Subscription;
  4032. }());
  4033. function flattenUnsubscriptionErrors(errors) {
  4034. return errors.reduce(function (errs, err) { return errs.concat((err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) ? err.errors : err); }, []);
  4035. }
  4036. //# sourceMappingURL=Subscription.js.map
  4037. /***/ }),
  4038. /* 32 */
  4039. /***/ (function(module, exports, __webpack_require__) {
  4040. // Copyright 2015 Joyent, Inc.
  4041. module.exports = {
  4042. bufferSplit: bufferSplit,
  4043. addRSAMissing: addRSAMissing,
  4044. calculateDSAPublic: calculateDSAPublic,
  4045. calculateED25519Public: calculateED25519Public,
  4046. calculateX25519Public: calculateX25519Public,
  4047. mpNormalize: mpNormalize,
  4048. mpDenormalize: mpDenormalize,
  4049. ecNormalize: ecNormalize,
  4050. countZeros: countZeros,
  4051. assertCompatible: assertCompatible,
  4052. isCompatible: isCompatible,
  4053. opensslKeyDeriv: opensslKeyDeriv,
  4054. opensshCipherInfo: opensshCipherInfo,
  4055. publicFromPrivateECDSA: publicFromPrivateECDSA,
  4056. zeroPadToLength: zeroPadToLength,
  4057. writeBitString: writeBitString,
  4058. readBitString: readBitString
  4059. };
  4060. var assert = __webpack_require__(22);
  4061. var Buffer = __webpack_require__(20).Buffer;
  4062. var PrivateKey = __webpack_require__(40);
  4063. var Key = __webpack_require__(35);
  4064. var crypto = __webpack_require__(21);
  4065. var algs = __webpack_require__(39);
  4066. var asn1 = __webpack_require__(67);
  4067. var ec, jsbn;
  4068. var nacl;
  4069. var MAX_CLASS_DEPTH = 3;
  4070. function isCompatible(obj, klass, needVer) {
  4071. if (obj === null || typeof (obj) !== 'object')
  4072. return (false);
  4073. if (needVer === undefined)
  4074. needVer = klass.prototype._sshpkApiVersion;
  4075. if (obj instanceof klass &&
  4076. klass.prototype._sshpkApiVersion[0] == needVer[0])
  4077. return (true);
  4078. var proto = Object.getPrototypeOf(obj);
  4079. var depth = 0;
  4080. while (proto.constructor.name !== klass.name) {
  4081. proto = Object.getPrototypeOf(proto);
  4082. if (!proto || ++depth > MAX_CLASS_DEPTH)
  4083. return (false);
  4084. }
  4085. if (proto.constructor.name !== klass.name)
  4086. return (false);
  4087. var ver = proto._sshpkApiVersion;
  4088. if (ver === undefined)
  4089. ver = klass._oldVersionDetect(obj);
  4090. if (ver[0] != needVer[0] || ver[1] < needVer[1])
  4091. return (false);
  4092. return (true);
  4093. }
  4094. function assertCompatible(obj, klass, needVer, name) {
  4095. if (name === undefined)
  4096. name = 'object';
  4097. assert.ok(obj, name + ' must not be null');
  4098. assert.object(obj, name + ' must be an object');
  4099. if (needVer === undefined)
  4100. needVer = klass.prototype._sshpkApiVersion;
  4101. if (obj instanceof klass &&
  4102. klass.prototype._sshpkApiVersion[0] == needVer[0])
  4103. return;
  4104. var proto = Object.getPrototypeOf(obj);
  4105. var depth = 0;
  4106. while (proto.constructor.name !== klass.name) {
  4107. proto = Object.getPrototypeOf(proto);
  4108. assert.ok(proto && ++depth <= MAX_CLASS_DEPTH,
  4109. name + ' must be a ' + klass.name + ' instance');
  4110. }
  4111. assert.strictEqual(proto.constructor.name, klass.name,
  4112. name + ' must be a ' + klass.name + ' instance');
  4113. var ver = proto._sshpkApiVersion;
  4114. if (ver === undefined)
  4115. ver = klass._oldVersionDetect(obj);
  4116. assert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1],
  4117. name + ' must be compatible with ' + klass.name + ' klass ' +
  4118. 'version ' + needVer[0] + '.' + needVer[1]);
  4119. }
  4120. var CIPHER_LEN = {
  4121. 'des-ede3-cbc': { key: 7, iv: 8 },
  4122. 'aes-128-cbc': { key: 16, iv: 16 }
  4123. };
  4124. var PKCS5_SALT_LEN = 8;
  4125. function opensslKeyDeriv(cipher, salt, passphrase, count) {
  4126. assert.buffer(salt, 'salt');
  4127. assert.buffer(passphrase, 'passphrase');
  4128. assert.number(count, 'iteration count');
  4129. var clen = CIPHER_LEN[cipher];
  4130. assert.object(clen, 'supported cipher');
  4131. salt = salt.slice(0, PKCS5_SALT_LEN);
  4132. var D, D_prev, bufs;
  4133. var material = Buffer.alloc(0);
  4134. while (material.length < clen.key + clen.iv) {
  4135. bufs = [];
  4136. if (D_prev)
  4137. bufs.push(D_prev);
  4138. bufs.push(passphrase);
  4139. bufs.push(salt);
  4140. D = Buffer.concat(bufs);
  4141. for (var j = 0; j < count; ++j)
  4142. D = crypto.createHash('md5').update(D).digest();
  4143. material = Buffer.concat([material, D]);
  4144. D_prev = D;
  4145. }
  4146. return ({
  4147. key: material.slice(0, clen.key),
  4148. iv: material.slice(clen.key, clen.key + clen.iv)
  4149. });
  4150. }
  4151. /* Count leading zero bits on a buffer */
  4152. function countZeros(buf) {
  4153. var o = 0, obit = 8;
  4154. while (o < buf.length) {
  4155. var mask = (1 << obit);
  4156. if ((buf[o] & mask) === mask)
  4157. break;
  4158. obit--;
  4159. if (obit < 0) {
  4160. o++;
  4161. obit = 8;
  4162. }
  4163. }
  4164. return (o*8 + (8 - obit) - 1);
  4165. }
  4166. function bufferSplit(buf, chr) {
  4167. assert.buffer(buf);
  4168. assert.string(chr);
  4169. var parts = [];
  4170. var lastPart = 0;
  4171. var matches = 0;
  4172. for (var i = 0; i < buf.length; ++i) {
  4173. if (buf[i] === chr.charCodeAt(matches))
  4174. ++matches;
  4175. else if (buf[i] === chr.charCodeAt(0))
  4176. matches = 1;
  4177. else
  4178. matches = 0;
  4179. if (matches >= chr.length) {
  4180. var newPart = i + 1;
  4181. parts.push(buf.slice(lastPart, newPart - matches));
  4182. lastPart = newPart;
  4183. matches = 0;
  4184. }
  4185. }
  4186. if (lastPart <= buf.length)
  4187. parts.push(buf.slice(lastPart, buf.length));
  4188. return (parts);
  4189. }
  4190. function ecNormalize(buf, addZero) {
  4191. assert.buffer(buf);
  4192. if (buf[0] === 0x00 && buf[1] === 0x04) {
  4193. if (addZero)
  4194. return (buf);
  4195. return (buf.slice(1));
  4196. } else if (buf[0] === 0x04) {
  4197. if (!addZero)
  4198. return (buf);
  4199. } else {
  4200. while (buf[0] === 0x00)
  4201. buf = buf.slice(1);
  4202. if (buf[0] === 0x02 || buf[0] === 0x03)
  4203. throw (new Error('Compressed elliptic curve points ' +
  4204. 'are not supported'));
  4205. if (buf[0] !== 0x04)
  4206. throw (new Error('Not a valid elliptic curve point'));
  4207. if (!addZero)
  4208. return (buf);
  4209. }
  4210. var b = Buffer.alloc(buf.length + 1);
  4211. b[0] = 0x0;
  4212. buf.copy(b, 1);
  4213. return (b);
  4214. }
  4215. function readBitString(der, tag) {
  4216. if (tag === undefined)
  4217. tag = asn1.Ber.BitString;
  4218. var buf = der.readString(tag, true);
  4219. assert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' +
  4220. 'not supported (0x' + buf[0].toString(16) + ')');
  4221. return (buf.slice(1));
  4222. }
  4223. function writeBitString(der, buf, tag) {
  4224. if (tag === undefined)
  4225. tag = asn1.Ber.BitString;
  4226. var b = Buffer.alloc(buf.length + 1);
  4227. b[0] = 0x00;
  4228. buf.copy(b, 1);
  4229. der.writeBuffer(b, tag);
  4230. }
  4231. function mpNormalize(buf) {
  4232. assert.buffer(buf);
  4233. while (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00)
  4234. buf = buf.slice(1);
  4235. if ((buf[0] & 0x80) === 0x80) {
  4236. var b = Buffer.alloc(buf.length + 1);
  4237. b[0] = 0x00;
  4238. buf.copy(b, 1);
  4239. buf = b;
  4240. }
  4241. return (buf);
  4242. }
  4243. function mpDenormalize(buf) {
  4244. assert.buffer(buf);
  4245. while (buf.length > 1 && buf[0] === 0x00)
  4246. buf = buf.slice(1);
  4247. return (buf);
  4248. }
  4249. function zeroPadToLength(buf, len) {
  4250. assert.buffer(buf);
  4251. assert.number(len);
  4252. while (buf.length > len) {
  4253. assert.equal(buf[0], 0x00);
  4254. buf = buf.slice(1);
  4255. }
  4256. while (buf.length < len) {
  4257. var b = Buffer.alloc(buf.length + 1);
  4258. b[0] = 0x00;
  4259. buf.copy(b, 1);
  4260. buf = b;
  4261. }
  4262. return (buf);
  4263. }
  4264. function bigintToMpBuf(bigint) {
  4265. var buf = Buffer.from(bigint.toByteArray());
  4266. buf = mpNormalize(buf);
  4267. return (buf);
  4268. }
  4269. function calculateDSAPublic(g, p, x) {
  4270. assert.buffer(g);
  4271. assert.buffer(p);
  4272. assert.buffer(x);
  4273. try {
  4274. var bigInt = __webpack_require__(79).BigInteger;
  4275. } catch (e) {
  4276. throw (new Error('To load a PKCS#8 format DSA private key, ' +
  4277. 'the node jsbn library is required.'));
  4278. }
  4279. g = new bigInt(g);
  4280. p = new bigInt(p);
  4281. x = new bigInt(x);
  4282. var y = g.modPow(x, p);
  4283. var ybuf = bigintToMpBuf(y);
  4284. return (ybuf);
  4285. }
  4286. function calculateED25519Public(k) {
  4287. assert.buffer(k);
  4288. if (nacl === undefined)
  4289. nacl = __webpack_require__(72);
  4290. var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k));
  4291. return (Buffer.from(kp.publicKey));
  4292. }
  4293. function calculateX25519Public(k) {
  4294. assert.buffer(k);
  4295. if (nacl === undefined)
  4296. nacl = __webpack_require__(72);
  4297. var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k));
  4298. return (Buffer.from(kp.publicKey));
  4299. }
  4300. function addRSAMissing(key) {
  4301. assert.object(key);
  4302. assertCompatible(key, PrivateKey, [1, 1]);
  4303. try {
  4304. var bigInt = __webpack_require__(79).BigInteger;
  4305. } catch (e) {
  4306. throw (new Error('To write a PEM private key from ' +
  4307. 'this source, the node jsbn lib is required.'));
  4308. }
  4309. var d = new bigInt(key.part.d.data);
  4310. var buf;
  4311. if (!key.part.dmodp) {
  4312. var p = new bigInt(key.part.p.data);
  4313. var dmodp = d.mod(p.subtract(1));
  4314. buf = bigintToMpBuf(dmodp);
  4315. key.part.dmodp = {name: 'dmodp', data: buf};
  4316. key.parts.push(key.part.dmodp);
  4317. }
  4318. if (!key.part.dmodq) {
  4319. var q = new bigInt(key.part.q.data);
  4320. var dmodq = d.mod(q.subtract(1));
  4321. buf = bigintToMpBuf(dmodq);
  4322. key.part.dmodq = {name: 'dmodq', data: buf};
  4323. key.parts.push(key.part.dmodq);
  4324. }
  4325. }
  4326. function publicFromPrivateECDSA(curveName, priv) {
  4327. assert.string(curveName, 'curveName');
  4328. assert.buffer(priv);
  4329. if (ec === undefined)
  4330. ec = __webpack_require__(130);
  4331. if (jsbn === undefined)
  4332. jsbn = __webpack_require__(79).BigInteger;
  4333. var params = algs.curves[curveName];
  4334. var p = new jsbn(params.p);
  4335. var a = new jsbn(params.a);
  4336. var b = new jsbn(params.b);
  4337. var curve = new ec.ECCurveFp(p, a, b);
  4338. var G = curve.decodePointHex(params.G.toString('hex'));
  4339. var d = new jsbn(mpNormalize(priv));
  4340. var pub = G.multiply(d);
  4341. pub = Buffer.from(curve.encodePointHex(pub), 'hex');
  4342. var parts = [];
  4343. parts.push({name: 'curve', data: Buffer.from(curveName)});
  4344. parts.push({name: 'Q', data: pub});
  4345. var key = new Key({type: 'ecdsa', curve: curve, parts: parts});
  4346. return (key);
  4347. }
  4348. function opensshCipherInfo(cipher) {
  4349. var inf = {};
  4350. switch (cipher) {
  4351. case '3des-cbc':
  4352. inf.keySize = 24;
  4353. inf.blockSize = 8;
  4354. inf.opensslName = 'des-ede3-cbc';
  4355. break;
  4356. case 'blowfish-cbc':
  4357. inf.keySize = 16;
  4358. inf.blockSize = 8;
  4359. inf.opensslName = 'bf-cbc';
  4360. break;
  4361. case 'aes128-cbc':
  4362. case 'aes128-ctr':
  4363. case 'aes128-gcm@openssh.com':
  4364. inf.keySize = 16;
  4365. inf.blockSize = 16;
  4366. inf.opensslName = 'aes-128-' + cipher.slice(7, 10);
  4367. break;
  4368. case 'aes192-cbc':
  4369. case 'aes192-ctr':
  4370. case 'aes192-gcm@openssh.com':
  4371. inf.keySize = 24;
  4372. inf.blockSize = 16;
  4373. inf.opensslName = 'aes-192-' + cipher.slice(7, 10);
  4374. break;
  4375. case 'aes256-cbc':
  4376. case 'aes256-ctr':
  4377. case 'aes256-gcm@openssh.com':
  4378. inf.keySize = 32;
  4379. inf.blockSize = 16;
  4380. inf.opensslName = 'aes-256-' + cipher.slice(7, 10);
  4381. break;
  4382. default:
  4383. throw (new Error(
  4384. 'Unsupported openssl cipher "' + cipher + '"'));
  4385. }
  4386. return (inf);
  4387. }
  4388. /***/ }),
  4389. /* 33 */
  4390. /***/ (function(module, exports, __webpack_require__) {
  4391. "use strict";
  4392. const escapeStringRegexp = __webpack_require__(351);
  4393. const ansiStyles = __webpack_require__(447);
  4394. const stdoutColor = __webpack_require__(564).stdout;
  4395. const template = __webpack_require__(565);
  4396. const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
  4397. // `supportsColor.level` → `ansiStyles.color[name]` mapping
  4398. const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
  4399. // `color-convert` models to exclude from the Chalk API due to conflicts and such
  4400. const skipModels = new Set(['gray']);
  4401. const styles = Object.create(null);
  4402. function applyOptions(obj, options) {
  4403. options = options || {};
  4404. // Detect level if not set manually
  4405. const scLevel = stdoutColor ? stdoutColor.level : 0;
  4406. obj.level = options.level === undefined ? scLevel : options.level;
  4407. obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
  4408. }
  4409. function Chalk(options) {
  4410. // We check for this.template here since calling `chalk.constructor()`
  4411. // by itself will have a `this` of a previously constructed chalk object
  4412. if (!this || !(this instanceof Chalk) || this.template) {
  4413. const chalk = {};
  4414. applyOptions(chalk, options);
  4415. chalk.template = function () {
  4416. const args = [].slice.call(arguments);
  4417. return chalkTag.apply(null, [chalk.template].concat(args));
  4418. };
  4419. Object.setPrototypeOf(chalk, Chalk.prototype);
  4420. Object.setPrototypeOf(chalk.template, chalk);
  4421. chalk.template.constructor = Chalk;
  4422. return chalk.template;
  4423. }
  4424. applyOptions(this, options);
  4425. }
  4426. // Use bright blue on Windows as the normal blue color is illegible
  4427. if (isSimpleWindowsTerm) {
  4428. ansiStyles.blue.open = '\u001B[94m';
  4429. }
  4430. for (const key of Object.keys(ansiStyles)) {
  4431. ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
  4432. styles[key] = {
  4433. get() {
  4434. const codes = ansiStyles[key];
  4435. return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
  4436. }
  4437. };
  4438. }
  4439. styles.visible = {
  4440. get() {
  4441. return build.call(this, this._styles || [], true, 'visible');
  4442. }
  4443. };
  4444. ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
  4445. for (const model of Object.keys(ansiStyles.color.ansi)) {
  4446. if (skipModels.has(model)) {
  4447. continue;
  4448. }
  4449. styles[model] = {
  4450. get() {
  4451. const level = this.level;
  4452. return function () {
  4453. const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
  4454. const codes = {
  4455. open,
  4456. close: ansiStyles.color.close,
  4457. closeRe: ansiStyles.color.closeRe
  4458. };
  4459. return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
  4460. };
  4461. }
  4462. };
  4463. }
  4464. ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
  4465. for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
  4466. if (skipModels.has(model)) {
  4467. continue;
  4468. }
  4469. const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
  4470. styles[bgModel] = {
  4471. get() {
  4472. const level = this.level;
  4473. return function () {
  4474. const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
  4475. const codes = {
  4476. open,
  4477. close: ansiStyles.bgColor.close,
  4478. closeRe: ansiStyles.bgColor.closeRe
  4479. };
  4480. return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
  4481. };
  4482. }
  4483. };
  4484. }
  4485. const proto = Object.defineProperties(() => {}, styles);
  4486. function build(_styles, _empty, key) {
  4487. const builder = function () {
  4488. return applyStyle.apply(builder, arguments);
  4489. };
  4490. builder._styles = _styles;
  4491. builder._empty = _empty;
  4492. const self = this;
  4493. Object.defineProperty(builder, 'level', {
  4494. enumerable: true,
  4495. get() {
  4496. return self.level;
  4497. },
  4498. set(level) {
  4499. self.level = level;
  4500. }
  4501. });
  4502. Object.defineProperty(builder, 'enabled', {
  4503. enumerable: true,
  4504. get() {
  4505. return self.enabled;
  4506. },
  4507. set(enabled) {
  4508. self.enabled = enabled;
  4509. }
  4510. });
  4511. // See below for fix regarding invisible grey/dim combination on Windows
  4512. builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
  4513. // `__proto__` is used because we must return a function, but there is
  4514. // no way to create a function with a different prototype
  4515. builder.__proto__ = proto; // eslint-disable-line no-proto
  4516. return builder;
  4517. }
  4518. function applyStyle() {
  4519. // Support varags, but simply cast to string in case there's only one arg
  4520. const args = arguments;
  4521. const argsLen = args.length;
  4522. let str = String(arguments[0]);
  4523. if (argsLen === 0) {
  4524. return '';
  4525. }
  4526. if (argsLen > 1) {
  4527. // Don't slice `arguments`, it prevents V8 optimizations
  4528. for (let a = 1; a < argsLen; a++) {
  4529. str += ' ' + args[a];
  4530. }
  4531. }
  4532. if (!this.enabled || this.level <= 0 || !str) {
  4533. return this._empty ? '' : str;
  4534. }
  4535. // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
  4536. // see https://github.com/chalk/chalk/issues/58
  4537. // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
  4538. const originalDim = ansiStyles.dim.open;
  4539. if (isSimpleWindowsTerm && this.hasGrey) {
  4540. ansiStyles.dim.open = '';
  4541. }
  4542. for (const code of this._styles.slice().reverse()) {
  4543. // Replace any instances already present with a re-opening code
  4544. // otherwise only the part of the string until said closing code
  4545. // will be colored, and the rest will simply be 'plain'.
  4546. str = code.open + str.replace(code.closeRe, code.open) + code.close;
  4547. // Close the styling before a linebreak and reopen
  4548. // after next line to fix a bleed issue on macOS
  4549. // https://github.com/chalk/chalk/pull/92
  4550. str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
  4551. }
  4552. // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
  4553. ansiStyles.dim.open = originalDim;
  4554. return str;
  4555. }
  4556. function chalkTag(chalk, strings) {
  4557. if (!Array.isArray(strings)) {
  4558. // If chalk() was called by itself or with a string,
  4559. // return the string itself as a string.
  4560. return [].slice.call(arguments, 1).join(' ');
  4561. }
  4562. const args = [].slice.call(arguments, 2);
  4563. const parts = [strings.raw[0]];
  4564. for (let i = 1; i < strings.length; i++) {
  4565. parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
  4566. parts.push(String(strings.raw[i]));
  4567. }
  4568. return template(chalk, parts.join(''));
  4569. }
  4570. Object.defineProperties(Chalk.prototype, styles);
  4571. module.exports = Chalk(); // eslint-disable-line new-cap
  4572. module.exports.supportsColor = stdoutColor;
  4573. module.exports.default = module.exports; // For TypeScript
  4574. /***/ }),
  4575. /* 34 */
  4576. /***/ (function(module, exports, __webpack_require__) {
  4577. var global = __webpack_require__(38);
  4578. var core = __webpack_require__(26);
  4579. var ctx = __webpack_require__(68);
  4580. var hide = __webpack_require__(77);
  4581. var has = __webpack_require__(89);
  4582. var PROTOTYPE = 'prototype';
  4583. var $export = function (type, name, source) {
  4584. var IS_FORCED = type & $export.F;
  4585. var IS_GLOBAL = type & $export.G;
  4586. var IS_STATIC = type & $export.S;
  4587. var IS_PROTO = type & $export.P;
  4588. var IS_BIND = type & $export.B;
  4589. var IS_WRAP = type & $export.W;
  4590. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  4591. var expProto = exports[PROTOTYPE];
  4592. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
  4593. var key, own, out;
  4594. if (IS_GLOBAL) source = name;
  4595. for (key in source) {
  4596. // contains in native
  4597. own = !IS_FORCED && target && target[key] !== undefined;
  4598. if (own && has(exports, key)) continue;
  4599. // export native or passed
  4600. out = own ? target[key] : source[key];
  4601. // prevent global pollution for namespaces
  4602. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  4603. // bind timers to global for call from export context
  4604. : IS_BIND && own ? ctx(out, global)
  4605. // wrap global constructors for prevent change them in library
  4606. : IS_WRAP && target[key] == out ? (function (C) {
  4607. var F = function (a, b, c) {
  4608. if (this instanceof C) {
  4609. switch (arguments.length) {
  4610. case 0: return new C();
  4611. case 1: return new C(a);
  4612. case 2: return new C(a, b);
  4613. } return new C(a, b, c);
  4614. } return C.apply(this, arguments);
  4615. };
  4616. F[PROTOTYPE] = C[PROTOTYPE];
  4617. return F;
  4618. // make static versions for prototype methods
  4619. })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  4620. // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
  4621. if (IS_PROTO) {
  4622. (exports.virtual || (exports.virtual = {}))[key] = out;
  4623. // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
  4624. if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
  4625. }
  4626. }
  4627. };
  4628. // type bitmap
  4629. $export.F = 1; // forced
  4630. $export.G = 2; // global
  4631. $export.S = 4; // static
  4632. $export.P = 8; // proto
  4633. $export.B = 16; // bind
  4634. $export.W = 32; // wrap
  4635. $export.U = 64; // safe
  4636. $export.R = 128; // real proto method for `library`
  4637. module.exports = $export;
  4638. /***/ }),
  4639. /* 35 */
  4640. /***/ (function(module, exports, __webpack_require__) {
  4641. // Copyright 2017 Joyent, Inc.
  4642. module.exports = Key;
  4643. var assert = __webpack_require__(22);
  4644. var algs = __webpack_require__(39);
  4645. var crypto = __webpack_require__(21);
  4646. var Fingerprint = __webpack_require__(145);
  4647. var Signature = __webpack_require__(71);
  4648. var DiffieHellman = __webpack_require__(266).DiffieHellman;
  4649. var errs = __webpack_require__(70);
  4650. var utils = __webpack_require__(32);
  4651. var PrivateKey = __webpack_require__(40);
  4652. var edCompat;
  4653. try {
  4654. edCompat = __webpack_require__(424);
  4655. } catch (e) {
  4656. /* Just continue through, and bail out if we try to use it. */
  4657. }
  4658. var InvalidAlgorithmError = errs.InvalidAlgorithmError;
  4659. var KeyParseError = errs.KeyParseError;
  4660. var formats = {};
  4661. formats['auto'] = __webpack_require__(425);
  4662. formats['pem'] = __webpack_require__(82);
  4663. formats['pkcs1'] = __webpack_require__(268);
  4664. formats['pkcs8'] = __webpack_require__(146);
  4665. formats['rfc4253'] = __webpack_require__(92);
  4666. formats['ssh'] = __webpack_require__(426);
  4667. formats['ssh-private'] = __webpack_require__(183);
  4668. formats['openssh'] = formats['ssh-private'];
  4669. formats['dnssec'] = __webpack_require__(267);
  4670. function Key(opts) {
  4671. assert.object(opts, 'options');
  4672. assert.arrayOfObject(opts.parts, 'options.parts');
  4673. assert.string(opts.type, 'options.type');
  4674. assert.optionalString(opts.comment, 'options.comment');
  4675. var algInfo = algs.info[opts.type];
  4676. if (typeof (algInfo) !== 'object')
  4677. throw (new InvalidAlgorithmError(opts.type));
  4678. var partLookup = {};
  4679. for (var i = 0; i < opts.parts.length; ++i) {
  4680. var part = opts.parts[i];
  4681. partLookup[part.name] = part;
  4682. }
  4683. this.type = opts.type;
  4684. this.parts = opts.parts;
  4685. this.part = partLookup;
  4686. this.comment = undefined;
  4687. this.source = opts.source;
  4688. /* for speeding up hashing/fingerprint operations */
  4689. this._rfc4253Cache = opts._rfc4253Cache;
  4690. this._hashCache = {};
  4691. var sz;
  4692. this.curve = undefined;
  4693. if (this.type === 'ecdsa') {
  4694. var curve = this.part.curve.data.toString();
  4695. this.curve = curve;
  4696. sz = algs.curves[curve].size;
  4697. } else if (this.type === 'ed25519' || this.type === 'curve25519') {
  4698. sz = 256;
  4699. this.curve = 'curve25519';
  4700. } else {
  4701. var szPart = this.part[algInfo.sizePart];
  4702. sz = szPart.data.length;
  4703. sz = sz * 8 - utils.countZeros(szPart.data);
  4704. }
  4705. this.size = sz;
  4706. }
  4707. Key.formats = formats;
  4708. Key.prototype.toBuffer = function (format, options) {
  4709. if (format === undefined)
  4710. format = 'ssh';
  4711. assert.string(format, 'format');
  4712. assert.object(formats[format], 'formats[format]');
  4713. assert.optionalObject(options, 'options');
  4714. if (format === 'rfc4253') {
  4715. if (this._rfc4253Cache === undefined)
  4716. this._rfc4253Cache = formats['rfc4253'].write(this);
  4717. return (this._rfc4253Cache);
  4718. }
  4719. return (formats[format].write(this, options));
  4720. };
  4721. Key.prototype.toString = function (format, options) {
  4722. return (this.toBuffer(format, options).toString());
  4723. };
  4724. Key.prototype.hash = function (algo) {
  4725. assert.string(algo, 'algorithm');
  4726. algo = algo.toLowerCase();
  4727. if (algs.hashAlgs[algo] === undefined)
  4728. throw (new InvalidAlgorithmError(algo));
  4729. if (this._hashCache[algo])
  4730. return (this._hashCache[algo]);
  4731. var hash = crypto.createHash(algo).
  4732. update(this.toBuffer('rfc4253')).digest();
  4733. this._hashCache[algo] = hash;
  4734. return (hash);
  4735. };
  4736. Key.prototype.fingerprint = function (algo) {
  4737. if (algo === undefined)
  4738. algo = 'sha256';
  4739. assert.string(algo, 'algorithm');
  4740. var opts = {
  4741. type: 'key',
  4742. hash: this.hash(algo),
  4743. algorithm: algo
  4744. };
  4745. return (new Fingerprint(opts));
  4746. };
  4747. Key.prototype.defaultHashAlgorithm = function () {
  4748. var hashAlgo = 'sha1';
  4749. if (this.type === 'rsa')
  4750. hashAlgo = 'sha256';
  4751. if (this.type === 'dsa' && this.size > 1024)
  4752. hashAlgo = 'sha256';
  4753. if (this.type === 'ed25519')
  4754. hashAlgo = 'sha512';
  4755. if (this.type === 'ecdsa') {
  4756. if (this.size <= 256)
  4757. hashAlgo = 'sha256';
  4758. else if (this.size <= 384)
  4759. hashAlgo = 'sha384';
  4760. else
  4761. hashAlgo = 'sha512';
  4762. }
  4763. return (hashAlgo);
  4764. };
  4765. Key.prototype.createVerify = function (hashAlgo) {
  4766. if (hashAlgo === undefined)
  4767. hashAlgo = this.defaultHashAlgorithm();
  4768. assert.string(hashAlgo, 'hash algorithm');
  4769. /* ED25519 is not supported by OpenSSL, use a javascript impl. */
  4770. if (this.type === 'ed25519' && edCompat !== undefined)
  4771. return (new edCompat.Verifier(this, hashAlgo));
  4772. if (this.type === 'curve25519')
  4773. throw (new Error('Curve25519 keys are not suitable for ' +
  4774. 'signing or verification'));
  4775. var v, nm, err;
  4776. try {
  4777. nm = hashAlgo.toUpperCase();
  4778. v = crypto.createVerify(nm);
  4779. } catch (e) {
  4780. err = e;
  4781. }
  4782. if (v === undefined || (err instanceof Error &&
  4783. err.message.match(/Unknown message digest/))) {
  4784. nm = 'RSA-';
  4785. nm += hashAlgo.toUpperCase();
  4786. v = crypto.createVerify(nm);
  4787. }
  4788. assert.ok(v, 'failed to create verifier');
  4789. var oldVerify = v.verify.bind(v);
  4790. var key = this.toBuffer('pkcs8');
  4791. var curve = this.curve;
  4792. var self = this;
  4793. v.verify = function (signature, fmt) {
  4794. if (Signature.isSignature(signature, [2, 0])) {
  4795. if (signature.type !== self.type)
  4796. return (false);
  4797. if (signature.hashAlgorithm &&
  4798. signature.hashAlgorithm !== hashAlgo)
  4799. return (false);
  4800. if (signature.curve && self.type === 'ecdsa' &&
  4801. signature.curve !== curve)
  4802. return (false);
  4803. return (oldVerify(key, signature.toBuffer('asn1')));
  4804. } else if (typeof (signature) === 'string' ||
  4805. Buffer.isBuffer(signature)) {
  4806. return (oldVerify(key, signature, fmt));
  4807. /*
  4808. * Avoid doing this on valid arguments, walking the prototype
  4809. * chain can be quite slow.
  4810. */
  4811. } else if (Signature.isSignature(signature, [1, 0])) {
  4812. throw (new Error('signature was created by too old ' +
  4813. 'a version of sshpk and cannot be verified'));
  4814. } else {
  4815. throw (new TypeError('signature must be a string, ' +
  4816. 'Buffer, or Signature object'));
  4817. }
  4818. };
  4819. return (v);
  4820. };
  4821. Key.prototype.createDiffieHellman = function () {
  4822. if (this.type === 'rsa')
  4823. throw (new Error('RSA keys do not support Diffie-Hellman'));
  4824. return (new DiffieHellman(this));
  4825. };
  4826. Key.prototype.createDH = Key.prototype.createDiffieHellman;
  4827. Key.parse = function (data, format, options) {
  4828. if (typeof (data) !== 'string')
  4829. assert.buffer(data, 'data');
  4830. if (format === undefined)
  4831. format = 'auto';
  4832. assert.string(format, 'format');
  4833. if (typeof (options) === 'string')
  4834. options = { filename: options };
  4835. assert.optionalObject(options, 'options');
  4836. if (options === undefined)
  4837. options = {};
  4838. assert.optionalString(options.filename, 'options.filename');
  4839. if (options.filename === undefined)
  4840. options.filename = '(unnamed)';
  4841. assert.object(formats[format], 'formats[format]');
  4842. try {
  4843. var k = formats[format].read(data, options);
  4844. if (k instanceof PrivateKey)
  4845. k = k.toPublic();
  4846. if (!k.comment)
  4847. k.comment = options.filename;
  4848. return (k);
  4849. } catch (e) {
  4850. if (e.name === 'KeyEncryptedError')
  4851. throw (e);
  4852. throw (new KeyParseError(options.filename, format, e));
  4853. }
  4854. };
  4855. Key.isKey = function (obj, ver) {
  4856. return (utils.isCompatible(obj, Key, ver));
  4857. };
  4858. /*
  4859. * API versions for Key:
  4860. * [1,0] -- initial ver, may take Signature for createVerify or may not
  4861. * [1,1] -- added pkcs1, pkcs8 formats
  4862. * [1,2] -- added auto, ssh-private, openssh formats
  4863. * [1,3] -- added defaultHashAlgorithm
  4864. * [1,4] -- added ed support, createDH
  4865. * [1,5] -- first explicitly tagged version
  4866. * [1,6] -- changed ed25519 part names
  4867. */
  4868. Key.prototype._sshpkApiVersion = [1, 6];
  4869. Key._oldVersionDetect = function (obj) {
  4870. assert.func(obj.toBuffer);
  4871. assert.func(obj.fingerprint);
  4872. if (obj.createDH)
  4873. return ([1, 4]);
  4874. if (obj.defaultHashAlgorithm)
  4875. return ([1, 3]);
  4876. if (obj.formats['auto'])
  4877. return ([1, 2]);
  4878. if (obj.formats['pkcs1'])
  4879. return ([1, 1]);
  4880. return ([1, 0]);
  4881. };
  4882. /***/ }),
  4883. /* 36 */
  4884. /***/ (function(module, exports) {
  4885. module.exports = require("stream");
  4886. /***/ }),
  4887. /* 37 */
  4888. /***/ (function(module, exports, __webpack_require__) {
  4889. module.exports = { "default": __webpack_require__(592), __esModule: true };
  4890. /***/ }),
  4891. /* 38 */
  4892. /***/ (function(module, exports) {
  4893. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  4894. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  4895. ? window : typeof self != 'undefined' && self.Math == Math ? self
  4896. // eslint-disable-next-line no-new-func
  4897. : Function('return this')();
  4898. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  4899. /***/ }),
  4900. /* 39 */
  4901. /***/ (function(module, exports, __webpack_require__) {
  4902. // Copyright 2015 Joyent, Inc.
  4903. var Buffer = __webpack_require__(20).Buffer;
  4904. var algInfo = {
  4905. 'dsa': {
  4906. parts: ['p', 'q', 'g', 'y'],
  4907. sizePart: 'p'
  4908. },
  4909. 'rsa': {
  4910. parts: ['e', 'n'],
  4911. sizePart: 'n'
  4912. },
  4913. 'ecdsa': {
  4914. parts: ['curve', 'Q'],
  4915. sizePart: 'Q'
  4916. },
  4917. 'ed25519': {
  4918. parts: ['A'],
  4919. sizePart: 'A'
  4920. }
  4921. };
  4922. algInfo['curve25519'] = algInfo['ed25519'];
  4923. var algPrivInfo = {
  4924. 'dsa': {
  4925. parts: ['p', 'q', 'g', 'y', 'x']
  4926. },
  4927. 'rsa': {
  4928. parts: ['n', 'e', 'd', 'iqmp', 'p', 'q']
  4929. },
  4930. 'ecdsa': {
  4931. parts: ['curve', 'Q', 'd']
  4932. },
  4933. 'ed25519': {
  4934. parts: ['A', 'k']
  4935. }
  4936. };
  4937. algPrivInfo['curve25519'] = algPrivInfo['ed25519'];
  4938. var hashAlgs = {
  4939. 'md5': true,
  4940. 'sha1': true,
  4941. 'sha256': true,
  4942. 'sha384': true,
  4943. 'sha512': true
  4944. };
  4945. /*
  4946. * Taken from
  4947. * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf
  4948. */
  4949. var curves = {
  4950. 'nistp256': {
  4951. size: 256,
  4952. pkcs8oid: '1.2.840.10045.3.1.7',
  4953. p: Buffer.from(('00' +
  4954. 'ffffffff 00000001 00000000 00000000' +
  4955. '00000000 ffffffff ffffffff ffffffff').
  4956. replace(/ /g, ''), 'hex'),
  4957. a: Buffer.from(('00' +
  4958. 'FFFFFFFF 00000001 00000000 00000000' +
  4959. '00000000 FFFFFFFF FFFFFFFF FFFFFFFC').
  4960. replace(/ /g, ''), 'hex'),
  4961. b: Buffer.from((
  4962. '5ac635d8 aa3a93e7 b3ebbd55 769886bc' +
  4963. '651d06b0 cc53b0f6 3bce3c3e 27d2604b').
  4964. replace(/ /g, ''), 'hex'),
  4965. s: Buffer.from(('00' +
  4966. 'c49d3608 86e70493 6a6678e1 139d26b7' +
  4967. '819f7e90').
  4968. replace(/ /g, ''), 'hex'),
  4969. n: Buffer.from(('00' +
  4970. 'ffffffff 00000000 ffffffff ffffffff' +
  4971. 'bce6faad a7179e84 f3b9cac2 fc632551').
  4972. replace(/ /g, ''), 'hex'),
  4973. G: Buffer.from(('04' +
  4974. '6b17d1f2 e12c4247 f8bce6e5 63a440f2' +
  4975. '77037d81 2deb33a0 f4a13945 d898c296' +
  4976. '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' +
  4977. '2bce3357 6b315ece cbb64068 37bf51f5').
  4978. replace(/ /g, ''), 'hex')
  4979. },
  4980. 'nistp384': {
  4981. size: 384,
  4982. pkcs8oid: '1.3.132.0.34',
  4983. p: Buffer.from(('00' +
  4984. 'ffffffff ffffffff ffffffff ffffffff' +
  4985. 'ffffffff ffffffff ffffffff fffffffe' +
  4986. 'ffffffff 00000000 00000000 ffffffff').
  4987. replace(/ /g, ''), 'hex'),
  4988. a: Buffer.from(('00' +
  4989. 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
  4990. 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' +
  4991. 'FFFFFFFF 00000000 00000000 FFFFFFFC').
  4992. replace(/ /g, ''), 'hex'),
  4993. b: Buffer.from((
  4994. 'b3312fa7 e23ee7e4 988e056b e3f82d19' +
  4995. '181d9c6e fe814112 0314088f 5013875a' +
  4996. 'c656398d 8a2ed19d 2a85c8ed d3ec2aef').
  4997. replace(/ /g, ''), 'hex'),
  4998. s: Buffer.from(('00' +
  4999. 'a335926a a319a27a 1d00896a 6773a482' +
  5000. '7acdac73').
  5001. replace(/ /g, ''), 'hex'),
  5002. n: Buffer.from(('00' +
  5003. 'ffffffff ffffffff ffffffff ffffffff' +
  5004. 'ffffffff ffffffff c7634d81 f4372ddf' +
  5005. '581a0db2 48b0a77a ecec196a ccc52973').
  5006. replace(/ /g, ''), 'hex'),
  5007. G: Buffer.from(('04' +
  5008. 'aa87ca22 be8b0537 8eb1c71e f320ad74' +
  5009. '6e1d3b62 8ba79b98 59f741e0 82542a38' +
  5010. '5502f25d bf55296c 3a545e38 72760ab7' +
  5011. '3617de4a 96262c6f 5d9e98bf 9292dc29' +
  5012. 'f8f41dbd 289a147c e9da3113 b5f0b8c0' +
  5013. '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f').
  5014. replace(/ /g, ''), 'hex')
  5015. },
  5016. 'nistp521': {
  5017. size: 521,
  5018. pkcs8oid: '1.3.132.0.35',
  5019. p: Buffer.from((
  5020. '01ffffff ffffffff ffffffff ffffffff' +
  5021. 'ffffffff ffffffff ffffffff ffffffff' +
  5022. 'ffffffff ffffffff ffffffff ffffffff' +
  5023. 'ffffffff ffffffff ffffffff ffffffff' +
  5024. 'ffff').replace(/ /g, ''), 'hex'),
  5025. a: Buffer.from(('01FF' +
  5026. 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
  5027. 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
  5028. 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
  5029. 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC').
  5030. replace(/ /g, ''), 'hex'),
  5031. b: Buffer.from(('51' +
  5032. '953eb961 8e1c9a1f 929a21a0 b68540ee' +
  5033. 'a2da725b 99b315f3 b8b48991 8ef109e1' +
  5034. '56193951 ec7e937b 1652c0bd 3bb1bf07' +
  5035. '3573df88 3d2c34f1 ef451fd4 6b503f00').
  5036. replace(/ /g, ''), 'hex'),
  5037. s: Buffer.from(('00' +
  5038. 'd09e8800 291cb853 96cc6717 393284aa' +
  5039. 'a0da64ba').replace(/ /g, ''), 'hex'),
  5040. n: Buffer.from(('01ff' +
  5041. 'ffffffff ffffffff ffffffff ffffffff' +
  5042. 'ffffffff ffffffff ffffffff fffffffa' +
  5043. '51868783 bf2f966b 7fcc0148 f709a5d0' +
  5044. '3bb5c9b8 899c47ae bb6fb71e 91386409').
  5045. replace(/ /g, ''), 'hex'),
  5046. G: Buffer.from(('04' +
  5047. '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' +
  5048. '9c648139 053fb521 f828af60 6b4d3dba' +
  5049. 'a14b5e77 efe75928 fe1dc127 a2ffa8de' +
  5050. '3348b3c1 856a429b f97e7e31 c2e5bd66' +
  5051. '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' +
  5052. '98f54449 579b4468 17afbd17 273e662c' +
  5053. '97ee7299 5ef42640 c550b901 3fad0761' +
  5054. '353c7086 a272c240 88be9476 9fd16650').
  5055. replace(/ /g, ''), 'hex')
  5056. }
  5057. };
  5058. module.exports = {
  5059. info: algInfo,
  5060. privInfo: algPrivInfo,
  5061. hashAlgs: hashAlgs,
  5062. curves: curves
  5063. };
  5064. /***/ }),
  5065. /* 40 */
  5066. /***/ (function(module, exports, __webpack_require__) {
  5067. // Copyright 2017 Joyent, Inc.
  5068. module.exports = PrivateKey;
  5069. var assert = __webpack_require__(22);
  5070. var Buffer = __webpack_require__(20).Buffer;
  5071. var algs = __webpack_require__(39);
  5072. var crypto = __webpack_require__(21);
  5073. var Fingerprint = __webpack_require__(145);
  5074. var Signature = __webpack_require__(71);
  5075. var errs = __webpack_require__(70);
  5076. var util = __webpack_require__(9);
  5077. var utils = __webpack_require__(32);
  5078. var dhe = __webpack_require__(266);
  5079. var generateECDSA = dhe.generateECDSA;
  5080. var generateED25519 = dhe.generateED25519;
  5081. var edCompat;
  5082. var nacl;
  5083. try {
  5084. edCompat = __webpack_require__(424);
  5085. } catch (e) {
  5086. /* Just continue through, and bail out if we try to use it. */
  5087. }
  5088. var Key = __webpack_require__(35);
  5089. var InvalidAlgorithmError = errs.InvalidAlgorithmError;
  5090. var KeyParseError = errs.KeyParseError;
  5091. var KeyEncryptedError = errs.KeyEncryptedError;
  5092. var formats = {};
  5093. formats['auto'] = __webpack_require__(425);
  5094. formats['pem'] = __webpack_require__(82);
  5095. formats['pkcs1'] = __webpack_require__(268);
  5096. formats['pkcs8'] = __webpack_require__(146);
  5097. formats['rfc4253'] = __webpack_require__(92);
  5098. formats['ssh-private'] = __webpack_require__(183);
  5099. formats['openssh'] = formats['ssh-private'];
  5100. formats['ssh'] = formats['ssh-private'];
  5101. formats['dnssec'] = __webpack_require__(267);
  5102. function PrivateKey(opts) {
  5103. assert.object(opts, 'options');
  5104. Key.call(this, opts);
  5105. this._pubCache = undefined;
  5106. }
  5107. util.inherits(PrivateKey, Key);
  5108. PrivateKey.formats = formats;
  5109. PrivateKey.prototype.toBuffer = function (format, options) {
  5110. if (format === undefined)
  5111. format = 'pkcs1';
  5112. assert.string(format, 'format');
  5113. assert.object(formats[format], 'formats[format]');
  5114. assert.optionalObject(options, 'options');
  5115. return (formats[format].write(this, options));
  5116. };
  5117. PrivateKey.prototype.hash = function (algo) {
  5118. return (this.toPublic().hash(algo));
  5119. };
  5120. PrivateKey.prototype.toPublic = function () {
  5121. if (this._pubCache)
  5122. return (this._pubCache);
  5123. var algInfo = algs.info[this.type];
  5124. var pubParts = [];
  5125. for (var i = 0; i < algInfo.parts.length; ++i) {
  5126. var p = algInfo.parts[i];
  5127. pubParts.push(this.part[p]);
  5128. }
  5129. this._pubCache = new Key({
  5130. type: this.type,
  5131. source: this,
  5132. parts: pubParts
  5133. });
  5134. if (this.comment)
  5135. this._pubCache.comment = this.comment;
  5136. return (this._pubCache);
  5137. };
  5138. PrivateKey.prototype.derive = function (newType) {
  5139. assert.string(newType, 'type');
  5140. var priv, pub, pair;
  5141. if (this.type === 'ed25519' && newType === 'curve25519') {
  5142. if (nacl === undefined)
  5143. nacl = __webpack_require__(72);
  5144. priv = this.part.k.data;
  5145. if (priv[0] === 0x00)
  5146. priv = priv.slice(1);
  5147. pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv));
  5148. pub = Buffer.from(pair.publicKey);
  5149. return (new PrivateKey({
  5150. type: 'curve25519',
  5151. parts: [
  5152. { name: 'A', data: utils.mpNormalize(pub) },
  5153. { name: 'k', data: utils.mpNormalize(priv) }
  5154. ]
  5155. }));
  5156. } else if (this.type === 'curve25519' && newType === 'ed25519') {
  5157. if (nacl === undefined)
  5158. nacl = __webpack_require__(72);
  5159. priv = this.part.k.data;
  5160. if (priv[0] === 0x00)
  5161. priv = priv.slice(1);
  5162. pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv));
  5163. pub = Buffer.from(pair.publicKey);
  5164. return (new PrivateKey({
  5165. type: 'ed25519',
  5166. parts: [
  5167. { name: 'A', data: utils.mpNormalize(pub) },
  5168. { name: 'k', data: utils.mpNormalize(priv) }
  5169. ]
  5170. }));
  5171. }
  5172. throw (new Error('Key derivation not supported from ' + this.type +
  5173. ' to ' + newType));
  5174. };
  5175. PrivateKey.prototype.createVerify = function (hashAlgo) {
  5176. return (this.toPublic().createVerify(hashAlgo));
  5177. };
  5178. PrivateKey.prototype.createSign = function (hashAlgo) {
  5179. if (hashAlgo === undefined)
  5180. hashAlgo = this.defaultHashAlgorithm();
  5181. assert.string(hashAlgo, 'hash algorithm');
  5182. /* ED25519 is not supported by OpenSSL, use a javascript impl. */
  5183. if (this.type === 'ed25519' && edCompat !== undefined)
  5184. return (new edCompat.Signer(this, hashAlgo));
  5185. if (this.type === 'curve25519')
  5186. throw (new Error('Curve25519 keys are not suitable for ' +
  5187. 'signing or verification'));
  5188. var v, nm, err;
  5189. try {
  5190. nm = hashAlgo.toUpperCase();
  5191. v = crypto.createSign(nm);
  5192. } catch (e) {
  5193. err = e;
  5194. }
  5195. if (v === undefined || (err instanceof Error &&
  5196. err.message.match(/Unknown message digest/))) {
  5197. nm = 'RSA-';
  5198. nm += hashAlgo.toUpperCase();
  5199. v = crypto.createSign(nm);
  5200. }
  5201. assert.ok(v, 'failed to create verifier');
  5202. var oldSign = v.sign.bind(v);
  5203. var key = this.toBuffer('pkcs1');
  5204. var type = this.type;
  5205. var curve = this.curve;
  5206. v.sign = function () {
  5207. var sig = oldSign(key);
  5208. if (typeof (sig) === 'string')
  5209. sig = Buffer.from(sig, 'binary');
  5210. sig = Signature.parse(sig, type, 'asn1');
  5211. sig.hashAlgorithm = hashAlgo;
  5212. sig.curve = curve;
  5213. return (sig);
  5214. };
  5215. return (v);
  5216. };
  5217. PrivateKey.parse = function (data, format, options) {
  5218. if (typeof (data) !== 'string')
  5219. assert.buffer(data, 'data');
  5220. if (format === undefined)
  5221. format = 'auto';
  5222. assert.string(format, 'format');
  5223. if (typeof (options) === 'string')
  5224. options = { filename: options };
  5225. assert.optionalObject(options, 'options');
  5226. if (options === undefined)
  5227. options = {};
  5228. assert.optionalString(options.filename, 'options.filename');
  5229. if (options.filename === undefined)
  5230. options.filename = '(unnamed)';
  5231. assert.object(formats[format], 'formats[format]');
  5232. try {
  5233. var k = formats[format].read(data, options);
  5234. assert.ok(k instanceof PrivateKey, 'key is not a private key');
  5235. if (!k.comment)
  5236. k.comment = options.filename;
  5237. return (k);
  5238. } catch (e) {
  5239. if (e.name === 'KeyEncryptedError')
  5240. throw (e);
  5241. throw (new KeyParseError(options.filename, format, e));
  5242. }
  5243. };
  5244. PrivateKey.isPrivateKey = function (obj, ver) {
  5245. return (utils.isCompatible(obj, PrivateKey, ver));
  5246. };
  5247. PrivateKey.generate = function (type, options) {
  5248. if (options === undefined)
  5249. options = {};
  5250. assert.object(options, 'options');
  5251. switch (type) {
  5252. case 'ecdsa':
  5253. if (options.curve === undefined)
  5254. options.curve = 'nistp256';
  5255. assert.string(options.curve, 'options.curve');
  5256. return (generateECDSA(options.curve));
  5257. case 'ed25519':
  5258. return (generateED25519());
  5259. default:
  5260. throw (new Error('Key generation not supported with key ' +
  5261. 'type "' + type + '"'));
  5262. }
  5263. };
  5264. /*
  5265. * API versions for PrivateKey:
  5266. * [1,0] -- initial ver
  5267. * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats
  5268. * [1,2] -- added defaultHashAlgorithm
  5269. * [1,3] -- added derive, ed, createDH
  5270. * [1,4] -- first tagged version
  5271. * [1,5] -- changed ed25519 part names and format
  5272. */
  5273. PrivateKey.prototype._sshpkApiVersion = [1, 5];
  5274. PrivateKey._oldVersionDetect = function (obj) {
  5275. assert.func(obj.toPublic);
  5276. assert.func(obj.createSign);
  5277. if (obj.derive)
  5278. return ([1, 3]);
  5279. if (obj.defaultHashAlgorithm)
  5280. return ([1, 2]);
  5281. if (obj.formats['auto'])
  5282. return ([1, 1]);
  5283. return ([1, 0]);
  5284. };
  5285. /***/ }),
  5286. /* 41 */
  5287. /***/ (function(module, exports, __webpack_require__) {
  5288. "use strict";
  5289. Object.defineProperty(exports, "__esModule", {
  5290. value: true
  5291. });
  5292. exports.wrapLifecycle = exports.run = exports.install = exports.Install = undefined;
  5293. var _set;
  5294. function _load_set() {
  5295. return _set = _interopRequireDefault(__webpack_require__(16));
  5296. }
  5297. var _promise;
  5298. function _load_promise() {
  5299. return _promise = _interopRequireDefault(__webpack_require__(7));
  5300. }
  5301. var _values;
  5302. function _load_values() {
  5303. return _values = _interopRequireDefault(__webpack_require__(551));
  5304. }
  5305. var _extends2;
  5306. function _load_extends() {
  5307. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  5308. }
  5309. var _assign;
  5310. function _load_assign() {
  5311. return _assign = _interopRequireDefault(__webpack_require__(23));
  5312. }
  5313. var _keys;
  5314. function _load_keys() {
  5315. return _keys = _interopRequireDefault(__webpack_require__(14));
  5316. }
  5317. var _getIterator2;
  5318. function _load_getIterator() {
  5319. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  5320. }
  5321. var _asyncToGenerator2;
  5322. function _load_asyncToGenerator() {
  5323. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  5324. }
  5325. var _classCallCheck2;
  5326. function _load_classCallCheck() {
  5327. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  5328. }
  5329. var install = exports.install = function () {
  5330. var _ref43 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) {
  5331. yield wrapLifecycle(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  5332. var install = new Install(flags, config, reporter, lockfile);
  5333. yield install.init();
  5334. }));
  5335. });
  5336. return function install(_x16, _x17, _x18, _x19) {
  5337. return _ref43.apply(this, arguments);
  5338. };
  5339. }();
  5340. var run = exports.run = function () {
  5341. var _ref45 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  5342. var lockfile = void 0;
  5343. var error = 'installCommandRenamed';
  5344. if (flags.lockfile === false) {
  5345. lockfile = new (_lockfile || _load_lockfile()).default();
  5346. } else {
  5347. lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
  5348. }
  5349. if (args.length) {
  5350. var exampleArgs = args.slice();
  5351. if (flags.saveDev) {
  5352. exampleArgs.push('--dev');
  5353. }
  5354. if (flags.savePeer) {
  5355. exampleArgs.push('--peer');
  5356. }
  5357. if (flags.saveOptional) {
  5358. exampleArgs.push('--optional');
  5359. }
  5360. if (flags.saveExact) {
  5361. exampleArgs.push('--exact');
  5362. }
  5363. if (flags.saveTilde) {
  5364. exampleArgs.push('--tilde');
  5365. }
  5366. var command = 'add';
  5367. if (flags.global) {
  5368. error = 'globalFlagRemoved';
  5369. command = 'global add';
  5370. }
  5371. throw new (_errors || _load_errors()).MessageError(reporter.lang(error, `yarn ${command} ${exampleArgs.join(' ')}`));
  5372. }
  5373. yield install(config, reporter, flags, lockfile);
  5374. });
  5375. return function run(_x20, _x21, _x22, _x23) {
  5376. return _ref45.apply(this, arguments);
  5377. };
  5378. }();
  5379. var wrapLifecycle = exports.wrapLifecycle = function () {
  5380. var _ref46 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) {
  5381. yield config.executeLifecycleScript('preinstall');
  5382. yield factory();
  5383. // npm behaviour, seems kinda funky but yay compatibility
  5384. yield config.executeLifecycleScript('install');
  5385. yield config.executeLifecycleScript('postinstall');
  5386. if (!config.production) {
  5387. if (!config.disablePrepublish) {
  5388. yield config.executeLifecycleScript('prepublish');
  5389. }
  5390. yield config.executeLifecycleScript('prepare');
  5391. }
  5392. });
  5393. return function wrapLifecycle(_x24, _x25, _x26) {
  5394. return _ref46.apply(this, arguments);
  5395. };
  5396. }();
  5397. exports.hasWrapper = hasWrapper;
  5398. exports.setFlags = setFlags;
  5399. var _objectPath;
  5400. function _load_objectPath() {
  5401. return _objectPath = _interopRequireDefault(__webpack_require__(244));
  5402. }
  5403. var _hooks;
  5404. function _load_hooks() {
  5405. return _hooks = __webpack_require__(311);
  5406. }
  5407. var _index;
  5408. function _load_index() {
  5409. return _index = _interopRequireDefault(__webpack_require__(206));
  5410. }
  5411. var _errors;
  5412. function _load_errors() {
  5413. return _errors = __webpack_require__(6);
  5414. }
  5415. var _integrityChecker;
  5416. function _load_integrityChecker() {
  5417. return _integrityChecker = _interopRequireDefault(__webpack_require__(195));
  5418. }
  5419. var _lockfile;
  5420. function _load_lockfile() {
  5421. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  5422. }
  5423. var _lockfile2;
  5424. function _load_lockfile2() {
  5425. return _lockfile2 = __webpack_require__(25);
  5426. }
  5427. var _packageFetcher;
  5428. function _load_packageFetcher() {
  5429. return _packageFetcher = _interopRequireWildcard(__webpack_require__(197));
  5430. }
  5431. var _packageInstallScripts;
  5432. function _load_packageInstallScripts() {
  5433. return _packageInstallScripts = _interopRequireDefault(__webpack_require__(513));
  5434. }
  5435. var _packageCompatibility;
  5436. function _load_packageCompatibility() {
  5437. return _packageCompatibility = _interopRequireWildcard(__webpack_require__(196));
  5438. }
  5439. var _packageResolver;
  5440. function _load_packageResolver() {
  5441. return _packageResolver = _interopRequireDefault(__webpack_require__(303));
  5442. }
  5443. var _packageLinker;
  5444. function _load_packageLinker() {
  5445. return _packageLinker = _interopRequireDefault(__webpack_require__(198));
  5446. }
  5447. var _index2;
  5448. function _load_index2() {
  5449. return _index2 = __webpack_require__(61);
  5450. }
  5451. var _index3;
  5452. function _load_index3() {
  5453. return _index3 = __webpack_require__(75);
  5454. }
  5455. var _autoclean;
  5456. function _load_autoclean() {
  5457. return _autoclean = __webpack_require__(290);
  5458. }
  5459. var _constants;
  5460. function _load_constants() {
  5461. return _constants = _interopRequireWildcard(__webpack_require__(13));
  5462. }
  5463. var _normalizePattern;
  5464. function _load_normalizePattern() {
  5465. return _normalizePattern = __webpack_require__(52);
  5466. }
  5467. var _fs;
  5468. function _load_fs() {
  5469. return _fs = _interopRequireWildcard(__webpack_require__(8));
  5470. }
  5471. var _map;
  5472. function _load_map() {
  5473. return _map = _interopRequireDefault(__webpack_require__(51));
  5474. }
  5475. var _yarnVersion;
  5476. function _load_yarnVersion() {
  5477. return _yarnVersion = __webpack_require__(96);
  5478. }
  5479. var _generatePnpMap;
  5480. function _load_generatePnpMap() {
  5481. return _generatePnpMap = __webpack_require__(536);
  5482. }
  5483. var _workspaceLayout;
  5484. function _load_workspaceLayout() {
  5485. return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
  5486. }
  5487. var _resolutionMap;
  5488. function _load_resolutionMap() {
  5489. return _resolutionMap = _interopRequireDefault(__webpack_require__(201));
  5490. }
  5491. var _guessName;
  5492. function _load_guessName() {
  5493. return _guessName = _interopRequireDefault(__webpack_require__(159));
  5494. }
  5495. var _audit;
  5496. function _load_audit() {
  5497. return _audit = _interopRequireDefault(__webpack_require__(289));
  5498. }
  5499. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  5500. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5501. var deepEqual = __webpack_require__(654);
  5502. var emoji = __webpack_require__(242);
  5503. var invariant = __webpack_require__(15);
  5504. var path = __webpack_require__(1);
  5505. var semver = __webpack_require__(27);
  5506. var uuid = __webpack_require__(114);
  5507. var ssri = __webpack_require__(93);
  5508. var ONE_DAY = 1000 * 60 * 60 * 24;
  5509. /**
  5510. * Try and detect the installation method for Yarn and provide a command to update it with.
  5511. */
  5512. function getUpdateCommand(installationMethod) {
  5513. if (installationMethod === 'tar') {
  5514. return `curl --compressed -o- -L ${(_constants || _load_constants()).YARN_INSTALLER_SH} | bash`;
  5515. }
  5516. if (installationMethod === 'homebrew') {
  5517. return 'brew upgrade yarn';
  5518. }
  5519. if (installationMethod === 'deb') {
  5520. return 'sudo apt-get update && sudo apt-get install yarn';
  5521. }
  5522. if (installationMethod === 'rpm') {
  5523. return 'sudo yum install yarn';
  5524. }
  5525. if (installationMethod === 'npm') {
  5526. return 'npm install --global yarn';
  5527. }
  5528. if (installationMethod === 'chocolatey') {
  5529. return 'choco upgrade yarn';
  5530. }
  5531. if (installationMethod === 'apk') {
  5532. return 'apk update && apk add -u yarn';
  5533. }
  5534. if (installationMethod === 'portage') {
  5535. return 'sudo emerge --sync && sudo emerge -au sys-apps/yarn';
  5536. }
  5537. return null;
  5538. }
  5539. function getUpdateInstaller(installationMethod) {
  5540. // Windows
  5541. if (installationMethod === 'msi') {
  5542. return (_constants || _load_constants()).YARN_INSTALLER_MSI;
  5543. }
  5544. return null;
  5545. }
  5546. function normalizeFlags(config, rawFlags) {
  5547. var flags = {
  5548. // install
  5549. har: !!rawFlags.har,
  5550. ignorePlatform: !!rawFlags.ignorePlatform,
  5551. ignoreEngines: !!rawFlags.ignoreEngines,
  5552. ignoreScripts: !!rawFlags.ignoreScripts,
  5553. ignoreOptional: !!rawFlags.ignoreOptional,
  5554. force: !!rawFlags.force,
  5555. flat: !!rawFlags.flat,
  5556. lockfile: rawFlags.lockfile !== false,
  5557. pureLockfile: !!rawFlags.pureLockfile,
  5558. updateChecksums: !!rawFlags.updateChecksums,
  5559. skipIntegrityCheck: !!rawFlags.skipIntegrityCheck,
  5560. frozenLockfile: !!rawFlags.frozenLockfile,
  5561. linkDuplicates: !!rawFlags.linkDuplicates,
  5562. checkFiles: !!rawFlags.checkFiles,
  5563. audit: !!rawFlags.audit,
  5564. // add
  5565. peer: !!rawFlags.peer,
  5566. dev: !!rawFlags.dev,
  5567. optional: !!rawFlags.optional,
  5568. exact: !!rawFlags.exact,
  5569. tilde: !!rawFlags.tilde,
  5570. ignoreWorkspaceRootCheck: !!rawFlags.ignoreWorkspaceRootCheck,
  5571. // outdated, update-interactive
  5572. includeWorkspaceDeps: !!rawFlags.includeWorkspaceDeps,
  5573. // add, remove, update
  5574. workspaceRootIsCwd: rawFlags.workspaceRootIsCwd !== false
  5575. };
  5576. if (config.getOption('ignore-scripts')) {
  5577. flags.ignoreScripts = true;
  5578. }
  5579. if (config.getOption('ignore-platform')) {
  5580. flags.ignorePlatform = true;
  5581. }
  5582. if (config.getOption('ignore-engines')) {
  5583. flags.ignoreEngines = true;
  5584. }
  5585. if (config.getOption('ignore-optional')) {
  5586. flags.ignoreOptional = true;
  5587. }
  5588. if (config.getOption('force')) {
  5589. flags.force = true;
  5590. }
  5591. return flags;
  5592. }
  5593. var Install = exports.Install = function () {
  5594. function Install(flags, config, reporter, lockfile) {
  5595. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Install);
  5596. this.rootManifestRegistries = [];
  5597. this.rootPatternsToOrigin = (0, (_map || _load_map()).default)();
  5598. this.lockfile = lockfile;
  5599. this.reporter = reporter;
  5600. this.config = config;
  5601. this.flags = normalizeFlags(config, flags);
  5602. this.resolutions = (0, (_map || _load_map()).default)(); // Legacy resolutions field used for flat install mode
  5603. this.resolutionMap = new (_resolutionMap || _load_resolutionMap()).default(config); // Selective resolutions for nested dependencies
  5604. this.resolver = new (_packageResolver || _load_packageResolver()).default(config, lockfile, this.resolutionMap);
  5605. this.integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config);
  5606. this.linker = new (_packageLinker || _load_packageLinker()).default(config, this.resolver);
  5607. this.scripts = new (_packageInstallScripts || _load_packageInstallScripts()).default(config, this.resolver, this.flags.force);
  5608. }
  5609. /**
  5610. * Create a list of dependency requests from the current directories manifests.
  5611. */
  5612. Install.prototype.fetchRequestFromCwd = function () {
  5613. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  5614. var _this = this;
  5615. var excludePatterns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  5616. var ignoreUnusedPatterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5617. var patterns = [];
  5618. var deps = [];
  5619. var resolutionDeps = [];
  5620. var manifest = {};
  5621. var ignorePatterns = [];
  5622. var usedPatterns = [];
  5623. var workspaceLayout = void 0;
  5624. // some commands should always run in the context of the entire workspace
  5625. var cwd = this.flags.includeWorkspaceDeps || this.flags.workspaceRootIsCwd ? this.config.lockfileFolder : this.config.cwd;
  5626. // non-workspaces are always root, otherwise check for workspace root
  5627. var cwdIsRoot = !this.config.workspaceRootFolder || this.config.lockfileFolder === cwd;
  5628. // exclude package names that are in install args
  5629. var excludeNames = [];
  5630. for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  5631. var _ref2;
  5632. if (_isArray) {
  5633. if (_i >= _iterator.length) break;
  5634. _ref2 = _iterator[_i++];
  5635. } else {
  5636. _i = _iterator.next();
  5637. if (_i.done) break;
  5638. _ref2 = _i.value;
  5639. }
  5640. var _pattern = _ref2;
  5641. if ((0, (_index3 || _load_index3()).getExoticResolver)(_pattern)) {
  5642. excludeNames.push((0, (_guessName || _load_guessName()).default)(_pattern));
  5643. } else {
  5644. // extract the name
  5645. var parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(_pattern);
  5646. excludeNames.push(parts.name);
  5647. }
  5648. }
  5649. var stripExcluded = function stripExcluded(manifest) {
  5650. for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  5651. var _ref3;
  5652. if (_isArray2) {
  5653. if (_i2 >= _iterator2.length) break;
  5654. _ref3 = _iterator2[_i2++];
  5655. } else {
  5656. _i2 = _iterator2.next();
  5657. if (_i2.done) break;
  5658. _ref3 = _i2.value;
  5659. }
  5660. var exclude = _ref3;
  5661. if (manifest.dependencies && manifest.dependencies[exclude]) {
  5662. delete manifest.dependencies[exclude];
  5663. }
  5664. if (manifest.devDependencies && manifest.devDependencies[exclude]) {
  5665. delete manifest.devDependencies[exclude];
  5666. }
  5667. if (manifest.optionalDependencies && manifest.optionalDependencies[exclude]) {
  5668. delete manifest.optionalDependencies[exclude];
  5669. }
  5670. }
  5671. };
  5672. var _loop = function* _loop(registry) {
  5673. var filename = (_index2 || _load_index2()).registries[registry].filename;
  5674. var loc = path.join(cwd, filename);
  5675. if (!(yield (_fs || _load_fs()).exists(loc))) {
  5676. return 'continue';
  5677. }
  5678. _this.rootManifestRegistries.push(registry);
  5679. var projectManifestJson = yield _this.config.readJson(loc);
  5680. yield (0, (_index || _load_index()).default)(projectManifestJson, cwd, _this.config, cwdIsRoot);
  5681. (0, (_assign || _load_assign()).default)(_this.resolutions, projectManifestJson.resolutions);
  5682. (0, (_assign || _load_assign()).default)(manifest, projectManifestJson);
  5683. _this.resolutionMap.init(_this.resolutions);
  5684. for (var _iterator4 = (0, (_keys || _load_keys()).default)(_this.resolutionMap.resolutionsByPackage), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  5685. var _ref5;
  5686. if (_isArray4) {
  5687. if (_i4 >= _iterator4.length) break;
  5688. _ref5 = _iterator4[_i4++];
  5689. } else {
  5690. _i4 = _iterator4.next();
  5691. if (_i4.done) break;
  5692. _ref5 = _i4.value;
  5693. }
  5694. var _packageName = _ref5;
  5695. var _optional = (_objectPath || _load_objectPath()).default.has(manifest.optionalDependencies, _packageName) && _this.flags.ignoreOptional;
  5696. for (var _iterator8 = _this.resolutionMap.resolutionsByPackage[_packageName], _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
  5697. var _ref11;
  5698. if (_isArray8) {
  5699. if (_i8 >= _iterator8.length) break;
  5700. _ref11 = _iterator8[_i8++];
  5701. } else {
  5702. _i8 = _iterator8.next();
  5703. if (_i8.done) break;
  5704. _ref11 = _i8.value;
  5705. }
  5706. var _ref10 = _ref11;
  5707. var _pattern3 = _ref10.pattern;
  5708. resolutionDeps = [].concat(resolutionDeps, [{ registry, pattern: _pattern3, optional: _optional, hint: 'resolution' }]);
  5709. }
  5710. }
  5711. var pushDeps = function pushDeps(depType, manifest, _ref6, isUsed) {
  5712. var hint = _ref6.hint,
  5713. optional = _ref6.optional;
  5714. if (ignoreUnusedPatterns && !isUsed) {
  5715. return;
  5716. }
  5717. // We only take unused dependencies into consideration to get deterministic hoisting.
  5718. // Since flat mode doesn't care about hoisting and everything is top level and specified then we can safely
  5719. // leave these out.
  5720. if (_this.flags.flat && !isUsed) {
  5721. return;
  5722. }
  5723. var depMap = manifest[depType];
  5724. for (var name in depMap) {
  5725. if (excludeNames.indexOf(name) >= 0) {
  5726. continue;
  5727. }
  5728. var _pattern2 = name;
  5729. if (!_this.lockfile.getLocked(_pattern2)) {
  5730. // when we use --save we save the dependency to the lockfile with just the name rather than the
  5731. // version combo
  5732. _pattern2 += '@' + depMap[name];
  5733. }
  5734. // normalization made sure packages are mentioned only once
  5735. if (isUsed) {
  5736. usedPatterns.push(_pattern2);
  5737. } else {
  5738. ignorePatterns.push(_pattern2);
  5739. }
  5740. _this.rootPatternsToOrigin[_pattern2] = depType;
  5741. patterns.push(_pattern2);
  5742. deps.push({ pattern: _pattern2, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc });
  5743. }
  5744. };
  5745. if (cwdIsRoot) {
  5746. pushDeps('dependencies', projectManifestJson, { hint: null, optional: false }, true);
  5747. pushDeps('devDependencies', projectManifestJson, { hint: 'dev', optional: false }, !_this.config.production);
  5748. pushDeps('optionalDependencies', projectManifestJson, { hint: 'optional', optional: true }, true);
  5749. }
  5750. if (_this.config.workspaceRootFolder) {
  5751. var workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename);
  5752. var workspacesRoot = path.dirname(workspaceLoc);
  5753. var workspaceManifestJson = projectManifestJson;
  5754. if (!cwdIsRoot) {
  5755. // the manifest we read before was a child workspace, so get the root
  5756. workspaceManifestJson = yield _this.config.readJson(workspaceLoc);
  5757. yield (0, (_index || _load_index()).default)(workspaceManifestJson, workspacesRoot, _this.config, true);
  5758. }
  5759. var workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson);
  5760. workspaceLayout = new (_workspaceLayout || _load_workspaceLayout()).default(workspaces, _this.config);
  5761. // add virtual manifest that depends on all workspaces, this way package hoisters and resolvers will work fine
  5762. var workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies);
  5763. for (var _iterator5 = (0, (_keys || _load_keys()).default)(workspaces), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  5764. var _ref7;
  5765. if (_isArray5) {
  5766. if (_i5 >= _iterator5.length) break;
  5767. _ref7 = _iterator5[_i5++];
  5768. } else {
  5769. _i5 = _iterator5.next();
  5770. if (_i5.done) break;
  5771. _ref7 = _i5.value;
  5772. }
  5773. var workspaceName = _ref7;
  5774. var workspaceManifest = workspaces[workspaceName].manifest;
  5775. workspaceDependencies[workspaceName] = workspaceManifest.version;
  5776. // include dependencies from all workspaces
  5777. if (_this.flags.includeWorkspaceDeps) {
  5778. pushDeps('dependencies', workspaceManifest, { hint: null, optional: false }, true);
  5779. pushDeps('devDependencies', workspaceManifest, { hint: 'dev', optional: false }, !_this.config.production);
  5780. pushDeps('optionalDependencies', workspaceManifest, { hint: 'optional', optional: true }, true);
  5781. }
  5782. }
  5783. var virtualDependencyManifest = {
  5784. _uid: '',
  5785. name: `workspace-aggregator-${uuid.v4()}`,
  5786. version: '1.0.0',
  5787. _registry: 'npm',
  5788. _loc: workspacesRoot,
  5789. dependencies: workspaceDependencies,
  5790. devDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.devDependencies),
  5791. optionalDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.optionalDependencies),
  5792. private: workspaceManifestJson.private,
  5793. workspaces: workspaceManifestJson.workspaces
  5794. };
  5795. workspaceLayout.virtualManifestName = virtualDependencyManifest.name;
  5796. var virtualDep = {};
  5797. virtualDep[virtualDependencyManifest.name] = virtualDependencyManifest.version;
  5798. workspaces[virtualDependencyManifest.name] = { loc: workspacesRoot, manifest: virtualDependencyManifest };
  5799. // ensure dependencies that should be excluded are stripped from the correct manifest
  5800. stripExcluded(cwdIsRoot ? virtualDependencyManifest : workspaces[projectManifestJson.name].manifest);
  5801. pushDeps('workspaces', { workspaces: virtualDep }, { hint: 'workspaces', optional: false }, true);
  5802. var implicitWorkspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceDependencies);
  5803. for (var _iterator6 = (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  5804. var _ref8;
  5805. if (_isArray6) {
  5806. if (_i6 >= _iterator6.length) break;
  5807. _ref8 = _iterator6[_i6++];
  5808. } else {
  5809. _i6 = _iterator6.next();
  5810. if (_i6.done) break;
  5811. _ref8 = _i6.value;
  5812. }
  5813. var type = _ref8;
  5814. for (var _iterator7 = (0, (_keys || _load_keys()).default)(projectManifestJson[type] || {}), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  5815. var _ref9;
  5816. if (_isArray7) {
  5817. if (_i7 >= _iterator7.length) break;
  5818. _ref9 = _iterator7[_i7++];
  5819. } else {
  5820. _i7 = _iterator7.next();
  5821. if (_i7.done) break;
  5822. _ref9 = _i7.value;
  5823. }
  5824. var dependencyName = _ref9;
  5825. delete implicitWorkspaceDependencies[dependencyName];
  5826. }
  5827. }
  5828. pushDeps('dependencies', { dependencies: implicitWorkspaceDependencies }, { hint: 'workspaces', optional: false }, true);
  5829. }
  5830. return 'break';
  5831. };
  5832. _loop2: for (var _iterator3 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  5833. var _ref4;
  5834. if (_isArray3) {
  5835. if (_i3 >= _iterator3.length) break;
  5836. _ref4 = _iterator3[_i3++];
  5837. } else {
  5838. _i3 = _iterator3.next();
  5839. if (_i3.done) break;
  5840. _ref4 = _i3.value;
  5841. }
  5842. var registry = _ref4;
  5843. var _ret = yield* _loop(registry);
  5844. switch (_ret) {
  5845. case 'continue':
  5846. continue;
  5847. case 'break':
  5848. break _loop2;}
  5849. }
  5850. // inherit root flat flag
  5851. if (manifest.flat) {
  5852. this.flags.flat = true;
  5853. }
  5854. return {
  5855. requests: [].concat(resolutionDeps, deps),
  5856. patterns,
  5857. manifest,
  5858. usedPatterns,
  5859. ignorePatterns,
  5860. workspaceLayout
  5861. };
  5862. });
  5863. function fetchRequestFromCwd() {
  5864. return _ref.apply(this, arguments);
  5865. }
  5866. return fetchRequestFromCwd;
  5867. }();
  5868. /**
  5869. * TODO description
  5870. */
  5871. Install.prototype.prepareRequests = function prepareRequests(requests) {
  5872. return requests;
  5873. };
  5874. Install.prototype.preparePatterns = function preparePatterns(patterns) {
  5875. return patterns;
  5876. };
  5877. Install.prototype.preparePatternsForLinking = function preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) {
  5878. return patterns;
  5879. };
  5880. Install.prototype.prepareManifests = function () {
  5881. var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  5882. var manifests = yield this.config.getRootManifests();
  5883. return manifests;
  5884. });
  5885. function prepareManifests() {
  5886. return _ref12.apply(this, arguments);
  5887. }
  5888. return prepareManifests;
  5889. }();
  5890. Install.prototype.bailout = function () {
  5891. var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) {
  5892. // We don't want to skip the audit - it could yield important errors
  5893. if (this.flags.audit) {
  5894. return false;
  5895. }
  5896. // PNP is so fast that the integrity check isn't pertinent
  5897. if (this.config.plugnplayEnabled) {
  5898. return false;
  5899. }
  5900. if (this.flags.skipIntegrityCheck || this.flags.force) {
  5901. return false;
  5902. }
  5903. var lockfileCache = this.lockfile.cache;
  5904. if (!lockfileCache) {
  5905. return false;
  5906. }
  5907. var lockfileClean = this.lockfile.parseResultType === 'success';
  5908. var match = yield this.integrityChecker.check(patterns, lockfileCache, this.flags, workspaceLayout);
  5909. if (this.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) {
  5910. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('frozenLockfileError'));
  5911. }
  5912. var haveLockfile = yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME));
  5913. var lockfileIntegrityPresent = !this.lockfile.hasEntriesExistWithoutIntegrity();
  5914. var integrityBailout = lockfileIntegrityPresent || !this.config.autoAddIntegrity;
  5915. if (match.integrityMatches && haveLockfile && lockfileClean && integrityBailout) {
  5916. this.reporter.success(this.reporter.lang('upToDate'));
  5917. return true;
  5918. }
  5919. if (match.integrityFileMissing && haveLockfile) {
  5920. // Integrity file missing, force script installations
  5921. this.scripts.setForce(true);
  5922. return false;
  5923. }
  5924. if (match.hardRefreshRequired) {
  5925. // e.g. node version doesn't match, force script installations
  5926. this.scripts.setForce(true);
  5927. return false;
  5928. }
  5929. if (!patterns.length && !match.integrityFileMissing) {
  5930. this.reporter.success(this.reporter.lang('nothingToInstall'));
  5931. yield this.createEmptyManifestFolders();
  5932. yield this.saveLockfileAndIntegrity(patterns, workspaceLayout);
  5933. return true;
  5934. }
  5935. return false;
  5936. });
  5937. function bailout(_x3, _x4) {
  5938. return _ref13.apply(this, arguments);
  5939. }
  5940. return bailout;
  5941. }();
  5942. /**
  5943. * Produce empty folders for all used root manifests.
  5944. */
  5945. Install.prototype.createEmptyManifestFolders = function () {
  5946. var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  5947. if (this.config.modulesFolder) {
  5948. // already created
  5949. return;
  5950. }
  5951. for (var _iterator9 = this.rootManifestRegistries, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
  5952. var _ref15;
  5953. if (_isArray9) {
  5954. if (_i9 >= _iterator9.length) break;
  5955. _ref15 = _iterator9[_i9++];
  5956. } else {
  5957. _i9 = _iterator9.next();
  5958. if (_i9.done) break;
  5959. _ref15 = _i9.value;
  5960. }
  5961. var registryName = _ref15;
  5962. var folder = this.config.registries[registryName].folder;
  5963. yield (_fs || _load_fs()).mkdirp(path.join(this.config.lockfileFolder, folder));
  5964. }
  5965. });
  5966. function createEmptyManifestFolders() {
  5967. return _ref14.apply(this, arguments);
  5968. }
  5969. return createEmptyManifestFolders;
  5970. }();
  5971. /**
  5972. * TODO description
  5973. */
  5974. Install.prototype.markIgnored = function markIgnored(patterns) {
  5975. for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
  5976. var _ref16;
  5977. if (_isArray10) {
  5978. if (_i10 >= _iterator10.length) break;
  5979. _ref16 = _iterator10[_i10++];
  5980. } else {
  5981. _i10 = _iterator10.next();
  5982. if (_i10.done) break;
  5983. _ref16 = _i10.value;
  5984. }
  5985. var _pattern4 = _ref16;
  5986. var _manifest = this.resolver.getStrictResolvedPattern(_pattern4);
  5987. var ref = _manifest._reference;
  5988. invariant(ref, 'expected package reference');
  5989. // just mark the package as ignored. if the package is used by a required package, the hoister
  5990. // will take care of that.
  5991. ref.ignore = true;
  5992. }
  5993. };
  5994. /**
  5995. * helper method that gets only recent manifests
  5996. * used by global.ls command
  5997. */
  5998. Install.prototype.getFlattenedDeps = function () {
  5999. var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  6000. var _ref18 = yield this.fetchRequestFromCwd(),
  6001. depRequests = _ref18.requests,
  6002. rawPatterns = _ref18.patterns;
  6003. yield this.resolver.init(depRequests, {});
  6004. var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config);
  6005. this.resolver.updateManifests(manifests);
  6006. return this.flatten(rawPatterns);
  6007. });
  6008. function getFlattenedDeps() {
  6009. return _ref17.apply(this, arguments);
  6010. }
  6011. return getFlattenedDeps;
  6012. }();
  6013. /**
  6014. * TODO description
  6015. */
  6016. Install.prototype.init = function () {
  6017. var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  6018. var _this2 = this;
  6019. this.checkUpdate();
  6020. // warn if we have a shrinkwrap
  6021. if (yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).NPM_SHRINKWRAP_FILENAME))) {
  6022. this.reporter.warn(this.reporter.lang('shrinkwrapWarning'));
  6023. }
  6024. // warn if we have an npm lockfile
  6025. if (yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).NPM_LOCK_FILENAME))) {
  6026. this.reporter.warn(this.reporter.lang('npmLockfileWarning'));
  6027. }
  6028. if (this.config.plugnplayEnabled) {
  6029. this.reporter.info(this.reporter.lang('plugnplaySuggestV2L1'));
  6030. this.reporter.info(this.reporter.lang('plugnplaySuggestV2L2'));
  6031. }
  6032. var flattenedTopLevelPatterns = [];
  6033. var steps = [];
  6034. var _ref20 = yield this.fetchRequestFromCwd(),
  6035. depRequests = _ref20.requests,
  6036. rawPatterns = _ref20.patterns,
  6037. ignorePatterns = _ref20.ignorePatterns,
  6038. workspaceLayout = _ref20.workspaceLayout,
  6039. manifest = _ref20.manifest;
  6040. var topLevelPatterns = [];
  6041. var artifacts = yield this.integrityChecker.getArtifacts();
  6042. if (artifacts) {
  6043. this.linker.setArtifacts(artifacts);
  6044. this.scripts.setArtifacts(artifacts);
  6045. }
  6046. if ((_packageCompatibility || _load_packageCompatibility()).shouldCheck(manifest, this.flags)) {
  6047. steps.push(function () {
  6048. var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) {
  6049. _this2.reporter.step(curr, total, _this2.reporter.lang('checkingManifest'), emoji.get('mag'));
  6050. yield _this2.checkCompatibility();
  6051. });
  6052. return function (_x5, _x6) {
  6053. return _ref21.apply(this, arguments);
  6054. };
  6055. }());
  6056. }
  6057. var audit = new (_audit || _load_audit()).default(this.config, this.reporter, { groups: (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES });
  6058. var auditFoundProblems = false;
  6059. steps.push(function (curr, total) {
  6060. return (0, (_hooks || _load_hooks()).callThroughHook)('resolveStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  6061. _this2.reporter.step(curr, total, _this2.reporter.lang('resolvingPackages'), emoji.get('mag'));
  6062. yield _this2.resolver.init(_this2.prepareRequests(depRequests), {
  6063. isFlat: _this2.flags.flat,
  6064. isFrozen: _this2.flags.frozenLockfile,
  6065. workspaceLayout
  6066. });
  6067. topLevelPatterns = _this2.preparePatterns(rawPatterns);
  6068. flattenedTopLevelPatterns = yield _this2.flatten(topLevelPatterns);
  6069. return { bailout: !_this2.flags.audit && (yield _this2.bailout(topLevelPatterns, workspaceLayout)) };
  6070. }));
  6071. });
  6072. if (this.flags.audit) {
  6073. steps.push(function (curr, total) {
  6074. return (0, (_hooks || _load_hooks()).callThroughHook)('auditStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  6075. _this2.reporter.step(curr, total, _this2.reporter.lang('auditRunning'), emoji.get('mag'));
  6076. if (_this2.flags.offline) {
  6077. _this2.reporter.warn(_this2.reporter.lang('auditOffline'));
  6078. return { bailout: false };
  6079. }
  6080. var preparedManifests = yield _this2.prepareManifests();
  6081. // $FlowFixMe - Flow considers `m` in the map operation to be "mixed", so does not recognize `m.object`
  6082. var mergedManifest = (_assign || _load_assign()).default.apply(Object, [{}].concat((0, (_values || _load_values()).default)(preparedManifests).map(function (m) {
  6083. return m.object;
  6084. })));
  6085. var auditVulnerabilityCounts = yield audit.performAudit(mergedManifest, _this2.lockfile, _this2.resolver, _this2.linker, topLevelPatterns);
  6086. auditFoundProblems = auditVulnerabilityCounts.info || auditVulnerabilityCounts.low || auditVulnerabilityCounts.moderate || auditVulnerabilityCounts.high || auditVulnerabilityCounts.critical;
  6087. return { bailout: yield _this2.bailout(topLevelPatterns, workspaceLayout) };
  6088. }));
  6089. });
  6090. }
  6091. steps.push(function (curr, total) {
  6092. return (0, (_hooks || _load_hooks()).callThroughHook)('fetchStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  6093. _this2.markIgnored(ignorePatterns);
  6094. _this2.reporter.step(curr, total, _this2.reporter.lang('fetchingPackages'), emoji.get('truck'));
  6095. var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this2.resolver.getManifests(), _this2.config);
  6096. _this2.resolver.updateManifests(manifests);
  6097. yield (_packageCompatibility || _load_packageCompatibility()).check(_this2.resolver.getManifests(), _this2.config, _this2.flags.ignoreEngines);
  6098. }));
  6099. });
  6100. steps.push(function (curr, total) {
  6101. return (0, (_hooks || _load_hooks()).callThroughHook)('linkStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  6102. // remove integrity hash to make this operation atomic
  6103. yield _this2.integrityChecker.removeIntegrityFile();
  6104. _this2.reporter.step(curr, total, _this2.reporter.lang('linkingDependencies'), emoji.get('link'));
  6105. flattenedTopLevelPatterns = _this2.preparePatternsForLinking(flattenedTopLevelPatterns, manifest, _this2.config.lockfileFolder === _this2.config.cwd);
  6106. yield _this2.linker.init(flattenedTopLevelPatterns, workspaceLayout, {
  6107. linkDuplicates: _this2.flags.linkDuplicates,
  6108. ignoreOptional: _this2.flags.ignoreOptional
  6109. });
  6110. }));
  6111. });
  6112. if (this.config.plugnplayEnabled) {
  6113. steps.push(function (curr, total) {
  6114. return (0, (_hooks || _load_hooks()).callThroughHook)('pnpStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  6115. var pnpPath = `${_this2.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`;
  6116. var code = yield (0, (_generatePnpMap || _load_generatePnpMap()).generatePnpMap)(_this2.config, flattenedTopLevelPatterns, {
  6117. resolver: _this2.resolver,
  6118. reporter: _this2.reporter,
  6119. targetPath: pnpPath,
  6120. workspaceLayout
  6121. });
  6122. try {
  6123. var file = yield (_fs || _load_fs()).readFile(pnpPath);
  6124. if (file === code) {
  6125. return;
  6126. }
  6127. } catch (error) {}
  6128. yield (_fs || _load_fs()).writeFile(pnpPath, code);
  6129. yield (_fs || _load_fs()).chmod(pnpPath, 0o755);
  6130. }));
  6131. });
  6132. }
  6133. steps.push(function (curr, total) {
  6134. return (0, (_hooks || _load_hooks()).callThroughHook)('buildStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  6135. _this2.reporter.step(curr, total, _this2.flags.force ? _this2.reporter.lang('rebuildingPackages') : _this2.reporter.lang('buildingFreshPackages'), emoji.get('hammer'));
  6136. if (_this2.config.ignoreScripts) {
  6137. _this2.reporter.warn(_this2.reporter.lang('ignoredScripts'));
  6138. } else {
  6139. yield _this2.scripts.init(flattenedTopLevelPatterns);
  6140. }
  6141. }));
  6142. });
  6143. if (this.flags.har) {
  6144. steps.push(function () {
  6145. var _ref28 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) {
  6146. var formattedDate = new Date().toISOString().replace(/:/g, '-');
  6147. var filename = `yarn-install_${formattedDate}.har`;
  6148. _this2.reporter.step(curr, total, _this2.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record'));
  6149. yield _this2.config.requestManager.saveHar(filename);
  6150. });
  6151. return function (_x7, _x8) {
  6152. return _ref28.apply(this, arguments);
  6153. };
  6154. }());
  6155. }
  6156. if (yield this.shouldClean()) {
  6157. steps.push(function () {
  6158. var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) {
  6159. _this2.reporter.step(curr, total, _this2.reporter.lang('cleaningModules'), emoji.get('recycle'));
  6160. yield (0, (_autoclean || _load_autoclean()).clean)(_this2.config, _this2.reporter);
  6161. });
  6162. return function (_x9, _x10) {
  6163. return _ref29.apply(this, arguments);
  6164. };
  6165. }());
  6166. }
  6167. var currentStep = 0;
  6168. for (var _iterator11 = steps, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
  6169. var _ref30;
  6170. if (_isArray11) {
  6171. if (_i11 >= _iterator11.length) break;
  6172. _ref30 = _iterator11[_i11++];
  6173. } else {
  6174. _i11 = _iterator11.next();
  6175. if (_i11.done) break;
  6176. _ref30 = _i11.value;
  6177. }
  6178. var step = _ref30;
  6179. var stepResult = yield step(++currentStep, steps.length);
  6180. if (stepResult && stepResult.bailout) {
  6181. if (this.flags.audit) {
  6182. audit.summary();
  6183. }
  6184. if (auditFoundProblems) {
  6185. this.reporter.warn(this.reporter.lang('auditRunAuditForDetails'));
  6186. }
  6187. this.maybeOutputUpdate();
  6188. return flattenedTopLevelPatterns;
  6189. }
  6190. }
  6191. // fin!
  6192. if (this.flags.audit) {
  6193. audit.summary();
  6194. }
  6195. if (auditFoundProblems) {
  6196. this.reporter.warn(this.reporter.lang('auditRunAuditForDetails'));
  6197. }
  6198. yield this.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout);
  6199. yield this.persistChanges();
  6200. this.maybeOutputUpdate();
  6201. this.config.requestManager.clearCache();
  6202. return flattenedTopLevelPatterns;
  6203. });
  6204. function init() {
  6205. return _ref19.apply(this, arguments);
  6206. }
  6207. return init;
  6208. }();
  6209. Install.prototype.checkCompatibility = function () {
  6210. var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  6211. var _ref32 = yield this.fetchRequestFromCwd(),
  6212. manifest = _ref32.manifest;
  6213. yield (_packageCompatibility || _load_packageCompatibility()).checkOne(manifest, this.config, this.flags.ignoreEngines);
  6214. });
  6215. function checkCompatibility() {
  6216. return _ref31.apply(this, arguments);
  6217. }
  6218. return checkCompatibility;
  6219. }();
  6220. Install.prototype.persistChanges = function () {
  6221. var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  6222. // get all the different registry manifests in this folder
  6223. var manifests = yield this.config.getRootManifests();
  6224. if (yield this.applyChanges(manifests)) {
  6225. yield this.config.saveRootManifests(manifests);
  6226. }
  6227. });
  6228. function persistChanges() {
  6229. return _ref33.apply(this, arguments);
  6230. }
  6231. return persistChanges;
  6232. }();
  6233. Install.prototype.applyChanges = function applyChanges(manifests) {
  6234. var hasChanged = false;
  6235. if (this.config.plugnplayPersist) {
  6236. var object = manifests.npm.object;
  6237. if (typeof object.installConfig !== 'object') {
  6238. object.installConfig = {};
  6239. }
  6240. if (this.config.plugnplayEnabled && object.installConfig.pnp !== true) {
  6241. object.installConfig.pnp = true;
  6242. hasChanged = true;
  6243. } else if (!this.config.plugnplayEnabled && typeof object.installConfig.pnp !== 'undefined') {
  6244. delete object.installConfig.pnp;
  6245. hasChanged = true;
  6246. }
  6247. if ((0, (_keys || _load_keys()).default)(object.installConfig).length === 0) {
  6248. delete object.installConfig;
  6249. }
  6250. }
  6251. return (_promise || _load_promise()).default.resolve(hasChanged);
  6252. };
  6253. /**
  6254. * Check if we should run the cleaning step.
  6255. */
  6256. Install.prototype.shouldClean = function shouldClean() {
  6257. return (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME));
  6258. };
  6259. /**
  6260. * TODO
  6261. */
  6262. Install.prototype.flatten = function () {
  6263. var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns) {
  6264. var _this3 = this;
  6265. if (!this.flags.flat) {
  6266. return patterns;
  6267. }
  6268. var flattenedPatterns = [];
  6269. for (var _iterator12 = this.resolver.getAllDependencyNamesByLevelOrder(patterns), _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
  6270. var _ref35;
  6271. if (_isArray12) {
  6272. if (_i12 >= _iterator12.length) break;
  6273. _ref35 = _iterator12[_i12++];
  6274. } else {
  6275. _i12 = _iterator12.next();
  6276. if (_i12.done) break;
  6277. _ref35 = _i12.value;
  6278. }
  6279. var name = _ref35;
  6280. var infos = this.resolver.getAllInfoForPackageName(name).filter(function (manifest) {
  6281. var ref = manifest._reference;
  6282. invariant(ref, 'expected package reference');
  6283. return !ref.ignore;
  6284. });
  6285. if (infos.length === 0) {
  6286. continue;
  6287. }
  6288. if (infos.length === 1) {
  6289. // single version of this package
  6290. // take out a single pattern as multiple patterns may have resolved to this package
  6291. flattenedPatterns.push(this.resolver.patternsByPackage[name][0]);
  6292. continue;
  6293. }
  6294. var options = infos.map(function (info) {
  6295. var ref = info._reference;
  6296. invariant(ref, 'expected reference');
  6297. return {
  6298. // TODO `and is required by {PARENT}`,
  6299. name: _this3.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version),
  6300. value: info.version
  6301. };
  6302. });
  6303. var versions = infos.map(function (info) {
  6304. return info.version;
  6305. });
  6306. var version = void 0;
  6307. var resolutionVersion = this.resolutions[name];
  6308. if (resolutionVersion && versions.indexOf(resolutionVersion) >= 0) {
  6309. // use json `resolution` version
  6310. version = resolutionVersion;
  6311. } else {
  6312. version = yield this.reporter.select(this.reporter.lang('manualVersionResolution', name), this.reporter.lang('answer'), options);
  6313. this.resolutions[name] = version;
  6314. }
  6315. flattenedPatterns.push(this.resolver.collapseAllVersionsOfPackage(name, version));
  6316. }
  6317. // save resolutions to their appropriate root manifest
  6318. if ((0, (_keys || _load_keys()).default)(this.resolutions).length) {
  6319. var manifests = yield this.config.getRootManifests();
  6320. for (var _name in this.resolutions) {
  6321. var version = this.resolutions[_name];
  6322. var _patterns = this.resolver.patternsByPackage[_name];
  6323. if (!_patterns) {
  6324. continue;
  6325. }
  6326. var _manifest2 = void 0;
  6327. for (var _iterator13 = _patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) {
  6328. var _ref36;
  6329. if (_isArray13) {
  6330. if (_i13 >= _iterator13.length) break;
  6331. _ref36 = _iterator13[_i13++];
  6332. } else {
  6333. _i13 = _iterator13.next();
  6334. if (_i13.done) break;
  6335. _ref36 = _i13.value;
  6336. }
  6337. var _pattern5 = _ref36;
  6338. _manifest2 = this.resolver.getResolvedPattern(_pattern5);
  6339. if (_manifest2) {
  6340. break;
  6341. }
  6342. }
  6343. invariant(_manifest2, 'expected manifest');
  6344. var ref = _manifest2._reference;
  6345. invariant(ref, 'expected reference');
  6346. var object = manifests[ref.registry].object;
  6347. object.resolutions = object.resolutions || {};
  6348. object.resolutions[_name] = version;
  6349. }
  6350. yield this.config.saveRootManifests(manifests);
  6351. }
  6352. return flattenedPatterns;
  6353. });
  6354. function flatten(_x11) {
  6355. return _ref34.apply(this, arguments);
  6356. }
  6357. return flatten;
  6358. }();
  6359. /**
  6360. * Remove offline tarballs that are no longer required
  6361. */
  6362. Install.prototype.pruneOfflineMirror = function () {
  6363. var _ref37 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile) {
  6364. var mirror = this.config.getOfflineMirrorPath();
  6365. if (!mirror) {
  6366. return;
  6367. }
  6368. var requiredTarballs = new (_set || _load_set()).default();
  6369. for (var dependency in lockfile) {
  6370. var resolved = lockfile[dependency].resolved;
  6371. if (resolved) {
  6372. var basename = path.basename(resolved.split('#')[0]);
  6373. if (dependency[0] === '@' && basename[0] !== '@') {
  6374. requiredTarballs.add(`${dependency.split('/')[0]}-${basename}`);
  6375. }
  6376. requiredTarballs.add(basename);
  6377. }
  6378. }
  6379. var mirrorFiles = yield (_fs || _load_fs()).walk(mirror);
  6380. for (var _iterator14 = mirrorFiles, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) {
  6381. var _ref38;
  6382. if (_isArray14) {
  6383. if (_i14 >= _iterator14.length) break;
  6384. _ref38 = _iterator14[_i14++];
  6385. } else {
  6386. _i14 = _iterator14.next();
  6387. if (_i14.done) break;
  6388. _ref38 = _i14.value;
  6389. }
  6390. var file = _ref38;
  6391. var isTarball = path.extname(file.basename) === '.tgz';
  6392. // if using experimental-pack-script-packages-in-mirror flag, don't unlink prebuilt packages
  6393. var hasPrebuiltPackage = file.relative.startsWith('prebuilt/');
  6394. if (isTarball && !hasPrebuiltPackage && !requiredTarballs.has(file.basename)) {
  6395. yield (_fs || _load_fs()).unlink(file.absolute);
  6396. }
  6397. }
  6398. });
  6399. function pruneOfflineMirror(_x12) {
  6400. return _ref37.apply(this, arguments);
  6401. }
  6402. return pruneOfflineMirror;
  6403. }();
  6404. /**
  6405. * Save updated integrity and lockfiles.
  6406. */
  6407. Install.prototype.saveLockfileAndIntegrity = function () {
  6408. var _ref39 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) {
  6409. var _this4 = this;
  6410. var resolvedPatterns = {};
  6411. (0, (_keys || _load_keys()).default)(this.resolver.patterns).forEach(function (pattern) {
  6412. if (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern)) {
  6413. resolvedPatterns[pattern] = _this4.resolver.patterns[pattern];
  6414. }
  6415. });
  6416. // TODO this code is duplicated in a few places, need a common way to filter out workspace patterns from lockfile
  6417. patterns = patterns.filter(function (p) {
  6418. return !workspaceLayout || !workspaceLayout.getManifestByPattern(p);
  6419. });
  6420. var lockfileBasedOnResolver = this.lockfile.getLockfile(resolvedPatterns);
  6421. if (this.config.pruneOfflineMirror) {
  6422. yield this.pruneOfflineMirror(lockfileBasedOnResolver);
  6423. }
  6424. // write integrity hash
  6425. if (!this.config.plugnplayEnabled) {
  6426. yield this.integrityChecker.save(patterns, lockfileBasedOnResolver, this.flags, workspaceLayout, this.scripts.getArtifacts());
  6427. }
  6428. // --no-lockfile or --pure-lockfile or --frozen-lockfile
  6429. if (this.flags.lockfile === false || this.flags.pureLockfile || this.flags.frozenLockfile) {
  6430. return;
  6431. }
  6432. var lockFileHasAllPatterns = patterns.every(function (p) {
  6433. return _this4.lockfile.getLocked(p);
  6434. });
  6435. var lockfilePatternsMatch = (0, (_keys || _load_keys()).default)(this.lockfile.cache || {}).every(function (p) {
  6436. return lockfileBasedOnResolver[p];
  6437. });
  6438. var resolverPatternsAreSameAsInLockfile = (0, (_keys || _load_keys()).default)(lockfileBasedOnResolver).every(function (pattern) {
  6439. var manifest = _this4.lockfile.getLocked(pattern);
  6440. return manifest && manifest.resolved === lockfileBasedOnResolver[pattern].resolved && deepEqual(manifest.prebuiltVariants, lockfileBasedOnResolver[pattern].prebuiltVariants);
  6441. });
  6442. var integrityPatternsAreSameAsInLockfile = (0, (_keys || _load_keys()).default)(lockfileBasedOnResolver).every(function (pattern) {
  6443. var existingIntegrityInfo = lockfileBasedOnResolver[pattern].integrity;
  6444. if (!existingIntegrityInfo) {
  6445. // if this entry does not have an integrity, no need to re-write the lockfile because of it
  6446. return true;
  6447. }
  6448. var manifest = _this4.lockfile.getLocked(pattern);
  6449. if (manifest && manifest.integrity) {
  6450. var manifestIntegrity = ssri.stringify(manifest.integrity);
  6451. return manifestIntegrity === existingIntegrityInfo;
  6452. }
  6453. return false;
  6454. });
  6455. // remove command is followed by install with force, lockfile will be rewritten in any case then
  6456. if (!this.flags.force && this.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && integrityPatternsAreSameAsInLockfile && patterns.length) {
  6457. return;
  6458. }
  6459. // build lockfile location
  6460. var loc = path.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME);
  6461. // write lockfile
  6462. var lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, this.config.enableLockfileVersions);
  6463. yield (_fs || _load_fs()).writeFilePreservingEol(loc, lockSource);
  6464. this._logSuccessSaveLockfile();
  6465. });
  6466. function saveLockfileAndIntegrity(_x13, _x14) {
  6467. return _ref39.apply(this, arguments);
  6468. }
  6469. return saveLockfileAndIntegrity;
  6470. }();
  6471. Install.prototype._logSuccessSaveLockfile = function _logSuccessSaveLockfile() {
  6472. this.reporter.success(this.reporter.lang('savedLockfile'));
  6473. };
  6474. /**
  6475. * Load the dependency graph of the current install. Only does package resolving and wont write to the cwd.
  6476. */
  6477. Install.prototype.hydrate = function () {
  6478. var _ref40 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ignoreUnusedPatterns) {
  6479. var request = yield this.fetchRequestFromCwd([], ignoreUnusedPatterns);
  6480. var depRequests = request.requests,
  6481. rawPatterns = request.patterns,
  6482. ignorePatterns = request.ignorePatterns,
  6483. workspaceLayout = request.workspaceLayout;
  6484. yield this.resolver.init(depRequests, {
  6485. isFlat: this.flags.flat,
  6486. isFrozen: this.flags.frozenLockfile,
  6487. workspaceLayout
  6488. });
  6489. yield this.flatten(rawPatterns);
  6490. this.markIgnored(ignorePatterns);
  6491. // fetch packages, should hit cache most of the time
  6492. var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config);
  6493. this.resolver.updateManifests(manifests);
  6494. yield (_packageCompatibility || _load_packageCompatibility()).check(this.resolver.getManifests(), this.config, this.flags.ignoreEngines);
  6495. // expand minimal manifests
  6496. for (var _iterator15 = this.resolver.getManifests(), _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) {
  6497. var _ref41;
  6498. if (_isArray15) {
  6499. if (_i15 >= _iterator15.length) break;
  6500. _ref41 = _iterator15[_i15++];
  6501. } else {
  6502. _i15 = _iterator15.next();
  6503. if (_i15.done) break;
  6504. _ref41 = _i15.value;
  6505. }
  6506. var _manifest3 = _ref41;
  6507. var ref = _manifest3._reference;
  6508. invariant(ref, 'expected reference');
  6509. var type = ref.remote.type;
  6510. // link specifier won't ever hit cache
  6511. var _loc = '';
  6512. if (type === 'link') {
  6513. continue;
  6514. } else if (type === 'workspace') {
  6515. if (!ref.remote.reference) {
  6516. continue;
  6517. }
  6518. _loc = ref.remote.reference;
  6519. } else {
  6520. _loc = this.config.generateModuleCachePath(ref);
  6521. }
  6522. var newPkg = yield this.config.readManifest(_loc);
  6523. yield this.resolver.updateManifest(ref, newPkg);
  6524. }
  6525. return request;
  6526. });
  6527. function hydrate(_x15) {
  6528. return _ref40.apply(this, arguments);
  6529. }
  6530. return hydrate;
  6531. }();
  6532. /**
  6533. * Check for updates every day and output a nag message if there's a newer version.
  6534. */
  6535. Install.prototype.checkUpdate = function checkUpdate() {
  6536. if (this.config.nonInteractive) {
  6537. // don't show upgrade dialog on CI or non-TTY terminals
  6538. return;
  6539. }
  6540. // don't check if disabled
  6541. if (this.config.getOption('disable-self-update-check')) {
  6542. return;
  6543. }
  6544. // only check for updates once a day
  6545. var lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0;
  6546. if (lastUpdateCheck && Date.now() - lastUpdateCheck < ONE_DAY) {
  6547. return;
  6548. }
  6549. // don't bug for updates on tagged releases
  6550. if ((_yarnVersion || _load_yarnVersion()).version.indexOf('-') >= 0) {
  6551. return;
  6552. }
  6553. this._checkUpdate().catch(function () {
  6554. // swallow errors
  6555. });
  6556. };
  6557. Install.prototype._checkUpdate = function () {
  6558. var _ref42 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  6559. var _this5 = this;
  6560. var latestVersion = yield this.config.requestManager.request({
  6561. url: (_constants || _load_constants()).SELF_UPDATE_VERSION_URL
  6562. });
  6563. invariant(typeof latestVersion === 'string', 'expected string');
  6564. latestVersion = latestVersion.trim();
  6565. if (!semver.valid(latestVersion)) {
  6566. return;
  6567. }
  6568. // ensure we only check for updates periodically
  6569. this.config.registries.yarn.saveHomeConfig({
  6570. lastUpdateCheck: Date.now()
  6571. });
  6572. if (semver.gt(latestVersion, (_yarnVersion || _load_yarnVersion()).version)) {
  6573. var installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)();
  6574. this.maybeOutputUpdate = function () {
  6575. _this5.reporter.warn(_this5.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version));
  6576. var command = getUpdateCommand(installationMethod);
  6577. if (command) {
  6578. _this5.reporter.info(_this5.reporter.lang('yarnOutdatedCommand'));
  6579. _this5.reporter.command(command);
  6580. } else {
  6581. var installer = getUpdateInstaller(installationMethod);
  6582. if (installer) {
  6583. _this5.reporter.info(_this5.reporter.lang('yarnOutdatedInstaller', installer));
  6584. }
  6585. }
  6586. };
  6587. }
  6588. });
  6589. function _checkUpdate() {
  6590. return _ref42.apply(this, arguments);
  6591. }
  6592. return _checkUpdate;
  6593. }();
  6594. /**
  6595. * Method to override with a possible upgrade message.
  6596. */
  6597. Install.prototype.maybeOutputUpdate = function maybeOutputUpdate() {};
  6598. return Install;
  6599. }();
  6600. function hasWrapper(commander, args) {
  6601. return true;
  6602. }
  6603. function setFlags(commander) {
  6604. commander.description('Yarn install is used to install all dependencies for a project.');
  6605. commander.usage('install [flags]');
  6606. commander.option('-A, --audit', 'Run vulnerability audit on installed packages');
  6607. commander.option('-g, --global', 'DEPRECATED');
  6608. commander.option('-S, --save', 'DEPRECATED - save package to your `dependencies`');
  6609. commander.option('-D, --save-dev', 'DEPRECATED - save package to your `devDependencies`');
  6610. commander.option('-P, --save-peer', 'DEPRECATED - save package to your `peerDependencies`');
  6611. commander.option('-O, --save-optional', 'DEPRECATED - save package to your `optionalDependencies`');
  6612. commander.option('-E, --save-exact', 'DEPRECATED');
  6613. commander.option('-T, --save-tilde', 'DEPRECATED');
  6614. }
  6615. /***/ }),
  6616. /* 42 */
  6617. /***/ (function(module, exports, __webpack_require__) {
  6618. module.exports = { "default": __webpack_require__(593), __esModule: true };
  6619. /***/ }),
  6620. /* 43 */
  6621. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6622. "use strict";
  6623. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SubjectSubscriber; });
  6624. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subject; });
  6625. /* unused harmony export AnonymousSubject */
  6626. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  6627. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(17);
  6628. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(5);
  6629. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(31);
  6630. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__ = __webpack_require__(180);
  6631. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__ = __webpack_require__(392);
  6632. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__ = __webpack_require__(262);
  6633. /** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */
  6634. var SubjectSubscriber = /*@__PURE__*/ (function (_super) {
  6635. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubjectSubscriber, _super);
  6636. function SubjectSubscriber(destination) {
  6637. var _this = _super.call(this, destination) || this;
  6638. _this.destination = destination;
  6639. return _this;
  6640. }
  6641. return SubjectSubscriber;
  6642. }(__WEBPACK_IMPORTED_MODULE_2__Subscriber__["a" /* Subscriber */]));
  6643. var Subject = /*@__PURE__*/ (function (_super) {
  6644. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subject, _super);
  6645. function Subject() {
  6646. var _this = _super.call(this) || this;
  6647. _this.observers = [];
  6648. _this.closed = false;
  6649. _this.isStopped = false;
  6650. _this.hasError = false;
  6651. _this.thrownError = null;
  6652. return _this;
  6653. }
  6654. Subject.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () {
  6655. return new SubjectSubscriber(this);
  6656. };
  6657. Subject.prototype.lift = function (operator) {
  6658. var subject = new AnonymousSubject(this, this);
  6659. subject.operator = operator;
  6660. return subject;
  6661. };
  6662. Subject.prototype.next = function (value) {
  6663. if (this.closed) {
  6664. throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
  6665. }
  6666. if (!this.isStopped) {
  6667. var observers = this.observers;
  6668. var len = observers.length;
  6669. var copy = observers.slice();
  6670. for (var i = 0; i < len; i++) {
  6671. copy[i].next(value);
  6672. }
  6673. }
  6674. };
  6675. Subject.prototype.error = function (err) {
  6676. if (this.closed) {
  6677. throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
  6678. }
  6679. this.hasError = true;
  6680. this.thrownError = err;
  6681. this.isStopped = true;
  6682. var observers = this.observers;
  6683. var len = observers.length;
  6684. var copy = observers.slice();
  6685. for (var i = 0; i < len; i++) {
  6686. copy[i].error(err);
  6687. }
  6688. this.observers.length = 0;
  6689. };
  6690. Subject.prototype.complete = function () {
  6691. if (this.closed) {
  6692. throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
  6693. }
  6694. this.isStopped = true;
  6695. var observers = this.observers;
  6696. var len = observers.length;
  6697. var copy = observers.slice();
  6698. for (var i = 0; i < len; i++) {
  6699. copy[i].complete();
  6700. }
  6701. this.observers.length = 0;
  6702. };
  6703. Subject.prototype.unsubscribe = function () {
  6704. this.isStopped = true;
  6705. this.closed = true;
  6706. this.observers = null;
  6707. };
  6708. Subject.prototype._trySubscribe = function (subscriber) {
  6709. if (this.closed) {
  6710. throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
  6711. }
  6712. else {
  6713. return _super.prototype._trySubscribe.call(this, subscriber);
  6714. }
  6715. };
  6716. Subject.prototype._subscribe = function (subscriber) {
  6717. if (this.closed) {
  6718. throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
  6719. }
  6720. else if (this.hasError) {
  6721. subscriber.error(this.thrownError);
  6722. return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY;
  6723. }
  6724. else if (this.isStopped) {
  6725. subscriber.complete();
  6726. return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY;
  6727. }
  6728. else {
  6729. this.observers.push(subscriber);
  6730. return new __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__["a" /* SubjectSubscription */](this, subscriber);
  6731. }
  6732. };
  6733. Subject.prototype.asObservable = function () {
  6734. var observable = new __WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */]();
  6735. observable.source = this;
  6736. return observable;
  6737. };
  6738. Subject.create = function (destination, source) {
  6739. return new AnonymousSubject(destination, source);
  6740. };
  6741. return Subject;
  6742. }(__WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */]));
  6743. var AnonymousSubject = /*@__PURE__*/ (function (_super) {
  6744. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AnonymousSubject, _super);
  6745. function AnonymousSubject(destination, source) {
  6746. var _this = _super.call(this) || this;
  6747. _this.destination = destination;
  6748. _this.source = source;
  6749. return _this;
  6750. }
  6751. AnonymousSubject.prototype.next = function (value) {
  6752. var destination = this.destination;
  6753. if (destination && destination.next) {
  6754. destination.next(value);
  6755. }
  6756. };
  6757. AnonymousSubject.prototype.error = function (err) {
  6758. var destination = this.destination;
  6759. if (destination && destination.error) {
  6760. this.destination.error(err);
  6761. }
  6762. };
  6763. AnonymousSubject.prototype.complete = function () {
  6764. var destination = this.destination;
  6765. if (destination && destination.complete) {
  6766. this.destination.complete();
  6767. }
  6768. };
  6769. AnonymousSubject.prototype._subscribe = function (subscriber) {
  6770. var source = this.source;
  6771. if (source) {
  6772. return this.source.subscribe(subscriber);
  6773. }
  6774. else {
  6775. return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY;
  6776. }
  6777. };
  6778. return AnonymousSubject;
  6779. }(Subject));
  6780. //# sourceMappingURL=Subject.js.map
  6781. /***/ }),
  6782. /* 44 */
  6783. /***/ (function(module, exports, __webpack_require__) {
  6784. var store = __webpack_require__(225)('wks');
  6785. var uid = __webpack_require__(162);
  6786. var Symbol = __webpack_require__(38).Symbol;
  6787. var USE_SYMBOL = typeof Symbol == 'function';
  6788. var $exports = module.exports = function (name) {
  6789. return store[name] || (store[name] =
  6790. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  6791. };
  6792. $exports.store = store;
  6793. /***/ }),
  6794. /* 45 */
  6795. /***/ (function(module, exports, __webpack_require__) {
  6796. /* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
  6797. * @license
  6798. * Lodash <https://lodash.com/>
  6799. * Copyright JS Foundation and other contributors <https://js.foundation/>
  6800. * Released under MIT license <https://lodash.com/license>
  6801. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  6802. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  6803. */
  6804. ;(function() {
  6805. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  6806. var undefined;
  6807. /** Used as the semantic version number. */
  6808. var VERSION = '4.17.10';
  6809. /** Used as the size to enable large array optimizations. */
  6810. var LARGE_ARRAY_SIZE = 200;
  6811. /** Error message constants. */
  6812. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  6813. FUNC_ERROR_TEXT = 'Expected a function';
  6814. /** Used to stand-in for `undefined` hash values. */
  6815. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  6816. /** Used as the maximum memoize cache size. */
  6817. var MAX_MEMOIZE_SIZE = 500;
  6818. /** Used as the internal argument placeholder. */
  6819. var PLACEHOLDER = '__lodash_placeholder__';
  6820. /** Used to compose bitmasks for cloning. */
  6821. var CLONE_DEEP_FLAG = 1,
  6822. CLONE_FLAT_FLAG = 2,
  6823. CLONE_SYMBOLS_FLAG = 4;
  6824. /** Used to compose bitmasks for value comparisons. */
  6825. var COMPARE_PARTIAL_FLAG = 1,
  6826. COMPARE_UNORDERED_FLAG = 2;
  6827. /** Used to compose bitmasks for function metadata. */
  6828. var WRAP_BIND_FLAG = 1,
  6829. WRAP_BIND_KEY_FLAG = 2,
  6830. WRAP_CURRY_BOUND_FLAG = 4,
  6831. WRAP_CURRY_FLAG = 8,
  6832. WRAP_CURRY_RIGHT_FLAG = 16,
  6833. WRAP_PARTIAL_FLAG = 32,
  6834. WRAP_PARTIAL_RIGHT_FLAG = 64,
  6835. WRAP_ARY_FLAG = 128,
  6836. WRAP_REARG_FLAG = 256,
  6837. WRAP_FLIP_FLAG = 512;
  6838. /** Used as default options for `_.truncate`. */
  6839. var DEFAULT_TRUNC_LENGTH = 30,
  6840. DEFAULT_TRUNC_OMISSION = '...';
  6841. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  6842. var HOT_COUNT = 800,
  6843. HOT_SPAN = 16;
  6844. /** Used to indicate the type of lazy iteratees. */
  6845. var LAZY_FILTER_FLAG = 1,
  6846. LAZY_MAP_FLAG = 2,
  6847. LAZY_WHILE_FLAG = 3;
  6848. /** Used as references for various `Number` constants. */
  6849. var INFINITY = 1 / 0,
  6850. MAX_SAFE_INTEGER = 9007199254740991,
  6851. MAX_INTEGER = 1.7976931348623157e+308,
  6852. NAN = 0 / 0;
  6853. /** Used as references for the maximum length and index of an array. */
  6854. var MAX_ARRAY_LENGTH = 4294967295,
  6855. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  6856. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  6857. /** Used to associate wrap methods with their bit flags. */
  6858. var wrapFlags = [
  6859. ['ary', WRAP_ARY_FLAG],
  6860. ['bind', WRAP_BIND_FLAG],
  6861. ['bindKey', WRAP_BIND_KEY_FLAG],
  6862. ['curry', WRAP_CURRY_FLAG],
  6863. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  6864. ['flip', WRAP_FLIP_FLAG],
  6865. ['partial', WRAP_PARTIAL_FLAG],
  6866. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  6867. ['rearg', WRAP_REARG_FLAG]
  6868. ];
  6869. /** `Object#toString` result references. */
  6870. var argsTag = '[object Arguments]',
  6871. arrayTag = '[object Array]',
  6872. asyncTag = '[object AsyncFunction]',
  6873. boolTag = '[object Boolean]',
  6874. dateTag = '[object Date]',
  6875. domExcTag = '[object DOMException]',
  6876. errorTag = '[object Error]',
  6877. funcTag = '[object Function]',
  6878. genTag = '[object GeneratorFunction]',
  6879. mapTag = '[object Map]',
  6880. numberTag = '[object Number]',
  6881. nullTag = '[object Null]',
  6882. objectTag = '[object Object]',
  6883. promiseTag = '[object Promise]',
  6884. proxyTag = '[object Proxy]',
  6885. regexpTag = '[object RegExp]',
  6886. setTag = '[object Set]',
  6887. stringTag = '[object String]',
  6888. symbolTag = '[object Symbol]',
  6889. undefinedTag = '[object Undefined]',
  6890. weakMapTag = '[object WeakMap]',
  6891. weakSetTag = '[object WeakSet]';
  6892. var arrayBufferTag = '[object ArrayBuffer]',
  6893. dataViewTag = '[object DataView]',
  6894. float32Tag = '[object Float32Array]',
  6895. float64Tag = '[object Float64Array]',
  6896. int8Tag = '[object Int8Array]',
  6897. int16Tag = '[object Int16Array]',
  6898. int32Tag = '[object Int32Array]',
  6899. uint8Tag = '[object Uint8Array]',
  6900. uint8ClampedTag = '[object Uint8ClampedArray]',
  6901. uint16Tag = '[object Uint16Array]',
  6902. uint32Tag = '[object Uint32Array]';
  6903. /** Used to match empty string literals in compiled template source. */
  6904. var reEmptyStringLeading = /\b__p \+= '';/g,
  6905. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  6906. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  6907. /** Used to match HTML entities and HTML characters. */
  6908. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  6909. reUnescapedHtml = /[&<>"']/g,
  6910. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  6911. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  6912. /** Used to match template delimiters. */
  6913. var reEscape = /<%-([\s\S]+?)%>/g,
  6914. reEvaluate = /<%([\s\S]+?)%>/g,
  6915. reInterpolate = /<%=([\s\S]+?)%>/g;
  6916. /** Used to match property names within property paths. */
  6917. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  6918. reIsPlainProp = /^\w*$/,
  6919. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  6920. /**
  6921. * Used to match `RegExp`
  6922. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  6923. */
  6924. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  6925. reHasRegExpChar = RegExp(reRegExpChar.source);
  6926. /** Used to match leading and trailing whitespace. */
  6927. var reTrim = /^\s+|\s+$/g,
  6928. reTrimStart = /^\s+/,
  6929. reTrimEnd = /\s+$/;
  6930. /** Used to match wrap detail comments. */
  6931. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  6932. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  6933. reSplitDetails = /,? & /;
  6934. /** Used to match words composed of alphanumeric characters. */
  6935. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  6936. /** Used to match backslashes in property paths. */
  6937. var reEscapeChar = /\\(\\)?/g;
  6938. /**
  6939. * Used to match
  6940. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  6941. */
  6942. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  6943. /** Used to match `RegExp` flags from their coerced string values. */
  6944. var reFlags = /\w*$/;
  6945. /** Used to detect bad signed hexadecimal string values. */
  6946. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  6947. /** Used to detect binary string values. */
  6948. var reIsBinary = /^0b[01]+$/i;
  6949. /** Used to detect host constructors (Safari). */
  6950. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  6951. /** Used to detect octal string values. */
  6952. var reIsOctal = /^0o[0-7]+$/i;
  6953. /** Used to detect unsigned integer values. */
  6954. var reIsUint = /^(?:0|[1-9]\d*)$/;
  6955. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  6956. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  6957. /** Used to ensure capturing order of template delimiters. */
  6958. var reNoMatch = /($^)/;
  6959. /** Used to match unescaped characters in compiled string literals. */
  6960. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  6961. /** Used to compose unicode character classes. */
  6962. var rsAstralRange = '\\ud800-\\udfff',
  6963. rsComboMarksRange = '\\u0300-\\u036f',
  6964. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  6965. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  6966. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  6967. rsDingbatRange = '\\u2700-\\u27bf',
  6968. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  6969. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  6970. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  6971. rsPunctuationRange = '\\u2000-\\u206f',
  6972. rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
  6973. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  6974. rsVarRange = '\\ufe0e\\ufe0f',
  6975. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  6976. /** Used to compose unicode capture groups. */
  6977. var rsApos = "['\u2019]",
  6978. rsAstral = '[' + rsAstralRange + ']',
  6979. rsBreak = '[' + rsBreakRange + ']',
  6980. rsCombo = '[' + rsComboRange + ']',
  6981. rsDigits = '\\d+',
  6982. rsDingbat = '[' + rsDingbatRange + ']',
  6983. rsLower = '[' + rsLowerRange + ']',
  6984. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  6985. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  6986. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  6987. rsNonAstral = '[^' + rsAstralRange + ']',
  6988. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  6989. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  6990. rsUpper = '[' + rsUpperRange + ']',
  6991. rsZWJ = '\\u200d';
  6992. /** Used to compose unicode regexes. */
  6993. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  6994. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  6995. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  6996. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  6997. reOptMod = rsModifier + '?',
  6998. rsOptVar = '[' + rsVarRange + ']?',
  6999. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  7000. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  7001. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  7002. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  7003. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  7004. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  7005. /** Used to match apostrophes. */
  7006. var reApos = RegExp(rsApos, 'g');
  7007. /**
  7008. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  7009. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  7010. */
  7011. var reComboMark = RegExp(rsCombo, 'g');
  7012. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  7013. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  7014. /** Used to match complex or compound words. */
  7015. var reUnicodeWord = RegExp([
  7016. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  7017. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  7018. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  7019. rsUpper + '+' + rsOptContrUpper,
  7020. rsOrdUpper,
  7021. rsOrdLower,
  7022. rsDigits,
  7023. rsEmoji
  7024. ].join('|'), 'g');
  7025. /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  7026. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  7027. /** Used to detect strings that need a more robust regexp to match words. */
  7028. var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
  7029. /** Used to assign default `context` object properties. */
  7030. var contextProps = [
  7031. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  7032. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  7033. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  7034. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  7035. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  7036. ];
  7037. /** Used to make template sourceURLs easier to identify. */
  7038. var templateCounter = -1;
  7039. /** Used to identify `toStringTag` values of typed arrays. */
  7040. var typedArrayTags = {};
  7041. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  7042. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  7043. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  7044. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  7045. typedArrayTags[uint32Tag] = true;
  7046. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  7047. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  7048. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  7049. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  7050. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  7051. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  7052. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  7053. typedArrayTags[weakMapTag] = false;
  7054. /** Used to identify `toStringTag` values supported by `_.clone`. */
  7055. var cloneableTags = {};
  7056. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  7057. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  7058. cloneableTags[boolTag] = cloneableTags[dateTag] =
  7059. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  7060. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  7061. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  7062. cloneableTags[numberTag] = cloneableTags[objectTag] =
  7063. cloneableTags[regexpTag] = cloneableTags[setTag] =
  7064. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  7065. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  7066. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  7067. cloneableTags[errorTag] = cloneableTags[funcTag] =
  7068. cloneableTags[weakMapTag] = false;
  7069. /** Used to map Latin Unicode letters to basic Latin letters. */
  7070. var deburredLetters = {
  7071. // Latin-1 Supplement block.
  7072. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  7073. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  7074. '\xc7': 'C', '\xe7': 'c',
  7075. '\xd0': 'D', '\xf0': 'd',
  7076. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  7077. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  7078. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  7079. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  7080. '\xd1': 'N', '\xf1': 'n',
  7081. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  7082. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  7083. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  7084. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  7085. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  7086. '\xc6': 'Ae', '\xe6': 'ae',
  7087. '\xde': 'Th', '\xfe': 'th',
  7088. '\xdf': 'ss',
  7089. // Latin Extended-A block.
  7090. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  7091. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  7092. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  7093. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  7094. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  7095. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  7096. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  7097. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  7098. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  7099. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  7100. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  7101. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  7102. '\u0134': 'J', '\u0135': 'j',
  7103. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  7104. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  7105. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  7106. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  7107. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  7108. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  7109. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  7110. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  7111. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  7112. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  7113. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  7114. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  7115. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  7116. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  7117. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  7118. '\u0174': 'W', '\u0175': 'w',
  7119. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  7120. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  7121. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  7122. '\u0132': 'IJ', '\u0133': 'ij',
  7123. '\u0152': 'Oe', '\u0153': 'oe',
  7124. '\u0149': "'n", '\u017f': 's'
  7125. };
  7126. /** Used to map characters to HTML entities. */
  7127. var htmlEscapes = {
  7128. '&': '&amp;',
  7129. '<': '&lt;',
  7130. '>': '&gt;',
  7131. '"': '&quot;',
  7132. "'": '&#39;'
  7133. };
  7134. /** Used to map HTML entities to characters. */
  7135. var htmlUnescapes = {
  7136. '&amp;': '&',
  7137. '&lt;': '<',
  7138. '&gt;': '>',
  7139. '&quot;': '"',
  7140. '&#39;': "'"
  7141. };
  7142. /** Used to escape characters for inclusion in compiled string literals. */
  7143. var stringEscapes = {
  7144. '\\': '\\',
  7145. "'": "'",
  7146. '\n': 'n',
  7147. '\r': 'r',
  7148. '\u2028': 'u2028',
  7149. '\u2029': 'u2029'
  7150. };
  7151. /** Built-in method references without a dependency on `root`. */
  7152. var freeParseFloat = parseFloat,
  7153. freeParseInt = parseInt;
  7154. /** Detect free variable `global` from Node.js. */
  7155. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  7156. /** Detect free variable `self`. */
  7157. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  7158. /** Used as a reference to the global object. */
  7159. var root = freeGlobal || freeSelf || Function('return this')();
  7160. /** Detect free variable `exports`. */
  7161. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  7162. /** Detect free variable `module`. */
  7163. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  7164. /** Detect the popular CommonJS extension `module.exports`. */
  7165. var moduleExports = freeModule && freeModule.exports === freeExports;
  7166. /** Detect free variable `process` from Node.js. */
  7167. var freeProcess = moduleExports && freeGlobal.process;
  7168. /** Used to access faster Node.js helpers. */
  7169. var nodeUtil = (function() {
  7170. try {
  7171. // Use `util.types` for Node.js 10+.
  7172. var types = freeModule && freeModule.require && freeModule.require('util').types;
  7173. if (types) {
  7174. return types;
  7175. }
  7176. // Legacy `process.binding('util')` for Node.js < 10.
  7177. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  7178. } catch (e) {}
  7179. }());
  7180. /* Node.js helper references. */
  7181. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  7182. nodeIsDate = nodeUtil && nodeUtil.isDate,
  7183. nodeIsMap = nodeUtil && nodeUtil.isMap,
  7184. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  7185. nodeIsSet = nodeUtil && nodeUtil.isSet,
  7186. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  7187. /*--------------------------------------------------------------------------*/
  7188. /**
  7189. * A faster alternative to `Function#apply`, this function invokes `func`
  7190. * with the `this` binding of `thisArg` and the arguments of `args`.
  7191. *
  7192. * @private
  7193. * @param {Function} func The function to invoke.
  7194. * @param {*} thisArg The `this` binding of `func`.
  7195. * @param {Array} args The arguments to invoke `func` with.
  7196. * @returns {*} Returns the result of `func`.
  7197. */
  7198. function apply(func, thisArg, args) {
  7199. switch (args.length) {
  7200. case 0: return func.call(thisArg);
  7201. case 1: return func.call(thisArg, args[0]);
  7202. case 2: return func.call(thisArg, args[0], args[1]);
  7203. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  7204. }
  7205. return func.apply(thisArg, args);
  7206. }
  7207. /**
  7208. * A specialized version of `baseAggregator` for arrays.
  7209. *
  7210. * @private
  7211. * @param {Array} [array] The array to iterate over.
  7212. * @param {Function} setter The function to set `accumulator` values.
  7213. * @param {Function} iteratee The iteratee to transform keys.
  7214. * @param {Object} accumulator The initial aggregated object.
  7215. * @returns {Function} Returns `accumulator`.
  7216. */
  7217. function arrayAggregator(array, setter, iteratee, accumulator) {
  7218. var index = -1,
  7219. length = array == null ? 0 : array.length;
  7220. while (++index < length) {
  7221. var value = array[index];
  7222. setter(accumulator, value, iteratee(value), array);
  7223. }
  7224. return accumulator;
  7225. }
  7226. /**
  7227. * A specialized version of `_.forEach` for arrays without support for
  7228. * iteratee shorthands.
  7229. *
  7230. * @private
  7231. * @param {Array} [array] The array to iterate over.
  7232. * @param {Function} iteratee The function invoked per iteration.
  7233. * @returns {Array} Returns `array`.
  7234. */
  7235. function arrayEach(array, iteratee) {
  7236. var index = -1,
  7237. length = array == null ? 0 : array.length;
  7238. while (++index < length) {
  7239. if (iteratee(array[index], index, array) === false) {
  7240. break;
  7241. }
  7242. }
  7243. return array;
  7244. }
  7245. /**
  7246. * A specialized version of `_.forEachRight` for arrays without support for
  7247. * iteratee shorthands.
  7248. *
  7249. * @private
  7250. * @param {Array} [array] The array to iterate over.
  7251. * @param {Function} iteratee The function invoked per iteration.
  7252. * @returns {Array} Returns `array`.
  7253. */
  7254. function arrayEachRight(array, iteratee) {
  7255. var length = array == null ? 0 : array.length;
  7256. while (length--) {
  7257. if (iteratee(array[length], length, array) === false) {
  7258. break;
  7259. }
  7260. }
  7261. return array;
  7262. }
  7263. /**
  7264. * A specialized version of `_.every` for arrays without support for
  7265. * iteratee shorthands.
  7266. *
  7267. * @private
  7268. * @param {Array} [array] The array to iterate over.
  7269. * @param {Function} predicate The function invoked per iteration.
  7270. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  7271. * else `false`.
  7272. */
  7273. function arrayEvery(array, predicate) {
  7274. var index = -1,
  7275. length = array == null ? 0 : array.length;
  7276. while (++index < length) {
  7277. if (!predicate(array[index], index, array)) {
  7278. return false;
  7279. }
  7280. }
  7281. return true;
  7282. }
  7283. /**
  7284. * A specialized version of `_.filter` for arrays without support for
  7285. * iteratee shorthands.
  7286. *
  7287. * @private
  7288. * @param {Array} [array] The array to iterate over.
  7289. * @param {Function} predicate The function invoked per iteration.
  7290. * @returns {Array} Returns the new filtered array.
  7291. */
  7292. function arrayFilter(array, predicate) {
  7293. var index = -1,
  7294. length = array == null ? 0 : array.length,
  7295. resIndex = 0,
  7296. result = [];
  7297. while (++index < length) {
  7298. var value = array[index];
  7299. if (predicate(value, index, array)) {
  7300. result[resIndex++] = value;
  7301. }
  7302. }
  7303. return result;
  7304. }
  7305. /**
  7306. * A specialized version of `_.includes` for arrays without support for
  7307. * specifying an index to search from.
  7308. *
  7309. * @private
  7310. * @param {Array} [array] The array to inspect.
  7311. * @param {*} target The value to search for.
  7312. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  7313. */
  7314. function arrayIncludes(array, value) {
  7315. var length = array == null ? 0 : array.length;
  7316. return !!length && baseIndexOf(array, value, 0) > -1;
  7317. }
  7318. /**
  7319. * This function is like `arrayIncludes` except that it accepts a comparator.
  7320. *
  7321. * @private
  7322. * @param {Array} [array] The array to inspect.
  7323. * @param {*} target The value to search for.
  7324. * @param {Function} comparator The comparator invoked per element.
  7325. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  7326. */
  7327. function arrayIncludesWith(array, value, comparator) {
  7328. var index = -1,
  7329. length = array == null ? 0 : array.length;
  7330. while (++index < length) {
  7331. if (comparator(value, array[index])) {
  7332. return true;
  7333. }
  7334. }
  7335. return false;
  7336. }
  7337. /**
  7338. * A specialized version of `_.map` for arrays without support for iteratee
  7339. * shorthands.
  7340. *
  7341. * @private
  7342. * @param {Array} [array] The array to iterate over.
  7343. * @param {Function} iteratee The function invoked per iteration.
  7344. * @returns {Array} Returns the new mapped array.
  7345. */
  7346. function arrayMap(array, iteratee) {
  7347. var index = -1,
  7348. length = array == null ? 0 : array.length,
  7349. result = Array(length);
  7350. while (++index < length) {
  7351. result[index] = iteratee(array[index], index, array);
  7352. }
  7353. return result;
  7354. }
  7355. /**
  7356. * Appends the elements of `values` to `array`.
  7357. *
  7358. * @private
  7359. * @param {Array} array The array to modify.
  7360. * @param {Array} values The values to append.
  7361. * @returns {Array} Returns `array`.
  7362. */
  7363. function arrayPush(array, values) {
  7364. var index = -1,
  7365. length = values.length,
  7366. offset = array.length;
  7367. while (++index < length) {
  7368. array[offset + index] = values[index];
  7369. }
  7370. return array;
  7371. }
  7372. /**
  7373. * A specialized version of `_.reduce` for arrays without support for
  7374. * iteratee shorthands.
  7375. *
  7376. * @private
  7377. * @param {Array} [array] The array to iterate over.
  7378. * @param {Function} iteratee The function invoked per iteration.
  7379. * @param {*} [accumulator] The initial value.
  7380. * @param {boolean} [initAccum] Specify using the first element of `array` as
  7381. * the initial value.
  7382. * @returns {*} Returns the accumulated value.
  7383. */
  7384. function arrayReduce(array, iteratee, accumulator, initAccum) {
  7385. var index = -1,
  7386. length = array == null ? 0 : array.length;
  7387. if (initAccum && length) {
  7388. accumulator = array[++index];
  7389. }
  7390. while (++index < length) {
  7391. accumulator = iteratee(accumulator, array[index], index, array);
  7392. }
  7393. return accumulator;
  7394. }
  7395. /**
  7396. * A specialized version of `_.reduceRight` for arrays without support for
  7397. * iteratee shorthands.
  7398. *
  7399. * @private
  7400. * @param {Array} [array] The array to iterate over.
  7401. * @param {Function} iteratee The function invoked per iteration.
  7402. * @param {*} [accumulator] The initial value.
  7403. * @param {boolean} [initAccum] Specify using the last element of `array` as
  7404. * the initial value.
  7405. * @returns {*} Returns the accumulated value.
  7406. */
  7407. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  7408. var length = array == null ? 0 : array.length;
  7409. if (initAccum && length) {
  7410. accumulator = array[--length];
  7411. }
  7412. while (length--) {
  7413. accumulator = iteratee(accumulator, array[length], length, array);
  7414. }
  7415. return accumulator;
  7416. }
  7417. /**
  7418. * A specialized version of `_.some` for arrays without support for iteratee
  7419. * shorthands.
  7420. *
  7421. * @private
  7422. * @param {Array} [array] The array to iterate over.
  7423. * @param {Function} predicate The function invoked per iteration.
  7424. * @returns {boolean} Returns `true` if any element passes the predicate check,
  7425. * else `false`.
  7426. */
  7427. function arraySome(array, predicate) {
  7428. var index = -1,
  7429. length = array == null ? 0 : array.length;
  7430. while (++index < length) {
  7431. if (predicate(array[index], index, array)) {
  7432. return true;
  7433. }
  7434. }
  7435. return false;
  7436. }
  7437. /**
  7438. * Gets the size of an ASCII `string`.
  7439. *
  7440. * @private
  7441. * @param {string} string The string inspect.
  7442. * @returns {number} Returns the string size.
  7443. */
  7444. var asciiSize = baseProperty('length');
  7445. /**
  7446. * Converts an ASCII `string` to an array.
  7447. *
  7448. * @private
  7449. * @param {string} string The string to convert.
  7450. * @returns {Array} Returns the converted array.
  7451. */
  7452. function asciiToArray(string) {
  7453. return string.split('');
  7454. }
  7455. /**
  7456. * Splits an ASCII `string` into an array of its words.
  7457. *
  7458. * @private
  7459. * @param {string} The string to inspect.
  7460. * @returns {Array} Returns the words of `string`.
  7461. */
  7462. function asciiWords(string) {
  7463. return string.match(reAsciiWord) || [];
  7464. }
  7465. /**
  7466. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  7467. * without support for iteratee shorthands, which iterates over `collection`
  7468. * using `eachFunc`.
  7469. *
  7470. * @private
  7471. * @param {Array|Object} collection The collection to inspect.
  7472. * @param {Function} predicate The function invoked per iteration.
  7473. * @param {Function} eachFunc The function to iterate over `collection`.
  7474. * @returns {*} Returns the found element or its key, else `undefined`.
  7475. */
  7476. function baseFindKey(collection, predicate, eachFunc) {
  7477. var result;
  7478. eachFunc(collection, function(value, key, collection) {
  7479. if (predicate(value, key, collection)) {
  7480. result = key;
  7481. return false;
  7482. }
  7483. });
  7484. return result;
  7485. }
  7486. /**
  7487. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  7488. * support for iteratee shorthands.
  7489. *
  7490. * @private
  7491. * @param {Array} array The array to inspect.
  7492. * @param {Function} predicate The function invoked per iteration.
  7493. * @param {number} fromIndex The index to search from.
  7494. * @param {boolean} [fromRight] Specify iterating from right to left.
  7495. * @returns {number} Returns the index of the matched value, else `-1`.
  7496. */
  7497. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  7498. var length = array.length,
  7499. index = fromIndex + (fromRight ? 1 : -1);
  7500. while ((fromRight ? index-- : ++index < length)) {
  7501. if (predicate(array[index], index, array)) {
  7502. return index;
  7503. }
  7504. }
  7505. return -1;
  7506. }
  7507. /**
  7508. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  7509. *
  7510. * @private
  7511. * @param {Array} array The array to inspect.
  7512. * @param {*} value The value to search for.
  7513. * @param {number} fromIndex The index to search from.
  7514. * @returns {number} Returns the index of the matched value, else `-1`.
  7515. */
  7516. function baseIndexOf(array, value, fromIndex) {
  7517. return value === value
  7518. ? strictIndexOf(array, value, fromIndex)
  7519. : baseFindIndex(array, baseIsNaN, fromIndex);
  7520. }
  7521. /**
  7522. * This function is like `baseIndexOf` except that it accepts a comparator.
  7523. *
  7524. * @private
  7525. * @param {Array} array The array to inspect.
  7526. * @param {*} value The value to search for.
  7527. * @param {number} fromIndex The index to search from.
  7528. * @param {Function} comparator The comparator invoked per element.
  7529. * @returns {number} Returns the index of the matched value, else `-1`.
  7530. */
  7531. function baseIndexOfWith(array, value, fromIndex, comparator) {
  7532. var index = fromIndex - 1,
  7533. length = array.length;
  7534. while (++index < length) {
  7535. if (comparator(array[index], value)) {
  7536. return index;
  7537. }
  7538. }
  7539. return -1;
  7540. }
  7541. /**
  7542. * The base implementation of `_.isNaN` without support for number objects.
  7543. *
  7544. * @private
  7545. * @param {*} value The value to check.
  7546. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  7547. */
  7548. function baseIsNaN(value) {
  7549. return value !== value;
  7550. }
  7551. /**
  7552. * The base implementation of `_.mean` and `_.meanBy` without support for
  7553. * iteratee shorthands.
  7554. *
  7555. * @private
  7556. * @param {Array} array The array to iterate over.
  7557. * @param {Function} iteratee The function invoked per iteration.
  7558. * @returns {number} Returns the mean.
  7559. */
  7560. function baseMean(array, iteratee) {
  7561. var length = array == null ? 0 : array.length;
  7562. return length ? (baseSum(array, iteratee) / length) : NAN;
  7563. }
  7564. /**
  7565. * The base implementation of `_.property` without support for deep paths.
  7566. *
  7567. * @private
  7568. * @param {string} key The key of the property to get.
  7569. * @returns {Function} Returns the new accessor function.
  7570. */
  7571. function baseProperty(key) {
  7572. return function(object) {
  7573. return object == null ? undefined : object[key];
  7574. };
  7575. }
  7576. /**
  7577. * The base implementation of `_.propertyOf` without support for deep paths.
  7578. *
  7579. * @private
  7580. * @param {Object} object The object to query.
  7581. * @returns {Function} Returns the new accessor function.
  7582. */
  7583. function basePropertyOf(object) {
  7584. return function(key) {
  7585. return object == null ? undefined : object[key];
  7586. };
  7587. }
  7588. /**
  7589. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  7590. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  7591. *
  7592. * @private
  7593. * @param {Array|Object} collection The collection to iterate over.
  7594. * @param {Function} iteratee The function invoked per iteration.
  7595. * @param {*} accumulator The initial value.
  7596. * @param {boolean} initAccum Specify using the first or last element of
  7597. * `collection` as the initial value.
  7598. * @param {Function} eachFunc The function to iterate over `collection`.
  7599. * @returns {*} Returns the accumulated value.
  7600. */
  7601. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  7602. eachFunc(collection, function(value, index, collection) {
  7603. accumulator = initAccum
  7604. ? (initAccum = false, value)
  7605. : iteratee(accumulator, value, index, collection);
  7606. });
  7607. return accumulator;
  7608. }
  7609. /**
  7610. * The base implementation of `_.sortBy` which uses `comparer` to define the
  7611. * sort order of `array` and replaces criteria objects with their corresponding
  7612. * values.
  7613. *
  7614. * @private
  7615. * @param {Array} array The array to sort.
  7616. * @param {Function} comparer The function to define sort order.
  7617. * @returns {Array} Returns `array`.
  7618. */
  7619. function baseSortBy(array, comparer) {
  7620. var length = array.length;
  7621. array.sort(comparer);
  7622. while (length--) {
  7623. array[length] = array[length].value;
  7624. }
  7625. return array;
  7626. }
  7627. /**
  7628. * The base implementation of `_.sum` and `_.sumBy` without support for
  7629. * iteratee shorthands.
  7630. *
  7631. * @private
  7632. * @param {Array} array The array to iterate over.
  7633. * @param {Function} iteratee The function invoked per iteration.
  7634. * @returns {number} Returns the sum.
  7635. */
  7636. function baseSum(array, iteratee) {
  7637. var result,
  7638. index = -1,
  7639. length = array.length;
  7640. while (++index < length) {
  7641. var current = iteratee(array[index]);
  7642. if (current !== undefined) {
  7643. result = result === undefined ? current : (result + current);
  7644. }
  7645. }
  7646. return result;
  7647. }
  7648. /**
  7649. * The base implementation of `_.times` without support for iteratee shorthands
  7650. * or max array length checks.
  7651. *
  7652. * @private
  7653. * @param {number} n The number of times to invoke `iteratee`.
  7654. * @param {Function} iteratee The function invoked per iteration.
  7655. * @returns {Array} Returns the array of results.
  7656. */
  7657. function baseTimes(n, iteratee) {
  7658. var index = -1,
  7659. result = Array(n);
  7660. while (++index < n) {
  7661. result[index] = iteratee(index);
  7662. }
  7663. return result;
  7664. }
  7665. /**
  7666. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  7667. * of key-value pairs for `object` corresponding to the property names of `props`.
  7668. *
  7669. * @private
  7670. * @param {Object} object The object to query.
  7671. * @param {Array} props The property names to get values for.
  7672. * @returns {Object} Returns the key-value pairs.
  7673. */
  7674. function baseToPairs(object, props) {
  7675. return arrayMap(props, function(key) {
  7676. return [key, object[key]];
  7677. });
  7678. }
  7679. /**
  7680. * The base implementation of `_.unary` without support for storing metadata.
  7681. *
  7682. * @private
  7683. * @param {Function} func The function to cap arguments for.
  7684. * @returns {Function} Returns the new capped function.
  7685. */
  7686. function baseUnary(func) {
  7687. return function(value) {
  7688. return func(value);
  7689. };
  7690. }
  7691. /**
  7692. * The base implementation of `_.values` and `_.valuesIn` which creates an
  7693. * array of `object` property values corresponding to the property names
  7694. * of `props`.
  7695. *
  7696. * @private
  7697. * @param {Object} object The object to query.
  7698. * @param {Array} props The property names to get values for.
  7699. * @returns {Object} Returns the array of property values.
  7700. */
  7701. function baseValues(object, props) {
  7702. return arrayMap(props, function(key) {
  7703. return object[key];
  7704. });
  7705. }
  7706. /**
  7707. * Checks if a `cache` value for `key` exists.
  7708. *
  7709. * @private
  7710. * @param {Object} cache The cache to query.
  7711. * @param {string} key The key of the entry to check.
  7712. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  7713. */
  7714. function cacheHas(cache, key) {
  7715. return cache.has(key);
  7716. }
  7717. /**
  7718. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  7719. * that is not found in the character symbols.
  7720. *
  7721. * @private
  7722. * @param {Array} strSymbols The string symbols to inspect.
  7723. * @param {Array} chrSymbols The character symbols to find.
  7724. * @returns {number} Returns the index of the first unmatched string symbol.
  7725. */
  7726. function charsStartIndex(strSymbols, chrSymbols) {
  7727. var index = -1,
  7728. length = strSymbols.length;
  7729. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  7730. return index;
  7731. }
  7732. /**
  7733. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  7734. * that is not found in the character symbols.
  7735. *
  7736. * @private
  7737. * @param {Array} strSymbols The string symbols to inspect.
  7738. * @param {Array} chrSymbols The character symbols to find.
  7739. * @returns {number} Returns the index of the last unmatched string symbol.
  7740. */
  7741. function charsEndIndex(strSymbols, chrSymbols) {
  7742. var index = strSymbols.length;
  7743. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  7744. return index;
  7745. }
  7746. /**
  7747. * Gets the number of `placeholder` occurrences in `array`.
  7748. *
  7749. * @private
  7750. * @param {Array} array The array to inspect.
  7751. * @param {*} placeholder The placeholder to search for.
  7752. * @returns {number} Returns the placeholder count.
  7753. */
  7754. function countHolders(array, placeholder) {
  7755. var length = array.length,
  7756. result = 0;
  7757. while (length--) {
  7758. if (array[length] === placeholder) {
  7759. ++result;
  7760. }
  7761. }
  7762. return result;
  7763. }
  7764. /**
  7765. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  7766. * letters to basic Latin letters.
  7767. *
  7768. * @private
  7769. * @param {string} letter The matched letter to deburr.
  7770. * @returns {string} Returns the deburred letter.
  7771. */
  7772. var deburrLetter = basePropertyOf(deburredLetters);
  7773. /**
  7774. * Used by `_.escape` to convert characters to HTML entities.
  7775. *
  7776. * @private
  7777. * @param {string} chr The matched character to escape.
  7778. * @returns {string} Returns the escaped character.
  7779. */
  7780. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  7781. /**
  7782. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  7783. *
  7784. * @private
  7785. * @param {string} chr The matched character to escape.
  7786. * @returns {string} Returns the escaped character.
  7787. */
  7788. function escapeStringChar(chr) {
  7789. return '\\' + stringEscapes[chr];
  7790. }
  7791. /**
  7792. * Gets the value at `key` of `object`.
  7793. *
  7794. * @private
  7795. * @param {Object} [object] The object to query.
  7796. * @param {string} key The key of the property to get.
  7797. * @returns {*} Returns the property value.
  7798. */
  7799. function getValue(object, key) {
  7800. return object == null ? undefined : object[key];
  7801. }
  7802. /**
  7803. * Checks if `string` contains Unicode symbols.
  7804. *
  7805. * @private
  7806. * @param {string} string The string to inspect.
  7807. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  7808. */
  7809. function hasUnicode(string) {
  7810. return reHasUnicode.test(string);
  7811. }
  7812. /**
  7813. * Checks if `string` contains a word composed of Unicode symbols.
  7814. *
  7815. * @private
  7816. * @param {string} string The string to inspect.
  7817. * @returns {boolean} Returns `true` if a word is found, else `false`.
  7818. */
  7819. function hasUnicodeWord(string) {
  7820. return reHasUnicodeWord.test(string);
  7821. }
  7822. /**
  7823. * Converts `iterator` to an array.
  7824. *
  7825. * @private
  7826. * @param {Object} iterator The iterator to convert.
  7827. * @returns {Array} Returns the converted array.
  7828. */
  7829. function iteratorToArray(iterator) {
  7830. var data,
  7831. result = [];
  7832. while (!(data = iterator.next()).done) {
  7833. result.push(data.value);
  7834. }
  7835. return result;
  7836. }
  7837. /**
  7838. * Converts `map` to its key-value pairs.
  7839. *
  7840. * @private
  7841. * @param {Object} map The map to convert.
  7842. * @returns {Array} Returns the key-value pairs.
  7843. */
  7844. function mapToArray(map) {
  7845. var index = -1,
  7846. result = Array(map.size);
  7847. map.forEach(function(value, key) {
  7848. result[++index] = [key, value];
  7849. });
  7850. return result;
  7851. }
  7852. /**
  7853. * Creates a unary function that invokes `func` with its argument transformed.
  7854. *
  7855. * @private
  7856. * @param {Function} func The function to wrap.
  7857. * @param {Function} transform The argument transform.
  7858. * @returns {Function} Returns the new function.
  7859. */
  7860. function overArg(func, transform) {
  7861. return function(arg) {
  7862. return func(transform(arg));
  7863. };
  7864. }
  7865. /**
  7866. * Replaces all `placeholder` elements in `array` with an internal placeholder
  7867. * and returns an array of their indexes.
  7868. *
  7869. * @private
  7870. * @param {Array} array The array to modify.
  7871. * @param {*} placeholder The placeholder to replace.
  7872. * @returns {Array} Returns the new array of placeholder indexes.
  7873. */
  7874. function replaceHolders(array, placeholder) {
  7875. var index = -1,
  7876. length = array.length,
  7877. resIndex = 0,
  7878. result = [];
  7879. while (++index < length) {
  7880. var value = array[index];
  7881. if (value === placeholder || value === PLACEHOLDER) {
  7882. array[index] = PLACEHOLDER;
  7883. result[resIndex++] = index;
  7884. }
  7885. }
  7886. return result;
  7887. }
  7888. /**
  7889. * Gets the value at `key`, unless `key` is "__proto__".
  7890. *
  7891. * @private
  7892. * @param {Object} object The object to query.
  7893. * @param {string} key The key of the property to get.
  7894. * @returns {*} Returns the property value.
  7895. */
  7896. function safeGet(object, key) {
  7897. return key == '__proto__'
  7898. ? undefined
  7899. : object[key];
  7900. }
  7901. /**
  7902. * Converts `set` to an array of its values.
  7903. *
  7904. * @private
  7905. * @param {Object} set The set to convert.
  7906. * @returns {Array} Returns the values.
  7907. */
  7908. function setToArray(set) {
  7909. var index = -1,
  7910. result = Array(set.size);
  7911. set.forEach(function(value) {
  7912. result[++index] = value;
  7913. });
  7914. return result;
  7915. }
  7916. /**
  7917. * Converts `set` to its value-value pairs.
  7918. *
  7919. * @private
  7920. * @param {Object} set The set to convert.
  7921. * @returns {Array} Returns the value-value pairs.
  7922. */
  7923. function setToPairs(set) {
  7924. var index = -1,
  7925. result = Array(set.size);
  7926. set.forEach(function(value) {
  7927. result[++index] = [value, value];
  7928. });
  7929. return result;
  7930. }
  7931. /**
  7932. * A specialized version of `_.indexOf` which performs strict equality
  7933. * comparisons of values, i.e. `===`.
  7934. *
  7935. * @private
  7936. * @param {Array} array The array to inspect.
  7937. * @param {*} value The value to search for.
  7938. * @param {number} fromIndex The index to search from.
  7939. * @returns {number} Returns the index of the matched value, else `-1`.
  7940. */
  7941. function strictIndexOf(array, value, fromIndex) {
  7942. var index = fromIndex - 1,
  7943. length = array.length;
  7944. while (++index < length) {
  7945. if (array[index] === value) {
  7946. return index;
  7947. }
  7948. }
  7949. return -1;
  7950. }
  7951. /**
  7952. * A specialized version of `_.lastIndexOf` which performs strict equality
  7953. * comparisons of values, i.e. `===`.
  7954. *
  7955. * @private
  7956. * @param {Array} array The array to inspect.
  7957. * @param {*} value The value to search for.
  7958. * @param {number} fromIndex The index to search from.
  7959. * @returns {number} Returns the index of the matched value, else `-1`.
  7960. */
  7961. function strictLastIndexOf(array, value, fromIndex) {
  7962. var index = fromIndex + 1;
  7963. while (index--) {
  7964. if (array[index] === value) {
  7965. return index;
  7966. }
  7967. }
  7968. return index;
  7969. }
  7970. /**
  7971. * Gets the number of symbols in `string`.
  7972. *
  7973. * @private
  7974. * @param {string} string The string to inspect.
  7975. * @returns {number} Returns the string size.
  7976. */
  7977. function stringSize(string) {
  7978. return hasUnicode(string)
  7979. ? unicodeSize(string)
  7980. : asciiSize(string);
  7981. }
  7982. /**
  7983. * Converts `string` to an array.
  7984. *
  7985. * @private
  7986. * @param {string} string The string to convert.
  7987. * @returns {Array} Returns the converted array.
  7988. */
  7989. function stringToArray(string) {
  7990. return hasUnicode(string)
  7991. ? unicodeToArray(string)
  7992. : asciiToArray(string);
  7993. }
  7994. /**
  7995. * Used by `_.unescape` to convert HTML entities to characters.
  7996. *
  7997. * @private
  7998. * @param {string} chr The matched character to unescape.
  7999. * @returns {string} Returns the unescaped character.
  8000. */
  8001. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  8002. /**
  8003. * Gets the size of a Unicode `string`.
  8004. *
  8005. * @private
  8006. * @param {string} string The string inspect.
  8007. * @returns {number} Returns the string size.
  8008. */
  8009. function unicodeSize(string) {
  8010. var result = reUnicode.lastIndex = 0;
  8011. while (reUnicode.test(string)) {
  8012. ++result;
  8013. }
  8014. return result;
  8015. }
  8016. /**
  8017. * Converts a Unicode `string` to an array.
  8018. *
  8019. * @private
  8020. * @param {string} string The string to convert.
  8021. * @returns {Array} Returns the converted array.
  8022. */
  8023. function unicodeToArray(string) {
  8024. return string.match(reUnicode) || [];
  8025. }
  8026. /**
  8027. * Splits a Unicode `string` into an array of its words.
  8028. *
  8029. * @private
  8030. * @param {string} The string to inspect.
  8031. * @returns {Array} Returns the words of `string`.
  8032. */
  8033. function unicodeWords(string) {
  8034. return string.match(reUnicodeWord) || [];
  8035. }
  8036. /*--------------------------------------------------------------------------*/
  8037. /**
  8038. * Create a new pristine `lodash` function using the `context` object.
  8039. *
  8040. * @static
  8041. * @memberOf _
  8042. * @since 1.1.0
  8043. * @category Util
  8044. * @param {Object} [context=root] The context object.
  8045. * @returns {Function} Returns a new `lodash` function.
  8046. * @example
  8047. *
  8048. * _.mixin({ 'foo': _.constant('foo') });
  8049. *
  8050. * var lodash = _.runInContext();
  8051. * lodash.mixin({ 'bar': lodash.constant('bar') });
  8052. *
  8053. * _.isFunction(_.foo);
  8054. * // => true
  8055. * _.isFunction(_.bar);
  8056. * // => false
  8057. *
  8058. * lodash.isFunction(lodash.foo);
  8059. * // => false
  8060. * lodash.isFunction(lodash.bar);
  8061. * // => true
  8062. *
  8063. * // Create a suped-up `defer` in Node.js.
  8064. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  8065. */
  8066. var runInContext = (function runInContext(context) {
  8067. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  8068. /** Built-in constructor references. */
  8069. var Array = context.Array,
  8070. Date = context.Date,
  8071. Error = context.Error,
  8072. Function = context.Function,
  8073. Math = context.Math,
  8074. Object = context.Object,
  8075. RegExp = context.RegExp,
  8076. String = context.String,
  8077. TypeError = context.TypeError;
  8078. /** Used for built-in method references. */
  8079. var arrayProto = Array.prototype,
  8080. funcProto = Function.prototype,
  8081. objectProto = Object.prototype;
  8082. /** Used to detect overreaching core-js shims. */
  8083. var coreJsData = context['__core-js_shared__'];
  8084. /** Used to resolve the decompiled source of functions. */
  8085. var funcToString = funcProto.toString;
  8086. /** Used to check objects for own properties. */
  8087. var hasOwnProperty = objectProto.hasOwnProperty;
  8088. /** Used to generate unique IDs. */
  8089. var idCounter = 0;
  8090. /** Used to detect methods masquerading as native. */
  8091. var maskSrcKey = (function() {
  8092. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  8093. return uid ? ('Symbol(src)_1.' + uid) : '';
  8094. }());
  8095. /**
  8096. * Used to resolve the
  8097. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  8098. * of values.
  8099. */
  8100. var nativeObjectToString = objectProto.toString;
  8101. /** Used to infer the `Object` constructor. */
  8102. var objectCtorString = funcToString.call(Object);
  8103. /** Used to restore the original `_` reference in `_.noConflict`. */
  8104. var oldDash = root._;
  8105. /** Used to detect if a method is native. */
  8106. var reIsNative = RegExp('^' +
  8107. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  8108. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  8109. );
  8110. /** Built-in value references. */
  8111. var Buffer = moduleExports ? context.Buffer : undefined,
  8112. Symbol = context.Symbol,
  8113. Uint8Array = context.Uint8Array,
  8114. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  8115. getPrototype = overArg(Object.getPrototypeOf, Object),
  8116. objectCreate = Object.create,
  8117. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  8118. splice = arrayProto.splice,
  8119. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  8120. symIterator = Symbol ? Symbol.iterator : undefined,
  8121. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  8122. var defineProperty = (function() {
  8123. try {
  8124. var func = getNative(Object, 'defineProperty');
  8125. func({}, '', {});
  8126. return func;
  8127. } catch (e) {}
  8128. }());
  8129. /** Mocked built-ins. */
  8130. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  8131. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  8132. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  8133. /* Built-in method references for those with the same name as other `lodash` methods. */
  8134. var nativeCeil = Math.ceil,
  8135. nativeFloor = Math.floor,
  8136. nativeGetSymbols = Object.getOwnPropertySymbols,
  8137. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  8138. nativeIsFinite = context.isFinite,
  8139. nativeJoin = arrayProto.join,
  8140. nativeKeys = overArg(Object.keys, Object),
  8141. nativeMax = Math.max,
  8142. nativeMin = Math.min,
  8143. nativeNow = Date.now,
  8144. nativeParseInt = context.parseInt,
  8145. nativeRandom = Math.random,
  8146. nativeReverse = arrayProto.reverse;
  8147. /* Built-in method references that are verified to be native. */
  8148. var DataView = getNative(context, 'DataView'),
  8149. Map = getNative(context, 'Map'),
  8150. Promise = getNative(context, 'Promise'),
  8151. Set = getNative(context, 'Set'),
  8152. WeakMap = getNative(context, 'WeakMap'),
  8153. nativeCreate = getNative(Object, 'create');
  8154. /** Used to store function metadata. */
  8155. var metaMap = WeakMap && new WeakMap;
  8156. /** Used to lookup unminified function names. */
  8157. var realNames = {};
  8158. /** Used to detect maps, sets, and weakmaps. */
  8159. var dataViewCtorString = toSource(DataView),
  8160. mapCtorString = toSource(Map),
  8161. promiseCtorString = toSource(Promise),
  8162. setCtorString = toSource(Set),
  8163. weakMapCtorString = toSource(WeakMap);
  8164. /** Used to convert symbols to primitives and strings. */
  8165. var symbolProto = Symbol ? Symbol.prototype : undefined,
  8166. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  8167. symbolToString = symbolProto ? symbolProto.toString : undefined;
  8168. /*------------------------------------------------------------------------*/
  8169. /**
  8170. * Creates a `lodash` object which wraps `value` to enable implicit method
  8171. * chain sequences. Methods that operate on and return arrays, collections,
  8172. * and functions can be chained together. Methods that retrieve a single value
  8173. * or may return a primitive value will automatically end the chain sequence
  8174. * and return the unwrapped value. Otherwise, the value must be unwrapped
  8175. * with `_#value`.
  8176. *
  8177. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  8178. * enabled using `_.chain`.
  8179. *
  8180. * The execution of chained methods is lazy, that is, it's deferred until
  8181. * `_#value` is implicitly or explicitly called.
  8182. *
  8183. * Lazy evaluation allows several methods to support shortcut fusion.
  8184. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  8185. * the creation of intermediate arrays and can greatly reduce the number of
  8186. * iteratee executions. Sections of a chain sequence qualify for shortcut
  8187. * fusion if the section is applied to an array and iteratees accept only
  8188. * one argument. The heuristic for whether a section qualifies for shortcut
  8189. * fusion is subject to change.
  8190. *
  8191. * Chaining is supported in custom builds as long as the `_#value` method is
  8192. * directly or indirectly included in the build.
  8193. *
  8194. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  8195. *
  8196. * The wrapper `Array` methods are:
  8197. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  8198. *
  8199. * The wrapper `String` methods are:
  8200. * `replace` and `split`
  8201. *
  8202. * The wrapper methods that support shortcut fusion are:
  8203. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  8204. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  8205. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  8206. *
  8207. * The chainable wrapper methods are:
  8208. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  8209. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  8210. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  8211. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  8212. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  8213. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  8214. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  8215. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  8216. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  8217. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  8218. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  8219. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  8220. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  8221. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  8222. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  8223. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  8224. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  8225. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  8226. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  8227. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  8228. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  8229. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  8230. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  8231. * `zipObject`, `zipObjectDeep`, and `zipWith`
  8232. *
  8233. * The wrapper methods that are **not** chainable by default are:
  8234. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  8235. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  8236. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  8237. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  8238. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  8239. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  8240. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  8241. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  8242. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  8243. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  8244. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  8245. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  8246. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  8247. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  8248. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  8249. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  8250. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  8251. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  8252. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  8253. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  8254. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  8255. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  8256. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  8257. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  8258. * `upperFirst`, `value`, and `words`
  8259. *
  8260. * @name _
  8261. * @constructor
  8262. * @category Seq
  8263. * @param {*} value The value to wrap in a `lodash` instance.
  8264. * @returns {Object} Returns the new `lodash` wrapper instance.
  8265. * @example
  8266. *
  8267. * function square(n) {
  8268. * return n * n;
  8269. * }
  8270. *
  8271. * var wrapped = _([1, 2, 3]);
  8272. *
  8273. * // Returns an unwrapped value.
  8274. * wrapped.reduce(_.add);
  8275. * // => 6
  8276. *
  8277. * // Returns a wrapped value.
  8278. * var squares = wrapped.map(square);
  8279. *
  8280. * _.isArray(squares);
  8281. * // => false
  8282. *
  8283. * _.isArray(squares.value());
  8284. * // => true
  8285. */
  8286. function lodash(value) {
  8287. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  8288. if (value instanceof LodashWrapper) {
  8289. return value;
  8290. }
  8291. if (hasOwnProperty.call(value, '__wrapped__')) {
  8292. return wrapperClone(value);
  8293. }
  8294. }
  8295. return new LodashWrapper(value);
  8296. }
  8297. /**
  8298. * The base implementation of `_.create` without support for assigning
  8299. * properties to the created object.
  8300. *
  8301. * @private
  8302. * @param {Object} proto The object to inherit from.
  8303. * @returns {Object} Returns the new object.
  8304. */
  8305. var baseCreate = (function() {
  8306. function object() {}
  8307. return function(proto) {
  8308. if (!isObject(proto)) {
  8309. return {};
  8310. }
  8311. if (objectCreate) {
  8312. return objectCreate(proto);
  8313. }
  8314. object.prototype = proto;
  8315. var result = new object;
  8316. object.prototype = undefined;
  8317. return result;
  8318. };
  8319. }());
  8320. /**
  8321. * The function whose prototype chain sequence wrappers inherit from.
  8322. *
  8323. * @private
  8324. */
  8325. function baseLodash() {
  8326. // No operation performed.
  8327. }
  8328. /**
  8329. * The base constructor for creating `lodash` wrapper objects.
  8330. *
  8331. * @private
  8332. * @param {*} value The value to wrap.
  8333. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  8334. */
  8335. function LodashWrapper(value, chainAll) {
  8336. this.__wrapped__ = value;
  8337. this.__actions__ = [];
  8338. this.__chain__ = !!chainAll;
  8339. this.__index__ = 0;
  8340. this.__values__ = undefined;
  8341. }
  8342. /**
  8343. * By default, the template delimiters used by lodash are like those in
  8344. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  8345. * following template settings to use alternative delimiters.
  8346. *
  8347. * @static
  8348. * @memberOf _
  8349. * @type {Object}
  8350. */
  8351. lodash.templateSettings = {
  8352. /**
  8353. * Used to detect `data` property values to be HTML-escaped.
  8354. *
  8355. * @memberOf _.templateSettings
  8356. * @type {RegExp}
  8357. */
  8358. 'escape': reEscape,
  8359. /**
  8360. * Used to detect code to be evaluated.
  8361. *
  8362. * @memberOf _.templateSettings
  8363. * @type {RegExp}
  8364. */
  8365. 'evaluate': reEvaluate,
  8366. /**
  8367. * Used to detect `data` property values to inject.
  8368. *
  8369. * @memberOf _.templateSettings
  8370. * @type {RegExp}
  8371. */
  8372. 'interpolate': reInterpolate,
  8373. /**
  8374. * Used to reference the data object in the template text.
  8375. *
  8376. * @memberOf _.templateSettings
  8377. * @type {string}
  8378. */
  8379. 'variable': '',
  8380. /**
  8381. * Used to import variables into the compiled template.
  8382. *
  8383. * @memberOf _.templateSettings
  8384. * @type {Object}
  8385. */
  8386. 'imports': {
  8387. /**
  8388. * A reference to the `lodash` function.
  8389. *
  8390. * @memberOf _.templateSettings.imports
  8391. * @type {Function}
  8392. */
  8393. '_': lodash
  8394. }
  8395. };
  8396. // Ensure wrappers are instances of `baseLodash`.
  8397. lodash.prototype = baseLodash.prototype;
  8398. lodash.prototype.constructor = lodash;
  8399. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  8400. LodashWrapper.prototype.constructor = LodashWrapper;
  8401. /*------------------------------------------------------------------------*/
  8402. /**
  8403. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  8404. *
  8405. * @private
  8406. * @constructor
  8407. * @param {*} value The value to wrap.
  8408. */
  8409. function LazyWrapper(value) {
  8410. this.__wrapped__ = value;
  8411. this.__actions__ = [];
  8412. this.__dir__ = 1;
  8413. this.__filtered__ = false;
  8414. this.__iteratees__ = [];
  8415. this.__takeCount__ = MAX_ARRAY_LENGTH;
  8416. this.__views__ = [];
  8417. }
  8418. /**
  8419. * Creates a clone of the lazy wrapper object.
  8420. *
  8421. * @private
  8422. * @name clone
  8423. * @memberOf LazyWrapper
  8424. * @returns {Object} Returns the cloned `LazyWrapper` object.
  8425. */
  8426. function lazyClone() {
  8427. var result = new LazyWrapper(this.__wrapped__);
  8428. result.__actions__ = copyArray(this.__actions__);
  8429. result.__dir__ = this.__dir__;
  8430. result.__filtered__ = this.__filtered__;
  8431. result.__iteratees__ = copyArray(this.__iteratees__);
  8432. result.__takeCount__ = this.__takeCount__;
  8433. result.__views__ = copyArray(this.__views__);
  8434. return result;
  8435. }
  8436. /**
  8437. * Reverses the direction of lazy iteration.
  8438. *
  8439. * @private
  8440. * @name reverse
  8441. * @memberOf LazyWrapper
  8442. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  8443. */
  8444. function lazyReverse() {
  8445. if (this.__filtered__) {
  8446. var result = new LazyWrapper(this);
  8447. result.__dir__ = -1;
  8448. result.__filtered__ = true;
  8449. } else {
  8450. result = this.clone();
  8451. result.__dir__ *= -1;
  8452. }
  8453. return result;
  8454. }
  8455. /**
  8456. * Extracts the unwrapped value from its lazy wrapper.
  8457. *
  8458. * @private
  8459. * @name value
  8460. * @memberOf LazyWrapper
  8461. * @returns {*} Returns the unwrapped value.
  8462. */
  8463. function lazyValue() {
  8464. var array = this.__wrapped__.value(),
  8465. dir = this.__dir__,
  8466. isArr = isArray(array),
  8467. isRight = dir < 0,
  8468. arrLength = isArr ? array.length : 0,
  8469. view = getView(0, arrLength, this.__views__),
  8470. start = view.start,
  8471. end = view.end,
  8472. length = end - start,
  8473. index = isRight ? end : (start - 1),
  8474. iteratees = this.__iteratees__,
  8475. iterLength = iteratees.length,
  8476. resIndex = 0,
  8477. takeCount = nativeMin(length, this.__takeCount__);
  8478. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  8479. return baseWrapperValue(array, this.__actions__);
  8480. }
  8481. var result = [];
  8482. outer:
  8483. while (length-- && resIndex < takeCount) {
  8484. index += dir;
  8485. var iterIndex = -1,
  8486. value = array[index];
  8487. while (++iterIndex < iterLength) {
  8488. var data = iteratees[iterIndex],
  8489. iteratee = data.iteratee,
  8490. type = data.type,
  8491. computed = iteratee(value);
  8492. if (type == LAZY_MAP_FLAG) {
  8493. value = computed;
  8494. } else if (!computed) {
  8495. if (type == LAZY_FILTER_FLAG) {
  8496. continue outer;
  8497. } else {
  8498. break outer;
  8499. }
  8500. }
  8501. }
  8502. result[resIndex++] = value;
  8503. }
  8504. return result;
  8505. }
  8506. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  8507. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  8508. LazyWrapper.prototype.constructor = LazyWrapper;
  8509. /*------------------------------------------------------------------------*/
  8510. /**
  8511. * Creates a hash object.
  8512. *
  8513. * @private
  8514. * @constructor
  8515. * @param {Array} [entries] The key-value pairs to cache.
  8516. */
  8517. function Hash(entries) {
  8518. var index = -1,
  8519. length = entries == null ? 0 : entries.length;
  8520. this.clear();
  8521. while (++index < length) {
  8522. var entry = entries[index];
  8523. this.set(entry[0], entry[1]);
  8524. }
  8525. }
  8526. /**
  8527. * Removes all key-value entries from the hash.
  8528. *
  8529. * @private
  8530. * @name clear
  8531. * @memberOf Hash
  8532. */
  8533. function hashClear() {
  8534. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  8535. this.size = 0;
  8536. }
  8537. /**
  8538. * Removes `key` and its value from the hash.
  8539. *
  8540. * @private
  8541. * @name delete
  8542. * @memberOf Hash
  8543. * @param {Object} hash The hash to modify.
  8544. * @param {string} key The key of the value to remove.
  8545. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8546. */
  8547. function hashDelete(key) {
  8548. var result = this.has(key) && delete this.__data__[key];
  8549. this.size -= result ? 1 : 0;
  8550. return result;
  8551. }
  8552. /**
  8553. * Gets the hash value for `key`.
  8554. *
  8555. * @private
  8556. * @name get
  8557. * @memberOf Hash
  8558. * @param {string} key The key of the value to get.
  8559. * @returns {*} Returns the entry value.
  8560. */
  8561. function hashGet(key) {
  8562. var data = this.__data__;
  8563. if (nativeCreate) {
  8564. var result = data[key];
  8565. return result === HASH_UNDEFINED ? undefined : result;
  8566. }
  8567. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  8568. }
  8569. /**
  8570. * Checks if a hash value for `key` exists.
  8571. *
  8572. * @private
  8573. * @name has
  8574. * @memberOf Hash
  8575. * @param {string} key The key of the entry to check.
  8576. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8577. */
  8578. function hashHas(key) {
  8579. var data = this.__data__;
  8580. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  8581. }
  8582. /**
  8583. * Sets the hash `key` to `value`.
  8584. *
  8585. * @private
  8586. * @name set
  8587. * @memberOf Hash
  8588. * @param {string} key The key of the value to set.
  8589. * @param {*} value The value to set.
  8590. * @returns {Object} Returns the hash instance.
  8591. */
  8592. function hashSet(key, value) {
  8593. var data = this.__data__;
  8594. this.size += this.has(key) ? 0 : 1;
  8595. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  8596. return this;
  8597. }
  8598. // Add methods to `Hash`.
  8599. Hash.prototype.clear = hashClear;
  8600. Hash.prototype['delete'] = hashDelete;
  8601. Hash.prototype.get = hashGet;
  8602. Hash.prototype.has = hashHas;
  8603. Hash.prototype.set = hashSet;
  8604. /*------------------------------------------------------------------------*/
  8605. /**
  8606. * Creates an list cache object.
  8607. *
  8608. * @private
  8609. * @constructor
  8610. * @param {Array} [entries] The key-value pairs to cache.
  8611. */
  8612. function ListCache(entries) {
  8613. var index = -1,
  8614. length = entries == null ? 0 : entries.length;
  8615. this.clear();
  8616. while (++index < length) {
  8617. var entry = entries[index];
  8618. this.set(entry[0], entry[1]);
  8619. }
  8620. }
  8621. /**
  8622. * Removes all key-value entries from the list cache.
  8623. *
  8624. * @private
  8625. * @name clear
  8626. * @memberOf ListCache
  8627. */
  8628. function listCacheClear() {
  8629. this.__data__ = [];
  8630. this.size = 0;
  8631. }
  8632. /**
  8633. * Removes `key` and its value from the list cache.
  8634. *
  8635. * @private
  8636. * @name delete
  8637. * @memberOf ListCache
  8638. * @param {string} key The key of the value to remove.
  8639. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8640. */
  8641. function listCacheDelete(key) {
  8642. var data = this.__data__,
  8643. index = assocIndexOf(data, key);
  8644. if (index < 0) {
  8645. return false;
  8646. }
  8647. var lastIndex = data.length - 1;
  8648. if (index == lastIndex) {
  8649. data.pop();
  8650. } else {
  8651. splice.call(data, index, 1);
  8652. }
  8653. --this.size;
  8654. return true;
  8655. }
  8656. /**
  8657. * Gets the list cache value for `key`.
  8658. *
  8659. * @private
  8660. * @name get
  8661. * @memberOf ListCache
  8662. * @param {string} key The key of the value to get.
  8663. * @returns {*} Returns the entry value.
  8664. */
  8665. function listCacheGet(key) {
  8666. var data = this.__data__,
  8667. index = assocIndexOf(data, key);
  8668. return index < 0 ? undefined : data[index][1];
  8669. }
  8670. /**
  8671. * Checks if a list cache value for `key` exists.
  8672. *
  8673. * @private
  8674. * @name has
  8675. * @memberOf ListCache
  8676. * @param {string} key The key of the entry to check.
  8677. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8678. */
  8679. function listCacheHas(key) {
  8680. return assocIndexOf(this.__data__, key) > -1;
  8681. }
  8682. /**
  8683. * Sets the list cache `key` to `value`.
  8684. *
  8685. * @private
  8686. * @name set
  8687. * @memberOf ListCache
  8688. * @param {string} key The key of the value to set.
  8689. * @param {*} value The value to set.
  8690. * @returns {Object} Returns the list cache instance.
  8691. */
  8692. function listCacheSet(key, value) {
  8693. var data = this.__data__,
  8694. index = assocIndexOf(data, key);
  8695. if (index < 0) {
  8696. ++this.size;
  8697. data.push([key, value]);
  8698. } else {
  8699. data[index][1] = value;
  8700. }
  8701. return this;
  8702. }
  8703. // Add methods to `ListCache`.
  8704. ListCache.prototype.clear = listCacheClear;
  8705. ListCache.prototype['delete'] = listCacheDelete;
  8706. ListCache.prototype.get = listCacheGet;
  8707. ListCache.prototype.has = listCacheHas;
  8708. ListCache.prototype.set = listCacheSet;
  8709. /*------------------------------------------------------------------------*/
  8710. /**
  8711. * Creates a map cache object to store key-value pairs.
  8712. *
  8713. * @private
  8714. * @constructor
  8715. * @param {Array} [entries] The key-value pairs to cache.
  8716. */
  8717. function MapCache(entries) {
  8718. var index = -1,
  8719. length = entries == null ? 0 : entries.length;
  8720. this.clear();
  8721. while (++index < length) {
  8722. var entry = entries[index];
  8723. this.set(entry[0], entry[1]);
  8724. }
  8725. }
  8726. /**
  8727. * Removes all key-value entries from the map.
  8728. *
  8729. * @private
  8730. * @name clear
  8731. * @memberOf MapCache
  8732. */
  8733. function mapCacheClear() {
  8734. this.size = 0;
  8735. this.__data__ = {
  8736. 'hash': new Hash,
  8737. 'map': new (Map || ListCache),
  8738. 'string': new Hash
  8739. };
  8740. }
  8741. /**
  8742. * Removes `key` and its value from the map.
  8743. *
  8744. * @private
  8745. * @name delete
  8746. * @memberOf MapCache
  8747. * @param {string} key The key of the value to remove.
  8748. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8749. */
  8750. function mapCacheDelete(key) {
  8751. var result = getMapData(this, key)['delete'](key);
  8752. this.size -= result ? 1 : 0;
  8753. return result;
  8754. }
  8755. /**
  8756. * Gets the map value for `key`.
  8757. *
  8758. * @private
  8759. * @name get
  8760. * @memberOf MapCache
  8761. * @param {string} key The key of the value to get.
  8762. * @returns {*} Returns the entry value.
  8763. */
  8764. function mapCacheGet(key) {
  8765. return getMapData(this, key).get(key);
  8766. }
  8767. /**
  8768. * Checks if a map value for `key` exists.
  8769. *
  8770. * @private
  8771. * @name has
  8772. * @memberOf MapCache
  8773. * @param {string} key The key of the entry to check.
  8774. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8775. */
  8776. function mapCacheHas(key) {
  8777. return getMapData(this, key).has(key);
  8778. }
  8779. /**
  8780. * Sets the map `key` to `value`.
  8781. *
  8782. * @private
  8783. * @name set
  8784. * @memberOf MapCache
  8785. * @param {string} key The key of the value to set.
  8786. * @param {*} value The value to set.
  8787. * @returns {Object} Returns the map cache instance.
  8788. */
  8789. function mapCacheSet(key, value) {
  8790. var data = getMapData(this, key),
  8791. size = data.size;
  8792. data.set(key, value);
  8793. this.size += data.size == size ? 0 : 1;
  8794. return this;
  8795. }
  8796. // Add methods to `MapCache`.
  8797. MapCache.prototype.clear = mapCacheClear;
  8798. MapCache.prototype['delete'] = mapCacheDelete;
  8799. MapCache.prototype.get = mapCacheGet;
  8800. MapCache.prototype.has = mapCacheHas;
  8801. MapCache.prototype.set = mapCacheSet;
  8802. /*------------------------------------------------------------------------*/
  8803. /**
  8804. *
  8805. * Creates an array cache object to store unique values.
  8806. *
  8807. * @private
  8808. * @constructor
  8809. * @param {Array} [values] The values to cache.
  8810. */
  8811. function SetCache(values) {
  8812. var index = -1,
  8813. length = values == null ? 0 : values.length;
  8814. this.__data__ = new MapCache;
  8815. while (++index < length) {
  8816. this.add(values[index]);
  8817. }
  8818. }
  8819. /**
  8820. * Adds `value` to the array cache.
  8821. *
  8822. * @private
  8823. * @name add
  8824. * @memberOf SetCache
  8825. * @alias push
  8826. * @param {*} value The value to cache.
  8827. * @returns {Object} Returns the cache instance.
  8828. */
  8829. function setCacheAdd(value) {
  8830. this.__data__.set(value, HASH_UNDEFINED);
  8831. return this;
  8832. }
  8833. /**
  8834. * Checks if `value` is in the array cache.
  8835. *
  8836. * @private
  8837. * @name has
  8838. * @memberOf SetCache
  8839. * @param {*} value The value to search for.
  8840. * @returns {number} Returns `true` if `value` is found, else `false`.
  8841. */
  8842. function setCacheHas(value) {
  8843. return this.__data__.has(value);
  8844. }
  8845. // Add methods to `SetCache`.
  8846. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  8847. SetCache.prototype.has = setCacheHas;
  8848. /*------------------------------------------------------------------------*/
  8849. /**
  8850. * Creates a stack cache object to store key-value pairs.
  8851. *
  8852. * @private
  8853. * @constructor
  8854. * @param {Array} [entries] The key-value pairs to cache.
  8855. */
  8856. function Stack(entries) {
  8857. var data = this.__data__ = new ListCache(entries);
  8858. this.size = data.size;
  8859. }
  8860. /**
  8861. * Removes all key-value entries from the stack.
  8862. *
  8863. * @private
  8864. * @name clear
  8865. * @memberOf Stack
  8866. */
  8867. function stackClear() {
  8868. this.__data__ = new ListCache;
  8869. this.size = 0;
  8870. }
  8871. /**
  8872. * Removes `key` and its value from the stack.
  8873. *
  8874. * @private
  8875. * @name delete
  8876. * @memberOf Stack
  8877. * @param {string} key The key of the value to remove.
  8878. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8879. */
  8880. function stackDelete(key) {
  8881. var data = this.__data__,
  8882. result = data['delete'](key);
  8883. this.size = data.size;
  8884. return result;
  8885. }
  8886. /**
  8887. * Gets the stack value for `key`.
  8888. *
  8889. * @private
  8890. * @name get
  8891. * @memberOf Stack
  8892. * @param {string} key The key of the value to get.
  8893. * @returns {*} Returns the entry value.
  8894. */
  8895. function stackGet(key) {
  8896. return this.__data__.get(key);
  8897. }
  8898. /**
  8899. * Checks if a stack value for `key` exists.
  8900. *
  8901. * @private
  8902. * @name has
  8903. * @memberOf Stack
  8904. * @param {string} key The key of the entry to check.
  8905. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8906. */
  8907. function stackHas(key) {
  8908. return this.__data__.has(key);
  8909. }
  8910. /**
  8911. * Sets the stack `key` to `value`.
  8912. *
  8913. * @private
  8914. * @name set
  8915. * @memberOf Stack
  8916. * @param {string} key The key of the value to set.
  8917. * @param {*} value The value to set.
  8918. * @returns {Object} Returns the stack cache instance.
  8919. */
  8920. function stackSet(key, value) {
  8921. var data = this.__data__;
  8922. if (data instanceof ListCache) {
  8923. var pairs = data.__data__;
  8924. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  8925. pairs.push([key, value]);
  8926. this.size = ++data.size;
  8927. return this;
  8928. }
  8929. data = this.__data__ = new MapCache(pairs);
  8930. }
  8931. data.set(key, value);
  8932. this.size = data.size;
  8933. return this;
  8934. }
  8935. // Add methods to `Stack`.
  8936. Stack.prototype.clear = stackClear;
  8937. Stack.prototype['delete'] = stackDelete;
  8938. Stack.prototype.get = stackGet;
  8939. Stack.prototype.has = stackHas;
  8940. Stack.prototype.set = stackSet;
  8941. /*------------------------------------------------------------------------*/
  8942. /**
  8943. * Creates an array of the enumerable property names of the array-like `value`.
  8944. *
  8945. * @private
  8946. * @param {*} value The value to query.
  8947. * @param {boolean} inherited Specify returning inherited property names.
  8948. * @returns {Array} Returns the array of property names.
  8949. */
  8950. function arrayLikeKeys(value, inherited) {
  8951. var isArr = isArray(value),
  8952. isArg = !isArr && isArguments(value),
  8953. isBuff = !isArr && !isArg && isBuffer(value),
  8954. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  8955. skipIndexes = isArr || isArg || isBuff || isType,
  8956. result = skipIndexes ? baseTimes(value.length, String) : [],
  8957. length = result.length;
  8958. for (var key in value) {
  8959. if ((inherited || hasOwnProperty.call(value, key)) &&
  8960. !(skipIndexes && (
  8961. // Safari 9 has enumerable `arguments.length` in strict mode.
  8962. key == 'length' ||
  8963. // Node.js 0.10 has enumerable non-index properties on buffers.
  8964. (isBuff && (key == 'offset' || key == 'parent')) ||
  8965. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  8966. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  8967. // Skip index properties.
  8968. isIndex(key, length)
  8969. ))) {
  8970. result.push(key);
  8971. }
  8972. }
  8973. return result;
  8974. }
  8975. /**
  8976. * A specialized version of `_.sample` for arrays.
  8977. *
  8978. * @private
  8979. * @param {Array} array The array to sample.
  8980. * @returns {*} Returns the random element.
  8981. */
  8982. function arraySample(array) {
  8983. var length = array.length;
  8984. return length ? array[baseRandom(0, length - 1)] : undefined;
  8985. }
  8986. /**
  8987. * A specialized version of `_.sampleSize` for arrays.
  8988. *
  8989. * @private
  8990. * @param {Array} array The array to sample.
  8991. * @param {number} n The number of elements to sample.
  8992. * @returns {Array} Returns the random elements.
  8993. */
  8994. function arraySampleSize(array, n) {
  8995. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  8996. }
  8997. /**
  8998. * A specialized version of `_.shuffle` for arrays.
  8999. *
  9000. * @private
  9001. * @param {Array} array The array to shuffle.
  9002. * @returns {Array} Returns the new shuffled array.
  9003. */
  9004. function arrayShuffle(array) {
  9005. return shuffleSelf(copyArray(array));
  9006. }
  9007. /**
  9008. * This function is like `assignValue` except that it doesn't assign
  9009. * `undefined` values.
  9010. *
  9011. * @private
  9012. * @param {Object} object The object to modify.
  9013. * @param {string} key The key of the property to assign.
  9014. * @param {*} value The value to assign.
  9015. */
  9016. function assignMergeValue(object, key, value) {
  9017. if ((value !== undefined && !eq(object[key], value)) ||
  9018. (value === undefined && !(key in object))) {
  9019. baseAssignValue(object, key, value);
  9020. }
  9021. }
  9022. /**
  9023. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  9024. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9025. * for equality comparisons.
  9026. *
  9027. * @private
  9028. * @param {Object} object The object to modify.
  9029. * @param {string} key The key of the property to assign.
  9030. * @param {*} value The value to assign.
  9031. */
  9032. function assignValue(object, key, value) {
  9033. var objValue = object[key];
  9034. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  9035. (value === undefined && !(key in object))) {
  9036. baseAssignValue(object, key, value);
  9037. }
  9038. }
  9039. /**
  9040. * Gets the index at which the `key` is found in `array` of key-value pairs.
  9041. *
  9042. * @private
  9043. * @param {Array} array The array to inspect.
  9044. * @param {*} key The key to search for.
  9045. * @returns {number} Returns the index of the matched value, else `-1`.
  9046. */
  9047. function assocIndexOf(array, key) {
  9048. var length = array.length;
  9049. while (length--) {
  9050. if (eq(array[length][0], key)) {
  9051. return length;
  9052. }
  9053. }
  9054. return -1;
  9055. }
  9056. /**
  9057. * Aggregates elements of `collection` on `accumulator` with keys transformed
  9058. * by `iteratee` and values set by `setter`.
  9059. *
  9060. * @private
  9061. * @param {Array|Object} collection The collection to iterate over.
  9062. * @param {Function} setter The function to set `accumulator` values.
  9063. * @param {Function} iteratee The iteratee to transform keys.
  9064. * @param {Object} accumulator The initial aggregated object.
  9065. * @returns {Function} Returns `accumulator`.
  9066. */
  9067. function baseAggregator(collection, setter, iteratee, accumulator) {
  9068. baseEach(collection, function(value, key, collection) {
  9069. setter(accumulator, value, iteratee(value), collection);
  9070. });
  9071. return accumulator;
  9072. }
  9073. /**
  9074. * The base implementation of `_.assign` without support for multiple sources
  9075. * or `customizer` functions.
  9076. *
  9077. * @private
  9078. * @param {Object} object The destination object.
  9079. * @param {Object} source The source object.
  9080. * @returns {Object} Returns `object`.
  9081. */
  9082. function baseAssign(object, source) {
  9083. return object && copyObject(source, keys(source), object);
  9084. }
  9085. /**
  9086. * The base implementation of `_.assignIn` without support for multiple sources
  9087. * or `customizer` functions.
  9088. *
  9089. * @private
  9090. * @param {Object} object The destination object.
  9091. * @param {Object} source The source object.
  9092. * @returns {Object} Returns `object`.
  9093. */
  9094. function baseAssignIn(object, source) {
  9095. return object && copyObject(source, keysIn(source), object);
  9096. }
  9097. /**
  9098. * The base implementation of `assignValue` and `assignMergeValue` without
  9099. * value checks.
  9100. *
  9101. * @private
  9102. * @param {Object} object The object to modify.
  9103. * @param {string} key The key of the property to assign.
  9104. * @param {*} value The value to assign.
  9105. */
  9106. function baseAssignValue(object, key, value) {
  9107. if (key == '__proto__' && defineProperty) {
  9108. defineProperty(object, key, {
  9109. 'configurable': true,
  9110. 'enumerable': true,
  9111. 'value': value,
  9112. 'writable': true
  9113. });
  9114. } else {
  9115. object[key] = value;
  9116. }
  9117. }
  9118. /**
  9119. * The base implementation of `_.at` without support for individual paths.
  9120. *
  9121. * @private
  9122. * @param {Object} object The object to iterate over.
  9123. * @param {string[]} paths The property paths to pick.
  9124. * @returns {Array} Returns the picked elements.
  9125. */
  9126. function baseAt(object, paths) {
  9127. var index = -1,
  9128. length = paths.length,
  9129. result = Array(length),
  9130. skip = object == null;
  9131. while (++index < length) {
  9132. result[index] = skip ? undefined : get(object, paths[index]);
  9133. }
  9134. return result;
  9135. }
  9136. /**
  9137. * The base implementation of `_.clamp` which doesn't coerce arguments.
  9138. *
  9139. * @private
  9140. * @param {number} number The number to clamp.
  9141. * @param {number} [lower] The lower bound.
  9142. * @param {number} upper The upper bound.
  9143. * @returns {number} Returns the clamped number.
  9144. */
  9145. function baseClamp(number, lower, upper) {
  9146. if (number === number) {
  9147. if (upper !== undefined) {
  9148. number = number <= upper ? number : upper;
  9149. }
  9150. if (lower !== undefined) {
  9151. number = number >= lower ? number : lower;
  9152. }
  9153. }
  9154. return number;
  9155. }
  9156. /**
  9157. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  9158. * traversed objects.
  9159. *
  9160. * @private
  9161. * @param {*} value The value to clone.
  9162. * @param {boolean} bitmask The bitmask flags.
  9163. * 1 - Deep clone
  9164. * 2 - Flatten inherited properties
  9165. * 4 - Clone symbols
  9166. * @param {Function} [customizer] The function to customize cloning.
  9167. * @param {string} [key] The key of `value`.
  9168. * @param {Object} [object] The parent object of `value`.
  9169. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  9170. * @returns {*} Returns the cloned value.
  9171. */
  9172. function baseClone(value, bitmask, customizer, key, object, stack) {
  9173. var result,
  9174. isDeep = bitmask & CLONE_DEEP_FLAG,
  9175. isFlat = bitmask & CLONE_FLAT_FLAG,
  9176. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  9177. if (customizer) {
  9178. result = object ? customizer(value, key, object, stack) : customizer(value);
  9179. }
  9180. if (result !== undefined) {
  9181. return result;
  9182. }
  9183. if (!isObject(value)) {
  9184. return value;
  9185. }
  9186. var isArr = isArray(value);
  9187. if (isArr) {
  9188. result = initCloneArray(value);
  9189. if (!isDeep) {
  9190. return copyArray(value, result);
  9191. }
  9192. } else {
  9193. var tag = getTag(value),
  9194. isFunc = tag == funcTag || tag == genTag;
  9195. if (isBuffer(value)) {
  9196. return cloneBuffer(value, isDeep);
  9197. }
  9198. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  9199. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  9200. if (!isDeep) {
  9201. return isFlat
  9202. ? copySymbolsIn(value, baseAssignIn(result, value))
  9203. : copySymbols(value, baseAssign(result, value));
  9204. }
  9205. } else {
  9206. if (!cloneableTags[tag]) {
  9207. return object ? value : {};
  9208. }
  9209. result = initCloneByTag(value, tag, isDeep);
  9210. }
  9211. }
  9212. // Check for circular references and return its corresponding clone.
  9213. stack || (stack = new Stack);
  9214. var stacked = stack.get(value);
  9215. if (stacked) {
  9216. return stacked;
  9217. }
  9218. stack.set(value, result);
  9219. if (isSet(value)) {
  9220. value.forEach(function(subValue) {
  9221. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  9222. });
  9223. return result;
  9224. }
  9225. if (isMap(value)) {
  9226. value.forEach(function(subValue, key) {
  9227. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  9228. });
  9229. return result;
  9230. }
  9231. var keysFunc = isFull
  9232. ? (isFlat ? getAllKeysIn : getAllKeys)
  9233. : (isFlat ? keysIn : keys);
  9234. var props = isArr ? undefined : keysFunc(value);
  9235. arrayEach(props || value, function(subValue, key) {
  9236. if (props) {
  9237. key = subValue;
  9238. subValue = value[key];
  9239. }
  9240. // Recursively populate clone (susceptible to call stack limits).
  9241. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  9242. });
  9243. return result;
  9244. }
  9245. /**
  9246. * The base implementation of `_.conforms` which doesn't clone `source`.
  9247. *
  9248. * @private
  9249. * @param {Object} source The object of property predicates to conform to.
  9250. * @returns {Function} Returns the new spec function.
  9251. */
  9252. function baseConforms(source) {
  9253. var props = keys(source);
  9254. return function(object) {
  9255. return baseConformsTo(object, source, props);
  9256. };
  9257. }
  9258. /**
  9259. * The base implementation of `_.conformsTo` which accepts `props` to check.
  9260. *
  9261. * @private
  9262. * @param {Object} object The object to inspect.
  9263. * @param {Object} source The object of property predicates to conform to.
  9264. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  9265. */
  9266. function baseConformsTo(object, source, props) {
  9267. var length = props.length;
  9268. if (object == null) {
  9269. return !length;
  9270. }
  9271. object = Object(object);
  9272. while (length--) {
  9273. var key = props[length],
  9274. predicate = source[key],
  9275. value = object[key];
  9276. if ((value === undefined && !(key in object)) || !predicate(value)) {
  9277. return false;
  9278. }
  9279. }
  9280. return true;
  9281. }
  9282. /**
  9283. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  9284. * to provide to `func`.
  9285. *
  9286. * @private
  9287. * @param {Function} func The function to delay.
  9288. * @param {number} wait The number of milliseconds to delay invocation.
  9289. * @param {Array} args The arguments to provide to `func`.
  9290. * @returns {number|Object} Returns the timer id or timeout object.
  9291. */
  9292. function baseDelay(func, wait, args) {
  9293. if (typeof func != 'function') {
  9294. throw new TypeError(FUNC_ERROR_TEXT);
  9295. }
  9296. return setTimeout(function() { func.apply(undefined, args); }, wait);
  9297. }
  9298. /**
  9299. * The base implementation of methods like `_.difference` without support
  9300. * for excluding multiple arrays or iteratee shorthands.
  9301. *
  9302. * @private
  9303. * @param {Array} array The array to inspect.
  9304. * @param {Array} values The values to exclude.
  9305. * @param {Function} [iteratee] The iteratee invoked per element.
  9306. * @param {Function} [comparator] The comparator invoked per element.
  9307. * @returns {Array} Returns the new array of filtered values.
  9308. */
  9309. function baseDifference(array, values, iteratee, comparator) {
  9310. var index = -1,
  9311. includes = arrayIncludes,
  9312. isCommon = true,
  9313. length = array.length,
  9314. result = [],
  9315. valuesLength = values.length;
  9316. if (!length) {
  9317. return result;
  9318. }
  9319. if (iteratee) {
  9320. values = arrayMap(values, baseUnary(iteratee));
  9321. }
  9322. if (comparator) {
  9323. includes = arrayIncludesWith;
  9324. isCommon = false;
  9325. }
  9326. else if (values.length >= LARGE_ARRAY_SIZE) {
  9327. includes = cacheHas;
  9328. isCommon = false;
  9329. values = new SetCache(values);
  9330. }
  9331. outer:
  9332. while (++index < length) {
  9333. var value = array[index],
  9334. computed = iteratee == null ? value : iteratee(value);
  9335. value = (comparator || value !== 0) ? value : 0;
  9336. if (isCommon && computed === computed) {
  9337. var valuesIndex = valuesLength;
  9338. while (valuesIndex--) {
  9339. if (values[valuesIndex] === computed) {
  9340. continue outer;
  9341. }
  9342. }
  9343. result.push(value);
  9344. }
  9345. else if (!includes(values, computed, comparator)) {
  9346. result.push(value);
  9347. }
  9348. }
  9349. return result;
  9350. }
  9351. /**
  9352. * The base implementation of `_.forEach` without support for iteratee shorthands.
  9353. *
  9354. * @private
  9355. * @param {Array|Object} collection The collection to iterate over.
  9356. * @param {Function} iteratee The function invoked per iteration.
  9357. * @returns {Array|Object} Returns `collection`.
  9358. */
  9359. var baseEach = createBaseEach(baseForOwn);
  9360. /**
  9361. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  9362. *
  9363. * @private
  9364. * @param {Array|Object} collection The collection to iterate over.
  9365. * @param {Function} iteratee The function invoked per iteration.
  9366. * @returns {Array|Object} Returns `collection`.
  9367. */
  9368. var baseEachRight = createBaseEach(baseForOwnRight, true);
  9369. /**
  9370. * The base implementation of `_.every` without support for iteratee shorthands.
  9371. *
  9372. * @private
  9373. * @param {Array|Object} collection The collection to iterate over.
  9374. * @param {Function} predicate The function invoked per iteration.
  9375. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9376. * else `false`
  9377. */
  9378. function baseEvery(collection, predicate) {
  9379. var result = true;
  9380. baseEach(collection, function(value, index, collection) {
  9381. result = !!predicate(value, index, collection);
  9382. return result;
  9383. });
  9384. return result;
  9385. }
  9386. /**
  9387. * The base implementation of methods like `_.max` and `_.min` which accepts a
  9388. * `comparator` to determine the extremum value.
  9389. *
  9390. * @private
  9391. * @param {Array} array The array to iterate over.
  9392. * @param {Function} iteratee The iteratee invoked per iteration.
  9393. * @param {Function} comparator The comparator used to compare values.
  9394. * @returns {*} Returns the extremum value.
  9395. */
  9396. function baseExtremum(array, iteratee, comparator) {
  9397. var index = -1,
  9398. length = array.length;
  9399. while (++index < length) {
  9400. var value = array[index],
  9401. current = iteratee(value);
  9402. if (current != null && (computed === undefined
  9403. ? (current === current && !isSymbol(current))
  9404. : comparator(current, computed)
  9405. )) {
  9406. var computed = current,
  9407. result = value;
  9408. }
  9409. }
  9410. return result;
  9411. }
  9412. /**
  9413. * The base implementation of `_.fill` without an iteratee call guard.
  9414. *
  9415. * @private
  9416. * @param {Array} array The array to fill.
  9417. * @param {*} value The value to fill `array` with.
  9418. * @param {number} [start=0] The start position.
  9419. * @param {number} [end=array.length] The end position.
  9420. * @returns {Array} Returns `array`.
  9421. */
  9422. function baseFill(array, value, start, end) {
  9423. var length = array.length;
  9424. start = toInteger(start);
  9425. if (start < 0) {
  9426. start = -start > length ? 0 : (length + start);
  9427. }
  9428. end = (end === undefined || end > length) ? length : toInteger(end);
  9429. if (end < 0) {
  9430. end += length;
  9431. }
  9432. end = start > end ? 0 : toLength(end);
  9433. while (start < end) {
  9434. array[start++] = value;
  9435. }
  9436. return array;
  9437. }
  9438. /**
  9439. * The base implementation of `_.filter` without support for iteratee shorthands.
  9440. *
  9441. * @private
  9442. * @param {Array|Object} collection The collection to iterate over.
  9443. * @param {Function} predicate The function invoked per iteration.
  9444. * @returns {Array} Returns the new filtered array.
  9445. */
  9446. function baseFilter(collection, predicate) {
  9447. var result = [];
  9448. baseEach(collection, function(value, index, collection) {
  9449. if (predicate(value, index, collection)) {
  9450. result.push(value);
  9451. }
  9452. });
  9453. return result;
  9454. }
  9455. /**
  9456. * The base implementation of `_.flatten` with support for restricting flattening.
  9457. *
  9458. * @private
  9459. * @param {Array} array The array to flatten.
  9460. * @param {number} depth The maximum recursion depth.
  9461. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  9462. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  9463. * @param {Array} [result=[]] The initial result value.
  9464. * @returns {Array} Returns the new flattened array.
  9465. */
  9466. function baseFlatten(array, depth, predicate, isStrict, result) {
  9467. var index = -1,
  9468. length = array.length;
  9469. predicate || (predicate = isFlattenable);
  9470. result || (result = []);
  9471. while (++index < length) {
  9472. var value = array[index];
  9473. if (depth > 0 && predicate(value)) {
  9474. if (depth > 1) {
  9475. // Recursively flatten arrays (susceptible to call stack limits).
  9476. baseFlatten(value, depth - 1, predicate, isStrict, result);
  9477. } else {
  9478. arrayPush(result, value);
  9479. }
  9480. } else if (!isStrict) {
  9481. result[result.length] = value;
  9482. }
  9483. }
  9484. return result;
  9485. }
  9486. /**
  9487. * The base implementation of `baseForOwn` which iterates over `object`
  9488. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  9489. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9490. *
  9491. * @private
  9492. * @param {Object} object The object to iterate over.
  9493. * @param {Function} iteratee The function invoked per iteration.
  9494. * @param {Function} keysFunc The function to get the keys of `object`.
  9495. * @returns {Object} Returns `object`.
  9496. */
  9497. var baseFor = createBaseFor();
  9498. /**
  9499. * This function is like `baseFor` except that it iterates over properties
  9500. * in the opposite order.
  9501. *
  9502. * @private
  9503. * @param {Object} object The object to iterate over.
  9504. * @param {Function} iteratee The function invoked per iteration.
  9505. * @param {Function} keysFunc The function to get the keys of `object`.
  9506. * @returns {Object} Returns `object`.
  9507. */
  9508. var baseForRight = createBaseFor(true);
  9509. /**
  9510. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  9511. *
  9512. * @private
  9513. * @param {Object} object The object to iterate over.
  9514. * @param {Function} iteratee The function invoked per iteration.
  9515. * @returns {Object} Returns `object`.
  9516. */
  9517. function baseForOwn(object, iteratee) {
  9518. return object && baseFor(object, iteratee, keys);
  9519. }
  9520. /**
  9521. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  9522. *
  9523. * @private
  9524. * @param {Object} object The object to iterate over.
  9525. * @param {Function} iteratee The function invoked per iteration.
  9526. * @returns {Object} Returns `object`.
  9527. */
  9528. function baseForOwnRight(object, iteratee) {
  9529. return object && baseForRight(object, iteratee, keys);
  9530. }
  9531. /**
  9532. * The base implementation of `_.functions` which creates an array of
  9533. * `object` function property names filtered from `props`.
  9534. *
  9535. * @private
  9536. * @param {Object} object The object to inspect.
  9537. * @param {Array} props The property names to filter.
  9538. * @returns {Array} Returns the function names.
  9539. */
  9540. function baseFunctions(object, props) {
  9541. return arrayFilter(props, function(key) {
  9542. return isFunction(object[key]);
  9543. });
  9544. }
  9545. /**
  9546. * The base implementation of `_.get` without support for default values.
  9547. *
  9548. * @private
  9549. * @param {Object} object The object to query.
  9550. * @param {Array|string} path The path of the property to get.
  9551. * @returns {*} Returns the resolved value.
  9552. */
  9553. function baseGet(object, path) {
  9554. path = castPath(path, object);
  9555. var index = 0,
  9556. length = path.length;
  9557. while (object != null && index < length) {
  9558. object = object[toKey(path[index++])];
  9559. }
  9560. return (index && index == length) ? object : undefined;
  9561. }
  9562. /**
  9563. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  9564. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  9565. * symbols of `object`.
  9566. *
  9567. * @private
  9568. * @param {Object} object The object to query.
  9569. * @param {Function} keysFunc The function to get the keys of `object`.
  9570. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  9571. * @returns {Array} Returns the array of property names and symbols.
  9572. */
  9573. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  9574. var result = keysFunc(object);
  9575. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  9576. }
  9577. /**
  9578. * The base implementation of `getTag` without fallbacks for buggy environments.
  9579. *
  9580. * @private
  9581. * @param {*} value The value to query.
  9582. * @returns {string} Returns the `toStringTag`.
  9583. */
  9584. function baseGetTag(value) {
  9585. if (value == null) {
  9586. return value === undefined ? undefinedTag : nullTag;
  9587. }
  9588. return (symToStringTag && symToStringTag in Object(value))
  9589. ? getRawTag(value)
  9590. : objectToString(value);
  9591. }
  9592. /**
  9593. * The base implementation of `_.gt` which doesn't coerce arguments.
  9594. *
  9595. * @private
  9596. * @param {*} value The value to compare.
  9597. * @param {*} other The other value to compare.
  9598. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  9599. * else `false`.
  9600. */
  9601. function baseGt(value, other) {
  9602. return value > other;
  9603. }
  9604. /**
  9605. * The base implementation of `_.has` without support for deep paths.
  9606. *
  9607. * @private
  9608. * @param {Object} [object] The object to query.
  9609. * @param {Array|string} key The key to check.
  9610. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  9611. */
  9612. function baseHas(object, key) {
  9613. return object != null && hasOwnProperty.call(object, key);
  9614. }
  9615. /**
  9616. * The base implementation of `_.hasIn` without support for deep paths.
  9617. *
  9618. * @private
  9619. * @param {Object} [object] The object to query.
  9620. * @param {Array|string} key The key to check.
  9621. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  9622. */
  9623. function baseHasIn(object, key) {
  9624. return object != null && key in Object(object);
  9625. }
  9626. /**
  9627. * The base implementation of `_.inRange` which doesn't coerce arguments.
  9628. *
  9629. * @private
  9630. * @param {number} number The number to check.
  9631. * @param {number} start The start of the range.
  9632. * @param {number} end The end of the range.
  9633. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  9634. */
  9635. function baseInRange(number, start, end) {
  9636. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  9637. }
  9638. /**
  9639. * The base implementation of methods like `_.intersection`, without support
  9640. * for iteratee shorthands, that accepts an array of arrays to inspect.
  9641. *
  9642. * @private
  9643. * @param {Array} arrays The arrays to inspect.
  9644. * @param {Function} [iteratee] The iteratee invoked per element.
  9645. * @param {Function} [comparator] The comparator invoked per element.
  9646. * @returns {Array} Returns the new array of shared values.
  9647. */
  9648. function baseIntersection(arrays, iteratee, comparator) {
  9649. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  9650. length = arrays[0].length,
  9651. othLength = arrays.length,
  9652. othIndex = othLength,
  9653. caches = Array(othLength),
  9654. maxLength = Infinity,
  9655. result = [];
  9656. while (othIndex--) {
  9657. var array = arrays[othIndex];
  9658. if (othIndex && iteratee) {
  9659. array = arrayMap(array, baseUnary(iteratee));
  9660. }
  9661. maxLength = nativeMin(array.length, maxLength);
  9662. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  9663. ? new SetCache(othIndex && array)
  9664. : undefined;
  9665. }
  9666. array = arrays[0];
  9667. var index = -1,
  9668. seen = caches[0];
  9669. outer:
  9670. while (++index < length && result.length < maxLength) {
  9671. var value = array[index],
  9672. computed = iteratee ? iteratee(value) : value;
  9673. value = (comparator || value !== 0) ? value : 0;
  9674. if (!(seen
  9675. ? cacheHas(seen, computed)
  9676. : includes(result, computed, comparator)
  9677. )) {
  9678. othIndex = othLength;
  9679. while (--othIndex) {
  9680. var cache = caches[othIndex];
  9681. if (!(cache
  9682. ? cacheHas(cache, computed)
  9683. : includes(arrays[othIndex], computed, comparator))
  9684. ) {
  9685. continue outer;
  9686. }
  9687. }
  9688. if (seen) {
  9689. seen.push(computed);
  9690. }
  9691. result.push(value);
  9692. }
  9693. }
  9694. return result;
  9695. }
  9696. /**
  9697. * The base implementation of `_.invert` and `_.invertBy` which inverts
  9698. * `object` with values transformed by `iteratee` and set by `setter`.
  9699. *
  9700. * @private
  9701. * @param {Object} object The object to iterate over.
  9702. * @param {Function} setter The function to set `accumulator` values.
  9703. * @param {Function} iteratee The iteratee to transform values.
  9704. * @param {Object} accumulator The initial inverted object.
  9705. * @returns {Function} Returns `accumulator`.
  9706. */
  9707. function baseInverter(object, setter, iteratee, accumulator) {
  9708. baseForOwn(object, function(value, key, object) {
  9709. setter(accumulator, iteratee(value), key, object);
  9710. });
  9711. return accumulator;
  9712. }
  9713. /**
  9714. * The base implementation of `_.invoke` without support for individual
  9715. * method arguments.
  9716. *
  9717. * @private
  9718. * @param {Object} object The object to query.
  9719. * @param {Array|string} path The path of the method to invoke.
  9720. * @param {Array} args The arguments to invoke the method with.
  9721. * @returns {*} Returns the result of the invoked method.
  9722. */
  9723. function baseInvoke(object, path, args) {
  9724. path = castPath(path, object);
  9725. object = parent(object, path);
  9726. var func = object == null ? object : object[toKey(last(path))];
  9727. return func == null ? undefined : apply(func, object, args);
  9728. }
  9729. /**
  9730. * The base implementation of `_.isArguments`.
  9731. *
  9732. * @private
  9733. * @param {*} value The value to check.
  9734. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  9735. */
  9736. function baseIsArguments(value) {
  9737. return isObjectLike(value) && baseGetTag(value) == argsTag;
  9738. }
  9739. /**
  9740. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  9741. *
  9742. * @private
  9743. * @param {*} value The value to check.
  9744. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  9745. */
  9746. function baseIsArrayBuffer(value) {
  9747. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  9748. }
  9749. /**
  9750. * The base implementation of `_.isDate` without Node.js optimizations.
  9751. *
  9752. * @private
  9753. * @param {*} value The value to check.
  9754. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  9755. */
  9756. function baseIsDate(value) {
  9757. return isObjectLike(value) && baseGetTag(value) == dateTag;
  9758. }
  9759. /**
  9760. * The base implementation of `_.isEqual` which supports partial comparisons
  9761. * and tracks traversed objects.
  9762. *
  9763. * @private
  9764. * @param {*} value The value to compare.
  9765. * @param {*} other The other value to compare.
  9766. * @param {boolean} bitmask The bitmask flags.
  9767. * 1 - Unordered comparison
  9768. * 2 - Partial comparison
  9769. * @param {Function} [customizer] The function to customize comparisons.
  9770. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  9771. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  9772. */
  9773. function baseIsEqual(value, other, bitmask, customizer, stack) {
  9774. if (value === other) {
  9775. return true;
  9776. }
  9777. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  9778. return value !== value && other !== other;
  9779. }
  9780. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  9781. }
  9782. /**
  9783. * A specialized version of `baseIsEqual` for arrays and objects which performs
  9784. * deep comparisons and tracks traversed objects enabling objects with circular
  9785. * references to be compared.
  9786. *
  9787. * @private
  9788. * @param {Object} object The object to compare.
  9789. * @param {Object} other The other object to compare.
  9790. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  9791. * @param {Function} customizer The function to customize comparisons.
  9792. * @param {Function} equalFunc The function to determine equivalents of values.
  9793. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  9794. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  9795. */
  9796. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  9797. var objIsArr = isArray(object),
  9798. othIsArr = isArray(other),
  9799. objTag = objIsArr ? arrayTag : getTag(object),
  9800. othTag = othIsArr ? arrayTag : getTag(other);
  9801. objTag = objTag == argsTag ? objectTag : objTag;
  9802. othTag = othTag == argsTag ? objectTag : othTag;
  9803. var objIsObj = objTag == objectTag,
  9804. othIsObj = othTag == objectTag,
  9805. isSameTag = objTag == othTag;
  9806. if (isSameTag && isBuffer(object)) {
  9807. if (!isBuffer(other)) {
  9808. return false;
  9809. }
  9810. objIsArr = true;
  9811. objIsObj = false;
  9812. }
  9813. if (isSameTag && !objIsObj) {
  9814. stack || (stack = new Stack);
  9815. return (objIsArr || isTypedArray(object))
  9816. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  9817. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  9818. }
  9819. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  9820. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  9821. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  9822. if (objIsWrapped || othIsWrapped) {
  9823. var objUnwrapped = objIsWrapped ? object.value() : object,
  9824. othUnwrapped = othIsWrapped ? other.value() : other;
  9825. stack || (stack = new Stack);
  9826. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  9827. }
  9828. }
  9829. if (!isSameTag) {
  9830. return false;
  9831. }
  9832. stack || (stack = new Stack);
  9833. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  9834. }
  9835. /**
  9836. * The base implementation of `_.isMap` without Node.js optimizations.
  9837. *
  9838. * @private
  9839. * @param {*} value The value to check.
  9840. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  9841. */
  9842. function baseIsMap(value) {
  9843. return isObjectLike(value) && getTag(value) == mapTag;
  9844. }
  9845. /**
  9846. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  9847. *
  9848. * @private
  9849. * @param {Object} object The object to inspect.
  9850. * @param {Object} source The object of property values to match.
  9851. * @param {Array} matchData The property names, values, and compare flags to match.
  9852. * @param {Function} [customizer] The function to customize comparisons.
  9853. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  9854. */
  9855. function baseIsMatch(object, source, matchData, customizer) {
  9856. var index = matchData.length,
  9857. length = index,
  9858. noCustomizer = !customizer;
  9859. if (object == null) {
  9860. return !length;
  9861. }
  9862. object = Object(object);
  9863. while (index--) {
  9864. var data = matchData[index];
  9865. if ((noCustomizer && data[2])
  9866. ? data[1] !== object[data[0]]
  9867. : !(data[0] in object)
  9868. ) {
  9869. return false;
  9870. }
  9871. }
  9872. while (++index < length) {
  9873. data = matchData[index];
  9874. var key = data[0],
  9875. objValue = object[key],
  9876. srcValue = data[1];
  9877. if (noCustomizer && data[2]) {
  9878. if (objValue === undefined && !(key in object)) {
  9879. return false;
  9880. }
  9881. } else {
  9882. var stack = new Stack;
  9883. if (customizer) {
  9884. var result = customizer(objValue, srcValue, key, object, source, stack);
  9885. }
  9886. if (!(result === undefined
  9887. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  9888. : result
  9889. )) {
  9890. return false;
  9891. }
  9892. }
  9893. }
  9894. return true;
  9895. }
  9896. /**
  9897. * The base implementation of `_.isNative` without bad shim checks.
  9898. *
  9899. * @private
  9900. * @param {*} value The value to check.
  9901. * @returns {boolean} Returns `true` if `value` is a native function,
  9902. * else `false`.
  9903. */
  9904. function baseIsNative(value) {
  9905. if (!isObject(value) || isMasked(value)) {
  9906. return false;
  9907. }
  9908. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  9909. return pattern.test(toSource(value));
  9910. }
  9911. /**
  9912. * The base implementation of `_.isRegExp` without Node.js optimizations.
  9913. *
  9914. * @private
  9915. * @param {*} value The value to check.
  9916. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  9917. */
  9918. function baseIsRegExp(value) {
  9919. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  9920. }
  9921. /**
  9922. * The base implementation of `_.isSet` without Node.js optimizations.
  9923. *
  9924. * @private
  9925. * @param {*} value The value to check.
  9926. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  9927. */
  9928. function baseIsSet(value) {
  9929. return isObjectLike(value) && getTag(value) == setTag;
  9930. }
  9931. /**
  9932. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  9933. *
  9934. * @private
  9935. * @param {*} value The value to check.
  9936. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  9937. */
  9938. function baseIsTypedArray(value) {
  9939. return isObjectLike(value) &&
  9940. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  9941. }
  9942. /**
  9943. * The base implementation of `_.iteratee`.
  9944. *
  9945. * @private
  9946. * @param {*} [value=_.identity] The value to convert to an iteratee.
  9947. * @returns {Function} Returns the iteratee.
  9948. */
  9949. function baseIteratee(value) {
  9950. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  9951. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  9952. if (typeof value == 'function') {
  9953. return value;
  9954. }
  9955. if (value == null) {
  9956. return identity;
  9957. }
  9958. if (typeof value == 'object') {
  9959. return isArray(value)
  9960. ? baseMatchesProperty(value[0], value[1])
  9961. : baseMatches(value);
  9962. }
  9963. return property(value);
  9964. }
  9965. /**
  9966. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  9967. *
  9968. * @private
  9969. * @param {Object} object The object to query.
  9970. * @returns {Array} Returns the array of property names.
  9971. */
  9972. function baseKeys(object) {
  9973. if (!isPrototype(object)) {
  9974. return nativeKeys(object);
  9975. }
  9976. var result = [];
  9977. for (var key in Object(object)) {
  9978. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  9979. result.push(key);
  9980. }
  9981. }
  9982. return result;
  9983. }
  9984. /**
  9985. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  9986. *
  9987. * @private
  9988. * @param {Object} object The object to query.
  9989. * @returns {Array} Returns the array of property names.
  9990. */
  9991. function baseKeysIn(object) {
  9992. if (!isObject(object)) {
  9993. return nativeKeysIn(object);
  9994. }
  9995. var isProto = isPrototype(object),
  9996. result = [];
  9997. for (var key in object) {
  9998. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  9999. result.push(key);
  10000. }
  10001. }
  10002. return result;
  10003. }
  10004. /**
  10005. * The base implementation of `_.lt` which doesn't coerce arguments.
  10006. *
  10007. * @private
  10008. * @param {*} value The value to compare.
  10009. * @param {*} other The other value to compare.
  10010. * @returns {boolean} Returns `true` if `value` is less than `other`,
  10011. * else `false`.
  10012. */
  10013. function baseLt(value, other) {
  10014. return value < other;
  10015. }
  10016. /**
  10017. * The base implementation of `_.map` without support for iteratee shorthands.
  10018. *
  10019. * @private
  10020. * @param {Array|Object} collection The collection to iterate over.
  10021. * @param {Function} iteratee The function invoked per iteration.
  10022. * @returns {Array} Returns the new mapped array.
  10023. */
  10024. function baseMap(collection, iteratee) {
  10025. var index = -1,
  10026. result = isArrayLike(collection) ? Array(collection.length) : [];
  10027. baseEach(collection, function(value, key, collection) {
  10028. result[++index] = iteratee(value, key, collection);
  10029. });
  10030. return result;
  10031. }
  10032. /**
  10033. * The base implementation of `_.matches` which doesn't clone `source`.
  10034. *
  10035. * @private
  10036. * @param {Object} source The object of property values to match.
  10037. * @returns {Function} Returns the new spec function.
  10038. */
  10039. function baseMatches(source) {
  10040. var matchData = getMatchData(source);
  10041. if (matchData.length == 1 && matchData[0][2]) {
  10042. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  10043. }
  10044. return function(object) {
  10045. return object === source || baseIsMatch(object, source, matchData);
  10046. };
  10047. }
  10048. /**
  10049. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  10050. *
  10051. * @private
  10052. * @param {string} path The path of the property to get.
  10053. * @param {*} srcValue The value to match.
  10054. * @returns {Function} Returns the new spec function.
  10055. */
  10056. function baseMatchesProperty(path, srcValue) {
  10057. if (isKey(path) && isStrictComparable(srcValue)) {
  10058. return matchesStrictComparable(toKey(path), srcValue);
  10059. }
  10060. return function(object) {
  10061. var objValue = get(object, path);
  10062. return (objValue === undefined && objValue === srcValue)
  10063. ? hasIn(object, path)
  10064. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  10065. };
  10066. }
  10067. /**
  10068. * The base implementation of `_.merge` without support for multiple sources.
  10069. *
  10070. * @private
  10071. * @param {Object} object The destination object.
  10072. * @param {Object} source The source object.
  10073. * @param {number} srcIndex The index of `source`.
  10074. * @param {Function} [customizer] The function to customize merged values.
  10075. * @param {Object} [stack] Tracks traversed source values and their merged
  10076. * counterparts.
  10077. */
  10078. function baseMerge(object, source, srcIndex, customizer, stack) {
  10079. if (object === source) {
  10080. return;
  10081. }
  10082. baseFor(source, function(srcValue, key) {
  10083. if (isObject(srcValue)) {
  10084. stack || (stack = new Stack);
  10085. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  10086. }
  10087. else {
  10088. var newValue = customizer
  10089. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  10090. : undefined;
  10091. if (newValue === undefined) {
  10092. newValue = srcValue;
  10093. }
  10094. assignMergeValue(object, key, newValue);
  10095. }
  10096. }, keysIn);
  10097. }
  10098. /**
  10099. * A specialized version of `baseMerge` for arrays and objects which performs
  10100. * deep merges and tracks traversed objects enabling objects with circular
  10101. * references to be merged.
  10102. *
  10103. * @private
  10104. * @param {Object} object The destination object.
  10105. * @param {Object} source The source object.
  10106. * @param {string} key The key of the value to merge.
  10107. * @param {number} srcIndex The index of `source`.
  10108. * @param {Function} mergeFunc The function to merge values.
  10109. * @param {Function} [customizer] The function to customize assigned values.
  10110. * @param {Object} [stack] Tracks traversed source values and their merged
  10111. * counterparts.
  10112. */
  10113. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  10114. var objValue = safeGet(object, key),
  10115. srcValue = safeGet(source, key),
  10116. stacked = stack.get(srcValue);
  10117. if (stacked) {
  10118. assignMergeValue(object, key, stacked);
  10119. return;
  10120. }
  10121. var newValue = customizer
  10122. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  10123. : undefined;
  10124. var isCommon = newValue === undefined;
  10125. if (isCommon) {
  10126. var isArr = isArray(srcValue),
  10127. isBuff = !isArr && isBuffer(srcValue),
  10128. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  10129. newValue = srcValue;
  10130. if (isArr || isBuff || isTyped) {
  10131. if (isArray(objValue)) {
  10132. newValue = objValue;
  10133. }
  10134. else if (isArrayLikeObject(objValue)) {
  10135. newValue = copyArray(objValue);
  10136. }
  10137. else if (isBuff) {
  10138. isCommon = false;
  10139. newValue = cloneBuffer(srcValue, true);
  10140. }
  10141. else if (isTyped) {
  10142. isCommon = false;
  10143. newValue = cloneTypedArray(srcValue, true);
  10144. }
  10145. else {
  10146. newValue = [];
  10147. }
  10148. }
  10149. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  10150. newValue = objValue;
  10151. if (isArguments(objValue)) {
  10152. newValue = toPlainObject(objValue);
  10153. }
  10154. else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
  10155. newValue = initCloneObject(srcValue);
  10156. }
  10157. }
  10158. else {
  10159. isCommon = false;
  10160. }
  10161. }
  10162. if (isCommon) {
  10163. // Recursively merge objects and arrays (susceptible to call stack limits).
  10164. stack.set(srcValue, newValue);
  10165. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  10166. stack['delete'](srcValue);
  10167. }
  10168. assignMergeValue(object, key, newValue);
  10169. }
  10170. /**
  10171. * The base implementation of `_.nth` which doesn't coerce arguments.
  10172. *
  10173. * @private
  10174. * @param {Array} array The array to query.
  10175. * @param {number} n The index of the element to return.
  10176. * @returns {*} Returns the nth element of `array`.
  10177. */
  10178. function baseNth(array, n) {
  10179. var length = array.length;
  10180. if (!length) {
  10181. return;
  10182. }
  10183. n += n < 0 ? length : 0;
  10184. return isIndex(n, length) ? array[n] : undefined;
  10185. }
  10186. /**
  10187. * The base implementation of `_.orderBy` without param guards.
  10188. *
  10189. * @private
  10190. * @param {Array|Object} collection The collection to iterate over.
  10191. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  10192. * @param {string[]} orders The sort orders of `iteratees`.
  10193. * @returns {Array} Returns the new sorted array.
  10194. */
  10195. function baseOrderBy(collection, iteratees, orders) {
  10196. var index = -1;
  10197. iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
  10198. var result = baseMap(collection, function(value, key, collection) {
  10199. var criteria = arrayMap(iteratees, function(iteratee) {
  10200. return iteratee(value);
  10201. });
  10202. return { 'criteria': criteria, 'index': ++index, 'value': value };
  10203. });
  10204. return baseSortBy(result, function(object, other) {
  10205. return compareMultiple(object, other, orders);
  10206. });
  10207. }
  10208. /**
  10209. * The base implementation of `_.pick` without support for individual
  10210. * property identifiers.
  10211. *
  10212. * @private
  10213. * @param {Object} object The source object.
  10214. * @param {string[]} paths The property paths to pick.
  10215. * @returns {Object} Returns the new object.
  10216. */
  10217. function basePick(object, paths) {
  10218. return basePickBy(object, paths, function(value, path) {
  10219. return hasIn(object, path);
  10220. });
  10221. }
  10222. /**
  10223. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  10224. *
  10225. * @private
  10226. * @param {Object} object The source object.
  10227. * @param {string[]} paths The property paths to pick.
  10228. * @param {Function} predicate The function invoked per property.
  10229. * @returns {Object} Returns the new object.
  10230. */
  10231. function basePickBy(object, paths, predicate) {
  10232. var index = -1,
  10233. length = paths.length,
  10234. result = {};
  10235. while (++index < length) {
  10236. var path = paths[index],
  10237. value = baseGet(object, path);
  10238. if (predicate(value, path)) {
  10239. baseSet(result, castPath(path, object), value);
  10240. }
  10241. }
  10242. return result;
  10243. }
  10244. /**
  10245. * A specialized version of `baseProperty` which supports deep paths.
  10246. *
  10247. * @private
  10248. * @param {Array|string} path The path of the property to get.
  10249. * @returns {Function} Returns the new accessor function.
  10250. */
  10251. function basePropertyDeep(path) {
  10252. return function(object) {
  10253. return baseGet(object, path);
  10254. };
  10255. }
  10256. /**
  10257. * The base implementation of `_.pullAllBy` without support for iteratee
  10258. * shorthands.
  10259. *
  10260. * @private
  10261. * @param {Array} array The array to modify.
  10262. * @param {Array} values The values to remove.
  10263. * @param {Function} [iteratee] The iteratee invoked per element.
  10264. * @param {Function} [comparator] The comparator invoked per element.
  10265. * @returns {Array} Returns `array`.
  10266. */
  10267. function basePullAll(array, values, iteratee, comparator) {
  10268. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  10269. index = -1,
  10270. length = values.length,
  10271. seen = array;
  10272. if (array === values) {
  10273. values = copyArray(values);
  10274. }
  10275. if (iteratee) {
  10276. seen = arrayMap(array, baseUnary(iteratee));
  10277. }
  10278. while (++index < length) {
  10279. var fromIndex = 0,
  10280. value = values[index],
  10281. computed = iteratee ? iteratee(value) : value;
  10282. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  10283. if (seen !== array) {
  10284. splice.call(seen, fromIndex, 1);
  10285. }
  10286. splice.call(array, fromIndex, 1);
  10287. }
  10288. }
  10289. return array;
  10290. }
  10291. /**
  10292. * The base implementation of `_.pullAt` without support for individual
  10293. * indexes or capturing the removed elements.
  10294. *
  10295. * @private
  10296. * @param {Array} array The array to modify.
  10297. * @param {number[]} indexes The indexes of elements to remove.
  10298. * @returns {Array} Returns `array`.
  10299. */
  10300. function basePullAt(array, indexes) {
  10301. var length = array ? indexes.length : 0,
  10302. lastIndex = length - 1;
  10303. while (length--) {
  10304. var index = indexes[length];
  10305. if (length == lastIndex || index !== previous) {
  10306. var previous = index;
  10307. if (isIndex(index)) {
  10308. splice.call(array, index, 1);
  10309. } else {
  10310. baseUnset(array, index);
  10311. }
  10312. }
  10313. }
  10314. return array;
  10315. }
  10316. /**
  10317. * The base implementation of `_.random` without support for returning
  10318. * floating-point numbers.
  10319. *
  10320. * @private
  10321. * @param {number} lower The lower bound.
  10322. * @param {number} upper The upper bound.
  10323. * @returns {number} Returns the random number.
  10324. */
  10325. function baseRandom(lower, upper) {
  10326. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  10327. }
  10328. /**
  10329. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  10330. * coerce arguments.
  10331. *
  10332. * @private
  10333. * @param {number} start The start of the range.
  10334. * @param {number} end The end of the range.
  10335. * @param {number} step The value to increment or decrement by.
  10336. * @param {boolean} [fromRight] Specify iterating from right to left.
  10337. * @returns {Array} Returns the range of numbers.
  10338. */
  10339. function baseRange(start, end, step, fromRight) {
  10340. var index = -1,
  10341. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  10342. result = Array(length);
  10343. while (length--) {
  10344. result[fromRight ? length : ++index] = start;
  10345. start += step;
  10346. }
  10347. return result;
  10348. }
  10349. /**
  10350. * The base implementation of `_.repeat` which doesn't coerce arguments.
  10351. *
  10352. * @private
  10353. * @param {string} string The string to repeat.
  10354. * @param {number} n The number of times to repeat the string.
  10355. * @returns {string} Returns the repeated string.
  10356. */
  10357. function baseRepeat(string, n) {
  10358. var result = '';
  10359. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  10360. return result;
  10361. }
  10362. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  10363. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  10364. do {
  10365. if (n % 2) {
  10366. result += string;
  10367. }
  10368. n = nativeFloor(n / 2);
  10369. if (n) {
  10370. string += string;
  10371. }
  10372. } while (n);
  10373. return result;
  10374. }
  10375. /**
  10376. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  10377. *
  10378. * @private
  10379. * @param {Function} func The function to apply a rest parameter to.
  10380. * @param {number} [start=func.length-1] The start position of the rest parameter.
  10381. * @returns {Function} Returns the new function.
  10382. */
  10383. function baseRest(func, start) {
  10384. return setToString(overRest(func, start, identity), func + '');
  10385. }
  10386. /**
  10387. * The base implementation of `_.sample`.
  10388. *
  10389. * @private
  10390. * @param {Array|Object} collection The collection to sample.
  10391. * @returns {*} Returns the random element.
  10392. */
  10393. function baseSample(collection) {
  10394. return arraySample(values(collection));
  10395. }
  10396. /**
  10397. * The base implementation of `_.sampleSize` without param guards.
  10398. *
  10399. * @private
  10400. * @param {Array|Object} collection The collection to sample.
  10401. * @param {number} n The number of elements to sample.
  10402. * @returns {Array} Returns the random elements.
  10403. */
  10404. function baseSampleSize(collection, n) {
  10405. var array = values(collection);
  10406. return shuffleSelf(array, baseClamp(n, 0, array.length));
  10407. }
  10408. /**
  10409. * The base implementation of `_.set`.
  10410. *
  10411. * @private
  10412. * @param {Object} object The object to modify.
  10413. * @param {Array|string} path The path of the property to set.
  10414. * @param {*} value The value to set.
  10415. * @param {Function} [customizer] The function to customize path creation.
  10416. * @returns {Object} Returns `object`.
  10417. */
  10418. function baseSet(object, path, value, customizer) {
  10419. if (!isObject(object)) {
  10420. return object;
  10421. }
  10422. path = castPath(path, object);
  10423. var index = -1,
  10424. length = path.length,
  10425. lastIndex = length - 1,
  10426. nested = object;
  10427. while (nested != null && ++index < length) {
  10428. var key = toKey(path[index]),
  10429. newValue = value;
  10430. if (index != lastIndex) {
  10431. var objValue = nested[key];
  10432. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  10433. if (newValue === undefined) {
  10434. newValue = isObject(objValue)
  10435. ? objValue
  10436. : (isIndex(path[index + 1]) ? [] : {});
  10437. }
  10438. }
  10439. assignValue(nested, key, newValue);
  10440. nested = nested[key];
  10441. }
  10442. return object;
  10443. }
  10444. /**
  10445. * The base implementation of `setData` without support for hot loop shorting.
  10446. *
  10447. * @private
  10448. * @param {Function} func The function to associate metadata with.
  10449. * @param {*} data The metadata.
  10450. * @returns {Function} Returns `func`.
  10451. */
  10452. var baseSetData = !metaMap ? identity : function(func, data) {
  10453. metaMap.set(func, data);
  10454. return func;
  10455. };
  10456. /**
  10457. * The base implementation of `setToString` without support for hot loop shorting.
  10458. *
  10459. * @private
  10460. * @param {Function} func The function to modify.
  10461. * @param {Function} string The `toString` result.
  10462. * @returns {Function} Returns `func`.
  10463. */
  10464. var baseSetToString = !defineProperty ? identity : function(func, string) {
  10465. return defineProperty(func, 'toString', {
  10466. 'configurable': true,
  10467. 'enumerable': false,
  10468. 'value': constant(string),
  10469. 'writable': true
  10470. });
  10471. };
  10472. /**
  10473. * The base implementation of `_.shuffle`.
  10474. *
  10475. * @private
  10476. * @param {Array|Object} collection The collection to shuffle.
  10477. * @returns {Array} Returns the new shuffled array.
  10478. */
  10479. function baseShuffle(collection) {
  10480. return shuffleSelf(values(collection));
  10481. }
  10482. /**
  10483. * The base implementation of `_.slice` without an iteratee call guard.
  10484. *
  10485. * @private
  10486. * @param {Array} array The array to slice.
  10487. * @param {number} [start=0] The start position.
  10488. * @param {number} [end=array.length] The end position.
  10489. * @returns {Array} Returns the slice of `array`.
  10490. */
  10491. function baseSlice(array, start, end) {
  10492. var index = -1,
  10493. length = array.length;
  10494. if (start < 0) {
  10495. start = -start > length ? 0 : (length + start);
  10496. }
  10497. end = end > length ? length : end;
  10498. if (end < 0) {
  10499. end += length;
  10500. }
  10501. length = start > end ? 0 : ((end - start) >>> 0);
  10502. start >>>= 0;
  10503. var result = Array(length);
  10504. while (++index < length) {
  10505. result[index] = array[index + start];
  10506. }
  10507. return result;
  10508. }
  10509. /**
  10510. * The base implementation of `_.some` without support for iteratee shorthands.
  10511. *
  10512. * @private
  10513. * @param {Array|Object} collection The collection to iterate over.
  10514. * @param {Function} predicate The function invoked per iteration.
  10515. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10516. * else `false`.
  10517. */
  10518. function baseSome(collection, predicate) {
  10519. var result;
  10520. baseEach(collection, function(value, index, collection) {
  10521. result = predicate(value, index, collection);
  10522. return !result;
  10523. });
  10524. return !!result;
  10525. }
  10526. /**
  10527. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  10528. * performs a binary search of `array` to determine the index at which `value`
  10529. * should be inserted into `array` in order to maintain its sort order.
  10530. *
  10531. * @private
  10532. * @param {Array} array The sorted array to inspect.
  10533. * @param {*} value The value to evaluate.
  10534. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  10535. * @returns {number} Returns the index at which `value` should be inserted
  10536. * into `array`.
  10537. */
  10538. function baseSortedIndex(array, value, retHighest) {
  10539. var low = 0,
  10540. high = array == null ? low : array.length;
  10541. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  10542. while (low < high) {
  10543. var mid = (low + high) >>> 1,
  10544. computed = array[mid];
  10545. if (computed !== null && !isSymbol(computed) &&
  10546. (retHighest ? (computed <= value) : (computed < value))) {
  10547. low = mid + 1;
  10548. } else {
  10549. high = mid;
  10550. }
  10551. }
  10552. return high;
  10553. }
  10554. return baseSortedIndexBy(array, value, identity, retHighest);
  10555. }
  10556. /**
  10557. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  10558. * which invokes `iteratee` for `value` and each element of `array` to compute
  10559. * their sort ranking. The iteratee is invoked with one argument; (value).
  10560. *
  10561. * @private
  10562. * @param {Array} array The sorted array to inspect.
  10563. * @param {*} value The value to evaluate.
  10564. * @param {Function} iteratee The iteratee invoked per element.
  10565. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  10566. * @returns {number} Returns the index at which `value` should be inserted
  10567. * into `array`.
  10568. */
  10569. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  10570. value = iteratee(value);
  10571. var low = 0,
  10572. high = array == null ? 0 : array.length,
  10573. valIsNaN = value !== value,
  10574. valIsNull = value === null,
  10575. valIsSymbol = isSymbol(value),
  10576. valIsUndefined = value === undefined;
  10577. while (low < high) {
  10578. var mid = nativeFloor((low + high) / 2),
  10579. computed = iteratee(array[mid]),
  10580. othIsDefined = computed !== undefined,
  10581. othIsNull = computed === null,
  10582. othIsReflexive = computed === computed,
  10583. othIsSymbol = isSymbol(computed);
  10584. if (valIsNaN) {
  10585. var setLow = retHighest || othIsReflexive;
  10586. } else if (valIsUndefined) {
  10587. setLow = othIsReflexive && (retHighest || othIsDefined);
  10588. } else if (valIsNull) {
  10589. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  10590. } else if (valIsSymbol) {
  10591. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  10592. } else if (othIsNull || othIsSymbol) {
  10593. setLow = false;
  10594. } else {
  10595. setLow = retHighest ? (computed <= value) : (computed < value);
  10596. }
  10597. if (setLow) {
  10598. low = mid + 1;
  10599. } else {
  10600. high = mid;
  10601. }
  10602. }
  10603. return nativeMin(high, MAX_ARRAY_INDEX);
  10604. }
  10605. /**
  10606. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  10607. * support for iteratee shorthands.
  10608. *
  10609. * @private
  10610. * @param {Array} array The array to inspect.
  10611. * @param {Function} [iteratee] The iteratee invoked per element.
  10612. * @returns {Array} Returns the new duplicate free array.
  10613. */
  10614. function baseSortedUniq(array, iteratee) {
  10615. var index = -1,
  10616. length = array.length,
  10617. resIndex = 0,
  10618. result = [];
  10619. while (++index < length) {
  10620. var value = array[index],
  10621. computed = iteratee ? iteratee(value) : value;
  10622. if (!index || !eq(computed, seen)) {
  10623. var seen = computed;
  10624. result[resIndex++] = value === 0 ? 0 : value;
  10625. }
  10626. }
  10627. return result;
  10628. }
  10629. /**
  10630. * The base implementation of `_.toNumber` which doesn't ensure correct
  10631. * conversions of binary, hexadecimal, or octal string values.
  10632. *
  10633. * @private
  10634. * @param {*} value The value to process.
  10635. * @returns {number} Returns the number.
  10636. */
  10637. function baseToNumber(value) {
  10638. if (typeof value == 'number') {
  10639. return value;
  10640. }
  10641. if (isSymbol(value)) {
  10642. return NAN;
  10643. }
  10644. return +value;
  10645. }
  10646. /**
  10647. * The base implementation of `_.toString` which doesn't convert nullish
  10648. * values to empty strings.
  10649. *
  10650. * @private
  10651. * @param {*} value The value to process.
  10652. * @returns {string} Returns the string.
  10653. */
  10654. function baseToString(value) {
  10655. // Exit early for strings to avoid a performance hit in some environments.
  10656. if (typeof value == 'string') {
  10657. return value;
  10658. }
  10659. if (isArray(value)) {
  10660. // Recursively convert values (susceptible to call stack limits).
  10661. return arrayMap(value, baseToString) + '';
  10662. }
  10663. if (isSymbol(value)) {
  10664. return symbolToString ? symbolToString.call(value) : '';
  10665. }
  10666. var result = (value + '');
  10667. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  10668. }
  10669. /**
  10670. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  10671. *
  10672. * @private
  10673. * @param {Array} array The array to inspect.
  10674. * @param {Function} [iteratee] The iteratee invoked per element.
  10675. * @param {Function} [comparator] The comparator invoked per element.
  10676. * @returns {Array} Returns the new duplicate free array.
  10677. */
  10678. function baseUniq(array, iteratee, comparator) {
  10679. var index = -1,
  10680. includes = arrayIncludes,
  10681. length = array.length,
  10682. isCommon = true,
  10683. result = [],
  10684. seen = result;
  10685. if (comparator) {
  10686. isCommon = false;
  10687. includes = arrayIncludesWith;
  10688. }
  10689. else if (length >= LARGE_ARRAY_SIZE) {
  10690. var set = iteratee ? null : createSet(array);
  10691. if (set) {
  10692. return setToArray(set);
  10693. }
  10694. isCommon = false;
  10695. includes = cacheHas;
  10696. seen = new SetCache;
  10697. }
  10698. else {
  10699. seen = iteratee ? [] : result;
  10700. }
  10701. outer:
  10702. while (++index < length) {
  10703. var value = array[index],
  10704. computed = iteratee ? iteratee(value) : value;
  10705. value = (comparator || value !== 0) ? value : 0;
  10706. if (isCommon && computed === computed) {
  10707. var seenIndex = seen.length;
  10708. while (seenIndex--) {
  10709. if (seen[seenIndex] === computed) {
  10710. continue outer;
  10711. }
  10712. }
  10713. if (iteratee) {
  10714. seen.push(computed);
  10715. }
  10716. result.push(value);
  10717. }
  10718. else if (!includes(seen, computed, comparator)) {
  10719. if (seen !== result) {
  10720. seen.push(computed);
  10721. }
  10722. result.push(value);
  10723. }
  10724. }
  10725. return result;
  10726. }
  10727. /**
  10728. * The base implementation of `_.unset`.
  10729. *
  10730. * @private
  10731. * @param {Object} object The object to modify.
  10732. * @param {Array|string} path The property path to unset.
  10733. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  10734. */
  10735. function baseUnset(object, path) {
  10736. path = castPath(path, object);
  10737. object = parent(object, path);
  10738. return object == null || delete object[toKey(last(path))];
  10739. }
  10740. /**
  10741. * The base implementation of `_.update`.
  10742. *
  10743. * @private
  10744. * @param {Object} object The object to modify.
  10745. * @param {Array|string} path The path of the property to update.
  10746. * @param {Function} updater The function to produce the updated value.
  10747. * @param {Function} [customizer] The function to customize path creation.
  10748. * @returns {Object} Returns `object`.
  10749. */
  10750. function baseUpdate(object, path, updater, customizer) {
  10751. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  10752. }
  10753. /**
  10754. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  10755. * without support for iteratee shorthands.
  10756. *
  10757. * @private
  10758. * @param {Array} array The array to query.
  10759. * @param {Function} predicate The function invoked per iteration.
  10760. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  10761. * @param {boolean} [fromRight] Specify iterating from right to left.
  10762. * @returns {Array} Returns the slice of `array`.
  10763. */
  10764. function baseWhile(array, predicate, isDrop, fromRight) {
  10765. var length = array.length,
  10766. index = fromRight ? length : -1;
  10767. while ((fromRight ? index-- : ++index < length) &&
  10768. predicate(array[index], index, array)) {}
  10769. return isDrop
  10770. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  10771. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  10772. }
  10773. /**
  10774. * The base implementation of `wrapperValue` which returns the result of
  10775. * performing a sequence of actions on the unwrapped `value`, where each
  10776. * successive action is supplied the return value of the previous.
  10777. *
  10778. * @private
  10779. * @param {*} value The unwrapped value.
  10780. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  10781. * @returns {*} Returns the resolved value.
  10782. */
  10783. function baseWrapperValue(value, actions) {
  10784. var result = value;
  10785. if (result instanceof LazyWrapper) {
  10786. result = result.value();
  10787. }
  10788. return arrayReduce(actions, function(result, action) {
  10789. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  10790. }, result);
  10791. }
  10792. /**
  10793. * The base implementation of methods like `_.xor`, without support for
  10794. * iteratee shorthands, that accepts an array of arrays to inspect.
  10795. *
  10796. * @private
  10797. * @param {Array} arrays The arrays to inspect.
  10798. * @param {Function} [iteratee] The iteratee invoked per element.
  10799. * @param {Function} [comparator] The comparator invoked per element.
  10800. * @returns {Array} Returns the new array of values.
  10801. */
  10802. function baseXor(arrays, iteratee, comparator) {
  10803. var length = arrays.length;
  10804. if (length < 2) {
  10805. return length ? baseUniq(arrays[0]) : [];
  10806. }
  10807. var index = -1,
  10808. result = Array(length);
  10809. while (++index < length) {
  10810. var array = arrays[index],
  10811. othIndex = -1;
  10812. while (++othIndex < length) {
  10813. if (othIndex != index) {
  10814. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  10815. }
  10816. }
  10817. }
  10818. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  10819. }
  10820. /**
  10821. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  10822. *
  10823. * @private
  10824. * @param {Array} props The property identifiers.
  10825. * @param {Array} values The property values.
  10826. * @param {Function} assignFunc The function to assign values.
  10827. * @returns {Object} Returns the new object.
  10828. */
  10829. function baseZipObject(props, values, assignFunc) {
  10830. var index = -1,
  10831. length = props.length,
  10832. valsLength = values.length,
  10833. result = {};
  10834. while (++index < length) {
  10835. var value = index < valsLength ? values[index] : undefined;
  10836. assignFunc(result, props[index], value);
  10837. }
  10838. return result;
  10839. }
  10840. /**
  10841. * Casts `value` to an empty array if it's not an array like object.
  10842. *
  10843. * @private
  10844. * @param {*} value The value to inspect.
  10845. * @returns {Array|Object} Returns the cast array-like object.
  10846. */
  10847. function castArrayLikeObject(value) {
  10848. return isArrayLikeObject(value) ? value : [];
  10849. }
  10850. /**
  10851. * Casts `value` to `identity` if it's not a function.
  10852. *
  10853. * @private
  10854. * @param {*} value The value to inspect.
  10855. * @returns {Function} Returns cast function.
  10856. */
  10857. function castFunction(value) {
  10858. return typeof value == 'function' ? value : identity;
  10859. }
  10860. /**
  10861. * Casts `value` to a path array if it's not one.
  10862. *
  10863. * @private
  10864. * @param {*} value The value to inspect.
  10865. * @param {Object} [object] The object to query keys on.
  10866. * @returns {Array} Returns the cast property path array.
  10867. */
  10868. function castPath(value, object) {
  10869. if (isArray(value)) {
  10870. return value;
  10871. }
  10872. return isKey(value, object) ? [value] : stringToPath(toString(value));
  10873. }
  10874. /**
  10875. * A `baseRest` alias which can be replaced with `identity` by module
  10876. * replacement plugins.
  10877. *
  10878. * @private
  10879. * @type {Function}
  10880. * @param {Function} func The function to apply a rest parameter to.
  10881. * @returns {Function} Returns the new function.
  10882. */
  10883. var castRest = baseRest;
  10884. /**
  10885. * Casts `array` to a slice if it's needed.
  10886. *
  10887. * @private
  10888. * @param {Array} array The array to inspect.
  10889. * @param {number} start The start position.
  10890. * @param {number} [end=array.length] The end position.
  10891. * @returns {Array} Returns the cast slice.
  10892. */
  10893. function castSlice(array, start, end) {
  10894. var length = array.length;
  10895. end = end === undefined ? length : end;
  10896. return (!start && end >= length) ? array : baseSlice(array, start, end);
  10897. }
  10898. /**
  10899. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  10900. *
  10901. * @private
  10902. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  10903. */
  10904. var clearTimeout = ctxClearTimeout || function(id) {
  10905. return root.clearTimeout(id);
  10906. };
  10907. /**
  10908. * Creates a clone of `buffer`.
  10909. *
  10910. * @private
  10911. * @param {Buffer} buffer The buffer to clone.
  10912. * @param {boolean} [isDeep] Specify a deep clone.
  10913. * @returns {Buffer} Returns the cloned buffer.
  10914. */
  10915. function cloneBuffer(buffer, isDeep) {
  10916. if (isDeep) {
  10917. return buffer.slice();
  10918. }
  10919. var length = buffer.length,
  10920. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  10921. buffer.copy(result);
  10922. return result;
  10923. }
  10924. /**
  10925. * Creates a clone of `arrayBuffer`.
  10926. *
  10927. * @private
  10928. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  10929. * @returns {ArrayBuffer} Returns the cloned array buffer.
  10930. */
  10931. function cloneArrayBuffer(arrayBuffer) {
  10932. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  10933. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  10934. return result;
  10935. }
  10936. /**
  10937. * Creates a clone of `dataView`.
  10938. *
  10939. * @private
  10940. * @param {Object} dataView The data view to clone.
  10941. * @param {boolean} [isDeep] Specify a deep clone.
  10942. * @returns {Object} Returns the cloned data view.
  10943. */
  10944. function cloneDataView(dataView, isDeep) {
  10945. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  10946. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  10947. }
  10948. /**
  10949. * Creates a clone of `regexp`.
  10950. *
  10951. * @private
  10952. * @param {Object} regexp The regexp to clone.
  10953. * @returns {Object} Returns the cloned regexp.
  10954. */
  10955. function cloneRegExp(regexp) {
  10956. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  10957. result.lastIndex = regexp.lastIndex;
  10958. return result;
  10959. }
  10960. /**
  10961. * Creates a clone of the `symbol` object.
  10962. *
  10963. * @private
  10964. * @param {Object} symbol The symbol object to clone.
  10965. * @returns {Object} Returns the cloned symbol object.
  10966. */
  10967. function cloneSymbol(symbol) {
  10968. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  10969. }
  10970. /**
  10971. * Creates a clone of `typedArray`.
  10972. *
  10973. * @private
  10974. * @param {Object} typedArray The typed array to clone.
  10975. * @param {boolean} [isDeep] Specify a deep clone.
  10976. * @returns {Object} Returns the cloned typed array.
  10977. */
  10978. function cloneTypedArray(typedArray, isDeep) {
  10979. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  10980. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  10981. }
  10982. /**
  10983. * Compares values to sort them in ascending order.
  10984. *
  10985. * @private
  10986. * @param {*} value The value to compare.
  10987. * @param {*} other The other value to compare.
  10988. * @returns {number} Returns the sort order indicator for `value`.
  10989. */
  10990. function compareAscending(value, other) {
  10991. if (value !== other) {
  10992. var valIsDefined = value !== undefined,
  10993. valIsNull = value === null,
  10994. valIsReflexive = value === value,
  10995. valIsSymbol = isSymbol(value);
  10996. var othIsDefined = other !== undefined,
  10997. othIsNull = other === null,
  10998. othIsReflexive = other === other,
  10999. othIsSymbol = isSymbol(other);
  11000. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  11001. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  11002. (valIsNull && othIsDefined && othIsReflexive) ||
  11003. (!valIsDefined && othIsReflexive) ||
  11004. !valIsReflexive) {
  11005. return 1;
  11006. }
  11007. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  11008. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  11009. (othIsNull && valIsDefined && valIsReflexive) ||
  11010. (!othIsDefined && valIsReflexive) ||
  11011. !othIsReflexive) {
  11012. return -1;
  11013. }
  11014. }
  11015. return 0;
  11016. }
  11017. /**
  11018. * Used by `_.orderBy` to compare multiple properties of a value to another
  11019. * and stable sort them.
  11020. *
  11021. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  11022. * specify an order of "desc" for descending or "asc" for ascending sort order
  11023. * of corresponding values.
  11024. *
  11025. * @private
  11026. * @param {Object} object The object to compare.
  11027. * @param {Object} other The other object to compare.
  11028. * @param {boolean[]|string[]} orders The order to sort by for each property.
  11029. * @returns {number} Returns the sort order indicator for `object`.
  11030. */
  11031. function compareMultiple(object, other, orders) {
  11032. var index = -1,
  11033. objCriteria = object.criteria,
  11034. othCriteria = other.criteria,
  11035. length = objCriteria.length,
  11036. ordersLength = orders.length;
  11037. while (++index < length) {
  11038. var result = compareAscending(objCriteria[index], othCriteria[index]);
  11039. if (result) {
  11040. if (index >= ordersLength) {
  11041. return result;
  11042. }
  11043. var order = orders[index];
  11044. return result * (order == 'desc' ? -1 : 1);
  11045. }
  11046. }
  11047. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  11048. // that causes it, under certain circumstances, to provide the same value for
  11049. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  11050. // for more details.
  11051. //
  11052. // This also ensures a stable sort in V8 and other engines.
  11053. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  11054. return object.index - other.index;
  11055. }
  11056. /**
  11057. * Creates an array that is the composition of partially applied arguments,
  11058. * placeholders, and provided arguments into a single array of arguments.
  11059. *
  11060. * @private
  11061. * @param {Array} args The provided arguments.
  11062. * @param {Array} partials The arguments to prepend to those provided.
  11063. * @param {Array} holders The `partials` placeholder indexes.
  11064. * @params {boolean} [isCurried] Specify composing for a curried function.
  11065. * @returns {Array} Returns the new array of composed arguments.
  11066. */
  11067. function composeArgs(args, partials, holders, isCurried) {
  11068. var argsIndex = -1,
  11069. argsLength = args.length,
  11070. holdersLength = holders.length,
  11071. leftIndex = -1,
  11072. leftLength = partials.length,
  11073. rangeLength = nativeMax(argsLength - holdersLength, 0),
  11074. result = Array(leftLength + rangeLength),
  11075. isUncurried = !isCurried;
  11076. while (++leftIndex < leftLength) {
  11077. result[leftIndex] = partials[leftIndex];
  11078. }
  11079. while (++argsIndex < holdersLength) {
  11080. if (isUncurried || argsIndex < argsLength) {
  11081. result[holders[argsIndex]] = args[argsIndex];
  11082. }
  11083. }
  11084. while (rangeLength--) {
  11085. result[leftIndex++] = args[argsIndex++];
  11086. }
  11087. return result;
  11088. }
  11089. /**
  11090. * This function is like `composeArgs` except that the arguments composition
  11091. * is tailored for `_.partialRight`.
  11092. *
  11093. * @private
  11094. * @param {Array} args The provided arguments.
  11095. * @param {Array} partials The arguments to append to those provided.
  11096. * @param {Array} holders The `partials` placeholder indexes.
  11097. * @params {boolean} [isCurried] Specify composing for a curried function.
  11098. * @returns {Array} Returns the new array of composed arguments.
  11099. */
  11100. function composeArgsRight(args, partials, holders, isCurried) {
  11101. var argsIndex = -1,
  11102. argsLength = args.length,
  11103. holdersIndex = -1,
  11104. holdersLength = holders.length,
  11105. rightIndex = -1,
  11106. rightLength = partials.length,
  11107. rangeLength = nativeMax(argsLength - holdersLength, 0),
  11108. result = Array(rangeLength + rightLength),
  11109. isUncurried = !isCurried;
  11110. while (++argsIndex < rangeLength) {
  11111. result[argsIndex] = args[argsIndex];
  11112. }
  11113. var offset = argsIndex;
  11114. while (++rightIndex < rightLength) {
  11115. result[offset + rightIndex] = partials[rightIndex];
  11116. }
  11117. while (++holdersIndex < holdersLength) {
  11118. if (isUncurried || argsIndex < argsLength) {
  11119. result[offset + holders[holdersIndex]] = args[argsIndex++];
  11120. }
  11121. }
  11122. return result;
  11123. }
  11124. /**
  11125. * Copies the values of `source` to `array`.
  11126. *
  11127. * @private
  11128. * @param {Array} source The array to copy values from.
  11129. * @param {Array} [array=[]] The array to copy values to.
  11130. * @returns {Array} Returns `array`.
  11131. */
  11132. function copyArray(source, array) {
  11133. var index = -1,
  11134. length = source.length;
  11135. array || (array = Array(length));
  11136. while (++index < length) {
  11137. array[index] = source[index];
  11138. }
  11139. return array;
  11140. }
  11141. /**
  11142. * Copies properties of `source` to `object`.
  11143. *
  11144. * @private
  11145. * @param {Object} source The object to copy properties from.
  11146. * @param {Array} props The property identifiers to copy.
  11147. * @param {Object} [object={}] The object to copy properties to.
  11148. * @param {Function} [customizer] The function to customize copied values.
  11149. * @returns {Object} Returns `object`.
  11150. */
  11151. function copyObject(source, props, object, customizer) {
  11152. var isNew = !object;
  11153. object || (object = {});
  11154. var index = -1,
  11155. length = props.length;
  11156. while (++index < length) {
  11157. var key = props[index];
  11158. var newValue = customizer
  11159. ? customizer(object[key], source[key], key, object, source)
  11160. : undefined;
  11161. if (newValue === undefined) {
  11162. newValue = source[key];
  11163. }
  11164. if (isNew) {
  11165. baseAssignValue(object, key, newValue);
  11166. } else {
  11167. assignValue(object, key, newValue);
  11168. }
  11169. }
  11170. return object;
  11171. }
  11172. /**
  11173. * Copies own symbols of `source` to `object`.
  11174. *
  11175. * @private
  11176. * @param {Object} source The object to copy symbols from.
  11177. * @param {Object} [object={}] The object to copy symbols to.
  11178. * @returns {Object} Returns `object`.
  11179. */
  11180. function copySymbols(source, object) {
  11181. return copyObject(source, getSymbols(source), object);
  11182. }
  11183. /**
  11184. * Copies own and inherited symbols of `source` to `object`.
  11185. *
  11186. * @private
  11187. * @param {Object} source The object to copy symbols from.
  11188. * @param {Object} [object={}] The object to copy symbols to.
  11189. * @returns {Object} Returns `object`.
  11190. */
  11191. function copySymbolsIn(source, object) {
  11192. return copyObject(source, getSymbolsIn(source), object);
  11193. }
  11194. /**
  11195. * Creates a function like `_.groupBy`.
  11196. *
  11197. * @private
  11198. * @param {Function} setter The function to set accumulator values.
  11199. * @param {Function} [initializer] The accumulator object initializer.
  11200. * @returns {Function} Returns the new aggregator function.
  11201. */
  11202. function createAggregator(setter, initializer) {
  11203. return function(collection, iteratee) {
  11204. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  11205. accumulator = initializer ? initializer() : {};
  11206. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  11207. };
  11208. }
  11209. /**
  11210. * Creates a function like `_.assign`.
  11211. *
  11212. * @private
  11213. * @param {Function} assigner The function to assign values.
  11214. * @returns {Function} Returns the new assigner function.
  11215. */
  11216. function createAssigner(assigner) {
  11217. return baseRest(function(object, sources) {
  11218. var index = -1,
  11219. length = sources.length,
  11220. customizer = length > 1 ? sources[length - 1] : undefined,
  11221. guard = length > 2 ? sources[2] : undefined;
  11222. customizer = (assigner.length > 3 && typeof customizer == 'function')
  11223. ? (length--, customizer)
  11224. : undefined;
  11225. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  11226. customizer = length < 3 ? undefined : customizer;
  11227. length = 1;
  11228. }
  11229. object = Object(object);
  11230. while (++index < length) {
  11231. var source = sources[index];
  11232. if (source) {
  11233. assigner(object, source, index, customizer);
  11234. }
  11235. }
  11236. return object;
  11237. });
  11238. }
  11239. /**
  11240. * Creates a `baseEach` or `baseEachRight` function.
  11241. *
  11242. * @private
  11243. * @param {Function} eachFunc The function to iterate over a collection.
  11244. * @param {boolean} [fromRight] Specify iterating from right to left.
  11245. * @returns {Function} Returns the new base function.
  11246. */
  11247. function createBaseEach(eachFunc, fromRight) {
  11248. return function(collection, iteratee) {
  11249. if (collection == null) {
  11250. return collection;
  11251. }
  11252. if (!isArrayLike(collection)) {
  11253. return eachFunc(collection, iteratee);
  11254. }
  11255. var length = collection.length,
  11256. index = fromRight ? length : -1,
  11257. iterable = Object(collection);
  11258. while ((fromRight ? index-- : ++index < length)) {
  11259. if (iteratee(iterable[index], index, iterable) === false) {
  11260. break;
  11261. }
  11262. }
  11263. return collection;
  11264. };
  11265. }
  11266. /**
  11267. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  11268. *
  11269. * @private
  11270. * @param {boolean} [fromRight] Specify iterating from right to left.
  11271. * @returns {Function} Returns the new base function.
  11272. */
  11273. function createBaseFor(fromRight) {
  11274. return function(object, iteratee, keysFunc) {
  11275. var index = -1,
  11276. iterable = Object(object),
  11277. props = keysFunc(object),
  11278. length = props.length;
  11279. while (length--) {
  11280. var key = props[fromRight ? length : ++index];
  11281. if (iteratee(iterable[key], key, iterable) === false) {
  11282. break;
  11283. }
  11284. }
  11285. return object;
  11286. };
  11287. }
  11288. /**
  11289. * Creates a function that wraps `func` to invoke it with the optional `this`
  11290. * binding of `thisArg`.
  11291. *
  11292. * @private
  11293. * @param {Function} func The function to wrap.
  11294. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  11295. * @param {*} [thisArg] The `this` binding of `func`.
  11296. * @returns {Function} Returns the new wrapped function.
  11297. */
  11298. function createBind(func, bitmask, thisArg) {
  11299. var isBind = bitmask & WRAP_BIND_FLAG,
  11300. Ctor = createCtor(func);
  11301. function wrapper() {
  11302. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  11303. return fn.apply(isBind ? thisArg : this, arguments);
  11304. }
  11305. return wrapper;
  11306. }
  11307. /**
  11308. * Creates a function like `_.lowerFirst`.
  11309. *
  11310. * @private
  11311. * @param {string} methodName The name of the `String` case method to use.
  11312. * @returns {Function} Returns the new case function.
  11313. */
  11314. function createCaseFirst(methodName) {
  11315. return function(string) {
  11316. string = toString(string);
  11317. var strSymbols = hasUnicode(string)
  11318. ? stringToArray(string)
  11319. : undefined;
  11320. var chr = strSymbols
  11321. ? strSymbols[0]
  11322. : string.charAt(0);
  11323. var trailing = strSymbols
  11324. ? castSlice(strSymbols, 1).join('')
  11325. : string.slice(1);
  11326. return chr[methodName]() + trailing;
  11327. };
  11328. }
  11329. /**
  11330. * Creates a function like `_.camelCase`.
  11331. *
  11332. * @private
  11333. * @param {Function} callback The function to combine each word.
  11334. * @returns {Function} Returns the new compounder function.
  11335. */
  11336. function createCompounder(callback) {
  11337. return function(string) {
  11338. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  11339. };
  11340. }
  11341. /**
  11342. * Creates a function that produces an instance of `Ctor` regardless of
  11343. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  11344. *
  11345. * @private
  11346. * @param {Function} Ctor The constructor to wrap.
  11347. * @returns {Function} Returns the new wrapped function.
  11348. */
  11349. function createCtor(Ctor) {
  11350. return function() {
  11351. // Use a `switch` statement to work with class constructors. See
  11352. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  11353. // for more details.
  11354. var args = arguments;
  11355. switch (args.length) {
  11356. case 0: return new Ctor;
  11357. case 1: return new Ctor(args[0]);
  11358. case 2: return new Ctor(args[0], args[1]);
  11359. case 3: return new Ctor(args[0], args[1], args[2]);
  11360. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  11361. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  11362. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  11363. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  11364. }
  11365. var thisBinding = baseCreate(Ctor.prototype),
  11366. result = Ctor.apply(thisBinding, args);
  11367. // Mimic the constructor's `return` behavior.
  11368. // See https://es5.github.io/#x13.2.2 for more details.
  11369. return isObject(result) ? result : thisBinding;
  11370. };
  11371. }
  11372. /**
  11373. * Creates a function that wraps `func` to enable currying.
  11374. *
  11375. * @private
  11376. * @param {Function} func The function to wrap.
  11377. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  11378. * @param {number} arity The arity of `func`.
  11379. * @returns {Function} Returns the new wrapped function.
  11380. */
  11381. function createCurry(func, bitmask, arity) {
  11382. var Ctor = createCtor(func);
  11383. function wrapper() {
  11384. var length = arguments.length,
  11385. args = Array(length),
  11386. index = length,
  11387. placeholder = getHolder(wrapper);
  11388. while (index--) {
  11389. args[index] = arguments[index];
  11390. }
  11391. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  11392. ? []
  11393. : replaceHolders(args, placeholder);
  11394. length -= holders.length;
  11395. if (length < arity) {
  11396. return createRecurry(
  11397. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  11398. args, holders, undefined, undefined, arity - length);
  11399. }
  11400. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  11401. return apply(fn, this, args);
  11402. }
  11403. return wrapper;
  11404. }
  11405. /**
  11406. * Creates a `_.find` or `_.findLast` function.
  11407. *
  11408. * @private
  11409. * @param {Function} findIndexFunc The function to find the collection index.
  11410. * @returns {Function} Returns the new find function.
  11411. */
  11412. function createFind(findIndexFunc) {
  11413. return function(collection, predicate, fromIndex) {
  11414. var iterable = Object(collection);
  11415. if (!isArrayLike(collection)) {
  11416. var iteratee = getIteratee(predicate, 3);
  11417. collection = keys(collection);
  11418. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  11419. }
  11420. var index = findIndexFunc(collection, predicate, fromIndex);
  11421. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  11422. };
  11423. }
  11424. /**
  11425. * Creates a `_.flow` or `_.flowRight` function.
  11426. *
  11427. * @private
  11428. * @param {boolean} [fromRight] Specify iterating from right to left.
  11429. * @returns {Function} Returns the new flow function.
  11430. */
  11431. function createFlow(fromRight) {
  11432. return flatRest(function(funcs) {
  11433. var length = funcs.length,
  11434. index = length,
  11435. prereq = LodashWrapper.prototype.thru;
  11436. if (fromRight) {
  11437. funcs.reverse();
  11438. }
  11439. while (index--) {
  11440. var func = funcs[index];
  11441. if (typeof func != 'function') {
  11442. throw new TypeError(FUNC_ERROR_TEXT);
  11443. }
  11444. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  11445. var wrapper = new LodashWrapper([], true);
  11446. }
  11447. }
  11448. index = wrapper ? index : length;
  11449. while (++index < length) {
  11450. func = funcs[index];
  11451. var funcName = getFuncName(func),
  11452. data = funcName == 'wrapper' ? getData(func) : undefined;
  11453. if (data && isLaziable(data[0]) &&
  11454. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  11455. !data[4].length && data[9] == 1
  11456. ) {
  11457. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  11458. } else {
  11459. wrapper = (func.length == 1 && isLaziable(func))
  11460. ? wrapper[funcName]()
  11461. : wrapper.thru(func);
  11462. }
  11463. }
  11464. return function() {
  11465. var args = arguments,
  11466. value = args[0];
  11467. if (wrapper && args.length == 1 && isArray(value)) {
  11468. return wrapper.plant(value).value();
  11469. }
  11470. var index = 0,
  11471. result = length ? funcs[index].apply(this, args) : value;
  11472. while (++index < length) {
  11473. result = funcs[index].call(this, result);
  11474. }
  11475. return result;
  11476. };
  11477. });
  11478. }
  11479. /**
  11480. * Creates a function that wraps `func` to invoke it with optional `this`
  11481. * binding of `thisArg`, partial application, and currying.
  11482. *
  11483. * @private
  11484. * @param {Function|string} func The function or method name to wrap.
  11485. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  11486. * @param {*} [thisArg] The `this` binding of `func`.
  11487. * @param {Array} [partials] The arguments to prepend to those provided to
  11488. * the new function.
  11489. * @param {Array} [holders] The `partials` placeholder indexes.
  11490. * @param {Array} [partialsRight] The arguments to append to those provided
  11491. * to the new function.
  11492. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  11493. * @param {Array} [argPos] The argument positions of the new function.
  11494. * @param {number} [ary] The arity cap of `func`.
  11495. * @param {number} [arity] The arity of `func`.
  11496. * @returns {Function} Returns the new wrapped function.
  11497. */
  11498. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  11499. var isAry = bitmask & WRAP_ARY_FLAG,
  11500. isBind = bitmask & WRAP_BIND_FLAG,
  11501. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  11502. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  11503. isFlip = bitmask & WRAP_FLIP_FLAG,
  11504. Ctor = isBindKey ? undefined : createCtor(func);
  11505. function wrapper() {
  11506. var length = arguments.length,
  11507. args = Array(length),
  11508. index = length;
  11509. while (index--) {
  11510. args[index] = arguments[index];
  11511. }
  11512. if (isCurried) {
  11513. var placeholder = getHolder(wrapper),
  11514. holdersCount = countHolders(args, placeholder);
  11515. }
  11516. if (partials) {
  11517. args = composeArgs(args, partials, holders, isCurried);
  11518. }
  11519. if (partialsRight) {
  11520. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  11521. }
  11522. length -= holdersCount;
  11523. if (isCurried && length < arity) {
  11524. var newHolders = replaceHolders(args, placeholder);
  11525. return createRecurry(
  11526. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  11527. args, newHolders, argPos, ary, arity - length
  11528. );
  11529. }
  11530. var thisBinding = isBind ? thisArg : this,
  11531. fn = isBindKey ? thisBinding[func] : func;
  11532. length = args.length;
  11533. if (argPos) {
  11534. args = reorder(args, argPos);
  11535. } else if (isFlip && length > 1) {
  11536. args.reverse();
  11537. }
  11538. if (isAry && ary < length) {
  11539. args.length = ary;
  11540. }
  11541. if (this && this !== root && this instanceof wrapper) {
  11542. fn = Ctor || createCtor(fn);
  11543. }
  11544. return fn.apply(thisBinding, args);
  11545. }
  11546. return wrapper;
  11547. }
  11548. /**
  11549. * Creates a function like `_.invertBy`.
  11550. *
  11551. * @private
  11552. * @param {Function} setter The function to set accumulator values.
  11553. * @param {Function} toIteratee The function to resolve iteratees.
  11554. * @returns {Function} Returns the new inverter function.
  11555. */
  11556. function createInverter(setter, toIteratee) {
  11557. return function(object, iteratee) {
  11558. return baseInverter(object, setter, toIteratee(iteratee), {});
  11559. };
  11560. }
  11561. /**
  11562. * Creates a function that performs a mathematical operation on two values.
  11563. *
  11564. * @private
  11565. * @param {Function} operator The function to perform the operation.
  11566. * @param {number} [defaultValue] The value used for `undefined` arguments.
  11567. * @returns {Function} Returns the new mathematical operation function.
  11568. */
  11569. function createMathOperation(operator, defaultValue) {
  11570. return function(value, other) {
  11571. var result;
  11572. if (value === undefined && other === undefined) {
  11573. return defaultValue;
  11574. }
  11575. if (value !== undefined) {
  11576. result = value;
  11577. }
  11578. if (other !== undefined) {
  11579. if (result === undefined) {
  11580. return other;
  11581. }
  11582. if (typeof value == 'string' || typeof other == 'string') {
  11583. value = baseToString(value);
  11584. other = baseToString(other);
  11585. } else {
  11586. value = baseToNumber(value);
  11587. other = baseToNumber(other);
  11588. }
  11589. result = operator(value, other);
  11590. }
  11591. return result;
  11592. };
  11593. }
  11594. /**
  11595. * Creates a function like `_.over`.
  11596. *
  11597. * @private
  11598. * @param {Function} arrayFunc The function to iterate over iteratees.
  11599. * @returns {Function} Returns the new over function.
  11600. */
  11601. function createOver(arrayFunc) {
  11602. return flatRest(function(iteratees) {
  11603. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  11604. return baseRest(function(args) {
  11605. var thisArg = this;
  11606. return arrayFunc(iteratees, function(iteratee) {
  11607. return apply(iteratee, thisArg, args);
  11608. });
  11609. });
  11610. });
  11611. }
  11612. /**
  11613. * Creates the padding for `string` based on `length`. The `chars` string
  11614. * is truncated if the number of characters exceeds `length`.
  11615. *
  11616. * @private
  11617. * @param {number} length The padding length.
  11618. * @param {string} [chars=' '] The string used as padding.
  11619. * @returns {string} Returns the padding for `string`.
  11620. */
  11621. function createPadding(length, chars) {
  11622. chars = chars === undefined ? ' ' : baseToString(chars);
  11623. var charsLength = chars.length;
  11624. if (charsLength < 2) {
  11625. return charsLength ? baseRepeat(chars, length) : chars;
  11626. }
  11627. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  11628. return hasUnicode(chars)
  11629. ? castSlice(stringToArray(result), 0, length).join('')
  11630. : result.slice(0, length);
  11631. }
  11632. /**
  11633. * Creates a function that wraps `func` to invoke it with the `this` binding
  11634. * of `thisArg` and `partials` prepended to the arguments it receives.
  11635. *
  11636. * @private
  11637. * @param {Function} func The function to wrap.
  11638. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  11639. * @param {*} thisArg The `this` binding of `func`.
  11640. * @param {Array} partials The arguments to prepend to those provided to
  11641. * the new function.
  11642. * @returns {Function} Returns the new wrapped function.
  11643. */
  11644. function createPartial(func, bitmask, thisArg, partials) {
  11645. var isBind = bitmask & WRAP_BIND_FLAG,
  11646. Ctor = createCtor(func);
  11647. function wrapper() {
  11648. var argsIndex = -1,
  11649. argsLength = arguments.length,
  11650. leftIndex = -1,
  11651. leftLength = partials.length,
  11652. args = Array(leftLength + argsLength),
  11653. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  11654. while (++leftIndex < leftLength) {
  11655. args[leftIndex] = partials[leftIndex];
  11656. }
  11657. while (argsLength--) {
  11658. args[leftIndex++] = arguments[++argsIndex];
  11659. }
  11660. return apply(fn, isBind ? thisArg : this, args);
  11661. }
  11662. return wrapper;
  11663. }
  11664. /**
  11665. * Creates a `_.range` or `_.rangeRight` function.
  11666. *
  11667. * @private
  11668. * @param {boolean} [fromRight] Specify iterating from right to left.
  11669. * @returns {Function} Returns the new range function.
  11670. */
  11671. function createRange(fromRight) {
  11672. return function(start, end, step) {
  11673. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  11674. end = step = undefined;
  11675. }
  11676. // Ensure the sign of `-0` is preserved.
  11677. start = toFinite(start);
  11678. if (end === undefined) {
  11679. end = start;
  11680. start = 0;
  11681. } else {
  11682. end = toFinite(end);
  11683. }
  11684. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  11685. return baseRange(start, end, step, fromRight);
  11686. };
  11687. }
  11688. /**
  11689. * Creates a function that performs a relational operation on two values.
  11690. *
  11691. * @private
  11692. * @param {Function} operator The function to perform the operation.
  11693. * @returns {Function} Returns the new relational operation function.
  11694. */
  11695. function createRelationalOperation(operator) {
  11696. return function(value, other) {
  11697. if (!(typeof value == 'string' && typeof other == 'string')) {
  11698. value = toNumber(value);
  11699. other = toNumber(other);
  11700. }
  11701. return operator(value, other);
  11702. };
  11703. }
  11704. /**
  11705. * Creates a function that wraps `func` to continue currying.
  11706. *
  11707. * @private
  11708. * @param {Function} func The function to wrap.
  11709. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  11710. * @param {Function} wrapFunc The function to create the `func` wrapper.
  11711. * @param {*} placeholder The placeholder value.
  11712. * @param {*} [thisArg] The `this` binding of `func`.
  11713. * @param {Array} [partials] The arguments to prepend to those provided to
  11714. * the new function.
  11715. * @param {Array} [holders] The `partials` placeholder indexes.
  11716. * @param {Array} [argPos] The argument positions of the new function.
  11717. * @param {number} [ary] The arity cap of `func`.
  11718. * @param {number} [arity] The arity of `func`.
  11719. * @returns {Function} Returns the new wrapped function.
  11720. */
  11721. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  11722. var isCurry = bitmask & WRAP_CURRY_FLAG,
  11723. newHolders = isCurry ? holders : undefined,
  11724. newHoldersRight = isCurry ? undefined : holders,
  11725. newPartials = isCurry ? partials : undefined,
  11726. newPartialsRight = isCurry ? undefined : partials;
  11727. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  11728. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  11729. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  11730. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  11731. }
  11732. var newData = [
  11733. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  11734. newHoldersRight, argPos, ary, arity
  11735. ];
  11736. var result = wrapFunc.apply(undefined, newData);
  11737. if (isLaziable(func)) {
  11738. setData(result, newData);
  11739. }
  11740. result.placeholder = placeholder;
  11741. return setWrapToString(result, func, bitmask);
  11742. }
  11743. /**
  11744. * Creates a function like `_.round`.
  11745. *
  11746. * @private
  11747. * @param {string} methodName The name of the `Math` method to use when rounding.
  11748. * @returns {Function} Returns the new round function.
  11749. */
  11750. function createRound(methodName) {
  11751. var func = Math[methodName];
  11752. return function(number, precision) {
  11753. number = toNumber(number);
  11754. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  11755. if (precision) {
  11756. // Shift with exponential notation to avoid floating-point issues.
  11757. // See [MDN](https://mdn.io/round#Examples) for more details.
  11758. var pair = (toString(number) + 'e').split('e'),
  11759. value = func(pair[0] + 'e' + (+pair[1] + precision));
  11760. pair = (toString(value) + 'e').split('e');
  11761. return +(pair[0] + 'e' + (+pair[1] - precision));
  11762. }
  11763. return func(number);
  11764. };
  11765. }
  11766. /**
  11767. * Creates a set object of `values`.
  11768. *
  11769. * @private
  11770. * @param {Array} values The values to add to the set.
  11771. * @returns {Object} Returns the new set.
  11772. */
  11773. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  11774. return new Set(values);
  11775. };
  11776. /**
  11777. * Creates a `_.toPairs` or `_.toPairsIn` function.
  11778. *
  11779. * @private
  11780. * @param {Function} keysFunc The function to get the keys of a given object.
  11781. * @returns {Function} Returns the new pairs function.
  11782. */
  11783. function createToPairs(keysFunc) {
  11784. return function(object) {
  11785. var tag = getTag(object);
  11786. if (tag == mapTag) {
  11787. return mapToArray(object);
  11788. }
  11789. if (tag == setTag) {
  11790. return setToPairs(object);
  11791. }
  11792. return baseToPairs(object, keysFunc(object));
  11793. };
  11794. }
  11795. /**
  11796. * Creates a function that either curries or invokes `func` with optional
  11797. * `this` binding and partially applied arguments.
  11798. *
  11799. * @private
  11800. * @param {Function|string} func The function or method name to wrap.
  11801. * @param {number} bitmask The bitmask flags.
  11802. * 1 - `_.bind`
  11803. * 2 - `_.bindKey`
  11804. * 4 - `_.curry` or `_.curryRight` of a bound function
  11805. * 8 - `_.curry`
  11806. * 16 - `_.curryRight`
  11807. * 32 - `_.partial`
  11808. * 64 - `_.partialRight`
  11809. * 128 - `_.rearg`
  11810. * 256 - `_.ary`
  11811. * 512 - `_.flip`
  11812. * @param {*} [thisArg] The `this` binding of `func`.
  11813. * @param {Array} [partials] The arguments to be partially applied.
  11814. * @param {Array} [holders] The `partials` placeholder indexes.
  11815. * @param {Array} [argPos] The argument positions of the new function.
  11816. * @param {number} [ary] The arity cap of `func`.
  11817. * @param {number} [arity] The arity of `func`.
  11818. * @returns {Function} Returns the new wrapped function.
  11819. */
  11820. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  11821. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  11822. if (!isBindKey && typeof func != 'function') {
  11823. throw new TypeError(FUNC_ERROR_TEXT);
  11824. }
  11825. var length = partials ? partials.length : 0;
  11826. if (!length) {
  11827. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  11828. partials = holders = undefined;
  11829. }
  11830. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  11831. arity = arity === undefined ? arity : toInteger(arity);
  11832. length -= holders ? holders.length : 0;
  11833. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  11834. var partialsRight = partials,
  11835. holdersRight = holders;
  11836. partials = holders = undefined;
  11837. }
  11838. var data = isBindKey ? undefined : getData(func);
  11839. var newData = [
  11840. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  11841. argPos, ary, arity
  11842. ];
  11843. if (data) {
  11844. mergeData(newData, data);
  11845. }
  11846. func = newData[0];
  11847. bitmask = newData[1];
  11848. thisArg = newData[2];
  11849. partials = newData[3];
  11850. holders = newData[4];
  11851. arity = newData[9] = newData[9] === undefined
  11852. ? (isBindKey ? 0 : func.length)
  11853. : nativeMax(newData[9] - length, 0);
  11854. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  11855. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  11856. }
  11857. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  11858. var result = createBind(func, bitmask, thisArg);
  11859. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  11860. result = createCurry(func, bitmask, arity);
  11861. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  11862. result = createPartial(func, bitmask, thisArg, partials);
  11863. } else {
  11864. result = createHybrid.apply(undefined, newData);
  11865. }
  11866. var setter = data ? baseSetData : setData;
  11867. return setWrapToString(setter(result, newData), func, bitmask);
  11868. }
  11869. /**
  11870. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  11871. * of source objects to the destination object for all destination properties
  11872. * that resolve to `undefined`.
  11873. *
  11874. * @private
  11875. * @param {*} objValue The destination value.
  11876. * @param {*} srcValue The source value.
  11877. * @param {string} key The key of the property to assign.
  11878. * @param {Object} object The parent object of `objValue`.
  11879. * @returns {*} Returns the value to assign.
  11880. */
  11881. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  11882. if (objValue === undefined ||
  11883. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  11884. return srcValue;
  11885. }
  11886. return objValue;
  11887. }
  11888. /**
  11889. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  11890. * objects into destination objects that are passed thru.
  11891. *
  11892. * @private
  11893. * @param {*} objValue The destination value.
  11894. * @param {*} srcValue The source value.
  11895. * @param {string} key The key of the property to merge.
  11896. * @param {Object} object The parent object of `objValue`.
  11897. * @param {Object} source The parent object of `srcValue`.
  11898. * @param {Object} [stack] Tracks traversed source values and their merged
  11899. * counterparts.
  11900. * @returns {*} Returns the value to assign.
  11901. */
  11902. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  11903. if (isObject(objValue) && isObject(srcValue)) {
  11904. // Recursively merge objects and arrays (susceptible to call stack limits).
  11905. stack.set(srcValue, objValue);
  11906. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  11907. stack['delete'](srcValue);
  11908. }
  11909. return objValue;
  11910. }
  11911. /**
  11912. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  11913. * objects.
  11914. *
  11915. * @private
  11916. * @param {*} value The value to inspect.
  11917. * @param {string} key The key of the property to inspect.
  11918. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  11919. */
  11920. function customOmitClone(value) {
  11921. return isPlainObject(value) ? undefined : value;
  11922. }
  11923. /**
  11924. * A specialized version of `baseIsEqualDeep` for arrays with support for
  11925. * partial deep comparisons.
  11926. *
  11927. * @private
  11928. * @param {Array} array The array to compare.
  11929. * @param {Array} other The other array to compare.
  11930. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  11931. * @param {Function} customizer The function to customize comparisons.
  11932. * @param {Function} equalFunc The function to determine equivalents of values.
  11933. * @param {Object} stack Tracks traversed `array` and `other` objects.
  11934. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  11935. */
  11936. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  11937. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  11938. arrLength = array.length,
  11939. othLength = other.length;
  11940. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  11941. return false;
  11942. }
  11943. // Assume cyclic values are equal.
  11944. var stacked = stack.get(array);
  11945. if (stacked && stack.get(other)) {
  11946. return stacked == other;
  11947. }
  11948. var index = -1,
  11949. result = true,
  11950. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  11951. stack.set(array, other);
  11952. stack.set(other, array);
  11953. // Ignore non-index properties.
  11954. while (++index < arrLength) {
  11955. var arrValue = array[index],
  11956. othValue = other[index];
  11957. if (customizer) {
  11958. var compared = isPartial
  11959. ? customizer(othValue, arrValue, index, other, array, stack)
  11960. : customizer(arrValue, othValue, index, array, other, stack);
  11961. }
  11962. if (compared !== undefined) {
  11963. if (compared) {
  11964. continue;
  11965. }
  11966. result = false;
  11967. break;
  11968. }
  11969. // Recursively compare arrays (susceptible to call stack limits).
  11970. if (seen) {
  11971. if (!arraySome(other, function(othValue, othIndex) {
  11972. if (!cacheHas(seen, othIndex) &&
  11973. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  11974. return seen.push(othIndex);
  11975. }
  11976. })) {
  11977. result = false;
  11978. break;
  11979. }
  11980. } else if (!(
  11981. arrValue === othValue ||
  11982. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  11983. )) {
  11984. result = false;
  11985. break;
  11986. }
  11987. }
  11988. stack['delete'](array);
  11989. stack['delete'](other);
  11990. return result;
  11991. }
  11992. /**
  11993. * A specialized version of `baseIsEqualDeep` for comparing objects of
  11994. * the same `toStringTag`.
  11995. *
  11996. * **Note:** This function only supports comparing values with tags of
  11997. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  11998. *
  11999. * @private
  12000. * @param {Object} object The object to compare.
  12001. * @param {Object} other The other object to compare.
  12002. * @param {string} tag The `toStringTag` of the objects to compare.
  12003. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  12004. * @param {Function} customizer The function to customize comparisons.
  12005. * @param {Function} equalFunc The function to determine equivalents of values.
  12006. * @param {Object} stack Tracks traversed `object` and `other` objects.
  12007. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  12008. */
  12009. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  12010. switch (tag) {
  12011. case dataViewTag:
  12012. if ((object.byteLength != other.byteLength) ||
  12013. (object.byteOffset != other.byteOffset)) {
  12014. return false;
  12015. }
  12016. object = object.buffer;
  12017. other = other.buffer;
  12018. case arrayBufferTag:
  12019. if ((object.byteLength != other.byteLength) ||
  12020. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  12021. return false;
  12022. }
  12023. return true;
  12024. case boolTag:
  12025. case dateTag:
  12026. case numberTag:
  12027. // Coerce booleans to `1` or `0` and dates to milliseconds.
  12028. // Invalid dates are coerced to `NaN`.
  12029. return eq(+object, +other);
  12030. case errorTag:
  12031. return object.name == other.name && object.message == other.message;
  12032. case regexpTag:
  12033. case stringTag:
  12034. // Coerce regexes to strings and treat strings, primitives and objects,
  12035. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  12036. // for more details.
  12037. return object == (other + '');
  12038. case mapTag:
  12039. var convert = mapToArray;
  12040. case setTag:
  12041. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  12042. convert || (convert = setToArray);
  12043. if (object.size != other.size && !isPartial) {
  12044. return false;
  12045. }
  12046. // Assume cyclic values are equal.
  12047. var stacked = stack.get(object);
  12048. if (stacked) {
  12049. return stacked == other;
  12050. }
  12051. bitmask |= COMPARE_UNORDERED_FLAG;
  12052. // Recursively compare objects (susceptible to call stack limits).
  12053. stack.set(object, other);
  12054. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  12055. stack['delete'](object);
  12056. return result;
  12057. case symbolTag:
  12058. if (symbolValueOf) {
  12059. return symbolValueOf.call(object) == symbolValueOf.call(other);
  12060. }
  12061. }
  12062. return false;
  12063. }
  12064. /**
  12065. * A specialized version of `baseIsEqualDeep` for objects with support for
  12066. * partial deep comparisons.
  12067. *
  12068. * @private
  12069. * @param {Object} object The object to compare.
  12070. * @param {Object} other The other object to compare.
  12071. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  12072. * @param {Function} customizer The function to customize comparisons.
  12073. * @param {Function} equalFunc The function to determine equivalents of values.
  12074. * @param {Object} stack Tracks traversed `object` and `other` objects.
  12075. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  12076. */
  12077. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  12078. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  12079. objProps = getAllKeys(object),
  12080. objLength = objProps.length,
  12081. othProps = getAllKeys(other),
  12082. othLength = othProps.length;
  12083. if (objLength != othLength && !isPartial) {
  12084. return false;
  12085. }
  12086. var index = objLength;
  12087. while (index--) {
  12088. var key = objProps[index];
  12089. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  12090. return false;
  12091. }
  12092. }
  12093. // Assume cyclic values are equal.
  12094. var stacked = stack.get(object);
  12095. if (stacked && stack.get(other)) {
  12096. return stacked == other;
  12097. }
  12098. var result = true;
  12099. stack.set(object, other);
  12100. stack.set(other, object);
  12101. var skipCtor = isPartial;
  12102. while (++index < objLength) {
  12103. key = objProps[index];
  12104. var objValue = object[key],
  12105. othValue = other[key];
  12106. if (customizer) {
  12107. var compared = isPartial
  12108. ? customizer(othValue, objValue, key, other, object, stack)
  12109. : customizer(objValue, othValue, key, object, other, stack);
  12110. }
  12111. // Recursively compare objects (susceptible to call stack limits).
  12112. if (!(compared === undefined
  12113. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  12114. : compared
  12115. )) {
  12116. result = false;
  12117. break;
  12118. }
  12119. skipCtor || (skipCtor = key == 'constructor');
  12120. }
  12121. if (result && !skipCtor) {
  12122. var objCtor = object.constructor,
  12123. othCtor = other.constructor;
  12124. // Non `Object` object instances with different constructors are not equal.
  12125. if (objCtor != othCtor &&
  12126. ('constructor' in object && 'constructor' in other) &&
  12127. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  12128. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  12129. result = false;
  12130. }
  12131. }
  12132. stack['delete'](object);
  12133. stack['delete'](other);
  12134. return result;
  12135. }
  12136. /**
  12137. * A specialized version of `baseRest` which flattens the rest array.
  12138. *
  12139. * @private
  12140. * @param {Function} func The function to apply a rest parameter to.
  12141. * @returns {Function} Returns the new function.
  12142. */
  12143. function flatRest(func) {
  12144. return setToString(overRest(func, undefined, flatten), func + '');
  12145. }
  12146. /**
  12147. * Creates an array of own enumerable property names and symbols of `object`.
  12148. *
  12149. * @private
  12150. * @param {Object} object The object to query.
  12151. * @returns {Array} Returns the array of property names and symbols.
  12152. */
  12153. function getAllKeys(object) {
  12154. return baseGetAllKeys(object, keys, getSymbols);
  12155. }
  12156. /**
  12157. * Creates an array of own and inherited enumerable property names and
  12158. * symbols of `object`.
  12159. *
  12160. * @private
  12161. * @param {Object} object The object to query.
  12162. * @returns {Array} Returns the array of property names and symbols.
  12163. */
  12164. function getAllKeysIn(object) {
  12165. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  12166. }
  12167. /**
  12168. * Gets metadata for `func`.
  12169. *
  12170. * @private
  12171. * @param {Function} func The function to query.
  12172. * @returns {*} Returns the metadata for `func`.
  12173. */
  12174. var getData = !metaMap ? noop : function(func) {
  12175. return metaMap.get(func);
  12176. };
  12177. /**
  12178. * Gets the name of `func`.
  12179. *
  12180. * @private
  12181. * @param {Function} func The function to query.
  12182. * @returns {string} Returns the function name.
  12183. */
  12184. function getFuncName(func) {
  12185. var result = (func.name + ''),
  12186. array = realNames[result],
  12187. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  12188. while (length--) {
  12189. var data = array[length],
  12190. otherFunc = data.func;
  12191. if (otherFunc == null || otherFunc == func) {
  12192. return data.name;
  12193. }
  12194. }
  12195. return result;
  12196. }
  12197. /**
  12198. * Gets the argument placeholder value for `func`.
  12199. *
  12200. * @private
  12201. * @param {Function} func The function to inspect.
  12202. * @returns {*} Returns the placeholder value.
  12203. */
  12204. function getHolder(func) {
  12205. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  12206. return object.placeholder;
  12207. }
  12208. /**
  12209. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  12210. * this function returns the custom method, otherwise it returns `baseIteratee`.
  12211. * If arguments are provided, the chosen function is invoked with them and
  12212. * its result is returned.
  12213. *
  12214. * @private
  12215. * @param {*} [value] The value to convert to an iteratee.
  12216. * @param {number} [arity] The arity of the created iteratee.
  12217. * @returns {Function} Returns the chosen function or its result.
  12218. */
  12219. function getIteratee() {
  12220. var result = lodash.iteratee || iteratee;
  12221. result = result === iteratee ? baseIteratee : result;
  12222. return arguments.length ? result(arguments[0], arguments[1]) : result;
  12223. }
  12224. /**
  12225. * Gets the data for `map`.
  12226. *
  12227. * @private
  12228. * @param {Object} map The map to query.
  12229. * @param {string} key The reference key.
  12230. * @returns {*} Returns the map data.
  12231. */
  12232. function getMapData(map, key) {
  12233. var data = map.__data__;
  12234. return isKeyable(key)
  12235. ? data[typeof key == 'string' ? 'string' : 'hash']
  12236. : data.map;
  12237. }
  12238. /**
  12239. * Gets the property names, values, and compare flags of `object`.
  12240. *
  12241. * @private
  12242. * @param {Object} object The object to query.
  12243. * @returns {Array} Returns the match data of `object`.
  12244. */
  12245. function getMatchData(object) {
  12246. var result = keys(object),
  12247. length = result.length;
  12248. while (length--) {
  12249. var key = result[length],
  12250. value = object[key];
  12251. result[length] = [key, value, isStrictComparable(value)];
  12252. }
  12253. return result;
  12254. }
  12255. /**
  12256. * Gets the native function at `key` of `object`.
  12257. *
  12258. * @private
  12259. * @param {Object} object The object to query.
  12260. * @param {string} key The key of the method to get.
  12261. * @returns {*} Returns the function if it's native, else `undefined`.
  12262. */
  12263. function getNative(object, key) {
  12264. var value = getValue(object, key);
  12265. return baseIsNative(value) ? value : undefined;
  12266. }
  12267. /**
  12268. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  12269. *
  12270. * @private
  12271. * @param {*} value The value to query.
  12272. * @returns {string} Returns the raw `toStringTag`.
  12273. */
  12274. function getRawTag(value) {
  12275. var isOwn = hasOwnProperty.call(value, symToStringTag),
  12276. tag = value[symToStringTag];
  12277. try {
  12278. value[symToStringTag] = undefined;
  12279. var unmasked = true;
  12280. } catch (e) {}
  12281. var result = nativeObjectToString.call(value);
  12282. if (unmasked) {
  12283. if (isOwn) {
  12284. value[symToStringTag] = tag;
  12285. } else {
  12286. delete value[symToStringTag];
  12287. }
  12288. }
  12289. return result;
  12290. }
  12291. /**
  12292. * Creates an array of the own enumerable symbols of `object`.
  12293. *
  12294. * @private
  12295. * @param {Object} object The object to query.
  12296. * @returns {Array} Returns the array of symbols.
  12297. */
  12298. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  12299. if (object == null) {
  12300. return [];
  12301. }
  12302. object = Object(object);
  12303. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  12304. return propertyIsEnumerable.call(object, symbol);
  12305. });
  12306. };
  12307. /**
  12308. * Creates an array of the own and inherited enumerable symbols of `object`.
  12309. *
  12310. * @private
  12311. * @param {Object} object The object to query.
  12312. * @returns {Array} Returns the array of symbols.
  12313. */
  12314. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  12315. var result = [];
  12316. while (object) {
  12317. arrayPush(result, getSymbols(object));
  12318. object = getPrototype(object);
  12319. }
  12320. return result;
  12321. };
  12322. /**
  12323. * Gets the `toStringTag` of `value`.
  12324. *
  12325. * @private
  12326. * @param {*} value The value to query.
  12327. * @returns {string} Returns the `toStringTag`.
  12328. */
  12329. var getTag = baseGetTag;
  12330. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  12331. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  12332. (Map && getTag(new Map) != mapTag) ||
  12333. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  12334. (Set && getTag(new Set) != setTag) ||
  12335. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  12336. getTag = function(value) {
  12337. var result = baseGetTag(value),
  12338. Ctor = result == objectTag ? value.constructor : undefined,
  12339. ctorString = Ctor ? toSource(Ctor) : '';
  12340. if (ctorString) {
  12341. switch (ctorString) {
  12342. case dataViewCtorString: return dataViewTag;
  12343. case mapCtorString: return mapTag;
  12344. case promiseCtorString: return promiseTag;
  12345. case setCtorString: return setTag;
  12346. case weakMapCtorString: return weakMapTag;
  12347. }
  12348. }
  12349. return result;
  12350. };
  12351. }
  12352. /**
  12353. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  12354. *
  12355. * @private
  12356. * @param {number} start The start of the view.
  12357. * @param {number} end The end of the view.
  12358. * @param {Array} transforms The transformations to apply to the view.
  12359. * @returns {Object} Returns an object containing the `start` and `end`
  12360. * positions of the view.
  12361. */
  12362. function getView(start, end, transforms) {
  12363. var index = -1,
  12364. length = transforms.length;
  12365. while (++index < length) {
  12366. var data = transforms[index],
  12367. size = data.size;
  12368. switch (data.type) {
  12369. case 'drop': start += size; break;
  12370. case 'dropRight': end -= size; break;
  12371. case 'take': end = nativeMin(end, start + size); break;
  12372. case 'takeRight': start = nativeMax(start, end - size); break;
  12373. }
  12374. }
  12375. return { 'start': start, 'end': end };
  12376. }
  12377. /**
  12378. * Extracts wrapper details from the `source` body comment.
  12379. *
  12380. * @private
  12381. * @param {string} source The source to inspect.
  12382. * @returns {Array} Returns the wrapper details.
  12383. */
  12384. function getWrapDetails(source) {
  12385. var match = source.match(reWrapDetails);
  12386. return match ? match[1].split(reSplitDetails) : [];
  12387. }
  12388. /**
  12389. * Checks if `path` exists on `object`.
  12390. *
  12391. * @private
  12392. * @param {Object} object The object to query.
  12393. * @param {Array|string} path The path to check.
  12394. * @param {Function} hasFunc The function to check properties.
  12395. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  12396. */
  12397. function hasPath(object, path, hasFunc) {
  12398. path = castPath(path, object);
  12399. var index = -1,
  12400. length = path.length,
  12401. result = false;
  12402. while (++index < length) {
  12403. var key = toKey(path[index]);
  12404. if (!(result = object != null && hasFunc(object, key))) {
  12405. break;
  12406. }
  12407. object = object[key];
  12408. }
  12409. if (result || ++index != length) {
  12410. return result;
  12411. }
  12412. length = object == null ? 0 : object.length;
  12413. return !!length && isLength(length) && isIndex(key, length) &&
  12414. (isArray(object) || isArguments(object));
  12415. }
  12416. /**
  12417. * Initializes an array clone.
  12418. *
  12419. * @private
  12420. * @param {Array} array The array to clone.
  12421. * @returns {Array} Returns the initialized clone.
  12422. */
  12423. function initCloneArray(array) {
  12424. var length = array.length,
  12425. result = new array.constructor(length);
  12426. // Add properties assigned by `RegExp#exec`.
  12427. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  12428. result.index = array.index;
  12429. result.input = array.input;
  12430. }
  12431. return result;
  12432. }
  12433. /**
  12434. * Initializes an object clone.
  12435. *
  12436. * @private
  12437. * @param {Object} object The object to clone.
  12438. * @returns {Object} Returns the initialized clone.
  12439. */
  12440. function initCloneObject(object) {
  12441. return (typeof object.constructor == 'function' && !isPrototype(object))
  12442. ? baseCreate(getPrototype(object))
  12443. : {};
  12444. }
  12445. /**
  12446. * Initializes an object clone based on its `toStringTag`.
  12447. *
  12448. * **Note:** This function only supports cloning values with tags of
  12449. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  12450. *
  12451. * @private
  12452. * @param {Object} object The object to clone.
  12453. * @param {string} tag The `toStringTag` of the object to clone.
  12454. * @param {boolean} [isDeep] Specify a deep clone.
  12455. * @returns {Object} Returns the initialized clone.
  12456. */
  12457. function initCloneByTag(object, tag, isDeep) {
  12458. var Ctor = object.constructor;
  12459. switch (tag) {
  12460. case arrayBufferTag:
  12461. return cloneArrayBuffer(object);
  12462. case boolTag:
  12463. case dateTag:
  12464. return new Ctor(+object);
  12465. case dataViewTag:
  12466. return cloneDataView(object, isDeep);
  12467. case float32Tag: case float64Tag:
  12468. case int8Tag: case int16Tag: case int32Tag:
  12469. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  12470. return cloneTypedArray(object, isDeep);
  12471. case mapTag:
  12472. return new Ctor;
  12473. case numberTag:
  12474. case stringTag:
  12475. return new Ctor(object);
  12476. case regexpTag:
  12477. return cloneRegExp(object);
  12478. case setTag:
  12479. return new Ctor;
  12480. case symbolTag:
  12481. return cloneSymbol(object);
  12482. }
  12483. }
  12484. /**
  12485. * Inserts wrapper `details` in a comment at the top of the `source` body.
  12486. *
  12487. * @private
  12488. * @param {string} source The source to modify.
  12489. * @returns {Array} details The details to insert.
  12490. * @returns {string} Returns the modified source.
  12491. */
  12492. function insertWrapDetails(source, details) {
  12493. var length = details.length;
  12494. if (!length) {
  12495. return source;
  12496. }
  12497. var lastIndex = length - 1;
  12498. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  12499. details = details.join(length > 2 ? ', ' : ' ');
  12500. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  12501. }
  12502. /**
  12503. * Checks if `value` is a flattenable `arguments` object or array.
  12504. *
  12505. * @private
  12506. * @param {*} value The value to check.
  12507. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  12508. */
  12509. function isFlattenable(value) {
  12510. return isArray(value) || isArguments(value) ||
  12511. !!(spreadableSymbol && value && value[spreadableSymbol]);
  12512. }
  12513. /**
  12514. * Checks if `value` is a valid array-like index.
  12515. *
  12516. * @private
  12517. * @param {*} value The value to check.
  12518. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  12519. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  12520. */
  12521. function isIndex(value, length) {
  12522. var type = typeof value;
  12523. length = length == null ? MAX_SAFE_INTEGER : length;
  12524. return !!length &&
  12525. (type == 'number' ||
  12526. (type != 'symbol' && reIsUint.test(value))) &&
  12527. (value > -1 && value % 1 == 0 && value < length);
  12528. }
  12529. /**
  12530. * Checks if the given arguments are from an iteratee call.
  12531. *
  12532. * @private
  12533. * @param {*} value The potential iteratee value argument.
  12534. * @param {*} index The potential iteratee index or key argument.
  12535. * @param {*} object The potential iteratee object argument.
  12536. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  12537. * else `false`.
  12538. */
  12539. function isIterateeCall(value, index, object) {
  12540. if (!isObject(object)) {
  12541. return false;
  12542. }
  12543. var type = typeof index;
  12544. if (type == 'number'
  12545. ? (isArrayLike(object) && isIndex(index, object.length))
  12546. : (type == 'string' && index in object)
  12547. ) {
  12548. return eq(object[index], value);
  12549. }
  12550. return false;
  12551. }
  12552. /**
  12553. * Checks if `value` is a property name and not a property path.
  12554. *
  12555. * @private
  12556. * @param {*} value The value to check.
  12557. * @param {Object} [object] The object to query keys on.
  12558. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12559. */
  12560. function isKey(value, object) {
  12561. if (isArray(value)) {
  12562. return false;
  12563. }
  12564. var type = typeof value;
  12565. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12566. value == null || isSymbol(value)) {
  12567. return true;
  12568. }
  12569. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12570. (object != null && value in Object(object));
  12571. }
  12572. /**
  12573. * Checks if `value` is suitable for use as unique object key.
  12574. *
  12575. * @private
  12576. * @param {*} value The value to check.
  12577. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12578. */
  12579. function isKeyable(value) {
  12580. var type = typeof value;
  12581. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12582. ? (value !== '__proto__')
  12583. : (value === null);
  12584. }
  12585. /**
  12586. * Checks if `func` has a lazy counterpart.
  12587. *
  12588. * @private
  12589. * @param {Function} func The function to check.
  12590. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  12591. * else `false`.
  12592. */
  12593. function isLaziable(func) {
  12594. var funcName = getFuncName(func),
  12595. other = lodash[funcName];
  12596. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  12597. return false;
  12598. }
  12599. if (func === other) {
  12600. return true;
  12601. }
  12602. var data = getData(other);
  12603. return !!data && func === data[0];
  12604. }
  12605. /**
  12606. * Checks if `func` has its source masked.
  12607. *
  12608. * @private
  12609. * @param {Function} func The function to check.
  12610. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12611. */
  12612. function isMasked(func) {
  12613. return !!maskSrcKey && (maskSrcKey in func);
  12614. }
  12615. /**
  12616. * Checks if `func` is capable of being masked.
  12617. *
  12618. * @private
  12619. * @param {*} value The value to check.
  12620. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  12621. */
  12622. var isMaskable = coreJsData ? isFunction : stubFalse;
  12623. /**
  12624. * Checks if `value` is likely a prototype object.
  12625. *
  12626. * @private
  12627. * @param {*} value The value to check.
  12628. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  12629. */
  12630. function isPrototype(value) {
  12631. var Ctor = value && value.constructor,
  12632. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  12633. return value === proto;
  12634. }
  12635. /**
  12636. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  12637. *
  12638. * @private
  12639. * @param {*} value The value to check.
  12640. * @returns {boolean} Returns `true` if `value` if suitable for strict
  12641. * equality comparisons, else `false`.
  12642. */
  12643. function isStrictComparable(value) {
  12644. return value === value && !isObject(value);
  12645. }
  12646. /**
  12647. * A specialized version of `matchesProperty` for source values suitable
  12648. * for strict equality comparisons, i.e. `===`.
  12649. *
  12650. * @private
  12651. * @param {string} key The key of the property to get.
  12652. * @param {*} srcValue The value to match.
  12653. * @returns {Function} Returns the new spec function.
  12654. */
  12655. function matchesStrictComparable(key, srcValue) {
  12656. return function(object) {
  12657. if (object == null) {
  12658. return false;
  12659. }
  12660. return object[key] === srcValue &&
  12661. (srcValue !== undefined || (key in Object(object)));
  12662. };
  12663. }
  12664. /**
  12665. * A specialized version of `_.memoize` which clears the memoized function's
  12666. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  12667. *
  12668. * @private
  12669. * @param {Function} func The function to have its output memoized.
  12670. * @returns {Function} Returns the new memoized function.
  12671. */
  12672. function memoizeCapped(func) {
  12673. var result = memoize(func, function(key) {
  12674. if (cache.size === MAX_MEMOIZE_SIZE) {
  12675. cache.clear();
  12676. }
  12677. return key;
  12678. });
  12679. var cache = result.cache;
  12680. return result;
  12681. }
  12682. /**
  12683. * Merges the function metadata of `source` into `data`.
  12684. *
  12685. * Merging metadata reduces the number of wrappers used to invoke a function.
  12686. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  12687. * may be applied regardless of execution order. Methods like `_.ary` and
  12688. * `_.rearg` modify function arguments, making the order in which they are
  12689. * executed important, preventing the merging of metadata. However, we make
  12690. * an exception for a safe combined case where curried functions have `_.ary`
  12691. * and or `_.rearg` applied.
  12692. *
  12693. * @private
  12694. * @param {Array} data The destination metadata.
  12695. * @param {Array} source The source metadata.
  12696. * @returns {Array} Returns `data`.
  12697. */
  12698. function mergeData(data, source) {
  12699. var bitmask = data[1],
  12700. srcBitmask = source[1],
  12701. newBitmask = bitmask | srcBitmask,
  12702. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  12703. var isCombo =
  12704. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  12705. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  12706. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  12707. // Exit early if metadata can't be merged.
  12708. if (!(isCommon || isCombo)) {
  12709. return data;
  12710. }
  12711. // Use source `thisArg` if available.
  12712. if (srcBitmask & WRAP_BIND_FLAG) {
  12713. data[2] = source[2];
  12714. // Set when currying a bound function.
  12715. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  12716. }
  12717. // Compose partial arguments.
  12718. var value = source[3];
  12719. if (value) {
  12720. var partials = data[3];
  12721. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  12722. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  12723. }
  12724. // Compose partial right arguments.
  12725. value = source[5];
  12726. if (value) {
  12727. partials = data[5];
  12728. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  12729. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  12730. }
  12731. // Use source `argPos` if available.
  12732. value = source[7];
  12733. if (value) {
  12734. data[7] = value;
  12735. }
  12736. // Use source `ary` if it's smaller.
  12737. if (srcBitmask & WRAP_ARY_FLAG) {
  12738. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  12739. }
  12740. // Use source `arity` if one is not provided.
  12741. if (data[9] == null) {
  12742. data[9] = source[9];
  12743. }
  12744. // Use source `func` and merge bitmasks.
  12745. data[0] = source[0];
  12746. data[1] = newBitmask;
  12747. return data;
  12748. }
  12749. /**
  12750. * This function is like
  12751. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  12752. * except that it includes inherited enumerable properties.
  12753. *
  12754. * @private
  12755. * @param {Object} object The object to query.
  12756. * @returns {Array} Returns the array of property names.
  12757. */
  12758. function nativeKeysIn(object) {
  12759. var result = [];
  12760. if (object != null) {
  12761. for (var key in Object(object)) {
  12762. result.push(key);
  12763. }
  12764. }
  12765. return result;
  12766. }
  12767. /**
  12768. * Converts `value` to a string using `Object.prototype.toString`.
  12769. *
  12770. * @private
  12771. * @param {*} value The value to convert.
  12772. * @returns {string} Returns the converted string.
  12773. */
  12774. function objectToString(value) {
  12775. return nativeObjectToString.call(value);
  12776. }
  12777. /**
  12778. * A specialized version of `baseRest` which transforms the rest array.
  12779. *
  12780. * @private
  12781. * @param {Function} func The function to apply a rest parameter to.
  12782. * @param {number} [start=func.length-1] The start position of the rest parameter.
  12783. * @param {Function} transform The rest array transform.
  12784. * @returns {Function} Returns the new function.
  12785. */
  12786. function overRest(func, start, transform) {
  12787. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  12788. return function() {
  12789. var args = arguments,
  12790. index = -1,
  12791. length = nativeMax(args.length - start, 0),
  12792. array = Array(length);
  12793. while (++index < length) {
  12794. array[index] = args[start + index];
  12795. }
  12796. index = -1;
  12797. var otherArgs = Array(start + 1);
  12798. while (++index < start) {
  12799. otherArgs[index] = args[index];
  12800. }
  12801. otherArgs[start] = transform(array);
  12802. return apply(func, this, otherArgs);
  12803. };
  12804. }
  12805. /**
  12806. * Gets the parent value at `path` of `object`.
  12807. *
  12808. * @private
  12809. * @param {Object} object The object to query.
  12810. * @param {Array} path The path to get the parent value of.
  12811. * @returns {*} Returns the parent value.
  12812. */
  12813. function parent(object, path) {
  12814. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  12815. }
  12816. /**
  12817. * Reorder `array` according to the specified indexes where the element at
  12818. * the first index is assigned as the first element, the element at
  12819. * the second index is assigned as the second element, and so on.
  12820. *
  12821. * @private
  12822. * @param {Array} array The array to reorder.
  12823. * @param {Array} indexes The arranged array indexes.
  12824. * @returns {Array} Returns `array`.
  12825. */
  12826. function reorder(array, indexes) {
  12827. var arrLength = array.length,
  12828. length = nativeMin(indexes.length, arrLength),
  12829. oldArray = copyArray(array);
  12830. while (length--) {
  12831. var index = indexes[length];
  12832. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  12833. }
  12834. return array;
  12835. }
  12836. /**
  12837. * Sets metadata for `func`.
  12838. *
  12839. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  12840. * period of time, it will trip its breaker and transition to an identity
  12841. * function to avoid garbage collection pauses in V8. See
  12842. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  12843. * for more details.
  12844. *
  12845. * @private
  12846. * @param {Function} func The function to associate metadata with.
  12847. * @param {*} data The metadata.
  12848. * @returns {Function} Returns `func`.
  12849. */
  12850. var setData = shortOut(baseSetData);
  12851. /**
  12852. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  12853. *
  12854. * @private
  12855. * @param {Function} func The function to delay.
  12856. * @param {number} wait The number of milliseconds to delay invocation.
  12857. * @returns {number|Object} Returns the timer id or timeout object.
  12858. */
  12859. var setTimeout = ctxSetTimeout || function(func, wait) {
  12860. return root.setTimeout(func, wait);
  12861. };
  12862. /**
  12863. * Sets the `toString` method of `func` to return `string`.
  12864. *
  12865. * @private
  12866. * @param {Function} func The function to modify.
  12867. * @param {Function} string The `toString` result.
  12868. * @returns {Function} Returns `func`.
  12869. */
  12870. var setToString = shortOut(baseSetToString);
  12871. /**
  12872. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  12873. * with wrapper details in a comment at the top of the source body.
  12874. *
  12875. * @private
  12876. * @param {Function} wrapper The function to modify.
  12877. * @param {Function} reference The reference function.
  12878. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  12879. * @returns {Function} Returns `wrapper`.
  12880. */
  12881. function setWrapToString(wrapper, reference, bitmask) {
  12882. var source = (reference + '');
  12883. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  12884. }
  12885. /**
  12886. * Creates a function that'll short out and invoke `identity` instead
  12887. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  12888. * milliseconds.
  12889. *
  12890. * @private
  12891. * @param {Function} func The function to restrict.
  12892. * @returns {Function} Returns the new shortable function.
  12893. */
  12894. function shortOut(func) {
  12895. var count = 0,
  12896. lastCalled = 0;
  12897. return function() {
  12898. var stamp = nativeNow(),
  12899. remaining = HOT_SPAN - (stamp - lastCalled);
  12900. lastCalled = stamp;
  12901. if (remaining > 0) {
  12902. if (++count >= HOT_COUNT) {
  12903. return arguments[0];
  12904. }
  12905. } else {
  12906. count = 0;
  12907. }
  12908. return func.apply(undefined, arguments);
  12909. };
  12910. }
  12911. /**
  12912. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  12913. *
  12914. * @private
  12915. * @param {Array} array The array to shuffle.
  12916. * @param {number} [size=array.length] The size of `array`.
  12917. * @returns {Array} Returns `array`.
  12918. */
  12919. function shuffleSelf(array, size) {
  12920. var index = -1,
  12921. length = array.length,
  12922. lastIndex = length - 1;
  12923. size = size === undefined ? length : size;
  12924. while (++index < size) {
  12925. var rand = baseRandom(index, lastIndex),
  12926. value = array[rand];
  12927. array[rand] = array[index];
  12928. array[index] = value;
  12929. }
  12930. array.length = size;
  12931. return array;
  12932. }
  12933. /**
  12934. * Converts `string` to a property path array.
  12935. *
  12936. * @private
  12937. * @param {string} string The string to convert.
  12938. * @returns {Array} Returns the property path array.
  12939. */
  12940. var stringToPath = memoizeCapped(function(string) {
  12941. var result = [];
  12942. if (string.charCodeAt(0) === 46 /* . */) {
  12943. result.push('');
  12944. }
  12945. string.replace(rePropName, function(match, number, quote, subString) {
  12946. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  12947. });
  12948. return result;
  12949. });
  12950. /**
  12951. * Converts `value` to a string key if it's not a string or symbol.
  12952. *
  12953. * @private
  12954. * @param {*} value The value to inspect.
  12955. * @returns {string|symbol} Returns the key.
  12956. */
  12957. function toKey(value) {
  12958. if (typeof value == 'string' || isSymbol(value)) {
  12959. return value;
  12960. }
  12961. var result = (value + '');
  12962. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12963. }
  12964. /**
  12965. * Converts `func` to its source code.
  12966. *
  12967. * @private
  12968. * @param {Function} func The function to convert.
  12969. * @returns {string} Returns the source code.
  12970. */
  12971. function toSource(func) {
  12972. if (func != null) {
  12973. try {
  12974. return funcToString.call(func);
  12975. } catch (e) {}
  12976. try {
  12977. return (func + '');
  12978. } catch (e) {}
  12979. }
  12980. return '';
  12981. }
  12982. /**
  12983. * Updates wrapper `details` based on `bitmask` flags.
  12984. *
  12985. * @private
  12986. * @returns {Array} details The details to modify.
  12987. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  12988. * @returns {Array} Returns `details`.
  12989. */
  12990. function updateWrapDetails(details, bitmask) {
  12991. arrayEach(wrapFlags, function(pair) {
  12992. var value = '_.' + pair[0];
  12993. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  12994. details.push(value);
  12995. }
  12996. });
  12997. return details.sort();
  12998. }
  12999. /**
  13000. * Creates a clone of `wrapper`.
  13001. *
  13002. * @private
  13003. * @param {Object} wrapper The wrapper to clone.
  13004. * @returns {Object} Returns the cloned wrapper.
  13005. */
  13006. function wrapperClone(wrapper) {
  13007. if (wrapper instanceof LazyWrapper) {
  13008. return wrapper.clone();
  13009. }
  13010. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  13011. result.__actions__ = copyArray(wrapper.__actions__);
  13012. result.__index__ = wrapper.__index__;
  13013. result.__values__ = wrapper.__values__;
  13014. return result;
  13015. }
  13016. /*------------------------------------------------------------------------*/
  13017. /**
  13018. * Creates an array of elements split into groups the length of `size`.
  13019. * If `array` can't be split evenly, the final chunk will be the remaining
  13020. * elements.
  13021. *
  13022. * @static
  13023. * @memberOf _
  13024. * @since 3.0.0
  13025. * @category Array
  13026. * @param {Array} array The array to process.
  13027. * @param {number} [size=1] The length of each chunk
  13028. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  13029. * @returns {Array} Returns the new array of chunks.
  13030. * @example
  13031. *
  13032. * _.chunk(['a', 'b', 'c', 'd'], 2);
  13033. * // => [['a', 'b'], ['c', 'd']]
  13034. *
  13035. * _.chunk(['a', 'b', 'c', 'd'], 3);
  13036. * // => [['a', 'b', 'c'], ['d']]
  13037. */
  13038. function chunk(array, size, guard) {
  13039. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  13040. size = 1;
  13041. } else {
  13042. size = nativeMax(toInteger(size), 0);
  13043. }
  13044. var length = array == null ? 0 : array.length;
  13045. if (!length || size < 1) {
  13046. return [];
  13047. }
  13048. var index = 0,
  13049. resIndex = 0,
  13050. result = Array(nativeCeil(length / size));
  13051. while (index < length) {
  13052. result[resIndex++] = baseSlice(array, index, (index += size));
  13053. }
  13054. return result;
  13055. }
  13056. /**
  13057. * Creates an array with all falsey values removed. The values `false`, `null`,
  13058. * `0`, `""`, `undefined`, and `NaN` are falsey.
  13059. *
  13060. * @static
  13061. * @memberOf _
  13062. * @since 0.1.0
  13063. * @category Array
  13064. * @param {Array} array The array to compact.
  13065. * @returns {Array} Returns the new array of filtered values.
  13066. * @example
  13067. *
  13068. * _.compact([0, 1, false, 2, '', 3]);
  13069. * // => [1, 2, 3]
  13070. */
  13071. function compact(array) {
  13072. var index = -1,
  13073. length = array == null ? 0 : array.length,
  13074. resIndex = 0,
  13075. result = [];
  13076. while (++index < length) {
  13077. var value = array[index];
  13078. if (value) {
  13079. result[resIndex++] = value;
  13080. }
  13081. }
  13082. return result;
  13083. }
  13084. /**
  13085. * Creates a new array concatenating `array` with any additional arrays
  13086. * and/or values.
  13087. *
  13088. * @static
  13089. * @memberOf _
  13090. * @since 4.0.0
  13091. * @category Array
  13092. * @param {Array} array The array to concatenate.
  13093. * @param {...*} [values] The values to concatenate.
  13094. * @returns {Array} Returns the new concatenated array.
  13095. * @example
  13096. *
  13097. * var array = [1];
  13098. * var other = _.concat(array, 2, [3], [[4]]);
  13099. *
  13100. * console.log(other);
  13101. * // => [1, 2, 3, [4]]
  13102. *
  13103. * console.log(array);
  13104. * // => [1]
  13105. */
  13106. function concat() {
  13107. var length = arguments.length;
  13108. if (!length) {
  13109. return [];
  13110. }
  13111. var args = Array(length - 1),
  13112. array = arguments[0],
  13113. index = length;
  13114. while (index--) {
  13115. args[index - 1] = arguments[index];
  13116. }
  13117. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  13118. }
  13119. /**
  13120. * Creates an array of `array` values not included in the other given arrays
  13121. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13122. * for equality comparisons. The order and references of result values are
  13123. * determined by the first array.
  13124. *
  13125. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  13126. *
  13127. * @static
  13128. * @memberOf _
  13129. * @since 0.1.0
  13130. * @category Array
  13131. * @param {Array} array The array to inspect.
  13132. * @param {...Array} [values] The values to exclude.
  13133. * @returns {Array} Returns the new array of filtered values.
  13134. * @see _.without, _.xor
  13135. * @example
  13136. *
  13137. * _.difference([2, 1], [2, 3]);
  13138. * // => [1]
  13139. */
  13140. var difference = baseRest(function(array, values) {
  13141. return isArrayLikeObject(array)
  13142. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  13143. : [];
  13144. });
  13145. /**
  13146. * This method is like `_.difference` except that it accepts `iteratee` which
  13147. * is invoked for each element of `array` and `values` to generate the criterion
  13148. * by which they're compared. The order and references of result values are
  13149. * determined by the first array. The iteratee is invoked with one argument:
  13150. * (value).
  13151. *
  13152. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  13153. *
  13154. * @static
  13155. * @memberOf _
  13156. * @since 4.0.0
  13157. * @category Array
  13158. * @param {Array} array The array to inspect.
  13159. * @param {...Array} [values] The values to exclude.
  13160. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13161. * @returns {Array} Returns the new array of filtered values.
  13162. * @example
  13163. *
  13164. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  13165. * // => [1.2]
  13166. *
  13167. * // The `_.property` iteratee shorthand.
  13168. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  13169. * // => [{ 'x': 2 }]
  13170. */
  13171. var differenceBy = baseRest(function(array, values) {
  13172. var iteratee = last(values);
  13173. if (isArrayLikeObject(iteratee)) {
  13174. iteratee = undefined;
  13175. }
  13176. return isArrayLikeObject(array)
  13177. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  13178. : [];
  13179. });
  13180. /**
  13181. * This method is like `_.difference` except that it accepts `comparator`
  13182. * which is invoked to compare elements of `array` to `values`. The order and
  13183. * references of result values are determined by the first array. The comparator
  13184. * is invoked with two arguments: (arrVal, othVal).
  13185. *
  13186. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  13187. *
  13188. * @static
  13189. * @memberOf _
  13190. * @since 4.0.0
  13191. * @category Array
  13192. * @param {Array} array The array to inspect.
  13193. * @param {...Array} [values] The values to exclude.
  13194. * @param {Function} [comparator] The comparator invoked per element.
  13195. * @returns {Array} Returns the new array of filtered values.
  13196. * @example
  13197. *
  13198. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  13199. *
  13200. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  13201. * // => [{ 'x': 2, 'y': 1 }]
  13202. */
  13203. var differenceWith = baseRest(function(array, values) {
  13204. var comparator = last(values);
  13205. if (isArrayLikeObject(comparator)) {
  13206. comparator = undefined;
  13207. }
  13208. return isArrayLikeObject(array)
  13209. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  13210. : [];
  13211. });
  13212. /**
  13213. * Creates a slice of `array` with `n` elements dropped from the beginning.
  13214. *
  13215. * @static
  13216. * @memberOf _
  13217. * @since 0.5.0
  13218. * @category Array
  13219. * @param {Array} array The array to query.
  13220. * @param {number} [n=1] The number of elements to drop.
  13221. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  13222. * @returns {Array} Returns the slice of `array`.
  13223. * @example
  13224. *
  13225. * _.drop([1, 2, 3]);
  13226. * // => [2, 3]
  13227. *
  13228. * _.drop([1, 2, 3], 2);
  13229. * // => [3]
  13230. *
  13231. * _.drop([1, 2, 3], 5);
  13232. * // => []
  13233. *
  13234. * _.drop([1, 2, 3], 0);
  13235. * // => [1, 2, 3]
  13236. */
  13237. function drop(array, n, guard) {
  13238. var length = array == null ? 0 : array.length;
  13239. if (!length) {
  13240. return [];
  13241. }
  13242. n = (guard || n === undefined) ? 1 : toInteger(n);
  13243. return baseSlice(array, n < 0 ? 0 : n, length);
  13244. }
  13245. /**
  13246. * Creates a slice of `array` with `n` elements dropped from the end.
  13247. *
  13248. * @static
  13249. * @memberOf _
  13250. * @since 3.0.0
  13251. * @category Array
  13252. * @param {Array} array The array to query.
  13253. * @param {number} [n=1] The number of elements to drop.
  13254. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  13255. * @returns {Array} Returns the slice of `array`.
  13256. * @example
  13257. *
  13258. * _.dropRight([1, 2, 3]);
  13259. * // => [1, 2]
  13260. *
  13261. * _.dropRight([1, 2, 3], 2);
  13262. * // => [1]
  13263. *
  13264. * _.dropRight([1, 2, 3], 5);
  13265. * // => []
  13266. *
  13267. * _.dropRight([1, 2, 3], 0);
  13268. * // => [1, 2, 3]
  13269. */
  13270. function dropRight(array, n, guard) {
  13271. var length = array == null ? 0 : array.length;
  13272. if (!length) {
  13273. return [];
  13274. }
  13275. n = (guard || n === undefined) ? 1 : toInteger(n);
  13276. n = length - n;
  13277. return baseSlice(array, 0, n < 0 ? 0 : n);
  13278. }
  13279. /**
  13280. * Creates a slice of `array` excluding elements dropped from the end.
  13281. * Elements are dropped until `predicate` returns falsey. The predicate is
  13282. * invoked with three arguments: (value, index, array).
  13283. *
  13284. * @static
  13285. * @memberOf _
  13286. * @since 3.0.0
  13287. * @category Array
  13288. * @param {Array} array The array to query.
  13289. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13290. * @returns {Array} Returns the slice of `array`.
  13291. * @example
  13292. *
  13293. * var users = [
  13294. * { 'user': 'barney', 'active': true },
  13295. * { 'user': 'fred', 'active': false },
  13296. * { 'user': 'pebbles', 'active': false }
  13297. * ];
  13298. *
  13299. * _.dropRightWhile(users, function(o) { return !o.active; });
  13300. * // => objects for ['barney']
  13301. *
  13302. * // The `_.matches` iteratee shorthand.
  13303. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  13304. * // => objects for ['barney', 'fred']
  13305. *
  13306. * // The `_.matchesProperty` iteratee shorthand.
  13307. * _.dropRightWhile(users, ['active', false]);
  13308. * // => objects for ['barney']
  13309. *
  13310. * // The `_.property` iteratee shorthand.
  13311. * _.dropRightWhile(users, 'active');
  13312. * // => objects for ['barney', 'fred', 'pebbles']
  13313. */
  13314. function dropRightWhile(array, predicate) {
  13315. return (array && array.length)
  13316. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  13317. : [];
  13318. }
  13319. /**
  13320. * Creates a slice of `array` excluding elements dropped from the beginning.
  13321. * Elements are dropped until `predicate` returns falsey. The predicate is
  13322. * invoked with three arguments: (value, index, array).
  13323. *
  13324. * @static
  13325. * @memberOf _
  13326. * @since 3.0.0
  13327. * @category Array
  13328. * @param {Array} array The array to query.
  13329. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13330. * @returns {Array} Returns the slice of `array`.
  13331. * @example
  13332. *
  13333. * var users = [
  13334. * { 'user': 'barney', 'active': false },
  13335. * { 'user': 'fred', 'active': false },
  13336. * { 'user': 'pebbles', 'active': true }
  13337. * ];
  13338. *
  13339. * _.dropWhile(users, function(o) { return !o.active; });
  13340. * // => objects for ['pebbles']
  13341. *
  13342. * // The `_.matches` iteratee shorthand.
  13343. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  13344. * // => objects for ['fred', 'pebbles']
  13345. *
  13346. * // The `_.matchesProperty` iteratee shorthand.
  13347. * _.dropWhile(users, ['active', false]);
  13348. * // => objects for ['pebbles']
  13349. *
  13350. * // The `_.property` iteratee shorthand.
  13351. * _.dropWhile(users, 'active');
  13352. * // => objects for ['barney', 'fred', 'pebbles']
  13353. */
  13354. function dropWhile(array, predicate) {
  13355. return (array && array.length)
  13356. ? baseWhile(array, getIteratee(predicate, 3), true)
  13357. : [];
  13358. }
  13359. /**
  13360. * Fills elements of `array` with `value` from `start` up to, but not
  13361. * including, `end`.
  13362. *
  13363. * **Note:** This method mutates `array`.
  13364. *
  13365. * @static
  13366. * @memberOf _
  13367. * @since 3.2.0
  13368. * @category Array
  13369. * @param {Array} array The array to fill.
  13370. * @param {*} value The value to fill `array` with.
  13371. * @param {number} [start=0] The start position.
  13372. * @param {number} [end=array.length] The end position.
  13373. * @returns {Array} Returns `array`.
  13374. * @example
  13375. *
  13376. * var array = [1, 2, 3];
  13377. *
  13378. * _.fill(array, 'a');
  13379. * console.log(array);
  13380. * // => ['a', 'a', 'a']
  13381. *
  13382. * _.fill(Array(3), 2);
  13383. * // => [2, 2, 2]
  13384. *
  13385. * _.fill([4, 6, 8, 10], '*', 1, 3);
  13386. * // => [4, '*', '*', 10]
  13387. */
  13388. function fill(array, value, start, end) {
  13389. var length = array == null ? 0 : array.length;
  13390. if (!length) {
  13391. return [];
  13392. }
  13393. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  13394. start = 0;
  13395. end = length;
  13396. }
  13397. return baseFill(array, value, start, end);
  13398. }
  13399. /**
  13400. * This method is like `_.find` except that it returns the index of the first
  13401. * element `predicate` returns truthy for instead of the element itself.
  13402. *
  13403. * @static
  13404. * @memberOf _
  13405. * @since 1.1.0
  13406. * @category Array
  13407. * @param {Array} array The array to inspect.
  13408. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13409. * @param {number} [fromIndex=0] The index to search from.
  13410. * @returns {number} Returns the index of the found element, else `-1`.
  13411. * @example
  13412. *
  13413. * var users = [
  13414. * { 'user': 'barney', 'active': false },
  13415. * { 'user': 'fred', 'active': false },
  13416. * { 'user': 'pebbles', 'active': true }
  13417. * ];
  13418. *
  13419. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  13420. * // => 0
  13421. *
  13422. * // The `_.matches` iteratee shorthand.
  13423. * _.findIndex(users, { 'user': 'fred', 'active': false });
  13424. * // => 1
  13425. *
  13426. * // The `_.matchesProperty` iteratee shorthand.
  13427. * _.findIndex(users, ['active', false]);
  13428. * // => 0
  13429. *
  13430. * // The `_.property` iteratee shorthand.
  13431. * _.findIndex(users, 'active');
  13432. * // => 2
  13433. */
  13434. function findIndex(array, predicate, fromIndex) {
  13435. var length = array == null ? 0 : array.length;
  13436. if (!length) {
  13437. return -1;
  13438. }
  13439. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  13440. if (index < 0) {
  13441. index = nativeMax(length + index, 0);
  13442. }
  13443. return baseFindIndex(array, getIteratee(predicate, 3), index);
  13444. }
  13445. /**
  13446. * This method is like `_.findIndex` except that it iterates over elements
  13447. * of `collection` from right to left.
  13448. *
  13449. * @static
  13450. * @memberOf _
  13451. * @since 2.0.0
  13452. * @category Array
  13453. * @param {Array} array The array to inspect.
  13454. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13455. * @param {number} [fromIndex=array.length-1] The index to search from.
  13456. * @returns {number} Returns the index of the found element, else `-1`.
  13457. * @example
  13458. *
  13459. * var users = [
  13460. * { 'user': 'barney', 'active': true },
  13461. * { 'user': 'fred', 'active': false },
  13462. * { 'user': 'pebbles', 'active': false }
  13463. * ];
  13464. *
  13465. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  13466. * // => 2
  13467. *
  13468. * // The `_.matches` iteratee shorthand.
  13469. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  13470. * // => 0
  13471. *
  13472. * // The `_.matchesProperty` iteratee shorthand.
  13473. * _.findLastIndex(users, ['active', false]);
  13474. * // => 2
  13475. *
  13476. * // The `_.property` iteratee shorthand.
  13477. * _.findLastIndex(users, 'active');
  13478. * // => 0
  13479. */
  13480. function findLastIndex(array, predicate, fromIndex) {
  13481. var length = array == null ? 0 : array.length;
  13482. if (!length) {
  13483. return -1;
  13484. }
  13485. var index = length - 1;
  13486. if (fromIndex !== undefined) {
  13487. index = toInteger(fromIndex);
  13488. index = fromIndex < 0
  13489. ? nativeMax(length + index, 0)
  13490. : nativeMin(index, length - 1);
  13491. }
  13492. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  13493. }
  13494. /**
  13495. * Flattens `array` a single level deep.
  13496. *
  13497. * @static
  13498. * @memberOf _
  13499. * @since 0.1.0
  13500. * @category Array
  13501. * @param {Array} array The array to flatten.
  13502. * @returns {Array} Returns the new flattened array.
  13503. * @example
  13504. *
  13505. * _.flatten([1, [2, [3, [4]], 5]]);
  13506. * // => [1, 2, [3, [4]], 5]
  13507. */
  13508. function flatten(array) {
  13509. var length = array == null ? 0 : array.length;
  13510. return length ? baseFlatten(array, 1) : [];
  13511. }
  13512. /**
  13513. * Recursively flattens `array`.
  13514. *
  13515. * @static
  13516. * @memberOf _
  13517. * @since 3.0.0
  13518. * @category Array
  13519. * @param {Array} array The array to flatten.
  13520. * @returns {Array} Returns the new flattened array.
  13521. * @example
  13522. *
  13523. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  13524. * // => [1, 2, 3, 4, 5]
  13525. */
  13526. function flattenDeep(array) {
  13527. var length = array == null ? 0 : array.length;
  13528. return length ? baseFlatten(array, INFINITY) : [];
  13529. }
  13530. /**
  13531. * Recursively flatten `array` up to `depth` times.
  13532. *
  13533. * @static
  13534. * @memberOf _
  13535. * @since 4.4.0
  13536. * @category Array
  13537. * @param {Array} array The array to flatten.
  13538. * @param {number} [depth=1] The maximum recursion depth.
  13539. * @returns {Array} Returns the new flattened array.
  13540. * @example
  13541. *
  13542. * var array = [1, [2, [3, [4]], 5]];
  13543. *
  13544. * _.flattenDepth(array, 1);
  13545. * // => [1, 2, [3, [4]], 5]
  13546. *
  13547. * _.flattenDepth(array, 2);
  13548. * // => [1, 2, 3, [4], 5]
  13549. */
  13550. function flattenDepth(array, depth) {
  13551. var length = array == null ? 0 : array.length;
  13552. if (!length) {
  13553. return [];
  13554. }
  13555. depth = depth === undefined ? 1 : toInteger(depth);
  13556. return baseFlatten(array, depth);
  13557. }
  13558. /**
  13559. * The inverse of `_.toPairs`; this method returns an object composed
  13560. * from key-value `pairs`.
  13561. *
  13562. * @static
  13563. * @memberOf _
  13564. * @since 4.0.0
  13565. * @category Array
  13566. * @param {Array} pairs The key-value pairs.
  13567. * @returns {Object} Returns the new object.
  13568. * @example
  13569. *
  13570. * _.fromPairs([['a', 1], ['b', 2]]);
  13571. * // => { 'a': 1, 'b': 2 }
  13572. */
  13573. function fromPairs(pairs) {
  13574. var index = -1,
  13575. length = pairs == null ? 0 : pairs.length,
  13576. result = {};
  13577. while (++index < length) {
  13578. var pair = pairs[index];
  13579. result[pair[0]] = pair[1];
  13580. }
  13581. return result;
  13582. }
  13583. /**
  13584. * Gets the first element of `array`.
  13585. *
  13586. * @static
  13587. * @memberOf _
  13588. * @since 0.1.0
  13589. * @alias first
  13590. * @category Array
  13591. * @param {Array} array The array to query.
  13592. * @returns {*} Returns the first element of `array`.
  13593. * @example
  13594. *
  13595. * _.head([1, 2, 3]);
  13596. * // => 1
  13597. *
  13598. * _.head([]);
  13599. * // => undefined
  13600. */
  13601. function head(array) {
  13602. return (array && array.length) ? array[0] : undefined;
  13603. }
  13604. /**
  13605. * Gets the index at which the first occurrence of `value` is found in `array`
  13606. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13607. * for equality comparisons. If `fromIndex` is negative, it's used as the
  13608. * offset from the end of `array`.
  13609. *
  13610. * @static
  13611. * @memberOf _
  13612. * @since 0.1.0
  13613. * @category Array
  13614. * @param {Array} array The array to inspect.
  13615. * @param {*} value The value to search for.
  13616. * @param {number} [fromIndex=0] The index to search from.
  13617. * @returns {number} Returns the index of the matched value, else `-1`.
  13618. * @example
  13619. *
  13620. * _.indexOf([1, 2, 1, 2], 2);
  13621. * // => 1
  13622. *
  13623. * // Search from the `fromIndex`.
  13624. * _.indexOf([1, 2, 1, 2], 2, 2);
  13625. * // => 3
  13626. */
  13627. function indexOf(array, value, fromIndex) {
  13628. var length = array == null ? 0 : array.length;
  13629. if (!length) {
  13630. return -1;
  13631. }
  13632. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  13633. if (index < 0) {
  13634. index = nativeMax(length + index, 0);
  13635. }
  13636. return baseIndexOf(array, value, index);
  13637. }
  13638. /**
  13639. * Gets all but the last element of `array`.
  13640. *
  13641. * @static
  13642. * @memberOf _
  13643. * @since 0.1.0
  13644. * @category Array
  13645. * @param {Array} array The array to query.
  13646. * @returns {Array} Returns the slice of `array`.
  13647. * @example
  13648. *
  13649. * _.initial([1, 2, 3]);
  13650. * // => [1, 2]
  13651. */
  13652. function initial(array) {
  13653. var length = array == null ? 0 : array.length;
  13654. return length ? baseSlice(array, 0, -1) : [];
  13655. }
  13656. /**
  13657. * Creates an array of unique values that are included in all given arrays
  13658. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13659. * for equality comparisons. The order and references of result values are
  13660. * determined by the first array.
  13661. *
  13662. * @static
  13663. * @memberOf _
  13664. * @since 0.1.0
  13665. * @category Array
  13666. * @param {...Array} [arrays] The arrays to inspect.
  13667. * @returns {Array} Returns the new array of intersecting values.
  13668. * @example
  13669. *
  13670. * _.intersection([2, 1], [2, 3]);
  13671. * // => [2]
  13672. */
  13673. var intersection = baseRest(function(arrays) {
  13674. var mapped = arrayMap(arrays, castArrayLikeObject);
  13675. return (mapped.length && mapped[0] === arrays[0])
  13676. ? baseIntersection(mapped)
  13677. : [];
  13678. });
  13679. /**
  13680. * This method is like `_.intersection` except that it accepts `iteratee`
  13681. * which is invoked for each element of each `arrays` to generate the criterion
  13682. * by which they're compared. The order and references of result values are
  13683. * determined by the first array. The iteratee is invoked with one argument:
  13684. * (value).
  13685. *
  13686. * @static
  13687. * @memberOf _
  13688. * @since 4.0.0
  13689. * @category Array
  13690. * @param {...Array} [arrays] The arrays to inspect.
  13691. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13692. * @returns {Array} Returns the new array of intersecting values.
  13693. * @example
  13694. *
  13695. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  13696. * // => [2.1]
  13697. *
  13698. * // The `_.property` iteratee shorthand.
  13699. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  13700. * // => [{ 'x': 1 }]
  13701. */
  13702. var intersectionBy = baseRest(function(arrays) {
  13703. var iteratee = last(arrays),
  13704. mapped = arrayMap(arrays, castArrayLikeObject);
  13705. if (iteratee === last(mapped)) {
  13706. iteratee = undefined;
  13707. } else {
  13708. mapped.pop();
  13709. }
  13710. return (mapped.length && mapped[0] === arrays[0])
  13711. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  13712. : [];
  13713. });
  13714. /**
  13715. * This method is like `_.intersection` except that it accepts `comparator`
  13716. * which is invoked to compare elements of `arrays`. The order and references
  13717. * of result values are determined by the first array. The comparator is
  13718. * invoked with two arguments: (arrVal, othVal).
  13719. *
  13720. * @static
  13721. * @memberOf _
  13722. * @since 4.0.0
  13723. * @category Array
  13724. * @param {...Array} [arrays] The arrays to inspect.
  13725. * @param {Function} [comparator] The comparator invoked per element.
  13726. * @returns {Array} Returns the new array of intersecting values.
  13727. * @example
  13728. *
  13729. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  13730. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  13731. *
  13732. * _.intersectionWith(objects, others, _.isEqual);
  13733. * // => [{ 'x': 1, 'y': 2 }]
  13734. */
  13735. var intersectionWith = baseRest(function(arrays) {
  13736. var comparator = last(arrays),
  13737. mapped = arrayMap(arrays, castArrayLikeObject);
  13738. comparator = typeof comparator == 'function' ? comparator : undefined;
  13739. if (comparator) {
  13740. mapped.pop();
  13741. }
  13742. return (mapped.length && mapped[0] === arrays[0])
  13743. ? baseIntersection(mapped, undefined, comparator)
  13744. : [];
  13745. });
  13746. /**
  13747. * Converts all elements in `array` into a string separated by `separator`.
  13748. *
  13749. * @static
  13750. * @memberOf _
  13751. * @since 4.0.0
  13752. * @category Array
  13753. * @param {Array} array The array to convert.
  13754. * @param {string} [separator=','] The element separator.
  13755. * @returns {string} Returns the joined string.
  13756. * @example
  13757. *
  13758. * _.join(['a', 'b', 'c'], '~');
  13759. * // => 'a~b~c'
  13760. */
  13761. function join(array, separator) {
  13762. return array == null ? '' : nativeJoin.call(array, separator);
  13763. }
  13764. /**
  13765. * Gets the last element of `array`.
  13766. *
  13767. * @static
  13768. * @memberOf _
  13769. * @since 0.1.0
  13770. * @category Array
  13771. * @param {Array} array The array to query.
  13772. * @returns {*} Returns the last element of `array`.
  13773. * @example
  13774. *
  13775. * _.last([1, 2, 3]);
  13776. * // => 3
  13777. */
  13778. function last(array) {
  13779. var length = array == null ? 0 : array.length;
  13780. return length ? array[length - 1] : undefined;
  13781. }
  13782. /**
  13783. * This method is like `_.indexOf` except that it iterates over elements of
  13784. * `array` from right to left.
  13785. *
  13786. * @static
  13787. * @memberOf _
  13788. * @since 0.1.0
  13789. * @category Array
  13790. * @param {Array} array The array to inspect.
  13791. * @param {*} value The value to search for.
  13792. * @param {number} [fromIndex=array.length-1] The index to search from.
  13793. * @returns {number} Returns the index of the matched value, else `-1`.
  13794. * @example
  13795. *
  13796. * _.lastIndexOf([1, 2, 1, 2], 2);
  13797. * // => 3
  13798. *
  13799. * // Search from the `fromIndex`.
  13800. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  13801. * // => 1
  13802. */
  13803. function lastIndexOf(array, value, fromIndex) {
  13804. var length = array == null ? 0 : array.length;
  13805. if (!length) {
  13806. return -1;
  13807. }
  13808. var index = length;
  13809. if (fromIndex !== undefined) {
  13810. index = toInteger(fromIndex);
  13811. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  13812. }
  13813. return value === value
  13814. ? strictLastIndexOf(array, value, index)
  13815. : baseFindIndex(array, baseIsNaN, index, true);
  13816. }
  13817. /**
  13818. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  13819. * element from the end is returned.
  13820. *
  13821. * @static
  13822. * @memberOf _
  13823. * @since 4.11.0
  13824. * @category Array
  13825. * @param {Array} array The array to query.
  13826. * @param {number} [n=0] The index of the element to return.
  13827. * @returns {*} Returns the nth element of `array`.
  13828. * @example
  13829. *
  13830. * var array = ['a', 'b', 'c', 'd'];
  13831. *
  13832. * _.nth(array, 1);
  13833. * // => 'b'
  13834. *
  13835. * _.nth(array, -2);
  13836. * // => 'c';
  13837. */
  13838. function nth(array, n) {
  13839. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  13840. }
  13841. /**
  13842. * Removes all given values from `array` using
  13843. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13844. * for equality comparisons.
  13845. *
  13846. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  13847. * to remove elements from an array by predicate.
  13848. *
  13849. * @static
  13850. * @memberOf _
  13851. * @since 2.0.0
  13852. * @category Array
  13853. * @param {Array} array The array to modify.
  13854. * @param {...*} [values] The values to remove.
  13855. * @returns {Array} Returns `array`.
  13856. * @example
  13857. *
  13858. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  13859. *
  13860. * _.pull(array, 'a', 'c');
  13861. * console.log(array);
  13862. * // => ['b', 'b']
  13863. */
  13864. var pull = baseRest(pullAll);
  13865. /**
  13866. * This method is like `_.pull` except that it accepts an array of values to remove.
  13867. *
  13868. * **Note:** Unlike `_.difference`, this method mutates `array`.
  13869. *
  13870. * @static
  13871. * @memberOf _
  13872. * @since 4.0.0
  13873. * @category Array
  13874. * @param {Array} array The array to modify.
  13875. * @param {Array} values The values to remove.
  13876. * @returns {Array} Returns `array`.
  13877. * @example
  13878. *
  13879. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  13880. *
  13881. * _.pullAll(array, ['a', 'c']);
  13882. * console.log(array);
  13883. * // => ['b', 'b']
  13884. */
  13885. function pullAll(array, values) {
  13886. return (array && array.length && values && values.length)
  13887. ? basePullAll(array, values)
  13888. : array;
  13889. }
  13890. /**
  13891. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  13892. * invoked for each element of `array` and `values` to generate the criterion
  13893. * by which they're compared. The iteratee is invoked with one argument: (value).
  13894. *
  13895. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  13896. *
  13897. * @static
  13898. * @memberOf _
  13899. * @since 4.0.0
  13900. * @category Array
  13901. * @param {Array} array The array to modify.
  13902. * @param {Array} values The values to remove.
  13903. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13904. * @returns {Array} Returns `array`.
  13905. * @example
  13906. *
  13907. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  13908. *
  13909. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  13910. * console.log(array);
  13911. * // => [{ 'x': 2 }]
  13912. */
  13913. function pullAllBy(array, values, iteratee) {
  13914. return (array && array.length && values && values.length)
  13915. ? basePullAll(array, values, getIteratee(iteratee, 2))
  13916. : array;
  13917. }
  13918. /**
  13919. * This method is like `_.pullAll` except that it accepts `comparator` which
  13920. * is invoked to compare elements of `array` to `values`. The comparator is
  13921. * invoked with two arguments: (arrVal, othVal).
  13922. *
  13923. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  13924. *
  13925. * @static
  13926. * @memberOf _
  13927. * @since 4.6.0
  13928. * @category Array
  13929. * @param {Array} array The array to modify.
  13930. * @param {Array} values The values to remove.
  13931. * @param {Function} [comparator] The comparator invoked per element.
  13932. * @returns {Array} Returns `array`.
  13933. * @example
  13934. *
  13935. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  13936. *
  13937. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  13938. * console.log(array);
  13939. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  13940. */
  13941. function pullAllWith(array, values, comparator) {
  13942. return (array && array.length && values && values.length)
  13943. ? basePullAll(array, values, undefined, comparator)
  13944. : array;
  13945. }
  13946. /**
  13947. * Removes elements from `array` corresponding to `indexes` and returns an
  13948. * array of removed elements.
  13949. *
  13950. * **Note:** Unlike `_.at`, this method mutates `array`.
  13951. *
  13952. * @static
  13953. * @memberOf _
  13954. * @since 3.0.0
  13955. * @category Array
  13956. * @param {Array} array The array to modify.
  13957. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  13958. * @returns {Array} Returns the new array of removed elements.
  13959. * @example
  13960. *
  13961. * var array = ['a', 'b', 'c', 'd'];
  13962. * var pulled = _.pullAt(array, [1, 3]);
  13963. *
  13964. * console.log(array);
  13965. * // => ['a', 'c']
  13966. *
  13967. * console.log(pulled);
  13968. * // => ['b', 'd']
  13969. */
  13970. var pullAt = flatRest(function(array, indexes) {
  13971. var length = array == null ? 0 : array.length,
  13972. result = baseAt(array, indexes);
  13973. basePullAt(array, arrayMap(indexes, function(index) {
  13974. return isIndex(index, length) ? +index : index;
  13975. }).sort(compareAscending));
  13976. return result;
  13977. });
  13978. /**
  13979. * Removes all elements from `array` that `predicate` returns truthy for
  13980. * and returns an array of the removed elements. The predicate is invoked
  13981. * with three arguments: (value, index, array).
  13982. *
  13983. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  13984. * to pull elements from an array by value.
  13985. *
  13986. * @static
  13987. * @memberOf _
  13988. * @since 2.0.0
  13989. * @category Array
  13990. * @param {Array} array The array to modify.
  13991. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13992. * @returns {Array} Returns the new array of removed elements.
  13993. * @example
  13994. *
  13995. * var array = [1, 2, 3, 4];
  13996. * var evens = _.remove(array, function(n) {
  13997. * return n % 2 == 0;
  13998. * });
  13999. *
  14000. * console.log(array);
  14001. * // => [1, 3]
  14002. *
  14003. * console.log(evens);
  14004. * // => [2, 4]
  14005. */
  14006. function remove(array, predicate) {
  14007. var result = [];
  14008. if (!(array && array.length)) {
  14009. return result;
  14010. }
  14011. var index = -1,
  14012. indexes = [],
  14013. length = array.length;
  14014. predicate = getIteratee(predicate, 3);
  14015. while (++index < length) {
  14016. var value = array[index];
  14017. if (predicate(value, index, array)) {
  14018. result.push(value);
  14019. indexes.push(index);
  14020. }
  14021. }
  14022. basePullAt(array, indexes);
  14023. return result;
  14024. }
  14025. /**
  14026. * Reverses `array` so that the first element becomes the last, the second
  14027. * element becomes the second to last, and so on.
  14028. *
  14029. * **Note:** This method mutates `array` and is based on
  14030. * [`Array#reverse`](https://mdn.io/Array/reverse).
  14031. *
  14032. * @static
  14033. * @memberOf _
  14034. * @since 4.0.0
  14035. * @category Array
  14036. * @param {Array} array The array to modify.
  14037. * @returns {Array} Returns `array`.
  14038. * @example
  14039. *
  14040. * var array = [1, 2, 3];
  14041. *
  14042. * _.reverse(array);
  14043. * // => [3, 2, 1]
  14044. *
  14045. * console.log(array);
  14046. * // => [3, 2, 1]
  14047. */
  14048. function reverse(array) {
  14049. return array == null ? array : nativeReverse.call(array);
  14050. }
  14051. /**
  14052. * Creates a slice of `array` from `start` up to, but not including, `end`.
  14053. *
  14054. * **Note:** This method is used instead of
  14055. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  14056. * returned.
  14057. *
  14058. * @static
  14059. * @memberOf _
  14060. * @since 3.0.0
  14061. * @category Array
  14062. * @param {Array} array The array to slice.
  14063. * @param {number} [start=0] The start position.
  14064. * @param {number} [end=array.length] The end position.
  14065. * @returns {Array} Returns the slice of `array`.
  14066. */
  14067. function slice(array, start, end) {
  14068. var length = array == null ? 0 : array.length;
  14069. if (!length) {
  14070. return [];
  14071. }
  14072. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  14073. start = 0;
  14074. end = length;
  14075. }
  14076. else {
  14077. start = start == null ? 0 : toInteger(start);
  14078. end = end === undefined ? length : toInteger(end);
  14079. }
  14080. return baseSlice(array, start, end);
  14081. }
  14082. /**
  14083. * Uses a binary search to determine the lowest index at which `value`
  14084. * should be inserted into `array` in order to maintain its sort order.
  14085. *
  14086. * @static
  14087. * @memberOf _
  14088. * @since 0.1.0
  14089. * @category Array
  14090. * @param {Array} array The sorted array to inspect.
  14091. * @param {*} value The value to evaluate.
  14092. * @returns {number} Returns the index at which `value` should be inserted
  14093. * into `array`.
  14094. * @example
  14095. *
  14096. * _.sortedIndex([30, 50], 40);
  14097. * // => 1
  14098. */
  14099. function sortedIndex(array, value) {
  14100. return baseSortedIndex(array, value);
  14101. }
  14102. /**
  14103. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  14104. * which is invoked for `value` and each element of `array` to compute their
  14105. * sort ranking. The iteratee is invoked with one argument: (value).
  14106. *
  14107. * @static
  14108. * @memberOf _
  14109. * @since 4.0.0
  14110. * @category Array
  14111. * @param {Array} array The sorted array to inspect.
  14112. * @param {*} value The value to evaluate.
  14113. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14114. * @returns {number} Returns the index at which `value` should be inserted
  14115. * into `array`.
  14116. * @example
  14117. *
  14118. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  14119. *
  14120. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  14121. * // => 0
  14122. *
  14123. * // The `_.property` iteratee shorthand.
  14124. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  14125. * // => 0
  14126. */
  14127. function sortedIndexBy(array, value, iteratee) {
  14128. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  14129. }
  14130. /**
  14131. * This method is like `_.indexOf` except that it performs a binary
  14132. * search on a sorted `array`.
  14133. *
  14134. * @static
  14135. * @memberOf _
  14136. * @since 4.0.0
  14137. * @category Array
  14138. * @param {Array} array The array to inspect.
  14139. * @param {*} value The value to search for.
  14140. * @returns {number} Returns the index of the matched value, else `-1`.
  14141. * @example
  14142. *
  14143. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  14144. * // => 1
  14145. */
  14146. function sortedIndexOf(array, value) {
  14147. var length = array == null ? 0 : array.length;
  14148. if (length) {
  14149. var index = baseSortedIndex(array, value);
  14150. if (index < length && eq(array[index], value)) {
  14151. return index;
  14152. }
  14153. }
  14154. return -1;
  14155. }
  14156. /**
  14157. * This method is like `_.sortedIndex` except that it returns the highest
  14158. * index at which `value` should be inserted into `array` in order to
  14159. * maintain its sort order.
  14160. *
  14161. * @static
  14162. * @memberOf _
  14163. * @since 3.0.0
  14164. * @category Array
  14165. * @param {Array} array The sorted array to inspect.
  14166. * @param {*} value The value to evaluate.
  14167. * @returns {number} Returns the index at which `value` should be inserted
  14168. * into `array`.
  14169. * @example
  14170. *
  14171. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  14172. * // => 4
  14173. */
  14174. function sortedLastIndex(array, value) {
  14175. return baseSortedIndex(array, value, true);
  14176. }
  14177. /**
  14178. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  14179. * which is invoked for `value` and each element of `array` to compute their
  14180. * sort ranking. The iteratee is invoked with one argument: (value).
  14181. *
  14182. * @static
  14183. * @memberOf _
  14184. * @since 4.0.0
  14185. * @category Array
  14186. * @param {Array} array The sorted array to inspect.
  14187. * @param {*} value The value to evaluate.
  14188. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14189. * @returns {number} Returns the index at which `value` should be inserted
  14190. * into `array`.
  14191. * @example
  14192. *
  14193. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  14194. *
  14195. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  14196. * // => 1
  14197. *
  14198. * // The `_.property` iteratee shorthand.
  14199. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  14200. * // => 1
  14201. */
  14202. function sortedLastIndexBy(array, value, iteratee) {
  14203. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  14204. }
  14205. /**
  14206. * This method is like `_.lastIndexOf` except that it performs a binary
  14207. * search on a sorted `array`.
  14208. *
  14209. * @static
  14210. * @memberOf _
  14211. * @since 4.0.0
  14212. * @category Array
  14213. * @param {Array} array The array to inspect.
  14214. * @param {*} value The value to search for.
  14215. * @returns {number} Returns the index of the matched value, else `-1`.
  14216. * @example
  14217. *
  14218. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  14219. * // => 3
  14220. */
  14221. function sortedLastIndexOf(array, value) {
  14222. var length = array == null ? 0 : array.length;
  14223. if (length) {
  14224. var index = baseSortedIndex(array, value, true) - 1;
  14225. if (eq(array[index], value)) {
  14226. return index;
  14227. }
  14228. }
  14229. return -1;
  14230. }
  14231. /**
  14232. * This method is like `_.uniq` except that it's designed and optimized
  14233. * for sorted arrays.
  14234. *
  14235. * @static
  14236. * @memberOf _
  14237. * @since 4.0.0
  14238. * @category Array
  14239. * @param {Array} array The array to inspect.
  14240. * @returns {Array} Returns the new duplicate free array.
  14241. * @example
  14242. *
  14243. * _.sortedUniq([1, 1, 2]);
  14244. * // => [1, 2]
  14245. */
  14246. function sortedUniq(array) {
  14247. return (array && array.length)
  14248. ? baseSortedUniq(array)
  14249. : [];
  14250. }
  14251. /**
  14252. * This method is like `_.uniqBy` except that it's designed and optimized
  14253. * for sorted arrays.
  14254. *
  14255. * @static
  14256. * @memberOf _
  14257. * @since 4.0.0
  14258. * @category Array
  14259. * @param {Array} array The array to inspect.
  14260. * @param {Function} [iteratee] The iteratee invoked per element.
  14261. * @returns {Array} Returns the new duplicate free array.
  14262. * @example
  14263. *
  14264. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  14265. * // => [1.1, 2.3]
  14266. */
  14267. function sortedUniqBy(array, iteratee) {
  14268. return (array && array.length)
  14269. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  14270. : [];
  14271. }
  14272. /**
  14273. * Gets all but the first element of `array`.
  14274. *
  14275. * @static
  14276. * @memberOf _
  14277. * @since 4.0.0
  14278. * @category Array
  14279. * @param {Array} array The array to query.
  14280. * @returns {Array} Returns the slice of `array`.
  14281. * @example
  14282. *
  14283. * _.tail([1, 2, 3]);
  14284. * // => [2, 3]
  14285. */
  14286. function tail(array) {
  14287. var length = array == null ? 0 : array.length;
  14288. return length ? baseSlice(array, 1, length) : [];
  14289. }
  14290. /**
  14291. * Creates a slice of `array` with `n` elements taken from the beginning.
  14292. *
  14293. * @static
  14294. * @memberOf _
  14295. * @since 0.1.0
  14296. * @category Array
  14297. * @param {Array} array The array to query.
  14298. * @param {number} [n=1] The number of elements to take.
  14299. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14300. * @returns {Array} Returns the slice of `array`.
  14301. * @example
  14302. *
  14303. * _.take([1, 2, 3]);
  14304. * // => [1]
  14305. *
  14306. * _.take([1, 2, 3], 2);
  14307. * // => [1, 2]
  14308. *
  14309. * _.take([1, 2, 3], 5);
  14310. * // => [1, 2, 3]
  14311. *
  14312. * _.take([1, 2, 3], 0);
  14313. * // => []
  14314. */
  14315. function take(array, n, guard) {
  14316. if (!(array && array.length)) {
  14317. return [];
  14318. }
  14319. n = (guard || n === undefined) ? 1 : toInteger(n);
  14320. return baseSlice(array, 0, n < 0 ? 0 : n);
  14321. }
  14322. /**
  14323. * Creates a slice of `array` with `n` elements taken from the end.
  14324. *
  14325. * @static
  14326. * @memberOf _
  14327. * @since 3.0.0
  14328. * @category Array
  14329. * @param {Array} array The array to query.
  14330. * @param {number} [n=1] The number of elements to take.
  14331. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14332. * @returns {Array} Returns the slice of `array`.
  14333. * @example
  14334. *
  14335. * _.takeRight([1, 2, 3]);
  14336. * // => [3]
  14337. *
  14338. * _.takeRight([1, 2, 3], 2);
  14339. * // => [2, 3]
  14340. *
  14341. * _.takeRight([1, 2, 3], 5);
  14342. * // => [1, 2, 3]
  14343. *
  14344. * _.takeRight([1, 2, 3], 0);
  14345. * // => []
  14346. */
  14347. function takeRight(array, n, guard) {
  14348. var length = array == null ? 0 : array.length;
  14349. if (!length) {
  14350. return [];
  14351. }
  14352. n = (guard || n === undefined) ? 1 : toInteger(n);
  14353. n = length - n;
  14354. return baseSlice(array, n < 0 ? 0 : n, length);
  14355. }
  14356. /**
  14357. * Creates a slice of `array` with elements taken from the end. Elements are
  14358. * taken until `predicate` returns falsey. The predicate is invoked with
  14359. * three arguments: (value, index, array).
  14360. *
  14361. * @static
  14362. * @memberOf _
  14363. * @since 3.0.0
  14364. * @category Array
  14365. * @param {Array} array The array to query.
  14366. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  14367. * @returns {Array} Returns the slice of `array`.
  14368. * @example
  14369. *
  14370. * var users = [
  14371. * { 'user': 'barney', 'active': true },
  14372. * { 'user': 'fred', 'active': false },
  14373. * { 'user': 'pebbles', 'active': false }
  14374. * ];
  14375. *
  14376. * _.takeRightWhile(users, function(o) { return !o.active; });
  14377. * // => objects for ['fred', 'pebbles']
  14378. *
  14379. * // The `_.matches` iteratee shorthand.
  14380. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  14381. * // => objects for ['pebbles']
  14382. *
  14383. * // The `_.matchesProperty` iteratee shorthand.
  14384. * _.takeRightWhile(users, ['active', false]);
  14385. * // => objects for ['fred', 'pebbles']
  14386. *
  14387. * // The `_.property` iteratee shorthand.
  14388. * _.takeRightWhile(users, 'active');
  14389. * // => []
  14390. */
  14391. function takeRightWhile(array, predicate) {
  14392. return (array && array.length)
  14393. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  14394. : [];
  14395. }
  14396. /**
  14397. * Creates a slice of `array` with elements taken from the beginning. Elements
  14398. * are taken until `predicate` returns falsey. The predicate is invoked with
  14399. * three arguments: (value, index, array).
  14400. *
  14401. * @static
  14402. * @memberOf _
  14403. * @since 3.0.0
  14404. * @category Array
  14405. * @param {Array} array The array to query.
  14406. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  14407. * @returns {Array} Returns the slice of `array`.
  14408. * @example
  14409. *
  14410. * var users = [
  14411. * { 'user': 'barney', 'active': false },
  14412. * { 'user': 'fred', 'active': false },
  14413. * { 'user': 'pebbles', 'active': true }
  14414. * ];
  14415. *
  14416. * _.takeWhile(users, function(o) { return !o.active; });
  14417. * // => objects for ['barney', 'fred']
  14418. *
  14419. * // The `_.matches` iteratee shorthand.
  14420. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  14421. * // => objects for ['barney']
  14422. *
  14423. * // The `_.matchesProperty` iteratee shorthand.
  14424. * _.takeWhile(users, ['active', false]);
  14425. * // => objects for ['barney', 'fred']
  14426. *
  14427. * // The `_.property` iteratee shorthand.
  14428. * _.takeWhile(users, 'active');
  14429. * // => []
  14430. */
  14431. function takeWhile(array, predicate) {
  14432. return (array && array.length)
  14433. ? baseWhile(array, getIteratee(predicate, 3))
  14434. : [];
  14435. }
  14436. /**
  14437. * Creates an array of unique values, in order, from all given arrays using
  14438. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14439. * for equality comparisons.
  14440. *
  14441. * @static
  14442. * @memberOf _
  14443. * @since 0.1.0
  14444. * @category Array
  14445. * @param {...Array} [arrays] The arrays to inspect.
  14446. * @returns {Array} Returns the new array of combined values.
  14447. * @example
  14448. *
  14449. * _.union([2], [1, 2]);
  14450. * // => [2, 1]
  14451. */
  14452. var union = baseRest(function(arrays) {
  14453. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  14454. });
  14455. /**
  14456. * This method is like `_.union` except that it accepts `iteratee` which is
  14457. * invoked for each element of each `arrays` to generate the criterion by
  14458. * which uniqueness is computed. Result values are chosen from the first
  14459. * array in which the value occurs. The iteratee is invoked with one argument:
  14460. * (value).
  14461. *
  14462. * @static
  14463. * @memberOf _
  14464. * @since 4.0.0
  14465. * @category Array
  14466. * @param {...Array} [arrays] The arrays to inspect.
  14467. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14468. * @returns {Array} Returns the new array of combined values.
  14469. * @example
  14470. *
  14471. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  14472. * // => [2.1, 1.2]
  14473. *
  14474. * // The `_.property` iteratee shorthand.
  14475. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  14476. * // => [{ 'x': 1 }, { 'x': 2 }]
  14477. */
  14478. var unionBy = baseRest(function(arrays) {
  14479. var iteratee = last(arrays);
  14480. if (isArrayLikeObject(iteratee)) {
  14481. iteratee = undefined;
  14482. }
  14483. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  14484. });
  14485. /**
  14486. * This method is like `_.union` except that it accepts `comparator` which
  14487. * is invoked to compare elements of `arrays`. Result values are chosen from
  14488. * the first array in which the value occurs. The comparator is invoked
  14489. * with two arguments: (arrVal, othVal).
  14490. *
  14491. * @static
  14492. * @memberOf _
  14493. * @since 4.0.0
  14494. * @category Array
  14495. * @param {...Array} [arrays] The arrays to inspect.
  14496. * @param {Function} [comparator] The comparator invoked per element.
  14497. * @returns {Array} Returns the new array of combined values.
  14498. * @example
  14499. *
  14500. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  14501. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  14502. *
  14503. * _.unionWith(objects, others, _.isEqual);
  14504. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  14505. */
  14506. var unionWith = baseRest(function(arrays) {
  14507. var comparator = last(arrays);
  14508. comparator = typeof comparator == 'function' ? comparator : undefined;
  14509. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  14510. });
  14511. /**
  14512. * Creates a duplicate-free version of an array, using
  14513. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14514. * for equality comparisons, in which only the first occurrence of each element
  14515. * is kept. The order of result values is determined by the order they occur
  14516. * in the array.
  14517. *
  14518. * @static
  14519. * @memberOf _
  14520. * @since 0.1.0
  14521. * @category Array
  14522. * @param {Array} array The array to inspect.
  14523. * @returns {Array} Returns the new duplicate free array.
  14524. * @example
  14525. *
  14526. * _.uniq([2, 1, 2]);
  14527. * // => [2, 1]
  14528. */
  14529. function uniq(array) {
  14530. return (array && array.length) ? baseUniq(array) : [];
  14531. }
  14532. /**
  14533. * This method is like `_.uniq` except that it accepts `iteratee` which is
  14534. * invoked for each element in `array` to generate the criterion by which
  14535. * uniqueness is computed. The order of result values is determined by the
  14536. * order they occur in the array. The iteratee is invoked with one argument:
  14537. * (value).
  14538. *
  14539. * @static
  14540. * @memberOf _
  14541. * @since 4.0.0
  14542. * @category Array
  14543. * @param {Array} array The array to inspect.
  14544. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14545. * @returns {Array} Returns the new duplicate free array.
  14546. * @example
  14547. *
  14548. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  14549. * // => [2.1, 1.2]
  14550. *
  14551. * // The `_.property` iteratee shorthand.
  14552. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  14553. * // => [{ 'x': 1 }, { 'x': 2 }]
  14554. */
  14555. function uniqBy(array, iteratee) {
  14556. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  14557. }
  14558. /**
  14559. * This method is like `_.uniq` except that it accepts `comparator` which
  14560. * is invoked to compare elements of `array`. The order of result values is
  14561. * determined by the order they occur in the array.The comparator is invoked
  14562. * with two arguments: (arrVal, othVal).
  14563. *
  14564. * @static
  14565. * @memberOf _
  14566. * @since 4.0.0
  14567. * @category Array
  14568. * @param {Array} array The array to inspect.
  14569. * @param {Function} [comparator] The comparator invoked per element.
  14570. * @returns {Array} Returns the new duplicate free array.
  14571. * @example
  14572. *
  14573. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  14574. *
  14575. * _.uniqWith(objects, _.isEqual);
  14576. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  14577. */
  14578. function uniqWith(array, comparator) {
  14579. comparator = typeof comparator == 'function' ? comparator : undefined;
  14580. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  14581. }
  14582. /**
  14583. * This method is like `_.zip` except that it accepts an array of grouped
  14584. * elements and creates an array regrouping the elements to their pre-zip
  14585. * configuration.
  14586. *
  14587. * @static
  14588. * @memberOf _
  14589. * @since 1.2.0
  14590. * @category Array
  14591. * @param {Array} array The array of grouped elements to process.
  14592. * @returns {Array} Returns the new array of regrouped elements.
  14593. * @example
  14594. *
  14595. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  14596. * // => [['a', 1, true], ['b', 2, false]]
  14597. *
  14598. * _.unzip(zipped);
  14599. * // => [['a', 'b'], [1, 2], [true, false]]
  14600. */
  14601. function unzip(array) {
  14602. if (!(array && array.length)) {
  14603. return [];
  14604. }
  14605. var length = 0;
  14606. array = arrayFilter(array, function(group) {
  14607. if (isArrayLikeObject(group)) {
  14608. length = nativeMax(group.length, length);
  14609. return true;
  14610. }
  14611. });
  14612. return baseTimes(length, function(index) {
  14613. return arrayMap(array, baseProperty(index));
  14614. });
  14615. }
  14616. /**
  14617. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  14618. * how regrouped values should be combined. The iteratee is invoked with the
  14619. * elements of each group: (...group).
  14620. *
  14621. * @static
  14622. * @memberOf _
  14623. * @since 3.8.0
  14624. * @category Array
  14625. * @param {Array} array The array of grouped elements to process.
  14626. * @param {Function} [iteratee=_.identity] The function to combine
  14627. * regrouped values.
  14628. * @returns {Array} Returns the new array of regrouped elements.
  14629. * @example
  14630. *
  14631. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  14632. * // => [[1, 10, 100], [2, 20, 200]]
  14633. *
  14634. * _.unzipWith(zipped, _.add);
  14635. * // => [3, 30, 300]
  14636. */
  14637. function unzipWith(array, iteratee) {
  14638. if (!(array && array.length)) {
  14639. return [];
  14640. }
  14641. var result = unzip(array);
  14642. if (iteratee == null) {
  14643. return result;
  14644. }
  14645. return arrayMap(result, function(group) {
  14646. return apply(iteratee, undefined, group);
  14647. });
  14648. }
  14649. /**
  14650. * Creates an array excluding all given values using
  14651. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14652. * for equality comparisons.
  14653. *
  14654. * **Note:** Unlike `_.pull`, this method returns a new array.
  14655. *
  14656. * @static
  14657. * @memberOf _
  14658. * @since 0.1.0
  14659. * @category Array
  14660. * @param {Array} array The array to inspect.
  14661. * @param {...*} [values] The values to exclude.
  14662. * @returns {Array} Returns the new array of filtered values.
  14663. * @see _.difference, _.xor
  14664. * @example
  14665. *
  14666. * _.without([2, 1, 2, 3], 1, 2);
  14667. * // => [3]
  14668. */
  14669. var without = baseRest(function(array, values) {
  14670. return isArrayLikeObject(array)
  14671. ? baseDifference(array, values)
  14672. : [];
  14673. });
  14674. /**
  14675. * Creates an array of unique values that is the
  14676. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  14677. * of the given arrays. The order of result values is determined by the order
  14678. * they occur in the arrays.
  14679. *
  14680. * @static
  14681. * @memberOf _
  14682. * @since 2.4.0
  14683. * @category Array
  14684. * @param {...Array} [arrays] The arrays to inspect.
  14685. * @returns {Array} Returns the new array of filtered values.
  14686. * @see _.difference, _.without
  14687. * @example
  14688. *
  14689. * _.xor([2, 1], [2, 3]);
  14690. * // => [1, 3]
  14691. */
  14692. var xor = baseRest(function(arrays) {
  14693. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  14694. });
  14695. /**
  14696. * This method is like `_.xor` except that it accepts `iteratee` which is
  14697. * invoked for each element of each `arrays` to generate the criterion by
  14698. * which by which they're compared. The order of result values is determined
  14699. * by the order they occur in the arrays. The iteratee is invoked with one
  14700. * argument: (value).
  14701. *
  14702. * @static
  14703. * @memberOf _
  14704. * @since 4.0.0
  14705. * @category Array
  14706. * @param {...Array} [arrays] The arrays to inspect.
  14707. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14708. * @returns {Array} Returns the new array of filtered values.
  14709. * @example
  14710. *
  14711. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  14712. * // => [1.2, 3.4]
  14713. *
  14714. * // The `_.property` iteratee shorthand.
  14715. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  14716. * // => [{ 'x': 2 }]
  14717. */
  14718. var xorBy = baseRest(function(arrays) {
  14719. var iteratee = last(arrays);
  14720. if (isArrayLikeObject(iteratee)) {
  14721. iteratee = undefined;
  14722. }
  14723. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  14724. });
  14725. /**
  14726. * This method is like `_.xor` except that it accepts `comparator` which is
  14727. * invoked to compare elements of `arrays`. The order of result values is
  14728. * determined by the order they occur in the arrays. The comparator is invoked
  14729. * with two arguments: (arrVal, othVal).
  14730. *
  14731. * @static
  14732. * @memberOf _
  14733. * @since 4.0.0
  14734. * @category Array
  14735. * @param {...Array} [arrays] The arrays to inspect.
  14736. * @param {Function} [comparator] The comparator invoked per element.
  14737. * @returns {Array} Returns the new array of filtered values.
  14738. * @example
  14739. *
  14740. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  14741. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  14742. *
  14743. * _.xorWith(objects, others, _.isEqual);
  14744. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  14745. */
  14746. var xorWith = baseRest(function(arrays) {
  14747. var comparator = last(arrays);
  14748. comparator = typeof comparator == 'function' ? comparator : undefined;
  14749. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  14750. });
  14751. /**
  14752. * Creates an array of grouped elements, the first of which contains the
  14753. * first elements of the given arrays, the second of which contains the
  14754. * second elements of the given arrays, and so on.
  14755. *
  14756. * @static
  14757. * @memberOf _
  14758. * @since 0.1.0
  14759. * @category Array
  14760. * @param {...Array} [arrays] The arrays to process.
  14761. * @returns {Array} Returns the new array of grouped elements.
  14762. * @example
  14763. *
  14764. * _.zip(['a', 'b'], [1, 2], [true, false]);
  14765. * // => [['a', 1, true], ['b', 2, false]]
  14766. */
  14767. var zip = baseRest(unzip);
  14768. /**
  14769. * This method is like `_.fromPairs` except that it accepts two arrays,
  14770. * one of property identifiers and one of corresponding values.
  14771. *
  14772. * @static
  14773. * @memberOf _
  14774. * @since 0.4.0
  14775. * @category Array
  14776. * @param {Array} [props=[]] The property identifiers.
  14777. * @param {Array} [values=[]] The property values.
  14778. * @returns {Object} Returns the new object.
  14779. * @example
  14780. *
  14781. * _.zipObject(['a', 'b'], [1, 2]);
  14782. * // => { 'a': 1, 'b': 2 }
  14783. */
  14784. function zipObject(props, values) {
  14785. return baseZipObject(props || [], values || [], assignValue);
  14786. }
  14787. /**
  14788. * This method is like `_.zipObject` except that it supports property paths.
  14789. *
  14790. * @static
  14791. * @memberOf _
  14792. * @since 4.1.0
  14793. * @category Array
  14794. * @param {Array} [props=[]] The property identifiers.
  14795. * @param {Array} [values=[]] The property values.
  14796. * @returns {Object} Returns the new object.
  14797. * @example
  14798. *
  14799. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  14800. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  14801. */
  14802. function zipObjectDeep(props, values) {
  14803. return baseZipObject(props || [], values || [], baseSet);
  14804. }
  14805. /**
  14806. * This method is like `_.zip` except that it accepts `iteratee` to specify
  14807. * how grouped values should be combined. The iteratee is invoked with the
  14808. * elements of each group: (...group).
  14809. *
  14810. * @static
  14811. * @memberOf _
  14812. * @since 3.8.0
  14813. * @category Array
  14814. * @param {...Array} [arrays] The arrays to process.
  14815. * @param {Function} [iteratee=_.identity] The function to combine
  14816. * grouped values.
  14817. * @returns {Array} Returns the new array of grouped elements.
  14818. * @example
  14819. *
  14820. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  14821. * return a + b + c;
  14822. * });
  14823. * // => [111, 222]
  14824. */
  14825. var zipWith = baseRest(function(arrays) {
  14826. var length = arrays.length,
  14827. iteratee = length > 1 ? arrays[length - 1] : undefined;
  14828. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  14829. return unzipWith(arrays, iteratee);
  14830. });
  14831. /*------------------------------------------------------------------------*/
  14832. /**
  14833. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  14834. * chain sequences enabled. The result of such sequences must be unwrapped
  14835. * with `_#value`.
  14836. *
  14837. * @static
  14838. * @memberOf _
  14839. * @since 1.3.0
  14840. * @category Seq
  14841. * @param {*} value The value to wrap.
  14842. * @returns {Object} Returns the new `lodash` wrapper instance.
  14843. * @example
  14844. *
  14845. * var users = [
  14846. * { 'user': 'barney', 'age': 36 },
  14847. * { 'user': 'fred', 'age': 40 },
  14848. * { 'user': 'pebbles', 'age': 1 }
  14849. * ];
  14850. *
  14851. * var youngest = _
  14852. * .chain(users)
  14853. * .sortBy('age')
  14854. * .map(function(o) {
  14855. * return o.user + ' is ' + o.age;
  14856. * })
  14857. * .head()
  14858. * .value();
  14859. * // => 'pebbles is 1'
  14860. */
  14861. function chain(value) {
  14862. var result = lodash(value);
  14863. result.__chain__ = true;
  14864. return result;
  14865. }
  14866. /**
  14867. * This method invokes `interceptor` and returns `value`. The interceptor
  14868. * is invoked with one argument; (value). The purpose of this method is to
  14869. * "tap into" a method chain sequence in order to modify intermediate results.
  14870. *
  14871. * @static
  14872. * @memberOf _
  14873. * @since 0.1.0
  14874. * @category Seq
  14875. * @param {*} value The value to provide to `interceptor`.
  14876. * @param {Function} interceptor The function to invoke.
  14877. * @returns {*} Returns `value`.
  14878. * @example
  14879. *
  14880. * _([1, 2, 3])
  14881. * .tap(function(array) {
  14882. * // Mutate input array.
  14883. * array.pop();
  14884. * })
  14885. * .reverse()
  14886. * .value();
  14887. * // => [2, 1]
  14888. */
  14889. function tap(value, interceptor) {
  14890. interceptor(value);
  14891. return value;
  14892. }
  14893. /**
  14894. * This method is like `_.tap` except that it returns the result of `interceptor`.
  14895. * The purpose of this method is to "pass thru" values replacing intermediate
  14896. * results in a method chain sequence.
  14897. *
  14898. * @static
  14899. * @memberOf _
  14900. * @since 3.0.0
  14901. * @category Seq
  14902. * @param {*} value The value to provide to `interceptor`.
  14903. * @param {Function} interceptor The function to invoke.
  14904. * @returns {*} Returns the result of `interceptor`.
  14905. * @example
  14906. *
  14907. * _(' abc ')
  14908. * .chain()
  14909. * .trim()
  14910. * .thru(function(value) {
  14911. * return [value];
  14912. * })
  14913. * .value();
  14914. * // => ['abc']
  14915. */
  14916. function thru(value, interceptor) {
  14917. return interceptor(value);
  14918. }
  14919. /**
  14920. * This method is the wrapper version of `_.at`.
  14921. *
  14922. * @name at
  14923. * @memberOf _
  14924. * @since 1.0.0
  14925. * @category Seq
  14926. * @param {...(string|string[])} [paths] The property paths to pick.
  14927. * @returns {Object} Returns the new `lodash` wrapper instance.
  14928. * @example
  14929. *
  14930. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  14931. *
  14932. * _(object).at(['a[0].b.c', 'a[1]']).value();
  14933. * // => [3, 4]
  14934. */
  14935. var wrapperAt = flatRest(function(paths) {
  14936. var length = paths.length,
  14937. start = length ? paths[0] : 0,
  14938. value = this.__wrapped__,
  14939. interceptor = function(object) { return baseAt(object, paths); };
  14940. if (length > 1 || this.__actions__.length ||
  14941. !(value instanceof LazyWrapper) || !isIndex(start)) {
  14942. return this.thru(interceptor);
  14943. }
  14944. value = value.slice(start, +start + (length ? 1 : 0));
  14945. value.__actions__.push({
  14946. 'func': thru,
  14947. 'args': [interceptor],
  14948. 'thisArg': undefined
  14949. });
  14950. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  14951. if (length && !array.length) {
  14952. array.push(undefined);
  14953. }
  14954. return array;
  14955. });
  14956. });
  14957. /**
  14958. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  14959. *
  14960. * @name chain
  14961. * @memberOf _
  14962. * @since 0.1.0
  14963. * @category Seq
  14964. * @returns {Object} Returns the new `lodash` wrapper instance.
  14965. * @example
  14966. *
  14967. * var users = [
  14968. * { 'user': 'barney', 'age': 36 },
  14969. * { 'user': 'fred', 'age': 40 }
  14970. * ];
  14971. *
  14972. * // A sequence without explicit chaining.
  14973. * _(users).head();
  14974. * // => { 'user': 'barney', 'age': 36 }
  14975. *
  14976. * // A sequence with explicit chaining.
  14977. * _(users)
  14978. * .chain()
  14979. * .head()
  14980. * .pick('user')
  14981. * .value();
  14982. * // => { 'user': 'barney' }
  14983. */
  14984. function wrapperChain() {
  14985. return chain(this);
  14986. }
  14987. /**
  14988. * Executes the chain sequence and returns the wrapped result.
  14989. *
  14990. * @name commit
  14991. * @memberOf _
  14992. * @since 3.2.0
  14993. * @category Seq
  14994. * @returns {Object} Returns the new `lodash` wrapper instance.
  14995. * @example
  14996. *
  14997. * var array = [1, 2];
  14998. * var wrapped = _(array).push(3);
  14999. *
  15000. * console.log(array);
  15001. * // => [1, 2]
  15002. *
  15003. * wrapped = wrapped.commit();
  15004. * console.log(array);
  15005. * // => [1, 2, 3]
  15006. *
  15007. * wrapped.last();
  15008. * // => 3
  15009. *
  15010. * console.log(array);
  15011. * // => [1, 2, 3]
  15012. */
  15013. function wrapperCommit() {
  15014. return new LodashWrapper(this.value(), this.__chain__);
  15015. }
  15016. /**
  15017. * Gets the next value on a wrapped object following the
  15018. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  15019. *
  15020. * @name next
  15021. * @memberOf _
  15022. * @since 4.0.0
  15023. * @category Seq
  15024. * @returns {Object} Returns the next iterator value.
  15025. * @example
  15026. *
  15027. * var wrapped = _([1, 2]);
  15028. *
  15029. * wrapped.next();
  15030. * // => { 'done': false, 'value': 1 }
  15031. *
  15032. * wrapped.next();
  15033. * // => { 'done': false, 'value': 2 }
  15034. *
  15035. * wrapped.next();
  15036. * // => { 'done': true, 'value': undefined }
  15037. */
  15038. function wrapperNext() {
  15039. if (this.__values__ === undefined) {
  15040. this.__values__ = toArray(this.value());
  15041. }
  15042. var done = this.__index__ >= this.__values__.length,
  15043. value = done ? undefined : this.__values__[this.__index__++];
  15044. return { 'done': done, 'value': value };
  15045. }
  15046. /**
  15047. * Enables the wrapper to be iterable.
  15048. *
  15049. * @name Symbol.iterator
  15050. * @memberOf _
  15051. * @since 4.0.0
  15052. * @category Seq
  15053. * @returns {Object} Returns the wrapper object.
  15054. * @example
  15055. *
  15056. * var wrapped = _([1, 2]);
  15057. *
  15058. * wrapped[Symbol.iterator]() === wrapped;
  15059. * // => true
  15060. *
  15061. * Array.from(wrapped);
  15062. * // => [1, 2]
  15063. */
  15064. function wrapperToIterator() {
  15065. return this;
  15066. }
  15067. /**
  15068. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  15069. *
  15070. * @name plant
  15071. * @memberOf _
  15072. * @since 3.2.0
  15073. * @category Seq
  15074. * @param {*} value The value to plant.
  15075. * @returns {Object} Returns the new `lodash` wrapper instance.
  15076. * @example
  15077. *
  15078. * function square(n) {
  15079. * return n * n;
  15080. * }
  15081. *
  15082. * var wrapped = _([1, 2]).map(square);
  15083. * var other = wrapped.plant([3, 4]);
  15084. *
  15085. * other.value();
  15086. * // => [9, 16]
  15087. *
  15088. * wrapped.value();
  15089. * // => [1, 4]
  15090. */
  15091. function wrapperPlant(value) {
  15092. var result,
  15093. parent = this;
  15094. while (parent instanceof baseLodash) {
  15095. var clone = wrapperClone(parent);
  15096. clone.__index__ = 0;
  15097. clone.__values__ = undefined;
  15098. if (result) {
  15099. previous.__wrapped__ = clone;
  15100. } else {
  15101. result = clone;
  15102. }
  15103. var previous = clone;
  15104. parent = parent.__wrapped__;
  15105. }
  15106. previous.__wrapped__ = value;
  15107. return result;
  15108. }
  15109. /**
  15110. * This method is the wrapper version of `_.reverse`.
  15111. *
  15112. * **Note:** This method mutates the wrapped array.
  15113. *
  15114. * @name reverse
  15115. * @memberOf _
  15116. * @since 0.1.0
  15117. * @category Seq
  15118. * @returns {Object} Returns the new `lodash` wrapper instance.
  15119. * @example
  15120. *
  15121. * var array = [1, 2, 3];
  15122. *
  15123. * _(array).reverse().value()
  15124. * // => [3, 2, 1]
  15125. *
  15126. * console.log(array);
  15127. * // => [3, 2, 1]
  15128. */
  15129. function wrapperReverse() {
  15130. var value = this.__wrapped__;
  15131. if (value instanceof LazyWrapper) {
  15132. var wrapped = value;
  15133. if (this.__actions__.length) {
  15134. wrapped = new LazyWrapper(this);
  15135. }
  15136. wrapped = wrapped.reverse();
  15137. wrapped.__actions__.push({
  15138. 'func': thru,
  15139. 'args': [reverse],
  15140. 'thisArg': undefined
  15141. });
  15142. return new LodashWrapper(wrapped, this.__chain__);
  15143. }
  15144. return this.thru(reverse);
  15145. }
  15146. /**
  15147. * Executes the chain sequence to resolve the unwrapped value.
  15148. *
  15149. * @name value
  15150. * @memberOf _
  15151. * @since 0.1.0
  15152. * @alias toJSON, valueOf
  15153. * @category Seq
  15154. * @returns {*} Returns the resolved unwrapped value.
  15155. * @example
  15156. *
  15157. * _([1, 2, 3]).value();
  15158. * // => [1, 2, 3]
  15159. */
  15160. function wrapperValue() {
  15161. return baseWrapperValue(this.__wrapped__, this.__actions__);
  15162. }
  15163. /*------------------------------------------------------------------------*/
  15164. /**
  15165. * Creates an object composed of keys generated from the results of running
  15166. * each element of `collection` thru `iteratee`. The corresponding value of
  15167. * each key is the number of times the key was returned by `iteratee`. The
  15168. * iteratee is invoked with one argument: (value).
  15169. *
  15170. * @static
  15171. * @memberOf _
  15172. * @since 0.5.0
  15173. * @category Collection
  15174. * @param {Array|Object} collection The collection to iterate over.
  15175. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  15176. * @returns {Object} Returns the composed aggregate object.
  15177. * @example
  15178. *
  15179. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  15180. * // => { '4': 1, '6': 2 }
  15181. *
  15182. * // The `_.property` iteratee shorthand.
  15183. * _.countBy(['one', 'two', 'three'], 'length');
  15184. * // => { '3': 2, '5': 1 }
  15185. */
  15186. var countBy = createAggregator(function(result, value, key) {
  15187. if (hasOwnProperty.call(result, key)) {
  15188. ++result[key];
  15189. } else {
  15190. baseAssignValue(result, key, 1);
  15191. }
  15192. });
  15193. /**
  15194. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  15195. * Iteration is stopped once `predicate` returns falsey. The predicate is
  15196. * invoked with three arguments: (value, index|key, collection).
  15197. *
  15198. * **Note:** This method returns `true` for
  15199. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  15200. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  15201. * elements of empty collections.
  15202. *
  15203. * @static
  15204. * @memberOf _
  15205. * @since 0.1.0
  15206. * @category Collection
  15207. * @param {Array|Object} collection The collection to iterate over.
  15208. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  15209. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15210. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  15211. * else `false`.
  15212. * @example
  15213. *
  15214. * _.every([true, 1, null, 'yes'], Boolean);
  15215. * // => false
  15216. *
  15217. * var users = [
  15218. * { 'user': 'barney', 'age': 36, 'active': false },
  15219. * { 'user': 'fred', 'age': 40, 'active': false }
  15220. * ];
  15221. *
  15222. * // The `_.matches` iteratee shorthand.
  15223. * _.every(users, { 'user': 'barney', 'active': false });
  15224. * // => false
  15225. *
  15226. * // The `_.matchesProperty` iteratee shorthand.
  15227. * _.every(users, ['active', false]);
  15228. * // => true
  15229. *
  15230. * // The `_.property` iteratee shorthand.
  15231. * _.every(users, 'active');
  15232. * // => false
  15233. */
  15234. function every(collection, predicate, guard) {
  15235. var func = isArray(collection) ? arrayEvery : baseEvery;
  15236. if (guard && isIterateeCall(collection, predicate, guard)) {
  15237. predicate = undefined;
  15238. }
  15239. return func(collection, getIteratee(predicate, 3));
  15240. }
  15241. /**
  15242. * Iterates over elements of `collection`, returning an array of all elements
  15243. * `predicate` returns truthy for. The predicate is invoked with three
  15244. * arguments: (value, index|key, collection).
  15245. *
  15246. * **Note:** Unlike `_.remove`, this method returns a new array.
  15247. *
  15248. * @static
  15249. * @memberOf _
  15250. * @since 0.1.0
  15251. * @category Collection
  15252. * @param {Array|Object} collection The collection to iterate over.
  15253. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  15254. * @returns {Array} Returns the new filtered array.
  15255. * @see _.reject
  15256. * @example
  15257. *
  15258. * var users = [
  15259. * { 'user': 'barney', 'age': 36, 'active': true },
  15260. * { 'user': 'fred', 'age': 40, 'active': false }
  15261. * ];
  15262. *
  15263. * _.filter(users, function(o) { return !o.active; });
  15264. * // => objects for ['fred']
  15265. *
  15266. * // The `_.matches` iteratee shorthand.
  15267. * _.filter(users, { 'age': 36, 'active': true });
  15268. * // => objects for ['barney']
  15269. *
  15270. * // The `_.matchesProperty` iteratee shorthand.
  15271. * _.filter(users, ['active', false]);
  15272. * // => objects for ['fred']
  15273. *
  15274. * // The `_.property` iteratee shorthand.
  15275. * _.filter(users, 'active');
  15276. * // => objects for ['barney']
  15277. */
  15278. function filter(collection, predicate) {
  15279. var func = isArray(collection) ? arrayFilter : baseFilter;
  15280. return func(collection, getIteratee(predicate, 3));
  15281. }
  15282. /**
  15283. * Iterates over elements of `collection`, returning the first element
  15284. * `predicate` returns truthy for. The predicate is invoked with three
  15285. * arguments: (value, index|key, collection).
  15286. *
  15287. * @static
  15288. * @memberOf _
  15289. * @since 0.1.0
  15290. * @category Collection
  15291. * @param {Array|Object} collection The collection to inspect.
  15292. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  15293. * @param {number} [fromIndex=0] The index to search from.
  15294. * @returns {*} Returns the matched element, else `undefined`.
  15295. * @example
  15296. *
  15297. * var users = [
  15298. * { 'user': 'barney', 'age': 36, 'active': true },
  15299. * { 'user': 'fred', 'age': 40, 'active': false },
  15300. * { 'user': 'pebbles', 'age': 1, 'active': true }
  15301. * ];
  15302. *
  15303. * _.find(users, function(o) { return o.age < 40; });
  15304. * // => object for 'barney'
  15305. *
  15306. * // The `_.matches` iteratee shorthand.
  15307. * _.find(users, { 'age': 1, 'active': true });
  15308. * // => object for 'pebbles'
  15309. *
  15310. * // The `_.matchesProperty` iteratee shorthand.
  15311. * _.find(users, ['active', false]);
  15312. * // => object for 'fred'
  15313. *
  15314. * // The `_.property` iteratee shorthand.
  15315. * _.find(users, 'active');
  15316. * // => object for 'barney'
  15317. */
  15318. var find = createFind(findIndex);
  15319. /**
  15320. * This method is like `_.find` except that it iterates over elements of
  15321. * `collection` from right to left.
  15322. *
  15323. * @static
  15324. * @memberOf _
  15325. * @since 2.0.0
  15326. * @category Collection
  15327. * @param {Array|Object} collection The collection to inspect.
  15328. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  15329. * @param {number} [fromIndex=collection.length-1] The index to search from.
  15330. * @returns {*} Returns the matched element, else `undefined`.
  15331. * @example
  15332. *
  15333. * _.findLast([1, 2, 3, 4], function(n) {
  15334. * return n % 2 == 1;
  15335. * });
  15336. * // => 3
  15337. */
  15338. var findLast = createFind(findLastIndex);
  15339. /**
  15340. * Creates a flattened array of values by running each element in `collection`
  15341. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  15342. * with three arguments: (value, index|key, collection).
  15343. *
  15344. * @static
  15345. * @memberOf _
  15346. * @since 4.0.0
  15347. * @category Collection
  15348. * @param {Array|Object} collection The collection to iterate over.
  15349. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15350. * @returns {Array} Returns the new flattened array.
  15351. * @example
  15352. *
  15353. * function duplicate(n) {
  15354. * return [n, n];
  15355. * }
  15356. *
  15357. * _.flatMap([1, 2], duplicate);
  15358. * // => [1, 1, 2, 2]
  15359. */
  15360. function flatMap(collection, iteratee) {
  15361. return baseFlatten(map(collection, iteratee), 1);
  15362. }
  15363. /**
  15364. * This method is like `_.flatMap` except that it recursively flattens the
  15365. * mapped results.
  15366. *
  15367. * @static
  15368. * @memberOf _
  15369. * @since 4.7.0
  15370. * @category Collection
  15371. * @param {Array|Object} collection The collection to iterate over.
  15372. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15373. * @returns {Array} Returns the new flattened array.
  15374. * @example
  15375. *
  15376. * function duplicate(n) {
  15377. * return [[[n, n]]];
  15378. * }
  15379. *
  15380. * _.flatMapDeep([1, 2], duplicate);
  15381. * // => [1, 1, 2, 2]
  15382. */
  15383. function flatMapDeep(collection, iteratee) {
  15384. return baseFlatten(map(collection, iteratee), INFINITY);
  15385. }
  15386. /**
  15387. * This method is like `_.flatMap` except that it recursively flattens the
  15388. * mapped results up to `depth` times.
  15389. *
  15390. * @static
  15391. * @memberOf _
  15392. * @since 4.7.0
  15393. * @category Collection
  15394. * @param {Array|Object} collection The collection to iterate over.
  15395. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15396. * @param {number} [depth=1] The maximum recursion depth.
  15397. * @returns {Array} Returns the new flattened array.
  15398. * @example
  15399. *
  15400. * function duplicate(n) {
  15401. * return [[[n, n]]];
  15402. * }
  15403. *
  15404. * _.flatMapDepth([1, 2], duplicate, 2);
  15405. * // => [[1, 1], [2, 2]]
  15406. */
  15407. function flatMapDepth(collection, iteratee, depth) {
  15408. depth = depth === undefined ? 1 : toInteger(depth);
  15409. return baseFlatten(map(collection, iteratee), depth);
  15410. }
  15411. /**
  15412. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  15413. * The iteratee is invoked with three arguments: (value, index|key, collection).
  15414. * Iteratee functions may exit iteration early by explicitly returning `false`.
  15415. *
  15416. * **Note:** As with other "Collections" methods, objects with a "length"
  15417. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  15418. * or `_.forOwn` for object iteration.
  15419. *
  15420. * @static
  15421. * @memberOf _
  15422. * @since 0.1.0
  15423. * @alias each
  15424. * @category Collection
  15425. * @param {Array|Object} collection The collection to iterate over.
  15426. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15427. * @returns {Array|Object} Returns `collection`.
  15428. * @see _.forEachRight
  15429. * @example
  15430. *
  15431. * _.forEach([1, 2], function(value) {
  15432. * console.log(value);
  15433. * });
  15434. * // => Logs `1` then `2`.
  15435. *
  15436. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  15437. * console.log(key);
  15438. * });
  15439. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  15440. */
  15441. function forEach(collection, iteratee) {
  15442. var func = isArray(collection) ? arrayEach : baseEach;
  15443. return func(collection, getIteratee(iteratee, 3));
  15444. }
  15445. /**
  15446. * This method is like `_.forEach` except that it iterates over elements of
  15447. * `collection` from right to left.
  15448. *
  15449. * @static
  15450. * @memberOf _
  15451. * @since 2.0.0
  15452. * @alias eachRight
  15453. * @category Collection
  15454. * @param {Array|Object} collection The collection to iterate over.
  15455. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15456. * @returns {Array|Object} Returns `collection`.
  15457. * @see _.forEach
  15458. * @example
  15459. *
  15460. * _.forEachRight([1, 2], function(value) {
  15461. * console.log(value);
  15462. * });
  15463. * // => Logs `2` then `1`.
  15464. */
  15465. function forEachRight(collection, iteratee) {
  15466. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  15467. return func(collection, getIteratee(iteratee, 3));
  15468. }
  15469. /**
  15470. * Creates an object composed of keys generated from the results of running
  15471. * each element of `collection` thru `iteratee`. The order of grouped values
  15472. * is determined by the order they occur in `collection`. The corresponding
  15473. * value of each key is an array of elements responsible for generating the
  15474. * key. The iteratee is invoked with one argument: (value).
  15475. *
  15476. * @static
  15477. * @memberOf _
  15478. * @since 0.1.0
  15479. * @category Collection
  15480. * @param {Array|Object} collection The collection to iterate over.
  15481. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  15482. * @returns {Object} Returns the composed aggregate object.
  15483. * @example
  15484. *
  15485. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  15486. * // => { '4': [4.2], '6': [6.1, 6.3] }
  15487. *
  15488. * // The `_.property` iteratee shorthand.
  15489. * _.groupBy(['one', 'two', 'three'], 'length');
  15490. * // => { '3': ['one', 'two'], '5': ['three'] }
  15491. */
  15492. var groupBy = createAggregator(function(result, value, key) {
  15493. if (hasOwnProperty.call(result, key)) {
  15494. result[key].push(value);
  15495. } else {
  15496. baseAssignValue(result, key, [value]);
  15497. }
  15498. });
  15499. /**
  15500. * Checks if `value` is in `collection`. If `collection` is a string, it's
  15501. * checked for a substring of `value`, otherwise
  15502. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  15503. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  15504. * the offset from the end of `collection`.
  15505. *
  15506. * @static
  15507. * @memberOf _
  15508. * @since 0.1.0
  15509. * @category Collection
  15510. * @param {Array|Object|string} collection The collection to inspect.
  15511. * @param {*} value The value to search for.
  15512. * @param {number} [fromIndex=0] The index to search from.
  15513. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  15514. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  15515. * @example
  15516. *
  15517. * _.includes([1, 2, 3], 1);
  15518. * // => true
  15519. *
  15520. * _.includes([1, 2, 3], 1, 2);
  15521. * // => false
  15522. *
  15523. * _.includes({ 'a': 1, 'b': 2 }, 1);
  15524. * // => true
  15525. *
  15526. * _.includes('abcd', 'bc');
  15527. * // => true
  15528. */
  15529. function includes(collection, value, fromIndex, guard) {
  15530. collection = isArrayLike(collection) ? collection : values(collection);
  15531. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  15532. var length = collection.length;
  15533. if (fromIndex < 0) {
  15534. fromIndex = nativeMax(length + fromIndex, 0);
  15535. }
  15536. return isString(collection)
  15537. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  15538. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  15539. }
  15540. /**
  15541. * Invokes the method at `path` of each element in `collection`, returning
  15542. * an array of the results of each invoked method. Any additional arguments
  15543. * are provided to each invoked method. If `path` is a function, it's invoked
  15544. * for, and `this` bound to, each element in `collection`.
  15545. *
  15546. * @static
  15547. * @memberOf _
  15548. * @since 4.0.0
  15549. * @category Collection
  15550. * @param {Array|Object} collection The collection to iterate over.
  15551. * @param {Array|Function|string} path The path of the method to invoke or
  15552. * the function invoked per iteration.
  15553. * @param {...*} [args] The arguments to invoke each method with.
  15554. * @returns {Array} Returns the array of results.
  15555. * @example
  15556. *
  15557. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  15558. * // => [[1, 5, 7], [1, 2, 3]]
  15559. *
  15560. * _.invokeMap([123, 456], String.prototype.split, '');
  15561. * // => [['1', '2', '3'], ['4', '5', '6']]
  15562. */
  15563. var invokeMap = baseRest(function(collection, path, args) {
  15564. var index = -1,
  15565. isFunc = typeof path == 'function',
  15566. result = isArrayLike(collection) ? Array(collection.length) : [];
  15567. baseEach(collection, function(value) {
  15568. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  15569. });
  15570. return result;
  15571. });
  15572. /**
  15573. * Creates an object composed of keys generated from the results of running
  15574. * each element of `collection` thru `iteratee`. The corresponding value of
  15575. * each key is the last element responsible for generating the key. The
  15576. * iteratee is invoked with one argument: (value).
  15577. *
  15578. * @static
  15579. * @memberOf _
  15580. * @since 4.0.0
  15581. * @category Collection
  15582. * @param {Array|Object} collection The collection to iterate over.
  15583. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  15584. * @returns {Object} Returns the composed aggregate object.
  15585. * @example
  15586. *
  15587. * var array = [
  15588. * { 'dir': 'left', 'code': 97 },
  15589. * { 'dir': 'right', 'code': 100 }
  15590. * ];
  15591. *
  15592. * _.keyBy(array, function(o) {
  15593. * return String.fromCharCode(o.code);
  15594. * });
  15595. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  15596. *
  15597. * _.keyBy(array, 'dir');
  15598. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  15599. */
  15600. var keyBy = createAggregator(function(result, value, key) {
  15601. baseAssignValue(result, key, value);
  15602. });
  15603. /**
  15604. * Creates an array of values by running each element in `collection` thru
  15605. * `iteratee`. The iteratee is invoked with three arguments:
  15606. * (value, index|key, collection).
  15607. *
  15608. * Many lodash methods are guarded to work as iteratees for methods like
  15609. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  15610. *
  15611. * The guarded methods are:
  15612. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  15613. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  15614. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  15615. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  15616. *
  15617. * @static
  15618. * @memberOf _
  15619. * @since 0.1.0
  15620. * @category Collection
  15621. * @param {Array|Object} collection The collection to iterate over.
  15622. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15623. * @returns {Array} Returns the new mapped array.
  15624. * @example
  15625. *
  15626. * function square(n) {
  15627. * return n * n;
  15628. * }
  15629. *
  15630. * _.map([4, 8], square);
  15631. * // => [16, 64]
  15632. *
  15633. * _.map({ 'a': 4, 'b': 8 }, square);
  15634. * // => [16, 64] (iteration order is not guaranteed)
  15635. *
  15636. * var users = [
  15637. * { 'user': 'barney' },
  15638. * { 'user': 'fred' }
  15639. * ];
  15640. *
  15641. * // The `_.property` iteratee shorthand.
  15642. * _.map(users, 'user');
  15643. * // => ['barney', 'fred']
  15644. */
  15645. function map(collection, iteratee) {
  15646. var func = isArray(collection) ? arrayMap : baseMap;
  15647. return func(collection, getIteratee(iteratee, 3));
  15648. }
  15649. /**
  15650. * This method is like `_.sortBy` except that it allows specifying the sort
  15651. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  15652. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  15653. * descending or "asc" for ascending sort order of corresponding values.
  15654. *
  15655. * @static
  15656. * @memberOf _
  15657. * @since 4.0.0
  15658. * @category Collection
  15659. * @param {Array|Object} collection The collection to iterate over.
  15660. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  15661. * The iteratees to sort by.
  15662. * @param {string[]} [orders] The sort orders of `iteratees`.
  15663. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  15664. * @returns {Array} Returns the new sorted array.
  15665. * @example
  15666. *
  15667. * var users = [
  15668. * { 'user': 'fred', 'age': 48 },
  15669. * { 'user': 'barney', 'age': 34 },
  15670. * { 'user': 'fred', 'age': 40 },
  15671. * { 'user': 'barney', 'age': 36 }
  15672. * ];
  15673. *
  15674. * // Sort by `user` in ascending order and by `age` in descending order.
  15675. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  15676. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  15677. */
  15678. function orderBy(collection, iteratees, orders, guard) {
  15679. if (collection == null) {
  15680. return [];
  15681. }
  15682. if (!isArray(iteratees)) {
  15683. iteratees = iteratees == null ? [] : [iteratees];
  15684. }
  15685. orders = guard ? undefined : orders;
  15686. if (!isArray(orders)) {
  15687. orders = orders == null ? [] : [orders];
  15688. }
  15689. return baseOrderBy(collection, iteratees, orders);
  15690. }
  15691. /**
  15692. * Creates an array of elements split into two groups, the first of which
  15693. * contains elements `predicate` returns truthy for, the second of which
  15694. * contains elements `predicate` returns falsey for. The predicate is
  15695. * invoked with one argument: (value).
  15696. *
  15697. * @static
  15698. * @memberOf _
  15699. * @since 3.0.0
  15700. * @category Collection
  15701. * @param {Array|Object} collection The collection to iterate over.
  15702. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  15703. * @returns {Array} Returns the array of grouped elements.
  15704. * @example
  15705. *
  15706. * var users = [
  15707. * { 'user': 'barney', 'age': 36, 'active': false },
  15708. * { 'user': 'fred', 'age': 40, 'active': true },
  15709. * { 'user': 'pebbles', 'age': 1, 'active': false }
  15710. * ];
  15711. *
  15712. * _.partition(users, function(o) { return o.active; });
  15713. * // => objects for [['fred'], ['barney', 'pebbles']]
  15714. *
  15715. * // The `_.matches` iteratee shorthand.
  15716. * _.partition(users, { 'age': 1, 'active': false });
  15717. * // => objects for [['pebbles'], ['barney', 'fred']]
  15718. *
  15719. * // The `_.matchesProperty` iteratee shorthand.
  15720. * _.partition(users, ['active', false]);
  15721. * // => objects for [['barney', 'pebbles'], ['fred']]
  15722. *
  15723. * // The `_.property` iteratee shorthand.
  15724. * _.partition(users, 'active');
  15725. * // => objects for [['fred'], ['barney', 'pebbles']]
  15726. */
  15727. var partition = createAggregator(function(result, value, key) {
  15728. result[key ? 0 : 1].push(value);
  15729. }, function() { return [[], []]; });
  15730. /**
  15731. * Reduces `collection` to a value which is the accumulated result of running
  15732. * each element in `collection` thru `iteratee`, where each successive
  15733. * invocation is supplied the return value of the previous. If `accumulator`
  15734. * is not given, the first element of `collection` is used as the initial
  15735. * value. The iteratee is invoked with four arguments:
  15736. * (accumulator, value, index|key, collection).
  15737. *
  15738. * Many lodash methods are guarded to work as iteratees for methods like
  15739. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  15740. *
  15741. * The guarded methods are:
  15742. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  15743. * and `sortBy`
  15744. *
  15745. * @static
  15746. * @memberOf _
  15747. * @since 0.1.0
  15748. * @category Collection
  15749. * @param {Array|Object} collection The collection to iterate over.
  15750. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15751. * @param {*} [accumulator] The initial value.
  15752. * @returns {*} Returns the accumulated value.
  15753. * @see _.reduceRight
  15754. * @example
  15755. *
  15756. * _.reduce([1, 2], function(sum, n) {
  15757. * return sum + n;
  15758. * }, 0);
  15759. * // => 3
  15760. *
  15761. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  15762. * (result[value] || (result[value] = [])).push(key);
  15763. * return result;
  15764. * }, {});
  15765. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  15766. */
  15767. function reduce(collection, iteratee, accumulator) {
  15768. var func = isArray(collection) ? arrayReduce : baseReduce,
  15769. initAccum = arguments.length < 3;
  15770. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  15771. }
  15772. /**
  15773. * This method is like `_.reduce` except that it iterates over elements of
  15774. * `collection` from right to left.
  15775. *
  15776. * @static
  15777. * @memberOf _
  15778. * @since 0.1.0
  15779. * @category Collection
  15780. * @param {Array|Object} collection The collection to iterate over.
  15781. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15782. * @param {*} [accumulator] The initial value.
  15783. * @returns {*} Returns the accumulated value.
  15784. * @see _.reduce
  15785. * @example
  15786. *
  15787. * var array = [[0, 1], [2, 3], [4, 5]];
  15788. *
  15789. * _.reduceRight(array, function(flattened, other) {
  15790. * return flattened.concat(other);
  15791. * }, []);
  15792. * // => [4, 5, 2, 3, 0, 1]
  15793. */
  15794. function reduceRight(collection, iteratee, accumulator) {
  15795. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  15796. initAccum = arguments.length < 3;
  15797. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  15798. }
  15799. /**
  15800. * The opposite of `_.filter`; this method returns the elements of `collection`
  15801. * that `predicate` does **not** return truthy for.
  15802. *
  15803. * @static
  15804. * @memberOf _
  15805. * @since 0.1.0
  15806. * @category Collection
  15807. * @param {Array|Object} collection The collection to iterate over.
  15808. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  15809. * @returns {Array} Returns the new filtered array.
  15810. * @see _.filter
  15811. * @example
  15812. *
  15813. * var users = [
  15814. * { 'user': 'barney', 'age': 36, 'active': false },
  15815. * { 'user': 'fred', 'age': 40, 'active': true }
  15816. * ];
  15817. *
  15818. * _.reject(users, function(o) { return !o.active; });
  15819. * // => objects for ['fred']
  15820. *
  15821. * // The `_.matches` iteratee shorthand.
  15822. * _.reject(users, { 'age': 40, 'active': true });
  15823. * // => objects for ['barney']
  15824. *
  15825. * // The `_.matchesProperty` iteratee shorthand.
  15826. * _.reject(users, ['active', false]);
  15827. * // => objects for ['fred']
  15828. *
  15829. * // The `_.property` iteratee shorthand.
  15830. * _.reject(users, 'active');
  15831. * // => objects for ['barney']
  15832. */
  15833. function reject(collection, predicate) {
  15834. var func = isArray(collection) ? arrayFilter : baseFilter;
  15835. return func(collection, negate(getIteratee(predicate, 3)));
  15836. }
  15837. /**
  15838. * Gets a random element from `collection`.
  15839. *
  15840. * @static
  15841. * @memberOf _
  15842. * @since 2.0.0
  15843. * @category Collection
  15844. * @param {Array|Object} collection The collection to sample.
  15845. * @returns {*} Returns the random element.
  15846. * @example
  15847. *
  15848. * _.sample([1, 2, 3, 4]);
  15849. * // => 2
  15850. */
  15851. function sample(collection) {
  15852. var func = isArray(collection) ? arraySample : baseSample;
  15853. return func(collection);
  15854. }
  15855. /**
  15856. * Gets `n` random elements at unique keys from `collection` up to the
  15857. * size of `collection`.
  15858. *
  15859. * @static
  15860. * @memberOf _
  15861. * @since 4.0.0
  15862. * @category Collection
  15863. * @param {Array|Object} collection The collection to sample.
  15864. * @param {number} [n=1] The number of elements to sample.
  15865. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15866. * @returns {Array} Returns the random elements.
  15867. * @example
  15868. *
  15869. * _.sampleSize([1, 2, 3], 2);
  15870. * // => [3, 1]
  15871. *
  15872. * _.sampleSize([1, 2, 3], 4);
  15873. * // => [2, 3, 1]
  15874. */
  15875. function sampleSize(collection, n, guard) {
  15876. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  15877. n = 1;
  15878. } else {
  15879. n = toInteger(n);
  15880. }
  15881. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  15882. return func(collection, n);
  15883. }
  15884. /**
  15885. * Creates an array of shuffled values, using a version of the
  15886. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  15887. *
  15888. * @static
  15889. * @memberOf _
  15890. * @since 0.1.0
  15891. * @category Collection
  15892. * @param {Array|Object} collection The collection to shuffle.
  15893. * @returns {Array} Returns the new shuffled array.
  15894. * @example
  15895. *
  15896. * _.shuffle([1, 2, 3, 4]);
  15897. * // => [4, 1, 3, 2]
  15898. */
  15899. function shuffle(collection) {
  15900. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  15901. return func(collection);
  15902. }
  15903. /**
  15904. * Gets the size of `collection` by returning its length for array-like
  15905. * values or the number of own enumerable string keyed properties for objects.
  15906. *
  15907. * @static
  15908. * @memberOf _
  15909. * @since 0.1.0
  15910. * @category Collection
  15911. * @param {Array|Object|string} collection The collection to inspect.
  15912. * @returns {number} Returns the collection size.
  15913. * @example
  15914. *
  15915. * _.size([1, 2, 3]);
  15916. * // => 3
  15917. *
  15918. * _.size({ 'a': 1, 'b': 2 });
  15919. * // => 2
  15920. *
  15921. * _.size('pebbles');
  15922. * // => 7
  15923. */
  15924. function size(collection) {
  15925. if (collection == null) {
  15926. return 0;
  15927. }
  15928. if (isArrayLike(collection)) {
  15929. return isString(collection) ? stringSize(collection) : collection.length;
  15930. }
  15931. var tag = getTag(collection);
  15932. if (tag == mapTag || tag == setTag) {
  15933. return collection.size;
  15934. }
  15935. return baseKeys(collection).length;
  15936. }
  15937. /**
  15938. * Checks if `predicate` returns truthy for **any** element of `collection`.
  15939. * Iteration is stopped once `predicate` returns truthy. The predicate is
  15940. * invoked with three arguments: (value, index|key, collection).
  15941. *
  15942. * @static
  15943. * @memberOf _
  15944. * @since 0.1.0
  15945. * @category Collection
  15946. * @param {Array|Object} collection The collection to iterate over.
  15947. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  15948. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15949. * @returns {boolean} Returns `true` if any element passes the predicate check,
  15950. * else `false`.
  15951. * @example
  15952. *
  15953. * _.some([null, 0, 'yes', false], Boolean);
  15954. * // => true
  15955. *
  15956. * var users = [
  15957. * { 'user': 'barney', 'active': true },
  15958. * { 'user': 'fred', 'active': false }
  15959. * ];
  15960. *
  15961. * // The `_.matches` iteratee shorthand.
  15962. * _.some(users, { 'user': 'barney', 'active': false });
  15963. * // => false
  15964. *
  15965. * // The `_.matchesProperty` iteratee shorthand.
  15966. * _.some(users, ['active', false]);
  15967. * // => true
  15968. *
  15969. * // The `_.property` iteratee shorthand.
  15970. * _.some(users, 'active');
  15971. * // => true
  15972. */
  15973. function some(collection, predicate, guard) {
  15974. var func = isArray(collection) ? arraySome : baseSome;
  15975. if (guard && isIterateeCall(collection, predicate, guard)) {
  15976. predicate = undefined;
  15977. }
  15978. return func(collection, getIteratee(predicate, 3));
  15979. }
  15980. /**
  15981. * Creates an array of elements, sorted in ascending order by the results of
  15982. * running each element in a collection thru each iteratee. This method
  15983. * performs a stable sort, that is, it preserves the original sort order of
  15984. * equal elements. The iteratees are invoked with one argument: (value).
  15985. *
  15986. * @static
  15987. * @memberOf _
  15988. * @since 0.1.0
  15989. * @category Collection
  15990. * @param {Array|Object} collection The collection to iterate over.
  15991. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  15992. * The iteratees to sort by.
  15993. * @returns {Array} Returns the new sorted array.
  15994. * @example
  15995. *
  15996. * var users = [
  15997. * { 'user': 'fred', 'age': 48 },
  15998. * { 'user': 'barney', 'age': 36 },
  15999. * { 'user': 'fred', 'age': 40 },
  16000. * { 'user': 'barney', 'age': 34 }
  16001. * ];
  16002. *
  16003. * _.sortBy(users, [function(o) { return o.user; }]);
  16004. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  16005. *
  16006. * _.sortBy(users, ['user', 'age']);
  16007. * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
  16008. */
  16009. var sortBy = baseRest(function(collection, iteratees) {
  16010. if (collection == null) {
  16011. return [];
  16012. }
  16013. var length = iteratees.length;
  16014. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  16015. iteratees = [];
  16016. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  16017. iteratees = [iteratees[0]];
  16018. }
  16019. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  16020. });
  16021. /*------------------------------------------------------------------------*/
  16022. /**
  16023. * Gets the timestamp of the number of milliseconds that have elapsed since
  16024. * the Unix epoch (1 January 1970 00:00:00 UTC).
  16025. *
  16026. * @static
  16027. * @memberOf _
  16028. * @since 2.4.0
  16029. * @category Date
  16030. * @returns {number} Returns the timestamp.
  16031. * @example
  16032. *
  16033. * _.defer(function(stamp) {
  16034. * console.log(_.now() - stamp);
  16035. * }, _.now());
  16036. * // => Logs the number of milliseconds it took for the deferred invocation.
  16037. */
  16038. var now = ctxNow || function() {
  16039. return root.Date.now();
  16040. };
  16041. /*------------------------------------------------------------------------*/
  16042. /**
  16043. * The opposite of `_.before`; this method creates a function that invokes
  16044. * `func` once it's called `n` or more times.
  16045. *
  16046. * @static
  16047. * @memberOf _
  16048. * @since 0.1.0
  16049. * @category Function
  16050. * @param {number} n The number of calls before `func` is invoked.
  16051. * @param {Function} func The function to restrict.
  16052. * @returns {Function} Returns the new restricted function.
  16053. * @example
  16054. *
  16055. * var saves = ['profile', 'settings'];
  16056. *
  16057. * var done = _.after(saves.length, function() {
  16058. * console.log('done saving!');
  16059. * });
  16060. *
  16061. * _.forEach(saves, function(type) {
  16062. * asyncSave({ 'type': type, 'complete': done });
  16063. * });
  16064. * // => Logs 'done saving!' after the two async saves have completed.
  16065. */
  16066. function after(n, func) {
  16067. if (typeof func != 'function') {
  16068. throw new TypeError(FUNC_ERROR_TEXT);
  16069. }
  16070. n = toInteger(n);
  16071. return function() {
  16072. if (--n < 1) {
  16073. return func.apply(this, arguments);
  16074. }
  16075. };
  16076. }
  16077. /**
  16078. * Creates a function that invokes `func`, with up to `n` arguments,
  16079. * ignoring any additional arguments.
  16080. *
  16081. * @static
  16082. * @memberOf _
  16083. * @since 3.0.0
  16084. * @category Function
  16085. * @param {Function} func The function to cap arguments for.
  16086. * @param {number} [n=func.length] The arity cap.
  16087. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16088. * @returns {Function} Returns the new capped function.
  16089. * @example
  16090. *
  16091. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  16092. * // => [6, 8, 10]
  16093. */
  16094. function ary(func, n, guard) {
  16095. n = guard ? undefined : n;
  16096. n = (func && n == null) ? func.length : n;
  16097. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  16098. }
  16099. /**
  16100. * Creates a function that invokes `func`, with the `this` binding and arguments
  16101. * of the created function, while it's called less than `n` times. Subsequent
  16102. * calls to the created function return the result of the last `func` invocation.
  16103. *
  16104. * @static
  16105. * @memberOf _
  16106. * @since 3.0.0
  16107. * @category Function
  16108. * @param {number} n The number of calls at which `func` is no longer invoked.
  16109. * @param {Function} func The function to restrict.
  16110. * @returns {Function} Returns the new restricted function.
  16111. * @example
  16112. *
  16113. * jQuery(element).on('click', _.before(5, addContactToList));
  16114. * // => Allows adding up to 4 contacts to the list.
  16115. */
  16116. function before(n, func) {
  16117. var result;
  16118. if (typeof func != 'function') {
  16119. throw new TypeError(FUNC_ERROR_TEXT);
  16120. }
  16121. n = toInteger(n);
  16122. return function() {
  16123. if (--n > 0) {
  16124. result = func.apply(this, arguments);
  16125. }
  16126. if (n <= 1) {
  16127. func = undefined;
  16128. }
  16129. return result;
  16130. };
  16131. }
  16132. /**
  16133. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  16134. * and `partials` prepended to the arguments it receives.
  16135. *
  16136. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  16137. * may be used as a placeholder for partially applied arguments.
  16138. *
  16139. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  16140. * property of bound functions.
  16141. *
  16142. * @static
  16143. * @memberOf _
  16144. * @since 0.1.0
  16145. * @category Function
  16146. * @param {Function} func The function to bind.
  16147. * @param {*} thisArg The `this` binding of `func`.
  16148. * @param {...*} [partials] The arguments to be partially applied.
  16149. * @returns {Function} Returns the new bound function.
  16150. * @example
  16151. *
  16152. * function greet(greeting, punctuation) {
  16153. * return greeting + ' ' + this.user + punctuation;
  16154. * }
  16155. *
  16156. * var object = { 'user': 'fred' };
  16157. *
  16158. * var bound = _.bind(greet, object, 'hi');
  16159. * bound('!');
  16160. * // => 'hi fred!'
  16161. *
  16162. * // Bound with placeholders.
  16163. * var bound = _.bind(greet, object, _, '!');
  16164. * bound('hi');
  16165. * // => 'hi fred!'
  16166. */
  16167. var bind = baseRest(function(func, thisArg, partials) {
  16168. var bitmask = WRAP_BIND_FLAG;
  16169. if (partials.length) {
  16170. var holders = replaceHolders(partials, getHolder(bind));
  16171. bitmask |= WRAP_PARTIAL_FLAG;
  16172. }
  16173. return createWrap(func, bitmask, thisArg, partials, holders);
  16174. });
  16175. /**
  16176. * Creates a function that invokes the method at `object[key]` with `partials`
  16177. * prepended to the arguments it receives.
  16178. *
  16179. * This method differs from `_.bind` by allowing bound functions to reference
  16180. * methods that may be redefined or don't yet exist. See
  16181. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  16182. * for more details.
  16183. *
  16184. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  16185. * builds, may be used as a placeholder for partially applied arguments.
  16186. *
  16187. * @static
  16188. * @memberOf _
  16189. * @since 0.10.0
  16190. * @category Function
  16191. * @param {Object} object The object to invoke the method on.
  16192. * @param {string} key The key of the method.
  16193. * @param {...*} [partials] The arguments to be partially applied.
  16194. * @returns {Function} Returns the new bound function.
  16195. * @example
  16196. *
  16197. * var object = {
  16198. * 'user': 'fred',
  16199. * 'greet': function(greeting, punctuation) {
  16200. * return greeting + ' ' + this.user + punctuation;
  16201. * }
  16202. * };
  16203. *
  16204. * var bound = _.bindKey(object, 'greet', 'hi');
  16205. * bound('!');
  16206. * // => 'hi fred!'
  16207. *
  16208. * object.greet = function(greeting, punctuation) {
  16209. * return greeting + 'ya ' + this.user + punctuation;
  16210. * };
  16211. *
  16212. * bound('!');
  16213. * // => 'hiya fred!'
  16214. *
  16215. * // Bound with placeholders.
  16216. * var bound = _.bindKey(object, 'greet', _, '!');
  16217. * bound('hi');
  16218. * // => 'hiya fred!'
  16219. */
  16220. var bindKey = baseRest(function(object, key, partials) {
  16221. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  16222. if (partials.length) {
  16223. var holders = replaceHolders(partials, getHolder(bindKey));
  16224. bitmask |= WRAP_PARTIAL_FLAG;
  16225. }
  16226. return createWrap(key, bitmask, object, partials, holders);
  16227. });
  16228. /**
  16229. * Creates a function that accepts arguments of `func` and either invokes
  16230. * `func` returning its result, if at least `arity` number of arguments have
  16231. * been provided, or returns a function that accepts the remaining `func`
  16232. * arguments, and so on. The arity of `func` may be specified if `func.length`
  16233. * is not sufficient.
  16234. *
  16235. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  16236. * may be used as a placeholder for provided arguments.
  16237. *
  16238. * **Note:** This method doesn't set the "length" property of curried functions.
  16239. *
  16240. * @static
  16241. * @memberOf _
  16242. * @since 2.0.0
  16243. * @category Function
  16244. * @param {Function} func The function to curry.
  16245. * @param {number} [arity=func.length] The arity of `func`.
  16246. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16247. * @returns {Function} Returns the new curried function.
  16248. * @example
  16249. *
  16250. * var abc = function(a, b, c) {
  16251. * return [a, b, c];
  16252. * };
  16253. *
  16254. * var curried = _.curry(abc);
  16255. *
  16256. * curried(1)(2)(3);
  16257. * // => [1, 2, 3]
  16258. *
  16259. * curried(1, 2)(3);
  16260. * // => [1, 2, 3]
  16261. *
  16262. * curried(1, 2, 3);
  16263. * // => [1, 2, 3]
  16264. *
  16265. * // Curried with placeholders.
  16266. * curried(1)(_, 3)(2);
  16267. * // => [1, 2, 3]
  16268. */
  16269. function curry(func, arity, guard) {
  16270. arity = guard ? undefined : arity;
  16271. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  16272. result.placeholder = curry.placeholder;
  16273. return result;
  16274. }
  16275. /**
  16276. * This method is like `_.curry` except that arguments are applied to `func`
  16277. * in the manner of `_.partialRight` instead of `_.partial`.
  16278. *
  16279. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  16280. * builds, may be used as a placeholder for provided arguments.
  16281. *
  16282. * **Note:** This method doesn't set the "length" property of curried functions.
  16283. *
  16284. * @static
  16285. * @memberOf _
  16286. * @since 3.0.0
  16287. * @category Function
  16288. * @param {Function} func The function to curry.
  16289. * @param {number} [arity=func.length] The arity of `func`.
  16290. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16291. * @returns {Function} Returns the new curried function.
  16292. * @example
  16293. *
  16294. * var abc = function(a, b, c) {
  16295. * return [a, b, c];
  16296. * };
  16297. *
  16298. * var curried = _.curryRight(abc);
  16299. *
  16300. * curried(3)(2)(1);
  16301. * // => [1, 2, 3]
  16302. *
  16303. * curried(2, 3)(1);
  16304. * // => [1, 2, 3]
  16305. *
  16306. * curried(1, 2, 3);
  16307. * // => [1, 2, 3]
  16308. *
  16309. * // Curried with placeholders.
  16310. * curried(3)(1, _)(2);
  16311. * // => [1, 2, 3]
  16312. */
  16313. function curryRight(func, arity, guard) {
  16314. arity = guard ? undefined : arity;
  16315. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  16316. result.placeholder = curryRight.placeholder;
  16317. return result;
  16318. }
  16319. /**
  16320. * Creates a debounced function that delays invoking `func` until after `wait`
  16321. * milliseconds have elapsed since the last time the debounced function was
  16322. * invoked. The debounced function comes with a `cancel` method to cancel
  16323. * delayed `func` invocations and a `flush` method to immediately invoke them.
  16324. * Provide `options` to indicate whether `func` should be invoked on the
  16325. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  16326. * with the last arguments provided to the debounced function. Subsequent
  16327. * calls to the debounced function return the result of the last `func`
  16328. * invocation.
  16329. *
  16330. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  16331. * invoked on the trailing edge of the timeout only if the debounced function
  16332. * is invoked more than once during the `wait` timeout.
  16333. *
  16334. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  16335. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  16336. *
  16337. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  16338. * for details over the differences between `_.debounce` and `_.throttle`.
  16339. *
  16340. * @static
  16341. * @memberOf _
  16342. * @since 0.1.0
  16343. * @category Function
  16344. * @param {Function} func The function to debounce.
  16345. * @param {number} [wait=0] The number of milliseconds to delay.
  16346. * @param {Object} [options={}] The options object.
  16347. * @param {boolean} [options.leading=false]
  16348. * Specify invoking on the leading edge of the timeout.
  16349. * @param {number} [options.maxWait]
  16350. * The maximum time `func` is allowed to be delayed before it's invoked.
  16351. * @param {boolean} [options.trailing=true]
  16352. * Specify invoking on the trailing edge of the timeout.
  16353. * @returns {Function} Returns the new debounced function.
  16354. * @example
  16355. *
  16356. * // Avoid costly calculations while the window size is in flux.
  16357. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  16358. *
  16359. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  16360. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  16361. * 'leading': true,
  16362. * 'trailing': false
  16363. * }));
  16364. *
  16365. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  16366. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  16367. * var source = new EventSource('/stream');
  16368. * jQuery(source).on('message', debounced);
  16369. *
  16370. * // Cancel the trailing debounced invocation.
  16371. * jQuery(window).on('popstate', debounced.cancel);
  16372. */
  16373. function debounce(func, wait, options) {
  16374. var lastArgs,
  16375. lastThis,
  16376. maxWait,
  16377. result,
  16378. timerId,
  16379. lastCallTime,
  16380. lastInvokeTime = 0,
  16381. leading = false,
  16382. maxing = false,
  16383. trailing = true;
  16384. if (typeof func != 'function') {
  16385. throw new TypeError(FUNC_ERROR_TEXT);
  16386. }
  16387. wait = toNumber(wait) || 0;
  16388. if (isObject(options)) {
  16389. leading = !!options.leading;
  16390. maxing = 'maxWait' in options;
  16391. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  16392. trailing = 'trailing' in options ? !!options.trailing : trailing;
  16393. }
  16394. function invokeFunc(time) {
  16395. var args = lastArgs,
  16396. thisArg = lastThis;
  16397. lastArgs = lastThis = undefined;
  16398. lastInvokeTime = time;
  16399. result = func.apply(thisArg, args);
  16400. return result;
  16401. }
  16402. function leadingEdge(time) {
  16403. // Reset any `maxWait` timer.
  16404. lastInvokeTime = time;
  16405. // Start the timer for the trailing edge.
  16406. timerId = setTimeout(timerExpired, wait);
  16407. // Invoke the leading edge.
  16408. return leading ? invokeFunc(time) : result;
  16409. }
  16410. function remainingWait(time) {
  16411. var timeSinceLastCall = time - lastCallTime,
  16412. timeSinceLastInvoke = time - lastInvokeTime,
  16413. timeWaiting = wait - timeSinceLastCall;
  16414. return maxing
  16415. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  16416. : timeWaiting;
  16417. }
  16418. function shouldInvoke(time) {
  16419. var timeSinceLastCall = time - lastCallTime,
  16420. timeSinceLastInvoke = time - lastInvokeTime;
  16421. // Either this is the first call, activity has stopped and we're at the
  16422. // trailing edge, the system time has gone backwards and we're treating
  16423. // it as the trailing edge, or we've hit the `maxWait` limit.
  16424. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  16425. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  16426. }
  16427. function timerExpired() {
  16428. var time = now();
  16429. if (shouldInvoke(time)) {
  16430. return trailingEdge(time);
  16431. }
  16432. // Restart the timer.
  16433. timerId = setTimeout(timerExpired, remainingWait(time));
  16434. }
  16435. function trailingEdge(time) {
  16436. timerId = undefined;
  16437. // Only invoke if we have `lastArgs` which means `func` has been
  16438. // debounced at least once.
  16439. if (trailing && lastArgs) {
  16440. return invokeFunc(time);
  16441. }
  16442. lastArgs = lastThis = undefined;
  16443. return result;
  16444. }
  16445. function cancel() {
  16446. if (timerId !== undefined) {
  16447. clearTimeout(timerId);
  16448. }
  16449. lastInvokeTime = 0;
  16450. lastArgs = lastCallTime = lastThis = timerId = undefined;
  16451. }
  16452. function flush() {
  16453. return timerId === undefined ? result : trailingEdge(now());
  16454. }
  16455. function debounced() {
  16456. var time = now(),
  16457. isInvoking = shouldInvoke(time);
  16458. lastArgs = arguments;
  16459. lastThis = this;
  16460. lastCallTime = time;
  16461. if (isInvoking) {
  16462. if (timerId === undefined) {
  16463. return leadingEdge(lastCallTime);
  16464. }
  16465. if (maxing) {
  16466. // Handle invocations in a tight loop.
  16467. timerId = setTimeout(timerExpired, wait);
  16468. return invokeFunc(lastCallTime);
  16469. }
  16470. }
  16471. if (timerId === undefined) {
  16472. timerId = setTimeout(timerExpired, wait);
  16473. }
  16474. return result;
  16475. }
  16476. debounced.cancel = cancel;
  16477. debounced.flush = flush;
  16478. return debounced;
  16479. }
  16480. /**
  16481. * Defers invoking the `func` until the current call stack has cleared. Any
  16482. * additional arguments are provided to `func` when it's invoked.
  16483. *
  16484. * @static
  16485. * @memberOf _
  16486. * @since 0.1.0
  16487. * @category Function
  16488. * @param {Function} func The function to defer.
  16489. * @param {...*} [args] The arguments to invoke `func` with.
  16490. * @returns {number} Returns the timer id.
  16491. * @example
  16492. *
  16493. * _.defer(function(text) {
  16494. * console.log(text);
  16495. * }, 'deferred');
  16496. * // => Logs 'deferred' after one millisecond.
  16497. */
  16498. var defer = baseRest(function(func, args) {
  16499. return baseDelay(func, 1, args);
  16500. });
  16501. /**
  16502. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  16503. * provided to `func` when it's invoked.
  16504. *
  16505. * @static
  16506. * @memberOf _
  16507. * @since 0.1.0
  16508. * @category Function
  16509. * @param {Function} func The function to delay.
  16510. * @param {number} wait The number of milliseconds to delay invocation.
  16511. * @param {...*} [args] The arguments to invoke `func` with.
  16512. * @returns {number} Returns the timer id.
  16513. * @example
  16514. *
  16515. * _.delay(function(text) {
  16516. * console.log(text);
  16517. * }, 1000, 'later');
  16518. * // => Logs 'later' after one second.
  16519. */
  16520. var delay = baseRest(function(func, wait, args) {
  16521. return baseDelay(func, toNumber(wait) || 0, args);
  16522. });
  16523. /**
  16524. * Creates a function that invokes `func` with arguments reversed.
  16525. *
  16526. * @static
  16527. * @memberOf _
  16528. * @since 4.0.0
  16529. * @category Function
  16530. * @param {Function} func The function to flip arguments for.
  16531. * @returns {Function} Returns the new flipped function.
  16532. * @example
  16533. *
  16534. * var flipped = _.flip(function() {
  16535. * return _.toArray(arguments);
  16536. * });
  16537. *
  16538. * flipped('a', 'b', 'c', 'd');
  16539. * // => ['d', 'c', 'b', 'a']
  16540. */
  16541. function flip(func) {
  16542. return createWrap(func, WRAP_FLIP_FLAG);
  16543. }
  16544. /**
  16545. * Creates a function that memoizes the result of `func`. If `resolver` is
  16546. * provided, it determines the cache key for storing the result based on the
  16547. * arguments provided to the memoized function. By default, the first argument
  16548. * provided to the memoized function is used as the map cache key. The `func`
  16549. * is invoked with the `this` binding of the memoized function.
  16550. *
  16551. * **Note:** The cache is exposed as the `cache` property on the memoized
  16552. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  16553. * constructor with one whose instances implement the
  16554. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  16555. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  16556. *
  16557. * @static
  16558. * @memberOf _
  16559. * @since 0.1.0
  16560. * @category Function
  16561. * @param {Function} func The function to have its output memoized.
  16562. * @param {Function} [resolver] The function to resolve the cache key.
  16563. * @returns {Function} Returns the new memoized function.
  16564. * @example
  16565. *
  16566. * var object = { 'a': 1, 'b': 2 };
  16567. * var other = { 'c': 3, 'd': 4 };
  16568. *
  16569. * var values = _.memoize(_.values);
  16570. * values(object);
  16571. * // => [1, 2]
  16572. *
  16573. * values(other);
  16574. * // => [3, 4]
  16575. *
  16576. * object.a = 2;
  16577. * values(object);
  16578. * // => [1, 2]
  16579. *
  16580. * // Modify the result cache.
  16581. * values.cache.set(object, ['a', 'b']);
  16582. * values(object);
  16583. * // => ['a', 'b']
  16584. *
  16585. * // Replace `_.memoize.Cache`.
  16586. * _.memoize.Cache = WeakMap;
  16587. */
  16588. function memoize(func, resolver) {
  16589. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  16590. throw new TypeError(FUNC_ERROR_TEXT);
  16591. }
  16592. var memoized = function() {
  16593. var args = arguments,
  16594. key = resolver ? resolver.apply(this, args) : args[0],
  16595. cache = memoized.cache;
  16596. if (cache.has(key)) {
  16597. return cache.get(key);
  16598. }
  16599. var result = func.apply(this, args);
  16600. memoized.cache = cache.set(key, result) || cache;
  16601. return result;
  16602. };
  16603. memoized.cache = new (memoize.Cache || MapCache);
  16604. return memoized;
  16605. }
  16606. // Expose `MapCache`.
  16607. memoize.Cache = MapCache;
  16608. /**
  16609. * Creates a function that negates the result of the predicate `func`. The
  16610. * `func` predicate is invoked with the `this` binding and arguments of the
  16611. * created function.
  16612. *
  16613. * @static
  16614. * @memberOf _
  16615. * @since 3.0.0
  16616. * @category Function
  16617. * @param {Function} predicate The predicate to negate.
  16618. * @returns {Function} Returns the new negated function.
  16619. * @example
  16620. *
  16621. * function isEven(n) {
  16622. * return n % 2 == 0;
  16623. * }
  16624. *
  16625. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  16626. * // => [1, 3, 5]
  16627. */
  16628. function negate(predicate) {
  16629. if (typeof predicate != 'function') {
  16630. throw new TypeError(FUNC_ERROR_TEXT);
  16631. }
  16632. return function() {
  16633. var args = arguments;
  16634. switch (args.length) {
  16635. case 0: return !predicate.call(this);
  16636. case 1: return !predicate.call(this, args[0]);
  16637. case 2: return !predicate.call(this, args[0], args[1]);
  16638. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  16639. }
  16640. return !predicate.apply(this, args);
  16641. };
  16642. }
  16643. /**
  16644. * Creates a function that is restricted to invoking `func` once. Repeat calls
  16645. * to the function return the value of the first invocation. The `func` is
  16646. * invoked with the `this` binding and arguments of the created function.
  16647. *
  16648. * @static
  16649. * @memberOf _
  16650. * @since 0.1.0
  16651. * @category Function
  16652. * @param {Function} func The function to restrict.
  16653. * @returns {Function} Returns the new restricted function.
  16654. * @example
  16655. *
  16656. * var initialize = _.once(createApplication);
  16657. * initialize();
  16658. * initialize();
  16659. * // => `createApplication` is invoked once
  16660. */
  16661. function once(func) {
  16662. return before(2, func);
  16663. }
  16664. /**
  16665. * Creates a function that invokes `func` with its arguments transformed.
  16666. *
  16667. * @static
  16668. * @since 4.0.0
  16669. * @memberOf _
  16670. * @category Function
  16671. * @param {Function} func The function to wrap.
  16672. * @param {...(Function|Function[])} [transforms=[_.identity]]
  16673. * The argument transforms.
  16674. * @returns {Function} Returns the new function.
  16675. * @example
  16676. *
  16677. * function doubled(n) {
  16678. * return n * 2;
  16679. * }
  16680. *
  16681. * function square(n) {
  16682. * return n * n;
  16683. * }
  16684. *
  16685. * var func = _.overArgs(function(x, y) {
  16686. * return [x, y];
  16687. * }, [square, doubled]);
  16688. *
  16689. * func(9, 3);
  16690. * // => [81, 6]
  16691. *
  16692. * func(10, 5);
  16693. * // => [100, 10]
  16694. */
  16695. var overArgs = castRest(function(func, transforms) {
  16696. transforms = (transforms.length == 1 && isArray(transforms[0]))
  16697. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  16698. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  16699. var funcsLength = transforms.length;
  16700. return baseRest(function(args) {
  16701. var index = -1,
  16702. length = nativeMin(args.length, funcsLength);
  16703. while (++index < length) {
  16704. args[index] = transforms[index].call(this, args[index]);
  16705. }
  16706. return apply(func, this, args);
  16707. });
  16708. });
  16709. /**
  16710. * Creates a function that invokes `func` with `partials` prepended to the
  16711. * arguments it receives. This method is like `_.bind` except it does **not**
  16712. * alter the `this` binding.
  16713. *
  16714. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  16715. * builds, may be used as a placeholder for partially applied arguments.
  16716. *
  16717. * **Note:** This method doesn't set the "length" property of partially
  16718. * applied functions.
  16719. *
  16720. * @static
  16721. * @memberOf _
  16722. * @since 0.2.0
  16723. * @category Function
  16724. * @param {Function} func The function to partially apply arguments to.
  16725. * @param {...*} [partials] The arguments to be partially applied.
  16726. * @returns {Function} Returns the new partially applied function.
  16727. * @example
  16728. *
  16729. * function greet(greeting, name) {
  16730. * return greeting + ' ' + name;
  16731. * }
  16732. *
  16733. * var sayHelloTo = _.partial(greet, 'hello');
  16734. * sayHelloTo('fred');
  16735. * // => 'hello fred'
  16736. *
  16737. * // Partially applied with placeholders.
  16738. * var greetFred = _.partial(greet, _, 'fred');
  16739. * greetFred('hi');
  16740. * // => 'hi fred'
  16741. */
  16742. var partial = baseRest(function(func, partials) {
  16743. var holders = replaceHolders(partials, getHolder(partial));
  16744. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  16745. });
  16746. /**
  16747. * This method is like `_.partial` except that partially applied arguments
  16748. * are appended to the arguments it receives.
  16749. *
  16750. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  16751. * builds, may be used as a placeholder for partially applied arguments.
  16752. *
  16753. * **Note:** This method doesn't set the "length" property of partially
  16754. * applied functions.
  16755. *
  16756. * @static
  16757. * @memberOf _
  16758. * @since 1.0.0
  16759. * @category Function
  16760. * @param {Function} func The function to partially apply arguments to.
  16761. * @param {...*} [partials] The arguments to be partially applied.
  16762. * @returns {Function} Returns the new partially applied function.
  16763. * @example
  16764. *
  16765. * function greet(greeting, name) {
  16766. * return greeting + ' ' + name;
  16767. * }
  16768. *
  16769. * var greetFred = _.partialRight(greet, 'fred');
  16770. * greetFred('hi');
  16771. * // => 'hi fred'
  16772. *
  16773. * // Partially applied with placeholders.
  16774. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  16775. * sayHelloTo('fred');
  16776. * // => 'hello fred'
  16777. */
  16778. var partialRight = baseRest(function(func, partials) {
  16779. var holders = replaceHolders(partials, getHolder(partialRight));
  16780. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  16781. });
  16782. /**
  16783. * Creates a function that invokes `func` with arguments arranged according
  16784. * to the specified `indexes` where the argument value at the first index is
  16785. * provided as the first argument, the argument value at the second index is
  16786. * provided as the second argument, and so on.
  16787. *
  16788. * @static
  16789. * @memberOf _
  16790. * @since 3.0.0
  16791. * @category Function
  16792. * @param {Function} func The function to rearrange arguments for.
  16793. * @param {...(number|number[])} indexes The arranged argument indexes.
  16794. * @returns {Function} Returns the new function.
  16795. * @example
  16796. *
  16797. * var rearged = _.rearg(function(a, b, c) {
  16798. * return [a, b, c];
  16799. * }, [2, 0, 1]);
  16800. *
  16801. * rearged('b', 'c', 'a')
  16802. * // => ['a', 'b', 'c']
  16803. */
  16804. var rearg = flatRest(function(func, indexes) {
  16805. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  16806. });
  16807. /**
  16808. * Creates a function that invokes `func` with the `this` binding of the
  16809. * created function and arguments from `start` and beyond provided as
  16810. * an array.
  16811. *
  16812. * **Note:** This method is based on the
  16813. * [rest parameter](https://mdn.io/rest_parameters).
  16814. *
  16815. * @static
  16816. * @memberOf _
  16817. * @since 4.0.0
  16818. * @category Function
  16819. * @param {Function} func The function to apply a rest parameter to.
  16820. * @param {number} [start=func.length-1] The start position of the rest parameter.
  16821. * @returns {Function} Returns the new function.
  16822. * @example
  16823. *
  16824. * var say = _.rest(function(what, names) {
  16825. * return what + ' ' + _.initial(names).join(', ') +
  16826. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  16827. * });
  16828. *
  16829. * say('hello', 'fred', 'barney', 'pebbles');
  16830. * // => 'hello fred, barney, & pebbles'
  16831. */
  16832. function rest(func, start) {
  16833. if (typeof func != 'function') {
  16834. throw new TypeError(FUNC_ERROR_TEXT);
  16835. }
  16836. start = start === undefined ? start : toInteger(start);
  16837. return baseRest(func, start);
  16838. }
  16839. /**
  16840. * Creates a function that invokes `func` with the `this` binding of the
  16841. * create function and an array of arguments much like
  16842. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  16843. *
  16844. * **Note:** This method is based on the
  16845. * [spread operator](https://mdn.io/spread_operator).
  16846. *
  16847. * @static
  16848. * @memberOf _
  16849. * @since 3.2.0
  16850. * @category Function
  16851. * @param {Function} func The function to spread arguments over.
  16852. * @param {number} [start=0] The start position of the spread.
  16853. * @returns {Function} Returns the new function.
  16854. * @example
  16855. *
  16856. * var say = _.spread(function(who, what) {
  16857. * return who + ' says ' + what;
  16858. * });
  16859. *
  16860. * say(['fred', 'hello']);
  16861. * // => 'fred says hello'
  16862. *
  16863. * var numbers = Promise.all([
  16864. * Promise.resolve(40),
  16865. * Promise.resolve(36)
  16866. * ]);
  16867. *
  16868. * numbers.then(_.spread(function(x, y) {
  16869. * return x + y;
  16870. * }));
  16871. * // => a Promise of 76
  16872. */
  16873. function spread(func, start) {
  16874. if (typeof func != 'function') {
  16875. throw new TypeError(FUNC_ERROR_TEXT);
  16876. }
  16877. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  16878. return baseRest(function(args) {
  16879. var array = args[start],
  16880. otherArgs = castSlice(args, 0, start);
  16881. if (array) {
  16882. arrayPush(otherArgs, array);
  16883. }
  16884. return apply(func, this, otherArgs);
  16885. });
  16886. }
  16887. /**
  16888. * Creates a throttled function that only invokes `func` at most once per
  16889. * every `wait` milliseconds. The throttled function comes with a `cancel`
  16890. * method to cancel delayed `func` invocations and a `flush` method to
  16891. * immediately invoke them. Provide `options` to indicate whether `func`
  16892. * should be invoked on the leading and/or trailing edge of the `wait`
  16893. * timeout. The `func` is invoked with the last arguments provided to the
  16894. * throttled function. Subsequent calls to the throttled function return the
  16895. * result of the last `func` invocation.
  16896. *
  16897. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  16898. * invoked on the trailing edge of the timeout only if the throttled function
  16899. * is invoked more than once during the `wait` timeout.
  16900. *
  16901. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  16902. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  16903. *
  16904. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  16905. * for details over the differences between `_.throttle` and `_.debounce`.
  16906. *
  16907. * @static
  16908. * @memberOf _
  16909. * @since 0.1.0
  16910. * @category Function
  16911. * @param {Function} func The function to throttle.
  16912. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  16913. * @param {Object} [options={}] The options object.
  16914. * @param {boolean} [options.leading=true]
  16915. * Specify invoking on the leading edge of the timeout.
  16916. * @param {boolean} [options.trailing=true]
  16917. * Specify invoking on the trailing edge of the timeout.
  16918. * @returns {Function} Returns the new throttled function.
  16919. * @example
  16920. *
  16921. * // Avoid excessively updating the position while scrolling.
  16922. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  16923. *
  16924. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  16925. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  16926. * jQuery(element).on('click', throttled);
  16927. *
  16928. * // Cancel the trailing throttled invocation.
  16929. * jQuery(window).on('popstate', throttled.cancel);
  16930. */
  16931. function throttle(func, wait, options) {
  16932. var leading = true,
  16933. trailing = true;
  16934. if (typeof func != 'function') {
  16935. throw new TypeError(FUNC_ERROR_TEXT);
  16936. }
  16937. if (isObject(options)) {
  16938. leading = 'leading' in options ? !!options.leading : leading;
  16939. trailing = 'trailing' in options ? !!options.trailing : trailing;
  16940. }
  16941. return debounce(func, wait, {
  16942. 'leading': leading,
  16943. 'maxWait': wait,
  16944. 'trailing': trailing
  16945. });
  16946. }
  16947. /**
  16948. * Creates a function that accepts up to one argument, ignoring any
  16949. * additional arguments.
  16950. *
  16951. * @static
  16952. * @memberOf _
  16953. * @since 4.0.0
  16954. * @category Function
  16955. * @param {Function} func The function to cap arguments for.
  16956. * @returns {Function} Returns the new capped function.
  16957. * @example
  16958. *
  16959. * _.map(['6', '8', '10'], _.unary(parseInt));
  16960. * // => [6, 8, 10]
  16961. */
  16962. function unary(func) {
  16963. return ary(func, 1);
  16964. }
  16965. /**
  16966. * Creates a function that provides `value` to `wrapper` as its first
  16967. * argument. Any additional arguments provided to the function are appended
  16968. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  16969. * binding of the created function.
  16970. *
  16971. * @static
  16972. * @memberOf _
  16973. * @since 0.1.0
  16974. * @category Function
  16975. * @param {*} value The value to wrap.
  16976. * @param {Function} [wrapper=identity] The wrapper function.
  16977. * @returns {Function} Returns the new function.
  16978. * @example
  16979. *
  16980. * var p = _.wrap(_.escape, function(func, text) {
  16981. * return '<p>' + func(text) + '</p>';
  16982. * });
  16983. *
  16984. * p('fred, barney, & pebbles');
  16985. * // => '<p>fred, barney, &amp; pebbles</p>'
  16986. */
  16987. function wrap(value, wrapper) {
  16988. return partial(castFunction(wrapper), value);
  16989. }
  16990. /*------------------------------------------------------------------------*/
  16991. /**
  16992. * Casts `value` as an array if it's not one.
  16993. *
  16994. * @static
  16995. * @memberOf _
  16996. * @since 4.4.0
  16997. * @category Lang
  16998. * @param {*} value The value to inspect.
  16999. * @returns {Array} Returns the cast array.
  17000. * @example
  17001. *
  17002. * _.castArray(1);
  17003. * // => [1]
  17004. *
  17005. * _.castArray({ 'a': 1 });
  17006. * // => [{ 'a': 1 }]
  17007. *
  17008. * _.castArray('abc');
  17009. * // => ['abc']
  17010. *
  17011. * _.castArray(null);
  17012. * // => [null]
  17013. *
  17014. * _.castArray(undefined);
  17015. * // => [undefined]
  17016. *
  17017. * _.castArray();
  17018. * // => []
  17019. *
  17020. * var array = [1, 2, 3];
  17021. * console.log(_.castArray(array) === array);
  17022. * // => true
  17023. */
  17024. function castArray() {
  17025. if (!arguments.length) {
  17026. return [];
  17027. }
  17028. var value = arguments[0];
  17029. return isArray(value) ? value : [value];
  17030. }
  17031. /**
  17032. * Creates a shallow clone of `value`.
  17033. *
  17034. * **Note:** This method is loosely based on the
  17035. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  17036. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  17037. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  17038. * arrays. The own enumerable properties of `arguments` objects are cloned
  17039. * as plain objects. An empty object is returned for uncloneable values such
  17040. * as error objects, functions, DOM nodes, and WeakMaps.
  17041. *
  17042. * @static
  17043. * @memberOf _
  17044. * @since 0.1.0
  17045. * @category Lang
  17046. * @param {*} value The value to clone.
  17047. * @returns {*} Returns the cloned value.
  17048. * @see _.cloneDeep
  17049. * @example
  17050. *
  17051. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  17052. *
  17053. * var shallow = _.clone(objects);
  17054. * console.log(shallow[0] === objects[0]);
  17055. * // => true
  17056. */
  17057. function clone(value) {
  17058. return baseClone(value, CLONE_SYMBOLS_FLAG);
  17059. }
  17060. /**
  17061. * This method is like `_.clone` except that it accepts `customizer` which
  17062. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  17063. * cloning is handled by the method instead. The `customizer` is invoked with
  17064. * up to four arguments; (value [, index|key, object, stack]).
  17065. *
  17066. * @static
  17067. * @memberOf _
  17068. * @since 4.0.0
  17069. * @category Lang
  17070. * @param {*} value The value to clone.
  17071. * @param {Function} [customizer] The function to customize cloning.
  17072. * @returns {*} Returns the cloned value.
  17073. * @see _.cloneDeepWith
  17074. * @example
  17075. *
  17076. * function customizer(value) {
  17077. * if (_.isElement(value)) {
  17078. * return value.cloneNode(false);
  17079. * }
  17080. * }
  17081. *
  17082. * var el = _.cloneWith(document.body, customizer);
  17083. *
  17084. * console.log(el === document.body);
  17085. * // => false
  17086. * console.log(el.nodeName);
  17087. * // => 'BODY'
  17088. * console.log(el.childNodes.length);
  17089. * // => 0
  17090. */
  17091. function cloneWith(value, customizer) {
  17092. customizer = typeof customizer == 'function' ? customizer : undefined;
  17093. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  17094. }
  17095. /**
  17096. * This method is like `_.clone` except that it recursively clones `value`.
  17097. *
  17098. * @static
  17099. * @memberOf _
  17100. * @since 1.0.0
  17101. * @category Lang
  17102. * @param {*} value The value to recursively clone.
  17103. * @returns {*} Returns the deep cloned value.
  17104. * @see _.clone
  17105. * @example
  17106. *
  17107. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  17108. *
  17109. * var deep = _.cloneDeep(objects);
  17110. * console.log(deep[0] === objects[0]);
  17111. * // => false
  17112. */
  17113. function cloneDeep(value) {
  17114. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  17115. }
  17116. /**
  17117. * This method is like `_.cloneWith` except that it recursively clones `value`.
  17118. *
  17119. * @static
  17120. * @memberOf _
  17121. * @since 4.0.0
  17122. * @category Lang
  17123. * @param {*} value The value to recursively clone.
  17124. * @param {Function} [customizer] The function to customize cloning.
  17125. * @returns {*} Returns the deep cloned value.
  17126. * @see _.cloneWith
  17127. * @example
  17128. *
  17129. * function customizer(value) {
  17130. * if (_.isElement(value)) {
  17131. * return value.cloneNode(true);
  17132. * }
  17133. * }
  17134. *
  17135. * var el = _.cloneDeepWith(document.body, customizer);
  17136. *
  17137. * console.log(el === document.body);
  17138. * // => false
  17139. * console.log(el.nodeName);
  17140. * // => 'BODY'
  17141. * console.log(el.childNodes.length);
  17142. * // => 20
  17143. */
  17144. function cloneDeepWith(value, customizer) {
  17145. customizer = typeof customizer == 'function' ? customizer : undefined;
  17146. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  17147. }
  17148. /**
  17149. * Checks if `object` conforms to `source` by invoking the predicate
  17150. * properties of `source` with the corresponding property values of `object`.
  17151. *
  17152. * **Note:** This method is equivalent to `_.conforms` when `source` is
  17153. * partially applied.
  17154. *
  17155. * @static
  17156. * @memberOf _
  17157. * @since 4.14.0
  17158. * @category Lang
  17159. * @param {Object} object The object to inspect.
  17160. * @param {Object} source The object of property predicates to conform to.
  17161. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  17162. * @example
  17163. *
  17164. * var object = { 'a': 1, 'b': 2 };
  17165. *
  17166. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  17167. * // => true
  17168. *
  17169. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  17170. * // => false
  17171. */
  17172. function conformsTo(object, source) {
  17173. return source == null || baseConformsTo(object, source, keys(source));
  17174. }
  17175. /**
  17176. * Performs a
  17177. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  17178. * comparison between two values to determine if they are equivalent.
  17179. *
  17180. * @static
  17181. * @memberOf _
  17182. * @since 4.0.0
  17183. * @category Lang
  17184. * @param {*} value The value to compare.
  17185. * @param {*} other The other value to compare.
  17186. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  17187. * @example
  17188. *
  17189. * var object = { 'a': 1 };
  17190. * var other = { 'a': 1 };
  17191. *
  17192. * _.eq(object, object);
  17193. * // => true
  17194. *
  17195. * _.eq(object, other);
  17196. * // => false
  17197. *
  17198. * _.eq('a', 'a');
  17199. * // => true
  17200. *
  17201. * _.eq('a', Object('a'));
  17202. * // => false
  17203. *
  17204. * _.eq(NaN, NaN);
  17205. * // => true
  17206. */
  17207. function eq(value, other) {
  17208. return value === other || (value !== value && other !== other);
  17209. }
  17210. /**
  17211. * Checks if `value` is greater than `other`.
  17212. *
  17213. * @static
  17214. * @memberOf _
  17215. * @since 3.9.0
  17216. * @category Lang
  17217. * @param {*} value The value to compare.
  17218. * @param {*} other The other value to compare.
  17219. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  17220. * else `false`.
  17221. * @see _.lt
  17222. * @example
  17223. *
  17224. * _.gt(3, 1);
  17225. * // => true
  17226. *
  17227. * _.gt(3, 3);
  17228. * // => false
  17229. *
  17230. * _.gt(1, 3);
  17231. * // => false
  17232. */
  17233. var gt = createRelationalOperation(baseGt);
  17234. /**
  17235. * Checks if `value` is greater than or equal to `other`.
  17236. *
  17237. * @static
  17238. * @memberOf _
  17239. * @since 3.9.0
  17240. * @category Lang
  17241. * @param {*} value The value to compare.
  17242. * @param {*} other The other value to compare.
  17243. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  17244. * `other`, else `false`.
  17245. * @see _.lte
  17246. * @example
  17247. *
  17248. * _.gte(3, 1);
  17249. * // => true
  17250. *
  17251. * _.gte(3, 3);
  17252. * // => true
  17253. *
  17254. * _.gte(1, 3);
  17255. * // => false
  17256. */
  17257. var gte = createRelationalOperation(function(value, other) {
  17258. return value >= other;
  17259. });
  17260. /**
  17261. * Checks if `value` is likely an `arguments` object.
  17262. *
  17263. * @static
  17264. * @memberOf _
  17265. * @since 0.1.0
  17266. * @category Lang
  17267. * @param {*} value The value to check.
  17268. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  17269. * else `false`.
  17270. * @example
  17271. *
  17272. * _.isArguments(function() { return arguments; }());
  17273. * // => true
  17274. *
  17275. * _.isArguments([1, 2, 3]);
  17276. * // => false
  17277. */
  17278. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  17279. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  17280. !propertyIsEnumerable.call(value, 'callee');
  17281. };
  17282. /**
  17283. * Checks if `value` is classified as an `Array` object.
  17284. *
  17285. * @static
  17286. * @memberOf _
  17287. * @since 0.1.0
  17288. * @category Lang
  17289. * @param {*} value The value to check.
  17290. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  17291. * @example
  17292. *
  17293. * _.isArray([1, 2, 3]);
  17294. * // => true
  17295. *
  17296. * _.isArray(document.body.children);
  17297. * // => false
  17298. *
  17299. * _.isArray('abc');
  17300. * // => false
  17301. *
  17302. * _.isArray(_.noop);
  17303. * // => false
  17304. */
  17305. var isArray = Array.isArray;
  17306. /**
  17307. * Checks if `value` is classified as an `ArrayBuffer` object.
  17308. *
  17309. * @static
  17310. * @memberOf _
  17311. * @since 4.3.0
  17312. * @category Lang
  17313. * @param {*} value The value to check.
  17314. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  17315. * @example
  17316. *
  17317. * _.isArrayBuffer(new ArrayBuffer(2));
  17318. * // => true
  17319. *
  17320. * _.isArrayBuffer(new Array(2));
  17321. * // => false
  17322. */
  17323. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  17324. /**
  17325. * Checks if `value` is array-like. A value is considered array-like if it's
  17326. * not a function and has a `value.length` that's an integer greater than or
  17327. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  17328. *
  17329. * @static
  17330. * @memberOf _
  17331. * @since 4.0.0
  17332. * @category Lang
  17333. * @param {*} value The value to check.
  17334. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  17335. * @example
  17336. *
  17337. * _.isArrayLike([1, 2, 3]);
  17338. * // => true
  17339. *
  17340. * _.isArrayLike(document.body.children);
  17341. * // => true
  17342. *
  17343. * _.isArrayLike('abc');
  17344. * // => true
  17345. *
  17346. * _.isArrayLike(_.noop);
  17347. * // => false
  17348. */
  17349. function isArrayLike(value) {
  17350. return value != null && isLength(value.length) && !isFunction(value);
  17351. }
  17352. /**
  17353. * This method is like `_.isArrayLike` except that it also checks if `value`
  17354. * is an object.
  17355. *
  17356. * @static
  17357. * @memberOf _
  17358. * @since 4.0.0
  17359. * @category Lang
  17360. * @param {*} value The value to check.
  17361. * @returns {boolean} Returns `true` if `value` is an array-like object,
  17362. * else `false`.
  17363. * @example
  17364. *
  17365. * _.isArrayLikeObject([1, 2, 3]);
  17366. * // => true
  17367. *
  17368. * _.isArrayLikeObject(document.body.children);
  17369. * // => true
  17370. *
  17371. * _.isArrayLikeObject('abc');
  17372. * // => false
  17373. *
  17374. * _.isArrayLikeObject(_.noop);
  17375. * // => false
  17376. */
  17377. function isArrayLikeObject(value) {
  17378. return isObjectLike(value) && isArrayLike(value);
  17379. }
  17380. /**
  17381. * Checks if `value` is classified as a boolean primitive or object.
  17382. *
  17383. * @static
  17384. * @memberOf _
  17385. * @since 0.1.0
  17386. * @category Lang
  17387. * @param {*} value The value to check.
  17388. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  17389. * @example
  17390. *
  17391. * _.isBoolean(false);
  17392. * // => true
  17393. *
  17394. * _.isBoolean(null);
  17395. * // => false
  17396. */
  17397. function isBoolean(value) {
  17398. return value === true || value === false ||
  17399. (isObjectLike(value) && baseGetTag(value) == boolTag);
  17400. }
  17401. /**
  17402. * Checks if `value` is a buffer.
  17403. *
  17404. * @static
  17405. * @memberOf _
  17406. * @since 4.3.0
  17407. * @category Lang
  17408. * @param {*} value The value to check.
  17409. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  17410. * @example
  17411. *
  17412. * _.isBuffer(new Buffer(2));
  17413. * // => true
  17414. *
  17415. * _.isBuffer(new Uint8Array(2));
  17416. * // => false
  17417. */
  17418. var isBuffer = nativeIsBuffer || stubFalse;
  17419. /**
  17420. * Checks if `value` is classified as a `Date` object.
  17421. *
  17422. * @static
  17423. * @memberOf _
  17424. * @since 0.1.0
  17425. * @category Lang
  17426. * @param {*} value The value to check.
  17427. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  17428. * @example
  17429. *
  17430. * _.isDate(new Date);
  17431. * // => true
  17432. *
  17433. * _.isDate('Mon April 23 2012');
  17434. * // => false
  17435. */
  17436. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  17437. /**
  17438. * Checks if `value` is likely a DOM element.
  17439. *
  17440. * @static
  17441. * @memberOf _
  17442. * @since 0.1.0
  17443. * @category Lang
  17444. * @param {*} value The value to check.
  17445. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  17446. * @example
  17447. *
  17448. * _.isElement(document.body);
  17449. * // => true
  17450. *
  17451. * _.isElement('<body>');
  17452. * // => false
  17453. */
  17454. function isElement(value) {
  17455. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  17456. }
  17457. /**
  17458. * Checks if `value` is an empty object, collection, map, or set.
  17459. *
  17460. * Objects are considered empty if they have no own enumerable string keyed
  17461. * properties.
  17462. *
  17463. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  17464. * jQuery-like collections are considered empty if they have a `length` of `0`.
  17465. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  17466. *
  17467. * @static
  17468. * @memberOf _
  17469. * @since 0.1.0
  17470. * @category Lang
  17471. * @param {*} value The value to check.
  17472. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  17473. * @example
  17474. *
  17475. * _.isEmpty(null);
  17476. * // => true
  17477. *
  17478. * _.isEmpty(true);
  17479. * // => true
  17480. *
  17481. * _.isEmpty(1);
  17482. * // => true
  17483. *
  17484. * _.isEmpty([1, 2, 3]);
  17485. * // => false
  17486. *
  17487. * _.isEmpty({ 'a': 1 });
  17488. * // => false
  17489. */
  17490. function isEmpty(value) {
  17491. if (value == null) {
  17492. return true;
  17493. }
  17494. if (isArrayLike(value) &&
  17495. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  17496. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  17497. return !value.length;
  17498. }
  17499. var tag = getTag(value);
  17500. if (tag == mapTag || tag == setTag) {
  17501. return !value.size;
  17502. }
  17503. if (isPrototype(value)) {
  17504. return !baseKeys(value).length;
  17505. }
  17506. for (var key in value) {
  17507. if (hasOwnProperty.call(value, key)) {
  17508. return false;
  17509. }
  17510. }
  17511. return true;
  17512. }
  17513. /**
  17514. * Performs a deep comparison between two values to determine if they are
  17515. * equivalent.
  17516. *
  17517. * **Note:** This method supports comparing arrays, array buffers, booleans,
  17518. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  17519. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  17520. * by their own, not inherited, enumerable properties. Functions and DOM
  17521. * nodes are compared by strict equality, i.e. `===`.
  17522. *
  17523. * @static
  17524. * @memberOf _
  17525. * @since 0.1.0
  17526. * @category Lang
  17527. * @param {*} value The value to compare.
  17528. * @param {*} other The other value to compare.
  17529. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  17530. * @example
  17531. *
  17532. * var object = { 'a': 1 };
  17533. * var other = { 'a': 1 };
  17534. *
  17535. * _.isEqual(object, other);
  17536. * // => true
  17537. *
  17538. * object === other;
  17539. * // => false
  17540. */
  17541. function isEqual(value, other) {
  17542. return baseIsEqual(value, other);
  17543. }
  17544. /**
  17545. * This method is like `_.isEqual` except that it accepts `customizer` which
  17546. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  17547. * are handled by the method instead. The `customizer` is invoked with up to
  17548. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  17549. *
  17550. * @static
  17551. * @memberOf _
  17552. * @since 4.0.0
  17553. * @category Lang
  17554. * @param {*} value The value to compare.
  17555. * @param {*} other The other value to compare.
  17556. * @param {Function} [customizer] The function to customize comparisons.
  17557. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  17558. * @example
  17559. *
  17560. * function isGreeting(value) {
  17561. * return /^h(?:i|ello)$/.test(value);
  17562. * }
  17563. *
  17564. * function customizer(objValue, othValue) {
  17565. * if (isGreeting(objValue) && isGreeting(othValue)) {
  17566. * return true;
  17567. * }
  17568. * }
  17569. *
  17570. * var array = ['hello', 'goodbye'];
  17571. * var other = ['hi', 'goodbye'];
  17572. *
  17573. * _.isEqualWith(array, other, customizer);
  17574. * // => true
  17575. */
  17576. function isEqualWith(value, other, customizer) {
  17577. customizer = typeof customizer == 'function' ? customizer : undefined;
  17578. var result = customizer ? customizer(value, other) : undefined;
  17579. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  17580. }
  17581. /**
  17582. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  17583. * `SyntaxError`, `TypeError`, or `URIError` object.
  17584. *
  17585. * @static
  17586. * @memberOf _
  17587. * @since 3.0.0
  17588. * @category Lang
  17589. * @param {*} value The value to check.
  17590. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  17591. * @example
  17592. *
  17593. * _.isError(new Error);
  17594. * // => true
  17595. *
  17596. * _.isError(Error);
  17597. * // => false
  17598. */
  17599. function isError(value) {
  17600. if (!isObjectLike(value)) {
  17601. return false;
  17602. }
  17603. var tag = baseGetTag(value);
  17604. return tag == errorTag || tag == domExcTag ||
  17605. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  17606. }
  17607. /**
  17608. * Checks if `value` is a finite primitive number.
  17609. *
  17610. * **Note:** This method is based on
  17611. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  17612. *
  17613. * @static
  17614. * @memberOf _
  17615. * @since 0.1.0
  17616. * @category Lang
  17617. * @param {*} value The value to check.
  17618. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  17619. * @example
  17620. *
  17621. * _.isFinite(3);
  17622. * // => true
  17623. *
  17624. * _.isFinite(Number.MIN_VALUE);
  17625. * // => true
  17626. *
  17627. * _.isFinite(Infinity);
  17628. * // => false
  17629. *
  17630. * _.isFinite('3');
  17631. * // => false
  17632. */
  17633. function isFinite(value) {
  17634. return typeof value == 'number' && nativeIsFinite(value);
  17635. }
  17636. /**
  17637. * Checks if `value` is classified as a `Function` object.
  17638. *
  17639. * @static
  17640. * @memberOf _
  17641. * @since 0.1.0
  17642. * @category Lang
  17643. * @param {*} value The value to check.
  17644. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  17645. * @example
  17646. *
  17647. * _.isFunction(_);
  17648. * // => true
  17649. *
  17650. * _.isFunction(/abc/);
  17651. * // => false
  17652. */
  17653. function isFunction(value) {
  17654. if (!isObject(value)) {
  17655. return false;
  17656. }
  17657. // The use of `Object#toString` avoids issues with the `typeof` operator
  17658. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  17659. var tag = baseGetTag(value);
  17660. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  17661. }
  17662. /**
  17663. * Checks if `value` is an integer.
  17664. *
  17665. * **Note:** This method is based on
  17666. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  17667. *
  17668. * @static
  17669. * @memberOf _
  17670. * @since 4.0.0
  17671. * @category Lang
  17672. * @param {*} value The value to check.
  17673. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  17674. * @example
  17675. *
  17676. * _.isInteger(3);
  17677. * // => true
  17678. *
  17679. * _.isInteger(Number.MIN_VALUE);
  17680. * // => false
  17681. *
  17682. * _.isInteger(Infinity);
  17683. * // => false
  17684. *
  17685. * _.isInteger('3');
  17686. * // => false
  17687. */
  17688. function isInteger(value) {
  17689. return typeof value == 'number' && value == toInteger(value);
  17690. }
  17691. /**
  17692. * Checks if `value` is a valid array-like length.
  17693. *
  17694. * **Note:** This method is loosely based on
  17695. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  17696. *
  17697. * @static
  17698. * @memberOf _
  17699. * @since 4.0.0
  17700. * @category Lang
  17701. * @param {*} value The value to check.
  17702. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  17703. * @example
  17704. *
  17705. * _.isLength(3);
  17706. * // => true
  17707. *
  17708. * _.isLength(Number.MIN_VALUE);
  17709. * // => false
  17710. *
  17711. * _.isLength(Infinity);
  17712. * // => false
  17713. *
  17714. * _.isLength('3');
  17715. * // => false
  17716. */
  17717. function isLength(value) {
  17718. return typeof value == 'number' &&
  17719. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  17720. }
  17721. /**
  17722. * Checks if `value` is the
  17723. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  17724. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  17725. *
  17726. * @static
  17727. * @memberOf _
  17728. * @since 0.1.0
  17729. * @category Lang
  17730. * @param {*} value The value to check.
  17731. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  17732. * @example
  17733. *
  17734. * _.isObject({});
  17735. * // => true
  17736. *
  17737. * _.isObject([1, 2, 3]);
  17738. * // => true
  17739. *
  17740. * _.isObject(_.noop);
  17741. * // => true
  17742. *
  17743. * _.isObject(null);
  17744. * // => false
  17745. */
  17746. function isObject(value) {
  17747. var type = typeof value;
  17748. return value != null && (type == 'object' || type == 'function');
  17749. }
  17750. /**
  17751. * Checks if `value` is object-like. A value is object-like if it's not `null`
  17752. * and has a `typeof` result of "object".
  17753. *
  17754. * @static
  17755. * @memberOf _
  17756. * @since 4.0.0
  17757. * @category Lang
  17758. * @param {*} value The value to check.
  17759. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  17760. * @example
  17761. *
  17762. * _.isObjectLike({});
  17763. * // => true
  17764. *
  17765. * _.isObjectLike([1, 2, 3]);
  17766. * // => true
  17767. *
  17768. * _.isObjectLike(_.noop);
  17769. * // => false
  17770. *
  17771. * _.isObjectLike(null);
  17772. * // => false
  17773. */
  17774. function isObjectLike(value) {
  17775. return value != null && typeof value == 'object';
  17776. }
  17777. /**
  17778. * Checks if `value` is classified as a `Map` object.
  17779. *
  17780. * @static
  17781. * @memberOf _
  17782. * @since 4.3.0
  17783. * @category Lang
  17784. * @param {*} value The value to check.
  17785. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  17786. * @example
  17787. *
  17788. * _.isMap(new Map);
  17789. * // => true
  17790. *
  17791. * _.isMap(new WeakMap);
  17792. * // => false
  17793. */
  17794. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  17795. /**
  17796. * Performs a partial deep comparison between `object` and `source` to
  17797. * determine if `object` contains equivalent property values.
  17798. *
  17799. * **Note:** This method is equivalent to `_.matches` when `source` is
  17800. * partially applied.
  17801. *
  17802. * Partial comparisons will match empty array and empty object `source`
  17803. * values against any array or object value, respectively. See `_.isEqual`
  17804. * for a list of supported value comparisons.
  17805. *
  17806. * @static
  17807. * @memberOf _
  17808. * @since 3.0.0
  17809. * @category Lang
  17810. * @param {Object} object The object to inspect.
  17811. * @param {Object} source The object of property values to match.
  17812. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  17813. * @example
  17814. *
  17815. * var object = { 'a': 1, 'b': 2 };
  17816. *
  17817. * _.isMatch(object, { 'b': 2 });
  17818. * // => true
  17819. *
  17820. * _.isMatch(object, { 'b': 1 });
  17821. * // => false
  17822. */
  17823. function isMatch(object, source) {
  17824. return object === source || baseIsMatch(object, source, getMatchData(source));
  17825. }
  17826. /**
  17827. * This method is like `_.isMatch` except that it accepts `customizer` which
  17828. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  17829. * are handled by the method instead. The `customizer` is invoked with five
  17830. * arguments: (objValue, srcValue, index|key, object, source).
  17831. *
  17832. * @static
  17833. * @memberOf _
  17834. * @since 4.0.0
  17835. * @category Lang
  17836. * @param {Object} object The object to inspect.
  17837. * @param {Object} source The object of property values to match.
  17838. * @param {Function} [customizer] The function to customize comparisons.
  17839. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  17840. * @example
  17841. *
  17842. * function isGreeting(value) {
  17843. * return /^h(?:i|ello)$/.test(value);
  17844. * }
  17845. *
  17846. * function customizer(objValue, srcValue) {
  17847. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  17848. * return true;
  17849. * }
  17850. * }
  17851. *
  17852. * var object = { 'greeting': 'hello' };
  17853. * var source = { 'greeting': 'hi' };
  17854. *
  17855. * _.isMatchWith(object, source, customizer);
  17856. * // => true
  17857. */
  17858. function isMatchWith(object, source, customizer) {
  17859. customizer = typeof customizer == 'function' ? customizer : undefined;
  17860. return baseIsMatch(object, source, getMatchData(source), customizer);
  17861. }
  17862. /**
  17863. * Checks if `value` is `NaN`.
  17864. *
  17865. * **Note:** This method is based on
  17866. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  17867. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  17868. * `undefined` and other non-number values.
  17869. *
  17870. * @static
  17871. * @memberOf _
  17872. * @since 0.1.0
  17873. * @category Lang
  17874. * @param {*} value The value to check.
  17875. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  17876. * @example
  17877. *
  17878. * _.isNaN(NaN);
  17879. * // => true
  17880. *
  17881. * _.isNaN(new Number(NaN));
  17882. * // => true
  17883. *
  17884. * isNaN(undefined);
  17885. * // => true
  17886. *
  17887. * _.isNaN(undefined);
  17888. * // => false
  17889. */
  17890. function isNaN(value) {
  17891. // An `NaN` primitive is the only value that is not equal to itself.
  17892. // Perform the `toStringTag` check first to avoid errors with some
  17893. // ActiveX objects in IE.
  17894. return isNumber(value) && value != +value;
  17895. }
  17896. /**
  17897. * Checks if `value` is a pristine native function.
  17898. *
  17899. * **Note:** This method can't reliably detect native functions in the presence
  17900. * of the core-js package because core-js circumvents this kind of detection.
  17901. * Despite multiple requests, the core-js maintainer has made it clear: any
  17902. * attempt to fix the detection will be obstructed. As a result, we're left
  17903. * with little choice but to throw an error. Unfortunately, this also affects
  17904. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  17905. * which rely on core-js.
  17906. *
  17907. * @static
  17908. * @memberOf _
  17909. * @since 3.0.0
  17910. * @category Lang
  17911. * @param {*} value The value to check.
  17912. * @returns {boolean} Returns `true` if `value` is a native function,
  17913. * else `false`.
  17914. * @example
  17915. *
  17916. * _.isNative(Array.prototype.push);
  17917. * // => true
  17918. *
  17919. * _.isNative(_);
  17920. * // => false
  17921. */
  17922. function isNative(value) {
  17923. if (isMaskable(value)) {
  17924. throw new Error(CORE_ERROR_TEXT);
  17925. }
  17926. return baseIsNative(value);
  17927. }
  17928. /**
  17929. * Checks if `value` is `null`.
  17930. *
  17931. * @static
  17932. * @memberOf _
  17933. * @since 0.1.0
  17934. * @category Lang
  17935. * @param {*} value The value to check.
  17936. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  17937. * @example
  17938. *
  17939. * _.isNull(null);
  17940. * // => true
  17941. *
  17942. * _.isNull(void 0);
  17943. * // => false
  17944. */
  17945. function isNull(value) {
  17946. return value === null;
  17947. }
  17948. /**
  17949. * Checks if `value` is `null` or `undefined`.
  17950. *
  17951. * @static
  17952. * @memberOf _
  17953. * @since 4.0.0
  17954. * @category Lang
  17955. * @param {*} value The value to check.
  17956. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  17957. * @example
  17958. *
  17959. * _.isNil(null);
  17960. * // => true
  17961. *
  17962. * _.isNil(void 0);
  17963. * // => true
  17964. *
  17965. * _.isNil(NaN);
  17966. * // => false
  17967. */
  17968. function isNil(value) {
  17969. return value == null;
  17970. }
  17971. /**
  17972. * Checks if `value` is classified as a `Number` primitive or object.
  17973. *
  17974. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  17975. * classified as numbers, use the `_.isFinite` method.
  17976. *
  17977. * @static
  17978. * @memberOf _
  17979. * @since 0.1.0
  17980. * @category Lang
  17981. * @param {*} value The value to check.
  17982. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  17983. * @example
  17984. *
  17985. * _.isNumber(3);
  17986. * // => true
  17987. *
  17988. * _.isNumber(Number.MIN_VALUE);
  17989. * // => true
  17990. *
  17991. * _.isNumber(Infinity);
  17992. * // => true
  17993. *
  17994. * _.isNumber('3');
  17995. * // => false
  17996. */
  17997. function isNumber(value) {
  17998. return typeof value == 'number' ||
  17999. (isObjectLike(value) && baseGetTag(value) == numberTag);
  18000. }
  18001. /**
  18002. * Checks if `value` is a plain object, that is, an object created by the
  18003. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  18004. *
  18005. * @static
  18006. * @memberOf _
  18007. * @since 0.8.0
  18008. * @category Lang
  18009. * @param {*} value The value to check.
  18010. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  18011. * @example
  18012. *
  18013. * function Foo() {
  18014. * this.a = 1;
  18015. * }
  18016. *
  18017. * _.isPlainObject(new Foo);
  18018. * // => false
  18019. *
  18020. * _.isPlainObject([1, 2, 3]);
  18021. * // => false
  18022. *
  18023. * _.isPlainObject({ 'x': 0, 'y': 0 });
  18024. * // => true
  18025. *
  18026. * _.isPlainObject(Object.create(null));
  18027. * // => true
  18028. */
  18029. function isPlainObject(value) {
  18030. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  18031. return false;
  18032. }
  18033. var proto = getPrototype(value);
  18034. if (proto === null) {
  18035. return true;
  18036. }
  18037. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  18038. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  18039. funcToString.call(Ctor) == objectCtorString;
  18040. }
  18041. /**
  18042. * Checks if `value` is classified as a `RegExp` object.
  18043. *
  18044. * @static
  18045. * @memberOf _
  18046. * @since 0.1.0
  18047. * @category Lang
  18048. * @param {*} value The value to check.
  18049. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  18050. * @example
  18051. *
  18052. * _.isRegExp(/abc/);
  18053. * // => true
  18054. *
  18055. * _.isRegExp('/abc/');
  18056. * // => false
  18057. */
  18058. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  18059. /**
  18060. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  18061. * double precision number which isn't the result of a rounded unsafe integer.
  18062. *
  18063. * **Note:** This method is based on
  18064. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  18065. *
  18066. * @static
  18067. * @memberOf _
  18068. * @since 4.0.0
  18069. * @category Lang
  18070. * @param {*} value The value to check.
  18071. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  18072. * @example
  18073. *
  18074. * _.isSafeInteger(3);
  18075. * // => true
  18076. *
  18077. * _.isSafeInteger(Number.MIN_VALUE);
  18078. * // => false
  18079. *
  18080. * _.isSafeInteger(Infinity);
  18081. * // => false
  18082. *
  18083. * _.isSafeInteger('3');
  18084. * // => false
  18085. */
  18086. function isSafeInteger(value) {
  18087. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  18088. }
  18089. /**
  18090. * Checks if `value` is classified as a `Set` object.
  18091. *
  18092. * @static
  18093. * @memberOf _
  18094. * @since 4.3.0
  18095. * @category Lang
  18096. * @param {*} value The value to check.
  18097. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  18098. * @example
  18099. *
  18100. * _.isSet(new Set);
  18101. * // => true
  18102. *
  18103. * _.isSet(new WeakSet);
  18104. * // => false
  18105. */
  18106. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  18107. /**
  18108. * Checks if `value` is classified as a `String` primitive or object.
  18109. *
  18110. * @static
  18111. * @since 0.1.0
  18112. * @memberOf _
  18113. * @category Lang
  18114. * @param {*} value The value to check.
  18115. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  18116. * @example
  18117. *
  18118. * _.isString('abc');
  18119. * // => true
  18120. *
  18121. * _.isString(1);
  18122. * // => false
  18123. */
  18124. function isString(value) {
  18125. return typeof value == 'string' ||
  18126. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  18127. }
  18128. /**
  18129. * Checks if `value` is classified as a `Symbol` primitive or object.
  18130. *
  18131. * @static
  18132. * @memberOf _
  18133. * @since 4.0.0
  18134. * @category Lang
  18135. * @param {*} value The value to check.
  18136. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  18137. * @example
  18138. *
  18139. * _.isSymbol(Symbol.iterator);
  18140. * // => true
  18141. *
  18142. * _.isSymbol('abc');
  18143. * // => false
  18144. */
  18145. function isSymbol(value) {
  18146. return typeof value == 'symbol' ||
  18147. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  18148. }
  18149. /**
  18150. * Checks if `value` is classified as a typed array.
  18151. *
  18152. * @static
  18153. * @memberOf _
  18154. * @since 3.0.0
  18155. * @category Lang
  18156. * @param {*} value The value to check.
  18157. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  18158. * @example
  18159. *
  18160. * _.isTypedArray(new Uint8Array);
  18161. * // => true
  18162. *
  18163. * _.isTypedArray([]);
  18164. * // => false
  18165. */
  18166. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  18167. /**
  18168. * Checks if `value` is `undefined`.
  18169. *
  18170. * @static
  18171. * @since 0.1.0
  18172. * @memberOf _
  18173. * @category Lang
  18174. * @param {*} value The value to check.
  18175. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  18176. * @example
  18177. *
  18178. * _.isUndefined(void 0);
  18179. * // => true
  18180. *
  18181. * _.isUndefined(null);
  18182. * // => false
  18183. */
  18184. function isUndefined(value) {
  18185. return value === undefined;
  18186. }
  18187. /**
  18188. * Checks if `value` is classified as a `WeakMap` object.
  18189. *
  18190. * @static
  18191. * @memberOf _
  18192. * @since 4.3.0
  18193. * @category Lang
  18194. * @param {*} value The value to check.
  18195. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  18196. * @example
  18197. *
  18198. * _.isWeakMap(new WeakMap);
  18199. * // => true
  18200. *
  18201. * _.isWeakMap(new Map);
  18202. * // => false
  18203. */
  18204. function isWeakMap(value) {
  18205. return isObjectLike(value) && getTag(value) == weakMapTag;
  18206. }
  18207. /**
  18208. * Checks if `value` is classified as a `WeakSet` object.
  18209. *
  18210. * @static
  18211. * @memberOf _
  18212. * @since 4.3.0
  18213. * @category Lang
  18214. * @param {*} value The value to check.
  18215. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  18216. * @example
  18217. *
  18218. * _.isWeakSet(new WeakSet);
  18219. * // => true
  18220. *
  18221. * _.isWeakSet(new Set);
  18222. * // => false
  18223. */
  18224. function isWeakSet(value) {
  18225. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  18226. }
  18227. /**
  18228. * Checks if `value` is less than `other`.
  18229. *
  18230. * @static
  18231. * @memberOf _
  18232. * @since 3.9.0
  18233. * @category Lang
  18234. * @param {*} value The value to compare.
  18235. * @param {*} other The other value to compare.
  18236. * @returns {boolean} Returns `true` if `value` is less than `other`,
  18237. * else `false`.
  18238. * @see _.gt
  18239. * @example
  18240. *
  18241. * _.lt(1, 3);
  18242. * // => true
  18243. *
  18244. * _.lt(3, 3);
  18245. * // => false
  18246. *
  18247. * _.lt(3, 1);
  18248. * // => false
  18249. */
  18250. var lt = createRelationalOperation(baseLt);
  18251. /**
  18252. * Checks if `value` is less than or equal to `other`.
  18253. *
  18254. * @static
  18255. * @memberOf _
  18256. * @since 3.9.0
  18257. * @category Lang
  18258. * @param {*} value The value to compare.
  18259. * @param {*} other The other value to compare.
  18260. * @returns {boolean} Returns `true` if `value` is less than or equal to
  18261. * `other`, else `false`.
  18262. * @see _.gte
  18263. * @example
  18264. *
  18265. * _.lte(1, 3);
  18266. * // => true
  18267. *
  18268. * _.lte(3, 3);
  18269. * // => true
  18270. *
  18271. * _.lte(3, 1);
  18272. * // => false
  18273. */
  18274. var lte = createRelationalOperation(function(value, other) {
  18275. return value <= other;
  18276. });
  18277. /**
  18278. * Converts `value` to an array.
  18279. *
  18280. * @static
  18281. * @since 0.1.0
  18282. * @memberOf _
  18283. * @category Lang
  18284. * @param {*} value The value to convert.
  18285. * @returns {Array} Returns the converted array.
  18286. * @example
  18287. *
  18288. * _.toArray({ 'a': 1, 'b': 2 });
  18289. * // => [1, 2]
  18290. *
  18291. * _.toArray('abc');
  18292. * // => ['a', 'b', 'c']
  18293. *
  18294. * _.toArray(1);
  18295. * // => []
  18296. *
  18297. * _.toArray(null);
  18298. * // => []
  18299. */
  18300. function toArray(value) {
  18301. if (!value) {
  18302. return [];
  18303. }
  18304. if (isArrayLike(value)) {
  18305. return isString(value) ? stringToArray(value) : copyArray(value);
  18306. }
  18307. if (symIterator && value[symIterator]) {
  18308. return iteratorToArray(value[symIterator]());
  18309. }
  18310. var tag = getTag(value),
  18311. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  18312. return func(value);
  18313. }
  18314. /**
  18315. * Converts `value` to a finite number.
  18316. *
  18317. * @static
  18318. * @memberOf _
  18319. * @since 4.12.0
  18320. * @category Lang
  18321. * @param {*} value The value to convert.
  18322. * @returns {number} Returns the converted number.
  18323. * @example
  18324. *
  18325. * _.toFinite(3.2);
  18326. * // => 3.2
  18327. *
  18328. * _.toFinite(Number.MIN_VALUE);
  18329. * // => 5e-324
  18330. *
  18331. * _.toFinite(Infinity);
  18332. * // => 1.7976931348623157e+308
  18333. *
  18334. * _.toFinite('3.2');
  18335. * // => 3.2
  18336. */
  18337. function toFinite(value) {
  18338. if (!value) {
  18339. return value === 0 ? value : 0;
  18340. }
  18341. value = toNumber(value);
  18342. if (value === INFINITY || value === -INFINITY) {
  18343. var sign = (value < 0 ? -1 : 1);
  18344. return sign * MAX_INTEGER;
  18345. }
  18346. return value === value ? value : 0;
  18347. }
  18348. /**
  18349. * Converts `value` to an integer.
  18350. *
  18351. * **Note:** This method is loosely based on
  18352. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  18353. *
  18354. * @static
  18355. * @memberOf _
  18356. * @since 4.0.0
  18357. * @category Lang
  18358. * @param {*} value The value to convert.
  18359. * @returns {number} Returns the converted integer.
  18360. * @example
  18361. *
  18362. * _.toInteger(3.2);
  18363. * // => 3
  18364. *
  18365. * _.toInteger(Number.MIN_VALUE);
  18366. * // => 0
  18367. *
  18368. * _.toInteger(Infinity);
  18369. * // => 1.7976931348623157e+308
  18370. *
  18371. * _.toInteger('3.2');
  18372. * // => 3
  18373. */
  18374. function toInteger(value) {
  18375. var result = toFinite(value),
  18376. remainder = result % 1;
  18377. return result === result ? (remainder ? result - remainder : result) : 0;
  18378. }
  18379. /**
  18380. * Converts `value` to an integer suitable for use as the length of an
  18381. * array-like object.
  18382. *
  18383. * **Note:** This method is based on
  18384. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  18385. *
  18386. * @static
  18387. * @memberOf _
  18388. * @since 4.0.0
  18389. * @category Lang
  18390. * @param {*} value The value to convert.
  18391. * @returns {number} Returns the converted integer.
  18392. * @example
  18393. *
  18394. * _.toLength(3.2);
  18395. * // => 3
  18396. *
  18397. * _.toLength(Number.MIN_VALUE);
  18398. * // => 0
  18399. *
  18400. * _.toLength(Infinity);
  18401. * // => 4294967295
  18402. *
  18403. * _.toLength('3.2');
  18404. * // => 3
  18405. */
  18406. function toLength(value) {
  18407. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  18408. }
  18409. /**
  18410. * Converts `value` to a number.
  18411. *
  18412. * @static
  18413. * @memberOf _
  18414. * @since 4.0.0
  18415. * @category Lang
  18416. * @param {*} value The value to process.
  18417. * @returns {number} Returns the number.
  18418. * @example
  18419. *
  18420. * _.toNumber(3.2);
  18421. * // => 3.2
  18422. *
  18423. * _.toNumber(Number.MIN_VALUE);
  18424. * // => 5e-324
  18425. *
  18426. * _.toNumber(Infinity);
  18427. * // => Infinity
  18428. *
  18429. * _.toNumber('3.2');
  18430. * // => 3.2
  18431. */
  18432. function toNumber(value) {
  18433. if (typeof value == 'number') {
  18434. return value;
  18435. }
  18436. if (isSymbol(value)) {
  18437. return NAN;
  18438. }
  18439. if (isObject(value)) {
  18440. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  18441. value = isObject(other) ? (other + '') : other;
  18442. }
  18443. if (typeof value != 'string') {
  18444. return value === 0 ? value : +value;
  18445. }
  18446. value = value.replace(reTrim, '');
  18447. var isBinary = reIsBinary.test(value);
  18448. return (isBinary || reIsOctal.test(value))
  18449. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  18450. : (reIsBadHex.test(value) ? NAN : +value);
  18451. }
  18452. /**
  18453. * Converts `value` to a plain object flattening inherited enumerable string
  18454. * keyed properties of `value` to own properties of the plain object.
  18455. *
  18456. * @static
  18457. * @memberOf _
  18458. * @since 3.0.0
  18459. * @category Lang
  18460. * @param {*} value The value to convert.
  18461. * @returns {Object} Returns the converted plain object.
  18462. * @example
  18463. *
  18464. * function Foo() {
  18465. * this.b = 2;
  18466. * }
  18467. *
  18468. * Foo.prototype.c = 3;
  18469. *
  18470. * _.assign({ 'a': 1 }, new Foo);
  18471. * // => { 'a': 1, 'b': 2 }
  18472. *
  18473. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  18474. * // => { 'a': 1, 'b': 2, 'c': 3 }
  18475. */
  18476. function toPlainObject(value) {
  18477. return copyObject(value, keysIn(value));
  18478. }
  18479. /**
  18480. * Converts `value` to a safe integer. A safe integer can be compared and
  18481. * represented correctly.
  18482. *
  18483. * @static
  18484. * @memberOf _
  18485. * @since 4.0.0
  18486. * @category Lang
  18487. * @param {*} value The value to convert.
  18488. * @returns {number} Returns the converted integer.
  18489. * @example
  18490. *
  18491. * _.toSafeInteger(3.2);
  18492. * // => 3
  18493. *
  18494. * _.toSafeInteger(Number.MIN_VALUE);
  18495. * // => 0
  18496. *
  18497. * _.toSafeInteger(Infinity);
  18498. * // => 9007199254740991
  18499. *
  18500. * _.toSafeInteger('3.2');
  18501. * // => 3
  18502. */
  18503. function toSafeInteger(value) {
  18504. return value
  18505. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  18506. : (value === 0 ? value : 0);
  18507. }
  18508. /**
  18509. * Converts `value` to a string. An empty string is returned for `null`
  18510. * and `undefined` values. The sign of `-0` is preserved.
  18511. *
  18512. * @static
  18513. * @memberOf _
  18514. * @since 4.0.0
  18515. * @category Lang
  18516. * @param {*} value The value to convert.
  18517. * @returns {string} Returns the converted string.
  18518. * @example
  18519. *
  18520. * _.toString(null);
  18521. * // => ''
  18522. *
  18523. * _.toString(-0);
  18524. * // => '-0'
  18525. *
  18526. * _.toString([1, 2, 3]);
  18527. * // => '1,2,3'
  18528. */
  18529. function toString(value) {
  18530. return value == null ? '' : baseToString(value);
  18531. }
  18532. /*------------------------------------------------------------------------*/
  18533. /**
  18534. * Assigns own enumerable string keyed properties of source objects to the
  18535. * destination object. Source objects are applied from left to right.
  18536. * Subsequent sources overwrite property assignments of previous sources.
  18537. *
  18538. * **Note:** This method mutates `object` and is loosely based on
  18539. * [`Object.assign`](https://mdn.io/Object/assign).
  18540. *
  18541. * @static
  18542. * @memberOf _
  18543. * @since 0.10.0
  18544. * @category Object
  18545. * @param {Object} object The destination object.
  18546. * @param {...Object} [sources] The source objects.
  18547. * @returns {Object} Returns `object`.
  18548. * @see _.assignIn
  18549. * @example
  18550. *
  18551. * function Foo() {
  18552. * this.a = 1;
  18553. * }
  18554. *
  18555. * function Bar() {
  18556. * this.c = 3;
  18557. * }
  18558. *
  18559. * Foo.prototype.b = 2;
  18560. * Bar.prototype.d = 4;
  18561. *
  18562. * _.assign({ 'a': 0 }, new Foo, new Bar);
  18563. * // => { 'a': 1, 'c': 3 }
  18564. */
  18565. var assign = createAssigner(function(object, source) {
  18566. if (isPrototype(source) || isArrayLike(source)) {
  18567. copyObject(source, keys(source), object);
  18568. return;
  18569. }
  18570. for (var key in source) {
  18571. if (hasOwnProperty.call(source, key)) {
  18572. assignValue(object, key, source[key]);
  18573. }
  18574. }
  18575. });
  18576. /**
  18577. * This method is like `_.assign` except that it iterates over own and
  18578. * inherited source properties.
  18579. *
  18580. * **Note:** This method mutates `object`.
  18581. *
  18582. * @static
  18583. * @memberOf _
  18584. * @since 4.0.0
  18585. * @alias extend
  18586. * @category Object
  18587. * @param {Object} object The destination object.
  18588. * @param {...Object} [sources] The source objects.
  18589. * @returns {Object} Returns `object`.
  18590. * @see _.assign
  18591. * @example
  18592. *
  18593. * function Foo() {
  18594. * this.a = 1;
  18595. * }
  18596. *
  18597. * function Bar() {
  18598. * this.c = 3;
  18599. * }
  18600. *
  18601. * Foo.prototype.b = 2;
  18602. * Bar.prototype.d = 4;
  18603. *
  18604. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  18605. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  18606. */
  18607. var assignIn = createAssigner(function(object, source) {
  18608. copyObject(source, keysIn(source), object);
  18609. });
  18610. /**
  18611. * This method is like `_.assignIn` except that it accepts `customizer`
  18612. * which is invoked to produce the assigned values. If `customizer` returns
  18613. * `undefined`, assignment is handled by the method instead. The `customizer`
  18614. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  18615. *
  18616. * **Note:** This method mutates `object`.
  18617. *
  18618. * @static
  18619. * @memberOf _
  18620. * @since 4.0.0
  18621. * @alias extendWith
  18622. * @category Object
  18623. * @param {Object} object The destination object.
  18624. * @param {...Object} sources The source objects.
  18625. * @param {Function} [customizer] The function to customize assigned values.
  18626. * @returns {Object} Returns `object`.
  18627. * @see _.assignWith
  18628. * @example
  18629. *
  18630. * function customizer(objValue, srcValue) {
  18631. * return _.isUndefined(objValue) ? srcValue : objValue;
  18632. * }
  18633. *
  18634. * var defaults = _.partialRight(_.assignInWith, customizer);
  18635. *
  18636. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  18637. * // => { 'a': 1, 'b': 2 }
  18638. */
  18639. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  18640. copyObject(source, keysIn(source), object, customizer);
  18641. });
  18642. /**
  18643. * This method is like `_.assign` except that it accepts `customizer`
  18644. * which is invoked to produce the assigned values. If `customizer` returns
  18645. * `undefined`, assignment is handled by the method instead. The `customizer`
  18646. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  18647. *
  18648. * **Note:** This method mutates `object`.
  18649. *
  18650. * @static
  18651. * @memberOf _
  18652. * @since 4.0.0
  18653. * @category Object
  18654. * @param {Object} object The destination object.
  18655. * @param {...Object} sources The source objects.
  18656. * @param {Function} [customizer] The function to customize assigned values.
  18657. * @returns {Object} Returns `object`.
  18658. * @see _.assignInWith
  18659. * @example
  18660. *
  18661. * function customizer(objValue, srcValue) {
  18662. * return _.isUndefined(objValue) ? srcValue : objValue;
  18663. * }
  18664. *
  18665. * var defaults = _.partialRight(_.assignWith, customizer);
  18666. *
  18667. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  18668. * // => { 'a': 1, 'b': 2 }
  18669. */
  18670. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  18671. copyObject(source, keys(source), object, customizer);
  18672. });
  18673. /**
  18674. * Creates an array of values corresponding to `paths` of `object`.
  18675. *
  18676. * @static
  18677. * @memberOf _
  18678. * @since 1.0.0
  18679. * @category Object
  18680. * @param {Object} object The object to iterate over.
  18681. * @param {...(string|string[])} [paths] The property paths to pick.
  18682. * @returns {Array} Returns the picked values.
  18683. * @example
  18684. *
  18685. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  18686. *
  18687. * _.at(object, ['a[0].b.c', 'a[1]']);
  18688. * // => [3, 4]
  18689. */
  18690. var at = flatRest(baseAt);
  18691. /**
  18692. * Creates an object that inherits from the `prototype` object. If a
  18693. * `properties` object is given, its own enumerable string keyed properties
  18694. * are assigned to the created object.
  18695. *
  18696. * @static
  18697. * @memberOf _
  18698. * @since 2.3.0
  18699. * @category Object
  18700. * @param {Object} prototype The object to inherit from.
  18701. * @param {Object} [properties] The properties to assign to the object.
  18702. * @returns {Object} Returns the new object.
  18703. * @example
  18704. *
  18705. * function Shape() {
  18706. * this.x = 0;
  18707. * this.y = 0;
  18708. * }
  18709. *
  18710. * function Circle() {
  18711. * Shape.call(this);
  18712. * }
  18713. *
  18714. * Circle.prototype = _.create(Shape.prototype, {
  18715. * 'constructor': Circle
  18716. * });
  18717. *
  18718. * var circle = new Circle;
  18719. * circle instanceof Circle;
  18720. * // => true
  18721. *
  18722. * circle instanceof Shape;
  18723. * // => true
  18724. */
  18725. function create(prototype, properties) {
  18726. var result = baseCreate(prototype);
  18727. return properties == null ? result : baseAssign(result, properties);
  18728. }
  18729. /**
  18730. * Assigns own and inherited enumerable string keyed properties of source
  18731. * objects to the destination object for all destination properties that
  18732. * resolve to `undefined`. Source objects are applied from left to right.
  18733. * Once a property is set, additional values of the same property are ignored.
  18734. *
  18735. * **Note:** This method mutates `object`.
  18736. *
  18737. * @static
  18738. * @since 0.1.0
  18739. * @memberOf _
  18740. * @category Object
  18741. * @param {Object} object The destination object.
  18742. * @param {...Object} [sources] The source objects.
  18743. * @returns {Object} Returns `object`.
  18744. * @see _.defaultsDeep
  18745. * @example
  18746. *
  18747. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  18748. * // => { 'a': 1, 'b': 2 }
  18749. */
  18750. var defaults = baseRest(function(object, sources) {
  18751. object = Object(object);
  18752. var index = -1;
  18753. var length = sources.length;
  18754. var guard = length > 2 ? sources[2] : undefined;
  18755. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  18756. length = 1;
  18757. }
  18758. while (++index < length) {
  18759. var source = sources[index];
  18760. var props = keysIn(source);
  18761. var propsIndex = -1;
  18762. var propsLength = props.length;
  18763. while (++propsIndex < propsLength) {
  18764. var key = props[propsIndex];
  18765. var value = object[key];
  18766. if (value === undefined ||
  18767. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  18768. object[key] = source[key];
  18769. }
  18770. }
  18771. }
  18772. return object;
  18773. });
  18774. /**
  18775. * This method is like `_.defaults` except that it recursively assigns
  18776. * default properties.
  18777. *
  18778. * **Note:** This method mutates `object`.
  18779. *
  18780. * @static
  18781. * @memberOf _
  18782. * @since 3.10.0
  18783. * @category Object
  18784. * @param {Object} object The destination object.
  18785. * @param {...Object} [sources] The source objects.
  18786. * @returns {Object} Returns `object`.
  18787. * @see _.defaults
  18788. * @example
  18789. *
  18790. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  18791. * // => { 'a': { 'b': 2, 'c': 3 } }
  18792. */
  18793. var defaultsDeep = baseRest(function(args) {
  18794. args.push(undefined, customDefaultsMerge);
  18795. return apply(mergeWith, undefined, args);
  18796. });
  18797. /**
  18798. * This method is like `_.find` except that it returns the key of the first
  18799. * element `predicate` returns truthy for instead of the element itself.
  18800. *
  18801. * @static
  18802. * @memberOf _
  18803. * @since 1.1.0
  18804. * @category Object
  18805. * @param {Object} object The object to inspect.
  18806. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  18807. * @returns {string|undefined} Returns the key of the matched element,
  18808. * else `undefined`.
  18809. * @example
  18810. *
  18811. * var users = {
  18812. * 'barney': { 'age': 36, 'active': true },
  18813. * 'fred': { 'age': 40, 'active': false },
  18814. * 'pebbles': { 'age': 1, 'active': true }
  18815. * };
  18816. *
  18817. * _.findKey(users, function(o) { return o.age < 40; });
  18818. * // => 'barney' (iteration order is not guaranteed)
  18819. *
  18820. * // The `_.matches` iteratee shorthand.
  18821. * _.findKey(users, { 'age': 1, 'active': true });
  18822. * // => 'pebbles'
  18823. *
  18824. * // The `_.matchesProperty` iteratee shorthand.
  18825. * _.findKey(users, ['active', false]);
  18826. * // => 'fred'
  18827. *
  18828. * // The `_.property` iteratee shorthand.
  18829. * _.findKey(users, 'active');
  18830. * // => 'barney'
  18831. */
  18832. function findKey(object, predicate) {
  18833. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  18834. }
  18835. /**
  18836. * This method is like `_.findKey` except that it iterates over elements of
  18837. * a collection in the opposite order.
  18838. *
  18839. * @static
  18840. * @memberOf _
  18841. * @since 2.0.0
  18842. * @category Object
  18843. * @param {Object} object The object to inspect.
  18844. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  18845. * @returns {string|undefined} Returns the key of the matched element,
  18846. * else `undefined`.
  18847. * @example
  18848. *
  18849. * var users = {
  18850. * 'barney': { 'age': 36, 'active': true },
  18851. * 'fred': { 'age': 40, 'active': false },
  18852. * 'pebbles': { 'age': 1, 'active': true }
  18853. * };
  18854. *
  18855. * _.findLastKey(users, function(o) { return o.age < 40; });
  18856. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  18857. *
  18858. * // The `_.matches` iteratee shorthand.
  18859. * _.findLastKey(users, { 'age': 36, 'active': true });
  18860. * // => 'barney'
  18861. *
  18862. * // The `_.matchesProperty` iteratee shorthand.
  18863. * _.findLastKey(users, ['active', false]);
  18864. * // => 'fred'
  18865. *
  18866. * // The `_.property` iteratee shorthand.
  18867. * _.findLastKey(users, 'active');
  18868. * // => 'pebbles'
  18869. */
  18870. function findLastKey(object, predicate) {
  18871. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  18872. }
  18873. /**
  18874. * Iterates over own and inherited enumerable string keyed properties of an
  18875. * object and invokes `iteratee` for each property. The iteratee is invoked
  18876. * with three arguments: (value, key, object). Iteratee functions may exit
  18877. * iteration early by explicitly returning `false`.
  18878. *
  18879. * @static
  18880. * @memberOf _
  18881. * @since 0.3.0
  18882. * @category Object
  18883. * @param {Object} object The object to iterate over.
  18884. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  18885. * @returns {Object} Returns `object`.
  18886. * @see _.forInRight
  18887. * @example
  18888. *
  18889. * function Foo() {
  18890. * this.a = 1;
  18891. * this.b = 2;
  18892. * }
  18893. *
  18894. * Foo.prototype.c = 3;
  18895. *
  18896. * _.forIn(new Foo, function(value, key) {
  18897. * console.log(key);
  18898. * });
  18899. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  18900. */
  18901. function forIn(object, iteratee) {
  18902. return object == null
  18903. ? object
  18904. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  18905. }
  18906. /**
  18907. * This method is like `_.forIn` except that it iterates over properties of
  18908. * `object` in the opposite order.
  18909. *
  18910. * @static
  18911. * @memberOf _
  18912. * @since 2.0.0
  18913. * @category Object
  18914. * @param {Object} object The object to iterate over.
  18915. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  18916. * @returns {Object} Returns `object`.
  18917. * @see _.forIn
  18918. * @example
  18919. *
  18920. * function Foo() {
  18921. * this.a = 1;
  18922. * this.b = 2;
  18923. * }
  18924. *
  18925. * Foo.prototype.c = 3;
  18926. *
  18927. * _.forInRight(new Foo, function(value, key) {
  18928. * console.log(key);
  18929. * });
  18930. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  18931. */
  18932. function forInRight(object, iteratee) {
  18933. return object == null
  18934. ? object
  18935. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  18936. }
  18937. /**
  18938. * Iterates over own enumerable string keyed properties of an object and
  18939. * invokes `iteratee` for each property. The iteratee is invoked with three
  18940. * arguments: (value, key, object). Iteratee functions may exit iteration
  18941. * early by explicitly returning `false`.
  18942. *
  18943. * @static
  18944. * @memberOf _
  18945. * @since 0.3.0
  18946. * @category Object
  18947. * @param {Object} object The object to iterate over.
  18948. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  18949. * @returns {Object} Returns `object`.
  18950. * @see _.forOwnRight
  18951. * @example
  18952. *
  18953. * function Foo() {
  18954. * this.a = 1;
  18955. * this.b = 2;
  18956. * }
  18957. *
  18958. * Foo.prototype.c = 3;
  18959. *
  18960. * _.forOwn(new Foo, function(value, key) {
  18961. * console.log(key);
  18962. * });
  18963. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  18964. */
  18965. function forOwn(object, iteratee) {
  18966. return object && baseForOwn(object, getIteratee(iteratee, 3));
  18967. }
  18968. /**
  18969. * This method is like `_.forOwn` except that it iterates over properties of
  18970. * `object` in the opposite order.
  18971. *
  18972. * @static
  18973. * @memberOf _
  18974. * @since 2.0.0
  18975. * @category Object
  18976. * @param {Object} object The object to iterate over.
  18977. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  18978. * @returns {Object} Returns `object`.
  18979. * @see _.forOwn
  18980. * @example
  18981. *
  18982. * function Foo() {
  18983. * this.a = 1;
  18984. * this.b = 2;
  18985. * }
  18986. *
  18987. * Foo.prototype.c = 3;
  18988. *
  18989. * _.forOwnRight(new Foo, function(value, key) {
  18990. * console.log(key);
  18991. * });
  18992. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  18993. */
  18994. function forOwnRight(object, iteratee) {
  18995. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  18996. }
  18997. /**
  18998. * Creates an array of function property names from own enumerable properties
  18999. * of `object`.
  19000. *
  19001. * @static
  19002. * @since 0.1.0
  19003. * @memberOf _
  19004. * @category Object
  19005. * @param {Object} object The object to inspect.
  19006. * @returns {Array} Returns the function names.
  19007. * @see _.functionsIn
  19008. * @example
  19009. *
  19010. * function Foo() {
  19011. * this.a = _.constant('a');
  19012. * this.b = _.constant('b');
  19013. * }
  19014. *
  19015. * Foo.prototype.c = _.constant('c');
  19016. *
  19017. * _.functions(new Foo);
  19018. * // => ['a', 'b']
  19019. */
  19020. function functions(object) {
  19021. return object == null ? [] : baseFunctions(object, keys(object));
  19022. }
  19023. /**
  19024. * Creates an array of function property names from own and inherited
  19025. * enumerable properties of `object`.
  19026. *
  19027. * @static
  19028. * @memberOf _
  19029. * @since 4.0.0
  19030. * @category Object
  19031. * @param {Object} object The object to inspect.
  19032. * @returns {Array} Returns the function names.
  19033. * @see _.functions
  19034. * @example
  19035. *
  19036. * function Foo() {
  19037. * this.a = _.constant('a');
  19038. * this.b = _.constant('b');
  19039. * }
  19040. *
  19041. * Foo.prototype.c = _.constant('c');
  19042. *
  19043. * _.functionsIn(new Foo);
  19044. * // => ['a', 'b', 'c']
  19045. */
  19046. function functionsIn(object) {
  19047. return object == null ? [] : baseFunctions(object, keysIn(object));
  19048. }
  19049. /**
  19050. * Gets the value at `path` of `object`. If the resolved value is
  19051. * `undefined`, the `defaultValue` is returned in its place.
  19052. *
  19053. * @static
  19054. * @memberOf _
  19055. * @since 3.7.0
  19056. * @category Object
  19057. * @param {Object} object The object to query.
  19058. * @param {Array|string} path The path of the property to get.
  19059. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  19060. * @returns {*} Returns the resolved value.
  19061. * @example
  19062. *
  19063. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  19064. *
  19065. * _.get(object, 'a[0].b.c');
  19066. * // => 3
  19067. *
  19068. * _.get(object, ['a', '0', 'b', 'c']);
  19069. * // => 3
  19070. *
  19071. * _.get(object, 'a.b.c', 'default');
  19072. * // => 'default'
  19073. */
  19074. function get(object, path, defaultValue) {
  19075. var result = object == null ? undefined : baseGet(object, path);
  19076. return result === undefined ? defaultValue : result;
  19077. }
  19078. /**
  19079. * Checks if `path` is a direct property of `object`.
  19080. *
  19081. * @static
  19082. * @since 0.1.0
  19083. * @memberOf _
  19084. * @category Object
  19085. * @param {Object} object The object to query.
  19086. * @param {Array|string} path The path to check.
  19087. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  19088. * @example
  19089. *
  19090. * var object = { 'a': { 'b': 2 } };
  19091. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  19092. *
  19093. * _.has(object, 'a');
  19094. * // => true
  19095. *
  19096. * _.has(object, 'a.b');
  19097. * // => true
  19098. *
  19099. * _.has(object, ['a', 'b']);
  19100. * // => true
  19101. *
  19102. * _.has(other, 'a');
  19103. * // => false
  19104. */
  19105. function has(object, path) {
  19106. return object != null && hasPath(object, path, baseHas);
  19107. }
  19108. /**
  19109. * Checks if `path` is a direct or inherited property of `object`.
  19110. *
  19111. * @static
  19112. * @memberOf _
  19113. * @since 4.0.0
  19114. * @category Object
  19115. * @param {Object} object The object to query.
  19116. * @param {Array|string} path The path to check.
  19117. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  19118. * @example
  19119. *
  19120. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  19121. *
  19122. * _.hasIn(object, 'a');
  19123. * // => true
  19124. *
  19125. * _.hasIn(object, 'a.b');
  19126. * // => true
  19127. *
  19128. * _.hasIn(object, ['a', 'b']);
  19129. * // => true
  19130. *
  19131. * _.hasIn(object, 'b');
  19132. * // => false
  19133. */
  19134. function hasIn(object, path) {
  19135. return object != null && hasPath(object, path, baseHasIn);
  19136. }
  19137. /**
  19138. * Creates an object composed of the inverted keys and values of `object`.
  19139. * If `object` contains duplicate values, subsequent values overwrite
  19140. * property assignments of previous values.
  19141. *
  19142. * @static
  19143. * @memberOf _
  19144. * @since 0.7.0
  19145. * @category Object
  19146. * @param {Object} object The object to invert.
  19147. * @returns {Object} Returns the new inverted object.
  19148. * @example
  19149. *
  19150. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  19151. *
  19152. * _.invert(object);
  19153. * // => { '1': 'c', '2': 'b' }
  19154. */
  19155. var invert = createInverter(function(result, value, key) {
  19156. if (value != null &&
  19157. typeof value.toString != 'function') {
  19158. value = nativeObjectToString.call(value);
  19159. }
  19160. result[value] = key;
  19161. }, constant(identity));
  19162. /**
  19163. * This method is like `_.invert` except that the inverted object is generated
  19164. * from the results of running each element of `object` thru `iteratee`. The
  19165. * corresponding inverted value of each inverted key is an array of keys
  19166. * responsible for generating the inverted value. The iteratee is invoked
  19167. * with one argument: (value).
  19168. *
  19169. * @static
  19170. * @memberOf _
  19171. * @since 4.1.0
  19172. * @category Object
  19173. * @param {Object} object The object to invert.
  19174. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  19175. * @returns {Object} Returns the new inverted object.
  19176. * @example
  19177. *
  19178. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  19179. *
  19180. * _.invertBy(object);
  19181. * // => { '1': ['a', 'c'], '2': ['b'] }
  19182. *
  19183. * _.invertBy(object, function(value) {
  19184. * return 'group' + value;
  19185. * });
  19186. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  19187. */
  19188. var invertBy = createInverter(function(result, value, key) {
  19189. if (value != null &&
  19190. typeof value.toString != 'function') {
  19191. value = nativeObjectToString.call(value);
  19192. }
  19193. if (hasOwnProperty.call(result, value)) {
  19194. result[value].push(key);
  19195. } else {
  19196. result[value] = [key];
  19197. }
  19198. }, getIteratee);
  19199. /**
  19200. * Invokes the method at `path` of `object`.
  19201. *
  19202. * @static
  19203. * @memberOf _
  19204. * @since 4.0.0
  19205. * @category Object
  19206. * @param {Object} object The object to query.
  19207. * @param {Array|string} path The path of the method to invoke.
  19208. * @param {...*} [args] The arguments to invoke the method with.
  19209. * @returns {*} Returns the result of the invoked method.
  19210. * @example
  19211. *
  19212. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  19213. *
  19214. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  19215. * // => [2, 3]
  19216. */
  19217. var invoke = baseRest(baseInvoke);
  19218. /**
  19219. * Creates an array of the own enumerable property names of `object`.
  19220. *
  19221. * **Note:** Non-object values are coerced to objects. See the
  19222. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  19223. * for more details.
  19224. *
  19225. * @static
  19226. * @since 0.1.0
  19227. * @memberOf _
  19228. * @category Object
  19229. * @param {Object} object The object to query.
  19230. * @returns {Array} Returns the array of property names.
  19231. * @example
  19232. *
  19233. * function Foo() {
  19234. * this.a = 1;
  19235. * this.b = 2;
  19236. * }
  19237. *
  19238. * Foo.prototype.c = 3;
  19239. *
  19240. * _.keys(new Foo);
  19241. * // => ['a', 'b'] (iteration order is not guaranteed)
  19242. *
  19243. * _.keys('hi');
  19244. * // => ['0', '1']
  19245. */
  19246. function keys(object) {
  19247. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  19248. }
  19249. /**
  19250. * Creates an array of the own and inherited enumerable property names of `object`.
  19251. *
  19252. * **Note:** Non-object values are coerced to objects.
  19253. *
  19254. * @static
  19255. * @memberOf _
  19256. * @since 3.0.0
  19257. * @category Object
  19258. * @param {Object} object The object to query.
  19259. * @returns {Array} Returns the array of property names.
  19260. * @example
  19261. *
  19262. * function Foo() {
  19263. * this.a = 1;
  19264. * this.b = 2;
  19265. * }
  19266. *
  19267. * Foo.prototype.c = 3;
  19268. *
  19269. * _.keysIn(new Foo);
  19270. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  19271. */
  19272. function keysIn(object) {
  19273. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  19274. }
  19275. /**
  19276. * The opposite of `_.mapValues`; this method creates an object with the
  19277. * same values as `object` and keys generated by running each own enumerable
  19278. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  19279. * with three arguments: (value, key, object).
  19280. *
  19281. * @static
  19282. * @memberOf _
  19283. * @since 3.8.0
  19284. * @category Object
  19285. * @param {Object} object The object to iterate over.
  19286. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  19287. * @returns {Object} Returns the new mapped object.
  19288. * @see _.mapValues
  19289. * @example
  19290. *
  19291. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  19292. * return key + value;
  19293. * });
  19294. * // => { 'a1': 1, 'b2': 2 }
  19295. */
  19296. function mapKeys(object, iteratee) {
  19297. var result = {};
  19298. iteratee = getIteratee(iteratee, 3);
  19299. baseForOwn(object, function(value, key, object) {
  19300. baseAssignValue(result, iteratee(value, key, object), value);
  19301. });
  19302. return result;
  19303. }
  19304. /**
  19305. * Creates an object with the same keys as `object` and values generated
  19306. * by running each own enumerable string keyed property of `object` thru
  19307. * `iteratee`. The iteratee is invoked with three arguments:
  19308. * (value, key, object).
  19309. *
  19310. * @static
  19311. * @memberOf _
  19312. * @since 2.4.0
  19313. * @category Object
  19314. * @param {Object} object The object to iterate over.
  19315. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  19316. * @returns {Object} Returns the new mapped object.
  19317. * @see _.mapKeys
  19318. * @example
  19319. *
  19320. * var users = {
  19321. * 'fred': { 'user': 'fred', 'age': 40 },
  19322. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  19323. * };
  19324. *
  19325. * _.mapValues(users, function(o) { return o.age; });
  19326. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  19327. *
  19328. * // The `_.property` iteratee shorthand.
  19329. * _.mapValues(users, 'age');
  19330. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  19331. */
  19332. function mapValues(object, iteratee) {
  19333. var result = {};
  19334. iteratee = getIteratee(iteratee, 3);
  19335. baseForOwn(object, function(value, key, object) {
  19336. baseAssignValue(result, key, iteratee(value, key, object));
  19337. });
  19338. return result;
  19339. }
  19340. /**
  19341. * This method is like `_.assign` except that it recursively merges own and
  19342. * inherited enumerable string keyed properties of source objects into the
  19343. * destination object. Source properties that resolve to `undefined` are
  19344. * skipped if a destination value exists. Array and plain object properties
  19345. * are merged recursively. Other objects and value types are overridden by
  19346. * assignment. Source objects are applied from left to right. Subsequent
  19347. * sources overwrite property assignments of previous sources.
  19348. *
  19349. * **Note:** This method mutates `object`.
  19350. *
  19351. * @static
  19352. * @memberOf _
  19353. * @since 0.5.0
  19354. * @category Object
  19355. * @param {Object} object The destination object.
  19356. * @param {...Object} [sources] The source objects.
  19357. * @returns {Object} Returns `object`.
  19358. * @example
  19359. *
  19360. * var object = {
  19361. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  19362. * };
  19363. *
  19364. * var other = {
  19365. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  19366. * };
  19367. *
  19368. * _.merge(object, other);
  19369. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  19370. */
  19371. var merge = createAssigner(function(object, source, srcIndex) {
  19372. baseMerge(object, source, srcIndex);
  19373. });
  19374. /**
  19375. * This method is like `_.merge` except that it accepts `customizer` which
  19376. * is invoked to produce the merged values of the destination and source
  19377. * properties. If `customizer` returns `undefined`, merging is handled by the
  19378. * method instead. The `customizer` is invoked with six arguments:
  19379. * (objValue, srcValue, key, object, source, stack).
  19380. *
  19381. * **Note:** This method mutates `object`.
  19382. *
  19383. * @static
  19384. * @memberOf _
  19385. * @since 4.0.0
  19386. * @category Object
  19387. * @param {Object} object The destination object.
  19388. * @param {...Object} sources The source objects.
  19389. * @param {Function} customizer The function to customize assigned values.
  19390. * @returns {Object} Returns `object`.
  19391. * @example
  19392. *
  19393. * function customizer(objValue, srcValue) {
  19394. * if (_.isArray(objValue)) {
  19395. * return objValue.concat(srcValue);
  19396. * }
  19397. * }
  19398. *
  19399. * var object = { 'a': [1], 'b': [2] };
  19400. * var other = { 'a': [3], 'b': [4] };
  19401. *
  19402. * _.mergeWith(object, other, customizer);
  19403. * // => { 'a': [1, 3], 'b': [2, 4] }
  19404. */
  19405. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  19406. baseMerge(object, source, srcIndex, customizer);
  19407. });
  19408. /**
  19409. * The opposite of `_.pick`; this method creates an object composed of the
  19410. * own and inherited enumerable property paths of `object` that are not omitted.
  19411. *
  19412. * **Note:** This method is considerably slower than `_.pick`.
  19413. *
  19414. * @static
  19415. * @since 0.1.0
  19416. * @memberOf _
  19417. * @category Object
  19418. * @param {Object} object The source object.
  19419. * @param {...(string|string[])} [paths] The property paths to omit.
  19420. * @returns {Object} Returns the new object.
  19421. * @example
  19422. *
  19423. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  19424. *
  19425. * _.omit(object, ['a', 'c']);
  19426. * // => { 'b': '2' }
  19427. */
  19428. var omit = flatRest(function(object, paths) {
  19429. var result = {};
  19430. if (object == null) {
  19431. return result;
  19432. }
  19433. var isDeep = false;
  19434. paths = arrayMap(paths, function(path) {
  19435. path = castPath(path, object);
  19436. isDeep || (isDeep = path.length > 1);
  19437. return path;
  19438. });
  19439. copyObject(object, getAllKeysIn(object), result);
  19440. if (isDeep) {
  19441. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  19442. }
  19443. var length = paths.length;
  19444. while (length--) {
  19445. baseUnset(result, paths[length]);
  19446. }
  19447. return result;
  19448. });
  19449. /**
  19450. * The opposite of `_.pickBy`; this method creates an object composed of
  19451. * the own and inherited enumerable string keyed properties of `object` that
  19452. * `predicate` doesn't return truthy for. The predicate is invoked with two
  19453. * arguments: (value, key).
  19454. *
  19455. * @static
  19456. * @memberOf _
  19457. * @since 4.0.0
  19458. * @category Object
  19459. * @param {Object} object The source object.
  19460. * @param {Function} [predicate=_.identity] The function invoked per property.
  19461. * @returns {Object} Returns the new object.
  19462. * @example
  19463. *
  19464. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  19465. *
  19466. * _.omitBy(object, _.isNumber);
  19467. * // => { 'b': '2' }
  19468. */
  19469. function omitBy(object, predicate) {
  19470. return pickBy(object, negate(getIteratee(predicate)));
  19471. }
  19472. /**
  19473. * Creates an object composed of the picked `object` properties.
  19474. *
  19475. * @static
  19476. * @since 0.1.0
  19477. * @memberOf _
  19478. * @category Object
  19479. * @param {Object} object The source object.
  19480. * @param {...(string|string[])} [paths] The property paths to pick.
  19481. * @returns {Object} Returns the new object.
  19482. * @example
  19483. *
  19484. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  19485. *
  19486. * _.pick(object, ['a', 'c']);
  19487. * // => { 'a': 1, 'c': 3 }
  19488. */
  19489. var pick = flatRest(function(object, paths) {
  19490. return object == null ? {} : basePick(object, paths);
  19491. });
  19492. /**
  19493. * Creates an object composed of the `object` properties `predicate` returns
  19494. * truthy for. The predicate is invoked with two arguments: (value, key).
  19495. *
  19496. * @static
  19497. * @memberOf _
  19498. * @since 4.0.0
  19499. * @category Object
  19500. * @param {Object} object The source object.
  19501. * @param {Function} [predicate=_.identity] The function invoked per property.
  19502. * @returns {Object} Returns the new object.
  19503. * @example
  19504. *
  19505. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  19506. *
  19507. * _.pickBy(object, _.isNumber);
  19508. * // => { 'a': 1, 'c': 3 }
  19509. */
  19510. function pickBy(object, predicate) {
  19511. if (object == null) {
  19512. return {};
  19513. }
  19514. var props = arrayMap(getAllKeysIn(object), function(prop) {
  19515. return [prop];
  19516. });
  19517. predicate = getIteratee(predicate);
  19518. return basePickBy(object, props, function(value, path) {
  19519. return predicate(value, path[0]);
  19520. });
  19521. }
  19522. /**
  19523. * This method is like `_.get` except that if the resolved value is a
  19524. * function it's invoked with the `this` binding of its parent object and
  19525. * its result is returned.
  19526. *
  19527. * @static
  19528. * @since 0.1.0
  19529. * @memberOf _
  19530. * @category Object
  19531. * @param {Object} object The object to query.
  19532. * @param {Array|string} path The path of the property to resolve.
  19533. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  19534. * @returns {*} Returns the resolved value.
  19535. * @example
  19536. *
  19537. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  19538. *
  19539. * _.result(object, 'a[0].b.c1');
  19540. * // => 3
  19541. *
  19542. * _.result(object, 'a[0].b.c2');
  19543. * // => 4
  19544. *
  19545. * _.result(object, 'a[0].b.c3', 'default');
  19546. * // => 'default'
  19547. *
  19548. * _.result(object, 'a[0].b.c3', _.constant('default'));
  19549. * // => 'default'
  19550. */
  19551. function result(object, path, defaultValue) {
  19552. path = castPath(path, object);
  19553. var index = -1,
  19554. length = path.length;
  19555. // Ensure the loop is entered when path is empty.
  19556. if (!length) {
  19557. length = 1;
  19558. object = undefined;
  19559. }
  19560. while (++index < length) {
  19561. var value = object == null ? undefined : object[toKey(path[index])];
  19562. if (value === undefined) {
  19563. index = length;
  19564. value = defaultValue;
  19565. }
  19566. object = isFunction(value) ? value.call(object) : value;
  19567. }
  19568. return object;
  19569. }
  19570. /**
  19571. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  19572. * it's created. Arrays are created for missing index properties while objects
  19573. * are created for all other missing properties. Use `_.setWith` to customize
  19574. * `path` creation.
  19575. *
  19576. * **Note:** This method mutates `object`.
  19577. *
  19578. * @static
  19579. * @memberOf _
  19580. * @since 3.7.0
  19581. * @category Object
  19582. * @param {Object} object The object to modify.
  19583. * @param {Array|string} path The path of the property to set.
  19584. * @param {*} value The value to set.
  19585. * @returns {Object} Returns `object`.
  19586. * @example
  19587. *
  19588. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  19589. *
  19590. * _.set(object, 'a[0].b.c', 4);
  19591. * console.log(object.a[0].b.c);
  19592. * // => 4
  19593. *
  19594. * _.set(object, ['x', '0', 'y', 'z'], 5);
  19595. * console.log(object.x[0].y.z);
  19596. * // => 5
  19597. */
  19598. function set(object, path, value) {
  19599. return object == null ? object : baseSet(object, path, value);
  19600. }
  19601. /**
  19602. * This method is like `_.set` except that it accepts `customizer` which is
  19603. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  19604. * path creation is handled by the method instead. The `customizer` is invoked
  19605. * with three arguments: (nsValue, key, nsObject).
  19606. *
  19607. * **Note:** This method mutates `object`.
  19608. *
  19609. * @static
  19610. * @memberOf _
  19611. * @since 4.0.0
  19612. * @category Object
  19613. * @param {Object} object The object to modify.
  19614. * @param {Array|string} path The path of the property to set.
  19615. * @param {*} value The value to set.
  19616. * @param {Function} [customizer] The function to customize assigned values.
  19617. * @returns {Object} Returns `object`.
  19618. * @example
  19619. *
  19620. * var object = {};
  19621. *
  19622. * _.setWith(object, '[0][1]', 'a', Object);
  19623. * // => { '0': { '1': 'a' } }
  19624. */
  19625. function setWith(object, path, value, customizer) {
  19626. customizer = typeof customizer == 'function' ? customizer : undefined;
  19627. return object == null ? object : baseSet(object, path, value, customizer);
  19628. }
  19629. /**
  19630. * Creates an array of own enumerable string keyed-value pairs for `object`
  19631. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  19632. * entries are returned.
  19633. *
  19634. * @static
  19635. * @memberOf _
  19636. * @since 4.0.0
  19637. * @alias entries
  19638. * @category Object
  19639. * @param {Object} object The object to query.
  19640. * @returns {Array} Returns the key-value pairs.
  19641. * @example
  19642. *
  19643. * function Foo() {
  19644. * this.a = 1;
  19645. * this.b = 2;
  19646. * }
  19647. *
  19648. * Foo.prototype.c = 3;
  19649. *
  19650. * _.toPairs(new Foo);
  19651. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  19652. */
  19653. var toPairs = createToPairs(keys);
  19654. /**
  19655. * Creates an array of own and inherited enumerable string keyed-value pairs
  19656. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  19657. * or set, its entries are returned.
  19658. *
  19659. * @static
  19660. * @memberOf _
  19661. * @since 4.0.0
  19662. * @alias entriesIn
  19663. * @category Object
  19664. * @param {Object} object The object to query.
  19665. * @returns {Array} Returns the key-value pairs.
  19666. * @example
  19667. *
  19668. * function Foo() {
  19669. * this.a = 1;
  19670. * this.b = 2;
  19671. * }
  19672. *
  19673. * Foo.prototype.c = 3;
  19674. *
  19675. * _.toPairsIn(new Foo);
  19676. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  19677. */
  19678. var toPairsIn = createToPairs(keysIn);
  19679. /**
  19680. * An alternative to `_.reduce`; this method transforms `object` to a new
  19681. * `accumulator` object which is the result of running each of its own
  19682. * enumerable string keyed properties thru `iteratee`, with each invocation
  19683. * potentially mutating the `accumulator` object. If `accumulator` is not
  19684. * provided, a new object with the same `[[Prototype]]` will be used. The
  19685. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  19686. * Iteratee functions may exit iteration early by explicitly returning `false`.
  19687. *
  19688. * @static
  19689. * @memberOf _
  19690. * @since 1.3.0
  19691. * @category Object
  19692. * @param {Object} object The object to iterate over.
  19693. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  19694. * @param {*} [accumulator] The custom accumulator value.
  19695. * @returns {*} Returns the accumulated value.
  19696. * @example
  19697. *
  19698. * _.transform([2, 3, 4], function(result, n) {
  19699. * result.push(n *= n);
  19700. * return n % 2 == 0;
  19701. * }, []);
  19702. * // => [4, 9]
  19703. *
  19704. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  19705. * (result[value] || (result[value] = [])).push(key);
  19706. * }, {});
  19707. * // => { '1': ['a', 'c'], '2': ['b'] }
  19708. */
  19709. function transform(object, iteratee, accumulator) {
  19710. var isArr = isArray(object),
  19711. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  19712. iteratee = getIteratee(iteratee, 4);
  19713. if (accumulator == null) {
  19714. var Ctor = object && object.constructor;
  19715. if (isArrLike) {
  19716. accumulator = isArr ? new Ctor : [];
  19717. }
  19718. else if (isObject(object)) {
  19719. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  19720. }
  19721. else {
  19722. accumulator = {};
  19723. }
  19724. }
  19725. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  19726. return iteratee(accumulator, value, index, object);
  19727. });
  19728. return accumulator;
  19729. }
  19730. /**
  19731. * Removes the property at `path` of `object`.
  19732. *
  19733. * **Note:** This method mutates `object`.
  19734. *
  19735. * @static
  19736. * @memberOf _
  19737. * @since 4.0.0
  19738. * @category Object
  19739. * @param {Object} object The object to modify.
  19740. * @param {Array|string} path The path of the property to unset.
  19741. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  19742. * @example
  19743. *
  19744. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  19745. * _.unset(object, 'a[0].b.c');
  19746. * // => true
  19747. *
  19748. * console.log(object);
  19749. * // => { 'a': [{ 'b': {} }] };
  19750. *
  19751. * _.unset(object, ['a', '0', 'b', 'c']);
  19752. * // => true
  19753. *
  19754. * console.log(object);
  19755. * // => { 'a': [{ 'b': {} }] };
  19756. */
  19757. function unset(object, path) {
  19758. return object == null ? true : baseUnset(object, path);
  19759. }
  19760. /**
  19761. * This method is like `_.set` except that accepts `updater` to produce the
  19762. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  19763. * is invoked with one argument: (value).
  19764. *
  19765. * **Note:** This method mutates `object`.
  19766. *
  19767. * @static
  19768. * @memberOf _
  19769. * @since 4.6.0
  19770. * @category Object
  19771. * @param {Object} object The object to modify.
  19772. * @param {Array|string} path The path of the property to set.
  19773. * @param {Function} updater The function to produce the updated value.
  19774. * @returns {Object} Returns `object`.
  19775. * @example
  19776. *
  19777. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  19778. *
  19779. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  19780. * console.log(object.a[0].b.c);
  19781. * // => 9
  19782. *
  19783. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  19784. * console.log(object.x[0].y.z);
  19785. * // => 0
  19786. */
  19787. function update(object, path, updater) {
  19788. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  19789. }
  19790. /**
  19791. * This method is like `_.update` except that it accepts `customizer` which is
  19792. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  19793. * path creation is handled by the method instead. The `customizer` is invoked
  19794. * with three arguments: (nsValue, key, nsObject).
  19795. *
  19796. * **Note:** This method mutates `object`.
  19797. *
  19798. * @static
  19799. * @memberOf _
  19800. * @since 4.6.0
  19801. * @category Object
  19802. * @param {Object} object The object to modify.
  19803. * @param {Array|string} path The path of the property to set.
  19804. * @param {Function} updater The function to produce the updated value.
  19805. * @param {Function} [customizer] The function to customize assigned values.
  19806. * @returns {Object} Returns `object`.
  19807. * @example
  19808. *
  19809. * var object = {};
  19810. *
  19811. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  19812. * // => { '0': { '1': 'a' } }
  19813. */
  19814. function updateWith(object, path, updater, customizer) {
  19815. customizer = typeof customizer == 'function' ? customizer : undefined;
  19816. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  19817. }
  19818. /**
  19819. * Creates an array of the own enumerable string keyed property values of `object`.
  19820. *
  19821. * **Note:** Non-object values are coerced to objects.
  19822. *
  19823. * @static
  19824. * @since 0.1.0
  19825. * @memberOf _
  19826. * @category Object
  19827. * @param {Object} object The object to query.
  19828. * @returns {Array} Returns the array of property values.
  19829. * @example
  19830. *
  19831. * function Foo() {
  19832. * this.a = 1;
  19833. * this.b = 2;
  19834. * }
  19835. *
  19836. * Foo.prototype.c = 3;
  19837. *
  19838. * _.values(new Foo);
  19839. * // => [1, 2] (iteration order is not guaranteed)
  19840. *
  19841. * _.values('hi');
  19842. * // => ['h', 'i']
  19843. */
  19844. function values(object) {
  19845. return object == null ? [] : baseValues(object, keys(object));
  19846. }
  19847. /**
  19848. * Creates an array of the own and inherited enumerable string keyed property
  19849. * values of `object`.
  19850. *
  19851. * **Note:** Non-object values are coerced to objects.
  19852. *
  19853. * @static
  19854. * @memberOf _
  19855. * @since 3.0.0
  19856. * @category Object
  19857. * @param {Object} object The object to query.
  19858. * @returns {Array} Returns the array of property values.
  19859. * @example
  19860. *
  19861. * function Foo() {
  19862. * this.a = 1;
  19863. * this.b = 2;
  19864. * }
  19865. *
  19866. * Foo.prototype.c = 3;
  19867. *
  19868. * _.valuesIn(new Foo);
  19869. * // => [1, 2, 3] (iteration order is not guaranteed)
  19870. */
  19871. function valuesIn(object) {
  19872. return object == null ? [] : baseValues(object, keysIn(object));
  19873. }
  19874. /*------------------------------------------------------------------------*/
  19875. /**
  19876. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  19877. *
  19878. * @static
  19879. * @memberOf _
  19880. * @since 4.0.0
  19881. * @category Number
  19882. * @param {number} number The number to clamp.
  19883. * @param {number} [lower] The lower bound.
  19884. * @param {number} upper The upper bound.
  19885. * @returns {number} Returns the clamped number.
  19886. * @example
  19887. *
  19888. * _.clamp(-10, -5, 5);
  19889. * // => -5
  19890. *
  19891. * _.clamp(10, -5, 5);
  19892. * // => 5
  19893. */
  19894. function clamp(number, lower, upper) {
  19895. if (upper === undefined) {
  19896. upper = lower;
  19897. lower = undefined;
  19898. }
  19899. if (upper !== undefined) {
  19900. upper = toNumber(upper);
  19901. upper = upper === upper ? upper : 0;
  19902. }
  19903. if (lower !== undefined) {
  19904. lower = toNumber(lower);
  19905. lower = lower === lower ? lower : 0;
  19906. }
  19907. return baseClamp(toNumber(number), lower, upper);
  19908. }
  19909. /**
  19910. * Checks if `n` is between `start` and up to, but not including, `end`. If
  19911. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  19912. * If `start` is greater than `end` the params are swapped to support
  19913. * negative ranges.
  19914. *
  19915. * @static
  19916. * @memberOf _
  19917. * @since 3.3.0
  19918. * @category Number
  19919. * @param {number} number The number to check.
  19920. * @param {number} [start=0] The start of the range.
  19921. * @param {number} end The end of the range.
  19922. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  19923. * @see _.range, _.rangeRight
  19924. * @example
  19925. *
  19926. * _.inRange(3, 2, 4);
  19927. * // => true
  19928. *
  19929. * _.inRange(4, 8);
  19930. * // => true
  19931. *
  19932. * _.inRange(4, 2);
  19933. * // => false
  19934. *
  19935. * _.inRange(2, 2);
  19936. * // => false
  19937. *
  19938. * _.inRange(1.2, 2);
  19939. * // => true
  19940. *
  19941. * _.inRange(5.2, 4);
  19942. * // => false
  19943. *
  19944. * _.inRange(-3, -2, -6);
  19945. * // => true
  19946. */
  19947. function inRange(number, start, end) {
  19948. start = toFinite(start);
  19949. if (end === undefined) {
  19950. end = start;
  19951. start = 0;
  19952. } else {
  19953. end = toFinite(end);
  19954. }
  19955. number = toNumber(number);
  19956. return baseInRange(number, start, end);
  19957. }
  19958. /**
  19959. * Produces a random number between the inclusive `lower` and `upper` bounds.
  19960. * If only one argument is provided a number between `0` and the given number
  19961. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  19962. * floats, a floating-point number is returned instead of an integer.
  19963. *
  19964. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  19965. * floating-point values which can produce unexpected results.
  19966. *
  19967. * @static
  19968. * @memberOf _
  19969. * @since 0.7.0
  19970. * @category Number
  19971. * @param {number} [lower=0] The lower bound.
  19972. * @param {number} [upper=1] The upper bound.
  19973. * @param {boolean} [floating] Specify returning a floating-point number.
  19974. * @returns {number} Returns the random number.
  19975. * @example
  19976. *
  19977. * _.random(0, 5);
  19978. * // => an integer between 0 and 5
  19979. *
  19980. * _.random(5);
  19981. * // => also an integer between 0 and 5
  19982. *
  19983. * _.random(5, true);
  19984. * // => a floating-point number between 0 and 5
  19985. *
  19986. * _.random(1.2, 5.2);
  19987. * // => a floating-point number between 1.2 and 5.2
  19988. */
  19989. function random(lower, upper, floating) {
  19990. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  19991. upper = floating = undefined;
  19992. }
  19993. if (floating === undefined) {
  19994. if (typeof upper == 'boolean') {
  19995. floating = upper;
  19996. upper = undefined;
  19997. }
  19998. else if (typeof lower == 'boolean') {
  19999. floating = lower;
  20000. lower = undefined;
  20001. }
  20002. }
  20003. if (lower === undefined && upper === undefined) {
  20004. lower = 0;
  20005. upper = 1;
  20006. }
  20007. else {
  20008. lower = toFinite(lower);
  20009. if (upper === undefined) {
  20010. upper = lower;
  20011. lower = 0;
  20012. } else {
  20013. upper = toFinite(upper);
  20014. }
  20015. }
  20016. if (lower > upper) {
  20017. var temp = lower;
  20018. lower = upper;
  20019. upper = temp;
  20020. }
  20021. if (floating || lower % 1 || upper % 1) {
  20022. var rand = nativeRandom();
  20023. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  20024. }
  20025. return baseRandom(lower, upper);
  20026. }
  20027. /*------------------------------------------------------------------------*/
  20028. /**
  20029. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  20030. *
  20031. * @static
  20032. * @memberOf _
  20033. * @since 3.0.0
  20034. * @category String
  20035. * @param {string} [string=''] The string to convert.
  20036. * @returns {string} Returns the camel cased string.
  20037. * @example
  20038. *
  20039. * _.camelCase('Foo Bar');
  20040. * // => 'fooBar'
  20041. *
  20042. * _.camelCase('--foo-bar--');
  20043. * // => 'fooBar'
  20044. *
  20045. * _.camelCase('__FOO_BAR__');
  20046. * // => 'fooBar'
  20047. */
  20048. var camelCase = createCompounder(function(result, word, index) {
  20049. word = word.toLowerCase();
  20050. return result + (index ? capitalize(word) : word);
  20051. });
  20052. /**
  20053. * Converts the first character of `string` to upper case and the remaining
  20054. * to lower case.
  20055. *
  20056. * @static
  20057. * @memberOf _
  20058. * @since 3.0.0
  20059. * @category String
  20060. * @param {string} [string=''] The string to capitalize.
  20061. * @returns {string} Returns the capitalized string.
  20062. * @example
  20063. *
  20064. * _.capitalize('FRED');
  20065. * // => 'Fred'
  20066. */
  20067. function capitalize(string) {
  20068. return upperFirst(toString(string).toLowerCase());
  20069. }
  20070. /**
  20071. * Deburrs `string` by converting
  20072. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  20073. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  20074. * letters to basic Latin letters and removing
  20075. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  20076. *
  20077. * @static
  20078. * @memberOf _
  20079. * @since 3.0.0
  20080. * @category String
  20081. * @param {string} [string=''] The string to deburr.
  20082. * @returns {string} Returns the deburred string.
  20083. * @example
  20084. *
  20085. * _.deburr('déjà vu');
  20086. * // => 'deja vu'
  20087. */
  20088. function deburr(string) {
  20089. string = toString(string);
  20090. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  20091. }
  20092. /**
  20093. * Checks if `string` ends with the given target string.
  20094. *
  20095. * @static
  20096. * @memberOf _
  20097. * @since 3.0.0
  20098. * @category String
  20099. * @param {string} [string=''] The string to inspect.
  20100. * @param {string} [target] The string to search for.
  20101. * @param {number} [position=string.length] The position to search up to.
  20102. * @returns {boolean} Returns `true` if `string` ends with `target`,
  20103. * else `false`.
  20104. * @example
  20105. *
  20106. * _.endsWith('abc', 'c');
  20107. * // => true
  20108. *
  20109. * _.endsWith('abc', 'b');
  20110. * // => false
  20111. *
  20112. * _.endsWith('abc', 'b', 2);
  20113. * // => true
  20114. */
  20115. function endsWith(string, target, position) {
  20116. string = toString(string);
  20117. target = baseToString(target);
  20118. var length = string.length;
  20119. position = position === undefined
  20120. ? length
  20121. : baseClamp(toInteger(position), 0, length);
  20122. var end = position;
  20123. position -= target.length;
  20124. return position >= 0 && string.slice(position, end) == target;
  20125. }
  20126. /**
  20127. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  20128. * corresponding HTML entities.
  20129. *
  20130. * **Note:** No other characters are escaped. To escape additional
  20131. * characters use a third-party library like [_he_](https://mths.be/he).
  20132. *
  20133. * Though the ">" character is escaped for symmetry, characters like
  20134. * ">" and "/" don't need escaping in HTML and have no special meaning
  20135. * unless they're part of a tag or unquoted attribute value. See
  20136. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  20137. * (under "semi-related fun fact") for more details.
  20138. *
  20139. * When working with HTML you should always
  20140. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  20141. * XSS vectors.
  20142. *
  20143. * @static
  20144. * @since 0.1.0
  20145. * @memberOf _
  20146. * @category String
  20147. * @param {string} [string=''] The string to escape.
  20148. * @returns {string} Returns the escaped string.
  20149. * @example
  20150. *
  20151. * _.escape('fred, barney, & pebbles');
  20152. * // => 'fred, barney, &amp; pebbles'
  20153. */
  20154. function escape(string) {
  20155. string = toString(string);
  20156. return (string && reHasUnescapedHtml.test(string))
  20157. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  20158. : string;
  20159. }
  20160. /**
  20161. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  20162. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  20163. *
  20164. * @static
  20165. * @memberOf _
  20166. * @since 3.0.0
  20167. * @category String
  20168. * @param {string} [string=''] The string to escape.
  20169. * @returns {string} Returns the escaped string.
  20170. * @example
  20171. *
  20172. * _.escapeRegExp('[lodash](https://lodash.com/)');
  20173. * // => '\[lodash\]\(https://lodash\.com/\)'
  20174. */
  20175. function escapeRegExp(string) {
  20176. string = toString(string);
  20177. return (string && reHasRegExpChar.test(string))
  20178. ? string.replace(reRegExpChar, '\\$&')
  20179. : string;
  20180. }
  20181. /**
  20182. * Converts `string` to
  20183. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  20184. *
  20185. * @static
  20186. * @memberOf _
  20187. * @since 3.0.0
  20188. * @category String
  20189. * @param {string} [string=''] The string to convert.
  20190. * @returns {string} Returns the kebab cased string.
  20191. * @example
  20192. *
  20193. * _.kebabCase('Foo Bar');
  20194. * // => 'foo-bar'
  20195. *
  20196. * _.kebabCase('fooBar');
  20197. * // => 'foo-bar'
  20198. *
  20199. * _.kebabCase('__FOO_BAR__');
  20200. * // => 'foo-bar'
  20201. */
  20202. var kebabCase = createCompounder(function(result, word, index) {
  20203. return result + (index ? '-' : '') + word.toLowerCase();
  20204. });
  20205. /**
  20206. * Converts `string`, as space separated words, to lower case.
  20207. *
  20208. * @static
  20209. * @memberOf _
  20210. * @since 4.0.0
  20211. * @category String
  20212. * @param {string} [string=''] The string to convert.
  20213. * @returns {string} Returns the lower cased string.
  20214. * @example
  20215. *
  20216. * _.lowerCase('--Foo-Bar--');
  20217. * // => 'foo bar'
  20218. *
  20219. * _.lowerCase('fooBar');
  20220. * // => 'foo bar'
  20221. *
  20222. * _.lowerCase('__FOO_BAR__');
  20223. * // => 'foo bar'
  20224. */
  20225. var lowerCase = createCompounder(function(result, word, index) {
  20226. return result + (index ? ' ' : '') + word.toLowerCase();
  20227. });
  20228. /**
  20229. * Converts the first character of `string` to lower case.
  20230. *
  20231. * @static
  20232. * @memberOf _
  20233. * @since 4.0.0
  20234. * @category String
  20235. * @param {string} [string=''] The string to convert.
  20236. * @returns {string} Returns the converted string.
  20237. * @example
  20238. *
  20239. * _.lowerFirst('Fred');
  20240. * // => 'fred'
  20241. *
  20242. * _.lowerFirst('FRED');
  20243. * // => 'fRED'
  20244. */
  20245. var lowerFirst = createCaseFirst('toLowerCase');
  20246. /**
  20247. * Pads `string` on the left and right sides if it's shorter than `length`.
  20248. * Padding characters are truncated if they can't be evenly divided by `length`.
  20249. *
  20250. * @static
  20251. * @memberOf _
  20252. * @since 3.0.0
  20253. * @category String
  20254. * @param {string} [string=''] The string to pad.
  20255. * @param {number} [length=0] The padding length.
  20256. * @param {string} [chars=' '] The string used as padding.
  20257. * @returns {string} Returns the padded string.
  20258. * @example
  20259. *
  20260. * _.pad('abc', 8);
  20261. * // => ' abc '
  20262. *
  20263. * _.pad('abc', 8, '_-');
  20264. * // => '_-abc_-_'
  20265. *
  20266. * _.pad('abc', 3);
  20267. * // => 'abc'
  20268. */
  20269. function pad(string, length, chars) {
  20270. string = toString(string);
  20271. length = toInteger(length);
  20272. var strLength = length ? stringSize(string) : 0;
  20273. if (!length || strLength >= length) {
  20274. return string;
  20275. }
  20276. var mid = (length - strLength) / 2;
  20277. return (
  20278. createPadding(nativeFloor(mid), chars) +
  20279. string +
  20280. createPadding(nativeCeil(mid), chars)
  20281. );
  20282. }
  20283. /**
  20284. * Pads `string` on the right side if it's shorter than `length`. Padding
  20285. * characters are truncated if they exceed `length`.
  20286. *
  20287. * @static
  20288. * @memberOf _
  20289. * @since 4.0.0
  20290. * @category String
  20291. * @param {string} [string=''] The string to pad.
  20292. * @param {number} [length=0] The padding length.
  20293. * @param {string} [chars=' '] The string used as padding.
  20294. * @returns {string} Returns the padded string.
  20295. * @example
  20296. *
  20297. * _.padEnd('abc', 6);
  20298. * // => 'abc '
  20299. *
  20300. * _.padEnd('abc', 6, '_-');
  20301. * // => 'abc_-_'
  20302. *
  20303. * _.padEnd('abc', 3);
  20304. * // => 'abc'
  20305. */
  20306. function padEnd(string, length, chars) {
  20307. string = toString(string);
  20308. length = toInteger(length);
  20309. var strLength = length ? stringSize(string) : 0;
  20310. return (length && strLength < length)
  20311. ? (string + createPadding(length - strLength, chars))
  20312. : string;
  20313. }
  20314. /**
  20315. * Pads `string` on the left side if it's shorter than `length`. Padding
  20316. * characters are truncated if they exceed `length`.
  20317. *
  20318. * @static
  20319. * @memberOf _
  20320. * @since 4.0.0
  20321. * @category String
  20322. * @param {string} [string=''] The string to pad.
  20323. * @param {number} [length=0] The padding length.
  20324. * @param {string} [chars=' '] The string used as padding.
  20325. * @returns {string} Returns the padded string.
  20326. * @example
  20327. *
  20328. * _.padStart('abc', 6);
  20329. * // => ' abc'
  20330. *
  20331. * _.padStart('abc', 6, '_-');
  20332. * // => '_-_abc'
  20333. *
  20334. * _.padStart('abc', 3);
  20335. * // => 'abc'
  20336. */
  20337. function padStart(string, length, chars) {
  20338. string = toString(string);
  20339. length = toInteger(length);
  20340. var strLength = length ? stringSize(string) : 0;
  20341. return (length && strLength < length)
  20342. ? (createPadding(length - strLength, chars) + string)
  20343. : string;
  20344. }
  20345. /**
  20346. * Converts `string` to an integer of the specified radix. If `radix` is
  20347. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  20348. * hexadecimal, in which case a `radix` of `16` is used.
  20349. *
  20350. * **Note:** This method aligns with the
  20351. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  20352. *
  20353. * @static
  20354. * @memberOf _
  20355. * @since 1.1.0
  20356. * @category String
  20357. * @param {string} string The string to convert.
  20358. * @param {number} [radix=10] The radix to interpret `value` by.
  20359. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  20360. * @returns {number} Returns the converted integer.
  20361. * @example
  20362. *
  20363. * _.parseInt('08');
  20364. * // => 8
  20365. *
  20366. * _.map(['6', '08', '10'], _.parseInt);
  20367. * // => [6, 8, 10]
  20368. */
  20369. function parseInt(string, radix, guard) {
  20370. if (guard || radix == null) {
  20371. radix = 0;
  20372. } else if (radix) {
  20373. radix = +radix;
  20374. }
  20375. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  20376. }
  20377. /**
  20378. * Repeats the given string `n` times.
  20379. *
  20380. * @static
  20381. * @memberOf _
  20382. * @since 3.0.0
  20383. * @category String
  20384. * @param {string} [string=''] The string to repeat.
  20385. * @param {number} [n=1] The number of times to repeat the string.
  20386. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  20387. * @returns {string} Returns the repeated string.
  20388. * @example
  20389. *
  20390. * _.repeat('*', 3);
  20391. * // => '***'
  20392. *
  20393. * _.repeat('abc', 2);
  20394. * // => 'abcabc'
  20395. *
  20396. * _.repeat('abc', 0);
  20397. * // => ''
  20398. */
  20399. function repeat(string, n, guard) {
  20400. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  20401. n = 1;
  20402. } else {
  20403. n = toInteger(n);
  20404. }
  20405. return baseRepeat(toString(string), n);
  20406. }
  20407. /**
  20408. * Replaces matches for `pattern` in `string` with `replacement`.
  20409. *
  20410. * **Note:** This method is based on
  20411. * [`String#replace`](https://mdn.io/String/replace).
  20412. *
  20413. * @static
  20414. * @memberOf _
  20415. * @since 4.0.0
  20416. * @category String
  20417. * @param {string} [string=''] The string to modify.
  20418. * @param {RegExp|string} pattern The pattern to replace.
  20419. * @param {Function|string} replacement The match replacement.
  20420. * @returns {string} Returns the modified string.
  20421. * @example
  20422. *
  20423. * _.replace('Hi Fred', 'Fred', 'Barney');
  20424. * // => 'Hi Barney'
  20425. */
  20426. function replace() {
  20427. var args = arguments,
  20428. string = toString(args[0]);
  20429. return args.length < 3 ? string : string.replace(args[1], args[2]);
  20430. }
  20431. /**
  20432. * Converts `string` to
  20433. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  20434. *
  20435. * @static
  20436. * @memberOf _
  20437. * @since 3.0.0
  20438. * @category String
  20439. * @param {string} [string=''] The string to convert.
  20440. * @returns {string} Returns the snake cased string.
  20441. * @example
  20442. *
  20443. * _.snakeCase('Foo Bar');
  20444. * // => 'foo_bar'
  20445. *
  20446. * _.snakeCase('fooBar');
  20447. * // => 'foo_bar'
  20448. *
  20449. * _.snakeCase('--FOO-BAR--');
  20450. * // => 'foo_bar'
  20451. */
  20452. var snakeCase = createCompounder(function(result, word, index) {
  20453. return result + (index ? '_' : '') + word.toLowerCase();
  20454. });
  20455. /**
  20456. * Splits `string` by `separator`.
  20457. *
  20458. * **Note:** This method is based on
  20459. * [`String#split`](https://mdn.io/String/split).
  20460. *
  20461. * @static
  20462. * @memberOf _
  20463. * @since 4.0.0
  20464. * @category String
  20465. * @param {string} [string=''] The string to split.
  20466. * @param {RegExp|string} separator The separator pattern to split by.
  20467. * @param {number} [limit] The length to truncate results to.
  20468. * @returns {Array} Returns the string segments.
  20469. * @example
  20470. *
  20471. * _.split('a-b-c', '-', 2);
  20472. * // => ['a', 'b']
  20473. */
  20474. function split(string, separator, limit) {
  20475. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  20476. separator = limit = undefined;
  20477. }
  20478. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  20479. if (!limit) {
  20480. return [];
  20481. }
  20482. string = toString(string);
  20483. if (string && (
  20484. typeof separator == 'string' ||
  20485. (separator != null && !isRegExp(separator))
  20486. )) {
  20487. separator = baseToString(separator);
  20488. if (!separator && hasUnicode(string)) {
  20489. return castSlice(stringToArray(string), 0, limit);
  20490. }
  20491. }
  20492. return string.split(separator, limit);
  20493. }
  20494. /**
  20495. * Converts `string` to
  20496. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  20497. *
  20498. * @static
  20499. * @memberOf _
  20500. * @since 3.1.0
  20501. * @category String
  20502. * @param {string} [string=''] The string to convert.
  20503. * @returns {string} Returns the start cased string.
  20504. * @example
  20505. *
  20506. * _.startCase('--foo-bar--');
  20507. * // => 'Foo Bar'
  20508. *
  20509. * _.startCase('fooBar');
  20510. * // => 'Foo Bar'
  20511. *
  20512. * _.startCase('__FOO_BAR__');
  20513. * // => 'FOO BAR'
  20514. */
  20515. var startCase = createCompounder(function(result, word, index) {
  20516. return result + (index ? ' ' : '') + upperFirst(word);
  20517. });
  20518. /**
  20519. * Checks if `string` starts with the given target string.
  20520. *
  20521. * @static
  20522. * @memberOf _
  20523. * @since 3.0.0
  20524. * @category String
  20525. * @param {string} [string=''] The string to inspect.
  20526. * @param {string} [target] The string to search for.
  20527. * @param {number} [position=0] The position to search from.
  20528. * @returns {boolean} Returns `true` if `string` starts with `target`,
  20529. * else `false`.
  20530. * @example
  20531. *
  20532. * _.startsWith('abc', 'a');
  20533. * // => true
  20534. *
  20535. * _.startsWith('abc', 'b');
  20536. * // => false
  20537. *
  20538. * _.startsWith('abc', 'b', 1);
  20539. * // => true
  20540. */
  20541. function startsWith(string, target, position) {
  20542. string = toString(string);
  20543. position = position == null
  20544. ? 0
  20545. : baseClamp(toInteger(position), 0, string.length);
  20546. target = baseToString(target);
  20547. return string.slice(position, position + target.length) == target;
  20548. }
  20549. /**
  20550. * Creates a compiled template function that can interpolate data properties
  20551. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  20552. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  20553. * properties may be accessed as free variables in the template. If a setting
  20554. * object is given, it takes precedence over `_.templateSettings` values.
  20555. *
  20556. * **Note:** In the development build `_.template` utilizes
  20557. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  20558. * for easier debugging.
  20559. *
  20560. * For more information on precompiling templates see
  20561. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  20562. *
  20563. * For more information on Chrome extension sandboxes see
  20564. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  20565. *
  20566. * @static
  20567. * @since 0.1.0
  20568. * @memberOf _
  20569. * @category String
  20570. * @param {string} [string=''] The template string.
  20571. * @param {Object} [options={}] The options object.
  20572. * @param {RegExp} [options.escape=_.templateSettings.escape]
  20573. * The HTML "escape" delimiter.
  20574. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  20575. * The "evaluate" delimiter.
  20576. * @param {Object} [options.imports=_.templateSettings.imports]
  20577. * An object to import into the template as free variables.
  20578. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  20579. * The "interpolate" delimiter.
  20580. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  20581. * The sourceURL of the compiled template.
  20582. * @param {string} [options.variable='obj']
  20583. * The data object variable name.
  20584. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  20585. * @returns {Function} Returns the compiled template function.
  20586. * @example
  20587. *
  20588. * // Use the "interpolate" delimiter to create a compiled template.
  20589. * var compiled = _.template('hello <%= user %>!');
  20590. * compiled({ 'user': 'fred' });
  20591. * // => 'hello fred!'
  20592. *
  20593. * // Use the HTML "escape" delimiter to escape data property values.
  20594. * var compiled = _.template('<b><%- value %></b>');
  20595. * compiled({ 'value': '<script>' });
  20596. * // => '<b>&lt;script&gt;</b>'
  20597. *
  20598. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  20599. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  20600. * compiled({ 'users': ['fred', 'barney'] });
  20601. * // => '<li>fred</li><li>barney</li>'
  20602. *
  20603. * // Use the internal `print` function in "evaluate" delimiters.
  20604. * var compiled = _.template('<% print("hello " + user); %>!');
  20605. * compiled({ 'user': 'barney' });
  20606. * // => 'hello barney!'
  20607. *
  20608. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  20609. * // Disable support by replacing the "interpolate" delimiter.
  20610. * var compiled = _.template('hello ${ user }!');
  20611. * compiled({ 'user': 'pebbles' });
  20612. * // => 'hello pebbles!'
  20613. *
  20614. * // Use backslashes to treat delimiters as plain text.
  20615. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  20616. * compiled({ 'value': 'ignored' });
  20617. * // => '<%- value %>'
  20618. *
  20619. * // Use the `imports` option to import `jQuery` as `jq`.
  20620. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  20621. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  20622. * compiled({ 'users': ['fred', 'barney'] });
  20623. * // => '<li>fred</li><li>barney</li>'
  20624. *
  20625. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  20626. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  20627. * compiled(data);
  20628. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  20629. *
  20630. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  20631. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  20632. * compiled.source;
  20633. * // => function(data) {
  20634. * // var __t, __p = '';
  20635. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  20636. * // return __p;
  20637. * // }
  20638. *
  20639. * // Use custom template delimiters.
  20640. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  20641. * var compiled = _.template('hello {{ user }}!');
  20642. * compiled({ 'user': 'mustache' });
  20643. * // => 'hello mustache!'
  20644. *
  20645. * // Use the `source` property to inline compiled templates for meaningful
  20646. * // line numbers in error messages and stack traces.
  20647. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  20648. * var JST = {\
  20649. * "main": ' + _.template(mainText).source + '\
  20650. * };\
  20651. * ');
  20652. */
  20653. function template(string, options, guard) {
  20654. // Based on John Resig's `tmpl` implementation
  20655. // (http://ejohn.org/blog/javascript-micro-templating/)
  20656. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  20657. var settings = lodash.templateSettings;
  20658. if (guard && isIterateeCall(string, options, guard)) {
  20659. options = undefined;
  20660. }
  20661. string = toString(string);
  20662. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  20663. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  20664. importsKeys = keys(imports),
  20665. importsValues = baseValues(imports, importsKeys);
  20666. var isEscaping,
  20667. isEvaluating,
  20668. index = 0,
  20669. interpolate = options.interpolate || reNoMatch,
  20670. source = "__p += '";
  20671. // Compile the regexp to match each delimiter.
  20672. var reDelimiters = RegExp(
  20673. (options.escape || reNoMatch).source + '|' +
  20674. interpolate.source + '|' +
  20675. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  20676. (options.evaluate || reNoMatch).source + '|$'
  20677. , 'g');
  20678. // Use a sourceURL for easier debugging.
  20679. var sourceURL = '//# sourceURL=' +
  20680. ('sourceURL' in options
  20681. ? options.sourceURL
  20682. : ('lodash.templateSources[' + (++templateCounter) + ']')
  20683. ) + '\n';
  20684. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  20685. interpolateValue || (interpolateValue = esTemplateValue);
  20686. // Escape characters that can't be included in string literals.
  20687. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  20688. // Replace delimiters with snippets.
  20689. if (escapeValue) {
  20690. isEscaping = true;
  20691. source += "' +\n__e(" + escapeValue + ") +\n'";
  20692. }
  20693. if (evaluateValue) {
  20694. isEvaluating = true;
  20695. source += "';\n" + evaluateValue + ";\n__p += '";
  20696. }
  20697. if (interpolateValue) {
  20698. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  20699. }
  20700. index = offset + match.length;
  20701. // The JS engine embedded in Adobe products needs `match` returned in
  20702. // order to produce the correct `offset` value.
  20703. return match;
  20704. });
  20705. source += "';\n";
  20706. // If `variable` is not specified wrap a with-statement around the generated
  20707. // code to add the data object to the top of the scope chain.
  20708. var variable = options.variable;
  20709. if (!variable) {
  20710. source = 'with (obj) {\n' + source + '\n}\n';
  20711. }
  20712. // Cleanup code by stripping empty strings.
  20713. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  20714. .replace(reEmptyStringMiddle, '$1')
  20715. .replace(reEmptyStringTrailing, '$1;');
  20716. // Frame code as the function body.
  20717. source = 'function(' + (variable || 'obj') + ') {\n' +
  20718. (variable
  20719. ? ''
  20720. : 'obj || (obj = {});\n'
  20721. ) +
  20722. "var __t, __p = ''" +
  20723. (isEscaping
  20724. ? ', __e = _.escape'
  20725. : ''
  20726. ) +
  20727. (isEvaluating
  20728. ? ', __j = Array.prototype.join;\n' +
  20729. "function print() { __p += __j.call(arguments, '') }\n"
  20730. : ';\n'
  20731. ) +
  20732. source +
  20733. 'return __p\n}';
  20734. var result = attempt(function() {
  20735. return Function(importsKeys, sourceURL + 'return ' + source)
  20736. .apply(undefined, importsValues);
  20737. });
  20738. // Provide the compiled function's source by its `toString` method or
  20739. // the `source` property as a convenience for inlining compiled templates.
  20740. result.source = source;
  20741. if (isError(result)) {
  20742. throw result;
  20743. }
  20744. return result;
  20745. }
  20746. /**
  20747. * Converts `string`, as a whole, to lower case just like
  20748. * [String#toLowerCase](https://mdn.io/toLowerCase).
  20749. *
  20750. * @static
  20751. * @memberOf _
  20752. * @since 4.0.0
  20753. * @category String
  20754. * @param {string} [string=''] The string to convert.
  20755. * @returns {string} Returns the lower cased string.
  20756. * @example
  20757. *
  20758. * _.toLower('--Foo-Bar--');
  20759. * // => '--foo-bar--'
  20760. *
  20761. * _.toLower('fooBar');
  20762. * // => 'foobar'
  20763. *
  20764. * _.toLower('__FOO_BAR__');
  20765. * // => '__foo_bar__'
  20766. */
  20767. function toLower(value) {
  20768. return toString(value).toLowerCase();
  20769. }
  20770. /**
  20771. * Converts `string`, as a whole, to upper case just like
  20772. * [String#toUpperCase](https://mdn.io/toUpperCase).
  20773. *
  20774. * @static
  20775. * @memberOf _
  20776. * @since 4.0.0
  20777. * @category String
  20778. * @param {string} [string=''] The string to convert.
  20779. * @returns {string} Returns the upper cased string.
  20780. * @example
  20781. *
  20782. * _.toUpper('--foo-bar--');
  20783. * // => '--FOO-BAR--'
  20784. *
  20785. * _.toUpper('fooBar');
  20786. * // => 'FOOBAR'
  20787. *
  20788. * _.toUpper('__foo_bar__');
  20789. * // => '__FOO_BAR__'
  20790. */
  20791. function toUpper(value) {
  20792. return toString(value).toUpperCase();
  20793. }
  20794. /**
  20795. * Removes leading and trailing whitespace or specified characters from `string`.
  20796. *
  20797. * @static
  20798. * @memberOf _
  20799. * @since 3.0.0
  20800. * @category String
  20801. * @param {string} [string=''] The string to trim.
  20802. * @param {string} [chars=whitespace] The characters to trim.
  20803. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  20804. * @returns {string} Returns the trimmed string.
  20805. * @example
  20806. *
  20807. * _.trim(' abc ');
  20808. * // => 'abc'
  20809. *
  20810. * _.trim('-_-abc-_-', '_-');
  20811. * // => 'abc'
  20812. *
  20813. * _.map([' foo ', ' bar '], _.trim);
  20814. * // => ['foo', 'bar']
  20815. */
  20816. function trim(string, chars, guard) {
  20817. string = toString(string);
  20818. if (string && (guard || chars === undefined)) {
  20819. return string.replace(reTrim, '');
  20820. }
  20821. if (!string || !(chars = baseToString(chars))) {
  20822. return string;
  20823. }
  20824. var strSymbols = stringToArray(string),
  20825. chrSymbols = stringToArray(chars),
  20826. start = charsStartIndex(strSymbols, chrSymbols),
  20827. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  20828. return castSlice(strSymbols, start, end).join('');
  20829. }
  20830. /**
  20831. * Removes trailing whitespace or specified characters from `string`.
  20832. *
  20833. * @static
  20834. * @memberOf _
  20835. * @since 4.0.0
  20836. * @category String
  20837. * @param {string} [string=''] The string to trim.
  20838. * @param {string} [chars=whitespace] The characters to trim.
  20839. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  20840. * @returns {string} Returns the trimmed string.
  20841. * @example
  20842. *
  20843. * _.trimEnd(' abc ');
  20844. * // => ' abc'
  20845. *
  20846. * _.trimEnd('-_-abc-_-', '_-');
  20847. * // => '-_-abc'
  20848. */
  20849. function trimEnd(string, chars, guard) {
  20850. string = toString(string);
  20851. if (string && (guard || chars === undefined)) {
  20852. return string.replace(reTrimEnd, '');
  20853. }
  20854. if (!string || !(chars = baseToString(chars))) {
  20855. return string;
  20856. }
  20857. var strSymbols = stringToArray(string),
  20858. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  20859. return castSlice(strSymbols, 0, end).join('');
  20860. }
  20861. /**
  20862. * Removes leading whitespace or specified characters from `string`.
  20863. *
  20864. * @static
  20865. * @memberOf _
  20866. * @since 4.0.0
  20867. * @category String
  20868. * @param {string} [string=''] The string to trim.
  20869. * @param {string} [chars=whitespace] The characters to trim.
  20870. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  20871. * @returns {string} Returns the trimmed string.
  20872. * @example
  20873. *
  20874. * _.trimStart(' abc ');
  20875. * // => 'abc '
  20876. *
  20877. * _.trimStart('-_-abc-_-', '_-');
  20878. * // => 'abc-_-'
  20879. */
  20880. function trimStart(string, chars, guard) {
  20881. string = toString(string);
  20882. if (string && (guard || chars === undefined)) {
  20883. return string.replace(reTrimStart, '');
  20884. }
  20885. if (!string || !(chars = baseToString(chars))) {
  20886. return string;
  20887. }
  20888. var strSymbols = stringToArray(string),
  20889. start = charsStartIndex(strSymbols, stringToArray(chars));
  20890. return castSlice(strSymbols, start).join('');
  20891. }
  20892. /**
  20893. * Truncates `string` if it's longer than the given maximum string length.
  20894. * The last characters of the truncated string are replaced with the omission
  20895. * string which defaults to "...".
  20896. *
  20897. * @static
  20898. * @memberOf _
  20899. * @since 4.0.0
  20900. * @category String
  20901. * @param {string} [string=''] The string to truncate.
  20902. * @param {Object} [options={}] The options object.
  20903. * @param {number} [options.length=30] The maximum string length.
  20904. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  20905. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  20906. * @returns {string} Returns the truncated string.
  20907. * @example
  20908. *
  20909. * _.truncate('hi-diddly-ho there, neighborino');
  20910. * // => 'hi-diddly-ho there, neighbo...'
  20911. *
  20912. * _.truncate('hi-diddly-ho there, neighborino', {
  20913. * 'length': 24,
  20914. * 'separator': ' '
  20915. * });
  20916. * // => 'hi-diddly-ho there,...'
  20917. *
  20918. * _.truncate('hi-diddly-ho there, neighborino', {
  20919. * 'length': 24,
  20920. * 'separator': /,? +/
  20921. * });
  20922. * // => 'hi-diddly-ho there...'
  20923. *
  20924. * _.truncate('hi-diddly-ho there, neighborino', {
  20925. * 'omission': ' [...]'
  20926. * });
  20927. * // => 'hi-diddly-ho there, neig [...]'
  20928. */
  20929. function truncate(string, options) {
  20930. var length = DEFAULT_TRUNC_LENGTH,
  20931. omission = DEFAULT_TRUNC_OMISSION;
  20932. if (isObject(options)) {
  20933. var separator = 'separator' in options ? options.separator : separator;
  20934. length = 'length' in options ? toInteger(options.length) : length;
  20935. omission = 'omission' in options ? baseToString(options.omission) : omission;
  20936. }
  20937. string = toString(string);
  20938. var strLength = string.length;
  20939. if (hasUnicode(string)) {
  20940. var strSymbols = stringToArray(string);
  20941. strLength = strSymbols.length;
  20942. }
  20943. if (length >= strLength) {
  20944. return string;
  20945. }
  20946. var end = length - stringSize(omission);
  20947. if (end < 1) {
  20948. return omission;
  20949. }
  20950. var result = strSymbols
  20951. ? castSlice(strSymbols, 0, end).join('')
  20952. : string.slice(0, end);
  20953. if (separator === undefined) {
  20954. return result + omission;
  20955. }
  20956. if (strSymbols) {
  20957. end += (result.length - end);
  20958. }
  20959. if (isRegExp(separator)) {
  20960. if (string.slice(end).search(separator)) {
  20961. var match,
  20962. substring = result;
  20963. if (!separator.global) {
  20964. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  20965. }
  20966. separator.lastIndex = 0;
  20967. while ((match = separator.exec(substring))) {
  20968. var newEnd = match.index;
  20969. }
  20970. result = result.slice(0, newEnd === undefined ? end : newEnd);
  20971. }
  20972. } else if (string.indexOf(baseToString(separator), end) != end) {
  20973. var index = result.lastIndexOf(separator);
  20974. if (index > -1) {
  20975. result = result.slice(0, index);
  20976. }
  20977. }
  20978. return result + omission;
  20979. }
  20980. /**
  20981. * The inverse of `_.escape`; this method converts the HTML entities
  20982. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  20983. * their corresponding characters.
  20984. *
  20985. * **Note:** No other HTML entities are unescaped. To unescape additional
  20986. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  20987. *
  20988. * @static
  20989. * @memberOf _
  20990. * @since 0.6.0
  20991. * @category String
  20992. * @param {string} [string=''] The string to unescape.
  20993. * @returns {string} Returns the unescaped string.
  20994. * @example
  20995. *
  20996. * _.unescape('fred, barney, &amp; pebbles');
  20997. * // => 'fred, barney, & pebbles'
  20998. */
  20999. function unescape(string) {
  21000. string = toString(string);
  21001. return (string && reHasEscapedHtml.test(string))
  21002. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  21003. : string;
  21004. }
  21005. /**
  21006. * Converts `string`, as space separated words, to upper case.
  21007. *
  21008. * @static
  21009. * @memberOf _
  21010. * @since 4.0.0
  21011. * @category String
  21012. * @param {string} [string=''] The string to convert.
  21013. * @returns {string} Returns the upper cased string.
  21014. * @example
  21015. *
  21016. * _.upperCase('--foo-bar');
  21017. * // => 'FOO BAR'
  21018. *
  21019. * _.upperCase('fooBar');
  21020. * // => 'FOO BAR'
  21021. *
  21022. * _.upperCase('__foo_bar__');
  21023. * // => 'FOO BAR'
  21024. */
  21025. var upperCase = createCompounder(function(result, word, index) {
  21026. return result + (index ? ' ' : '') + word.toUpperCase();
  21027. });
  21028. /**
  21029. * Converts the first character of `string` to upper case.
  21030. *
  21031. * @static
  21032. * @memberOf _
  21033. * @since 4.0.0
  21034. * @category String
  21035. * @param {string} [string=''] The string to convert.
  21036. * @returns {string} Returns the converted string.
  21037. * @example
  21038. *
  21039. * _.upperFirst('fred');
  21040. * // => 'Fred'
  21041. *
  21042. * _.upperFirst('FRED');
  21043. * // => 'FRED'
  21044. */
  21045. var upperFirst = createCaseFirst('toUpperCase');
  21046. /**
  21047. * Splits `string` into an array of its words.
  21048. *
  21049. * @static
  21050. * @memberOf _
  21051. * @since 3.0.0
  21052. * @category String
  21053. * @param {string} [string=''] The string to inspect.
  21054. * @param {RegExp|string} [pattern] The pattern to match words.
  21055. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  21056. * @returns {Array} Returns the words of `string`.
  21057. * @example
  21058. *
  21059. * _.words('fred, barney, & pebbles');
  21060. * // => ['fred', 'barney', 'pebbles']
  21061. *
  21062. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  21063. * // => ['fred', 'barney', '&', 'pebbles']
  21064. */
  21065. function words(string, pattern, guard) {
  21066. string = toString(string);
  21067. pattern = guard ? undefined : pattern;
  21068. if (pattern === undefined) {
  21069. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  21070. }
  21071. return string.match(pattern) || [];
  21072. }
  21073. /*------------------------------------------------------------------------*/
  21074. /**
  21075. * Attempts to invoke `func`, returning either the result or the caught error
  21076. * object. Any additional arguments are provided to `func` when it's invoked.
  21077. *
  21078. * @static
  21079. * @memberOf _
  21080. * @since 3.0.0
  21081. * @category Util
  21082. * @param {Function} func The function to attempt.
  21083. * @param {...*} [args] The arguments to invoke `func` with.
  21084. * @returns {*} Returns the `func` result or error object.
  21085. * @example
  21086. *
  21087. * // Avoid throwing errors for invalid selectors.
  21088. * var elements = _.attempt(function(selector) {
  21089. * return document.querySelectorAll(selector);
  21090. * }, '>_>');
  21091. *
  21092. * if (_.isError(elements)) {
  21093. * elements = [];
  21094. * }
  21095. */
  21096. var attempt = baseRest(function(func, args) {
  21097. try {
  21098. return apply(func, undefined, args);
  21099. } catch (e) {
  21100. return isError(e) ? e : new Error(e);
  21101. }
  21102. });
  21103. /**
  21104. * Binds methods of an object to the object itself, overwriting the existing
  21105. * method.
  21106. *
  21107. * **Note:** This method doesn't set the "length" property of bound functions.
  21108. *
  21109. * @static
  21110. * @since 0.1.0
  21111. * @memberOf _
  21112. * @category Util
  21113. * @param {Object} object The object to bind and assign the bound methods to.
  21114. * @param {...(string|string[])} methodNames The object method names to bind.
  21115. * @returns {Object} Returns `object`.
  21116. * @example
  21117. *
  21118. * var view = {
  21119. * 'label': 'docs',
  21120. * 'click': function() {
  21121. * console.log('clicked ' + this.label);
  21122. * }
  21123. * };
  21124. *
  21125. * _.bindAll(view, ['click']);
  21126. * jQuery(element).on('click', view.click);
  21127. * // => Logs 'clicked docs' when clicked.
  21128. */
  21129. var bindAll = flatRest(function(object, methodNames) {
  21130. arrayEach(methodNames, function(key) {
  21131. key = toKey(key);
  21132. baseAssignValue(object, key, bind(object[key], object));
  21133. });
  21134. return object;
  21135. });
  21136. /**
  21137. * Creates a function that iterates over `pairs` and invokes the corresponding
  21138. * function of the first predicate to return truthy. The predicate-function
  21139. * pairs are invoked with the `this` binding and arguments of the created
  21140. * function.
  21141. *
  21142. * @static
  21143. * @memberOf _
  21144. * @since 4.0.0
  21145. * @category Util
  21146. * @param {Array} pairs The predicate-function pairs.
  21147. * @returns {Function} Returns the new composite function.
  21148. * @example
  21149. *
  21150. * var func = _.cond([
  21151. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  21152. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  21153. * [_.stubTrue, _.constant('no match')]
  21154. * ]);
  21155. *
  21156. * func({ 'a': 1, 'b': 2 });
  21157. * // => 'matches A'
  21158. *
  21159. * func({ 'a': 0, 'b': 1 });
  21160. * // => 'matches B'
  21161. *
  21162. * func({ 'a': '1', 'b': '2' });
  21163. * // => 'no match'
  21164. */
  21165. function cond(pairs) {
  21166. var length = pairs == null ? 0 : pairs.length,
  21167. toIteratee = getIteratee();
  21168. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  21169. if (typeof pair[1] != 'function') {
  21170. throw new TypeError(FUNC_ERROR_TEXT);
  21171. }
  21172. return [toIteratee(pair[0]), pair[1]];
  21173. });
  21174. return baseRest(function(args) {
  21175. var index = -1;
  21176. while (++index < length) {
  21177. var pair = pairs[index];
  21178. if (apply(pair[0], this, args)) {
  21179. return apply(pair[1], this, args);
  21180. }
  21181. }
  21182. });
  21183. }
  21184. /**
  21185. * Creates a function that invokes the predicate properties of `source` with
  21186. * the corresponding property values of a given object, returning `true` if
  21187. * all predicates return truthy, else `false`.
  21188. *
  21189. * **Note:** The created function is equivalent to `_.conformsTo` with
  21190. * `source` partially applied.
  21191. *
  21192. * @static
  21193. * @memberOf _
  21194. * @since 4.0.0
  21195. * @category Util
  21196. * @param {Object} source The object of property predicates to conform to.
  21197. * @returns {Function} Returns the new spec function.
  21198. * @example
  21199. *
  21200. * var objects = [
  21201. * { 'a': 2, 'b': 1 },
  21202. * { 'a': 1, 'b': 2 }
  21203. * ];
  21204. *
  21205. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  21206. * // => [{ 'a': 1, 'b': 2 }]
  21207. */
  21208. function conforms(source) {
  21209. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  21210. }
  21211. /**
  21212. * Creates a function that returns `value`.
  21213. *
  21214. * @static
  21215. * @memberOf _
  21216. * @since 2.4.0
  21217. * @category Util
  21218. * @param {*} value The value to return from the new function.
  21219. * @returns {Function} Returns the new constant function.
  21220. * @example
  21221. *
  21222. * var objects = _.times(2, _.constant({ 'a': 1 }));
  21223. *
  21224. * console.log(objects);
  21225. * // => [{ 'a': 1 }, { 'a': 1 }]
  21226. *
  21227. * console.log(objects[0] === objects[1]);
  21228. * // => true
  21229. */
  21230. function constant(value) {
  21231. return function() {
  21232. return value;
  21233. };
  21234. }
  21235. /**
  21236. * Checks `value` to determine whether a default value should be returned in
  21237. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  21238. * or `undefined`.
  21239. *
  21240. * @static
  21241. * @memberOf _
  21242. * @since 4.14.0
  21243. * @category Util
  21244. * @param {*} value The value to check.
  21245. * @param {*} defaultValue The default value.
  21246. * @returns {*} Returns the resolved value.
  21247. * @example
  21248. *
  21249. * _.defaultTo(1, 10);
  21250. * // => 1
  21251. *
  21252. * _.defaultTo(undefined, 10);
  21253. * // => 10
  21254. */
  21255. function defaultTo(value, defaultValue) {
  21256. return (value == null || value !== value) ? defaultValue : value;
  21257. }
  21258. /**
  21259. * Creates a function that returns the result of invoking the given functions
  21260. * with the `this` binding of the created function, where each successive
  21261. * invocation is supplied the return value of the previous.
  21262. *
  21263. * @static
  21264. * @memberOf _
  21265. * @since 3.0.0
  21266. * @category Util
  21267. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  21268. * @returns {Function} Returns the new composite function.
  21269. * @see _.flowRight
  21270. * @example
  21271. *
  21272. * function square(n) {
  21273. * return n * n;
  21274. * }
  21275. *
  21276. * var addSquare = _.flow([_.add, square]);
  21277. * addSquare(1, 2);
  21278. * // => 9
  21279. */
  21280. var flow = createFlow();
  21281. /**
  21282. * This method is like `_.flow` except that it creates a function that
  21283. * invokes the given functions from right to left.
  21284. *
  21285. * @static
  21286. * @since 3.0.0
  21287. * @memberOf _
  21288. * @category Util
  21289. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  21290. * @returns {Function} Returns the new composite function.
  21291. * @see _.flow
  21292. * @example
  21293. *
  21294. * function square(n) {
  21295. * return n * n;
  21296. * }
  21297. *
  21298. * var addSquare = _.flowRight([square, _.add]);
  21299. * addSquare(1, 2);
  21300. * // => 9
  21301. */
  21302. var flowRight = createFlow(true);
  21303. /**
  21304. * This method returns the first argument it receives.
  21305. *
  21306. * @static
  21307. * @since 0.1.0
  21308. * @memberOf _
  21309. * @category Util
  21310. * @param {*} value Any value.
  21311. * @returns {*} Returns `value`.
  21312. * @example
  21313. *
  21314. * var object = { 'a': 1 };
  21315. *
  21316. * console.log(_.identity(object) === object);
  21317. * // => true
  21318. */
  21319. function identity(value) {
  21320. return value;
  21321. }
  21322. /**
  21323. * Creates a function that invokes `func` with the arguments of the created
  21324. * function. If `func` is a property name, the created function returns the
  21325. * property value for a given element. If `func` is an array or object, the
  21326. * created function returns `true` for elements that contain the equivalent
  21327. * source properties, otherwise it returns `false`.
  21328. *
  21329. * @static
  21330. * @since 4.0.0
  21331. * @memberOf _
  21332. * @category Util
  21333. * @param {*} [func=_.identity] The value to convert to a callback.
  21334. * @returns {Function} Returns the callback.
  21335. * @example
  21336. *
  21337. * var users = [
  21338. * { 'user': 'barney', 'age': 36, 'active': true },
  21339. * { 'user': 'fred', 'age': 40, 'active': false }
  21340. * ];
  21341. *
  21342. * // The `_.matches` iteratee shorthand.
  21343. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  21344. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  21345. *
  21346. * // The `_.matchesProperty` iteratee shorthand.
  21347. * _.filter(users, _.iteratee(['user', 'fred']));
  21348. * // => [{ 'user': 'fred', 'age': 40 }]
  21349. *
  21350. * // The `_.property` iteratee shorthand.
  21351. * _.map(users, _.iteratee('user'));
  21352. * // => ['barney', 'fred']
  21353. *
  21354. * // Create custom iteratee shorthands.
  21355. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  21356. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  21357. * return func.test(string);
  21358. * };
  21359. * });
  21360. *
  21361. * _.filter(['abc', 'def'], /ef/);
  21362. * // => ['def']
  21363. */
  21364. function iteratee(func) {
  21365. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  21366. }
  21367. /**
  21368. * Creates a function that performs a partial deep comparison between a given
  21369. * object and `source`, returning `true` if the given object has equivalent
  21370. * property values, else `false`.
  21371. *
  21372. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  21373. * partially applied.
  21374. *
  21375. * Partial comparisons will match empty array and empty object `source`
  21376. * values against any array or object value, respectively. See `_.isEqual`
  21377. * for a list of supported value comparisons.
  21378. *
  21379. * @static
  21380. * @memberOf _
  21381. * @since 3.0.0
  21382. * @category Util
  21383. * @param {Object} source The object of property values to match.
  21384. * @returns {Function} Returns the new spec function.
  21385. * @example
  21386. *
  21387. * var objects = [
  21388. * { 'a': 1, 'b': 2, 'c': 3 },
  21389. * { 'a': 4, 'b': 5, 'c': 6 }
  21390. * ];
  21391. *
  21392. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  21393. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  21394. */
  21395. function matches(source) {
  21396. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  21397. }
  21398. /**
  21399. * Creates a function that performs a partial deep comparison between the
  21400. * value at `path` of a given object to `srcValue`, returning `true` if the
  21401. * object value is equivalent, else `false`.
  21402. *
  21403. * **Note:** Partial comparisons will match empty array and empty object
  21404. * `srcValue` values against any array or object value, respectively. See
  21405. * `_.isEqual` for a list of supported value comparisons.
  21406. *
  21407. * @static
  21408. * @memberOf _
  21409. * @since 3.2.0
  21410. * @category Util
  21411. * @param {Array|string} path The path of the property to get.
  21412. * @param {*} srcValue The value to match.
  21413. * @returns {Function} Returns the new spec function.
  21414. * @example
  21415. *
  21416. * var objects = [
  21417. * { 'a': 1, 'b': 2, 'c': 3 },
  21418. * { 'a': 4, 'b': 5, 'c': 6 }
  21419. * ];
  21420. *
  21421. * _.find(objects, _.matchesProperty('a', 4));
  21422. * // => { 'a': 4, 'b': 5, 'c': 6 }
  21423. */
  21424. function matchesProperty(path, srcValue) {
  21425. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  21426. }
  21427. /**
  21428. * Creates a function that invokes the method at `path` of a given object.
  21429. * Any additional arguments are provided to the invoked method.
  21430. *
  21431. * @static
  21432. * @memberOf _
  21433. * @since 3.7.0
  21434. * @category Util
  21435. * @param {Array|string} path The path of the method to invoke.
  21436. * @param {...*} [args] The arguments to invoke the method with.
  21437. * @returns {Function} Returns the new invoker function.
  21438. * @example
  21439. *
  21440. * var objects = [
  21441. * { 'a': { 'b': _.constant(2) } },
  21442. * { 'a': { 'b': _.constant(1) } }
  21443. * ];
  21444. *
  21445. * _.map(objects, _.method('a.b'));
  21446. * // => [2, 1]
  21447. *
  21448. * _.map(objects, _.method(['a', 'b']));
  21449. * // => [2, 1]
  21450. */
  21451. var method = baseRest(function(path, args) {
  21452. return function(object) {
  21453. return baseInvoke(object, path, args);
  21454. };
  21455. });
  21456. /**
  21457. * The opposite of `_.method`; this method creates a function that invokes
  21458. * the method at a given path of `object`. Any additional arguments are
  21459. * provided to the invoked method.
  21460. *
  21461. * @static
  21462. * @memberOf _
  21463. * @since 3.7.0
  21464. * @category Util
  21465. * @param {Object} object The object to query.
  21466. * @param {...*} [args] The arguments to invoke the method with.
  21467. * @returns {Function} Returns the new invoker function.
  21468. * @example
  21469. *
  21470. * var array = _.times(3, _.constant),
  21471. * object = { 'a': array, 'b': array, 'c': array };
  21472. *
  21473. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  21474. * // => [2, 0]
  21475. *
  21476. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  21477. * // => [2, 0]
  21478. */
  21479. var methodOf = baseRest(function(object, args) {
  21480. return function(path) {
  21481. return baseInvoke(object, path, args);
  21482. };
  21483. });
  21484. /**
  21485. * Adds all own enumerable string keyed function properties of a source
  21486. * object to the destination object. If `object` is a function, then methods
  21487. * are added to its prototype as well.
  21488. *
  21489. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  21490. * avoid conflicts caused by modifying the original.
  21491. *
  21492. * @static
  21493. * @since 0.1.0
  21494. * @memberOf _
  21495. * @category Util
  21496. * @param {Function|Object} [object=lodash] The destination object.
  21497. * @param {Object} source The object of functions to add.
  21498. * @param {Object} [options={}] The options object.
  21499. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  21500. * @returns {Function|Object} Returns `object`.
  21501. * @example
  21502. *
  21503. * function vowels(string) {
  21504. * return _.filter(string, function(v) {
  21505. * return /[aeiou]/i.test(v);
  21506. * });
  21507. * }
  21508. *
  21509. * _.mixin({ 'vowels': vowels });
  21510. * _.vowels('fred');
  21511. * // => ['e']
  21512. *
  21513. * _('fred').vowels().value();
  21514. * // => ['e']
  21515. *
  21516. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  21517. * _('fred').vowels();
  21518. * // => ['e']
  21519. */
  21520. function mixin(object, source, options) {
  21521. var props = keys(source),
  21522. methodNames = baseFunctions(source, props);
  21523. if (options == null &&
  21524. !(isObject(source) && (methodNames.length || !props.length))) {
  21525. options = source;
  21526. source = object;
  21527. object = this;
  21528. methodNames = baseFunctions(source, keys(source));
  21529. }
  21530. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  21531. isFunc = isFunction(object);
  21532. arrayEach(methodNames, function(methodName) {
  21533. var func = source[methodName];
  21534. object[methodName] = func;
  21535. if (isFunc) {
  21536. object.prototype[methodName] = function() {
  21537. var chainAll = this.__chain__;
  21538. if (chain || chainAll) {
  21539. var result = object(this.__wrapped__),
  21540. actions = result.__actions__ = copyArray(this.__actions__);
  21541. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  21542. result.__chain__ = chainAll;
  21543. return result;
  21544. }
  21545. return func.apply(object, arrayPush([this.value()], arguments));
  21546. };
  21547. }
  21548. });
  21549. return object;
  21550. }
  21551. /**
  21552. * Reverts the `_` variable to its previous value and returns a reference to
  21553. * the `lodash` function.
  21554. *
  21555. * @static
  21556. * @since 0.1.0
  21557. * @memberOf _
  21558. * @category Util
  21559. * @returns {Function} Returns the `lodash` function.
  21560. * @example
  21561. *
  21562. * var lodash = _.noConflict();
  21563. */
  21564. function noConflict() {
  21565. if (root._ === this) {
  21566. root._ = oldDash;
  21567. }
  21568. return this;
  21569. }
  21570. /**
  21571. * This method returns `undefined`.
  21572. *
  21573. * @static
  21574. * @memberOf _
  21575. * @since 2.3.0
  21576. * @category Util
  21577. * @example
  21578. *
  21579. * _.times(2, _.noop);
  21580. * // => [undefined, undefined]
  21581. */
  21582. function noop() {
  21583. // No operation performed.
  21584. }
  21585. /**
  21586. * Creates a function that gets the argument at index `n`. If `n` is negative,
  21587. * the nth argument from the end is returned.
  21588. *
  21589. * @static
  21590. * @memberOf _
  21591. * @since 4.0.0
  21592. * @category Util
  21593. * @param {number} [n=0] The index of the argument to return.
  21594. * @returns {Function} Returns the new pass-thru function.
  21595. * @example
  21596. *
  21597. * var func = _.nthArg(1);
  21598. * func('a', 'b', 'c', 'd');
  21599. * // => 'b'
  21600. *
  21601. * var func = _.nthArg(-2);
  21602. * func('a', 'b', 'c', 'd');
  21603. * // => 'c'
  21604. */
  21605. function nthArg(n) {
  21606. n = toInteger(n);
  21607. return baseRest(function(args) {
  21608. return baseNth(args, n);
  21609. });
  21610. }
  21611. /**
  21612. * Creates a function that invokes `iteratees` with the arguments it receives
  21613. * and returns their results.
  21614. *
  21615. * @static
  21616. * @memberOf _
  21617. * @since 4.0.0
  21618. * @category Util
  21619. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  21620. * The iteratees to invoke.
  21621. * @returns {Function} Returns the new function.
  21622. * @example
  21623. *
  21624. * var func = _.over([Math.max, Math.min]);
  21625. *
  21626. * func(1, 2, 3, 4);
  21627. * // => [4, 1]
  21628. */
  21629. var over = createOver(arrayMap);
  21630. /**
  21631. * Creates a function that checks if **all** of the `predicates` return
  21632. * truthy when invoked with the arguments it receives.
  21633. *
  21634. * @static
  21635. * @memberOf _
  21636. * @since 4.0.0
  21637. * @category Util
  21638. * @param {...(Function|Function[])} [predicates=[_.identity]]
  21639. * The predicates to check.
  21640. * @returns {Function} Returns the new function.
  21641. * @example
  21642. *
  21643. * var func = _.overEvery([Boolean, isFinite]);
  21644. *
  21645. * func('1');
  21646. * // => true
  21647. *
  21648. * func(null);
  21649. * // => false
  21650. *
  21651. * func(NaN);
  21652. * // => false
  21653. */
  21654. var overEvery = createOver(arrayEvery);
  21655. /**
  21656. * Creates a function that checks if **any** of the `predicates` return
  21657. * truthy when invoked with the arguments it receives.
  21658. *
  21659. * @static
  21660. * @memberOf _
  21661. * @since 4.0.0
  21662. * @category Util
  21663. * @param {...(Function|Function[])} [predicates=[_.identity]]
  21664. * The predicates to check.
  21665. * @returns {Function} Returns the new function.
  21666. * @example
  21667. *
  21668. * var func = _.overSome([Boolean, isFinite]);
  21669. *
  21670. * func('1');
  21671. * // => true
  21672. *
  21673. * func(null);
  21674. * // => true
  21675. *
  21676. * func(NaN);
  21677. * // => false
  21678. */
  21679. var overSome = createOver(arraySome);
  21680. /**
  21681. * Creates a function that returns the value at `path` of a given object.
  21682. *
  21683. * @static
  21684. * @memberOf _
  21685. * @since 2.4.0
  21686. * @category Util
  21687. * @param {Array|string} path The path of the property to get.
  21688. * @returns {Function} Returns the new accessor function.
  21689. * @example
  21690. *
  21691. * var objects = [
  21692. * { 'a': { 'b': 2 } },
  21693. * { 'a': { 'b': 1 } }
  21694. * ];
  21695. *
  21696. * _.map(objects, _.property('a.b'));
  21697. * // => [2, 1]
  21698. *
  21699. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  21700. * // => [1, 2]
  21701. */
  21702. function property(path) {
  21703. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  21704. }
  21705. /**
  21706. * The opposite of `_.property`; this method creates a function that returns
  21707. * the value at a given path of `object`.
  21708. *
  21709. * @static
  21710. * @memberOf _
  21711. * @since 3.0.0
  21712. * @category Util
  21713. * @param {Object} object The object to query.
  21714. * @returns {Function} Returns the new accessor function.
  21715. * @example
  21716. *
  21717. * var array = [0, 1, 2],
  21718. * object = { 'a': array, 'b': array, 'c': array };
  21719. *
  21720. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  21721. * // => [2, 0]
  21722. *
  21723. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  21724. * // => [2, 0]
  21725. */
  21726. function propertyOf(object) {
  21727. return function(path) {
  21728. return object == null ? undefined : baseGet(object, path);
  21729. };
  21730. }
  21731. /**
  21732. * Creates an array of numbers (positive and/or negative) progressing from
  21733. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  21734. * `start` is specified without an `end` or `step`. If `end` is not specified,
  21735. * it's set to `start` with `start` then set to `0`.
  21736. *
  21737. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  21738. * floating-point values which can produce unexpected results.
  21739. *
  21740. * @static
  21741. * @since 0.1.0
  21742. * @memberOf _
  21743. * @category Util
  21744. * @param {number} [start=0] The start of the range.
  21745. * @param {number} end The end of the range.
  21746. * @param {number} [step=1] The value to increment or decrement by.
  21747. * @returns {Array} Returns the range of numbers.
  21748. * @see _.inRange, _.rangeRight
  21749. * @example
  21750. *
  21751. * _.range(4);
  21752. * // => [0, 1, 2, 3]
  21753. *
  21754. * _.range(-4);
  21755. * // => [0, -1, -2, -3]
  21756. *
  21757. * _.range(1, 5);
  21758. * // => [1, 2, 3, 4]
  21759. *
  21760. * _.range(0, 20, 5);
  21761. * // => [0, 5, 10, 15]
  21762. *
  21763. * _.range(0, -4, -1);
  21764. * // => [0, -1, -2, -3]
  21765. *
  21766. * _.range(1, 4, 0);
  21767. * // => [1, 1, 1]
  21768. *
  21769. * _.range(0);
  21770. * // => []
  21771. */
  21772. var range = createRange();
  21773. /**
  21774. * This method is like `_.range` except that it populates values in
  21775. * descending order.
  21776. *
  21777. * @static
  21778. * @memberOf _
  21779. * @since 4.0.0
  21780. * @category Util
  21781. * @param {number} [start=0] The start of the range.
  21782. * @param {number} end The end of the range.
  21783. * @param {number} [step=1] The value to increment or decrement by.
  21784. * @returns {Array} Returns the range of numbers.
  21785. * @see _.inRange, _.range
  21786. * @example
  21787. *
  21788. * _.rangeRight(4);
  21789. * // => [3, 2, 1, 0]
  21790. *
  21791. * _.rangeRight(-4);
  21792. * // => [-3, -2, -1, 0]
  21793. *
  21794. * _.rangeRight(1, 5);
  21795. * // => [4, 3, 2, 1]
  21796. *
  21797. * _.rangeRight(0, 20, 5);
  21798. * // => [15, 10, 5, 0]
  21799. *
  21800. * _.rangeRight(0, -4, -1);
  21801. * // => [-3, -2, -1, 0]
  21802. *
  21803. * _.rangeRight(1, 4, 0);
  21804. * // => [1, 1, 1]
  21805. *
  21806. * _.rangeRight(0);
  21807. * // => []
  21808. */
  21809. var rangeRight = createRange(true);
  21810. /**
  21811. * This method returns a new empty array.
  21812. *
  21813. * @static
  21814. * @memberOf _
  21815. * @since 4.13.0
  21816. * @category Util
  21817. * @returns {Array} Returns the new empty array.
  21818. * @example
  21819. *
  21820. * var arrays = _.times(2, _.stubArray);
  21821. *
  21822. * console.log(arrays);
  21823. * // => [[], []]
  21824. *
  21825. * console.log(arrays[0] === arrays[1]);
  21826. * // => false
  21827. */
  21828. function stubArray() {
  21829. return [];
  21830. }
  21831. /**
  21832. * This method returns `false`.
  21833. *
  21834. * @static
  21835. * @memberOf _
  21836. * @since 4.13.0
  21837. * @category Util
  21838. * @returns {boolean} Returns `false`.
  21839. * @example
  21840. *
  21841. * _.times(2, _.stubFalse);
  21842. * // => [false, false]
  21843. */
  21844. function stubFalse() {
  21845. return false;
  21846. }
  21847. /**
  21848. * This method returns a new empty object.
  21849. *
  21850. * @static
  21851. * @memberOf _
  21852. * @since 4.13.0
  21853. * @category Util
  21854. * @returns {Object} Returns the new empty object.
  21855. * @example
  21856. *
  21857. * var objects = _.times(2, _.stubObject);
  21858. *
  21859. * console.log(objects);
  21860. * // => [{}, {}]
  21861. *
  21862. * console.log(objects[0] === objects[1]);
  21863. * // => false
  21864. */
  21865. function stubObject() {
  21866. return {};
  21867. }
  21868. /**
  21869. * This method returns an empty string.
  21870. *
  21871. * @static
  21872. * @memberOf _
  21873. * @since 4.13.0
  21874. * @category Util
  21875. * @returns {string} Returns the empty string.
  21876. * @example
  21877. *
  21878. * _.times(2, _.stubString);
  21879. * // => ['', '']
  21880. */
  21881. function stubString() {
  21882. return '';
  21883. }
  21884. /**
  21885. * This method returns `true`.
  21886. *
  21887. * @static
  21888. * @memberOf _
  21889. * @since 4.13.0
  21890. * @category Util
  21891. * @returns {boolean} Returns `true`.
  21892. * @example
  21893. *
  21894. * _.times(2, _.stubTrue);
  21895. * // => [true, true]
  21896. */
  21897. function stubTrue() {
  21898. return true;
  21899. }
  21900. /**
  21901. * Invokes the iteratee `n` times, returning an array of the results of
  21902. * each invocation. The iteratee is invoked with one argument; (index).
  21903. *
  21904. * @static
  21905. * @since 0.1.0
  21906. * @memberOf _
  21907. * @category Util
  21908. * @param {number} n The number of times to invoke `iteratee`.
  21909. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  21910. * @returns {Array} Returns the array of results.
  21911. * @example
  21912. *
  21913. * _.times(3, String);
  21914. * // => ['0', '1', '2']
  21915. *
  21916. * _.times(4, _.constant(0));
  21917. * // => [0, 0, 0, 0]
  21918. */
  21919. function times(n, iteratee) {
  21920. n = toInteger(n);
  21921. if (n < 1 || n > MAX_SAFE_INTEGER) {
  21922. return [];
  21923. }
  21924. var index = MAX_ARRAY_LENGTH,
  21925. length = nativeMin(n, MAX_ARRAY_LENGTH);
  21926. iteratee = getIteratee(iteratee);
  21927. n -= MAX_ARRAY_LENGTH;
  21928. var result = baseTimes(length, iteratee);
  21929. while (++index < n) {
  21930. iteratee(index);
  21931. }
  21932. return result;
  21933. }
  21934. /**
  21935. * Converts `value` to a property path array.
  21936. *
  21937. * @static
  21938. * @memberOf _
  21939. * @since 4.0.0
  21940. * @category Util
  21941. * @param {*} value The value to convert.
  21942. * @returns {Array} Returns the new property path array.
  21943. * @example
  21944. *
  21945. * _.toPath('a.b.c');
  21946. * // => ['a', 'b', 'c']
  21947. *
  21948. * _.toPath('a[0].b.c');
  21949. * // => ['a', '0', 'b', 'c']
  21950. */
  21951. function toPath(value) {
  21952. if (isArray(value)) {
  21953. return arrayMap(value, toKey);
  21954. }
  21955. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  21956. }
  21957. /**
  21958. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  21959. *
  21960. * @static
  21961. * @since 0.1.0
  21962. * @memberOf _
  21963. * @category Util
  21964. * @param {string} [prefix=''] The value to prefix the ID with.
  21965. * @returns {string} Returns the unique ID.
  21966. * @example
  21967. *
  21968. * _.uniqueId('contact_');
  21969. * // => 'contact_104'
  21970. *
  21971. * _.uniqueId();
  21972. * // => '105'
  21973. */
  21974. function uniqueId(prefix) {
  21975. var id = ++idCounter;
  21976. return toString(prefix) + id;
  21977. }
  21978. /*------------------------------------------------------------------------*/
  21979. /**
  21980. * Adds two numbers.
  21981. *
  21982. * @static
  21983. * @memberOf _
  21984. * @since 3.4.0
  21985. * @category Math
  21986. * @param {number} augend The first number in an addition.
  21987. * @param {number} addend The second number in an addition.
  21988. * @returns {number} Returns the total.
  21989. * @example
  21990. *
  21991. * _.add(6, 4);
  21992. * // => 10
  21993. */
  21994. var add = createMathOperation(function(augend, addend) {
  21995. return augend + addend;
  21996. }, 0);
  21997. /**
  21998. * Computes `number` rounded up to `precision`.
  21999. *
  22000. * @static
  22001. * @memberOf _
  22002. * @since 3.10.0
  22003. * @category Math
  22004. * @param {number} number The number to round up.
  22005. * @param {number} [precision=0] The precision to round up to.
  22006. * @returns {number} Returns the rounded up number.
  22007. * @example
  22008. *
  22009. * _.ceil(4.006);
  22010. * // => 5
  22011. *
  22012. * _.ceil(6.004, 2);
  22013. * // => 6.01
  22014. *
  22015. * _.ceil(6040, -2);
  22016. * // => 6100
  22017. */
  22018. var ceil = createRound('ceil');
  22019. /**
  22020. * Divide two numbers.
  22021. *
  22022. * @static
  22023. * @memberOf _
  22024. * @since 4.7.0
  22025. * @category Math
  22026. * @param {number} dividend The first number in a division.
  22027. * @param {number} divisor The second number in a division.
  22028. * @returns {number} Returns the quotient.
  22029. * @example
  22030. *
  22031. * _.divide(6, 4);
  22032. * // => 1.5
  22033. */
  22034. var divide = createMathOperation(function(dividend, divisor) {
  22035. return dividend / divisor;
  22036. }, 1);
  22037. /**
  22038. * Computes `number` rounded down to `precision`.
  22039. *
  22040. * @static
  22041. * @memberOf _
  22042. * @since 3.10.0
  22043. * @category Math
  22044. * @param {number} number The number to round down.
  22045. * @param {number} [precision=0] The precision to round down to.
  22046. * @returns {number} Returns the rounded down number.
  22047. * @example
  22048. *
  22049. * _.floor(4.006);
  22050. * // => 4
  22051. *
  22052. * _.floor(0.046, 2);
  22053. * // => 0.04
  22054. *
  22055. * _.floor(4060, -2);
  22056. * // => 4000
  22057. */
  22058. var floor = createRound('floor');
  22059. /**
  22060. * Computes the maximum value of `array`. If `array` is empty or falsey,
  22061. * `undefined` is returned.
  22062. *
  22063. * @static
  22064. * @since 0.1.0
  22065. * @memberOf _
  22066. * @category Math
  22067. * @param {Array} array The array to iterate over.
  22068. * @returns {*} Returns the maximum value.
  22069. * @example
  22070. *
  22071. * _.max([4, 2, 8, 6]);
  22072. * // => 8
  22073. *
  22074. * _.max([]);
  22075. * // => undefined
  22076. */
  22077. function max(array) {
  22078. return (array && array.length)
  22079. ? baseExtremum(array, identity, baseGt)
  22080. : undefined;
  22081. }
  22082. /**
  22083. * This method is like `_.max` except that it accepts `iteratee` which is
  22084. * invoked for each element in `array` to generate the criterion by which
  22085. * the value is ranked. The iteratee is invoked with one argument: (value).
  22086. *
  22087. * @static
  22088. * @memberOf _
  22089. * @since 4.0.0
  22090. * @category Math
  22091. * @param {Array} array The array to iterate over.
  22092. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  22093. * @returns {*} Returns the maximum value.
  22094. * @example
  22095. *
  22096. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  22097. *
  22098. * _.maxBy(objects, function(o) { return o.n; });
  22099. * // => { 'n': 2 }
  22100. *
  22101. * // The `_.property` iteratee shorthand.
  22102. * _.maxBy(objects, 'n');
  22103. * // => { 'n': 2 }
  22104. */
  22105. function maxBy(array, iteratee) {
  22106. return (array && array.length)
  22107. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  22108. : undefined;
  22109. }
  22110. /**
  22111. * Computes the mean of the values in `array`.
  22112. *
  22113. * @static
  22114. * @memberOf _
  22115. * @since 4.0.0
  22116. * @category Math
  22117. * @param {Array} array The array to iterate over.
  22118. * @returns {number} Returns the mean.
  22119. * @example
  22120. *
  22121. * _.mean([4, 2, 8, 6]);
  22122. * // => 5
  22123. */
  22124. function mean(array) {
  22125. return baseMean(array, identity);
  22126. }
  22127. /**
  22128. * This method is like `_.mean` except that it accepts `iteratee` which is
  22129. * invoked for each element in `array` to generate the value to be averaged.
  22130. * The iteratee is invoked with one argument: (value).
  22131. *
  22132. * @static
  22133. * @memberOf _
  22134. * @since 4.7.0
  22135. * @category Math
  22136. * @param {Array} array The array to iterate over.
  22137. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  22138. * @returns {number} Returns the mean.
  22139. * @example
  22140. *
  22141. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  22142. *
  22143. * _.meanBy(objects, function(o) { return o.n; });
  22144. * // => 5
  22145. *
  22146. * // The `_.property` iteratee shorthand.
  22147. * _.meanBy(objects, 'n');
  22148. * // => 5
  22149. */
  22150. function meanBy(array, iteratee) {
  22151. return baseMean(array, getIteratee(iteratee, 2));
  22152. }
  22153. /**
  22154. * Computes the minimum value of `array`. If `array` is empty or falsey,
  22155. * `undefined` is returned.
  22156. *
  22157. * @static
  22158. * @since 0.1.0
  22159. * @memberOf _
  22160. * @category Math
  22161. * @param {Array} array The array to iterate over.
  22162. * @returns {*} Returns the minimum value.
  22163. * @example
  22164. *
  22165. * _.min([4, 2, 8, 6]);
  22166. * // => 2
  22167. *
  22168. * _.min([]);
  22169. * // => undefined
  22170. */
  22171. function min(array) {
  22172. return (array && array.length)
  22173. ? baseExtremum(array, identity, baseLt)
  22174. : undefined;
  22175. }
  22176. /**
  22177. * This method is like `_.min` except that it accepts `iteratee` which is
  22178. * invoked for each element in `array` to generate the criterion by which
  22179. * the value is ranked. The iteratee is invoked with one argument: (value).
  22180. *
  22181. * @static
  22182. * @memberOf _
  22183. * @since 4.0.0
  22184. * @category Math
  22185. * @param {Array} array The array to iterate over.
  22186. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  22187. * @returns {*} Returns the minimum value.
  22188. * @example
  22189. *
  22190. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  22191. *
  22192. * _.minBy(objects, function(o) { return o.n; });
  22193. * // => { 'n': 1 }
  22194. *
  22195. * // The `_.property` iteratee shorthand.
  22196. * _.minBy(objects, 'n');
  22197. * // => { 'n': 1 }
  22198. */
  22199. function minBy(array, iteratee) {
  22200. return (array && array.length)
  22201. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  22202. : undefined;
  22203. }
  22204. /**
  22205. * Multiply two numbers.
  22206. *
  22207. * @static
  22208. * @memberOf _
  22209. * @since 4.7.0
  22210. * @category Math
  22211. * @param {number} multiplier The first number in a multiplication.
  22212. * @param {number} multiplicand The second number in a multiplication.
  22213. * @returns {number} Returns the product.
  22214. * @example
  22215. *
  22216. * _.multiply(6, 4);
  22217. * // => 24
  22218. */
  22219. var multiply = createMathOperation(function(multiplier, multiplicand) {
  22220. return multiplier * multiplicand;
  22221. }, 1);
  22222. /**
  22223. * Computes `number` rounded to `precision`.
  22224. *
  22225. * @static
  22226. * @memberOf _
  22227. * @since 3.10.0
  22228. * @category Math
  22229. * @param {number} number The number to round.
  22230. * @param {number} [precision=0] The precision to round to.
  22231. * @returns {number} Returns the rounded number.
  22232. * @example
  22233. *
  22234. * _.round(4.006);
  22235. * // => 4
  22236. *
  22237. * _.round(4.006, 2);
  22238. * // => 4.01
  22239. *
  22240. * _.round(4060, -2);
  22241. * // => 4100
  22242. */
  22243. var round = createRound('round');
  22244. /**
  22245. * Subtract two numbers.
  22246. *
  22247. * @static
  22248. * @memberOf _
  22249. * @since 4.0.0
  22250. * @category Math
  22251. * @param {number} minuend The first number in a subtraction.
  22252. * @param {number} subtrahend The second number in a subtraction.
  22253. * @returns {number} Returns the difference.
  22254. * @example
  22255. *
  22256. * _.subtract(6, 4);
  22257. * // => 2
  22258. */
  22259. var subtract = createMathOperation(function(minuend, subtrahend) {
  22260. return minuend - subtrahend;
  22261. }, 0);
  22262. /**
  22263. * Computes the sum of the values in `array`.
  22264. *
  22265. * @static
  22266. * @memberOf _
  22267. * @since 3.4.0
  22268. * @category Math
  22269. * @param {Array} array The array to iterate over.
  22270. * @returns {number} Returns the sum.
  22271. * @example
  22272. *
  22273. * _.sum([4, 2, 8, 6]);
  22274. * // => 20
  22275. */
  22276. function sum(array) {
  22277. return (array && array.length)
  22278. ? baseSum(array, identity)
  22279. : 0;
  22280. }
  22281. /**
  22282. * This method is like `_.sum` except that it accepts `iteratee` which is
  22283. * invoked for each element in `array` to generate the value to be summed.
  22284. * The iteratee is invoked with one argument: (value).
  22285. *
  22286. * @static
  22287. * @memberOf _
  22288. * @since 4.0.0
  22289. * @category Math
  22290. * @param {Array} array The array to iterate over.
  22291. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  22292. * @returns {number} Returns the sum.
  22293. * @example
  22294. *
  22295. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  22296. *
  22297. * _.sumBy(objects, function(o) { return o.n; });
  22298. * // => 20
  22299. *
  22300. * // The `_.property` iteratee shorthand.
  22301. * _.sumBy(objects, 'n');
  22302. * // => 20
  22303. */
  22304. function sumBy(array, iteratee) {
  22305. return (array && array.length)
  22306. ? baseSum(array, getIteratee(iteratee, 2))
  22307. : 0;
  22308. }
  22309. /*------------------------------------------------------------------------*/
  22310. // Add methods that return wrapped values in chain sequences.
  22311. lodash.after = after;
  22312. lodash.ary = ary;
  22313. lodash.assign = assign;
  22314. lodash.assignIn = assignIn;
  22315. lodash.assignInWith = assignInWith;
  22316. lodash.assignWith = assignWith;
  22317. lodash.at = at;
  22318. lodash.before = before;
  22319. lodash.bind = bind;
  22320. lodash.bindAll = bindAll;
  22321. lodash.bindKey = bindKey;
  22322. lodash.castArray = castArray;
  22323. lodash.chain = chain;
  22324. lodash.chunk = chunk;
  22325. lodash.compact = compact;
  22326. lodash.concat = concat;
  22327. lodash.cond = cond;
  22328. lodash.conforms = conforms;
  22329. lodash.constant = constant;
  22330. lodash.countBy = countBy;
  22331. lodash.create = create;
  22332. lodash.curry = curry;
  22333. lodash.curryRight = curryRight;
  22334. lodash.debounce = debounce;
  22335. lodash.defaults = defaults;
  22336. lodash.defaultsDeep = defaultsDeep;
  22337. lodash.defer = defer;
  22338. lodash.delay = delay;
  22339. lodash.difference = difference;
  22340. lodash.differenceBy = differenceBy;
  22341. lodash.differenceWith = differenceWith;
  22342. lodash.drop = drop;
  22343. lodash.dropRight = dropRight;
  22344. lodash.dropRightWhile = dropRightWhile;
  22345. lodash.dropWhile = dropWhile;
  22346. lodash.fill = fill;
  22347. lodash.filter = filter;
  22348. lodash.flatMap = flatMap;
  22349. lodash.flatMapDeep = flatMapDeep;
  22350. lodash.flatMapDepth = flatMapDepth;
  22351. lodash.flatten = flatten;
  22352. lodash.flattenDeep = flattenDeep;
  22353. lodash.flattenDepth = flattenDepth;
  22354. lodash.flip = flip;
  22355. lodash.flow = flow;
  22356. lodash.flowRight = flowRight;
  22357. lodash.fromPairs = fromPairs;
  22358. lodash.functions = functions;
  22359. lodash.functionsIn = functionsIn;
  22360. lodash.groupBy = groupBy;
  22361. lodash.initial = initial;
  22362. lodash.intersection = intersection;
  22363. lodash.intersectionBy = intersectionBy;
  22364. lodash.intersectionWith = intersectionWith;
  22365. lodash.invert = invert;
  22366. lodash.invertBy = invertBy;
  22367. lodash.invokeMap = invokeMap;
  22368. lodash.iteratee = iteratee;
  22369. lodash.keyBy = keyBy;
  22370. lodash.keys = keys;
  22371. lodash.keysIn = keysIn;
  22372. lodash.map = map;
  22373. lodash.mapKeys = mapKeys;
  22374. lodash.mapValues = mapValues;
  22375. lodash.matches = matches;
  22376. lodash.matchesProperty = matchesProperty;
  22377. lodash.memoize = memoize;
  22378. lodash.merge = merge;
  22379. lodash.mergeWith = mergeWith;
  22380. lodash.method = method;
  22381. lodash.methodOf = methodOf;
  22382. lodash.mixin = mixin;
  22383. lodash.negate = negate;
  22384. lodash.nthArg = nthArg;
  22385. lodash.omit = omit;
  22386. lodash.omitBy = omitBy;
  22387. lodash.once = once;
  22388. lodash.orderBy = orderBy;
  22389. lodash.over = over;
  22390. lodash.overArgs = overArgs;
  22391. lodash.overEvery = overEvery;
  22392. lodash.overSome = overSome;
  22393. lodash.partial = partial;
  22394. lodash.partialRight = partialRight;
  22395. lodash.partition = partition;
  22396. lodash.pick = pick;
  22397. lodash.pickBy = pickBy;
  22398. lodash.property = property;
  22399. lodash.propertyOf = propertyOf;
  22400. lodash.pull = pull;
  22401. lodash.pullAll = pullAll;
  22402. lodash.pullAllBy = pullAllBy;
  22403. lodash.pullAllWith = pullAllWith;
  22404. lodash.pullAt = pullAt;
  22405. lodash.range = range;
  22406. lodash.rangeRight = rangeRight;
  22407. lodash.rearg = rearg;
  22408. lodash.reject = reject;
  22409. lodash.remove = remove;
  22410. lodash.rest = rest;
  22411. lodash.reverse = reverse;
  22412. lodash.sampleSize = sampleSize;
  22413. lodash.set = set;
  22414. lodash.setWith = setWith;
  22415. lodash.shuffle = shuffle;
  22416. lodash.slice = slice;
  22417. lodash.sortBy = sortBy;
  22418. lodash.sortedUniq = sortedUniq;
  22419. lodash.sortedUniqBy = sortedUniqBy;
  22420. lodash.split = split;
  22421. lodash.spread = spread;
  22422. lodash.tail = tail;
  22423. lodash.take = take;
  22424. lodash.takeRight = takeRight;
  22425. lodash.takeRightWhile = takeRightWhile;
  22426. lodash.takeWhile = takeWhile;
  22427. lodash.tap = tap;
  22428. lodash.throttle = throttle;
  22429. lodash.thru = thru;
  22430. lodash.toArray = toArray;
  22431. lodash.toPairs = toPairs;
  22432. lodash.toPairsIn = toPairsIn;
  22433. lodash.toPath = toPath;
  22434. lodash.toPlainObject = toPlainObject;
  22435. lodash.transform = transform;
  22436. lodash.unary = unary;
  22437. lodash.union = union;
  22438. lodash.unionBy = unionBy;
  22439. lodash.unionWith = unionWith;
  22440. lodash.uniq = uniq;
  22441. lodash.uniqBy = uniqBy;
  22442. lodash.uniqWith = uniqWith;
  22443. lodash.unset = unset;
  22444. lodash.unzip = unzip;
  22445. lodash.unzipWith = unzipWith;
  22446. lodash.update = update;
  22447. lodash.updateWith = updateWith;
  22448. lodash.values = values;
  22449. lodash.valuesIn = valuesIn;
  22450. lodash.without = without;
  22451. lodash.words = words;
  22452. lodash.wrap = wrap;
  22453. lodash.xor = xor;
  22454. lodash.xorBy = xorBy;
  22455. lodash.xorWith = xorWith;
  22456. lodash.zip = zip;
  22457. lodash.zipObject = zipObject;
  22458. lodash.zipObjectDeep = zipObjectDeep;
  22459. lodash.zipWith = zipWith;
  22460. // Add aliases.
  22461. lodash.entries = toPairs;
  22462. lodash.entriesIn = toPairsIn;
  22463. lodash.extend = assignIn;
  22464. lodash.extendWith = assignInWith;
  22465. // Add methods to `lodash.prototype`.
  22466. mixin(lodash, lodash);
  22467. /*------------------------------------------------------------------------*/
  22468. // Add methods that return unwrapped values in chain sequences.
  22469. lodash.add = add;
  22470. lodash.attempt = attempt;
  22471. lodash.camelCase = camelCase;
  22472. lodash.capitalize = capitalize;
  22473. lodash.ceil = ceil;
  22474. lodash.clamp = clamp;
  22475. lodash.clone = clone;
  22476. lodash.cloneDeep = cloneDeep;
  22477. lodash.cloneDeepWith = cloneDeepWith;
  22478. lodash.cloneWith = cloneWith;
  22479. lodash.conformsTo = conformsTo;
  22480. lodash.deburr = deburr;
  22481. lodash.defaultTo = defaultTo;
  22482. lodash.divide = divide;
  22483. lodash.endsWith = endsWith;
  22484. lodash.eq = eq;
  22485. lodash.escape = escape;
  22486. lodash.escapeRegExp = escapeRegExp;
  22487. lodash.every = every;
  22488. lodash.find = find;
  22489. lodash.findIndex = findIndex;
  22490. lodash.findKey = findKey;
  22491. lodash.findLast = findLast;
  22492. lodash.findLastIndex = findLastIndex;
  22493. lodash.findLastKey = findLastKey;
  22494. lodash.floor = floor;
  22495. lodash.forEach = forEach;
  22496. lodash.forEachRight = forEachRight;
  22497. lodash.forIn = forIn;
  22498. lodash.forInRight = forInRight;
  22499. lodash.forOwn = forOwn;
  22500. lodash.forOwnRight = forOwnRight;
  22501. lodash.get = get;
  22502. lodash.gt = gt;
  22503. lodash.gte = gte;
  22504. lodash.has = has;
  22505. lodash.hasIn = hasIn;
  22506. lodash.head = head;
  22507. lodash.identity = identity;
  22508. lodash.includes = includes;
  22509. lodash.indexOf = indexOf;
  22510. lodash.inRange = inRange;
  22511. lodash.invoke = invoke;
  22512. lodash.isArguments = isArguments;
  22513. lodash.isArray = isArray;
  22514. lodash.isArrayBuffer = isArrayBuffer;
  22515. lodash.isArrayLike = isArrayLike;
  22516. lodash.isArrayLikeObject = isArrayLikeObject;
  22517. lodash.isBoolean = isBoolean;
  22518. lodash.isBuffer = isBuffer;
  22519. lodash.isDate = isDate;
  22520. lodash.isElement = isElement;
  22521. lodash.isEmpty = isEmpty;
  22522. lodash.isEqual = isEqual;
  22523. lodash.isEqualWith = isEqualWith;
  22524. lodash.isError = isError;
  22525. lodash.isFinite = isFinite;
  22526. lodash.isFunction = isFunction;
  22527. lodash.isInteger = isInteger;
  22528. lodash.isLength = isLength;
  22529. lodash.isMap = isMap;
  22530. lodash.isMatch = isMatch;
  22531. lodash.isMatchWith = isMatchWith;
  22532. lodash.isNaN = isNaN;
  22533. lodash.isNative = isNative;
  22534. lodash.isNil = isNil;
  22535. lodash.isNull = isNull;
  22536. lodash.isNumber = isNumber;
  22537. lodash.isObject = isObject;
  22538. lodash.isObjectLike = isObjectLike;
  22539. lodash.isPlainObject = isPlainObject;
  22540. lodash.isRegExp = isRegExp;
  22541. lodash.isSafeInteger = isSafeInteger;
  22542. lodash.isSet = isSet;
  22543. lodash.isString = isString;
  22544. lodash.isSymbol = isSymbol;
  22545. lodash.isTypedArray = isTypedArray;
  22546. lodash.isUndefined = isUndefined;
  22547. lodash.isWeakMap = isWeakMap;
  22548. lodash.isWeakSet = isWeakSet;
  22549. lodash.join = join;
  22550. lodash.kebabCase = kebabCase;
  22551. lodash.last = last;
  22552. lodash.lastIndexOf = lastIndexOf;
  22553. lodash.lowerCase = lowerCase;
  22554. lodash.lowerFirst = lowerFirst;
  22555. lodash.lt = lt;
  22556. lodash.lte = lte;
  22557. lodash.max = max;
  22558. lodash.maxBy = maxBy;
  22559. lodash.mean = mean;
  22560. lodash.meanBy = meanBy;
  22561. lodash.min = min;
  22562. lodash.minBy = minBy;
  22563. lodash.stubArray = stubArray;
  22564. lodash.stubFalse = stubFalse;
  22565. lodash.stubObject = stubObject;
  22566. lodash.stubString = stubString;
  22567. lodash.stubTrue = stubTrue;
  22568. lodash.multiply = multiply;
  22569. lodash.nth = nth;
  22570. lodash.noConflict = noConflict;
  22571. lodash.noop = noop;
  22572. lodash.now = now;
  22573. lodash.pad = pad;
  22574. lodash.padEnd = padEnd;
  22575. lodash.padStart = padStart;
  22576. lodash.parseInt = parseInt;
  22577. lodash.random = random;
  22578. lodash.reduce = reduce;
  22579. lodash.reduceRight = reduceRight;
  22580. lodash.repeat = repeat;
  22581. lodash.replace = replace;
  22582. lodash.result = result;
  22583. lodash.round = round;
  22584. lodash.runInContext = runInContext;
  22585. lodash.sample = sample;
  22586. lodash.size = size;
  22587. lodash.snakeCase = snakeCase;
  22588. lodash.some = some;
  22589. lodash.sortedIndex = sortedIndex;
  22590. lodash.sortedIndexBy = sortedIndexBy;
  22591. lodash.sortedIndexOf = sortedIndexOf;
  22592. lodash.sortedLastIndex = sortedLastIndex;
  22593. lodash.sortedLastIndexBy = sortedLastIndexBy;
  22594. lodash.sortedLastIndexOf = sortedLastIndexOf;
  22595. lodash.startCase = startCase;
  22596. lodash.startsWith = startsWith;
  22597. lodash.subtract = subtract;
  22598. lodash.sum = sum;
  22599. lodash.sumBy = sumBy;
  22600. lodash.template = template;
  22601. lodash.times = times;
  22602. lodash.toFinite = toFinite;
  22603. lodash.toInteger = toInteger;
  22604. lodash.toLength = toLength;
  22605. lodash.toLower = toLower;
  22606. lodash.toNumber = toNumber;
  22607. lodash.toSafeInteger = toSafeInteger;
  22608. lodash.toString = toString;
  22609. lodash.toUpper = toUpper;
  22610. lodash.trim = trim;
  22611. lodash.trimEnd = trimEnd;
  22612. lodash.trimStart = trimStart;
  22613. lodash.truncate = truncate;
  22614. lodash.unescape = unescape;
  22615. lodash.uniqueId = uniqueId;
  22616. lodash.upperCase = upperCase;
  22617. lodash.upperFirst = upperFirst;
  22618. // Add aliases.
  22619. lodash.each = forEach;
  22620. lodash.eachRight = forEachRight;
  22621. lodash.first = head;
  22622. mixin(lodash, (function() {
  22623. var source = {};
  22624. baseForOwn(lodash, function(func, methodName) {
  22625. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  22626. source[methodName] = func;
  22627. }
  22628. });
  22629. return source;
  22630. }()), { 'chain': false });
  22631. /*------------------------------------------------------------------------*/
  22632. /**
  22633. * The semantic version number.
  22634. *
  22635. * @static
  22636. * @memberOf _
  22637. * @type {string}
  22638. */
  22639. lodash.VERSION = VERSION;
  22640. // Assign default placeholders.
  22641. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  22642. lodash[methodName].placeholder = lodash;
  22643. });
  22644. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  22645. arrayEach(['drop', 'take'], function(methodName, index) {
  22646. LazyWrapper.prototype[methodName] = function(n) {
  22647. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  22648. var result = (this.__filtered__ && !index)
  22649. ? new LazyWrapper(this)
  22650. : this.clone();
  22651. if (result.__filtered__) {
  22652. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  22653. } else {
  22654. result.__views__.push({
  22655. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  22656. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  22657. });
  22658. }
  22659. return result;
  22660. };
  22661. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  22662. return this.reverse()[methodName](n).reverse();
  22663. };
  22664. });
  22665. // Add `LazyWrapper` methods that accept an `iteratee` value.
  22666. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  22667. var type = index + 1,
  22668. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  22669. LazyWrapper.prototype[methodName] = function(iteratee) {
  22670. var result = this.clone();
  22671. result.__iteratees__.push({
  22672. 'iteratee': getIteratee(iteratee, 3),
  22673. 'type': type
  22674. });
  22675. result.__filtered__ = result.__filtered__ || isFilter;
  22676. return result;
  22677. };
  22678. });
  22679. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  22680. arrayEach(['head', 'last'], function(methodName, index) {
  22681. var takeName = 'take' + (index ? 'Right' : '');
  22682. LazyWrapper.prototype[methodName] = function() {
  22683. return this[takeName](1).value()[0];
  22684. };
  22685. });
  22686. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  22687. arrayEach(['initial', 'tail'], function(methodName, index) {
  22688. var dropName = 'drop' + (index ? '' : 'Right');
  22689. LazyWrapper.prototype[methodName] = function() {
  22690. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  22691. };
  22692. });
  22693. LazyWrapper.prototype.compact = function() {
  22694. return this.filter(identity);
  22695. };
  22696. LazyWrapper.prototype.find = function(predicate) {
  22697. return this.filter(predicate).head();
  22698. };
  22699. LazyWrapper.prototype.findLast = function(predicate) {
  22700. return this.reverse().find(predicate);
  22701. };
  22702. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  22703. if (typeof path == 'function') {
  22704. return new LazyWrapper(this);
  22705. }
  22706. return this.map(function(value) {
  22707. return baseInvoke(value, path, args);
  22708. });
  22709. });
  22710. LazyWrapper.prototype.reject = function(predicate) {
  22711. return this.filter(negate(getIteratee(predicate)));
  22712. };
  22713. LazyWrapper.prototype.slice = function(start, end) {
  22714. start = toInteger(start);
  22715. var result = this;
  22716. if (result.__filtered__ && (start > 0 || end < 0)) {
  22717. return new LazyWrapper(result);
  22718. }
  22719. if (start < 0) {
  22720. result = result.takeRight(-start);
  22721. } else if (start) {
  22722. result = result.drop(start);
  22723. }
  22724. if (end !== undefined) {
  22725. end = toInteger(end);
  22726. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  22727. }
  22728. return result;
  22729. };
  22730. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  22731. return this.reverse().takeWhile(predicate).reverse();
  22732. };
  22733. LazyWrapper.prototype.toArray = function() {
  22734. return this.take(MAX_ARRAY_LENGTH);
  22735. };
  22736. // Add `LazyWrapper` methods to `lodash.prototype`.
  22737. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  22738. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  22739. isTaker = /^(?:head|last)$/.test(methodName),
  22740. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  22741. retUnwrapped = isTaker || /^find/.test(methodName);
  22742. if (!lodashFunc) {
  22743. return;
  22744. }
  22745. lodash.prototype[methodName] = function() {
  22746. var value = this.__wrapped__,
  22747. args = isTaker ? [1] : arguments,
  22748. isLazy = value instanceof LazyWrapper,
  22749. iteratee = args[0],
  22750. useLazy = isLazy || isArray(value);
  22751. var interceptor = function(value) {
  22752. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  22753. return (isTaker && chainAll) ? result[0] : result;
  22754. };
  22755. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  22756. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  22757. isLazy = useLazy = false;
  22758. }
  22759. var chainAll = this.__chain__,
  22760. isHybrid = !!this.__actions__.length,
  22761. isUnwrapped = retUnwrapped && !chainAll,
  22762. onlyLazy = isLazy && !isHybrid;
  22763. if (!retUnwrapped && useLazy) {
  22764. value = onlyLazy ? value : new LazyWrapper(this);
  22765. var result = func.apply(value, args);
  22766. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  22767. return new LodashWrapper(result, chainAll);
  22768. }
  22769. if (isUnwrapped && onlyLazy) {
  22770. return func.apply(this, args);
  22771. }
  22772. result = this.thru(interceptor);
  22773. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  22774. };
  22775. });
  22776. // Add `Array` methods to `lodash.prototype`.
  22777. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  22778. var func = arrayProto[methodName],
  22779. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  22780. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  22781. lodash.prototype[methodName] = function() {
  22782. var args = arguments;
  22783. if (retUnwrapped && !this.__chain__) {
  22784. var value = this.value();
  22785. return func.apply(isArray(value) ? value : [], args);
  22786. }
  22787. return this[chainName](function(value) {
  22788. return func.apply(isArray(value) ? value : [], args);
  22789. });
  22790. };
  22791. });
  22792. // Map minified method names to their real names.
  22793. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  22794. var lodashFunc = lodash[methodName];
  22795. if (lodashFunc) {
  22796. var key = (lodashFunc.name + ''),
  22797. names = realNames[key] || (realNames[key] = []);
  22798. names.push({ 'name': methodName, 'func': lodashFunc });
  22799. }
  22800. });
  22801. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  22802. 'name': 'wrapper',
  22803. 'func': undefined
  22804. }];
  22805. // Add methods to `LazyWrapper`.
  22806. LazyWrapper.prototype.clone = lazyClone;
  22807. LazyWrapper.prototype.reverse = lazyReverse;
  22808. LazyWrapper.prototype.value = lazyValue;
  22809. // Add chain sequence methods to the `lodash` wrapper.
  22810. lodash.prototype.at = wrapperAt;
  22811. lodash.prototype.chain = wrapperChain;
  22812. lodash.prototype.commit = wrapperCommit;
  22813. lodash.prototype.next = wrapperNext;
  22814. lodash.prototype.plant = wrapperPlant;
  22815. lodash.prototype.reverse = wrapperReverse;
  22816. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  22817. // Add lazy aliases.
  22818. lodash.prototype.first = lodash.prototype.head;
  22819. if (symIterator) {
  22820. lodash.prototype[symIterator] = wrapperToIterator;
  22821. }
  22822. return lodash;
  22823. });
  22824. /*--------------------------------------------------------------------------*/
  22825. // Export lodash.
  22826. var _ = runInContext();
  22827. // Some AMD build optimizers, like r.js, check for condition patterns like:
  22828. if (true) {
  22829. // Expose Lodash on the global object to prevent errors when Lodash is
  22830. // loaded by a script tag in the presence of an AMD loader.
  22831. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  22832. // Use `_.noConflict` to remove Lodash from the global object.
  22833. root._ = _;
  22834. // Define as an anonymous module so, through path mapping, it can be
  22835. // referenced as the "underscore" module.
  22836. !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
  22837. return _;
  22838. }.call(exports, __webpack_require__, exports, module),
  22839. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  22840. }
  22841. // Check for `exports` after `define` in case a build optimizer adds it.
  22842. else if (freeModule) {
  22843. // Export for Node.js.
  22844. (freeModule.exports = _)._ = _;
  22845. // Export for CommonJS support.
  22846. freeExports._ = _;
  22847. }
  22848. else {
  22849. // Export to the global object.
  22850. root._ = _;
  22851. }
  22852. }.call(this));
  22853. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(115)(module)))
  22854. /***/ }),
  22855. /* 46 */
  22856. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22857. "use strict";
  22858. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return EMPTY; });
  22859. /* harmony export (immutable) */ __webpack_exports__["a"] = empty;
  22860. /* unused harmony export emptyScheduled */
  22861. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  22862. /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
  22863. var EMPTY = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return subscriber.complete(); });
  22864. function empty(scheduler) {
  22865. return scheduler ? emptyScheduled(scheduler) : EMPTY;
  22866. }
  22867. function emptyScheduled(scheduler) {
  22868. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });
  22869. }
  22870. //# sourceMappingURL=empty.js.map
  22871. /***/ }),
  22872. /* 47 */
  22873. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22874. "use strict";
  22875. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return async; });
  22876. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AsyncAction__ = __webpack_require__(138);
  22877. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(139);
  22878. /** PURE_IMPORTS_START _AsyncAction,_AsyncScheduler PURE_IMPORTS_END */
  22879. var async = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */](__WEBPACK_IMPORTED_MODULE_0__AsyncAction__["a" /* AsyncAction */]);
  22880. //# sourceMappingURL=async.js.map
  22881. /***/ }),
  22882. /* 48 */
  22883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22884. "use strict";
  22885. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isArray; });
  22886. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  22887. var isArray = Array.isArray || (function (x) { return x && typeof x.length === 'number'; });
  22888. //# sourceMappingURL=isArray.js.map
  22889. /***/ }),
  22890. /* 49 */
  22891. /***/ (function(module, exports) {
  22892. module.exports = function (it) {
  22893. return typeof it === 'object' ? it !== null : typeof it === 'function';
  22894. };
  22895. /***/ }),
  22896. /* 50 */
  22897. /***/ (function(module, exports) {
  22898. module.exports = require("assert");
  22899. /***/ }),
  22900. /* 51 */
  22901. /***/ (function(module, exports, __webpack_require__) {
  22902. "use strict";
  22903. Object.defineProperty(exports, "__esModule", {
  22904. value: true
  22905. });
  22906. var _setPrototypeOf;
  22907. function _load_setPrototypeOf() {
  22908. return _setPrototypeOf = _interopRequireDefault(__webpack_require__(211));
  22909. }
  22910. var _getIterator2;
  22911. function _load_getIterator() {
  22912. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  22913. }
  22914. exports.default = nullify;
  22915. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  22916. function nullify() {
  22917. var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  22918. if (Array.isArray(obj)) {
  22919. for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  22920. var _ref;
  22921. if (_isArray) {
  22922. if (_i >= _iterator.length) break;
  22923. _ref = _iterator[_i++];
  22924. } else {
  22925. _i = _iterator.next();
  22926. if (_i.done) break;
  22927. _ref = _i.value;
  22928. }
  22929. var item = _ref;
  22930. nullify(item);
  22931. }
  22932. } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') {
  22933. (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(obj, null);
  22934. // for..in can only be applied to 'object', not 'function'
  22935. if (typeof obj === 'object') {
  22936. for (var key in obj) {
  22937. nullify(obj[key]);
  22938. }
  22939. }
  22940. }
  22941. return obj;
  22942. }
  22943. /***/ }),
  22944. /* 52 */
  22945. /***/ (function(module, exports, __webpack_require__) {
  22946. "use strict";
  22947. Object.defineProperty(exports, "__esModule", {
  22948. value: true
  22949. });
  22950. exports.normalizePattern = normalizePattern;
  22951. /**
  22952. * Explode and normalize a pattern into its name and range.
  22953. */
  22954. function normalizePattern(pattern) {
  22955. var hasVersion = false;
  22956. var range = 'latest';
  22957. var name = pattern;
  22958. // if we're a scope then remove the @ and add it back later
  22959. var isScoped = false;
  22960. if (name[0] === '@') {
  22961. isScoped = true;
  22962. name = name.slice(1);
  22963. }
  22964. // take first part as the name
  22965. var parts = name.split('@');
  22966. if (parts.length > 1) {
  22967. name = parts.shift();
  22968. range = parts.join('@');
  22969. if (range) {
  22970. hasVersion = true;
  22971. } else {
  22972. range = '*';
  22973. }
  22974. }
  22975. // add back @ scope suffix
  22976. if (isScoped) {
  22977. name = `@${name}`;
  22978. }
  22979. return { name, range, hasVersion };
  22980. }
  22981. /***/ }),
  22982. /* 53 */
  22983. /***/ (function(module, exports, __webpack_require__) {
  22984. module.exports = { "default": __webpack_require__(590), __esModule: true };
  22985. /***/ }),
  22986. /* 54 */
  22987. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22988. "use strict";
  22989. /* harmony export (immutable) */ __webpack_exports__["a"] = map;
  22990. /* unused harmony export MapOperator */
  22991. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  22992. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  22993. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  22994. function map(project, thisArg) {
  22995. return function mapOperation(source) {
  22996. if (typeof project !== 'function') {
  22997. throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
  22998. }
  22999. return source.lift(new MapOperator(project, thisArg));
  23000. };
  23001. }
  23002. var MapOperator = /*@__PURE__*/ (function () {
  23003. function MapOperator(project, thisArg) {
  23004. this.project = project;
  23005. this.thisArg = thisArg;
  23006. }
  23007. MapOperator.prototype.call = function (subscriber, source) {
  23008. return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
  23009. };
  23010. return MapOperator;
  23011. }());
  23012. var MapSubscriber = /*@__PURE__*/ (function (_super) {
  23013. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MapSubscriber, _super);
  23014. function MapSubscriber(destination, project, thisArg) {
  23015. var _this = _super.call(this, destination) || this;
  23016. _this.project = project;
  23017. _this.count = 0;
  23018. _this.thisArg = thisArg || _this;
  23019. return _this;
  23020. }
  23021. MapSubscriber.prototype._next = function (value) {
  23022. var result;
  23023. try {
  23024. result = this.project.call(this.thisArg, value, this.count++);
  23025. }
  23026. catch (err) {
  23027. this.destination.error(err);
  23028. return;
  23029. }
  23030. this.destination.next(result);
  23031. };
  23032. return MapSubscriber;
  23033. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  23034. //# sourceMappingURL=map.js.map
  23035. /***/ }),
  23036. /* 55 */
  23037. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23038. "use strict";
  23039. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return errorObject; });
  23040. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  23041. var errorObject = { e: {} };
  23042. //# sourceMappingURL=errorObject.js.map
  23043. /***/ }),
  23044. /* 56 */
  23045. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23046. "use strict";
  23047. /* harmony export (immutable) */ __webpack_exports__["a"] = isScheduler;
  23048. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  23049. function isScheduler(value) {
  23050. return value && typeof value.schedule === 'function';
  23051. }
  23052. //# sourceMappingURL=isScheduler.js.map
  23053. /***/ }),
  23054. /* 57 */
  23055. /***/ (function(module, exports, __webpack_require__) {
  23056. "use strict";
  23057. Object.defineProperty(exports, "__esModule", {
  23058. value: true
  23059. });
  23060. exports.exec = exports.queue = undefined;
  23061. var _keys;
  23062. function _load_keys() {
  23063. return _keys = _interopRequireDefault(__webpack_require__(14));
  23064. }
  23065. var _promise;
  23066. function _load_promise() {
  23067. return _promise = _interopRequireDefault(__webpack_require__(7));
  23068. }
  23069. var _getIterator2;
  23070. function _load_getIterator() {
  23071. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  23072. }
  23073. exports.forkp = forkp;
  23074. exports.spawnp = spawnp;
  23075. exports.forwardSignalToSpawnedProcesses = forwardSignalToSpawnedProcesses;
  23076. exports.spawn = spawn;
  23077. var _constants;
  23078. function _load_constants() {
  23079. return _constants = _interopRequireWildcard(__webpack_require__(13));
  23080. }
  23081. var _blockingQueue;
  23082. function _load_blockingQueue() {
  23083. return _blockingQueue = _interopRequireDefault(__webpack_require__(157));
  23084. }
  23085. var _errors;
  23086. function _load_errors() {
  23087. return _errors = __webpack_require__(6);
  23088. }
  23089. var _promise2;
  23090. function _load_promise2() {
  23091. return _promise2 = __webpack_require__(86);
  23092. }
  23093. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  23094. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  23095. /* global child_process$spawnOpts */
  23096. var os = __webpack_require__(66);
  23097. var child = __webpack_require__(271);
  23098. var fs = __webpack_require__(12);
  23099. var path = __webpack_require__(1);
  23100. var queue = exports.queue = new (_blockingQueue || _load_blockingQueue()).default('child', (_constants || _load_constants()).CHILD_CONCURRENCY);
  23101. // TODO: this uid check is kinda whack
  23102. var uid = 0;
  23103. var exec = exports.exec = (0, (_promise2 || _load_promise2()).promisify)(child.exec);
  23104. function validate(program) {
  23105. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  23106. if (program.match(/[\\\/]/)) {
  23107. return;
  23108. }
  23109. if (process.platform === 'win32' && process.env.PATHEXT) {
  23110. var cwd = opts.cwd || process.cwd();
  23111. var pathext = process.env.PATHEXT;
  23112. for (var _iterator = pathext.split(';'), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  23113. var _ref;
  23114. if (_isArray) {
  23115. if (_i >= _iterator.length) break;
  23116. _ref = _iterator[_i++];
  23117. } else {
  23118. _i = _iterator.next();
  23119. if (_i.done) break;
  23120. _ref = _i.value;
  23121. }
  23122. var ext = _ref;
  23123. var candidate = path.join(cwd, `${program}${ext}`);
  23124. if (fs.existsSync(candidate)) {
  23125. throw new Error(`Potentially dangerous call to "${program}" in ${cwd}`);
  23126. }
  23127. }
  23128. }
  23129. }
  23130. function forkp(program, args, opts) {
  23131. validate(program, opts);
  23132. var key = String(++uid);
  23133. return new (_promise || _load_promise()).default(function (resolve, reject) {
  23134. var proc = child.fork(program, args, opts);
  23135. spawnedProcesses[key] = proc;
  23136. proc.on('error', function (error) {
  23137. reject(error);
  23138. });
  23139. proc.on('close', function (exitCode, signal) {
  23140. var finalExitCode = typeof exitCode !== `undefined` && exitCode !== null ? exitCode : 128 + os.constants.signals[signal];
  23141. resolve(finalExitCode);
  23142. });
  23143. });
  23144. }
  23145. function spawnp(program, args, opts) {
  23146. validate(program, opts);
  23147. var key = String(++uid);
  23148. return new (_promise || _load_promise()).default(function (resolve, reject) {
  23149. var proc = child.spawn(program, args, opts);
  23150. spawnedProcesses[key] = proc;
  23151. proc.on('error', function (error) {
  23152. reject(error);
  23153. });
  23154. proc.on('close', function (exitCode, signal) {
  23155. var finalExitCode = typeof exitCode !== `undefined` && exitCode !== null ? exitCode : 128 + os.constants.signals[signal];
  23156. resolve(finalExitCode);
  23157. });
  23158. });
  23159. }
  23160. var spawnedProcesses = {};
  23161. function forwardSignalToSpawnedProcesses(signal) {
  23162. for (var _iterator2 = (0, (_keys || _load_keys()).default)(spawnedProcesses), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  23163. var _ref2;
  23164. if (_isArray2) {
  23165. if (_i2 >= _iterator2.length) break;
  23166. _ref2 = _iterator2[_i2++];
  23167. } else {
  23168. _i2 = _iterator2.next();
  23169. if (_i2.done) break;
  23170. _ref2 = _i2.value;
  23171. }
  23172. var key = _ref2;
  23173. spawnedProcesses[key].kill(signal);
  23174. }
  23175. }
  23176. function spawn(program, args) {
  23177. var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  23178. var onData = arguments[3];
  23179. var key = opts.cwd || String(++uid);
  23180. return queue.push(key, function () {
  23181. return new (_promise || _load_promise()).default(function (resolve, reject) {
  23182. validate(program, opts);
  23183. var proc = child.spawn(program, args, opts);
  23184. spawnedProcesses[key] = proc;
  23185. var processingDone = false;
  23186. var processClosed = false;
  23187. var err = null;
  23188. var stdout = '';
  23189. proc.on('error', function (err) {
  23190. if (err.code === 'ENOENT') {
  23191. reject(new (_errors || _load_errors()).ProcessSpawnError(`Couldn't find the binary ${program}`, err.code, program));
  23192. } else {
  23193. reject(err);
  23194. }
  23195. });
  23196. function updateStdout(chunk) {
  23197. stdout += chunk;
  23198. if (onData) {
  23199. onData(chunk);
  23200. }
  23201. }
  23202. function finish() {
  23203. delete spawnedProcesses[key];
  23204. if (err) {
  23205. reject(err);
  23206. } else {
  23207. resolve(stdout.trim());
  23208. }
  23209. }
  23210. if (typeof opts.process === 'function') {
  23211. opts.process(proc, updateStdout, reject, function () {
  23212. if (processClosed) {
  23213. finish();
  23214. } else {
  23215. processingDone = true;
  23216. }
  23217. });
  23218. } else {
  23219. if (proc.stderr) {
  23220. proc.stderr.on('data', updateStdout);
  23221. }
  23222. if (proc.stdout) {
  23223. proc.stdout.on('data', updateStdout);
  23224. }
  23225. processingDone = true;
  23226. }
  23227. proc.on('close', function (code, signal) {
  23228. if (signal || code >= 1) {
  23229. err = new (_errors || _load_errors()).ProcessTermError(['Command failed.', signal ? `Exit signal: ${signal}` : `Exit code: ${code}`, `Command: ${program}`, `Arguments: ${args.join(' ')}`, `Directory: ${opts.cwd || process.cwd()}`, `Output:\n${stdout.trim()}`].join('\n'));
  23230. err.EXIT_SIGNAL = signal;
  23231. err.EXIT_CODE = code;
  23232. }
  23233. if (processingDone || err) {
  23234. finish();
  23235. } else {
  23236. processClosed = true;
  23237. }
  23238. });
  23239. });
  23240. });
  23241. }
  23242. /***/ }),
  23243. /* 58 */
  23244. /***/ (function(module, exports, __webpack_require__) {
  23245. var isObject = __webpack_require__(49);
  23246. module.exports = function (it) {
  23247. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  23248. return it;
  23249. };
  23250. /***/ }),
  23251. /* 59 */
  23252. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23253. "use strict";
  23254. /* harmony export (immutable) */ __webpack_exports__["a"] = tryCatch;
  23255. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__errorObject__ = __webpack_require__(55);
  23256. /** PURE_IMPORTS_START _errorObject PURE_IMPORTS_END */
  23257. var tryCatchTarget;
  23258. function tryCatcher() {
  23259. try {
  23260. return tryCatchTarget.apply(this, arguments);
  23261. }
  23262. catch (e) {
  23263. __WEBPACK_IMPORTED_MODULE_0__errorObject__["a" /* errorObject */].e = e;
  23264. return __WEBPACK_IMPORTED_MODULE_0__errorObject__["a" /* errorObject */];
  23265. }
  23266. }
  23267. function tryCatch(fn) {
  23268. tryCatchTarget = fn;
  23269. return tryCatcher;
  23270. }
  23271. //# sourceMappingURL=tryCatch.js.map
  23272. /***/ }),
  23273. /* 60 */
  23274. /***/ (function(module, exports, __webpack_require__) {
  23275. /* eslint-disable node/no-deprecated-api */
  23276. var buffer = __webpack_require__(94)
  23277. var Buffer = buffer.Buffer
  23278. // alternative to using Object.keys for old browsers
  23279. function copyProps (src, dst) {
  23280. for (var key in src) {
  23281. dst[key] = src[key]
  23282. }
  23283. }
  23284. if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  23285. module.exports = buffer
  23286. } else {
  23287. // Copy properties from require('buffer')
  23288. copyProps(buffer, exports)
  23289. exports.Buffer = SafeBuffer
  23290. }
  23291. function SafeBuffer (arg, encodingOrOffset, length) {
  23292. return Buffer(arg, encodingOrOffset, length)
  23293. }
  23294. // Copy static methods from Buffer
  23295. copyProps(Buffer, SafeBuffer)
  23296. SafeBuffer.from = function (arg, encodingOrOffset, length) {
  23297. if (typeof arg === 'number') {
  23298. throw new TypeError('Argument must not be a number')
  23299. }
  23300. return Buffer(arg, encodingOrOffset, length)
  23301. }
  23302. SafeBuffer.alloc = function (size, fill, encoding) {
  23303. if (typeof size !== 'number') {
  23304. throw new TypeError('Argument must be a number')
  23305. }
  23306. var buf = Buffer(size)
  23307. if (fill !== undefined) {
  23308. if (typeof encoding === 'string') {
  23309. buf.fill(fill, encoding)
  23310. } else {
  23311. buf.fill(fill)
  23312. }
  23313. } else {
  23314. buf.fill(0)
  23315. }
  23316. return buf
  23317. }
  23318. SafeBuffer.allocUnsafe = function (size) {
  23319. if (typeof size !== 'number') {
  23320. throw new TypeError('Argument must be a number')
  23321. }
  23322. return Buffer(size)
  23323. }
  23324. SafeBuffer.allocUnsafeSlow = function (size) {
  23325. if (typeof size !== 'number') {
  23326. throw new TypeError('Argument must be a number')
  23327. }
  23328. return buffer.SlowBuffer(size)
  23329. }
  23330. /***/ }),
  23331. /* 61 */
  23332. /***/ (function(module, exports, __webpack_require__) {
  23333. "use strict";
  23334. Object.defineProperty(exports, "__esModule", {
  23335. value: true
  23336. });
  23337. exports.registryNames = exports.registries = undefined;
  23338. var _keys;
  23339. function _load_keys() {
  23340. return _keys = _interopRequireDefault(__webpack_require__(14));
  23341. }
  23342. var _yarnRegistry;
  23343. function _load_yarnRegistry() {
  23344. return _yarnRegistry = _interopRequireDefault(__webpack_require__(515));
  23345. }
  23346. var _npmRegistry;
  23347. function _load_npmRegistry() {
  23348. return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
  23349. }
  23350. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  23351. var registries = exports.registries = {
  23352. npm: (_npmRegistry || _load_npmRegistry()).default,
  23353. yarn: (_yarnRegistry || _load_yarnRegistry()).default
  23354. };
  23355. var registryNames = exports.registryNames = (0, (_keys || _load_keys()).default)(registries);
  23356. /***/ }),
  23357. /* 62 */
  23358. /***/ (function(module, exports, __webpack_require__) {
  23359. "use strict";
  23360. Object.defineProperty(exports, "__esModule", {
  23361. value: true
  23362. });
  23363. var _getIterator2;
  23364. function _load_getIterator() {
  23365. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  23366. }
  23367. var _promise;
  23368. function _load_promise() {
  23369. return _promise = _interopRequireDefault(__webpack_require__(7));
  23370. }
  23371. var _asyncToGenerator2;
  23372. function _load_asyncToGenerator() {
  23373. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  23374. }
  23375. var _keys;
  23376. function _load_keys() {
  23377. return _keys = _interopRequireDefault(__webpack_require__(14));
  23378. }
  23379. exports.default = function (rootCommandName, subCommands) {
  23380. var run = function () {
  23381. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  23382. var subName = (0, (_misc || _load_misc()).camelCase)(args.shift() || '');
  23383. if (subName && subCommands[subName]) {
  23384. var command = subCommands[subName];
  23385. var res = yield command(config, reporter, flags, args);
  23386. if (res !== false) {
  23387. return (_promise || _load_promise()).default.resolve();
  23388. }
  23389. }
  23390. if (usage && usage.length) {
  23391. reporter.error(`${reporter.lang('usage')}:`);
  23392. for (var _iterator = usage, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  23393. var _ref2;
  23394. if (_isArray) {
  23395. if (_i >= _iterator.length) break;
  23396. _ref2 = _iterator[_i++];
  23397. } else {
  23398. _i = _iterator.next();
  23399. if (_i.done) break;
  23400. _ref2 = _i.value;
  23401. }
  23402. var msg = _ref2;
  23403. reporter.error(`yarn ${rootCommandName} ${msg}`);
  23404. }
  23405. }
  23406. return (_promise || _load_promise()).default.reject(new (_errors || _load_errors()).MessageError(reporter.lang('invalidCommand', subCommandNames.join(', '))));
  23407. });
  23408. return function run(_x2, _x3, _x4, _x5) {
  23409. return _ref.apply(this, arguments);
  23410. };
  23411. }();
  23412. var usage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  23413. var subCommandNames = (0, (_keys || _load_keys()).default)(subCommands).map((_misc || _load_misc()).hyphenate);
  23414. function setFlags(commander) {
  23415. commander.usage(`${rootCommandName} [${subCommandNames.join('|')}] [flags]`);
  23416. }
  23417. function hasWrapper(commander, args) {
  23418. return true;
  23419. }
  23420. var examples = usage.map(function (cmd) {
  23421. return `${rootCommandName} ${cmd}`;
  23422. });
  23423. return { run, setFlags, hasWrapper, examples };
  23424. };
  23425. var _errors;
  23426. function _load_errors() {
  23427. return _errors = __webpack_require__(6);
  23428. }
  23429. var _misc;
  23430. function _load_misc() {
  23431. return _misc = __webpack_require__(28);
  23432. }
  23433. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  23434. /***/ }),
  23435. /* 63 */
  23436. /***/ (function(module, exports, __webpack_require__) {
  23437. var anObject = __webpack_require__(58);
  23438. var IE8_DOM_DEFINE = __webpack_require__(328);
  23439. var toPrimitive = __webpack_require__(227);
  23440. var dP = Object.defineProperty;
  23441. exports.f = __webpack_require__(69) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  23442. anObject(O);
  23443. P = toPrimitive(P, true);
  23444. anObject(Attributes);
  23445. if (IE8_DOM_DEFINE) try {
  23446. return dP(O, P, Attributes);
  23447. } catch (e) { /* empty */ }
  23448. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  23449. if ('value' in Attributes) O[P] = Attributes.value;
  23450. return O;
  23451. };
  23452. /***/ }),
  23453. /* 64 */
  23454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23455. "use strict";
  23456. /* harmony export (immutable) */ __webpack_exports__["a"] = from;
  23457. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  23458. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isPromise__ = __webpack_require__(415);
  23459. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArrayLike__ = __webpack_require__(412);
  23460. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isInteropObservable__ = __webpack_require__(1001);
  23461. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isIterable__ = __webpack_require__(1002);
  23462. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fromArray__ = __webpack_require__(81);
  23463. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__fromPromise__ = __webpack_require__(903);
  23464. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__fromIterable__ = __webpack_require__(901);
  23465. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__fromObservable__ = __webpack_require__(902);
  23466. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util_subscribeTo__ = __webpack_require__(416);
  23467. /** PURE_IMPORTS_START _Observable,_util_isPromise,_util_isArrayLike,_util_isInteropObservable,_util_isIterable,_fromArray,_fromPromise,_fromIterable,_fromObservable,_util_subscribeTo PURE_IMPORTS_END */
  23468. function from(input, scheduler) {
  23469. if (!scheduler) {
  23470. if (input instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */]) {
  23471. return input;
  23472. }
  23473. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__util_subscribeTo__["a" /* subscribeTo */])(input));
  23474. }
  23475. if (input != null) {
  23476. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isInteropObservable__["a" /* isInteropObservable */])(input)) {
  23477. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__fromObservable__["a" /* fromObservable */])(input, scheduler);
  23478. }
  23479. else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isPromise__["a" /* isPromise */])(input)) {
  23480. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__fromPromise__["a" /* fromPromise */])(input, scheduler);
  23481. }
  23482. else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArrayLike__["a" /* isArrayLike */])(input)) {
  23483. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__fromArray__["a" /* fromArray */])(input, scheduler);
  23484. }
  23485. else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isIterable__["a" /* isIterable */])(input) || typeof input === 'string') {
  23486. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__fromIterable__["a" /* fromIterable */])(input, scheduler);
  23487. }
  23488. }
  23489. throw new TypeError((input !== null && typeof input || input) + ' is not observable');
  23490. }
  23491. //# sourceMappingURL=from.js.map
  23492. /***/ }),
  23493. /* 65 */
  23494. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  23495. "use strict";
  23496. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  23497. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_operators_audit__ = __webpack_require__(398);
  23498. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_operators_audit__["a"]; });
  23499. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_operators_auditTime__ = __webpack_require__(911);
  23500. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_operators_auditTime__["a"]; });
  23501. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_operators_buffer__ = __webpack_require__(912);
  23502. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_operators_buffer__["a"]; });
  23503. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_operators_bufferCount__ = __webpack_require__(913);
  23504. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return __WEBPACK_IMPORTED_MODULE_3__internal_operators_bufferCount__["a"]; });
  23505. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_operators_bufferTime__ = __webpack_require__(914);
  23506. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_operators_bufferTime__["a"]; });
  23507. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_operators_bufferToggle__ = __webpack_require__(915);
  23508. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_operators_bufferToggle__["a"]; });
  23509. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_operators_bufferWhen__ = __webpack_require__(916);
  23510. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return __WEBPACK_IMPORTED_MODULE_6__internal_operators_bufferWhen__["a"]; });
  23511. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__internal_operators_catchError__ = __webpack_require__(917);
  23512. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return __WEBPACK_IMPORTED_MODULE_7__internal_operators_catchError__["a"]; });
  23513. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__internal_operators_combineAll__ = __webpack_require__(918);
  23514. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return __WEBPACK_IMPORTED_MODULE_8__internal_operators_combineAll__["a"]; });
  23515. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__internal_operators_combineLatest__ = __webpack_require__(919);
  23516. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return __WEBPACK_IMPORTED_MODULE_9__internal_operators_combineLatest__["a"]; });
  23517. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__internal_operators_concat__ = __webpack_require__(920);
  23518. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return __WEBPACK_IMPORTED_MODULE_10__internal_operators_concat__["a"]; });
  23519. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__internal_operators_concatAll__ = __webpack_require__(399);
  23520. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return __WEBPACK_IMPORTED_MODULE_11__internal_operators_concatAll__["a"]; });
  23521. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__internal_operators_concatMap__ = __webpack_require__(400);
  23522. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return __WEBPACK_IMPORTED_MODULE_12__internal_operators_concatMap__["a"]; });
  23523. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__internal_operators_concatMapTo__ = __webpack_require__(921);
  23524. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return __WEBPACK_IMPORTED_MODULE_13__internal_operators_concatMapTo__["a"]; });
  23525. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__internal_operators_count__ = __webpack_require__(922);
  23526. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "count", function() { return __WEBPACK_IMPORTED_MODULE_14__internal_operators_count__["a"]; });
  23527. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__internal_operators_debounce__ = __webpack_require__(923);
  23528. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_15__internal_operators_debounce__["a"]; });
  23529. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__internal_operators_debounceTime__ = __webpack_require__(924);
  23530. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return __WEBPACK_IMPORTED_MODULE_16__internal_operators_debounceTime__["a"]; });
  23531. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__internal_operators_defaultIfEmpty__ = __webpack_require__(135);
  23532. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return __WEBPACK_IMPORTED_MODULE_17__internal_operators_defaultIfEmpty__["a"]; });
  23533. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__internal_operators_delay__ = __webpack_require__(925);
  23534. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_18__internal_operators_delay__["a"]; });
  23535. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__internal_operators_delayWhen__ = __webpack_require__(926);
  23536. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return __WEBPACK_IMPORTED_MODULE_19__internal_operators_delayWhen__["a"]; });
  23537. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__internal_operators_dematerialize__ = __webpack_require__(927);
  23538. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return __WEBPACK_IMPORTED_MODULE_20__internal_operators_dematerialize__["a"]; });
  23539. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__internal_operators_distinct__ = __webpack_require__(928);
  23540. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return __WEBPACK_IMPORTED_MODULE_21__internal_operators_distinct__["a"]; });
  23541. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__internal_operators_distinctUntilChanged__ = __webpack_require__(401);
  23542. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return __WEBPACK_IMPORTED_MODULE_22__internal_operators_distinctUntilChanged__["a"]; });
  23543. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__internal_operators_distinctUntilKeyChanged__ = __webpack_require__(929);
  23544. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return __WEBPACK_IMPORTED_MODULE_23__internal_operators_distinctUntilKeyChanged__["a"]; });
  23545. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__internal_operators_elementAt__ = __webpack_require__(930);
  23546. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return __WEBPACK_IMPORTED_MODULE_24__internal_operators_elementAt__["a"]; });
  23547. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__internal_operators_endWith__ = __webpack_require__(931);
  23548. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return __WEBPACK_IMPORTED_MODULE_25__internal_operators_endWith__["a"]; });
  23549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__internal_operators_every__ = __webpack_require__(932);
  23550. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_26__internal_operators_every__["a"]; });
  23551. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__internal_operators_exhaust__ = __webpack_require__(933);
  23552. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return __WEBPACK_IMPORTED_MODULE_27__internal_operators_exhaust__["a"]; });
  23553. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__internal_operators_exhaustMap__ = __webpack_require__(934);
  23554. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return __WEBPACK_IMPORTED_MODULE_28__internal_operators_exhaustMap__["a"]; });
  23555. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__internal_operators_expand__ = __webpack_require__(935);
  23556. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return __WEBPACK_IMPORTED_MODULE_29__internal_operators_expand__["a"]; });
  23557. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__internal_operators_filter__ = __webpack_require__(136);
  23558. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_30__internal_operators_filter__["a"]; });
  23559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__internal_operators_finalize__ = __webpack_require__(936);
  23560. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_operators_finalize__["a"]; });
  23561. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__internal_operators_find__ = __webpack_require__(402);
  23562. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_32__internal_operators_find__["a"]; });
  23563. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__internal_operators_findIndex__ = __webpack_require__(937);
  23564. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_33__internal_operators_findIndex__["a"]; });
  23565. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__internal_operators_first__ = __webpack_require__(938);
  23566. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_34__internal_operators_first__["a"]; });
  23567. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__internal_operators_groupBy__ = __webpack_require__(403);
  23568. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_35__internal_operators_groupBy__["b"]; });
  23569. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__internal_operators_ignoreElements__ = __webpack_require__(939);
  23570. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return __WEBPACK_IMPORTED_MODULE_36__internal_operators_ignoreElements__["a"]; });
  23571. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__internal_operators_isEmpty__ = __webpack_require__(940);
  23572. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_37__internal_operators_isEmpty__["a"]; });
  23573. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__internal_operators_last__ = __webpack_require__(941);
  23574. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_38__internal_operators_last__["a"]; });
  23575. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__internal_operators_map__ = __webpack_require__(54);
  23576. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_39__internal_operators_map__["a"]; });
  23577. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__internal_operators_mapTo__ = __webpack_require__(942);
  23578. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_operators_mapTo__["a"]; });
  23579. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__internal_operators_materialize__ = __webpack_require__(943);
  23580. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return __WEBPACK_IMPORTED_MODULE_41__internal_operators_materialize__["a"]; });
  23581. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__internal_operators_max__ = __webpack_require__(944);
  23582. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_42__internal_operators_max__["a"]; });
  23583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__internal_operators_merge__ = __webpack_require__(945);
  23584. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return __WEBPACK_IMPORTED_MODULE_43__internal_operators_merge__["a"]; });
  23585. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__internal_operators_mergeAll__ = __webpack_require__(256);
  23586. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return __WEBPACK_IMPORTED_MODULE_44__internal_operators_mergeAll__["a"]; });
  23587. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__internal_operators_mergeMap__ = __webpack_require__(137);
  23588. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return __WEBPACK_IMPORTED_MODULE_45__internal_operators_mergeMap__["a"]; });
  23589. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return __WEBPACK_IMPORTED_MODULE_45__internal_operators_mergeMap__["a"]; });
  23590. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__internal_operators_mergeMapTo__ = __webpack_require__(946);
  23591. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return __WEBPACK_IMPORTED_MODULE_46__internal_operators_mergeMapTo__["a"]; });
  23592. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__internal_operators_mergeScan__ = __webpack_require__(947);
  23593. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return __WEBPACK_IMPORTED_MODULE_47__internal_operators_mergeScan__["a"]; });
  23594. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__internal_operators_min__ = __webpack_require__(948);
  23595. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_48__internal_operators_min__["a"]; });
  23596. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__internal_operators_multicast__ = __webpack_require__(111);
  23597. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return __WEBPACK_IMPORTED_MODULE_49__internal_operators_multicast__["a"]; });
  23598. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__internal_operators_observeOn__ = __webpack_require__(404);
  23599. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return __WEBPACK_IMPORTED_MODULE_50__internal_operators_observeOn__["b"]; });
  23600. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__internal_operators_onErrorResumeNext__ = __webpack_require__(949);
  23601. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return __WEBPACK_IMPORTED_MODULE_51__internal_operators_onErrorResumeNext__["a"]; });
  23602. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__internal_operators_pairwise__ = __webpack_require__(950);
  23603. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return __WEBPACK_IMPORTED_MODULE_52__internal_operators_pairwise__["a"]; });
  23604. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__internal_operators_partition__ = __webpack_require__(951);
  23605. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_53__internal_operators_partition__["a"]; });
  23606. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__internal_operators_pluck__ = __webpack_require__(952);
  23607. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_54__internal_operators_pluck__["a"]; });
  23608. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__internal_operators_publish__ = __webpack_require__(953);
  23609. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return __WEBPACK_IMPORTED_MODULE_55__internal_operators_publish__["a"]; });
  23610. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__internal_operators_publishBehavior__ = __webpack_require__(954);
  23611. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return __WEBPACK_IMPORTED_MODULE_56__internal_operators_publishBehavior__["a"]; });
  23612. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__internal_operators_publishLast__ = __webpack_require__(955);
  23613. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return __WEBPACK_IMPORTED_MODULE_57__internal_operators_publishLast__["a"]; });
  23614. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__internal_operators_publishReplay__ = __webpack_require__(956);
  23615. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return __WEBPACK_IMPORTED_MODULE_58__internal_operators_publishReplay__["a"]; });
  23616. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__internal_operators_race__ = __webpack_require__(957);
  23617. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return __WEBPACK_IMPORTED_MODULE_59__internal_operators_race__["a"]; });
  23618. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__internal_operators_reduce__ = __webpack_require__(178);
  23619. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_60__internal_operators_reduce__["a"]; });
  23620. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__internal_operators_repeat__ = __webpack_require__(958);
  23621. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return __WEBPACK_IMPORTED_MODULE_61__internal_operators_repeat__["a"]; });
  23622. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__internal_operators_repeatWhen__ = __webpack_require__(959);
  23623. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return __WEBPACK_IMPORTED_MODULE_62__internal_operators_repeatWhen__["a"]; });
  23624. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__internal_operators_retry__ = __webpack_require__(960);
  23625. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return __WEBPACK_IMPORTED_MODULE_63__internal_operators_retry__["a"]; });
  23626. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__internal_operators_retryWhen__ = __webpack_require__(961);
  23627. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return __WEBPACK_IMPORTED_MODULE_64__internal_operators_retryWhen__["a"]; });
  23628. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__internal_operators_refCount__ = __webpack_require__(257);
  23629. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return __WEBPACK_IMPORTED_MODULE_65__internal_operators_refCount__["a"]; });
  23630. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__internal_operators_sample__ = __webpack_require__(962);
  23631. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_66__internal_operators_sample__["a"]; });
  23632. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__internal_operators_sampleTime__ = __webpack_require__(963);
  23633. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return __WEBPACK_IMPORTED_MODULE_67__internal_operators_sampleTime__["a"]; });
  23634. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__internal_operators_scan__ = __webpack_require__(258);
  23635. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return __WEBPACK_IMPORTED_MODULE_68__internal_operators_scan__["a"]; });
  23636. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__internal_operators_sequenceEqual__ = __webpack_require__(964);
  23637. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return __WEBPACK_IMPORTED_MODULE_69__internal_operators_sequenceEqual__["a"]; });
  23638. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__internal_operators_share__ = __webpack_require__(965);
  23639. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "share", function() { return __WEBPACK_IMPORTED_MODULE_70__internal_operators_share__["a"]; });
  23640. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__internal_operators_shareReplay__ = __webpack_require__(966);
  23641. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return __WEBPACK_IMPORTED_MODULE_71__internal_operators_shareReplay__["a"]; });
  23642. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__internal_operators_single__ = __webpack_require__(967);
  23643. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "single", function() { return __WEBPACK_IMPORTED_MODULE_72__internal_operators_single__["a"]; });
  23644. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__internal_operators_skip__ = __webpack_require__(968);
  23645. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return __WEBPACK_IMPORTED_MODULE_73__internal_operators_skip__["a"]; });
  23646. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__internal_operators_skipLast__ = __webpack_require__(969);
  23647. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return __WEBPACK_IMPORTED_MODULE_74__internal_operators_skipLast__["a"]; });
  23648. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__internal_operators_skipUntil__ = __webpack_require__(970);
  23649. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return __WEBPACK_IMPORTED_MODULE_75__internal_operators_skipUntil__["a"]; });
  23650. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__internal_operators_skipWhile__ = __webpack_require__(971);
  23651. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return __WEBPACK_IMPORTED_MODULE_76__internal_operators_skipWhile__["a"]; });
  23652. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__internal_operators_startWith__ = __webpack_require__(972);
  23653. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return __WEBPACK_IMPORTED_MODULE_77__internal_operators_startWith__["a"]; });
  23654. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__internal_operators_subscribeOn__ = __webpack_require__(973);
  23655. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return __WEBPACK_IMPORTED_MODULE_78__internal_operators_subscribeOn__["a"]; });
  23656. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__internal_operators_switchAll__ = __webpack_require__(974);
  23657. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return __WEBPACK_IMPORTED_MODULE_79__internal_operators_switchAll__["a"]; });
  23658. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__internal_operators_switchMap__ = __webpack_require__(259);
  23659. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return __WEBPACK_IMPORTED_MODULE_80__internal_operators_switchMap__["a"]; });
  23660. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__internal_operators_switchMapTo__ = __webpack_require__(975);
  23661. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return __WEBPACK_IMPORTED_MODULE_81__internal_operators_switchMapTo__["a"]; });
  23662. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__internal_operators_take__ = __webpack_require__(260);
  23663. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_82__internal_operators_take__["a"]; });
  23664. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__internal_operators_takeLast__ = __webpack_require__(261);
  23665. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return __WEBPACK_IMPORTED_MODULE_83__internal_operators_takeLast__["a"]; });
  23666. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__internal_operators_takeUntil__ = __webpack_require__(976);
  23667. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return __WEBPACK_IMPORTED_MODULE_84__internal_operators_takeUntil__["a"]; });
  23668. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__internal_operators_takeWhile__ = __webpack_require__(977);
  23669. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return __WEBPACK_IMPORTED_MODULE_85__internal_operators_takeWhile__["a"]; });
  23670. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__internal_operators_tap__ = __webpack_require__(405);
  23671. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_86__internal_operators_tap__["a"]; });
  23672. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__internal_operators_throttle__ = __webpack_require__(406);
  23673. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_87__internal_operators_throttle__["a"]; });
  23674. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__internal_operators_throttleTime__ = __webpack_require__(978);
  23675. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return __WEBPACK_IMPORTED_MODULE_88__internal_operators_throttleTime__["a"]; });
  23676. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__internal_operators_throwIfEmpty__ = __webpack_require__(179);
  23677. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return __WEBPACK_IMPORTED_MODULE_89__internal_operators_throwIfEmpty__["a"]; });
  23678. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__internal_operators_timeInterval__ = __webpack_require__(979);
  23679. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return __WEBPACK_IMPORTED_MODULE_90__internal_operators_timeInterval__["a"]; });
  23680. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__internal_operators_timeout__ = __webpack_require__(980);
  23681. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return __WEBPACK_IMPORTED_MODULE_91__internal_operators_timeout__["a"]; });
  23682. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__internal_operators_timeoutWith__ = __webpack_require__(407);
  23683. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return __WEBPACK_IMPORTED_MODULE_92__internal_operators_timeoutWith__["a"]; });
  23684. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__internal_operators_timestamp__ = __webpack_require__(981);
  23685. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return __WEBPACK_IMPORTED_MODULE_93__internal_operators_timestamp__["a"]; });
  23686. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__internal_operators_toArray__ = __webpack_require__(982);
  23687. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_94__internal_operators_toArray__["a"]; });
  23688. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__internal_operators_window__ = __webpack_require__(983);
  23689. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "window", function() { return __WEBPACK_IMPORTED_MODULE_95__internal_operators_window__["a"]; });
  23690. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__internal_operators_windowCount__ = __webpack_require__(984);
  23691. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return __WEBPACK_IMPORTED_MODULE_96__internal_operators_windowCount__["a"]; });
  23692. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__internal_operators_windowTime__ = __webpack_require__(985);
  23693. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return __WEBPACK_IMPORTED_MODULE_97__internal_operators_windowTime__["a"]; });
  23694. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__internal_operators_windowToggle__ = __webpack_require__(986);
  23695. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return __WEBPACK_IMPORTED_MODULE_98__internal_operators_windowToggle__["a"]; });
  23696. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__internal_operators_windowWhen__ = __webpack_require__(987);
  23697. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return __WEBPACK_IMPORTED_MODULE_99__internal_operators_windowWhen__["a"]; });
  23698. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__internal_operators_withLatestFrom__ = __webpack_require__(988);
  23699. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return __WEBPACK_IMPORTED_MODULE_100__internal_operators_withLatestFrom__["a"]; });
  23700. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__internal_operators_zip__ = __webpack_require__(989);
  23701. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_101__internal_operators_zip__["a"]; });
  23702. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__internal_operators_zipAll__ = __webpack_require__(990);
  23703. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return __WEBPACK_IMPORTED_MODULE_102__internal_operators_zipAll__["a"]; });
  23704. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  23705. //# sourceMappingURL=index.js.map
  23706. /***/ }),
  23707. /* 66 */
  23708. /***/ (function(module, exports) {
  23709. module.exports = require("os");
  23710. /***/ }),
  23711. /* 67 */
  23712. /***/ (function(module, exports, __webpack_require__) {
  23713. // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
  23714. // If you have no idea what ASN.1 or BER is, see this:
  23715. // ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
  23716. var Ber = __webpack_require__(455);
  23717. // --- Exported API
  23718. module.exports = {
  23719. Ber: Ber,
  23720. BerReader: Ber.Reader,
  23721. BerWriter: Ber.Writer
  23722. };
  23723. /***/ }),
  23724. /* 68 */
  23725. /***/ (function(module, exports, __webpack_require__) {
  23726. // optional / simple context binding
  23727. var aFunction = __webpack_require__(88);
  23728. module.exports = function (fn, that, length) {
  23729. aFunction(fn);
  23730. if (that === undefined) return fn;
  23731. switch (length) {
  23732. case 1: return function (a) {
  23733. return fn.call(that, a);
  23734. };
  23735. case 2: return function (a, b) {
  23736. return fn.call(that, a, b);
  23737. };
  23738. case 3: return function (a, b, c) {
  23739. return fn.call(that, a, b, c);
  23740. };
  23741. }
  23742. return function (/* ...args */) {
  23743. return fn.apply(that, arguments);
  23744. };
  23745. };
  23746. /***/ }),
  23747. /* 69 */
  23748. /***/ (function(module, exports, __webpack_require__) {
  23749. // Thank's IE8 for his funny defineProperty
  23750. module.exports = !__webpack_require__(76)(function () {
  23751. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  23752. });
  23753. /***/ }),
  23754. /* 70 */
  23755. /***/ (function(module, exports, __webpack_require__) {
  23756. // Copyright 2015 Joyent, Inc.
  23757. var assert = __webpack_require__(22);
  23758. var util = __webpack_require__(9);
  23759. function FingerprintFormatError(fp, format) {
  23760. if (Error.captureStackTrace)
  23761. Error.captureStackTrace(this, FingerprintFormatError);
  23762. this.name = 'FingerprintFormatError';
  23763. this.fingerprint = fp;
  23764. this.format = format;
  23765. this.message = 'Fingerprint format is not supported, or is invalid: ';
  23766. if (fp !== undefined)
  23767. this.message += ' fingerprint = ' + fp;
  23768. if (format !== undefined)
  23769. this.message += ' format = ' + format;
  23770. }
  23771. util.inherits(FingerprintFormatError, Error);
  23772. function InvalidAlgorithmError(alg) {
  23773. if (Error.captureStackTrace)
  23774. Error.captureStackTrace(this, InvalidAlgorithmError);
  23775. this.name = 'InvalidAlgorithmError';
  23776. this.algorithm = alg;
  23777. this.message = 'Algorithm "' + alg + '" is not supported';
  23778. }
  23779. util.inherits(InvalidAlgorithmError, Error);
  23780. function KeyParseError(name, format, innerErr) {
  23781. if (Error.captureStackTrace)
  23782. Error.captureStackTrace(this, KeyParseError);
  23783. this.name = 'KeyParseError';
  23784. this.format = format;
  23785. this.keyName = name;
  23786. this.innerErr = innerErr;
  23787. this.message = 'Failed to parse ' + name + ' as a valid ' + format +
  23788. ' format key: ' + innerErr.message;
  23789. }
  23790. util.inherits(KeyParseError, Error);
  23791. function SignatureParseError(type, format, innerErr) {
  23792. if (Error.captureStackTrace)
  23793. Error.captureStackTrace(this, SignatureParseError);
  23794. this.name = 'SignatureParseError';
  23795. this.type = type;
  23796. this.format = format;
  23797. this.innerErr = innerErr;
  23798. this.message = 'Failed to parse the given data as a ' + type +
  23799. ' signature in ' + format + ' format: ' + innerErr.message;
  23800. }
  23801. util.inherits(SignatureParseError, Error);
  23802. function CertificateParseError(name, format, innerErr) {
  23803. if (Error.captureStackTrace)
  23804. Error.captureStackTrace(this, CertificateParseError);
  23805. this.name = 'CertificateParseError';
  23806. this.format = format;
  23807. this.certName = name;
  23808. this.innerErr = innerErr;
  23809. this.message = 'Failed to parse ' + name + ' as a valid ' + format +
  23810. ' format certificate: ' + innerErr.message;
  23811. }
  23812. util.inherits(CertificateParseError, Error);
  23813. function KeyEncryptedError(name, format) {
  23814. if (Error.captureStackTrace)
  23815. Error.captureStackTrace(this, KeyEncryptedError);
  23816. this.name = 'KeyEncryptedError';
  23817. this.format = format;
  23818. this.keyName = name;
  23819. this.message = 'The ' + format + ' format key ' + name + ' is ' +
  23820. 'encrypted (password-protected), and no passphrase was ' +
  23821. 'provided in `options`';
  23822. }
  23823. util.inherits(KeyEncryptedError, Error);
  23824. module.exports = {
  23825. FingerprintFormatError: FingerprintFormatError,
  23826. InvalidAlgorithmError: InvalidAlgorithmError,
  23827. KeyParseError: KeyParseError,
  23828. SignatureParseError: SignatureParseError,
  23829. KeyEncryptedError: KeyEncryptedError,
  23830. CertificateParseError: CertificateParseError
  23831. };
  23832. /***/ }),
  23833. /* 71 */
  23834. /***/ (function(module, exports, __webpack_require__) {
  23835. // Copyright 2015 Joyent, Inc.
  23836. module.exports = Signature;
  23837. var assert = __webpack_require__(22);
  23838. var Buffer = __webpack_require__(20).Buffer;
  23839. var algs = __webpack_require__(39);
  23840. var crypto = __webpack_require__(21);
  23841. var errs = __webpack_require__(70);
  23842. var utils = __webpack_require__(32);
  23843. var asn1 = __webpack_require__(67);
  23844. var SSHBuffer = __webpack_require__(148);
  23845. var InvalidAlgorithmError = errs.InvalidAlgorithmError;
  23846. var SignatureParseError = errs.SignatureParseError;
  23847. function Signature(opts) {
  23848. assert.object(opts, 'options');
  23849. assert.arrayOfObject(opts.parts, 'options.parts');
  23850. assert.string(opts.type, 'options.type');
  23851. var partLookup = {};
  23852. for (var i = 0; i < opts.parts.length; ++i) {
  23853. var part = opts.parts[i];
  23854. partLookup[part.name] = part;
  23855. }
  23856. this.type = opts.type;
  23857. this.hashAlgorithm = opts.hashAlgo;
  23858. this.curve = opts.curve;
  23859. this.parts = opts.parts;
  23860. this.part = partLookup;
  23861. }
  23862. Signature.prototype.toBuffer = function (format) {
  23863. if (format === undefined)
  23864. format = 'asn1';
  23865. assert.string(format, 'format');
  23866. var buf;
  23867. var stype = 'ssh-' + this.type;
  23868. switch (this.type) {
  23869. case 'rsa':
  23870. switch (this.hashAlgorithm) {
  23871. case 'sha256':
  23872. stype = 'rsa-sha2-256';
  23873. break;
  23874. case 'sha512':
  23875. stype = 'rsa-sha2-512';
  23876. break;
  23877. case 'sha1':
  23878. case undefined:
  23879. break;
  23880. default:
  23881. throw (new Error('SSH signature ' +
  23882. 'format does not support hash ' +
  23883. 'algorithm ' + this.hashAlgorithm));
  23884. }
  23885. if (format === 'ssh') {
  23886. buf = new SSHBuffer({});
  23887. buf.writeString(stype);
  23888. buf.writePart(this.part.sig);
  23889. return (buf.toBuffer());
  23890. } else {
  23891. return (this.part.sig.data);
  23892. }
  23893. break;
  23894. case 'ed25519':
  23895. if (format === 'ssh') {
  23896. buf = new SSHBuffer({});
  23897. buf.writeString(stype);
  23898. buf.writePart(this.part.sig);
  23899. return (buf.toBuffer());
  23900. } else {
  23901. return (this.part.sig.data);
  23902. }
  23903. break;
  23904. case 'dsa':
  23905. case 'ecdsa':
  23906. var r, s;
  23907. if (format === 'asn1') {
  23908. var der = new asn1.BerWriter();
  23909. der.startSequence();
  23910. r = utils.mpNormalize(this.part.r.data);
  23911. s = utils.mpNormalize(this.part.s.data);
  23912. der.writeBuffer(r, asn1.Ber.Integer);
  23913. der.writeBuffer(s, asn1.Ber.Integer);
  23914. der.endSequence();
  23915. return (der.buffer);
  23916. } else if (format === 'ssh' && this.type === 'dsa') {
  23917. buf = new SSHBuffer({});
  23918. buf.writeString('ssh-dss');
  23919. r = this.part.r.data;
  23920. if (r.length > 20 && r[0] === 0x00)
  23921. r = r.slice(1);
  23922. s = this.part.s.data;
  23923. if (s.length > 20 && s[0] === 0x00)
  23924. s = s.slice(1);
  23925. if ((this.hashAlgorithm &&
  23926. this.hashAlgorithm !== 'sha1') ||
  23927. r.length + s.length !== 40) {
  23928. throw (new Error('OpenSSH only supports ' +
  23929. 'DSA signatures with SHA1 hash'));
  23930. }
  23931. buf.writeBuffer(Buffer.concat([r, s]));
  23932. return (buf.toBuffer());
  23933. } else if (format === 'ssh' && this.type === 'ecdsa') {
  23934. var inner = new SSHBuffer({});
  23935. r = this.part.r.data;
  23936. inner.writeBuffer(r);
  23937. inner.writePart(this.part.s);
  23938. buf = new SSHBuffer({});
  23939. /* XXX: find a more proper way to do this? */
  23940. var curve;
  23941. if (r[0] === 0x00)
  23942. r = r.slice(1);
  23943. var sz = r.length * 8;
  23944. if (sz === 256)
  23945. curve = 'nistp256';
  23946. else if (sz === 384)
  23947. curve = 'nistp384';
  23948. else if (sz === 528)
  23949. curve = 'nistp521';
  23950. buf.writeString('ecdsa-sha2-' + curve);
  23951. buf.writeBuffer(inner.toBuffer());
  23952. return (buf.toBuffer());
  23953. }
  23954. throw (new Error('Invalid signature format'));
  23955. default:
  23956. throw (new Error('Invalid signature data'));
  23957. }
  23958. };
  23959. Signature.prototype.toString = function (format) {
  23960. assert.optionalString(format, 'format');
  23961. return (this.toBuffer(format).toString('base64'));
  23962. };
  23963. Signature.parse = function (data, type, format) {
  23964. if (typeof (data) === 'string')
  23965. data = Buffer.from(data, 'base64');
  23966. assert.buffer(data, 'data');
  23967. assert.string(format, 'format');
  23968. assert.string(type, 'type');
  23969. var opts = {};
  23970. opts.type = type.toLowerCase();
  23971. opts.parts = [];
  23972. try {
  23973. assert.ok(data.length > 0, 'signature must not be empty');
  23974. switch (opts.type) {
  23975. case 'rsa':
  23976. return (parseOneNum(data, type, format, opts));
  23977. case 'ed25519':
  23978. return (parseOneNum(data, type, format, opts));
  23979. case 'dsa':
  23980. case 'ecdsa':
  23981. if (format === 'asn1')
  23982. return (parseDSAasn1(data, type, format, opts));
  23983. else if (opts.type === 'dsa')
  23984. return (parseDSA(data, type, format, opts));
  23985. else
  23986. return (parseECDSA(data, type, format, opts));
  23987. default:
  23988. throw (new InvalidAlgorithmError(type));
  23989. }
  23990. } catch (e) {
  23991. if (e instanceof InvalidAlgorithmError)
  23992. throw (e);
  23993. throw (new SignatureParseError(type, format, e));
  23994. }
  23995. };
  23996. function parseOneNum(data, type, format, opts) {
  23997. if (format === 'ssh') {
  23998. try {
  23999. var buf = new SSHBuffer({buffer: data});
  24000. var head = buf.readString();
  24001. } catch (e) {
  24002. /* fall through */
  24003. }
  24004. if (buf !== undefined) {
  24005. var msg = 'SSH signature does not match expected ' +
  24006. 'type (expected ' + type + ', got ' + head + ')';
  24007. switch (head) {
  24008. case 'ssh-rsa':
  24009. assert.strictEqual(type, 'rsa', msg);
  24010. opts.hashAlgo = 'sha1';
  24011. break;
  24012. case 'rsa-sha2-256':
  24013. assert.strictEqual(type, 'rsa', msg);
  24014. opts.hashAlgo = 'sha256';
  24015. break;
  24016. case 'rsa-sha2-512':
  24017. assert.strictEqual(type, 'rsa', msg);
  24018. opts.hashAlgo = 'sha512';
  24019. break;
  24020. case 'ssh-ed25519':
  24021. assert.strictEqual(type, 'ed25519', msg);
  24022. opts.hashAlgo = 'sha512';
  24023. break;
  24024. default:
  24025. throw (new Error('Unknown SSH signature ' +
  24026. 'type: ' + head));
  24027. }
  24028. var sig = buf.readPart();
  24029. assert.ok(buf.atEnd(), 'extra trailing bytes');
  24030. sig.name = 'sig';
  24031. opts.parts.push(sig);
  24032. return (new Signature(opts));
  24033. }
  24034. }
  24035. opts.parts.push({name: 'sig', data: data});
  24036. return (new Signature(opts));
  24037. }
  24038. function parseDSAasn1(data, type, format, opts) {
  24039. var der = new asn1.BerReader(data);
  24040. der.readSequence();
  24041. var r = der.readString(asn1.Ber.Integer, true);
  24042. var s = der.readString(asn1.Ber.Integer, true);
  24043. opts.parts.push({name: 'r', data: utils.mpNormalize(r)});
  24044. opts.parts.push({name: 's', data: utils.mpNormalize(s)});
  24045. return (new Signature(opts));
  24046. }
  24047. function parseDSA(data, type, format, opts) {
  24048. if (data.length != 40) {
  24049. var buf = new SSHBuffer({buffer: data});
  24050. var d = buf.readBuffer();
  24051. if (d.toString('ascii') === 'ssh-dss')
  24052. d = buf.readBuffer();
  24053. assert.ok(buf.atEnd(), 'extra trailing bytes');
  24054. assert.strictEqual(d.length, 40, 'invalid inner length');
  24055. data = d;
  24056. }
  24057. opts.parts.push({name: 'r', data: data.slice(0, 20)});
  24058. opts.parts.push({name: 's', data: data.slice(20, 40)});
  24059. return (new Signature(opts));
  24060. }
  24061. function parseECDSA(data, type, format, opts) {
  24062. var buf = new SSHBuffer({buffer: data});
  24063. var r, s;
  24064. var inner = buf.readBuffer();
  24065. var stype = inner.toString('ascii');
  24066. if (stype.slice(0, 6) === 'ecdsa-') {
  24067. var parts = stype.split('-');
  24068. assert.strictEqual(parts[0], 'ecdsa');
  24069. assert.strictEqual(parts[1], 'sha2');
  24070. opts.curve = parts[2];
  24071. switch (opts.curve) {
  24072. case 'nistp256':
  24073. opts.hashAlgo = 'sha256';
  24074. break;
  24075. case 'nistp384':
  24076. opts.hashAlgo = 'sha384';
  24077. break;
  24078. case 'nistp521':
  24079. opts.hashAlgo = 'sha512';
  24080. break;
  24081. default:
  24082. throw (new Error('Unsupported ECDSA curve: ' +
  24083. opts.curve));
  24084. }
  24085. inner = buf.readBuffer();
  24086. assert.ok(buf.atEnd(), 'extra trailing bytes on outer');
  24087. buf = new SSHBuffer({buffer: inner});
  24088. r = buf.readPart();
  24089. } else {
  24090. r = {data: inner};
  24091. }
  24092. s = buf.readPart();
  24093. assert.ok(buf.atEnd(), 'extra trailing bytes');
  24094. r.name = 'r';
  24095. s.name = 's';
  24096. opts.parts.push(r);
  24097. opts.parts.push(s);
  24098. return (new Signature(opts));
  24099. }
  24100. Signature.isSignature = function (obj, ver) {
  24101. return (utils.isCompatible(obj, Signature, ver));
  24102. };
  24103. /*
  24104. * API versions for Signature:
  24105. * [1,0] -- initial ver
  24106. * [2,0] -- support for rsa in full ssh format, compat with sshpk-agent
  24107. * hashAlgorithm property
  24108. * [2,1] -- first tagged version
  24109. */
  24110. Signature.prototype._sshpkApiVersion = [2, 1];
  24111. Signature._oldVersionDetect = function (obj) {
  24112. assert.func(obj.toBuffer);
  24113. if (obj.hasOwnProperty('hashAlgorithm'))
  24114. return ([2, 0]);
  24115. return ([1, 0]);
  24116. };
  24117. /***/ }),
  24118. /* 72 */
  24119. /***/ (function(module, exports, __webpack_require__) {
  24120. (function(nacl) {
  24121. 'use strict';
  24122. // Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.
  24123. // Public domain.
  24124. //
  24125. // Implementation derived from TweetNaCl version 20140427.
  24126. // See for details: http://tweetnacl.cr.yp.to/
  24127. var gf = function(init) {
  24128. var i, r = new Float64Array(16);
  24129. if (init) for (i = 0; i < init.length; i++) r[i] = init[i];
  24130. return r;
  24131. };
  24132. // Pluggable, initialized in high-level API below.
  24133. var randombytes = function(/* x, n */) { throw new Error('no PRNG'); };
  24134. var _0 = new Uint8Array(16);
  24135. var _9 = new Uint8Array(32); _9[0] = 9;
  24136. var gf0 = gf(),
  24137. gf1 = gf([1]),
  24138. _121665 = gf([0xdb41, 1]),
  24139. D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),
  24140. D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),
  24141. X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),
  24142. Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),
  24143. I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);
  24144. function ts64(x, i, h, l) {
  24145. x[i] = (h >> 24) & 0xff;
  24146. x[i+1] = (h >> 16) & 0xff;
  24147. x[i+2] = (h >> 8) & 0xff;
  24148. x[i+3] = h & 0xff;
  24149. x[i+4] = (l >> 24) & 0xff;
  24150. x[i+5] = (l >> 16) & 0xff;
  24151. x[i+6] = (l >> 8) & 0xff;
  24152. x[i+7] = l & 0xff;
  24153. }
  24154. function vn(x, xi, y, yi, n) {
  24155. var i,d = 0;
  24156. for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];
  24157. return (1 & ((d - 1) >>> 8)) - 1;
  24158. }
  24159. function crypto_verify_16(x, xi, y, yi) {
  24160. return vn(x,xi,y,yi,16);
  24161. }
  24162. function crypto_verify_32(x, xi, y, yi) {
  24163. return vn(x,xi,y,yi,32);
  24164. }
  24165. function core_salsa20(o, p, k, c) {
  24166. var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,
  24167. j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,
  24168. j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,
  24169. j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,
  24170. j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,
  24171. j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,
  24172. j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,
  24173. j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,
  24174. j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,
  24175. j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,
  24176. j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,
  24177. j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,
  24178. j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,
  24179. j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,
  24180. j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,
  24181. j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;
  24182. var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,
  24183. x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,
  24184. x15 = j15, u;
  24185. for (var i = 0; i < 20; i += 2) {
  24186. u = x0 + x12 | 0;
  24187. x4 ^= u<<7 | u>>>(32-7);
  24188. u = x4 + x0 | 0;
  24189. x8 ^= u<<9 | u>>>(32-9);
  24190. u = x8 + x4 | 0;
  24191. x12 ^= u<<13 | u>>>(32-13);
  24192. u = x12 + x8 | 0;
  24193. x0 ^= u<<18 | u>>>(32-18);
  24194. u = x5 + x1 | 0;
  24195. x9 ^= u<<7 | u>>>(32-7);
  24196. u = x9 + x5 | 0;
  24197. x13 ^= u<<9 | u>>>(32-9);
  24198. u = x13 + x9 | 0;
  24199. x1 ^= u<<13 | u>>>(32-13);
  24200. u = x1 + x13 | 0;
  24201. x5 ^= u<<18 | u>>>(32-18);
  24202. u = x10 + x6 | 0;
  24203. x14 ^= u<<7 | u>>>(32-7);
  24204. u = x14 + x10 | 0;
  24205. x2 ^= u<<9 | u>>>(32-9);
  24206. u = x2 + x14 | 0;
  24207. x6 ^= u<<13 | u>>>(32-13);
  24208. u = x6 + x2 | 0;
  24209. x10 ^= u<<18 | u>>>(32-18);
  24210. u = x15 + x11 | 0;
  24211. x3 ^= u<<7 | u>>>(32-7);
  24212. u = x3 + x15 | 0;
  24213. x7 ^= u<<9 | u>>>(32-9);
  24214. u = x7 + x3 | 0;
  24215. x11 ^= u<<13 | u>>>(32-13);
  24216. u = x11 + x7 | 0;
  24217. x15 ^= u<<18 | u>>>(32-18);
  24218. u = x0 + x3 | 0;
  24219. x1 ^= u<<7 | u>>>(32-7);
  24220. u = x1 + x0 | 0;
  24221. x2 ^= u<<9 | u>>>(32-9);
  24222. u = x2 + x1 | 0;
  24223. x3 ^= u<<13 | u>>>(32-13);
  24224. u = x3 + x2 | 0;
  24225. x0 ^= u<<18 | u>>>(32-18);
  24226. u = x5 + x4 | 0;
  24227. x6 ^= u<<7 | u>>>(32-7);
  24228. u = x6 + x5 | 0;
  24229. x7 ^= u<<9 | u>>>(32-9);
  24230. u = x7 + x6 | 0;
  24231. x4 ^= u<<13 | u>>>(32-13);
  24232. u = x4 + x7 | 0;
  24233. x5 ^= u<<18 | u>>>(32-18);
  24234. u = x10 + x9 | 0;
  24235. x11 ^= u<<7 | u>>>(32-7);
  24236. u = x11 + x10 | 0;
  24237. x8 ^= u<<9 | u>>>(32-9);
  24238. u = x8 + x11 | 0;
  24239. x9 ^= u<<13 | u>>>(32-13);
  24240. u = x9 + x8 | 0;
  24241. x10 ^= u<<18 | u>>>(32-18);
  24242. u = x15 + x14 | 0;
  24243. x12 ^= u<<7 | u>>>(32-7);
  24244. u = x12 + x15 | 0;
  24245. x13 ^= u<<9 | u>>>(32-9);
  24246. u = x13 + x12 | 0;
  24247. x14 ^= u<<13 | u>>>(32-13);
  24248. u = x14 + x13 | 0;
  24249. x15 ^= u<<18 | u>>>(32-18);
  24250. }
  24251. x0 = x0 + j0 | 0;
  24252. x1 = x1 + j1 | 0;
  24253. x2 = x2 + j2 | 0;
  24254. x3 = x3 + j3 | 0;
  24255. x4 = x4 + j4 | 0;
  24256. x5 = x5 + j5 | 0;
  24257. x6 = x6 + j6 | 0;
  24258. x7 = x7 + j7 | 0;
  24259. x8 = x8 + j8 | 0;
  24260. x9 = x9 + j9 | 0;
  24261. x10 = x10 + j10 | 0;
  24262. x11 = x11 + j11 | 0;
  24263. x12 = x12 + j12 | 0;
  24264. x13 = x13 + j13 | 0;
  24265. x14 = x14 + j14 | 0;
  24266. x15 = x15 + j15 | 0;
  24267. o[ 0] = x0 >>> 0 & 0xff;
  24268. o[ 1] = x0 >>> 8 & 0xff;
  24269. o[ 2] = x0 >>> 16 & 0xff;
  24270. o[ 3] = x0 >>> 24 & 0xff;
  24271. o[ 4] = x1 >>> 0 & 0xff;
  24272. o[ 5] = x1 >>> 8 & 0xff;
  24273. o[ 6] = x1 >>> 16 & 0xff;
  24274. o[ 7] = x1 >>> 24 & 0xff;
  24275. o[ 8] = x2 >>> 0 & 0xff;
  24276. o[ 9] = x2 >>> 8 & 0xff;
  24277. o[10] = x2 >>> 16 & 0xff;
  24278. o[11] = x2 >>> 24 & 0xff;
  24279. o[12] = x3 >>> 0 & 0xff;
  24280. o[13] = x3 >>> 8 & 0xff;
  24281. o[14] = x3 >>> 16 & 0xff;
  24282. o[15] = x3 >>> 24 & 0xff;
  24283. o[16] = x4 >>> 0 & 0xff;
  24284. o[17] = x4 >>> 8 & 0xff;
  24285. o[18] = x4 >>> 16 & 0xff;
  24286. o[19] = x4 >>> 24 & 0xff;
  24287. o[20] = x5 >>> 0 & 0xff;
  24288. o[21] = x5 >>> 8 & 0xff;
  24289. o[22] = x5 >>> 16 & 0xff;
  24290. o[23] = x5 >>> 24 & 0xff;
  24291. o[24] = x6 >>> 0 & 0xff;
  24292. o[25] = x6 >>> 8 & 0xff;
  24293. o[26] = x6 >>> 16 & 0xff;
  24294. o[27] = x6 >>> 24 & 0xff;
  24295. o[28] = x7 >>> 0 & 0xff;
  24296. o[29] = x7 >>> 8 & 0xff;
  24297. o[30] = x7 >>> 16 & 0xff;
  24298. o[31] = x7 >>> 24 & 0xff;
  24299. o[32] = x8 >>> 0 & 0xff;
  24300. o[33] = x8 >>> 8 & 0xff;
  24301. o[34] = x8 >>> 16 & 0xff;
  24302. o[35] = x8 >>> 24 & 0xff;
  24303. o[36] = x9 >>> 0 & 0xff;
  24304. o[37] = x9 >>> 8 & 0xff;
  24305. o[38] = x9 >>> 16 & 0xff;
  24306. o[39] = x9 >>> 24 & 0xff;
  24307. o[40] = x10 >>> 0 & 0xff;
  24308. o[41] = x10 >>> 8 & 0xff;
  24309. o[42] = x10 >>> 16 & 0xff;
  24310. o[43] = x10 >>> 24 & 0xff;
  24311. o[44] = x11 >>> 0 & 0xff;
  24312. o[45] = x11 >>> 8 & 0xff;
  24313. o[46] = x11 >>> 16 & 0xff;
  24314. o[47] = x11 >>> 24 & 0xff;
  24315. o[48] = x12 >>> 0 & 0xff;
  24316. o[49] = x12 >>> 8 & 0xff;
  24317. o[50] = x12 >>> 16 & 0xff;
  24318. o[51] = x12 >>> 24 & 0xff;
  24319. o[52] = x13 >>> 0 & 0xff;
  24320. o[53] = x13 >>> 8 & 0xff;
  24321. o[54] = x13 >>> 16 & 0xff;
  24322. o[55] = x13 >>> 24 & 0xff;
  24323. o[56] = x14 >>> 0 & 0xff;
  24324. o[57] = x14 >>> 8 & 0xff;
  24325. o[58] = x14 >>> 16 & 0xff;
  24326. o[59] = x14 >>> 24 & 0xff;
  24327. o[60] = x15 >>> 0 & 0xff;
  24328. o[61] = x15 >>> 8 & 0xff;
  24329. o[62] = x15 >>> 16 & 0xff;
  24330. o[63] = x15 >>> 24 & 0xff;
  24331. }
  24332. function core_hsalsa20(o,p,k,c) {
  24333. var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,
  24334. j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,
  24335. j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,
  24336. j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,
  24337. j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,
  24338. j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,
  24339. j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,
  24340. j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,
  24341. j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,
  24342. j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,
  24343. j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,
  24344. j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,
  24345. j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,
  24346. j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,
  24347. j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,
  24348. j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;
  24349. var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,
  24350. x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,
  24351. x15 = j15, u;
  24352. for (var i = 0; i < 20; i += 2) {
  24353. u = x0 + x12 | 0;
  24354. x4 ^= u<<7 | u>>>(32-7);
  24355. u = x4 + x0 | 0;
  24356. x8 ^= u<<9 | u>>>(32-9);
  24357. u = x8 + x4 | 0;
  24358. x12 ^= u<<13 | u>>>(32-13);
  24359. u = x12 + x8 | 0;
  24360. x0 ^= u<<18 | u>>>(32-18);
  24361. u = x5 + x1 | 0;
  24362. x9 ^= u<<7 | u>>>(32-7);
  24363. u = x9 + x5 | 0;
  24364. x13 ^= u<<9 | u>>>(32-9);
  24365. u = x13 + x9 | 0;
  24366. x1 ^= u<<13 | u>>>(32-13);
  24367. u = x1 + x13 | 0;
  24368. x5 ^= u<<18 | u>>>(32-18);
  24369. u = x10 + x6 | 0;
  24370. x14 ^= u<<7 | u>>>(32-7);
  24371. u = x14 + x10 | 0;
  24372. x2 ^= u<<9 | u>>>(32-9);
  24373. u = x2 + x14 | 0;
  24374. x6 ^= u<<13 | u>>>(32-13);
  24375. u = x6 + x2 | 0;
  24376. x10 ^= u<<18 | u>>>(32-18);
  24377. u = x15 + x11 | 0;
  24378. x3 ^= u<<7 | u>>>(32-7);
  24379. u = x3 + x15 | 0;
  24380. x7 ^= u<<9 | u>>>(32-9);
  24381. u = x7 + x3 | 0;
  24382. x11 ^= u<<13 | u>>>(32-13);
  24383. u = x11 + x7 | 0;
  24384. x15 ^= u<<18 | u>>>(32-18);
  24385. u = x0 + x3 | 0;
  24386. x1 ^= u<<7 | u>>>(32-7);
  24387. u = x1 + x0 | 0;
  24388. x2 ^= u<<9 | u>>>(32-9);
  24389. u = x2 + x1 | 0;
  24390. x3 ^= u<<13 | u>>>(32-13);
  24391. u = x3 + x2 | 0;
  24392. x0 ^= u<<18 | u>>>(32-18);
  24393. u = x5 + x4 | 0;
  24394. x6 ^= u<<7 | u>>>(32-7);
  24395. u = x6 + x5 | 0;
  24396. x7 ^= u<<9 | u>>>(32-9);
  24397. u = x7 + x6 | 0;
  24398. x4 ^= u<<13 | u>>>(32-13);
  24399. u = x4 + x7 | 0;
  24400. x5 ^= u<<18 | u>>>(32-18);
  24401. u = x10 + x9 | 0;
  24402. x11 ^= u<<7 | u>>>(32-7);
  24403. u = x11 + x10 | 0;
  24404. x8 ^= u<<9 | u>>>(32-9);
  24405. u = x8 + x11 | 0;
  24406. x9 ^= u<<13 | u>>>(32-13);
  24407. u = x9 + x8 | 0;
  24408. x10 ^= u<<18 | u>>>(32-18);
  24409. u = x15 + x14 | 0;
  24410. x12 ^= u<<7 | u>>>(32-7);
  24411. u = x12 + x15 | 0;
  24412. x13 ^= u<<9 | u>>>(32-9);
  24413. u = x13 + x12 | 0;
  24414. x14 ^= u<<13 | u>>>(32-13);
  24415. u = x14 + x13 | 0;
  24416. x15 ^= u<<18 | u>>>(32-18);
  24417. }
  24418. o[ 0] = x0 >>> 0 & 0xff;
  24419. o[ 1] = x0 >>> 8 & 0xff;
  24420. o[ 2] = x0 >>> 16 & 0xff;
  24421. o[ 3] = x0 >>> 24 & 0xff;
  24422. o[ 4] = x5 >>> 0 & 0xff;
  24423. o[ 5] = x5 >>> 8 & 0xff;
  24424. o[ 6] = x5 >>> 16 & 0xff;
  24425. o[ 7] = x5 >>> 24 & 0xff;
  24426. o[ 8] = x10 >>> 0 & 0xff;
  24427. o[ 9] = x10 >>> 8 & 0xff;
  24428. o[10] = x10 >>> 16 & 0xff;
  24429. o[11] = x10 >>> 24 & 0xff;
  24430. o[12] = x15 >>> 0 & 0xff;
  24431. o[13] = x15 >>> 8 & 0xff;
  24432. o[14] = x15 >>> 16 & 0xff;
  24433. o[15] = x15 >>> 24 & 0xff;
  24434. o[16] = x6 >>> 0 & 0xff;
  24435. o[17] = x6 >>> 8 & 0xff;
  24436. o[18] = x6 >>> 16 & 0xff;
  24437. o[19] = x6 >>> 24 & 0xff;
  24438. o[20] = x7 >>> 0 & 0xff;
  24439. o[21] = x7 >>> 8 & 0xff;
  24440. o[22] = x7 >>> 16 & 0xff;
  24441. o[23] = x7 >>> 24 & 0xff;
  24442. o[24] = x8 >>> 0 & 0xff;
  24443. o[25] = x8 >>> 8 & 0xff;
  24444. o[26] = x8 >>> 16 & 0xff;
  24445. o[27] = x8 >>> 24 & 0xff;
  24446. o[28] = x9 >>> 0 & 0xff;
  24447. o[29] = x9 >>> 8 & 0xff;
  24448. o[30] = x9 >>> 16 & 0xff;
  24449. o[31] = x9 >>> 24 & 0xff;
  24450. }
  24451. function crypto_core_salsa20(out,inp,k,c) {
  24452. core_salsa20(out,inp,k,c);
  24453. }
  24454. function crypto_core_hsalsa20(out,inp,k,c) {
  24455. core_hsalsa20(out,inp,k,c);
  24456. }
  24457. var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
  24458. // "expand 32-byte k"
  24459. function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {
  24460. var z = new Uint8Array(16), x = new Uint8Array(64);
  24461. var u, i;
  24462. for (i = 0; i < 16; i++) z[i] = 0;
  24463. for (i = 0; i < 8; i++) z[i] = n[i];
  24464. while (b >= 64) {
  24465. crypto_core_salsa20(x,z,k,sigma);
  24466. for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];
  24467. u = 1;
  24468. for (i = 8; i < 16; i++) {
  24469. u = u + (z[i] & 0xff) | 0;
  24470. z[i] = u & 0xff;
  24471. u >>>= 8;
  24472. }
  24473. b -= 64;
  24474. cpos += 64;
  24475. mpos += 64;
  24476. }
  24477. if (b > 0) {
  24478. crypto_core_salsa20(x,z,k,sigma);
  24479. for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];
  24480. }
  24481. return 0;
  24482. }
  24483. function crypto_stream_salsa20(c,cpos,b,n,k) {
  24484. var z = new Uint8Array(16), x = new Uint8Array(64);
  24485. var u, i;
  24486. for (i = 0; i < 16; i++) z[i] = 0;
  24487. for (i = 0; i < 8; i++) z[i] = n[i];
  24488. while (b >= 64) {
  24489. crypto_core_salsa20(x,z,k,sigma);
  24490. for (i = 0; i < 64; i++) c[cpos+i] = x[i];
  24491. u = 1;
  24492. for (i = 8; i < 16; i++) {
  24493. u = u + (z[i] & 0xff) | 0;
  24494. z[i] = u & 0xff;
  24495. u >>>= 8;
  24496. }
  24497. b -= 64;
  24498. cpos += 64;
  24499. }
  24500. if (b > 0) {
  24501. crypto_core_salsa20(x,z,k,sigma);
  24502. for (i = 0; i < b; i++) c[cpos+i] = x[i];
  24503. }
  24504. return 0;
  24505. }
  24506. function crypto_stream(c,cpos,d,n,k) {
  24507. var s = new Uint8Array(32);
  24508. crypto_core_hsalsa20(s,n,k,sigma);
  24509. var sn = new Uint8Array(8);
  24510. for (var i = 0; i < 8; i++) sn[i] = n[i+16];
  24511. return crypto_stream_salsa20(c,cpos,d,sn,s);
  24512. }
  24513. function crypto_stream_xor(c,cpos,m,mpos,d,n,k) {
  24514. var s = new Uint8Array(32);
  24515. crypto_core_hsalsa20(s,n,k,sigma);
  24516. var sn = new Uint8Array(8);
  24517. for (var i = 0; i < 8; i++) sn[i] = n[i+16];
  24518. return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);
  24519. }
  24520. /*
  24521. * Port of Andrew Moon's Poly1305-donna-16. Public domain.
  24522. * https://github.com/floodyberry/poly1305-donna
  24523. */
  24524. var poly1305 = function(key) {
  24525. this.buffer = new Uint8Array(16);
  24526. this.r = new Uint16Array(10);
  24527. this.h = new Uint16Array(10);
  24528. this.pad = new Uint16Array(8);
  24529. this.leftover = 0;
  24530. this.fin = 0;
  24531. var t0, t1, t2, t3, t4, t5, t6, t7;
  24532. t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff;
  24533. t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;
  24534. t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;
  24535. t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;
  24536. t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;
  24537. this.r[5] = ((t4 >>> 1)) & 0x1ffe;
  24538. t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;
  24539. t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;
  24540. t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;
  24541. this.r[9] = ((t7 >>> 5)) & 0x007f;
  24542. this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;
  24543. this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;
  24544. this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;
  24545. this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;
  24546. this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;
  24547. this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;
  24548. this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;
  24549. this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;
  24550. };
  24551. poly1305.prototype.blocks = function(m, mpos, bytes) {
  24552. var hibit = this.fin ? 0 : (1 << 11);
  24553. var t0, t1, t2, t3, t4, t5, t6, t7, c;
  24554. var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;
  24555. var h0 = this.h[0],
  24556. h1 = this.h[1],
  24557. h2 = this.h[2],
  24558. h3 = this.h[3],
  24559. h4 = this.h[4],
  24560. h5 = this.h[5],
  24561. h6 = this.h[6],
  24562. h7 = this.h[7],
  24563. h8 = this.h[8],
  24564. h9 = this.h[9];
  24565. var r0 = this.r[0],
  24566. r1 = this.r[1],
  24567. r2 = this.r[2],
  24568. r3 = this.r[3],
  24569. r4 = this.r[4],
  24570. r5 = this.r[5],
  24571. r6 = this.r[6],
  24572. r7 = this.r[7],
  24573. r8 = this.r[8],
  24574. r9 = this.r[9];
  24575. while (bytes >= 16) {
  24576. t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff;
  24577. t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff;
  24578. t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff;
  24579. t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff;
  24580. t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff;
  24581. h5 += ((t4 >>> 1)) & 0x1fff;
  24582. t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff;
  24583. t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff;
  24584. t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff;
  24585. h9 += ((t7 >>> 5)) | hibit;
  24586. c = 0;
  24587. d0 = c;
  24588. d0 += h0 * r0;
  24589. d0 += h1 * (5 * r9);
  24590. d0 += h2 * (5 * r8);
  24591. d0 += h3 * (5 * r7);
  24592. d0 += h4 * (5 * r6);
  24593. c = (d0 >>> 13); d0 &= 0x1fff;
  24594. d0 += h5 * (5 * r5);
  24595. d0 += h6 * (5 * r4);
  24596. d0 += h7 * (5 * r3);
  24597. d0 += h8 * (5 * r2);
  24598. d0 += h9 * (5 * r1);
  24599. c += (d0 >>> 13); d0 &= 0x1fff;
  24600. d1 = c;
  24601. d1 += h0 * r1;
  24602. d1 += h1 * r0;
  24603. d1 += h2 * (5 * r9);
  24604. d1 += h3 * (5 * r8);
  24605. d1 += h4 * (5 * r7);
  24606. c = (d1 >>> 13); d1 &= 0x1fff;
  24607. d1 += h5 * (5 * r6);
  24608. d1 += h6 * (5 * r5);
  24609. d1 += h7 * (5 * r4);
  24610. d1 += h8 * (5 * r3);
  24611. d1 += h9 * (5 * r2);
  24612. c += (d1 >>> 13); d1 &= 0x1fff;
  24613. d2 = c;
  24614. d2 += h0 * r2;
  24615. d2 += h1 * r1;
  24616. d2 += h2 * r0;
  24617. d2 += h3 * (5 * r9);
  24618. d2 += h4 * (5 * r8);
  24619. c = (d2 >>> 13); d2 &= 0x1fff;
  24620. d2 += h5 * (5 * r7);
  24621. d2 += h6 * (5 * r6);
  24622. d2 += h7 * (5 * r5);
  24623. d2 += h8 * (5 * r4);
  24624. d2 += h9 * (5 * r3);
  24625. c += (d2 >>> 13); d2 &= 0x1fff;
  24626. d3 = c;
  24627. d3 += h0 * r3;
  24628. d3 += h1 * r2;
  24629. d3 += h2 * r1;
  24630. d3 += h3 * r0;
  24631. d3 += h4 * (5 * r9);
  24632. c = (d3 >>> 13); d3 &= 0x1fff;
  24633. d3 += h5 * (5 * r8);
  24634. d3 += h6 * (5 * r7);
  24635. d3 += h7 * (5 * r6);
  24636. d3 += h8 * (5 * r5);
  24637. d3 += h9 * (5 * r4);
  24638. c += (d3 >>> 13); d3 &= 0x1fff;
  24639. d4 = c;
  24640. d4 += h0 * r4;
  24641. d4 += h1 * r3;
  24642. d4 += h2 * r2;
  24643. d4 += h3 * r1;
  24644. d4 += h4 * r0;
  24645. c = (d4 >>> 13); d4 &= 0x1fff;
  24646. d4 += h5 * (5 * r9);
  24647. d4 += h6 * (5 * r8);
  24648. d4 += h7 * (5 * r7);
  24649. d4 += h8 * (5 * r6);
  24650. d4 += h9 * (5 * r5);
  24651. c += (d4 >>> 13); d4 &= 0x1fff;
  24652. d5 = c;
  24653. d5 += h0 * r5;
  24654. d5 += h1 * r4;
  24655. d5 += h2 * r3;
  24656. d5 += h3 * r2;
  24657. d5 += h4 * r1;
  24658. c = (d5 >>> 13); d5 &= 0x1fff;
  24659. d5 += h5 * r0;
  24660. d5 += h6 * (5 * r9);
  24661. d5 += h7 * (5 * r8);
  24662. d5 += h8 * (5 * r7);
  24663. d5 += h9 * (5 * r6);
  24664. c += (d5 >>> 13); d5 &= 0x1fff;
  24665. d6 = c;
  24666. d6 += h0 * r6;
  24667. d6 += h1 * r5;
  24668. d6 += h2 * r4;
  24669. d6 += h3 * r3;
  24670. d6 += h4 * r2;
  24671. c = (d6 >>> 13); d6 &= 0x1fff;
  24672. d6 += h5 * r1;
  24673. d6 += h6 * r0;
  24674. d6 += h7 * (5 * r9);
  24675. d6 += h8 * (5 * r8);
  24676. d6 += h9 * (5 * r7);
  24677. c += (d6 >>> 13); d6 &= 0x1fff;
  24678. d7 = c;
  24679. d7 += h0 * r7;
  24680. d7 += h1 * r6;
  24681. d7 += h2 * r5;
  24682. d7 += h3 * r4;
  24683. d7 += h4 * r3;
  24684. c = (d7 >>> 13); d7 &= 0x1fff;
  24685. d7 += h5 * r2;
  24686. d7 += h6 * r1;
  24687. d7 += h7 * r0;
  24688. d7 += h8 * (5 * r9);
  24689. d7 += h9 * (5 * r8);
  24690. c += (d7 >>> 13); d7 &= 0x1fff;
  24691. d8 = c;
  24692. d8 += h0 * r8;
  24693. d8 += h1 * r7;
  24694. d8 += h2 * r6;
  24695. d8 += h3 * r5;
  24696. d8 += h4 * r4;
  24697. c = (d8 >>> 13); d8 &= 0x1fff;
  24698. d8 += h5 * r3;
  24699. d8 += h6 * r2;
  24700. d8 += h7 * r1;
  24701. d8 += h8 * r0;
  24702. d8 += h9 * (5 * r9);
  24703. c += (d8 >>> 13); d8 &= 0x1fff;
  24704. d9 = c;
  24705. d9 += h0 * r9;
  24706. d9 += h1 * r8;
  24707. d9 += h2 * r7;
  24708. d9 += h3 * r6;
  24709. d9 += h4 * r5;
  24710. c = (d9 >>> 13); d9 &= 0x1fff;
  24711. d9 += h5 * r4;
  24712. d9 += h6 * r3;
  24713. d9 += h7 * r2;
  24714. d9 += h8 * r1;
  24715. d9 += h9 * r0;
  24716. c += (d9 >>> 13); d9 &= 0x1fff;
  24717. c = (((c << 2) + c)) | 0;
  24718. c = (c + d0) | 0;
  24719. d0 = c & 0x1fff;
  24720. c = (c >>> 13);
  24721. d1 += c;
  24722. h0 = d0;
  24723. h1 = d1;
  24724. h2 = d2;
  24725. h3 = d3;
  24726. h4 = d4;
  24727. h5 = d5;
  24728. h6 = d6;
  24729. h7 = d7;
  24730. h8 = d8;
  24731. h9 = d9;
  24732. mpos += 16;
  24733. bytes -= 16;
  24734. }
  24735. this.h[0] = h0;
  24736. this.h[1] = h1;
  24737. this.h[2] = h2;
  24738. this.h[3] = h3;
  24739. this.h[4] = h4;
  24740. this.h[5] = h5;
  24741. this.h[6] = h6;
  24742. this.h[7] = h7;
  24743. this.h[8] = h8;
  24744. this.h[9] = h9;
  24745. };
  24746. poly1305.prototype.finish = function(mac, macpos) {
  24747. var g = new Uint16Array(10);
  24748. var c, mask, f, i;
  24749. if (this.leftover) {
  24750. i = this.leftover;
  24751. this.buffer[i++] = 1;
  24752. for (; i < 16; i++) this.buffer[i] = 0;
  24753. this.fin = 1;
  24754. this.blocks(this.buffer, 0, 16);
  24755. }
  24756. c = this.h[1] >>> 13;
  24757. this.h[1] &= 0x1fff;
  24758. for (i = 2; i < 10; i++) {
  24759. this.h[i] += c;
  24760. c = this.h[i] >>> 13;
  24761. this.h[i] &= 0x1fff;
  24762. }
  24763. this.h[0] += (c * 5);
  24764. c = this.h[0] >>> 13;
  24765. this.h[0] &= 0x1fff;
  24766. this.h[1] += c;
  24767. c = this.h[1] >>> 13;
  24768. this.h[1] &= 0x1fff;
  24769. this.h[2] += c;
  24770. g[0] = this.h[0] + 5;
  24771. c = g[0] >>> 13;
  24772. g[0] &= 0x1fff;
  24773. for (i = 1; i < 10; i++) {
  24774. g[i] = this.h[i] + c;
  24775. c = g[i] >>> 13;
  24776. g[i] &= 0x1fff;
  24777. }
  24778. g[9] -= (1 << 13);
  24779. mask = (c ^ 1) - 1;
  24780. for (i = 0; i < 10; i++) g[i] &= mask;
  24781. mask = ~mask;
  24782. for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];
  24783. this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff;
  24784. this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff;
  24785. this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff;
  24786. this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff;
  24787. this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff;
  24788. this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff;
  24789. this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff;
  24790. this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff;
  24791. f = this.h[0] + this.pad[0];
  24792. this.h[0] = f & 0xffff;
  24793. for (i = 1; i < 8; i++) {
  24794. f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;
  24795. this.h[i] = f & 0xffff;
  24796. }
  24797. mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;
  24798. mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;
  24799. mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;
  24800. mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;
  24801. mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;
  24802. mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;
  24803. mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;
  24804. mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;
  24805. mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;
  24806. mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;
  24807. mac[macpos+10] = (this.h[5] >>> 0) & 0xff;
  24808. mac[macpos+11] = (this.h[5] >>> 8) & 0xff;
  24809. mac[macpos+12] = (this.h[6] >>> 0) & 0xff;
  24810. mac[macpos+13] = (this.h[6] >>> 8) & 0xff;
  24811. mac[macpos+14] = (this.h[7] >>> 0) & 0xff;
  24812. mac[macpos+15] = (this.h[7] >>> 8) & 0xff;
  24813. };
  24814. poly1305.prototype.update = function(m, mpos, bytes) {
  24815. var i, want;
  24816. if (this.leftover) {
  24817. want = (16 - this.leftover);
  24818. if (want > bytes)
  24819. want = bytes;
  24820. for (i = 0; i < want; i++)
  24821. this.buffer[this.leftover + i] = m[mpos+i];
  24822. bytes -= want;
  24823. mpos += want;
  24824. this.leftover += want;
  24825. if (this.leftover < 16)
  24826. return;
  24827. this.blocks(this.buffer, 0, 16);
  24828. this.leftover = 0;
  24829. }
  24830. if (bytes >= 16) {
  24831. want = bytes - (bytes % 16);
  24832. this.blocks(m, mpos, want);
  24833. mpos += want;
  24834. bytes -= want;
  24835. }
  24836. if (bytes) {
  24837. for (i = 0; i < bytes; i++)
  24838. this.buffer[this.leftover + i] = m[mpos+i];
  24839. this.leftover += bytes;
  24840. }
  24841. };
  24842. function crypto_onetimeauth(out, outpos, m, mpos, n, k) {
  24843. var s = new poly1305(k);
  24844. s.update(m, mpos, n);
  24845. s.finish(out, outpos);
  24846. return 0;
  24847. }
  24848. function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {
  24849. var x = new Uint8Array(16);
  24850. crypto_onetimeauth(x,0,m,mpos,n,k);
  24851. return crypto_verify_16(h,hpos,x,0);
  24852. }
  24853. function crypto_secretbox(c,m,d,n,k) {
  24854. var i;
  24855. if (d < 32) return -1;
  24856. crypto_stream_xor(c,0,m,0,d,n,k);
  24857. crypto_onetimeauth(c, 16, c, 32, d - 32, c);
  24858. for (i = 0; i < 16; i++) c[i] = 0;
  24859. return 0;
  24860. }
  24861. function crypto_secretbox_open(m,c,d,n,k) {
  24862. var i;
  24863. var x = new Uint8Array(32);
  24864. if (d < 32) return -1;
  24865. crypto_stream(x,0,32,n,k);
  24866. if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;
  24867. crypto_stream_xor(m,0,c,0,d,n,k);
  24868. for (i = 0; i < 32; i++) m[i] = 0;
  24869. return 0;
  24870. }
  24871. function set25519(r, a) {
  24872. var i;
  24873. for (i = 0; i < 16; i++) r[i] = a[i]|0;
  24874. }
  24875. function car25519(o) {
  24876. var i, v, c = 1;
  24877. for (i = 0; i < 16; i++) {
  24878. v = o[i] + c + 65535;
  24879. c = Math.floor(v / 65536);
  24880. o[i] = v - c * 65536;
  24881. }
  24882. o[0] += c-1 + 37 * (c-1);
  24883. }
  24884. function sel25519(p, q, b) {
  24885. var t, c = ~(b-1);
  24886. for (var i = 0; i < 16; i++) {
  24887. t = c & (p[i] ^ q[i]);
  24888. p[i] ^= t;
  24889. q[i] ^= t;
  24890. }
  24891. }
  24892. function pack25519(o, n) {
  24893. var i, j, b;
  24894. var m = gf(), t = gf();
  24895. for (i = 0; i < 16; i++) t[i] = n[i];
  24896. car25519(t);
  24897. car25519(t);
  24898. car25519(t);
  24899. for (j = 0; j < 2; j++) {
  24900. m[0] = t[0] - 0xffed;
  24901. for (i = 1; i < 15; i++) {
  24902. m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);
  24903. m[i-1] &= 0xffff;
  24904. }
  24905. m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);
  24906. b = (m[15]>>16) & 1;
  24907. m[14] &= 0xffff;
  24908. sel25519(t, m, 1-b);
  24909. }
  24910. for (i = 0; i < 16; i++) {
  24911. o[2*i] = t[i] & 0xff;
  24912. o[2*i+1] = t[i]>>8;
  24913. }
  24914. }
  24915. function neq25519(a, b) {
  24916. var c = new Uint8Array(32), d = new Uint8Array(32);
  24917. pack25519(c, a);
  24918. pack25519(d, b);
  24919. return crypto_verify_32(c, 0, d, 0);
  24920. }
  24921. function par25519(a) {
  24922. var d = new Uint8Array(32);
  24923. pack25519(d, a);
  24924. return d[0] & 1;
  24925. }
  24926. function unpack25519(o, n) {
  24927. var i;
  24928. for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);
  24929. o[15] &= 0x7fff;
  24930. }
  24931. function A(o, a, b) {
  24932. for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];
  24933. }
  24934. function Z(o, a, b) {
  24935. for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];
  24936. }
  24937. function M(o, a, b) {
  24938. var v, c,
  24939. t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,
  24940. t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,
  24941. t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,
  24942. t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,
  24943. b0 = b[0],
  24944. b1 = b[1],
  24945. b2 = b[2],
  24946. b3 = b[3],
  24947. b4 = b[4],
  24948. b5 = b[5],
  24949. b6 = b[6],
  24950. b7 = b[7],
  24951. b8 = b[8],
  24952. b9 = b[9],
  24953. b10 = b[10],
  24954. b11 = b[11],
  24955. b12 = b[12],
  24956. b13 = b[13],
  24957. b14 = b[14],
  24958. b15 = b[15];
  24959. v = a[0];
  24960. t0 += v * b0;
  24961. t1 += v * b1;
  24962. t2 += v * b2;
  24963. t3 += v * b3;
  24964. t4 += v * b4;
  24965. t5 += v * b5;
  24966. t6 += v * b6;
  24967. t7 += v * b7;
  24968. t8 += v * b8;
  24969. t9 += v * b9;
  24970. t10 += v * b10;
  24971. t11 += v * b11;
  24972. t12 += v * b12;
  24973. t13 += v * b13;
  24974. t14 += v * b14;
  24975. t15 += v * b15;
  24976. v = a[1];
  24977. t1 += v * b0;
  24978. t2 += v * b1;
  24979. t3 += v * b2;
  24980. t4 += v * b3;
  24981. t5 += v * b4;
  24982. t6 += v * b5;
  24983. t7 += v * b6;
  24984. t8 += v * b7;
  24985. t9 += v * b8;
  24986. t10 += v * b9;
  24987. t11 += v * b10;
  24988. t12 += v * b11;
  24989. t13 += v * b12;
  24990. t14 += v * b13;
  24991. t15 += v * b14;
  24992. t16 += v * b15;
  24993. v = a[2];
  24994. t2 += v * b0;
  24995. t3 += v * b1;
  24996. t4 += v * b2;
  24997. t5 += v * b3;
  24998. t6 += v * b4;
  24999. t7 += v * b5;
  25000. t8 += v * b6;
  25001. t9 += v * b7;
  25002. t10 += v * b8;
  25003. t11 += v * b9;
  25004. t12 += v * b10;
  25005. t13 += v * b11;
  25006. t14 += v * b12;
  25007. t15 += v * b13;
  25008. t16 += v * b14;
  25009. t17 += v * b15;
  25010. v = a[3];
  25011. t3 += v * b0;
  25012. t4 += v * b1;
  25013. t5 += v * b2;
  25014. t6 += v * b3;
  25015. t7 += v * b4;
  25016. t8 += v * b5;
  25017. t9 += v * b6;
  25018. t10 += v * b7;
  25019. t11 += v * b8;
  25020. t12 += v * b9;
  25021. t13 += v * b10;
  25022. t14 += v * b11;
  25023. t15 += v * b12;
  25024. t16 += v * b13;
  25025. t17 += v * b14;
  25026. t18 += v * b15;
  25027. v = a[4];
  25028. t4 += v * b0;
  25029. t5 += v * b1;
  25030. t6 += v * b2;
  25031. t7 += v * b3;
  25032. t8 += v * b4;
  25033. t9 += v * b5;
  25034. t10 += v * b6;
  25035. t11 += v * b7;
  25036. t12 += v * b8;
  25037. t13 += v * b9;
  25038. t14 += v * b10;
  25039. t15 += v * b11;
  25040. t16 += v * b12;
  25041. t17 += v * b13;
  25042. t18 += v * b14;
  25043. t19 += v * b15;
  25044. v = a[5];
  25045. t5 += v * b0;
  25046. t6 += v * b1;
  25047. t7 += v * b2;
  25048. t8 += v * b3;
  25049. t9 += v * b4;
  25050. t10 += v * b5;
  25051. t11 += v * b6;
  25052. t12 += v * b7;
  25053. t13 += v * b8;
  25054. t14 += v * b9;
  25055. t15 += v * b10;
  25056. t16 += v * b11;
  25057. t17 += v * b12;
  25058. t18 += v * b13;
  25059. t19 += v * b14;
  25060. t20 += v * b15;
  25061. v = a[6];
  25062. t6 += v * b0;
  25063. t7 += v * b1;
  25064. t8 += v * b2;
  25065. t9 += v * b3;
  25066. t10 += v * b4;
  25067. t11 += v * b5;
  25068. t12 += v * b6;
  25069. t13 += v * b7;
  25070. t14 += v * b8;
  25071. t15 += v * b9;
  25072. t16 += v * b10;
  25073. t17 += v * b11;
  25074. t18 += v * b12;
  25075. t19 += v * b13;
  25076. t20 += v * b14;
  25077. t21 += v * b15;
  25078. v = a[7];
  25079. t7 += v * b0;
  25080. t8 += v * b1;
  25081. t9 += v * b2;
  25082. t10 += v * b3;
  25083. t11 += v * b4;
  25084. t12 += v * b5;
  25085. t13 += v * b6;
  25086. t14 += v * b7;
  25087. t15 += v * b8;
  25088. t16 += v * b9;
  25089. t17 += v * b10;
  25090. t18 += v * b11;
  25091. t19 += v * b12;
  25092. t20 += v * b13;
  25093. t21 += v * b14;
  25094. t22 += v * b15;
  25095. v = a[8];
  25096. t8 += v * b0;
  25097. t9 += v * b1;
  25098. t10 += v * b2;
  25099. t11 += v * b3;
  25100. t12 += v * b4;
  25101. t13 += v * b5;
  25102. t14 += v * b6;
  25103. t15 += v * b7;
  25104. t16 += v * b8;
  25105. t17 += v * b9;
  25106. t18 += v * b10;
  25107. t19 += v * b11;
  25108. t20 += v * b12;
  25109. t21 += v * b13;
  25110. t22 += v * b14;
  25111. t23 += v * b15;
  25112. v = a[9];
  25113. t9 += v * b0;
  25114. t10 += v * b1;
  25115. t11 += v * b2;
  25116. t12 += v * b3;
  25117. t13 += v * b4;
  25118. t14 += v * b5;
  25119. t15 += v * b6;
  25120. t16 += v * b7;
  25121. t17 += v * b8;
  25122. t18 += v * b9;
  25123. t19 += v * b10;
  25124. t20 += v * b11;
  25125. t21 += v * b12;
  25126. t22 += v * b13;
  25127. t23 += v * b14;
  25128. t24 += v * b15;
  25129. v = a[10];
  25130. t10 += v * b0;
  25131. t11 += v * b1;
  25132. t12 += v * b2;
  25133. t13 += v * b3;
  25134. t14 += v * b4;
  25135. t15 += v * b5;
  25136. t16 += v * b6;
  25137. t17 += v * b7;
  25138. t18 += v * b8;
  25139. t19 += v * b9;
  25140. t20 += v * b10;
  25141. t21 += v * b11;
  25142. t22 += v * b12;
  25143. t23 += v * b13;
  25144. t24 += v * b14;
  25145. t25 += v * b15;
  25146. v = a[11];
  25147. t11 += v * b0;
  25148. t12 += v * b1;
  25149. t13 += v * b2;
  25150. t14 += v * b3;
  25151. t15 += v * b4;
  25152. t16 += v * b5;
  25153. t17 += v * b6;
  25154. t18 += v * b7;
  25155. t19 += v * b8;
  25156. t20 += v * b9;
  25157. t21 += v * b10;
  25158. t22 += v * b11;
  25159. t23 += v * b12;
  25160. t24 += v * b13;
  25161. t25 += v * b14;
  25162. t26 += v * b15;
  25163. v = a[12];
  25164. t12 += v * b0;
  25165. t13 += v * b1;
  25166. t14 += v * b2;
  25167. t15 += v * b3;
  25168. t16 += v * b4;
  25169. t17 += v * b5;
  25170. t18 += v * b6;
  25171. t19 += v * b7;
  25172. t20 += v * b8;
  25173. t21 += v * b9;
  25174. t22 += v * b10;
  25175. t23 += v * b11;
  25176. t24 += v * b12;
  25177. t25 += v * b13;
  25178. t26 += v * b14;
  25179. t27 += v * b15;
  25180. v = a[13];
  25181. t13 += v * b0;
  25182. t14 += v * b1;
  25183. t15 += v * b2;
  25184. t16 += v * b3;
  25185. t17 += v * b4;
  25186. t18 += v * b5;
  25187. t19 += v * b6;
  25188. t20 += v * b7;
  25189. t21 += v * b8;
  25190. t22 += v * b9;
  25191. t23 += v * b10;
  25192. t24 += v * b11;
  25193. t25 += v * b12;
  25194. t26 += v * b13;
  25195. t27 += v * b14;
  25196. t28 += v * b15;
  25197. v = a[14];
  25198. t14 += v * b0;
  25199. t15 += v * b1;
  25200. t16 += v * b2;
  25201. t17 += v * b3;
  25202. t18 += v * b4;
  25203. t19 += v * b5;
  25204. t20 += v * b6;
  25205. t21 += v * b7;
  25206. t22 += v * b8;
  25207. t23 += v * b9;
  25208. t24 += v * b10;
  25209. t25 += v * b11;
  25210. t26 += v * b12;
  25211. t27 += v * b13;
  25212. t28 += v * b14;
  25213. t29 += v * b15;
  25214. v = a[15];
  25215. t15 += v * b0;
  25216. t16 += v * b1;
  25217. t17 += v * b2;
  25218. t18 += v * b3;
  25219. t19 += v * b4;
  25220. t20 += v * b5;
  25221. t21 += v * b6;
  25222. t22 += v * b7;
  25223. t23 += v * b8;
  25224. t24 += v * b9;
  25225. t25 += v * b10;
  25226. t26 += v * b11;
  25227. t27 += v * b12;
  25228. t28 += v * b13;
  25229. t29 += v * b14;
  25230. t30 += v * b15;
  25231. t0 += 38 * t16;
  25232. t1 += 38 * t17;
  25233. t2 += 38 * t18;
  25234. t3 += 38 * t19;
  25235. t4 += 38 * t20;
  25236. t5 += 38 * t21;
  25237. t6 += 38 * t22;
  25238. t7 += 38 * t23;
  25239. t8 += 38 * t24;
  25240. t9 += 38 * t25;
  25241. t10 += 38 * t26;
  25242. t11 += 38 * t27;
  25243. t12 += 38 * t28;
  25244. t13 += 38 * t29;
  25245. t14 += 38 * t30;
  25246. // t15 left as is
  25247. // first car
  25248. c = 1;
  25249. v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;
  25250. v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;
  25251. v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;
  25252. v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;
  25253. v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;
  25254. v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;
  25255. v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;
  25256. v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;
  25257. v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;
  25258. v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;
  25259. v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;
  25260. v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;
  25261. v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;
  25262. v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;
  25263. v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;
  25264. v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;
  25265. t0 += c-1 + 37 * (c-1);
  25266. // second car
  25267. c = 1;
  25268. v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;
  25269. v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;
  25270. v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;
  25271. v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;
  25272. v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;
  25273. v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;
  25274. v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;
  25275. v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;
  25276. v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;
  25277. v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;
  25278. v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;
  25279. v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;
  25280. v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;
  25281. v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;
  25282. v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;
  25283. v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;
  25284. t0 += c-1 + 37 * (c-1);
  25285. o[ 0] = t0;
  25286. o[ 1] = t1;
  25287. o[ 2] = t2;
  25288. o[ 3] = t3;
  25289. o[ 4] = t4;
  25290. o[ 5] = t5;
  25291. o[ 6] = t6;
  25292. o[ 7] = t7;
  25293. o[ 8] = t8;
  25294. o[ 9] = t9;
  25295. o[10] = t10;
  25296. o[11] = t11;
  25297. o[12] = t12;
  25298. o[13] = t13;
  25299. o[14] = t14;
  25300. o[15] = t15;
  25301. }
  25302. function S(o, a) {
  25303. M(o, a, a);
  25304. }
  25305. function inv25519(o, i) {
  25306. var c = gf();
  25307. var a;
  25308. for (a = 0; a < 16; a++) c[a] = i[a];
  25309. for (a = 253; a >= 0; a--) {
  25310. S(c, c);
  25311. if(a !== 2 && a !== 4) M(c, c, i);
  25312. }
  25313. for (a = 0; a < 16; a++) o[a] = c[a];
  25314. }
  25315. function pow2523(o, i) {
  25316. var c = gf();
  25317. var a;
  25318. for (a = 0; a < 16; a++) c[a] = i[a];
  25319. for (a = 250; a >= 0; a--) {
  25320. S(c, c);
  25321. if(a !== 1) M(c, c, i);
  25322. }
  25323. for (a = 0; a < 16; a++) o[a] = c[a];
  25324. }
  25325. function crypto_scalarmult(q, n, p) {
  25326. var z = new Uint8Array(32);
  25327. var x = new Float64Array(80), r, i;
  25328. var a = gf(), b = gf(), c = gf(),
  25329. d = gf(), e = gf(), f = gf();
  25330. for (i = 0; i < 31; i++) z[i] = n[i];
  25331. z[31]=(n[31]&127)|64;
  25332. z[0]&=248;
  25333. unpack25519(x,p);
  25334. for (i = 0; i < 16; i++) {
  25335. b[i]=x[i];
  25336. d[i]=a[i]=c[i]=0;
  25337. }
  25338. a[0]=d[0]=1;
  25339. for (i=254; i>=0; --i) {
  25340. r=(z[i>>>3]>>>(i&7))&1;
  25341. sel25519(a,b,r);
  25342. sel25519(c,d,r);
  25343. A(e,a,c);
  25344. Z(a,a,c);
  25345. A(c,b,d);
  25346. Z(b,b,d);
  25347. S(d,e);
  25348. S(f,a);
  25349. M(a,c,a);
  25350. M(c,b,e);
  25351. A(e,a,c);
  25352. Z(a,a,c);
  25353. S(b,a);
  25354. Z(c,d,f);
  25355. M(a,c,_121665);
  25356. A(a,a,d);
  25357. M(c,c,a);
  25358. M(a,d,f);
  25359. M(d,b,x);
  25360. S(b,e);
  25361. sel25519(a,b,r);
  25362. sel25519(c,d,r);
  25363. }
  25364. for (i = 0; i < 16; i++) {
  25365. x[i+16]=a[i];
  25366. x[i+32]=c[i];
  25367. x[i+48]=b[i];
  25368. x[i+64]=d[i];
  25369. }
  25370. var x32 = x.subarray(32);
  25371. var x16 = x.subarray(16);
  25372. inv25519(x32,x32);
  25373. M(x16,x16,x32);
  25374. pack25519(q,x16);
  25375. return 0;
  25376. }
  25377. function crypto_scalarmult_base(q, n) {
  25378. return crypto_scalarmult(q, n, _9);
  25379. }
  25380. function crypto_box_keypair(y, x) {
  25381. randombytes(x, 32);
  25382. return crypto_scalarmult_base(y, x);
  25383. }
  25384. function crypto_box_beforenm(k, y, x) {
  25385. var s = new Uint8Array(32);
  25386. crypto_scalarmult(s, x, y);
  25387. return crypto_core_hsalsa20(k, _0, s, sigma);
  25388. }
  25389. var crypto_box_afternm = crypto_secretbox;
  25390. var crypto_box_open_afternm = crypto_secretbox_open;
  25391. function crypto_box(c, m, d, n, y, x) {
  25392. var k = new Uint8Array(32);
  25393. crypto_box_beforenm(k, y, x);
  25394. return crypto_box_afternm(c, m, d, n, k);
  25395. }
  25396. function crypto_box_open(m, c, d, n, y, x) {
  25397. var k = new Uint8Array(32);
  25398. crypto_box_beforenm(k, y, x);
  25399. return crypto_box_open_afternm(m, c, d, n, k);
  25400. }
  25401. var K = [
  25402. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  25403. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  25404. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  25405. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  25406. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  25407. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  25408. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  25409. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  25410. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  25411. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  25412. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  25413. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  25414. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  25415. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  25416. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  25417. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  25418. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  25419. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  25420. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  25421. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  25422. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  25423. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  25424. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  25425. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  25426. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  25427. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  25428. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  25429. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  25430. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  25431. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  25432. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  25433. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  25434. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  25435. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  25436. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  25437. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  25438. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  25439. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  25440. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  25441. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  25442. ];
  25443. function crypto_hashblocks_hl(hh, hl, m, n) {
  25444. var wh = new Int32Array(16), wl = new Int32Array(16),
  25445. bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,
  25446. bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,
  25447. th, tl, i, j, h, l, a, b, c, d;
  25448. var ah0 = hh[0],
  25449. ah1 = hh[1],
  25450. ah2 = hh[2],
  25451. ah3 = hh[3],
  25452. ah4 = hh[4],
  25453. ah5 = hh[5],
  25454. ah6 = hh[6],
  25455. ah7 = hh[7],
  25456. al0 = hl[0],
  25457. al1 = hl[1],
  25458. al2 = hl[2],
  25459. al3 = hl[3],
  25460. al4 = hl[4],
  25461. al5 = hl[5],
  25462. al6 = hl[6],
  25463. al7 = hl[7];
  25464. var pos = 0;
  25465. while (n >= 128) {
  25466. for (i = 0; i < 16; i++) {
  25467. j = 8 * i + pos;
  25468. wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];
  25469. wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];
  25470. }
  25471. for (i = 0; i < 80; i++) {
  25472. bh0 = ah0;
  25473. bh1 = ah1;
  25474. bh2 = ah2;
  25475. bh3 = ah3;
  25476. bh4 = ah4;
  25477. bh5 = ah5;
  25478. bh6 = ah6;
  25479. bh7 = ah7;
  25480. bl0 = al0;
  25481. bl1 = al1;
  25482. bl2 = al2;
  25483. bl3 = al3;
  25484. bl4 = al4;
  25485. bl5 = al5;
  25486. bl6 = al6;
  25487. bl7 = al7;
  25488. // add
  25489. h = ah7;
  25490. l = al7;
  25491. a = l & 0xffff; b = l >>> 16;
  25492. c = h & 0xffff; d = h >>> 16;
  25493. // Sigma1
  25494. h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));
  25495. l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));
  25496. a += l & 0xffff; b += l >>> 16;
  25497. c += h & 0xffff; d += h >>> 16;
  25498. // Ch
  25499. h = (ah4 & ah5) ^ (~ah4 & ah6);
  25500. l = (al4 & al5) ^ (~al4 & al6);
  25501. a += l & 0xffff; b += l >>> 16;
  25502. c += h & 0xffff; d += h >>> 16;
  25503. // K
  25504. h = K[i*2];
  25505. l = K[i*2+1];
  25506. a += l & 0xffff; b += l >>> 16;
  25507. c += h & 0xffff; d += h >>> 16;
  25508. // w
  25509. h = wh[i%16];
  25510. l = wl[i%16];
  25511. a += l & 0xffff; b += l >>> 16;
  25512. c += h & 0xffff; d += h >>> 16;
  25513. b += a >>> 16;
  25514. c += b >>> 16;
  25515. d += c >>> 16;
  25516. th = c & 0xffff | d << 16;
  25517. tl = a & 0xffff | b << 16;
  25518. // add
  25519. h = th;
  25520. l = tl;
  25521. a = l & 0xffff; b = l >>> 16;
  25522. c = h & 0xffff; d = h >>> 16;
  25523. // Sigma0
  25524. h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));
  25525. l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));
  25526. a += l & 0xffff; b += l >>> 16;
  25527. c += h & 0xffff; d += h >>> 16;
  25528. // Maj
  25529. h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);
  25530. l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);
  25531. a += l & 0xffff; b += l >>> 16;
  25532. c += h & 0xffff; d += h >>> 16;
  25533. b += a >>> 16;
  25534. c += b >>> 16;
  25535. d += c >>> 16;
  25536. bh7 = (c & 0xffff) | (d << 16);
  25537. bl7 = (a & 0xffff) | (b << 16);
  25538. // add
  25539. h = bh3;
  25540. l = bl3;
  25541. a = l & 0xffff; b = l >>> 16;
  25542. c = h & 0xffff; d = h >>> 16;
  25543. h = th;
  25544. l = tl;
  25545. a += l & 0xffff; b += l >>> 16;
  25546. c += h & 0xffff; d += h >>> 16;
  25547. b += a >>> 16;
  25548. c += b >>> 16;
  25549. d += c >>> 16;
  25550. bh3 = (c & 0xffff) | (d << 16);
  25551. bl3 = (a & 0xffff) | (b << 16);
  25552. ah1 = bh0;
  25553. ah2 = bh1;
  25554. ah3 = bh2;
  25555. ah4 = bh3;
  25556. ah5 = bh4;
  25557. ah6 = bh5;
  25558. ah7 = bh6;
  25559. ah0 = bh7;
  25560. al1 = bl0;
  25561. al2 = bl1;
  25562. al3 = bl2;
  25563. al4 = bl3;
  25564. al5 = bl4;
  25565. al6 = bl5;
  25566. al7 = bl6;
  25567. al0 = bl7;
  25568. if (i%16 === 15) {
  25569. for (j = 0; j < 16; j++) {
  25570. // add
  25571. h = wh[j];
  25572. l = wl[j];
  25573. a = l & 0xffff; b = l >>> 16;
  25574. c = h & 0xffff; d = h >>> 16;
  25575. h = wh[(j+9)%16];
  25576. l = wl[(j+9)%16];
  25577. a += l & 0xffff; b += l >>> 16;
  25578. c += h & 0xffff; d += h >>> 16;
  25579. // sigma0
  25580. th = wh[(j+1)%16];
  25581. tl = wl[(j+1)%16];
  25582. h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);
  25583. l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));
  25584. a += l & 0xffff; b += l >>> 16;
  25585. c += h & 0xffff; d += h >>> 16;
  25586. // sigma1
  25587. th = wh[(j+14)%16];
  25588. tl = wl[(j+14)%16];
  25589. h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);
  25590. l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));
  25591. a += l & 0xffff; b += l >>> 16;
  25592. c += h & 0xffff; d += h >>> 16;
  25593. b += a >>> 16;
  25594. c += b >>> 16;
  25595. d += c >>> 16;
  25596. wh[j] = (c & 0xffff) | (d << 16);
  25597. wl[j] = (a & 0xffff) | (b << 16);
  25598. }
  25599. }
  25600. }
  25601. // add
  25602. h = ah0;
  25603. l = al0;
  25604. a = l & 0xffff; b = l >>> 16;
  25605. c = h & 0xffff; d = h >>> 16;
  25606. h = hh[0];
  25607. l = hl[0];
  25608. a += l & 0xffff; b += l >>> 16;
  25609. c += h & 0xffff; d += h >>> 16;
  25610. b += a >>> 16;
  25611. c += b >>> 16;
  25612. d += c >>> 16;
  25613. hh[0] = ah0 = (c & 0xffff) | (d << 16);
  25614. hl[0] = al0 = (a & 0xffff) | (b << 16);
  25615. h = ah1;
  25616. l = al1;
  25617. a = l & 0xffff; b = l >>> 16;
  25618. c = h & 0xffff; d = h >>> 16;
  25619. h = hh[1];
  25620. l = hl[1];
  25621. a += l & 0xffff; b += l >>> 16;
  25622. c += h & 0xffff; d += h >>> 16;
  25623. b += a >>> 16;
  25624. c += b >>> 16;
  25625. d += c >>> 16;
  25626. hh[1] = ah1 = (c & 0xffff) | (d << 16);
  25627. hl[1] = al1 = (a & 0xffff) | (b << 16);
  25628. h = ah2;
  25629. l = al2;
  25630. a = l & 0xffff; b = l >>> 16;
  25631. c = h & 0xffff; d = h >>> 16;
  25632. h = hh[2];
  25633. l = hl[2];
  25634. a += l & 0xffff; b += l >>> 16;
  25635. c += h & 0xffff; d += h >>> 16;
  25636. b += a >>> 16;
  25637. c += b >>> 16;
  25638. d += c >>> 16;
  25639. hh[2] = ah2 = (c & 0xffff) | (d << 16);
  25640. hl[2] = al2 = (a & 0xffff) | (b << 16);
  25641. h = ah3;
  25642. l = al3;
  25643. a = l & 0xffff; b = l >>> 16;
  25644. c = h & 0xffff; d = h >>> 16;
  25645. h = hh[3];
  25646. l = hl[3];
  25647. a += l & 0xffff; b += l >>> 16;
  25648. c += h & 0xffff; d += h >>> 16;
  25649. b += a >>> 16;
  25650. c += b >>> 16;
  25651. d += c >>> 16;
  25652. hh[3] = ah3 = (c & 0xffff) | (d << 16);
  25653. hl[3] = al3 = (a & 0xffff) | (b << 16);
  25654. h = ah4;
  25655. l = al4;
  25656. a = l & 0xffff; b = l >>> 16;
  25657. c = h & 0xffff; d = h >>> 16;
  25658. h = hh[4];
  25659. l = hl[4];
  25660. a += l & 0xffff; b += l >>> 16;
  25661. c += h & 0xffff; d += h >>> 16;
  25662. b += a >>> 16;
  25663. c += b >>> 16;
  25664. d += c >>> 16;
  25665. hh[4] = ah4 = (c & 0xffff) | (d << 16);
  25666. hl[4] = al4 = (a & 0xffff) | (b << 16);
  25667. h = ah5;
  25668. l = al5;
  25669. a = l & 0xffff; b = l >>> 16;
  25670. c = h & 0xffff; d = h >>> 16;
  25671. h = hh[5];
  25672. l = hl[5];
  25673. a += l & 0xffff; b += l >>> 16;
  25674. c += h & 0xffff; d += h >>> 16;
  25675. b += a >>> 16;
  25676. c += b >>> 16;
  25677. d += c >>> 16;
  25678. hh[5] = ah5 = (c & 0xffff) | (d << 16);
  25679. hl[5] = al5 = (a & 0xffff) | (b << 16);
  25680. h = ah6;
  25681. l = al6;
  25682. a = l & 0xffff; b = l >>> 16;
  25683. c = h & 0xffff; d = h >>> 16;
  25684. h = hh[6];
  25685. l = hl[6];
  25686. a += l & 0xffff; b += l >>> 16;
  25687. c += h & 0xffff; d += h >>> 16;
  25688. b += a >>> 16;
  25689. c += b >>> 16;
  25690. d += c >>> 16;
  25691. hh[6] = ah6 = (c & 0xffff) | (d << 16);
  25692. hl[6] = al6 = (a & 0xffff) | (b << 16);
  25693. h = ah7;
  25694. l = al7;
  25695. a = l & 0xffff; b = l >>> 16;
  25696. c = h & 0xffff; d = h >>> 16;
  25697. h = hh[7];
  25698. l = hl[7];
  25699. a += l & 0xffff; b += l >>> 16;
  25700. c += h & 0xffff; d += h >>> 16;
  25701. b += a >>> 16;
  25702. c += b >>> 16;
  25703. d += c >>> 16;
  25704. hh[7] = ah7 = (c & 0xffff) | (d << 16);
  25705. hl[7] = al7 = (a & 0xffff) | (b << 16);
  25706. pos += 128;
  25707. n -= 128;
  25708. }
  25709. return n;
  25710. }
  25711. function crypto_hash(out, m, n) {
  25712. var hh = new Int32Array(8),
  25713. hl = new Int32Array(8),
  25714. x = new Uint8Array(256),
  25715. i, b = n;
  25716. hh[0] = 0x6a09e667;
  25717. hh[1] = 0xbb67ae85;
  25718. hh[2] = 0x3c6ef372;
  25719. hh[3] = 0xa54ff53a;
  25720. hh[4] = 0x510e527f;
  25721. hh[5] = 0x9b05688c;
  25722. hh[6] = 0x1f83d9ab;
  25723. hh[7] = 0x5be0cd19;
  25724. hl[0] = 0xf3bcc908;
  25725. hl[1] = 0x84caa73b;
  25726. hl[2] = 0xfe94f82b;
  25727. hl[3] = 0x5f1d36f1;
  25728. hl[4] = 0xade682d1;
  25729. hl[5] = 0x2b3e6c1f;
  25730. hl[6] = 0xfb41bd6b;
  25731. hl[7] = 0x137e2179;
  25732. crypto_hashblocks_hl(hh, hl, m, n);
  25733. n %= 128;
  25734. for (i = 0; i < n; i++) x[i] = m[b-n+i];
  25735. x[n] = 128;
  25736. n = 256-128*(n<112?1:0);
  25737. x[n-9] = 0;
  25738. ts64(x, n-8, (b / 0x20000000) | 0, b << 3);
  25739. crypto_hashblocks_hl(hh, hl, x, n);
  25740. for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);
  25741. return 0;
  25742. }
  25743. function add(p, q) {
  25744. var a = gf(), b = gf(), c = gf(),
  25745. d = gf(), e = gf(), f = gf(),
  25746. g = gf(), h = gf(), t = gf();
  25747. Z(a, p[1], p[0]);
  25748. Z(t, q[1], q[0]);
  25749. M(a, a, t);
  25750. A(b, p[0], p[1]);
  25751. A(t, q[0], q[1]);
  25752. M(b, b, t);
  25753. M(c, p[3], q[3]);
  25754. M(c, c, D2);
  25755. M(d, p[2], q[2]);
  25756. A(d, d, d);
  25757. Z(e, b, a);
  25758. Z(f, d, c);
  25759. A(g, d, c);
  25760. A(h, b, a);
  25761. M(p[0], e, f);
  25762. M(p[1], h, g);
  25763. M(p[2], g, f);
  25764. M(p[3], e, h);
  25765. }
  25766. function cswap(p, q, b) {
  25767. var i;
  25768. for (i = 0; i < 4; i++) {
  25769. sel25519(p[i], q[i], b);
  25770. }
  25771. }
  25772. function pack(r, p) {
  25773. var tx = gf(), ty = gf(), zi = gf();
  25774. inv25519(zi, p[2]);
  25775. M(tx, p[0], zi);
  25776. M(ty, p[1], zi);
  25777. pack25519(r, ty);
  25778. r[31] ^= par25519(tx) << 7;
  25779. }
  25780. function scalarmult(p, q, s) {
  25781. var b, i;
  25782. set25519(p[0], gf0);
  25783. set25519(p[1], gf1);
  25784. set25519(p[2], gf1);
  25785. set25519(p[3], gf0);
  25786. for (i = 255; i >= 0; --i) {
  25787. b = (s[(i/8)|0] >> (i&7)) & 1;
  25788. cswap(p, q, b);
  25789. add(q, p);
  25790. add(p, p);
  25791. cswap(p, q, b);
  25792. }
  25793. }
  25794. function scalarbase(p, s) {
  25795. var q = [gf(), gf(), gf(), gf()];
  25796. set25519(q[0], X);
  25797. set25519(q[1], Y);
  25798. set25519(q[2], gf1);
  25799. M(q[3], X, Y);
  25800. scalarmult(p, q, s);
  25801. }
  25802. function crypto_sign_keypair(pk, sk, seeded) {
  25803. var d = new Uint8Array(64);
  25804. var p = [gf(), gf(), gf(), gf()];
  25805. var i;
  25806. if (!seeded) randombytes(sk, 32);
  25807. crypto_hash(d, sk, 32);
  25808. d[0] &= 248;
  25809. d[31] &= 127;
  25810. d[31] |= 64;
  25811. scalarbase(p, d);
  25812. pack(pk, p);
  25813. for (i = 0; i < 32; i++) sk[i+32] = pk[i];
  25814. return 0;
  25815. }
  25816. var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);
  25817. function modL(r, x) {
  25818. var carry, i, j, k;
  25819. for (i = 63; i >= 32; --i) {
  25820. carry = 0;
  25821. for (j = i - 32, k = i - 12; j < k; ++j) {
  25822. x[j] += carry - 16 * x[i] * L[j - (i - 32)];
  25823. carry = (x[j] + 128) >> 8;
  25824. x[j] -= carry * 256;
  25825. }
  25826. x[j] += carry;
  25827. x[i] = 0;
  25828. }
  25829. carry = 0;
  25830. for (j = 0; j < 32; j++) {
  25831. x[j] += carry - (x[31] >> 4) * L[j];
  25832. carry = x[j] >> 8;
  25833. x[j] &= 255;
  25834. }
  25835. for (j = 0; j < 32; j++) x[j] -= carry * L[j];
  25836. for (i = 0; i < 32; i++) {
  25837. x[i+1] += x[i] >> 8;
  25838. r[i] = x[i] & 255;
  25839. }
  25840. }
  25841. function reduce(r) {
  25842. var x = new Float64Array(64), i;
  25843. for (i = 0; i < 64; i++) x[i] = r[i];
  25844. for (i = 0; i < 64; i++) r[i] = 0;
  25845. modL(r, x);
  25846. }
  25847. // Note: difference from C - smlen returned, not passed as argument.
  25848. function crypto_sign(sm, m, n, sk) {
  25849. var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);
  25850. var i, j, x = new Float64Array(64);
  25851. var p = [gf(), gf(), gf(), gf()];
  25852. crypto_hash(d, sk, 32);
  25853. d[0] &= 248;
  25854. d[31] &= 127;
  25855. d[31] |= 64;
  25856. var smlen = n + 64;
  25857. for (i = 0; i < n; i++) sm[64 + i] = m[i];
  25858. for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];
  25859. crypto_hash(r, sm.subarray(32), n+32);
  25860. reduce(r);
  25861. scalarbase(p, r);
  25862. pack(sm, p);
  25863. for (i = 32; i < 64; i++) sm[i] = sk[i];
  25864. crypto_hash(h, sm, n + 64);
  25865. reduce(h);
  25866. for (i = 0; i < 64; i++) x[i] = 0;
  25867. for (i = 0; i < 32; i++) x[i] = r[i];
  25868. for (i = 0; i < 32; i++) {
  25869. for (j = 0; j < 32; j++) {
  25870. x[i+j] += h[i] * d[j];
  25871. }
  25872. }
  25873. modL(sm.subarray(32), x);
  25874. return smlen;
  25875. }
  25876. function unpackneg(r, p) {
  25877. var t = gf(), chk = gf(), num = gf(),
  25878. den = gf(), den2 = gf(), den4 = gf(),
  25879. den6 = gf();
  25880. set25519(r[2], gf1);
  25881. unpack25519(r[1], p);
  25882. S(num, r[1]);
  25883. M(den, num, D);
  25884. Z(num, num, r[2]);
  25885. A(den, r[2], den);
  25886. S(den2, den);
  25887. S(den4, den2);
  25888. M(den6, den4, den2);
  25889. M(t, den6, num);
  25890. M(t, t, den);
  25891. pow2523(t, t);
  25892. M(t, t, num);
  25893. M(t, t, den);
  25894. M(t, t, den);
  25895. M(r[0], t, den);
  25896. S(chk, r[0]);
  25897. M(chk, chk, den);
  25898. if (neq25519(chk, num)) M(r[0], r[0], I);
  25899. S(chk, r[0]);
  25900. M(chk, chk, den);
  25901. if (neq25519(chk, num)) return -1;
  25902. if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);
  25903. M(r[3], r[0], r[1]);
  25904. return 0;
  25905. }
  25906. function crypto_sign_open(m, sm, n, pk) {
  25907. var i, mlen;
  25908. var t = new Uint8Array(32), h = new Uint8Array(64);
  25909. var p = [gf(), gf(), gf(), gf()],
  25910. q = [gf(), gf(), gf(), gf()];
  25911. mlen = -1;
  25912. if (n < 64) return -1;
  25913. if (unpackneg(q, pk)) return -1;
  25914. for (i = 0; i < n; i++) m[i] = sm[i];
  25915. for (i = 0; i < 32; i++) m[i+32] = pk[i];
  25916. crypto_hash(h, m, n);
  25917. reduce(h);
  25918. scalarmult(p, q, h);
  25919. scalarbase(q, sm.subarray(32));
  25920. add(p, q);
  25921. pack(t, p);
  25922. n -= 64;
  25923. if (crypto_verify_32(sm, 0, t, 0)) {
  25924. for (i = 0; i < n; i++) m[i] = 0;
  25925. return -1;
  25926. }
  25927. for (i = 0; i < n; i++) m[i] = sm[i + 64];
  25928. mlen = n;
  25929. return mlen;
  25930. }
  25931. var crypto_secretbox_KEYBYTES = 32,
  25932. crypto_secretbox_NONCEBYTES = 24,
  25933. crypto_secretbox_ZEROBYTES = 32,
  25934. crypto_secretbox_BOXZEROBYTES = 16,
  25935. crypto_scalarmult_BYTES = 32,
  25936. crypto_scalarmult_SCALARBYTES = 32,
  25937. crypto_box_PUBLICKEYBYTES = 32,
  25938. crypto_box_SECRETKEYBYTES = 32,
  25939. crypto_box_BEFORENMBYTES = 32,
  25940. crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,
  25941. crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,
  25942. crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,
  25943. crypto_sign_BYTES = 64,
  25944. crypto_sign_PUBLICKEYBYTES = 32,
  25945. crypto_sign_SECRETKEYBYTES = 64,
  25946. crypto_sign_SEEDBYTES = 32,
  25947. crypto_hash_BYTES = 64;
  25948. nacl.lowlevel = {
  25949. crypto_core_hsalsa20: crypto_core_hsalsa20,
  25950. crypto_stream_xor: crypto_stream_xor,
  25951. crypto_stream: crypto_stream,
  25952. crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,
  25953. crypto_stream_salsa20: crypto_stream_salsa20,
  25954. crypto_onetimeauth: crypto_onetimeauth,
  25955. crypto_onetimeauth_verify: crypto_onetimeauth_verify,
  25956. crypto_verify_16: crypto_verify_16,
  25957. crypto_verify_32: crypto_verify_32,
  25958. crypto_secretbox: crypto_secretbox,
  25959. crypto_secretbox_open: crypto_secretbox_open,
  25960. crypto_scalarmult: crypto_scalarmult,
  25961. crypto_scalarmult_base: crypto_scalarmult_base,
  25962. crypto_box_beforenm: crypto_box_beforenm,
  25963. crypto_box_afternm: crypto_box_afternm,
  25964. crypto_box: crypto_box,
  25965. crypto_box_open: crypto_box_open,
  25966. crypto_box_keypair: crypto_box_keypair,
  25967. crypto_hash: crypto_hash,
  25968. crypto_sign: crypto_sign,
  25969. crypto_sign_keypair: crypto_sign_keypair,
  25970. crypto_sign_open: crypto_sign_open,
  25971. crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,
  25972. crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,
  25973. crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,
  25974. crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,
  25975. crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,
  25976. crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,
  25977. crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,
  25978. crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,
  25979. crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,
  25980. crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,
  25981. crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,
  25982. crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,
  25983. crypto_sign_BYTES: crypto_sign_BYTES,
  25984. crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,
  25985. crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,
  25986. crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,
  25987. crypto_hash_BYTES: crypto_hash_BYTES
  25988. };
  25989. /* High-level API */
  25990. function checkLengths(k, n) {
  25991. if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');
  25992. if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');
  25993. }
  25994. function checkBoxLengths(pk, sk) {
  25995. if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');
  25996. if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');
  25997. }
  25998. function checkArrayTypes() {
  25999. var t, i;
  26000. for (i = 0; i < arguments.length; i++) {
  26001. if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]')
  26002. throw new TypeError('unexpected type ' + t + ', use Uint8Array');
  26003. }
  26004. }
  26005. function cleanup(arr) {
  26006. for (var i = 0; i < arr.length; i++) arr[i] = 0;
  26007. }
  26008. // TODO: Completely remove this in v0.15.
  26009. if (!nacl.util) {
  26010. nacl.util = {};
  26011. nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() {
  26012. throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js');
  26013. };
  26014. }
  26015. nacl.randomBytes = function(n) {
  26016. var b = new Uint8Array(n);
  26017. randombytes(b, n);
  26018. return b;
  26019. };
  26020. nacl.secretbox = function(msg, nonce, key) {
  26021. checkArrayTypes(msg, nonce, key);
  26022. checkLengths(key, nonce);
  26023. var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);
  26024. var c = new Uint8Array(m.length);
  26025. for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];
  26026. crypto_secretbox(c, m, m.length, nonce, key);
  26027. return c.subarray(crypto_secretbox_BOXZEROBYTES);
  26028. };
  26029. nacl.secretbox.open = function(box, nonce, key) {
  26030. checkArrayTypes(box, nonce, key);
  26031. checkLengths(key, nonce);
  26032. var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);
  26033. var m = new Uint8Array(c.length);
  26034. for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];
  26035. if (c.length < 32) return false;
  26036. if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false;
  26037. return m.subarray(crypto_secretbox_ZEROBYTES);
  26038. };
  26039. nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;
  26040. nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;
  26041. nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;
  26042. nacl.scalarMult = function(n, p) {
  26043. checkArrayTypes(n, p);
  26044. if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
  26045. if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');
  26046. var q = new Uint8Array(crypto_scalarmult_BYTES);
  26047. crypto_scalarmult(q, n, p);
  26048. return q;
  26049. };
  26050. nacl.scalarMult.base = function(n) {
  26051. checkArrayTypes(n);
  26052. if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
  26053. var q = new Uint8Array(crypto_scalarmult_BYTES);
  26054. crypto_scalarmult_base(q, n);
  26055. return q;
  26056. };
  26057. nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;
  26058. nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;
  26059. nacl.box = function(msg, nonce, publicKey, secretKey) {
  26060. var k = nacl.box.before(publicKey, secretKey);
  26061. return nacl.secretbox(msg, nonce, k);
  26062. };
  26063. nacl.box.before = function(publicKey, secretKey) {
  26064. checkArrayTypes(publicKey, secretKey);
  26065. checkBoxLengths(publicKey, secretKey);
  26066. var k = new Uint8Array(crypto_box_BEFORENMBYTES);
  26067. crypto_box_beforenm(k, publicKey, secretKey);
  26068. return k;
  26069. };
  26070. nacl.box.after = nacl.secretbox;
  26071. nacl.box.open = function(msg, nonce, publicKey, secretKey) {
  26072. var k = nacl.box.before(publicKey, secretKey);
  26073. return nacl.secretbox.open(msg, nonce, k);
  26074. };
  26075. nacl.box.open.after = nacl.secretbox.open;
  26076. nacl.box.keyPair = function() {
  26077. var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
  26078. var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);
  26079. crypto_box_keypair(pk, sk);
  26080. return {publicKey: pk, secretKey: sk};
  26081. };
  26082. nacl.box.keyPair.fromSecretKey = function(secretKey) {
  26083. checkArrayTypes(secretKey);
  26084. if (secretKey.length !== crypto_box_SECRETKEYBYTES)
  26085. throw new Error('bad secret key size');
  26086. var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
  26087. crypto_scalarmult_base(pk, secretKey);
  26088. return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
  26089. };
  26090. nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;
  26091. nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;
  26092. nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;
  26093. nacl.box.nonceLength = crypto_box_NONCEBYTES;
  26094. nacl.box.overheadLength = nacl.secretbox.overheadLength;
  26095. nacl.sign = function(msg, secretKey) {
  26096. checkArrayTypes(msg, secretKey);
  26097. if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
  26098. throw new Error('bad secret key size');
  26099. var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);
  26100. crypto_sign(signedMsg, msg, msg.length, secretKey);
  26101. return signedMsg;
  26102. };
  26103. nacl.sign.open = function(signedMsg, publicKey) {
  26104. if (arguments.length !== 2)
  26105. throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?');
  26106. checkArrayTypes(signedMsg, publicKey);
  26107. if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
  26108. throw new Error('bad public key size');
  26109. var tmp = new Uint8Array(signedMsg.length);
  26110. var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);
  26111. if (mlen < 0) return null;
  26112. var m = new Uint8Array(mlen);
  26113. for (var i = 0; i < m.length; i++) m[i] = tmp[i];
  26114. return m;
  26115. };
  26116. nacl.sign.detached = function(msg, secretKey) {
  26117. var signedMsg = nacl.sign(msg, secretKey);
  26118. var sig = new Uint8Array(crypto_sign_BYTES);
  26119. for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];
  26120. return sig;
  26121. };
  26122. nacl.sign.detached.verify = function(msg, sig, publicKey) {
  26123. checkArrayTypes(msg, sig, publicKey);
  26124. if (sig.length !== crypto_sign_BYTES)
  26125. throw new Error('bad signature size');
  26126. if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
  26127. throw new Error('bad public key size');
  26128. var sm = new Uint8Array(crypto_sign_BYTES + msg.length);
  26129. var m = new Uint8Array(crypto_sign_BYTES + msg.length);
  26130. var i;
  26131. for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];
  26132. for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];
  26133. return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);
  26134. };
  26135. nacl.sign.keyPair = function() {
  26136. var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
  26137. var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
  26138. crypto_sign_keypair(pk, sk);
  26139. return {publicKey: pk, secretKey: sk};
  26140. };
  26141. nacl.sign.keyPair.fromSecretKey = function(secretKey) {
  26142. checkArrayTypes(secretKey);
  26143. if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
  26144. throw new Error('bad secret key size');
  26145. var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
  26146. for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];
  26147. return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
  26148. };
  26149. nacl.sign.keyPair.fromSeed = function(seed) {
  26150. checkArrayTypes(seed);
  26151. if (seed.length !== crypto_sign_SEEDBYTES)
  26152. throw new Error('bad seed size');
  26153. var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
  26154. var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
  26155. for (var i = 0; i < 32; i++) sk[i] = seed[i];
  26156. crypto_sign_keypair(pk, sk, true);
  26157. return {publicKey: pk, secretKey: sk};
  26158. };
  26159. nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;
  26160. nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;
  26161. nacl.sign.seedLength = crypto_sign_SEEDBYTES;
  26162. nacl.sign.signatureLength = crypto_sign_BYTES;
  26163. nacl.hash = function(msg) {
  26164. checkArrayTypes(msg);
  26165. var h = new Uint8Array(crypto_hash_BYTES);
  26166. crypto_hash(h, msg, msg.length);
  26167. return h;
  26168. };
  26169. nacl.hash.hashLength = crypto_hash_BYTES;
  26170. nacl.verify = function(x, y) {
  26171. checkArrayTypes(x, y);
  26172. // Zero length arguments are considered not equal.
  26173. if (x.length === 0 || y.length === 0) return false;
  26174. if (x.length !== y.length) return false;
  26175. return (vn(x, 0, y, 0, x.length) === 0) ? true : false;
  26176. };
  26177. nacl.setPRNG = function(fn) {
  26178. randombytes = fn;
  26179. };
  26180. (function() {
  26181. // Initialize PRNG if environment provides CSPRNG.
  26182. // If not, methods calling randombytes will throw.
  26183. var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;
  26184. if (crypto && crypto.getRandomValues) {
  26185. // Browsers.
  26186. var QUOTA = 65536;
  26187. nacl.setPRNG(function(x, n) {
  26188. var i, v = new Uint8Array(n);
  26189. for (i = 0; i < n; i += QUOTA) {
  26190. crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
  26191. }
  26192. for (i = 0; i < n; i++) x[i] = v[i];
  26193. cleanup(v);
  26194. });
  26195. } else if (true) {
  26196. // Node.js.
  26197. crypto = __webpack_require__(21);
  26198. if (crypto && crypto.randomBytes) {
  26199. nacl.setPRNG(function(x, n) {
  26200. var i, v = crypto.randomBytes(n);
  26201. for (i = 0; i < n; i++) x[i] = v[i];
  26202. cleanup(v);
  26203. });
  26204. }
  26205. }
  26206. })();
  26207. })(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));
  26208. /***/ }),
  26209. /* 73 */
  26210. /***/ (function(module, exports, __webpack_require__) {
  26211. "use strict";
  26212. /**
  26213. * Base prompt implementation
  26214. * Should be extended by prompt types.
  26215. */
  26216. var _promise;
  26217. function _load_promise() {
  26218. return _promise = _interopRequireDefault(__webpack_require__(7));
  26219. }
  26220. var _classCallCheck2;
  26221. function _load_classCallCheck() {
  26222. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  26223. }
  26224. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  26225. var _ = __webpack_require__(45);
  26226. var chalk = __webpack_require__(33);
  26227. var runAsync = __webpack_require__(172);
  26228. var _require = __webpack_require__(65),
  26229. filter = _require.filter,
  26230. flatMap = _require.flatMap,
  26231. share = _require.share,
  26232. take = _require.take,
  26233. takeUntil = _require.takeUntil;
  26234. var Choices = __webpack_require__(466);
  26235. var ScreenManager = __webpack_require__(477);
  26236. var Prompt = function () {
  26237. function Prompt(question, rl, answers) {
  26238. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Prompt);
  26239. // Setup instance defaults property
  26240. _.assign(this, {
  26241. answers: answers,
  26242. status: 'pending'
  26243. });
  26244. // Set defaults prompt options
  26245. this.opt = _.defaults(_.clone(question), {
  26246. validate: function validate() {
  26247. return true;
  26248. },
  26249. filter: function filter(val) {
  26250. return val;
  26251. },
  26252. when: function when() {
  26253. return true;
  26254. },
  26255. suffix: '',
  26256. prefix: chalk.green('?')
  26257. });
  26258. // Make sure name is present
  26259. if (!this.opt.name) {
  26260. this.throwParamError('name');
  26261. }
  26262. // Set default message if no message defined
  26263. if (!this.opt.message) {
  26264. this.opt.message = this.opt.name + ':';
  26265. }
  26266. // Normalize choices
  26267. if (Array.isArray(this.opt.choices)) {
  26268. this.opt.choices = new Choices(this.opt.choices, answers);
  26269. }
  26270. this.rl = rl;
  26271. this.screen = new ScreenManager(this.rl);
  26272. }
  26273. /**
  26274. * Start the Inquiry session and manage output value filtering
  26275. * @return {Promise}
  26276. */
  26277. Prompt.prototype.run = function run() {
  26278. var _this = this;
  26279. return new (_promise || _load_promise()).default(function (resolve) {
  26280. _this._run(function (value) {
  26281. return resolve(value);
  26282. });
  26283. });
  26284. };
  26285. // Default noop (this one should be overwritten in prompts)
  26286. Prompt.prototype._run = function _run(cb) {
  26287. cb();
  26288. };
  26289. /**
  26290. * Throw an error telling a required parameter is missing
  26291. * @param {String} name Name of the missing param
  26292. * @return {Throw Error}
  26293. */
  26294. Prompt.prototype.throwParamError = function throwParamError(name) {
  26295. throw new Error('You must provide a `' + name + '` parameter');
  26296. };
  26297. /**
  26298. * Called when the UI closes. Override to do any specific cleanup necessary
  26299. */
  26300. Prompt.prototype.close = function close() {
  26301. this.screen.releaseCursor();
  26302. };
  26303. /**
  26304. * Run the provided validation method each time a submit event occur.
  26305. * @param {Rx.Observable} submit - submit event flow
  26306. * @return {Object} Object containing two observables: `success` and `error`
  26307. */
  26308. Prompt.prototype.handleSubmitEvents = function handleSubmitEvents(submit) {
  26309. var self = this;
  26310. var validate = runAsync(this.opt.validate);
  26311. var asyncFilter = runAsync(this.opt.filter);
  26312. var validation = submit.pipe(flatMap(function (value) {
  26313. return asyncFilter(value, self.answers).then(function (filteredValue) {
  26314. return validate(filteredValue, self.answers).then(function (isValid) {
  26315. return { isValid: isValid, value: filteredValue };
  26316. }, function (err) {
  26317. return { isValid: err };
  26318. });
  26319. }, function (err) {
  26320. return { isValid: err };
  26321. });
  26322. }), share());
  26323. var success = validation.pipe(filter(function (state) {
  26324. return state.isValid === true;
  26325. }), take(1));
  26326. var error = validation.pipe(filter(function (state) {
  26327. return state.isValid !== true;
  26328. }), takeUntil(success));
  26329. return {
  26330. success: success,
  26331. error: error
  26332. };
  26333. };
  26334. /**
  26335. * Generate the prompt question string
  26336. * @return {String} prompt question string
  26337. */
  26338. Prompt.prototype.getQuestion = function getQuestion() {
  26339. var message = this.opt.prefix + ' ' + chalk.bold(this.opt.message) + this.opt.suffix + chalk.reset(' ');
  26340. // Append the default if available, and if question isn't answered
  26341. if (this.opt.default != null && this.status !== 'answered') {
  26342. // If default password is supplied, hide it
  26343. if (this.opt.type === 'password') {
  26344. message += chalk.italic.dim('[hidden] ');
  26345. } else {
  26346. message += chalk.dim('(' + this.opt.default + ') ');
  26347. }
  26348. }
  26349. return message;
  26350. };
  26351. return Prompt;
  26352. }();
  26353. module.exports = Prompt;
  26354. /***/ }),
  26355. /* 74 */
  26356. /***/ (function(module, exports, __webpack_require__) {
  26357. "use strict";
  26358. var _require = __webpack_require__(173),
  26359. fromEvent = _require.fromEvent;
  26360. var _require2 = __webpack_require__(65),
  26361. filter = _require2.filter,
  26362. map = _require2.map,
  26363. share = _require2.share;
  26364. function normalizeKeypressEvents(value, key) {
  26365. return { value: value, key: key || {} };
  26366. }
  26367. module.exports = function (rl) {
  26368. var keypress = fromEvent(rl.input, 'keypress', normalizeKeypressEvents)
  26369. // Ignore `enter` key. On the readline, we only care about the `line` event.
  26370. .pipe(filter(function (_ref) {
  26371. var key = _ref.key;
  26372. return key.name !== 'enter' && key.name !== 'return';
  26373. }));
  26374. return {
  26375. line: fromEvent(rl, 'line'),
  26376. keypress: keypress,
  26377. normalizedUpKey: keypress.pipe(filter(function (_ref2) {
  26378. var key = _ref2.key;
  26379. return key.name === 'up' || key.name === 'k' || key.name === 'p' && key.ctrl;
  26380. }), share()),
  26381. normalizedDownKey: keypress.pipe(filter(function (_ref3) {
  26382. var key = _ref3.key;
  26383. return key.name === 'down' || key.name === 'j' || key.name === 'n' && key.ctrl;
  26384. }), share()),
  26385. numberKey: keypress.pipe(filter(function (e) {
  26386. return e.value && '123456789'.indexOf(e.value) >= 0;
  26387. }), map(function (e) {
  26388. return Number(e.value);
  26389. }), share()),
  26390. spaceKey: keypress.pipe(filter(function (_ref4) {
  26391. var key = _ref4.key;
  26392. return key && key.name === 'space';
  26393. }), share()),
  26394. aKey: keypress.pipe(filter(function (_ref5) {
  26395. var key = _ref5.key;
  26396. return key && key.name === 'a';
  26397. }), share()),
  26398. iKey: keypress.pipe(filter(function (_ref6) {
  26399. var key = _ref6.key;
  26400. return key && key.name === 'i';
  26401. }), share())
  26402. };
  26403. };
  26404. /***/ }),
  26405. /* 75 */
  26406. /***/ (function(module, exports, __webpack_require__) {
  26407. "use strict";
  26408. Object.defineProperty(exports, "__esModule", {
  26409. value: true
  26410. });
  26411. exports.hostedGit = exports.registries = undefined;
  26412. var _classCallCheck2;
  26413. function _load_classCallCheck() {
  26414. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  26415. }
  26416. var _possibleConstructorReturn2;
  26417. function _load_possibleConstructorReturn() {
  26418. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  26419. }
  26420. var _inherits2;
  26421. function _load_inherits() {
  26422. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  26423. }
  26424. var _getIterator2;
  26425. function _load_getIterator() {
  26426. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  26427. }
  26428. var _set;
  26429. function _load_set() {
  26430. return _set = _interopRequireDefault(__webpack_require__(16));
  26431. }
  26432. exports.getExoticResolver = getExoticResolver;
  26433. exports.hostedGitFragmentToGitUrl = hostedGitFragmentToGitUrl;
  26434. var _baseResolver;
  26435. function _load_baseResolver() {
  26436. return _baseResolver = _interopRequireDefault(__webpack_require__(118));
  26437. }
  26438. var _npmResolver;
  26439. function _load_npmResolver() {
  26440. return _npmResolver = _interopRequireDefault(__webpack_require__(204));
  26441. }
  26442. var _yarnResolver;
  26443. function _load_yarnResolver() {
  26444. return _yarnResolver = _interopRequireDefault(__webpack_require__(532));
  26445. }
  26446. var _gitResolver;
  26447. function _load_gitResolver() {
  26448. return _gitResolver = _interopRequireDefault(__webpack_require__(119));
  26449. }
  26450. var _tarballResolver;
  26451. function _load_tarballResolver() {
  26452. return _tarballResolver = _interopRequireDefault(__webpack_require__(530));
  26453. }
  26454. var _githubResolver;
  26455. function _load_githubResolver() {
  26456. return _githubResolver = _interopRequireDefault(__webpack_require__(304));
  26457. }
  26458. var _fileResolver;
  26459. function _load_fileResolver() {
  26460. return _fileResolver = _interopRequireDefault(__webpack_require__(202));
  26461. }
  26462. var _linkResolver;
  26463. function _load_linkResolver() {
  26464. return _linkResolver = _interopRequireDefault(__webpack_require__(305));
  26465. }
  26466. var _gitlabResolver;
  26467. function _load_gitlabResolver() {
  26468. return _gitlabResolver = _interopRequireDefault(__webpack_require__(528));
  26469. }
  26470. var _gistResolver;
  26471. function _load_gistResolver() {
  26472. return _gistResolver = _interopRequireDefault(__webpack_require__(203));
  26473. }
  26474. var _bitbucketResolver;
  26475. function _load_bitbucketResolver() {
  26476. return _bitbucketResolver = _interopRequireDefault(__webpack_require__(527));
  26477. }
  26478. var _hostedGitResolver;
  26479. function _load_hostedGitResolver() {
  26480. return _hostedGitResolver = __webpack_require__(99);
  26481. }
  26482. var _registryResolver;
  26483. function _load_registryResolver() {
  26484. return _registryResolver = _interopRequireDefault(__webpack_require__(529));
  26485. }
  26486. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  26487. var registries = exports.registries = {
  26488. npm: (_npmResolver || _load_npmResolver()).default,
  26489. yarn: (_yarnResolver || _load_yarnResolver()).default
  26490. };
  26491. //
  26492. var exotics = new (_set || _load_set()).default([(_gitResolver || _load_gitResolver()).default, (_tarballResolver || _load_tarballResolver()).default, (_githubResolver || _load_githubResolver()).default, (_fileResolver || _load_fileResolver()).default, (_linkResolver || _load_linkResolver()).default, (_gitlabResolver || _load_gitlabResolver()).default, (_gistResolver || _load_gistResolver()).default, (_bitbucketResolver || _load_bitbucketResolver()).default]);
  26493. function getExoticResolver(pattern) {
  26494. for (var _iterator = exotics, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  26495. var _ref;
  26496. if (_isArray) {
  26497. if (_i >= _iterator.length) break;
  26498. _ref = _iterator[_i++];
  26499. } else {
  26500. _i = _iterator.next();
  26501. if (_i.done) break;
  26502. _ref = _i.value;
  26503. }
  26504. var Resolver = _ref;
  26505. if (Resolver.isVersion(pattern)) {
  26506. return Resolver;
  26507. }
  26508. }
  26509. return null;
  26510. }
  26511. //
  26512. var hostedGit = exports.hostedGit = {
  26513. github: (_githubResolver || _load_githubResolver()).default,
  26514. gitlab: (_gitlabResolver || _load_gitlabResolver()).default,
  26515. bitbucket: (_bitbucketResolver || _load_bitbucketResolver()).default
  26516. };
  26517. function hostedGitFragmentToGitUrl(fragment, reporter) {
  26518. for (var key in hostedGit) {
  26519. var Resolver = hostedGit[key];
  26520. if (Resolver.isVersion(fragment)) {
  26521. return Resolver.getGitHTTPUrl((0, (_hostedGitResolver || _load_hostedGitResolver()).explodeHostedGitFragment)(fragment, reporter));
  26522. }
  26523. }
  26524. return fragment;
  26525. }
  26526. //
  26527. for (var key in registries) {
  26528. var _class, _temp;
  26529. var RegistryResolver = registries[key];
  26530. exotics.add((_temp = _class = function (_ExoticRegistryResolv) {
  26531. (0, (_inherits2 || _load_inherits()).default)(_class, _ExoticRegistryResolv);
  26532. function _class() {
  26533. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, _class);
  26534. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticRegistryResolv.apply(this, arguments));
  26535. }
  26536. return _class;
  26537. }((_registryResolver || _load_registryResolver()).default), _class.protocol = key, _class.factory = RegistryResolver, _temp));
  26538. }
  26539. /***/ }),
  26540. /* 76 */
  26541. /***/ (function(module, exports) {
  26542. module.exports = function (exec) {
  26543. try {
  26544. return !!exec();
  26545. } catch (e) {
  26546. return true;
  26547. }
  26548. };
  26549. /***/ }),
  26550. /* 77 */
  26551. /***/ (function(module, exports, __webpack_require__) {
  26552. var dP = __webpack_require__(63);
  26553. var createDesc = __webpack_require__(127);
  26554. module.exports = __webpack_require__(69) ? function (object, key, value) {
  26555. return dP.f(object, key, createDesc(1, value));
  26556. } : function (object, key, value) {
  26557. object[key] = value;
  26558. return object;
  26559. };
  26560. /***/ }),
  26561. /* 78 */
  26562. /***/ (function(module, exports, __webpack_require__) {
  26563. try {
  26564. var util = __webpack_require__(9);
  26565. if (typeof util.inherits !== 'function') throw '';
  26566. module.exports = util.inherits;
  26567. } catch (e) {
  26568. module.exports = __webpack_require__(746);
  26569. }
  26570. /***/ }),
  26571. /* 79 */
  26572. /***/ (function(module, exports, __webpack_require__) {
  26573. (function(){
  26574. // Copyright (c) 2005 Tom Wu
  26575. // All Rights Reserved.
  26576. // See "LICENSE" for details.
  26577. // Basic JavaScript BN library - subset useful for RSA encryption.
  26578. // Bits per digit
  26579. var dbits;
  26580. // JavaScript engine analysis
  26581. var canary = 0xdeadbeefcafe;
  26582. var j_lm = ((canary&0xffffff)==0xefcafe);
  26583. // (public) Constructor
  26584. function BigInteger(a,b,c) {
  26585. if(a != null)
  26586. if("number" == typeof a) this.fromNumber(a,b,c);
  26587. else if(b == null && "string" != typeof a) this.fromString(a,256);
  26588. else this.fromString(a,b);
  26589. }
  26590. // return new, unset BigInteger
  26591. function nbi() { return new BigInteger(null); }
  26592. // am: Compute w_j += (x*this_i), propagate carries,
  26593. // c is initial carry, returns final carry.
  26594. // c < 3*dvalue, x < 2*dvalue, this_i < dvalue
  26595. // We need to select the fastest one that works in this environment.
  26596. // am1: use a single mult and divide to get the high bits,
  26597. // max digit bits should be 26 because
  26598. // max internal value = 2*dvalue^2-2*dvalue (< 2^53)
  26599. function am1(i,x,w,j,c,n) {
  26600. while(--n >= 0) {
  26601. var v = x*this[i++]+w[j]+c;
  26602. c = Math.floor(v/0x4000000);
  26603. w[j++] = v&0x3ffffff;
  26604. }
  26605. return c;
  26606. }
  26607. // am2 avoids a big mult-and-extract completely.
  26608. // Max digit bits should be <= 30 because we do bitwise ops
  26609. // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
  26610. function am2(i,x,w,j,c,n) {
  26611. var xl = x&0x7fff, xh = x>>15;
  26612. while(--n >= 0) {
  26613. var l = this[i]&0x7fff;
  26614. var h = this[i++]>>15;
  26615. var m = xh*l+h*xl;
  26616. l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
  26617. c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
  26618. w[j++] = l&0x3fffffff;
  26619. }
  26620. return c;
  26621. }
  26622. // Alternately, set max digit bits to 28 since some
  26623. // browsers slow down when dealing with 32-bit numbers.
  26624. function am3(i,x,w,j,c,n) {
  26625. var xl = x&0x3fff, xh = x>>14;
  26626. while(--n >= 0) {
  26627. var l = this[i]&0x3fff;
  26628. var h = this[i++]>>14;
  26629. var m = xh*l+h*xl;
  26630. l = xl*l+((m&0x3fff)<<14)+w[j]+c;
  26631. c = (l>>28)+(m>>14)+xh*h;
  26632. w[j++] = l&0xfffffff;
  26633. }
  26634. return c;
  26635. }
  26636. var inBrowser = typeof navigator !== "undefined";
  26637. if(inBrowser && j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
  26638. BigInteger.prototype.am = am2;
  26639. dbits = 30;
  26640. }
  26641. else if(inBrowser && j_lm && (navigator.appName != "Netscape")) {
  26642. BigInteger.prototype.am = am1;
  26643. dbits = 26;
  26644. }
  26645. else { // Mozilla/Netscape seems to prefer am3
  26646. BigInteger.prototype.am = am3;
  26647. dbits = 28;
  26648. }
  26649. BigInteger.prototype.DB = dbits;
  26650. BigInteger.prototype.DM = ((1<<dbits)-1);
  26651. BigInteger.prototype.DV = (1<<dbits);
  26652. var BI_FP = 52;
  26653. BigInteger.prototype.FV = Math.pow(2,BI_FP);
  26654. BigInteger.prototype.F1 = BI_FP-dbits;
  26655. BigInteger.prototype.F2 = 2*dbits-BI_FP;
  26656. // Digit conversions
  26657. var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
  26658. var BI_RC = new Array();
  26659. var rr,vv;
  26660. rr = "0".charCodeAt(0);
  26661. for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
  26662. rr = "a".charCodeAt(0);
  26663. for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
  26664. rr = "A".charCodeAt(0);
  26665. for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
  26666. function int2char(n) { return BI_RM.charAt(n); }
  26667. function intAt(s,i) {
  26668. var c = BI_RC[s.charCodeAt(i)];
  26669. return (c==null)?-1:c;
  26670. }
  26671. // (protected) copy this to r
  26672. function bnpCopyTo(r) {
  26673. for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
  26674. r.t = this.t;
  26675. r.s = this.s;
  26676. }
  26677. // (protected) set from integer value x, -DV <= x < DV
  26678. function bnpFromInt(x) {
  26679. this.t = 1;
  26680. this.s = (x<0)?-1:0;
  26681. if(x > 0) this[0] = x;
  26682. else if(x < -1) this[0] = x+this.DV;
  26683. else this.t = 0;
  26684. }
  26685. // return bigint initialized to value
  26686. function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
  26687. // (protected) set from string and radix
  26688. function bnpFromString(s,b) {
  26689. var k;
  26690. if(b == 16) k = 4;
  26691. else if(b == 8) k = 3;
  26692. else if(b == 256) k = 8; // byte array
  26693. else if(b == 2) k = 1;
  26694. else if(b == 32) k = 5;
  26695. else if(b == 4) k = 2;
  26696. else { this.fromRadix(s,b); return; }
  26697. this.t = 0;
  26698. this.s = 0;
  26699. var i = s.length, mi = false, sh = 0;
  26700. while(--i >= 0) {
  26701. var x = (k==8)?s[i]&0xff:intAt(s,i);
  26702. if(x < 0) {
  26703. if(s.charAt(i) == "-") mi = true;
  26704. continue;
  26705. }
  26706. mi = false;
  26707. if(sh == 0)
  26708. this[this.t++] = x;
  26709. else if(sh+k > this.DB) {
  26710. this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;
  26711. this[this.t++] = (x>>(this.DB-sh));
  26712. }
  26713. else
  26714. this[this.t-1] |= x<<sh;
  26715. sh += k;
  26716. if(sh >= this.DB) sh -= this.DB;
  26717. }
  26718. if(k == 8 && (s[0]&0x80) != 0) {
  26719. this.s = -1;
  26720. if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;
  26721. }
  26722. this.clamp();
  26723. if(mi) BigInteger.ZERO.subTo(this,this);
  26724. }
  26725. // (protected) clamp off excess high words
  26726. function bnpClamp() {
  26727. var c = this.s&this.DM;
  26728. while(this.t > 0 && this[this.t-1] == c) --this.t;
  26729. }
  26730. // (public) return string representation in given radix
  26731. function bnToString(b) {
  26732. if(this.s < 0) return "-"+this.negate().toString(b);
  26733. var k;
  26734. if(b == 16) k = 4;
  26735. else if(b == 8) k = 3;
  26736. else if(b == 2) k = 1;
  26737. else if(b == 32) k = 5;
  26738. else if(b == 4) k = 2;
  26739. else return this.toRadix(b);
  26740. var km = (1<<k)-1, d, m = false, r = "", i = this.t;
  26741. var p = this.DB-(i*this.DB)%k;
  26742. if(i-- > 0) {
  26743. if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
  26744. while(i >= 0) {
  26745. if(p < k) {
  26746. d = (this[i]&((1<<p)-1))<<(k-p);
  26747. d |= this[--i]>>(p+=this.DB-k);
  26748. }
  26749. else {
  26750. d = (this[i]>>(p-=k))&km;
  26751. if(p <= 0) { p += this.DB; --i; }
  26752. }
  26753. if(d > 0) m = true;
  26754. if(m) r += int2char(d);
  26755. }
  26756. }
  26757. return m?r:"0";
  26758. }
  26759. // (public) -this
  26760. function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
  26761. // (public) |this|
  26762. function bnAbs() { return (this.s<0)?this.negate():this; }
  26763. // (public) return + if this > a, - if this < a, 0 if equal
  26764. function bnCompareTo(a) {
  26765. var r = this.s-a.s;
  26766. if(r != 0) return r;
  26767. var i = this.t;
  26768. r = i-a.t;
  26769. if(r != 0) return (this.s<0)?-r:r;
  26770. while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
  26771. return 0;
  26772. }
  26773. // returns bit length of the integer x
  26774. function nbits(x) {
  26775. var r = 1, t;
  26776. if((t=x>>>16) != 0) { x = t; r += 16; }
  26777. if((t=x>>8) != 0) { x = t; r += 8; }
  26778. if((t=x>>4) != 0) { x = t; r += 4; }
  26779. if((t=x>>2) != 0) { x = t; r += 2; }
  26780. if((t=x>>1) != 0) { x = t; r += 1; }
  26781. return r;
  26782. }
  26783. // (public) return the number of bits in "this"
  26784. function bnBitLength() {
  26785. if(this.t <= 0) return 0;
  26786. return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
  26787. }
  26788. // (protected) r = this << n*DB
  26789. function bnpDLShiftTo(n,r) {
  26790. var i;
  26791. for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
  26792. for(i = n-1; i >= 0; --i) r[i] = 0;
  26793. r.t = this.t+n;
  26794. r.s = this.s;
  26795. }
  26796. // (protected) r = this >> n*DB
  26797. function bnpDRShiftTo(n,r) {
  26798. for(var i = n; i < this.t; ++i) r[i-n] = this[i];
  26799. r.t = Math.max(this.t-n,0);
  26800. r.s = this.s;
  26801. }
  26802. // (protected) r = this << n
  26803. function bnpLShiftTo(n,r) {
  26804. var bs = n%this.DB;
  26805. var cbs = this.DB-bs;
  26806. var bm = (1<<cbs)-1;
  26807. var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;
  26808. for(i = this.t-1; i >= 0; --i) {
  26809. r[i+ds+1] = (this[i]>>cbs)|c;
  26810. c = (this[i]&bm)<<bs;
  26811. }
  26812. for(i = ds-1; i >= 0; --i) r[i] = 0;
  26813. r[ds] = c;
  26814. r.t = this.t+ds+1;
  26815. r.s = this.s;
  26816. r.clamp();
  26817. }
  26818. // (protected) r = this >> n
  26819. function bnpRShiftTo(n,r) {
  26820. r.s = this.s;
  26821. var ds = Math.floor(n/this.DB);
  26822. if(ds >= this.t) { r.t = 0; return; }
  26823. var bs = n%this.DB;
  26824. var cbs = this.DB-bs;
  26825. var bm = (1<<bs)-1;
  26826. r[0] = this[ds]>>bs;
  26827. for(var i = ds+1; i < this.t; ++i) {
  26828. r[i-ds-1] |= (this[i]&bm)<<cbs;
  26829. r[i-ds] = this[i]>>bs;
  26830. }
  26831. if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;
  26832. r.t = this.t-ds;
  26833. r.clamp();
  26834. }
  26835. // (protected) r = this - a
  26836. function bnpSubTo(a,r) {
  26837. var i = 0, c = 0, m = Math.min(a.t,this.t);
  26838. while(i < m) {
  26839. c += this[i]-a[i];
  26840. r[i++] = c&this.DM;
  26841. c >>= this.DB;
  26842. }
  26843. if(a.t < this.t) {
  26844. c -= a.s;
  26845. while(i < this.t) {
  26846. c += this[i];
  26847. r[i++] = c&this.DM;
  26848. c >>= this.DB;
  26849. }
  26850. c += this.s;
  26851. }
  26852. else {
  26853. c += this.s;
  26854. while(i < a.t) {
  26855. c -= a[i];
  26856. r[i++] = c&this.DM;
  26857. c >>= this.DB;
  26858. }
  26859. c -= a.s;
  26860. }
  26861. r.s = (c<0)?-1:0;
  26862. if(c < -1) r[i++] = this.DV+c;
  26863. else if(c > 0) r[i++] = c;
  26864. r.t = i;
  26865. r.clamp();
  26866. }
  26867. // (protected) r = this * a, r != this,a (HAC 14.12)
  26868. // "this" should be the larger one if appropriate.
  26869. function bnpMultiplyTo(a,r) {
  26870. var x = this.abs(), y = a.abs();
  26871. var i = x.t;
  26872. r.t = i+y.t;
  26873. while(--i >= 0) r[i] = 0;
  26874. for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
  26875. r.s = 0;
  26876. r.clamp();
  26877. if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
  26878. }
  26879. // (protected) r = this^2, r != this (HAC 14.16)
  26880. function bnpSquareTo(r) {
  26881. var x = this.abs();
  26882. var i = r.t = 2*x.t;
  26883. while(--i >= 0) r[i] = 0;
  26884. for(i = 0; i < x.t-1; ++i) {
  26885. var c = x.am(i,x[i],r,2*i,0,1);
  26886. if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
  26887. r[i+x.t] -= x.DV;
  26888. r[i+x.t+1] = 1;
  26889. }
  26890. }
  26891. if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
  26892. r.s = 0;
  26893. r.clamp();
  26894. }
  26895. // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
  26896. // r != q, this != m. q or r may be null.
  26897. function bnpDivRemTo(m,q,r) {
  26898. var pm = m.abs();
  26899. if(pm.t <= 0) return;
  26900. var pt = this.abs();
  26901. if(pt.t < pm.t) {
  26902. if(q != null) q.fromInt(0);
  26903. if(r != null) this.copyTo(r);
  26904. return;
  26905. }
  26906. if(r == null) r = nbi();
  26907. var y = nbi(), ts = this.s, ms = m.s;
  26908. var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus
  26909. if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
  26910. else { pm.copyTo(y); pt.copyTo(r); }
  26911. var ys = y.t;
  26912. var y0 = y[ys-1];
  26913. if(y0 == 0) return;
  26914. var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);
  26915. var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;
  26916. var i = r.t, j = i-ys, t = (q==null)?nbi():q;
  26917. y.dlShiftTo(j,t);
  26918. if(r.compareTo(t) >= 0) {
  26919. r[r.t++] = 1;
  26920. r.subTo(t,r);
  26921. }
  26922. BigInteger.ONE.dlShiftTo(ys,t);
  26923. t.subTo(y,y); // "negative" y so we can replace sub with am later
  26924. while(y.t < ys) y[y.t++] = 0;
  26925. while(--j >= 0) {
  26926. // Estimate quotient digit
  26927. var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
  26928. if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
  26929. y.dlShiftTo(j,t);
  26930. r.subTo(t,r);
  26931. while(r[i] < --qd) r.subTo(t,r);
  26932. }
  26933. }
  26934. if(q != null) {
  26935. r.drShiftTo(ys,q);
  26936. if(ts != ms) BigInteger.ZERO.subTo(q,q);
  26937. }
  26938. r.t = ys;
  26939. r.clamp();
  26940. if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
  26941. if(ts < 0) BigInteger.ZERO.subTo(r,r);
  26942. }
  26943. // (public) this mod a
  26944. function bnMod(a) {
  26945. var r = nbi();
  26946. this.abs().divRemTo(a,null,r);
  26947. if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
  26948. return r;
  26949. }
  26950. // Modular reduction using "classic" algorithm
  26951. function Classic(m) { this.m = m; }
  26952. function cConvert(x) {
  26953. if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
  26954. else return x;
  26955. }
  26956. function cRevert(x) { return x; }
  26957. function cReduce(x) { x.divRemTo(this.m,null,x); }
  26958. function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
  26959. function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
  26960. Classic.prototype.convert = cConvert;
  26961. Classic.prototype.revert = cRevert;
  26962. Classic.prototype.reduce = cReduce;
  26963. Classic.prototype.mulTo = cMulTo;
  26964. Classic.prototype.sqrTo = cSqrTo;
  26965. // (protected) return "-1/this % 2^DB"; useful for Mont. reduction
  26966. // justification:
  26967. // xy == 1 (mod m)
  26968. // xy = 1+km
  26969. // xy(2-xy) = (1+km)(1-km)
  26970. // x[y(2-xy)] = 1-k^2m^2
  26971. // x[y(2-xy)] == 1 (mod m^2)
  26972. // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
  26973. // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
  26974. // JS multiply "overflows" differently from C/C++, so care is needed here.
  26975. function bnpInvDigit() {
  26976. if(this.t < 1) return 0;
  26977. var x = this[0];
  26978. if((x&1) == 0) return 0;
  26979. var y = x&3; // y == 1/x mod 2^2
  26980. y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
  26981. y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
  26982. y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
  26983. // last step - calculate inverse mod DV directly;
  26984. // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
  26985. y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
  26986. // we really want the negative inverse, and -DV < y < DV
  26987. return (y>0)?this.DV-y:-y;
  26988. }
  26989. // Montgomery reduction
  26990. function Montgomery(m) {
  26991. this.m = m;
  26992. this.mp = m.invDigit();
  26993. this.mpl = this.mp&0x7fff;
  26994. this.mph = this.mp>>15;
  26995. this.um = (1<<(m.DB-15))-1;
  26996. this.mt2 = 2*m.t;
  26997. }
  26998. // xR mod m
  26999. function montConvert(x) {
  27000. var r = nbi();
  27001. x.abs().dlShiftTo(this.m.t,r);
  27002. r.divRemTo(this.m,null,r);
  27003. if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
  27004. return r;
  27005. }
  27006. // x/R mod m
  27007. function montRevert(x) {
  27008. var r = nbi();
  27009. x.copyTo(r);
  27010. this.reduce(r);
  27011. return r;
  27012. }
  27013. // x = x/R mod m (HAC 14.32)
  27014. function montReduce(x) {
  27015. while(x.t <= this.mt2) // pad x so am has enough room later
  27016. x[x.t++] = 0;
  27017. for(var i = 0; i < this.m.t; ++i) {
  27018. // faster way of calculating u0 = x[i]*mp mod DV
  27019. var j = x[i]&0x7fff;
  27020. var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
  27021. // use am to combine the multiply-shift-add into one call
  27022. j = i+this.m.t;
  27023. x[j] += this.m.am(0,u0,x,i,0,this.m.t);
  27024. // propagate carry
  27025. while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
  27026. }
  27027. x.clamp();
  27028. x.drShiftTo(this.m.t,x);
  27029. if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
  27030. }
  27031. // r = "x^2/R mod m"; x != r
  27032. function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
  27033. // r = "xy/R mod m"; x,y != r
  27034. function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
  27035. Montgomery.prototype.convert = montConvert;
  27036. Montgomery.prototype.revert = montRevert;
  27037. Montgomery.prototype.reduce = montReduce;
  27038. Montgomery.prototype.mulTo = montMulTo;
  27039. Montgomery.prototype.sqrTo = montSqrTo;
  27040. // (protected) true iff this is even
  27041. function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
  27042. // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
  27043. function bnpExp(e,z) {
  27044. if(e > 0xffffffff || e < 1) return BigInteger.ONE;
  27045. var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
  27046. g.copyTo(r);
  27047. while(--i >= 0) {
  27048. z.sqrTo(r,r2);
  27049. if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
  27050. else { var t = r; r = r2; r2 = t; }
  27051. }
  27052. return z.revert(r);
  27053. }
  27054. // (public) this^e % m, 0 <= e < 2^32
  27055. function bnModPowInt(e,m) {
  27056. var z;
  27057. if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
  27058. return this.exp(e,z);
  27059. }
  27060. // protected
  27061. BigInteger.prototype.copyTo = bnpCopyTo;
  27062. BigInteger.prototype.fromInt = bnpFromInt;
  27063. BigInteger.prototype.fromString = bnpFromString;
  27064. BigInteger.prototype.clamp = bnpClamp;
  27065. BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
  27066. BigInteger.prototype.drShiftTo = bnpDRShiftTo;
  27067. BigInteger.prototype.lShiftTo = bnpLShiftTo;
  27068. BigInteger.prototype.rShiftTo = bnpRShiftTo;
  27069. BigInteger.prototype.subTo = bnpSubTo;
  27070. BigInteger.prototype.multiplyTo = bnpMultiplyTo;
  27071. BigInteger.prototype.squareTo = bnpSquareTo;
  27072. BigInteger.prototype.divRemTo = bnpDivRemTo;
  27073. BigInteger.prototype.invDigit = bnpInvDigit;
  27074. BigInteger.prototype.isEven = bnpIsEven;
  27075. BigInteger.prototype.exp = bnpExp;
  27076. // public
  27077. BigInteger.prototype.toString = bnToString;
  27078. BigInteger.prototype.negate = bnNegate;
  27079. BigInteger.prototype.abs = bnAbs;
  27080. BigInteger.prototype.compareTo = bnCompareTo;
  27081. BigInteger.prototype.bitLength = bnBitLength;
  27082. BigInteger.prototype.mod = bnMod;
  27083. BigInteger.prototype.modPowInt = bnModPowInt;
  27084. // "constants"
  27085. BigInteger.ZERO = nbv(0);
  27086. BigInteger.ONE = nbv(1);
  27087. // Copyright (c) 2005-2009 Tom Wu
  27088. // All Rights Reserved.
  27089. // See "LICENSE" for details.
  27090. // Extended JavaScript BN functions, required for RSA private ops.
  27091. // Version 1.1: new BigInteger("0", 10) returns "proper" zero
  27092. // Version 1.2: square() API, isProbablePrime fix
  27093. // (public)
  27094. function bnClone() { var r = nbi(); this.copyTo(r); return r; }
  27095. // (public) return value as integer
  27096. function bnIntValue() {
  27097. if(this.s < 0) {
  27098. if(this.t == 1) return this[0]-this.DV;
  27099. else if(this.t == 0) return -1;
  27100. }
  27101. else if(this.t == 1) return this[0];
  27102. else if(this.t == 0) return 0;
  27103. // assumes 16 < DB < 32
  27104. return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];
  27105. }
  27106. // (public) return value as byte
  27107. function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }
  27108. // (public) return value as short (assumes DB>=16)
  27109. function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }
  27110. // (protected) return x s.t. r^x < DV
  27111. function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
  27112. // (public) 0 if this == 0, 1 if this > 0
  27113. function bnSigNum() {
  27114. if(this.s < 0) return -1;
  27115. else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
  27116. else return 1;
  27117. }
  27118. // (protected) convert to radix string
  27119. function bnpToRadix(b) {
  27120. if(b == null) b = 10;
  27121. if(this.signum() == 0 || b < 2 || b > 36) return "0";
  27122. var cs = this.chunkSize(b);
  27123. var a = Math.pow(b,cs);
  27124. var d = nbv(a), y = nbi(), z = nbi(), r = "";
  27125. this.divRemTo(d,y,z);
  27126. while(y.signum() > 0) {
  27127. r = (a+z.intValue()).toString(b).substr(1) + r;
  27128. y.divRemTo(d,y,z);
  27129. }
  27130. return z.intValue().toString(b) + r;
  27131. }
  27132. // (protected) convert from radix string
  27133. function bnpFromRadix(s,b) {
  27134. this.fromInt(0);
  27135. if(b == null) b = 10;
  27136. var cs = this.chunkSize(b);
  27137. var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
  27138. for(var i = 0; i < s.length; ++i) {
  27139. var x = intAt(s,i);
  27140. if(x < 0) {
  27141. if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
  27142. continue;
  27143. }
  27144. w = b*w+x;
  27145. if(++j >= cs) {
  27146. this.dMultiply(d);
  27147. this.dAddOffset(w,0);
  27148. j = 0;
  27149. w = 0;
  27150. }
  27151. }
  27152. if(j > 0) {
  27153. this.dMultiply(Math.pow(b,j));
  27154. this.dAddOffset(w,0);
  27155. }
  27156. if(mi) BigInteger.ZERO.subTo(this,this);
  27157. }
  27158. // (protected) alternate constructor
  27159. function bnpFromNumber(a,b,c) {
  27160. if("number" == typeof b) {
  27161. // new BigInteger(int,int,RNG)
  27162. if(a < 2) this.fromInt(1);
  27163. else {
  27164. this.fromNumber(a,c);
  27165. if(!this.testBit(a-1)) // force MSB set
  27166. this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
  27167. if(this.isEven()) this.dAddOffset(1,0); // force odd
  27168. while(!this.isProbablePrime(b)) {
  27169. this.dAddOffset(2,0);
  27170. if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
  27171. }
  27172. }
  27173. }
  27174. else {
  27175. // new BigInteger(int,RNG)
  27176. var x = new Array(), t = a&7;
  27177. x.length = (a>>3)+1;
  27178. b.nextBytes(x);
  27179. if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
  27180. this.fromString(x,256);
  27181. }
  27182. }
  27183. // (public) convert to bigendian byte array
  27184. function bnToByteArray() {
  27185. var i = this.t, r = new Array();
  27186. r[0] = this.s;
  27187. var p = this.DB-(i*this.DB)%8, d, k = 0;
  27188. if(i-- > 0) {
  27189. if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)
  27190. r[k++] = d|(this.s<<(this.DB-p));
  27191. while(i >= 0) {
  27192. if(p < 8) {
  27193. d = (this[i]&((1<<p)-1))<<(8-p);
  27194. d |= this[--i]>>(p+=this.DB-8);
  27195. }
  27196. else {
  27197. d = (this[i]>>(p-=8))&0xff;
  27198. if(p <= 0) { p += this.DB; --i; }
  27199. }
  27200. if((d&0x80) != 0) d |= -256;
  27201. if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;
  27202. if(k > 0 || d != this.s) r[k++] = d;
  27203. }
  27204. }
  27205. return r;
  27206. }
  27207. function bnEquals(a) { return(this.compareTo(a)==0); }
  27208. function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
  27209. function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
  27210. // (protected) r = this op a (bitwise)
  27211. function bnpBitwiseTo(a,op,r) {
  27212. var i, f, m = Math.min(a.t,this.t);
  27213. for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);
  27214. if(a.t < this.t) {
  27215. f = a.s&this.DM;
  27216. for(i = m; i < this.t; ++i) r[i] = op(this[i],f);
  27217. r.t = this.t;
  27218. }
  27219. else {
  27220. f = this.s&this.DM;
  27221. for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);
  27222. r.t = a.t;
  27223. }
  27224. r.s = op(this.s,a.s);
  27225. r.clamp();
  27226. }
  27227. // (public) this & a
  27228. function op_and(x,y) { return x&y; }
  27229. function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
  27230. // (public) this | a
  27231. function op_or(x,y) { return x|y; }
  27232. function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
  27233. // (public) this ^ a
  27234. function op_xor(x,y) { return x^y; }
  27235. function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
  27236. // (public) this & ~a
  27237. function op_andnot(x,y) { return x&~y; }
  27238. function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
  27239. // (public) ~this
  27240. function bnNot() {
  27241. var r = nbi();
  27242. for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];
  27243. r.t = this.t;
  27244. r.s = ~this.s;
  27245. return r;
  27246. }
  27247. // (public) this << n
  27248. function bnShiftLeft(n) {
  27249. var r = nbi();
  27250. if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
  27251. return r;
  27252. }
  27253. // (public) this >> n
  27254. function bnShiftRight(n) {
  27255. var r = nbi();
  27256. if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
  27257. return r;
  27258. }
  27259. // return index of lowest 1-bit in x, x < 2^31
  27260. function lbit(x) {
  27261. if(x == 0) return -1;
  27262. var r = 0;
  27263. if((x&0xffff) == 0) { x >>= 16; r += 16; }
  27264. if((x&0xff) == 0) { x >>= 8; r += 8; }
  27265. if((x&0xf) == 0) { x >>= 4; r += 4; }
  27266. if((x&3) == 0) { x >>= 2; r += 2; }
  27267. if((x&1) == 0) ++r;
  27268. return r;
  27269. }
  27270. // (public) returns index of lowest 1-bit (or -1 if none)
  27271. function bnGetLowestSetBit() {
  27272. for(var i = 0; i < this.t; ++i)
  27273. if(this[i] != 0) return i*this.DB+lbit(this[i]);
  27274. if(this.s < 0) return this.t*this.DB;
  27275. return -1;
  27276. }
  27277. // return number of 1 bits in x
  27278. function cbit(x) {
  27279. var r = 0;
  27280. while(x != 0) { x &= x-1; ++r; }
  27281. return r;
  27282. }
  27283. // (public) return number of set bits
  27284. function bnBitCount() {
  27285. var r = 0, x = this.s&this.DM;
  27286. for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);
  27287. return r;
  27288. }
  27289. // (public) true iff nth bit is set
  27290. function bnTestBit(n) {
  27291. var j = Math.floor(n/this.DB);
  27292. if(j >= this.t) return(this.s!=0);
  27293. return((this[j]&(1<<(n%this.DB)))!=0);
  27294. }
  27295. // (protected) this op (1<<n)
  27296. function bnpChangeBit(n,op) {
  27297. var r = BigInteger.ONE.shiftLeft(n);
  27298. this.bitwiseTo(r,op,r);
  27299. return r;
  27300. }
  27301. // (public) this | (1<<n)
  27302. function bnSetBit(n) { return this.changeBit(n,op_or); }
  27303. // (public) this & ~(1<<n)
  27304. function bnClearBit(n) { return this.changeBit(n,op_andnot); }
  27305. // (public) this ^ (1<<n)
  27306. function bnFlipBit(n) { return this.changeBit(n,op_xor); }
  27307. // (protected) r = this + a
  27308. function bnpAddTo(a,r) {
  27309. var i = 0, c = 0, m = Math.min(a.t,this.t);
  27310. while(i < m) {
  27311. c += this[i]+a[i];
  27312. r[i++] = c&this.DM;
  27313. c >>= this.DB;
  27314. }
  27315. if(a.t < this.t) {
  27316. c += a.s;
  27317. while(i < this.t) {
  27318. c += this[i];
  27319. r[i++] = c&this.DM;
  27320. c >>= this.DB;
  27321. }
  27322. c += this.s;
  27323. }
  27324. else {
  27325. c += this.s;
  27326. while(i < a.t) {
  27327. c += a[i];
  27328. r[i++] = c&this.DM;
  27329. c >>= this.DB;
  27330. }
  27331. c += a.s;
  27332. }
  27333. r.s = (c<0)?-1:0;
  27334. if(c > 0) r[i++] = c;
  27335. else if(c < -1) r[i++] = this.DV+c;
  27336. r.t = i;
  27337. r.clamp();
  27338. }
  27339. // (public) this + a
  27340. function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
  27341. // (public) this - a
  27342. function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
  27343. // (public) this * a
  27344. function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
  27345. // (public) this^2
  27346. function bnSquare() { var r = nbi(); this.squareTo(r); return r; }
  27347. // (public) this / a
  27348. function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
  27349. // (public) this % a
  27350. function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
  27351. // (public) [this/a,this%a]
  27352. function bnDivideAndRemainder(a) {
  27353. var q = nbi(), r = nbi();
  27354. this.divRemTo(a,q,r);
  27355. return new Array(q,r);
  27356. }
  27357. // (protected) this *= n, this >= 0, 1 < n < DV
  27358. function bnpDMultiply(n) {
  27359. this[this.t] = this.am(0,n-1,this,0,0,this.t);
  27360. ++this.t;
  27361. this.clamp();
  27362. }
  27363. // (protected) this += n << w words, this >= 0
  27364. function bnpDAddOffset(n,w) {
  27365. if(n == 0) return;
  27366. while(this.t <= w) this[this.t++] = 0;
  27367. this[w] += n;
  27368. while(this[w] >= this.DV) {
  27369. this[w] -= this.DV;
  27370. if(++w >= this.t) this[this.t++] = 0;
  27371. ++this[w];
  27372. }
  27373. }
  27374. // A "null" reducer
  27375. function NullExp() {}
  27376. function nNop(x) { return x; }
  27377. function nMulTo(x,y,r) { x.multiplyTo(y,r); }
  27378. function nSqrTo(x,r) { x.squareTo(r); }
  27379. NullExp.prototype.convert = nNop;
  27380. NullExp.prototype.revert = nNop;
  27381. NullExp.prototype.mulTo = nMulTo;
  27382. NullExp.prototype.sqrTo = nSqrTo;
  27383. // (public) this^e
  27384. function bnPow(e) { return this.exp(e,new NullExp()); }
  27385. // (protected) r = lower n words of "this * a", a.t <= n
  27386. // "this" should be the larger one if appropriate.
  27387. function bnpMultiplyLowerTo(a,n,r) {
  27388. var i = Math.min(this.t+a.t,n);
  27389. r.s = 0; // assumes a,this >= 0
  27390. r.t = i;
  27391. while(i > 0) r[--i] = 0;
  27392. var j;
  27393. for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);
  27394. for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);
  27395. r.clamp();
  27396. }
  27397. // (protected) r = "this * a" without lower n words, n > 0
  27398. // "this" should be the larger one if appropriate.
  27399. function bnpMultiplyUpperTo(a,n,r) {
  27400. --n;
  27401. var i = r.t = this.t+a.t-n;
  27402. r.s = 0; // assumes a,this >= 0
  27403. while(--i >= 0) r[i] = 0;
  27404. for(i = Math.max(n-this.t,0); i < a.t; ++i)
  27405. r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);
  27406. r.clamp();
  27407. r.drShiftTo(1,r);
  27408. }
  27409. // Barrett modular reduction
  27410. function Barrett(m) {
  27411. // setup Barrett
  27412. this.r2 = nbi();
  27413. this.q3 = nbi();
  27414. BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
  27415. this.mu = this.r2.divide(m);
  27416. this.m = m;
  27417. }
  27418. function barrettConvert(x) {
  27419. if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
  27420. else if(x.compareTo(this.m) < 0) return x;
  27421. else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
  27422. }
  27423. function barrettRevert(x) { return x; }
  27424. // x = x mod m (HAC 14.42)
  27425. function barrettReduce(x) {
  27426. x.drShiftTo(this.m.t-1,this.r2);
  27427. if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
  27428. this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
  27429. this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
  27430. while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
  27431. x.subTo(this.r2,x);
  27432. while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
  27433. }
  27434. // r = x^2 mod m; x != r
  27435. function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
  27436. // r = x*y mod m; x,y != r
  27437. function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
  27438. Barrett.prototype.convert = barrettConvert;
  27439. Barrett.prototype.revert = barrettRevert;
  27440. Barrett.prototype.reduce = barrettReduce;
  27441. Barrett.prototype.mulTo = barrettMulTo;
  27442. Barrett.prototype.sqrTo = barrettSqrTo;
  27443. // (public) this^e % m (HAC 14.85)
  27444. function bnModPow(e,m) {
  27445. var i = e.bitLength(), k, r = nbv(1), z;
  27446. if(i <= 0) return r;
  27447. else if(i < 18) k = 1;
  27448. else if(i < 48) k = 3;
  27449. else if(i < 144) k = 4;
  27450. else if(i < 768) k = 5;
  27451. else k = 6;
  27452. if(i < 8)
  27453. z = new Classic(m);
  27454. else if(m.isEven())
  27455. z = new Barrett(m);
  27456. else
  27457. z = new Montgomery(m);
  27458. // precomputation
  27459. var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;
  27460. g[1] = z.convert(this);
  27461. if(k > 1) {
  27462. var g2 = nbi();
  27463. z.sqrTo(g[1],g2);
  27464. while(n <= km) {
  27465. g[n] = nbi();
  27466. z.mulTo(g2,g[n-2],g[n]);
  27467. n += 2;
  27468. }
  27469. }
  27470. var j = e.t-1, w, is1 = true, r2 = nbi(), t;
  27471. i = nbits(e[j])-1;
  27472. while(j >= 0) {
  27473. if(i >= k1) w = (e[j]>>(i-k1))&km;
  27474. else {
  27475. w = (e[j]&((1<<(i+1))-1))<<(k1-i);
  27476. if(j > 0) w |= e[j-1]>>(this.DB+i-k1);
  27477. }
  27478. n = k;
  27479. while((w&1) == 0) { w >>= 1; --n; }
  27480. if((i -= n) < 0) { i += this.DB; --j; }
  27481. if(is1) { // ret == 1, don't bother squaring or multiplying it
  27482. g[w].copyTo(r);
  27483. is1 = false;
  27484. }
  27485. else {
  27486. while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
  27487. if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
  27488. z.mulTo(r2,g[w],r);
  27489. }
  27490. while(j >= 0 && (e[j]&(1<<i)) == 0) {
  27491. z.sqrTo(r,r2); t = r; r = r2; r2 = t;
  27492. if(--i < 0) { i = this.DB-1; --j; }
  27493. }
  27494. }
  27495. return z.revert(r);
  27496. }
  27497. // (public) gcd(this,a) (HAC 14.54)
  27498. function bnGCD(a) {
  27499. var x = (this.s<0)?this.negate():this.clone();
  27500. var y = (a.s<0)?a.negate():a.clone();
  27501. if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }
  27502. var i = x.getLowestSetBit(), g = y.getLowestSetBit();
  27503. if(g < 0) return x;
  27504. if(i < g) g = i;
  27505. if(g > 0) {
  27506. x.rShiftTo(g,x);
  27507. y.rShiftTo(g,y);
  27508. }
  27509. while(x.signum() > 0) {
  27510. if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
  27511. if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
  27512. if(x.compareTo(y) >= 0) {
  27513. x.subTo(y,x);
  27514. x.rShiftTo(1,x);
  27515. }
  27516. else {
  27517. y.subTo(x,y);
  27518. y.rShiftTo(1,y);
  27519. }
  27520. }
  27521. if(g > 0) y.lShiftTo(g,y);
  27522. return y;
  27523. }
  27524. // (protected) this % n, n < 2^26
  27525. function bnpModInt(n) {
  27526. if(n <= 0) return 0;
  27527. var d = this.DV%n, r = (this.s<0)?n-1:0;
  27528. if(this.t > 0)
  27529. if(d == 0) r = this[0]%n;
  27530. else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;
  27531. return r;
  27532. }
  27533. // (public) 1/this % m (HAC 14.61)
  27534. function bnModInverse(m) {
  27535. var ac = m.isEven();
  27536. if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
  27537. var u = m.clone(), v = this.clone();
  27538. var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
  27539. while(u.signum() != 0) {
  27540. while(u.isEven()) {
  27541. u.rShiftTo(1,u);
  27542. if(ac) {
  27543. if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
  27544. a.rShiftTo(1,a);
  27545. }
  27546. else if(!b.isEven()) b.subTo(m,b);
  27547. b.rShiftTo(1,b);
  27548. }
  27549. while(v.isEven()) {
  27550. v.rShiftTo(1,v);
  27551. if(ac) {
  27552. if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
  27553. c.rShiftTo(1,c);
  27554. }
  27555. else if(!d.isEven()) d.subTo(m,d);
  27556. d.rShiftTo(1,d);
  27557. }
  27558. if(u.compareTo(v) >= 0) {
  27559. u.subTo(v,u);
  27560. if(ac) a.subTo(c,a);
  27561. b.subTo(d,b);
  27562. }
  27563. else {
  27564. v.subTo(u,v);
  27565. if(ac) c.subTo(a,c);
  27566. d.subTo(b,d);
  27567. }
  27568. }
  27569. if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
  27570. if(d.compareTo(m) >= 0) return d.subtract(m);
  27571. if(d.signum() < 0) d.addTo(m,d); else return d;
  27572. if(d.signum() < 0) return d.add(m); else return d;
  27573. }
  27574. var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
  27575. var lplim = (1<<26)/lowprimes[lowprimes.length-1];
  27576. // (public) test primality with certainty >= 1-.5^t
  27577. function bnIsProbablePrime(t) {
  27578. var i, x = this.abs();
  27579. if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {
  27580. for(i = 0; i < lowprimes.length; ++i)
  27581. if(x[0] == lowprimes[i]) return true;
  27582. return false;
  27583. }
  27584. if(x.isEven()) return false;
  27585. i = 1;
  27586. while(i < lowprimes.length) {
  27587. var m = lowprimes[i], j = i+1;
  27588. while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];
  27589. m = x.modInt(m);
  27590. while(i < j) if(m%lowprimes[i++] == 0) return false;
  27591. }
  27592. return x.millerRabin(t);
  27593. }
  27594. // (protected) true if probably prime (HAC 4.24, Miller-Rabin)
  27595. function bnpMillerRabin(t) {
  27596. var n1 = this.subtract(BigInteger.ONE);
  27597. var k = n1.getLowestSetBit();
  27598. if(k <= 0) return false;
  27599. var r = n1.shiftRight(k);
  27600. t = (t+1)>>1;
  27601. if(t > lowprimes.length) t = lowprimes.length;
  27602. var a = nbi();
  27603. for(var i = 0; i < t; ++i) {
  27604. //Pick bases at random, instead of starting at 2
  27605. a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);
  27606. var y = a.modPow(r,this);
  27607. if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
  27608. var j = 1;
  27609. while(j++ < k && y.compareTo(n1) != 0) {
  27610. y = y.modPowInt(2,this);
  27611. if(y.compareTo(BigInteger.ONE) == 0) return false;
  27612. }
  27613. if(y.compareTo(n1) != 0) return false;
  27614. }
  27615. }
  27616. return true;
  27617. }
  27618. // protected
  27619. BigInteger.prototype.chunkSize = bnpChunkSize;
  27620. BigInteger.prototype.toRadix = bnpToRadix;
  27621. BigInteger.prototype.fromRadix = bnpFromRadix;
  27622. BigInteger.prototype.fromNumber = bnpFromNumber;
  27623. BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
  27624. BigInteger.prototype.changeBit = bnpChangeBit;
  27625. BigInteger.prototype.addTo = bnpAddTo;
  27626. BigInteger.prototype.dMultiply = bnpDMultiply;
  27627. BigInteger.prototype.dAddOffset = bnpDAddOffset;
  27628. BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
  27629. BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
  27630. BigInteger.prototype.modInt = bnpModInt;
  27631. BigInteger.prototype.millerRabin = bnpMillerRabin;
  27632. // public
  27633. BigInteger.prototype.clone = bnClone;
  27634. BigInteger.prototype.intValue = bnIntValue;
  27635. BigInteger.prototype.byteValue = bnByteValue;
  27636. BigInteger.prototype.shortValue = bnShortValue;
  27637. BigInteger.prototype.signum = bnSigNum;
  27638. BigInteger.prototype.toByteArray = bnToByteArray;
  27639. BigInteger.prototype.equals = bnEquals;
  27640. BigInteger.prototype.min = bnMin;
  27641. BigInteger.prototype.max = bnMax;
  27642. BigInteger.prototype.and = bnAnd;
  27643. BigInteger.prototype.or = bnOr;
  27644. BigInteger.prototype.xor = bnXor;
  27645. BigInteger.prototype.andNot = bnAndNot;
  27646. BigInteger.prototype.not = bnNot;
  27647. BigInteger.prototype.shiftLeft = bnShiftLeft;
  27648. BigInteger.prototype.shiftRight = bnShiftRight;
  27649. BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
  27650. BigInteger.prototype.bitCount = bnBitCount;
  27651. BigInteger.prototype.testBit = bnTestBit;
  27652. BigInteger.prototype.setBit = bnSetBit;
  27653. BigInteger.prototype.clearBit = bnClearBit;
  27654. BigInteger.prototype.flipBit = bnFlipBit;
  27655. BigInteger.prototype.add = bnAdd;
  27656. BigInteger.prototype.subtract = bnSubtract;
  27657. BigInteger.prototype.multiply = bnMultiply;
  27658. BigInteger.prototype.divide = bnDivide;
  27659. BigInteger.prototype.remainder = bnRemainder;
  27660. BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
  27661. BigInteger.prototype.modPow = bnModPow;
  27662. BigInteger.prototype.modInverse = bnModInverse;
  27663. BigInteger.prototype.pow = bnPow;
  27664. BigInteger.prototype.gcd = bnGCD;
  27665. BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
  27666. // JSBN-specific extension
  27667. BigInteger.prototype.square = bnSquare;
  27668. // Expose the Barrett function
  27669. BigInteger.prototype.Barrett = Barrett
  27670. // BigInteger interfaces not implemented in jsbn:
  27671. // BigInteger(int signum, byte[] magnitude)
  27672. // double doubleValue()
  27673. // float floatValue()
  27674. // int hashCode()
  27675. // long longValue()
  27676. // static BigInteger valueOf(long val)
  27677. // Random number generator - requires a PRNG backend, e.g. prng4.js
  27678. // For best results, put code like
  27679. // <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
  27680. // in your main HTML document.
  27681. var rng_state;
  27682. var rng_pool;
  27683. var rng_pptr;
  27684. // Mix in a 32-bit integer into the pool
  27685. function rng_seed_int(x) {
  27686. rng_pool[rng_pptr++] ^= x & 255;
  27687. rng_pool[rng_pptr++] ^= (x >> 8) & 255;
  27688. rng_pool[rng_pptr++] ^= (x >> 16) & 255;
  27689. rng_pool[rng_pptr++] ^= (x >> 24) & 255;
  27690. if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
  27691. }
  27692. // Mix in the current time (w/milliseconds) into the pool
  27693. function rng_seed_time() {
  27694. rng_seed_int(new Date().getTime());
  27695. }
  27696. // Initialize the pool with junk if needed.
  27697. if(rng_pool == null) {
  27698. rng_pool = new Array();
  27699. rng_pptr = 0;
  27700. var t;
  27701. if(typeof window !== "undefined" && window.crypto) {
  27702. if (window.crypto.getRandomValues) {
  27703. // Use webcrypto if available
  27704. var ua = new Uint8Array(32);
  27705. window.crypto.getRandomValues(ua);
  27706. for(t = 0; t < 32; ++t)
  27707. rng_pool[rng_pptr++] = ua[t];
  27708. }
  27709. else if(navigator.appName == "Netscape" && navigator.appVersion < "5") {
  27710. // Extract entropy (256 bits) from NS4 RNG if available
  27711. var z = window.crypto.random(32);
  27712. for(t = 0; t < z.length; ++t)
  27713. rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
  27714. }
  27715. }
  27716. while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
  27717. t = Math.floor(65536 * Math.random());
  27718. rng_pool[rng_pptr++] = t >>> 8;
  27719. rng_pool[rng_pptr++] = t & 255;
  27720. }
  27721. rng_pptr = 0;
  27722. rng_seed_time();
  27723. //rng_seed_int(window.screenX);
  27724. //rng_seed_int(window.screenY);
  27725. }
  27726. function rng_get_byte() {
  27727. if(rng_state == null) {
  27728. rng_seed_time();
  27729. rng_state = prng_newstate();
  27730. rng_state.init(rng_pool);
  27731. for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
  27732. rng_pool[rng_pptr] = 0;
  27733. rng_pptr = 0;
  27734. //rng_pool = null;
  27735. }
  27736. // TODO: allow reseeding after first request
  27737. return rng_state.next();
  27738. }
  27739. function rng_get_bytes(ba) {
  27740. var i;
  27741. for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
  27742. }
  27743. function SecureRandom() {}
  27744. SecureRandom.prototype.nextBytes = rng_get_bytes;
  27745. // prng4.js - uses Arcfour as a PRNG
  27746. function Arcfour() {
  27747. this.i = 0;
  27748. this.j = 0;
  27749. this.S = new Array();
  27750. }
  27751. // Initialize arcfour context from key, an array of ints, each from [0..255]
  27752. function ARC4init(key) {
  27753. var i, j, t;
  27754. for(i = 0; i < 256; ++i)
  27755. this.S[i] = i;
  27756. j = 0;
  27757. for(i = 0; i < 256; ++i) {
  27758. j = (j + this.S[i] + key[i % key.length]) & 255;
  27759. t = this.S[i];
  27760. this.S[i] = this.S[j];
  27761. this.S[j] = t;
  27762. }
  27763. this.i = 0;
  27764. this.j = 0;
  27765. }
  27766. function ARC4next() {
  27767. var t;
  27768. this.i = (this.i + 1) & 255;
  27769. this.j = (this.j + this.S[this.i]) & 255;
  27770. t = this.S[this.i];
  27771. this.S[this.i] = this.S[this.j];
  27772. this.S[this.j] = t;
  27773. return this.S[(t + this.S[this.i]) & 255];
  27774. }
  27775. Arcfour.prototype.init = ARC4init;
  27776. Arcfour.prototype.next = ARC4next;
  27777. // Plug in your RNG constructor here
  27778. function prng_newstate() {
  27779. return new Arcfour();
  27780. }
  27781. // Pool size must be a multiple of 4 and greater than 32.
  27782. // An array of bytes the size of the pool will be passed to init()
  27783. var rng_psize = 256;
  27784. BigInteger.SecureRandom = SecureRandom;
  27785. BigInteger.BigInteger = BigInteger;
  27786. if (true) {
  27787. exports = module.exports = BigInteger;
  27788. } else {
  27789. this.BigInteger = BigInteger;
  27790. this.SecureRandom = SecureRandom;
  27791. }
  27792. }).call(this);
  27793. /***/ }),
  27794. /* 80 */
  27795. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  27796. "use strict";
  27797. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InnerSubscriber; });
  27798. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  27799. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  27800. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  27801. var InnerSubscriber = /*@__PURE__*/ (function (_super) {
  27802. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](InnerSubscriber, _super);
  27803. function InnerSubscriber(parent, outerValue, outerIndex) {
  27804. var _this = _super.call(this) || this;
  27805. _this.parent = parent;
  27806. _this.outerValue = outerValue;
  27807. _this.outerIndex = outerIndex;
  27808. _this.index = 0;
  27809. return _this;
  27810. }
  27811. InnerSubscriber.prototype._next = function (value) {
  27812. this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);
  27813. };
  27814. InnerSubscriber.prototype._error = function (error) {
  27815. this.parent.notifyError(error, this);
  27816. this.unsubscribe();
  27817. };
  27818. InnerSubscriber.prototype._complete = function () {
  27819. this.parent.notifyComplete(this);
  27820. this.unsubscribe();
  27821. };
  27822. return InnerSubscriber;
  27823. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  27824. //# sourceMappingURL=InnerSubscriber.js.map
  27825. /***/ }),
  27826. /* 81 */
  27827. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  27828. "use strict";
  27829. /* harmony export (immutable) */ __webpack_exports__["a"] = fromArray;
  27830. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  27831. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
  27832. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToArray__ = __webpack_require__(417);
  27833. /** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToArray PURE_IMPORTS_END */
  27834. function fromArray(input, scheduler) {
  27835. if (!scheduler) {
  27836. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToArray__["a" /* subscribeToArray */])(input));
  27837. }
  27838. else {
  27839. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  27840. var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
  27841. var i = 0;
  27842. sub.add(scheduler.schedule(function () {
  27843. if (i === input.length) {
  27844. subscriber.complete();
  27845. return;
  27846. }
  27847. subscriber.next(input[i++]);
  27848. if (!subscriber.closed) {
  27849. sub.add(this.schedule());
  27850. }
  27851. }));
  27852. return sub;
  27853. });
  27854. }
  27855. }
  27856. //# sourceMappingURL=fromArray.js.map
  27857. /***/ }),
  27858. /* 82 */
  27859. /***/ (function(module, exports, __webpack_require__) {
  27860. // Copyright 2015 Joyent, Inc.
  27861. module.exports = {
  27862. read: read,
  27863. write: write
  27864. };
  27865. var assert = __webpack_require__(22);
  27866. var asn1 = __webpack_require__(67);
  27867. var crypto = __webpack_require__(21);
  27868. var Buffer = __webpack_require__(20).Buffer;
  27869. var algs = __webpack_require__(39);
  27870. var utils = __webpack_require__(32);
  27871. var Key = __webpack_require__(35);
  27872. var PrivateKey = __webpack_require__(40);
  27873. var pkcs1 = __webpack_require__(268);
  27874. var pkcs8 = __webpack_require__(146);
  27875. var sshpriv = __webpack_require__(183);
  27876. var rfc4253 = __webpack_require__(92);
  27877. var errors = __webpack_require__(70);
  27878. /*
  27879. * For reading we support both PKCS#1 and PKCS#8. If we find a private key,
  27880. * we just take the public component of it and use that.
  27881. */
  27882. function read(buf, options, forceType) {
  27883. var input = buf;
  27884. if (typeof (buf) !== 'string') {
  27885. assert.buffer(buf, 'buf');
  27886. buf = buf.toString('ascii');
  27887. }
  27888. var lines = buf.trim().split('\n');
  27889. var m = lines[0].match(/*JSSTYLED*/
  27890. /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);
  27891. assert.ok(m, 'invalid PEM header');
  27892. var m2 = lines[lines.length - 1].match(/*JSSTYLED*/
  27893. /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);
  27894. assert.ok(m2, 'invalid PEM footer');
  27895. /* Begin and end banners must match key type */
  27896. assert.equal(m[2], m2[2]);
  27897. var type = m[2].toLowerCase();
  27898. var alg;
  27899. if (m[1]) {
  27900. /* They also must match algorithms, if given */
  27901. assert.equal(m[1], m2[1], 'PEM header and footer mismatch');
  27902. alg = m[1].trim();
  27903. }
  27904. var headers = {};
  27905. while (true) {
  27906. lines = lines.slice(1);
  27907. m = lines[0].match(/*JSSTYLED*/
  27908. /^([A-Za-z0-9-]+): (.+)$/);
  27909. if (!m)
  27910. break;
  27911. headers[m[1].toLowerCase()] = m[2];
  27912. }
  27913. var cipher, key, iv;
  27914. if (headers['proc-type']) {
  27915. var parts = headers['proc-type'].split(',');
  27916. if (parts[0] === '4' && parts[1] === 'ENCRYPTED') {
  27917. if (typeof (options.passphrase) === 'string') {
  27918. options.passphrase = Buffer.from(
  27919. options.passphrase, 'utf-8');
  27920. }
  27921. if (!Buffer.isBuffer(options.passphrase)) {
  27922. throw (new errors.KeyEncryptedError(
  27923. options.filename, 'PEM'));
  27924. } else {
  27925. parts = headers['dek-info'].split(',');
  27926. assert.ok(parts.length === 2);
  27927. cipher = parts[0].toLowerCase();
  27928. iv = Buffer.from(parts[1], 'hex');
  27929. key = utils.opensslKeyDeriv(cipher, iv,
  27930. options.passphrase, 1).key;
  27931. }
  27932. }
  27933. }
  27934. /* Chop off the first and last lines */
  27935. lines = lines.slice(0, -1).join('');
  27936. buf = Buffer.from(lines, 'base64');
  27937. if (cipher && key && iv) {
  27938. var cipherStream = crypto.createDecipheriv(cipher, key, iv);
  27939. var chunk, chunks = [];
  27940. cipherStream.once('error', function (e) {
  27941. if (e.toString().indexOf('bad decrypt') !== -1) {
  27942. throw (new Error('Incorrect passphrase ' +
  27943. 'supplied, could not decrypt key'));
  27944. }
  27945. throw (e);
  27946. });
  27947. cipherStream.write(buf);
  27948. cipherStream.end();
  27949. while ((chunk = cipherStream.read()) !== null)
  27950. chunks.push(chunk);
  27951. buf = Buffer.concat(chunks);
  27952. }
  27953. /* The new OpenSSH internal format abuses PEM headers */
  27954. if (alg && alg.toLowerCase() === 'openssh')
  27955. return (sshpriv.readSSHPrivate(type, buf, options));
  27956. if (alg && alg.toLowerCase() === 'ssh2')
  27957. return (rfc4253.readType(type, buf, options));
  27958. var der = new asn1.BerReader(buf);
  27959. der.originalInput = input;
  27960. /*
  27961. * All of the PEM file types start with a sequence tag, so chop it
  27962. * off here
  27963. */
  27964. der.readSequence();
  27965. /* PKCS#1 type keys name an algorithm in the banner explicitly */
  27966. if (alg) {
  27967. if (forceType)
  27968. assert.strictEqual(forceType, 'pkcs1');
  27969. return (pkcs1.readPkcs1(alg, type, der));
  27970. } else {
  27971. if (forceType)
  27972. assert.strictEqual(forceType, 'pkcs8');
  27973. return (pkcs8.readPkcs8(alg, type, der));
  27974. }
  27975. }
  27976. function write(key, options, type) {
  27977. assert.object(key);
  27978. var alg = {
  27979. 'ecdsa': 'EC',
  27980. 'rsa': 'RSA',
  27981. 'dsa': 'DSA',
  27982. 'ed25519': 'EdDSA'
  27983. }[key.type];
  27984. var header;
  27985. var der = new asn1.BerWriter();
  27986. if (PrivateKey.isPrivateKey(key)) {
  27987. if (type && type === 'pkcs8') {
  27988. header = 'PRIVATE KEY';
  27989. pkcs8.writePkcs8(der, key);
  27990. } else {
  27991. if (type)
  27992. assert.strictEqual(type, 'pkcs1');
  27993. header = alg + ' PRIVATE KEY';
  27994. pkcs1.writePkcs1(der, key);
  27995. }
  27996. } else if (Key.isKey(key)) {
  27997. if (type && type === 'pkcs1') {
  27998. header = alg + ' PUBLIC KEY';
  27999. pkcs1.writePkcs1(der, key);
  28000. } else {
  28001. if (type)
  28002. assert.strictEqual(type, 'pkcs8');
  28003. header = 'PUBLIC KEY';
  28004. pkcs8.writePkcs8(der, key);
  28005. }
  28006. } else {
  28007. throw (new Error('key is not a Key or PrivateKey'));
  28008. }
  28009. var tmp = der.buffer.toString('base64');
  28010. var len = tmp.length + (tmp.length / 64) +
  28011. 18 + 16 + header.length*2 + 10;
  28012. var buf = Buffer.alloc(len);
  28013. var o = 0;
  28014. o += buf.write('-----BEGIN ' + header + '-----\n', o);
  28015. for (var i = 0; i < tmp.length; ) {
  28016. var limit = i + 64;
  28017. if (limit > tmp.length)
  28018. limit = tmp.length;
  28019. o += buf.write(tmp.slice(i, limit), o);
  28020. buf[o++] = 10;
  28021. i = limit;
  28022. }
  28023. o += buf.write('-----END ' + header + '-----\n', o);
  28024. return (buf.slice(0, o));
  28025. }
  28026. /***/ }),
  28027. /* 83 */
  28028. /***/ (function(module, exports) {
  28029. module.exports = require("http");
  28030. /***/ }),
  28031. /* 84 */
  28032. /***/ (function(module, exports, __webpack_require__) {
  28033. "use strict";
  28034. Object.defineProperty(exports, "__esModule", {
  28035. value: true
  28036. });
  28037. exports.SCOPE_SEPARATOR = undefined;
  28038. var _assign;
  28039. function _load_assign() {
  28040. return _assign = _interopRequireDefault(__webpack_require__(23));
  28041. }
  28042. var _getIterator2;
  28043. function _load_getIterator() {
  28044. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  28045. }
  28046. var _keys;
  28047. function _load_keys() {
  28048. return _keys = _interopRequireDefault(__webpack_require__(14));
  28049. }
  28050. var _extends2;
  28051. function _load_extends() {
  28052. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  28053. }
  28054. var _asyncToGenerator2;
  28055. function _load_asyncToGenerator() {
  28056. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  28057. }
  28058. var _classCallCheck2;
  28059. function _load_classCallCheck() {
  28060. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  28061. }
  28062. var _possibleConstructorReturn2;
  28063. function _load_possibleConstructorReturn() {
  28064. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  28065. }
  28066. var _inherits2;
  28067. function _load_inherits() {
  28068. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  28069. }
  28070. var _set;
  28071. function _load_set() {
  28072. return _set = _interopRequireDefault(__webpack_require__(16));
  28073. }
  28074. var _constants;
  28075. function _load_constants() {
  28076. return _constants = __webpack_require__(13);
  28077. }
  28078. var _fs;
  28079. function _load_fs() {
  28080. return _fs = _interopRequireWildcard(__webpack_require__(8));
  28081. }
  28082. var _npmResolver;
  28083. function _load_npmResolver() {
  28084. return _npmResolver = _interopRequireDefault(__webpack_require__(204));
  28085. }
  28086. var _envReplace;
  28087. function _load_envReplace() {
  28088. return _envReplace = _interopRequireDefault(__webpack_require__(533));
  28089. }
  28090. var _baseRegistry;
  28091. function _load_baseRegistry() {
  28092. return _baseRegistry = _interopRequireDefault(__webpack_require__(514));
  28093. }
  28094. var _misc;
  28095. function _load_misc() {
  28096. return _misc = __webpack_require__(28);
  28097. }
  28098. var _path;
  28099. function _load_path() {
  28100. return _path = __webpack_require__(314);
  28101. }
  28102. var _normalizeUrl;
  28103. function _load_normalizeUrl() {
  28104. return _normalizeUrl = _interopRequireDefault(__webpack_require__(372));
  28105. }
  28106. var _userHomeDir;
  28107. function _load_userHomeDir() {
  28108. return _userHomeDir = _interopRequireDefault(__webpack_require__(101));
  28109. }
  28110. var _userHomeDir2;
  28111. function _load_userHomeDir2() {
  28112. return _userHomeDir2 = __webpack_require__(101);
  28113. }
  28114. var _errors;
  28115. function _load_errors() {
  28116. return _errors = __webpack_require__(6);
  28117. }
  28118. var _login;
  28119. function _load_login() {
  28120. return _login = __webpack_require__(97);
  28121. }
  28122. var _path2;
  28123. function _load_path2() {
  28124. return _path2 = _interopRequireDefault(__webpack_require__(1));
  28125. }
  28126. var _url;
  28127. function _load_url() {
  28128. return _url = _interopRequireDefault(__webpack_require__(29));
  28129. }
  28130. var _ini;
  28131. function _load_ini() {
  28132. return _ini = _interopRequireDefault(__webpack_require__(747));
  28133. }
  28134. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  28135. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  28136. var DEFAULT_REGISTRY = 'https://registry.npmjs.org/';
  28137. var REGEX_REGISTRY_ENFORCED_HTTPS = /^https?:\/\/([^\/]+\.)?(yarnpkg\.com|npmjs\.(org|com))(\/|$)/;
  28138. var REGEX_REGISTRY_HTTP_PROTOCOL = /^https?:/i;
  28139. var REGEX_REGISTRY_PREFIX = /^(https?:)?\/\//i;
  28140. var REGEX_REGISTRY_SUFFIX = /registry\/?$/;
  28141. var SCOPE_SEPARATOR = exports.SCOPE_SEPARATOR = '%2f';
  28142. // All scoped package names are of the format `@scope%2fpkg` from the use of NpmRegistry.escapeName
  28143. // `(?:^|\/)` Match either the start of the string or a `/` but don't capture
  28144. // `[^\/?]+?` Match any character that is not '/' or '?' and capture, up until the first occurrence of:
  28145. // `(?=%2f|\/)` Match SCOPE_SEPARATOR, the escaped '/', or a raw `/` and don't capture
  28146. // The reason for matching a plain `/` is NPM registry being inconsistent about escaping `/` in
  28147. // scoped package names: when you're fetching a tarball, it is not escaped, when you want info
  28148. // about the package, it is escaped.
  28149. var SCOPED_PKG_REGEXP = /(?:^|\/)(@[^\/?]+?)(?=%2f|\/)/;
  28150. // TODO: Use the method from src/cli/commands/global.js for this instead
  28151. function getGlobalPrefix() {
  28152. if (process.env.PREFIX) {
  28153. return process.env.PREFIX;
  28154. } else if (process.platform === 'win32') {
  28155. // c:\node\node.exe --> prefix=c:\node\
  28156. return (_path2 || _load_path2()).default.dirname(process.execPath);
  28157. } else {
  28158. // /usr/local/bin/node --> prefix=/usr/local
  28159. var prefix = (_path2 || _load_path2()).default.dirname((_path2 || _load_path2()).default.dirname(process.execPath));
  28160. // destdir only is respected on Unix
  28161. if (process.env.DESTDIR) {
  28162. prefix = (_path2 || _load_path2()).default.join(process.env.DESTDIR, prefix);
  28163. }
  28164. return prefix;
  28165. }
  28166. }
  28167. var PATH_CONFIG_OPTIONS = new (_set || _load_set()).default(['cache', 'cafile', 'prefix', 'userconfig']);
  28168. function isPathConfigOption(key) {
  28169. return PATH_CONFIG_OPTIONS.has(key);
  28170. }
  28171. function normalizePath(val) {
  28172. if (val === undefined) {
  28173. return undefined;
  28174. }
  28175. if (typeof val !== 'string') {
  28176. val = String(val);
  28177. }
  28178. return (0, (_path || _load_path()).resolveWithHome)(val);
  28179. }
  28180. function urlParts(requestUrl) {
  28181. var normalizedUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(requestUrl);
  28182. var parsed = (_url || _load_url()).default.parse(normalizedUrl);
  28183. var host = parsed.host || '';
  28184. var path = parsed.path || '';
  28185. return { host, path };
  28186. }
  28187. var NpmRegistry = function (_Registry) {
  28188. (0, (_inherits2 || _load_inherits()).default)(NpmRegistry, _Registry);
  28189. function NpmRegistry(cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles) {
  28190. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NpmRegistry);
  28191. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Registry.call(this, cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles));
  28192. _this.folder = 'node_modules';
  28193. return _this;
  28194. }
  28195. NpmRegistry.escapeName = function escapeName(name) {
  28196. // scoped packages contain slashes and the npm registry expects them to be escaped
  28197. return name.replace('/', SCOPE_SEPARATOR);
  28198. };
  28199. NpmRegistry.prototype.isScopedPackage = function isScopedPackage(packageIdent) {
  28200. return SCOPED_PKG_REGEXP.test(packageIdent);
  28201. };
  28202. NpmRegistry.prototype.getRequestUrl = function getRequestUrl(registry, pathname) {
  28203. var resolved = pathname;
  28204. if (!REGEX_REGISTRY_PREFIX.test(pathname)) {
  28205. resolved = (_url || _load_url()).default.resolve((0, (_misc || _load_misc()).addSuffix)(registry, '/'), `./${pathname}`);
  28206. }
  28207. if (REGEX_REGISTRY_ENFORCED_HTTPS.test(resolved)) {
  28208. resolved = resolved.replace(/^http:\/\//, 'https://');
  28209. }
  28210. return resolved;
  28211. };
  28212. NpmRegistry.prototype.isRequestToRegistry = function isRequestToRegistry(requestUrl, registryUrl) {
  28213. var request = urlParts(requestUrl);
  28214. var registry = urlParts(registryUrl);
  28215. var customHostSuffix = this.getRegistryOrGlobalOption(registryUrl, 'custom-host-suffix');
  28216. var requestToRegistryHost = request.host === registry.host;
  28217. var requestToYarn = (_constants || _load_constants()).YARN_REGISTRY.indexOf(request.host) !== -1 && DEFAULT_REGISTRY.indexOf(registry.host) !== -1;
  28218. var requestToRegistryPath = request.path.startsWith(registry.path);
  28219. // For some registries, the package path does not prefix with the registry path
  28220. var customHostSuffixInUse = typeof customHostSuffix === 'string' && request.host.endsWith(customHostSuffix);
  28221. return (requestToRegistryHost || requestToYarn) && (requestToRegistryPath || customHostSuffixInUse);
  28222. };
  28223. NpmRegistry.prototype.request = function () {
  28224. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pathname) {
  28225. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  28226. var packageName = arguments[2];
  28227. // packageName needs to be escaped when if it is passed
  28228. var packageIdent = packageName && NpmRegistry.escapeName(packageName) || pathname;
  28229. var registry = opts.registry || this.getRegistry(packageIdent);
  28230. var requestUrl = this.getRequestUrl(registry, pathname);
  28231. var alwaysAuth = this.getRegistryOrGlobalOption(registry, 'always-auth');
  28232. var headers = (0, (_extends2 || _load_extends()).default)({
  28233. Accept:
  28234. // This is to use less bandwidth unless we really need to get the full response.
  28235. // See https://github.com/npm/npm-registry-client#requests
  28236. opts.unfiltered ? 'application/json' : 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*'
  28237. }, opts.headers);
  28238. var isToRegistry = this.isRequestToRegistry(requestUrl, registry) || this.requestNeedsAuth(requestUrl);
  28239. // this.token must be checked to account for publish requests on non-scoped packages
  28240. if (this.token || isToRegistry && (alwaysAuth || this.isScopedPackage(packageIdent))) {
  28241. var authorization = this.getAuth(packageIdent);
  28242. if (authorization) {
  28243. headers.authorization = authorization;
  28244. }
  28245. }
  28246. if (this.otp) {
  28247. headers['npm-otp'] = this.otp;
  28248. }
  28249. try {
  28250. return yield this.requestManager.request({
  28251. url: requestUrl,
  28252. method: opts.method,
  28253. body: opts.body,
  28254. auth: opts.auth,
  28255. headers,
  28256. json: !opts.buffer,
  28257. buffer: opts.buffer,
  28258. process: opts.process,
  28259. gzip: true
  28260. });
  28261. } catch (error) {
  28262. if (error instanceof (_errors || _load_errors()).OneTimePasswordError) {
  28263. if (this.otp) {
  28264. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('incorrectOneTimePassword'));
  28265. }
  28266. this.reporter.info(this.reporter.lang('twoFactorAuthenticationEnabled'));
  28267. if (error.notice) {
  28268. this.reporter.info(error.notice);
  28269. }
  28270. this.otp = yield (0, (_login || _load_login()).getOneTimePassword)(this.reporter);
  28271. this.requestManager.clearCache();
  28272. return this.request(pathname, opts, packageName);
  28273. } else {
  28274. throw error;
  28275. }
  28276. }
  28277. });
  28278. function request(_x) {
  28279. return _ref.apply(this, arguments);
  28280. }
  28281. return request;
  28282. }();
  28283. NpmRegistry.prototype.requestNeedsAuth = function requestNeedsAuth(requestUrl) {
  28284. var config = this.config;
  28285. var requestParts = urlParts(requestUrl);
  28286. return !!(0, (_keys || _load_keys()).default)(config).find(function (option) {
  28287. var parts = option.split(':');
  28288. if (parts.length === 2 && parts[1] === '_authToken' || parts[1] === '_password') {
  28289. var registryParts = urlParts(parts[0]);
  28290. if (requestParts.host === registryParts.host && requestParts.path.startsWith(registryParts.path)) {
  28291. return true;
  28292. }
  28293. }
  28294. return false;
  28295. });
  28296. };
  28297. NpmRegistry.prototype.checkOutdated = function () {
  28298. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, name, range) {
  28299. var escapedName = NpmRegistry.escapeName(name);
  28300. var req = yield this.request(escapedName, { unfiltered: true });
  28301. if (!req) {
  28302. throw new Error(`couldn't find ${name}`);
  28303. }
  28304. // By default use top level 'repository' and 'homepage' values
  28305. var repository = req.repository,
  28306. homepage = req.homepage;
  28307. var wantedPkg = yield (_npmResolver || _load_npmResolver()).default.findVersionInRegistryResponse(config, escapedName, range, req);
  28308. // But some local repositories like Verdaccio do not return 'repository' nor 'homepage'
  28309. // in top level data structure, so we fallback to wanted package manifest
  28310. if (!repository && !homepage) {
  28311. repository = wantedPkg.repository;
  28312. homepage = wantedPkg.homepage;
  28313. }
  28314. var latest = req['dist-tags'].latest;
  28315. // In certain cases, registries do not return a 'latest' tag.
  28316. if (!latest) {
  28317. latest = wantedPkg.version;
  28318. }
  28319. var url = homepage || repository && repository.url || '';
  28320. return {
  28321. latest,
  28322. wanted: wantedPkg.version,
  28323. url
  28324. };
  28325. });
  28326. function checkOutdated(_x3, _x4, _x5) {
  28327. return _ref2.apply(this, arguments);
  28328. }
  28329. return checkOutdated;
  28330. }();
  28331. NpmRegistry.prototype.getPossibleConfigLocations = function () {
  28332. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, reporter) {
  28333. var possibles = [];
  28334. for (var _iterator = this.extraneousRcFiles.slice().reverse(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  28335. var _ref4;
  28336. if (_isArray) {
  28337. if (_i >= _iterator.length) break;
  28338. _ref4 = _iterator[_i++];
  28339. } else {
  28340. _i = _iterator.next();
  28341. if (_i.done) break;
  28342. _ref4 = _i.value;
  28343. }
  28344. var rcFile = _ref4;
  28345. possibles.push([false, (_path2 || _load_path2()).default.resolve(process.cwd(), rcFile)]);
  28346. }
  28347. if (this.enableDefaultRc) {
  28348. // npmrc --> ./.npmrc, ~/.npmrc, ${prefix}/etc/npmrc
  28349. var localfile = '.' + filename;
  28350. possibles = possibles.concat([[false, (_path2 || _load_path2()).default.join(this.cwd, localfile)], [true, this.config.userconfig || (_path2 || _load_path2()).default.join((_userHomeDir || _load_userHomeDir()).default, localfile)], [false, (_path2 || _load_path2()).default.join(getGlobalPrefix(), 'etc', filename)]]);
  28351. // When home directory for global install is different from where $HOME/npmrc is stored,
  28352. // E.g. /usr/local/share vs /root on linux machines, check the additional location
  28353. if ((_userHomeDir2 || _load_userHomeDir2()).home !== (_userHomeDir || _load_userHomeDir()).default) {
  28354. possibles.push([true, (_path2 || _load_path2()).default.join((_userHomeDir2 || _load_userHomeDir2()).home, localfile)]);
  28355. }
  28356. // npmrc --> ../.npmrc, ../../.npmrc, etc.
  28357. var foldersFromRootToCwd = (0, (_path || _load_path()).getPosixPath)(this.cwd).split('/');
  28358. while (foldersFromRootToCwd.length > 1) {
  28359. possibles.push([false, (_path2 || _load_path2()).default.join(foldersFromRootToCwd.join((_path2 || _load_path2()).default.sep), localfile)]);
  28360. foldersFromRootToCwd.pop();
  28361. }
  28362. }
  28363. var actuals = [];
  28364. for (var _iterator2 = possibles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  28365. var _ref6;
  28366. if (_isArray2) {
  28367. if (_i2 >= _iterator2.length) break;
  28368. _ref6 = _iterator2[_i2++];
  28369. } else {
  28370. _i2 = _iterator2.next();
  28371. if (_i2.done) break;
  28372. _ref6 = _i2.value;
  28373. }
  28374. var _ref5 = _ref6;
  28375. var isHome = _ref5[0];
  28376. var loc = _ref5[1];
  28377. reporter.verbose(reporter.lang('configPossibleFile', loc));
  28378. if (yield (_fs || _load_fs()).exists(loc)) {
  28379. reporter.verbose(reporter.lang('configFileFound', loc));
  28380. actuals.push([isHome, loc, yield (_fs || _load_fs()).readFile(loc)]);
  28381. }
  28382. }
  28383. return actuals;
  28384. });
  28385. function getPossibleConfigLocations(_x6, _x7) {
  28386. return _ref3.apply(this, arguments);
  28387. }
  28388. return getPossibleConfigLocations;
  28389. }();
  28390. NpmRegistry.getConfigEnv = function getConfigEnv() {
  28391. var env = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : process.env;
  28392. // To match NPM's behavior, HOME is always the user's home directory.
  28393. var overrideEnv = {
  28394. HOME: (_userHomeDir2 || _load_userHomeDir2()).home
  28395. };
  28396. return (0, (_assign || _load_assign()).default)({}, env, overrideEnv);
  28397. };
  28398. NpmRegistry.normalizeConfig = function normalizeConfig(config) {
  28399. var env = NpmRegistry.getConfigEnv();
  28400. config = (_baseRegistry || _load_baseRegistry()).default.normalizeConfig(config);
  28401. for (var key in config) {
  28402. config[key] = (0, (_envReplace || _load_envReplace()).default)(config[key], env);
  28403. if (isPathConfigOption(key)) {
  28404. config[key] = normalizePath(config[key]);
  28405. }
  28406. }
  28407. return config;
  28408. };
  28409. NpmRegistry.prototype.loadConfig = function () {
  28410. var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  28411. // docs: https://docs.npmjs.com/misc/config
  28412. this.mergeEnv('npm_config_');
  28413. for (var _iterator3 = yield this.getPossibleConfigLocations('npmrc', this.reporter), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  28414. var _ref9;
  28415. if (_isArray3) {
  28416. if (_i3 >= _iterator3.length) break;
  28417. _ref9 = _iterator3[_i3++];
  28418. } else {
  28419. _i3 = _iterator3.next();
  28420. if (_i3.done) break;
  28421. _ref9 = _i3.value;
  28422. }
  28423. var _ref8 = _ref9;
  28424. var loc = _ref8[1];
  28425. var file = _ref8[2];
  28426. var config = NpmRegistry.normalizeConfig((_ini || _load_ini()).default.parse(file));
  28427. // normalize offline mirror path relative to the current npmrc
  28428. var offlineLoc = config['yarn-offline-mirror'];
  28429. // don't normalize if we already have a mirror path
  28430. if (!this.config['yarn-offline-mirror'] && offlineLoc) {
  28431. var mirrorLoc = config['yarn-offline-mirror'] = (_path2 || _load_path2()).default.resolve((_path2 || _load_path2()).default.dirname(loc), offlineLoc);
  28432. yield (_fs || _load_fs()).mkdirp(mirrorLoc);
  28433. }
  28434. this.config = (0, (_assign || _load_assign()).default)({}, config, this.config);
  28435. }
  28436. });
  28437. function loadConfig() {
  28438. return _ref7.apply(this, arguments);
  28439. }
  28440. return loadConfig;
  28441. }();
  28442. NpmRegistry.prototype.getScope = function getScope(packageIdent) {
  28443. var match = packageIdent.match(SCOPED_PKG_REGEXP);
  28444. return match && match[1] || '';
  28445. };
  28446. NpmRegistry.prototype.getRegistry = function getRegistry(packageIdent) {
  28447. // Try extracting registry from the url, then scoped registry, and default registry
  28448. if (packageIdent.match(REGEX_REGISTRY_PREFIX)) {
  28449. var availableRegistries = this.getAvailableRegistries();
  28450. var registry = availableRegistries.find(function (registry) {
  28451. return packageIdent.startsWith(registry);
  28452. });
  28453. if (registry) {
  28454. return String(registry);
  28455. }
  28456. }
  28457. var _arr = [this.getScope(packageIdent), ''];
  28458. for (var _i4 = 0; _i4 < _arr.length; _i4++) {
  28459. var scope = _arr[_i4];
  28460. var _registry = this.getScopedOption(scope, 'registry') || this.registries.yarn.getScopedOption(scope, 'registry');
  28461. if (_registry) {
  28462. return String(_registry);
  28463. }
  28464. }
  28465. return DEFAULT_REGISTRY;
  28466. };
  28467. NpmRegistry.prototype.getAuthByRegistry = function getAuthByRegistry(registry) {
  28468. // Check for bearer token.
  28469. var authToken = this.getRegistryOrGlobalOption(registry, '_authToken');
  28470. if (authToken) {
  28471. return `Bearer ${String(authToken)}`;
  28472. }
  28473. // Check for basic auth token.
  28474. var auth = this.getRegistryOrGlobalOption(registry, '_auth');
  28475. if (auth) {
  28476. return `Basic ${String(auth)}`;
  28477. }
  28478. // Check for basic username/password auth.
  28479. var username = this.getRegistryOrGlobalOption(registry, 'username');
  28480. var password = this.getRegistryOrGlobalOption(registry, '_password');
  28481. if (username && password) {
  28482. var pw = Buffer.from(String(password), 'base64').toString();
  28483. return 'Basic ' + Buffer.from(String(username) + ':' + pw).toString('base64');
  28484. }
  28485. return '';
  28486. };
  28487. NpmRegistry.prototype.getAuth = function getAuth(packageIdent) {
  28488. if (this.token) {
  28489. return this.token;
  28490. }
  28491. var baseRegistry = this.getRegistry(packageIdent);
  28492. var registries = [baseRegistry];
  28493. // If sending a request to the Yarn registry, we must also send it the auth token for the npm registry
  28494. if (baseRegistry === (_constants || _load_constants()).YARN_REGISTRY) {
  28495. registries.push(DEFAULT_REGISTRY);
  28496. }
  28497. for (var _iterator4 = registries, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  28498. var _ref10;
  28499. if (_isArray4) {
  28500. if (_i5 >= _iterator4.length) break;
  28501. _ref10 = _iterator4[_i5++];
  28502. } else {
  28503. _i5 = _iterator4.next();
  28504. if (_i5.done) break;
  28505. _ref10 = _i5.value;
  28506. }
  28507. var registry = _ref10;
  28508. var auth = this.getAuthByRegistry(registry);
  28509. if (auth) {
  28510. return auth;
  28511. }
  28512. }
  28513. return '';
  28514. };
  28515. NpmRegistry.prototype.getScopedOption = function getScopedOption(scope, option) {
  28516. return this.getOption(scope + (scope ? ':' : '') + option);
  28517. };
  28518. NpmRegistry.prototype.getRegistryOption = function getRegistryOption(registry, option) {
  28519. var pre = REGEX_REGISTRY_HTTP_PROTOCOL;
  28520. var suf = REGEX_REGISTRY_SUFFIX;
  28521. // When registry is used config scope, the trailing '/' is required
  28522. var reg = (0, (_misc || _load_misc()).addSuffix)(registry, '/');
  28523. // 1st attempt, try to get option for the given registry URL
  28524. // 2nd attempt, remove the 'https?:' prefix of the registry URL
  28525. // 3nd attempt, remove the 'registry/?' suffix of the registry URL
  28526. return this.getScopedOption(reg, option) || pre.test(reg) && this.getRegistryOption(reg.replace(pre, ''), option) || suf.test(reg) && this.getRegistryOption(reg.replace(suf, ''), option);
  28527. };
  28528. NpmRegistry.prototype.getRegistryOrGlobalOption = function getRegistryOrGlobalOption(registry, option) {
  28529. return this.getRegistryOption(registry, option) || this.getOption(option);
  28530. };
  28531. return NpmRegistry;
  28532. }((_baseRegistry || _load_baseRegistry()).default);
  28533. NpmRegistry.filename = 'package.json';
  28534. exports.default = NpmRegistry;
  28535. /***/ }),
  28536. /* 85 */
  28537. /***/ (function(module, exports, __webpack_require__) {
  28538. "use strict";
  28539. Object.defineProperty(exports, "__esModule", {
  28540. value: true
  28541. });
  28542. var _classCallCheck2;
  28543. function _load_classCallCheck() {
  28544. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  28545. }
  28546. var _possibleConstructorReturn2;
  28547. function _load_possibleConstructorReturn() {
  28548. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  28549. }
  28550. var _inherits2;
  28551. function _load_inherits() {
  28552. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  28553. }
  28554. var _baseResolver;
  28555. function _load_baseResolver() {
  28556. return _baseResolver = _interopRequireDefault(__webpack_require__(118));
  28557. }
  28558. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  28559. var ExoticResolver = function (_BaseResolver) {
  28560. (0, (_inherits2 || _load_inherits()).default)(ExoticResolver, _BaseResolver);
  28561. function ExoticResolver() {
  28562. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ExoticResolver);
  28563. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.apply(this, arguments));
  28564. }
  28565. ExoticResolver.isVersion = function isVersion(pattern) {
  28566. var proto = this.protocol;
  28567. if (proto) {
  28568. return pattern.startsWith(`${proto}:`);
  28569. } else {
  28570. throw new Error('No protocol specified');
  28571. }
  28572. };
  28573. return ExoticResolver;
  28574. }((_baseResolver || _load_baseResolver()).default);
  28575. exports.default = ExoticResolver;
  28576. /***/ }),
  28577. /* 86 */
  28578. /***/ (function(module, exports, __webpack_require__) {
  28579. "use strict";
  28580. Object.defineProperty(exports, "__esModule", {
  28581. value: true
  28582. });
  28583. var _promise;
  28584. function _load_promise() {
  28585. return _promise = _interopRequireDefault(__webpack_require__(7));
  28586. }
  28587. exports.wait = wait;
  28588. exports.promisify = promisify;
  28589. exports.queue = queue;
  28590. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  28591. function wait(delay) {
  28592. return new (_promise || _load_promise()).default(function (resolve) {
  28593. setTimeout(resolve, delay);
  28594. });
  28595. }
  28596. function promisify(fn, firstData) {
  28597. return function () {
  28598. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  28599. args[_key] = arguments[_key];
  28600. }
  28601. return new (_promise || _load_promise()).default(function (resolve, reject) {
  28602. args.push(function (err) {
  28603. for (var _len2 = arguments.length, result = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  28604. result[_key2 - 1] = arguments[_key2];
  28605. }
  28606. var res = result;
  28607. if (result.length <= 1) {
  28608. res = result[0];
  28609. }
  28610. if (firstData) {
  28611. res = err;
  28612. err = null;
  28613. }
  28614. if (err) {
  28615. reject(err);
  28616. } else {
  28617. resolve(res);
  28618. }
  28619. });
  28620. fn.apply(null, args);
  28621. });
  28622. };
  28623. }
  28624. function queue(arr, promiseProducer) {
  28625. var concurrency = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity;
  28626. concurrency = Math.min(concurrency, arr.length);
  28627. // clone
  28628. arr = arr.slice();
  28629. var results = [];
  28630. var total = arr.length;
  28631. if (!total) {
  28632. return (_promise || _load_promise()).default.resolve(results);
  28633. }
  28634. return new (_promise || _load_promise()).default(function (resolve, reject) {
  28635. for (var i = 0; i < concurrency; i++) {
  28636. next();
  28637. }
  28638. function next() {
  28639. var item = arr.shift();
  28640. var promise = promiseProducer(item);
  28641. promise.then(function (result) {
  28642. results.push(result);
  28643. total--;
  28644. if (total === 0) {
  28645. resolve(results);
  28646. } else {
  28647. if (arr.length) {
  28648. next();
  28649. }
  28650. }
  28651. }, reject);
  28652. }
  28653. });
  28654. }
  28655. /***/ }),
  28656. /* 87 */
  28657. /***/ (function(module, exports, __webpack_require__) {
  28658. "use strict";
  28659. Object.defineProperty(exports, "__esModule", {
  28660. value: true
  28661. });
  28662. var _classCallCheck2;
  28663. function _load_classCallCheck() {
  28664. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  28665. }
  28666. var _normalizePattern2;
  28667. function _load_normalizePattern() {
  28668. return _normalizePattern2 = __webpack_require__(52);
  28669. }
  28670. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  28671. var semver = __webpack_require__(27);
  28672. var WorkspaceLayout = function () {
  28673. function WorkspaceLayout(workspaces, config) {
  28674. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, WorkspaceLayout);
  28675. this.workspaces = workspaces;
  28676. this.config = config;
  28677. }
  28678. WorkspaceLayout.prototype.getWorkspaceManifest = function getWorkspaceManifest(key) {
  28679. return this.workspaces[key];
  28680. };
  28681. WorkspaceLayout.prototype.getManifestByPattern = function getManifestByPattern(pattern) {
  28682. var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern),
  28683. name = _normalizePattern.name,
  28684. range = _normalizePattern.range;
  28685. var workspace = this.getWorkspaceManifest(name);
  28686. if (!workspace || !semver.satisfies(workspace.manifest.version, range, this.config.looseSemver)) {
  28687. return null;
  28688. }
  28689. return workspace;
  28690. };
  28691. return WorkspaceLayout;
  28692. }();
  28693. exports.default = WorkspaceLayout;
  28694. /***/ }),
  28695. /* 88 */
  28696. /***/ (function(module, exports) {
  28697. module.exports = function (it) {
  28698. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  28699. return it;
  28700. };
  28701. /***/ }),
  28702. /* 89 */
  28703. /***/ (function(module, exports) {
  28704. var hasOwnProperty = {}.hasOwnProperty;
  28705. module.exports = function (it, key) {
  28706. return hasOwnProperty.call(it, key);
  28707. };
  28708. /***/ }),
  28709. /* 90 */
  28710. /***/ (function(module, exports, __webpack_require__) {
  28711. // to indexed object, toObject with fallback for non-array-like ES3 strings
  28712. var IObject = __webpack_require__(218);
  28713. var defined = __webpack_require__(215);
  28714. module.exports = function (it) {
  28715. return IObject(defined(it));
  28716. };
  28717. /***/ }),
  28718. /* 91 */
  28719. /***/ (function(module, exports, __webpack_require__) {
  28720. var Stream = __webpack_require__(36);
  28721. if (process.env.READABLE_STREAM === 'disable' && Stream) {
  28722. module.exports = Stream;
  28723. exports = module.exports = Stream.Readable;
  28724. exports.Readable = Stream.Readable;
  28725. exports.Writable = Stream.Writable;
  28726. exports.Duplex = Stream.Duplex;
  28727. exports.Transform = Stream.Transform;
  28728. exports.PassThrough = Stream.PassThrough;
  28729. exports.Stream = Stream;
  28730. } else {
  28731. exports = module.exports = __webpack_require__(376);
  28732. exports.Stream = Stream || exports;
  28733. exports.Readable = exports;
  28734. exports.Writable = __webpack_require__(378);
  28735. exports.Duplex = __webpack_require__(110);
  28736. exports.Transform = __webpack_require__(377);
  28737. exports.PassThrough = __webpack_require__(864);
  28738. }
  28739. /***/ }),
  28740. /* 92 */
  28741. /***/ (function(module, exports, __webpack_require__) {
  28742. // Copyright 2015 Joyent, Inc.
  28743. module.exports = {
  28744. read: read.bind(undefined, false, undefined),
  28745. readType: read.bind(undefined, false),
  28746. write: write,
  28747. /* semi-private api, used by sshpk-agent */
  28748. readPartial: read.bind(undefined, true),
  28749. /* shared with ssh format */
  28750. readInternal: read,
  28751. keyTypeToAlg: keyTypeToAlg,
  28752. algToKeyType: algToKeyType
  28753. };
  28754. var assert = __webpack_require__(22);
  28755. var Buffer = __webpack_require__(20).Buffer;
  28756. var algs = __webpack_require__(39);
  28757. var utils = __webpack_require__(32);
  28758. var Key = __webpack_require__(35);
  28759. var PrivateKey = __webpack_require__(40);
  28760. var SSHBuffer = __webpack_require__(148);
  28761. function algToKeyType(alg) {
  28762. assert.string(alg);
  28763. if (alg === 'ssh-dss')
  28764. return ('dsa');
  28765. else if (alg === 'ssh-rsa')
  28766. return ('rsa');
  28767. else if (alg === 'ssh-ed25519')
  28768. return ('ed25519');
  28769. else if (alg === 'ssh-curve25519')
  28770. return ('curve25519');
  28771. else if (alg.match(/^ecdsa-sha2-/))
  28772. return ('ecdsa');
  28773. else
  28774. throw (new Error('Unknown algorithm ' + alg));
  28775. }
  28776. function keyTypeToAlg(key) {
  28777. assert.object(key);
  28778. if (key.type === 'dsa')
  28779. return ('ssh-dss');
  28780. else if (key.type === 'rsa')
  28781. return ('ssh-rsa');
  28782. else if (key.type === 'ed25519')
  28783. return ('ssh-ed25519');
  28784. else if (key.type === 'curve25519')
  28785. return ('ssh-curve25519');
  28786. else if (key.type === 'ecdsa')
  28787. return ('ecdsa-sha2-' + key.part.curve.data.toString());
  28788. else
  28789. throw (new Error('Unknown key type ' + key.type));
  28790. }
  28791. function read(partial, type, buf, options) {
  28792. if (typeof (buf) === 'string')
  28793. buf = Buffer.from(buf);
  28794. assert.buffer(buf, 'buf');
  28795. var key = {};
  28796. var parts = key.parts = [];
  28797. var sshbuf = new SSHBuffer({buffer: buf});
  28798. var alg = sshbuf.readString();
  28799. assert.ok(!sshbuf.atEnd(), 'key must have at least one part');
  28800. key.type = algToKeyType(alg);
  28801. var partCount = algs.info[key.type].parts.length;
  28802. if (type && type === 'private')
  28803. partCount = algs.privInfo[key.type].parts.length;
  28804. while (!sshbuf.atEnd() && parts.length < partCount)
  28805. parts.push(sshbuf.readPart());
  28806. while (!partial && !sshbuf.atEnd())
  28807. parts.push(sshbuf.readPart());
  28808. assert.ok(parts.length >= 1,
  28809. 'key must have at least one part');
  28810. assert.ok(partial || sshbuf.atEnd(),
  28811. 'leftover bytes at end of key');
  28812. var Constructor = Key;
  28813. var algInfo = algs.info[key.type];
  28814. if (type === 'private' || algInfo.parts.length !== parts.length) {
  28815. algInfo = algs.privInfo[key.type];
  28816. Constructor = PrivateKey;
  28817. }
  28818. assert.strictEqual(algInfo.parts.length, parts.length);
  28819. if (key.type === 'ecdsa') {
  28820. var res = /^ecdsa-sha2-(.+)$/.exec(alg);
  28821. assert.ok(res !== null);
  28822. assert.strictEqual(res[1], parts[0].data.toString());
  28823. }
  28824. var normalized = true;
  28825. for (var i = 0; i < algInfo.parts.length; ++i) {
  28826. var p = parts[i];
  28827. p.name = algInfo.parts[i];
  28828. /*
  28829. * OpenSSH stores ed25519 "private" keys as seed + public key
  28830. * concat'd together (k followed by A). We want to keep them
  28831. * separate for other formats that don't do this.
  28832. */
  28833. if (key.type === 'ed25519' && p.name === 'k')
  28834. p.data = p.data.slice(0, 32);
  28835. if (p.name !== 'curve' && algInfo.normalize !== false) {
  28836. var nd;
  28837. if (key.type === 'ed25519') {
  28838. nd = utils.zeroPadToLength(p.data, 32);
  28839. } else {
  28840. nd = utils.mpNormalize(p.data);
  28841. }
  28842. if (nd.toString('binary') !==
  28843. p.data.toString('binary')) {
  28844. p.data = nd;
  28845. normalized = false;
  28846. }
  28847. }
  28848. }
  28849. if (normalized)
  28850. key._rfc4253Cache = sshbuf.toBuffer();
  28851. if (partial && typeof (partial) === 'object') {
  28852. partial.remainder = sshbuf.remainder();
  28853. partial.consumed = sshbuf._offset;
  28854. }
  28855. return (new Constructor(key));
  28856. }
  28857. function write(key, options) {
  28858. assert.object(key);
  28859. var alg = keyTypeToAlg(key);
  28860. var i;
  28861. var algInfo = algs.info[key.type];
  28862. if (PrivateKey.isPrivateKey(key))
  28863. algInfo = algs.privInfo[key.type];
  28864. var parts = algInfo.parts;
  28865. var buf = new SSHBuffer({});
  28866. buf.writeString(alg);
  28867. for (i = 0; i < parts.length; ++i) {
  28868. var data = key.part[parts[i]].data;
  28869. if (algInfo.normalize !== false) {
  28870. if (key.type === 'ed25519')
  28871. data = utils.zeroPadToLength(data, 32);
  28872. else
  28873. data = utils.mpNormalize(data);
  28874. }
  28875. if (key.type === 'ed25519' && parts[i] === 'k')
  28876. data = Buffer.concat([data, key.part.A.data]);
  28877. buf.writeBuffer(data);
  28878. }
  28879. return (buf.toBuffer());
  28880. }
  28881. /***/ }),
  28882. /* 93 */
  28883. /***/ (function(module, exports, __webpack_require__) {
  28884. "use strict";
  28885. const Buffer = __webpack_require__(60).Buffer
  28886. const crypto = __webpack_require__(21)
  28887. const Transform = __webpack_require__(36).Transform
  28888. const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512']
  28889. const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i
  28890. const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/
  28891. const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/
  28892. const VCHAR_REGEX = /^[\x21-\x7E]+$/
  28893. class Hash {
  28894. get isHash () { return true }
  28895. constructor (hash, opts) {
  28896. const strict = !!(opts && opts.strict)
  28897. this.source = hash.trim()
  28898. // 3.1. Integrity metadata (called "Hash" by ssri)
  28899. // https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description
  28900. const match = this.source.match(
  28901. strict
  28902. ? STRICT_SRI_REGEX
  28903. : SRI_REGEX
  28904. )
  28905. if (!match) { return }
  28906. if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return }
  28907. this.algorithm = match[1]
  28908. this.digest = match[2]
  28909. const rawOpts = match[3]
  28910. this.options = rawOpts ? rawOpts.slice(1).split('?') : []
  28911. }
  28912. hexDigest () {
  28913. return this.digest && Buffer.from(this.digest, 'base64').toString('hex')
  28914. }
  28915. toJSON () {
  28916. return this.toString()
  28917. }
  28918. toString (opts) {
  28919. if (opts && opts.strict) {
  28920. // Strict mode enforces the standard as close to the foot of the
  28921. // letter as it can.
  28922. if (!(
  28923. // The spec has very restricted productions for algorithms.
  28924. // https://www.w3.org/TR/CSP2/#source-list-syntax
  28925. SPEC_ALGORITHMS.some(x => x === this.algorithm) &&
  28926. // Usually, if someone insists on using a "different" base64, we
  28927. // leave it as-is, since there's multiple standards, and the
  28928. // specified is not a URL-safe variant.
  28929. // https://www.w3.org/TR/CSP2/#base64_value
  28930. this.digest.match(BASE64_REGEX) &&
  28931. // Option syntax is strictly visual chars.
  28932. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression
  28933. // https://tools.ietf.org/html/rfc5234#appendix-B.1
  28934. (this.options || []).every(opt => opt.match(VCHAR_REGEX))
  28935. )) {
  28936. return ''
  28937. }
  28938. }
  28939. const options = this.options && this.options.length
  28940. ? `?${this.options.join('?')}`
  28941. : ''
  28942. return `${this.algorithm}-${this.digest}${options}`
  28943. }
  28944. }
  28945. class Integrity {
  28946. get isIntegrity () { return true }
  28947. toJSON () {
  28948. return this.toString()
  28949. }
  28950. toString (opts) {
  28951. opts = opts || {}
  28952. let sep = opts.sep || ' '
  28953. if (opts.strict) {
  28954. // Entries must be separated by whitespace, according to spec.
  28955. sep = sep.replace(/\S+/g, ' ')
  28956. }
  28957. return Object.keys(this).map(k => {
  28958. return this[k].map(hash => {
  28959. return Hash.prototype.toString.call(hash, opts)
  28960. }).filter(x => x.length).join(sep)
  28961. }).filter(x => x.length).join(sep)
  28962. }
  28963. concat (integrity, opts) {
  28964. const other = typeof integrity === 'string'
  28965. ? integrity
  28966. : stringify(integrity, opts)
  28967. return parse(`${this.toString(opts)} ${other}`, opts)
  28968. }
  28969. hexDigest () {
  28970. return parse(this, {single: true}).hexDigest()
  28971. }
  28972. match (integrity, opts) {
  28973. const other = parse(integrity, opts)
  28974. const algo = other.pickAlgorithm(opts)
  28975. return (
  28976. this[algo] &&
  28977. other[algo] &&
  28978. this[algo].find(hash =>
  28979. other[algo].find(otherhash =>
  28980. hash.digest === otherhash.digest
  28981. )
  28982. )
  28983. ) || false
  28984. }
  28985. pickAlgorithm (opts) {
  28986. const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash
  28987. const keys = Object.keys(this)
  28988. if (!keys.length) {
  28989. throw new Error(`No algorithms available for ${
  28990. JSON.stringify(this.toString())
  28991. }`)
  28992. }
  28993. return keys.reduce((acc, algo) => {
  28994. return pickAlgorithm(acc, algo) || acc
  28995. })
  28996. }
  28997. }
  28998. module.exports.parse = parse
  28999. function parse (sri, opts) {
  29000. opts = opts || {}
  29001. if (typeof sri === 'string') {
  29002. return _parse(sri, opts)
  29003. } else if (sri.algorithm && sri.digest) {
  29004. const fullSri = new Integrity()
  29005. fullSri[sri.algorithm] = [sri]
  29006. return _parse(stringify(fullSri, opts), opts)
  29007. } else {
  29008. return _parse(stringify(sri, opts), opts)
  29009. }
  29010. }
  29011. function _parse (integrity, opts) {
  29012. // 3.4.3. Parse metadata
  29013. // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  29014. if (opts.single) {
  29015. return new Hash(integrity, opts)
  29016. }
  29017. return integrity.trim().split(/\s+/).reduce((acc, string) => {
  29018. const hash = new Hash(string, opts)
  29019. if (hash.algorithm && hash.digest) {
  29020. const algo = hash.algorithm
  29021. if (!acc[algo]) { acc[algo] = [] }
  29022. acc[algo].push(hash)
  29023. }
  29024. return acc
  29025. }, new Integrity())
  29026. }
  29027. module.exports.stringify = stringify
  29028. function stringify (obj, opts) {
  29029. if (obj.algorithm && obj.digest) {
  29030. return Hash.prototype.toString.call(obj, opts)
  29031. } else if (typeof obj === 'string') {
  29032. return stringify(parse(obj, opts), opts)
  29033. } else {
  29034. return Integrity.prototype.toString.call(obj, opts)
  29035. }
  29036. }
  29037. module.exports.fromHex = fromHex
  29038. function fromHex (hexDigest, algorithm, opts) {
  29039. const optString = (opts && opts.options && opts.options.length)
  29040. ? `?${opts.options.join('?')}`
  29041. : ''
  29042. return parse(
  29043. `${algorithm}-${
  29044. Buffer.from(hexDigest, 'hex').toString('base64')
  29045. }${optString}`, opts
  29046. )
  29047. }
  29048. module.exports.fromData = fromData
  29049. function fromData (data, opts) {
  29050. opts = opts || {}
  29051. const algorithms = opts.algorithms || ['sha512']
  29052. const optString = opts.options && opts.options.length
  29053. ? `?${opts.options.join('?')}`
  29054. : ''
  29055. return algorithms.reduce((acc, algo) => {
  29056. const digest = crypto.createHash(algo).update(data).digest('base64')
  29057. const hash = new Hash(
  29058. `${algo}-${digest}${optString}`,
  29059. opts
  29060. )
  29061. if (hash.algorithm && hash.digest) {
  29062. const algo = hash.algorithm
  29063. if (!acc[algo]) { acc[algo] = [] }
  29064. acc[algo].push(hash)
  29065. }
  29066. return acc
  29067. }, new Integrity())
  29068. }
  29069. module.exports.fromStream = fromStream
  29070. function fromStream (stream, opts) {
  29071. opts = opts || {}
  29072. const P = opts.Promise || Promise
  29073. const istream = integrityStream(opts)
  29074. return new P((resolve, reject) => {
  29075. stream.pipe(istream)
  29076. stream.on('error', reject)
  29077. istream.on('error', reject)
  29078. let sri
  29079. istream.on('integrity', s => { sri = s })
  29080. istream.on('end', () => resolve(sri))
  29081. istream.on('data', () => {})
  29082. })
  29083. }
  29084. module.exports.checkData = checkData
  29085. function checkData (data, sri, opts) {
  29086. opts = opts || {}
  29087. sri = parse(sri, opts)
  29088. if (!Object.keys(sri).length) {
  29089. if (opts.error) {
  29090. throw Object.assign(
  29091. new Error('No valid integrity hashes to check against'), {
  29092. code: 'EINTEGRITY'
  29093. }
  29094. )
  29095. } else {
  29096. return false
  29097. }
  29098. }
  29099. const algorithm = sri.pickAlgorithm(opts)
  29100. const digest = crypto.createHash(algorithm).update(data).digest('base64')
  29101. const newSri = parse({algorithm, digest})
  29102. const match = newSri.match(sri, opts)
  29103. if (match || !opts.error) {
  29104. return match
  29105. } else if (typeof opts.size === 'number' && (data.length !== opts.size)) {
  29106. const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`)
  29107. err.code = 'EBADSIZE'
  29108. err.found = data.length
  29109. err.expected = opts.size
  29110. err.sri = sri
  29111. throw err
  29112. } else {
  29113. const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`)
  29114. err.code = 'EINTEGRITY'
  29115. err.found = newSri
  29116. err.expected = sri
  29117. err.algorithm = algorithm
  29118. err.sri = sri
  29119. throw err
  29120. }
  29121. }
  29122. module.exports.checkStream = checkStream
  29123. function checkStream (stream, sri, opts) {
  29124. opts = opts || {}
  29125. const P = opts.Promise || Promise
  29126. const checker = integrityStream(Object.assign({}, opts, {
  29127. integrity: sri
  29128. }))
  29129. return new P((resolve, reject) => {
  29130. stream.pipe(checker)
  29131. stream.on('error', reject)
  29132. checker.on('error', reject)
  29133. let sri
  29134. checker.on('verified', s => { sri = s })
  29135. checker.on('end', () => resolve(sri))
  29136. checker.on('data', () => {})
  29137. })
  29138. }
  29139. module.exports.integrityStream = integrityStream
  29140. function integrityStream (opts) {
  29141. opts = opts || {}
  29142. // For verification
  29143. const sri = opts.integrity && parse(opts.integrity, opts)
  29144. const goodSri = sri && Object.keys(sri).length
  29145. const algorithm = goodSri && sri.pickAlgorithm(opts)
  29146. const digests = goodSri && sri[algorithm]
  29147. // Calculating stream
  29148. const algorithms = Array.from(
  29149. new Set(
  29150. (opts.algorithms || ['sha512'])
  29151. .concat(algorithm ? [algorithm] : [])
  29152. )
  29153. )
  29154. const hashes = algorithms.map(crypto.createHash)
  29155. let streamSize = 0
  29156. const stream = new Transform({
  29157. transform (chunk, enc, cb) {
  29158. streamSize += chunk.length
  29159. hashes.forEach(h => h.update(chunk, enc))
  29160. cb(null, chunk, enc)
  29161. }
  29162. }).on('end', () => {
  29163. const optString = (opts.options && opts.options.length)
  29164. ? `?${opts.options.join('?')}`
  29165. : ''
  29166. const newSri = parse(hashes.map((h, i) => {
  29167. return `${algorithms[i]}-${h.digest('base64')}${optString}`
  29168. }).join(' '), opts)
  29169. // Integrity verification mode
  29170. const match = goodSri && newSri.match(sri, opts)
  29171. if (typeof opts.size === 'number' && streamSize !== opts.size) {
  29172. const err = new Error(`stream size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${streamSize}`)
  29173. err.code = 'EBADSIZE'
  29174. err.found = streamSize
  29175. err.expected = opts.size
  29176. err.sri = sri
  29177. stream.emit('error', err)
  29178. } else if (opts.integrity && !match) {
  29179. const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`)
  29180. err.code = 'EINTEGRITY'
  29181. err.found = newSri
  29182. err.expected = digests
  29183. err.algorithm = algorithm
  29184. err.sri = sri
  29185. stream.emit('error', err)
  29186. } else {
  29187. stream.emit('size', streamSize)
  29188. stream.emit('integrity', newSri)
  29189. match && stream.emit('verified', match)
  29190. }
  29191. })
  29192. return stream
  29193. }
  29194. module.exports.create = createIntegrity
  29195. function createIntegrity (opts) {
  29196. opts = opts || {}
  29197. const algorithms = opts.algorithms || ['sha512']
  29198. const optString = opts.options && opts.options.length
  29199. ? `?${opts.options.join('?')}`
  29200. : ''
  29201. const hashes = algorithms.map(crypto.createHash)
  29202. return {
  29203. update: function (chunk, enc) {
  29204. hashes.forEach(h => h.update(chunk, enc))
  29205. return this
  29206. },
  29207. digest: function (enc) {
  29208. const integrity = algorithms.reduce((acc, algo) => {
  29209. const digest = hashes.shift().digest('base64')
  29210. const hash = new Hash(
  29211. `${algo}-${digest}${optString}`,
  29212. opts
  29213. )
  29214. if (hash.algorithm && hash.digest) {
  29215. const algo = hash.algorithm
  29216. if (!acc[algo]) { acc[algo] = [] }
  29217. acc[algo].push(hash)
  29218. }
  29219. return acc
  29220. }, new Integrity())
  29221. return integrity
  29222. }
  29223. }
  29224. }
  29225. const NODE_HASHES = new Set(crypto.getHashes())
  29226. // This is a Best Effort™ at a reasonable priority for hash algos
  29227. const DEFAULT_PRIORITY = [
  29228. 'md5', 'whirlpool', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512',
  29229. // TODO - it's unclear _which_ of these Node will actually use as its name
  29230. // for the algorithm, so we guesswork it based on the OpenSSL names.
  29231. 'sha3',
  29232. 'sha3-256', 'sha3-384', 'sha3-512',
  29233. 'sha3_256', 'sha3_384', 'sha3_512'
  29234. ].filter(algo => NODE_HASHES.has(algo))
  29235. function getPrioritizedHash (algo1, algo2) {
  29236. return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase())
  29237. ? algo1
  29238. : algo2
  29239. }
  29240. /***/ }),
  29241. /* 94 */
  29242. /***/ (function(module, exports) {
  29243. module.exports = require("buffer");
  29244. /***/ }),
  29245. /* 95 */
  29246. /***/ (function(module, exports) {
  29247. module.exports = require("events");
  29248. /***/ }),
  29249. /* 96 */
  29250. /***/ (function(module, exports, __webpack_require__) {
  29251. "use strict";
  29252. Object.defineProperty(exports, "__esModule", {
  29253. value: true
  29254. });
  29255. exports.getInstallationMethod = exports.version = undefined;
  29256. var _asyncToGenerator2;
  29257. function _load_asyncToGenerator() {
  29258. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  29259. }
  29260. var getInstallationMethod = exports.getInstallationMethod = function () {
  29261. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  29262. var installationMethod = originalInstallationMethod;
  29263. // If there's a package.json in the parent directory, it could have an
  29264. // override for the installation method, so we should prefer that over
  29265. // whatever was originally in Yarn's package.json. This is the case with
  29266. // systems such as Homebrew, which take the tarball and modify the
  29267. // installation method so we're aware of the fact that Yarn was installed via
  29268. // Homebrew (so things like update notifications can point out the correct
  29269. // command to upgrade).
  29270. try {
  29271. var manifestPath = (_path || _load_path()).default.join(__dirname, '..', 'package.json');
  29272. if ((_fs2 || _load_fs2()).default.existsSync(manifestPath)) {
  29273. // non-async version is deprecated
  29274. var manifest = yield (0, (_fs || _load_fs()).readJson)(manifestPath);
  29275. if (manifest.installationMethod) {
  29276. installationMethod = manifest.installationMethod;
  29277. }
  29278. }
  29279. } catch (e) {
  29280. // Ignore any errors; this is not critical functionality.
  29281. }
  29282. return installationMethod;
  29283. });
  29284. return function getInstallationMethod() {
  29285. return _ref.apply(this, arguments);
  29286. };
  29287. }();
  29288. var _fs;
  29289. function _load_fs() {
  29290. return _fs = __webpack_require__(8);
  29291. }
  29292. var _fs2;
  29293. function _load_fs2() {
  29294. return _fs2 = _interopRequireDefault(__webpack_require__(12));
  29295. }
  29296. var _path;
  29297. function _load_path() {
  29298. return _path = _interopRequireDefault(__webpack_require__(1));
  29299. }
  29300. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  29301. // This will be bundled directly in the .js file for production builds
  29302. var _require = __webpack_require__(438),
  29303. version = _require.version,
  29304. originalInstallationMethod = _require.installationMethod; /**
  29305. * Determines the current version of Yarn itself.
  29306. *
  29307. */
  29308. exports.version = version;
  29309. /***/ }),
  29310. /* 97 */
  29311. /***/ (function(module, exports, __webpack_require__) {
  29312. "use strict";
  29313. Object.defineProperty(exports, "__esModule", {
  29314. value: true
  29315. });
  29316. exports.run = exports.getToken = undefined;
  29317. var _promise;
  29318. function _load_promise() {
  29319. return _promise = _interopRequireDefault(__webpack_require__(7));
  29320. }
  29321. var _asyncToGenerator2;
  29322. function _load_asyncToGenerator() {
  29323. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  29324. }
  29325. var getCredentials = function () {
  29326. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) {
  29327. var _config$registries$ya = config.registries.yarn.config,
  29328. username = _config$registries$ya.username,
  29329. email = _config$registries$ya.email;
  29330. if (username) {
  29331. reporter.info(`${reporter.lang('npmUsername')}: ${username}`);
  29332. } else {
  29333. username = yield reporter.question(reporter.lang('npmUsername'));
  29334. if (!username) {
  29335. return null;
  29336. }
  29337. }
  29338. if (email) {
  29339. reporter.info(`${reporter.lang('npmEmail')}: ${email}`);
  29340. } else {
  29341. email = yield reporter.question(reporter.lang('npmEmail'));
  29342. if (!email) {
  29343. return null;
  29344. }
  29345. }
  29346. yield config.registries.yarn.saveHomeConfig({ username, email });
  29347. return { username, email };
  29348. });
  29349. return function getCredentials(_x, _x2) {
  29350. return _ref.apply(this, arguments);
  29351. };
  29352. }();
  29353. var getToken = exports.getToken = function () {
  29354. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) {
  29355. var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  29356. var flags = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  29357. var registry = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '';
  29358. var auth = registry ? config.registries.npm.getAuthByRegistry(registry) : config.registries.npm.getAuth(name);
  29359. if (config.otp) {
  29360. config.registries.npm.setOtp(config.otp);
  29361. }
  29362. if (auth) {
  29363. config.registries.npm.setToken(auth);
  29364. return function revoke() {
  29365. reporter.info(reporter.lang('notRevokingConfigToken'));
  29366. return (_promise || _load_promise()).default.resolve();
  29367. };
  29368. }
  29369. var env = process.env.YARN_AUTH_TOKEN || process.env.NPM_AUTH_TOKEN;
  29370. if (env) {
  29371. config.registries.npm.setToken(`Bearer ${env}`);
  29372. return function revoke() {
  29373. reporter.info(reporter.lang('notRevokingEnvToken'));
  29374. return (_promise || _load_promise()).default.resolve();
  29375. };
  29376. }
  29377. // make sure we're not running in non-interactive mode before asking for login
  29378. if (flags.nonInteractive || config.nonInteractive) {
  29379. throw new (_errors || _load_errors()).MessageError(reporter.lang('nonInteractiveNoToken'));
  29380. }
  29381. //
  29382. var creds = yield getCredentials(config, reporter);
  29383. if (!creds) {
  29384. reporter.warn(reporter.lang('loginAsPublic'));
  29385. return function revoke() {
  29386. reporter.info(reporter.lang('noTokenToRevoke'));
  29387. return (_promise || _load_promise()).default.resolve();
  29388. };
  29389. }
  29390. var username = creds.username,
  29391. email = creds.email;
  29392. var password = yield reporter.question(reporter.lang('npmPassword'), {
  29393. password: true,
  29394. required: true
  29395. });
  29396. //
  29397. var userobj = {
  29398. _id: `org.couchdb.user:${username}`,
  29399. name: username,
  29400. password,
  29401. email,
  29402. type: 'user',
  29403. roles: [],
  29404. date: new Date().toISOString()
  29405. };
  29406. //
  29407. var res = yield config.registries.npm.request(`-/user/org.couchdb.user:${encodeURIComponent(username)}`, {
  29408. method: 'PUT',
  29409. registry,
  29410. body: userobj,
  29411. auth: { username, password, email }
  29412. });
  29413. if (res && res.ok) {
  29414. reporter.success(reporter.lang('loggedIn'));
  29415. var token = res.token;
  29416. config.registries.npm.setToken(`Bearer ${token}`);
  29417. return function () {
  29418. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  29419. reporter.success(reporter.lang('revokedToken'));
  29420. yield config.registries.npm.request(`-/user/token/${token}`, {
  29421. method: 'DELETE',
  29422. registry
  29423. });
  29424. });
  29425. function revoke() {
  29426. return _ref3.apply(this, arguments);
  29427. }
  29428. return revoke;
  29429. }();
  29430. } else {
  29431. throw new (_errors || _load_errors()).MessageError(reporter.lang('incorrectCredentials'));
  29432. }
  29433. });
  29434. return function getToken(_x3, _x4) {
  29435. return _ref2.apply(this, arguments);
  29436. };
  29437. }();
  29438. var run = exports.run = function () {
  29439. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  29440. yield getCredentials(config, reporter);
  29441. });
  29442. return function run(_x8, _x9, _x10, _x11) {
  29443. return _ref4.apply(this, arguments);
  29444. };
  29445. }();
  29446. exports.getOneTimePassword = getOneTimePassword;
  29447. exports.hasWrapper = hasWrapper;
  29448. exports.setFlags = setFlags;
  29449. var _errors;
  29450. function _load_errors() {
  29451. return _errors = __webpack_require__(6);
  29452. }
  29453. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  29454. function getOneTimePassword(reporter) {
  29455. return reporter.question(reporter.lang('npmOneTimePassword'));
  29456. }
  29457. function hasWrapper(commander, args) {
  29458. return true;
  29459. }
  29460. function setFlags(commander) {
  29461. commander.description('Stores registry username and email.');
  29462. }
  29463. /***/ }),
  29464. /* 98 */
  29465. /***/ (function(module, exports, __webpack_require__) {
  29466. "use strict";
  29467. Object.defineProperty(exports, "__esModule", {
  29468. value: true
  29469. });
  29470. var _asyncToGenerator2;
  29471. function _load_asyncToGenerator() {
  29472. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  29473. }
  29474. var _promise;
  29475. function _load_promise() {
  29476. return _promise = _interopRequireDefault(__webpack_require__(7));
  29477. }
  29478. var _classCallCheck2;
  29479. function _load_classCallCheck() {
  29480. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  29481. }
  29482. var _stringify;
  29483. function _load_stringify() {
  29484. return _stringify = _interopRequireDefault(__webpack_require__(37));
  29485. }
  29486. exports.stringifyLangArgs = stringifyLangArgs;
  29487. var _format;
  29488. function _load_format() {
  29489. return _format = __webpack_require__(522);
  29490. }
  29491. var _index;
  29492. function _load_index() {
  29493. return _index = _interopRequireWildcard(__webpack_require__(524));
  29494. }
  29495. var _isCi;
  29496. function _load_isCi() {
  29497. return _isCi = _interopRequireDefault(__webpack_require__(365));
  29498. }
  29499. var _os;
  29500. function _load_os() {
  29501. return _os = _interopRequireDefault(__webpack_require__(66));
  29502. }
  29503. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  29504. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  29505. /* eslint no-unused-vars: 0 */
  29506. var util = __webpack_require__(9);
  29507. var EventEmitter = __webpack_require__(95).EventEmitter;
  29508. function stringifyLangArgs(args) {
  29509. return args.map(function (val) {
  29510. if (val != null && val.inspect) {
  29511. return val.inspect();
  29512. } else {
  29513. try {
  29514. var str = (0, (_stringify || _load_stringify()).default)(val) || val + '';
  29515. // should match all literal line breaks and
  29516. // "u001b" that follow an odd number of backslashes and convert them to ESC
  29517. // we do this because the JSON.stringify process has escaped these characters
  29518. return str.replace(/((?:^|[^\\])(?:\\{2})*)\\u001[bB]/g, '$1\u001b').replace(/[\\]r[\\]n|([\\])?[\\]n/g, function (match, precededBacklash) {
  29519. // precededBacklash not null when "\n" is preceded by a backlash ("\\n")
  29520. // match will be "\\n" and we don't replace it with os.EOL
  29521. return precededBacklash ? match : (_os || _load_os()).default.EOL;
  29522. });
  29523. } catch (e) {
  29524. return util.inspect(val);
  29525. }
  29526. }
  29527. });
  29528. }
  29529. var BaseReporter = function () {
  29530. function BaseReporter() {
  29531. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  29532. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseReporter);
  29533. var lang = 'en';
  29534. this.language = lang;
  29535. this.stdout = opts.stdout || process.stdout;
  29536. this.stderr = opts.stderr || process.stderr;
  29537. this.stdin = opts.stdin || this._getStandardInput();
  29538. this.emoji = !!opts.emoji;
  29539. this.nonInteractive = !!opts.nonInteractive;
  29540. this.noProgress = !!opts.noProgress || (_isCi || _load_isCi()).default;
  29541. this.isVerbose = !!opts.verbose;
  29542. // $FlowFixMe: this is valid!
  29543. this.isTTY = this.stdout.isTTY;
  29544. this.peakMemory = 0;
  29545. this.startTime = Date.now();
  29546. this.format = (_format || _load_format()).defaultFormatter;
  29547. }
  29548. BaseReporter.prototype.lang = function lang(key) {
  29549. var msg = (_index || _load_index())[this.language][key] || (_index || _load_index()).en[key];
  29550. if (!msg) {
  29551. throw new ReferenceError(`No message defined for language key ${key}`);
  29552. }
  29553. // stringify args
  29554. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  29555. args[_key - 1] = arguments[_key];
  29556. }
  29557. var stringifiedArgs = stringifyLangArgs(args);
  29558. // replace $0 placeholders with args
  29559. return msg.replace(/\$(\d+)/g, function (str, i) {
  29560. return stringifiedArgs[i];
  29561. });
  29562. };
  29563. /**
  29564. * `stringifyLangArgs` run `JSON.stringify` on strings too causing
  29565. * them to appear quoted. This marks them as "raw" and prevents
  29566. * the quoting and escaping
  29567. */
  29568. BaseReporter.prototype.rawText = function rawText(str) {
  29569. return {
  29570. inspect() {
  29571. return str;
  29572. }
  29573. };
  29574. };
  29575. BaseReporter.prototype.verbose = function verbose(msg) {
  29576. if (this.isVerbose) {
  29577. this._verbose(msg);
  29578. }
  29579. };
  29580. BaseReporter.prototype.verboseInspect = function verboseInspect(val) {
  29581. if (this.isVerbose) {
  29582. this._verboseInspect(val);
  29583. }
  29584. };
  29585. BaseReporter.prototype._verbose = function _verbose(msg) {};
  29586. BaseReporter.prototype._verboseInspect = function _verboseInspect(val) {};
  29587. BaseReporter.prototype._getStandardInput = function _getStandardInput() {
  29588. var standardInput = void 0;
  29589. // Accessing stdin in a win32 headless process (e.g., Visual Studio) may throw an exception.
  29590. try {
  29591. standardInput = process.stdin;
  29592. } catch (e) {
  29593. console.warn(e.message);
  29594. delete process.stdin;
  29595. // $FlowFixMe: this is valid!
  29596. process.stdin = new EventEmitter();
  29597. standardInput = process.stdin;
  29598. }
  29599. return standardInput;
  29600. };
  29601. BaseReporter.prototype.initPeakMemoryCounter = function initPeakMemoryCounter() {
  29602. var _this = this;
  29603. this.checkPeakMemory();
  29604. this.peakMemoryInterval = setInterval(function () {
  29605. _this.checkPeakMemory();
  29606. }, 1000);
  29607. // $FlowFixMe: Node's setInterval returns a Timeout, not a Number
  29608. this.peakMemoryInterval.unref();
  29609. };
  29610. BaseReporter.prototype.checkPeakMemory = function checkPeakMemory() {
  29611. var _process$memoryUsage = process.memoryUsage(),
  29612. heapTotal = _process$memoryUsage.heapTotal;
  29613. if (heapTotal > this.peakMemory) {
  29614. this.peakMemory = heapTotal;
  29615. }
  29616. };
  29617. BaseReporter.prototype.close = function close() {
  29618. if (this.peakMemoryInterval) {
  29619. clearInterval(this.peakMemoryInterval);
  29620. this.peakMemoryInterval = null;
  29621. }
  29622. };
  29623. BaseReporter.prototype.getTotalTime = function getTotalTime() {
  29624. return Date.now() - this.startTime;
  29625. };
  29626. // TODO
  29627. BaseReporter.prototype.list = function list(key, items, hints) {};
  29628. // Outputs basic tree structure to console
  29629. BaseReporter.prototype.tree = function tree(key, obj) {
  29630. var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  29631. _ref$force = _ref.force,
  29632. force = _ref$force === undefined ? false : _ref$force;
  29633. };
  29634. // called whenever we begin a step in the CLI.
  29635. BaseReporter.prototype.step = function step(current, total, message, emoji) {};
  29636. // a error message has been triggered. this however does not always meant an abrupt
  29637. // program end.
  29638. BaseReporter.prototype.error = function error(message) {};
  29639. // an info message has been triggered. this provides things like stats and diagnostics.
  29640. BaseReporter.prototype.info = function info(message) {};
  29641. // a warning message has been triggered.
  29642. BaseReporter.prototype.warn = function warn(message) {};
  29643. // a success message has been triggered.
  29644. BaseReporter.prototype.success = function success(message) {};
  29645. // a simple log message
  29646. // TODO: rethink the {force} parameter. In the meantime, please don't use it (cf comments in #4143).
  29647. BaseReporter.prototype.log = function log(message) {
  29648. var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  29649. _ref2$force = _ref2.force,
  29650. force = _ref2$force === undefined ? false : _ref2$force;
  29651. };
  29652. // a shell command has been executed
  29653. BaseReporter.prototype.command = function command(_command) {};
  29654. // inspect and pretty-print any value
  29655. BaseReporter.prototype.inspect = function inspect(value) {};
  29656. // the screen shown at the very start of the CLI
  29657. BaseReporter.prototype.header = function header(command, pkg) {};
  29658. // the screen shown at the very end of the CLI
  29659. BaseReporter.prototype.footer = function footer(showPeakMemory) {};
  29660. // a table structure
  29661. BaseReporter.prototype.table = function table(head, body) {};
  29662. // security audit action to resolve advisories
  29663. BaseReporter.prototype.auditAction = function auditAction(recommendation) {};
  29664. // security audit requires manual review
  29665. BaseReporter.prototype.auditManualReview = function auditManualReview() {};
  29666. // security audit advisory
  29667. BaseReporter.prototype.auditAdvisory = function auditAdvisory(resolution, _auditAdvisory) {};
  29668. // summary for security audit report
  29669. BaseReporter.prototype.auditSummary = function auditSummary(auditMetadata) {};
  29670. // render an activity spinner and return a function that will trigger an update
  29671. BaseReporter.prototype.activity = function activity() {
  29672. return {
  29673. tick(name) {},
  29674. end() {}
  29675. };
  29676. };
  29677. //
  29678. BaseReporter.prototype.activitySet = function activitySet(total, workers) {
  29679. return {
  29680. spinners: Array(workers).fill({
  29681. clear() {},
  29682. setPrefix() {},
  29683. tick() {},
  29684. end() {}
  29685. }),
  29686. end() {}
  29687. };
  29688. };
  29689. //
  29690. BaseReporter.prototype.question = function question(_question) {
  29691. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  29692. return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
  29693. };
  29694. //
  29695. BaseReporter.prototype.questionAffirm = function () {
  29696. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (question) {
  29697. var condition = true; // trick eslint
  29698. if (this.nonInteractive) {
  29699. return true;
  29700. }
  29701. while (condition) {
  29702. var answer = yield this.question(question);
  29703. answer = answer.toLowerCase();
  29704. if (answer === 'y' || answer === 'yes') {
  29705. return true;
  29706. }
  29707. if (answer === 'n' || answer === 'no') {
  29708. return false;
  29709. }
  29710. this.error('Invalid answer for question');
  29711. }
  29712. return false;
  29713. });
  29714. function questionAffirm(_x5) {
  29715. return _ref3.apply(this, arguments);
  29716. }
  29717. return questionAffirm;
  29718. }();
  29719. // prompt the user to select an option from an array
  29720. BaseReporter.prototype.select = function select(header, question, options) {
  29721. return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
  29722. };
  29723. // render a progress bar and return a function which when called will trigger an update
  29724. BaseReporter.prototype.progress = function progress(total) {
  29725. return function () {};
  29726. };
  29727. // utility function to disable progress bar
  29728. BaseReporter.prototype.disableProgress = function disableProgress() {
  29729. this.noProgress = true;
  29730. };
  29731. //
  29732. BaseReporter.prototype.prompt = function prompt(message, choices) {
  29733. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  29734. return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
  29735. };
  29736. return BaseReporter;
  29737. }();
  29738. exports.default = BaseReporter;
  29739. /***/ }),
  29740. /* 99 */
  29741. /***/ (function(module, exports, __webpack_require__) {
  29742. "use strict";
  29743. Object.defineProperty(exports, "__esModule", {
  29744. value: true
  29745. });
  29746. var _asyncToGenerator2;
  29747. function _load_asyncToGenerator() {
  29748. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  29749. }
  29750. var _classCallCheck2;
  29751. function _load_classCallCheck() {
  29752. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  29753. }
  29754. var _possibleConstructorReturn2;
  29755. function _load_possibleConstructorReturn() {
  29756. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  29757. }
  29758. var _inherits2;
  29759. function _load_inherits() {
  29760. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  29761. }
  29762. exports.explodeHostedGitFragment = explodeHostedGitFragment;
  29763. var _errors;
  29764. function _load_errors() {
  29765. return _errors = __webpack_require__(6);
  29766. }
  29767. var _index;
  29768. function _load_index() {
  29769. return _index = __webpack_require__(61);
  29770. }
  29771. var _gitResolver;
  29772. function _load_gitResolver() {
  29773. return _gitResolver = _interopRequireDefault(__webpack_require__(119));
  29774. }
  29775. var _exoticResolver;
  29776. function _load_exoticResolver() {
  29777. return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
  29778. }
  29779. var _git;
  29780. function _load_git() {
  29781. return _git = _interopRequireDefault(__webpack_require__(205));
  29782. }
  29783. var _guessName;
  29784. function _load_guessName() {
  29785. return _guessName = _interopRequireDefault(__webpack_require__(159));
  29786. }
  29787. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  29788. function parseHash(fragment) {
  29789. var hashPosition = fragment.indexOf('#');
  29790. return hashPosition === -1 ? '' : fragment.substr(hashPosition + 1);
  29791. }
  29792. function explodeHostedGitFragment(fragment, reporter) {
  29793. var hash = parseHash(fragment);
  29794. var preParts = fragment.split('@');
  29795. if (preParts.length > 2) {
  29796. fragment = preParts[1] + '@' + preParts[2];
  29797. }
  29798. var parts = fragment.replace(/(.*?)#.*/, '$1') // Strip hash
  29799. .replace(/.*:(.*)/, '$1') // Strip prefixed protocols
  29800. .replace(/.git$/, '') // Strip the .git suffix
  29801. .split('/');
  29802. var user = parts[parts.length - 2];
  29803. var repo = parts[parts.length - 1];
  29804. if (user === undefined || repo === undefined) {
  29805. throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidHostedGitFragment', fragment));
  29806. }
  29807. return {
  29808. user,
  29809. repo,
  29810. hash
  29811. };
  29812. }
  29813. var HostedGitResolver = function (_ExoticResolver) {
  29814. (0, (_inherits2 || _load_inherits()).default)(HostedGitResolver, _ExoticResolver);
  29815. function HostedGitResolver(request, fragment) {
  29816. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, HostedGitResolver);
  29817. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
  29818. var exploded = _this.exploded = explodeHostedGitFragment(fragment, _this.reporter);
  29819. var user = exploded.user,
  29820. repo = exploded.repo,
  29821. hash = exploded.hash;
  29822. _this.user = user;
  29823. _this.repo = repo;
  29824. _this.hash = hash;
  29825. return _this;
  29826. }
  29827. HostedGitResolver.getTarballUrl = function getTarballUrl(exploded, commit) {
  29828. exploded;
  29829. commit;
  29830. throw new Error('Not implemented');
  29831. };
  29832. HostedGitResolver.getGitHTTPUrl = function getGitHTTPUrl(exploded) {
  29833. exploded;
  29834. throw new Error('Not implemented');
  29835. };
  29836. HostedGitResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(exploded) {
  29837. exploded;
  29838. throw new Error('Not implemented');
  29839. };
  29840. HostedGitResolver.getGitSSHUrl = function getGitSSHUrl(exploded) {
  29841. exploded;
  29842. throw new Error('Not implemented');
  29843. };
  29844. HostedGitResolver.getHTTPFileUrl = function getHTTPFileUrl(exploded, filename, commit) {
  29845. exploded;
  29846. filename;
  29847. commit;
  29848. throw new Error('Not implemented');
  29849. };
  29850. HostedGitResolver.prototype.getRefOverHTTP = function () {
  29851. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) {
  29852. var gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url);
  29853. var client = new (_git || _load_git()).default(this.config, gitUrl, this.hash);
  29854. var out = yield this.config.requestManager.request({
  29855. url: `${url}/info/refs?service=git-upload-pack`,
  29856. queue: this.resolver.fetchingQueue
  29857. });
  29858. if (out) {
  29859. // clean up output
  29860. var lines = out.trim().split('\n');
  29861. // remove first two lines which contains compatibility info etc
  29862. lines = lines.slice(2);
  29863. // remove last line which contains the terminator "0000"
  29864. lines.pop();
  29865. // remove line lengths from start of each line
  29866. lines = lines.map(function (line) {
  29867. return line.slice(4);
  29868. });
  29869. out = lines.join('\n');
  29870. } else {
  29871. throw new Error(this.reporter.lang('hostedGitResolveError'));
  29872. }
  29873. return client.setRefHosted(out);
  29874. });
  29875. function getRefOverHTTP(_x) {
  29876. return _ref.apply(this, arguments);
  29877. }
  29878. return getRefOverHTTP;
  29879. }();
  29880. HostedGitResolver.prototype.resolveOverHTTP = function () {
  29881. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) {
  29882. var _this2 = this;
  29883. var commit = yield this.getRefOverHTTP(url);
  29884. var config = this.config;
  29885. var tarballUrl = this.constructor.getTarballUrl(this.exploded, commit);
  29886. var tryRegistry = function () {
  29887. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) {
  29888. var filename = (_index || _load_index()).registries[registry].filename;
  29889. var href = _this2.constructor.getHTTPFileUrl(_this2.exploded, filename, commit);
  29890. var file = yield config.requestManager.request({
  29891. url: href,
  29892. queue: _this2.resolver.fetchingQueue
  29893. });
  29894. if (!file) {
  29895. return null;
  29896. }
  29897. var json = yield config.readJson(href, function () {
  29898. return JSON.parse(file);
  29899. });
  29900. json._uid = commit;
  29901. json._remote = {
  29902. resolved: tarballUrl,
  29903. type: 'tarball',
  29904. reference: tarballUrl,
  29905. registry
  29906. };
  29907. return json;
  29908. });
  29909. return function tryRegistry(_x3) {
  29910. return _ref3.apply(this, arguments);
  29911. };
  29912. }();
  29913. var file = yield tryRegistry(this.registry);
  29914. if (file) {
  29915. return file;
  29916. }
  29917. for (var registry in (_index || _load_index()).registries) {
  29918. if (registry === this.registry) {
  29919. continue;
  29920. }
  29921. var _file = yield tryRegistry(registry);
  29922. if (_file) {
  29923. return _file;
  29924. }
  29925. }
  29926. return {
  29927. name: (0, (_guessName || _load_guessName()).default)(url),
  29928. version: '0.0.0',
  29929. _uid: commit,
  29930. _remote: {
  29931. resolved: tarballUrl,
  29932. type: 'tarball',
  29933. reference: tarballUrl,
  29934. registry: 'npm',
  29935. hash: undefined
  29936. }
  29937. };
  29938. });
  29939. function resolveOverHTTP(_x2) {
  29940. return _ref2.apply(this, arguments);
  29941. }
  29942. return resolveOverHTTP;
  29943. }();
  29944. HostedGitResolver.prototype.hasHTTPCapability = function () {
  29945. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) {
  29946. return (yield this.config.requestManager.request({
  29947. url,
  29948. method: 'HEAD',
  29949. queue: this.resolver.fetchingQueue,
  29950. followRedirect: false
  29951. })) !== false;
  29952. });
  29953. function hasHTTPCapability(_x4) {
  29954. return _ref4.apply(this, arguments);
  29955. }
  29956. return hasHTTPCapability;
  29957. }();
  29958. HostedGitResolver.prototype.resolve = function () {
  29959. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  29960. // If we already have the tarball, just return it without having to make any HTTP requests.
  29961. var shrunk = this.request.getLocked('tarball');
  29962. if (shrunk) {
  29963. return shrunk;
  29964. }
  29965. var httpUrl = this.constructor.getGitHTTPUrl(this.exploded);
  29966. var httpBaseUrl = this.constructor.getGitHTTPBaseUrl(this.exploded);
  29967. var sshUrl = this.constructor.getGitSSHUrl(this.exploded);
  29968. // If we can access the files over HTTP then we should as it's MUCH faster than git
  29969. // archive and tarball unarchiving. The HTTP API is only available for public repos
  29970. // though.
  29971. if (yield this.hasHTTPCapability(httpBaseUrl)) {
  29972. return this.resolveOverHTTP(httpUrl);
  29973. }
  29974. // If the url is accessible over git archive then we should immediately delegate to
  29975. // the git resolver.
  29976. //
  29977. // NOTE: Here we use a different url than when we delegate to the git resolver later on.
  29978. // This is because `git archive` requires access over ssh and github only allows that
  29979. // if you have write permissions
  29980. var sshGitUrl = (_git || _load_git()).default.npmUrlToGitUrl(sshUrl);
  29981. if (yield (_git || _load_git()).default.hasArchiveCapability(sshGitUrl)) {
  29982. var archiveClient = new (_git || _load_git()).default(this.config, sshGitUrl, this.hash);
  29983. var commit = yield archiveClient.init();
  29984. return this.fork((_gitResolver || _load_gitResolver()).default, true, `${sshUrl}#${commit}`);
  29985. }
  29986. // fallback to the plain git resolver
  29987. return this.fork((_gitResolver || _load_gitResolver()).default, true, sshUrl);
  29988. });
  29989. function resolve() {
  29990. return _ref5.apply(this, arguments);
  29991. }
  29992. return resolve;
  29993. }();
  29994. return HostedGitResolver;
  29995. }((_exoticResolver || _load_exoticResolver()).default);
  29996. exports.default = HostedGitResolver;
  29997. /***/ }),
  29998. /* 100 */
  29999. /***/ (function(module, exports, __webpack_require__) {
  30000. "use strict";
  30001. Object.defineProperty(exports, "__esModule", {
  30002. value: true
  30003. });
  30004. exports.execCommand = exports.execFromManifest = exports.executeLifecycleScript = exports.makeEnv = exports.getWrappersFolder = exports.IGNORE_MANIFEST_KEYS = undefined;
  30005. var _promise;
  30006. function _load_promise() {
  30007. return _promise = _interopRequireDefault(__webpack_require__(7));
  30008. }
  30009. var _getIterator2;
  30010. function _load_getIterator() {
  30011. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  30012. }
  30013. var _from;
  30014. function _load_from() {
  30015. return _from = _interopRequireDefault(__webpack_require__(53));
  30016. }
  30017. var _keys;
  30018. function _load_keys() {
  30019. return _keys = _interopRequireDefault(__webpack_require__(14));
  30020. }
  30021. var _stringify;
  30022. function _load_stringify() {
  30023. return _stringify = _interopRequireDefault(__webpack_require__(37));
  30024. }
  30025. var _assign;
  30026. function _load_assign() {
  30027. return _assign = _interopRequireDefault(__webpack_require__(23));
  30028. }
  30029. var _extends2;
  30030. function _load_extends() {
  30031. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  30032. }
  30033. var _asyncToGenerator2;
  30034. function _load_asyncToGenerator() {
  30035. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  30036. }
  30037. var _set;
  30038. function _load_set() {
  30039. return _set = _interopRequireDefault(__webpack_require__(16));
  30040. }
  30041. var getWrappersFolder = exports.getWrappersFolder = function () {
  30042. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
  30043. if (wrappersFolder) {
  30044. return wrappersFolder;
  30045. }
  30046. wrappersFolder = yield (_fs || _load_fs()).makeTempDir();
  30047. yield (0, (_portableScript || _load_portableScript()).makePortableProxyScript)(process.execPath, wrappersFolder, {
  30048. proxyBasename: 'node'
  30049. });
  30050. yield (0, (_portableScript || _load_portableScript()).makePortableProxyScript)(process.execPath, wrappersFolder, {
  30051. proxyBasename: 'yarn',
  30052. prependArguments: [process.argv[1]]
  30053. });
  30054. return wrappersFolder;
  30055. });
  30056. return function getWrappersFolder(_x) {
  30057. return _ref.apply(this, arguments);
  30058. };
  30059. }();
  30060. var makeEnv = exports.makeEnv = function () {
  30061. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, cwd, config) {
  30062. var env = (0, (_extends2 || _load_extends()).default)({
  30063. NODE: process.execPath,
  30064. INIT_CWD: process.cwd()
  30065. }, process.env);
  30066. // Merge in the `env` object specified in .yarnrc
  30067. var customEnv = config.getOption('env');
  30068. if (customEnv && typeof customEnv === 'object') {
  30069. (0, (_assign || _load_assign()).default)(env, customEnv);
  30070. }
  30071. env.npm_lifecycle_event = stage;
  30072. env.npm_node_execpath = env.NODE;
  30073. env.npm_execpath = env.npm_execpath || process.mainModule && process.mainModule.filename;
  30074. // Set the env to production for npm compat if production mode.
  30075. // https://github.com/npm/npm/blob/30d75e738b9cb7a6a3f9b50e971adcbe63458ed3/lib/utils/lifecycle.js#L336
  30076. if (config.production) {
  30077. env.NODE_ENV = 'production';
  30078. }
  30079. // Note: npm_config_argv environment variable contains output of nopt - command-line
  30080. // parser used by npm. Since we use other parser, we just roughly emulate it's output. (See: #684)
  30081. env.npm_config_argv = (0, (_stringify || _load_stringify()).default)({
  30082. remain: [],
  30083. cooked: config.commandName === 'run' ? [config.commandName, stage] : [config.commandName],
  30084. original: process.argv.slice(2)
  30085. });
  30086. var manifest = yield config.maybeReadManifest(cwd);
  30087. if (manifest) {
  30088. if (manifest.scripts && Object.prototype.hasOwnProperty.call(manifest.scripts, stage)) {
  30089. env.npm_lifecycle_script = manifest.scripts[stage];
  30090. }
  30091. // add npm_package_*
  30092. var queue = [['', manifest]];
  30093. while (queue.length) {
  30094. var _queue$pop = queue.pop(),
  30095. _key = _queue$pop[0],
  30096. val = _queue$pop[1];
  30097. if (typeof val === 'object') {
  30098. for (var subKey in val) {
  30099. var fullKey = [_key, subKey].filter(Boolean).join('_');
  30100. if (fullKey && fullKey[0] !== '_' && !IGNORE_MANIFEST_KEYS.has(fullKey)) {
  30101. queue.push([fullKey, val[subKey]]);
  30102. }
  30103. }
  30104. } else {
  30105. var cleanVal = String(val);
  30106. if (cleanVal.indexOf('\n') >= 0) {
  30107. cleanVal = (0, (_stringify || _load_stringify()).default)(cleanVal);
  30108. }
  30109. //replacing invalid chars with underscore
  30110. var cleanKey = _key.replace(INVALID_CHAR_REGEX, '_');
  30111. env[`npm_package_${cleanKey}`] = cleanVal;
  30112. }
  30113. }
  30114. }
  30115. // add npm_config_* and npm_package_config_* from yarn config
  30116. var keys = new (_set || _load_set()).default([].concat((0, (_keys || _load_keys()).default)(config.registries.yarn.config), (0, (_keys || _load_keys()).default)(config.registries.npm.config)));
  30117. var cleaned = (0, (_from || _load_from()).default)(keys).filter(function (key) {
  30118. return !key.match(/:_/) && IGNORE_CONFIG_KEYS.indexOf(key) === -1;
  30119. }).map(function (key) {
  30120. var val = config.getOption(key);
  30121. if (!val) {
  30122. val = '';
  30123. } else if (typeof val === 'number') {
  30124. val = '' + val;
  30125. } else if (typeof val !== 'string') {
  30126. val = (0, (_stringify || _load_stringify()).default)(val);
  30127. }
  30128. if (val.indexOf('\n') >= 0) {
  30129. val = (0, (_stringify || _load_stringify()).default)(val);
  30130. }
  30131. return [key, val];
  30132. });
  30133. // add npm_config_*
  30134. for (var _iterator = cleaned, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  30135. var _ref4;
  30136. if (_isArray) {
  30137. if (_i >= _iterator.length) break;
  30138. _ref4 = _iterator[_i++];
  30139. } else {
  30140. _i = _iterator.next();
  30141. if (_i.done) break;
  30142. _ref4 = _i.value;
  30143. }
  30144. var _ref3 = _ref4;
  30145. var _key2 = _ref3[0];
  30146. var _val = _ref3[1];
  30147. var _cleanKey = _key2.replace(/^_+/, '');
  30148. var envKey = `npm_config_${_cleanKey}`.replace(INVALID_CHAR_REGEX, '_');
  30149. env[envKey] = _val;
  30150. }
  30151. // add npm_package_config_*
  30152. if (manifest && manifest.name) {
  30153. var packageConfigPrefix = `${manifest.name}:`;
  30154. for (var _iterator2 = cleaned, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  30155. var _ref6;
  30156. if (_isArray2) {
  30157. if (_i2 >= _iterator2.length) break;
  30158. _ref6 = _iterator2[_i2++];
  30159. } else {
  30160. _i2 = _iterator2.next();
  30161. if (_i2.done) break;
  30162. _ref6 = _i2.value;
  30163. }
  30164. var _ref5 = _ref6;
  30165. var _key3 = _ref5[0];
  30166. var _val2 = _ref5[1];
  30167. if (_key3.indexOf(packageConfigPrefix) !== 0) {
  30168. continue;
  30169. }
  30170. var _cleanKey2 = _key3.replace(/^_+/, '').replace(packageConfigPrefix, '');
  30171. var envKey = `npm_package_config_${_cleanKey2}`.replace(INVALID_CHAR_REGEX, '_');
  30172. env[envKey] = _val2;
  30173. }
  30174. }
  30175. // split up the path
  30176. var envPath = env[(_constants || _load_constants()).ENV_PATH_KEY];
  30177. var pathParts = envPath ? envPath.split(path.delimiter) : [];
  30178. // Include node-gyp version that was bundled with the current Node.js version,
  30179. // if available.
  30180. pathParts.unshift(path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'node-gyp-bin'));
  30181. pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin'));
  30182. // Include node-gyp version from homebrew managed npm, if available.
  30183. pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'libexec', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin'));
  30184. // Add global bin folder if it is not present already, as some packages depend
  30185. // on a globally-installed version of node-gyp.
  30186. var globalBin = yield (0, (_global || _load_global()).getBinFolder)(config, {});
  30187. if (pathParts.indexOf(globalBin) === -1) {
  30188. pathParts.unshift(globalBin);
  30189. }
  30190. // Add node_modules .bin folders to the PATH
  30191. for (var _iterator3 = config.registryFolders, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  30192. var _ref7;
  30193. if (_isArray3) {
  30194. if (_i3 >= _iterator3.length) break;
  30195. _ref7 = _iterator3[_i3++];
  30196. } else {
  30197. _i3 = _iterator3.next();
  30198. if (_i3.done) break;
  30199. _ref7 = _i3.value;
  30200. }
  30201. var registryFolder = _ref7;
  30202. var binFolder = path.join(registryFolder, '.bin');
  30203. if (config.workspacesEnabled && config.workspaceRootFolder) {
  30204. pathParts.unshift(path.join(config.workspaceRootFolder, binFolder));
  30205. }
  30206. pathParts.unshift(path.join(config.linkFolder, binFolder));
  30207. pathParts.unshift(path.join(cwd, binFolder));
  30208. }
  30209. var pnpFile = void 0;
  30210. if (process.versions.pnp) {
  30211. pnpFile = (_dynamicRequire || _load_dynamicRequire()).dynamicRequire.resolve('pnpapi');
  30212. } else {
  30213. var candidate = `${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`;
  30214. if (yield (_fs || _load_fs()).exists(candidate)) {
  30215. pnpFile = candidate;
  30216. }
  30217. }
  30218. if (pnpFile) {
  30219. var pnpApi = (0, (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)(pnpFile);
  30220. var packageLocator = pnpApi.findPackageLocator(`${cwd}/`);
  30221. var packageInformation = pnpApi.getPackageInformation(packageLocator);
  30222. for (var _iterator4 = packageInformation.packageDependencies.entries(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  30223. var _ref9;
  30224. if (_isArray4) {
  30225. if (_i4 >= _iterator4.length) break;
  30226. _ref9 = _iterator4[_i4++];
  30227. } else {
  30228. _i4 = _iterator4.next();
  30229. if (_i4.done) break;
  30230. _ref9 = _i4.value;
  30231. }
  30232. var _ref8 = _ref9;
  30233. var name = _ref8[0];
  30234. var reference = _ref8[1];
  30235. var dependencyInformation = pnpApi.getPackageInformation({ name, reference });
  30236. if (!dependencyInformation || !dependencyInformation.packageLocation) {
  30237. continue;
  30238. }
  30239. var binFolder = `${dependencyInformation.packageLocation}/.bin`;
  30240. if (yield (_fs || _load_fs()).exists(binFolder)) {
  30241. pathParts.unshift(binFolder);
  30242. }
  30243. }
  30244. // Note that NODE_OPTIONS doesn't support any style of quoting its arguments at the moment
  30245. // For this reason, it won't work if the user has a space inside its $PATH
  30246. env.NODE_OPTIONS = env.NODE_OPTIONS || '';
  30247. env.NODE_OPTIONS = `--require ${pnpFile} ${env.NODE_OPTIONS}`;
  30248. }
  30249. pathParts.unshift((yield getWrappersFolder(config)));
  30250. // join path back together
  30251. env[(_constants || _load_constants()).ENV_PATH_KEY] = pathParts.join(path.delimiter);
  30252. return env;
  30253. });
  30254. return function makeEnv(_x2, _x3, _x4) {
  30255. return _ref2.apply(this, arguments);
  30256. };
  30257. }();
  30258. var executeLifecycleScript = exports.executeLifecycleScript = function () {
  30259. var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref11) {
  30260. var stage = _ref11.stage,
  30261. config = _ref11.config,
  30262. cwd = _ref11.cwd,
  30263. cmd = _ref11.cmd,
  30264. isInteractive = _ref11.isInteractive,
  30265. onProgress = _ref11.onProgress,
  30266. customShell = _ref11.customShell;
  30267. var env = yield makeEnv(stage, cwd, config);
  30268. yield checkForGypIfNeeded(config, cmd, env[(_constants || _load_constants()).ENV_PATH_KEY].split(path.delimiter));
  30269. if (process.platform === 'win32' && (!customShell || customShell === 'cmd')) {
  30270. // handle windows run scripts starting with a relative path
  30271. cmd = (0, (_fixCmdWinSlashes || _load_fixCmdWinSlashes()).fixCmdWinSlashes)(cmd);
  30272. }
  30273. // By default (non-interactive), pipe everything to the terminal and run child process detached
  30274. // as long as it's not Windows (since windows does not have /dev/tty)
  30275. var stdio = ['ignore', 'pipe', 'pipe'];
  30276. var detached = process.platform !== 'win32';
  30277. if (isInteractive) {
  30278. stdio = 'inherit';
  30279. detached = false;
  30280. }
  30281. var shell = customShell || true;
  30282. var stdout = yield (_child || _load_child()).spawn(cmd, [], { cwd, env, stdio, detached, shell }, onProgress);
  30283. return { cwd, command: cmd, stdout };
  30284. });
  30285. return function executeLifecycleScript(_x5) {
  30286. return _ref10.apply(this, arguments);
  30287. };
  30288. }();
  30289. var _checkForGyp = function () {
  30290. var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, paths) {
  30291. var reporter = config.reporter;
  30292. // Check every directory in the PATH
  30293. var allChecks = yield (_promise || _load_promise()).default.all(paths.map(function (dir) {
  30294. return (_fs || _load_fs()).exists(path.join(dir, 'node-gyp'));
  30295. }));
  30296. if (allChecks.some(Boolean)) {
  30297. // node-gyp is available somewhere
  30298. return;
  30299. }
  30300. reporter.info(reporter.lang('packageRequiresNodeGyp'));
  30301. try {
  30302. yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', 'node-gyp']);
  30303. } catch (e) {
  30304. throw new (_errors || _load_errors()).MessageError(reporter.lang('nodeGypAutoInstallFailed', e.message));
  30305. }
  30306. });
  30307. return function _checkForGyp(_x6, _x7) {
  30308. return _ref12.apply(this, arguments);
  30309. };
  30310. }();
  30311. var execFromManifest = exports.execFromManifest = function () {
  30312. var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, commandName, cwd) {
  30313. var pkg = yield config.maybeReadManifest(cwd);
  30314. if (!pkg || !pkg.scripts) {
  30315. return;
  30316. }
  30317. var cmd = pkg.scripts[commandName];
  30318. if (cmd) {
  30319. yield execCommand({ stage: commandName, config, cmd, cwd, isInteractive: true });
  30320. }
  30321. });
  30322. return function execFromManifest(_x8, _x9, _x10) {
  30323. return _ref13.apply(this, arguments);
  30324. };
  30325. }();
  30326. var execCommand = exports.execCommand = function () {
  30327. var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref15) {
  30328. var stage = _ref15.stage,
  30329. config = _ref15.config,
  30330. cmd = _ref15.cmd,
  30331. cwd = _ref15.cwd,
  30332. isInteractive = _ref15.isInteractive,
  30333. customShell = _ref15.customShell;
  30334. var reporter = config.reporter;
  30335. try {
  30336. reporter.command(cmd);
  30337. yield executeLifecycleScript({ stage, config, cwd, cmd, isInteractive, customShell });
  30338. return (_promise || _load_promise()).default.resolve();
  30339. } catch (err) {
  30340. if (err instanceof (_errors || _load_errors()).ProcessTermError) {
  30341. var formattedError = new (_errors || _load_errors()).ProcessTermError(err.EXIT_SIGNAL ? reporter.lang('commandFailedWithSignal', err.EXIT_SIGNAL) : reporter.lang('commandFailedWithCode', err.EXIT_CODE));
  30342. formattedError.EXIT_CODE = err.EXIT_CODE;
  30343. formattedError.EXIT_SIGNAL = err.EXIT_SIGNAL;
  30344. throw formattedError;
  30345. } else {
  30346. throw err;
  30347. }
  30348. }
  30349. });
  30350. return function execCommand(_x11) {
  30351. return _ref14.apply(this, arguments);
  30352. };
  30353. }();
  30354. var _errors;
  30355. function _load_errors() {
  30356. return _errors = __webpack_require__(6);
  30357. }
  30358. var _constants;
  30359. function _load_constants() {
  30360. return _constants = _interopRequireWildcard(__webpack_require__(13));
  30361. }
  30362. var _child;
  30363. function _load_child() {
  30364. return _child = _interopRequireWildcard(__webpack_require__(57));
  30365. }
  30366. var _fs;
  30367. function _load_fs() {
  30368. return _fs = _interopRequireWildcard(__webpack_require__(8));
  30369. }
  30370. var _dynamicRequire;
  30371. function _load_dynamicRequire() {
  30372. return _dynamicRequire = __webpack_require__(308);
  30373. }
  30374. var _portableScript;
  30375. function _load_portableScript() {
  30376. return _portableScript = __webpack_require__(546);
  30377. }
  30378. var _fixCmdWinSlashes;
  30379. function _load_fixCmdWinSlashes() {
  30380. return _fixCmdWinSlashes = __webpack_require__(534);
  30381. }
  30382. var _global;
  30383. function _load_global() {
  30384. return _global = __webpack_require__(116);
  30385. }
  30386. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  30387. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30388. var path = __webpack_require__(1);
  30389. var IGNORE_MANIFEST_KEYS = exports.IGNORE_MANIFEST_KEYS = new (_set || _load_set()).default(['readme', 'notice', 'licenseText', 'activationEvents', 'contributes']);
  30390. // We treat these configs as internal, thus not expose them to process.env.
  30391. // This helps us avoid some gyp issues when building native modules.
  30392. // See https://github.com/yarnpkg/yarn/issues/2286.
  30393. var IGNORE_CONFIG_KEYS = ['lastUpdateCheck'];
  30394. var wrappersFolder = null;
  30395. var INVALID_CHAR_REGEX = /\W/g;
  30396. exports.default = executeLifecycleScript;
  30397. var checkGypPromise = null;
  30398. /**
  30399. * Special case: Some packages depend on node-gyp, but don't specify this in
  30400. * their package.json dependencies. They assume that node-gyp is available
  30401. * globally. We need to detect this case and show an error message.
  30402. */
  30403. function checkForGypIfNeeded(config, cmd, paths) {
  30404. if (cmd.substr(0, cmd.indexOf(' ')) !== 'node-gyp') {
  30405. return (_promise || _load_promise()).default.resolve();
  30406. }
  30407. // Ensure this only runs once, rather than multiple times in parallel.
  30408. if (!checkGypPromise) {
  30409. checkGypPromise = _checkForGyp(config, paths);
  30410. }
  30411. return checkGypPromise;
  30412. }
  30413. /***/ }),
  30414. /* 101 */
  30415. /***/ (function(module, exports, __webpack_require__) {
  30416. "use strict";
  30417. Object.defineProperty(exports, "__esModule", {
  30418. value: true
  30419. });
  30420. exports.home = undefined;
  30421. var _rootUser;
  30422. function _load_rootUser() {
  30423. return _rootUser = _interopRequireDefault(__webpack_require__(548));
  30424. }
  30425. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30426. var path = __webpack_require__(1);
  30427. var home = exports.home = __webpack_require__(66).homedir();
  30428. var userHomeDir = (_rootUser || _load_rootUser()).default ? path.resolve('/usr/local/share') : home;
  30429. exports.default = userHomeDir;
  30430. /***/ }),
  30431. /* 102 */
  30432. /***/ (function(module, exports, __webpack_require__) {
  30433. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  30434. var $keys = __webpack_require__(338);
  30435. var enumBugKeys = __webpack_require__(217);
  30436. module.exports = Object.keys || function keys(O) {
  30437. return $keys(O, enumBugKeys);
  30438. };
  30439. /***/ }),
  30440. /* 103 */
  30441. /***/ (function(module, exports, __webpack_require__) {
  30442. // 7.1.13 ToObject(argument)
  30443. var defined = __webpack_require__(215);
  30444. module.exports = function (it) {
  30445. return Object(defined(it));
  30446. };
  30447. /***/ }),
  30448. /* 104 */
  30449. /***/ (function(module, exports, __webpack_require__) {
  30450. "use strict";
  30451. var $at = __webpack_require__(621)(true);
  30452. // 21.1.3.27 String.prototype[@@iterator]()
  30453. __webpack_require__(219)(String, 'String', function (iterated) {
  30454. this._t = String(iterated); // target
  30455. this._i = 0; // next index
  30456. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  30457. }, function () {
  30458. var O = this._t;
  30459. var index = this._i;
  30460. var point;
  30461. if (index >= O.length) return { value: undefined, done: true };
  30462. point = $at(O, index);
  30463. this._i += point.length;
  30464. return { value: point, done: false };
  30465. });
  30466. /***/ }),
  30467. /* 105 */
  30468. /***/ (function(module, exports) {
  30469. // Copyright Joyent, Inc. and other Node contributors.
  30470. //
  30471. // Permission is hereby granted, free of charge, to any person obtaining a
  30472. // copy of this software and associated documentation files (the
  30473. // "Software"), to deal in the Software without restriction, including
  30474. // without limitation the rights to use, copy, modify, merge, publish,
  30475. // distribute, sublicense, and/or sell copies of the Software, and to permit
  30476. // persons to whom the Software is furnished to do so, subject to the
  30477. // following conditions:
  30478. //
  30479. // The above copyright notice and this permission notice shall be included
  30480. // in all copies or substantial portions of the Software.
  30481. //
  30482. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  30483. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  30484. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  30485. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  30486. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  30487. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  30488. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  30489. // NOTE: These type checking functions intentionally don't use `instanceof`
  30490. // because it is fragile and can be easily faked with `Object.create()`.
  30491. function isArray(arg) {
  30492. if (Array.isArray) {
  30493. return Array.isArray(arg);
  30494. }
  30495. return objectToString(arg) === '[object Array]';
  30496. }
  30497. exports.isArray = isArray;
  30498. function isBoolean(arg) {
  30499. return typeof arg === 'boolean';
  30500. }
  30501. exports.isBoolean = isBoolean;
  30502. function isNull(arg) {
  30503. return arg === null;
  30504. }
  30505. exports.isNull = isNull;
  30506. function isNullOrUndefined(arg) {
  30507. return arg == null;
  30508. }
  30509. exports.isNullOrUndefined = isNullOrUndefined;
  30510. function isNumber(arg) {
  30511. return typeof arg === 'number';
  30512. }
  30513. exports.isNumber = isNumber;
  30514. function isString(arg) {
  30515. return typeof arg === 'string';
  30516. }
  30517. exports.isString = isString;
  30518. function isSymbol(arg) {
  30519. return typeof arg === 'symbol';
  30520. }
  30521. exports.isSymbol = isSymbol;
  30522. function isUndefined(arg) {
  30523. return arg === void 0;
  30524. }
  30525. exports.isUndefined = isUndefined;
  30526. function isRegExp(re) {
  30527. return objectToString(re) === '[object RegExp]';
  30528. }
  30529. exports.isRegExp = isRegExp;
  30530. function isObject(arg) {
  30531. return typeof arg === 'object' && arg !== null;
  30532. }
  30533. exports.isObject = isObject;
  30534. function isDate(d) {
  30535. return objectToString(d) === '[object Date]';
  30536. }
  30537. exports.isDate = isDate;
  30538. function isError(e) {
  30539. return (objectToString(e) === '[object Error]' || e instanceof Error);
  30540. }
  30541. exports.isError = isError;
  30542. function isFunction(arg) {
  30543. return typeof arg === 'function';
  30544. }
  30545. exports.isFunction = isFunction;
  30546. function isPrimitive(arg) {
  30547. return arg === null ||
  30548. typeof arg === 'boolean' ||
  30549. typeof arg === 'number' ||
  30550. typeof arg === 'string' ||
  30551. typeof arg === 'symbol' || // ES6 symbol
  30552. typeof arg === 'undefined';
  30553. }
  30554. exports.isPrimitive = isPrimitive;
  30555. exports.isBuffer = Buffer.isBuffer;
  30556. function objectToString(o) {
  30557. return Object.prototype.toString.call(o);
  30558. }
  30559. /***/ }),
  30560. /* 106 */
  30561. /***/ (function(module, exports, __webpack_require__) {
  30562. "use strict";
  30563. module.exports = {
  30564. copy: copy,
  30565. checkDataType: checkDataType,
  30566. checkDataTypes: checkDataTypes,
  30567. coerceToTypes: coerceToTypes,
  30568. toHash: toHash,
  30569. getProperty: getProperty,
  30570. escapeQuotes: escapeQuotes,
  30571. equal: __webpack_require__(237),
  30572. ucs2length: __webpack_require__(712),
  30573. varOccurences: varOccurences,
  30574. varReplace: varReplace,
  30575. cleanUpCode: cleanUpCode,
  30576. finalCleanUpCode: finalCleanUpCode,
  30577. schemaHasRules: schemaHasRules,
  30578. schemaHasRulesExcept: schemaHasRulesExcept,
  30579. toQuotedString: toQuotedString,
  30580. getPathExpr: getPathExpr,
  30581. getPath: getPath,
  30582. getData: getData,
  30583. unescapeFragment: unescapeFragment,
  30584. unescapeJsonPointer: unescapeJsonPointer,
  30585. escapeFragment: escapeFragment,
  30586. escapeJsonPointer: escapeJsonPointer
  30587. };
  30588. function copy(o, to) {
  30589. to = to || {};
  30590. for (var key in o) to[key] = o[key];
  30591. return to;
  30592. }
  30593. function checkDataType(dataType, data, negate) {
  30594. var EQUAL = negate ? ' !== ' : ' === '
  30595. , AND = negate ? ' || ' : ' && '
  30596. , OK = negate ? '!' : ''
  30597. , NOT = negate ? '' : '!';
  30598. switch (dataType) {
  30599. case 'null': return data + EQUAL + 'null';
  30600. case 'array': return OK + 'Array.isArray(' + data + ')';
  30601. case 'object': return '(' + OK + data + AND +
  30602. 'typeof ' + data + EQUAL + '"object"' + AND +
  30603. NOT + 'Array.isArray(' + data + '))';
  30604. case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND +
  30605. NOT + '(' + data + ' % 1)' +
  30606. AND + data + EQUAL + data + ')';
  30607. default: return 'typeof ' + data + EQUAL + '"' + dataType + '"';
  30608. }
  30609. }
  30610. function checkDataTypes(dataTypes, data) {
  30611. switch (dataTypes.length) {
  30612. case 1: return checkDataType(dataTypes[0], data, true);
  30613. default:
  30614. var code = '';
  30615. var types = toHash(dataTypes);
  30616. if (types.array && types.object) {
  30617. code = types.null ? '(': '(!' + data + ' || ';
  30618. code += 'typeof ' + data + ' !== "object")';
  30619. delete types.null;
  30620. delete types.array;
  30621. delete types.object;
  30622. }
  30623. if (types.number) delete types.integer;
  30624. for (var t in types)
  30625. code += (code ? ' && ' : '' ) + checkDataType(t, data, true);
  30626. return code;
  30627. }
  30628. }
  30629. var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);
  30630. function coerceToTypes(optionCoerceTypes, dataTypes) {
  30631. if (Array.isArray(dataTypes)) {
  30632. var types = [];
  30633. for (var i=0; i<dataTypes.length; i++) {
  30634. var t = dataTypes[i];
  30635. if (COERCE_TO_TYPES[t]) types[types.length] = t;
  30636. else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t;
  30637. }
  30638. if (types.length) return types;
  30639. } else if (COERCE_TO_TYPES[dataTypes]) {
  30640. return [dataTypes];
  30641. } else if (optionCoerceTypes === 'array' && dataTypes === 'array') {
  30642. return ['array'];
  30643. }
  30644. }
  30645. function toHash(arr) {
  30646. var hash = {};
  30647. for (var i=0; i<arr.length; i++) hash[arr[i]] = true;
  30648. return hash;
  30649. }
  30650. var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
  30651. var SINGLE_QUOTE = /'|\\/g;
  30652. function getProperty(key) {
  30653. return typeof key == 'number'
  30654. ? '[' + key + ']'
  30655. : IDENTIFIER.test(key)
  30656. ? '.' + key
  30657. : "['" + escapeQuotes(key) + "']";
  30658. }
  30659. function escapeQuotes(str) {
  30660. return str.replace(SINGLE_QUOTE, '\\$&')
  30661. .replace(/\n/g, '\\n')
  30662. .replace(/\r/g, '\\r')
  30663. .replace(/\f/g, '\\f')
  30664. .replace(/\t/g, '\\t');
  30665. }
  30666. function varOccurences(str, dataVar) {
  30667. dataVar += '[^0-9]';
  30668. var matches = str.match(new RegExp(dataVar, 'g'));
  30669. return matches ? matches.length : 0;
  30670. }
  30671. function varReplace(str, dataVar, expr) {
  30672. dataVar += '([^0-9])';
  30673. expr = expr.replace(/\$/g, '$$$$');
  30674. return str.replace(new RegExp(dataVar, 'g'), expr + '$1');
  30675. }
  30676. var EMPTY_ELSE = /else\s*{\s*}/g
  30677. , EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g
  30678. , EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g;
  30679. function cleanUpCode(out) {
  30680. return out.replace(EMPTY_ELSE, '')
  30681. .replace(EMPTY_IF_NO_ELSE, '')
  30682. .replace(EMPTY_IF_WITH_ELSE, 'if (!($1))');
  30683. }
  30684. var ERRORS_REGEXP = /[^v.]errors/g
  30685. , REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g
  30686. , REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g
  30687. , RETURN_VALID = 'return errors === 0;'
  30688. , RETURN_TRUE = 'validate.errors = null; return true;'
  30689. , RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/
  30690. , RETURN_DATA_ASYNC = 'return data;'
  30691. , ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g
  30692. , REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/;
  30693. function finalCleanUpCode(out, async) {
  30694. var matches = out.match(ERRORS_REGEXP);
  30695. if (matches && matches.length == 2) {
  30696. out = async
  30697. ? out.replace(REMOVE_ERRORS_ASYNC, '')
  30698. .replace(RETURN_ASYNC, RETURN_DATA_ASYNC)
  30699. : out.replace(REMOVE_ERRORS, '')
  30700. .replace(RETURN_VALID, RETURN_TRUE);
  30701. }
  30702. matches = out.match(ROOTDATA_REGEXP);
  30703. if (!matches || matches.length !== 3) return out;
  30704. return out.replace(REMOVE_ROOTDATA, '');
  30705. }
  30706. function schemaHasRules(schema, rules) {
  30707. if (typeof schema == 'boolean') return !schema;
  30708. for (var key in schema) if (rules[key]) return true;
  30709. }
  30710. function schemaHasRulesExcept(schema, rules, exceptKeyword) {
  30711. if (typeof schema == 'boolean') return !schema && exceptKeyword != 'not';
  30712. for (var key in schema) if (key != exceptKeyword && rules[key]) return true;
  30713. }
  30714. function toQuotedString(str) {
  30715. return '\'' + escapeQuotes(str) + '\'';
  30716. }
  30717. function getPathExpr(currentPath, expr, jsonPointers, isNumber) {
  30718. var path = jsonPointers // false by default
  30719. ? '\'/\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \'~0\').replace(/\\//g, \'~1\')')
  30720. : (isNumber ? '\'[\' + ' + expr + ' + \']\'' : '\'[\\\'\' + ' + expr + ' + \'\\\']\'');
  30721. return joinPaths(currentPath, path);
  30722. }
  30723. function getPath(currentPath, prop, jsonPointers) {
  30724. var path = jsonPointers // false by default
  30725. ? toQuotedString('/' + escapeJsonPointer(prop))
  30726. : toQuotedString(getProperty(prop));
  30727. return joinPaths(currentPath, path);
  30728. }
  30729. var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
  30730. var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
  30731. function getData($data, lvl, paths) {
  30732. var up, jsonPointer, data, matches;
  30733. if ($data === '') return 'rootData';
  30734. if ($data[0] == '/') {
  30735. if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);
  30736. jsonPointer = $data;
  30737. data = 'rootData';
  30738. } else {
  30739. matches = $data.match(RELATIVE_JSON_POINTER);
  30740. if (!matches) throw new Error('Invalid JSON-pointer: ' + $data);
  30741. up = +matches[1];
  30742. jsonPointer = matches[2];
  30743. if (jsonPointer == '#') {
  30744. if (up >= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl);
  30745. return paths[lvl - up];
  30746. }
  30747. if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl);
  30748. data = 'data' + ((lvl - up) || '');
  30749. if (!jsonPointer) return data;
  30750. }
  30751. var expr = data;
  30752. var segments = jsonPointer.split('/');
  30753. for (var i=0; i<segments.length; i++) {
  30754. var segment = segments[i];
  30755. if (segment) {
  30756. data += getProperty(unescapeJsonPointer(segment));
  30757. expr += ' && ' + data;
  30758. }
  30759. }
  30760. return expr;
  30761. }
  30762. function joinPaths (a, b) {
  30763. if (a == '""') return b;
  30764. return (a + ' + ' + b).replace(/' \+ '/g, '');
  30765. }
  30766. function unescapeFragment(str) {
  30767. return unescapeJsonPointer(decodeURIComponent(str));
  30768. }
  30769. function escapeFragment(str) {
  30770. return encodeURIComponent(escapeJsonPointer(str));
  30771. }
  30772. function escapeJsonPointer(str) {
  30773. return str.replace(/~/g, '~0').replace(/\//g, '~1');
  30774. }
  30775. function unescapeJsonPointer(str) {
  30776. return str.replace(/~1/g, '/').replace(/~0/g, '~');
  30777. }
  30778. /***/ }),
  30779. /* 107 */
  30780. /***/ (function(module, exports, __webpack_require__) {
  30781. "use strict";
  30782. function isNothing(subject) {
  30783. return (typeof subject === 'undefined') || (subject === null);
  30784. }
  30785. function isObject(subject) {
  30786. return (typeof subject === 'object') && (subject !== null);
  30787. }
  30788. function toArray(sequence) {
  30789. if (Array.isArray(sequence)) return sequence;
  30790. else if (isNothing(sequence)) return [];
  30791. return [ sequence ];
  30792. }
  30793. function extend(target, source) {
  30794. var index, length, key, sourceKeys;
  30795. if (source) {
  30796. sourceKeys = Object.keys(source);
  30797. for (index = 0, length = sourceKeys.length; index < length; index += 1) {
  30798. key = sourceKeys[index];
  30799. target[key] = source[key];
  30800. }
  30801. }
  30802. return target;
  30803. }
  30804. function repeat(string, count) {
  30805. var result = '', cycle;
  30806. for (cycle = 0; cycle < count; cycle += 1) {
  30807. result += string;
  30808. }
  30809. return result;
  30810. }
  30811. function isNegativeZero(number) {
  30812. return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
  30813. }
  30814. module.exports.isNothing = isNothing;
  30815. module.exports.isObject = isObject;
  30816. module.exports.toArray = toArray;
  30817. module.exports.repeat = repeat;
  30818. module.exports.isNegativeZero = isNegativeZero;
  30819. module.exports.extend = extend;
  30820. /***/ }),
  30821. /* 108 */
  30822. /***/ (function(module, exports, __webpack_require__) {
  30823. "use strict";
  30824. /*eslint-disable max-len*/
  30825. var common = __webpack_require__(107);
  30826. var YAMLException = __webpack_require__(132);
  30827. var Type = __webpack_require__(30);
  30828. function compileList(schema, name, result) {
  30829. var exclude = [];
  30830. schema.include.forEach(function (includedSchema) {
  30831. result = compileList(includedSchema, name, result);
  30832. });
  30833. schema[name].forEach(function (currentType) {
  30834. result.forEach(function (previousType, previousIndex) {
  30835. if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
  30836. exclude.push(previousIndex);
  30837. }
  30838. });
  30839. result.push(currentType);
  30840. });
  30841. return result.filter(function (type, index) {
  30842. return exclude.indexOf(index) === -1;
  30843. });
  30844. }
  30845. function compileMap(/* lists... */) {
  30846. var result = {
  30847. scalar: {},
  30848. sequence: {},
  30849. mapping: {},
  30850. fallback: {}
  30851. }, index, length;
  30852. function collectType(type) {
  30853. result[type.kind][type.tag] = result['fallback'][type.tag] = type;
  30854. }
  30855. for (index = 0, length = arguments.length; index < length; index += 1) {
  30856. arguments[index].forEach(collectType);
  30857. }
  30858. return result;
  30859. }
  30860. function Schema(definition) {
  30861. this.include = definition.include || [];
  30862. this.implicit = definition.implicit || [];
  30863. this.explicit = definition.explicit || [];
  30864. this.implicit.forEach(function (type) {
  30865. if (type.loadKind && type.loadKind !== 'scalar') {
  30866. throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
  30867. }
  30868. });
  30869. this.compiledImplicit = compileList(this, 'implicit', []);
  30870. this.compiledExplicit = compileList(this, 'explicit', []);
  30871. this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
  30872. }
  30873. Schema.DEFAULT = null;
  30874. Schema.create = function createSchema() {
  30875. var schemas, types;
  30876. switch (arguments.length) {
  30877. case 1:
  30878. schemas = Schema.DEFAULT;
  30879. types = arguments[0];
  30880. break;
  30881. case 2:
  30882. schemas = arguments[0];
  30883. types = arguments[1];
  30884. break;
  30885. default:
  30886. throw new YAMLException('Wrong number of arguments for Schema.create function');
  30887. }
  30888. schemas = common.toArray(schemas);
  30889. types = common.toArray(types);
  30890. if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
  30891. throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
  30892. }
  30893. if (!types.every(function (type) { return type instanceof Type; })) {
  30894. throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
  30895. }
  30896. return new Schema({
  30897. include: schemas,
  30898. explicit: types
  30899. });
  30900. };
  30901. module.exports = Schema;
  30902. /***/ }),
  30903. /* 109 */
  30904. /***/ (function(module, exports, __webpack_require__) {
  30905. "use strict";
  30906. /*!
  30907. * micromatch <https://github.com/jonschlinkert/micromatch>
  30908. *
  30909. * Copyright (c) 2014-2015, Jon Schlinkert.
  30910. * Licensed under the MIT License.
  30911. */
  30912. var expand = __webpack_require__(824);
  30913. var utils = __webpack_require__(240);
  30914. /**
  30915. * The main function. Pass an array of filepaths,
  30916. * and a string or array of glob patterns
  30917. *
  30918. * @param {Array|String} `files`
  30919. * @param {Array|String} `patterns`
  30920. * @param {Object} `opts`
  30921. * @return {Array} Array of matches
  30922. */
  30923. function micromatch(files, patterns, opts) {
  30924. if (!files || !patterns) return [];
  30925. opts = opts || {};
  30926. if (typeof opts.cache === 'undefined') {
  30927. opts.cache = true;
  30928. }
  30929. if (!Array.isArray(patterns)) {
  30930. return match(files, patterns, opts);
  30931. }
  30932. var len = patterns.length, i = 0;
  30933. var omit = [], keep = [];
  30934. while (len--) {
  30935. var glob = patterns[i++];
  30936. if (typeof glob === 'string' && glob.charCodeAt(0) === 33 /* ! */) {
  30937. omit.push.apply(omit, match(files, glob.slice(1), opts));
  30938. } else {
  30939. keep.push.apply(keep, match(files, glob, opts));
  30940. }
  30941. }
  30942. return utils.diff(keep, omit);
  30943. }
  30944. /**
  30945. * Return an array of files that match the given glob pattern.
  30946. *
  30947. * This function is called by the main `micromatch` function If you only
  30948. * need to pass a single pattern you might get very minor speed improvements
  30949. * using this function.
  30950. *
  30951. * @param {Array} `files`
  30952. * @param {String} `pattern`
  30953. * @param {Object} `options`
  30954. * @return {Array}
  30955. */
  30956. function match(files, pattern, opts) {
  30957. if (utils.typeOf(files) !== 'string' && !Array.isArray(files)) {
  30958. throw new Error(msg('match', 'files', 'a string or array'));
  30959. }
  30960. files = utils.arrayify(files);
  30961. opts = opts || {};
  30962. var negate = opts.negate || false;
  30963. var orig = pattern;
  30964. if (typeof pattern === 'string') {
  30965. negate = pattern.charAt(0) === '!';
  30966. if (negate) {
  30967. pattern = pattern.slice(1);
  30968. }
  30969. // we need to remove the character regardless,
  30970. // so the above logic is still needed
  30971. if (opts.nonegate === true) {
  30972. negate = false;
  30973. }
  30974. }
  30975. var _isMatch = matcher(pattern, opts);
  30976. var len = files.length, i = 0;
  30977. var res = [];
  30978. while (i < len) {
  30979. var file = files[i++];
  30980. var fp = utils.unixify(file, opts);
  30981. if (!_isMatch(fp)) { continue; }
  30982. res.push(fp);
  30983. }
  30984. if (res.length === 0) {
  30985. if (opts.failglob === true) {
  30986. throw new Error('micromatch.match() found no matches for: "' + orig + '".');
  30987. }
  30988. if (opts.nonull || opts.nullglob) {
  30989. res.push(utils.unescapeGlob(orig));
  30990. }
  30991. }
  30992. // if `negate` was defined, diff negated files
  30993. if (negate) { res = utils.diff(files, res); }
  30994. // if `ignore` was defined, diff ignored filed
  30995. if (opts.ignore && opts.ignore.length) {
  30996. pattern = opts.ignore;
  30997. opts = utils.omit(opts, ['ignore']);
  30998. res = utils.diff(res, micromatch(res, pattern, opts));
  30999. }
  31000. if (opts.nodupes) {
  31001. return utils.unique(res);
  31002. }
  31003. return res;
  31004. }
  31005. /**
  31006. * Returns a function that takes a glob pattern or array of glob patterns
  31007. * to be used with `Array#filter()`. (Internally this function generates
  31008. * the matching function using the [matcher] method).
  31009. *
  31010. * ```js
  31011. * var fn = mm.filter('[a-c]');
  31012. * ['a', 'b', 'c', 'd', 'e'].filter(fn);
  31013. * //=> ['a', 'b', 'c']
  31014. * ```
  31015. * @param {String|Array} `patterns` Can be a glob or array of globs.
  31016. * @param {Options} `opts` Options to pass to the [matcher] method.
  31017. * @return {Function} Filter function to be passed to `Array#filter()`.
  31018. */
  31019. function filter(patterns, opts) {
  31020. if (!Array.isArray(patterns) && typeof patterns !== 'string') {
  31021. throw new TypeError(msg('filter', 'patterns', 'a string or array'));
  31022. }
  31023. patterns = utils.arrayify(patterns);
  31024. var len = patterns.length, i = 0;
  31025. var patternMatchers = Array(len);
  31026. while (i < len) {
  31027. patternMatchers[i] = matcher(patterns[i++], opts);
  31028. }
  31029. return function(fp) {
  31030. if (fp == null) return [];
  31031. var len = patternMatchers.length, i = 0;
  31032. var res = true;
  31033. fp = utils.unixify(fp, opts);
  31034. while (i < len) {
  31035. var fn = patternMatchers[i++];
  31036. if (!fn(fp)) {
  31037. res = false;
  31038. break;
  31039. }
  31040. }
  31041. return res;
  31042. };
  31043. }
  31044. /**
  31045. * Returns true if the filepath contains the given
  31046. * pattern. Can also return a function for matching.
  31047. *
  31048. * ```js
  31049. * isMatch('foo.md', '*.md', {});
  31050. * //=> true
  31051. *
  31052. * isMatch('*.md', {})('foo.md')
  31053. * //=> true
  31054. * ```
  31055. * @param {String} `fp`
  31056. * @param {String} `pattern`
  31057. * @param {Object} `opts`
  31058. * @return {Boolean}
  31059. */
  31060. function isMatch(fp, pattern, opts) {
  31061. if (typeof fp !== 'string') {
  31062. throw new TypeError(msg('isMatch', 'filepath', 'a string'));
  31063. }
  31064. fp = utils.unixify(fp, opts);
  31065. if (utils.typeOf(pattern) === 'object') {
  31066. return matcher(fp, pattern);
  31067. }
  31068. return matcher(pattern, opts)(fp);
  31069. }
  31070. /**
  31071. * Returns true if the filepath matches the
  31072. * given pattern.
  31073. */
  31074. function contains(fp, pattern, opts) {
  31075. if (typeof fp !== 'string') {
  31076. throw new TypeError(msg('contains', 'pattern', 'a string'));
  31077. }
  31078. opts = opts || {};
  31079. opts.contains = (pattern !== '');
  31080. fp = utils.unixify(fp, opts);
  31081. if (opts.contains && !utils.isGlob(pattern)) {
  31082. return fp.indexOf(pattern) !== -1;
  31083. }
  31084. return matcher(pattern, opts)(fp);
  31085. }
  31086. /**
  31087. * Returns true if a file path matches any of the
  31088. * given patterns.
  31089. *
  31090. * @param {String} `fp` The filepath to test.
  31091. * @param {String|Array} `patterns` Glob patterns to use.
  31092. * @param {Object} `opts` Options to pass to the `matcher()` function.
  31093. * @return {String}
  31094. */
  31095. function any(fp, patterns, opts) {
  31096. if (!Array.isArray(patterns) && typeof patterns !== 'string') {
  31097. throw new TypeError(msg('any', 'patterns', 'a string or array'));
  31098. }
  31099. patterns = utils.arrayify(patterns);
  31100. var len = patterns.length;
  31101. fp = utils.unixify(fp, opts);
  31102. while (len--) {
  31103. var isMatch = matcher(patterns[len], opts);
  31104. if (isMatch(fp)) {
  31105. return true;
  31106. }
  31107. }
  31108. return false;
  31109. }
  31110. /**
  31111. * Filter the keys of an object with the given `glob` pattern
  31112. * and `options`
  31113. *
  31114. * @param {Object} `object`
  31115. * @param {Pattern} `object`
  31116. * @return {Array}
  31117. */
  31118. function matchKeys(obj, glob, options) {
  31119. if (utils.typeOf(obj) !== 'object') {
  31120. throw new TypeError(msg('matchKeys', 'first argument', 'an object'));
  31121. }
  31122. var fn = matcher(glob, options);
  31123. var res = {};
  31124. for (var key in obj) {
  31125. if (obj.hasOwnProperty(key) && fn(key)) {
  31126. res[key] = obj[key];
  31127. }
  31128. }
  31129. return res;
  31130. }
  31131. /**
  31132. * Return a function for matching based on the
  31133. * given `pattern` and `options`.
  31134. *
  31135. * @param {String} `pattern`
  31136. * @param {Object} `options`
  31137. * @return {Function}
  31138. */
  31139. function matcher(pattern, opts) {
  31140. // pattern is a function
  31141. if (typeof pattern === 'function') {
  31142. return pattern;
  31143. }
  31144. // pattern is a regex
  31145. if (pattern instanceof RegExp) {
  31146. return function(fp) {
  31147. return pattern.test(fp);
  31148. };
  31149. }
  31150. if (typeof pattern !== 'string') {
  31151. throw new TypeError(msg('matcher', 'pattern', 'a string, regex, or function'));
  31152. }
  31153. // strings, all the way down...
  31154. pattern = utils.unixify(pattern, opts);
  31155. // pattern is a non-glob string
  31156. if (!utils.isGlob(pattern)) {
  31157. return utils.matchPath(pattern, opts);
  31158. }
  31159. // pattern is a glob string
  31160. var re = makeRe(pattern, opts);
  31161. // `matchBase` is defined
  31162. if (opts && opts.matchBase) {
  31163. return utils.hasFilename(re, opts);
  31164. }
  31165. // `matchBase` is not defined
  31166. return function(fp) {
  31167. fp = utils.unixify(fp, opts);
  31168. return re.test(fp);
  31169. };
  31170. }
  31171. /**
  31172. * Create and cache a regular expression for matching
  31173. * file paths.
  31174. *
  31175. * If the leading character in the `glob` is `!`, a negation
  31176. * regex is returned.
  31177. *
  31178. * @param {String} `glob`
  31179. * @param {Object} `options`
  31180. * @return {RegExp}
  31181. */
  31182. function toRegex(glob, options) {
  31183. // clone options to prevent mutating the original object
  31184. var opts = Object.create(options || {});
  31185. var flags = opts.flags || '';
  31186. if (opts.nocase && flags.indexOf('i') === -1) {
  31187. flags += 'i';
  31188. }
  31189. var parsed = expand(glob, opts);
  31190. // pass in tokens to avoid parsing more than once
  31191. opts.negated = opts.negated || parsed.negated;
  31192. opts.negate = opts.negated;
  31193. glob = wrapGlob(parsed.pattern, opts);
  31194. var re;
  31195. try {
  31196. re = new RegExp(glob, flags);
  31197. return re;
  31198. } catch (err) {
  31199. err.reason = 'micromatch invalid regex: (' + re + ')';
  31200. if (opts.strict) throw new SyntaxError(err);
  31201. }
  31202. // we're only here if a bad pattern was used and the user
  31203. // passed `options.silent`, so match nothing
  31204. return /$^/;
  31205. }
  31206. /**
  31207. * Create the regex to do the matching. If the leading
  31208. * character in the `glob` is `!` a negation regex is returned.
  31209. *
  31210. * @param {String} `glob`
  31211. * @param {Boolean} `negate`
  31212. */
  31213. function wrapGlob(glob, opts) {
  31214. var prefix = (opts && !opts.contains) ? '^' : '';
  31215. var after = (opts && !opts.contains) ? '$' : '';
  31216. glob = ('(?:' + glob + ')' + after);
  31217. if (opts && opts.negate) {
  31218. return prefix + ('(?!^' + glob + ').*$');
  31219. }
  31220. return prefix + glob;
  31221. }
  31222. /**
  31223. * Create and cache a regular expression for matching file paths.
  31224. * If the leading character in the `glob` is `!`, a negation
  31225. * regex is returned.
  31226. *
  31227. * @param {String} `glob`
  31228. * @param {Object} `options`
  31229. * @return {RegExp}
  31230. */
  31231. function makeRe(glob, opts) {
  31232. if (utils.typeOf(glob) !== 'string') {
  31233. throw new Error(msg('makeRe', 'glob', 'a string'));
  31234. }
  31235. return utils.cache(toRegex, glob, opts);
  31236. }
  31237. /**
  31238. * Make error messages consistent. Follows this format:
  31239. *
  31240. * ```js
  31241. * msg(methodName, argNumber, nativeType);
  31242. * // example:
  31243. * msg('matchKeys', 'first', 'an object');
  31244. * ```
  31245. *
  31246. * @param {String} `method`
  31247. * @param {String} `num`
  31248. * @param {String} `type`
  31249. * @return {String}
  31250. */
  31251. function msg(method, what, type) {
  31252. return 'micromatch.' + method + '(): ' + what + ' should be ' + type + '.';
  31253. }
  31254. /**
  31255. * Public methods
  31256. */
  31257. /* eslint no-multi-spaces: 0 */
  31258. micromatch.any = any;
  31259. micromatch.braces = micromatch.braceExpand = utils.braces;
  31260. micromatch.contains = contains;
  31261. micromatch.expand = expand;
  31262. micromatch.filter = filter;
  31263. micromatch.isMatch = isMatch;
  31264. micromatch.makeRe = makeRe;
  31265. micromatch.match = match;
  31266. micromatch.matcher = matcher;
  31267. micromatch.matchKeys = matchKeys;
  31268. /**
  31269. * Expose `micromatch`
  31270. */
  31271. module.exports = micromatch;
  31272. /***/ }),
  31273. /* 110 */
  31274. /***/ (function(module, exports, __webpack_require__) {
  31275. "use strict";
  31276. // Copyright Joyent, Inc. and other Node contributors.
  31277. //
  31278. // Permission is hereby granted, free of charge, to any person obtaining a
  31279. // copy of this software and associated documentation files (the
  31280. // "Software"), to deal in the Software without restriction, including
  31281. // without limitation the rights to use, copy, modify, merge, publish,
  31282. // distribute, sublicense, and/or sell copies of the Software, and to permit
  31283. // persons to whom the Software is furnished to do so, subject to the
  31284. // following conditions:
  31285. //
  31286. // The above copyright notice and this permission notice shall be included
  31287. // in all copies or substantial portions of the Software.
  31288. //
  31289. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  31290. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  31291. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  31292. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  31293. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  31294. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  31295. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  31296. // a duplex stream is just a stream that is both readable and writable.
  31297. // Since JS doesn't have multiple prototypal inheritance, this class
  31298. // prototypally inherits from Readable, and then parasitically from
  31299. // Writable.
  31300. /*<replacement>*/
  31301. var pna = __webpack_require__(171);
  31302. /*</replacement>*/
  31303. /*<replacement>*/
  31304. var objectKeys = Object.keys || function (obj) {
  31305. var keys = [];
  31306. for (var key in obj) {
  31307. keys.push(key);
  31308. }return keys;
  31309. };
  31310. /*</replacement>*/
  31311. module.exports = Duplex;
  31312. /*<replacement>*/
  31313. var util = __webpack_require__(105);
  31314. util.inherits = __webpack_require__(78);
  31315. /*</replacement>*/
  31316. var Readable = __webpack_require__(376);
  31317. var Writable = __webpack_require__(378);
  31318. util.inherits(Duplex, Readable);
  31319. {
  31320. // avoid scope creep, the keys array can then be collected
  31321. var keys = objectKeys(Writable.prototype);
  31322. for (var v = 0; v < keys.length; v++) {
  31323. var method = keys[v];
  31324. if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  31325. }
  31326. }
  31327. function Duplex(options) {
  31328. if (!(this instanceof Duplex)) return new Duplex(options);
  31329. Readable.call(this, options);
  31330. Writable.call(this, options);
  31331. if (options && options.readable === false) this.readable = false;
  31332. if (options && options.writable === false) this.writable = false;
  31333. this.allowHalfOpen = true;
  31334. if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
  31335. this.once('end', onend);
  31336. }
  31337. Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
  31338. // making it explicit this property is not enumerable
  31339. // because otherwise some prototype manipulation in
  31340. // userland will fail
  31341. enumerable: false,
  31342. get: function () {
  31343. return this._writableState.highWaterMark;
  31344. }
  31345. });
  31346. // the no-half-open enforcer
  31347. function onend() {
  31348. // if we allow half-open state, or if the writable side ended,
  31349. // then we're ok.
  31350. if (this.allowHalfOpen || this._writableState.ended) return;
  31351. // no more data can be written.
  31352. // But allow more writes to happen in this tick.
  31353. pna.nextTick(onEndNT, this);
  31354. }
  31355. function onEndNT(self) {
  31356. self.end();
  31357. }
  31358. Object.defineProperty(Duplex.prototype, 'destroyed', {
  31359. get: function () {
  31360. if (this._readableState === undefined || this._writableState === undefined) {
  31361. return false;
  31362. }
  31363. return this._readableState.destroyed && this._writableState.destroyed;
  31364. },
  31365. set: function (value) {
  31366. // we ignore the value if the stream
  31367. // has not been initialized yet
  31368. if (this._readableState === undefined || this._writableState === undefined) {
  31369. return;
  31370. }
  31371. // backward compatibility, the user is explicitly
  31372. // managing destroyed
  31373. this._readableState.destroyed = value;
  31374. this._writableState.destroyed = value;
  31375. }
  31376. });
  31377. Duplex.prototype._destroy = function (err, cb) {
  31378. this.push(null);
  31379. this.end();
  31380. pna.nextTick(cb, err);
  31381. };
  31382. /***/ }),
  31383. /* 111 */
  31384. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31385. "use strict";
  31386. /* harmony export (immutable) */ __webpack_exports__["a"] = multicast;
  31387. /* unused harmony export MulticastOperator */
  31388. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_ConnectableObservable__ = __webpack_require__(393);
  31389. /** PURE_IMPORTS_START _observable_ConnectableObservable PURE_IMPORTS_END */
  31390. function multicast(subjectOrSubjectFactory, selector) {
  31391. return function multicastOperatorFunction(source) {
  31392. var subjectFactory;
  31393. if (typeof subjectOrSubjectFactory === 'function') {
  31394. subjectFactory = subjectOrSubjectFactory;
  31395. }
  31396. else {
  31397. subjectFactory = function subjectFactory() {
  31398. return subjectOrSubjectFactory;
  31399. };
  31400. }
  31401. if (typeof selector === 'function') {
  31402. return source.lift(new MulticastOperator(subjectFactory, selector));
  31403. }
  31404. var connectable = Object.create(source, __WEBPACK_IMPORTED_MODULE_0__observable_ConnectableObservable__["b" /* connectableObservableDescriptor */]);
  31405. connectable.source = source;
  31406. connectable.subjectFactory = subjectFactory;
  31407. return connectable;
  31408. };
  31409. }
  31410. var MulticastOperator = /*@__PURE__*/ (function () {
  31411. function MulticastOperator(subjectFactory, selector) {
  31412. this.subjectFactory = subjectFactory;
  31413. this.selector = selector;
  31414. }
  31415. MulticastOperator.prototype.call = function (subscriber, source) {
  31416. var selector = this.selector;
  31417. var subject = this.subjectFactory();
  31418. var subscription = selector(subject).subscribe(subscriber);
  31419. subscription.add(source.subscribe(subject));
  31420. return subscription;
  31421. };
  31422. return MulticastOperator;
  31423. }());
  31424. //# sourceMappingURL=multicast.js.map
  31425. /***/ }),
  31426. /* 112 */
  31427. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31428. "use strict";
  31429. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return observable; });
  31430. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  31431. var observable = typeof Symbol === 'function' && Symbol.observable || '@@observable';
  31432. //# sourceMappingURL=observable.js.map
  31433. /***/ }),
  31434. /* 113 */
  31435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31436. "use strict";
  31437. /* harmony export (immutable) */ __webpack_exports__["a"] = identity;
  31438. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  31439. function identity(x) {
  31440. return x;
  31441. }
  31442. //# sourceMappingURL=identity.js.map
  31443. /***/ }),
  31444. /* 114 */
  31445. /***/ (function(module, exports, __webpack_require__) {
  31446. var v1 = __webpack_require__(1030);
  31447. var v4 = __webpack_require__(1031);
  31448. var uuid = v4;
  31449. uuid.v1 = v1;
  31450. uuid.v4 = v4;
  31451. module.exports = uuid;
  31452. /***/ }),
  31453. /* 115 */
  31454. /***/ (function(module, exports) {
  31455. module.exports = function(module) {
  31456. if(!module.webpackPolyfill) {
  31457. module.deprecate = function() {};
  31458. module.paths = [];
  31459. // module.parent = undefined by default
  31460. if(!module.children) module.children = [];
  31461. Object.defineProperty(module, "loaded", {
  31462. enumerable: true,
  31463. get: function() {
  31464. return module.l;
  31465. }
  31466. });
  31467. Object.defineProperty(module, "id", {
  31468. enumerable: true,
  31469. get: function() {
  31470. return module.i;
  31471. }
  31472. });
  31473. module.webpackPolyfill = 1;
  31474. }
  31475. return module;
  31476. };
  31477. /***/ }),
  31478. /* 116 */
  31479. /***/ (function(module, exports, __webpack_require__) {
  31480. "use strict";
  31481. Object.defineProperty(exports, "__esModule", {
  31482. value: true
  31483. });
  31484. exports.run = exports.getBinFolder = undefined;
  31485. var _keys;
  31486. function _load_keys() {
  31487. return _keys = _interopRequireDefault(__webpack_require__(14));
  31488. }
  31489. var _set;
  31490. function _load_set() {
  31491. return _set = _interopRequireDefault(__webpack_require__(16));
  31492. }
  31493. var _asyncToGenerator2;
  31494. function _load_asyncToGenerator() {
  31495. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  31496. }
  31497. var _getIterator2;
  31498. function _load_getIterator() {
  31499. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  31500. }
  31501. var _promise;
  31502. function _load_promise() {
  31503. return _promise = _interopRequireDefault(__webpack_require__(7));
  31504. }
  31505. var _classCallCheck2;
  31506. function _load_classCallCheck() {
  31507. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  31508. }
  31509. var _possibleConstructorReturn2;
  31510. function _load_possibleConstructorReturn() {
  31511. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  31512. }
  31513. var _inherits2;
  31514. function _load_inherits() {
  31515. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  31516. }
  31517. var updateCwd = function () {
  31518. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
  31519. yield (_fs || _load_fs()).mkdirp(config.globalFolder);
  31520. yield config.init({
  31521. cwd: config.globalFolder,
  31522. offline: config.offline,
  31523. binLinks: true,
  31524. globalFolder: config.globalFolder,
  31525. cacheFolder: config._cacheRootFolder,
  31526. linkFolder: config.linkFolder,
  31527. enableDefaultRc: config.enableDefaultRc,
  31528. extraneousYarnrcFiles: config.extraneousYarnrcFiles
  31529. });
  31530. });
  31531. return function updateCwd(_x) {
  31532. return _ref2.apply(this, arguments);
  31533. };
  31534. }();
  31535. var getBins = function () {
  31536. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
  31537. // build up list of registry folders to search for binaries
  31538. var dirs = [];
  31539. for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index || _load_index()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  31540. var _ref4;
  31541. if (_isArray2) {
  31542. if (_i2 >= _iterator2.length) break;
  31543. _ref4 = _iterator2[_i2++];
  31544. } else {
  31545. _i2 = _iterator2.next();
  31546. if (_i2.done) break;
  31547. _ref4 = _i2.value;
  31548. }
  31549. var registryName = _ref4;
  31550. var registry = config.registries[registryName];
  31551. dirs.push(registry.loc);
  31552. }
  31553. // build up list of binary files
  31554. var paths = new (_set || _load_set()).default();
  31555. for (var _iterator3 = dirs, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  31556. var _ref5;
  31557. if (_isArray3) {
  31558. if (_i3 >= _iterator3.length) break;
  31559. _ref5 = _iterator3[_i3++];
  31560. } else {
  31561. _i3 = _iterator3.next();
  31562. if (_i3.done) break;
  31563. _ref5 = _i3.value;
  31564. }
  31565. var dir = _ref5;
  31566. var binDir = path.join(dir, '.bin');
  31567. if (!(yield (_fs || _load_fs()).exists(binDir))) {
  31568. continue;
  31569. }
  31570. for (var _iterator4 = yield (_fs || _load_fs()).readdir(binDir), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  31571. var _ref6;
  31572. if (_isArray4) {
  31573. if (_i4 >= _iterator4.length) break;
  31574. _ref6 = _iterator4[_i4++];
  31575. } else {
  31576. _i4 = _iterator4.next();
  31577. if (_i4.done) break;
  31578. _ref6 = _i4.value;
  31579. }
  31580. var name = _ref6;
  31581. paths.add(path.join(binDir, name));
  31582. }
  31583. }
  31584. return paths;
  31585. });
  31586. return function getBins(_x2) {
  31587. return _ref3.apply(this, arguments);
  31588. };
  31589. }();
  31590. var getGlobalPrefix = function () {
  31591. var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) {
  31592. if (flags.prefix) {
  31593. return flags.prefix;
  31594. } else if (config.getOption('prefix', true)) {
  31595. return String(config.getOption('prefix', true));
  31596. } else if (process.env.PREFIX) {
  31597. return process.env.PREFIX;
  31598. }
  31599. var potentialPrefixFolders = [(_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX];
  31600. if (process.platform === 'win32') {
  31601. // %LOCALAPPDATA%\Yarn --> C:\Users\Alice\AppData\Local\Yarn
  31602. if (process.env.LOCALAPPDATA) {
  31603. potentialPrefixFolders.unshift(path.join(process.env.LOCALAPPDATA, 'Yarn'));
  31604. }
  31605. } else {
  31606. potentialPrefixFolders.unshift((_constants || _load_constants()).POSIX_GLOBAL_PREFIX);
  31607. }
  31608. var binFolders = potentialPrefixFolders.map(function (prefix) {
  31609. return path.join(prefix, 'bin');
  31610. });
  31611. var prefixFolderQueryResult = yield (_fs || _load_fs()).getFirstSuitableFolder(binFolders);
  31612. var prefix = prefixFolderQueryResult.folder && path.dirname(prefixFolderQueryResult.folder);
  31613. if (!prefix) {
  31614. config.reporter.warn(config.reporter.lang('noGlobalFolder', prefixFolderQueryResult.skipped.map(function (item) {
  31615. return path.dirname(item.folder);
  31616. }).join(', ')));
  31617. return (_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX;
  31618. }
  31619. return prefix;
  31620. });
  31621. return function getGlobalPrefix(_x3, _x4) {
  31622. return _ref7.apply(this, arguments);
  31623. };
  31624. }();
  31625. var getBinFolder = exports.getBinFolder = function () {
  31626. var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) {
  31627. var prefix = yield getGlobalPrefix(config, flags);
  31628. return path.resolve(prefix, 'bin');
  31629. });
  31630. return function getBinFolder(_x5, _x6) {
  31631. return _ref8.apply(this, arguments);
  31632. };
  31633. }();
  31634. var initUpdateBins = function () {
  31635. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags) {
  31636. var beforeBins = yield getBins(config);
  31637. var binFolder = yield getBinFolder(config, flags);
  31638. function throwPermError(err, dest) {
  31639. if (err.code === 'EACCES') {
  31640. throw new (_errors || _load_errors()).MessageError(reporter.lang('noPermission', dest));
  31641. } else {
  31642. throw err;
  31643. }
  31644. }
  31645. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  31646. try {
  31647. yield (_fs || _load_fs()).mkdirp(binFolder);
  31648. } catch (err) {
  31649. throwPermError(err, binFolder);
  31650. }
  31651. var afterBins = yield getBins(config);
  31652. // remove old bins
  31653. for (var _iterator5 = beforeBins, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  31654. var _ref11;
  31655. if (_isArray5) {
  31656. if (_i5 >= _iterator5.length) break;
  31657. _ref11 = _iterator5[_i5++];
  31658. } else {
  31659. _i5 = _iterator5.next();
  31660. if (_i5.done) break;
  31661. _ref11 = _i5.value;
  31662. }
  31663. var src = _ref11;
  31664. if (afterBins.has(src)) {
  31665. // not old
  31666. continue;
  31667. }
  31668. // remove old bin
  31669. var dest = path.join(binFolder, path.basename(src));
  31670. try {
  31671. yield (_fs || _load_fs()).unlink(dest);
  31672. } catch (err) {
  31673. throwPermError(err, dest);
  31674. }
  31675. }
  31676. // add new bins
  31677. for (var _iterator6 = afterBins, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  31678. var _ref12;
  31679. if (_isArray6) {
  31680. if (_i6 >= _iterator6.length) break;
  31681. _ref12 = _iterator6[_i6++];
  31682. } else {
  31683. _i6 = _iterator6.next();
  31684. if (_i6.done) break;
  31685. _ref12 = _i6.value;
  31686. }
  31687. var _src = _ref12;
  31688. // insert new bin
  31689. var dest = path.join(binFolder, path.basename(_src));
  31690. try {
  31691. yield (_fs || _load_fs()).unlink(dest);
  31692. yield (0, (_packageLinker || _load_packageLinker()).linkBin)(_src, dest);
  31693. if (process.platform === 'win32' && dest.indexOf('.cmd') !== -1) {
  31694. yield (_fs || _load_fs()).rename(dest + '.cmd', dest);
  31695. }
  31696. } catch (err) {
  31697. throwPermError(err, dest);
  31698. }
  31699. }
  31700. });
  31701. });
  31702. return function initUpdateBins(_x7, _x8, _x9) {
  31703. return _ref9.apply(this, arguments);
  31704. };
  31705. }();
  31706. var list = function () {
  31707. var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  31708. yield updateCwd(config);
  31709. // install so we get hard file paths
  31710. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd);
  31711. var install = new (_install || _load_install()).Install({}, config, new (_baseReporter || _load_baseReporter()).default(), lockfile);
  31712. var patterns = yield install.getFlattenedDeps();
  31713. // dump global modules
  31714. for (var _iterator7 = patterns, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  31715. var _ref14;
  31716. if (_isArray7) {
  31717. if (_i7 >= _iterator7.length) break;
  31718. _ref14 = _iterator7[_i7++];
  31719. } else {
  31720. _i7 = _iterator7.next();
  31721. if (_i7.done) break;
  31722. _ref14 = _i7.value;
  31723. }
  31724. var pattern = _ref14;
  31725. var manifest = install.resolver.getStrictResolvedPattern(pattern);
  31726. ls(manifest, reporter, false);
  31727. }
  31728. });
  31729. return function list(_x10, _x11, _x12, _x13) {
  31730. return _ref13.apply(this, arguments);
  31731. };
  31732. }();
  31733. exports.hasWrapper = hasWrapper;
  31734. exports.setFlags = setFlags;
  31735. var _errors;
  31736. function _load_errors() {
  31737. return _errors = __webpack_require__(6);
  31738. }
  31739. var _index;
  31740. function _load_index() {
  31741. return _index = __webpack_require__(61);
  31742. }
  31743. var _baseReporter;
  31744. function _load_baseReporter() {
  31745. return _baseReporter = _interopRequireDefault(__webpack_require__(98));
  31746. }
  31747. var _buildSubCommands2;
  31748. function _load_buildSubCommands() {
  31749. return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
  31750. }
  31751. var _lockfile;
  31752. function _load_lockfile() {
  31753. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  31754. }
  31755. var _install;
  31756. function _load_install() {
  31757. return _install = __webpack_require__(41);
  31758. }
  31759. var _add;
  31760. function _load_add() {
  31761. return _add = __webpack_require__(154);
  31762. }
  31763. var _remove;
  31764. function _load_remove() {
  31765. return _remove = __webpack_require__(295);
  31766. }
  31767. var _upgrade;
  31768. function _load_upgrade() {
  31769. return _upgrade = __webpack_require__(194);
  31770. }
  31771. var _upgradeInteractive;
  31772. function _load_upgradeInteractive() {
  31773. return _upgradeInteractive = __webpack_require__(298);
  31774. }
  31775. var _packageLinker;
  31776. function _load_packageLinker() {
  31777. return _packageLinker = __webpack_require__(198);
  31778. }
  31779. var _constants;
  31780. function _load_constants() {
  31781. return _constants = __webpack_require__(13);
  31782. }
  31783. var _fs;
  31784. function _load_fs() {
  31785. return _fs = _interopRequireWildcard(__webpack_require__(8));
  31786. }
  31787. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  31788. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31789. var GlobalAdd = function (_Add) {
  31790. (0, (_inherits2 || _load_inherits()).default)(GlobalAdd, _Add);
  31791. function GlobalAdd(args, flags, config, reporter, lockfile) {
  31792. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GlobalAdd);
  31793. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Add.call(this, args, flags, config, reporter, lockfile));
  31794. _this.linker.setTopLevelBinLinking(false);
  31795. return _this;
  31796. }
  31797. GlobalAdd.prototype.maybeOutputSaveTree = function maybeOutputSaveTree() {
  31798. for (var _iterator = this.addedPatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  31799. var _ref;
  31800. if (_isArray) {
  31801. if (_i >= _iterator.length) break;
  31802. _ref = _iterator[_i++];
  31803. } else {
  31804. _i = _iterator.next();
  31805. if (_i.done) break;
  31806. _ref = _i.value;
  31807. }
  31808. var pattern = _ref;
  31809. var manifest = this.resolver.getStrictResolvedPattern(pattern);
  31810. ls(manifest, this.reporter, true);
  31811. }
  31812. return (_promise || _load_promise()).default.resolve();
  31813. };
  31814. GlobalAdd.prototype._logSuccessSaveLockfile = function _logSuccessSaveLockfile() {
  31815. // noop
  31816. };
  31817. return GlobalAdd;
  31818. }((_add || _load_add()).Add);
  31819. var path = __webpack_require__(1);
  31820. function hasWrapper(flags, args) {
  31821. return args[0] !== 'bin' && args[0] !== 'dir';
  31822. }
  31823. function ls(manifest, reporter, saved) {
  31824. var bins = manifest.bin ? (0, (_keys || _load_keys()).default)(manifest.bin) : [];
  31825. var human = `${manifest.name}@${manifest.version}`;
  31826. if (bins.length) {
  31827. if (saved) {
  31828. reporter.success(reporter.lang('packageInstalledWithBinaries', human));
  31829. } else {
  31830. reporter.info(reporter.lang('packageHasBinaries', human));
  31831. }
  31832. reporter.list(`bins-${manifest.name}`, bins);
  31833. } else if (saved) {
  31834. reporter.warn(reporter.lang('packageHasNoBinaries', human));
  31835. }
  31836. }
  31837. var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('global', {
  31838. add(config, reporter, flags, args) {
  31839. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  31840. yield updateCwd(config);
  31841. var updateBins = yield initUpdateBins(config, reporter, flags);
  31842. if (args.indexOf('yarn') !== -1) {
  31843. reporter.warn(reporter.lang('packageContainsYarnAsGlobal'));
  31844. }
  31845. // install module
  31846. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd);
  31847. var install = new GlobalAdd(args, flags, config, reporter, lockfile);
  31848. yield install.init();
  31849. // link binaries
  31850. yield updateBins();
  31851. })();
  31852. },
  31853. bin(config, reporter, flags, args) {
  31854. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  31855. reporter.log((yield getBinFolder(config, flags)), { force: true });
  31856. })();
  31857. },
  31858. dir(config, reporter, flags, args) {
  31859. reporter.log(config.globalFolder, { force: true });
  31860. return (_promise || _load_promise()).default.resolve();
  31861. },
  31862. ls(config, reporter, flags, args) {
  31863. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  31864. reporter.warn(`\`yarn global ls\` is deprecated. Please use \`yarn global list\`.`);
  31865. yield list(config, reporter, flags, args);
  31866. })();
  31867. },
  31868. list(config, reporter, flags, args) {
  31869. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  31870. yield list(config, reporter, flags, args);
  31871. })();
  31872. },
  31873. remove(config, reporter, flags, args) {
  31874. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  31875. yield updateCwd(config);
  31876. var updateBins = yield initUpdateBins(config, reporter, flags);
  31877. // remove module
  31878. yield (0, (_remove || _load_remove()).run)(config, reporter, flags, args);
  31879. // remove binaries
  31880. yield updateBins();
  31881. })();
  31882. },
  31883. upgrade(config, reporter, flags, args) {
  31884. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  31885. yield updateCwd(config);
  31886. var updateBins = yield initUpdateBins(config, reporter, flags);
  31887. // upgrade module
  31888. yield (0, (_upgrade || _load_upgrade()).run)(config, reporter, flags, args);
  31889. // update binaries
  31890. yield updateBins();
  31891. })();
  31892. },
  31893. upgradeInteractive(config, reporter, flags, args) {
  31894. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  31895. yield updateCwd(config);
  31896. var updateBins = yield initUpdateBins(config, reporter, flags);
  31897. // upgrade module
  31898. yield (0, (_upgradeInteractive || _load_upgradeInteractive()).run)(config, reporter, flags, args);
  31899. // update binaries
  31900. yield updateBins();
  31901. })();
  31902. }
  31903. }),
  31904. run = _buildSubCommands.run,
  31905. _setFlags = _buildSubCommands.setFlags;
  31906. exports.run = run;
  31907. function setFlags(commander) {
  31908. _setFlags(commander);
  31909. commander.description('Installs packages globally on your operating system.');
  31910. commander.option('--prefix <prefix>', 'bin prefix to use to install binaries');
  31911. commander.option('--latest', 'upgrade to the latest version of packages');
  31912. }
  31913. /***/ }),
  31914. /* 117 */
  31915. /***/ (function(module, exports, __webpack_require__) {
  31916. "use strict";
  31917. Object.defineProperty(exports, "__esModule", {
  31918. value: true
  31919. });
  31920. var _promise;
  31921. function _load_promise() {
  31922. return _promise = _interopRequireDefault(__webpack_require__(7));
  31923. }
  31924. var _getIterator2;
  31925. function _load_getIterator() {
  31926. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  31927. }
  31928. var _assign;
  31929. function _load_assign() {
  31930. return _assign = _interopRequireDefault(__webpack_require__(23));
  31931. }
  31932. var _asyncToGenerator2;
  31933. function _load_asyncToGenerator() {
  31934. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  31935. }
  31936. var _classCallCheck2;
  31937. function _load_classCallCheck() {
  31938. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  31939. }
  31940. var _path;
  31941. function _load_path() {
  31942. return _path = _interopRequireDefault(__webpack_require__(1));
  31943. }
  31944. var _invariant;
  31945. function _load_invariant() {
  31946. return _invariant = _interopRequireDefault(__webpack_require__(15));
  31947. }
  31948. var _semver;
  31949. function _load_semver() {
  31950. return _semver = _interopRequireDefault(__webpack_require__(27));
  31951. }
  31952. var _validate;
  31953. function _load_validate() {
  31954. return _validate = __webpack_require__(120);
  31955. }
  31956. var _lockfile;
  31957. function _load_lockfile() {
  31958. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  31959. }
  31960. var _packageReference;
  31961. function _load_packageReference() {
  31962. return _packageReference = _interopRequireDefault(__webpack_require__(302));
  31963. }
  31964. var _index;
  31965. function _load_index() {
  31966. return _index = __webpack_require__(75);
  31967. }
  31968. var _errors;
  31969. function _load_errors() {
  31970. return _errors = __webpack_require__(6);
  31971. }
  31972. var _constants;
  31973. function _load_constants() {
  31974. return _constants = _interopRequireWildcard(__webpack_require__(13));
  31975. }
  31976. var _version;
  31977. function _load_version() {
  31978. return _version = _interopRequireWildcard(__webpack_require__(209));
  31979. }
  31980. var _workspaceResolver;
  31981. function _load_workspaceResolver() {
  31982. return _workspaceResolver = _interopRequireDefault(__webpack_require__(526));
  31983. }
  31984. var _fs;
  31985. function _load_fs() {
  31986. return _fs = _interopRequireWildcard(__webpack_require__(8));
  31987. }
  31988. var _normalizePattern4;
  31989. function _load_normalizePattern() {
  31990. return _normalizePattern4 = __webpack_require__(52);
  31991. }
  31992. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  31993. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31994. var micromatch = __webpack_require__(109);
  31995. var PackageRequest = function () {
  31996. function PackageRequest(req, resolver) {
  31997. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageRequest);
  31998. this.parentRequest = req.parentRequest;
  31999. this.parentNames = req.parentNames || [];
  32000. this.lockfile = resolver.lockfile;
  32001. this.registry = req.registry;
  32002. this.reporter = resolver.reporter;
  32003. this.resolver = resolver;
  32004. this.optional = req.optional;
  32005. this.hint = req.hint;
  32006. this.pattern = req.pattern;
  32007. this.config = resolver.config;
  32008. this.foundInfo = null;
  32009. }
  32010. PackageRequest.prototype.init = function init() {
  32011. this.resolver.usedRegistries.add(this.registry);
  32012. };
  32013. PackageRequest.prototype.getLocked = function getLocked(remoteType) {
  32014. // always prioritise root lockfile
  32015. var shrunk = this.lockfile.getLocked(this.pattern);
  32016. if (shrunk && shrunk.resolved) {
  32017. var resolvedParts = (_version || _load_version()).explodeHashedUrl(shrunk.resolved);
  32018. // Detect Git protocols (git://HOST/PATH or git+PROTOCOL://HOST/PATH)
  32019. var preferredRemoteType = /^git(\+[a-z0-9]+)?:\/\//.test(resolvedParts.url) ? 'git' : remoteType;
  32020. return {
  32021. name: shrunk.name,
  32022. version: shrunk.version,
  32023. _uid: shrunk.uid,
  32024. _remote: {
  32025. resolved: shrunk.resolved,
  32026. type: preferredRemoteType,
  32027. reference: resolvedParts.url,
  32028. hash: resolvedParts.hash,
  32029. integrity: shrunk.integrity,
  32030. registry: shrunk.registry,
  32031. packageName: shrunk.name
  32032. },
  32033. optionalDependencies: shrunk.optionalDependencies || {},
  32034. dependencies: shrunk.dependencies || {},
  32035. prebuiltVariants: shrunk.prebuiltVariants || {}
  32036. };
  32037. } else {
  32038. return null;
  32039. }
  32040. };
  32041. /**
  32042. * If the input pattern matches a registry one then attempt to find it on the registry.
  32043. * Otherwise fork off to an exotic resolver if one matches.
  32044. */
  32045. PackageRequest.prototype.findVersionOnRegistry = function () {
  32046. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) {
  32047. var _ref2 = yield this.normalize(pattern),
  32048. range = _ref2.range,
  32049. name = _ref2.name;
  32050. var exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range);
  32051. if (exoticResolver) {
  32052. var data = yield this.findExoticVersionInfo(exoticResolver, range);
  32053. // clone data as we're manipulating it in place and this could be resolved multiple
  32054. // times
  32055. data = (0, (_assign || _load_assign()).default)({}, data);
  32056. // this is so the returned package response uses the overridden name. ie. if the
  32057. // package's actual name is `bar`, but it's been specified in the manifest like:
  32058. // "foo": "http://foo.com/bar.tar.gz"
  32059. // then we use the foo name
  32060. data.name = name;
  32061. return data;
  32062. }
  32063. var Resolver = this.getRegistryResolver();
  32064. var resolver = new Resolver(this, name, range);
  32065. try {
  32066. return yield resolver.resolve();
  32067. } catch (err) {
  32068. // if it is not an error thrown by yarn and it has a parent request,
  32069. // thow a more readable error
  32070. if (!(err instanceof (_errors || _load_errors()).MessageError) && this.parentRequest && this.parentRequest.pattern) {
  32071. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('requiredPackageNotFoundRegistry', pattern, this.parentRequest.pattern, this.registry));
  32072. }
  32073. throw err;
  32074. }
  32075. });
  32076. function findVersionOnRegistry(_x) {
  32077. return _ref.apply(this, arguments);
  32078. }
  32079. return findVersionOnRegistry;
  32080. }();
  32081. /**
  32082. * Get the registry resolver associated with this package request.
  32083. */
  32084. PackageRequest.prototype.getRegistryResolver = function getRegistryResolver() {
  32085. var Resolver = (_index || _load_index()).registries[this.registry];
  32086. if (Resolver) {
  32087. return Resolver;
  32088. } else {
  32089. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('unknownRegistryResolver', this.registry));
  32090. }
  32091. };
  32092. PackageRequest.prototype.normalizeRange = function () {
  32093. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) {
  32094. if (pattern.indexOf(':') > -1 || pattern.indexOf('@') > -1 || (0, (_index || _load_index()).getExoticResolver)(pattern)) {
  32095. return pattern;
  32096. }
  32097. if (!(_semver || _load_semver()).default.validRange(pattern)) {
  32098. try {
  32099. if (yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(this.config.cwd, pattern, (_constants || _load_constants()).NODE_PACKAGE_JSON))) {
  32100. this.reporter.warn(this.reporter.lang('implicitFileDeprecated', pattern));
  32101. return `file:${pattern}`;
  32102. }
  32103. } catch (err) {
  32104. // pass
  32105. }
  32106. }
  32107. return pattern;
  32108. });
  32109. function normalizeRange(_x2) {
  32110. return _ref3.apply(this, arguments);
  32111. }
  32112. return normalizeRange;
  32113. }();
  32114. PackageRequest.prototype.normalize = function () {
  32115. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) {
  32116. var _normalizePattern = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern),
  32117. name = _normalizePattern.name,
  32118. range = _normalizePattern.range,
  32119. hasVersion = _normalizePattern.hasVersion;
  32120. var newRange = yield this.normalizeRange(range);
  32121. return { name, range: newRange, hasVersion };
  32122. });
  32123. function normalize(_x3) {
  32124. return _ref4.apply(this, arguments);
  32125. }
  32126. return normalize;
  32127. }();
  32128. /**
  32129. * Construct an exotic resolver instance with the input `ExoticResolver` and `range`.
  32130. */
  32131. PackageRequest.prototype.findExoticVersionInfo = function findExoticVersionInfo(ExoticResolver, range) {
  32132. var resolver = new ExoticResolver(this, range);
  32133. return resolver.resolve();
  32134. };
  32135. /**
  32136. * If the current pattern matches an exotic resolver then delegate to it or else try
  32137. * the registry.
  32138. */
  32139. PackageRequest.prototype.findVersionInfo = function () {
  32140. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  32141. var exoticResolver = (0, (_index || _load_index()).getExoticResolver)(this.pattern);
  32142. if (exoticResolver) {
  32143. return this.findExoticVersionInfo(exoticResolver, this.pattern);
  32144. } else if ((_workspaceResolver || _load_workspaceResolver()).default.isWorkspace(this.pattern, this.resolver.workspaceLayout)) {
  32145. (0, (_invariant || _load_invariant()).default)(this.resolver.workspaceLayout, 'expected workspaceLayout');
  32146. var resolver = new (_workspaceResolver || _load_workspaceResolver()).default(this, this.pattern, this.resolver.workspaceLayout);
  32147. var manifest = void 0;
  32148. if (this.config.focus && !(this.pattern.indexOf(this.resolver.workspaceLayout.virtualManifestName) !== -1) && !this.pattern.startsWith(this.config.focusedWorkspaceName + '@')) {
  32149. var localInfo = this.resolver.workspaceLayout.getManifestByPattern(this.pattern);
  32150. (0, (_invariant || _load_invariant()).default)(localInfo, 'expected local info for ' + this.pattern);
  32151. var localManifest = localInfo.manifest;
  32152. var requestPattern = localManifest.name + '@' + localManifest.version;
  32153. manifest = yield this.findVersionOnRegistry(requestPattern);
  32154. }
  32155. return resolver.resolve(manifest);
  32156. } else {
  32157. return this.findVersionOnRegistry(this.pattern);
  32158. }
  32159. });
  32160. function findVersionInfo() {
  32161. return _ref5.apply(this, arguments);
  32162. }
  32163. return findVersionInfo;
  32164. }();
  32165. PackageRequest.prototype.reportResolvedRangeMatch = function reportResolvedRangeMatch(info, resolved) {};
  32166. /**
  32167. * Do the final resolve of a package that had a match with an existing version.
  32168. * After all unique versions have been discovered, so the best available version
  32169. * is found.
  32170. */
  32171. PackageRequest.prototype.resolveToExistingVersion = function resolveToExistingVersion(info) {
  32172. // get final resolved version
  32173. var _normalizePattern2 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern),
  32174. range = _normalizePattern2.range,
  32175. name = _normalizePattern2.name;
  32176. var solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range;
  32177. var resolved = this.resolver.getHighestRangeVersionMatch(name, solvedRange, info);
  32178. (0, (_invariant || _load_invariant()).default)(resolved, 'should have a resolved reference');
  32179. this.reportResolvedRangeMatch(info, resolved);
  32180. var ref = resolved._reference;
  32181. (0, (_invariant || _load_invariant()).default)(ref, 'Resolved package info has no package reference');
  32182. ref.addRequest(this);
  32183. ref.addPattern(this.pattern, resolved);
  32184. ref.addOptional(this.optional);
  32185. };
  32186. /**
  32187. * TODO description
  32188. */
  32189. PackageRequest.prototype.find = function () {
  32190. var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref7) {
  32191. var fresh = _ref7.fresh,
  32192. frozen = _ref7.frozen;
  32193. // find version info for this package pattern
  32194. var info = yield this.findVersionInfo();
  32195. if (!(_semver || _load_semver()).default.valid(info.version)) {
  32196. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('invalidPackageVersion', info.name, info.version));
  32197. }
  32198. info.fresh = fresh;
  32199. (0, (_validate || _load_validate()).cleanDependencies)(info, false, this.reporter, function () {
  32200. // swallow warnings
  32201. });
  32202. // check if while we were resolving this dep we've already resolved one that satisfies
  32203. // the same range
  32204. var _normalizePattern3 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern),
  32205. range = _normalizePattern3.range,
  32206. name = _normalizePattern3.name;
  32207. var solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range;
  32208. var resolved = !info.fresh || frozen ? this.resolver.getExactVersionMatch(name, solvedRange, info) : this.resolver.getHighestRangeVersionMatch(name, solvedRange, info);
  32209. if (resolved) {
  32210. this.resolver.reportPackageWithExistingVersion(this, info);
  32211. return;
  32212. }
  32213. if (info.flat && !this.resolver.flat) {
  32214. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('flatGlobalError', `${info.name}@${info.version}`));
  32215. }
  32216. // validate version info
  32217. PackageRequest.validateVersionInfo(info, this.reporter);
  32218. //
  32219. var remote = info._remote;
  32220. (0, (_invariant || _load_invariant()).default)(remote, 'Missing remote');
  32221. // set package reference
  32222. var ref = new (_packageReference || _load_packageReference()).default(this, info, remote);
  32223. ref.addPattern(this.pattern, info);
  32224. ref.addOptional(this.optional);
  32225. ref.setFresh(fresh);
  32226. info._reference = ref;
  32227. info._remote = remote;
  32228. // start installation of dependencies
  32229. var promises = [];
  32230. var deps = [];
  32231. var parentNames = [].concat(this.parentNames, [name]);
  32232. // normal deps
  32233. for (var depName in info.dependencies) {
  32234. var depPattern = depName + '@' + info.dependencies[depName];
  32235. deps.push(depPattern);
  32236. promises.push(this.resolver.find({
  32237. pattern: depPattern,
  32238. registry: remote.registry,
  32239. // dependencies of optional dependencies should themselves be optional
  32240. optional: this.optional,
  32241. parentRequest: this,
  32242. parentNames
  32243. }));
  32244. }
  32245. // optional deps
  32246. for (var _depName in info.optionalDependencies) {
  32247. var _depPattern = _depName + '@' + info.optionalDependencies[_depName];
  32248. deps.push(_depPattern);
  32249. promises.push(this.resolver.find({
  32250. hint: 'optional',
  32251. pattern: _depPattern,
  32252. registry: remote.registry,
  32253. optional: true,
  32254. parentRequest: this,
  32255. parentNames
  32256. }));
  32257. }
  32258. if (remote.type === 'workspace' && !this.config.production) {
  32259. // workspaces support dev dependencies
  32260. for (var _depName2 in info.devDependencies) {
  32261. var _depPattern2 = _depName2 + '@' + info.devDependencies[_depName2];
  32262. deps.push(_depPattern2);
  32263. promises.push(this.resolver.find({
  32264. hint: 'dev',
  32265. pattern: _depPattern2,
  32266. registry: remote.registry,
  32267. optional: false,
  32268. parentRequest: this,
  32269. parentNames
  32270. }));
  32271. }
  32272. }
  32273. for (var _iterator = promises, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  32274. var _ref8;
  32275. if (_isArray) {
  32276. if (_i >= _iterator.length) break;
  32277. _ref8 = _iterator[_i++];
  32278. } else {
  32279. _i = _iterator.next();
  32280. if (_i.done) break;
  32281. _ref8 = _i.value;
  32282. }
  32283. var promise = _ref8;
  32284. yield promise;
  32285. }
  32286. ref.addDependencies(deps);
  32287. // Now that we have all dependencies, it's safe to propagate optional
  32288. for (var _iterator2 = ref.requests.slice(1), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  32289. var _ref9;
  32290. if (_isArray2) {
  32291. if (_i2 >= _iterator2.length) break;
  32292. _ref9 = _iterator2[_i2++];
  32293. } else {
  32294. _i2 = _iterator2.next();
  32295. if (_i2.done) break;
  32296. _ref9 = _i2.value;
  32297. }
  32298. var otherRequest = _ref9;
  32299. ref.addOptional(otherRequest.optional);
  32300. }
  32301. });
  32302. function find(_x4) {
  32303. return _ref6.apply(this, arguments);
  32304. }
  32305. return find;
  32306. }();
  32307. /**
  32308. * TODO description
  32309. */
  32310. PackageRequest.validateVersionInfo = function validateVersionInfo(info, reporter) {
  32311. // human readable name to use in errors
  32312. var human = `${info.name}@${info.version}`;
  32313. info.version = PackageRequest.getPackageVersion(info);
  32314. for (var _iterator3 = (_constants || _load_constants()).REQUIRED_PACKAGE_KEYS, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  32315. var _ref10;
  32316. if (_isArray3) {
  32317. if (_i3 >= _iterator3.length) break;
  32318. _ref10 = _iterator3[_i3++];
  32319. } else {
  32320. _i3 = _iterator3.next();
  32321. if (_i3.done) break;
  32322. _ref10 = _i3.value;
  32323. }
  32324. var key = _ref10;
  32325. if (!info[key]) {
  32326. throw new (_errors || _load_errors()).MessageError(reporter.lang('missingRequiredPackageKey', human, key));
  32327. }
  32328. }
  32329. };
  32330. /**
  32331. * Returns the package version if present, else defaults to the uid
  32332. */
  32333. PackageRequest.getPackageVersion = function getPackageVersion(info) {
  32334. // TODO possibly reconsider this behaviour
  32335. return info.version === undefined ? info._uid : info.version;
  32336. };
  32337. /**
  32338. * Gets all of the outdated packages and sorts them appropriately
  32339. */
  32340. PackageRequest.getOutdatedPackages = function () {
  32341. var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile, install, config, reporter, filterByPatterns, flags) {
  32342. var _ref12 = yield install.fetchRequestFromCwd(),
  32343. reqPatterns = _ref12.requests,
  32344. workspaceLayout = _ref12.workspaceLayout;
  32345. // Filter out workspace patterns if necessary
  32346. var depReqPatterns = workspaceLayout ? reqPatterns.filter(function (p) {
  32347. return !workspaceLayout.getManifestByPattern(p.pattern);
  32348. }) : reqPatterns;
  32349. // filter the list down to just the packages requested.
  32350. // prevents us from having to query the metadata for all packages.
  32351. if (filterByPatterns && filterByPatterns.length || flags && flags.pattern) {
  32352. var filterByNames = filterByPatterns && filterByPatterns.length ? filterByPatterns.map(function (pattern) {
  32353. return (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern).name;
  32354. }) : [];
  32355. depReqPatterns = depReqPatterns.filter(function (dep) {
  32356. return filterByNames.indexOf((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name) >= 0 || flags && flags.pattern && micromatch.contains((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name, flags.pattern);
  32357. });
  32358. }
  32359. var deps = yield (_promise || _load_promise()).default.all(depReqPatterns.map(function () {
  32360. var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref14) {
  32361. var pattern = _ref14.pattern,
  32362. hint = _ref14.hint,
  32363. workspaceName = _ref14.workspaceName,
  32364. workspaceLoc = _ref14.workspaceLoc;
  32365. var locked = lockfile.getLocked(pattern);
  32366. if (!locked) {
  32367. throw new (_errors || _load_errors()).MessageError(reporter.lang('lockfileOutdated'));
  32368. }
  32369. var name = locked.name,
  32370. current = locked.version;
  32371. var latest = '';
  32372. var wanted = '';
  32373. var url = '';
  32374. var normalized = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern);
  32375. if ((0, (_index || _load_index()).getExoticResolver)(pattern) || (0, (_index || _load_index()).getExoticResolver)(normalized.range)) {
  32376. latest = wanted = 'exotic';
  32377. url = normalized.range;
  32378. } else {
  32379. var registry = config.registries[locked.registry];
  32380. var _ref15 = yield registry.checkOutdated(config, name, normalized.range);
  32381. latest = _ref15.latest;
  32382. wanted = _ref15.wanted;
  32383. url = _ref15.url;
  32384. }
  32385. return {
  32386. name,
  32387. current,
  32388. wanted,
  32389. latest,
  32390. url,
  32391. hint,
  32392. range: normalized.range,
  32393. upgradeTo: '',
  32394. workspaceName: workspaceName || '',
  32395. workspaceLoc: workspaceLoc || ''
  32396. };
  32397. });
  32398. return function (_x11) {
  32399. return _ref13.apply(this, arguments);
  32400. };
  32401. }()));
  32402. // Make sure to always output `exotic` versions to be compatible with npm
  32403. var isDepOld = function isDepOld(_ref16) {
  32404. var current = _ref16.current,
  32405. latest = _ref16.latest,
  32406. wanted = _ref16.wanted;
  32407. return latest === 'exotic' || (_semver || _load_semver()).default.lt(current, wanted) || (_semver || _load_semver()).default.lt(current, latest);
  32408. };
  32409. var orderByName = function orderByName(depA, depB) {
  32410. return depA.name.localeCompare(depB.name);
  32411. };
  32412. return deps.filter(isDepOld).sort(orderByName);
  32413. });
  32414. function getOutdatedPackages(_x5, _x6, _x7, _x8, _x9, _x10) {
  32415. return _ref11.apply(this, arguments);
  32416. }
  32417. return getOutdatedPackages;
  32418. }();
  32419. return PackageRequest;
  32420. }();
  32421. exports.default = PackageRequest;
  32422. /***/ }),
  32423. /* 118 */
  32424. /***/ (function(module, exports, __webpack_require__) {
  32425. "use strict";
  32426. Object.defineProperty(exports, "__esModule", {
  32427. value: true
  32428. });
  32429. var _classCallCheck2;
  32430. function _load_classCallCheck() {
  32431. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  32432. }
  32433. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  32434. var BaseResolver = function () {
  32435. function BaseResolver(request, fragment) {
  32436. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseResolver);
  32437. this.resolver = request.resolver;
  32438. this.reporter = request.reporter;
  32439. this.fragment = fragment;
  32440. this.registry = request.registry;
  32441. this.request = request;
  32442. this.pattern = request.pattern;
  32443. this.config = request.config;
  32444. }
  32445. BaseResolver.prototype.fork = function fork(Resolver, resolveArg) {
  32446. for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  32447. args[_key - 2] = arguments[_key];
  32448. }
  32449. var resolver = new (Function.prototype.bind.apply(Resolver, [null].concat([this.request], args)))();
  32450. resolver.registry = this.registry;
  32451. return resolver.resolve(resolveArg);
  32452. };
  32453. BaseResolver.prototype.resolve = function resolve(resolveArg) {
  32454. throw new Error('Not implemented');
  32455. };
  32456. return BaseResolver;
  32457. }();
  32458. exports.default = BaseResolver;
  32459. /***/ }),
  32460. /* 119 */
  32461. /***/ (function(module, exports, __webpack_require__) {
  32462. "use strict";
  32463. Object.defineProperty(exports, "__esModule", {
  32464. value: true
  32465. });
  32466. var _asyncToGenerator2;
  32467. function _load_asyncToGenerator() {
  32468. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  32469. }
  32470. var _getIterator2;
  32471. function _load_getIterator() {
  32472. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  32473. }
  32474. var _classCallCheck2;
  32475. function _load_classCallCheck() {
  32476. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  32477. }
  32478. var _possibleConstructorReturn2;
  32479. function _load_possibleConstructorReturn() {
  32480. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  32481. }
  32482. var _inherits2;
  32483. function _load_inherits() {
  32484. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  32485. }
  32486. var _index;
  32487. function _load_index() {
  32488. return _index = __webpack_require__(75);
  32489. }
  32490. var _misc;
  32491. function _load_misc() {
  32492. return _misc = _interopRequireWildcard(__webpack_require__(28));
  32493. }
  32494. var _version;
  32495. function _load_version() {
  32496. return _version = _interopRequireWildcard(__webpack_require__(209));
  32497. }
  32498. var _guessName;
  32499. function _load_guessName() {
  32500. return _guessName = _interopRequireDefault(__webpack_require__(159));
  32501. }
  32502. var _index2;
  32503. function _load_index2() {
  32504. return _index2 = __webpack_require__(61);
  32505. }
  32506. var _exoticResolver;
  32507. function _load_exoticResolver() {
  32508. return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
  32509. }
  32510. var _git;
  32511. function _load_git() {
  32512. return _git = _interopRequireDefault(__webpack_require__(205));
  32513. }
  32514. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  32515. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  32516. var urlParse = __webpack_require__(29).parse;
  32517. var GIT_HOSTS = ['github.com', 'gitlab.com', 'bitbucket.com', 'bitbucket.org'];
  32518. var GIT_PATTERN_MATCHERS = [/^git:/, /^git\+.+:/, /^ssh:/, /^https?:.+\.git$/, /^https?:.+\.git#.+/];
  32519. var GitResolver = function (_ExoticResolver) {
  32520. (0, (_inherits2 || _load_inherits()).default)(GitResolver, _ExoticResolver);
  32521. function GitResolver(request, fragment) {
  32522. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitResolver);
  32523. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
  32524. var _versionUtil$explodeH = (_version || _load_version()).explodeHashedUrl(fragment),
  32525. url = _versionUtil$explodeH.url,
  32526. hash = _versionUtil$explodeH.hash;
  32527. _this.url = url;
  32528. _this.hash = hash;
  32529. return _this;
  32530. }
  32531. GitResolver.isVersion = function isVersion(pattern) {
  32532. for (var _iterator = GIT_PATTERN_MATCHERS, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  32533. var _ref;
  32534. if (_isArray) {
  32535. if (_i >= _iterator.length) break;
  32536. _ref = _iterator[_i++];
  32537. } else {
  32538. _i = _iterator.next();
  32539. if (_i.done) break;
  32540. _ref = _i.value;
  32541. }
  32542. var matcher = _ref;
  32543. if (matcher.test(pattern)) {
  32544. return true;
  32545. }
  32546. }
  32547. var _urlParse = urlParse(pattern),
  32548. hostname = _urlParse.hostname,
  32549. path = _urlParse.path;
  32550. if (hostname && path && GIT_HOSTS.indexOf(hostname) >= 0) {
  32551. // only if dependency is pointing to a git repo,
  32552. // e.g. facebook/flow and not file in a git repo facebook/flow/archive/v1.0.0.tar.gz
  32553. return path.split('/').filter(function (p) {
  32554. return !!p;
  32555. }).length === 2;
  32556. }
  32557. return false;
  32558. };
  32559. GitResolver.prototype.resolve = function () {
  32560. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (forked) {
  32561. var tryRegistry = function () {
  32562. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) {
  32563. var filename = (_index2 || _load_index2()).registries[registry].filename;
  32564. var file = yield client.getFile(filename);
  32565. if (!file) {
  32566. return null;
  32567. }
  32568. var json = yield config.readJson(`${url}/${filename}`, function () {
  32569. return JSON.parse(file);
  32570. });
  32571. json._uid = commit;
  32572. json._remote = {
  32573. resolved: `${url}#${commit}`,
  32574. type: 'git',
  32575. reference: url,
  32576. hash: commit,
  32577. registry
  32578. };
  32579. return json;
  32580. });
  32581. return function tryRegistry(_x2) {
  32582. return _ref3.apply(this, arguments);
  32583. };
  32584. }();
  32585. var url = this.url;
  32586. // shortcut for hosted git. we will fallback to a GitResolver if the hosted git
  32587. // optimisations fail which the `forked` flag indicates so we don't get into an
  32588. // infinite loop
  32589. var parts = urlParse(url);
  32590. if (false) {
  32591. // check if this git url uses any of the hostnames defined in our hosted git resolvers
  32592. for (var name in (_index || _load_index()).hostedGit) {
  32593. var Resolver = (_index || _load_index()).hostedGit[name];
  32594. if (Resolver.hostname !== parts.hostname) {
  32595. continue;
  32596. }
  32597. // we have a match! clean up the pathname of url artifacts
  32598. var pathname = parts.pathname;
  32599. pathname = (_misc || _load_misc()).removePrefix(pathname, '/'); // remove prefixed slash
  32600. pathname = (_misc || _load_misc()).removeSuffix(pathname, '.git'); // remove .git suffix if present
  32601. var _url = `${pathname}${this.hash ? '#' + decodeURIComponent(this.hash) : ''}`;
  32602. return this.fork(Resolver, false, _url);
  32603. }
  32604. }
  32605. // get from lockfile
  32606. var shrunk = this.request.getLocked('git');
  32607. if (shrunk) {
  32608. return shrunk;
  32609. }
  32610. var config = this.config;
  32611. var gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url);
  32612. var client = new (_git || _load_git()).default(config, gitUrl, this.hash);
  32613. var commit = yield client.init();
  32614. var file = yield tryRegistry(this.registry);
  32615. if (file) {
  32616. return file;
  32617. }
  32618. for (var registry in (_index2 || _load_index2()).registries) {
  32619. if (registry === this.registry) {
  32620. continue;
  32621. }
  32622. var _file = yield tryRegistry(registry);
  32623. if (_file) {
  32624. return _file;
  32625. }
  32626. }
  32627. return {
  32628. // This is just the default, it can be overridden with key of dependencies
  32629. name: (0, (_guessName || _load_guessName()).default)(url),
  32630. version: '0.0.0',
  32631. _uid: commit,
  32632. _remote: {
  32633. resolved: `${url}#${commit}`,
  32634. type: 'git',
  32635. reference: url,
  32636. hash: commit,
  32637. registry: 'npm'
  32638. }
  32639. };
  32640. });
  32641. function resolve(_x) {
  32642. return _ref2.apply(this, arguments);
  32643. }
  32644. return resolve;
  32645. }();
  32646. return GitResolver;
  32647. }((_exoticResolver || _load_exoticResolver()).default);
  32648. exports.default = GitResolver;
  32649. /***/ }),
  32650. /* 120 */
  32651. /***/ (function(module, exports, __webpack_require__) {
  32652. "use strict";
  32653. Object.defineProperty(exports, "__esModule", {
  32654. value: true
  32655. });
  32656. var _keys;
  32657. function _load_keys() {
  32658. return _keys = _interopRequireDefault(__webpack_require__(14));
  32659. }
  32660. var _set;
  32661. function _load_set() {
  32662. return _set = _interopRequireDefault(__webpack_require__(16));
  32663. }
  32664. var _map;
  32665. function _load_map() {
  32666. return _map = _interopRequireDefault(__webpack_require__(42));
  32667. }
  32668. var _getIterator2;
  32669. function _load_getIterator() {
  32670. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  32671. }
  32672. exports.isValidPackageName = isValidPackageName;
  32673. exports.default = function (info, isRoot, reporter, warn) {
  32674. if (isRoot) {
  32675. for (var key in (_typos || _load_typos()).default) {
  32676. if (key in info) {
  32677. warn(reporter.lang('manifestPotentialTypo', key, (_typos || _load_typos()).default[key]));
  32678. }
  32679. }
  32680. }
  32681. // validate name
  32682. var name = info.name;
  32683. if (typeof name === 'string') {
  32684. if (isRoot && isBuiltinModule(name)) {
  32685. warn(reporter.lang('manifestBuiltinModule', name));
  32686. }
  32687. // cannot start with a dot
  32688. if (name[0] === '.') {
  32689. throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameDot'));
  32690. }
  32691. // cannot contain the following characters
  32692. if (!isValidPackageName(name)) {
  32693. throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameIllegalChars'));
  32694. }
  32695. // cannot equal node_modules or favicon.ico
  32696. var lower = name.toLowerCase();
  32697. if (lower === 'node_modules' || lower === 'favicon.ico') {
  32698. throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameBlacklisted'));
  32699. }
  32700. }
  32701. // validate license
  32702. if (isRoot && !info.private) {
  32703. if (typeof info.license === 'string') {
  32704. var license = info.license.replace(/\*$/g, '');
  32705. if (!(0, (_util || _load_util()).isValidLicense)(license)) {
  32706. warn(reporter.lang('manifestLicenseInvalid'));
  32707. }
  32708. } else {
  32709. warn(reporter.lang('manifestLicenseNone'));
  32710. }
  32711. }
  32712. // validate strings
  32713. for (var _iterator = strings, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  32714. var _ref;
  32715. if (_isArray) {
  32716. if (_i >= _iterator.length) break;
  32717. _ref = _iterator[_i++];
  32718. } else {
  32719. _i = _iterator.next();
  32720. if (_i.done) break;
  32721. _ref = _i.value;
  32722. }
  32723. var _key = _ref;
  32724. var val = info[_key];
  32725. if (val && typeof val !== 'string') {
  32726. throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestStringExpected', _key));
  32727. }
  32728. }
  32729. cleanDependencies(info, isRoot, reporter, warn);
  32730. };
  32731. exports.cleanDependencies = cleanDependencies;
  32732. var _errors;
  32733. function _load_errors() {
  32734. return _errors = __webpack_require__(6);
  32735. }
  32736. var _util;
  32737. function _load_util() {
  32738. return _util = __webpack_require__(207);
  32739. }
  32740. var _typos;
  32741. function _load_typos() {
  32742. return _typos = _interopRequireDefault(__webpack_require__(544));
  32743. }
  32744. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  32745. var isBuiltinModule = __webpack_require__(779);
  32746. var strings = ['name', 'version'];
  32747. var dependencyKeys = [
  32748. // npm registry will include optionalDependencies in dependencies and we'll want to dedupe them from the
  32749. // other fields first
  32750. 'optionalDependencies',
  32751. // it's seemingly common to include a dependency in dependencies and devDependencies of the same name but
  32752. // different ranges, this can cause a lot of issues with our determinism and the behaviour of npm is
  32753. // currently unspecified.
  32754. 'dependencies', 'devDependencies'];
  32755. function isValidName(name) {
  32756. return !name.match(/[\/@\s\+%:]/) && encodeURIComponent(name) === name;
  32757. }
  32758. function isValidScopedName(name) {
  32759. if (name[0] !== '@') {
  32760. return false;
  32761. }
  32762. var parts = name.slice(1).split('/');
  32763. return parts.length === 2 && isValidName(parts[0]) && isValidName(parts[1]);
  32764. }
  32765. function isValidPackageName(name) {
  32766. return isValidName(name) || isValidScopedName(name);
  32767. }
  32768. function cleanDependencies(info, isRoot, reporter, warn) {
  32769. // get dependency objects
  32770. var depTypes = [];
  32771. for (var _iterator2 = dependencyKeys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  32772. var _ref2;
  32773. if (_isArray2) {
  32774. if (_i2 >= _iterator2.length) break;
  32775. _ref2 = _iterator2[_i2++];
  32776. } else {
  32777. _i2 = _iterator2.next();
  32778. if (_i2.done) break;
  32779. _ref2 = _i2.value;
  32780. }
  32781. var _type = _ref2;
  32782. var deps = info[_type];
  32783. if (!deps || typeof deps !== 'object') {
  32784. continue;
  32785. }
  32786. depTypes.push([_type, deps]);
  32787. }
  32788. // aggregate all non-trivial deps (not '' or '*')
  32789. var nonTrivialDeps = new (_map || _load_map()).default();
  32790. for (var _iterator3 = depTypes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  32791. var _ref4;
  32792. if (_isArray3) {
  32793. if (_i3 >= _iterator3.length) break;
  32794. _ref4 = _iterator3[_i3++];
  32795. } else {
  32796. _i3 = _iterator3.next();
  32797. if (_i3.done) break;
  32798. _ref4 = _i3.value;
  32799. }
  32800. var _ref3 = _ref4;
  32801. var _type2 = _ref3[0];
  32802. var deps = _ref3[1];
  32803. for (var _iterator5 = (0, (_keys || _load_keys()).default)(deps), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  32804. var _ref7;
  32805. if (_isArray5) {
  32806. if (_i5 >= _iterator5.length) break;
  32807. _ref7 = _iterator5[_i5++];
  32808. } else {
  32809. _i5 = _iterator5.next();
  32810. if (_i5.done) break;
  32811. _ref7 = _i5.value;
  32812. }
  32813. var name = _ref7;
  32814. var _version = deps[name];
  32815. if (!nonTrivialDeps.has(name) && _version && _version !== '*') {
  32816. nonTrivialDeps.set(name, { type: _type2, version: _version });
  32817. }
  32818. }
  32819. }
  32820. // overwrite first dep of package with non-trivial version, remove the rest
  32821. var setDeps = new (_set || _load_set()).default();
  32822. for (var _iterator4 = depTypes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  32823. var _ref6;
  32824. if (_isArray4) {
  32825. if (_i4 >= _iterator4.length) break;
  32826. _ref6 = _iterator4[_i4++];
  32827. } else {
  32828. _i4 = _iterator4.next();
  32829. if (_i4.done) break;
  32830. _ref6 = _i4.value;
  32831. }
  32832. var _ref5 = _ref6;
  32833. var _type3 = _ref5[0];
  32834. var _deps = _ref5[1];
  32835. for (var _iterator6 = (0, (_keys || _load_keys()).default)(_deps), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  32836. var _ref8;
  32837. if (_isArray6) {
  32838. if (_i6 >= _iterator6.length) break;
  32839. _ref8 = _iterator6[_i6++];
  32840. } else {
  32841. _i6 = _iterator6.next();
  32842. if (_i6.done) break;
  32843. _ref8 = _i6.value;
  32844. }
  32845. var _name = _ref8;
  32846. var _version2 = _deps[_name];
  32847. var dep = nonTrivialDeps.get(_name);
  32848. if (dep) {
  32849. if (_version2 && _version2 !== '*' && _version2 !== dep.version && isRoot) {
  32850. // only throw a warning when at the root
  32851. warn(reporter.lang('manifestDependencyCollision', dep.type, _name, dep.version, _type3, _version2));
  32852. }
  32853. _version2 = dep.version;
  32854. }
  32855. if (setDeps.has(_name)) {
  32856. delete _deps[_name];
  32857. } else {
  32858. _deps[_name] = _version2;
  32859. setDeps.add(_name);
  32860. }
  32861. }
  32862. }
  32863. }
  32864. /***/ }),
  32865. /* 121 */
  32866. /***/ (function(module, exports) {
  32867. var toString = {}.toString;
  32868. module.exports = function (it) {
  32869. return toString.call(it).slice(8, -1);
  32870. };
  32871. /***/ }),
  32872. /* 122 */
  32873. /***/ (function(module, exports, __webpack_require__) {
  32874. var ctx = __webpack_require__(68);
  32875. var call = __webpack_require__(332);
  32876. var isArrayIter = __webpack_require__(330);
  32877. var anObject = __webpack_require__(58);
  32878. var toLength = __webpack_require__(161);
  32879. var getIterFn = __webpack_require__(231);
  32880. var BREAK = {};
  32881. var RETURN = {};
  32882. var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  32883. var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  32884. var f = ctx(fn, that, entries ? 2 : 1);
  32885. var index = 0;
  32886. var length, step, iterator, result;
  32887. if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  32888. // fast case for arrays with default iterator
  32889. if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
  32890. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  32891. if (result === BREAK || result === RETURN) return result;
  32892. } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
  32893. result = call(iterator, f, step.value, entries);
  32894. if (result === BREAK || result === RETURN) return result;
  32895. }
  32896. };
  32897. exports.BREAK = BREAK;
  32898. exports.RETURN = RETURN;
  32899. /***/ }),
  32900. /* 123 */
  32901. /***/ (function(module, exports) {
  32902. module.exports = {};
  32903. /***/ }),
  32904. /* 124 */
  32905. /***/ (function(module, exports) {
  32906. module.exports = true;
  32907. /***/ }),
  32908. /* 125 */
  32909. /***/ (function(module, exports, __webpack_require__) {
  32910. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  32911. var anObject = __webpack_require__(58);
  32912. var dPs = __webpack_require__(617);
  32913. var enumBugKeys = __webpack_require__(217);
  32914. var IE_PROTO = __webpack_require__(224)('IE_PROTO');
  32915. var Empty = function () { /* empty */ };
  32916. var PROTOTYPE = 'prototype';
  32917. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  32918. var createDict = function () {
  32919. // Thrash, waste and sodomy: IE GC bug
  32920. var iframe = __webpack_require__(216)('iframe');
  32921. var i = enumBugKeys.length;
  32922. var lt = '<';
  32923. var gt = '>';
  32924. var iframeDocument;
  32925. iframe.style.display = 'none';
  32926. __webpack_require__(327).appendChild(iframe);
  32927. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  32928. // createDict = iframe.contentWindow.Object;
  32929. // html.removeChild(iframe);
  32930. iframeDocument = iframe.contentWindow.document;
  32931. iframeDocument.open();
  32932. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  32933. iframeDocument.close();
  32934. createDict = iframeDocument.F;
  32935. while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  32936. return createDict();
  32937. };
  32938. module.exports = Object.create || function create(O, Properties) {
  32939. var result;
  32940. if (O !== null) {
  32941. Empty[PROTOTYPE] = anObject(O);
  32942. result = new Empty();
  32943. Empty[PROTOTYPE] = null;
  32944. // add "__proto__" for Object.getPrototypeOf polyfill
  32945. result[IE_PROTO] = O;
  32946. } else result = createDict();
  32947. return Properties === undefined ? result : dPs(result, Properties);
  32948. };
  32949. /***/ }),
  32950. /* 126 */
  32951. /***/ (function(module, exports) {
  32952. exports.f = {}.propertyIsEnumerable;
  32953. /***/ }),
  32954. /* 127 */
  32955. /***/ (function(module, exports) {
  32956. module.exports = function (bitmap, value) {
  32957. return {
  32958. enumerable: !(bitmap & 1),
  32959. configurable: !(bitmap & 2),
  32960. writable: !(bitmap & 4),
  32961. value: value
  32962. };
  32963. };
  32964. /***/ }),
  32965. /* 128 */
  32966. /***/ (function(module, exports, __webpack_require__) {
  32967. var def = __webpack_require__(63).f;
  32968. var has = __webpack_require__(89);
  32969. var TAG = __webpack_require__(44)('toStringTag');
  32970. module.exports = function (it, tag, stat) {
  32971. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  32972. };
  32973. /***/ }),
  32974. /* 129 */
  32975. /***/ (function(module, exports, __webpack_require__) {
  32976. __webpack_require__(626);
  32977. var global = __webpack_require__(38);
  32978. var hide = __webpack_require__(77);
  32979. var Iterators = __webpack_require__(123);
  32980. var TO_STRING_TAG = __webpack_require__(44)('toStringTag');
  32981. var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
  32982. 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
  32983. 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
  32984. 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
  32985. 'TextTrackList,TouchList').split(',');
  32986. for (var i = 0; i < DOMIterables.length; i++) {
  32987. var NAME = DOMIterables[i];
  32988. var Collection = global[NAME];
  32989. var proto = Collection && Collection.prototype;
  32990. if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  32991. Iterators[NAME] = Iterators.Array;
  32992. }
  32993. /***/ }),
  32994. /* 130 */
  32995. /***/ (function(module, exports, __webpack_require__) {
  32996. // Basic Javascript Elliptic Curve implementation
  32997. // Ported loosely from BouncyCastle's Java EC code
  32998. // Only Fp curves implemented for now
  32999. // Requires jsbn.js and jsbn2.js
  33000. var BigInteger = __webpack_require__(79).BigInteger
  33001. var Barrett = BigInteger.prototype.Barrett
  33002. // ----------------
  33003. // ECFieldElementFp
  33004. // constructor
  33005. function ECFieldElementFp(q,x) {
  33006. this.x = x;
  33007. // TODO if(x.compareTo(q) >= 0) error
  33008. this.q = q;
  33009. }
  33010. function feFpEquals(other) {
  33011. if(other == this) return true;
  33012. return (this.q.equals(other.q) && this.x.equals(other.x));
  33013. }
  33014. function feFpToBigInteger() {
  33015. return this.x;
  33016. }
  33017. function feFpNegate() {
  33018. return new ECFieldElementFp(this.q, this.x.negate().mod(this.q));
  33019. }
  33020. function feFpAdd(b) {
  33021. return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q));
  33022. }
  33023. function feFpSubtract(b) {
  33024. return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q));
  33025. }
  33026. function feFpMultiply(b) {
  33027. return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q));
  33028. }
  33029. function feFpSquare() {
  33030. return new ECFieldElementFp(this.q, this.x.square().mod(this.q));
  33031. }
  33032. function feFpDivide(b) {
  33033. return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q));
  33034. }
  33035. ECFieldElementFp.prototype.equals = feFpEquals;
  33036. ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger;
  33037. ECFieldElementFp.prototype.negate = feFpNegate;
  33038. ECFieldElementFp.prototype.add = feFpAdd;
  33039. ECFieldElementFp.prototype.subtract = feFpSubtract;
  33040. ECFieldElementFp.prototype.multiply = feFpMultiply;
  33041. ECFieldElementFp.prototype.square = feFpSquare;
  33042. ECFieldElementFp.prototype.divide = feFpDivide;
  33043. // ----------------
  33044. // ECPointFp
  33045. // constructor
  33046. function ECPointFp(curve,x,y,z) {
  33047. this.curve = curve;
  33048. this.x = x;
  33049. this.y = y;
  33050. // Projective coordinates: either zinv == null or z * zinv == 1
  33051. // z and zinv are just BigIntegers, not fieldElements
  33052. if(z == null) {
  33053. this.z = BigInteger.ONE;
  33054. }
  33055. else {
  33056. this.z = z;
  33057. }
  33058. this.zinv = null;
  33059. //TODO: compression flag
  33060. }
  33061. function pointFpGetX() {
  33062. if(this.zinv == null) {
  33063. this.zinv = this.z.modInverse(this.curve.q);
  33064. }
  33065. var r = this.x.toBigInteger().multiply(this.zinv);
  33066. this.curve.reduce(r);
  33067. return this.curve.fromBigInteger(r);
  33068. }
  33069. function pointFpGetY() {
  33070. if(this.zinv == null) {
  33071. this.zinv = this.z.modInverse(this.curve.q);
  33072. }
  33073. var r = this.y.toBigInteger().multiply(this.zinv);
  33074. this.curve.reduce(r);
  33075. return this.curve.fromBigInteger(r);
  33076. }
  33077. function pointFpEquals(other) {
  33078. if(other == this) return true;
  33079. if(this.isInfinity()) return other.isInfinity();
  33080. if(other.isInfinity()) return this.isInfinity();
  33081. var u, v;
  33082. // u = Y2 * Z1 - Y1 * Z2
  33083. u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q);
  33084. if(!u.equals(BigInteger.ZERO)) return false;
  33085. // v = X2 * Z1 - X1 * Z2
  33086. v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q);
  33087. return v.equals(BigInteger.ZERO);
  33088. }
  33089. function pointFpIsInfinity() {
  33090. if((this.x == null) && (this.y == null)) return true;
  33091. return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO);
  33092. }
  33093. function pointFpNegate() {
  33094. return new ECPointFp(this.curve, this.x, this.y.negate(), this.z);
  33095. }
  33096. function pointFpAdd(b) {
  33097. if(this.isInfinity()) return b;
  33098. if(b.isInfinity()) return this;
  33099. // u = Y2 * Z1 - Y1 * Z2
  33100. var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q);
  33101. // v = X2 * Z1 - X1 * Z2
  33102. var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q);
  33103. if(BigInteger.ZERO.equals(v)) {
  33104. if(BigInteger.ZERO.equals(u)) {
  33105. return this.twice(); // this == b, so double
  33106. }
  33107. return this.curve.getInfinity(); // this = -b, so infinity
  33108. }
  33109. var THREE = new BigInteger("3");
  33110. var x1 = this.x.toBigInteger();
  33111. var y1 = this.y.toBigInteger();
  33112. var x2 = b.x.toBigInteger();
  33113. var y2 = b.y.toBigInteger();
  33114. var v2 = v.square();
  33115. var v3 = v2.multiply(v);
  33116. var x1v2 = x1.multiply(v2);
  33117. var zu2 = u.square().multiply(this.z);
  33118. // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)
  33119. var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q);
  33120. // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3
  33121. var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q);
  33122. // z3 = v^3 * z1 * z2
  33123. var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q);
  33124. return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);
  33125. }
  33126. function pointFpTwice() {
  33127. if(this.isInfinity()) return this;
  33128. if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity();
  33129. // TODO: optimized handling of constants
  33130. var THREE = new BigInteger("3");
  33131. var x1 = this.x.toBigInteger();
  33132. var y1 = this.y.toBigInteger();
  33133. var y1z1 = y1.multiply(this.z);
  33134. var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q);
  33135. var a = this.curve.a.toBigInteger();
  33136. // w = 3 * x1^2 + a * z1^2
  33137. var w = x1.square().multiply(THREE);
  33138. if(!BigInteger.ZERO.equals(a)) {
  33139. w = w.add(this.z.square().multiply(a));
  33140. }
  33141. w = w.mod(this.curve.q);
  33142. //this.curve.reduce(w);
  33143. // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)
  33144. var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q);
  33145. // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3
  33146. var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q);
  33147. // z3 = 8 * (y1 * z1)^3
  33148. var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q);
  33149. return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);
  33150. }
  33151. // Simple NAF (Non-Adjacent Form) multiplication algorithm
  33152. // TODO: modularize the multiplication algorithm
  33153. function pointFpMultiply(k) {
  33154. if(this.isInfinity()) return this;
  33155. if(k.signum() == 0) return this.curve.getInfinity();
  33156. var e = k;
  33157. var h = e.multiply(new BigInteger("3"));
  33158. var neg = this.negate();
  33159. var R = this;
  33160. var i;
  33161. for(i = h.bitLength() - 2; i > 0; --i) {
  33162. R = R.twice();
  33163. var hBit = h.testBit(i);
  33164. var eBit = e.testBit(i);
  33165. if (hBit != eBit) {
  33166. R = R.add(hBit ? this : neg);
  33167. }
  33168. }
  33169. return R;
  33170. }
  33171. // Compute this*j + x*k (simultaneous multiplication)
  33172. function pointFpMultiplyTwo(j,x,k) {
  33173. var i;
  33174. if(j.bitLength() > k.bitLength())
  33175. i = j.bitLength() - 1;
  33176. else
  33177. i = k.bitLength() - 1;
  33178. var R = this.curve.getInfinity();
  33179. var both = this.add(x);
  33180. while(i >= 0) {
  33181. R = R.twice();
  33182. if(j.testBit(i)) {
  33183. if(k.testBit(i)) {
  33184. R = R.add(both);
  33185. }
  33186. else {
  33187. R = R.add(this);
  33188. }
  33189. }
  33190. else {
  33191. if(k.testBit(i)) {
  33192. R = R.add(x);
  33193. }
  33194. }
  33195. --i;
  33196. }
  33197. return R;
  33198. }
  33199. ECPointFp.prototype.getX = pointFpGetX;
  33200. ECPointFp.prototype.getY = pointFpGetY;
  33201. ECPointFp.prototype.equals = pointFpEquals;
  33202. ECPointFp.prototype.isInfinity = pointFpIsInfinity;
  33203. ECPointFp.prototype.negate = pointFpNegate;
  33204. ECPointFp.prototype.add = pointFpAdd;
  33205. ECPointFp.prototype.twice = pointFpTwice;
  33206. ECPointFp.prototype.multiply = pointFpMultiply;
  33207. ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo;
  33208. // ----------------
  33209. // ECCurveFp
  33210. // constructor
  33211. function ECCurveFp(q,a,b) {
  33212. this.q = q;
  33213. this.a = this.fromBigInteger(a);
  33214. this.b = this.fromBigInteger(b);
  33215. this.infinity = new ECPointFp(this, null, null);
  33216. this.reducer = new Barrett(this.q);
  33217. }
  33218. function curveFpGetQ() {
  33219. return this.q;
  33220. }
  33221. function curveFpGetA() {
  33222. return this.a;
  33223. }
  33224. function curveFpGetB() {
  33225. return this.b;
  33226. }
  33227. function curveFpEquals(other) {
  33228. if(other == this) return true;
  33229. return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b));
  33230. }
  33231. function curveFpGetInfinity() {
  33232. return this.infinity;
  33233. }
  33234. function curveFpFromBigInteger(x) {
  33235. return new ECFieldElementFp(this.q, x);
  33236. }
  33237. function curveReduce(x) {
  33238. this.reducer.reduce(x);
  33239. }
  33240. // for now, work with hex strings because they're easier in JS
  33241. function curveFpDecodePointHex(s) {
  33242. switch(parseInt(s.substr(0,2), 16)) { // first byte
  33243. case 0:
  33244. return this.infinity;
  33245. case 2:
  33246. case 3:
  33247. // point compression not supported yet
  33248. return null;
  33249. case 4:
  33250. case 6:
  33251. case 7:
  33252. var len = (s.length - 2) / 2;
  33253. var xHex = s.substr(2, len);
  33254. var yHex = s.substr(len+2, len);
  33255. return new ECPointFp(this,
  33256. this.fromBigInteger(new BigInteger(xHex, 16)),
  33257. this.fromBigInteger(new BigInteger(yHex, 16)));
  33258. default: // unsupported
  33259. return null;
  33260. }
  33261. }
  33262. function curveFpEncodePointHex(p) {
  33263. if (p.isInfinity()) return "00";
  33264. var xHex = p.getX().toBigInteger().toString(16);
  33265. var yHex = p.getY().toBigInteger().toString(16);
  33266. var oLen = this.getQ().toString(16).length;
  33267. if ((oLen % 2) != 0) oLen++;
  33268. while (xHex.length < oLen) {
  33269. xHex = "0" + xHex;
  33270. }
  33271. while (yHex.length < oLen) {
  33272. yHex = "0" + yHex;
  33273. }
  33274. return "04" + xHex + yHex;
  33275. }
  33276. ECCurveFp.prototype.getQ = curveFpGetQ;
  33277. ECCurveFp.prototype.getA = curveFpGetA;
  33278. ECCurveFp.prototype.getB = curveFpGetB;
  33279. ECCurveFp.prototype.equals = curveFpEquals;
  33280. ECCurveFp.prototype.getInfinity = curveFpGetInfinity;
  33281. ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger;
  33282. ECCurveFp.prototype.reduce = curveReduce;
  33283. //ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex;
  33284. ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex;
  33285. // from: https://github.com/kaielvin/jsbn-ec-point-compression
  33286. ECCurveFp.prototype.decodePointHex = function(s)
  33287. {
  33288. var yIsEven;
  33289. switch(parseInt(s.substr(0,2), 16)) { // first byte
  33290. case 0:
  33291. return this.infinity;
  33292. case 2:
  33293. yIsEven = false;
  33294. case 3:
  33295. if(yIsEven == undefined) yIsEven = true;
  33296. var len = s.length - 2;
  33297. var xHex = s.substr(2, len);
  33298. var x = this.fromBigInteger(new BigInteger(xHex,16));
  33299. var alpha = x.multiply(x.square().add(this.getA())).add(this.getB());
  33300. var beta = alpha.sqrt();
  33301. if (beta == null) throw "Invalid point compression";
  33302. var betaValue = beta.toBigInteger();
  33303. if (betaValue.testBit(0) != yIsEven)
  33304. {
  33305. // Use the other root
  33306. beta = this.fromBigInteger(this.getQ().subtract(betaValue));
  33307. }
  33308. return new ECPointFp(this,x,beta);
  33309. case 4:
  33310. case 6:
  33311. case 7:
  33312. var len = (s.length - 2) / 2;
  33313. var xHex = s.substr(2, len);
  33314. var yHex = s.substr(len+2, len);
  33315. return new ECPointFp(this,
  33316. this.fromBigInteger(new BigInteger(xHex, 16)),
  33317. this.fromBigInteger(new BigInteger(yHex, 16)));
  33318. default: // unsupported
  33319. return null;
  33320. }
  33321. }
  33322. ECCurveFp.prototype.encodeCompressedPointHex = function(p)
  33323. {
  33324. if (p.isInfinity()) return "00";
  33325. var xHex = p.getX().toBigInteger().toString(16);
  33326. var oLen = this.getQ().toString(16).length;
  33327. if ((oLen % 2) != 0) oLen++;
  33328. while (xHex.length < oLen)
  33329. xHex = "0" + xHex;
  33330. var yPrefix;
  33331. if(p.getY().toBigInteger().isEven()) yPrefix = "02";
  33332. else yPrefix = "03";
  33333. return yPrefix + xHex;
  33334. }
  33335. ECFieldElementFp.prototype.getR = function()
  33336. {
  33337. if(this.r != undefined) return this.r;
  33338. this.r = null;
  33339. var bitLength = this.q.bitLength();
  33340. if (bitLength > 128)
  33341. {
  33342. var firstWord = this.q.shiftRight(bitLength - 64);
  33343. if (firstWord.intValue() == -1)
  33344. {
  33345. this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q);
  33346. }
  33347. }
  33348. return this.r;
  33349. }
  33350. ECFieldElementFp.prototype.modMult = function(x1,x2)
  33351. {
  33352. return this.modReduce(x1.multiply(x2));
  33353. }
  33354. ECFieldElementFp.prototype.modReduce = function(x)
  33355. {
  33356. if (this.getR() != null)
  33357. {
  33358. var qLen = q.bitLength();
  33359. while (x.bitLength() > (qLen + 1))
  33360. {
  33361. var u = x.shiftRight(qLen);
  33362. var v = x.subtract(u.shiftLeft(qLen));
  33363. if (!this.getR().equals(BigInteger.ONE))
  33364. {
  33365. u = u.multiply(this.getR());
  33366. }
  33367. x = u.add(v);
  33368. }
  33369. while (x.compareTo(q) >= 0)
  33370. {
  33371. x = x.subtract(q);
  33372. }
  33373. }
  33374. else
  33375. {
  33376. x = x.mod(q);
  33377. }
  33378. return x;
  33379. }
  33380. ECFieldElementFp.prototype.sqrt = function()
  33381. {
  33382. if (!this.q.testBit(0)) throw "unsupported";
  33383. // p mod 4 == 3
  33384. if (this.q.testBit(1))
  33385. {
  33386. var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q));
  33387. return z.square().equals(this) ? z : null;
  33388. }
  33389. // p mod 4 == 1
  33390. var qMinusOne = this.q.subtract(BigInteger.ONE);
  33391. var legendreExponent = qMinusOne.shiftRight(1);
  33392. if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE)))
  33393. {
  33394. return null;
  33395. }
  33396. var u = qMinusOne.shiftRight(2);
  33397. var k = u.shiftLeft(1).add(BigInteger.ONE);
  33398. var Q = this.x;
  33399. var fourQ = modDouble(modDouble(Q));
  33400. var U, V;
  33401. do
  33402. {
  33403. var P;
  33404. do
  33405. {
  33406. P = new BigInteger(this.q.bitLength(), new SecureRandom());
  33407. }
  33408. while (P.compareTo(this.q) >= 0
  33409. || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne)));
  33410. var result = this.lucasSequence(P, Q, k);
  33411. U = result[0];
  33412. V = result[1];
  33413. if (this.modMult(V, V).equals(fourQ))
  33414. {
  33415. // Integer division by 2, mod q
  33416. if (V.testBit(0))
  33417. {
  33418. V = V.add(q);
  33419. }
  33420. V = V.shiftRight(1);
  33421. return new ECFieldElementFp(q,V);
  33422. }
  33423. }
  33424. while (U.equals(BigInteger.ONE) || U.equals(qMinusOne));
  33425. return null;
  33426. }
  33427. ECFieldElementFp.prototype.lucasSequence = function(P,Q,k)
  33428. {
  33429. var n = k.bitLength();
  33430. var s = k.getLowestSetBit();
  33431. var Uh = BigInteger.ONE;
  33432. var Vl = BigInteger.TWO;
  33433. var Vh = P;
  33434. var Ql = BigInteger.ONE;
  33435. var Qh = BigInteger.ONE;
  33436. for (var j = n - 1; j >= s + 1; --j)
  33437. {
  33438. Ql = this.modMult(Ql, Qh);
  33439. if (k.testBit(j))
  33440. {
  33441. Qh = this.modMult(Ql, Q);
  33442. Uh = this.modMult(Uh, Vh);
  33443. Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
  33444. Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1)));
  33445. }
  33446. else
  33447. {
  33448. Qh = Ql;
  33449. Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));
  33450. Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
  33451. Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));
  33452. }
  33453. }
  33454. Ql = this.modMult(Ql, Qh);
  33455. Qh = this.modMult(Ql, Q);
  33456. Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));
  33457. Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
  33458. Ql = this.modMult(Ql, Qh);
  33459. for (var j = 1; j <= s; ++j)
  33460. {
  33461. Uh = this.modMult(Uh, Vl);
  33462. Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));
  33463. Ql = this.modMult(Ql, Ql);
  33464. }
  33465. return [ Uh, Vl ];
  33466. }
  33467. var exports = {
  33468. ECCurveFp: ECCurveFp,
  33469. ECPointFp: ECPointFp,
  33470. ECFieldElementFp: ECFieldElementFp
  33471. }
  33472. module.exports = exports
  33473. /***/ }),
  33474. /* 131 */
  33475. /***/ (function(module, exports) {
  33476. module.exports = function(det, rec, confidence, name, lang) {
  33477. this.confidence = confidence;
  33478. this.name = name || rec.name(det);
  33479. this.lang = lang;
  33480. };
  33481. /***/ }),
  33482. /* 132 */
  33483. /***/ (function(module, exports, __webpack_require__) {
  33484. "use strict";
  33485. // YAML error class. http://stackoverflow.com/questions/8458984
  33486. //
  33487. function YAMLException(reason, mark) {
  33488. // Super constructor
  33489. Error.call(this);
  33490. this.name = 'YAMLException';
  33491. this.reason = reason;
  33492. this.mark = mark;
  33493. this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
  33494. // Include stack trace in error object
  33495. if (Error.captureStackTrace) {
  33496. // Chrome and NodeJS
  33497. Error.captureStackTrace(this, this.constructor);
  33498. } else {
  33499. // FF, IE 10+ and Safari 6+. Fallback for others
  33500. this.stack = (new Error()).stack || '';
  33501. }
  33502. }
  33503. // Inherit from Error
  33504. YAMLException.prototype = Object.create(Error.prototype);
  33505. YAMLException.prototype.constructor = YAMLException;
  33506. YAMLException.prototype.toString = function toString(compact) {
  33507. var result = this.name + ': ';
  33508. result += this.reason || '(unknown reason)';
  33509. if (!compact && this.mark) {
  33510. result += ' ' + this.mark.toString();
  33511. }
  33512. return result;
  33513. };
  33514. module.exports = YAMLException;
  33515. /***/ }),
  33516. /* 133 */
  33517. /***/ (function(module, exports, __webpack_require__) {
  33518. "use strict";
  33519. // JS-YAML's default schema for `safeLoad` function.
  33520. // It is not described in the YAML specification.
  33521. //
  33522. // This schema is based on standard YAML's Core schema and includes most of
  33523. // extra types described at YAML tag repository. (http://yaml.org/type/)
  33524. var Schema = __webpack_require__(108);
  33525. module.exports = new Schema({
  33526. include: [
  33527. __webpack_require__(368)
  33528. ],
  33529. implicit: [
  33530. __webpack_require__(814),
  33531. __webpack_require__(807)
  33532. ],
  33533. explicit: [
  33534. __webpack_require__(799),
  33535. __webpack_require__(809),
  33536. __webpack_require__(810),
  33537. __webpack_require__(812)
  33538. ]
  33539. });
  33540. /***/ }),
  33541. /* 134 */
  33542. /***/ (function(module, exports, __webpack_require__) {
  33543. var wrappy = __webpack_require__(436)
  33544. module.exports = wrappy(once)
  33545. module.exports.strict = wrappy(onceStrict)
  33546. once.proto = once(function () {
  33547. Object.defineProperty(Function.prototype, 'once', {
  33548. value: function () {
  33549. return once(this)
  33550. },
  33551. configurable: true
  33552. })
  33553. Object.defineProperty(Function.prototype, 'onceStrict', {
  33554. value: function () {
  33555. return onceStrict(this)
  33556. },
  33557. configurable: true
  33558. })
  33559. })
  33560. function once (fn) {
  33561. var f = function () {
  33562. if (f.called) return f.value
  33563. f.called = true
  33564. return f.value = fn.apply(this, arguments)
  33565. }
  33566. f.called = false
  33567. return f
  33568. }
  33569. function onceStrict (fn) {
  33570. var f = function () {
  33571. if (f.called)
  33572. throw new Error(f.onceError)
  33573. f.called = true
  33574. return f.value = fn.apply(this, arguments)
  33575. }
  33576. var name = fn.name || 'Function wrapped with `once`'
  33577. f.onceError = name + " shouldn't be called more than once"
  33578. f.called = false
  33579. return f
  33580. }
  33581. /***/ }),
  33582. /* 135 */
  33583. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33584. "use strict";
  33585. /* harmony export (immutable) */ __webpack_exports__["a"] = defaultIfEmpty;
  33586. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  33587. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  33588. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  33589. function defaultIfEmpty(defaultValue) {
  33590. if (defaultValue === void 0) {
  33591. defaultValue = null;
  33592. }
  33593. return function (source) { return source.lift(new DefaultIfEmptyOperator(defaultValue)); };
  33594. }
  33595. var DefaultIfEmptyOperator = /*@__PURE__*/ (function () {
  33596. function DefaultIfEmptyOperator(defaultValue) {
  33597. this.defaultValue = defaultValue;
  33598. }
  33599. DefaultIfEmptyOperator.prototype.call = function (subscriber, source) {
  33600. return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));
  33601. };
  33602. return DefaultIfEmptyOperator;
  33603. }());
  33604. var DefaultIfEmptySubscriber = /*@__PURE__*/ (function (_super) {
  33605. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DefaultIfEmptySubscriber, _super);
  33606. function DefaultIfEmptySubscriber(destination, defaultValue) {
  33607. var _this = _super.call(this, destination) || this;
  33608. _this.defaultValue = defaultValue;
  33609. _this.isEmpty = true;
  33610. return _this;
  33611. }
  33612. DefaultIfEmptySubscriber.prototype._next = function (value) {
  33613. this.isEmpty = false;
  33614. this.destination.next(value);
  33615. };
  33616. DefaultIfEmptySubscriber.prototype._complete = function () {
  33617. if (this.isEmpty) {
  33618. this.destination.next(this.defaultValue);
  33619. }
  33620. this.destination.complete();
  33621. };
  33622. return DefaultIfEmptySubscriber;
  33623. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  33624. //# sourceMappingURL=defaultIfEmpty.js.map
  33625. /***/ }),
  33626. /* 136 */
  33627. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33628. "use strict";
  33629. /* harmony export (immutable) */ __webpack_exports__["a"] = filter;
  33630. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  33631. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  33632. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  33633. function filter(predicate, thisArg) {
  33634. return function filterOperatorFunction(source) {
  33635. return source.lift(new FilterOperator(predicate, thisArg));
  33636. };
  33637. }
  33638. var FilterOperator = /*@__PURE__*/ (function () {
  33639. function FilterOperator(predicate, thisArg) {
  33640. this.predicate = predicate;
  33641. this.thisArg = thisArg;
  33642. }
  33643. FilterOperator.prototype.call = function (subscriber, source) {
  33644. return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
  33645. };
  33646. return FilterOperator;
  33647. }());
  33648. var FilterSubscriber = /*@__PURE__*/ (function (_super) {
  33649. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](FilterSubscriber, _super);
  33650. function FilterSubscriber(destination, predicate, thisArg) {
  33651. var _this = _super.call(this, destination) || this;
  33652. _this.predicate = predicate;
  33653. _this.thisArg = thisArg;
  33654. _this.count = 0;
  33655. return _this;
  33656. }
  33657. FilterSubscriber.prototype._next = function (value) {
  33658. var result;
  33659. try {
  33660. result = this.predicate.call(this.thisArg, value, this.count++);
  33661. }
  33662. catch (err) {
  33663. this.destination.error(err);
  33664. return;
  33665. }
  33666. if (result) {
  33667. this.destination.next(value);
  33668. }
  33669. };
  33670. return FilterSubscriber;
  33671. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  33672. //# sourceMappingURL=filter.js.map
  33673. /***/ }),
  33674. /* 137 */
  33675. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33676. "use strict";
  33677. /* harmony export (immutable) */ __webpack_exports__["a"] = mergeMap;
  33678. /* unused harmony export MergeMapOperator */
  33679. /* unused harmony export MergeMapSubscriber */
  33680. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  33681. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_subscribeToResult__ = __webpack_require__(19);
  33682. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__ = __webpack_require__(18);
  33683. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__InnerSubscriber__ = __webpack_require__(80);
  33684. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(54);
  33685. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(64);
  33686. /** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber,_map,_observable_from PURE_IMPORTS_END */
  33687. function mergeMap(project, resultSelector, concurrent) {
  33688. if (concurrent === void 0) {
  33689. concurrent = Number.POSITIVE_INFINITY;
  33690. }
  33691. if (typeof resultSelector === 'function') {
  33692. return function (source) { return source.pipe(mergeMap(function (a, i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__observable_from__["a" /* from */])(project(a, i)).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__map__["a" /* map */])(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); };
  33693. }
  33694. else if (typeof resultSelector === 'number') {
  33695. concurrent = resultSelector;
  33696. }
  33697. return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); };
  33698. }
  33699. var MergeMapOperator = /*@__PURE__*/ (function () {
  33700. function MergeMapOperator(project, concurrent) {
  33701. if (concurrent === void 0) {
  33702. concurrent = Number.POSITIVE_INFINITY;
  33703. }
  33704. this.project = project;
  33705. this.concurrent = concurrent;
  33706. }
  33707. MergeMapOperator.prototype.call = function (observer, source) {
  33708. return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));
  33709. };
  33710. return MergeMapOperator;
  33711. }());
  33712. var MergeMapSubscriber = /*@__PURE__*/ (function (_super) {
  33713. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MergeMapSubscriber, _super);
  33714. function MergeMapSubscriber(destination, project, concurrent) {
  33715. if (concurrent === void 0) {
  33716. concurrent = Number.POSITIVE_INFINITY;
  33717. }
  33718. var _this = _super.call(this, destination) || this;
  33719. _this.project = project;
  33720. _this.concurrent = concurrent;
  33721. _this.hasCompleted = false;
  33722. _this.buffer = [];
  33723. _this.active = 0;
  33724. _this.index = 0;
  33725. return _this;
  33726. }
  33727. MergeMapSubscriber.prototype._next = function (value) {
  33728. if (this.active < this.concurrent) {
  33729. this._tryNext(value);
  33730. }
  33731. else {
  33732. this.buffer.push(value);
  33733. }
  33734. };
  33735. MergeMapSubscriber.prototype._tryNext = function (value) {
  33736. var result;
  33737. var index = this.index++;
  33738. try {
  33739. result = this.project(value, index);
  33740. }
  33741. catch (err) {
  33742. this.destination.error(err);
  33743. return;
  33744. }
  33745. this.active++;
  33746. this._innerSub(result, value, index);
  33747. };
  33748. MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {
  33749. var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_3__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
  33750. var destination = this.destination;
  33751. destination.add(innerSubscriber);
  33752. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_subscribeToResult__["a" /* subscribeToResult */])(this, ish, value, index, innerSubscriber);
  33753. };
  33754. MergeMapSubscriber.prototype._complete = function () {
  33755. this.hasCompleted = true;
  33756. if (this.active === 0 && this.buffer.length === 0) {
  33757. this.destination.complete();
  33758. }
  33759. this.unsubscribe();
  33760. };
  33761. MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  33762. this.destination.next(innerValue);
  33763. };
  33764. MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {
  33765. var buffer = this.buffer;
  33766. this.remove(innerSub);
  33767. this.active--;
  33768. if (buffer.length > 0) {
  33769. this._next(buffer.shift());
  33770. }
  33771. else if (this.active === 0 && this.hasCompleted) {
  33772. this.destination.complete();
  33773. }
  33774. };
  33775. return MergeMapSubscriber;
  33776. }(__WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__["a" /* OuterSubscriber */]));
  33777. //# sourceMappingURL=mergeMap.js.map
  33778. /***/ }),
  33779. /* 138 */
  33780. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33781. "use strict";
  33782. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncAction; });
  33783. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  33784. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Action__ = __webpack_require__(991);
  33785. /** PURE_IMPORTS_START tslib,_Action PURE_IMPORTS_END */
  33786. var AsyncAction = /*@__PURE__*/ (function (_super) {
  33787. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncAction, _super);
  33788. function AsyncAction(scheduler, work) {
  33789. var _this = _super.call(this, scheduler, work) || this;
  33790. _this.scheduler = scheduler;
  33791. _this.work = work;
  33792. _this.pending = false;
  33793. return _this;
  33794. }
  33795. AsyncAction.prototype.schedule = function (state, delay) {
  33796. if (delay === void 0) {
  33797. delay = 0;
  33798. }
  33799. if (this.closed) {
  33800. return this;
  33801. }
  33802. this.state = state;
  33803. var id = this.id;
  33804. var scheduler = this.scheduler;
  33805. if (id != null) {
  33806. this.id = this.recycleAsyncId(scheduler, id, delay);
  33807. }
  33808. this.pending = true;
  33809. this.delay = delay;
  33810. this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
  33811. return this;
  33812. };
  33813. AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {
  33814. if (delay === void 0) {
  33815. delay = 0;
  33816. }
  33817. return setInterval(scheduler.flush.bind(scheduler, this), delay);
  33818. };
  33819. AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
  33820. if (delay === void 0) {
  33821. delay = 0;
  33822. }
  33823. if (delay !== null && this.delay === delay && this.pending === false) {
  33824. return id;
  33825. }
  33826. clearInterval(id);
  33827. };
  33828. AsyncAction.prototype.execute = function (state, delay) {
  33829. if (this.closed) {
  33830. return new Error('executing a cancelled action');
  33831. }
  33832. this.pending = false;
  33833. var error = this._execute(state, delay);
  33834. if (error) {
  33835. return error;
  33836. }
  33837. else if (this.pending === false && this.id != null) {
  33838. this.id = this.recycleAsyncId(this.scheduler, this.id, null);
  33839. }
  33840. };
  33841. AsyncAction.prototype._execute = function (state, delay) {
  33842. var errored = false;
  33843. var errorValue = undefined;
  33844. try {
  33845. this.work(state);
  33846. }
  33847. catch (e) {
  33848. errored = true;
  33849. errorValue = !!e && e || new Error(e);
  33850. }
  33851. if (errored) {
  33852. this.unsubscribe();
  33853. return errorValue;
  33854. }
  33855. };
  33856. AsyncAction.prototype._unsubscribe = function () {
  33857. var id = this.id;
  33858. var scheduler = this.scheduler;
  33859. var actions = scheduler.actions;
  33860. var index = actions.indexOf(this);
  33861. this.work = null;
  33862. this.state = null;
  33863. this.pending = false;
  33864. this.scheduler = null;
  33865. if (index !== -1) {
  33866. actions.splice(index, 1);
  33867. }
  33868. if (id != null) {
  33869. this.id = this.recycleAsyncId(scheduler, id, null);
  33870. }
  33871. this.delay = null;
  33872. };
  33873. return AsyncAction;
  33874. }(__WEBPACK_IMPORTED_MODULE_1__Action__["a" /* Action */]));
  33875. //# sourceMappingURL=AsyncAction.js.map
  33876. /***/ }),
  33877. /* 139 */
  33878. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33879. "use strict";
  33880. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncScheduler; });
  33881. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  33882. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Scheduler__ = __webpack_require__(391);
  33883. /** PURE_IMPORTS_START tslib,_Scheduler PURE_IMPORTS_END */
  33884. var AsyncScheduler = /*@__PURE__*/ (function (_super) {
  33885. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncScheduler, _super);
  33886. function AsyncScheduler(SchedulerAction, now) {
  33887. if (now === void 0) {
  33888. now = __WEBPACK_IMPORTED_MODULE_1__Scheduler__["a" /* Scheduler */].now;
  33889. }
  33890. var _this = _super.call(this, SchedulerAction, function () {
  33891. if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) {
  33892. return AsyncScheduler.delegate.now();
  33893. }
  33894. else {
  33895. return now();
  33896. }
  33897. }) || this;
  33898. _this.actions = [];
  33899. _this.active = false;
  33900. _this.scheduled = undefined;
  33901. return _this;
  33902. }
  33903. AsyncScheduler.prototype.schedule = function (work, delay, state) {
  33904. if (delay === void 0) {
  33905. delay = 0;
  33906. }
  33907. if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
  33908. return AsyncScheduler.delegate.schedule(work, delay, state);
  33909. }
  33910. else {
  33911. return _super.prototype.schedule.call(this, work, delay, state);
  33912. }
  33913. };
  33914. AsyncScheduler.prototype.flush = function (action) {
  33915. var actions = this.actions;
  33916. if (this.active) {
  33917. actions.push(action);
  33918. return;
  33919. }
  33920. var error;
  33921. this.active = true;
  33922. do {
  33923. if (error = action.execute(action.state, action.delay)) {
  33924. break;
  33925. }
  33926. } while (action = actions.shift());
  33927. this.active = false;
  33928. if (error) {
  33929. while (action = actions.shift()) {
  33930. action.unsubscribe();
  33931. }
  33932. throw error;
  33933. }
  33934. };
  33935. return AsyncScheduler;
  33936. }(__WEBPACK_IMPORTED_MODULE_1__Scheduler__["a" /* Scheduler */]));
  33937. //# sourceMappingURL=AsyncScheduler.js.map
  33938. /***/ }),
  33939. /* 140 */
  33940. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33941. "use strict";
  33942. /* unused harmony export getSymbolIterator */
  33943. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return iterator; });
  33944. /* unused harmony export $$iterator */
  33945. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  33946. function getSymbolIterator() {
  33947. if (typeof Symbol !== 'function' || !Symbol.iterator) {
  33948. return '@@iterator';
  33949. }
  33950. return Symbol.iterator;
  33951. }
  33952. var iterator = /*@__PURE__*/ getSymbolIterator();
  33953. var $$iterator = iterator;
  33954. //# sourceMappingURL=iterator.js.map
  33955. /***/ }),
  33956. /* 141 */
  33957. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33958. "use strict";
  33959. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArgumentOutOfRangeError; });
  33960. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  33961. function ArgumentOutOfRangeErrorImpl() {
  33962. Error.call(this);
  33963. this.message = 'argument out of range';
  33964. this.name = 'ArgumentOutOfRangeError';
  33965. return this;
  33966. }
  33967. ArgumentOutOfRangeErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
  33968. var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl;
  33969. //# sourceMappingURL=ArgumentOutOfRangeError.js.map
  33970. /***/ }),
  33971. /* 142 */
  33972. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33973. "use strict";
  33974. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EmptyError; });
  33975. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  33976. function EmptyErrorImpl() {
  33977. Error.call(this);
  33978. this.message = 'no elements in sequence';
  33979. this.name = 'EmptyError';
  33980. return this;
  33981. }
  33982. EmptyErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
  33983. var EmptyError = EmptyErrorImpl;
  33984. //# sourceMappingURL=EmptyError.js.map
  33985. /***/ }),
  33986. /* 143 */
  33987. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33988. "use strict";
  33989. /* harmony export (immutable) */ __webpack_exports__["a"] = isFunction;
  33990. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  33991. function isFunction(x) {
  33992. return typeof x === 'function';
  33993. }
  33994. //# sourceMappingURL=isFunction.js.map
  33995. /***/ }),
  33996. /* 144 */
  33997. /***/ (function(module, exports, __webpack_require__) {
  33998. // Copyright 2016 Joyent, Inc.
  33999. module.exports = Certificate;
  34000. var assert = __webpack_require__(22);
  34001. var Buffer = __webpack_require__(20).Buffer;
  34002. var algs = __webpack_require__(39);
  34003. var crypto = __webpack_require__(21);
  34004. var Fingerprint = __webpack_require__(145);
  34005. var Signature = __webpack_require__(71);
  34006. var errs = __webpack_require__(70);
  34007. var util = __webpack_require__(9);
  34008. var utils = __webpack_require__(32);
  34009. var Key = __webpack_require__(35);
  34010. var PrivateKey = __webpack_require__(40);
  34011. var Identity = __webpack_require__(147);
  34012. var formats = {};
  34013. formats['openssh'] = __webpack_require__(1013);
  34014. formats['x509'] = __webpack_require__(427);
  34015. formats['pem'] = __webpack_require__(1014);
  34016. var CertificateParseError = errs.CertificateParseError;
  34017. var InvalidAlgorithmError = errs.InvalidAlgorithmError;
  34018. function Certificate(opts) {
  34019. assert.object(opts, 'options');
  34020. assert.arrayOfObject(opts.subjects, 'options.subjects');
  34021. utils.assertCompatible(opts.subjects[0], Identity, [1, 0],
  34022. 'options.subjects');
  34023. utils.assertCompatible(opts.subjectKey, Key, [1, 0],
  34024. 'options.subjectKey');
  34025. utils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer');
  34026. if (opts.issuerKey !== undefined) {
  34027. utils.assertCompatible(opts.issuerKey, Key, [1, 0],
  34028. 'options.issuerKey');
  34029. }
  34030. assert.object(opts.signatures, 'options.signatures');
  34031. assert.buffer(opts.serial, 'options.serial');
  34032. assert.date(opts.validFrom, 'options.validFrom');
  34033. assert.date(opts.validUntil, 'optons.validUntil');
  34034. assert.optionalArrayOfString(opts.purposes, 'options.purposes');
  34035. this._hashCache = {};
  34036. this.subjects = opts.subjects;
  34037. this.issuer = opts.issuer;
  34038. this.subjectKey = opts.subjectKey;
  34039. this.issuerKey = opts.issuerKey;
  34040. this.signatures = opts.signatures;
  34041. this.serial = opts.serial;
  34042. this.validFrom = opts.validFrom;
  34043. this.validUntil = opts.validUntil;
  34044. this.purposes = opts.purposes;
  34045. }
  34046. Certificate.formats = formats;
  34047. Certificate.prototype.toBuffer = function (format, options) {
  34048. if (format === undefined)
  34049. format = 'x509';
  34050. assert.string(format, 'format');
  34051. assert.object(formats[format], 'formats[format]');
  34052. assert.optionalObject(options, 'options');
  34053. return (formats[format].write(this, options));
  34054. };
  34055. Certificate.prototype.toString = function (format, options) {
  34056. if (format === undefined)
  34057. format = 'pem';
  34058. return (this.toBuffer(format, options).toString());
  34059. };
  34060. Certificate.prototype.fingerprint = function (algo) {
  34061. if (algo === undefined)
  34062. algo = 'sha256';
  34063. assert.string(algo, 'algorithm');
  34064. var opts = {
  34065. type: 'certificate',
  34066. hash: this.hash(algo),
  34067. algorithm: algo
  34068. };
  34069. return (new Fingerprint(opts));
  34070. };
  34071. Certificate.prototype.hash = function (algo) {
  34072. assert.string(algo, 'algorithm');
  34073. algo = algo.toLowerCase();
  34074. if (algs.hashAlgs[algo] === undefined)
  34075. throw (new InvalidAlgorithmError(algo));
  34076. if (this._hashCache[algo])
  34077. return (this._hashCache[algo]);
  34078. var hash = crypto.createHash(algo).
  34079. update(this.toBuffer('x509')).digest();
  34080. this._hashCache[algo] = hash;
  34081. return (hash);
  34082. };
  34083. Certificate.prototype.isExpired = function (when) {
  34084. if (when === undefined)
  34085. when = new Date();
  34086. return (!((when.getTime() >= this.validFrom.getTime()) &&
  34087. (when.getTime() < this.validUntil.getTime())));
  34088. };
  34089. Certificate.prototype.isSignedBy = function (issuerCert) {
  34090. utils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer');
  34091. if (!this.issuer.equals(issuerCert.subjects[0]))
  34092. return (false);
  34093. if (this.issuer.purposes && this.issuer.purposes.length > 0 &&
  34094. this.issuer.purposes.indexOf('ca') === -1) {
  34095. return (false);
  34096. }
  34097. return (this.isSignedByKey(issuerCert.subjectKey));
  34098. };
  34099. Certificate.prototype.isSignedByKey = function (issuerKey) {
  34100. utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey');
  34101. if (this.issuerKey !== undefined) {
  34102. return (this.issuerKey.
  34103. fingerprint('sha512').matches(issuerKey));
  34104. }
  34105. var fmt = Object.keys(this.signatures)[0];
  34106. var valid = formats[fmt].verify(this, issuerKey);
  34107. if (valid)
  34108. this.issuerKey = issuerKey;
  34109. return (valid);
  34110. };
  34111. Certificate.prototype.signWith = function (key) {
  34112. utils.assertCompatible(key, PrivateKey, [1, 2], 'key');
  34113. var fmts = Object.keys(formats);
  34114. var didOne = false;
  34115. for (var i = 0; i < fmts.length; ++i) {
  34116. if (fmts[i] !== 'pem') {
  34117. var ret = formats[fmts[i]].sign(this, key);
  34118. if (ret === true)
  34119. didOne = true;
  34120. }
  34121. }
  34122. if (!didOne) {
  34123. throw (new Error('Failed to sign the certificate for any ' +
  34124. 'available certificate formats'));
  34125. }
  34126. };
  34127. Certificate.createSelfSigned = function (subjectOrSubjects, key, options) {
  34128. var subjects;
  34129. if (Array.isArray(subjectOrSubjects))
  34130. subjects = subjectOrSubjects;
  34131. else
  34132. subjects = [subjectOrSubjects];
  34133. assert.arrayOfObject(subjects);
  34134. subjects.forEach(function (subject) {
  34135. utils.assertCompatible(subject, Identity, [1, 0], 'subject');
  34136. });
  34137. utils.assertCompatible(key, PrivateKey, [1, 2], 'private key');
  34138. assert.optionalObject(options, 'options');
  34139. if (options === undefined)
  34140. options = {};
  34141. assert.optionalObject(options.validFrom, 'options.validFrom');
  34142. assert.optionalObject(options.validUntil, 'options.validUntil');
  34143. var validFrom = options.validFrom;
  34144. var validUntil = options.validUntil;
  34145. if (validFrom === undefined)
  34146. validFrom = new Date();
  34147. if (validUntil === undefined) {
  34148. assert.optionalNumber(options.lifetime, 'options.lifetime');
  34149. var lifetime = options.lifetime;
  34150. if (lifetime === undefined)
  34151. lifetime = 10*365*24*3600;
  34152. validUntil = new Date();
  34153. validUntil.setTime(validUntil.getTime() + lifetime*1000);
  34154. }
  34155. assert.optionalBuffer(options.serial, 'options.serial');
  34156. var serial = options.serial;
  34157. if (serial === undefined)
  34158. serial = Buffer.from('0000000000000001', 'hex');
  34159. var purposes = options.purposes;
  34160. if (purposes === undefined)
  34161. purposes = [];
  34162. if (purposes.indexOf('signature') === -1)
  34163. purposes.push('signature');
  34164. /* Self-signed certs are always CAs. */
  34165. if (purposes.indexOf('ca') === -1)
  34166. purposes.push('ca');
  34167. if (purposes.indexOf('crl') === -1)
  34168. purposes.push('crl');
  34169. /*
  34170. * If we weren't explicitly given any other purposes, do the sensible
  34171. * thing and add some basic ones depending on the subject type.
  34172. */
  34173. if (purposes.length <= 3) {
  34174. var hostSubjects = subjects.filter(function (subject) {
  34175. return (subject.type === 'host');
  34176. });
  34177. var userSubjects = subjects.filter(function (subject) {
  34178. return (subject.type === 'user');
  34179. });
  34180. if (hostSubjects.length > 0) {
  34181. if (purposes.indexOf('serverAuth') === -1)
  34182. purposes.push('serverAuth');
  34183. }
  34184. if (userSubjects.length > 0) {
  34185. if (purposes.indexOf('clientAuth') === -1)
  34186. purposes.push('clientAuth');
  34187. }
  34188. if (userSubjects.length > 0 || hostSubjects.length > 0) {
  34189. if (purposes.indexOf('keyAgreement') === -1)
  34190. purposes.push('keyAgreement');
  34191. if (key.type === 'rsa' &&
  34192. purposes.indexOf('encryption') === -1)
  34193. purposes.push('encryption');
  34194. }
  34195. }
  34196. var cert = new Certificate({
  34197. subjects: subjects,
  34198. issuer: subjects[0],
  34199. subjectKey: key.toPublic(),
  34200. issuerKey: key.toPublic(),
  34201. signatures: {},
  34202. serial: serial,
  34203. validFrom: validFrom,
  34204. validUntil: validUntil,
  34205. purposes: purposes
  34206. });
  34207. cert.signWith(key);
  34208. return (cert);
  34209. };
  34210. Certificate.create =
  34211. function (subjectOrSubjects, key, issuer, issuerKey, options) {
  34212. var subjects;
  34213. if (Array.isArray(subjectOrSubjects))
  34214. subjects = subjectOrSubjects;
  34215. else
  34216. subjects = [subjectOrSubjects];
  34217. assert.arrayOfObject(subjects);
  34218. subjects.forEach(function (subject) {
  34219. utils.assertCompatible(subject, Identity, [1, 0], 'subject');
  34220. });
  34221. utils.assertCompatible(key, Key, [1, 0], 'key');
  34222. if (PrivateKey.isPrivateKey(key))
  34223. key = key.toPublic();
  34224. utils.assertCompatible(issuer, Identity, [1, 0], 'issuer');
  34225. utils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key');
  34226. assert.optionalObject(options, 'options');
  34227. if (options === undefined)
  34228. options = {};
  34229. assert.optionalObject(options.validFrom, 'options.validFrom');
  34230. assert.optionalObject(options.validUntil, 'options.validUntil');
  34231. var validFrom = options.validFrom;
  34232. var validUntil = options.validUntil;
  34233. if (validFrom === undefined)
  34234. validFrom = new Date();
  34235. if (validUntil === undefined) {
  34236. assert.optionalNumber(options.lifetime, 'options.lifetime');
  34237. var lifetime = options.lifetime;
  34238. if (lifetime === undefined)
  34239. lifetime = 10*365*24*3600;
  34240. validUntil = new Date();
  34241. validUntil.setTime(validUntil.getTime() + lifetime*1000);
  34242. }
  34243. assert.optionalBuffer(options.serial, 'options.serial');
  34244. var serial = options.serial;
  34245. if (serial === undefined)
  34246. serial = Buffer.from('0000000000000001', 'hex');
  34247. var purposes = options.purposes;
  34248. if (purposes === undefined)
  34249. purposes = [];
  34250. if (purposes.indexOf('signature') === -1)
  34251. purposes.push('signature');
  34252. if (options.ca === true) {
  34253. if (purposes.indexOf('ca') === -1)
  34254. purposes.push('ca');
  34255. if (purposes.indexOf('crl') === -1)
  34256. purposes.push('crl');
  34257. }
  34258. var hostSubjects = subjects.filter(function (subject) {
  34259. return (subject.type === 'host');
  34260. });
  34261. var userSubjects = subjects.filter(function (subject) {
  34262. return (subject.type === 'user');
  34263. });
  34264. if (hostSubjects.length > 0) {
  34265. if (purposes.indexOf('serverAuth') === -1)
  34266. purposes.push('serverAuth');
  34267. }
  34268. if (userSubjects.length > 0) {
  34269. if (purposes.indexOf('clientAuth') === -1)
  34270. purposes.push('clientAuth');
  34271. }
  34272. if (userSubjects.length > 0 || hostSubjects.length > 0) {
  34273. if (purposes.indexOf('keyAgreement') === -1)
  34274. purposes.push('keyAgreement');
  34275. if (key.type === 'rsa' &&
  34276. purposes.indexOf('encryption') === -1)
  34277. purposes.push('encryption');
  34278. }
  34279. var cert = new Certificate({
  34280. subjects: subjects,
  34281. issuer: issuer,
  34282. subjectKey: key,
  34283. issuerKey: issuerKey.toPublic(),
  34284. signatures: {},
  34285. serial: serial,
  34286. validFrom: validFrom,
  34287. validUntil: validUntil,
  34288. purposes: purposes
  34289. });
  34290. cert.signWith(issuerKey);
  34291. return (cert);
  34292. };
  34293. Certificate.parse = function (data, format, options) {
  34294. if (typeof (data) !== 'string')
  34295. assert.buffer(data, 'data');
  34296. if (format === undefined)
  34297. format = 'auto';
  34298. assert.string(format, 'format');
  34299. if (typeof (options) === 'string')
  34300. options = { filename: options };
  34301. assert.optionalObject(options, 'options');
  34302. if (options === undefined)
  34303. options = {};
  34304. assert.optionalString(options.filename, 'options.filename');
  34305. if (options.filename === undefined)
  34306. options.filename = '(unnamed)';
  34307. assert.object(formats[format], 'formats[format]');
  34308. try {
  34309. var k = formats[format].read(data, options);
  34310. return (k);
  34311. } catch (e) {
  34312. throw (new CertificateParseError(options.filename, format, e));
  34313. }
  34314. };
  34315. Certificate.isCertificate = function (obj, ver) {
  34316. return (utils.isCompatible(obj, Certificate, ver));
  34317. };
  34318. /*
  34319. * API versions for Certificate:
  34320. * [1,0] -- initial ver
  34321. */
  34322. Certificate.prototype._sshpkApiVersion = [1, 0];
  34323. Certificate._oldVersionDetect = function (obj) {
  34324. return ([1, 0]);
  34325. };
  34326. /***/ }),
  34327. /* 145 */
  34328. /***/ (function(module, exports, __webpack_require__) {
  34329. // Copyright 2015 Joyent, Inc.
  34330. module.exports = Fingerprint;
  34331. var assert = __webpack_require__(22);
  34332. var Buffer = __webpack_require__(20).Buffer;
  34333. var algs = __webpack_require__(39);
  34334. var crypto = __webpack_require__(21);
  34335. var errs = __webpack_require__(70);
  34336. var Key = __webpack_require__(35);
  34337. var Certificate = __webpack_require__(144);
  34338. var utils = __webpack_require__(32);
  34339. var FingerprintFormatError = errs.FingerprintFormatError;
  34340. var InvalidAlgorithmError = errs.InvalidAlgorithmError;
  34341. function Fingerprint(opts) {
  34342. assert.object(opts, 'options');
  34343. assert.string(opts.type, 'options.type');
  34344. assert.buffer(opts.hash, 'options.hash');
  34345. assert.string(opts.algorithm, 'options.algorithm');
  34346. this.algorithm = opts.algorithm.toLowerCase();
  34347. if (algs.hashAlgs[this.algorithm] !== true)
  34348. throw (new InvalidAlgorithmError(this.algorithm));
  34349. this.hash = opts.hash;
  34350. this.type = opts.type;
  34351. }
  34352. Fingerprint.prototype.toString = function (format) {
  34353. if (format === undefined) {
  34354. if (this.algorithm === 'md5')
  34355. format = 'hex';
  34356. else
  34357. format = 'base64';
  34358. }
  34359. assert.string(format);
  34360. switch (format) {
  34361. case 'hex':
  34362. return (addColons(this.hash.toString('hex')));
  34363. case 'base64':
  34364. return (sshBase64Format(this.algorithm,
  34365. this.hash.toString('base64')));
  34366. default:
  34367. throw (new FingerprintFormatError(undefined, format));
  34368. }
  34369. };
  34370. Fingerprint.prototype.matches = function (other) {
  34371. assert.object(other, 'key or certificate');
  34372. if (this.type === 'key') {
  34373. utils.assertCompatible(other, Key, [1, 0], 'key');
  34374. } else {
  34375. utils.assertCompatible(other, Certificate, [1, 0],
  34376. 'certificate');
  34377. }
  34378. var theirHash = other.hash(this.algorithm);
  34379. var theirHash2 = crypto.createHash(this.algorithm).
  34380. update(theirHash).digest('base64');
  34381. if (this.hash2 === undefined)
  34382. this.hash2 = crypto.createHash(this.algorithm).
  34383. update(this.hash).digest('base64');
  34384. return (this.hash2 === theirHash2);
  34385. };
  34386. Fingerprint.parse = function (fp, options) {
  34387. assert.string(fp, 'fingerprint');
  34388. var alg, hash, enAlgs;
  34389. if (Array.isArray(options)) {
  34390. enAlgs = options;
  34391. options = {};
  34392. }
  34393. assert.optionalObject(options, 'options');
  34394. if (options === undefined)
  34395. options = {};
  34396. if (options.enAlgs !== undefined)
  34397. enAlgs = options.enAlgs;
  34398. assert.optionalArrayOfString(enAlgs, 'algorithms');
  34399. var parts = fp.split(':');
  34400. if (parts.length == 2) {
  34401. alg = parts[0].toLowerCase();
  34402. /*JSSTYLED*/
  34403. var base64RE = /^[A-Za-z0-9+\/=]+$/;
  34404. if (!base64RE.test(parts[1]))
  34405. throw (new FingerprintFormatError(fp));
  34406. try {
  34407. hash = Buffer.from(parts[1], 'base64');
  34408. } catch (e) {
  34409. throw (new FingerprintFormatError(fp));
  34410. }
  34411. } else if (parts.length > 2) {
  34412. alg = 'md5';
  34413. if (parts[0].toLowerCase() === 'md5')
  34414. parts = parts.slice(1);
  34415. parts = parts.join('');
  34416. /*JSSTYLED*/
  34417. var md5RE = /^[a-fA-F0-9]+$/;
  34418. if (!md5RE.test(parts))
  34419. throw (new FingerprintFormatError(fp));
  34420. try {
  34421. hash = Buffer.from(parts, 'hex');
  34422. } catch (e) {
  34423. throw (new FingerprintFormatError(fp));
  34424. }
  34425. }
  34426. if (alg === undefined)
  34427. throw (new FingerprintFormatError(fp));
  34428. if (algs.hashAlgs[alg] === undefined)
  34429. throw (new InvalidAlgorithmError(alg));
  34430. if (enAlgs !== undefined) {
  34431. enAlgs = enAlgs.map(function (a) { return a.toLowerCase(); });
  34432. if (enAlgs.indexOf(alg) === -1)
  34433. throw (new InvalidAlgorithmError(alg));
  34434. }
  34435. return (new Fingerprint({
  34436. algorithm: alg,
  34437. hash: hash,
  34438. type: options.type || 'key'
  34439. }));
  34440. };
  34441. function addColons(s) {
  34442. /*JSSTYLED*/
  34443. return (s.replace(/(.{2})(?=.)/g, '$1:'));
  34444. }
  34445. function base64Strip(s) {
  34446. /*JSSTYLED*/
  34447. return (s.replace(/=*$/, ''));
  34448. }
  34449. function sshBase64Format(alg, h) {
  34450. return (alg.toUpperCase() + ':' + base64Strip(h));
  34451. }
  34452. Fingerprint.isFingerprint = function (obj, ver) {
  34453. return (utils.isCompatible(obj, Fingerprint, ver));
  34454. };
  34455. /*
  34456. * API versions for Fingerprint:
  34457. * [1,0] -- initial ver
  34458. * [1,1] -- first tagged ver
  34459. */
  34460. Fingerprint.prototype._sshpkApiVersion = [1, 1];
  34461. Fingerprint._oldVersionDetect = function (obj) {
  34462. assert.func(obj.toString);
  34463. assert.func(obj.matches);
  34464. return ([1, 0]);
  34465. };
  34466. /***/ }),
  34467. /* 146 */
  34468. /***/ (function(module, exports, __webpack_require__) {
  34469. // Copyright 2015 Joyent, Inc.
  34470. module.exports = {
  34471. read: read,
  34472. readPkcs8: readPkcs8,
  34473. write: write,
  34474. writePkcs8: writePkcs8,
  34475. readECDSACurve: readECDSACurve,
  34476. writeECDSACurve: writeECDSACurve
  34477. };
  34478. var assert = __webpack_require__(22);
  34479. var asn1 = __webpack_require__(67);
  34480. var Buffer = __webpack_require__(20).Buffer;
  34481. var algs = __webpack_require__(39);
  34482. var utils = __webpack_require__(32);
  34483. var Key = __webpack_require__(35);
  34484. var PrivateKey = __webpack_require__(40);
  34485. var pem = __webpack_require__(82);
  34486. function read(buf, options) {
  34487. return (pem.read(buf, options, 'pkcs8'));
  34488. }
  34489. function write(key, options) {
  34490. return (pem.write(key, options, 'pkcs8'));
  34491. }
  34492. /* Helper to read in a single mpint */
  34493. function readMPInt(der, nm) {
  34494. assert.strictEqual(der.peek(), asn1.Ber.Integer,
  34495. nm + ' is not an Integer');
  34496. return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));
  34497. }
  34498. function readPkcs8(alg, type, der) {
  34499. /* Private keys in pkcs#8 format have a weird extra int */
  34500. if (der.peek() === asn1.Ber.Integer) {
  34501. assert.strictEqual(type, 'private',
  34502. 'unexpected Integer at start of public key');
  34503. der.readString(asn1.Ber.Integer, true);
  34504. }
  34505. der.readSequence();
  34506. var next = der.offset + der.length;
  34507. var oid = der.readOID();
  34508. switch (oid) {
  34509. case '1.2.840.113549.1.1.1':
  34510. der._offset = next;
  34511. if (type === 'public')
  34512. return (readPkcs8RSAPublic(der));
  34513. else
  34514. return (readPkcs8RSAPrivate(der));
  34515. case '1.2.840.10040.4.1':
  34516. if (type === 'public')
  34517. return (readPkcs8DSAPublic(der));
  34518. else
  34519. return (readPkcs8DSAPrivate(der));
  34520. case '1.2.840.10045.2.1':
  34521. if (type === 'public')
  34522. return (readPkcs8ECDSAPublic(der));
  34523. else
  34524. return (readPkcs8ECDSAPrivate(der));
  34525. case '1.3.101.112':
  34526. if (type === 'public') {
  34527. return (readPkcs8EdDSAPublic(der));
  34528. } else {
  34529. return (readPkcs8EdDSAPrivate(der));
  34530. }
  34531. case '1.3.101.110':
  34532. if (type === 'public') {
  34533. return (readPkcs8X25519Public(der));
  34534. } else {
  34535. return (readPkcs8X25519Private(der));
  34536. }
  34537. default:
  34538. throw (new Error('Unknown key type OID ' + oid));
  34539. }
  34540. }
  34541. function readPkcs8RSAPublic(der) {
  34542. // bit string sequence
  34543. der.readSequence(asn1.Ber.BitString);
  34544. der.readByte();
  34545. der.readSequence();
  34546. // modulus
  34547. var n = readMPInt(der, 'modulus');
  34548. var e = readMPInt(der, 'exponent');
  34549. // now, make the key
  34550. var key = {
  34551. type: 'rsa',
  34552. source: der.originalInput,
  34553. parts: [
  34554. { name: 'e', data: e },
  34555. { name: 'n', data: n }
  34556. ]
  34557. };
  34558. return (new Key(key));
  34559. }
  34560. function readPkcs8RSAPrivate(der) {
  34561. der.readSequence(asn1.Ber.OctetString);
  34562. der.readSequence();
  34563. var ver = readMPInt(der, 'version');
  34564. assert.equal(ver[0], 0x0, 'unknown RSA private key version');
  34565. // modulus then public exponent
  34566. var n = readMPInt(der, 'modulus');
  34567. var e = readMPInt(der, 'public exponent');
  34568. var d = readMPInt(der, 'private exponent');
  34569. var p = readMPInt(der, 'prime1');
  34570. var q = readMPInt(der, 'prime2');
  34571. var dmodp = readMPInt(der, 'exponent1');
  34572. var dmodq = readMPInt(der, 'exponent2');
  34573. var iqmp = readMPInt(der, 'iqmp');
  34574. // now, make the key
  34575. var key = {
  34576. type: 'rsa',
  34577. parts: [
  34578. { name: 'n', data: n },
  34579. { name: 'e', data: e },
  34580. { name: 'd', data: d },
  34581. { name: 'iqmp', data: iqmp },
  34582. { name: 'p', data: p },
  34583. { name: 'q', data: q },
  34584. { name: 'dmodp', data: dmodp },
  34585. { name: 'dmodq', data: dmodq }
  34586. ]
  34587. };
  34588. return (new PrivateKey(key));
  34589. }
  34590. function readPkcs8DSAPublic(der) {
  34591. der.readSequence();
  34592. var p = readMPInt(der, 'p');
  34593. var q = readMPInt(der, 'q');
  34594. var g = readMPInt(der, 'g');
  34595. // bit string sequence
  34596. der.readSequence(asn1.Ber.BitString);
  34597. der.readByte();
  34598. var y = readMPInt(der, 'y');
  34599. // now, make the key
  34600. var key = {
  34601. type: 'dsa',
  34602. parts: [
  34603. { name: 'p', data: p },
  34604. { name: 'q', data: q },
  34605. { name: 'g', data: g },
  34606. { name: 'y', data: y }
  34607. ]
  34608. };
  34609. return (new Key(key));
  34610. }
  34611. function readPkcs8DSAPrivate(der) {
  34612. der.readSequence();
  34613. var p = readMPInt(der, 'p');
  34614. var q = readMPInt(der, 'q');
  34615. var g = readMPInt(der, 'g');
  34616. der.readSequence(asn1.Ber.OctetString);
  34617. var x = readMPInt(der, 'x');
  34618. /* The pkcs#8 format does not include the public key */
  34619. var y = utils.calculateDSAPublic(g, p, x);
  34620. var key = {
  34621. type: 'dsa',
  34622. parts: [
  34623. { name: 'p', data: p },
  34624. { name: 'q', data: q },
  34625. { name: 'g', data: g },
  34626. { name: 'y', data: y },
  34627. { name: 'x', data: x }
  34628. ]
  34629. };
  34630. return (new PrivateKey(key));
  34631. }
  34632. function readECDSACurve(der) {
  34633. var curveName, curveNames;
  34634. var j, c, cd;
  34635. if (der.peek() === asn1.Ber.OID) {
  34636. var oid = der.readOID();
  34637. curveNames = Object.keys(algs.curves);
  34638. for (j = 0; j < curveNames.length; ++j) {
  34639. c = curveNames[j];
  34640. cd = algs.curves[c];
  34641. if (cd.pkcs8oid === oid) {
  34642. curveName = c;
  34643. break;
  34644. }
  34645. }
  34646. } else {
  34647. // ECParameters sequence
  34648. der.readSequence();
  34649. var version = der.readString(asn1.Ber.Integer, true);
  34650. assert.strictEqual(version[0], 1, 'ECDSA key not version 1');
  34651. var curve = {};
  34652. // FieldID sequence
  34653. der.readSequence();
  34654. var fieldTypeOid = der.readOID();
  34655. assert.strictEqual(fieldTypeOid, '1.2.840.10045.1.1',
  34656. 'ECDSA key is not from a prime-field');
  34657. var p = curve.p = utils.mpNormalize(
  34658. der.readString(asn1.Ber.Integer, true));
  34659. /*
  34660. * p always starts with a 1 bit, so count the zeros to get its
  34661. * real size.
  34662. */
  34663. curve.size = p.length * 8 - utils.countZeros(p);
  34664. // Curve sequence
  34665. der.readSequence();
  34666. curve.a = utils.mpNormalize(
  34667. der.readString(asn1.Ber.OctetString, true));
  34668. curve.b = utils.mpNormalize(
  34669. der.readString(asn1.Ber.OctetString, true));
  34670. if (der.peek() === asn1.Ber.BitString)
  34671. curve.s = der.readString(asn1.Ber.BitString, true);
  34672. // Combined Gx and Gy
  34673. curve.G = der.readString(asn1.Ber.OctetString, true);
  34674. assert.strictEqual(curve.G[0], 0x4,
  34675. 'uncompressed G is required');
  34676. curve.n = utils.mpNormalize(
  34677. der.readString(asn1.Ber.Integer, true));
  34678. curve.h = utils.mpNormalize(
  34679. der.readString(asn1.Ber.Integer, true));
  34680. assert.strictEqual(curve.h[0], 0x1, 'a cofactor=1 curve is ' +
  34681. 'required');
  34682. curveNames = Object.keys(algs.curves);
  34683. var ks = Object.keys(curve);
  34684. for (j = 0; j < curveNames.length; ++j) {
  34685. c = curveNames[j];
  34686. cd = algs.curves[c];
  34687. var equal = true;
  34688. for (var i = 0; i < ks.length; ++i) {
  34689. var k = ks[i];
  34690. if (cd[k] === undefined)
  34691. continue;
  34692. if (typeof (cd[k]) === 'object' &&
  34693. cd[k].equals !== undefined) {
  34694. if (!cd[k].equals(curve[k])) {
  34695. equal = false;
  34696. break;
  34697. }
  34698. } else if (Buffer.isBuffer(cd[k])) {
  34699. if (cd[k].toString('binary')
  34700. !== curve[k].toString('binary')) {
  34701. equal = false;
  34702. break;
  34703. }
  34704. } else {
  34705. if (cd[k] !== curve[k]) {
  34706. equal = false;
  34707. break;
  34708. }
  34709. }
  34710. }
  34711. if (equal) {
  34712. curveName = c;
  34713. break;
  34714. }
  34715. }
  34716. }
  34717. return (curveName);
  34718. }
  34719. function readPkcs8ECDSAPrivate(der) {
  34720. var curveName = readECDSACurve(der);
  34721. assert.string(curveName, 'a known elliptic curve');
  34722. der.readSequence(asn1.Ber.OctetString);
  34723. der.readSequence();
  34724. var version = readMPInt(der, 'version');
  34725. assert.equal(version[0], 1, 'unknown version of ECDSA key');
  34726. var d = der.readString(asn1.Ber.OctetString, true);
  34727. der.readSequence(0xa1);
  34728. var Q = der.readString(asn1.Ber.BitString, true);
  34729. Q = utils.ecNormalize(Q);
  34730. var key = {
  34731. type: 'ecdsa',
  34732. parts: [
  34733. { name: 'curve', data: Buffer.from(curveName) },
  34734. { name: 'Q', data: Q },
  34735. { name: 'd', data: d }
  34736. ]
  34737. };
  34738. return (new PrivateKey(key));
  34739. }
  34740. function readPkcs8ECDSAPublic(der) {
  34741. var curveName = readECDSACurve(der);
  34742. assert.string(curveName, 'a known elliptic curve');
  34743. var Q = der.readString(asn1.Ber.BitString, true);
  34744. Q = utils.ecNormalize(Q);
  34745. var key = {
  34746. type: 'ecdsa',
  34747. parts: [
  34748. { name: 'curve', data: Buffer.from(curveName) },
  34749. { name: 'Q', data: Q }
  34750. ]
  34751. };
  34752. return (new Key(key));
  34753. }
  34754. function readPkcs8EdDSAPublic(der) {
  34755. if (der.peek() === 0x00)
  34756. der.readByte();
  34757. var A = utils.readBitString(der);
  34758. var key = {
  34759. type: 'ed25519',
  34760. parts: [
  34761. { name: 'A', data: utils.zeroPadToLength(A, 32) }
  34762. ]
  34763. };
  34764. return (new Key(key));
  34765. }
  34766. function readPkcs8X25519Public(der) {
  34767. var A = utils.readBitString(der);
  34768. var key = {
  34769. type: 'curve25519',
  34770. parts: [
  34771. { name: 'A', data: utils.zeroPadToLength(A, 32) }
  34772. ]
  34773. };
  34774. return (new Key(key));
  34775. }
  34776. function readPkcs8EdDSAPrivate(der) {
  34777. if (der.peek() === 0x00)
  34778. der.readByte();
  34779. der.readSequence(asn1.Ber.OctetString);
  34780. var k = der.readString(asn1.Ber.OctetString, true);
  34781. k = utils.zeroPadToLength(k, 32);
  34782. var A;
  34783. if (der.peek() === asn1.Ber.BitString) {
  34784. A = utils.readBitString(der);
  34785. A = utils.zeroPadToLength(A, 32);
  34786. } else {
  34787. A = utils.calculateED25519Public(k);
  34788. }
  34789. var key = {
  34790. type: 'ed25519',
  34791. parts: [
  34792. { name: 'A', data: utils.zeroPadToLength(A, 32) },
  34793. { name: 'k', data: utils.zeroPadToLength(k, 32) }
  34794. ]
  34795. };
  34796. return (new PrivateKey(key));
  34797. }
  34798. function readPkcs8X25519Private(der) {
  34799. if (der.peek() === 0x00)
  34800. der.readByte();
  34801. der.readSequence(asn1.Ber.OctetString);
  34802. var k = der.readString(asn1.Ber.OctetString, true);
  34803. k = utils.zeroPadToLength(k, 32);
  34804. var A = utils.calculateX25519Public(k);
  34805. var key = {
  34806. type: 'curve25519',
  34807. parts: [
  34808. { name: 'A', data: utils.zeroPadToLength(A, 32) },
  34809. { name: 'k', data: utils.zeroPadToLength(k, 32) }
  34810. ]
  34811. };
  34812. return (new PrivateKey(key));
  34813. }
  34814. function writePkcs8(der, key) {
  34815. der.startSequence();
  34816. if (PrivateKey.isPrivateKey(key)) {
  34817. var sillyInt = Buffer.from([0]);
  34818. der.writeBuffer(sillyInt, asn1.Ber.Integer);
  34819. }
  34820. der.startSequence();
  34821. switch (key.type) {
  34822. case 'rsa':
  34823. der.writeOID('1.2.840.113549.1.1.1');
  34824. if (PrivateKey.isPrivateKey(key))
  34825. writePkcs8RSAPrivate(key, der);
  34826. else
  34827. writePkcs8RSAPublic(key, der);
  34828. break;
  34829. case 'dsa':
  34830. der.writeOID('1.2.840.10040.4.1');
  34831. if (PrivateKey.isPrivateKey(key))
  34832. writePkcs8DSAPrivate(key, der);
  34833. else
  34834. writePkcs8DSAPublic(key, der);
  34835. break;
  34836. case 'ecdsa':
  34837. der.writeOID('1.2.840.10045.2.1');
  34838. if (PrivateKey.isPrivateKey(key))
  34839. writePkcs8ECDSAPrivate(key, der);
  34840. else
  34841. writePkcs8ECDSAPublic(key, der);
  34842. break;
  34843. case 'ed25519':
  34844. der.writeOID('1.3.101.112');
  34845. if (PrivateKey.isPrivateKey(key))
  34846. throw (new Error('Ed25519 private keys in pkcs8 ' +
  34847. 'format are not supported'));
  34848. writePkcs8EdDSAPublic(key, der);
  34849. break;
  34850. default:
  34851. throw (new Error('Unsupported key type: ' + key.type));
  34852. }
  34853. der.endSequence();
  34854. }
  34855. function writePkcs8RSAPrivate(key, der) {
  34856. der.writeNull();
  34857. der.endSequence();
  34858. der.startSequence(asn1.Ber.OctetString);
  34859. der.startSequence();
  34860. var version = Buffer.from([0]);
  34861. der.writeBuffer(version, asn1.Ber.Integer);
  34862. der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
  34863. der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
  34864. der.writeBuffer(key.part.d.data, asn1.Ber.Integer);
  34865. der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
  34866. der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
  34867. if (!key.part.dmodp || !key.part.dmodq)
  34868. utils.addRSAMissing(key);
  34869. der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);
  34870. der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);
  34871. der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);
  34872. der.endSequence();
  34873. der.endSequence();
  34874. }
  34875. function writePkcs8RSAPublic(key, der) {
  34876. der.writeNull();
  34877. der.endSequence();
  34878. der.startSequence(asn1.Ber.BitString);
  34879. der.writeByte(0x00);
  34880. der.startSequence();
  34881. der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
  34882. der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
  34883. der.endSequence();
  34884. der.endSequence();
  34885. }
  34886. function writePkcs8DSAPrivate(key, der) {
  34887. der.startSequence();
  34888. der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
  34889. der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
  34890. der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
  34891. der.endSequence();
  34892. der.endSequence();
  34893. der.startSequence(asn1.Ber.OctetString);
  34894. der.writeBuffer(key.part.x.data, asn1.Ber.Integer);
  34895. der.endSequence();
  34896. }
  34897. function writePkcs8DSAPublic(key, der) {
  34898. der.startSequence();
  34899. der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
  34900. der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
  34901. der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
  34902. der.endSequence();
  34903. der.endSequence();
  34904. der.startSequence(asn1.Ber.BitString);
  34905. der.writeByte(0x00);
  34906. der.writeBuffer(key.part.y.data, asn1.Ber.Integer);
  34907. der.endSequence();
  34908. }
  34909. function writeECDSACurve(key, der) {
  34910. var curve = algs.curves[key.curve];
  34911. if (curve.pkcs8oid) {
  34912. /* This one has a name in pkcs#8, so just write the oid */
  34913. der.writeOID(curve.pkcs8oid);
  34914. } else {
  34915. // ECParameters sequence
  34916. der.startSequence();
  34917. var version = Buffer.from([1]);
  34918. der.writeBuffer(version, asn1.Ber.Integer);
  34919. // FieldID sequence
  34920. der.startSequence();
  34921. der.writeOID('1.2.840.10045.1.1'); // prime-field
  34922. der.writeBuffer(curve.p, asn1.Ber.Integer);
  34923. der.endSequence();
  34924. // Curve sequence
  34925. der.startSequence();
  34926. var a = curve.p;
  34927. if (a[0] === 0x0)
  34928. a = a.slice(1);
  34929. der.writeBuffer(a, asn1.Ber.OctetString);
  34930. der.writeBuffer(curve.b, asn1.Ber.OctetString);
  34931. der.writeBuffer(curve.s, asn1.Ber.BitString);
  34932. der.endSequence();
  34933. der.writeBuffer(curve.G, asn1.Ber.OctetString);
  34934. der.writeBuffer(curve.n, asn1.Ber.Integer);
  34935. var h = curve.h;
  34936. if (!h) {
  34937. h = Buffer.from([1]);
  34938. }
  34939. der.writeBuffer(h, asn1.Ber.Integer);
  34940. // ECParameters
  34941. der.endSequence();
  34942. }
  34943. }
  34944. function writePkcs8ECDSAPublic(key, der) {
  34945. writeECDSACurve(key, der);
  34946. der.endSequence();
  34947. var Q = utils.ecNormalize(key.part.Q.data, true);
  34948. der.writeBuffer(Q, asn1.Ber.BitString);
  34949. }
  34950. function writePkcs8ECDSAPrivate(key, der) {
  34951. writeECDSACurve(key, der);
  34952. der.endSequence();
  34953. der.startSequence(asn1.Ber.OctetString);
  34954. der.startSequence();
  34955. var version = Buffer.from([1]);
  34956. der.writeBuffer(version, asn1.Ber.Integer);
  34957. der.writeBuffer(key.part.d.data, asn1.Ber.OctetString);
  34958. der.startSequence(0xa1);
  34959. var Q = utils.ecNormalize(key.part.Q.data, true);
  34960. der.writeBuffer(Q, asn1.Ber.BitString);
  34961. der.endSequence();
  34962. der.endSequence();
  34963. der.endSequence();
  34964. }
  34965. function writePkcs8EdDSAPublic(key, der) {
  34966. der.endSequence();
  34967. utils.writeBitString(der, key.part.A.data);
  34968. }
  34969. function writePkcs8EdDSAPrivate(key, der) {
  34970. der.endSequence();
  34971. var k = utils.mpNormalize(key.part.k.data, true);
  34972. der.startSequence(asn1.Ber.OctetString);
  34973. der.writeBuffer(k, asn1.Ber.OctetString);
  34974. der.endSequence();
  34975. }
  34976. /***/ }),
  34977. /* 147 */
  34978. /***/ (function(module, exports, __webpack_require__) {
  34979. // Copyright 2017 Joyent, Inc.
  34980. module.exports = Identity;
  34981. var assert = __webpack_require__(22);
  34982. var algs = __webpack_require__(39);
  34983. var crypto = __webpack_require__(21);
  34984. var Fingerprint = __webpack_require__(145);
  34985. var Signature = __webpack_require__(71);
  34986. var errs = __webpack_require__(70);
  34987. var util = __webpack_require__(9);
  34988. var utils = __webpack_require__(32);
  34989. var asn1 = __webpack_require__(67);
  34990. var Buffer = __webpack_require__(20).Buffer;
  34991. /*JSSTYLED*/
  34992. var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i;
  34993. var oids = {};
  34994. oids.cn = '2.5.4.3';
  34995. oids.o = '2.5.4.10';
  34996. oids.ou = '2.5.4.11';
  34997. oids.l = '2.5.4.7';
  34998. oids.s = '2.5.4.8';
  34999. oids.c = '2.5.4.6';
  35000. oids.sn = '2.5.4.4';
  35001. oids.dc = '0.9.2342.19200300.100.1.25';
  35002. oids.uid = '0.9.2342.19200300.100.1.1';
  35003. oids.mail = '0.9.2342.19200300.100.1.3';
  35004. var unoids = {};
  35005. Object.keys(oids).forEach(function (k) {
  35006. unoids[oids[k]] = k;
  35007. });
  35008. function Identity(opts) {
  35009. var self = this;
  35010. assert.object(opts, 'options');
  35011. assert.arrayOfObject(opts.components, 'options.components');
  35012. this.components = opts.components;
  35013. this.componentLookup = {};
  35014. this.components.forEach(function (c) {
  35015. if (c.name && !c.oid)
  35016. c.oid = oids[c.name];
  35017. if (c.oid && !c.name)
  35018. c.name = unoids[c.oid];
  35019. if (self.componentLookup[c.name] === undefined)
  35020. self.componentLookup[c.name] = [];
  35021. self.componentLookup[c.name].push(c);
  35022. });
  35023. if (this.componentLookup.cn && this.componentLookup.cn.length > 0) {
  35024. this.cn = this.componentLookup.cn[0].value;
  35025. }
  35026. assert.optionalString(opts.type, 'options.type');
  35027. if (opts.type === undefined) {
  35028. if (this.components.length === 1 &&
  35029. this.componentLookup.cn &&
  35030. this.componentLookup.cn.length === 1 &&
  35031. this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {
  35032. this.type = 'host';
  35033. this.hostname = this.componentLookup.cn[0].value;
  35034. } else if (this.componentLookup.dc &&
  35035. this.components.length === this.componentLookup.dc.length) {
  35036. this.type = 'host';
  35037. this.hostname = this.componentLookup.dc.map(
  35038. function (c) {
  35039. return (c.value);
  35040. }).join('.');
  35041. } else if (this.componentLookup.uid &&
  35042. this.components.length ===
  35043. this.componentLookup.uid.length) {
  35044. this.type = 'user';
  35045. this.uid = this.componentLookup.uid[0].value;
  35046. } else if (this.componentLookup.cn &&
  35047. this.componentLookup.cn.length === 1 &&
  35048. this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {
  35049. this.type = 'host';
  35050. this.hostname = this.componentLookup.cn[0].value;
  35051. } else if (this.componentLookup.uid &&
  35052. this.componentLookup.uid.length === 1) {
  35053. this.type = 'user';
  35054. this.uid = this.componentLookup.uid[0].value;
  35055. } else if (this.componentLookup.mail &&
  35056. this.componentLookup.mail.length === 1) {
  35057. this.type = 'email';
  35058. this.email = this.componentLookup.mail[0].value;
  35059. } else if (this.componentLookup.cn &&
  35060. this.componentLookup.cn.length === 1) {
  35061. this.type = 'user';
  35062. this.uid = this.componentLookup.cn[0].value;
  35063. } else {
  35064. this.type = 'unknown';
  35065. }
  35066. } else {
  35067. this.type = opts.type;
  35068. if (this.type === 'host')
  35069. this.hostname = opts.hostname;
  35070. else if (this.type === 'user')
  35071. this.uid = opts.uid;
  35072. else if (this.type === 'email')
  35073. this.email = opts.email;
  35074. else
  35075. throw (new Error('Unknown type ' + this.type));
  35076. }
  35077. }
  35078. Identity.prototype.toString = function () {
  35079. return (this.components.map(function (c) {
  35080. return (c.name.toUpperCase() + '=' + c.value);
  35081. }).join(', '));
  35082. };
  35083. /*
  35084. * These are from X.680 -- PrintableString allowed chars are in section 37.4
  35085. * table 8. Spec for IA5Strings is "1,6 + SPACE + DEL" where 1 refers to
  35086. * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006
  35087. * (the basic ASCII character set).
  35088. */
  35089. /* JSSTYLED */
  35090. var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/;
  35091. /* JSSTYLED */
  35092. var NOT_IA5 = /[^\x00-\x7f]/;
  35093. Identity.prototype.toAsn1 = function (der, tag) {
  35094. der.startSequence(tag);
  35095. this.components.forEach(function (c) {
  35096. der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set);
  35097. der.startSequence();
  35098. der.writeOID(c.oid);
  35099. /*
  35100. * If we fit in a PrintableString, use that. Otherwise use an
  35101. * IA5String or UTF8String.
  35102. *
  35103. * If this identity was parsed from a DN, use the ASN.1 types
  35104. * from the original representation (otherwise this might not
  35105. * be a full match for the original in some validators).
  35106. */
  35107. if (c.asn1type === asn1.Ber.Utf8String ||
  35108. c.value.match(NOT_IA5)) {
  35109. var v = Buffer.from(c.value, 'utf8');
  35110. der.writeBuffer(v, asn1.Ber.Utf8String);
  35111. } else if (c.asn1type === asn1.Ber.IA5String ||
  35112. c.value.match(NOT_PRINTABLE)) {
  35113. der.writeString(c.value, asn1.Ber.IA5String);
  35114. } else {
  35115. var type = asn1.Ber.PrintableString;
  35116. if (c.asn1type !== undefined)
  35117. type = c.asn1type;
  35118. der.writeString(c.value, type);
  35119. }
  35120. der.endSequence();
  35121. der.endSequence();
  35122. });
  35123. der.endSequence();
  35124. };
  35125. function globMatch(a, b) {
  35126. if (a === '**' || b === '**')
  35127. return (true);
  35128. var aParts = a.split('.');
  35129. var bParts = b.split('.');
  35130. if (aParts.length !== bParts.length)
  35131. return (false);
  35132. for (var i = 0; i < aParts.length; ++i) {
  35133. if (aParts[i] === '*' || bParts[i] === '*')
  35134. continue;
  35135. if (aParts[i] !== bParts[i])
  35136. return (false);
  35137. }
  35138. return (true);
  35139. }
  35140. Identity.prototype.equals = function (other) {
  35141. if (!Identity.isIdentity(other, [1, 0]))
  35142. return (false);
  35143. if (other.components.length !== this.components.length)
  35144. return (false);
  35145. for (var i = 0; i < this.components.length; ++i) {
  35146. if (this.components[i].oid !== other.components[i].oid)
  35147. return (false);
  35148. if (!globMatch(this.components[i].value,
  35149. other.components[i].value)) {
  35150. return (false);
  35151. }
  35152. }
  35153. return (true);
  35154. };
  35155. Identity.forHost = function (hostname) {
  35156. assert.string(hostname, 'hostname');
  35157. return (new Identity({
  35158. type: 'host',
  35159. hostname: hostname,
  35160. components: [ { name: 'cn', value: hostname } ]
  35161. }));
  35162. };
  35163. Identity.forUser = function (uid) {
  35164. assert.string(uid, 'uid');
  35165. return (new Identity({
  35166. type: 'user',
  35167. uid: uid,
  35168. components: [ { name: 'uid', value: uid } ]
  35169. }));
  35170. };
  35171. Identity.forEmail = function (email) {
  35172. assert.string(email, 'email');
  35173. return (new Identity({
  35174. type: 'email',
  35175. email: email,
  35176. components: [ { name: 'mail', value: email } ]
  35177. }));
  35178. };
  35179. Identity.parseDN = function (dn) {
  35180. assert.string(dn, 'dn');
  35181. var parts = dn.split(',');
  35182. var cmps = parts.map(function (c) {
  35183. c = c.trim();
  35184. var eqPos = c.indexOf('=');
  35185. var name = c.slice(0, eqPos).toLowerCase();
  35186. var value = c.slice(eqPos + 1);
  35187. return ({ name: name, value: value });
  35188. });
  35189. return (new Identity({ components: cmps }));
  35190. };
  35191. Identity.parseAsn1 = function (der, top) {
  35192. var components = [];
  35193. der.readSequence(top);
  35194. var end = der.offset + der.length;
  35195. while (der.offset < end) {
  35196. der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set);
  35197. var after = der.offset + der.length;
  35198. der.readSequence();
  35199. var oid = der.readOID();
  35200. var type = der.peek();
  35201. var value;
  35202. switch (type) {
  35203. case asn1.Ber.PrintableString:
  35204. case asn1.Ber.IA5String:
  35205. case asn1.Ber.OctetString:
  35206. case asn1.Ber.T61String:
  35207. value = der.readString(type);
  35208. break;
  35209. case asn1.Ber.Utf8String:
  35210. value = der.readString(type, true);
  35211. value = value.toString('utf8');
  35212. break;
  35213. case asn1.Ber.CharacterString:
  35214. case asn1.Ber.BMPString:
  35215. value = der.readString(type, true);
  35216. value = value.toString('utf16le');
  35217. break;
  35218. default:
  35219. throw (new Error('Unknown asn1 type ' + type));
  35220. }
  35221. components.push({ oid: oid, asn1type: type, value: value });
  35222. der._offset = after;
  35223. }
  35224. der._offset = end;
  35225. return (new Identity({
  35226. components: components
  35227. }));
  35228. };
  35229. Identity.isIdentity = function (obj, ver) {
  35230. return (utils.isCompatible(obj, Identity, ver));
  35231. };
  35232. /*
  35233. * API versions for Identity:
  35234. * [1,0] -- initial ver
  35235. */
  35236. Identity.prototype._sshpkApiVersion = [1, 0];
  35237. Identity._oldVersionDetect = function (obj) {
  35238. return ([1, 0]);
  35239. };
  35240. /***/ }),
  35241. /* 148 */
  35242. /***/ (function(module, exports, __webpack_require__) {
  35243. // Copyright 2015 Joyent, Inc.
  35244. module.exports = SSHBuffer;
  35245. var assert = __webpack_require__(22);
  35246. var Buffer = __webpack_require__(20).Buffer;
  35247. function SSHBuffer(opts) {
  35248. assert.object(opts, 'options');
  35249. if (opts.buffer !== undefined)
  35250. assert.buffer(opts.buffer, 'options.buffer');
  35251. this._size = opts.buffer ? opts.buffer.length : 1024;
  35252. this._buffer = opts.buffer || Buffer.alloc(this._size);
  35253. this._offset = 0;
  35254. }
  35255. SSHBuffer.prototype.toBuffer = function () {
  35256. return (this._buffer.slice(0, this._offset));
  35257. };
  35258. SSHBuffer.prototype.atEnd = function () {
  35259. return (this._offset >= this._buffer.length);
  35260. };
  35261. SSHBuffer.prototype.remainder = function () {
  35262. return (this._buffer.slice(this._offset));
  35263. };
  35264. SSHBuffer.prototype.skip = function (n) {
  35265. this._offset += n;
  35266. };
  35267. SSHBuffer.prototype.expand = function () {
  35268. this._size *= 2;
  35269. var buf = Buffer.alloc(this._size);
  35270. this._buffer.copy(buf, 0);
  35271. this._buffer = buf;
  35272. };
  35273. SSHBuffer.prototype.readPart = function () {
  35274. return ({data: this.readBuffer()});
  35275. };
  35276. SSHBuffer.prototype.readBuffer = function () {
  35277. var len = this._buffer.readUInt32BE(this._offset);
  35278. this._offset += 4;
  35279. assert.ok(this._offset + len <= this._buffer.length,
  35280. 'length out of bounds at +0x' + this._offset.toString(16) +
  35281. ' (data truncated?)');
  35282. var buf = this._buffer.slice(this._offset, this._offset + len);
  35283. this._offset += len;
  35284. return (buf);
  35285. };
  35286. SSHBuffer.prototype.readString = function () {
  35287. return (this.readBuffer().toString());
  35288. };
  35289. SSHBuffer.prototype.readCString = function () {
  35290. var offset = this._offset;
  35291. while (offset < this._buffer.length &&
  35292. this._buffer[offset] !== 0x00)
  35293. offset++;
  35294. assert.ok(offset < this._buffer.length, 'c string does not terminate');
  35295. var str = this._buffer.slice(this._offset, offset).toString();
  35296. this._offset = offset + 1;
  35297. return (str);
  35298. };
  35299. SSHBuffer.prototype.readInt = function () {
  35300. var v = this._buffer.readUInt32BE(this._offset);
  35301. this._offset += 4;
  35302. return (v);
  35303. };
  35304. SSHBuffer.prototype.readInt64 = function () {
  35305. assert.ok(this._offset + 8 < this._buffer.length,
  35306. 'buffer not long enough to read Int64');
  35307. var v = this._buffer.slice(this._offset, this._offset + 8);
  35308. this._offset += 8;
  35309. return (v);
  35310. };
  35311. SSHBuffer.prototype.readChar = function () {
  35312. var v = this._buffer[this._offset++];
  35313. return (v);
  35314. };
  35315. SSHBuffer.prototype.writeBuffer = function (buf) {
  35316. while (this._offset + 4 + buf.length > this._size)
  35317. this.expand();
  35318. this._buffer.writeUInt32BE(buf.length, this._offset);
  35319. this._offset += 4;
  35320. buf.copy(this._buffer, this._offset);
  35321. this._offset += buf.length;
  35322. };
  35323. SSHBuffer.prototype.writeString = function (str) {
  35324. this.writeBuffer(Buffer.from(str, 'utf8'));
  35325. };
  35326. SSHBuffer.prototype.writeCString = function (str) {
  35327. while (this._offset + 1 + str.length > this._size)
  35328. this.expand();
  35329. this._buffer.write(str, this._offset);
  35330. this._offset += str.length;
  35331. this._buffer[this._offset++] = 0;
  35332. };
  35333. SSHBuffer.prototype.writeInt = function (v) {
  35334. while (this._offset + 4 > this._size)
  35335. this.expand();
  35336. this._buffer.writeUInt32BE(v, this._offset);
  35337. this._offset += 4;
  35338. };
  35339. SSHBuffer.prototype.writeInt64 = function (v) {
  35340. assert.buffer(v, 'value');
  35341. if (v.length > 8) {
  35342. var lead = v.slice(0, v.length - 8);
  35343. for (var i = 0; i < lead.length; ++i) {
  35344. assert.strictEqual(lead[i], 0,
  35345. 'must fit in 64 bits of precision');
  35346. }
  35347. v = v.slice(v.length - 8, v.length);
  35348. }
  35349. while (this._offset + 8 > this._size)
  35350. this.expand();
  35351. v.copy(this._buffer, this._offset);
  35352. this._offset += 8;
  35353. };
  35354. SSHBuffer.prototype.writeChar = function (v) {
  35355. while (this._offset + 1 > this._size)
  35356. this.expand();
  35357. this._buffer[this._offset++] = v;
  35358. };
  35359. SSHBuffer.prototype.writePart = function (p) {
  35360. this.writeBuffer(p.data);
  35361. };
  35362. SSHBuffer.prototype.write = function (buf) {
  35363. while (this._offset + buf.length > this._size)
  35364. this.expand();
  35365. buf.copy(this._buffer, this._offset);
  35366. this._offset += buf.length;
  35367. };
  35368. /***/ }),
  35369. /* 149 */
  35370. /***/ (function(module, exports) {
  35371. module.exports = require("tty");
  35372. /***/ }),
  35373. /* 150 */
  35374. /***/ (function(module, exports, __webpack_require__) {
  35375. "use strict";
  35376. Object.defineProperty(exports, "__esModule", {
  35377. value: true
  35378. });
  35379. var _stringify;
  35380. function _load_stringify() {
  35381. return _stringify = _interopRequireDefault(__webpack_require__(37));
  35382. }
  35383. var _extends2;
  35384. function _load_extends() {
  35385. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  35386. }
  35387. var _set;
  35388. function _load_set() {
  35389. return _set = _interopRequireDefault(__webpack_require__(16));
  35390. }
  35391. var _promise;
  35392. function _load_promise() {
  35393. return _promise = _interopRequireDefault(__webpack_require__(7));
  35394. }
  35395. var _map;
  35396. function _load_map() {
  35397. return _map = _interopRequireDefault(__webpack_require__(42));
  35398. }
  35399. var _getIterator2;
  35400. function _load_getIterator() {
  35401. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  35402. }
  35403. var _asyncToGenerator2;
  35404. function _load_asyncToGenerator() {
  35405. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  35406. }
  35407. var _classCallCheck2;
  35408. function _load_classCallCheck() {
  35409. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  35410. }
  35411. var _keys;
  35412. function _load_keys() {
  35413. return _keys = _interopRequireDefault(__webpack_require__(14));
  35414. }
  35415. exports.extractWorkspaces = extractWorkspaces;
  35416. var _executeLifecycleScript;
  35417. function _load_executeLifecycleScript() {
  35418. return _executeLifecycleScript = __webpack_require__(100);
  35419. }
  35420. var _path;
  35421. function _load_path() {
  35422. return _path = __webpack_require__(314);
  35423. }
  35424. var _conversion;
  35425. function _load_conversion() {
  35426. return _conversion = __webpack_require__(275);
  35427. }
  35428. var _index;
  35429. function _load_index() {
  35430. return _index = _interopRequireDefault(__webpack_require__(206));
  35431. }
  35432. var _errors;
  35433. function _load_errors() {
  35434. return _errors = __webpack_require__(6);
  35435. }
  35436. var _fs;
  35437. function _load_fs() {
  35438. return _fs = _interopRequireWildcard(__webpack_require__(8));
  35439. }
  35440. var _constants;
  35441. function _load_constants() {
  35442. return _constants = _interopRequireWildcard(__webpack_require__(13));
  35443. }
  35444. var _packageConstraintResolver;
  35445. function _load_packageConstraintResolver() {
  35446. return _packageConstraintResolver = _interopRequireDefault(__webpack_require__(511));
  35447. }
  35448. var _requestManager;
  35449. function _load_requestManager() {
  35450. return _requestManager = _interopRequireDefault(__webpack_require__(315));
  35451. }
  35452. var _index2;
  35453. function _load_index2() {
  35454. return _index2 = __webpack_require__(61);
  35455. }
  35456. var _index3;
  35457. function _load_index3() {
  35458. return _index3 = __webpack_require__(189);
  35459. }
  35460. var _map2;
  35461. function _load_map2() {
  35462. return _map2 = _interopRequireDefault(__webpack_require__(51));
  35463. }
  35464. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  35465. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  35466. var crypto = __webpack_require__(21);
  35467. var detectIndent = __webpack_require__(658);
  35468. var invariant = __webpack_require__(15);
  35469. var path = __webpack_require__(1);
  35470. var micromatch = __webpack_require__(109);
  35471. var isCi = __webpack_require__(365);
  35472. function sortObject(object) {
  35473. var sortedObject = {};
  35474. (0, (_keys || _load_keys()).default)(object).sort().forEach(function (item) {
  35475. sortedObject[item] = object[item];
  35476. });
  35477. return sortedObject;
  35478. }
  35479. var Config = function () {
  35480. function Config(reporter) {
  35481. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Config);
  35482. this.constraintResolver = new (_packageConstraintResolver || _load_packageConstraintResolver()).default(this, reporter);
  35483. this.requestManager = new (_requestManager || _load_requestManager()).default(reporter);
  35484. this.reporter = reporter;
  35485. this._init({});
  35486. }
  35487. //
  35488. //
  35489. // cache packages in offline mirror folder as new .tgz files
  35490. //
  35491. //
  35492. //
  35493. //
  35494. //
  35495. //
  35496. //
  35497. //
  35498. //
  35499. //
  35500. //
  35501. // Whether we should ignore executing lifecycle scripts
  35502. //
  35503. //
  35504. //
  35505. //
  35506. /**
  35507. * Execute a promise produced by factory if it doesn't exist in our cache with
  35508. * the associated key.
  35509. */
  35510. Config.prototype.getCache = function getCache(key, factory) {
  35511. var _this = this;
  35512. var cached = this.cache[key];
  35513. if (cached) {
  35514. return cached;
  35515. }
  35516. return this.cache[key] = factory().catch(function (err) {
  35517. _this.cache[key] = null;
  35518. throw err;
  35519. });
  35520. };
  35521. /**
  35522. * Get a config option from our yarn config.
  35523. */
  35524. Config.prototype.getOption = function getOption(key) {
  35525. var resolve = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  35526. var value = this.registries.yarn.getOption(key);
  35527. if (resolve && typeof value === 'string' && value.length) {
  35528. return (0, (_path || _load_path()).resolveWithHome)(value);
  35529. }
  35530. return value;
  35531. };
  35532. /**
  35533. * Reduce a list of versions to a single one based on an input range.
  35534. */
  35535. Config.prototype.resolveConstraints = function resolveConstraints(versions, range) {
  35536. return this.constraintResolver.reduce(versions, range);
  35537. };
  35538. /**
  35539. * Initialise config. Fetch registry options, find package roots.
  35540. */
  35541. Config.prototype.init = function () {
  35542. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  35543. var _this2 = this;
  35544. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  35545. this._init(opts);
  35546. this.workspaceRootFolder = yield this.findWorkspaceRoot(this.cwd);
  35547. this.lockfileFolder = this.workspaceRootFolder || this.cwd;
  35548. // using focus in a workspace root is not allowed
  35549. if (this.focus && (!this.workspaceRootFolder || this.cwd === this.workspaceRootFolder)) {
  35550. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesFocusRootCheck'));
  35551. }
  35552. if (this.focus) {
  35553. var focusedWorkspaceManifest = yield this.readRootManifest();
  35554. this.focusedWorkspaceName = focusedWorkspaceManifest.name;
  35555. }
  35556. this.linkedModules = [];
  35557. var linkedModules = void 0;
  35558. try {
  35559. linkedModules = yield (_fs || _load_fs()).readdir(this.linkFolder);
  35560. } catch (err) {
  35561. if (err.code === 'ENOENT') {
  35562. linkedModules = [];
  35563. } else {
  35564. throw err;
  35565. }
  35566. }
  35567. var _loop = function* _loop(dir) {
  35568. var linkedPath = path.join(_this2.linkFolder, dir);
  35569. if (dir[0] === '@') {
  35570. var _linkedModules;
  35571. // it's a scope, not a package
  35572. var scopedLinked = yield (_fs || _load_fs()).readdir(linkedPath);
  35573. (_linkedModules = _this2.linkedModules).push.apply(_linkedModules, scopedLinked.map(function (scopedDir) {
  35574. return path.join(dir, scopedDir);
  35575. }));
  35576. } else {
  35577. _this2.linkedModules.push(dir);
  35578. }
  35579. };
  35580. for (var _iterator = linkedModules, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  35581. var _ref2;
  35582. if (_isArray) {
  35583. if (_i >= _iterator.length) break;
  35584. _ref2 = _iterator[_i++];
  35585. } else {
  35586. _i = _iterator.next();
  35587. if (_i.done) break;
  35588. _ref2 = _i.value;
  35589. }
  35590. var dir = _ref2;
  35591. yield* _loop(dir);
  35592. }
  35593. for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  35594. var _ref3;
  35595. if (_isArray2) {
  35596. if (_i2 >= _iterator2.length) break;
  35597. _ref3 = _iterator2[_i2++];
  35598. } else {
  35599. _i2 = _iterator2.next();
  35600. if (_i2.done) break;
  35601. _ref3 = _i2.value;
  35602. }
  35603. var _key = _ref3;
  35604. var Registry = (_index2 || _load_index2()).registries[_key];
  35605. var extraneousRcFiles = Registry === (_index2 || _load_index2()).registries.yarn ? this.extraneousYarnrcFiles : [];
  35606. // instantiate registry
  35607. var _registry = new Registry(this.cwd, this.registries, this.requestManager, this.reporter, this.enableDefaultRc, extraneousRcFiles);
  35608. yield _registry.init({
  35609. registry: opts.registry
  35610. });
  35611. this.registries[_key] = _registry;
  35612. if (this.registryFolders.indexOf(_registry.folder) === -1) {
  35613. this.registryFolders.push(_registry.folder);
  35614. }
  35615. }
  35616. if (this.modulesFolder) {
  35617. this.registryFolders = [this.modulesFolder];
  35618. }
  35619. this.networkConcurrency = opts.networkConcurrency || Number(this.getOption('network-concurrency')) || (_constants || _load_constants()).NETWORK_CONCURRENCY;
  35620. this.childConcurrency = opts.childConcurrency || Number(this.getOption('child-concurrency')) || Number(process.env.CHILD_CONCURRENCY) || (_constants || _load_constants()).CHILD_CONCURRENCY;
  35621. this.networkTimeout = opts.networkTimeout || Number(this.getOption('network-timeout')) || (_constants || _load_constants()).NETWORK_TIMEOUT;
  35622. var httpProxy = opts.httpProxy || this.getOption('proxy');
  35623. var httpsProxy = opts.httpsProxy || this.getOption('https-proxy');
  35624. this.requestManager.setOptions({
  35625. userAgent: String(this.getOption('user-agent')),
  35626. httpProxy: httpProxy === false ? false : String(httpProxy || ''),
  35627. httpsProxy: httpsProxy === false ? false : String(httpsProxy || ''),
  35628. strictSSL: Boolean(this.getOption('strict-ssl')),
  35629. ca: Array.prototype.concat(opts.ca || this.getOption('ca') || []).map(String),
  35630. cafile: String(opts.cafile || this.getOption('cafile', true) || ''),
  35631. cert: String(opts.cert || this.getOption('cert') || ''),
  35632. key: String(opts.key || this.getOption('key') || ''),
  35633. networkConcurrency: this.networkConcurrency,
  35634. networkTimeout: this.networkTimeout
  35635. });
  35636. this.globalFolder = opts.globalFolder || String(this.getOption('global-folder', true));
  35637. if (this.globalFolder === 'undefined') {
  35638. this.globalFolder = (_constants || _load_constants()).GLOBAL_MODULE_DIRECTORY;
  35639. }
  35640. var cacheRootFolder = opts.cacheFolder || this.getOption('cache-folder', true);
  35641. if (!cacheRootFolder) {
  35642. var preferredCacheFolders = (_constants || _load_constants()).PREFERRED_MODULE_CACHE_DIRECTORIES;
  35643. var preferredCacheFolder = opts.preferredCacheFolder || this.getOption('preferred-cache-folder', true);
  35644. if (preferredCacheFolder) {
  35645. preferredCacheFolders = [String(preferredCacheFolder)].concat(preferredCacheFolders);
  35646. }
  35647. var cacheFolderQuery = yield (_fs || _load_fs()).getFirstSuitableFolder(preferredCacheFolders, (_fs || _load_fs()).constants.W_OK | (_fs || _load_fs()).constants.X_OK | (_fs || _load_fs()).constants.R_OK // eslint-disable-line no-bitwise
  35648. );
  35649. for (var _iterator3 = cacheFolderQuery.skipped, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  35650. var _ref4;
  35651. if (_isArray3) {
  35652. if (_i3 >= _iterator3.length) break;
  35653. _ref4 = _iterator3[_i3++];
  35654. } else {
  35655. _i3 = _iterator3.next();
  35656. if (_i3.done) break;
  35657. _ref4 = _i3.value;
  35658. }
  35659. var skippedEntry = _ref4;
  35660. this.reporter.warn(this.reporter.lang('cacheFolderSkipped', skippedEntry.folder));
  35661. }
  35662. cacheRootFolder = cacheFolderQuery.folder;
  35663. if (cacheRootFolder && cacheFolderQuery.skipped.length > 0) {
  35664. this.reporter.warn(this.reporter.lang('cacheFolderSelected', cacheRootFolder));
  35665. }
  35666. }
  35667. if (!cacheRootFolder) {
  35668. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('cacheFolderMissing'));
  35669. } else {
  35670. this._cacheRootFolder = String(cacheRootFolder);
  35671. }
  35672. var manifest = yield this.maybeReadManifest(this.lockfileFolder);
  35673. var plugnplayByEnv = this.getOption('plugnplay-override');
  35674. if (plugnplayByEnv != null) {
  35675. this.plugnplayEnabled = plugnplayByEnv !== 'false' && plugnplayByEnv !== '0';
  35676. this.plugnplayPersist = false;
  35677. } else if (opts.enablePnp || opts.disablePnp) {
  35678. this.plugnplayEnabled = !!opts.enablePnp;
  35679. this.plugnplayPersist = true;
  35680. } else if (manifest && manifest.installConfig && manifest.installConfig.pnp) {
  35681. this.plugnplayEnabled = !!manifest.installConfig.pnp;
  35682. this.plugnplayPersist = false;
  35683. } else {
  35684. this.plugnplayEnabled = false;
  35685. this.plugnplayPersist = false;
  35686. }
  35687. if (process.platform === 'win32') {
  35688. var cacheRootFolderDrive = path.parse(this._cacheRootFolder).root.toLowerCase();
  35689. var lockfileFolderDrive = path.parse(this.lockfileFolder).root.toLowerCase();
  35690. if (cacheRootFolderDrive !== lockfileFolderDrive) {
  35691. if (this.plugnplayEnabled) {
  35692. this.reporter.warn(this.reporter.lang('plugnplayWindowsSupport'));
  35693. }
  35694. this.plugnplayEnabled = false;
  35695. this.plugnplayPersist = false;
  35696. }
  35697. }
  35698. this.plugnplayShebang = String(this.getOption('plugnplay-shebang') || '') || '/usr/bin/env node';
  35699. this.plugnplayBlacklist = String(this.getOption('plugnplay-blacklist') || '') || null;
  35700. this.ignoreScripts = opts.ignoreScripts || Boolean(this.getOption('ignore-scripts', false));
  35701. this.workspacesEnabled = this.getOption('workspaces-experimental') !== false;
  35702. this.workspacesNohoistEnabled = this.getOption('workspaces-nohoist-experimental') !== false;
  35703. this.offlineCacheFolder = String(this.getOption('offline-cache-folder') || '') || null;
  35704. this.pruneOfflineMirror = Boolean(this.getOption('yarn-offline-mirror-pruning'));
  35705. this.enableMetaFolder = Boolean(this.getOption('enable-meta-folder'));
  35706. this.enableLockfileVersions = Boolean(this.getOption('yarn-enable-lockfile-versions'));
  35707. this.linkFileDependencies = Boolean(this.getOption('yarn-link-file-dependencies'));
  35708. this.packBuiltPackages = Boolean(this.getOption('experimental-pack-script-packages-in-mirror'));
  35709. this.autoAddIntegrity = !(0, (_conversion || _load_conversion()).boolifyWithDefault)(String(this.getOption('unsafe-disable-integrity-migration')), true);
  35710. //init & create cacheFolder, tempFolder
  35711. this.cacheFolder = path.join(this._cacheRootFolder, 'v' + String((_constants || _load_constants()).CACHE_VERSION));
  35712. this.tempFolder = opts.tempFolder || path.join(this.cacheFolder, '.tmp');
  35713. yield (_fs || _load_fs()).mkdirp(this.cacheFolder);
  35714. yield (_fs || _load_fs()).mkdirp(this.tempFolder);
  35715. if (opts.production !== undefined) {
  35716. this.production = Boolean(opts.production);
  35717. } else {
  35718. this.production = Boolean(this.getOption('production')) || process.env.NODE_ENV === 'production' && process.env.NPM_CONFIG_PRODUCTION !== 'false' && process.env.YARN_PRODUCTION !== 'false';
  35719. }
  35720. if (this.workspaceRootFolder && !this.workspacesEnabled) {
  35721. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesDisabled'));
  35722. }
  35723. });
  35724. function init() {
  35725. return _ref.apply(this, arguments);
  35726. }
  35727. return init;
  35728. }();
  35729. Config.prototype._init = function _init(opts) {
  35730. this.registryFolders = [];
  35731. this.linkedModules = [];
  35732. this.registries = (0, (_map2 || _load_map2()).default)();
  35733. this.cache = (0, (_map2 || _load_map2()).default)();
  35734. // Ensure the cwd is always an absolute path.
  35735. this.cwd = path.resolve(opts.cwd || this.cwd || process.cwd());
  35736. this.looseSemver = opts.looseSemver == undefined ? true : opts.looseSemver;
  35737. this.commandName = opts.commandName || '';
  35738. this.enableDefaultRc = opts.enableDefaultRc !== false;
  35739. this.extraneousYarnrcFiles = opts.extraneousYarnrcFiles || [];
  35740. this.preferOffline = !!opts.preferOffline;
  35741. this.modulesFolder = opts.modulesFolder;
  35742. this.linkFolder = opts.linkFolder || (_constants || _load_constants()).LINK_REGISTRY_DIRECTORY;
  35743. this.offline = !!opts.offline;
  35744. this.binLinks = !!opts.binLinks;
  35745. this.updateChecksums = !!opts.updateChecksums;
  35746. this.plugnplayUnplugged = [];
  35747. this.plugnplayPurgeUnpluggedPackages = false;
  35748. this.ignorePlatform = !!opts.ignorePlatform;
  35749. this.ignoreScripts = !!opts.ignoreScripts;
  35750. this.disablePrepublish = !!opts.disablePrepublish;
  35751. // $FlowFixMe$
  35752. this.nonInteractive = !!opts.nonInteractive || isCi || !process.stdout.isTTY;
  35753. this.requestManager.setOptions({
  35754. offline: !!opts.offline && !opts.preferOffline,
  35755. captureHar: !!opts.captureHar
  35756. });
  35757. this.focus = !!opts.focus;
  35758. this.focusedWorkspaceName = '';
  35759. this.otp = opts.otp || '';
  35760. };
  35761. /**
  35762. * Generate a name suitable as unique filesystem identifier for the specified package.
  35763. */
  35764. Config.prototype.generateUniquePackageSlug = function generateUniquePackageSlug(pkg) {
  35765. var slug = pkg.name;
  35766. slug = slug.replace(/[^@a-z0-9]+/g, '-');
  35767. slug = slug.replace(/^-+|-+$/g, '');
  35768. if (pkg.registry) {
  35769. slug = `${pkg.registry}-${slug}`;
  35770. } else {
  35771. slug = `unknown-${slug}`;
  35772. }
  35773. var hash = pkg.remote.hash;
  35774. if (pkg.version) {
  35775. slug += `-${pkg.version}`;
  35776. }
  35777. if (pkg.uid && pkg.version !== pkg.uid) {
  35778. slug += `-${pkg.uid}`;
  35779. } else if (hash) {
  35780. slug += `-${hash}`;
  35781. }
  35782. if (pkg.remote.integrity) {
  35783. slug += `-integrity`;
  35784. }
  35785. return slug;
  35786. };
  35787. /**
  35788. * Generate an absolute module path.
  35789. */
  35790. Config.prototype.generateModuleCachePath = function generateModuleCachePath(pkg) {
  35791. invariant(this.cacheFolder, 'No package root');
  35792. invariant(pkg, 'Undefined package');
  35793. var slug = this.generateUniquePackageSlug(pkg);
  35794. return path.join(this.cacheFolder, slug, 'node_modules', pkg.name);
  35795. };
  35796. /**
  35797. */
  35798. Config.prototype.getUnpluggedPath = function getUnpluggedPath() {
  35799. return path.join(this.lockfileFolder, '.pnp', 'unplugged');
  35800. };
  35801. /**
  35802. */
  35803. Config.prototype.generatePackageUnpluggedPath = function generatePackageUnpluggedPath(pkg) {
  35804. var slug = this.generateUniquePackageSlug(pkg);
  35805. return path.join(this.getUnpluggedPath(), slug, 'node_modules', pkg.name);
  35806. };
  35807. /**
  35808. */
  35809. Config.prototype.listUnpluggedPackageFolders = function () {
  35810. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  35811. var unpluggedPackages = new (_map || _load_map()).default();
  35812. var unpluggedPath = this.getUnpluggedPath();
  35813. if (!(yield (_fs || _load_fs()).exists(unpluggedPath))) {
  35814. return unpluggedPackages;
  35815. }
  35816. for (var _iterator4 = yield (_fs || _load_fs()).readdir(unpluggedPath), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  35817. var _ref6;
  35818. if (_isArray4) {
  35819. if (_i4 >= _iterator4.length) break;
  35820. _ref6 = _iterator4[_i4++];
  35821. } else {
  35822. _i4 = _iterator4.next();
  35823. if (_i4.done) break;
  35824. _ref6 = _i4.value;
  35825. }
  35826. var unpluggedName = _ref6;
  35827. var nmListing = yield (_fs || _load_fs()).readdir(path.join(unpluggedPath, unpluggedName, 'node_modules'));
  35828. invariant(nmListing.length === 1, 'A single folder should be in the unplugged directory');
  35829. var target = path.join(unpluggedPath, unpluggedName, `node_modules`, nmListing[0]);
  35830. unpluggedPackages.set(unpluggedName, target);
  35831. }
  35832. return unpluggedPackages;
  35833. });
  35834. function listUnpluggedPackageFolders() {
  35835. return _ref5.apply(this, arguments);
  35836. }
  35837. return listUnpluggedPackageFolders;
  35838. }();
  35839. /**
  35840. * Execute lifecycle scripts in the specified directory. Ignoring when the --ignore-scripts flag has been
  35841. * passed.
  35842. */
  35843. Config.prototype.executeLifecycleScript = function executeLifecycleScript(commandName, cwd) {
  35844. if (this.ignoreScripts) {
  35845. return (_promise || _load_promise()).default.resolve();
  35846. } else {
  35847. return (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execFromManifest)(this, commandName, cwd || this.cwd);
  35848. }
  35849. };
  35850. /**
  35851. * Generate an absolute temporary filename location based on the input filename.
  35852. */
  35853. Config.prototype.getTemp = function getTemp(filename) {
  35854. invariant(this.tempFolder, 'No temp folder');
  35855. return path.join(this.tempFolder, filename);
  35856. };
  35857. /**
  35858. * Remote packages may be cached in a file system to be available for offline installation.
  35859. * Second time the same package needs to be installed it will be loaded from there.
  35860. * Given a package's filename, return a path in the offline mirror location.
  35861. */
  35862. Config.prototype.getOfflineMirrorPath = function getOfflineMirrorPath(packageFilename) {
  35863. var mirrorPath = void 0;
  35864. var _arr = ['npm', 'yarn'];
  35865. for (var _i5 = 0; _i5 < _arr.length; _i5++) {
  35866. var _key2 = _arr[_i5];
  35867. var _registry2 = this.registries[_key2];
  35868. if (_registry2 == null) {
  35869. continue;
  35870. }
  35871. var registryMirrorPath = _registry2.config['yarn-offline-mirror'];
  35872. if (registryMirrorPath === false) {
  35873. return null;
  35874. }
  35875. if (registryMirrorPath == null) {
  35876. continue;
  35877. }
  35878. mirrorPath = registryMirrorPath;
  35879. }
  35880. if (mirrorPath == null) {
  35881. return null;
  35882. }
  35883. if (packageFilename == null) {
  35884. return mirrorPath;
  35885. }
  35886. return path.join(mirrorPath, path.basename(packageFilename));
  35887. };
  35888. /**
  35889. * Checker whether the folder input is a valid module folder. We output a yarn metadata
  35890. * file when we've successfully setup a folder so use this as a marker.
  35891. */
  35892. Config.prototype.isValidModuleDest = function () {
  35893. var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) {
  35894. if (!(yield (_fs || _load_fs()).exists(dest))) {
  35895. return false;
  35896. }
  35897. if (!(yield (_fs || _load_fs()).exists(path.join(dest, (_constants || _load_constants()).METADATA_FILENAME)))) {
  35898. return false;
  35899. }
  35900. return true;
  35901. });
  35902. function isValidModuleDest(_x3) {
  35903. return _ref7.apply(this, arguments);
  35904. }
  35905. return isValidModuleDest;
  35906. }();
  35907. /**
  35908. * Read package metadata and normalized package info.
  35909. */
  35910. Config.prototype.readPackageMetadata = function readPackageMetadata(dir) {
  35911. var _this3 = this;
  35912. return this.getCache(`metadata-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  35913. var metadata = yield _this3.readJson(path.join(dir, (_constants || _load_constants()).METADATA_FILENAME));
  35914. var pkg = yield _this3.readManifest(dir, metadata.registry);
  35915. return {
  35916. package: pkg,
  35917. artifacts: metadata.artifacts || [],
  35918. hash: metadata.hash,
  35919. remote: metadata.remote,
  35920. registry: metadata.registry
  35921. };
  35922. }));
  35923. };
  35924. /**
  35925. * Read normalized package info according yarn-metadata.json
  35926. * throw an error if package.json was not found
  35927. */
  35928. Config.prototype.readManifest = function readManifest(dir, priorityRegistry) {
  35929. var _this4 = this;
  35930. var isRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  35931. return this.getCache(`manifest-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  35932. var manifest = yield _this4.maybeReadManifest(dir, priorityRegistry, isRoot);
  35933. if (manifest) {
  35934. return manifest;
  35935. } else {
  35936. throw new (_errors || _load_errors()).MessageError(_this4.reporter.lang('couldntFindPackagejson', dir), 'ENOENT');
  35937. }
  35938. }));
  35939. };
  35940. /**
  35941. * try get the manifest file by looking
  35942. * 1. manifest file in cache
  35943. * 2. manifest file in registry
  35944. */
  35945. Config.prototype.maybeReadManifest = function () {
  35946. var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, priorityRegistry) {
  35947. var isRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  35948. var metadataLoc = path.join(dir, (_constants || _load_constants()).METADATA_FILENAME);
  35949. if (yield (_fs || _load_fs()).exists(metadataLoc)) {
  35950. var metadata = yield this.readJson(metadataLoc);
  35951. if (!priorityRegistry) {
  35952. priorityRegistry = metadata.priorityRegistry;
  35953. }
  35954. if (typeof metadata.manifest !== 'undefined') {
  35955. return metadata.manifest;
  35956. }
  35957. }
  35958. if (priorityRegistry) {
  35959. var file = yield this.tryManifest(dir, priorityRegistry, isRoot);
  35960. if (file) {
  35961. return file;
  35962. }
  35963. }
  35964. for (var _iterator5 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray5 = Array.isArray(_iterator5), _i6 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  35965. var _ref11;
  35966. if (_isArray5) {
  35967. if (_i6 >= _iterator5.length) break;
  35968. _ref11 = _iterator5[_i6++];
  35969. } else {
  35970. _i6 = _iterator5.next();
  35971. if (_i6.done) break;
  35972. _ref11 = _i6.value;
  35973. }
  35974. var _registry3 = _ref11;
  35975. if (priorityRegistry === _registry3) {
  35976. continue;
  35977. }
  35978. var _file = yield this.tryManifest(dir, _registry3, isRoot);
  35979. if (_file) {
  35980. return _file;
  35981. }
  35982. }
  35983. return null;
  35984. });
  35985. function maybeReadManifest(_x5, _x6) {
  35986. return _ref10.apply(this, arguments);
  35987. }
  35988. return maybeReadManifest;
  35989. }();
  35990. /**
  35991. * Read the root manifest.
  35992. */
  35993. Config.prototype.readRootManifest = function readRootManifest() {
  35994. return this.readManifest(this.cwd, 'npm', true);
  35995. };
  35996. /**
  35997. * Try and find package info with the input directory and registry.
  35998. */
  35999. Config.prototype.tryManifest = function () {
  36000. var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, registry, isRoot) {
  36001. var filename = (_index2 || _load_index2()).registries[registry].filename;
  36002. var loc = path.join(dir, filename);
  36003. if (yield (_fs || _load_fs()).exists(loc)) {
  36004. var data = yield this.readJson(loc);
  36005. data._registry = registry;
  36006. data._loc = loc;
  36007. return (0, (_index || _load_index()).default)(data, dir, this, isRoot);
  36008. } else {
  36009. return null;
  36010. }
  36011. });
  36012. function tryManifest(_x8, _x9, _x10) {
  36013. return _ref12.apply(this, arguments);
  36014. }
  36015. return tryManifest;
  36016. }();
  36017. Config.prototype.findManifest = function () {
  36018. var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, isRoot) {
  36019. for (var _iterator6 = (_index2 || _load_index2()).registryNames, _isArray6 = Array.isArray(_iterator6), _i7 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  36020. var _ref14;
  36021. if (_isArray6) {
  36022. if (_i7 >= _iterator6.length) break;
  36023. _ref14 = _iterator6[_i7++];
  36024. } else {
  36025. _i7 = _iterator6.next();
  36026. if (_i7.done) break;
  36027. _ref14 = _i7.value;
  36028. }
  36029. var _registry4 = _ref14;
  36030. var manifest = yield this.tryManifest(dir, _registry4, isRoot);
  36031. if (manifest) {
  36032. return manifest;
  36033. }
  36034. }
  36035. return null;
  36036. });
  36037. function findManifest(_x11, _x12) {
  36038. return _ref13.apply(this, arguments);
  36039. }
  36040. return findManifest;
  36041. }();
  36042. Config.prototype.findWorkspaceRoot = function () {
  36043. var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (initial) {
  36044. var previous = null;
  36045. var current = path.normalize(initial);
  36046. if (!(yield (_fs || _load_fs()).exists(current))) {
  36047. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('folderMissing', current));
  36048. }
  36049. do {
  36050. var manifest = yield this.findManifest(current, true);
  36051. var ws = extractWorkspaces(manifest);
  36052. if (ws && ws.packages) {
  36053. var relativePath = path.relative(current, initial);
  36054. if (relativePath === '' || micromatch([relativePath], ws.packages).length > 0) {
  36055. return current;
  36056. } else {
  36057. return null;
  36058. }
  36059. }
  36060. previous = current;
  36061. current = path.dirname(current);
  36062. } while (current !== previous);
  36063. return null;
  36064. });
  36065. function findWorkspaceRoot(_x13) {
  36066. return _ref15.apply(this, arguments);
  36067. }
  36068. return findWorkspaceRoot;
  36069. }();
  36070. Config.prototype.resolveWorkspaces = function () {
  36071. var _ref16 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (root, rootManifest) {
  36072. var _this5 = this;
  36073. var workspaces = {};
  36074. if (!this.workspacesEnabled) {
  36075. return workspaces;
  36076. }
  36077. var ws = this.getWorkspaces(rootManifest, true);
  36078. var patterns = ws && ws.packages ? ws.packages : [];
  36079. if (!Array.isArray(patterns)) {
  36080. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesSettingMustBeArray'));
  36081. }
  36082. var registryFilenames = (_index2 || _load_index2()).registryNames.map(function (registryName) {
  36083. return _this5.registries[registryName].constructor.filename;
  36084. }).join('|');
  36085. var trailingPattern = `/+(${registryFilenames})`;
  36086. // anything under folder (node_modules) should be ignored, thus use the '**' instead of shallow match "*"
  36087. var ignorePatterns = this.registryFolders.map(function (folder) {
  36088. return `/${folder}/**/+(${registryFilenames})`;
  36089. });
  36090. var files = yield (_promise || _load_promise()).default.all(patterns.map(function (pattern) {
  36091. return (_fs || _load_fs()).glob(pattern.replace(/\/?$/, trailingPattern), {
  36092. cwd: root,
  36093. ignore: ignorePatterns.map(function (ignorePattern) {
  36094. return pattern.replace(/\/?$/, ignorePattern);
  36095. })
  36096. });
  36097. }));
  36098. for (var _iterator7 = new (_set || _load_set()).default((_ref18 = []).concat.apply(_ref18, files)), _isArray7 = Array.isArray(_iterator7), _i8 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  36099. var _ref18;
  36100. var _ref17;
  36101. if (_isArray7) {
  36102. if (_i8 >= _iterator7.length) break;
  36103. _ref17 = _iterator7[_i8++];
  36104. } else {
  36105. _i8 = _iterator7.next();
  36106. if (_i8.done) break;
  36107. _ref17 = _i8.value;
  36108. }
  36109. var file = _ref17;
  36110. var _loc = path.join(root, path.dirname(file));
  36111. var manifest = yield this.findManifest(_loc, false);
  36112. if (!manifest) {
  36113. continue;
  36114. }
  36115. if (!manifest.name) {
  36116. this.reporter.warn(this.reporter.lang('workspaceNameMandatory', _loc));
  36117. continue;
  36118. }
  36119. if (!manifest.version) {
  36120. this.reporter.warn(this.reporter.lang('workspaceVersionMandatory', _loc));
  36121. continue;
  36122. }
  36123. if (Object.prototype.hasOwnProperty.call(workspaces, manifest.name)) {
  36124. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspaceNameDuplicate', manifest.name));
  36125. }
  36126. workspaces[manifest.name] = { loc: _loc, manifest };
  36127. }
  36128. return workspaces;
  36129. });
  36130. function resolveWorkspaces(_x14, _x15) {
  36131. return _ref16.apply(this, arguments);
  36132. }
  36133. return resolveWorkspaces;
  36134. }();
  36135. // workspaces functions
  36136. Config.prototype.getWorkspaces = function getWorkspaces(manifest) {
  36137. var shouldThrow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  36138. if (!manifest || !this.workspacesEnabled) {
  36139. return undefined;
  36140. }
  36141. var ws = extractWorkspaces(manifest);
  36142. if (!ws) {
  36143. return ws;
  36144. }
  36145. // validate eligibility
  36146. var wsCopy = (0, (_extends2 || _load_extends()).default)({}, ws);
  36147. var warnings = [];
  36148. var errors = [];
  36149. // packages
  36150. if (wsCopy.packages && wsCopy.packages.length > 0 && !manifest.private) {
  36151. errors.push(this.reporter.lang('workspacesRequirePrivateProjects'));
  36152. wsCopy = undefined;
  36153. }
  36154. // nohoist
  36155. if (wsCopy && wsCopy.nohoist && wsCopy.nohoist.length > 0) {
  36156. if (!this.workspacesNohoistEnabled) {
  36157. warnings.push(this.reporter.lang('workspacesNohoistDisabled', manifest.name));
  36158. wsCopy.nohoist = undefined;
  36159. } else if (!manifest.private) {
  36160. errors.push(this.reporter.lang('workspacesNohoistRequirePrivatePackages', manifest.name));
  36161. wsCopy.nohoist = undefined;
  36162. }
  36163. }
  36164. if (errors.length > 0 && shouldThrow) {
  36165. throw new (_errors || _load_errors()).MessageError(errors.join('\n'));
  36166. }
  36167. var msg = errors.concat(warnings).join('\n');
  36168. if (msg.length > 0) {
  36169. this.reporter.warn(msg);
  36170. }
  36171. return wsCopy;
  36172. };
  36173. /**
  36174. * Description
  36175. */
  36176. Config.prototype.getFolder = function getFolder(pkg) {
  36177. var registryName = pkg._registry;
  36178. if (!registryName) {
  36179. var ref = pkg._reference;
  36180. invariant(ref, 'expected reference');
  36181. registryName = ref.registry;
  36182. }
  36183. return this.registries[registryName].folder;
  36184. };
  36185. /**
  36186. * Get root manifests.
  36187. */
  36188. Config.prototype.getRootManifests = function () {
  36189. var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  36190. var manifests = {};
  36191. for (var _iterator8 = (_index2 || _load_index2()).registryNames, _isArray8 = Array.isArray(_iterator8), _i9 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
  36192. var _ref20;
  36193. if (_isArray8) {
  36194. if (_i9 >= _iterator8.length) break;
  36195. _ref20 = _iterator8[_i9++];
  36196. } else {
  36197. _i9 = _iterator8.next();
  36198. if (_i9.done) break;
  36199. _ref20 = _i9.value;
  36200. }
  36201. var _registryName = _ref20;
  36202. var _registry5 = (_index2 || _load_index2()).registries[_registryName];
  36203. var jsonLoc = path.join(this.cwd, _registry5.filename);
  36204. var _object = {};
  36205. var _exists = false;
  36206. var _indent = void 0;
  36207. if (yield (_fs || _load_fs()).exists(jsonLoc)) {
  36208. _exists = true;
  36209. var info = yield this.readJson(jsonLoc, (_fs || _load_fs()).readJsonAndFile);
  36210. _object = info.object;
  36211. _indent = detectIndent(info.content).indent || undefined;
  36212. }
  36213. manifests[_registryName] = { loc: jsonLoc, object: _object, exists: _exists, indent: _indent };
  36214. }
  36215. return manifests;
  36216. });
  36217. function getRootManifests() {
  36218. return _ref19.apply(this, arguments);
  36219. }
  36220. return getRootManifests;
  36221. }();
  36222. /**
  36223. * Save root manifests.
  36224. */
  36225. Config.prototype.saveRootManifests = function () {
  36226. var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (manifests) {
  36227. for (var _iterator9 = (_index2 || _load_index2()).registryNames, _isArray9 = Array.isArray(_iterator9), _i10 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
  36228. var _ref22;
  36229. if (_isArray9) {
  36230. if (_i10 >= _iterator9.length) break;
  36231. _ref22 = _iterator9[_i10++];
  36232. } else {
  36233. _i10 = _iterator9.next();
  36234. if (_i10.done) break;
  36235. _ref22 = _i10.value;
  36236. }
  36237. var _registryName2 = _ref22;
  36238. var _manifests$_registryN = manifests[_registryName2],
  36239. _loc2 = _manifests$_registryN.loc,
  36240. _object2 = _manifests$_registryN.object,
  36241. _exists2 = _manifests$_registryN.exists,
  36242. _indent2 = _manifests$_registryN.indent;
  36243. if (!_exists2 && !(0, (_keys || _load_keys()).default)(_object2).length) {
  36244. continue;
  36245. }
  36246. for (var _iterator10 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray10 = Array.isArray(_iterator10), _i11 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
  36247. var _ref23;
  36248. if (_isArray10) {
  36249. if (_i11 >= _iterator10.length) break;
  36250. _ref23 = _iterator10[_i11++];
  36251. } else {
  36252. _i11 = _iterator10.next();
  36253. if (_i11.done) break;
  36254. _ref23 = _i11.value;
  36255. }
  36256. var field = _ref23;
  36257. if (_object2[field]) {
  36258. _object2[field] = sortObject(_object2[field]);
  36259. }
  36260. }
  36261. yield (_fs || _load_fs()).writeFilePreservingEol(_loc2, (0, (_stringify || _load_stringify()).default)(_object2, null, _indent2 || (_constants || _load_constants()).DEFAULT_INDENT) + '\n');
  36262. }
  36263. });
  36264. function saveRootManifests(_x17) {
  36265. return _ref21.apply(this, arguments);
  36266. }
  36267. return saveRootManifests;
  36268. }();
  36269. /**
  36270. * Call the passed factory (defaults to fs.readJson) and rethrow a pretty error message if it was the result
  36271. * of a syntax error.
  36272. */
  36273. Config.prototype.readJson = function readJson(loc) {
  36274. var factory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_fs || _load_fs()).readJson;
  36275. try {
  36276. return factory(loc);
  36277. } catch (err) {
  36278. if (err instanceof SyntaxError) {
  36279. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('jsonError', loc, err.message));
  36280. } else {
  36281. throw err;
  36282. }
  36283. }
  36284. };
  36285. Config.create = function () {
  36286. var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  36287. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  36288. var reporter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new (_index3 || _load_index3()).NoopReporter();
  36289. var config = new Config(reporter);
  36290. yield config.init(opts);
  36291. return config;
  36292. });
  36293. function create() {
  36294. return _ref24.apply(this, arguments);
  36295. }
  36296. return create;
  36297. }();
  36298. return Config;
  36299. }();
  36300. exports.default = Config;
  36301. function extractWorkspaces(manifest) {
  36302. if (!manifest || !manifest.workspaces) {
  36303. return undefined;
  36304. }
  36305. if (Array.isArray(manifest.workspaces)) {
  36306. return { packages: manifest.workspaces };
  36307. }
  36308. if (manifest.workspaces.packages && Array.isArray(manifest.workspaces.packages) || manifest.workspaces.nohoist && Array.isArray(manifest.workspaces.nohoist)) {
  36309. return manifest.workspaces;
  36310. }
  36311. return undefined;
  36312. }
  36313. /***/ }),
  36314. /* 151 */
  36315. /***/ (function(module, exports) {
  36316. module.exports = require("net");
  36317. /***/ }),
  36318. /* 152 */
  36319. /***/ (function(module, exports, __webpack_require__) {
  36320. "use strict";
  36321. var _classCallCheck2;
  36322. function _load_classCallCheck() {
  36323. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  36324. }
  36325. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  36326. var chalk = __webpack_require__(33);
  36327. var figures = __webpack_require__(233);
  36328. /**
  36329. * Separator object
  36330. * Used to space/separate choices group
  36331. * @constructor
  36332. * @param {String} line Separation line content (facultative)
  36333. */
  36334. var Separator = function () {
  36335. function Separator(line) {
  36336. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Separator);
  36337. this.type = 'separator';
  36338. this.line = chalk.dim(line || new Array(15).join(figures.line));
  36339. }
  36340. /**
  36341. * Stringify separator
  36342. * @return {String} the separator display string
  36343. */
  36344. Separator.prototype.toString = function toString() {
  36345. return this.line;
  36346. };
  36347. return Separator;
  36348. }();
  36349. /**
  36350. * Helper function returning false if object is a separator
  36351. * @param {Object} obj object to test against
  36352. * @return {Boolean} `false` if object is a separator
  36353. */
  36354. Separator.exclude = function (obj) {
  36355. return obj.type !== 'separator';
  36356. };
  36357. module.exports = Separator;
  36358. /***/ }),
  36359. /* 153 */
  36360. /***/ (function(module, exports, __webpack_require__) {
  36361. "use strict";
  36362. var _classCallCheck2;
  36363. function _load_classCallCheck() {
  36364. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  36365. }
  36366. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  36367. var _ = __webpack_require__(45);
  36368. var chalk = __webpack_require__(33);
  36369. /**
  36370. * The paginator keeps track of a pointer index in a list and returns
  36371. * a subset of the choices if the list is too long.
  36372. */
  36373. var Paginator = function () {
  36374. function Paginator(screen) {
  36375. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Paginator);
  36376. this.pointer = 0;
  36377. this.lastIndex = 0;
  36378. this.screen = screen;
  36379. }
  36380. Paginator.prototype.paginate = function paginate(output, active, pageSize) {
  36381. pageSize = pageSize || 7;
  36382. var middleOfList = Math.floor(pageSize / 2);
  36383. var lines = output.split('\n');
  36384. if (this.screen) {
  36385. lines = this.screen.breakLines(lines);
  36386. active = _.sum(lines.map(function (lineParts) {
  36387. return lineParts.length;
  36388. }).splice(0, active));
  36389. lines = _.flatten(lines);
  36390. }
  36391. // Make sure there's enough lines to paginate
  36392. if (lines.length <= pageSize) {
  36393. return output;
  36394. }
  36395. // Move the pointer only when the user go down and limit it to the middle of the list
  36396. if (this.pointer < middleOfList && this.lastIndex < active && active - this.lastIndex < pageSize) {
  36397. this.pointer = Math.min(middleOfList, this.pointer + active - this.lastIndex);
  36398. }
  36399. this.lastIndex = active;
  36400. // Duplicate the lines so it give an infinite list look
  36401. var infinite = _.flatten([lines, lines, lines]);
  36402. var topIndex = Math.max(0, active + lines.length - this.pointer);
  36403. var section = infinite.splice(topIndex, pageSize).join('\n');
  36404. return section + '\n' + chalk.dim('(Move up and down to reveal more choices)');
  36405. };
  36406. return Paginator;
  36407. }();
  36408. module.exports = Paginator;
  36409. /***/ }),
  36410. /* 154 */
  36411. /***/ (function(module, exports, __webpack_require__) {
  36412. "use strict";
  36413. Object.defineProperty(exports, "__esModule", {
  36414. value: true
  36415. });
  36416. exports.run = exports.Add = undefined;
  36417. var _keys;
  36418. function _load_keys() {
  36419. return _keys = _interopRequireDefault(__webpack_require__(14));
  36420. }
  36421. var _set;
  36422. function _load_set() {
  36423. return _set = _interopRequireDefault(__webpack_require__(16));
  36424. }
  36425. var _asyncToGenerator2;
  36426. function _load_asyncToGenerator() {
  36427. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  36428. }
  36429. var _getIterator2;
  36430. function _load_getIterator() {
  36431. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  36432. }
  36433. var _extends2;
  36434. function _load_extends() {
  36435. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  36436. }
  36437. var _classCallCheck2;
  36438. function _load_classCallCheck() {
  36439. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  36440. }
  36441. var _possibleConstructorReturn2;
  36442. function _load_possibleConstructorReturn() {
  36443. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  36444. }
  36445. var _inherits2;
  36446. function _load_inherits() {
  36447. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  36448. }
  36449. var run = exports.run = function () {
  36450. var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  36451. if (!args.length) {
  36452. throw new (_errors || _load_errors()).MessageError(reporter.lang('missingAddDependencies'));
  36453. }
  36454. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
  36455. yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  36456. var install = new Add(args, flags, config, reporter, lockfile);
  36457. yield install.init();
  36458. }));
  36459. });
  36460. return function run(_x5, _x6, _x7, _x8) {
  36461. return _ref13.apply(this, arguments);
  36462. };
  36463. }();
  36464. exports.hasWrapper = hasWrapper;
  36465. exports.setFlags = setFlags;
  36466. var _lockfile;
  36467. function _load_lockfile() {
  36468. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  36469. }
  36470. var _normalizePattern2;
  36471. function _load_normalizePattern() {
  36472. return _normalizePattern2 = __webpack_require__(52);
  36473. }
  36474. var _workspaceLayout;
  36475. function _load_workspaceLayout() {
  36476. return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
  36477. }
  36478. var _index;
  36479. function _load_index() {
  36480. return _index = __webpack_require__(75);
  36481. }
  36482. var _list;
  36483. function _load_list() {
  36484. return _list = __webpack_require__(294);
  36485. }
  36486. var _install;
  36487. function _load_install() {
  36488. return _install = __webpack_require__(41);
  36489. }
  36490. var _errors;
  36491. function _load_errors() {
  36492. return _errors = __webpack_require__(6);
  36493. }
  36494. var _constants;
  36495. function _load_constants() {
  36496. return _constants = _interopRequireWildcard(__webpack_require__(13));
  36497. }
  36498. var _fs;
  36499. function _load_fs() {
  36500. return _fs = _interopRequireWildcard(__webpack_require__(8));
  36501. }
  36502. var _invariant;
  36503. function _load_invariant() {
  36504. return _invariant = _interopRequireDefault(__webpack_require__(15));
  36505. }
  36506. var _path;
  36507. function _load_path() {
  36508. return _path = _interopRequireDefault(__webpack_require__(1));
  36509. }
  36510. var _semver;
  36511. function _load_semver() {
  36512. return _semver = _interopRequireDefault(__webpack_require__(27));
  36513. }
  36514. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  36515. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  36516. var SILENCE_DEPENDENCY_TYPE_WARNINGS = ['upgrade', 'upgrade-interactive'];
  36517. var Add = exports.Add = function (_Install) {
  36518. (0, (_inherits2 || _load_inherits()).default)(Add, _Install);
  36519. function Add(args, flags, config, reporter, lockfile) {
  36520. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Add);
  36521. var workspaceRootIsCwd = config.cwd === config.lockfileFolder;
  36522. var _flags = flags ? (0, (_extends2 || _load_extends()).default)({}, flags, { workspaceRootIsCwd }) : { workspaceRootIsCwd };
  36523. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Install.call(this, _flags, config, reporter, lockfile));
  36524. _this.args = args;
  36525. // only one flag is supported, so we can figure out which one was passed to `yarn add`
  36526. _this.flagToOrigin = [flags.dev && 'devDependencies', flags.optional && 'optionalDependencies', flags.peer && 'peerDependencies', 'dependencies'].filter(Boolean).shift();
  36527. return _this;
  36528. }
  36529. /**
  36530. * TODO
  36531. */
  36532. Add.prototype.prepareRequests = function prepareRequests(requests) {
  36533. var requestsWithArgs = requests.slice();
  36534. for (var _iterator = this.args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  36535. var _ref;
  36536. if (_isArray) {
  36537. if (_i >= _iterator.length) break;
  36538. _ref = _iterator[_i++];
  36539. } else {
  36540. _i = _iterator.next();
  36541. if (_i.done) break;
  36542. _ref = _i.value;
  36543. }
  36544. var _pattern = _ref;
  36545. requestsWithArgs.push({
  36546. pattern: _pattern,
  36547. registry: 'npm',
  36548. optional: false
  36549. });
  36550. }
  36551. return requestsWithArgs;
  36552. };
  36553. /**
  36554. * returns version for a pattern based on Manifest
  36555. */
  36556. Add.prototype.getPatternVersion = function getPatternVersion(pattern, pkg) {
  36557. var tilde = this.flags.tilde;
  36558. var configPrefix = String(this.config.getOption('save-prefix'));
  36559. var exact = this.flags.exact || Boolean(this.config.getOption('save-exact')) || configPrefix === '';
  36560. var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern),
  36561. hasVersion = _normalizePattern.hasVersion,
  36562. range = _normalizePattern.range;
  36563. var version = void 0;
  36564. if ((0, (_index || _load_index()).getExoticResolver)(pattern)) {
  36565. // wasn't a name/range tuple so this is just a raw exotic pattern
  36566. version = pattern;
  36567. } else if (hasVersion && range && ((_semver || _load_semver()).default.satisfies(pkg.version, range) || (0, (_index || _load_index()).getExoticResolver)(range))) {
  36568. // if the user specified a range then use it verbatim
  36569. version = range;
  36570. }
  36571. if (!version || (_semver || _load_semver()).default.valid(version)) {
  36572. var prefix = configPrefix || '^';
  36573. if (tilde) {
  36574. prefix = '~';
  36575. } else if (version || exact) {
  36576. prefix = '';
  36577. }
  36578. version = `${prefix}${pkg.version}`;
  36579. }
  36580. return version;
  36581. };
  36582. Add.prototype.preparePatterns = function preparePatterns(patterns) {
  36583. var preparedPatterns = patterns.slice();
  36584. for (var _iterator2 = this.resolver.dedupePatterns(this.args), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  36585. var _ref2;
  36586. if (_isArray2) {
  36587. if (_i2 >= _iterator2.length) break;
  36588. _ref2 = _iterator2[_i2++];
  36589. } else {
  36590. _i2 = _iterator2.next();
  36591. if (_i2.done) break;
  36592. _ref2 = _i2.value;
  36593. }
  36594. var _pattern2 = _ref2;
  36595. var pkg = this.resolver.getResolvedPattern(_pattern2);
  36596. (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${_pattern2}`);
  36597. var _version = this.getPatternVersion(_pattern2, pkg);
  36598. var newPattern = `${pkg.name}@${_version}`;
  36599. preparedPatterns.push(newPattern);
  36600. this.addedPatterns.push(newPattern);
  36601. if (newPattern === _pattern2) {
  36602. continue;
  36603. }
  36604. this.resolver.replacePattern(_pattern2, newPattern);
  36605. }
  36606. return preparedPatterns;
  36607. };
  36608. Add.prototype.preparePatternsForLinking = function preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) {
  36609. // remove the newly added patterns if cwd != root and update the in-memory package dependency instead
  36610. if (cwdIsRoot) {
  36611. return patterns;
  36612. }
  36613. var manifest = void 0;
  36614. var cwdPackage = `${cwdManifest.name}@${cwdManifest.version}`;
  36615. try {
  36616. manifest = this.resolver.getStrictResolvedPattern(cwdPackage);
  36617. } catch (e) {
  36618. this.reporter.warn(this.reporter.lang('unknownPackage', cwdPackage));
  36619. return patterns;
  36620. }
  36621. var newPatterns = patterns;
  36622. this._iterateAddedPackages(function (pattern, registry, dependencyType, pkgName, version) {
  36623. // remove added package from patterns list
  36624. var filtered = newPatterns.filter(function (p) {
  36625. return p !== pattern;
  36626. });
  36627. (0, (_invariant || _load_invariant()).default)(newPatterns.length - filtered.length > 0, `expect added pattern '${pattern}' in the list: ${patterns.toString()}`);
  36628. newPatterns = filtered;
  36629. // add new package into in-memory manifest so they can be linked properly
  36630. manifest[dependencyType] = manifest[dependencyType] || {};
  36631. if (manifest[dependencyType][pkgName] === version) {
  36632. // package already existed
  36633. return;
  36634. }
  36635. // update dependencies in the manifest
  36636. (0, (_invariant || _load_invariant()).default)(manifest._reference, 'manifest._reference should not be null');
  36637. var ref = manifest._reference;
  36638. ref['dependencies'] = ref['dependencies'] || [];
  36639. ref['dependencies'].push(pattern);
  36640. });
  36641. return newPatterns;
  36642. };
  36643. Add.prototype.bailout = function () {
  36644. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) {
  36645. var lockfileCache = this.lockfile.cache;
  36646. if (!lockfileCache) {
  36647. return false;
  36648. }
  36649. var match = yield this.integrityChecker.check(patterns, lockfileCache, this.flags, workspaceLayout);
  36650. var haveLockfile = yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME));
  36651. if (match.integrityFileMissing && haveLockfile) {
  36652. // Integrity file missing, force script installations
  36653. this.scripts.setForce(true);
  36654. }
  36655. return false;
  36656. });
  36657. function bailout(_x, _x2) {
  36658. return _ref3.apply(this, arguments);
  36659. }
  36660. return bailout;
  36661. }();
  36662. /**
  36663. * Description
  36664. */
  36665. Add.prototype.init = function () {
  36666. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  36667. var isWorkspaceRoot = this.config.workspaceRootFolder && this.config.cwd === this.config.workspaceRootFolder;
  36668. // running "yarn add something" in a workspace root is often a mistake
  36669. if (isWorkspaceRoot && !this.flags.ignoreWorkspaceRootCheck) {
  36670. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesAddRootCheck'));
  36671. }
  36672. this.addedPatterns = [];
  36673. var patterns = yield (_install || _load_install()).Install.prototype.init.call(this);
  36674. yield this.maybeOutputSaveTree(patterns);
  36675. return patterns;
  36676. });
  36677. function init() {
  36678. return _ref4.apply(this, arguments);
  36679. }
  36680. return init;
  36681. }();
  36682. Add.prototype.applyChanges = function () {
  36683. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (manifests) {
  36684. var _this2 = this;
  36685. yield (_install || _load_install()).Install.prototype.applyChanges.call(this, manifests);
  36686. // fill rootPatternsToOrigin without `excludePatterns`
  36687. yield (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this);
  36688. this._iterateAddedPackages(function (pattern, registry, dependencyType, pkgName, version) {
  36689. // add it to manifest
  36690. var object = manifests[registry].object;
  36691. object[dependencyType] = object[dependencyType] || {};
  36692. object[dependencyType][pkgName] = version;
  36693. if (SILENCE_DEPENDENCY_TYPE_WARNINGS.indexOf(_this2.config.commandName) === -1 && dependencyType !== _this2.flagToOrigin) {
  36694. _this2.reporter.warn(_this2.reporter.lang('moduleAlreadyInManifest', pkgName, dependencyType, _this2.flagToOrigin));
  36695. }
  36696. });
  36697. return true;
  36698. });
  36699. function applyChanges(_x3) {
  36700. return _ref5.apply(this, arguments);
  36701. }
  36702. return applyChanges;
  36703. }();
  36704. /**
  36705. * Description
  36706. */
  36707. Add.prototype.fetchRequestFromCwd = function fetchRequestFromCwd() {
  36708. return (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this, this.args);
  36709. };
  36710. /**
  36711. * Output a tree of any newly added dependencies.
  36712. */
  36713. Add.prototype.maybeOutputSaveTree = function () {
  36714. var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns) {
  36715. // don't limit the shown tree depth
  36716. var opts = {
  36717. reqDepth: 0
  36718. };
  36719. // restore the original patterns
  36720. var merged = [].concat(patterns, this.addedPatterns);
  36721. var _ref7 = yield (0, (_list || _load_list()).buildTree)(this.resolver, this.linker, merged, opts, true, true),
  36722. trees = _ref7.trees,
  36723. count = _ref7.count;
  36724. if (count === 1) {
  36725. this.reporter.success(this.reporter.lang('savedNewDependency'));
  36726. } else {
  36727. this.reporter.success(this.reporter.lang('savedNewDependencies', count));
  36728. }
  36729. if (!count) {
  36730. return;
  36731. }
  36732. var resolverPatterns = new (_set || _load_set()).default();
  36733. for (var _iterator3 = patterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  36734. var _ref8;
  36735. if (_isArray3) {
  36736. if (_i3 >= _iterator3.length) break;
  36737. _ref8 = _iterator3[_i3++];
  36738. } else {
  36739. _i3 = _iterator3.next();
  36740. if (_i3.done) break;
  36741. _ref8 = _i3.value;
  36742. }
  36743. var _pattern3 = _ref8;
  36744. var _ref10 = this.resolver.getResolvedPattern(_pattern3) || {},
  36745. _version2 = _ref10.version,
  36746. name = _ref10.name;
  36747. resolverPatterns.add(`${name}@${_version2}`);
  36748. }
  36749. var directRequireDependencies = trees.filter(function (_ref9) {
  36750. var name = _ref9.name;
  36751. return resolverPatterns.has(name);
  36752. });
  36753. this.reporter.info(this.reporter.lang('directDependencies'));
  36754. this.reporter.tree('newDirectDependencies', directRequireDependencies);
  36755. this.reporter.info(this.reporter.lang('allDependencies'));
  36756. this.reporter.tree('newAllDependencies', trees);
  36757. });
  36758. function maybeOutputSaveTree(_x4) {
  36759. return _ref6.apply(this, arguments);
  36760. }
  36761. return maybeOutputSaveTree;
  36762. }();
  36763. /**
  36764. * Save added packages to manifest if any of the --save flags were used.
  36765. */
  36766. Add.prototype.savePackages = function () {
  36767. var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {});
  36768. function savePackages() {
  36769. return _ref11.apply(this, arguments);
  36770. }
  36771. return savePackages;
  36772. }();
  36773. Add.prototype._iterateAddedPackages = function _iterateAddedPackages(f) {
  36774. var _this3 = this;
  36775. var patternOrigins = (0, (_keys || _load_keys()).default)(this.rootPatternsToOrigin);
  36776. // add new patterns to their appropriate registry manifest
  36777. var _loop = function _loop(_pattern4) {
  36778. var pkg = _this3.resolver.getResolvedPattern(_pattern4);
  36779. (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${_pattern4}`);
  36780. var version = _this3.getPatternVersion(_pattern4, pkg);
  36781. var ref = pkg._reference;
  36782. (0, (_invariant || _load_invariant()).default)(ref, 'expected package reference');
  36783. // lookup the package to determine dependency type; used during `yarn upgrade`
  36784. var depType = patternOrigins.reduce(function (acc, prev) {
  36785. if (prev.indexOf(`${pkg.name}@`) === 0) {
  36786. return _this3.rootPatternsToOrigin[prev];
  36787. }
  36788. return acc;
  36789. }, null);
  36790. // depType is calculated when `yarn upgrade` command is used
  36791. var target = depType || _this3.flagToOrigin;
  36792. f(_pattern4, ref.registry, target, pkg.name, version);
  36793. };
  36794. for (var _iterator4 = this.addedPatterns, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  36795. var _ref12;
  36796. if (_isArray4) {
  36797. if (_i4 >= _iterator4.length) break;
  36798. _ref12 = _iterator4[_i4++];
  36799. } else {
  36800. _i4 = _iterator4.next();
  36801. if (_i4.done) break;
  36802. _ref12 = _i4.value;
  36803. }
  36804. var _pattern4 = _ref12;
  36805. _loop(_pattern4);
  36806. }
  36807. };
  36808. return Add;
  36809. }((_install || _load_install()).Install);
  36810. function hasWrapper(commander) {
  36811. return true;
  36812. }
  36813. function setFlags(commander) {
  36814. commander.description('Installs a package and any packages that it depends on.');
  36815. commander.usage('add [packages ...] [flags]');
  36816. commander.option('-W, --ignore-workspace-root-check', 'required to run yarn add inside a workspace root');
  36817. commander.option('-D, --dev', 'save package to your `devDependencies`');
  36818. commander.option('-P, --peer', 'save package to your `peerDependencies`');
  36819. commander.option('-O, --optional', 'save package to your `optionalDependencies`');
  36820. commander.option('-E, --exact', 'install exact version');
  36821. commander.option('-T, --tilde', 'install most recent release with the same minor version');
  36822. commander.option('-A, --audit', 'Run vulnerability audit on installed packages');
  36823. }
  36824. /***/ }),
  36825. /* 155 */
  36826. /***/ (function(module, exports, __webpack_require__) {
  36827. "use strict";
  36828. Object.defineProperty(exports, "__esModule", {
  36829. value: true
  36830. });
  36831. exports.run = exports.pack = exports.packTarball = undefined;
  36832. var _promise;
  36833. function _load_promise() {
  36834. return _promise = _interopRequireDefault(__webpack_require__(7));
  36835. }
  36836. var _from;
  36837. function _load_from() {
  36838. return _from = _interopRequireDefault(__webpack_require__(53));
  36839. }
  36840. var _set;
  36841. function _load_set() {
  36842. return _set = _interopRequireDefault(__webpack_require__(16));
  36843. }
  36844. var _getIterator2;
  36845. function _load_getIterator() {
  36846. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  36847. }
  36848. var _asyncToGenerator2;
  36849. function _load_asyncToGenerator() {
  36850. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  36851. }
  36852. var packTarball = exports.packTarball = function () {
  36853. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
  36854. var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  36855. mapHeader = _ref2.mapHeader;
  36856. var pkg = yield config.readRootManifest();
  36857. var bundleDependencies = pkg.bundleDependencies,
  36858. main = pkg.main,
  36859. onlyFiles = pkg.files;
  36860. // include required files
  36861. var filters = NEVER_IGNORE.slice();
  36862. // include default filters unless `files` is used
  36863. if (!onlyFiles) {
  36864. filters = filters.concat(DEFAULT_IGNORE);
  36865. }
  36866. if (main) {
  36867. filters = filters.concat((0, (_filter || _load_filter()).ignoreLinesToRegex)(['!/' + main]));
  36868. }
  36869. // include bundleDependencies
  36870. var bundleDependenciesFiles = [];
  36871. if (bundleDependencies) {
  36872. for (var _iterator = bundleDependencies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  36873. var _ref3;
  36874. if (_isArray) {
  36875. if (_i >= _iterator.length) break;
  36876. _ref3 = _iterator[_i++];
  36877. } else {
  36878. _i = _iterator.next();
  36879. if (_i.done) break;
  36880. _ref3 = _i.value;
  36881. }
  36882. var dependency = _ref3;
  36883. var dependencyList = depsFor(dependency, config.cwd);
  36884. for (var _iterator2 = dependencyList, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  36885. var _ref4;
  36886. if (_isArray2) {
  36887. if (_i2 >= _iterator2.length) break;
  36888. _ref4 = _iterator2[_i2++];
  36889. } else {
  36890. _i2 = _iterator2.next();
  36891. if (_i2.done) break;
  36892. _ref4 = _i2.value;
  36893. }
  36894. var dep = _ref4;
  36895. var filesForBundledDep = yield (_fs || _load_fs()).walk(dep.baseDir, null, new (_set || _load_set()).default(FOLDERS_IGNORE));
  36896. bundleDependenciesFiles = bundleDependenciesFiles.concat(filesForBundledDep);
  36897. }
  36898. }
  36899. }
  36900. // `files` field
  36901. if (onlyFiles) {
  36902. var lines = ['*'];
  36903. lines = lines.concat(onlyFiles.map(function (filename) {
  36904. return `!${filename}`;
  36905. }), onlyFiles.map(function (filename) {
  36906. return `!${path.join(filename, '**')}`;
  36907. }));
  36908. var regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, './');
  36909. filters = filters.concat(regexes);
  36910. }
  36911. var files = yield (_fs || _load_fs()).walk(config.cwd, null, new (_set || _load_set()).default(FOLDERS_IGNORE));
  36912. var dotIgnoreFiles = (0, (_filter || _load_filter()).filterOverridenGitignores)(files);
  36913. // create ignores
  36914. for (var _iterator3 = dotIgnoreFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  36915. var _ref5;
  36916. if (_isArray3) {
  36917. if (_i3 >= _iterator3.length) break;
  36918. _ref5 = _iterator3[_i3++];
  36919. } else {
  36920. _i3 = _iterator3.next();
  36921. if (_i3.done) break;
  36922. _ref5 = _i3.value;
  36923. }
  36924. var file = _ref5;
  36925. var raw = yield (_fs || _load_fs()).readFile(file.absolute);
  36926. var _lines = raw.split('\n');
  36927. var _regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(_lines, path.dirname(file.relative));
  36928. filters = filters.concat(_regexes);
  36929. }
  36930. // files to definitely keep, takes precedence over ignore filter
  36931. var keepFiles = new (_set || _load_set()).default();
  36932. // files to definitely ignore
  36933. var ignoredFiles = new (_set || _load_set()).default();
  36934. // list of files that didn't match any of our patterns, if a directory in the chain above was matched
  36935. // then we should inherit it
  36936. var possibleKeepFiles = new (_set || _load_set()).default();
  36937. // apply filters
  36938. (0, (_filter || _load_filter()).sortFilter)(files, filters, keepFiles, possibleKeepFiles, ignoredFiles);
  36939. // add the files for the bundled dependencies to the set of files to keep
  36940. for (var _iterator4 = bundleDependenciesFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  36941. var _ref6;
  36942. if (_isArray4) {
  36943. if (_i4 >= _iterator4.length) break;
  36944. _ref6 = _iterator4[_i4++];
  36945. } else {
  36946. _i4 = _iterator4.next();
  36947. if (_i4.done) break;
  36948. _ref6 = _i4.value;
  36949. }
  36950. var _file = _ref6;
  36951. var realPath = yield (_fs || _load_fs()).realpath(config.cwd);
  36952. keepFiles.add(path.relative(realPath, _file.absolute));
  36953. }
  36954. return packWithIgnoreAndHeaders(config.cwd, function (name) {
  36955. var relative = path.relative(config.cwd, name);
  36956. // Don't ignore directories, since we need to recurse inside them to check for unignored files.
  36957. if (fs2.lstatSync(name).isDirectory()) {
  36958. var isParentOfKeptFile = (0, (_from || _load_from()).default)(keepFiles).some(function (name) {
  36959. return !path.relative(relative, name).startsWith('..');
  36960. });
  36961. return !isParentOfKeptFile;
  36962. }
  36963. // Otherwise, ignore a file if we're not supposed to keep it.
  36964. return !keepFiles.has(relative);
  36965. }, { mapHeader });
  36966. });
  36967. return function packTarball(_x) {
  36968. return _ref.apply(this, arguments);
  36969. };
  36970. }();
  36971. var pack = exports.pack = function () {
  36972. var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
  36973. var packer = yield packTarball(config);
  36974. var compressor = packer.pipe(new zlib.Gzip());
  36975. return compressor;
  36976. });
  36977. return function pack(_x4) {
  36978. return _ref8.apply(this, arguments);
  36979. };
  36980. }();
  36981. var run = exports.run = function () {
  36982. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  36983. var pkg = yield config.readRootManifest();
  36984. if (!pkg.name) {
  36985. throw new (_errors || _load_errors()).MessageError(reporter.lang('noName'));
  36986. }
  36987. if (!pkg.version) {
  36988. throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion'));
  36989. }
  36990. var normaliseScope = function normaliseScope(name) {
  36991. return name[0] === '@' ? name.substr(1).replace('/', '-') : name;
  36992. };
  36993. var filename = flags.filename || path.join(config.cwd, `${normaliseScope(pkg.name)}-v${pkg.version}.tgz`);
  36994. yield config.executeLifecycleScript('prepack');
  36995. var stream = yield pack(config);
  36996. yield new (_promise || _load_promise()).default(function (resolve, reject) {
  36997. stream.pipe(fs2.createWriteStream(filename));
  36998. stream.on('error', reject);
  36999. stream.on('close', resolve);
  37000. });
  37001. yield config.executeLifecycleScript('postpack');
  37002. reporter.success(reporter.lang('packWroteTarball', filename));
  37003. });
  37004. return function run(_x5, _x6, _x7, _x8) {
  37005. return _ref9.apply(this, arguments);
  37006. };
  37007. }();
  37008. exports.packWithIgnoreAndHeaders = packWithIgnoreAndHeaders;
  37009. exports.setFlags = setFlags;
  37010. exports.hasWrapper = hasWrapper;
  37011. var _fs;
  37012. function _load_fs() {
  37013. return _fs = _interopRequireWildcard(__webpack_require__(8));
  37014. }
  37015. var _filter;
  37016. function _load_filter() {
  37017. return _filter = __webpack_require__(309);
  37018. }
  37019. var _errors;
  37020. function _load_errors() {
  37021. return _errors = __webpack_require__(6);
  37022. }
  37023. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  37024. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  37025. var zlib = __webpack_require__(188);
  37026. var path = __webpack_require__(1);
  37027. var tar = __webpack_require__(184);
  37028. var fs2 = __webpack_require__(12);
  37029. var depsFor = __webpack_require__(738);
  37030. var FOLDERS_IGNORE = [
  37031. // never allow version control folders
  37032. '.git', 'CVS', '.svn', '.hg', 'node_modules'];
  37033. var DEFAULT_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([].concat(FOLDERS_IGNORE, [
  37034. // ignore cruft
  37035. 'yarn.lock', '.lock-wscript', '.wafpickle-{0..9}', '*.swp', '._*', 'npm-debug.log', 'yarn-error.log', '.npmrc', '.yarnrc', '.yarnrc.yml', '.npmignore', '.gitignore', '.DS_Store']));
  37036. var NEVER_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([
  37037. // never ignore these files
  37038. '!/package.json', '!/readme*', '!/+(license|licence)*', '!/+(changes|changelog|history)*']);
  37039. function packWithIgnoreAndHeaders(cwd, ignoreFunction) {
  37040. var _ref7 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  37041. mapHeader = _ref7.mapHeader;
  37042. return tar.pack(cwd, {
  37043. ignore: ignoreFunction,
  37044. sort: true,
  37045. map: function map(header) {
  37046. var suffix = header.name === '.' ? '' : `/${header.name}`;
  37047. header.name = `package${suffix}`;
  37048. delete header.uid;
  37049. delete header.gid;
  37050. return mapHeader ? mapHeader(header) : header;
  37051. }
  37052. });
  37053. }
  37054. function setFlags(commander) {
  37055. commander.description('Creates a compressed gzip archive of package dependencies.');
  37056. commander.option('-f, --filename <filename>', 'filename');
  37057. }
  37058. function hasWrapper(commander, args) {
  37059. return true;
  37060. }
  37061. /***/ }),
  37062. /* 156 */
  37063. /***/ (function(module, exports, __webpack_require__) {
  37064. "use strict";
  37065. Object.defineProperty(exports, "__esModule", {
  37066. value: true
  37067. });
  37068. var _stringify;
  37069. function _load_stringify() {
  37070. return _stringify = _interopRequireDefault(__webpack_require__(37));
  37071. }
  37072. var _getIterator2;
  37073. function _load_getIterator() {
  37074. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  37075. }
  37076. var _keys;
  37077. function _load_keys() {
  37078. return _keys = _interopRequireDefault(__webpack_require__(14));
  37079. }
  37080. var _asyncToGenerator2;
  37081. function _load_asyncToGenerator() {
  37082. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  37083. }
  37084. var _promise;
  37085. function _load_promise() {
  37086. return _promise = _interopRequireDefault(__webpack_require__(7));
  37087. }
  37088. var _classCallCheck2;
  37089. function _load_classCallCheck() {
  37090. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  37091. }
  37092. var _index;
  37093. function _load_index() {
  37094. return _index = _interopRequireDefault(__webpack_require__(206));
  37095. }
  37096. var _constants;
  37097. function _load_constants() {
  37098. return _constants = _interopRequireWildcard(__webpack_require__(13));
  37099. }
  37100. var _fs;
  37101. function _load_fs() {
  37102. return _fs = _interopRequireWildcard(__webpack_require__(8));
  37103. }
  37104. var _mutex;
  37105. function _load_mutex() {
  37106. return _mutex = _interopRequireDefault(__webpack_require__(312));
  37107. }
  37108. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  37109. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  37110. /* eslint no-unused-vars: 0 */
  37111. var cmdShim = __webpack_require__(190);
  37112. var path = __webpack_require__(1);
  37113. var BaseFetcher = function () {
  37114. function BaseFetcher(dest, remote, config) {
  37115. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseFetcher);
  37116. this.reporter = config.reporter;
  37117. this.packageName = remote.packageName;
  37118. this.reference = remote.reference;
  37119. this.registry = remote.registry;
  37120. this.hash = remote.hash;
  37121. this.remote = remote;
  37122. this.config = config;
  37123. this.dest = dest;
  37124. }
  37125. BaseFetcher.prototype.setupMirrorFromCache = function setupMirrorFromCache() {
  37126. // fetcher subclasses may use this to perform actions such as copying over a cached tarball to the offline
  37127. // mirror etc
  37128. return (_promise || _load_promise()).default.resolve();
  37129. };
  37130. BaseFetcher.prototype._fetch = function _fetch() {
  37131. return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
  37132. };
  37133. BaseFetcher.prototype.fetch = function fetch(defaultManifest) {
  37134. var _this = this;
  37135. return (_fs || _load_fs()).lockQueue.push(this.dest, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  37136. yield (_fs || _load_fs()).mkdirp(_this.dest);
  37137. // fetch package and get the hash
  37138. var _ref2 = yield _this._fetch(),
  37139. hash = _ref2.hash;
  37140. var pkg = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  37141. // load the new normalized manifest
  37142. try {
  37143. return yield _this.config.readManifest(_this.dest, _this.registry);
  37144. } catch (e) {
  37145. if (e.code === 'ENOENT' && defaultManifest) {
  37146. return (0, (_index || _load_index()).default)(defaultManifest, _this.dest, _this.config, false);
  37147. } else {
  37148. throw e;
  37149. }
  37150. }
  37151. })();
  37152. if (pkg.bin) {
  37153. for (var _iterator = (0, (_keys || _load_keys()).default)(pkg.bin), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  37154. var _ref4;
  37155. if (_isArray) {
  37156. if (_i >= _iterator.length) break;
  37157. _ref4 = _iterator[_i++];
  37158. } else {
  37159. _i = _iterator.next();
  37160. if (_i.done) break;
  37161. _ref4 = _i.value;
  37162. }
  37163. var binName = _ref4;
  37164. var binDest = `${_this.dest}/.bin`;
  37165. // Using any sort of absolute path here would prevent makePortableProxyScript from preserving symlinks when
  37166. // calling the binary
  37167. var src = path.resolve(_this.dest, pkg.bin[binName]);
  37168. if (yield (_fs || _load_fs()).exists(src)) {
  37169. // We ensure that the target is executable
  37170. yield (_fs || _load_fs()).chmod(src, 0o755);
  37171. }
  37172. yield (_fs || _load_fs()).mkdirp(binDest);
  37173. if (process.platform === 'win32') {
  37174. var unlockMutex = yield (0, (_mutex || _load_mutex()).default)(src);
  37175. try {
  37176. yield cmdShim.ifExists(src, `${binDest}/${binName}`, { createPwshFile: false });
  37177. } finally {
  37178. unlockMutex();
  37179. }
  37180. } else {
  37181. yield (_fs || _load_fs()).symlink(src, `${binDest}/${binName}`);
  37182. }
  37183. }
  37184. }
  37185. yield (_fs || _load_fs()).writeFile(path.join(_this.dest, (_constants || _load_constants()).METADATA_FILENAME), (0, (_stringify || _load_stringify()).default)({
  37186. manifest: pkg,
  37187. artifacts: [],
  37188. remote: _this.remote,
  37189. registry: _this.registry,
  37190. hash
  37191. }, null, ' '));
  37192. return {
  37193. hash,
  37194. dest: _this.dest,
  37195. package: pkg,
  37196. cached: false
  37197. };
  37198. }));
  37199. };
  37200. return BaseFetcher;
  37201. }();
  37202. exports.default = BaseFetcher;
  37203. /***/ }),
  37204. /* 157 */
  37205. /***/ (function(module, exports, __webpack_require__) {
  37206. "use strict";
  37207. Object.defineProperty(exports, "__esModule", {
  37208. value: true
  37209. });
  37210. var _promise;
  37211. function _load_promise() {
  37212. return _promise = _interopRequireDefault(__webpack_require__(7));
  37213. }
  37214. var _keys;
  37215. function _load_keys() {
  37216. return _keys = _interopRequireDefault(__webpack_require__(14));
  37217. }
  37218. var _stringify;
  37219. function _load_stringify() {
  37220. return _stringify = _interopRequireDefault(__webpack_require__(37));
  37221. }
  37222. var _classCallCheck2;
  37223. function _load_classCallCheck() {
  37224. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  37225. }
  37226. var _map;
  37227. function _load_map() {
  37228. return _map = _interopRequireDefault(__webpack_require__(51));
  37229. }
  37230. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  37231. var debug = __webpack_require__(651)('yarn');
  37232. var BlockingQueue = function () {
  37233. function BlockingQueue(alias) {
  37234. var maxConcurrency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
  37235. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BlockingQueue);
  37236. this.concurrencyQueue = [];
  37237. this.maxConcurrency = maxConcurrency;
  37238. this.runningCount = 0;
  37239. this.warnedStuck = false;
  37240. this.alias = alias;
  37241. this.first = true;
  37242. this.running = (0, (_map || _load_map()).default)();
  37243. this.queue = (0, (_map || _load_map()).default)();
  37244. this.stuckTick = this.stuckTick.bind(this);
  37245. }
  37246. BlockingQueue.prototype.stillActive = function stillActive() {
  37247. if (this.stuckTimer) {
  37248. clearTimeout(this.stuckTimer);
  37249. }
  37250. this.stuckTimer = setTimeout(this.stuckTick, 5000);
  37251. // We need to check the existence of unref because of https://github.com/facebook/jest/issues/4559
  37252. // $FlowFixMe: Node's setInterval returns a Timeout, not a Number
  37253. this.stuckTimer.unref && this.stuckTimer.unref();
  37254. };
  37255. BlockingQueue.prototype.stuckTick = function stuckTick() {
  37256. if (this.runningCount === 1) {
  37257. this.warnedStuck = true;
  37258. debug(`The ${(0, (_stringify || _load_stringify()).default)(this.alias)} blocking queue may be stuck. 5 seconds ` + `without any activity with 1 worker: ${(0, (_keys || _load_keys()).default)(this.running)[0]}`);
  37259. }
  37260. };
  37261. BlockingQueue.prototype.push = function push(key, factory) {
  37262. var _this = this;
  37263. if (this.first) {
  37264. this.first = false;
  37265. } else {
  37266. this.stillActive();
  37267. }
  37268. return new (_promise || _load_promise()).default(function (resolve, reject) {
  37269. // we're already running so push ourselves to the queue
  37270. var queue = _this.queue[key] = _this.queue[key] || [];
  37271. queue.push({ factory, resolve, reject });
  37272. if (!_this.running[key]) {
  37273. _this.shift(key);
  37274. }
  37275. });
  37276. };
  37277. BlockingQueue.prototype.shift = function shift(key) {
  37278. var _this2 = this;
  37279. if (this.running[key]) {
  37280. delete this.running[key];
  37281. this.runningCount--;
  37282. if (this.stuckTimer) {
  37283. clearTimeout(this.stuckTimer);
  37284. this.stuckTimer = null;
  37285. }
  37286. if (this.warnedStuck) {
  37287. this.warnedStuck = false;
  37288. debug(`${(0, (_stringify || _load_stringify()).default)(this.alias)} blocking queue finally resolved. Nothing to worry about.`);
  37289. }
  37290. }
  37291. var queue = this.queue[key];
  37292. if (!queue) {
  37293. return;
  37294. }
  37295. var _queue$shift = queue.shift(),
  37296. resolve = _queue$shift.resolve,
  37297. reject = _queue$shift.reject,
  37298. factory = _queue$shift.factory;
  37299. if (!queue.length) {
  37300. delete this.queue[key];
  37301. }
  37302. var next = function next() {
  37303. _this2.shift(key);
  37304. _this2.shiftConcurrencyQueue();
  37305. };
  37306. var run = function run() {
  37307. _this2.running[key] = true;
  37308. _this2.runningCount++;
  37309. factory().then(function (val) {
  37310. resolve(val);
  37311. next();
  37312. return null;
  37313. }).catch(function (err) {
  37314. reject(err);
  37315. next();
  37316. });
  37317. };
  37318. this.maybePushConcurrencyQueue(run);
  37319. };
  37320. BlockingQueue.prototype.maybePushConcurrencyQueue = function maybePushConcurrencyQueue(run) {
  37321. if (this.runningCount < this.maxConcurrency) {
  37322. run();
  37323. } else {
  37324. this.concurrencyQueue.push(run);
  37325. }
  37326. };
  37327. BlockingQueue.prototype.shiftConcurrencyQueue = function shiftConcurrencyQueue() {
  37328. if (this.runningCount < this.maxConcurrency) {
  37329. var fn = this.concurrencyQueue.shift();
  37330. if (fn) {
  37331. fn();
  37332. }
  37333. }
  37334. };
  37335. return BlockingQueue;
  37336. }();
  37337. exports.default = BlockingQueue;
  37338. /***/ }),
  37339. /* 158 */
  37340. /***/ (function(module, exports, __webpack_require__) {
  37341. "use strict";
  37342. Object.defineProperty(exports, "__esModule", {
  37343. value: true
  37344. });
  37345. exports.HashStream = undefined;
  37346. var _classCallCheck2;
  37347. function _load_classCallCheck() {
  37348. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  37349. }
  37350. var _possibleConstructorReturn2;
  37351. function _load_possibleConstructorReturn() {
  37352. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  37353. }
  37354. var _inherits2;
  37355. function _load_inherits() {
  37356. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  37357. }
  37358. exports.hash = hash;
  37359. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  37360. var crypto = __webpack_require__(21);
  37361. var stream = __webpack_require__(36);
  37362. function hash(content) {
  37363. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md5';
  37364. return crypto.createHash(type).update(content).digest('hex');
  37365. }
  37366. var HashStream = exports.HashStream = function (_stream$Transform) {
  37367. (0, (_inherits2 || _load_inherits()).default)(HashStream, _stream$Transform);
  37368. function HashStream(options) {
  37369. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, HashStream);
  37370. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _stream$Transform.call(this, options));
  37371. _this._hash = crypto.createHash('sha1');
  37372. _this._updated = false;
  37373. return _this;
  37374. }
  37375. HashStream.prototype._transform = function _transform(chunk, encoding, callback) {
  37376. this._updated = true;
  37377. this._hash.update(chunk);
  37378. callback(null, chunk);
  37379. };
  37380. HashStream.prototype.getHash = function getHash() {
  37381. return this._hash.digest('hex');
  37382. };
  37383. HashStream.prototype.test = function test(sum) {
  37384. return this._updated && sum === this.getHash();
  37385. };
  37386. return HashStream;
  37387. }(stream.Transform);
  37388. /***/ }),
  37389. /* 159 */
  37390. /***/ (function(module, exports, __webpack_require__) {
  37391. "use strict";
  37392. Object.defineProperty(exports, "__esModule", {
  37393. value: true
  37394. });
  37395. var _getIterator2;
  37396. function _load_getIterator() {
  37397. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  37398. }
  37399. exports.default = guessName;
  37400. var _url;
  37401. function _load_url() {
  37402. return _url = _interopRequireDefault(__webpack_require__(29));
  37403. }
  37404. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  37405. function cleanup(name) {
  37406. name = name.replace(/-\d+\.\d+\.\d+/, '');
  37407. return name.replace(/\.git$|\.zip$|\.tar\.gz$|\.tar\.bz2$/, '');
  37408. }
  37409. function guessNameFallback(source) {
  37410. // If cannot parse as url, just return cleaned up last part
  37411. var parts = source.split('/');
  37412. return cleanup(parts[parts.length - 1]);
  37413. }
  37414. function guessName(source) {
  37415. try {
  37416. var parsed = (_url || _load_url()).default.parse(source);
  37417. if (!parsed.pathname) {
  37418. return guessNameFallback(source);
  37419. }
  37420. var parts = parsed.pathname.split('/');
  37421. // Priority goes to part that ends with .git
  37422. for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  37423. var _ref;
  37424. if (_isArray) {
  37425. if (_i >= _iterator.length) break;
  37426. _ref = _iterator[_i++];
  37427. } else {
  37428. _i = _iterator.next();
  37429. if (_i.done) break;
  37430. _ref = _i.value;
  37431. }
  37432. var part = _ref;
  37433. if (part.match(/\.git$/)) {
  37434. return cleanup(part);
  37435. }
  37436. }
  37437. // Most likely a directory
  37438. if (parsed.host == null) {
  37439. return cleanup(parts[parts.length - 1]);
  37440. }
  37441. // A site like github or gitlab
  37442. if (parts.length > 2) {
  37443. return cleanup(parts[2]);
  37444. }
  37445. // Privately hosted package?
  37446. if (parts.length > 1) {
  37447. return cleanup(parts[1]);
  37448. }
  37449. return guessNameFallback(source);
  37450. } catch (e) {
  37451. return guessNameFallback(source);
  37452. }
  37453. }
  37454. /***/ }),
  37455. /* 160 */
  37456. /***/ (function(module, exports, __webpack_require__) {
  37457. "use strict";
  37458. Object.defineProperty(exports, "__esModule", {
  37459. value: true
  37460. });
  37461. exports.satisfiesWithPrereleases = satisfiesWithPrereleases;
  37462. exports.diffWithUnstable = diffWithUnstable;
  37463. var _semver;
  37464. function _load_semver() {
  37465. return _semver = _interopRequireDefault(__webpack_require__(27));
  37466. }
  37467. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  37468. /**
  37469. * Returns whether the given semver version satisfies the given range. Notably this supports
  37470. * prerelease versions so that "2.0.0-rc.0" satisfies the range ">=1.0.0", for example.
  37471. */
  37472. function satisfiesWithPrereleases(version, range) {
  37473. var loose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  37474. var semverRange = void 0;
  37475. try {
  37476. // $FlowFixMe: Add a definition for the Range class
  37477. semverRange = new (_semver || _load_semver()).default.Range(range, loose);
  37478. } catch (err) {
  37479. return false;
  37480. }
  37481. if (!version) {
  37482. return false;
  37483. }
  37484. var semverVersion = void 0;
  37485. try {
  37486. semverVersion = new (_semver || _load_semver()).default.SemVer(version, semverRange.loose);
  37487. } catch (err) {
  37488. return false;
  37489. }
  37490. // A range has multiple sets of comparators. A version must satisfy all comparators in a set
  37491. // and at least one set to satisfy the range.
  37492. return semverRange.set.some(function (comparatorSet) {
  37493. // node-semver converts ~ and ^ ranges into pairs of >= and < ranges but the upper bounds don't
  37494. // properly exclude prerelease versions. For example, "^1.0.0" is converted to ">=1.0.0 <2.0.0",
  37495. // which includes "2.0.0-pre" since prerelease versions are lower than their non-prerelease
  37496. // counterparts. As a practical workaround we make upper-bound ranges exclude prereleases and
  37497. // convert "<2.0.0" to "<2.0.0-0", for example.
  37498. comparatorSet = comparatorSet.map(function (comparator) {
  37499. if (comparator.operator !== '<' || !comparator.value || comparator.semver.prerelease.length) {
  37500. return comparator;
  37501. }
  37502. // "0" is the lowest prerelease version
  37503. comparator.semver.inc('pre', 0);
  37504. var comparatorString = comparator.operator + comparator.semver.version;
  37505. // $FlowFixMe: Add a definition for the Comparator class
  37506. return new (_semver || _load_semver()).default.Comparator(comparatorString, comparator.loose);
  37507. });
  37508. return !comparatorSet.some(function (comparator) {
  37509. return !comparator.test(semverVersion);
  37510. });
  37511. });
  37512. }
  37513. var PRE_RELEASES = {
  37514. major: 'premajor',
  37515. minor: 'preminor',
  37516. patch: 'prepatch'
  37517. };
  37518. /**
  37519. * Returns the difference between two versions as a semantic string representation.
  37520. * Similar to the `diff` method in node-semver, but it also accounts for unstable versions,
  37521. * like 0.x.x or 0.0.x.
  37522. */
  37523. function diffWithUnstable(version1, version2) {
  37524. if ((_semver || _load_semver()).default.eq(version1, version2) === false) {
  37525. var v1 = (_semver || _load_semver()).default.parse(version1);
  37526. var v2 = (_semver || _load_semver()).default.parse(version2);
  37527. if (v1 != null && v2 != null) {
  37528. var isPreRelease = v1.prerelease.length > 0 || v2.prerelease.length > 0;
  37529. var preMajor = v1.major === 0 || v2.major === 0;
  37530. var preMinor = preMajor && (v1.minor === 0 || v2.minor === 0);
  37531. var diff = null;
  37532. if (v1.major !== v2.major) {
  37533. diff = 'major';
  37534. } else if (v1.minor !== v2.minor) {
  37535. if (preMajor) {
  37536. // If the major version number is zero (0.x.x), treat a change
  37537. // of the minor version number as a major change.
  37538. diff = 'major';
  37539. } else {
  37540. diff = 'minor';
  37541. }
  37542. } else if (v1.patch !== v2.patch) {
  37543. if (preMinor) {
  37544. // If the major & minor version numbers are zero (0.0.x), treat a change
  37545. // of the patch version number as a major change.
  37546. diff = 'major';
  37547. } else if (preMajor) {
  37548. // If the major version number is zero (0.x.x), treat a change
  37549. // of the patch version number as a minor change.
  37550. diff = 'minor';
  37551. } else {
  37552. diff = 'patch';
  37553. }
  37554. }
  37555. if (isPreRelease) {
  37556. if (diff != null) {
  37557. diff = PRE_RELEASES[diff];
  37558. } else {
  37559. diff = 'prerelease';
  37560. }
  37561. }
  37562. return diff;
  37563. }
  37564. }
  37565. return null;
  37566. }
  37567. /***/ }),
  37568. /* 161 */
  37569. /***/ (function(module, exports, __webpack_require__) {
  37570. // 7.1.15 ToLength
  37571. var toInteger = __webpack_require__(226);
  37572. var min = Math.min;
  37573. module.exports = function (it) {
  37574. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  37575. };
  37576. /***/ }),
  37577. /* 162 */
  37578. /***/ (function(module, exports) {
  37579. var id = 0;
  37580. var px = Math.random();
  37581. module.exports = function (key) {
  37582. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  37583. };
  37584. /***/ }),
  37585. /* 163 */
  37586. /***/ (function(module, exports) {
  37587. /***/ }),
  37588. /* 164 */
  37589. /***/ (function(module, exports, __webpack_require__) {
  37590. var once = __webpack_require__(134);
  37591. var noop = function() {};
  37592. var isRequest = function(stream) {
  37593. return stream.setHeader && typeof stream.abort === 'function';
  37594. };
  37595. var isChildProcess = function(stream) {
  37596. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  37597. };
  37598. var eos = function(stream, opts, callback) {
  37599. if (typeof opts === 'function') return eos(stream, null, opts);
  37600. if (!opts) opts = {};
  37601. callback = once(callback || noop);
  37602. var ws = stream._writableState;
  37603. var rs = stream._readableState;
  37604. var readable = opts.readable || (opts.readable !== false && stream.readable);
  37605. var writable = opts.writable || (opts.writable !== false && stream.writable);
  37606. var onlegacyfinish = function() {
  37607. if (!stream.writable) onfinish();
  37608. };
  37609. var onfinish = function() {
  37610. writable = false;
  37611. if (!readable) callback.call(stream);
  37612. };
  37613. var onend = function() {
  37614. readable = false;
  37615. if (!writable) callback.call(stream);
  37616. };
  37617. var onexit = function(exitCode) {
  37618. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  37619. };
  37620. var onerror = function(err) {
  37621. callback.call(stream, err);
  37622. };
  37623. var onclose = function() {
  37624. if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close'));
  37625. if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close'));
  37626. };
  37627. var onrequest = function() {
  37628. stream.req.on('finish', onfinish);
  37629. };
  37630. if (isRequest(stream)) {
  37631. stream.on('complete', onfinish);
  37632. stream.on('abort', onclose);
  37633. if (stream.req) onrequest();
  37634. else stream.on('request', onrequest);
  37635. } else if (writable && !ws) { // legacy streams
  37636. stream.on('end', onlegacyfinish);
  37637. stream.on('close', onlegacyfinish);
  37638. }
  37639. if (isChildProcess(stream)) stream.on('exit', onexit);
  37640. stream.on('end', onend);
  37641. stream.on('finish', onfinish);
  37642. if (opts.error !== false) stream.on('error', onerror);
  37643. stream.on('close', onclose);
  37644. return function() {
  37645. stream.removeListener('complete', onfinish);
  37646. stream.removeListener('abort', onclose);
  37647. stream.removeListener('request', onrequest);
  37648. if (stream.req) stream.req.removeListener('finish', onfinish);
  37649. stream.removeListener('end', onlegacyfinish);
  37650. stream.removeListener('close', onlegacyfinish);
  37651. stream.removeListener('finish', onfinish);
  37652. stream.removeListener('exit', onexit);
  37653. stream.removeListener('end', onend);
  37654. stream.removeListener('error', onerror);
  37655. stream.removeListener('close', onclose);
  37656. };
  37657. };
  37658. module.exports = eos;
  37659. /***/ }),
  37660. /* 165 */
  37661. /***/ (function(module, exports, __webpack_require__) {
  37662. // Copyright 2012 Joyent, Inc. All rights reserved.
  37663. var assert = __webpack_require__(22);
  37664. var sshpk = __webpack_require__(269);
  37665. var util = __webpack_require__(9);
  37666. var HASH_ALGOS = {
  37667. 'sha1': true,
  37668. 'sha256': true,
  37669. 'sha512': true
  37670. };
  37671. var PK_ALGOS = {
  37672. 'rsa': true,
  37673. 'dsa': true,
  37674. 'ecdsa': true
  37675. };
  37676. function HttpSignatureError(message, caller) {
  37677. if (Error.captureStackTrace)
  37678. Error.captureStackTrace(this, caller || HttpSignatureError);
  37679. this.message = message;
  37680. this.name = caller.name;
  37681. }
  37682. util.inherits(HttpSignatureError, Error);
  37683. function InvalidAlgorithmError(message) {
  37684. HttpSignatureError.call(this, message, InvalidAlgorithmError);
  37685. }
  37686. util.inherits(InvalidAlgorithmError, HttpSignatureError);
  37687. function validateAlgorithm(algorithm) {
  37688. var alg = algorithm.toLowerCase().split('-');
  37689. if (alg.length !== 2) {
  37690. throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' +
  37691. 'valid algorithm'));
  37692. }
  37693. if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) {
  37694. throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' +
  37695. 'are not supported'));
  37696. }
  37697. if (!HASH_ALGOS[alg[1]]) {
  37698. throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' +
  37699. 'supported hash algorithm'));
  37700. }
  37701. return (alg);
  37702. }
  37703. ///--- API
  37704. module.exports = {
  37705. HASH_ALGOS: HASH_ALGOS,
  37706. PK_ALGOS: PK_ALGOS,
  37707. HttpSignatureError: HttpSignatureError,
  37708. InvalidAlgorithmError: InvalidAlgorithmError,
  37709. validateAlgorithm: validateAlgorithm,
  37710. /**
  37711. * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.
  37712. *
  37713. * The intent of this module is to interoperate with OpenSSL only,
  37714. * specifically the node crypto module's `verify` method.
  37715. *
  37716. * @param {String} key an OpenSSH public key.
  37717. * @return {String} PEM encoded form of the RSA public key.
  37718. * @throws {TypeError} on bad input.
  37719. * @throws {Error} on invalid ssh key formatted data.
  37720. */
  37721. sshKeyToPEM: function sshKeyToPEM(key) {
  37722. assert.string(key, 'ssh_key');
  37723. var k = sshpk.parseKey(key, 'ssh');
  37724. return (k.toString('pem'));
  37725. },
  37726. /**
  37727. * Generates an OpenSSH fingerprint from an ssh public key.
  37728. *
  37729. * @param {String} key an OpenSSH public key.
  37730. * @return {String} key fingerprint.
  37731. * @throws {TypeError} on bad input.
  37732. * @throws {Error} if what you passed doesn't look like an ssh public key.
  37733. */
  37734. fingerprint: function fingerprint(key) {
  37735. assert.string(key, 'ssh_key');
  37736. var k = sshpk.parseKey(key, 'ssh');
  37737. return (k.fingerprint('md5').toString('hex'));
  37738. },
  37739. /**
  37740. * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa)
  37741. *
  37742. * The reverse of the above function.
  37743. */
  37744. pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) {
  37745. assert.equal('string', typeof (pem), 'typeof pem');
  37746. var k = sshpk.parseKey(pem, 'pem');
  37747. k.comment = comment;
  37748. return (k.toString('ssh'));
  37749. }
  37750. };
  37751. /***/ }),
  37752. /* 166 */
  37753. /***/ (function(module, exports) {
  37754. /*!
  37755. * is-extglob <https://github.com/jonschlinkert/is-extglob>
  37756. *
  37757. * Copyright (c) 2014-2015, Jon Schlinkert.
  37758. * Licensed under the MIT License.
  37759. */
  37760. module.exports = function isExtglob(str) {
  37761. return typeof str === 'string'
  37762. && /[@?!+*]\(/.test(str);
  37763. };
  37764. /***/ }),
  37765. /* 167 */
  37766. /***/ (function(module, exports, __webpack_require__) {
  37767. /*!
  37768. * is-glob <https://github.com/jonschlinkert/is-glob>
  37769. *
  37770. * Copyright (c) 2014-2015, Jon Schlinkert.
  37771. * Licensed under the MIT License.
  37772. */
  37773. var isExtglob = __webpack_require__(166);
  37774. module.exports = function isGlob(str) {
  37775. return typeof str === 'string'
  37776. && (/[*!?{}(|)[\]]/.test(str)
  37777. || isExtglob(str));
  37778. };
  37779. /***/ }),
  37780. /* 168 */
  37781. /***/ (function(module, exports, __webpack_require__) {
  37782. "use strict";
  37783. // JS-YAML's default schema for `load` function.
  37784. // It is not described in the YAML specification.
  37785. //
  37786. // This schema is based on JS-YAML's default safe schema and includes
  37787. // JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
  37788. //
  37789. // Also this schema is used as default base schema at `Schema.create` function.
  37790. var Schema = __webpack_require__(108);
  37791. module.exports = Schema.DEFAULT = new Schema({
  37792. include: [
  37793. __webpack_require__(133)
  37794. ],
  37795. explicit: [
  37796. __webpack_require__(805),
  37797. __webpack_require__(804),
  37798. __webpack_require__(803)
  37799. ]
  37800. });
  37801. /***/ }),
  37802. /* 169 */
  37803. /***/ (function(module, exports, __webpack_require__) {
  37804. var isBuffer = __webpack_require__(778);
  37805. var toString = Object.prototype.toString;
  37806. /**
  37807. * Get the native `typeof` a value.
  37808. *
  37809. * @param {*} `val`
  37810. * @return {*} Native javascript type
  37811. */
  37812. module.exports = function kindOf(val) {
  37813. // primitivies
  37814. if (typeof val === 'undefined') {
  37815. return 'undefined';
  37816. }
  37817. if (val === null) {
  37818. return 'null';
  37819. }
  37820. if (val === true || val === false || val instanceof Boolean) {
  37821. return 'boolean';
  37822. }
  37823. if (typeof val === 'string' || val instanceof String) {
  37824. return 'string';
  37825. }
  37826. if (typeof val === 'number' || val instanceof Number) {
  37827. return 'number';
  37828. }
  37829. // functions
  37830. if (typeof val === 'function' || val instanceof Function) {
  37831. return 'function';
  37832. }
  37833. // array
  37834. if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
  37835. return 'array';
  37836. }
  37837. // check for instances of RegExp and Date before calling `toString`
  37838. if (val instanceof RegExp) {
  37839. return 'regexp';
  37840. }
  37841. if (val instanceof Date) {
  37842. return 'date';
  37843. }
  37844. // other objects
  37845. var type = toString.call(val);
  37846. if (type === '[object RegExp]') {
  37847. return 'regexp';
  37848. }
  37849. if (type === '[object Date]') {
  37850. return 'date';
  37851. }
  37852. if (type === '[object Arguments]') {
  37853. return 'arguments';
  37854. }
  37855. if (type === '[object Error]') {
  37856. return 'error';
  37857. }
  37858. // buffer
  37859. if (isBuffer(val)) {
  37860. return 'buffer';
  37861. }
  37862. // es6: Map, WeakMap, Set, WeakSet
  37863. if (type === '[object Set]') {
  37864. return 'set';
  37865. }
  37866. if (type === '[object WeakSet]') {
  37867. return 'weakset';
  37868. }
  37869. if (type === '[object Map]') {
  37870. return 'map';
  37871. }
  37872. if (type === '[object WeakMap]') {
  37873. return 'weakmap';
  37874. }
  37875. if (type === '[object Symbol]') {
  37876. return 'symbol';
  37877. }
  37878. // typed arrays
  37879. if (type === '[object Int8Array]') {
  37880. return 'int8array';
  37881. }
  37882. if (type === '[object Uint8Array]') {
  37883. return 'uint8array';
  37884. }
  37885. if (type === '[object Uint8ClampedArray]') {
  37886. return 'uint8clampedarray';
  37887. }
  37888. if (type === '[object Int16Array]') {
  37889. return 'int16array';
  37890. }
  37891. if (type === '[object Uint16Array]') {
  37892. return 'uint16array';
  37893. }
  37894. if (type === '[object Int32Array]') {
  37895. return 'int32array';
  37896. }
  37897. if (type === '[object Uint32Array]') {
  37898. return 'uint32array';
  37899. }
  37900. if (type === '[object Float32Array]') {
  37901. return 'float32array';
  37902. }
  37903. if (type === '[object Float64Array]') {
  37904. return 'float64array';
  37905. }
  37906. // must be a plain object
  37907. return 'object';
  37908. };
  37909. /***/ }),
  37910. /* 170 */
  37911. /***/ (function(module, exports, __webpack_require__) {
  37912. module.exports = minimatch
  37913. minimatch.Minimatch = Minimatch
  37914. var path = { sep: '/' }
  37915. try {
  37916. path = __webpack_require__(1)
  37917. } catch (er) {}
  37918. var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
  37919. var expand = __webpack_require__(557)
  37920. var plTypes = {
  37921. '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
  37922. '?': { open: '(?:', close: ')?' },
  37923. '+': { open: '(?:', close: ')+' },
  37924. '*': { open: '(?:', close: ')*' },
  37925. '@': { open: '(?:', close: ')' }
  37926. }
  37927. // any single thing other than /
  37928. // don't need to escape / when using new RegExp()
  37929. var qmark = '[^/]'
  37930. // * => any number of characters
  37931. var star = qmark + '*?'
  37932. // ** when dots are allowed. Anything goes, except .. and .
  37933. // not (^ or / followed by one or two dots followed by $ or /),
  37934. // followed by anything, any number of times.
  37935. var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
  37936. // not a ^ or / followed by a dot,
  37937. // followed by anything, any number of times.
  37938. var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
  37939. // characters that need to be escaped in RegExp.
  37940. var reSpecials = charSet('().*{}+?[]^$\\!')
  37941. // "abc" -> { a:true, b:true, c:true }
  37942. function charSet (s) {
  37943. return s.split('').reduce(function (set, c) {
  37944. set[c] = true
  37945. return set
  37946. }, {})
  37947. }
  37948. // normalizes slashes.
  37949. var slashSplit = /\/+/
  37950. minimatch.filter = filter
  37951. function filter (pattern, options) {
  37952. options = options || {}
  37953. return function (p, i, list) {
  37954. return minimatch(p, pattern, options)
  37955. }
  37956. }
  37957. function ext (a, b) {
  37958. a = a || {}
  37959. b = b || {}
  37960. var t = {}
  37961. Object.keys(b).forEach(function (k) {
  37962. t[k] = b[k]
  37963. })
  37964. Object.keys(a).forEach(function (k) {
  37965. t[k] = a[k]
  37966. })
  37967. return t
  37968. }
  37969. minimatch.defaults = function (def) {
  37970. if (!def || !Object.keys(def).length) return minimatch
  37971. var orig = minimatch
  37972. var m = function minimatch (p, pattern, options) {
  37973. return orig.minimatch(p, pattern, ext(def, options))
  37974. }
  37975. m.Minimatch = function Minimatch (pattern, options) {
  37976. return new orig.Minimatch(pattern, ext(def, options))
  37977. }
  37978. return m
  37979. }
  37980. Minimatch.defaults = function (def) {
  37981. if (!def || !Object.keys(def).length) return Minimatch
  37982. return minimatch.defaults(def).Minimatch
  37983. }
  37984. function minimatch (p, pattern, options) {
  37985. if (typeof pattern !== 'string') {
  37986. throw new TypeError('glob pattern string required')
  37987. }
  37988. if (!options) options = {}
  37989. // shortcut: comments match nothing.
  37990. if (!options.nocomment && pattern.charAt(0) === '#') {
  37991. return false
  37992. }
  37993. // "" only matches ""
  37994. if (pattern.trim() === '') return p === ''
  37995. return new Minimatch(pattern, options).match(p)
  37996. }
  37997. function Minimatch (pattern, options) {
  37998. if (!(this instanceof Minimatch)) {
  37999. return new Minimatch(pattern, options)
  38000. }
  38001. if (typeof pattern !== 'string') {
  38002. throw new TypeError('glob pattern string required')
  38003. }
  38004. if (!options) options = {}
  38005. pattern = pattern.trim()
  38006. // windows support: need to use /, not \
  38007. if (path.sep !== '/') {
  38008. pattern = pattern.split(path.sep).join('/')
  38009. }
  38010. this.options = options
  38011. this.set = []
  38012. this.pattern = pattern
  38013. this.regexp = null
  38014. this.negate = false
  38015. this.comment = false
  38016. this.empty = false
  38017. // make the set of regexps etc.
  38018. this.make()
  38019. }
  38020. Minimatch.prototype.debug = function () {}
  38021. Minimatch.prototype.make = make
  38022. function make () {
  38023. // don't do it more than once.
  38024. if (this._made) return
  38025. var pattern = this.pattern
  38026. var options = this.options
  38027. // empty patterns and comments match nothing.
  38028. if (!options.nocomment && pattern.charAt(0) === '#') {
  38029. this.comment = true
  38030. return
  38031. }
  38032. if (!pattern) {
  38033. this.empty = true
  38034. return
  38035. }
  38036. // step 1: figure out negation, etc.
  38037. this.parseNegate()
  38038. // step 2: expand braces
  38039. var set = this.globSet = this.braceExpand()
  38040. if (options.debug) this.debug = console.error
  38041. this.debug(this.pattern, set)
  38042. // step 3: now we have a set, so turn each one into a series of path-portion
  38043. // matching patterns.
  38044. // These will be regexps, except in the case of "**", which is
  38045. // set to the GLOBSTAR object for globstar behavior,
  38046. // and will not contain any / characters
  38047. set = this.globParts = set.map(function (s) {
  38048. return s.split(slashSplit)
  38049. })
  38050. this.debug(this.pattern, set)
  38051. // glob --> regexps
  38052. set = set.map(function (s, si, set) {
  38053. return s.map(this.parse, this)
  38054. }, this)
  38055. this.debug(this.pattern, set)
  38056. // filter out everything that didn't compile properly.
  38057. set = set.filter(function (s) {
  38058. return s.indexOf(false) === -1
  38059. })
  38060. this.debug(this.pattern, set)
  38061. this.set = set
  38062. }
  38063. Minimatch.prototype.parseNegate = parseNegate
  38064. function parseNegate () {
  38065. var pattern = this.pattern
  38066. var negate = false
  38067. var options = this.options
  38068. var negateOffset = 0
  38069. if (options.nonegate) return
  38070. for (var i = 0, l = pattern.length
  38071. ; i < l && pattern.charAt(i) === '!'
  38072. ; i++) {
  38073. negate = !negate
  38074. negateOffset++
  38075. }
  38076. if (negateOffset) this.pattern = pattern.substr(negateOffset)
  38077. this.negate = negate
  38078. }
  38079. // Brace expansion:
  38080. // a{b,c}d -> abd acd
  38081. // a{b,}c -> abc ac
  38082. // a{0..3}d -> a0d a1d a2d a3d
  38083. // a{b,c{d,e}f}g -> abg acdfg acefg
  38084. // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
  38085. //
  38086. // Invalid sets are not expanded.
  38087. // a{2..}b -> a{2..}b
  38088. // a{b}c -> a{b}c
  38089. minimatch.braceExpand = function (pattern, options) {
  38090. return braceExpand(pattern, options)
  38091. }
  38092. Minimatch.prototype.braceExpand = braceExpand
  38093. function braceExpand (pattern, options) {
  38094. if (!options) {
  38095. if (this instanceof Minimatch) {
  38096. options = this.options
  38097. } else {
  38098. options = {}
  38099. }
  38100. }
  38101. pattern = typeof pattern === 'undefined'
  38102. ? this.pattern : pattern
  38103. if (typeof pattern === 'undefined') {
  38104. throw new TypeError('undefined pattern')
  38105. }
  38106. if (options.nobrace ||
  38107. !pattern.match(/\{.*\}/)) {
  38108. // shortcut. no need to expand.
  38109. return [pattern]
  38110. }
  38111. return expand(pattern)
  38112. }
  38113. // parse a component of the expanded set.
  38114. // At this point, no pattern may contain "/" in it
  38115. // so we're going to return a 2d array, where each entry is the full
  38116. // pattern, split on '/', and then turned into a regular expression.
  38117. // A regexp is made at the end which joins each array with an
  38118. // escaped /, and another full one which joins each regexp with |.
  38119. //
  38120. // Following the lead of Bash 4.1, note that "**" only has special meaning
  38121. // when it is the *only* thing in a path portion. Otherwise, any series
  38122. // of * is equivalent to a single *. Globstar behavior is enabled by
  38123. // default, and can be disabled by setting options.noglobstar.
  38124. Minimatch.prototype.parse = parse
  38125. var SUBPARSE = {}
  38126. function parse (pattern, isSub) {
  38127. if (pattern.length > 1024 * 64) {
  38128. throw new TypeError('pattern is too long')
  38129. }
  38130. var options = this.options
  38131. // shortcuts
  38132. if (!options.noglobstar && pattern === '**') return GLOBSTAR
  38133. if (pattern === '') return ''
  38134. var re = ''
  38135. var hasMagic = !!options.nocase
  38136. var escaping = false
  38137. // ? => one single character
  38138. var patternListStack = []
  38139. var negativeLists = []
  38140. var stateChar
  38141. var inClass = false
  38142. var reClassStart = -1
  38143. var classStart = -1
  38144. // . and .. never match anything that doesn't start with .,
  38145. // even when options.dot is set.
  38146. var patternStart = pattern.charAt(0) === '.' ? '' // anything
  38147. // not (start or / followed by . or .. followed by / or end)
  38148. : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
  38149. : '(?!\\.)'
  38150. var self = this
  38151. function clearStateChar () {
  38152. if (stateChar) {
  38153. // we had some state-tracking character
  38154. // that wasn't consumed by this pass.
  38155. switch (stateChar) {
  38156. case '*':
  38157. re += star
  38158. hasMagic = true
  38159. break
  38160. case '?':
  38161. re += qmark
  38162. hasMagic = true
  38163. break
  38164. default:
  38165. re += '\\' + stateChar
  38166. break
  38167. }
  38168. self.debug('clearStateChar %j %j', stateChar, re)
  38169. stateChar = false
  38170. }
  38171. }
  38172. for (var i = 0, len = pattern.length, c
  38173. ; (i < len) && (c = pattern.charAt(i))
  38174. ; i++) {
  38175. this.debug('%s\t%s %s %j', pattern, i, re, c)
  38176. // skip over any that are escaped.
  38177. if (escaping && reSpecials[c]) {
  38178. re += '\\' + c
  38179. escaping = false
  38180. continue
  38181. }
  38182. switch (c) {
  38183. case '/':
  38184. // completely not allowed, even escaped.
  38185. // Should already be path-split by now.
  38186. return false
  38187. case '\\':
  38188. clearStateChar()
  38189. escaping = true
  38190. continue
  38191. // the various stateChar values
  38192. // for the "extglob" stuff.
  38193. case '?':
  38194. case '*':
  38195. case '+':
  38196. case '@':
  38197. case '!':
  38198. this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
  38199. // all of those are literals inside a class, except that
  38200. // the glob [!a] means [^a] in regexp
  38201. if (inClass) {
  38202. this.debug(' in class')
  38203. if (c === '!' && i === classStart + 1) c = '^'
  38204. re += c
  38205. continue
  38206. }
  38207. // if we already have a stateChar, then it means
  38208. // that there was something like ** or +? in there.
  38209. // Handle the stateChar, then proceed with this one.
  38210. self.debug('call clearStateChar %j', stateChar)
  38211. clearStateChar()
  38212. stateChar = c
  38213. // if extglob is disabled, then +(asdf|foo) isn't a thing.
  38214. // just clear the statechar *now*, rather than even diving into
  38215. // the patternList stuff.
  38216. if (options.noext) clearStateChar()
  38217. continue
  38218. case '(':
  38219. if (inClass) {
  38220. re += '('
  38221. continue
  38222. }
  38223. if (!stateChar) {
  38224. re += '\\('
  38225. continue
  38226. }
  38227. patternListStack.push({
  38228. type: stateChar,
  38229. start: i - 1,
  38230. reStart: re.length,
  38231. open: plTypes[stateChar].open,
  38232. close: plTypes[stateChar].close
  38233. })
  38234. // negation is (?:(?!js)[^/]*)
  38235. re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
  38236. this.debug('plType %j %j', stateChar, re)
  38237. stateChar = false
  38238. continue
  38239. case ')':
  38240. if (inClass || !patternListStack.length) {
  38241. re += '\\)'
  38242. continue
  38243. }
  38244. clearStateChar()
  38245. hasMagic = true
  38246. var pl = patternListStack.pop()
  38247. // negation is (?:(?!js)[^/]*)
  38248. // The others are (?:<pattern>)<type>
  38249. re += pl.close
  38250. if (pl.type === '!') {
  38251. negativeLists.push(pl)
  38252. }
  38253. pl.reEnd = re.length
  38254. continue
  38255. case '|':
  38256. if (inClass || !patternListStack.length || escaping) {
  38257. re += '\\|'
  38258. escaping = false
  38259. continue
  38260. }
  38261. clearStateChar()
  38262. re += '|'
  38263. continue
  38264. // these are mostly the same in regexp and glob
  38265. case '[':
  38266. // swallow any state-tracking char before the [
  38267. clearStateChar()
  38268. if (inClass) {
  38269. re += '\\' + c
  38270. continue
  38271. }
  38272. inClass = true
  38273. classStart = i
  38274. reClassStart = re.length
  38275. re += c
  38276. continue
  38277. case ']':
  38278. // a right bracket shall lose its special
  38279. // meaning and represent itself in
  38280. // a bracket expression if it occurs
  38281. // first in the list. -- POSIX.2 2.8.3.2
  38282. if (i === classStart + 1 || !inClass) {
  38283. re += '\\' + c
  38284. escaping = false
  38285. continue
  38286. }
  38287. // handle the case where we left a class open.
  38288. // "[z-a]" is valid, equivalent to "\[z-a\]"
  38289. if (inClass) {
  38290. // split where the last [ was, make sure we don't have
  38291. // an invalid re. if so, re-walk the contents of the
  38292. // would-be class to re-translate any characters that
  38293. // were passed through as-is
  38294. // TODO: It would probably be faster to determine this
  38295. // without a try/catch and a new RegExp, but it's tricky
  38296. // to do safely. For now, this is safe and works.
  38297. var cs = pattern.substring(classStart + 1, i)
  38298. try {
  38299. RegExp('[' + cs + ']')
  38300. } catch (er) {
  38301. // not a valid class!
  38302. var sp = this.parse(cs, SUBPARSE)
  38303. re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
  38304. hasMagic = hasMagic || sp[1]
  38305. inClass = false
  38306. continue
  38307. }
  38308. }
  38309. // finish up the class.
  38310. hasMagic = true
  38311. inClass = false
  38312. re += c
  38313. continue
  38314. default:
  38315. // swallow any state char that wasn't consumed
  38316. clearStateChar()
  38317. if (escaping) {
  38318. // no need
  38319. escaping = false
  38320. } else if (reSpecials[c]
  38321. && !(c === '^' && inClass)) {
  38322. re += '\\'
  38323. }
  38324. re += c
  38325. } // switch
  38326. } // for
  38327. // handle the case where we left a class open.
  38328. // "[abc" is valid, equivalent to "\[abc"
  38329. if (inClass) {
  38330. // split where the last [ was, and escape it
  38331. // this is a huge pita. We now have to re-walk
  38332. // the contents of the would-be class to re-translate
  38333. // any characters that were passed through as-is
  38334. cs = pattern.substr(classStart + 1)
  38335. sp = this.parse(cs, SUBPARSE)
  38336. re = re.substr(0, reClassStart) + '\\[' + sp[0]
  38337. hasMagic = hasMagic || sp[1]
  38338. }
  38339. // handle the case where we had a +( thing at the *end*
  38340. // of the pattern.
  38341. // each pattern list stack adds 3 chars, and we need to go through
  38342. // and escape any | chars that were passed through as-is for the regexp.
  38343. // Go through and escape them, taking care not to double-escape any
  38344. // | chars that were already escaped.
  38345. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
  38346. var tail = re.slice(pl.reStart + pl.open.length)
  38347. this.debug('setting tail', re, pl)
  38348. // maybe some even number of \, then maybe 1 \, followed by a |
  38349. tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
  38350. if (!$2) {
  38351. // the | isn't already escaped, so escape it.
  38352. $2 = '\\'
  38353. }
  38354. // need to escape all those slashes *again*, without escaping the
  38355. // one that we need for escaping the | character. As it works out,
  38356. // escaping an even number of slashes can be done by simply repeating
  38357. // it exactly after itself. That's why this trick works.
  38358. //
  38359. // I am sorry that you have to see this.
  38360. return $1 + $1 + $2 + '|'
  38361. })
  38362. this.debug('tail=%j\n %s', tail, tail, pl, re)
  38363. var t = pl.type === '*' ? star
  38364. : pl.type === '?' ? qmark
  38365. : '\\' + pl.type
  38366. hasMagic = true
  38367. re = re.slice(0, pl.reStart) + t + '\\(' + tail
  38368. }
  38369. // handle trailing things that only matter at the very end.
  38370. clearStateChar()
  38371. if (escaping) {
  38372. // trailing \\
  38373. re += '\\\\'
  38374. }
  38375. // only need to apply the nodot start if the re starts with
  38376. // something that could conceivably capture a dot
  38377. var addPatternStart = false
  38378. switch (re.charAt(0)) {
  38379. case '.':
  38380. case '[':
  38381. case '(': addPatternStart = true
  38382. }
  38383. // Hack to work around lack of negative lookbehind in JS
  38384. // A pattern like: *.!(x).!(y|z) needs to ensure that a name
  38385. // like 'a.xyz.yz' doesn't match. So, the first negative
  38386. // lookahead, has to look ALL the way ahead, to the end of
  38387. // the pattern.
  38388. for (var n = negativeLists.length - 1; n > -1; n--) {
  38389. var nl = negativeLists[n]
  38390. var nlBefore = re.slice(0, nl.reStart)
  38391. var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
  38392. var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
  38393. var nlAfter = re.slice(nl.reEnd)
  38394. nlLast += nlAfter
  38395. // Handle nested stuff like *(*.js|!(*.json)), where open parens
  38396. // mean that we should *not* include the ) in the bit that is considered
  38397. // "after" the negated section.
  38398. var openParensBefore = nlBefore.split('(').length - 1
  38399. var cleanAfter = nlAfter
  38400. for (i = 0; i < openParensBefore; i++) {
  38401. cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
  38402. }
  38403. nlAfter = cleanAfter
  38404. var dollar = ''
  38405. if (nlAfter === '' && isSub !== SUBPARSE) {
  38406. dollar = '$'
  38407. }
  38408. var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
  38409. re = newRe
  38410. }
  38411. // if the re is not "" at this point, then we need to make sure
  38412. // it doesn't match against an empty path part.
  38413. // Otherwise a/* will match a/, which it should not.
  38414. if (re !== '' && hasMagic) {
  38415. re = '(?=.)' + re
  38416. }
  38417. if (addPatternStart) {
  38418. re = patternStart + re
  38419. }
  38420. // parsing just a piece of a larger pattern.
  38421. if (isSub === SUBPARSE) {
  38422. return [re, hasMagic]
  38423. }
  38424. // skip the regexp for non-magical patterns
  38425. // unescape anything in it, though, so that it'll be
  38426. // an exact match against a file etc.
  38427. if (!hasMagic) {
  38428. return globUnescape(pattern)
  38429. }
  38430. var flags = options.nocase ? 'i' : ''
  38431. try {
  38432. var regExp = new RegExp('^' + re + '$', flags)
  38433. } catch (er) {
  38434. // If it was an invalid regular expression, then it can't match
  38435. // anything. This trick looks for a character after the end of
  38436. // the string, which is of course impossible, except in multi-line
  38437. // mode, but it's not a /m regex.
  38438. return new RegExp('$.')
  38439. }
  38440. regExp._glob = pattern
  38441. regExp._src = re
  38442. return regExp
  38443. }
  38444. minimatch.makeRe = function (pattern, options) {
  38445. return new Minimatch(pattern, options || {}).makeRe()
  38446. }
  38447. Minimatch.prototype.makeRe = makeRe
  38448. function makeRe () {
  38449. if (this.regexp || this.regexp === false) return this.regexp
  38450. // at this point, this.set is a 2d array of partial
  38451. // pattern strings, or "**".
  38452. //
  38453. // It's better to use .match(). This function shouldn't
  38454. // be used, really, but it's pretty convenient sometimes,
  38455. // when you just want to work with a regex.
  38456. var set = this.set
  38457. if (!set.length) {
  38458. this.regexp = false
  38459. return this.regexp
  38460. }
  38461. var options = this.options
  38462. var twoStar = options.noglobstar ? star
  38463. : options.dot ? twoStarDot
  38464. : twoStarNoDot
  38465. var flags = options.nocase ? 'i' : ''
  38466. var re = set.map(function (pattern) {
  38467. return pattern.map(function (p) {
  38468. return (p === GLOBSTAR) ? twoStar
  38469. : (typeof p === 'string') ? regExpEscape(p)
  38470. : p._src
  38471. }).join('\\\/')
  38472. }).join('|')
  38473. // must match entire pattern
  38474. // ending in a * or ** will make it less strict.
  38475. re = '^(?:' + re + ')$'
  38476. // can match anything, as long as it's not this.
  38477. if (this.negate) re = '^(?!' + re + ').*$'
  38478. try {
  38479. this.regexp = new RegExp(re, flags)
  38480. } catch (ex) {
  38481. this.regexp = false
  38482. }
  38483. return this.regexp
  38484. }
  38485. minimatch.match = function (list, pattern, options) {
  38486. options = options || {}
  38487. var mm = new Minimatch(pattern, options)
  38488. list = list.filter(function (f) {
  38489. return mm.match(f)
  38490. })
  38491. if (mm.options.nonull && !list.length) {
  38492. list.push(pattern)
  38493. }
  38494. return list
  38495. }
  38496. Minimatch.prototype.match = match
  38497. function match (f, partial) {
  38498. this.debug('match', f, this.pattern)
  38499. // short-circuit in the case of busted things.
  38500. // comments, etc.
  38501. if (this.comment) return false
  38502. if (this.empty) return f === ''
  38503. if (f === '/' && partial) return true
  38504. var options = this.options
  38505. // windows: need to use /, not \
  38506. if (path.sep !== '/') {
  38507. f = f.split(path.sep).join('/')
  38508. }
  38509. // treat the test path as a set of pathparts.
  38510. f = f.split(slashSplit)
  38511. this.debug(this.pattern, 'split', f)
  38512. // just ONE of the pattern sets in this.set needs to match
  38513. // in order for it to be valid. If negating, then just one
  38514. // match means that we have failed.
  38515. // Either way, return on the first hit.
  38516. var set = this.set
  38517. this.debug(this.pattern, 'set', set)
  38518. // Find the basename of the path by looking for the last non-empty segment
  38519. var filename
  38520. var i
  38521. for (i = f.length - 1; i >= 0; i--) {
  38522. filename = f[i]
  38523. if (filename) break
  38524. }
  38525. for (i = 0; i < set.length; i++) {
  38526. var pattern = set[i]
  38527. var file = f
  38528. if (options.matchBase && pattern.length === 1) {
  38529. file = [filename]
  38530. }
  38531. var hit = this.matchOne(file, pattern, partial)
  38532. if (hit) {
  38533. if (options.flipNegate) return true
  38534. return !this.negate
  38535. }
  38536. }
  38537. // didn't get any hits. this is success if it's a negative
  38538. // pattern, failure otherwise.
  38539. if (options.flipNegate) return false
  38540. return this.negate
  38541. }
  38542. // set partial to true to test if, for example,
  38543. // "/a/b" matches the start of "/*/b/*/d"
  38544. // Partial means, if you run out of file before you run
  38545. // out of pattern, then that's fine, as long as all
  38546. // the parts match.
  38547. Minimatch.prototype.matchOne = function (file, pattern, partial) {
  38548. var options = this.options
  38549. this.debug('matchOne',
  38550. { 'this': this, file: file, pattern: pattern })
  38551. this.debug('matchOne', file.length, pattern.length)
  38552. for (var fi = 0,
  38553. pi = 0,
  38554. fl = file.length,
  38555. pl = pattern.length
  38556. ; (fi < fl) && (pi < pl)
  38557. ; fi++, pi++) {
  38558. this.debug('matchOne loop')
  38559. var p = pattern[pi]
  38560. var f = file[fi]
  38561. this.debug(pattern, p, f)
  38562. // should be impossible.
  38563. // some invalid regexp stuff in the set.
  38564. if (p === false) return false
  38565. if (p === GLOBSTAR) {
  38566. this.debug('GLOBSTAR', [pattern, p, f])
  38567. // "**"
  38568. // a/**/b/**/c would match the following:
  38569. // a/b/x/y/z/c
  38570. // a/x/y/z/b/c
  38571. // a/b/x/b/x/c
  38572. // a/b/c
  38573. // To do this, take the rest of the pattern after
  38574. // the **, and see if it would match the file remainder.
  38575. // If so, return success.
  38576. // If not, the ** "swallows" a segment, and try again.
  38577. // This is recursively awful.
  38578. //
  38579. // a/**/b/**/c matching a/b/x/y/z/c
  38580. // - a matches a
  38581. // - doublestar
  38582. // - matchOne(b/x/y/z/c, b/**/c)
  38583. // - b matches b
  38584. // - doublestar
  38585. // - matchOne(x/y/z/c, c) -> no
  38586. // - matchOne(y/z/c, c) -> no
  38587. // - matchOne(z/c, c) -> no
  38588. // - matchOne(c, c) yes, hit
  38589. var fr = fi
  38590. var pr = pi + 1
  38591. if (pr === pl) {
  38592. this.debug('** at the end')
  38593. // a ** at the end will just swallow the rest.
  38594. // We have found a match.
  38595. // however, it will not swallow /.x, unless
  38596. // options.dot is set.
  38597. // . and .. are *never* matched by **, for explosively
  38598. // exponential reasons.
  38599. for (; fi < fl; fi++) {
  38600. if (file[fi] === '.' || file[fi] === '..' ||
  38601. (!options.dot && file[fi].charAt(0) === '.')) return false
  38602. }
  38603. return true
  38604. }
  38605. // ok, let's see if we can swallow whatever we can.
  38606. while (fr < fl) {
  38607. var swallowee = file[fr]
  38608. this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
  38609. // XXX remove this slice. Just pass the start index.
  38610. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
  38611. this.debug('globstar found match!', fr, fl, swallowee)
  38612. // found a match.
  38613. return true
  38614. } else {
  38615. // can't swallow "." or ".." ever.
  38616. // can only swallow ".foo" when explicitly asked.
  38617. if (swallowee === '.' || swallowee === '..' ||
  38618. (!options.dot && swallowee.charAt(0) === '.')) {
  38619. this.debug('dot detected!', file, fr, pattern, pr)
  38620. break
  38621. }
  38622. // ** swallows a segment, and continue.
  38623. this.debug('globstar swallow a segment, and continue')
  38624. fr++
  38625. }
  38626. }
  38627. // no match was found.
  38628. // However, in partial mode, we can't say this is necessarily over.
  38629. // If there's more *pattern* left, then
  38630. if (partial) {
  38631. // ran out of file
  38632. this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
  38633. if (fr === fl) return true
  38634. }
  38635. return false
  38636. }
  38637. // something other than **
  38638. // non-magic patterns just have to match exactly
  38639. // patterns with magic have been turned into regexps.
  38640. var hit
  38641. if (typeof p === 'string') {
  38642. if (options.nocase) {
  38643. hit = f.toLowerCase() === p.toLowerCase()
  38644. } else {
  38645. hit = f === p
  38646. }
  38647. this.debug('string match', p, f, hit)
  38648. } else {
  38649. hit = f.match(p)
  38650. this.debug('pattern match', p, f, hit)
  38651. }
  38652. if (!hit) return false
  38653. }
  38654. // Note: ending in / means that we'll get a final ""
  38655. // at the end of the pattern. This can only match a
  38656. // corresponding "" at the end of the file.
  38657. // If the file ends in /, then it can only match a
  38658. // a pattern that ends in /, unless the pattern just
  38659. // doesn't have any more for it. But, a/b/ should *not*
  38660. // match "a/b/*", even though "" matches against the
  38661. // [^/]*? pattern, except in partial mode, where it might
  38662. // simply not be reached yet.
  38663. // However, a/b/ should still satisfy a/*
  38664. // now either we fell off the end of the pattern, or we're done.
  38665. if (fi === fl && pi === pl) {
  38666. // ran out of pattern and filename at the same time.
  38667. // an exact hit!
  38668. return true
  38669. } else if (fi === fl) {
  38670. // ran out of file, but still had pattern left.
  38671. // this is ok if we're doing the match as part of
  38672. // a glob fs traversal.
  38673. return partial
  38674. } else if (pi === pl) {
  38675. // ran out of pattern, still have file left.
  38676. // this is only acceptable if we're on the very last
  38677. // empty segment of a file with a trailing slash.
  38678. // a/* should match a/b/
  38679. var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
  38680. return emptyFileEnd
  38681. }
  38682. // should be unreachable.
  38683. throw new Error('wtf?')
  38684. }
  38685. // replace stuff like \* with *
  38686. function globUnescape (s) {
  38687. return s.replace(/\\(.)/g, '$1')
  38688. }
  38689. function regExpEscape (s) {
  38690. return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
  38691. }
  38692. /***/ }),
  38693. /* 171 */
  38694. /***/ (function(module, exports, __webpack_require__) {
  38695. "use strict";
  38696. if (!process.version ||
  38697. process.version.indexOf('v0.') === 0 ||
  38698. process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
  38699. module.exports = { nextTick: nextTick };
  38700. } else {
  38701. module.exports = process
  38702. }
  38703. function nextTick(fn, arg1, arg2, arg3) {
  38704. if (typeof fn !== 'function') {
  38705. throw new TypeError('"callback" argument must be a function');
  38706. }
  38707. var len = arguments.length;
  38708. var args, i;
  38709. switch (len) {
  38710. case 0:
  38711. case 1:
  38712. return process.nextTick(fn);
  38713. case 2:
  38714. return process.nextTick(function afterTickOne() {
  38715. fn.call(null, arg1);
  38716. });
  38717. case 3:
  38718. return process.nextTick(function afterTickTwo() {
  38719. fn.call(null, arg1, arg2);
  38720. });
  38721. case 4:
  38722. return process.nextTick(function afterTickThree() {
  38723. fn.call(null, arg1, arg2, arg3);
  38724. });
  38725. default:
  38726. args = new Array(len - 1);
  38727. i = 0;
  38728. while (i < args.length) {
  38729. args[i++] = arguments[i];
  38730. }
  38731. return process.nextTick(function afterTick() {
  38732. fn.apply(null, args);
  38733. });
  38734. }
  38735. }
  38736. /***/ }),
  38737. /* 172 */
  38738. /***/ (function(module, exports, __webpack_require__) {
  38739. "use strict";
  38740. var isPromise = __webpack_require__(790);
  38741. /**
  38742. * Return a function that will run a function asynchronously or synchronously
  38743. *
  38744. * example:
  38745. * runAsync(wrappedFunction, callback)(...args);
  38746. *
  38747. * @param {Function} func Function to run
  38748. * @param {Function} cb Callback function passed the `func` returned value
  38749. * @return {Function(arguments)} Arguments to pass to `func`. This function will in turn
  38750. * return a Promise (Node >= 0.12) or call the callbacks.
  38751. */
  38752. var runAsync = module.exports = function (func, cb) {
  38753. cb = cb || function () {};
  38754. return function () {
  38755. var async = false;
  38756. var args = arguments;
  38757. var promise = new Promise(function (resolve, reject) {
  38758. var answer = func.apply({
  38759. async: function () {
  38760. async = true;
  38761. return function (err, value) {
  38762. if (err) {
  38763. reject(err);
  38764. } else {
  38765. resolve(value);
  38766. }
  38767. };
  38768. }
  38769. }, Array.prototype.slice.call(args));
  38770. if (!async) {
  38771. if (isPromise(answer)) {
  38772. answer.then(resolve, reject);
  38773. } else {
  38774. resolve(answer);
  38775. }
  38776. }
  38777. });
  38778. promise.then(cb.bind(null, null), cb);
  38779. return promise;
  38780. }
  38781. };
  38782. runAsync.cb = function (func, cb) {
  38783. return runAsync(function () {
  38784. var args = Array.prototype.slice.call(arguments);
  38785. if (args.length === func.length - 1) {
  38786. args.push(this.async());
  38787. }
  38788. return func.apply(this, args);
  38789. }, cb);
  38790. };
  38791. /***/ }),
  38792. /* 173 */
  38793. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38794. "use strict";
  38795. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  38796. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_Observable__ = __webpack_require__(17);
  38797. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_Observable__["a"]; });
  38798. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_observable_ConnectableObservable__ = __webpack_require__(393);
  38799. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_observable_ConnectableObservable__["a"]; });
  38800. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_operators_groupBy__ = __webpack_require__(403);
  38801. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_operators_groupBy__["a"]; });
  38802. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_symbol_observable__ = __webpack_require__(112);
  38803. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return __WEBPACK_IMPORTED_MODULE_3__internal_symbol_observable__["a"]; });
  38804. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_Subject__ = __webpack_require__(43);
  38805. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_Subject__["a"]; });
  38806. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_BehaviorSubject__ = __webpack_require__(389);
  38807. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_BehaviorSubject__["a"]; });
  38808. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_ReplaySubject__ = __webpack_require__(249);
  38809. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return __WEBPACK_IMPORTED_MODULE_6__internal_ReplaySubject__["a"]; });
  38810. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__internal_AsyncSubject__ = __webpack_require__(174);
  38811. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return __WEBPACK_IMPORTED_MODULE_7__internal_AsyncSubject__["a"]; });
  38812. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__internal_scheduler_asap__ = __webpack_require__(408);
  38813. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return __WEBPACK_IMPORTED_MODULE_8__internal_scheduler_asap__["a"]; });
  38814. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__internal_scheduler_async__ = __webpack_require__(47);
  38815. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return __WEBPACK_IMPORTED_MODULE_9__internal_scheduler_async__["a"]; });
  38816. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__internal_scheduler_queue__ = __webpack_require__(409);
  38817. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return __WEBPACK_IMPORTED_MODULE_10__internal_scheduler_queue__["a"]; });
  38818. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__internal_scheduler_animationFrame__ = __webpack_require__(999);
  38819. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return __WEBPACK_IMPORTED_MODULE_11__internal_scheduler_animationFrame__["a"]; });
  38820. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__ = __webpack_require__(998);
  38821. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__["a"]; });
  38822. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__["b"]; });
  38823. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__internal_Scheduler__ = __webpack_require__(391);
  38824. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return __WEBPACK_IMPORTED_MODULE_13__internal_Scheduler__["a"]; });
  38825. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__internal_Subscription__ = __webpack_require__(31);
  38826. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return __WEBPACK_IMPORTED_MODULE_14__internal_Subscription__["a"]; });
  38827. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__internal_Subscriber__ = __webpack_require__(5);
  38828. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return __WEBPACK_IMPORTED_MODULE_15__internal_Subscriber__["a"]; });
  38829. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__internal_Notification__ = __webpack_require__(175);
  38830. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return __WEBPACK_IMPORTED_MODULE_16__internal_Notification__["a"]; });
  38831. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__internal_util_pipe__ = __webpack_require__(265);
  38832. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return __WEBPACK_IMPORTED_MODULE_17__internal_util_pipe__["a"]; });
  38833. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__internal_util_noop__ = __webpack_require__(182);
  38834. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_18__internal_util_noop__["a"]; });
  38835. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__internal_util_identity__ = __webpack_require__(113);
  38836. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_19__internal_util_identity__["a"]; });
  38837. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__internal_util_isObservable__ = __webpack_require__(1003);
  38838. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return __WEBPACK_IMPORTED_MODULE_20__internal_util_isObservable__["a"]; });
  38839. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__internal_util_ArgumentOutOfRangeError__ = __webpack_require__(141);
  38840. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return __WEBPACK_IMPORTED_MODULE_21__internal_util_ArgumentOutOfRangeError__["a"]; });
  38841. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__internal_util_EmptyError__ = __webpack_require__(142);
  38842. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return __WEBPACK_IMPORTED_MODULE_22__internal_util_EmptyError__["a"]; });
  38843. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__internal_util_ObjectUnsubscribedError__ = __webpack_require__(180);
  38844. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return __WEBPACK_IMPORTED_MODULE_23__internal_util_ObjectUnsubscribedError__["a"]; });
  38845. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__internal_util_UnsubscriptionError__ = __webpack_require__(411);
  38846. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return __WEBPACK_IMPORTED_MODULE_24__internal_util_UnsubscriptionError__["a"]; });
  38847. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__internal_util_TimeoutError__ = __webpack_require__(410);
  38848. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return __WEBPACK_IMPORTED_MODULE_25__internal_util_TimeoutError__["a"]; });
  38849. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__internal_observable_bindCallback__ = __webpack_require__(896);
  38850. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return __WEBPACK_IMPORTED_MODULE_26__internal_observable_bindCallback__["a"]; });
  38851. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__internal_observable_bindNodeCallback__ = __webpack_require__(897);
  38852. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return __WEBPACK_IMPORTED_MODULE_27__internal_observable_bindNodeCallback__["a"]; });
  38853. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__internal_observable_combineLatest__ = __webpack_require__(250);
  38854. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return __WEBPACK_IMPORTED_MODULE_28__internal_observable_combineLatest__["a"]; });
  38855. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__internal_observable_concat__ = __webpack_require__(177);
  38856. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return __WEBPACK_IMPORTED_MODULE_29__internal_observable_concat__["a"]; });
  38857. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__internal_observable_defer__ = __webpack_require__(251);
  38858. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_30__internal_observable_defer__["a"]; });
  38859. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__ = __webpack_require__(46);
  38860. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__["a"]; });
  38861. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__internal_observable_forkJoin__ = __webpack_require__(898);
  38862. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return __WEBPACK_IMPORTED_MODULE_32__internal_observable_forkJoin__["a"]; });
  38863. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__internal_observable_from__ = __webpack_require__(64);
  38864. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "from", function() { return __WEBPACK_IMPORTED_MODULE_33__internal_observable_from__["a"]; });
  38865. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__internal_observable_fromEvent__ = __webpack_require__(899);
  38866. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return __WEBPACK_IMPORTED_MODULE_34__internal_observable_fromEvent__["a"]; });
  38867. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__internal_observable_fromEventPattern__ = __webpack_require__(900);
  38868. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return __WEBPACK_IMPORTED_MODULE_35__internal_observable_fromEventPattern__["a"]; });
  38869. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__internal_observable_generate__ = __webpack_require__(904);
  38870. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return __WEBPACK_IMPORTED_MODULE_36__internal_observable_generate__["a"]; });
  38871. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__internal_observable_iif__ = __webpack_require__(905);
  38872. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return __WEBPACK_IMPORTED_MODULE_37__internal_observable_iif__["a"]; });
  38873. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__internal_observable_interval__ = __webpack_require__(906);
  38874. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return __WEBPACK_IMPORTED_MODULE_38__internal_observable_interval__["a"]; });
  38875. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__internal_observable_merge__ = __webpack_require__(394);
  38876. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return __WEBPACK_IMPORTED_MODULE_39__internal_observable_merge__["a"]; });
  38877. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__ = __webpack_require__(395);
  38878. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "never", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__["a"]; });
  38879. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__internal_observable_of__ = __webpack_require__(252);
  38880. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "of", function() { return __WEBPACK_IMPORTED_MODULE_41__internal_observable_of__["a"]; });
  38881. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__internal_observable_onErrorResumeNext__ = __webpack_require__(907);
  38882. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return __WEBPACK_IMPORTED_MODULE_42__internal_observable_onErrorResumeNext__["a"]; });
  38883. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__internal_observable_pairs__ = __webpack_require__(908);
  38884. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_43__internal_observable_pairs__["a"]; });
  38885. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__internal_observable_race__ = __webpack_require__(396);
  38886. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return __WEBPACK_IMPORTED_MODULE_44__internal_observable_race__["a"]; });
  38887. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__internal_observable_range__ = __webpack_require__(909);
  38888. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_45__internal_observable_range__["a"]; });
  38889. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__internal_observable_throwError__ = __webpack_require__(254);
  38890. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return __WEBPACK_IMPORTED_MODULE_46__internal_observable_throwError__["a"]; });
  38891. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__internal_observable_timer__ = __webpack_require__(397);
  38892. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return __WEBPACK_IMPORTED_MODULE_47__internal_observable_timer__["a"]; });
  38893. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__internal_observable_using__ = __webpack_require__(910);
  38894. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "using", function() { return __WEBPACK_IMPORTED_MODULE_48__internal_observable_using__["a"]; });
  38895. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__internal_observable_zip__ = __webpack_require__(255);
  38896. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_49__internal_observable_zip__["a"]; });
  38897. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__["b"]; });
  38898. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__["b"]; });
  38899. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__internal_config__ = __webpack_require__(176);
  38900. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return __WEBPACK_IMPORTED_MODULE_50__internal_config__["a"]; });
  38901. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  38902. //# sourceMappingURL=index.js.map
  38903. /***/ }),
  38904. /* 174 */
  38905. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38906. "use strict";
  38907. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncSubject; });
  38908. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  38909. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
  38910. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(31);
  38911. /** PURE_IMPORTS_START tslib,_Subject,_Subscription PURE_IMPORTS_END */
  38912. var AsyncSubject = /*@__PURE__*/ (function (_super) {
  38913. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncSubject, _super);
  38914. function AsyncSubject() {
  38915. var _this = _super !== null && _super.apply(this, arguments) || this;
  38916. _this.value = null;
  38917. _this.hasNext = false;
  38918. _this.hasCompleted = false;
  38919. return _this;
  38920. }
  38921. AsyncSubject.prototype._subscribe = function (subscriber) {
  38922. if (this.hasError) {
  38923. subscriber.error(this.thrownError);
  38924. return __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */].EMPTY;
  38925. }
  38926. else if (this.hasCompleted && this.hasNext) {
  38927. subscriber.next(this.value);
  38928. subscriber.complete();
  38929. return __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */].EMPTY;
  38930. }
  38931. return _super.prototype._subscribe.call(this, subscriber);
  38932. };
  38933. AsyncSubject.prototype.next = function (value) {
  38934. if (!this.hasCompleted) {
  38935. this.value = value;
  38936. this.hasNext = true;
  38937. }
  38938. };
  38939. AsyncSubject.prototype.error = function (error) {
  38940. if (!this.hasCompleted) {
  38941. _super.prototype.error.call(this, error);
  38942. }
  38943. };
  38944. AsyncSubject.prototype.complete = function () {
  38945. this.hasCompleted = true;
  38946. if (this.hasNext) {
  38947. _super.prototype.next.call(this, this.value);
  38948. }
  38949. _super.prototype.complete.call(this);
  38950. };
  38951. return AsyncSubject;
  38952. }(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]));
  38953. //# sourceMappingURL=AsyncSubject.js.map
  38954. /***/ }),
  38955. /* 175 */
  38956. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38957. "use strict";
  38958. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Notification; });
  38959. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_empty__ = __webpack_require__(46);
  38960. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_of__ = __webpack_require__(252);
  38961. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_throwError__ = __webpack_require__(254);
  38962. /** PURE_IMPORTS_START _observable_empty,_observable_of,_observable_throwError PURE_IMPORTS_END */
  38963. var Notification = /*@__PURE__*/ (function () {
  38964. function Notification(kind, value, error) {
  38965. this.kind = kind;
  38966. this.value = value;
  38967. this.error = error;
  38968. this.hasValue = kind === 'N';
  38969. }
  38970. Notification.prototype.observe = function (observer) {
  38971. switch (this.kind) {
  38972. case 'N':
  38973. return observer.next && observer.next(this.value);
  38974. case 'E':
  38975. return observer.error && observer.error(this.error);
  38976. case 'C':
  38977. return observer.complete && observer.complete();
  38978. }
  38979. };
  38980. Notification.prototype.do = function (next, error, complete) {
  38981. var kind = this.kind;
  38982. switch (kind) {
  38983. case 'N':
  38984. return next && next(this.value);
  38985. case 'E':
  38986. return error && error(this.error);
  38987. case 'C':
  38988. return complete && complete();
  38989. }
  38990. };
  38991. Notification.prototype.accept = function (nextOrObserver, error, complete) {
  38992. if (nextOrObserver && typeof nextOrObserver.next === 'function') {
  38993. return this.observe(nextOrObserver);
  38994. }
  38995. else {
  38996. return this.do(nextOrObserver, error, complete);
  38997. }
  38998. };
  38999. Notification.prototype.toObservable = function () {
  39000. var kind = this.kind;
  39001. switch (kind) {
  39002. case 'N':
  39003. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_of__["a" /* of */])(this.value);
  39004. case 'E':
  39005. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_throwError__["a" /* throwError */])(this.error);
  39006. case 'C':
  39007. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__observable_empty__["a" /* empty */])();
  39008. }
  39009. throw new Error('unexpected notification kind value');
  39010. };
  39011. Notification.createNext = function (value) {
  39012. if (typeof value !== 'undefined') {
  39013. return new Notification('N', value);
  39014. }
  39015. return Notification.undefinedValueNotification;
  39016. };
  39017. Notification.createError = function (err) {
  39018. return new Notification('E', undefined, err);
  39019. };
  39020. Notification.createComplete = function () {
  39021. return Notification.completeNotification;
  39022. };
  39023. Notification.completeNotification = new Notification('C');
  39024. Notification.undefinedValueNotification = new Notification('N', undefined);
  39025. return Notification;
  39026. }());
  39027. //# sourceMappingURL=Notification.js.map
  39028. /***/ }),
  39029. /* 176 */
  39030. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39031. "use strict";
  39032. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return config; });
  39033. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  39034. var _enable_super_gross_mode_that_will_cause_bad_things = false;
  39035. var config = {
  39036. Promise: undefined,
  39037. set useDeprecatedSynchronousErrorHandling(value) {
  39038. if (value) {
  39039. var error = /*@__PURE__*/ new Error();
  39040. /*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
  39041. }
  39042. else if (_enable_super_gross_mode_that_will_cause_bad_things) {
  39043. /*@__PURE__*/ console.log('RxJS: Back to a better error behavior. Thank you. <3');
  39044. }
  39045. _enable_super_gross_mode_that_will_cause_bad_things = value;
  39046. },
  39047. get useDeprecatedSynchronousErrorHandling() {
  39048. return _enable_super_gross_mode_that_will_cause_bad_things;
  39049. },
  39050. };
  39051. //# sourceMappingURL=config.js.map
  39052. /***/ }),
  39053. /* 177 */
  39054. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39055. "use strict";
  39056. /* harmony export (immutable) */ __webpack_exports__["a"] = concat;
  39057. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isScheduler__ = __webpack_require__(56);
  39058. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__of__ = __webpack_require__(252);
  39059. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__from__ = __webpack_require__(64);
  39060. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_concatAll__ = __webpack_require__(399);
  39061. /** PURE_IMPORTS_START _util_isScheduler,_of,_from,_operators_concatAll PURE_IMPORTS_END */
  39062. function concat() {
  39063. var observables = [];
  39064. for (var _i = 0; _i < arguments.length; _i++) {
  39065. observables[_i] = arguments[_i];
  39066. }
  39067. if (observables.length === 1 || (observables.length === 2 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isScheduler__["a" /* isScheduler */])(observables[1]))) {
  39068. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__from__["a" /* from */])(observables[0]);
  39069. }
  39070. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__operators_concatAll__["a" /* concatAll */])()(__WEBPACK_IMPORTED_MODULE_1__of__["a" /* of */].apply(void 0, observables));
  39071. }
  39072. //# sourceMappingURL=concat.js.map
  39073. /***/ }),
  39074. /* 178 */
  39075. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39076. "use strict";
  39077. /* harmony export (immutable) */ __webpack_exports__["a"] = reduce;
  39078. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scan__ = __webpack_require__(258);
  39079. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__takeLast__ = __webpack_require__(261);
  39080. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__defaultIfEmpty__ = __webpack_require__(135);
  39081. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(265);
  39082. /** PURE_IMPORTS_START _scan,_takeLast,_defaultIfEmpty,_util_pipe PURE_IMPORTS_END */
  39083. function reduce(accumulator, seed) {
  39084. if (arguments.length >= 2) {
  39085. return function reduceOperatorFunctionWithSeed(source) {
  39086. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["a" /* pipe */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__scan__["a" /* scan */])(accumulator, seed), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__takeLast__["a" /* takeLast */])(1), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__defaultIfEmpty__["a" /* defaultIfEmpty */])(seed))(source);
  39087. };
  39088. }
  39089. return function reduceOperatorFunction(source) {
  39090. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["a" /* pipe */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__scan__["a" /* scan */])(function (acc, value, index) { return accumulator(acc, value, index + 1); }), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__takeLast__["a" /* takeLast */])(1))(source);
  39091. };
  39092. }
  39093. //# sourceMappingURL=reduce.js.map
  39094. /***/ }),
  39095. /* 179 */
  39096. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39097. "use strict";
  39098. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return throwIfEmpty; });
  39099. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tap__ = __webpack_require__(405);
  39100. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_EmptyError__ = __webpack_require__(142);
  39101. /** PURE_IMPORTS_START _tap,_util_EmptyError PURE_IMPORTS_END */
  39102. var throwIfEmpty = function (errorFactory) {
  39103. if (errorFactory === void 0) {
  39104. errorFactory = defaultErrorFactory;
  39105. }
  39106. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__tap__["a" /* tap */])({
  39107. hasValue: false,
  39108. next: function () { this.hasValue = true; },
  39109. complete: function () {
  39110. if (!this.hasValue) {
  39111. throw errorFactory();
  39112. }
  39113. }
  39114. });
  39115. };
  39116. function defaultErrorFactory() {
  39117. return new __WEBPACK_IMPORTED_MODULE_1__util_EmptyError__["a" /* EmptyError */]();
  39118. }
  39119. //# sourceMappingURL=throwIfEmpty.js.map
  39120. /***/ }),
  39121. /* 180 */
  39122. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39123. "use strict";
  39124. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ObjectUnsubscribedError; });
  39125. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  39126. function ObjectUnsubscribedErrorImpl() {
  39127. Error.call(this);
  39128. this.message = 'object unsubscribed';
  39129. this.name = 'ObjectUnsubscribedError';
  39130. return this;
  39131. }
  39132. ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
  39133. var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;
  39134. //# sourceMappingURL=ObjectUnsubscribedError.js.map
  39135. /***/ }),
  39136. /* 181 */
  39137. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39138. "use strict";
  39139. /* harmony export (immutable) */ __webpack_exports__["a"] = isNumeric;
  39140. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray__ = __webpack_require__(48);
  39141. /** PURE_IMPORTS_START _isArray PURE_IMPORTS_END */
  39142. function isNumeric(val) {
  39143. return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isArray__["a" /* isArray */])(val) && (val - parseFloat(val) + 1) >= 0;
  39144. }
  39145. //# sourceMappingURL=isNumeric.js.map
  39146. /***/ }),
  39147. /* 182 */
  39148. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39149. "use strict";
  39150. /* harmony export (immutable) */ __webpack_exports__["a"] = noop;
  39151. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  39152. function noop() { }
  39153. //# sourceMappingURL=noop.js.map
  39154. /***/ }),
  39155. /* 183 */
  39156. /***/ (function(module, exports, __webpack_require__) {
  39157. // Copyright 2015 Joyent, Inc.
  39158. module.exports = {
  39159. read: read,
  39160. readSSHPrivate: readSSHPrivate,
  39161. write: write
  39162. };
  39163. var assert = __webpack_require__(22);
  39164. var asn1 = __webpack_require__(67);
  39165. var Buffer = __webpack_require__(20).Buffer;
  39166. var algs = __webpack_require__(39);
  39167. var utils = __webpack_require__(32);
  39168. var crypto = __webpack_require__(21);
  39169. var Key = __webpack_require__(35);
  39170. var PrivateKey = __webpack_require__(40);
  39171. var pem = __webpack_require__(82);
  39172. var rfc4253 = __webpack_require__(92);
  39173. var SSHBuffer = __webpack_require__(148);
  39174. var errors = __webpack_require__(70);
  39175. var bcrypt;
  39176. function read(buf, options) {
  39177. return (pem.read(buf, options));
  39178. }
  39179. var MAGIC = 'openssh-key-v1';
  39180. function readSSHPrivate(type, buf, options) {
  39181. buf = new SSHBuffer({buffer: buf});
  39182. var magic = buf.readCString();
  39183. assert.strictEqual(magic, MAGIC, 'bad magic string');
  39184. var cipher = buf.readString();
  39185. var kdf = buf.readString();
  39186. var kdfOpts = buf.readBuffer();
  39187. var nkeys = buf.readInt();
  39188. if (nkeys !== 1) {
  39189. throw (new Error('OpenSSH-format key file contains ' +
  39190. 'multiple keys: this is unsupported.'));
  39191. }
  39192. var pubKey = buf.readBuffer();
  39193. if (type === 'public') {
  39194. assert.ok(buf.atEnd(), 'excess bytes left after key');
  39195. return (rfc4253.read(pubKey));
  39196. }
  39197. var privKeyBlob = buf.readBuffer();
  39198. assert.ok(buf.atEnd(), 'excess bytes left after key');
  39199. var kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts });
  39200. switch (kdf) {
  39201. case 'none':
  39202. if (cipher !== 'none') {
  39203. throw (new Error('OpenSSH-format key uses KDF "none" ' +
  39204. 'but specifies a cipher other than "none"'));
  39205. }
  39206. break;
  39207. case 'bcrypt':
  39208. var salt = kdfOptsBuf.readBuffer();
  39209. var rounds = kdfOptsBuf.readInt();
  39210. var cinf = utils.opensshCipherInfo(cipher);
  39211. if (bcrypt === undefined) {
  39212. bcrypt = __webpack_require__(317);
  39213. }
  39214. if (typeof (options.passphrase) === 'string') {
  39215. options.passphrase = Buffer.from(options.passphrase,
  39216. 'utf-8');
  39217. }
  39218. if (!Buffer.isBuffer(options.passphrase)) {
  39219. throw (new errors.KeyEncryptedError(
  39220. options.filename, 'OpenSSH'));
  39221. }
  39222. var pass = new Uint8Array(options.passphrase);
  39223. var salti = new Uint8Array(salt);
  39224. /* Use the pbkdf to derive both the key and the IV. */
  39225. var out = new Uint8Array(cinf.keySize + cinf.blockSize);
  39226. var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length,
  39227. out, out.length, rounds);
  39228. if (res !== 0) {
  39229. throw (new Error('bcrypt_pbkdf function returned ' +
  39230. 'failure, parameters invalid'));
  39231. }
  39232. out = Buffer.from(out);
  39233. var ckey = out.slice(0, cinf.keySize);
  39234. var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);
  39235. var cipherStream = crypto.createDecipheriv(cinf.opensslName,
  39236. ckey, iv);
  39237. cipherStream.setAutoPadding(false);
  39238. var chunk, chunks = [];
  39239. cipherStream.once('error', function (e) {
  39240. if (e.toString().indexOf('bad decrypt') !== -1) {
  39241. throw (new Error('Incorrect passphrase ' +
  39242. 'supplied, could not decrypt key'));
  39243. }
  39244. throw (e);
  39245. });
  39246. cipherStream.write(privKeyBlob);
  39247. cipherStream.end();
  39248. while ((chunk = cipherStream.read()) !== null)
  39249. chunks.push(chunk);
  39250. privKeyBlob = Buffer.concat(chunks);
  39251. break;
  39252. default:
  39253. throw (new Error(
  39254. 'OpenSSH-format key uses unknown KDF "' + kdf + '"'));
  39255. }
  39256. buf = new SSHBuffer({buffer: privKeyBlob});
  39257. var checkInt1 = buf.readInt();
  39258. var checkInt2 = buf.readInt();
  39259. if (checkInt1 !== checkInt2) {
  39260. throw (new Error('Incorrect passphrase supplied, could not ' +
  39261. 'decrypt key'));
  39262. }
  39263. var ret = {};
  39264. var key = rfc4253.readInternal(ret, 'private', buf.remainder());
  39265. buf.skip(ret.consumed);
  39266. var comment = buf.readString();
  39267. key.comment = comment;
  39268. return (key);
  39269. }
  39270. function write(key, options) {
  39271. var pubKey;
  39272. if (PrivateKey.isPrivateKey(key))
  39273. pubKey = key.toPublic();
  39274. else
  39275. pubKey = key;
  39276. var cipher = 'none';
  39277. var kdf = 'none';
  39278. var kdfopts = Buffer.alloc(0);
  39279. var cinf = { blockSize: 8 };
  39280. var passphrase;
  39281. if (options !== undefined) {
  39282. passphrase = options.passphrase;
  39283. if (typeof (passphrase) === 'string')
  39284. passphrase = Buffer.from(passphrase, 'utf-8');
  39285. if (passphrase !== undefined) {
  39286. assert.buffer(passphrase, 'options.passphrase');
  39287. assert.optionalString(options.cipher, 'options.cipher');
  39288. cipher = options.cipher;
  39289. if (cipher === undefined)
  39290. cipher = 'aes128-ctr';
  39291. cinf = utils.opensshCipherInfo(cipher);
  39292. kdf = 'bcrypt';
  39293. }
  39294. }
  39295. var privBuf;
  39296. if (PrivateKey.isPrivateKey(key)) {
  39297. privBuf = new SSHBuffer({});
  39298. var checkInt = crypto.randomBytes(4).readUInt32BE(0);
  39299. privBuf.writeInt(checkInt);
  39300. privBuf.writeInt(checkInt);
  39301. privBuf.write(key.toBuffer('rfc4253'));
  39302. privBuf.writeString(key.comment || '');
  39303. var n = 1;
  39304. while (privBuf._offset % cinf.blockSize !== 0)
  39305. privBuf.writeChar(n++);
  39306. privBuf = privBuf.toBuffer();
  39307. }
  39308. switch (kdf) {
  39309. case 'none':
  39310. break;
  39311. case 'bcrypt':
  39312. var salt = crypto.randomBytes(16);
  39313. var rounds = 16;
  39314. var kdfssh = new SSHBuffer({});
  39315. kdfssh.writeBuffer(salt);
  39316. kdfssh.writeInt(rounds);
  39317. kdfopts = kdfssh.toBuffer();
  39318. if (bcrypt === undefined) {
  39319. bcrypt = __webpack_require__(317);
  39320. }
  39321. var pass = new Uint8Array(passphrase);
  39322. var salti = new Uint8Array(salt);
  39323. /* Use the pbkdf to derive both the key and the IV. */
  39324. var out = new Uint8Array(cinf.keySize + cinf.blockSize);
  39325. var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length,
  39326. out, out.length, rounds);
  39327. if (res !== 0) {
  39328. throw (new Error('bcrypt_pbkdf function returned ' +
  39329. 'failure, parameters invalid'));
  39330. }
  39331. out = Buffer.from(out);
  39332. var ckey = out.slice(0, cinf.keySize);
  39333. var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);
  39334. var cipherStream = crypto.createCipheriv(cinf.opensslName,
  39335. ckey, iv);
  39336. cipherStream.setAutoPadding(false);
  39337. var chunk, chunks = [];
  39338. cipherStream.once('error', function (e) {
  39339. throw (e);
  39340. });
  39341. cipherStream.write(privBuf);
  39342. cipherStream.end();
  39343. while ((chunk = cipherStream.read()) !== null)
  39344. chunks.push(chunk);
  39345. privBuf = Buffer.concat(chunks);
  39346. break;
  39347. default:
  39348. throw (new Error('Unsupported kdf ' + kdf));
  39349. }
  39350. var buf = new SSHBuffer({});
  39351. buf.writeCString(MAGIC);
  39352. buf.writeString(cipher); /* cipher */
  39353. buf.writeString(kdf); /* kdf */
  39354. buf.writeBuffer(kdfopts); /* kdfoptions */
  39355. buf.writeInt(1); /* nkeys */
  39356. buf.writeBuffer(pubKey.toBuffer('rfc4253'));
  39357. if (privBuf)
  39358. buf.writeBuffer(privBuf);
  39359. buf = buf.toBuffer();
  39360. var header;
  39361. if (PrivateKey.isPrivateKey(key))
  39362. header = 'OPENSSH PRIVATE KEY';
  39363. else
  39364. header = 'OPENSSH PUBLIC KEY';
  39365. var tmp = buf.toString('base64');
  39366. var len = tmp.length + (tmp.length / 70) +
  39367. 18 + 16 + header.length*2 + 10;
  39368. buf = Buffer.alloc(len);
  39369. var o = 0;
  39370. o += buf.write('-----BEGIN ' + header + '-----\n', o);
  39371. for (var i = 0; i < tmp.length; ) {
  39372. var limit = i + 70;
  39373. if (limit > tmp.length)
  39374. limit = tmp.length;
  39375. o += buf.write(tmp.slice(i, limit), o);
  39376. buf[o++] = 10;
  39377. i = limit;
  39378. }
  39379. o += buf.write('-----END ' + header + '-----\n', o);
  39380. return (buf.slice(0, o));
  39381. }
  39382. /***/ }),
  39383. /* 184 */
  39384. /***/ (function(module, exports, __webpack_require__) {
  39385. var chownr = __webpack_require__(566)
  39386. var tar = __webpack_require__(431)
  39387. var pump = __webpack_require__(853)
  39388. var mkdirp = __webpack_require__(241)
  39389. var fs = __webpack_require__(12)
  39390. var path = __webpack_require__(1)
  39391. var os = __webpack_require__(66)
  39392. var win32 = os.platform() === 'win32'
  39393. var noop = function () {}
  39394. var echo = function (name) {
  39395. return name
  39396. }
  39397. var normalize = !win32 ? echo : function (name) {
  39398. return name.replace(/\\/g, '/').replace(/[:?<>|]/g, '_')
  39399. }
  39400. var statAll = function (fs, stat, cwd, ignore, entries, sort) {
  39401. var queue = entries || ['.']
  39402. return function loop (callback) {
  39403. if (!queue.length) return callback()
  39404. var next = queue.shift()
  39405. var nextAbs = path.join(cwd, next)
  39406. stat(nextAbs, function (err, stat) {
  39407. if (err) return callback(err)
  39408. if (!stat.isDirectory()) return callback(null, next, stat)
  39409. fs.readdir(nextAbs, function (err, files) {
  39410. if (err) return callback(err)
  39411. if (sort) files.sort()
  39412. for (var i = 0; i < files.length; i++) {
  39413. if (!ignore(path.join(cwd, next, files[i]))) queue.push(path.join(next, files[i]))
  39414. }
  39415. callback(null, next, stat)
  39416. })
  39417. })
  39418. }
  39419. }
  39420. var strip = function (map, level) {
  39421. return function (header) {
  39422. header.name = header.name.split('/').slice(level).join('/')
  39423. var linkname = header.linkname
  39424. if (linkname && (header.type === 'link' || path.isAbsolute(linkname))) {
  39425. header.linkname = linkname.split('/').slice(level).join('/')
  39426. }
  39427. return map(header)
  39428. }
  39429. }
  39430. exports.pack = function (cwd, opts) {
  39431. if (!cwd) cwd = '.'
  39432. if (!opts) opts = {}
  39433. var xfs = opts.fs || fs
  39434. var ignore = opts.ignore || opts.filter || noop
  39435. var map = opts.map || noop
  39436. var mapStream = opts.mapStream || echo
  39437. var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort)
  39438. var strict = opts.strict !== false
  39439. var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask()
  39440. var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0
  39441. var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0
  39442. var pack = opts.pack || tar.pack()
  39443. var finish = opts.finish || noop
  39444. if (opts.strip) map = strip(map, opts.strip)
  39445. if (opts.readable) {
  39446. dmode |= parseInt(555, 8)
  39447. fmode |= parseInt(444, 8)
  39448. }
  39449. if (opts.writable) {
  39450. dmode |= parseInt(333, 8)
  39451. fmode |= parseInt(222, 8)
  39452. }
  39453. var onsymlink = function (filename, header) {
  39454. xfs.readlink(path.join(cwd, filename), function (err, linkname) {
  39455. if (err) return pack.destroy(err)
  39456. header.linkname = normalize(linkname)
  39457. pack.entry(header, onnextentry)
  39458. })
  39459. }
  39460. var onstat = function (err, filename, stat) {
  39461. if (err) return pack.destroy(err)
  39462. if (!filename) {
  39463. if (opts.finalize !== false) pack.finalize()
  39464. return finish(pack)
  39465. }
  39466. if (stat.isSocket()) return onnextentry() // tar does not support sockets...
  39467. var header = {
  39468. name: normalize(filename),
  39469. mode: (stat.mode | (stat.isDirectory() ? dmode : fmode)) & umask,
  39470. mtime: stat.mtime,
  39471. size: stat.size,
  39472. type: 'file',
  39473. uid: stat.uid,
  39474. gid: stat.gid
  39475. }
  39476. if (stat.isDirectory()) {
  39477. header.size = 0
  39478. header.type = 'directory'
  39479. header = map(header) || header
  39480. return pack.entry(header, onnextentry)
  39481. }
  39482. if (stat.isSymbolicLink()) {
  39483. header.size = 0
  39484. header.type = 'symlink'
  39485. header = map(header) || header
  39486. return onsymlink(filename, header)
  39487. }
  39488. // TODO: add fifo etc...
  39489. header = map(header) || header
  39490. if (!stat.isFile()) {
  39491. if (strict) return pack.destroy(new Error('unsupported type for ' + filename))
  39492. return onnextentry()
  39493. }
  39494. var entry = pack.entry(header, onnextentry)
  39495. if (!entry) return
  39496. var rs = mapStream(xfs.createReadStream(path.join(cwd, filename)), header)
  39497. rs.on('error', function (err) { // always forward errors on destroy
  39498. entry.destroy(err)
  39499. })
  39500. pump(rs, entry)
  39501. }
  39502. var onnextentry = function (err) {
  39503. if (err) return pack.destroy(err)
  39504. statNext(onstat)
  39505. }
  39506. onnextentry()
  39507. return pack
  39508. }
  39509. var head = function (list) {
  39510. return list.length ? list[list.length - 1] : null
  39511. }
  39512. var processGetuid = function () {
  39513. return process.getuid ? process.getuid() : -1
  39514. }
  39515. var processUmask = function () {
  39516. return process.umask ? process.umask() : 0
  39517. }
  39518. exports.extract = function (cwd, opts) {
  39519. if (!cwd) cwd = '.'
  39520. if (!opts) opts = {}
  39521. var xfs = opts.fs || fs
  39522. var ignore = opts.ignore || opts.filter || noop
  39523. var map = opts.map || noop
  39524. var mapStream = opts.mapStream || echo
  39525. var own = opts.chown !== false && !win32 && processGetuid() === 0
  39526. var extract = opts.extract || tar.extract()
  39527. var stack = []
  39528. var now = new Date()
  39529. var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask()
  39530. var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0
  39531. var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0
  39532. var strict = opts.strict !== false
  39533. if (opts.strip) map = strip(map, opts.strip)
  39534. if (opts.readable) {
  39535. dmode |= parseInt(555, 8)
  39536. fmode |= parseInt(444, 8)
  39537. }
  39538. if (opts.writable) {
  39539. dmode |= parseInt(333, 8)
  39540. fmode |= parseInt(222, 8)
  39541. }
  39542. var utimesParent = function (name, cb) { // we just set the mtime on the parent dir again everytime we write an entry
  39543. var top
  39544. while ((top = head(stack)) && name.slice(0, top[0].length) !== top[0]) stack.pop()
  39545. if (!top) return cb()
  39546. xfs.utimes(top[0], now, top[1], cb)
  39547. }
  39548. var utimes = function (name, header, cb) {
  39549. if (opts.utimes === false) return cb()
  39550. if (header.type === 'directory') return xfs.utimes(name, now, header.mtime, cb)
  39551. if (header.type === 'symlink') return utimesParent(name, cb) // TODO: how to set mtime on link?
  39552. xfs.utimes(name, now, header.mtime, function (err) {
  39553. if (err) return cb(err)
  39554. utimesParent(name, cb)
  39555. })
  39556. }
  39557. var chperm = function (name, header, cb) {
  39558. var link = header.type === 'symlink'
  39559. var chmod = link ? xfs.lchmod : xfs.chmod
  39560. var chown = link ? xfs.lchown : xfs.chown
  39561. if (!chmod) return cb()
  39562. var mode = (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask
  39563. chmod(name, mode, function (err) {
  39564. if (err) return cb(err)
  39565. if (!own) return cb()
  39566. if (!chown) return cb()
  39567. chown(name, header.uid, header.gid, cb)
  39568. })
  39569. }
  39570. extract.on('entry', function (header, stream, next) {
  39571. header = map(header) || header
  39572. header.name = normalize(header.name)
  39573. var name = path.join(cwd, path.join('/', header.name))
  39574. if (ignore(name, header)) {
  39575. stream.resume()
  39576. return next()
  39577. }
  39578. var stat = function (err) {
  39579. if (err) return next(err)
  39580. utimes(name, header, function (err) {
  39581. if (err) return next(err)
  39582. if (win32) return next()
  39583. chperm(name, header, next)
  39584. })
  39585. }
  39586. var onsymlink = function () {
  39587. if (win32) return next() // skip symlinks on win for now before it can be tested
  39588. xfs.unlink(name, function () {
  39589. xfs.symlink(header.linkname, name, stat)
  39590. })
  39591. }
  39592. var onlink = function () {
  39593. if (win32) return next() // skip links on win for now before it can be tested
  39594. xfs.unlink(name, function () {
  39595. var srcpath = path.join(cwd, path.join('/', header.linkname))
  39596. xfs.link(srcpath, name, function (err) {
  39597. if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) {
  39598. stream = xfs.createReadStream(srcpath)
  39599. return onfile()
  39600. }
  39601. stat(err)
  39602. })
  39603. })
  39604. }
  39605. var onfile = function () {
  39606. var ws = xfs.createWriteStream(name)
  39607. var rs = mapStream(stream, header)
  39608. ws.on('error', function (err) { // always forward errors on destroy
  39609. rs.destroy(err)
  39610. })
  39611. pump(rs, ws, function (err) {
  39612. if (err) return next(err)
  39613. ws.on('close', stat)
  39614. })
  39615. }
  39616. if (header.type === 'directory') {
  39617. stack.push([name, header.mtime])
  39618. return mkdirfix(name, {
  39619. fs: xfs, own: own, uid: header.uid, gid: header.gid
  39620. }, stat)
  39621. }
  39622. var dir = path.dirname(name)
  39623. validate(xfs, dir, path.join(cwd, '.'), function (err, valid) {
  39624. if (err) return next(err)
  39625. if (!valid) return next(new Error(dir + ' is not a valid path'))
  39626. mkdirfix(dir, {
  39627. fs: xfs, own: own, uid: header.uid, gid: header.gid
  39628. }, function (err) {
  39629. if (err) return next(err)
  39630. switch (header.type) {
  39631. case 'file': return onfile()
  39632. case 'link': return onlink()
  39633. case 'symlink': return onsymlink()
  39634. }
  39635. if (strict) return next(new Error('unsupported type for ' + name + ' (' + header.type + ')'))
  39636. stream.resume()
  39637. next()
  39638. })
  39639. })
  39640. })
  39641. if (opts.finish) extract.on('finish', opts.finish)
  39642. return extract
  39643. }
  39644. function validate (fs, name, root, cb) {
  39645. if (name === root) return cb(null, true)
  39646. fs.lstat(name, function (err, st) {
  39647. if (err && err.code !== 'ENOENT') return cb(err)
  39648. if (err || st.isDirectory()) return validate(fs, path.join(name, '..'), root, cb)
  39649. cb(null, false)
  39650. })
  39651. }
  39652. function mkdirfix (name, opts, cb) {
  39653. mkdirp(name, {fs: opts.fs}, function (err, made) {
  39654. if (!err && made && opts.own) {
  39655. chownr(made, opts.uid, opts.gid, cb)
  39656. } else {
  39657. cb(err)
  39658. }
  39659. })
  39660. }
  39661. /***/ }),
  39662. /* 185 */
  39663. /***/ (function(module, exports) {
  39664. module.exports = require("https");
  39665. /***/ }),
  39666. /* 186 */
  39667. /***/ (function(module, exports) {
  39668. module.exports = require("querystring");
  39669. /***/ }),
  39670. /* 187 */
  39671. /***/ (function(module, exports) {
  39672. module.exports = require("readline");
  39673. /***/ }),
  39674. /* 188 */
  39675. /***/ (function(module, exports) {
  39676. module.exports = require("zlib");
  39677. /***/ }),
  39678. /* 189 */
  39679. /***/ (function(module, exports, __webpack_require__) {
  39680. "use strict";
  39681. Object.defineProperty(exports, "__esModule", {
  39682. value: true
  39683. });
  39684. var _consoleReporter;
  39685. function _load_consoleReporter() {
  39686. return _consoleReporter = __webpack_require__(517);
  39687. }
  39688. Object.defineProperty(exports, 'ConsoleReporter', {
  39689. enumerable: true,
  39690. get: function get() {
  39691. return _interopRequireDefault(_consoleReporter || _load_consoleReporter()).default;
  39692. }
  39693. });
  39694. var _bufferReporter;
  39695. function _load_bufferReporter() {
  39696. return _bufferReporter = __webpack_require__(516);
  39697. }
  39698. Object.defineProperty(exports, 'BufferReporter', {
  39699. enumerable: true,
  39700. get: function get() {
  39701. return _interopRequireDefault(_bufferReporter || _load_bufferReporter()).default;
  39702. }
  39703. });
  39704. var _eventReporter;
  39705. function _load_eventReporter() {
  39706. return _eventReporter = __webpack_require__(521);
  39707. }
  39708. Object.defineProperty(exports, 'EventReporter', {
  39709. enumerable: true,
  39710. get: function get() {
  39711. return _interopRequireDefault(_eventReporter || _load_eventReporter()).default;
  39712. }
  39713. });
  39714. var _jsonReporter;
  39715. function _load_jsonReporter() {
  39716. return _jsonReporter = __webpack_require__(200);
  39717. }
  39718. Object.defineProperty(exports, 'JSONReporter', {
  39719. enumerable: true,
  39720. get: function get() {
  39721. return _interopRequireDefault(_jsonReporter || _load_jsonReporter()).default;
  39722. }
  39723. });
  39724. var _noopReporter;
  39725. function _load_noopReporter() {
  39726. return _noopReporter = __webpack_require__(525);
  39727. }
  39728. Object.defineProperty(exports, 'NoopReporter', {
  39729. enumerable: true,
  39730. get: function get() {
  39731. return _interopRequireDefault(_noopReporter || _load_noopReporter()).default;
  39732. }
  39733. });
  39734. var _baseReporter;
  39735. function _load_baseReporter() {
  39736. return _baseReporter = __webpack_require__(98);
  39737. }
  39738. Object.defineProperty(exports, 'Reporter', {
  39739. enumerable: true,
  39740. get: function get() {
  39741. return _interopRequireDefault(_baseReporter || _load_baseReporter()).default;
  39742. }
  39743. });
  39744. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  39745. /***/ }),
  39746. /* 190 */
  39747. /***/ (function(module, exports, __webpack_require__) {
  39748. "use strict";
  39749. // On windows, create a .cmd file.
  39750. // Read the #! in the file to see what it uses. The vast majority
  39751. // of the time, this will be either:
  39752. // "#!/usr/bin/env <prog> <args...>"
  39753. // or:
  39754. // "#!<prog> <args...>"
  39755. //
  39756. // Write a binroot/pkg.bin + ".cmd" file that has this line in it:
  39757. // @<prog> <args...> %~dp0<target> %*
  39758. module.exports = cmdShim
  39759. cmdShim.ifExists = cmdShimIfExists
  39760. const fs = __webpack_require__(834)
  39761. const mkdir = __webpack_require__(832)
  39762. const path = __webpack_require__(1)
  39763. const isWindows = __webpack_require__(793)
  39764. const shebangExpr = /^#!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/
  39765. const DEFAULT_OPTIONS = {
  39766. // Create PowerShell file by default if the option hasn't been specified
  39767. createPwshFile: true,
  39768. createCmdFile: isWindows()
  39769. }
  39770. function cmdShimIfExists (src, to, opts) {
  39771. opts = Object.assign({}, DEFAULT_OPTIONS, opts)
  39772. return fs.stat(src)
  39773. .then(() => cmdShim(src, to, opts))
  39774. .catch(() => {})
  39775. }
  39776. // Try to unlink, but ignore errors.
  39777. // Any problems will surface later.
  39778. function rm (path) {
  39779. return fs.unlink(path).catch(() => {})
  39780. }
  39781. function cmdShim (src, to, opts) {
  39782. opts = Object.assign({}, DEFAULT_OPTIONS, opts)
  39783. return fs.stat(src)
  39784. .then(() => cmdShim_(src, to, opts))
  39785. }
  39786. function cmdShim_ (src, to, opts) {
  39787. return Promise.all([
  39788. rm(to),
  39789. rm(`${to}.ps1`),
  39790. opts.createCmdFile && rm(`${to}.cmd`)
  39791. ])
  39792. .then(() => writeShim(src, to, opts))
  39793. }
  39794. function writeShim (src, to, opts) {
  39795. opts = Object.assign({}, DEFAULT_OPTIONS, opts)
  39796. const defaultArgs = opts.preserveSymlinks ? '--preserve-symlinks' : ''
  39797. // make a cmd file and a sh script
  39798. // First, check if the bin is a #! of some sort.
  39799. // If not, then assume it's something that'll be compiled, or some other
  39800. // sort of script, and just call it directly.
  39801. return mkdir(path.dirname(to))
  39802. .then(() => {
  39803. return fs.readFile(src, 'utf8')
  39804. .then(data => {
  39805. const firstLine = data.trim().split(/\r*\n/)[0]
  39806. const shebang = firstLine.match(shebangExpr)
  39807. if (!shebang) return writeShim_(src, to, Object.assign({}, opts, {args: defaultArgs}))
  39808. const prog = shebang[1]
  39809. const args = (shebang[2] && ((defaultArgs && (shebang[2] + ' ' + defaultArgs)) || shebang[2])) || defaultArgs
  39810. return writeShim_(src, to, Object.assign({}, opts, {prog, args}))
  39811. })
  39812. .catch(() => writeShim_(src, to, Object.assign({}, opts, {args: defaultArgs})))
  39813. })
  39814. }
  39815. function writeShim_ (src, to, opts) {
  39816. opts = Object.assign({}, DEFAULT_OPTIONS, opts)
  39817. let shTarget = path.relative(path.dirname(to), src)
  39818. let target = shTarget.split('/').join('\\')
  39819. let longProg
  39820. let prog = opts.prog
  39821. let shProg = prog && prog.split('\\').join('/')
  39822. let shLongProg
  39823. let pwshProg = shProg && `"${shProg}$exe"`
  39824. let pwshLongProg
  39825. shTarget = shTarget.split('\\').join('/')
  39826. let args = opts.args || ''
  39827. let {
  39828. win32: nodePath,
  39829. posix: shNodePath
  39830. } = normalizePathEnvVar(opts.nodePath)
  39831. if (!prog) {
  39832. prog = `"%~dp0\\${target}"`
  39833. shProg = `"$basedir/${shTarget}"`
  39834. pwshProg = shProg
  39835. args = ''
  39836. target = ''
  39837. shTarget = ''
  39838. } else {
  39839. longProg = `"%~dp0\\${prog}.exe"`
  39840. shLongProg = '"$basedir/' + prog + '"'
  39841. pwshLongProg = `"$basedir/${prog}$exe"`
  39842. target = `"%~dp0\\${target}"`
  39843. shTarget = `"$basedir/${shTarget}"`
  39844. }
  39845. let cmd
  39846. if (opts.createCmdFile) {
  39847. // @IF EXIST "%~dp0\node.exe" (
  39848. // "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
  39849. // ) ELSE (
  39850. // SETLOCAL
  39851. // SET PATHEXT=%PATHEXT:;.JS;=;%
  39852. // node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
  39853. // )
  39854. cmd = nodePath ? `@SET NODE_PATH=${nodePath}\r\n` : ''
  39855. if (longProg) {
  39856. cmd += '@IF EXIST ' + longProg + ' (\r\n' +
  39857. ' ' + longProg + ' ' + args + ' ' + target + ' %*\r\n' +
  39858. ') ELSE (\r\n' +
  39859. ' @SETLOCAL\r\n' +
  39860. ' @SET PATHEXT=%PATHEXT:;.JS;=;%\r\n' +
  39861. ' ' + prog + ' ' + args + ' ' + target + ' %*\r\n' +
  39862. ')'
  39863. } else {
  39864. cmd += `@${prog} ${args} ${target} %*\r\n`
  39865. }
  39866. }
  39867. // #!/bin/sh
  39868. // basedir=`dirname "$0"`
  39869. //
  39870. // case `uname` in
  39871. // *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
  39872. // esac
  39873. //
  39874. // if [ -x "$basedir/node.exe" ]; then
  39875. // "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@"
  39876. // ret=$?
  39877. // else
  39878. // node "$basedir/node_modules/npm/bin/npm-cli.js" "$@"
  39879. // ret=$?
  39880. // fi
  39881. // exit $ret
  39882. let sh = '#!/bin/sh\n'
  39883. sh = sh +
  39884. "basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n" +
  39885. '\n' +
  39886. 'case `uname` in\n' +
  39887. ' *CYGWIN*) basedir=`cygpath -w "$basedir"`;;\n' +
  39888. 'esac\n' +
  39889. '\n'
  39890. const env = opts.nodePath ? `NODE_PATH="${shNodePath}" ` : ''
  39891. if (shLongProg) {
  39892. sh = sh +
  39893. 'if [ -x ' + shLongProg + ' ]; then\n' +
  39894. ' ' + env + shLongProg + ' ' + args + ' ' + shTarget + ' "$@"\n' +
  39895. ' ret=$?\n' +
  39896. 'else \n' +
  39897. ' ' + env + shProg + ' ' + args + ' ' + shTarget + ' "$@"\n' +
  39898. ' ret=$?\n' +
  39899. 'fi\n' +
  39900. 'exit $ret\n'
  39901. } else {
  39902. sh = sh + env + shProg + ' ' + args + ' ' + shTarget + ' "$@"\n' +
  39903. 'exit $?\n'
  39904. }
  39905. // #!/usr/bin/env pwsh
  39906. // $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
  39907. //
  39908. // $ret=0
  39909. // $exe = ""
  39910. // if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
  39911. // # Fix case when both the Windows and Linux builds of Node
  39912. // # are installed in the same directory
  39913. // $exe = ".exe"
  39914. // }
  39915. // if (Test-Path "$basedir/node") {
  39916. // & "$basedir/node$exe" "$basedir/node_modules/npm/bin/npm-cli.js" $args
  39917. // $ret=$LASTEXITCODE
  39918. // } else {
  39919. // & "node$exe" "$basedir/node_modules/npm/bin/npm-cli.js" $args
  39920. // $ret=$LASTEXITCODE
  39921. // }
  39922. // exit $ret
  39923. let pwsh = '#!/usr/bin/env pwsh\n' +
  39924. '$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n' +
  39925. '\n' +
  39926. '$exe=""\n' +
  39927. (opts.nodePath ? '$env_node_path=$env:NODE_PATH\n' +
  39928. `$env:NODE_PATH="${nodePath}"\n` : '') +
  39929. 'if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {\n' +
  39930. ' # Fix case when both the Windows and Linux builds of Node\n' +
  39931. ' # are installed in the same directory\n' +
  39932. ' $exe=".exe"\n' +
  39933. '}'
  39934. if (opts.nodePath) {
  39935. pwsh = pwsh +
  39936. ' else {\n' +
  39937. ` $env:NODE_PATH="${shNodePath}"\n` +
  39938. '}'
  39939. }
  39940. pwsh += '\n'
  39941. if (shLongProg) {
  39942. pwsh = pwsh +
  39943. '$ret=0\n' +
  39944. `if (Test-Path ${pwshLongProg}) {\n` +
  39945. ` & ${pwshLongProg} ${args} ${shTarget} $args\n` +
  39946. ' $ret=$LASTEXITCODE\n' +
  39947. '} else {\n' +
  39948. ` & ${pwshProg} ${args} ${shTarget} $args\n` +
  39949. ' $ret=$LASTEXITCODE\n' +
  39950. '}\n' +
  39951. (opts.nodePath ? '$env:NODE_PATH=$env_node_path\n' : '') +
  39952. 'exit $ret\n'
  39953. } else {
  39954. pwsh = pwsh +
  39955. `& ${pwshProg} ${args} ${shTarget} $args\n` +
  39956. (opts.nodePath ? '$env:NODE_PATH=$env_node_path\n' : '') +
  39957. 'exit $LASTEXITCODE\n'
  39958. }
  39959. return Promise.all([
  39960. opts.createCmdFile && fs.writeFile(to + '.cmd', cmd, 'utf8'),
  39961. opts.createPwshFile && fs.writeFile(`${to}.ps1`, pwsh, 'utf8'),
  39962. fs.writeFile(to, sh, 'utf8')
  39963. ])
  39964. .then(() => chmodShim(to, opts))
  39965. }
  39966. function chmodShim (to, {createCmdFile, createPwshFile}) {
  39967. return Promise.all([
  39968. fs.chmod(to, 0o755),
  39969. createPwshFile && fs.chmod(`${to}.ps1`, 0o755),
  39970. createCmdFile && fs.chmod(`${to}.cmd`, 0o755)
  39971. ])
  39972. }
  39973. /**
  39974. * @param {string|string[]} nodePath
  39975. * @returns {{win32:string,posix:string}}
  39976. */
  39977. function normalizePathEnvVar (nodePath) {
  39978. if (!nodePath) {
  39979. return {
  39980. win32: nodePath,
  39981. posix: nodePath
  39982. }
  39983. }
  39984. let split = (typeof nodePath === 'string' ? nodePath.split(path.delimiter) : Array.from(nodePath))
  39985. let result = {}
  39986. for (let i = 0; i < split.length; i++) {
  39987. const win32 = split[i].split('/').join('\\')
  39988. const posix = isWindows() ? split[i].split('\\').join('/').replace(/^([^:\\/]*):/, (_, $1) => `/mnt/${$1.toLowerCase()}`) : split[i]
  39989. result.win32 = result.win32 ? `${result.win32};${win32}` : win32
  39990. result.posix = result.posix ? `${result.posix}:${posix}` : posix
  39991. result[i] = {win32, posix}
  39992. }
  39993. return result
  39994. }
  39995. /***/ }),
  39996. /* 191 */
  39997. /***/ (function(module, exports) {
  39998. // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
  39999. module.exports = {
  40000. newInvalidAsn1Error: function (msg) {
  40001. var e = new Error();
  40002. e.name = 'InvalidAsn1Error';
  40003. e.message = msg || '';
  40004. return e;
  40005. }
  40006. };
  40007. /***/ }),
  40008. /* 192 */
  40009. /***/ (function(module, exports) {
  40010. // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
  40011. module.exports = {
  40012. EOC: 0,
  40013. Boolean: 1,
  40014. Integer: 2,
  40015. BitString: 3,
  40016. OctetString: 4,
  40017. Null: 5,
  40018. OID: 6,
  40019. ObjectDescriptor: 7,
  40020. External: 8,
  40021. Real: 9, // float
  40022. Enumeration: 10,
  40023. PDV: 11,
  40024. Utf8String: 12,
  40025. RelativeOID: 13,
  40026. Sequence: 16,
  40027. Set: 17,
  40028. NumericString: 18,
  40029. PrintableString: 19,
  40030. T61String: 20,
  40031. VideotexString: 21,
  40032. IA5String: 22,
  40033. UTCTime: 23,
  40034. GeneralizedTime: 24,
  40035. GraphicString: 25,
  40036. VisibleString: 26,
  40037. GeneralString: 28,
  40038. UniversalString: 29,
  40039. CharacterString: 30,
  40040. BMPString: 31,
  40041. Constructor: 32,
  40042. Context: 128
  40043. };
  40044. /***/ }),
  40045. /* 193 */
  40046. /***/ (function(module, exports, __webpack_require__) {
  40047. "use strict";
  40048. /**
  40049. * Inquirer.js
  40050. * A collection of common interactive command line user interfaces.
  40051. */
  40052. var inquirer = module.exports;
  40053. /**
  40054. * Client interfaces
  40055. */
  40056. inquirer.prompts = {};
  40057. inquirer.Separator = __webpack_require__(152);
  40058. inquirer.ui = {
  40059. BottomBar: __webpack_require__(475),
  40060. Prompt: __webpack_require__(476)
  40061. };
  40062. /**
  40063. * Create a new self-contained prompt module.
  40064. */
  40065. inquirer.createPromptModule = function (opt) {
  40066. var promptModule = function promptModule(questions) {
  40067. var ui = new inquirer.ui.Prompt(promptModule.prompts, opt);
  40068. var promise = ui.run(questions);
  40069. // Monkey patch the UI on the promise object so
  40070. // that it remains publicly accessible.
  40071. promise.ui = ui;
  40072. return promise;
  40073. };
  40074. promptModule.prompts = {};
  40075. /**
  40076. * Register a prompt type
  40077. * @param {String} name Prompt type name
  40078. * @param {Function} prompt Prompt constructor
  40079. * @return {inquirer}
  40080. */
  40081. promptModule.registerPrompt = function (name, prompt) {
  40082. promptModule.prompts[name] = prompt;
  40083. return this;
  40084. };
  40085. /**
  40086. * Register the defaults provider prompts
  40087. */
  40088. promptModule.restoreDefaultPrompts = function () {
  40089. this.registerPrompt('list', __webpack_require__(471));
  40090. this.registerPrompt('input', __webpack_require__(285));
  40091. this.registerPrompt('number', __webpack_require__(472));
  40092. this.registerPrompt('confirm', __webpack_require__(468));
  40093. this.registerPrompt('rawlist', __webpack_require__(474));
  40094. this.registerPrompt('expand', __webpack_require__(470));
  40095. this.registerPrompt('checkbox', __webpack_require__(467));
  40096. this.registerPrompt('password', __webpack_require__(473));
  40097. this.registerPrompt('editor', __webpack_require__(469));
  40098. };
  40099. promptModule.restoreDefaultPrompts();
  40100. return promptModule;
  40101. };
  40102. /**
  40103. * Public CLI helper interface
  40104. * @param {Array|Object|Rx.Observable} questions - Questions settings array
  40105. * @param {Function} cb - Callback being passed the user answers
  40106. * @return {inquirer.ui.Prompt}
  40107. */
  40108. inquirer.prompt = inquirer.createPromptModule();
  40109. // Expose helper functions on the top level for easiest usage by common users
  40110. inquirer.registerPrompt = function (name, prompt) {
  40111. inquirer.prompt.registerPrompt(name, prompt);
  40112. };
  40113. inquirer.restoreDefaultPrompts = function () {
  40114. inquirer.prompt.restoreDefaultPrompts();
  40115. };
  40116. /***/ }),
  40117. /* 194 */
  40118. /***/ (function(module, exports, __webpack_require__) {
  40119. "use strict";
  40120. Object.defineProperty(exports, "__esModule", {
  40121. value: true
  40122. });
  40123. exports.getOutdated = exports.run = exports.requireLockfile = undefined;
  40124. var _asyncToGenerator2;
  40125. function _load_asyncToGenerator() {
  40126. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  40127. }
  40128. var _keys;
  40129. function _load_keys() {
  40130. return _keys = _interopRequireDefault(__webpack_require__(14));
  40131. }
  40132. var _assign;
  40133. function _load_assign() {
  40134. return _assign = _interopRequireDefault(__webpack_require__(23));
  40135. }
  40136. var run = exports.run = function () {
  40137. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  40138. var addArgs = [];
  40139. var upgradeAll = args.length === 0 && typeof flags.scope === 'undefined' && typeof flags.pattern === 'undefined';
  40140. var addFlags = (0, (_assign || _load_assign()).default)({}, flags, {
  40141. force: true,
  40142. ignoreWorkspaceRootCheck: true,
  40143. workspaceRootIsCwd: config.cwd === config.lockfileFolder
  40144. });
  40145. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
  40146. var deps = yield getOutdated(config, reporter, flags, lockfile, args);
  40147. var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
  40148. var _ref2 = yield install.fetchRequestFromCwd(),
  40149. packagePatterns = _ref2.requests;
  40150. setUserRequestedPackageVersions(deps, args, flags.latest, packagePatterns, reporter);
  40151. cleanLockfile(lockfile, deps, packagePatterns, reporter);
  40152. addArgs = deps.map(function (dep) {
  40153. return dep.upgradeTo;
  40154. });
  40155. if (flags.scope && validScopeRegex.test(flags.scope)) {
  40156. addArgs = addArgs.filter(function (depName) {
  40157. return depName.startsWith(flags.scope);
  40158. });
  40159. }
  40160. var add = new (_add || _load_add()).Add(addArgs, addFlags, config, reporter, upgradeAll ? new (_lockfile || _load_lockfile()).default() : lockfile);
  40161. yield add.init();
  40162. });
  40163. return function run(_x, _x2, _x3, _x4) {
  40164. return _ref.apply(this, arguments);
  40165. };
  40166. }();
  40167. var getOutdated = exports.getOutdated = function () {
  40168. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile, patterns) {
  40169. var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
  40170. var outdatedFieldName = flags.latest ? 'latest' : 'wanted';
  40171. // ensure scope is of the form `@scope/`
  40172. var normalizeScope = function normalizeScope() {
  40173. if (flags.scope) {
  40174. if (!flags.scope.startsWith('@')) {
  40175. flags.scope = '@' + flags.scope;
  40176. }
  40177. if (!flags.scope.endsWith('/')) {
  40178. flags.scope += '/';
  40179. }
  40180. }
  40181. };
  40182. var versionFilter = function versionFilter(dep) {
  40183. return dep.current !== dep[outdatedFieldName];
  40184. };
  40185. if (!flags.latest) {
  40186. // these flags only have an affect when --latest is used
  40187. flags.tilde = false;
  40188. flags.exact = false;
  40189. flags.caret = false;
  40190. }
  40191. normalizeScope();
  40192. var deps = (yield (_packageRequest || _load_packageRequest()).default.getOutdatedPackages(lockfile, install, config, reporter, patterns, flags)).filter(versionFilter).filter(scopeFilter.bind(this, flags));
  40193. deps.forEach(function (dep) {
  40194. dep.upgradeTo = buildPatternToUpgradeTo(dep, flags);
  40195. reporter.verbose(reporter.lang('verboseUpgradeBecauseOutdated', dep.name, dep.upgradeTo));
  40196. });
  40197. return deps;
  40198. });
  40199. return function getOutdated(_x5, _x6, _x7, _x8, _x9) {
  40200. return _ref3.apply(this, arguments);
  40201. };
  40202. }();
  40203. exports.cleanLockfile = cleanLockfile;
  40204. exports.setFlags = setFlags;
  40205. exports.hasWrapper = hasWrapper;
  40206. var _add;
  40207. function _load_add() {
  40208. return _add = __webpack_require__(154);
  40209. }
  40210. var _lockfile;
  40211. function _load_lockfile() {
  40212. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  40213. }
  40214. var _packageRequest;
  40215. function _load_packageRequest() {
  40216. return _packageRequest = _interopRequireDefault(__webpack_require__(117));
  40217. }
  40218. var _normalizePattern;
  40219. function _load_normalizePattern() {
  40220. return _normalizePattern = __webpack_require__(52);
  40221. }
  40222. var _install;
  40223. function _load_install() {
  40224. return _install = __webpack_require__(41);
  40225. }
  40226. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  40227. // used to detect whether a semver range is simple enough to preserve when doing a --latest upgrade.
  40228. // when not matched, the upgraded version range will default to `^` the same as the `add` command would.
  40229. var basicSemverOperatorRegex = new RegExp('^(\\^|~|>=|<=)?[^ |&,]+$');
  40230. // used to detect if a passed parameter is a scope or a package name.
  40231. var validScopeRegex = /^@[a-zA-Z0-9-][a-zA-Z0-9_.-]*\/$/;
  40232. // If specific versions were requested for packages, override what getOutdated reported as the latest to install
  40233. // Also add ones that are missing, since the requested packages may not have been outdated at all.
  40234. function setUserRequestedPackageVersions(deps, args, latest, packagePatterns, reporter) {
  40235. args.forEach(function (requestedPattern) {
  40236. var found = false;
  40237. var normalized = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(requestedPattern);
  40238. // if the user specified a package name without a version range, then that implies "latest"
  40239. // but if the latest flag is not passed then we need to use the version range from package.json
  40240. if (!normalized.hasVersion && !latest) {
  40241. packagePatterns.forEach(function (packagePattern) {
  40242. var packageNormalized = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(packagePattern.pattern);
  40243. if (packageNormalized.name === normalized.name) {
  40244. normalized = packageNormalized;
  40245. }
  40246. });
  40247. }
  40248. var newPattern = `${normalized.name}@${normalized.range}`;
  40249. // if this dependency is already in the outdated list,
  40250. // just update the upgradeTo to whatever version the user requested.
  40251. deps.forEach(function (dep) {
  40252. if (normalized.hasVersion && dep.name === normalized.name) {
  40253. found = true;
  40254. dep.upgradeTo = newPattern;
  40255. reporter.verbose(reporter.lang('verboseUpgradeBecauseRequested', requestedPattern, newPattern));
  40256. }
  40257. });
  40258. // if this dependency was not in the outdated list,
  40259. // then add a new entry
  40260. if (normalized.hasVersion && !found) {
  40261. deps.push({
  40262. name: normalized.name,
  40263. wanted: '',
  40264. latest: '',
  40265. url: '',
  40266. hint: '',
  40267. range: '',
  40268. current: '',
  40269. upgradeTo: newPattern,
  40270. workspaceName: '',
  40271. workspaceLoc: ''
  40272. });
  40273. reporter.verbose(reporter.lang('verboseUpgradeBecauseRequested', requestedPattern, newPattern));
  40274. }
  40275. });
  40276. }
  40277. // this function attempts to determine the range operator on the semver range.
  40278. // this will only handle the simple cases of a semver starting with '^', '~', '>=', '<=', or an exact version.
  40279. // "exotic" semver ranges will not be handled.
  40280. function getRangeOperator(version) {
  40281. var result = basicSemverOperatorRegex.exec(version);
  40282. return result ? result[1] || '' : '^';
  40283. }
  40284. // Attempt to preserve the range operator from the package.json specified semver range.
  40285. // If an explicit operator was specified using --exact, --tilde, --caret, then that will take precedence.
  40286. function buildPatternToUpgradeTo(dep, flags) {
  40287. if (dep.latest === 'exotic') {
  40288. return `${dep.name}@${dep.url}`;
  40289. }
  40290. var toLatest = flags.latest;
  40291. var toVersion = toLatest ? dep.latest : dep.range;
  40292. var rangeOperator = '';
  40293. if (toLatest) {
  40294. if (flags.caret) {
  40295. rangeOperator = '^';
  40296. } else if (flags.tilde) {
  40297. rangeOperator = '~';
  40298. } else if (flags.exact) {
  40299. rangeOperator = '';
  40300. } else {
  40301. rangeOperator = getRangeOperator(dep.range);
  40302. }
  40303. }
  40304. return `${dep.name}@${rangeOperator}${toVersion}`;
  40305. }
  40306. function scopeFilter(flags, dep) {
  40307. if (validScopeRegex.test(flags.scope)) {
  40308. return dep.name.startsWith(flags.scope);
  40309. }
  40310. return true;
  40311. }
  40312. // Remove deps being upgraded from the lockfile, or else Add will use the already-installed version
  40313. // instead of the latest for the range.
  40314. // We do this recursively so that when Yarn installs the potentially updated transitive deps,
  40315. // it may upgrade them too instead of just using the "locked" version from the lockfile.
  40316. // Transitive dependencies that are also a direct dependency are skipped.
  40317. function cleanLockfile(lockfile, deps, packagePatterns, reporter) {
  40318. function cleanDepFromLockfile(pattern, depth) {
  40319. var lockManifest = lockfile.getLocked(pattern);
  40320. if (!lockManifest || depth > 1 && packagePatterns.some(function (packagePattern) {
  40321. return packagePattern.pattern === pattern;
  40322. })) {
  40323. reporter.verbose(reporter.lang('verboseUpgradeNotUnlocking', pattern));
  40324. return;
  40325. }
  40326. var dependencies = (0, (_assign || _load_assign()).default)({}, lockManifest.dependencies || {}, lockManifest.optionalDependencies || {});
  40327. var depPatterns = (0, (_keys || _load_keys()).default)(dependencies).map(function (key) {
  40328. return `${key}@${dependencies[key]}`;
  40329. });
  40330. reporter.verbose(reporter.lang('verboseUpgradeUnlocking', pattern));
  40331. lockfile.removePattern(pattern);
  40332. depPatterns.forEach(function (pattern) {
  40333. return cleanDepFromLockfile(pattern, depth + 1);
  40334. });
  40335. }
  40336. var patterns = deps.map(function (dep) {
  40337. return dep.upgradeTo;
  40338. });
  40339. patterns.forEach(function (pattern) {
  40340. return cleanDepFromLockfile(pattern, 1);
  40341. });
  40342. }
  40343. function setFlags(commander) {
  40344. commander.description('Upgrades packages to their latest version based on the specified range.');
  40345. commander.usage('upgrade [flags]');
  40346. commander.option('-S, --scope <scope>', 'upgrade packages under the specified scope');
  40347. commander.option('-L, --latest', 'list the latest version of packages, ignoring version ranges in package.json');
  40348. commander.option('-E, --exact', 'install exact version. Only used when --latest is specified.');
  40349. commander.option('-P, --pattern [pattern]', 'upgrade packages that match pattern');
  40350. commander.option('-T, --tilde', 'install most recent release with the same minor version. Only used when --latest is specified.');
  40351. commander.option('-C, --caret', 'install most recent release with the same major version. Only used when --latest is specified.');
  40352. commander.option('-A, --audit', 'Run vulnerability audit on installed packages');
  40353. }
  40354. function hasWrapper(commander, args) {
  40355. return true;
  40356. }
  40357. var requireLockfile = exports.requireLockfile = true;
  40358. /***/ }),
  40359. /* 195 */
  40360. /***/ (function(module, exports, __webpack_require__) {
  40361. "use strict";
  40362. Object.defineProperty(exports, "__esModule", {
  40363. value: true
  40364. });
  40365. exports.integrityErrors = undefined;
  40366. var _stringify;
  40367. function _load_stringify() {
  40368. return _stringify = _interopRequireDefault(__webpack_require__(37));
  40369. }
  40370. var _extends2;
  40371. function _load_extends() {
  40372. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  40373. }
  40374. var _getIterator2;
  40375. function _load_getIterator() {
  40376. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  40377. }
  40378. var _keys;
  40379. function _load_keys() {
  40380. return _keys = _interopRequireDefault(__webpack_require__(14));
  40381. }
  40382. var _asyncToGenerator2;
  40383. function _load_asyncToGenerator() {
  40384. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  40385. }
  40386. var _classCallCheck2;
  40387. function _load_classCallCheck() {
  40388. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  40389. }
  40390. var _constants;
  40391. function _load_constants() {
  40392. return _constants = _interopRequireWildcard(__webpack_require__(13));
  40393. }
  40394. var _fs;
  40395. function _load_fs() {
  40396. return _fs = _interopRequireWildcard(__webpack_require__(8));
  40397. }
  40398. var _misc;
  40399. function _load_misc() {
  40400. return _misc = __webpack_require__(28);
  40401. }
  40402. var _packageNameUtils;
  40403. function _load_packageNameUtils() {
  40404. return _packageNameUtils = __webpack_require__(208);
  40405. }
  40406. var _workspaceLayout;
  40407. function _load_workspaceLayout() {
  40408. return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
  40409. }
  40410. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  40411. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  40412. var invariant = __webpack_require__(15);
  40413. var path = __webpack_require__(1);
  40414. var integrityErrors = exports.integrityErrors = {
  40415. EXPECTED_IS_NOT_A_JSON: 'integrityFailedExpectedIsNotAJSON',
  40416. FILES_MISSING: 'integrityFailedFilesMissing',
  40417. LOCKFILE_DONT_MATCH: 'integrityLockfilesDontMatch',
  40418. FLAGS_DONT_MATCH: 'integrityFlagsDontMatch',
  40419. LINKED_MODULES_DONT_MATCH: 'integrityCheckLinkedModulesDontMatch',
  40420. PATTERNS_DONT_MATCH: 'integrityPatternsDontMatch',
  40421. MODULES_FOLDERS_MISSING: 'integrityModulesFoldersMissing',
  40422. SYSTEM_PARAMS_DONT_MATCH: 'integritySystemParamsDontMatch'
  40423. };
  40424. var INTEGRITY_FILE_DEFAULTS = function INTEGRITY_FILE_DEFAULTS() {
  40425. return {
  40426. systemParams: (0, (_packageNameUtils || _load_packageNameUtils()).getSystemParams)(),
  40427. modulesFolders: [],
  40428. flags: [],
  40429. linkedModules: [],
  40430. topLevelPatterns: [],
  40431. lockfileEntries: {},
  40432. files: []
  40433. };
  40434. };
  40435. /**
  40436. *
  40437. */
  40438. var InstallationIntegrityChecker = function () {
  40439. function InstallationIntegrityChecker(config) {
  40440. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, InstallationIntegrityChecker);
  40441. this.config = config;
  40442. }
  40443. /**
  40444. * Get the common ancestor of every node_modules - it may be a node_modules directory itself, but isn't required to.
  40445. */
  40446. InstallationIntegrityChecker.prototype._getModulesRootFolder = function _getModulesRootFolder() {
  40447. if (this.config.modulesFolder) {
  40448. return this.config.modulesFolder;
  40449. } else if (this.config.workspaceRootFolder) {
  40450. return this.config.workspaceRootFolder;
  40451. } else {
  40452. return path.join(this.config.lockfileFolder, (_constants || _load_constants()).NODE_MODULES_FOLDER);
  40453. }
  40454. };
  40455. /**
  40456. * Get the directory in which the yarn-integrity file should be written.
  40457. */
  40458. InstallationIntegrityChecker.prototype._getIntegrityFileFolder = function _getIntegrityFileFolder() {
  40459. if (this.config.modulesFolder) {
  40460. return this.config.modulesFolder;
  40461. } else if (this.config.enableMetaFolder) {
  40462. return path.join(this.config.lockfileFolder, (_constants || _load_constants()).META_FOLDER);
  40463. } else {
  40464. return path.join(this.config.lockfileFolder, (_constants || _load_constants()).NODE_MODULES_FOLDER);
  40465. }
  40466. };
  40467. /**
  40468. * Get the full path of the yarn-integrity file.
  40469. */
  40470. InstallationIntegrityChecker.prototype._getIntegrityFileLocation = function () {
  40471. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  40472. var locationFolder = this._getIntegrityFileFolder();
  40473. var locationPath = path.join(locationFolder, (_constants || _load_constants()).INTEGRITY_FILENAME);
  40474. var exists = yield (_fs || _load_fs()).exists(locationPath);
  40475. return {
  40476. locationFolder,
  40477. locationPath,
  40478. exists
  40479. };
  40480. });
  40481. function _getIntegrityFileLocation() {
  40482. return _ref.apply(this, arguments);
  40483. }
  40484. return _getIntegrityFileLocation;
  40485. }();
  40486. /**
  40487. * Get the list of the directories that contain our modules (there might be multiple such folders b/c of workspaces).
  40488. */
  40489. InstallationIntegrityChecker.prototype._getModulesFolders = function _getModulesFolders() {
  40490. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  40491. workspaceLayout = _ref2.workspaceLayout;
  40492. var locations = [];
  40493. if (this.config.modulesFolder) {
  40494. locations.push(this.config.modulesFolder);
  40495. } else {
  40496. locations.push(path.join(this.config.lockfileFolder, (_constants || _load_constants()).NODE_MODULES_FOLDER));
  40497. }
  40498. if (workspaceLayout) {
  40499. for (var _iterator = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  40500. var _ref3;
  40501. if (_isArray) {
  40502. if (_i >= _iterator.length) break;
  40503. _ref3 = _iterator[_i++];
  40504. } else {
  40505. _i = _iterator.next();
  40506. if (_i.done) break;
  40507. _ref3 = _i.value;
  40508. }
  40509. var workspaceName = _ref3;
  40510. var loc = workspaceLayout.workspaces[workspaceName].loc;
  40511. if (loc) {
  40512. locations.push(path.join(loc, (_constants || _load_constants()).NODE_MODULES_FOLDER));
  40513. }
  40514. }
  40515. }
  40516. return locations.sort((_misc || _load_misc()).sortAlpha);
  40517. };
  40518. /**
  40519. * Get a list of the files that are located inside our module folders.
  40520. */
  40521. InstallationIntegrityChecker.prototype._getIntegrityListing = function () {
  40522. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  40523. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  40524. workspaceLayout = _ref5.workspaceLayout;
  40525. var files = [];
  40526. var recurse = function () {
  40527. var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) {
  40528. for (var _iterator2 = yield (_fs || _load_fs()).readdir(dir), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  40529. var _ref7;
  40530. if (_isArray2) {
  40531. if (_i2 >= _iterator2.length) break;
  40532. _ref7 = _iterator2[_i2++];
  40533. } else {
  40534. _i2 = _iterator2.next();
  40535. if (_i2.done) break;
  40536. _ref7 = _i2.value;
  40537. }
  40538. var file = _ref7;
  40539. var entry = path.join(dir, file);
  40540. var stat = yield (_fs || _load_fs()).lstat(entry);
  40541. if (stat.isDirectory()) {
  40542. yield recurse(entry);
  40543. } else {
  40544. files.push(entry);
  40545. }
  40546. }
  40547. });
  40548. return function recurse(_x3) {
  40549. return _ref6.apply(this, arguments);
  40550. };
  40551. }();
  40552. for (var _iterator3 = this._getModulesFolders({ workspaceLayout }), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  40553. var _ref8;
  40554. if (_isArray3) {
  40555. if (_i3 >= _iterator3.length) break;
  40556. _ref8 = _iterator3[_i3++];
  40557. } else {
  40558. _i3 = _iterator3.next();
  40559. if (_i3.done) break;
  40560. _ref8 = _i3.value;
  40561. }
  40562. var modulesFolder = _ref8;
  40563. if (yield (_fs || _load_fs()).exists(modulesFolder)) {
  40564. yield recurse(modulesFolder);
  40565. }
  40566. }
  40567. return files;
  40568. });
  40569. function _getIntegrityListing() {
  40570. return _ref4.apply(this, arguments);
  40571. }
  40572. return _getIntegrityListing;
  40573. }();
  40574. /**
  40575. * Generate integrity hash of input lockfile.
  40576. */
  40577. InstallationIntegrityChecker.prototype._generateIntegrityFile = function () {
  40578. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile, patterns, flags, workspaceLayout, artifacts) {
  40579. var result = (0, (_extends2 || _load_extends()).default)({}, INTEGRITY_FILE_DEFAULTS(), {
  40580. artifacts
  40581. });
  40582. result.topLevelPatterns = patterns;
  40583. // If using workspaces, we also need to add the workspaces patterns to the top-level, so that we'll know if a
  40584. // dependency is added or removed into one of them. We must take care not to read the aggregator (if !loc).
  40585. //
  40586. // Also note that we can't use of workspaceLayout.workspaces[].manifest._reference.patterns, because when
  40587. // doing a "yarn check", the _reference property hasn't yet been properly initialized.
  40588. if (workspaceLayout) {
  40589. result.topLevelPatterns = result.topLevelPatterns.filter(function (p) {
  40590. // $FlowFixMe
  40591. return !workspaceLayout.getManifestByPattern(p);
  40592. });
  40593. for (var _iterator4 = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  40594. var _ref10;
  40595. if (_isArray4) {
  40596. if (_i4 >= _iterator4.length) break;
  40597. _ref10 = _iterator4[_i4++];
  40598. } else {
  40599. _i4 = _iterator4.next();
  40600. if (_i4.done) break;
  40601. _ref10 = _i4.value;
  40602. }
  40603. var name = _ref10;
  40604. if (!workspaceLayout.workspaces[name].loc) {
  40605. continue;
  40606. }
  40607. var manifest = workspaceLayout.workspaces[name].manifest;
  40608. if (manifest) {
  40609. for (var _iterator5 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  40610. var _ref11;
  40611. if (_isArray5) {
  40612. if (_i5 >= _iterator5.length) break;
  40613. _ref11 = _iterator5[_i5++];
  40614. } else {
  40615. _i5 = _iterator5.next();
  40616. if (_i5.done) break;
  40617. _ref11 = _i5.value;
  40618. }
  40619. var dependencyType = _ref11;
  40620. var dependencies = manifest[dependencyType];
  40621. if (!dependencies) {
  40622. continue;
  40623. }
  40624. for (var _iterator6 = (0, (_keys || _load_keys()).default)(dependencies), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  40625. var _ref12;
  40626. if (_isArray6) {
  40627. if (_i6 >= _iterator6.length) break;
  40628. _ref12 = _iterator6[_i6++];
  40629. } else {
  40630. _i6 = _iterator6.next();
  40631. if (_i6.done) break;
  40632. _ref12 = _i6.value;
  40633. }
  40634. var dep = _ref12;
  40635. result.topLevelPatterns.push(`${dep}@${dependencies[dep]}`);
  40636. }
  40637. }
  40638. }
  40639. }
  40640. }
  40641. result.topLevelPatterns.sort((_misc || _load_misc()).sortAlpha);
  40642. if (flags.checkFiles) {
  40643. result.flags.push('checkFiles');
  40644. }
  40645. if (flags.flat) {
  40646. result.flags.push('flat');
  40647. }
  40648. if (this.config.ignoreScripts) {
  40649. result.flags.push('ignoreScripts');
  40650. }
  40651. if (this.config.focus) {
  40652. result.flags.push('focus: ' + this.config.focusedWorkspaceName);
  40653. }
  40654. if (this.config.production) {
  40655. result.flags.push('production');
  40656. }
  40657. if (this.config.plugnplayEnabled) {
  40658. result.flags.push('plugnplay');
  40659. }
  40660. var linkedModules = this.config.linkedModules;
  40661. if (linkedModules.length) {
  40662. result.linkedModules = linkedModules.sort((_misc || _load_misc()).sortAlpha);
  40663. }
  40664. for (var _iterator7 = (0, (_keys || _load_keys()).default)(lockfile), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  40665. var _ref13;
  40666. if (_isArray7) {
  40667. if (_i7 >= _iterator7.length) break;
  40668. _ref13 = _iterator7[_i7++];
  40669. } else {
  40670. _i7 = _iterator7.next();
  40671. if (_i7.done) break;
  40672. _ref13 = _i7.value;
  40673. }
  40674. var _key = _ref13;
  40675. result.lockfileEntries[_key] = lockfile[_key].resolved || '';
  40676. }
  40677. for (var _iterator8 = this._getModulesFolders({ workspaceLayout }), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
  40678. var _ref14;
  40679. if (_isArray8) {
  40680. if (_i8 >= _iterator8.length) break;
  40681. _ref14 = _iterator8[_i8++];
  40682. } else {
  40683. _i8 = _iterator8.next();
  40684. if (_i8.done) break;
  40685. _ref14 = _i8.value;
  40686. }
  40687. var modulesFolder = _ref14;
  40688. if (yield (_fs || _load_fs()).exists(modulesFolder)) {
  40689. result.modulesFolders.push(path.relative(this.config.lockfileFolder, modulesFolder));
  40690. }
  40691. }
  40692. if (flags.checkFiles) {
  40693. var modulesRoot = this._getModulesRootFolder();
  40694. result.files = (yield this._getIntegrityListing({ workspaceLayout })).map(function (entry) {
  40695. return path.relative(modulesRoot, entry);
  40696. }).sort((_misc || _load_misc()).sortAlpha);
  40697. }
  40698. return result;
  40699. });
  40700. function _generateIntegrityFile(_x4, _x5, _x6, _x7, _x8) {
  40701. return _ref9.apply(this, arguments);
  40702. }
  40703. return _generateIntegrityFile;
  40704. }();
  40705. InstallationIntegrityChecker.prototype._getIntegrityFile = function () {
  40706. var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (locationPath) {
  40707. var expectedRaw = yield (_fs || _load_fs()).readFile(locationPath);
  40708. try {
  40709. return (0, (_extends2 || _load_extends()).default)({}, INTEGRITY_FILE_DEFAULTS(), JSON.parse(expectedRaw));
  40710. } catch (e) {
  40711. // ignore JSON parsing for legacy text integrity files compatibility
  40712. }
  40713. return null;
  40714. });
  40715. function _getIntegrityFile(_x9) {
  40716. return _ref15.apply(this, arguments);
  40717. }
  40718. return _getIntegrityFile;
  40719. }();
  40720. InstallationIntegrityChecker.prototype._compareIntegrityFiles = function _compareIntegrityFiles(actual, expected, checkFiles, workspaceLayout) {
  40721. if (!expected) {
  40722. return 'EXPECTED_IS_NOT_A_JSON';
  40723. }
  40724. if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.linkedModules, expected.linkedModules)) {
  40725. return 'LINKED_MODULES_DONT_MATCH';
  40726. }
  40727. if (actual.systemParams !== expected.systemParams) {
  40728. return 'SYSTEM_PARAMS_DONT_MATCH';
  40729. }
  40730. var relevantExpectedFlags = expected.flags.slice();
  40731. // If we run "yarn" after "yarn --check-files", we shouldn't fail the less strict validation
  40732. if (actual.flags.indexOf('checkFiles') === -1) {
  40733. relevantExpectedFlags = relevantExpectedFlags.filter(function (flag) {
  40734. return flag !== 'checkFiles';
  40735. });
  40736. }
  40737. if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.flags, relevantExpectedFlags)) {
  40738. return 'FLAGS_DONT_MATCH';
  40739. }
  40740. if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.topLevelPatterns, expected.topLevelPatterns || [])) {
  40741. return 'PATTERNS_DONT_MATCH';
  40742. }
  40743. for (var _iterator9 = (0, (_keys || _load_keys()).default)(actual.lockfileEntries), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
  40744. var _ref16;
  40745. if (_isArray9) {
  40746. if (_i9 >= _iterator9.length) break;
  40747. _ref16 = _iterator9[_i9++];
  40748. } else {
  40749. _i9 = _iterator9.next();
  40750. if (_i9.done) break;
  40751. _ref16 = _i9.value;
  40752. }
  40753. var _key2 = _ref16;
  40754. if (actual.lockfileEntries[_key2] !== expected.lockfileEntries[_key2]) {
  40755. return 'LOCKFILE_DONT_MATCH';
  40756. }
  40757. }
  40758. for (var _iterator10 = (0, (_keys || _load_keys()).default)(expected.lockfileEntries), _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
  40759. var _ref17;
  40760. if (_isArray10) {
  40761. if (_i10 >= _iterator10.length) break;
  40762. _ref17 = _iterator10[_i10++];
  40763. } else {
  40764. _i10 = _iterator10.next();
  40765. if (_i10.done) break;
  40766. _ref17 = _i10.value;
  40767. }
  40768. var _key3 = _ref17;
  40769. if (actual.lockfileEntries[_key3] !== expected.lockfileEntries[_key3]) {
  40770. return 'LOCKFILE_DONT_MATCH';
  40771. }
  40772. }
  40773. if (checkFiles) {
  40774. // Early bailout if we expect more files than what we have
  40775. if (expected.files.length > actual.files.length) {
  40776. return 'FILES_MISSING';
  40777. }
  40778. // Since we know the "files" array is sorted (alphabetically), we can optimize the thing
  40779. // Instead of storing the files in a Set, we can just iterate both arrays at once. O(n)!
  40780. for (var u = 0, v = 0; u < expected.files.length; ++u) {
  40781. // Index that, if reached, means that we won't have enough food to match the remaining expected entries anyway
  40782. var max = v + (actual.files.length - v) - (expected.files.length - u) + 1;
  40783. // Skip over files that have been added (ie not present in 'expected')
  40784. while (v < max && actual.files[v] !== expected.files[u]) {
  40785. v += 1;
  40786. }
  40787. // If we've reached the index defined above, the file is either missing or we can early exit
  40788. if (v === max) {
  40789. return 'FILES_MISSING';
  40790. }
  40791. }
  40792. }
  40793. return 'OK';
  40794. };
  40795. InstallationIntegrityChecker.prototype.check = function () {
  40796. var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, lockfile, flags, workspaceLayout) {
  40797. // check if patterns exist in lockfile
  40798. var missingPatterns = patterns.filter(function (p) {
  40799. return !lockfile[p] && (!workspaceLayout || !workspaceLayout.getManifestByPattern(p));
  40800. });
  40801. var loc = yield this._getIntegrityFileLocation();
  40802. if (missingPatterns.length || !loc.exists) {
  40803. return {
  40804. integrityFileMissing: !loc.exists,
  40805. missingPatterns
  40806. };
  40807. }
  40808. var actual = yield this._generateIntegrityFile(lockfile, patterns, flags, workspaceLayout);
  40809. var expected = yield this._getIntegrityFile(loc.locationPath);
  40810. var integrityMatches = this._compareIntegrityFiles(actual, expected, flags.checkFiles, workspaceLayout);
  40811. if (integrityMatches === 'OK') {
  40812. invariant(expected, "The integrity shouldn't pass without integrity file");
  40813. for (var _iterator11 = expected.modulesFolders, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
  40814. var _ref19;
  40815. if (_isArray11) {
  40816. if (_i11 >= _iterator11.length) break;
  40817. _ref19 = _iterator11[_i11++];
  40818. } else {
  40819. _i11 = _iterator11.next();
  40820. if (_i11.done) break;
  40821. _ref19 = _i11.value;
  40822. }
  40823. var modulesFolder = _ref19;
  40824. if (!(yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, modulesFolder)))) {
  40825. integrityMatches = 'MODULES_FOLDERS_MISSING';
  40826. }
  40827. }
  40828. }
  40829. return {
  40830. integrityFileMissing: false,
  40831. integrityMatches: integrityMatches === 'OK',
  40832. integrityError: integrityMatches === 'OK' ? undefined : integrityMatches,
  40833. missingPatterns,
  40834. hardRefreshRequired: integrityMatches === 'SYSTEM_PARAMS_DONT_MATCH'
  40835. };
  40836. });
  40837. function check(_x10, _x11, _x12, _x13) {
  40838. return _ref18.apply(this, arguments);
  40839. }
  40840. return check;
  40841. }();
  40842. /**
  40843. * Get artifacts from integrity file if it exists.
  40844. */
  40845. InstallationIntegrityChecker.prototype.getArtifacts = function () {
  40846. var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  40847. var loc = yield this._getIntegrityFileLocation();
  40848. if (!loc.exists) {
  40849. return null;
  40850. }
  40851. var expectedRaw = yield (_fs || _load_fs()).readFile(loc.locationPath);
  40852. var expected = void 0;
  40853. try {
  40854. expected = JSON.parse(expectedRaw);
  40855. } catch (e) {
  40856. // ignore JSON parsing for legacy text integrity files compatibility
  40857. }
  40858. return expected ? expected.artifacts : null;
  40859. });
  40860. function getArtifacts() {
  40861. return _ref20.apply(this, arguments);
  40862. }
  40863. return getArtifacts;
  40864. }();
  40865. /**
  40866. * Write the integrity hash of the current install to disk.
  40867. */
  40868. InstallationIntegrityChecker.prototype.save = function () {
  40869. var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, lockfile, flags, workspaceLayout, artifacts) {
  40870. var integrityFile = yield this._generateIntegrityFile(lockfile, patterns, flags, workspaceLayout, artifacts);
  40871. var loc = yield this._getIntegrityFileLocation();
  40872. invariant(loc.locationPath, 'expected integrity hash location');
  40873. yield (_fs || _load_fs()).mkdirp(path.dirname(loc.locationPath));
  40874. yield (_fs || _load_fs()).writeFile(loc.locationPath, (0, (_stringify || _load_stringify()).default)(integrityFile, null, 2));
  40875. });
  40876. function save(_x14, _x15, _x16, _x17, _x18) {
  40877. return _ref21.apply(this, arguments);
  40878. }
  40879. return save;
  40880. }();
  40881. InstallationIntegrityChecker.prototype.removeIntegrityFile = function () {
  40882. var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  40883. var loc = yield this._getIntegrityFileLocation();
  40884. if (loc.exists) {
  40885. yield (_fs || _load_fs()).unlink(loc.locationPath);
  40886. }
  40887. });
  40888. function removeIntegrityFile() {
  40889. return _ref22.apply(this, arguments);
  40890. }
  40891. return removeIntegrityFile;
  40892. }();
  40893. return InstallationIntegrityChecker;
  40894. }();
  40895. exports.default = InstallationIntegrityChecker;
  40896. /***/ }),
  40897. /* 196 */
  40898. /***/ (function(module, exports, __webpack_require__) {
  40899. "use strict";
  40900. Object.defineProperty(exports, "__esModule", {
  40901. value: true
  40902. });
  40903. var _getIterator2;
  40904. function _load_getIterator() {
  40905. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  40906. }
  40907. var _assign;
  40908. function _load_assign() {
  40909. return _assign = _interopRequireDefault(__webpack_require__(23));
  40910. }
  40911. exports.testEngine = testEngine;
  40912. exports.checkOne = checkOne;
  40913. exports.check = check;
  40914. exports.shouldCheck = shouldCheck;
  40915. var _errors;
  40916. function _load_errors() {
  40917. return _errors = __webpack_require__(6);
  40918. }
  40919. var _map;
  40920. function _load_map() {
  40921. return _map = _interopRequireDefault(__webpack_require__(51));
  40922. }
  40923. var _misc;
  40924. function _load_misc() {
  40925. return _misc = __webpack_require__(28);
  40926. }
  40927. var _yarnVersion;
  40928. function _load_yarnVersion() {
  40929. return _yarnVersion = __webpack_require__(96);
  40930. }
  40931. var _semver;
  40932. function _load_semver() {
  40933. return _semver = __webpack_require__(160);
  40934. }
  40935. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  40936. var semver = __webpack_require__(27);
  40937. var VERSIONS = (0, (_assign || _load_assign()).default)({}, process.versions, {
  40938. yarn: (_yarnVersion || _load_yarnVersion()).version
  40939. });
  40940. function isValid(items, actual) {
  40941. var isNotWhitelist = true;
  40942. var isBlacklist = false;
  40943. for (var _iterator = items, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  40944. var _ref;
  40945. if (_isArray) {
  40946. if (_i >= _iterator.length) break;
  40947. _ref = _iterator[_i++];
  40948. } else {
  40949. _i = _iterator.next();
  40950. if (_i.done) break;
  40951. _ref = _i.value;
  40952. }
  40953. var item = _ref;
  40954. // blacklist
  40955. if (item[0] === '!') {
  40956. isBlacklist = true;
  40957. if (actual === item.slice(1)) {
  40958. return false;
  40959. }
  40960. // whitelist
  40961. } else {
  40962. isNotWhitelist = false;
  40963. if (item === actual) {
  40964. return true;
  40965. }
  40966. }
  40967. }
  40968. // npm allows blacklists and whitelists to be mixed. Blacklists with
  40969. // whitelisted items should be treated as whitelists.
  40970. return isBlacklist && isNotWhitelist;
  40971. }
  40972. var aliases = (0, (_map || _load_map()).default)({
  40973. iojs: 'node' // we should probably prompt these libraries to fix this
  40974. });
  40975. var ignore = ['npm', // we'll never satisfy this for obvious reasons
  40976. 'teleport', // a module bundler used by some modules
  40977. 'rhino', // once a target for older modules
  40978. 'cordovaDependencies', // http://bit.ly/2tkUePg
  40979. 'parcel'];
  40980. function testEngine(name, range, versions, looseSemver) {
  40981. var actual = versions[name];
  40982. if (!actual) {
  40983. return false;
  40984. }
  40985. if (!semver.valid(actual, looseSemver)) {
  40986. return false;
  40987. }
  40988. if (semver.satisfies(actual, range, looseSemver)) {
  40989. return true;
  40990. }
  40991. if (name === 'yarn' && (0, (_semver || _load_semver()).satisfiesWithPrereleases)(actual, range, looseSemver)) {
  40992. return true;
  40993. }
  40994. if (name === 'node' && semver.gt(actual, '1.0.0', looseSemver)) {
  40995. // WARNING: this is a massive hack and is super gross but necessary for compatibility
  40996. // some modules have the `engines.node` field set to a caret version below semver major v1
  40997. // eg. ^0.12.0. this is problematic as we enforce engines checks and node is now on version >=1
  40998. // to allow this pattern we transform the node version to fake ones in the minor range 10-13
  40999. var major = semver.major(actual, looseSemver);
  41000. var fakes = [`0.10.${major}`, `0.11.${major}`, `0.12.${major}`, `0.13.${major}`];
  41001. for (var _iterator2 = fakes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  41002. var _ref2;
  41003. if (_isArray2) {
  41004. if (_i2 >= _iterator2.length) break;
  41005. _ref2 = _iterator2[_i2++];
  41006. } else {
  41007. _i2 = _iterator2.next();
  41008. if (_i2.done) break;
  41009. _ref2 = _i2.value;
  41010. }
  41011. var actualFake = _ref2;
  41012. if (semver.satisfies(actualFake, range, looseSemver)) {
  41013. return true;
  41014. }
  41015. }
  41016. }
  41017. // incompatible version
  41018. return false;
  41019. }
  41020. function isValidArch(archs) {
  41021. return isValid(archs, process.arch);
  41022. }
  41023. function isValidPlatform(platforms) {
  41024. return isValid(platforms, process.platform);
  41025. }
  41026. function checkOne(info, config, ignoreEngines) {
  41027. var didIgnore = false;
  41028. var didError = false;
  41029. var reporter = config.reporter;
  41030. var human = `${info.name}@${info.version}`;
  41031. var pushError = function pushError(msg) {
  41032. var ref = info._reference;
  41033. if (ref && ref.optional) {
  41034. ref.ignore = true;
  41035. ref.incompatible = true;
  41036. if (!didIgnore) {
  41037. didIgnore = true;
  41038. }
  41039. } else {
  41040. reporter.error(`${human}: ${msg}`);
  41041. didError = true;
  41042. }
  41043. };
  41044. var os = info.os,
  41045. cpu = info.cpu,
  41046. engines = info.engines;
  41047. if (shouldCheckPlatform(os, config.ignorePlatform) && !isValidPlatform(os)) {
  41048. pushError(reporter.lang('incompatibleOS', process.platform));
  41049. }
  41050. if (shouldCheckCpu(cpu, config.ignorePlatform) && !isValidArch(cpu)) {
  41051. pushError(reporter.lang('incompatibleCPU', process.arch));
  41052. }
  41053. if (shouldCheckEngines(engines, ignoreEngines)) {
  41054. for (var _iterator3 = (0, (_misc || _load_misc()).entries)(info.engines), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  41055. var _ref3;
  41056. if (_isArray3) {
  41057. if (_i3 >= _iterator3.length) break;
  41058. _ref3 = _iterator3[_i3++];
  41059. } else {
  41060. _i3 = _iterator3.next();
  41061. if (_i3.done) break;
  41062. _ref3 = _i3.value;
  41063. }
  41064. var entry = _ref3;
  41065. var name = entry[0];
  41066. var range = entry[1];
  41067. if (aliases[name]) {
  41068. name = aliases[name];
  41069. }
  41070. if (VERSIONS[name]) {
  41071. if (!testEngine(name, range, VERSIONS, config.looseSemver)) {
  41072. pushError(reporter.lang('incompatibleEngine', name, range, VERSIONS[name]));
  41073. }
  41074. } else if (ignore.indexOf(name) < 0) {
  41075. reporter.warn(`${human}: ${reporter.lang('invalidEngine', name)}`);
  41076. }
  41077. }
  41078. }
  41079. if (didError) {
  41080. throw new (_errors || _load_errors()).MessageError(reporter.lang('foundIncompatible'));
  41081. }
  41082. }
  41083. function check(infos, config, ignoreEngines) {
  41084. for (var _iterator4 = infos, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  41085. var _ref4;
  41086. if (_isArray4) {
  41087. if (_i4 >= _iterator4.length) break;
  41088. _ref4 = _iterator4[_i4++];
  41089. } else {
  41090. _i4 = _iterator4.next();
  41091. if (_i4.done) break;
  41092. _ref4 = _i4.value;
  41093. }
  41094. var info = _ref4;
  41095. checkOne(info, config, ignoreEngines);
  41096. }
  41097. }
  41098. function shouldCheckCpu(cpu, ignorePlatform) {
  41099. return !ignorePlatform && Array.isArray(cpu) && cpu.length > 0;
  41100. }
  41101. function shouldCheckPlatform(os, ignorePlatform) {
  41102. return !ignorePlatform && Array.isArray(os) && os.length > 0;
  41103. }
  41104. function shouldCheckEngines(engines, ignoreEngines) {
  41105. return !ignoreEngines && typeof engines === 'object';
  41106. }
  41107. function shouldCheck(manifest, options) {
  41108. return shouldCheckCpu(manifest.cpu, options.ignorePlatform) || shouldCheckPlatform(manifest.os, options.ignorePlatform) || shouldCheckEngines(manifest.engines, options.ignoreEngines);
  41109. }
  41110. /***/ }),
  41111. /* 197 */
  41112. /***/ (function(module, exports, __webpack_require__) {
  41113. "use strict";
  41114. Object.defineProperty(exports, "__esModule", {
  41115. value: true
  41116. });
  41117. exports.fetchOneRemote = undefined;
  41118. var _keys;
  41119. function _load_keys() {
  41120. return _keys = _interopRequireDefault(__webpack_require__(14));
  41121. }
  41122. var _map;
  41123. function _load_map() {
  41124. return _map = _interopRequireDefault(__webpack_require__(42));
  41125. }
  41126. var _promise;
  41127. function _load_promise() {
  41128. return _promise = _interopRequireDefault(__webpack_require__(7));
  41129. }
  41130. var _asyncToGenerator2;
  41131. function _load_asyncToGenerator() {
  41132. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  41133. }
  41134. var fetchCache = function () {
  41135. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest, fetcher, config, remote) {
  41136. // $FlowFixMe: This error doesn't make sense
  41137. var _ref2 = yield config.readPackageMetadata(dest),
  41138. hash = _ref2.hash,
  41139. pkg = _ref2.package,
  41140. cacheRemote = _ref2.remote;
  41141. var cacheIntegrity = cacheRemote.cacheIntegrity || cacheRemote.integrity;
  41142. var cacheHash = cacheRemote.hash;
  41143. if (remote.integrity) {
  41144. if (!cacheIntegrity || !ssri.parse(cacheIntegrity).match(remote.integrity)) {
  41145. throw new (_errors || _load_errors()).SecurityError(config.reporter.lang('fetchBadIntegrityCache', pkg.name, cacheIntegrity, remote.integrity));
  41146. }
  41147. }
  41148. if (remote.hash) {
  41149. if (!cacheHash || cacheHash !== remote.hash) {
  41150. throw new (_errors || _load_errors()).SecurityError(config.reporter.lang('fetchBadHashCache', pkg.name, cacheHash, remote.hash));
  41151. }
  41152. }
  41153. yield fetcher.setupMirrorFromCache();
  41154. return {
  41155. package: pkg,
  41156. hash,
  41157. dest,
  41158. cached: true
  41159. };
  41160. });
  41161. return function fetchCache(_x, _x2, _x3, _x4) {
  41162. return _ref.apply(this, arguments);
  41163. };
  41164. }();
  41165. var fetchOneRemote = exports.fetchOneRemote = function () {
  41166. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (remote, name, version, dest, config) {
  41167. // Mock metadata for symlinked dependencies
  41168. if (remote.type === 'link') {
  41169. var mockPkg = { _uid: '', name: '', version: '0.0.0' };
  41170. return (_promise || _load_promise()).default.resolve({ resolved: null, hash: '', dest, package: mockPkg, cached: false });
  41171. }
  41172. var Fetcher = (_index || _load_index())[remote.type];
  41173. if (!Fetcher) {
  41174. throw new (_errors || _load_errors()).MessageError(config.reporter.lang('unknownFetcherFor', remote.type));
  41175. }
  41176. var fetcher = new Fetcher(dest, remote, config);
  41177. if (yield config.isValidModuleDest(dest)) {
  41178. return fetchCache(dest, fetcher, config, remote);
  41179. }
  41180. // remove as the module may be invalid
  41181. yield (_fs || _load_fs()).unlink(dest);
  41182. try {
  41183. return yield fetcher.fetch({
  41184. name,
  41185. version
  41186. });
  41187. } catch (err) {
  41188. try {
  41189. yield (_fs || _load_fs()).unlink(dest);
  41190. } catch (err2) {
  41191. // what do?
  41192. }
  41193. throw err;
  41194. }
  41195. });
  41196. return function fetchOneRemote(_x5, _x6, _x7, _x8, _x9) {
  41197. return _ref3.apply(this, arguments);
  41198. };
  41199. }();
  41200. var maybeFetchOne = function () {
  41201. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref, config) {
  41202. try {
  41203. return yield fetchOne(ref, config);
  41204. } catch (err) {
  41205. if (ref.optional) {
  41206. config.reporter.error(err.message);
  41207. return null;
  41208. } else {
  41209. throw err;
  41210. }
  41211. }
  41212. });
  41213. return function maybeFetchOne(_x10, _x11) {
  41214. return _ref4.apply(this, arguments);
  41215. };
  41216. }();
  41217. exports.fetch = fetch;
  41218. var _errors;
  41219. function _load_errors() {
  41220. return _errors = __webpack_require__(6);
  41221. }
  41222. var _index;
  41223. function _load_index() {
  41224. return _index = _interopRequireWildcard(__webpack_require__(507));
  41225. }
  41226. var _fs;
  41227. function _load_fs() {
  41228. return _fs = _interopRequireWildcard(__webpack_require__(8));
  41229. }
  41230. var _promise2;
  41231. function _load_promise2() {
  41232. return _promise2 = _interopRequireWildcard(__webpack_require__(86));
  41233. }
  41234. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  41235. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  41236. var ssri = __webpack_require__(93);
  41237. function fetchOne(ref, config) {
  41238. var dest = config.generateModuleCachePath(ref);
  41239. return fetchOneRemote(ref.remote, ref.name, ref.version, dest, config);
  41240. }
  41241. function fetch(pkgs, config) {
  41242. var pkgsPerDest = new (_map || _load_map()).default();
  41243. pkgs = pkgs.filter(function (pkg) {
  41244. var ref = pkg._reference;
  41245. if (!ref) {
  41246. return false;
  41247. }
  41248. var dest = config.generateModuleCachePath(ref);
  41249. var otherPkg = pkgsPerDest.get(dest);
  41250. if (otherPkg) {
  41251. config.reporter.warn(config.reporter.lang('multiplePackagesCantUnpackInSameDestination', ref.patterns, dest, otherPkg.patterns));
  41252. return false;
  41253. }
  41254. pkgsPerDest.set(dest, ref);
  41255. return true;
  41256. });
  41257. var tick = config.reporter.progress(pkgs.length);
  41258. return (_promise2 || _load_promise2()).queue(pkgs, function () {
  41259. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg) {
  41260. var ref = pkg._reference;
  41261. if (!ref) {
  41262. return pkg;
  41263. }
  41264. var res = yield maybeFetchOne(ref, config);
  41265. var newPkg = void 0;
  41266. if (res) {
  41267. newPkg = res.package;
  41268. // update with new remote
  41269. // but only if there was a hash previously as the tarball fetcher does not provide a hash.
  41270. if (ref.remote.hash) {
  41271. // if the checksum was updated, also update resolved and cache
  41272. if (ref.remote.hash !== res.hash && config.updateChecksums) {
  41273. var oldHash = ref.remote.hash;
  41274. if (ref.remote.resolved) {
  41275. ref.remote.resolved = ref.remote.resolved.replace(oldHash, res.hash);
  41276. }
  41277. ref.config.cache = (0, (_keys || _load_keys()).default)(ref.config.cache).reduce(function (cache, entry) {
  41278. var entryWithNewHash = entry.replace(oldHash, res.hash);
  41279. cache[entryWithNewHash] = ref.config.cache[entry];
  41280. return cache;
  41281. }, {});
  41282. }
  41283. ref.remote.hash = res.hash || ref.remote.hash;
  41284. }
  41285. }
  41286. if (tick) {
  41287. tick();
  41288. }
  41289. if (newPkg) {
  41290. newPkg._reference = ref;
  41291. newPkg._remote = ref.remote;
  41292. newPkg.name = pkg.name;
  41293. newPkg.fresh = pkg.fresh;
  41294. return newPkg;
  41295. }
  41296. return pkg;
  41297. });
  41298. return function (_x12) {
  41299. return _ref5.apply(this, arguments);
  41300. };
  41301. }(), config.networkConcurrency);
  41302. }
  41303. /***/ }),
  41304. /* 198 */
  41305. /***/ (function(module, exports, __webpack_require__) {
  41306. "use strict";
  41307. Object.defineProperty(exports, "__esModule", {
  41308. value: true
  41309. });
  41310. exports.linkBin = undefined;
  41311. var _from;
  41312. function _load_from() {
  41313. return _from = _interopRequireDefault(__webpack_require__(53));
  41314. }
  41315. var _set;
  41316. function _load_set() {
  41317. return _set = _interopRequireDefault(__webpack_require__(16));
  41318. }
  41319. var _map;
  41320. function _load_map() {
  41321. return _map = _interopRequireDefault(__webpack_require__(42));
  41322. }
  41323. var _promise;
  41324. function _load_promise() {
  41325. return _promise = _interopRequireDefault(__webpack_require__(7));
  41326. }
  41327. var _keys;
  41328. function _load_keys() {
  41329. return _keys = _interopRequireDefault(__webpack_require__(14));
  41330. }
  41331. var _getIterator2;
  41332. function _load_getIterator() {
  41333. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  41334. }
  41335. var _classCallCheck2;
  41336. function _load_classCallCheck() {
  41337. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  41338. }
  41339. var _asyncToGenerator2;
  41340. function _load_asyncToGenerator() {
  41341. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  41342. }
  41343. var linkBin = exports.linkBin = function () {
  41344. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) {
  41345. if (process.platform === 'win32') {
  41346. var unlockMutex = yield (0, (_mutex || _load_mutex()).default)(src);
  41347. try {
  41348. yield cmdShim(src, dest, { createPwshFile: false });
  41349. } finally {
  41350. unlockMutex();
  41351. }
  41352. } else {
  41353. yield (_fs || _load_fs()).mkdirp(path.dirname(dest));
  41354. yield (_fs || _load_fs()).symlink(src, dest);
  41355. yield (_fs || _load_fs()).chmod(dest, '755');
  41356. }
  41357. });
  41358. return function linkBin(_x, _x2) {
  41359. return _ref.apply(this, arguments);
  41360. };
  41361. }();
  41362. var _packageHoister;
  41363. function _load_packageHoister() {
  41364. return _packageHoister = _interopRequireDefault(__webpack_require__(512));
  41365. }
  41366. var _constants;
  41367. function _load_constants() {
  41368. return _constants = _interopRequireWildcard(__webpack_require__(13));
  41369. }
  41370. var _promise2;
  41371. function _load_promise2() {
  41372. return _promise2 = _interopRequireWildcard(__webpack_require__(86));
  41373. }
  41374. var _normalizePattern2;
  41375. function _load_normalizePattern() {
  41376. return _normalizePattern2 = __webpack_require__(52);
  41377. }
  41378. var _misc;
  41379. function _load_misc() {
  41380. return _misc = __webpack_require__(28);
  41381. }
  41382. var _fs;
  41383. function _load_fs() {
  41384. return _fs = _interopRequireWildcard(__webpack_require__(8));
  41385. }
  41386. var _mutex;
  41387. function _load_mutex() {
  41388. return _mutex = _interopRequireDefault(__webpack_require__(312));
  41389. }
  41390. var _semver;
  41391. function _load_semver() {
  41392. return _semver = __webpack_require__(160);
  41393. }
  41394. var _workspaceLayout;
  41395. function _load_workspaceLayout() {
  41396. return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
  41397. }
  41398. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  41399. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  41400. var invariant = __webpack_require__(15);
  41401. var cmdShim = __webpack_require__(190);
  41402. var path = __webpack_require__(1);
  41403. var semver = __webpack_require__(27);
  41404. // Concurrency for creating bin links disabled because of the issue #1961
  41405. var linkBinConcurrency = 1;
  41406. var PackageLinker = function () {
  41407. function PackageLinker(config, resolver) {
  41408. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageLinker);
  41409. this.resolver = resolver;
  41410. this.reporter = config.reporter;
  41411. this.config = config;
  41412. this.artifacts = {};
  41413. this.topLevelBinLinking = true;
  41414. this.unplugged = [];
  41415. }
  41416. PackageLinker.prototype.setArtifacts = function setArtifacts(artifacts) {
  41417. this.artifacts = artifacts;
  41418. };
  41419. PackageLinker.prototype.setTopLevelBinLinking = function setTopLevelBinLinking(topLevelBinLinking) {
  41420. this.topLevelBinLinking = topLevelBinLinking;
  41421. };
  41422. PackageLinker.prototype.linkSelfDependencies = function () {
  41423. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, pkgLoc, targetBinLoc) {
  41424. var override = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  41425. targetBinLoc = path.join(targetBinLoc, '.bin');
  41426. yield (_fs || _load_fs()).mkdirp(targetBinLoc);
  41427. targetBinLoc = yield (_fs || _load_fs()).realpath(targetBinLoc);
  41428. pkgLoc = yield (_fs || _load_fs()).realpath(pkgLoc);
  41429. for (var _iterator = (0, (_misc || _load_misc()).entries)(pkg.bin), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  41430. var _ref4;
  41431. if (_isArray) {
  41432. if (_i >= _iterator.length) break;
  41433. _ref4 = _iterator[_i++];
  41434. } else {
  41435. _i = _iterator.next();
  41436. if (_i.done) break;
  41437. _ref4 = _i.value;
  41438. }
  41439. var _ref3 = _ref4;
  41440. var scriptName = _ref3[0];
  41441. var scriptCmd = _ref3[1];
  41442. var dest = path.join(targetBinLoc, scriptName);
  41443. var src = path.join(pkgLoc, scriptCmd);
  41444. if (!(yield (_fs || _load_fs()).exists(src))) {
  41445. if (!override) {
  41446. // TODO maybe throw an error
  41447. continue;
  41448. }
  41449. }
  41450. yield linkBin(src, dest);
  41451. }
  41452. });
  41453. function linkSelfDependencies(_x3, _x4, _x5) {
  41454. return _ref2.apply(this, arguments);
  41455. }
  41456. return linkSelfDependencies;
  41457. }();
  41458. PackageLinker.prototype.linkBinDependencies = function () {
  41459. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, dir) {
  41460. var _this = this;
  41461. var deps = [];
  41462. var ref = pkg._reference;
  41463. invariant(ref, 'Package reference is missing');
  41464. var remote = pkg._remote;
  41465. invariant(remote, 'Package remote is missing');
  41466. // link up `bin scripts` in `dependencies`
  41467. for (var _iterator2 = ref.dependencies, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  41468. var _ref6;
  41469. if (_isArray2) {
  41470. if (_i2 >= _iterator2.length) break;
  41471. _ref6 = _iterator2[_i2++];
  41472. } else {
  41473. _i2 = _iterator2.next();
  41474. if (_i2.done) break;
  41475. _ref6 = _i2.value;
  41476. }
  41477. var pattern = _ref6;
  41478. var _dep = this.resolver.getStrictResolvedPattern(pattern);
  41479. if (
  41480. // Missing locations means not installed inside node_modules
  41481. _dep._reference && _dep._reference.locations.length && _dep.bin && (0, (_keys || _load_keys()).default)(_dep.bin).length) {
  41482. var _loc2 = yield this.findNearestInstalledVersionOfPackage(_dep, dir);
  41483. deps.push({ dep: _dep, loc: _loc2 });
  41484. }
  41485. }
  41486. // link up the `bin` scripts in bundled dependencies
  41487. if (pkg.bundleDependencies) {
  41488. var _loop = function* _loop(depName) {
  41489. var locs = ref.locations.map(function (loc) {
  41490. return path.join(loc, _this.config.getFolder(pkg), depName);
  41491. });
  41492. try {
  41493. var _dep2 = yield _this.config.readManifest(locs[0], remote.registry); //all of them should be the same
  41494. if (_dep2.bin && (0, (_keys || _load_keys()).default)(_dep2.bin).length) {
  41495. deps.push.apply(deps, locs.map(function (loc) {
  41496. return { dep: _dep2, loc };
  41497. }));
  41498. }
  41499. } catch (ex) {
  41500. if (ex.code !== 'ENOENT') {
  41501. throw ex;
  41502. }
  41503. // intentionally ignoring ENOENT error.
  41504. // bundledDependency either does not exist or does not contain a package.json
  41505. }
  41506. };
  41507. for (var _iterator3 = pkg.bundleDependencies, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  41508. var _ref7;
  41509. if (_isArray3) {
  41510. if (_i3 >= _iterator3.length) break;
  41511. _ref7 = _iterator3[_i3++];
  41512. } else {
  41513. _i3 = _iterator3.next();
  41514. if (_i3.done) break;
  41515. _ref7 = _i3.value;
  41516. }
  41517. var depName = _ref7;
  41518. yield* _loop(depName);
  41519. }
  41520. }
  41521. // no deps to link
  41522. if (!deps.length) {
  41523. return;
  41524. }
  41525. // write the executables
  41526. for (var _iterator4 = deps, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  41527. var _ref9;
  41528. if (_isArray4) {
  41529. if (_i4 >= _iterator4.length) break;
  41530. _ref9 = _iterator4[_i4++];
  41531. } else {
  41532. _i4 = _iterator4.next();
  41533. if (_i4.done) break;
  41534. _ref9 = _i4.value;
  41535. }
  41536. var _ref8 = _ref9;
  41537. var _dep3 = _ref8.dep,
  41538. _loc = _ref8.loc;
  41539. if (_dep3._reference && _dep3._reference.locations.length) {
  41540. invariant(!_dep3._reference.isPlugnplay, "Plug'n'play packages should not be referenced here");
  41541. yield this.linkSelfDependencies(_dep3, _loc, dir);
  41542. }
  41543. }
  41544. });
  41545. function linkBinDependencies(_x7, _x8) {
  41546. return _ref5.apply(this, arguments);
  41547. }
  41548. return linkBinDependencies;
  41549. }();
  41550. //find the installation location of ref that would be used in binLoc based on node module resolution
  41551. PackageLinker.prototype.findNearestInstalledVersionOfPackage = function () {
  41552. var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, binLoc) {
  41553. var ref = pkg._reference;
  41554. invariant(ref, 'expected pkg reference for ' + pkg.name);
  41555. var moduleFolder = this.config.getFolder(pkg);
  41556. yield (_fs || _load_fs()).mkdirp(binLoc);
  41557. var realBinLoc = yield (_fs || _load_fs()).realpath(binLoc);
  41558. var allLocations = [].concat(ref.locations);
  41559. var realLocations = yield (_promise || _load_promise()).default.all(ref.locations.map(function (loc) {
  41560. return (_fs || _load_fs()).realpath(loc);
  41561. }));
  41562. realLocations.forEach(function (loc) {
  41563. return allLocations.indexOf(loc) !== -1 || allLocations.push(loc);
  41564. });
  41565. var locationBinLocPairs = allLocations.map(function (loc) {
  41566. return [loc, binLoc];
  41567. });
  41568. if (binLoc !== realBinLoc) {
  41569. locationBinLocPairs.push.apply(locationBinLocPairs, allLocations.map(function (loc) {
  41570. return [loc, realBinLoc];
  41571. }));
  41572. }
  41573. var distancePairs = locationBinLocPairs.map(function (_ref11) {
  41574. var loc = _ref11[0],
  41575. curBinLoc = _ref11[1];
  41576. var distance = 0;
  41577. var curLoc = curBinLoc;
  41578. var notFound = false;
  41579. while (path.join(curLoc, ref.name) !== loc && path.join(curLoc, moduleFolder, ref.name) !== loc) {
  41580. var next = path.dirname(curLoc);
  41581. if (curLoc === next) {
  41582. notFound = true;
  41583. break;
  41584. }
  41585. distance++;
  41586. curLoc = next;
  41587. }
  41588. return notFound ? null : [loc, distance];
  41589. });
  41590. //remove items where path was not found
  41591. var filteredDistancePairs = distancePairs.filter(function (d) {
  41592. return d;
  41593. });
  41594. filteredDistancePairs;
  41595. invariant(filteredDistancePairs.length > 0, `could not find a copy of ${pkg.name} to link in ${binLoc}`);
  41596. //get smallest distance from package location
  41597. var minItem = filteredDistancePairs.reduce(function (min, cur) {
  41598. return cur[1] < min[1] ? cur : min;
  41599. });
  41600. invariant(minItem[1] >= 0, 'could not find a target for bin dir of ' + minItem.toString());
  41601. return minItem[0];
  41602. });
  41603. function findNearestInstalledVersionOfPackage(_x9, _x10) {
  41604. return _ref10.apply(this, arguments);
  41605. }
  41606. return findNearestInstalledVersionOfPackage;
  41607. }();
  41608. PackageLinker.prototype.getFlatHoistedTree = function getFlatHoistedTree(patterns, workspaceLayout) {
  41609. var _ref12 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  41610. ignoreOptional = _ref12.ignoreOptional;
  41611. var hoister = new (_packageHoister || _load_packageHoister()).default(this.config, this.resolver, { ignoreOptional, workspaceLayout });
  41612. hoister.seed(patterns);
  41613. if (this.config.focus) {
  41614. hoister.markShallowWorkspaceEntries();
  41615. }
  41616. return hoister.init();
  41617. };
  41618. PackageLinker.prototype.copyModules = function () {
  41619. var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) {
  41620. var _this2 = this;
  41621. var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  41622. linkDuplicates = _ref14.linkDuplicates,
  41623. ignoreOptional = _ref14.ignoreOptional;
  41624. var flatTree = this.getFlatHoistedTree(patterns, workspaceLayout, { ignoreOptional });
  41625. // sorted tree makes file creation and copying not to interfere with each other
  41626. flatTree = flatTree.sort(function (dep1, dep2) {
  41627. return dep1[0].localeCompare(dep2[0]);
  41628. });
  41629. // list of artifacts in modules to remove from extraneous removal
  41630. var artifactFiles = [];
  41631. var copyQueue = new (_map || _load_map()).default();
  41632. var hardlinkQueue = new (_map || _load_map()).default();
  41633. var hardlinksEnabled = linkDuplicates && (yield (_fs || _load_fs()).hardlinksWork(this.config.cwd));
  41634. var copiedSrcs = new (_map || _load_map()).default();
  41635. var symlinkPaths = new (_map || _load_map()).default();
  41636. var _loop2 = function* _loop2(folder, pkg, isShallow, _loc3) {
  41637. var remote = pkg._remote || { type: '' };
  41638. var ref = pkg._reference;
  41639. var dest = folder;
  41640. invariant(ref, 'expected package reference');
  41641. var src = _loc3;
  41642. var type = '';
  41643. if (remote.type === 'link') {
  41644. // replace package source from incorrect cache location (workspaces and link: are not cached)
  41645. // with a symlink source
  41646. src = remote.reference;
  41647. type = 'symlink';
  41648. } else if (workspaceLayout && remote.type === 'workspace' && !isShallow) {
  41649. src = remote.reference;
  41650. type = 'symlink';
  41651. // to get real path for non hoisted dependencies
  41652. symlinkPaths.set(dest, src);
  41653. } else {
  41654. // backwards compatibility: get build artifacts from metadata
  41655. // does not apply to symlinked dependencies
  41656. var metadata = yield _this2.config.readPackageMetadata(src);
  41657. for (var _iterator15 = metadata.artifacts, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) {
  41658. var _ref32;
  41659. if (_isArray15) {
  41660. if (_i15 >= _iterator15.length) break;
  41661. _ref32 = _iterator15[_i15++];
  41662. } else {
  41663. _i15 = _iterator15.next();
  41664. if (_i15.done) break;
  41665. _ref32 = _i15.value;
  41666. }
  41667. var file = _ref32;
  41668. artifactFiles.push(path.join(dest, file));
  41669. }
  41670. }
  41671. for (var _iterator16 = symlinkPaths.entries(), _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) {
  41672. var _ref34;
  41673. if (_isArray16) {
  41674. if (_i16 >= _iterator16.length) break;
  41675. _ref34 = _iterator16[_i16++];
  41676. } else {
  41677. _i16 = _iterator16.next();
  41678. if (_i16.done) break;
  41679. _ref34 = _i16.value;
  41680. }
  41681. var _ref33 = _ref34;
  41682. var symlink = _ref33[0];
  41683. var realpath = _ref33[1];
  41684. if (dest.indexOf(symlink + path.sep) === 0) {
  41685. // after hoisting we end up with this structure
  41686. // root/node_modules/workspace-package(symlink)/node_modules/package-a
  41687. // fs.copy operations can't copy files through a symlink, so all the paths under workspace-package
  41688. // need to be replaced with a real path, except for the symlink root/node_modules/workspace-package
  41689. dest = dest.replace(symlink, realpath);
  41690. }
  41691. }
  41692. if (_this2.config.plugnplayEnabled) {
  41693. ref.isPlugnplay = true;
  41694. if (yield _this2._isUnplugged(pkg, ref)) {
  41695. dest = _this2.config.generatePackageUnpluggedPath(ref);
  41696. // We don't skip the copy if the unplugged package isn't materialized yet
  41697. if (yield (_fs || _load_fs()).exists(dest)) {
  41698. ref.addLocation(dest);
  41699. return 'continue';
  41700. }
  41701. } else {
  41702. ref.addLocation(src);
  41703. return 'continue';
  41704. }
  41705. }
  41706. ref.addLocation(dest);
  41707. var integrityArtifacts = _this2.artifacts[`${pkg.name}@${pkg.version}`];
  41708. if (integrityArtifacts) {
  41709. for (var _iterator17 = integrityArtifacts, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator17);;) {
  41710. var _ref35;
  41711. if (_isArray17) {
  41712. if (_i17 >= _iterator17.length) break;
  41713. _ref35 = _iterator17[_i17++];
  41714. } else {
  41715. _i17 = _iterator17.next();
  41716. if (_i17.done) break;
  41717. _ref35 = _i17.value;
  41718. }
  41719. var _file = _ref35;
  41720. artifactFiles.push(path.join(dest, _file));
  41721. }
  41722. }
  41723. var copiedDest = copiedSrcs.get(src);
  41724. if (!copiedDest) {
  41725. // no point to hardlink to a symlink
  41726. if (hardlinksEnabled && type !== 'symlink') {
  41727. copiedSrcs.set(src, dest);
  41728. }
  41729. copyQueue.set(dest, {
  41730. src,
  41731. dest,
  41732. type,
  41733. onFresh() {
  41734. if (ref) {
  41735. ref.setFresh(true);
  41736. }
  41737. }
  41738. });
  41739. } else {
  41740. hardlinkQueue.set(dest, {
  41741. src: copiedDest,
  41742. dest,
  41743. onFresh() {
  41744. if (ref) {
  41745. ref.setFresh(true);
  41746. }
  41747. }
  41748. });
  41749. }
  41750. };
  41751. for (var _iterator5 = flatTree, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  41752. var _ref16;
  41753. if (_isArray5) {
  41754. if (_i5 >= _iterator5.length) break;
  41755. _ref16 = _iterator5[_i5++];
  41756. } else {
  41757. _i5 = _iterator5.next();
  41758. if (_i5.done) break;
  41759. _ref16 = _i5.value;
  41760. }
  41761. var _ref15 = _ref16;
  41762. var folder = _ref15[0];
  41763. var _ref15$ = _ref15[1];
  41764. var pkg = _ref15$.pkg;
  41765. var _loc3 = _ref15$.loc;
  41766. var isShallow = _ref15$.isShallow;
  41767. var _ret2 = yield* _loop2(folder, pkg, isShallow, _loc3);
  41768. if (_ret2 === 'continue') continue;
  41769. }
  41770. var possibleExtraneous = new (_set || _load_set()).default();
  41771. var scopedPaths = new (_set || _load_set()).default();
  41772. var findExtraneousFiles = function () {
  41773. var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (basePath) {
  41774. for (var _iterator6 = _this2.config.registryFolders, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  41775. var _ref18;
  41776. if (_isArray6) {
  41777. if (_i6 >= _iterator6.length) break;
  41778. _ref18 = _iterator6[_i6++];
  41779. } else {
  41780. _i6 = _iterator6.next();
  41781. if (_i6.done) break;
  41782. _ref18 = _i6.value;
  41783. }
  41784. var folder = _ref18;
  41785. var _loc4 = path.resolve(basePath, folder);
  41786. if (yield (_fs || _load_fs()).exists(_loc4)) {
  41787. var files = yield (_fs || _load_fs()).readdir(_loc4);
  41788. for (var _iterator7 = files, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  41789. var _ref19;
  41790. if (_isArray7) {
  41791. if (_i7 >= _iterator7.length) break;
  41792. _ref19 = _iterator7[_i7++];
  41793. } else {
  41794. _i7 = _iterator7.next();
  41795. if (_i7.done) break;
  41796. _ref19 = _i7.value;
  41797. }
  41798. var file = _ref19;
  41799. var filepath = path.join(_loc4, file);
  41800. // it's a scope, not a package
  41801. if (file[0] === '@') {
  41802. scopedPaths.add(filepath);
  41803. for (var _iterator8 = yield (_fs || _load_fs()).readdir(filepath), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
  41804. var _ref20;
  41805. if (_isArray8) {
  41806. if (_i8 >= _iterator8.length) break;
  41807. _ref20 = _iterator8[_i8++];
  41808. } else {
  41809. _i8 = _iterator8.next();
  41810. if (_i8.done) break;
  41811. _ref20 = _i8.value;
  41812. }
  41813. var subfile = _ref20;
  41814. possibleExtraneous.add(path.join(filepath, subfile));
  41815. }
  41816. } else if (file[0] === '.' && file !== '.bin') {
  41817. if (!(yield (_fs || _load_fs()).lstat(filepath)).isDirectory()) {
  41818. possibleExtraneous.add(filepath);
  41819. }
  41820. } else {
  41821. possibleExtraneous.add(filepath);
  41822. }
  41823. }
  41824. }
  41825. }
  41826. });
  41827. return function findExtraneousFiles(_x15) {
  41828. return _ref17.apply(this, arguments);
  41829. };
  41830. }();
  41831. yield findExtraneousFiles(this.config.lockfileFolder);
  41832. if (workspaceLayout) {
  41833. for (var _iterator9 = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
  41834. var _ref21;
  41835. if (_isArray9) {
  41836. if (_i9 >= _iterator9.length) break;
  41837. _ref21 = _iterator9[_i9++];
  41838. } else {
  41839. _i9 = _iterator9.next();
  41840. if (_i9.done) break;
  41841. _ref21 = _i9.value;
  41842. }
  41843. var workspaceName = _ref21;
  41844. yield findExtraneousFiles(workspaceLayout.workspaces[workspaceName].loc);
  41845. }
  41846. }
  41847. // If an Extraneous is an entry created via "yarn link", we prevent it from being overwritten.
  41848. // Unfortunately, the only way we can know if they have been created this way is to check if they
  41849. // are symlinks - problem is that it then conflicts with the newly introduced "link:" protocol,
  41850. // which also creates symlinks :( a somewhat weak fix is to check if the symlink target is registered
  41851. // inside the linkFolder, in which case we assume it has been created via "yarn link". Otherwise, we
  41852. // assume it's a link:-managed dependency, and overwrite it as usual.
  41853. var linkTargets = new (_map || _load_map()).default();
  41854. var linkedModules = void 0;
  41855. try {
  41856. linkedModules = yield (_fs || _load_fs()).readdir(this.config.linkFolder);
  41857. } catch (err) {
  41858. if (err.code === 'ENOENT') {
  41859. linkedModules = [];
  41860. } else {
  41861. throw err;
  41862. }
  41863. }
  41864. // TODO: Consolidate this logic with `this.config.linkedModules` logic
  41865. for (var _iterator10 = linkedModules, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
  41866. var _ref22;
  41867. if (_isArray10) {
  41868. if (_i10 >= _iterator10.length) break;
  41869. _ref22 = _iterator10[_i10++];
  41870. } else {
  41871. _i10 = _iterator10.next();
  41872. if (_i10.done) break;
  41873. _ref22 = _i10.value;
  41874. }
  41875. var entry = _ref22;
  41876. var entryPath = path.join(this.config.linkFolder, entry);
  41877. var stat = yield (_fs || _load_fs()).lstat(entryPath);
  41878. if (stat.isSymbolicLink()) {
  41879. try {
  41880. var entryTarget = yield (_fs || _load_fs()).realpath(entryPath);
  41881. linkTargets.set(entry, entryTarget);
  41882. } catch (err) {
  41883. this.reporter.warn(this.reporter.lang('linkTargetMissing', entry));
  41884. yield (_fs || _load_fs()).unlink(entryPath);
  41885. }
  41886. } else if (stat.isDirectory() && entry[0] === '@') {
  41887. // if the entry is directory beginning with '@', then we're dealing with a package scope, which
  41888. // means we must iterate inside to retrieve the package names it contains
  41889. var scopeName = entry;
  41890. for (var _iterator18 = yield (_fs || _load_fs()).readdir(entryPath), _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator18);;) {
  41891. var _ref36;
  41892. if (_isArray18) {
  41893. if (_i18 >= _iterator18.length) break;
  41894. _ref36 = _iterator18[_i18++];
  41895. } else {
  41896. _i18 = _iterator18.next();
  41897. if (_i18.done) break;
  41898. _ref36 = _i18.value;
  41899. }
  41900. var entry2 = _ref36;
  41901. var entryPath2 = path.join(entryPath, entry2);
  41902. var stat2 = yield (_fs || _load_fs()).lstat(entryPath2);
  41903. if (stat2.isSymbolicLink()) {
  41904. var packageName = `${scopeName}/${entry2}`;
  41905. try {
  41906. var _entryTarget = yield (_fs || _load_fs()).realpath(entryPath2);
  41907. linkTargets.set(packageName, _entryTarget);
  41908. } catch (err) {
  41909. this.reporter.warn(this.reporter.lang('linkTargetMissing', packageName));
  41910. yield (_fs || _load_fs()).unlink(entryPath2);
  41911. }
  41912. }
  41913. }
  41914. }
  41915. }
  41916. for (var _iterator11 = possibleExtraneous, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
  41917. var _ref23;
  41918. if (_isArray11) {
  41919. if (_i11 >= _iterator11.length) break;
  41920. _ref23 = _iterator11[_i11++];
  41921. } else {
  41922. _i11 = _iterator11.next();
  41923. if (_i11.done) break;
  41924. _ref23 = _i11.value;
  41925. }
  41926. var _loc5 = _ref23;
  41927. var packageName = path.basename(_loc5);
  41928. var scopeName = path.basename(path.dirname(_loc5));
  41929. if (scopeName[0] === `@`) {
  41930. packageName = `${scopeName}/${packageName}`;
  41931. }
  41932. if ((yield (_fs || _load_fs()).lstat(_loc5)).isSymbolicLink() && linkTargets.has(packageName) && linkTargets.get(packageName) === (yield (_fs || _load_fs()).realpath(_loc5))) {
  41933. possibleExtraneous.delete(_loc5);
  41934. copyQueue.delete(_loc5);
  41935. }
  41936. }
  41937. //
  41938. var tick = void 0;
  41939. yield (_fs || _load_fs()).copyBulk((0, (_from || _load_from()).default)(copyQueue.values()), this.reporter, {
  41940. possibleExtraneous,
  41941. artifactFiles,
  41942. ignoreBasenames: [(_constants || _load_constants()).METADATA_FILENAME, (_constants || _load_constants()).TARBALL_FILENAME, '.bin'],
  41943. onStart: function onStart(num) {
  41944. tick = _this2.reporter.progress(num);
  41945. },
  41946. onProgress(src) {
  41947. if (tick) {
  41948. tick();
  41949. }
  41950. }
  41951. });
  41952. yield (_fs || _load_fs()).hardlinkBulk((0, (_from || _load_from()).default)(hardlinkQueue.values()), this.reporter, {
  41953. possibleExtraneous,
  41954. artifactFiles,
  41955. onStart: function onStart(num) {
  41956. tick = _this2.reporter.progress(num);
  41957. },
  41958. onProgress(src) {
  41959. if (tick) {
  41960. tick();
  41961. }
  41962. }
  41963. });
  41964. // remove all extraneous files that weren't in the tree
  41965. for (var _iterator12 = possibleExtraneous, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
  41966. var _ref24;
  41967. if (_isArray12) {
  41968. if (_i12 >= _iterator12.length) break;
  41969. _ref24 = _iterator12[_i12++];
  41970. } else {
  41971. _i12 = _iterator12.next();
  41972. if (_i12.done) break;
  41973. _ref24 = _i12.value;
  41974. }
  41975. var _loc6 = _ref24;
  41976. this.reporter.verbose(this.reporter.lang('verboseFileRemoveExtraneous', _loc6));
  41977. yield (_fs || _load_fs()).unlink(_loc6);
  41978. }
  41979. // remove any empty scoped directories
  41980. for (var _iterator13 = scopedPaths, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) {
  41981. var _ref25;
  41982. if (_isArray13) {
  41983. if (_i13 >= _iterator13.length) break;
  41984. _ref25 = _iterator13[_i13++];
  41985. } else {
  41986. _i13 = _iterator13.next();
  41987. if (_i13.done) break;
  41988. _ref25 = _i13.value;
  41989. }
  41990. var scopedPath = _ref25;
  41991. var files = yield (_fs || _load_fs()).readdir(scopedPath);
  41992. if (files.length === 0) {
  41993. yield (_fs || _load_fs()).unlink(scopedPath);
  41994. }
  41995. }
  41996. // create binary links
  41997. if (this.config.getOption('bin-links') && this.config.binLinks !== false) {
  41998. var topLevelDependencies = this.determineTopLevelBinLinkOrder(flatTree);
  41999. var tickBin = this.reporter.progress(flatTree.length + topLevelDependencies.length);
  42000. // create links in transient dependencies
  42001. yield (_promise2 || _load_promise2()).queue(flatTree, function () {
  42002. var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref27) {
  42003. var dest = _ref27[0],
  42004. _ref27$ = _ref27[1],
  42005. pkg = _ref27$.pkg,
  42006. isNohoist = _ref27$.isNohoist,
  42007. parts = _ref27$.parts;
  42008. if (pkg._reference && pkg._reference.locations.length && !pkg._reference.isPlugnplay) {
  42009. var binLoc = path.join(dest, _this2.config.getFolder(pkg));
  42010. yield _this2.linkBinDependencies(pkg, binLoc);
  42011. if (isNohoist) {
  42012. // if nohoist, we need to override the binLink to point to the local destination
  42013. var parentBinLoc = _this2.getParentBinLoc(parts, flatTree);
  42014. yield _this2.linkSelfDependencies(pkg, dest, parentBinLoc, true);
  42015. }
  42016. tickBin();
  42017. }
  42018. tickBin();
  42019. });
  42020. return function (_x16) {
  42021. return _ref26.apply(this, arguments);
  42022. };
  42023. }(), linkBinConcurrency);
  42024. // create links at top level for all dependencies.
  42025. yield (_promise2 || _load_promise2()).queue(topLevelDependencies, function () {
  42026. var _ref28 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref29) {
  42027. var dest = _ref29[0],
  42028. pkg = _ref29[1].pkg;
  42029. if (pkg._reference && pkg._reference.locations.length && !pkg._reference.isPlugnplay && pkg.bin && (0, (_keys || _load_keys()).default)(pkg.bin).length) {
  42030. var binLoc = void 0;
  42031. if (_this2.config.modulesFolder) {
  42032. binLoc = path.join(_this2.config.modulesFolder);
  42033. } else {
  42034. binLoc = path.join(_this2.config.lockfileFolder, _this2.config.getFolder(pkg));
  42035. }
  42036. yield _this2.linkSelfDependencies(pkg, dest, binLoc);
  42037. }
  42038. tickBin();
  42039. });
  42040. return function (_x17) {
  42041. return _ref28.apply(this, arguments);
  42042. };
  42043. }(), linkBinConcurrency);
  42044. }
  42045. for (var _iterator14 = flatTree, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) {
  42046. var _ref31;
  42047. if (_isArray14) {
  42048. if (_i14 >= _iterator14.length) break;
  42049. _ref31 = _iterator14[_i14++];
  42050. } else {
  42051. _i14 = _iterator14.next();
  42052. if (_i14.done) break;
  42053. _ref31 = _i14.value;
  42054. }
  42055. var _ref30 = _ref31;
  42056. var pkg = _ref30[1].pkg;
  42057. yield this._warnForMissingBundledDependencies(pkg);
  42058. }
  42059. });
  42060. function copyModules(_x12, _x13) {
  42061. return _ref13.apply(this, arguments);
  42062. }
  42063. return copyModules;
  42064. }();
  42065. PackageLinker.prototype._buildTreeHash = function _buildTreeHash(flatTree) {
  42066. var hash = new (_map || _load_map()).default();
  42067. for (var _iterator19 = flatTree, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator19);;) {
  42068. var _ref38;
  42069. if (_isArray19) {
  42070. if (_i19 >= _iterator19.length) break;
  42071. _ref38 = _iterator19[_i19++];
  42072. } else {
  42073. _i19 = _iterator19.next();
  42074. if (_i19.done) break;
  42075. _ref38 = _i19.value;
  42076. }
  42077. var _ref37 = _ref38;
  42078. var _dest = _ref37[0];
  42079. var hoistManifest = _ref37[1];
  42080. var key = hoistManifest.parts.join('#');
  42081. hash.set(key, [_dest, hoistManifest]);
  42082. }
  42083. this._treeHash = hash;
  42084. return hash;
  42085. };
  42086. PackageLinker.prototype.getParentBinLoc = function getParentBinLoc(parts, flatTree) {
  42087. var hash = this._treeHash || this._buildTreeHash(flatTree);
  42088. var parent = parts.slice(0, -1).join('#');
  42089. var tuple = hash.get(parent);
  42090. if (!tuple) {
  42091. throw new Error(`failed to get parent '${parent}' binLoc`);
  42092. }
  42093. var dest = tuple[0],
  42094. hoistManifest = tuple[1];
  42095. var parentBinLoc = path.join(dest, this.config.getFolder(hoistManifest.pkg));
  42096. return parentBinLoc;
  42097. };
  42098. PackageLinker.prototype.determineTopLevelBinLinkOrder = function determineTopLevelBinLinkOrder(flatTree) {
  42099. var linksToCreate = new (_map || _load_map()).default();
  42100. for (var _iterator20 = flatTree, _isArray20 = Array.isArray(_iterator20), _i20 = 0, _iterator20 = _isArray20 ? _iterator20 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator20);;) {
  42101. var _ref40;
  42102. if (_isArray20) {
  42103. if (_i20 >= _iterator20.length) break;
  42104. _ref40 = _iterator20[_i20++];
  42105. } else {
  42106. _i20 = _iterator20.next();
  42107. if (_i20.done) break;
  42108. _ref40 = _i20.value;
  42109. }
  42110. var _ref39 = _ref40;
  42111. var _dest2 = _ref39[0];
  42112. var hoistManifest = _ref39[1];
  42113. var pkg = hoistManifest.pkg,
  42114. isDirectRequire = hoistManifest.isDirectRequire,
  42115. isNohoist = hoistManifest.isNohoist,
  42116. isShallow = hoistManifest.isShallow;
  42117. var name = pkg.name;
  42118. // nohoist and shallow packages should not be linked at topLevel bin
  42119. if (!isNohoist && !isShallow && (isDirectRequire || this.topLevelBinLinking && !linksToCreate.has(name))) {
  42120. linksToCreate.set(name, [_dest2, hoistManifest]);
  42121. }
  42122. }
  42123. // Sort the array so that direct dependencies will be linked last.
  42124. // Bin links are overwritten if they already exist, so this will cause direct deps to take precedence.
  42125. // If someone finds this to be incorrect later, you could also consider sorting descending by
  42126. // `linkToCreate.level` which is the dependency tree depth. Direct deps will have level 0 and transitive
  42127. // deps will have level > 0.
  42128. var transientBins = [];
  42129. var topLevelBins = [];
  42130. for (var _iterator21 = (0, (_from || _load_from()).default)(linksToCreate.values()), _isArray21 = Array.isArray(_iterator21), _i21 = 0, _iterator21 = _isArray21 ? _iterator21 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator21);;) {
  42131. var _ref41;
  42132. if (_isArray21) {
  42133. if (_i21 >= _iterator21.length) break;
  42134. _ref41 = _iterator21[_i21++];
  42135. } else {
  42136. _i21 = _iterator21.next();
  42137. if (_i21.done) break;
  42138. _ref41 = _i21.value;
  42139. }
  42140. var linkToCreate = _ref41;
  42141. if (linkToCreate[1].isDirectRequire) {
  42142. topLevelBins.push(linkToCreate);
  42143. } else {
  42144. transientBins.push(linkToCreate);
  42145. }
  42146. }
  42147. return [].concat(transientBins, topLevelBins);
  42148. };
  42149. PackageLinker.prototype.resolvePeerModules = function resolvePeerModules() {
  42150. var _this3 = this;
  42151. var _loop3 = function _loop3(pkg) {
  42152. var peerDeps = pkg.peerDependencies;
  42153. var peerDepsMeta = pkg.peerDependenciesMeta;
  42154. if (!peerDeps) {
  42155. return 'continue';
  42156. }
  42157. var ref = pkg._reference;
  42158. invariant(ref, 'Package reference is missing');
  42159. // TODO: We are taking the "shortest" ref tree but there may be multiple ref trees with the same length
  42160. var refTree = ref.requests.map(function (req) {
  42161. return req.parentNames;
  42162. }).sort(function (arr1, arr2) {
  42163. return arr1.length - arr2.length;
  42164. })[0];
  42165. var getLevelDistance = function getLevelDistance(pkgRef) {
  42166. var minDistance = Infinity;
  42167. for (var _iterator23 = pkgRef.requests, _isArray23 = Array.isArray(_iterator23), _i23 = 0, _iterator23 = _isArray23 ? _iterator23 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator23);;) {
  42168. var _ref43;
  42169. if (_isArray23) {
  42170. if (_i23 >= _iterator23.length) break;
  42171. _ref43 = _iterator23[_i23++];
  42172. } else {
  42173. _i23 = _iterator23.next();
  42174. if (_i23.done) break;
  42175. _ref43 = _i23.value;
  42176. }
  42177. var req = _ref43;
  42178. var distance = refTree.length - req.parentNames.length;
  42179. if (distance >= 0 && distance < minDistance && req.parentNames.every(function (name, idx) {
  42180. return name === refTree[idx];
  42181. })) {
  42182. minDistance = distance;
  42183. }
  42184. }
  42185. return minDistance;
  42186. };
  42187. for (var peerDepName in peerDeps) {
  42188. var range = peerDeps[peerDepName];
  42189. var meta = peerDepsMeta && peerDepsMeta[peerDepName];
  42190. var isOptional = !!(meta && meta.optional);
  42191. var peerPkgs = _this3.resolver.getAllInfoForPackageName(peerDepName);
  42192. var peerError = 'unmetPeer';
  42193. var resolvedLevelDistance = Infinity;
  42194. var resolvedPeerPkg = void 0;
  42195. for (var _iterator24 = peerPkgs, _isArray24 = Array.isArray(_iterator24), _i24 = 0, _iterator24 = _isArray24 ? _iterator24 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator24);;) {
  42196. var _ref44;
  42197. if (_isArray24) {
  42198. if (_i24 >= _iterator24.length) break;
  42199. _ref44 = _iterator24[_i24++];
  42200. } else {
  42201. _i24 = _iterator24.next();
  42202. if (_i24.done) break;
  42203. _ref44 = _i24.value;
  42204. }
  42205. var peerPkg = _ref44;
  42206. var peerPkgRef = peerPkg._reference;
  42207. if (!(peerPkgRef && peerPkgRef.patterns)) {
  42208. continue;
  42209. }
  42210. var levelDistance = getLevelDistance(peerPkgRef);
  42211. if (isFinite(levelDistance) && levelDistance < resolvedLevelDistance) {
  42212. if (_this3._satisfiesPeerDependency(range, peerPkgRef.version)) {
  42213. resolvedLevelDistance = levelDistance;
  42214. resolvedPeerPkg = peerPkgRef;
  42215. } else {
  42216. peerError = 'incorrectPeer';
  42217. }
  42218. }
  42219. }
  42220. if (resolvedPeerPkg) {
  42221. ref.addDependencies(resolvedPeerPkg.patterns);
  42222. _this3.reporter.verbose(_this3.reporter.lang('selectedPeer', `${pkg.name}@${pkg.version}`, `${peerDepName}@${resolvedPeerPkg.version}`, resolvedPeerPkg.level));
  42223. } else if (!isOptional) {
  42224. _this3.reporter.warn(_this3.reporter.lang(peerError, `${refTree.join(' > ')} > ${pkg.name}@${pkg.version}`, `${peerDepName}@${range}`));
  42225. }
  42226. }
  42227. };
  42228. for (var _iterator22 = this.resolver.getManifests(), _isArray22 = Array.isArray(_iterator22), _i22 = 0, _iterator22 = _isArray22 ? _iterator22 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator22);;) {
  42229. var _ref42;
  42230. if (_isArray22) {
  42231. if (_i22 >= _iterator22.length) break;
  42232. _ref42 = _iterator22[_i22++];
  42233. } else {
  42234. _i22 = _iterator22.next();
  42235. if (_i22.done) break;
  42236. _ref42 = _i22.value;
  42237. }
  42238. var pkg = _ref42;
  42239. var _ret3 = _loop3(pkg);
  42240. if (_ret3 === 'continue') continue;
  42241. }
  42242. };
  42243. PackageLinker.prototype._satisfiesPeerDependency = function _satisfiesPeerDependency(range, version) {
  42244. return range === '*' || (0, (_semver || _load_semver()).satisfiesWithPrereleases)(version, range, this.config.looseSemver);
  42245. };
  42246. PackageLinker.prototype._warnForMissingBundledDependencies = function () {
  42247. var _ref45 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg) {
  42248. var _this4 = this;
  42249. var ref = pkg._reference;
  42250. invariant(ref, 'missing package ref ' + pkg.name);
  42251. if (pkg.bundleDependencies) {
  42252. var _loop4 = function* _loop4(depName) {
  42253. var locs = ref.locations.map(function (loc) {
  42254. return path.join(loc, _this4.config.getFolder(pkg), depName);
  42255. });
  42256. var locsExist = yield (_promise || _load_promise()).default.all(locs.map(function (loc) {
  42257. return (_fs || _load_fs()).exists(loc);
  42258. }));
  42259. if (locsExist.some(function (e) {
  42260. return !e;
  42261. })) {
  42262. //if any of the locs do not exist
  42263. var pkgHuman = `${pkg.name}@${pkg.version}`;
  42264. _this4.reporter.warn(_this4.reporter.lang('missingBundledDependency', pkgHuman, depName));
  42265. }
  42266. };
  42267. for (var _iterator25 = pkg.bundleDependencies, _isArray25 = Array.isArray(_iterator25), _i25 = 0, _iterator25 = _isArray25 ? _iterator25 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator25);;) {
  42268. var _ref46;
  42269. if (_isArray25) {
  42270. if (_i25 >= _iterator25.length) break;
  42271. _ref46 = _iterator25[_i25++];
  42272. } else {
  42273. _i25 = _iterator25.next();
  42274. if (_i25.done) break;
  42275. _ref46 = _i25.value;
  42276. }
  42277. var depName = _ref46;
  42278. yield* _loop4(depName);
  42279. }
  42280. }
  42281. });
  42282. function _warnForMissingBundledDependencies(_x18) {
  42283. return _ref45.apply(this, arguments);
  42284. }
  42285. return _warnForMissingBundledDependencies;
  42286. }();
  42287. PackageLinker.prototype._isUnplugged = function () {
  42288. var _ref47 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, ref) {
  42289. // If an unplugged folder exists for the specified package, we simply use it
  42290. if (yield (_fs || _load_fs()).exists(this.config.generatePackageUnpluggedPath(ref))) {
  42291. return true;
  42292. }
  42293. // If the package has a postinstall script, we also unplug it (otherwise they would run into the cache)
  42294. if (!this.config.ignoreScripts && pkg.scripts && (pkg.scripts.preinstall || pkg.scripts.install || pkg.scripts.postinstall)) {
  42295. return true;
  42296. }
  42297. // Check whether the user explicitly requested for the package to be unplugged
  42298. return this.unplugged.some(function (patternToUnplug) {
  42299. var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(patternToUnplug),
  42300. name = _normalizePattern.name,
  42301. range = _normalizePattern.range,
  42302. hasVersion = _normalizePattern.hasVersion;
  42303. var satisfiesSemver = hasVersion ? semver.satisfies(ref.version, range) : true;
  42304. return name === ref.name && satisfiesSemver;
  42305. });
  42306. });
  42307. function _isUnplugged(_x19, _x20) {
  42308. return _ref47.apply(this, arguments);
  42309. }
  42310. return _isUnplugged;
  42311. }();
  42312. PackageLinker.prototype.init = function () {
  42313. var _ref48 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) {
  42314. var _ref49 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  42315. linkDuplicates = _ref49.linkDuplicates,
  42316. ignoreOptional = _ref49.ignoreOptional;
  42317. this.resolvePeerModules();
  42318. yield this.copyModules(patterns, workspaceLayout, { linkDuplicates, ignoreOptional });
  42319. if (!this.config.plugnplayEnabled) {
  42320. yield (_fs || _load_fs()).unlink(`${this.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`);
  42321. }
  42322. });
  42323. function init(_x21, _x22) {
  42324. return _ref48.apply(this, arguments);
  42325. }
  42326. return init;
  42327. }();
  42328. return PackageLinker;
  42329. }();
  42330. exports.default = PackageLinker;
  42331. /***/ }),
  42332. /* 199 */
  42333. /***/ (function(module, exports, __webpack_require__) {
  42334. "use strict";
  42335. Object.defineProperty(exports, "__esModule", {
  42336. value: true
  42337. });
  42338. exports.clearLine = clearLine;
  42339. exports.toStartOfLine = toStartOfLine;
  42340. exports.writeOnNthLine = writeOnNthLine;
  42341. exports.clearNthLine = clearNthLine;
  42342. var _tty;
  42343. function _load_tty() {
  42344. return _tty = _interopRequireDefault(__webpack_require__(149));
  42345. }
  42346. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  42347. var readline = __webpack_require__(187);
  42348. var _require = __webpack_require__(33),
  42349. supportsColor = _require.supportsColor;
  42350. var CLEAR_WHOLE_LINE = 0;
  42351. var CLEAR_RIGHT_OF_CURSOR = 1;
  42352. function clearLine(stdout) {
  42353. if (!supportsColor) {
  42354. if (stdout instanceof (_tty || _load_tty()).default.WriteStream) {
  42355. if (stdout.columns > 0) {
  42356. stdout.write(`\r${' '.repeat(stdout.columns - 1)}`);
  42357. }
  42358. stdout.write(`\r`);
  42359. }
  42360. return;
  42361. }
  42362. readline.clearLine(stdout, CLEAR_WHOLE_LINE);
  42363. readline.cursorTo(stdout, 0);
  42364. }
  42365. function toStartOfLine(stdout) {
  42366. if (!supportsColor) {
  42367. stdout.write('\r');
  42368. return;
  42369. }
  42370. readline.cursorTo(stdout, 0);
  42371. }
  42372. function writeOnNthLine(stdout, n, msg) {
  42373. if (!supportsColor) {
  42374. return;
  42375. }
  42376. if (n == 0) {
  42377. readline.cursorTo(stdout, 0);
  42378. stdout.write(msg);
  42379. readline.clearLine(stdout, CLEAR_RIGHT_OF_CURSOR);
  42380. return;
  42381. }
  42382. readline.cursorTo(stdout, 0);
  42383. readline.moveCursor(stdout, 0, -n);
  42384. stdout.write(msg);
  42385. readline.clearLine(stdout, CLEAR_RIGHT_OF_CURSOR);
  42386. readline.cursorTo(stdout, 0);
  42387. readline.moveCursor(stdout, 0, n);
  42388. }
  42389. function clearNthLine(stdout, n) {
  42390. if (!supportsColor) {
  42391. return;
  42392. }
  42393. if (n == 0) {
  42394. clearLine(stdout);
  42395. return;
  42396. }
  42397. readline.cursorTo(stdout, 0);
  42398. readline.moveCursor(stdout, 0, -n);
  42399. readline.clearLine(stdout, CLEAR_WHOLE_LINE);
  42400. readline.moveCursor(stdout, 0, n);
  42401. }
  42402. /***/ }),
  42403. /* 200 */
  42404. /***/ (function(module, exports, __webpack_require__) {
  42405. "use strict";
  42406. Object.defineProperty(exports, "__esModule", {
  42407. value: true
  42408. });
  42409. var _extends2;
  42410. function _load_extends() {
  42411. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  42412. }
  42413. var _stringify;
  42414. function _load_stringify() {
  42415. return _stringify = _interopRequireDefault(__webpack_require__(37));
  42416. }
  42417. var _classCallCheck2;
  42418. function _load_classCallCheck() {
  42419. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  42420. }
  42421. var _possibleConstructorReturn2;
  42422. function _load_possibleConstructorReturn() {
  42423. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  42424. }
  42425. var _inherits2;
  42426. function _load_inherits() {
  42427. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  42428. }
  42429. var _baseReporter;
  42430. function _load_baseReporter() {
  42431. return _baseReporter = _interopRequireDefault(__webpack_require__(98));
  42432. }
  42433. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  42434. var JSONReporter = function (_BaseReporter) {
  42435. (0, (_inherits2 || _load_inherits()).default)(JSONReporter, _BaseReporter);
  42436. function JSONReporter(opts) {
  42437. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, JSONReporter);
  42438. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseReporter.call(this, opts));
  42439. _this._activityId = 0;
  42440. _this._progressId = 0;
  42441. return _this;
  42442. }
  42443. JSONReporter.prototype._dump = function _dump(type, data, error) {
  42444. var stdout = this.stdout;
  42445. if (error) {
  42446. stdout = this.stderr;
  42447. }
  42448. stdout.write(`${(0, (_stringify || _load_stringify()).default)({ type, data })}\n`);
  42449. };
  42450. JSONReporter.prototype._verbose = function _verbose(msg) {
  42451. this._dump('verbose', msg);
  42452. };
  42453. JSONReporter.prototype.list = function list(type, items, hints) {
  42454. this._dump('list', { type, items, hints });
  42455. };
  42456. JSONReporter.prototype.tree = function tree(type, trees) {
  42457. this._dump('tree', { type, trees });
  42458. };
  42459. JSONReporter.prototype.step = function step(current, total, message) {
  42460. this._dump('step', { message, current, total });
  42461. };
  42462. JSONReporter.prototype.inspect = function inspect(value) {
  42463. this._dump('inspect', value);
  42464. };
  42465. JSONReporter.prototype.footer = function footer(showPeakMemory) {
  42466. this._dump('finished', this.getTotalTime());
  42467. };
  42468. JSONReporter.prototype.log = function log(msg) {
  42469. this._dump('log', msg);
  42470. };
  42471. JSONReporter.prototype.command = function command(msg) {
  42472. this._dump('command', msg);
  42473. };
  42474. JSONReporter.prototype.table = function table(head, body) {
  42475. this._dump('table', { head, body });
  42476. };
  42477. JSONReporter.prototype.success = function success(msg) {
  42478. this._dump('success', msg);
  42479. };
  42480. JSONReporter.prototype.error = function error(msg) {
  42481. this._dump('error', msg, true);
  42482. };
  42483. JSONReporter.prototype.warn = function warn(msg) {
  42484. this._dump('warning', msg, true);
  42485. };
  42486. JSONReporter.prototype.info = function info(msg) {
  42487. this._dump('info', msg);
  42488. };
  42489. JSONReporter.prototype.activitySet = function activitySet(total, workers) {
  42490. var _this2 = this;
  42491. if (!this.isTTY || this.noProgress) {
  42492. return _BaseReporter.prototype.activitySet.call(this, total, workers);
  42493. }
  42494. var id = this._activityId++;
  42495. this._dump('activitySetStart', { id, total, workers });
  42496. var spinners = [];
  42497. var _loop = function _loop(i) {
  42498. var current = 0;
  42499. var header = '';
  42500. spinners.push({
  42501. clear() {},
  42502. setPrefix(_current, _header) {
  42503. current = _current;
  42504. header = _header;
  42505. },
  42506. tick: function tick(msg) {
  42507. _this2._dump('activitySetTick', {
  42508. id,
  42509. header,
  42510. current,
  42511. worker: i,
  42512. message: msg
  42513. });
  42514. },
  42515. end() {}
  42516. });
  42517. };
  42518. for (var i = 0; i < workers; i++) {
  42519. _loop(i);
  42520. }
  42521. return {
  42522. spinners,
  42523. end: function end() {
  42524. _this2._dump('activitySetEnd', { id });
  42525. }
  42526. };
  42527. };
  42528. JSONReporter.prototype.activity = function activity() {
  42529. return this._activity({});
  42530. };
  42531. JSONReporter.prototype._activity = function _activity(data) {
  42532. var _this3 = this;
  42533. if (!this.isTTY || this.noProgress) {
  42534. return {
  42535. tick() {},
  42536. end() {}
  42537. };
  42538. }
  42539. var id = this._activityId++;
  42540. this._dump('activityStart', (0, (_extends2 || _load_extends()).default)({ id }, data));
  42541. return {
  42542. tick: function tick(name) {
  42543. _this3._dump('activityTick', { id, name });
  42544. },
  42545. end: function end() {
  42546. _this3._dump('activityEnd', { id });
  42547. }
  42548. };
  42549. };
  42550. JSONReporter.prototype.progress = function progress(total) {
  42551. var _this4 = this;
  42552. if (this.noProgress) {
  42553. return function () {
  42554. // noop
  42555. };
  42556. }
  42557. var id = this._progressId++;
  42558. var current = 0;
  42559. this._dump('progressStart', { id, total });
  42560. return function () {
  42561. current++;
  42562. _this4._dump('progressTick', { id, current });
  42563. if (current === total) {
  42564. _this4._dump('progressFinish', { id });
  42565. }
  42566. };
  42567. };
  42568. JSONReporter.prototype.auditAction = function auditAction(recommendation) {
  42569. this._dump('auditAction', recommendation);
  42570. };
  42571. JSONReporter.prototype.auditAdvisory = function auditAdvisory(resolution, _auditAdvisory) {
  42572. this._dump('auditAdvisory', { resolution, advisory: _auditAdvisory });
  42573. };
  42574. JSONReporter.prototype.auditSummary = function auditSummary(auditMetadata) {
  42575. this._dump('auditSummary', auditMetadata);
  42576. };
  42577. return JSONReporter;
  42578. }((_baseReporter || _load_baseReporter()).default);
  42579. exports.default = JSONReporter;
  42580. /***/ }),
  42581. /* 201 */
  42582. /***/ (function(module, exports, __webpack_require__) {
  42583. "use strict";
  42584. Object.defineProperty(exports, "__esModule", {
  42585. value: true
  42586. });
  42587. exports.shouldUpdateLockfile = undefined;
  42588. var _set;
  42589. function _load_set() {
  42590. return _set = _interopRequireDefault(__webpack_require__(16));
  42591. }
  42592. var _classCallCheck2;
  42593. function _load_classCallCheck() {
  42594. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  42595. }
  42596. var _semver;
  42597. function _load_semver() {
  42598. return _semver = _interopRequireDefault(__webpack_require__(27));
  42599. }
  42600. var _minimatch;
  42601. function _load_minimatch() {
  42602. return _minimatch = _interopRequireDefault(__webpack_require__(170));
  42603. }
  42604. var _map;
  42605. function _load_map() {
  42606. return _map = _interopRequireDefault(__webpack_require__(51));
  42607. }
  42608. var _normalizePattern2;
  42609. function _load_normalizePattern() {
  42610. return _normalizePattern2 = __webpack_require__(52);
  42611. }
  42612. var _parsePackagePath;
  42613. function _load_parsePackagePath() {
  42614. return _parsePackagePath = _interopRequireDefault(__webpack_require__(313));
  42615. }
  42616. var _parsePackagePath2;
  42617. function _load_parsePackagePath2() {
  42618. return _parsePackagePath2 = __webpack_require__(313);
  42619. }
  42620. var _resolvers;
  42621. function _load_resolvers() {
  42622. return _resolvers = __webpack_require__(75);
  42623. }
  42624. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  42625. var DIRECTORY_SEPARATOR = '/';
  42626. var GLOBAL_NESTED_DEP_PATTERN = '**/';
  42627. var ResolutionMap = function () {
  42628. function ResolutionMap(config) {
  42629. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ResolutionMap);
  42630. this.resolutionsByPackage = (0, (_map || _load_map()).default)();
  42631. this.config = config;
  42632. this.reporter = config.reporter;
  42633. this.delayQueue = new (_set || _load_set()).default();
  42634. }
  42635. ResolutionMap.prototype.init = function init() {
  42636. var resolutions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  42637. for (var _globPattern in resolutions) {
  42638. var info = this.parsePatternInfo(_globPattern, resolutions[_globPattern]);
  42639. if (info) {
  42640. var resolution = this.resolutionsByPackage[info.name] || [];
  42641. this.resolutionsByPackage[info.name] = [].concat(resolution, [info]);
  42642. }
  42643. }
  42644. };
  42645. ResolutionMap.prototype.addToDelayQueue = function addToDelayQueue(req) {
  42646. this.delayQueue.add(req);
  42647. };
  42648. ResolutionMap.prototype.parsePatternInfo = function parsePatternInfo(globPattern, range) {
  42649. if (!(0, (_parsePackagePath2 || _load_parsePackagePath2()).isValidPackagePath)(globPattern)) {
  42650. this.reporter.warn(this.reporter.lang('invalidResolutionName', globPattern));
  42651. return null;
  42652. }
  42653. var directories = (0, (_parsePackagePath || _load_parsePackagePath()).default)(globPattern);
  42654. var name = directories.pop();
  42655. if (!(_semver || _load_semver()).default.validRange(range) && !(0, (_resolvers || _load_resolvers()).getExoticResolver)(range)) {
  42656. this.reporter.warn(this.reporter.lang('invalidResolutionVersion', range));
  42657. return null;
  42658. }
  42659. // For legacy support of resolutions, replace `name` with `**/name`
  42660. if (name === globPattern) {
  42661. globPattern = `${GLOBAL_NESTED_DEP_PATTERN}${name}`;
  42662. }
  42663. return {
  42664. name,
  42665. range,
  42666. globPattern,
  42667. pattern: `${name}@${range}`
  42668. };
  42669. };
  42670. ResolutionMap.prototype.find = function find(reqPattern, parentNames) {
  42671. var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(reqPattern),
  42672. name = _normalizePattern.name,
  42673. reqRange = _normalizePattern.range;
  42674. var resolutions = this.resolutionsByPackage[name];
  42675. if (!resolutions) {
  42676. return '';
  42677. }
  42678. var modulePath = [].concat(parentNames, [name]).join(DIRECTORY_SEPARATOR);
  42679. var _ref = resolutions.find(function (_ref2) {
  42680. var globPattern = _ref2.globPattern;
  42681. return (0, (_minimatch || _load_minimatch()).default)(modulePath, globPattern);
  42682. }) || {},
  42683. pattern = _ref.pattern,
  42684. range = _ref.range;
  42685. if (pattern) {
  42686. if ((_semver || _load_semver()).default.validRange(reqRange) && (_semver || _load_semver()).default.valid(range) && !(_semver || _load_semver()).default.satisfies(range, reqRange)) {
  42687. this.reporter.warn(this.reporter.lang('incompatibleResolutionVersion', pattern, reqPattern));
  42688. }
  42689. }
  42690. return pattern;
  42691. };
  42692. return ResolutionMap;
  42693. }();
  42694. exports.default = ResolutionMap;
  42695. var shouldUpdateLockfile = exports.shouldUpdateLockfile = function shouldUpdateLockfile(lockfileEntry, resolutionEntry) {
  42696. if (!lockfileEntry || !resolutionEntry) {
  42697. return false;
  42698. }
  42699. return lockfileEntry.resolved !== resolutionEntry.remote.resolved;
  42700. };
  42701. /***/ }),
  42702. /* 202 */
  42703. /***/ (function(module, exports, __webpack_require__) {
  42704. "use strict";
  42705. Object.defineProperty(exports, "__esModule", {
  42706. value: true
  42707. });
  42708. exports.FILE_PROTOCOL_PREFIX = undefined;
  42709. var _asyncToGenerator2;
  42710. function _load_asyncToGenerator() {
  42711. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  42712. }
  42713. var _classCallCheck2;
  42714. function _load_classCallCheck() {
  42715. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  42716. }
  42717. var _possibleConstructorReturn2;
  42718. function _load_possibleConstructorReturn() {
  42719. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  42720. }
  42721. var _inherits2;
  42722. function _load_inherits() {
  42723. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  42724. }
  42725. var _path;
  42726. function _load_path() {
  42727. return _path = _interopRequireDefault(__webpack_require__(1));
  42728. }
  42729. var _invariant;
  42730. function _load_invariant() {
  42731. return _invariant = _interopRequireDefault(__webpack_require__(15));
  42732. }
  42733. var _uuid;
  42734. function _load_uuid() {
  42735. return _uuid = _interopRequireDefault(__webpack_require__(114));
  42736. }
  42737. var _errors;
  42738. function _load_errors() {
  42739. return _errors = __webpack_require__(6);
  42740. }
  42741. var _exoticResolver;
  42742. function _load_exoticResolver() {
  42743. return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
  42744. }
  42745. var _misc;
  42746. function _load_misc() {
  42747. return _misc = _interopRequireWildcard(__webpack_require__(28));
  42748. }
  42749. var _fs;
  42750. function _load_fs() {
  42751. return _fs = _interopRequireWildcard(__webpack_require__(8));
  42752. }
  42753. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  42754. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  42755. var FILE_PROTOCOL_PREFIX = exports.FILE_PROTOCOL_PREFIX = 'file:';
  42756. var FileResolver = function (_ExoticResolver) {
  42757. (0, (_inherits2 || _load_inherits()).default)(FileResolver, _ExoticResolver);
  42758. function FileResolver(request, fragment) {
  42759. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, FileResolver);
  42760. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
  42761. _this.loc = (_misc || _load_misc()).removePrefix(fragment, FILE_PROTOCOL_PREFIX);
  42762. return _this;
  42763. }
  42764. FileResolver.isVersion = function isVersion(pattern) {
  42765. return _ExoticResolver.isVersion.call(this, pattern) || this.prefixMatcher.test(pattern) || (_path || _load_path()).default.isAbsolute(pattern);
  42766. };
  42767. FileResolver.prototype.resolve = function () {
  42768. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  42769. var _this2 = this;
  42770. var loc = this.loc;
  42771. if (!(_path || _load_path()).default.isAbsolute(loc)) {
  42772. loc = (_path || _load_path()).default.resolve(this.config.lockfileFolder, loc);
  42773. }
  42774. if (this.config.linkFileDependencies) {
  42775. var _registry = 'npm';
  42776. var _manifest = { _uid: '', name: '', version: '0.0.0', _registry: _registry };
  42777. _manifest._remote = {
  42778. type: 'link',
  42779. registry: _registry,
  42780. hash: null,
  42781. reference: loc
  42782. };
  42783. _manifest._uid = _manifest.version;
  42784. return _manifest;
  42785. }
  42786. if (!(yield (_fs || _load_fs()).exists(loc))) {
  42787. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('doesntExist', loc, this.pattern.split('@')[0]));
  42788. }
  42789. var manifest = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  42790. try {
  42791. return yield _this2.config.readManifest(loc, _this2.registry);
  42792. } catch (e) {
  42793. if (e.code === 'ENOENT') {
  42794. return {
  42795. // This is just the default, it can be overridden with key of dependencies
  42796. name: (_path || _load_path()).default.dirname(loc),
  42797. version: '0.0.0',
  42798. _uid: '0.0.0',
  42799. _registry: 'npm'
  42800. };
  42801. }
  42802. throw e;
  42803. }
  42804. })();
  42805. var registry = manifest._registry;
  42806. (0, (_invariant || _load_invariant()).default)(registry, 'expected registry');
  42807. manifest._remote = {
  42808. type: 'copy',
  42809. registry,
  42810. hash: `${(_uuid || _load_uuid()).default.v4()}-${new Date().getTime()}`,
  42811. reference: loc
  42812. };
  42813. manifest._uid = manifest.version;
  42814. return manifest;
  42815. });
  42816. function resolve() {
  42817. return _ref.apply(this, arguments);
  42818. }
  42819. return resolve;
  42820. }();
  42821. return FileResolver;
  42822. }((_exoticResolver || _load_exoticResolver()).default);
  42823. FileResolver.protocol = 'file';
  42824. FileResolver.prefixMatcher = /^\.{1,2}\//;
  42825. exports.default = FileResolver;
  42826. /***/ }),
  42827. /* 203 */
  42828. /***/ (function(module, exports, __webpack_require__) {
  42829. "use strict";
  42830. Object.defineProperty(exports, "__esModule", {
  42831. value: true
  42832. });
  42833. var _classCallCheck2;
  42834. function _load_classCallCheck() {
  42835. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  42836. }
  42837. var _possibleConstructorReturn2;
  42838. function _load_possibleConstructorReturn() {
  42839. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  42840. }
  42841. var _inherits2;
  42842. function _load_inherits() {
  42843. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  42844. }
  42845. exports.explodeGistFragment = explodeGistFragment;
  42846. var _errors;
  42847. function _load_errors() {
  42848. return _errors = __webpack_require__(6);
  42849. }
  42850. var _gitResolver;
  42851. function _load_gitResolver() {
  42852. return _gitResolver = _interopRequireDefault(__webpack_require__(119));
  42853. }
  42854. var _exoticResolver;
  42855. function _load_exoticResolver() {
  42856. return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
  42857. }
  42858. var _misc;
  42859. function _load_misc() {
  42860. return _misc = _interopRequireWildcard(__webpack_require__(28));
  42861. }
  42862. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  42863. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  42864. function explodeGistFragment(fragment, reporter) {
  42865. fragment = (_misc || _load_misc()).removePrefix(fragment, 'gist:');
  42866. var parts = fragment.split('#');
  42867. if (parts.length <= 2) {
  42868. return {
  42869. id: parts[0],
  42870. hash: parts[1] || ''
  42871. };
  42872. } else {
  42873. throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidGistFragment', fragment));
  42874. }
  42875. }
  42876. var GistResolver = function (_ExoticResolver) {
  42877. (0, (_inherits2 || _load_inherits()).default)(GistResolver, _ExoticResolver);
  42878. function GistResolver(request, fragment) {
  42879. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GistResolver);
  42880. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
  42881. var _explodeGistFragment = explodeGistFragment(fragment, _this.reporter),
  42882. id = _explodeGistFragment.id,
  42883. hash = _explodeGistFragment.hash;
  42884. _this.id = id;
  42885. _this.hash = hash;
  42886. return _this;
  42887. }
  42888. GistResolver.prototype.resolve = function resolve() {
  42889. return this.fork((_gitResolver || _load_gitResolver()).default, false, `https://gist.github.com/${this.id}.git#${this.hash}`);
  42890. };
  42891. return GistResolver;
  42892. }((_exoticResolver || _load_exoticResolver()).default);
  42893. GistResolver.protocol = 'gist';
  42894. exports.default = GistResolver;
  42895. /***/ }),
  42896. /* 204 */
  42897. /***/ (function(module, exports, __webpack_require__) {
  42898. "use strict";
  42899. Object.defineProperty(exports, "__esModule", {
  42900. value: true
  42901. });
  42902. var _assign;
  42903. function _load_assign() {
  42904. return _assign = _interopRequireDefault(__webpack_require__(23));
  42905. }
  42906. var _getIterator2;
  42907. function _load_getIterator() {
  42908. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  42909. }
  42910. var _keys;
  42911. function _load_keys() {
  42912. return _keys = _interopRequireDefault(__webpack_require__(14));
  42913. }
  42914. var _asyncToGenerator2;
  42915. function _load_asyncToGenerator() {
  42916. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  42917. }
  42918. var _classCallCheck2;
  42919. function _load_classCallCheck() {
  42920. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  42921. }
  42922. var _possibleConstructorReturn2;
  42923. function _load_possibleConstructorReturn() {
  42924. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  42925. }
  42926. var _inherits2;
  42927. function _load_inherits() {
  42928. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  42929. }
  42930. var _cache;
  42931. function _load_cache() {
  42932. return _cache = __webpack_require__(291);
  42933. }
  42934. var _errors;
  42935. function _load_errors() {
  42936. return _errors = __webpack_require__(6);
  42937. }
  42938. var _registryResolver;
  42939. function _load_registryResolver() {
  42940. return _registryResolver = _interopRequireDefault(__webpack_require__(531));
  42941. }
  42942. var _npmRegistry;
  42943. function _load_npmRegistry() {
  42944. return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
  42945. }
  42946. var _map;
  42947. function _load_map() {
  42948. return _map = _interopRequireDefault(__webpack_require__(51));
  42949. }
  42950. var _fs;
  42951. function _load_fs() {
  42952. return _fs = _interopRequireWildcard(__webpack_require__(8));
  42953. }
  42954. var _constants;
  42955. function _load_constants() {
  42956. return _constants = __webpack_require__(13);
  42957. }
  42958. var _packageNameUtils;
  42959. function _load_packageNameUtils() {
  42960. return _packageNameUtils = __webpack_require__(208);
  42961. }
  42962. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  42963. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  42964. var inquirer = __webpack_require__(193);
  42965. var tty = __webpack_require__(149);
  42966. var path = __webpack_require__(1);
  42967. var semver = __webpack_require__(27);
  42968. var ssri = __webpack_require__(93);
  42969. var NPM_REGISTRY_ID = 'npm';
  42970. var NpmResolver = function (_RegistryResolver) {
  42971. (0, (_inherits2 || _load_inherits()).default)(NpmResolver, _RegistryResolver);
  42972. function NpmResolver() {
  42973. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NpmResolver);
  42974. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _RegistryResolver.apply(this, arguments));
  42975. }
  42976. NpmResolver.findVersionInRegistryResponse = function () {
  42977. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, name, range, body, request) {
  42978. if (body.versions && (0, (_keys || _load_keys()).default)(body.versions).length === 0) {
  42979. throw new (_errors || _load_errors()).MessageError(config.reporter.lang('registryNoVersions', body.name));
  42980. }
  42981. if (!body['dist-tags'] || !body.versions) {
  42982. throw new (_errors || _load_errors()).MessageError(config.reporter.lang('malformedRegistryResponse', name));
  42983. }
  42984. if (range in body['dist-tags']) {
  42985. range = body['dist-tags'][range];
  42986. }
  42987. // If the latest tag in the registry satisfies the requested range, then use that.
  42988. // Otherwise we will fall back to semver maxSatisfying.
  42989. // This mimics logic in NPM. See issue #3560
  42990. var latestVersion = body['dist-tags'] ? body['dist-tags'].latest : undefined;
  42991. if (latestVersion && semver.satisfies(latestVersion, range)) {
  42992. return body.versions[latestVersion];
  42993. }
  42994. var satisfied = yield config.resolveConstraints((0, (_keys || _load_keys()).default)(body.versions), range);
  42995. if (satisfied) {
  42996. return body.versions[satisfied];
  42997. } else if (request && !config.nonInteractive) {
  42998. if (request.resolver && request.resolver.activity) {
  42999. request.resolver.activity.end();
  43000. }
  43001. config.reporter.log(config.reporter.lang('couldntFindVersionThatMatchesRange', body.name, range));
  43002. var pageSize = void 0;
  43003. if (process.stdout instanceof tty.WriteStream) {
  43004. pageSize = process.stdout.rows - 2;
  43005. }
  43006. var response = yield inquirer.prompt([{
  43007. name: 'package',
  43008. type: 'list',
  43009. message: config.reporter.lang('chooseVersionFromList', body.name),
  43010. choices: semver.rsort((0, (_keys || _load_keys()).default)(body.versions)),
  43011. pageSize
  43012. }]);
  43013. if (response && response.package) {
  43014. return body.versions[response.package];
  43015. }
  43016. }
  43017. throw new (_errors || _load_errors()).MessageError(config.reporter.lang('couldntFindVersionThatMatchesRange', body.name, range));
  43018. });
  43019. function findVersionInRegistryResponse(_x, _x2, _x3, _x4, _x5) {
  43020. return _ref.apply(this, arguments);
  43021. }
  43022. return findVersionInRegistryResponse;
  43023. }();
  43024. NpmResolver.prototype.resolveRequest = function () {
  43025. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (desiredVersion) {
  43026. if (this.config.offline) {
  43027. var res = yield this.resolveRequestOffline();
  43028. if (res != null) {
  43029. return res;
  43030. }
  43031. }
  43032. var escapedName = (_npmRegistry || _load_npmRegistry()).default.escapeName(this.name);
  43033. var desiredRange = desiredVersion || this.range;
  43034. var body = yield this.config.registries.npm.request(escapedName);
  43035. if (body) {
  43036. return NpmResolver.findVersionInRegistryResponse(this.config, escapedName, desiredRange, body, this.request);
  43037. } else {
  43038. return null;
  43039. }
  43040. });
  43041. function resolveRequest(_x6) {
  43042. return _ref2.apply(this, arguments);
  43043. }
  43044. return resolveRequest;
  43045. }();
  43046. NpmResolver.prototype.resolveRequestOffline = function () {
  43047. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  43048. var _this2 = this;
  43049. var packageDirs = yield this.config.getCache('cachedPackages', function () {
  43050. return (0, (_cache || _load_cache()).getCachedPackagesDirs)(_this2.config, _this2.config.cacheFolder);
  43051. });
  43052. var versions = (0, (_map || _load_map()).default)();
  43053. for (var _iterator = packageDirs, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  43054. var _ref4;
  43055. if (_isArray) {
  43056. if (_i >= _iterator.length) break;
  43057. _ref4 = _iterator[_i++];
  43058. } else {
  43059. _i = _iterator.next();
  43060. if (_i.done) break;
  43061. _ref4 = _i.value;
  43062. }
  43063. var dir = _ref4;
  43064. // check if folder contains the registry prefix
  43065. if (dir.indexOf(`${NPM_REGISTRY_ID}-`) === -1) {
  43066. continue;
  43067. }
  43068. // read manifest and validate correct name
  43069. var pkg = yield this.config.readManifest(dir, NPM_REGISTRY_ID);
  43070. if (pkg.name !== this.name) {
  43071. continue;
  43072. }
  43073. // read package metadata
  43074. var metadata = yield this.config.readPackageMetadata(dir);
  43075. if (!metadata.remote) {
  43076. continue; // old yarn metadata
  43077. }
  43078. versions[pkg.version] = (0, (_assign || _load_assign()).default)({}, pkg, {
  43079. _remote: metadata.remote
  43080. });
  43081. }
  43082. var satisfied = yield this.config.resolveConstraints((0, (_keys || _load_keys()).default)(versions), this.range);
  43083. if (satisfied) {
  43084. return versions[satisfied];
  43085. } else if (!this.config.preferOffline) {
  43086. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('couldntFindPackageInCache', this.name, this.range, (0, (_keys || _load_keys()).default)(versions).join(', ')));
  43087. } else {
  43088. return null;
  43089. }
  43090. });
  43091. function resolveRequestOffline() {
  43092. return _ref3.apply(this, arguments);
  43093. }
  43094. return resolveRequestOffline;
  43095. }();
  43096. NpmResolver.prototype.cleanRegistry = function cleanRegistry(url) {
  43097. if (this.config.getOption('registry') === (_constants || _load_constants()).YARN_REGISTRY) {
  43098. return url.replace((_constants || _load_constants()).NPM_REGISTRY_RE, (_constants || _load_constants()).YARN_REGISTRY);
  43099. } else {
  43100. return url;
  43101. }
  43102. };
  43103. NpmResolver.prototype.resolve = function () {
  43104. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  43105. // lockfile
  43106. var shrunk = this.request.getLocked('tarball');
  43107. if (shrunk) {
  43108. if (this.config.packBuiltPackages && shrunk.prebuiltVariants && shrunk._remote) {
  43109. var prebuiltVariants = shrunk.prebuiltVariants;
  43110. var prebuiltName = (0, (_packageNameUtils || _load_packageNameUtils()).getPlatformSpecificPackageFilename)(shrunk);
  43111. var offlineMirrorPath = this.config.getOfflineMirrorPath();
  43112. if (prebuiltVariants[prebuiltName] && offlineMirrorPath) {
  43113. var filename = path.join(offlineMirrorPath, 'prebuilt', prebuiltName + '.tgz');
  43114. var _remote = shrunk._remote;
  43115. if (_remote && (yield (_fs || _load_fs()).exists(filename))) {
  43116. _remote.reference = `file:${filename}`;
  43117. _remote.hash = prebuiltVariants[prebuiltName];
  43118. _remote.integrity = ssri.fromHex(_remote.hash, 'sha1').toString();
  43119. }
  43120. }
  43121. }
  43122. }
  43123. if (shrunk && shrunk._remote && (shrunk._remote.integrity || this.config.offline || !this.config.autoAddIntegrity)) {
  43124. // if the integrity field does not exist, we're not network-restricted, and the
  43125. // migration hasn't been disabled, it needs to be created
  43126. return shrunk;
  43127. }
  43128. var desiredVersion = shrunk && shrunk.version ? shrunk.version : null;
  43129. var info = yield this.resolveRequest(desiredVersion);
  43130. if (info == null) {
  43131. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('packageNotFoundRegistry', this.name, NPM_REGISTRY_ID));
  43132. }
  43133. var deprecated = info.deprecated,
  43134. dist = info.dist;
  43135. if (shrunk && shrunk._remote) {
  43136. shrunk._remote.integrity = dist && dist.integrity ? ssri.parse(dist.integrity) : ssri.fromHex(dist && dist.shasum ? dist.shasum : '', 'sha1');
  43137. return shrunk;
  43138. }
  43139. if (typeof deprecated === 'string') {
  43140. var human = `${info.name}@${info.version}`;
  43141. var parentNames = this.request.parentNames;
  43142. if (parentNames.length) {
  43143. human = parentNames.concat(human).join(' > ');
  43144. }
  43145. this.reporter.warn(`${human}: ${deprecated}`);
  43146. }
  43147. if (dist != null && dist.tarball) {
  43148. info._remote = {
  43149. resolved: `${this.cleanRegistry(dist.tarball)}#${dist.shasum}`,
  43150. type: 'tarball',
  43151. reference: this.cleanRegistry(dist.tarball),
  43152. hash: dist.shasum,
  43153. integrity: dist.integrity ? ssri.parse(dist.integrity) : ssri.fromHex(dist.shasum, 'sha1'),
  43154. registry: NPM_REGISTRY_ID,
  43155. packageName: info.name
  43156. };
  43157. }
  43158. info._uid = info.version;
  43159. return info;
  43160. });
  43161. function resolve() {
  43162. return _ref5.apply(this, arguments);
  43163. }
  43164. return resolve;
  43165. }();
  43166. return NpmResolver;
  43167. }((_registryResolver || _load_registryResolver()).default);
  43168. NpmResolver.registry = NPM_REGISTRY_ID;
  43169. exports.default = NpmResolver;
  43170. /***/ }),
  43171. /* 205 */
  43172. /***/ (function(module, exports, __webpack_require__) {
  43173. "use strict";
  43174. Object.defineProperty(exports, "__esModule", {
  43175. value: true
  43176. });
  43177. var _from;
  43178. function _load_from() {
  43179. return _from = _interopRequireDefault(__webpack_require__(53));
  43180. }
  43181. var _asyncToGenerator2;
  43182. function _load_asyncToGenerator() {
  43183. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  43184. }
  43185. var _classCallCheck2;
  43186. function _load_classCallCheck() {
  43187. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  43188. }
  43189. var _extends2;
  43190. function _load_extends() {
  43191. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  43192. }
  43193. var _invariant;
  43194. function _load_invariant() {
  43195. return _invariant = _interopRequireDefault(__webpack_require__(15));
  43196. }
  43197. var _string_decoder;
  43198. function _load_string_decoder() {
  43199. return _string_decoder = __webpack_require__(272);
  43200. }
  43201. var _tarFs;
  43202. function _load_tarFs() {
  43203. return _tarFs = _interopRequireDefault(__webpack_require__(184));
  43204. }
  43205. var _tarStream;
  43206. function _load_tarStream() {
  43207. return _tarStream = _interopRequireDefault(__webpack_require__(431));
  43208. }
  43209. var _url;
  43210. function _load_url() {
  43211. return _url = _interopRequireDefault(__webpack_require__(29));
  43212. }
  43213. var _fs;
  43214. function _load_fs() {
  43215. return _fs = __webpack_require__(12);
  43216. }
  43217. var _errors;
  43218. function _load_errors() {
  43219. return _errors = __webpack_require__(6);
  43220. }
  43221. var _gitSpawn;
  43222. function _load_gitSpawn() {
  43223. return _gitSpawn = __webpack_require__(310);
  43224. }
  43225. var _gitRefResolver;
  43226. function _load_gitRefResolver() {
  43227. return _gitRefResolver = __webpack_require__(538);
  43228. }
  43229. var _crypto;
  43230. function _load_crypto() {
  43231. return _crypto = _interopRequireWildcard(__webpack_require__(158));
  43232. }
  43233. var _fs2;
  43234. function _load_fs2() {
  43235. return _fs2 = _interopRequireWildcard(__webpack_require__(8));
  43236. }
  43237. var _map;
  43238. function _load_map() {
  43239. return _map = _interopRequireDefault(__webpack_require__(51));
  43240. }
  43241. var _misc;
  43242. function _load_misc() {
  43243. return _misc = __webpack_require__(28);
  43244. }
  43245. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  43246. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  43247. var GIT_PROTOCOL_PREFIX = 'git+';
  43248. var SSH_PROTOCOL = 'ssh:';
  43249. var SCP_PATH_PREFIX = '/:';
  43250. var FILE_PROTOCOL = 'file:';
  43251. var GIT_VALID_REF_LINE_REGEXP = /^([a-fA-F0-9]+|ref)/;
  43252. var validRef = function validRef(line) {
  43253. return GIT_VALID_REF_LINE_REGEXP.exec(line);
  43254. };
  43255. var supportsArchiveCache = (0, (_map || _load_map()).default)({
  43256. 'github.com': false // not support, doubt they will ever support it
  43257. });
  43258. var handleSpawnError = function handleSpawnError(err) {
  43259. if (err instanceof (_errors || _load_errors()).ProcessSpawnError) {
  43260. throw err;
  43261. }
  43262. };
  43263. var SHORTHAND_SERVICES = (0, (_map || _load_map()).default)({
  43264. 'github:': function github(parsedUrl) {
  43265. return (0, (_extends2 || _load_extends()).default)({}, parsedUrl, {
  43266. slashes: true,
  43267. auth: 'git',
  43268. protocol: SSH_PROTOCOL,
  43269. host: 'github.com',
  43270. hostname: 'github.com',
  43271. pathname: `/${parsedUrl.hostname}${parsedUrl.pathname}`
  43272. });
  43273. },
  43274. 'bitbucket:': function bitbucket(parsedUrl) {
  43275. return (0, (_extends2 || _load_extends()).default)({}, parsedUrl, {
  43276. slashes: true,
  43277. auth: 'git',
  43278. protocol: SSH_PROTOCOL,
  43279. host: 'bitbucket.com',
  43280. hostname: 'bitbucket.com',
  43281. pathname: `/${parsedUrl.hostname}${parsedUrl.pathname}`
  43282. });
  43283. }
  43284. });
  43285. var Git = function () {
  43286. function Git(config, gitUrl, hash) {
  43287. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Git);
  43288. this.supportsArchive = false;
  43289. this.fetched = false;
  43290. this.config = config;
  43291. this.reporter = config.reporter;
  43292. this.hash = hash;
  43293. this.ref = hash;
  43294. this.gitUrl = gitUrl;
  43295. this.cwd = this.config.getTemp((_crypto || _load_crypto()).hash(this.gitUrl.repository));
  43296. }
  43297. /**
  43298. * npm URLs contain a 'git+' scheme prefix, which is not understood by git.
  43299. * git "URLs" also allow an alternative scp-like syntax, so they're not standard URLs.
  43300. */
  43301. Git.npmUrlToGitUrl = function npmUrlToGitUrl(npmUrl) {
  43302. npmUrl = (0, (_misc || _load_misc()).removePrefix)(npmUrl, GIT_PROTOCOL_PREFIX);
  43303. var parsed = (_url || _load_url()).default.parse(npmUrl);
  43304. var expander = parsed.protocol && SHORTHAND_SERVICES[parsed.protocol];
  43305. if (expander) {
  43306. parsed = expander(parsed);
  43307. }
  43308. // Special case in npm, where ssh:// prefix is stripped to pass scp-like syntax
  43309. // which in git works as remote path only if there are no slashes before ':'.
  43310. // See #3146.
  43311. if (parsed.protocol === SSH_PROTOCOL && parsed.hostname && parsed.path && parsed.path.startsWith(SCP_PATH_PREFIX) && parsed.port === null) {
  43312. var auth = parsed.auth ? parsed.auth + '@' : '';
  43313. var pathname = parsed.path.slice(SCP_PATH_PREFIX.length);
  43314. return {
  43315. hostname: parsed.hostname,
  43316. protocol: parsed.protocol,
  43317. repository: `${auth}${parsed.hostname}:${pathname}`
  43318. };
  43319. }
  43320. // git local repos are specified as `git+file:` and a filesystem path, not a url.
  43321. var repository = void 0;
  43322. if (parsed.protocol === FILE_PROTOCOL) {
  43323. repository = parsed.path;
  43324. } else {
  43325. repository = (_url || _load_url()).default.format((0, (_extends2 || _load_extends()).default)({}, parsed, { hash: '' }));
  43326. }
  43327. return {
  43328. hostname: parsed.hostname || null,
  43329. protocol: parsed.protocol || FILE_PROTOCOL,
  43330. repository: repository || ''
  43331. };
  43332. };
  43333. /**
  43334. * Check if the host specified in the input `gitUrl` has archive capability.
  43335. */
  43336. Git.hasArchiveCapability = function () {
  43337. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref) {
  43338. var hostname = ref.hostname;
  43339. if (ref.protocol !== 'ssh:' || hostname == null) {
  43340. return false;
  43341. }
  43342. if (hostname in supportsArchiveCache) {
  43343. return supportsArchiveCache[hostname];
  43344. }
  43345. try {
  43346. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${ref.repository}`, 'HEAD', Date.now() + '']);
  43347. throw new Error();
  43348. } catch (err) {
  43349. handleSpawnError(err);
  43350. var supports = err.message.indexOf('did not match any files') >= 0;
  43351. return supportsArchiveCache[hostname] = supports;
  43352. }
  43353. });
  43354. function hasArchiveCapability(_x) {
  43355. return _ref.apply(this, arguments);
  43356. }
  43357. return hasArchiveCapability;
  43358. }();
  43359. /**
  43360. * Check if the input `target` is a 5-40 character hex commit hash.
  43361. */
  43362. Git.repoExists = function () {
  43363. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref) {
  43364. var isLocal = ref.protocol === FILE_PROTOCOL;
  43365. try {
  43366. if (isLocal) {
  43367. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', '-t'], { cwd: ref.repository });
  43368. } else {
  43369. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '-t', ref.repository]);
  43370. }
  43371. return true;
  43372. } catch (err) {
  43373. handleSpawnError(err);
  43374. return false;
  43375. }
  43376. });
  43377. function repoExists(_x2) {
  43378. return _ref2.apply(this, arguments);
  43379. }
  43380. return repoExists;
  43381. }();
  43382. Git.replaceProtocol = function replaceProtocol(ref, protocol) {
  43383. return {
  43384. hostname: ref.hostname,
  43385. protocol,
  43386. repository: ref.repository.replace(/^(?:git|http):/, protocol)
  43387. };
  43388. };
  43389. /**
  43390. * Attempt to upgrade insecure protocols to secure protocol
  43391. */
  43392. Git.secureGitUrl = function () {
  43393. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref, hash, reporter) {
  43394. if ((0, (_gitRefResolver || _load_gitRefResolver()).isCommitSha)(hash)) {
  43395. // this is cryptographically secure
  43396. return ref;
  43397. }
  43398. if (ref.protocol === 'git:') {
  43399. var secureUrl = Git.replaceProtocol(ref, 'https:');
  43400. if (yield Git.repoExists(secureUrl)) {
  43401. return secureUrl;
  43402. } else {
  43403. reporter.warn(reporter.lang('downloadGitWithoutCommit', ref.repository));
  43404. return ref;
  43405. }
  43406. }
  43407. if (ref.protocol === 'http:') {
  43408. var secureRef = Git.replaceProtocol(ref, 'https:');
  43409. if (yield Git.repoExists(secureRef)) {
  43410. return secureRef;
  43411. } else {
  43412. reporter.warn(reporter.lang('downloadHTTPWithoutCommit', ref.repository));
  43413. return ref;
  43414. }
  43415. }
  43416. return ref;
  43417. });
  43418. function secureGitUrl(_x3, _x4, _x5) {
  43419. return _ref3.apply(this, arguments);
  43420. }
  43421. return secureGitUrl;
  43422. }();
  43423. /**
  43424. * Archive a repo to destination
  43425. */
  43426. Git.prototype.archive = function archive(dest) {
  43427. if (this.supportsArchive) {
  43428. return this._archiveViaRemoteArchive(dest);
  43429. } else {
  43430. return this._archiveViaLocalFetched(dest);
  43431. }
  43432. };
  43433. Git.prototype._archiveViaRemoteArchive = function () {
  43434. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) {
  43435. var hashStream = new (_crypto || _load_crypto()).HashStream();
  43436. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref], {
  43437. process(proc, resolve, reject, done) {
  43438. var writeStream = (0, (_fs || _load_fs()).createWriteStream)(dest);
  43439. proc.on('error', reject);
  43440. writeStream.on('error', reject);
  43441. writeStream.on('end', done);
  43442. writeStream.on('open', function () {
  43443. proc.stdout.pipe(hashStream).pipe(writeStream);
  43444. });
  43445. writeStream.once('finish', done);
  43446. }
  43447. });
  43448. return hashStream.getHash();
  43449. });
  43450. function _archiveViaRemoteArchive(_x6) {
  43451. return _ref4.apply(this, arguments);
  43452. }
  43453. return _archiveViaRemoteArchive;
  43454. }();
  43455. Git.prototype._archiveViaLocalFetched = function () {
  43456. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) {
  43457. var hashStream = new (_crypto || _load_crypto()).HashStream();
  43458. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', this.hash], {
  43459. cwd: this.cwd,
  43460. process(proc, resolve, reject, done) {
  43461. var writeStream = (0, (_fs || _load_fs()).createWriteStream)(dest);
  43462. proc.on('error', reject);
  43463. writeStream.on('error', reject);
  43464. writeStream.on('open', function () {
  43465. proc.stdout.pipe(hashStream).pipe(writeStream);
  43466. });
  43467. writeStream.once('finish', done);
  43468. }
  43469. });
  43470. return hashStream.getHash();
  43471. });
  43472. function _archiveViaLocalFetched(_x7) {
  43473. return _ref5.apply(this, arguments);
  43474. }
  43475. return _archiveViaLocalFetched;
  43476. }();
  43477. /**
  43478. * Clone a repo to the input `dest`. Use `git archive` if it's available, otherwise fall
  43479. * back to `git clone`.
  43480. */
  43481. Git.prototype.clone = function clone(dest) {
  43482. if (this.supportsArchive) {
  43483. return this._cloneViaRemoteArchive(dest);
  43484. } else {
  43485. return this._cloneViaLocalFetched(dest);
  43486. }
  43487. };
  43488. Git.prototype._cloneViaRemoteArchive = function () {
  43489. var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) {
  43490. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref], {
  43491. process(proc, update, reject, done) {
  43492. var extractor = (_tarFs || _load_tarFs()).default.extract(dest, {
  43493. dmode: 0o555, // all dirs should be readable
  43494. fmode: 0o444 // all files should be readable
  43495. });
  43496. extractor.on('error', reject);
  43497. extractor.on('finish', done);
  43498. proc.stdout.pipe(extractor);
  43499. proc.on('error', reject);
  43500. }
  43501. });
  43502. });
  43503. function _cloneViaRemoteArchive(_x8) {
  43504. return _ref6.apply(this, arguments);
  43505. }
  43506. return _cloneViaRemoteArchive;
  43507. }();
  43508. Git.prototype._cloneViaLocalFetched = function () {
  43509. var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) {
  43510. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', this.hash], {
  43511. cwd: this.cwd,
  43512. process(proc, resolve, reject, done) {
  43513. var extractor = (_tarFs || _load_tarFs()).default.extract(dest, {
  43514. dmode: 0o555, // all dirs should be readable
  43515. fmode: 0o444 // all files should be readable
  43516. });
  43517. extractor.on('error', reject);
  43518. extractor.on('finish', done);
  43519. proc.stdout.pipe(extractor);
  43520. }
  43521. });
  43522. });
  43523. function _cloneViaLocalFetched(_x9) {
  43524. return _ref7.apply(this, arguments);
  43525. }
  43526. return _cloneViaLocalFetched;
  43527. }();
  43528. /**
  43529. * Clone this repo.
  43530. */
  43531. Git.prototype.fetch = function fetch() {
  43532. var _this = this;
  43533. var gitUrl = this.gitUrl,
  43534. cwd = this.cwd;
  43535. return (_fs2 || _load_fs2()).lockQueue.push(gitUrl.repository, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  43536. if (yield (_fs2 || _load_fs2()).exists(cwd)) {
  43537. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['fetch', '--tags'], { cwd });
  43538. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['pull'], { cwd });
  43539. } else {
  43540. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['clone', gitUrl.repository, cwd]);
  43541. }
  43542. _this.fetched = true;
  43543. }));
  43544. };
  43545. /**
  43546. * Fetch the file by cloning the repo and reading it.
  43547. */
  43548. Git.prototype.getFile = function getFile(filename) {
  43549. if (this.supportsArchive) {
  43550. return this._getFileFromArchive(filename);
  43551. } else {
  43552. return this._getFileFromClone(filename);
  43553. }
  43554. };
  43555. Git.prototype._getFileFromArchive = function () {
  43556. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename) {
  43557. try {
  43558. return yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref, filename], {
  43559. process(proc, update, reject, done) {
  43560. var parser = (_tarStream || _load_tarStream()).default.extract();
  43561. parser.on('error', reject);
  43562. parser.on('finish', done);
  43563. parser.on('entry', function (header, stream, next) {
  43564. var decoder = new (_string_decoder || _load_string_decoder()).StringDecoder('utf8');
  43565. var fileContent = '';
  43566. stream.on('data', function (buffer) {
  43567. fileContent += decoder.write(buffer);
  43568. });
  43569. stream.on('end', function () {
  43570. var remaining = decoder.end();
  43571. update(fileContent + remaining);
  43572. next();
  43573. });
  43574. stream.resume();
  43575. });
  43576. proc.stdout.pipe(parser);
  43577. }
  43578. });
  43579. } catch (err) {
  43580. if (err.message.indexOf('did not match any files') >= 0) {
  43581. return false;
  43582. } else {
  43583. throw err;
  43584. }
  43585. }
  43586. });
  43587. function _getFileFromArchive(_x10) {
  43588. return _ref9.apply(this, arguments);
  43589. }
  43590. return _getFileFromArchive;
  43591. }();
  43592. Git.prototype._getFileFromClone = function () {
  43593. var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename) {
  43594. (0, (_invariant || _load_invariant()).default)(this.fetched, 'Repo not fetched');
  43595. try {
  43596. return yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show', `${this.hash}:${filename}`], {
  43597. cwd: this.cwd
  43598. });
  43599. } catch (err) {
  43600. handleSpawnError(err);
  43601. // file doesn't exist
  43602. return false;
  43603. }
  43604. });
  43605. function _getFileFromClone(_x11) {
  43606. return _ref10.apply(this, arguments);
  43607. }
  43608. return _getFileFromClone;
  43609. }();
  43610. /**
  43611. * Initialize the repo, find a secure url to use and
  43612. * set the ref to match an input `target`.
  43613. */
  43614. Git.prototype.init = function () {
  43615. var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  43616. this.gitUrl = yield Git.secureGitUrl(this.gitUrl, this.hash, this.reporter);
  43617. yield this.setRefRemote();
  43618. // check capabilities
  43619. if (this.ref !== '' && (yield Git.hasArchiveCapability(this.gitUrl))) {
  43620. this.supportsArchive = true;
  43621. } else {
  43622. yield this.fetch();
  43623. }
  43624. return this.hash;
  43625. });
  43626. function init() {
  43627. return _ref11.apply(this, arguments);
  43628. }
  43629. return init;
  43630. }();
  43631. Git.prototype.setRefRemote = function () {
  43632. var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  43633. var isLocal = this.gitUrl.protocol === FILE_PROTOCOL;
  43634. var stdout = void 0;
  43635. if (isLocal) {
  43636. stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', '--tags', '--heads'], { cwd: this.gitUrl.repository });
  43637. } else {
  43638. stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--tags', '--heads', this.gitUrl.repository]);
  43639. }
  43640. var refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(stdout);
  43641. return this.setRef(refs);
  43642. });
  43643. function setRefRemote() {
  43644. return _ref12.apply(this, arguments);
  43645. }
  43646. return setRefRemote;
  43647. }();
  43648. Git.prototype.setRefHosted = function setRefHosted(hostedRefsList) {
  43649. var refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(hostedRefsList);
  43650. return this.setRef(refs);
  43651. };
  43652. /**
  43653. * Resolves the default branch of a remote repository (not always "master")
  43654. */
  43655. Git.prototype.resolveDefaultBranch = function () {
  43656. var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  43657. var isLocal = this.gitUrl.protocol === FILE_PROTOCOL;
  43658. try {
  43659. var stdout = void 0;
  43660. if (isLocal) {
  43661. stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', 'HEAD'], { cwd: this.gitUrl.repository });
  43662. var refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(stdout);
  43663. var sha = refs.values().next().value;
  43664. if (sha) {
  43665. return { sha, ref: undefined };
  43666. } else {
  43667. throw new Error('Unable to find SHA for git HEAD');
  43668. }
  43669. } else {
  43670. stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--symref', this.gitUrl.repository, 'HEAD']);
  43671. var lines = stdout.split('\n').filter(validRef);
  43672. var _lines$0$split = lines[0].split(/\s+/),
  43673. ref = _lines$0$split[1];
  43674. var _lines$1$split = lines[1].split(/\s+/),
  43675. _sha = _lines$1$split[0];
  43676. return { sha: _sha, ref };
  43677. }
  43678. } catch (err) {
  43679. handleSpawnError(err);
  43680. // older versions of git don't support "--symref"
  43681. var _stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', this.gitUrl.repository, 'HEAD']);
  43682. var _lines = _stdout.split('\n').filter(validRef);
  43683. var _lines$0$split2 = _lines[0].split(/\s+/),
  43684. _sha2 = _lines$0$split2[0];
  43685. return { sha: _sha2, ref: undefined };
  43686. }
  43687. });
  43688. function resolveDefaultBranch() {
  43689. return _ref13.apply(this, arguments);
  43690. }
  43691. return resolveDefaultBranch;
  43692. }();
  43693. /**
  43694. * Resolve a git commit to it's 40-chars format and ensure it exists in the repository
  43695. * We need to use the 40-chars format to avoid multiple folders in the cache
  43696. */
  43697. Git.prototype.resolveCommit = function () {
  43698. var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (shaToResolve) {
  43699. try {
  43700. yield this.fetch();
  43701. var revListArgs = ['rev-list', '-n', '1', '--no-abbrev-commit', '--format=oneline', shaToResolve];
  43702. var stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(revListArgs, { cwd: this.cwd });
  43703. var _stdout$split = stdout.split(/\s+/),
  43704. sha = _stdout$split[0];
  43705. return { sha, ref: undefined };
  43706. } catch (err) {
  43707. handleSpawnError(err);
  43708. // assuming commit not found, let's try something else
  43709. return null;
  43710. }
  43711. });
  43712. function resolveCommit(_x12) {
  43713. return _ref14.apply(this, arguments);
  43714. }
  43715. return resolveCommit;
  43716. }();
  43717. /**
  43718. * Resolves the input hash / ref / semver range to a valid commit sha
  43719. * If possible also resolves the sha to a valid ref in order to use "git archive"
  43720. */
  43721. Git.prototype.setRef = function () {
  43722. var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (refs) {
  43723. // get commit ref
  43724. var version = this.hash;
  43725. var resolvedResult = yield (0, (_gitRefResolver || _load_gitRefResolver()).resolveVersion)({
  43726. config: this.config,
  43727. git: this,
  43728. version,
  43729. refs
  43730. });
  43731. if (!resolvedResult) {
  43732. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('couldntFindMatch', version, (0, (_from || _load_from()).default)(refs.keys()).join(','), this.gitUrl.repository));
  43733. }
  43734. this.hash = resolvedResult.sha;
  43735. this.ref = resolvedResult.ref || '';
  43736. return this.hash;
  43737. });
  43738. function setRef(_x13) {
  43739. return _ref15.apply(this, arguments);
  43740. }
  43741. return setRef;
  43742. }();
  43743. return Git;
  43744. }();
  43745. exports.default = Git;
  43746. /***/ }),
  43747. /* 206 */
  43748. /***/ (function(module, exports, __webpack_require__) {
  43749. "use strict";
  43750. Object.defineProperty(exports, "__esModule", {
  43751. value: true
  43752. });
  43753. var _asyncToGenerator2;
  43754. function _load_asyncToGenerator() {
  43755. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  43756. }
  43757. var _resolveRelative;
  43758. function _load_resolveRelative() {
  43759. return _resolveRelative = _interopRequireDefault(__webpack_require__(543));
  43760. }
  43761. var _validate;
  43762. function _load_validate() {
  43763. return _validate = _interopRequireDefault(__webpack_require__(120));
  43764. }
  43765. var _fix;
  43766. function _load_fix() {
  43767. return _fix = _interopRequireDefault(__webpack_require__(540));
  43768. }
  43769. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  43770. var path = __webpack_require__(1);
  43771. exports.default = function () {
  43772. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (info, moduleLoc, config, isRoot) {
  43773. // create human readable name
  43774. var name = info.name,
  43775. version = info.version;
  43776. var human = void 0;
  43777. if (typeof name === 'string') {
  43778. human = name;
  43779. }
  43780. if (human && typeof version === 'string' && version) {
  43781. human += `@${version}`;
  43782. }
  43783. if (isRoot && info._loc) {
  43784. human = path.relative(config.cwd, info._loc);
  43785. }
  43786. function warn(msg) {
  43787. if (human) {
  43788. msg = `${human}: ${msg}`;
  43789. }
  43790. config.reporter.warn(msg);
  43791. }
  43792. yield (0, (_fix || _load_fix()).default)(info, moduleLoc, config.reporter, warn, config.looseSemver);
  43793. (0, (_resolveRelative || _load_resolveRelative()).default)(info, moduleLoc, config.lockfileFolder);
  43794. if (config.cwd === config.globalFolder) {
  43795. return info;
  43796. }
  43797. try {
  43798. (0, (_validate || _load_validate()).default)(info, isRoot, config.reporter, warn);
  43799. } catch (err) {
  43800. if (human) {
  43801. err.message = `${human}: ${err.message}`;
  43802. }
  43803. throw err;
  43804. }
  43805. return info;
  43806. });
  43807. return function (_x, _x2, _x3, _x4) {
  43808. return _ref.apply(this, arguments);
  43809. };
  43810. }();
  43811. /***/ }),
  43812. /* 207 */
  43813. /***/ (function(module, exports, __webpack_require__) {
  43814. "use strict";
  43815. Object.defineProperty(exports, "__esModule", {
  43816. value: true
  43817. });
  43818. exports.isValidLicense = isValidLicense;
  43819. exports.isValidBin = isValidBin;
  43820. exports.stringifyPerson = stringifyPerson;
  43821. exports.parsePerson = parsePerson;
  43822. exports.normalizePerson = normalizePerson;
  43823. exports.extractDescription = extractDescription;
  43824. exports.extractRepositoryUrl = extractRepositoryUrl;
  43825. var path = __webpack_require__(1);
  43826. var validateLicense = __webpack_require__(1032);
  43827. var PARENT_PATH = /^\.\.([\\\/]|$)/;
  43828. function isValidLicense(license) {
  43829. return !!license && validateLicense(license).validForNewPackages;
  43830. }
  43831. function isValidBin(bin) {
  43832. return !path.isAbsolute(bin) && !PARENT_PATH.test(path.normalize(bin));
  43833. }
  43834. function stringifyPerson(person) {
  43835. if (!person || typeof person !== 'object') {
  43836. return person;
  43837. }
  43838. var parts = [];
  43839. if (person.name) {
  43840. parts.push(person.name);
  43841. }
  43842. var email = person.email || person.mail;
  43843. if (typeof email === 'string') {
  43844. parts.push(`<${email}>`);
  43845. }
  43846. var url = person.url || person.web;
  43847. if (typeof url === 'string') {
  43848. parts.push(`(${url})`);
  43849. }
  43850. return parts.join(' ');
  43851. }
  43852. function parsePerson(person) {
  43853. if (typeof person !== 'string') {
  43854. return person;
  43855. }
  43856. // format: name (url) <email>
  43857. var obj = {};
  43858. var name = person.match(/^([^\(<]+)/);
  43859. if (name) {
  43860. name = name[0].trim();
  43861. if (name) {
  43862. obj.name = name;
  43863. }
  43864. }
  43865. var email = person.match(/<([^>]+)>/);
  43866. if (email) {
  43867. obj.email = email[1];
  43868. }
  43869. var url = person.match(/\(([^\)]+)\)/);
  43870. if (url) {
  43871. obj.url = url[1];
  43872. }
  43873. return obj;
  43874. }
  43875. function normalizePerson(person) {
  43876. return parsePerson(stringifyPerson(person));
  43877. }
  43878. function extractDescription(readme) {
  43879. if (typeof readme !== 'string' || readme === '') {
  43880. return undefined;
  43881. }
  43882. // split into lines
  43883. var lines = readme.trim().split('\n').map(function (line) {
  43884. return line.trim();
  43885. });
  43886. // find the start of the first paragraph, ignore headings
  43887. var start = 0;
  43888. for (; start < lines.length; start++) {
  43889. var line = lines[start];
  43890. if (line && line.match(/^(#|$)/)) {
  43891. // line isn't empty and isn't a heading so this is the start of a paragraph
  43892. start++;
  43893. break;
  43894. }
  43895. }
  43896. // skip newlines from the header to the first line
  43897. while (start < lines.length && !lines[start]) {
  43898. start++;
  43899. }
  43900. // continue to the first non empty line
  43901. var end = start;
  43902. while (end < lines.length && lines[end]) {
  43903. end++;
  43904. }
  43905. return lines.slice(start, end).join(' ');
  43906. }
  43907. function extractRepositoryUrl(repository) {
  43908. if (!repository || typeof repository !== 'object') {
  43909. return repository;
  43910. }
  43911. return repository.url;
  43912. }
  43913. /***/ }),
  43914. /* 208 */
  43915. /***/ (function(module, exports, __webpack_require__) {
  43916. "use strict";
  43917. Object.defineProperty(exports, "__esModule", {
  43918. value: true
  43919. });
  43920. exports.getPlatformSpecificPackageFilename = getPlatformSpecificPackageFilename;
  43921. exports.getSystemParams = getSystemParams;
  43922. function getPlatformSpecificPackageFilename(pkg) {
  43923. // TODO support hash for all subdependencies that have installs scripts
  43924. var normalizeScope = function normalizeScope(name) {
  43925. return name[0] === '@' ? name.substr(1).replace('/', '-') : name;
  43926. };
  43927. var suffix = getSystemParams();
  43928. return `${normalizeScope(pkg.name)}-v${pkg.version}-${suffix}`;
  43929. }
  43930. function getSystemParams() {
  43931. // TODO support platform variant for linux
  43932. return `${process.platform}-${process.arch}-${process.versions.modules || ''}`;
  43933. }
  43934. /***/ }),
  43935. /* 209 */
  43936. /***/ (function(module, exports, __webpack_require__) {
  43937. "use strict";
  43938. Object.defineProperty(exports, "__esModule", {
  43939. value: true
  43940. });
  43941. exports.explodeHashedUrl = explodeHashedUrl;
  43942. function explodeHashedUrl(url) {
  43943. var parts = url.split('#');
  43944. return {
  43945. hash: parts[1] || '',
  43946. url: parts[0]
  43947. };
  43948. }
  43949. /***/ }),
  43950. /* 210 */
  43951. /***/ (function(module, exports, __webpack_require__) {
  43952. module.exports = { "default": __webpack_require__(595), __esModule: true };
  43953. /***/ }),
  43954. /* 211 */
  43955. /***/ (function(module, exports, __webpack_require__) {
  43956. module.exports = { "default": __webpack_require__(598), __esModule: true };
  43957. /***/ }),
  43958. /* 212 */
  43959. /***/ (function(module, exports) {
  43960. function Caseless (dict) {
  43961. this.dict = dict || {}
  43962. }
  43963. Caseless.prototype.set = function (name, value, clobber) {
  43964. if (typeof name === 'object') {
  43965. for (var i in name) {
  43966. this.set(i, name[i], value)
  43967. }
  43968. } else {
  43969. if (typeof clobber === 'undefined') clobber = true
  43970. var has = this.has(name)
  43971. if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value
  43972. else this.dict[has || name] = value
  43973. return has
  43974. }
  43975. }
  43976. Caseless.prototype.has = function (name) {
  43977. var keys = Object.keys(this.dict)
  43978. , name = name.toLowerCase()
  43979. ;
  43980. for (var i=0;i<keys.length;i++) {
  43981. if (keys[i].toLowerCase() === name) return keys[i]
  43982. }
  43983. return false
  43984. }
  43985. Caseless.prototype.get = function (name) {
  43986. name = name.toLowerCase()
  43987. var result, _key
  43988. var headers = this.dict
  43989. Object.keys(headers).forEach(function (key) {
  43990. _key = key.toLowerCase()
  43991. if (name === _key) result = headers[key]
  43992. })
  43993. return result
  43994. }
  43995. Caseless.prototype.swap = function (name) {
  43996. var has = this.has(name)
  43997. if (has === name) return
  43998. if (!has) throw new Error('There is no header than matches "'+name+'"')
  43999. this.dict[name] = this.dict[has]
  44000. delete this.dict[has]
  44001. }
  44002. Caseless.prototype.del = function (name) {
  44003. var has = this.has(name)
  44004. return delete this.dict[has || name]
  44005. }
  44006. module.exports = function (dict) {return new Caseless(dict)}
  44007. module.exports.httpify = function (resp, headers) {
  44008. var c = new Caseless(headers)
  44009. resp.setHeader = function (key, value, clobber) {
  44010. if (typeof value === 'undefined') return
  44011. return c.set(key, value, clobber)
  44012. }
  44013. resp.hasHeader = function (key) {
  44014. return c.has(key)
  44015. }
  44016. resp.getHeader = function (key) {
  44017. return c.get(key)
  44018. }
  44019. resp.removeHeader = function (key) {
  44020. return c.del(key)
  44021. }
  44022. resp.headers = c.dict
  44023. return c
  44024. }
  44025. /***/ }),
  44026. /* 213 */
  44027. /***/ (function(module, exports) {
  44028. module.exports = function (it, Constructor, name, forbiddenField) {
  44029. if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
  44030. throw TypeError(name + ': incorrect invocation!');
  44031. } return it;
  44032. };
  44033. /***/ }),
  44034. /* 214 */
  44035. /***/ (function(module, exports, __webpack_require__) {
  44036. // getting tag from 19.1.3.6 Object.prototype.toString()
  44037. var cof = __webpack_require__(121);
  44038. var TAG = __webpack_require__(44)('toStringTag');
  44039. // ES3 wrong here
  44040. var ARG = cof(function () { return arguments; }()) == 'Arguments';
  44041. // fallback for IE11 Script Access Denied error
  44042. var tryGet = function (it, key) {
  44043. try {
  44044. return it[key];
  44045. } catch (e) { /* empty */ }
  44046. };
  44047. module.exports = function (it) {
  44048. var O, T, B;
  44049. return it === undefined ? 'Undefined' : it === null ? 'Null'
  44050. // @@toStringTag case
  44051. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  44052. // builtinTag case
  44053. : ARG ? cof(O)
  44054. // ES3 arguments fallback
  44055. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  44056. };
  44057. /***/ }),
  44058. /* 215 */
  44059. /***/ (function(module, exports) {
  44060. // 7.2.1 RequireObjectCoercible(argument)
  44061. module.exports = function (it) {
  44062. if (it == undefined) throw TypeError("Can't call method on " + it);
  44063. return it;
  44064. };
  44065. /***/ }),
  44066. /* 216 */
  44067. /***/ (function(module, exports, __webpack_require__) {
  44068. var isObject = __webpack_require__(49);
  44069. var document = __webpack_require__(38).document;
  44070. // typeof document.createElement is 'object' in old IE
  44071. var is = isObject(document) && isObject(document.createElement);
  44072. module.exports = function (it) {
  44073. return is ? document.createElement(it) : {};
  44074. };
  44075. /***/ }),
  44076. /* 217 */
  44077. /***/ (function(module, exports) {
  44078. // IE 8- don't enum bug keys
  44079. module.exports = (
  44080. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  44081. ).split(',');
  44082. /***/ }),
  44083. /* 218 */
  44084. /***/ (function(module, exports, __webpack_require__) {
  44085. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  44086. var cof = __webpack_require__(121);
  44087. // eslint-disable-next-line no-prototype-builtins
  44088. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  44089. return cof(it) == 'String' ? it.split('') : Object(it);
  44090. };
  44091. /***/ }),
  44092. /* 219 */
  44093. /***/ (function(module, exports, __webpack_require__) {
  44094. "use strict";
  44095. var LIBRARY = __webpack_require__(124);
  44096. var $export = __webpack_require__(34);
  44097. var redefine = __webpack_require__(342);
  44098. var hide = __webpack_require__(77);
  44099. var Iterators = __webpack_require__(123);
  44100. var $iterCreate = __webpack_require__(614);
  44101. var setToStringTag = __webpack_require__(128);
  44102. var getPrototypeOf = __webpack_require__(337);
  44103. var ITERATOR = __webpack_require__(44)('iterator');
  44104. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  44105. var FF_ITERATOR = '@@iterator';
  44106. var KEYS = 'keys';
  44107. var VALUES = 'values';
  44108. var returnThis = function () { return this; };
  44109. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  44110. $iterCreate(Constructor, NAME, next);
  44111. var getMethod = function (kind) {
  44112. if (!BUGGY && kind in proto) return proto[kind];
  44113. switch (kind) {
  44114. case KEYS: return function keys() { return new Constructor(this, kind); };
  44115. case VALUES: return function values() { return new Constructor(this, kind); };
  44116. } return function entries() { return new Constructor(this, kind); };
  44117. };
  44118. var TAG = NAME + ' Iterator';
  44119. var DEF_VALUES = DEFAULT == VALUES;
  44120. var VALUES_BUG = false;
  44121. var proto = Base.prototype;
  44122. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  44123. var $default = $native || getMethod(DEFAULT);
  44124. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  44125. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  44126. var methods, key, IteratorPrototype;
  44127. // Fix native
  44128. if ($anyNative) {
  44129. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  44130. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  44131. // Set @@toStringTag to native iterators
  44132. setToStringTag(IteratorPrototype, TAG, true);
  44133. // fix for some old engines
  44134. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
  44135. }
  44136. }
  44137. // fix Array#{values, @@iterator}.name in V8 / FF
  44138. if (DEF_VALUES && $native && $native.name !== VALUES) {
  44139. VALUES_BUG = true;
  44140. $default = function values() { return $native.call(this); };
  44141. }
  44142. // Define iterator
  44143. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  44144. hide(proto, ITERATOR, $default);
  44145. }
  44146. // Plug for library
  44147. Iterators[NAME] = $default;
  44148. Iterators[TAG] = returnThis;
  44149. if (DEFAULT) {
  44150. methods = {
  44151. values: DEF_VALUES ? $default : getMethod(VALUES),
  44152. keys: IS_SET ? $default : getMethod(KEYS),
  44153. entries: $entries
  44154. };
  44155. if (FORCED) for (key in methods) {
  44156. if (!(key in proto)) redefine(proto, key, methods[key]);
  44157. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  44158. }
  44159. return methods;
  44160. };
  44161. /***/ }),
  44162. /* 220 */
  44163. /***/ (function(module, exports, __webpack_require__) {
  44164. var META = __webpack_require__(162)('meta');
  44165. var isObject = __webpack_require__(49);
  44166. var has = __webpack_require__(89);
  44167. var setDesc = __webpack_require__(63).f;
  44168. var id = 0;
  44169. var isExtensible = Object.isExtensible || function () {
  44170. return true;
  44171. };
  44172. var FREEZE = !__webpack_require__(76)(function () {
  44173. return isExtensible(Object.preventExtensions({}));
  44174. });
  44175. var setMeta = function (it) {
  44176. setDesc(it, META, { value: {
  44177. i: 'O' + ++id, // object ID
  44178. w: {} // weak collections IDs
  44179. } });
  44180. };
  44181. var fastKey = function (it, create) {
  44182. // return primitive with prefix
  44183. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  44184. if (!has(it, META)) {
  44185. // can't set metadata to uncaught frozen object
  44186. if (!isExtensible(it)) return 'F';
  44187. // not necessary to add metadata
  44188. if (!create) return 'E';
  44189. // add missing metadata
  44190. setMeta(it);
  44191. // return object ID
  44192. } return it[META].i;
  44193. };
  44194. var getWeak = function (it, create) {
  44195. if (!has(it, META)) {
  44196. // can't set metadata to uncaught frozen object
  44197. if (!isExtensible(it)) return true;
  44198. // not necessary to add metadata
  44199. if (!create) return false;
  44200. // add missing metadata
  44201. setMeta(it);
  44202. // return hash weak collections IDs
  44203. } return it[META].w;
  44204. };
  44205. // add metadata on freeze-family methods calling
  44206. var onFreeze = function (it) {
  44207. if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
  44208. return it;
  44209. };
  44210. var meta = module.exports = {
  44211. KEY: META,
  44212. NEED: false,
  44213. fastKey: fastKey,
  44214. getWeak: getWeak,
  44215. onFreeze: onFreeze
  44216. };
  44217. /***/ }),
  44218. /* 221 */
  44219. /***/ (function(module, exports, __webpack_require__) {
  44220. "use strict";
  44221. // 25.4.1.5 NewPromiseCapability(C)
  44222. var aFunction = __webpack_require__(88);
  44223. function PromiseCapability(C) {
  44224. var resolve, reject;
  44225. this.promise = new C(function ($$resolve, $$reject) {
  44226. if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
  44227. resolve = $$resolve;
  44228. reject = $$reject;
  44229. });
  44230. this.resolve = aFunction(resolve);
  44231. this.reject = aFunction(reject);
  44232. }
  44233. module.exports.f = function (C) {
  44234. return new PromiseCapability(C);
  44235. };
  44236. /***/ }),
  44237. /* 222 */
  44238. /***/ (function(module, exports) {
  44239. exports.f = Object.getOwnPropertySymbols;
  44240. /***/ }),
  44241. /* 223 */
  44242. /***/ (function(module, exports, __webpack_require__) {
  44243. var hide = __webpack_require__(77);
  44244. module.exports = function (target, src, safe) {
  44245. for (var key in src) {
  44246. if (safe && target[key]) target[key] = src[key];
  44247. else hide(target, key, src[key]);
  44248. } return target;
  44249. };
  44250. /***/ }),
  44251. /* 224 */
  44252. /***/ (function(module, exports, __webpack_require__) {
  44253. var shared = __webpack_require__(225)('keys');
  44254. var uid = __webpack_require__(162);
  44255. module.exports = function (key) {
  44256. return shared[key] || (shared[key] = uid(key));
  44257. };
  44258. /***/ }),
  44259. /* 225 */
  44260. /***/ (function(module, exports, __webpack_require__) {
  44261. var core = __webpack_require__(26);
  44262. var global = __webpack_require__(38);
  44263. var SHARED = '__core-js_shared__';
  44264. var store = global[SHARED] || (global[SHARED] = {});
  44265. (module.exports = function (key, value) {
  44266. return store[key] || (store[key] = value !== undefined ? value : {});
  44267. })('versions', []).push({
  44268. version: core.version,
  44269. mode: __webpack_require__(124) ? 'pure' : 'global',
  44270. copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
  44271. });
  44272. /***/ }),
  44273. /* 226 */
  44274. /***/ (function(module, exports) {
  44275. // 7.1.4 ToInteger
  44276. var ceil = Math.ceil;
  44277. var floor = Math.floor;
  44278. module.exports = function (it) {
  44279. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  44280. };
  44281. /***/ }),
  44282. /* 227 */
  44283. /***/ (function(module, exports, __webpack_require__) {
  44284. // 7.1.1 ToPrimitive(input [, PreferredType])
  44285. var isObject = __webpack_require__(49);
  44286. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  44287. // and the second argument - flag - preferred type is a string
  44288. module.exports = function (it, S) {
  44289. if (!isObject(it)) return it;
  44290. var fn, val;
  44291. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  44292. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  44293. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  44294. throw TypeError("Can't convert object to primitive value");
  44295. };
  44296. /***/ }),
  44297. /* 228 */
  44298. /***/ (function(module, exports, __webpack_require__) {
  44299. var isObject = __webpack_require__(49);
  44300. module.exports = function (it, TYPE) {
  44301. if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
  44302. return it;
  44303. };
  44304. /***/ }),
  44305. /* 229 */
  44306. /***/ (function(module, exports, __webpack_require__) {
  44307. var global = __webpack_require__(38);
  44308. var core = __webpack_require__(26);
  44309. var LIBRARY = __webpack_require__(124);
  44310. var wksExt = __webpack_require__(230);
  44311. var defineProperty = __webpack_require__(63).f;
  44312. module.exports = function (name) {
  44313. var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  44314. if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
  44315. };
  44316. /***/ }),
  44317. /* 230 */
  44318. /***/ (function(module, exports, __webpack_require__) {
  44319. exports.f = __webpack_require__(44);
  44320. /***/ }),
  44321. /* 231 */
  44322. /***/ (function(module, exports, __webpack_require__) {
  44323. var classof = __webpack_require__(214);
  44324. var ITERATOR = __webpack_require__(44)('iterator');
  44325. var Iterators = __webpack_require__(123);
  44326. module.exports = __webpack_require__(26).getIteratorMethod = function (it) {
  44327. if (it != undefined) return it[ITERATOR]
  44328. || it['@@iterator']
  44329. || Iterators[classof(it)];
  44330. };
  44331. /***/ }),
  44332. /* 232 */
  44333. /***/ (function(module, exports, __webpack_require__) {
  44334. "use strict";
  44335. var hasOwn = Object.prototype.hasOwnProperty;
  44336. var toStr = Object.prototype.toString;
  44337. var defineProperty = Object.defineProperty;
  44338. var gOPD = Object.getOwnPropertyDescriptor;
  44339. var isArray = function isArray(arr) {
  44340. if (typeof Array.isArray === 'function') {
  44341. return Array.isArray(arr);
  44342. }
  44343. return toStr.call(arr) === '[object Array]';
  44344. };
  44345. var isPlainObject = function isPlainObject(obj) {
  44346. if (!obj || toStr.call(obj) !== '[object Object]') {
  44347. return false;
  44348. }
  44349. var hasOwnConstructor = hasOwn.call(obj, 'constructor');
  44350. var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
  44351. // Not own constructor property must be Object
  44352. if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
  44353. return false;
  44354. }
  44355. // Own properties are enumerated firstly, so to speed up,
  44356. // if last one is own, then all properties are own.
  44357. var key;
  44358. for (key in obj) { /**/ }
  44359. return typeof key === 'undefined' || hasOwn.call(obj, key);
  44360. };
  44361. // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
  44362. var setProperty = function setProperty(target, options) {
  44363. if (defineProperty && options.name === '__proto__') {
  44364. defineProperty(target, options.name, {
  44365. enumerable: true,
  44366. configurable: true,
  44367. value: options.newValue,
  44368. writable: true
  44369. });
  44370. } else {
  44371. target[options.name] = options.newValue;
  44372. }
  44373. };
  44374. // Return undefined instead of __proto__ if '__proto__' is not an own property
  44375. var getProperty = function getProperty(obj, name) {
  44376. if (name === '__proto__') {
  44377. if (!hasOwn.call(obj, name)) {
  44378. return void 0;
  44379. } else if (gOPD) {
  44380. // In early versions of node, obj['__proto__'] is buggy when obj has
  44381. // __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
  44382. return gOPD(obj, name).value;
  44383. }
  44384. }
  44385. return obj[name];
  44386. };
  44387. module.exports = function extend() {
  44388. var options, name, src, copy, copyIsArray, clone;
  44389. var target = arguments[0];
  44390. var i = 1;
  44391. var length = arguments.length;
  44392. var deep = false;
  44393. // Handle a deep copy situation
  44394. if (typeof target === 'boolean') {
  44395. deep = target;
  44396. target = arguments[1] || {};
  44397. // skip the boolean and the target
  44398. i = 2;
  44399. }
  44400. if (target == null || (typeof target !== 'object' && typeof target !== 'function')) {
  44401. target = {};
  44402. }
  44403. for (; i < length; ++i) {
  44404. options = arguments[i];
  44405. // Only deal with non-null/undefined values
  44406. if (options != null) {
  44407. // Extend the base object
  44408. for (name in options) {
  44409. src = getProperty(target, name);
  44410. copy = getProperty(options, name);
  44411. // Prevent never-ending loop
  44412. if (target !== copy) {
  44413. // Recurse if we're merging plain objects or arrays
  44414. if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
  44415. if (copyIsArray) {
  44416. copyIsArray = false;
  44417. clone = src && isArray(src) ? src : [];
  44418. } else {
  44419. clone = src && isPlainObject(src) ? src : {};
  44420. }
  44421. // Never move original objects, clone them
  44422. setProperty(target, { name: name, newValue: extend(deep, clone, copy) });
  44423. // Don't bring in undefined values
  44424. } else if (typeof copy !== 'undefined') {
  44425. setProperty(target, { name: name, newValue: copy });
  44426. }
  44427. }
  44428. }
  44429. }
  44430. }
  44431. // Return the modified object
  44432. return target;
  44433. };
  44434. /***/ }),
  44435. /* 233 */
  44436. /***/ (function(module, exports, __webpack_require__) {
  44437. "use strict";
  44438. const escapeStringRegexp = __webpack_require__(351);
  44439. const platform = process.platform;
  44440. const main = {
  44441. tick: '✔',
  44442. cross: '✖',
  44443. star: '★',
  44444. square: '▇',
  44445. squareSmall: '◻',
  44446. squareSmallFilled: '◼',
  44447. play: '▶',
  44448. circle: '◯',
  44449. circleFilled: '◉',
  44450. circleDotted: '◌',
  44451. circleDouble: '◎',
  44452. circleCircle: 'ⓞ',
  44453. circleCross: 'ⓧ',
  44454. circlePipe: 'Ⓘ',
  44455. circleQuestionMark: '?⃝',
  44456. bullet: '●',
  44457. dot: '․',
  44458. line: '─',
  44459. ellipsis: '…',
  44460. pointer: '❯',
  44461. pointerSmall: '›',
  44462. info: 'ℹ',
  44463. warning: '⚠',
  44464. hamburger: '☰',
  44465. smiley: '㋡',
  44466. mustache: '෴',
  44467. heart: '♥',
  44468. arrowUp: '↑',
  44469. arrowDown: '↓',
  44470. arrowLeft: '←',
  44471. arrowRight: '→',
  44472. radioOn: '◉',
  44473. radioOff: '◯',
  44474. checkboxOn: '☒',
  44475. checkboxOff: '☐',
  44476. checkboxCircleOn: 'ⓧ',
  44477. checkboxCircleOff: 'Ⓘ',
  44478. questionMarkPrefix: '?⃝',
  44479. oneHalf: '½',
  44480. oneThird: '⅓',
  44481. oneQuarter: '¼',
  44482. oneFifth: '⅕',
  44483. oneSixth: '⅙',
  44484. oneSeventh: '⅐',
  44485. oneEighth: '⅛',
  44486. oneNinth: '⅑',
  44487. oneTenth: '⅒',
  44488. twoThirds: '⅔',
  44489. twoFifths: '⅖',
  44490. threeQuarters: '¾',
  44491. threeFifths: '⅗',
  44492. threeEighths: '⅜',
  44493. fourFifths: '⅘',
  44494. fiveSixths: '⅚',
  44495. fiveEighths: '⅝',
  44496. sevenEighths: '⅞'
  44497. };
  44498. const win = {
  44499. tick: '√',
  44500. cross: '×',
  44501. star: '*',
  44502. square: '█',
  44503. squareSmall: '[ ]',
  44504. squareSmallFilled: '[█]',
  44505. play: '►',
  44506. circle: '( )',
  44507. circleFilled: '(*)',
  44508. circleDotted: '( )',
  44509. circleDouble: '( )',
  44510. circleCircle: '(○)',
  44511. circleCross: '(×)',
  44512. circlePipe: '(│)',
  44513. circleQuestionMark: '(?)',
  44514. bullet: '*',
  44515. dot: '.',
  44516. line: '─',
  44517. ellipsis: '...',
  44518. pointer: '>',
  44519. pointerSmall: '»',
  44520. info: 'i',
  44521. warning: '‼',
  44522. hamburger: '≡',
  44523. smiley: '☺',
  44524. mustache: '┌─┐',
  44525. heart: main.heart,
  44526. arrowUp: main.arrowUp,
  44527. arrowDown: main.arrowDown,
  44528. arrowLeft: main.arrowLeft,
  44529. arrowRight: main.arrowRight,
  44530. radioOn: '(*)',
  44531. radioOff: '( )',
  44532. checkboxOn: '[×]',
  44533. checkboxOff: '[ ]',
  44534. checkboxCircleOn: '(×)',
  44535. checkboxCircleOff: '( )',
  44536. questionMarkPrefix: '?',
  44537. oneHalf: '1/2',
  44538. oneThird: '1/3',
  44539. oneQuarter: '1/4',
  44540. oneFifth: '1/5',
  44541. oneSixth: '1/6',
  44542. oneSeventh: '1/7',
  44543. oneEighth: '1/8',
  44544. oneNinth: '1/9',
  44545. oneTenth: '1/10',
  44546. twoThirds: '2/3',
  44547. twoFifths: '2/5',
  44548. threeQuarters: '3/4',
  44549. threeFifths: '3/5',
  44550. threeEighths: '3/8',
  44551. fourFifths: '4/5',
  44552. fiveSixths: '5/6',
  44553. fiveEighths: '5/8',
  44554. sevenEighths: '7/8'
  44555. };
  44556. if (platform === 'linux') {
  44557. // the main one doesn't look that good on Ubuntu
  44558. main.questionMarkPrefix = '?';
  44559. }
  44560. const figures = platform === 'win32' ? win : main;
  44561. const fn = str => {
  44562. if (figures === main) {
  44563. return str;
  44564. }
  44565. Object.keys(main).forEach(key => {
  44566. if (main[key] === figures[key]) {
  44567. return;
  44568. }
  44569. str = str.replace(new RegExp(escapeStringRegexp(main[key]), 'g'), figures[key]);
  44570. });
  44571. return str;
  44572. };
  44573. module.exports = Object.assign(fn, figures);
  44574. /***/ }),
  44575. /* 234 */
  44576. /***/ (function(module, exports, __webpack_require__) {
  44577. // Approach:
  44578. //
  44579. // 1. Get the minimatch set
  44580. // 2. For each pattern in the set, PROCESS(pattern, false)
  44581. // 3. Store matches per-set, then uniq them
  44582. //
  44583. // PROCESS(pattern, inGlobStar)
  44584. // Get the first [n] items from pattern that are all strings
  44585. // Join these together. This is PREFIX.
  44586. // If there is no more remaining, then stat(PREFIX) and
  44587. // add to matches if it succeeds. END.
  44588. //
  44589. // If inGlobStar and PREFIX is symlink and points to dir
  44590. // set ENTRIES = []
  44591. // else readdir(PREFIX) as ENTRIES
  44592. // If fail, END
  44593. //
  44594. // with ENTRIES
  44595. // If pattern[n] is GLOBSTAR
  44596. // // handle the case where the globstar match is empty
  44597. // // by pruning it out, and testing the resulting pattern
  44598. // PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
  44599. // // handle other cases.
  44600. // for ENTRY in ENTRIES (not dotfiles)
  44601. // // attach globstar + tail onto the entry
  44602. // // Mark that this entry is a globstar match
  44603. // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
  44604. //
  44605. // else // not globstar
  44606. // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
  44607. // Test ENTRY against pattern[n]
  44608. // If fails, continue
  44609. // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
  44610. //
  44611. // Caveat:
  44612. // Cache all stats and readdirs results to minimize syscall. Since all
  44613. // we ever care about is existence and directory-ness, we can just keep
  44614. // `true` for files, and [children,...] for directories, or `false` for
  44615. // things that don't exist.
  44616. module.exports = glob
  44617. var fs = __webpack_require__(12)
  44618. var rp = __webpack_require__(353)
  44619. var minimatch = __webpack_require__(170)
  44620. var Minimatch = minimatch.Minimatch
  44621. var inherits = __webpack_require__(78)
  44622. var EE = __webpack_require__(95).EventEmitter
  44623. var path = __webpack_require__(1)
  44624. var assert = __webpack_require__(50)
  44625. var isAbsolute = __webpack_require__(245)
  44626. var globSync = __webpack_require__(679)
  44627. var common = __webpack_require__(354)
  44628. var alphasort = common.alphasort
  44629. var alphasorti = common.alphasorti
  44630. var setopts = common.setopts
  44631. var ownProp = common.ownProp
  44632. var inflight = __webpack_require__(745)
  44633. var util = __webpack_require__(9)
  44634. var childrenIgnored = common.childrenIgnored
  44635. var isIgnored = common.isIgnored
  44636. var once = __webpack_require__(134)
  44637. function glob (pattern, options, cb) {
  44638. if (typeof options === 'function') cb = options, options = {}
  44639. if (!options) options = {}
  44640. if (options.sync) {
  44641. if (cb)
  44642. throw new TypeError('callback provided to sync glob')
  44643. return globSync(pattern, options)
  44644. }
  44645. return new Glob(pattern, options, cb)
  44646. }
  44647. glob.sync = globSync
  44648. var GlobSync = glob.GlobSync = globSync.GlobSync
  44649. // old api surface
  44650. glob.glob = glob
  44651. function extend (origin, add) {
  44652. if (add === null || typeof add !== 'object') {
  44653. return origin
  44654. }
  44655. var keys = Object.keys(add)
  44656. var i = keys.length
  44657. while (i--) {
  44658. origin[keys[i]] = add[keys[i]]
  44659. }
  44660. return origin
  44661. }
  44662. glob.hasMagic = function (pattern, options_) {
  44663. var options = extend({}, options_)
  44664. options.noprocess = true
  44665. var g = new Glob(pattern, options)
  44666. var set = g.minimatch.set
  44667. if (!pattern)
  44668. return false
  44669. if (set.length > 1)
  44670. return true
  44671. for (var j = 0; j < set[0].length; j++) {
  44672. if (typeof set[0][j] !== 'string')
  44673. return true
  44674. }
  44675. return false
  44676. }
  44677. glob.Glob = Glob
  44678. inherits(Glob, EE)
  44679. function Glob (pattern, options, cb) {
  44680. if (typeof options === 'function') {
  44681. cb = options
  44682. options = null
  44683. }
  44684. if (options && options.sync) {
  44685. if (cb)
  44686. throw new TypeError('callback provided to sync glob')
  44687. return new GlobSync(pattern, options)
  44688. }
  44689. if (!(this instanceof Glob))
  44690. return new Glob(pattern, options, cb)
  44691. setopts(this, pattern, options)
  44692. this._didRealPath = false
  44693. // process each pattern in the minimatch set
  44694. var n = this.minimatch.set.length
  44695. // The matches are stored as {<filename>: true,...} so that
  44696. // duplicates are automagically pruned.
  44697. // Later, we do an Object.keys() on these.
  44698. // Keep them as a list so we can fill in when nonull is set.
  44699. this.matches = new Array(n)
  44700. if (typeof cb === 'function') {
  44701. cb = once(cb)
  44702. this.on('error', cb)
  44703. this.on('end', function (matches) {
  44704. cb(null, matches)
  44705. })
  44706. }
  44707. var self = this
  44708. this._processing = 0
  44709. this._emitQueue = []
  44710. this._processQueue = []
  44711. this.paused = false
  44712. if (this.noprocess)
  44713. return this
  44714. if (n === 0)
  44715. return done()
  44716. var sync = true
  44717. for (var i = 0; i < n; i ++) {
  44718. this._process(this.minimatch.set[i], i, false, done)
  44719. }
  44720. sync = false
  44721. function done () {
  44722. --self._processing
  44723. if (self._processing <= 0) {
  44724. if (sync) {
  44725. process.nextTick(function () {
  44726. self._finish()
  44727. })
  44728. } else {
  44729. self._finish()
  44730. }
  44731. }
  44732. }
  44733. }
  44734. Glob.prototype._finish = function () {
  44735. assert(this instanceof Glob)
  44736. if (this.aborted)
  44737. return
  44738. if (this.realpath && !this._didRealpath)
  44739. return this._realpath()
  44740. common.finish(this)
  44741. this.emit('end', this.found)
  44742. }
  44743. Glob.prototype._realpath = function () {
  44744. if (this._didRealpath)
  44745. return
  44746. this._didRealpath = true
  44747. var n = this.matches.length
  44748. if (n === 0)
  44749. return this._finish()
  44750. var self = this
  44751. for (var i = 0; i < this.matches.length; i++)
  44752. this._realpathSet(i, next)
  44753. function next () {
  44754. if (--n === 0)
  44755. self._finish()
  44756. }
  44757. }
  44758. Glob.prototype._realpathSet = function (index, cb) {
  44759. var matchset = this.matches[index]
  44760. if (!matchset)
  44761. return cb()
  44762. var found = Object.keys(matchset)
  44763. var self = this
  44764. var n = found.length
  44765. if (n === 0)
  44766. return cb()
  44767. var set = this.matches[index] = Object.create(null)
  44768. found.forEach(function (p, i) {
  44769. // If there's a problem with the stat, then it means that
  44770. // one or more of the links in the realpath couldn't be
  44771. // resolved. just return the abs value in that case.
  44772. p = self._makeAbs(p)
  44773. rp.realpath(p, self.realpathCache, function (er, real) {
  44774. if (!er)
  44775. set[real] = true
  44776. else if (er.syscall === 'stat')
  44777. set[p] = true
  44778. else
  44779. self.emit('error', er) // srsly wtf right here
  44780. if (--n === 0) {
  44781. self.matches[index] = set
  44782. cb()
  44783. }
  44784. })
  44785. })
  44786. }
  44787. Glob.prototype._mark = function (p) {
  44788. return common.mark(this, p)
  44789. }
  44790. Glob.prototype._makeAbs = function (f) {
  44791. return common.makeAbs(this, f)
  44792. }
  44793. Glob.prototype.abort = function () {
  44794. this.aborted = true
  44795. this.emit('abort')
  44796. }
  44797. Glob.prototype.pause = function () {
  44798. if (!this.paused) {
  44799. this.paused = true
  44800. this.emit('pause')
  44801. }
  44802. }
  44803. Glob.prototype.resume = function () {
  44804. if (this.paused) {
  44805. this.emit('resume')
  44806. this.paused = false
  44807. if (this._emitQueue.length) {
  44808. var eq = this._emitQueue.slice(0)
  44809. this._emitQueue.length = 0
  44810. for (var i = 0; i < eq.length; i ++) {
  44811. var e = eq[i]
  44812. this._emitMatch(e[0], e[1])
  44813. }
  44814. }
  44815. if (this._processQueue.length) {
  44816. var pq = this._processQueue.slice(0)
  44817. this._processQueue.length = 0
  44818. for (var i = 0; i < pq.length; i ++) {
  44819. var p = pq[i]
  44820. this._processing--
  44821. this._process(p[0], p[1], p[2], p[3])
  44822. }
  44823. }
  44824. }
  44825. }
  44826. Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
  44827. assert(this instanceof Glob)
  44828. assert(typeof cb === 'function')
  44829. if (this.aborted)
  44830. return
  44831. this._processing++
  44832. if (this.paused) {
  44833. this._processQueue.push([pattern, index, inGlobStar, cb])
  44834. return
  44835. }
  44836. //console.error('PROCESS %d', this._processing, pattern)
  44837. // Get the first [n] parts of pattern that are all strings.
  44838. var n = 0
  44839. while (typeof pattern[n] === 'string') {
  44840. n ++
  44841. }
  44842. // now n is the index of the first one that is *not* a string.
  44843. // see if there's anything else
  44844. var prefix
  44845. switch (n) {
  44846. // if not, then this is rather simple
  44847. case pattern.length:
  44848. this._processSimple(pattern.join('/'), index, cb)
  44849. return
  44850. case 0:
  44851. // pattern *starts* with some non-trivial item.
  44852. // going to readdir(cwd), but not include the prefix in matches.
  44853. prefix = null
  44854. break
  44855. default:
  44856. // pattern has some string bits in the front.
  44857. // whatever it starts with, whether that's 'absolute' like /foo/bar,
  44858. // or 'relative' like '../baz'
  44859. prefix = pattern.slice(0, n).join('/')
  44860. break
  44861. }
  44862. var remain = pattern.slice(n)
  44863. // get the list of entries.
  44864. var read
  44865. if (prefix === null)
  44866. read = '.'
  44867. else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
  44868. if (!prefix || !isAbsolute(prefix))
  44869. prefix = '/' + prefix
  44870. read = prefix
  44871. } else
  44872. read = prefix
  44873. var abs = this._makeAbs(read)
  44874. //if ignored, skip _processing
  44875. if (childrenIgnored(this, read))
  44876. return cb()
  44877. var isGlobStar = remain[0] === minimatch.GLOBSTAR
  44878. if (isGlobStar)
  44879. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
  44880. else
  44881. this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
  44882. }
  44883. Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  44884. var self = this
  44885. this._readdir(abs, inGlobStar, function (er, entries) {
  44886. return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
  44887. })
  44888. }
  44889. Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  44890. // if the abs isn't a dir, then nothing can match!
  44891. if (!entries)
  44892. return cb()
  44893. // It will only match dot entries if it starts with a dot, or if
  44894. // dot is set. Stuff like @(.foo|.bar) isn't allowed.
  44895. var pn = remain[0]
  44896. var negate = !!this.minimatch.negate
  44897. var rawGlob = pn._glob
  44898. var dotOk = this.dot || rawGlob.charAt(0) === '.'
  44899. var matchedEntries = []
  44900. for (var i = 0; i < entries.length; i++) {
  44901. var e = entries[i]
  44902. if (e.charAt(0) !== '.' || dotOk) {
  44903. var m
  44904. if (negate && !prefix) {
  44905. m = !e.match(pn)
  44906. } else {
  44907. m = e.match(pn)
  44908. }
  44909. if (m)
  44910. matchedEntries.push(e)
  44911. }
  44912. }
  44913. //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
  44914. var len = matchedEntries.length
  44915. // If there are no matched entries, then nothing matches.
  44916. if (len === 0)
  44917. return cb()
  44918. // if this is the last remaining pattern bit, then no need for
  44919. // an additional stat *unless* the user has specified mark or
  44920. // stat explicitly. We know they exist, since readdir returned
  44921. // them.
  44922. if (remain.length === 1 && !this.mark && !this.stat) {
  44923. if (!this.matches[index])
  44924. this.matches[index] = Object.create(null)
  44925. for (var i = 0; i < len; i ++) {
  44926. var e = matchedEntries[i]
  44927. if (prefix) {
  44928. if (prefix !== '/')
  44929. e = prefix + '/' + e
  44930. else
  44931. e = prefix + e
  44932. }
  44933. if (e.charAt(0) === '/' && !this.nomount) {
  44934. e = path.join(this.root, e)
  44935. }
  44936. this._emitMatch(index, e)
  44937. }
  44938. // This was the last one, and no stats were needed
  44939. return cb()
  44940. }
  44941. // now test all matched entries as stand-ins for that part
  44942. // of the pattern.
  44943. remain.shift()
  44944. for (var i = 0; i < len; i ++) {
  44945. var e = matchedEntries[i]
  44946. var newPattern
  44947. if (prefix) {
  44948. if (prefix !== '/')
  44949. e = prefix + '/' + e
  44950. else
  44951. e = prefix + e
  44952. }
  44953. this._process([e].concat(remain), index, inGlobStar, cb)
  44954. }
  44955. cb()
  44956. }
  44957. Glob.prototype._emitMatch = function (index, e) {
  44958. if (this.aborted)
  44959. return
  44960. if (isIgnored(this, e))
  44961. return
  44962. if (this.paused) {
  44963. this._emitQueue.push([index, e])
  44964. return
  44965. }
  44966. var abs = isAbsolute(e) ? e : this._makeAbs(e)
  44967. if (this.mark)
  44968. e = this._mark(e)
  44969. if (this.absolute)
  44970. e = abs
  44971. if (this.matches[index][e])
  44972. return
  44973. if (this.nodir) {
  44974. var c = this.cache[abs]
  44975. if (c === 'DIR' || Array.isArray(c))
  44976. return
  44977. }
  44978. this.matches[index][e] = true
  44979. var st = this.statCache[abs]
  44980. if (st)
  44981. this.emit('stat', e, st)
  44982. this.emit('match', e)
  44983. }
  44984. Glob.prototype._readdirInGlobStar = function (abs, cb) {
  44985. if (this.aborted)
  44986. return
  44987. // follow all symlinked directories forever
  44988. // just proceed as if this is a non-globstar situation
  44989. if (this.follow)
  44990. return this._readdir(abs, false, cb)
  44991. var lstatkey = 'lstat\0' + abs
  44992. var self = this
  44993. var lstatcb = inflight(lstatkey, lstatcb_)
  44994. if (lstatcb)
  44995. fs.lstat(abs, lstatcb)
  44996. function lstatcb_ (er, lstat) {
  44997. if (er && er.code === 'ENOENT')
  44998. return cb()
  44999. var isSym = lstat && lstat.isSymbolicLink()
  45000. self.symlinks[abs] = isSym
  45001. // If it's not a symlink or a dir, then it's definitely a regular file.
  45002. // don't bother doing a readdir in that case.
  45003. if (!isSym && lstat && !lstat.isDirectory()) {
  45004. self.cache[abs] = 'FILE'
  45005. cb()
  45006. } else
  45007. self._readdir(abs, false, cb)
  45008. }
  45009. }
  45010. Glob.prototype._readdir = function (abs, inGlobStar, cb) {
  45011. if (this.aborted)
  45012. return
  45013. cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
  45014. if (!cb)
  45015. return
  45016. //console.error('RD %j %j', +inGlobStar, abs)
  45017. if (inGlobStar && !ownProp(this.symlinks, abs))
  45018. return this._readdirInGlobStar(abs, cb)
  45019. if (ownProp(this.cache, abs)) {
  45020. var c = this.cache[abs]
  45021. if (!c || c === 'FILE')
  45022. return cb()
  45023. if (Array.isArray(c))
  45024. return cb(null, c)
  45025. }
  45026. var self = this
  45027. fs.readdir(abs, readdirCb(this, abs, cb))
  45028. }
  45029. function readdirCb (self, abs, cb) {
  45030. return function (er, entries) {
  45031. if (er)
  45032. self._readdirError(abs, er, cb)
  45033. else
  45034. self._readdirEntries(abs, entries, cb)
  45035. }
  45036. }
  45037. Glob.prototype._readdirEntries = function (abs, entries, cb) {
  45038. if (this.aborted)
  45039. return
  45040. // if we haven't asked to stat everything, then just
  45041. // assume that everything in there exists, so we can avoid
  45042. // having to stat it a second time.
  45043. if (!this.mark && !this.stat) {
  45044. for (var i = 0; i < entries.length; i ++) {
  45045. var e = entries[i]
  45046. if (abs === '/')
  45047. e = abs + e
  45048. else
  45049. e = abs + '/' + e
  45050. this.cache[e] = true
  45051. }
  45052. }
  45053. this.cache[abs] = entries
  45054. return cb(null, entries)
  45055. }
  45056. Glob.prototype._readdirError = function (f, er, cb) {
  45057. if (this.aborted)
  45058. return
  45059. // handle errors, and cache the information
  45060. switch (er.code) {
  45061. case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
  45062. case 'ENOTDIR': // totally normal. means it *does* exist.
  45063. var abs = this._makeAbs(f)
  45064. this.cache[abs] = 'FILE'
  45065. if (abs === this.cwdAbs) {
  45066. var error = new Error(er.code + ' invalid cwd ' + this.cwd)
  45067. error.path = this.cwd
  45068. error.code = er.code
  45069. this.emit('error', error)
  45070. this.abort()
  45071. }
  45072. break
  45073. case 'ENOENT': // not terribly unusual
  45074. case 'ELOOP':
  45075. case 'ENAMETOOLONG':
  45076. case 'UNKNOWN':
  45077. this.cache[this._makeAbs(f)] = false
  45078. break
  45079. default: // some unusual error. Treat as failure.
  45080. this.cache[this._makeAbs(f)] = false
  45081. if (this.strict) {
  45082. this.emit('error', er)
  45083. // If the error is handled, then we abort
  45084. // if not, we threw out of here
  45085. this.abort()
  45086. }
  45087. if (!this.silent)
  45088. console.error('glob error', er)
  45089. break
  45090. }
  45091. return cb()
  45092. }
  45093. Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  45094. var self = this
  45095. this._readdir(abs, inGlobStar, function (er, entries) {
  45096. self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
  45097. })
  45098. }
  45099. Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  45100. //console.error('pgs2', prefix, remain[0], entries)
  45101. // no entries means not a dir, so it can never have matches
  45102. // foo.txt/** doesn't match foo.txt
  45103. if (!entries)
  45104. return cb()
  45105. // test without the globstar, and with every child both below
  45106. // and replacing the globstar.
  45107. var remainWithoutGlobStar = remain.slice(1)
  45108. var gspref = prefix ? [ prefix ] : []
  45109. var noGlobStar = gspref.concat(remainWithoutGlobStar)
  45110. // the noGlobStar pattern exits the inGlobStar state
  45111. this._process(noGlobStar, index, false, cb)
  45112. var isSym = this.symlinks[abs]
  45113. var len = entries.length
  45114. // If it's a symlink, and we're in a globstar, then stop
  45115. if (isSym && inGlobStar)
  45116. return cb()
  45117. for (var i = 0; i < len; i++) {
  45118. var e = entries[i]
  45119. if (e.charAt(0) === '.' && !this.dot)
  45120. continue
  45121. // these two cases enter the inGlobStar state
  45122. var instead = gspref.concat(entries[i], remainWithoutGlobStar)
  45123. this._process(instead, index, true, cb)
  45124. var below = gspref.concat(entries[i], remain)
  45125. this._process(below, index, true, cb)
  45126. }
  45127. cb()
  45128. }
  45129. Glob.prototype._processSimple = function (prefix, index, cb) {
  45130. // XXX review this. Shouldn't it be doing the mounting etc
  45131. // before doing stat? kinda weird?
  45132. var self = this
  45133. this._stat(prefix, function (er, exists) {
  45134. self._processSimple2(prefix, index, er, exists, cb)
  45135. })
  45136. }
  45137. Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
  45138. //console.error('ps2', prefix, exists)
  45139. if (!this.matches[index])
  45140. this.matches[index] = Object.create(null)
  45141. // If it doesn't exist, then just mark the lack of results
  45142. if (!exists)
  45143. return cb()
  45144. if (prefix && isAbsolute(prefix) && !this.nomount) {
  45145. var trail = /[\/\\]$/.test(prefix)
  45146. if (prefix.charAt(0) === '/') {
  45147. prefix = path.join(this.root, prefix)
  45148. } else {
  45149. prefix = path.resolve(this.root, prefix)
  45150. if (trail)
  45151. prefix += '/'
  45152. }
  45153. }
  45154. if (process.platform === 'win32')
  45155. prefix = prefix.replace(/\\/g, '/')
  45156. // Mark this as a match
  45157. this._emitMatch(index, prefix)
  45158. cb()
  45159. }
  45160. // Returns either 'DIR', 'FILE', or false
  45161. Glob.prototype._stat = function (f, cb) {
  45162. var abs = this._makeAbs(f)
  45163. var needDir = f.slice(-1) === '/'
  45164. if (f.length > this.maxLength)
  45165. return cb()
  45166. if (!this.stat && ownProp(this.cache, abs)) {
  45167. var c = this.cache[abs]
  45168. if (Array.isArray(c))
  45169. c = 'DIR'
  45170. // It exists, but maybe not how we need it
  45171. if (!needDir || c === 'DIR')
  45172. return cb(null, c)
  45173. if (needDir && c === 'FILE')
  45174. return cb()
  45175. // otherwise we have to stat, because maybe c=true
  45176. // if we know it exists, but not what it is.
  45177. }
  45178. var exists
  45179. var stat = this.statCache[abs]
  45180. if (stat !== undefined) {
  45181. if (stat === false)
  45182. return cb(null, stat)
  45183. else {
  45184. var type = stat.isDirectory() ? 'DIR' : 'FILE'
  45185. if (needDir && type === 'FILE')
  45186. return cb()
  45187. else
  45188. return cb(null, type, stat)
  45189. }
  45190. }
  45191. var self = this
  45192. var statcb = inflight('stat\0' + abs, lstatcb_)
  45193. if (statcb)
  45194. fs.lstat(abs, statcb)
  45195. function lstatcb_ (er, lstat) {
  45196. if (lstat && lstat.isSymbolicLink()) {
  45197. // If it's a symlink, then treat it as the target, unless
  45198. // the target does not exist, then treat it as a file.
  45199. return fs.stat(abs, function (er, stat) {
  45200. if (er)
  45201. self._stat2(f, abs, null, lstat, cb)
  45202. else
  45203. self._stat2(f, abs, er, stat, cb)
  45204. })
  45205. } else {
  45206. self._stat2(f, abs, er, lstat, cb)
  45207. }
  45208. }
  45209. }
  45210. Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
  45211. if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
  45212. this.statCache[abs] = false
  45213. return cb()
  45214. }
  45215. var needDir = f.slice(-1) === '/'
  45216. this.statCache[abs] = stat
  45217. if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
  45218. return cb(null, false, stat)
  45219. var c = true
  45220. if (stat)
  45221. c = stat.isDirectory() ? 'DIR' : 'FILE'
  45222. this.cache[abs] = this.cache[abs] || c
  45223. if (needDir && c === 'FILE')
  45224. return cb()
  45225. return cb(null, c, stat)
  45226. }
  45227. /***/ }),
  45228. /* 235 */
  45229. /***/ (function(module, exports, __webpack_require__) {
  45230. "use strict";
  45231. var resolve = __webpack_require__(236);
  45232. module.exports = {
  45233. Validation: errorSubclass(ValidationError),
  45234. MissingRef: errorSubclass(MissingRefError)
  45235. };
  45236. function ValidationError(errors) {
  45237. this.message = 'validation failed';
  45238. this.errors = errors;
  45239. this.ajv = this.validation = true;
  45240. }
  45241. MissingRefError.message = function (baseId, ref) {
  45242. return 'can\'t resolve reference ' + ref + ' from id ' + baseId;
  45243. };
  45244. function MissingRefError(baseId, ref, message) {
  45245. this.message = message || MissingRefError.message(baseId, ref);
  45246. this.missingRef = resolve.url(baseId, ref);
  45247. this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef));
  45248. }
  45249. function errorSubclass(Subclass) {
  45250. Subclass.prototype = Object.create(Error.prototype);
  45251. Subclass.prototype.constructor = Subclass;
  45252. return Subclass;
  45253. }
  45254. /***/ }),
  45255. /* 236 */
  45256. /***/ (function(module, exports, __webpack_require__) {
  45257. "use strict";
  45258. var url = __webpack_require__(29)
  45259. , equal = __webpack_require__(237)
  45260. , util = __webpack_require__(106)
  45261. , SchemaObject = __webpack_require__(357)
  45262. , traverse = __webpack_require__(735);
  45263. module.exports = resolve;
  45264. resolve.normalizeId = normalizeId;
  45265. resolve.fullPath = getFullPath;
  45266. resolve.url = resolveUrl;
  45267. resolve.ids = resolveIds;
  45268. resolve.inlineRef = inlineRef;
  45269. resolve.schema = resolveSchema;
  45270. /**
  45271. * [resolve and compile the references ($ref)]
  45272. * @this Ajv
  45273. * @param {Function} compile reference to schema compilation funciton (localCompile)
  45274. * @param {Object} root object with information about the root schema for the current schema
  45275. * @param {String} ref reference to resolve
  45276. * @return {Object|Function} schema object (if the schema can be inlined) or validation function
  45277. */
  45278. function resolve(compile, root, ref) {
  45279. /* jshint validthis: true */
  45280. var refVal = this._refs[ref];
  45281. if (typeof refVal == 'string') {
  45282. if (this._refs[refVal]) refVal = this._refs[refVal];
  45283. else return resolve.call(this, compile, root, refVal);
  45284. }
  45285. refVal = refVal || this._schemas[ref];
  45286. if (refVal instanceof SchemaObject) {
  45287. return inlineRef(refVal.schema, this._opts.inlineRefs)
  45288. ? refVal.schema
  45289. : refVal.validate || this._compile(refVal);
  45290. }
  45291. var res = resolveSchema.call(this, root, ref);
  45292. var schema, v, baseId;
  45293. if (res) {
  45294. schema = res.schema;
  45295. root = res.root;
  45296. baseId = res.baseId;
  45297. }
  45298. if (schema instanceof SchemaObject) {
  45299. v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);
  45300. } else if (schema !== undefined) {
  45301. v = inlineRef(schema, this._opts.inlineRefs)
  45302. ? schema
  45303. : compile.call(this, schema, root, undefined, baseId);
  45304. }
  45305. return v;
  45306. }
  45307. /**
  45308. * Resolve schema, its root and baseId
  45309. * @this Ajv
  45310. * @param {Object} root root object with properties schema, refVal, refs
  45311. * @param {String} ref reference to resolve
  45312. * @return {Object} object with properties schema, root, baseId
  45313. */
  45314. function resolveSchema(root, ref) {
  45315. /* jshint validthis: true */
  45316. var p = url.parse(ref, false, true)
  45317. , refPath = _getFullPath(p)
  45318. , baseId = getFullPath(this._getId(root.schema));
  45319. if (refPath !== baseId) {
  45320. var id = normalizeId(refPath);
  45321. var refVal = this._refs[id];
  45322. if (typeof refVal == 'string') {
  45323. return resolveRecursive.call(this, root, refVal, p);
  45324. } else if (refVal instanceof SchemaObject) {
  45325. if (!refVal.validate) this._compile(refVal);
  45326. root = refVal;
  45327. } else {
  45328. refVal = this._schemas[id];
  45329. if (refVal instanceof SchemaObject) {
  45330. if (!refVal.validate) this._compile(refVal);
  45331. if (id == normalizeId(ref))
  45332. return { schema: refVal, root: root, baseId: baseId };
  45333. root = refVal;
  45334. } else {
  45335. return;
  45336. }
  45337. }
  45338. if (!root.schema) return;
  45339. baseId = getFullPath(this._getId(root.schema));
  45340. }
  45341. return getJsonPointer.call(this, p, baseId, root.schema, root);
  45342. }
  45343. /* @this Ajv */
  45344. function resolveRecursive(root, ref, parsedRef) {
  45345. /* jshint validthis: true */
  45346. var res = resolveSchema.call(this, root, ref);
  45347. if (res) {
  45348. var schema = res.schema;
  45349. var baseId = res.baseId;
  45350. root = res.root;
  45351. var id = this._getId(schema);
  45352. if (id) baseId = resolveUrl(baseId, id);
  45353. return getJsonPointer.call(this, parsedRef, baseId, schema, root);
  45354. }
  45355. }
  45356. var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);
  45357. /* @this Ajv */
  45358. function getJsonPointer(parsedRef, baseId, schema, root) {
  45359. /* jshint validthis: true */
  45360. parsedRef.hash = parsedRef.hash || '';
  45361. if (parsedRef.hash.slice(0,2) != '#/') return;
  45362. var parts = parsedRef.hash.split('/');
  45363. for (var i = 1; i < parts.length; i++) {
  45364. var part = parts[i];
  45365. if (part) {
  45366. part = util.unescapeFragment(part);
  45367. schema = schema[part];
  45368. if (schema === undefined) break;
  45369. var id;
  45370. if (!PREVENT_SCOPE_CHANGE[part]) {
  45371. id = this._getId(schema);
  45372. if (id) baseId = resolveUrl(baseId, id);
  45373. if (schema.$ref) {
  45374. var $ref = resolveUrl(baseId, schema.$ref);
  45375. var res = resolveSchema.call(this, root, $ref);
  45376. if (res) {
  45377. schema = res.schema;
  45378. root = res.root;
  45379. baseId = res.baseId;
  45380. }
  45381. }
  45382. }
  45383. }
  45384. }
  45385. if (schema !== undefined && schema !== root.schema)
  45386. return { schema: schema, root: root, baseId: baseId };
  45387. }
  45388. var SIMPLE_INLINED = util.toHash([
  45389. 'type', 'format', 'pattern',
  45390. 'maxLength', 'minLength',
  45391. 'maxProperties', 'minProperties',
  45392. 'maxItems', 'minItems',
  45393. 'maximum', 'minimum',
  45394. 'uniqueItems', 'multipleOf',
  45395. 'required', 'enum'
  45396. ]);
  45397. function inlineRef(schema, limit) {
  45398. if (limit === false) return false;
  45399. if (limit === undefined || limit === true) return checkNoRef(schema);
  45400. else if (limit) return countKeys(schema) <= limit;
  45401. }
  45402. function checkNoRef(schema) {
  45403. var item;
  45404. if (Array.isArray(schema)) {
  45405. for (var i=0; i<schema.length; i++) {
  45406. item = schema[i];
  45407. if (typeof item == 'object' && !checkNoRef(item)) return false;
  45408. }
  45409. } else {
  45410. for (var key in schema) {
  45411. if (key == '$ref') return false;
  45412. item = schema[key];
  45413. if (typeof item == 'object' && !checkNoRef(item)) return false;
  45414. }
  45415. }
  45416. return true;
  45417. }
  45418. function countKeys(schema) {
  45419. var count = 0, item;
  45420. if (Array.isArray(schema)) {
  45421. for (var i=0; i<schema.length; i++) {
  45422. item = schema[i];
  45423. if (typeof item == 'object') count += countKeys(item);
  45424. if (count == Infinity) return Infinity;
  45425. }
  45426. } else {
  45427. for (var key in schema) {
  45428. if (key == '$ref') return Infinity;
  45429. if (SIMPLE_INLINED[key]) {
  45430. count++;
  45431. } else {
  45432. item = schema[key];
  45433. if (typeof item == 'object') count += countKeys(item) + 1;
  45434. if (count == Infinity) return Infinity;
  45435. }
  45436. }
  45437. }
  45438. return count;
  45439. }
  45440. function getFullPath(id, normalize) {
  45441. if (normalize !== false) id = normalizeId(id);
  45442. var p = url.parse(id, false, true);
  45443. return _getFullPath(p);
  45444. }
  45445. function _getFullPath(p) {
  45446. var protocolSeparator = p.protocol || p.href.slice(0,2) == '//' ? '//' : '';
  45447. return (p.protocol||'') + protocolSeparator + (p.host||'') + (p.path||'') + '#';
  45448. }
  45449. var TRAILING_SLASH_HASH = /#\/?$/;
  45450. function normalizeId(id) {
  45451. return id ? id.replace(TRAILING_SLASH_HASH, '') : '';
  45452. }
  45453. function resolveUrl(baseId, id) {
  45454. id = normalizeId(id);
  45455. return url.resolve(baseId, id);
  45456. }
  45457. /* @this Ajv */
  45458. function resolveIds(schema) {
  45459. var schemaId = normalizeId(this._getId(schema));
  45460. var baseIds = {'': schemaId};
  45461. var fullPaths = {'': getFullPath(schemaId, false)};
  45462. var localRefs = {};
  45463. var self = this;
  45464. traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
  45465. if (jsonPtr === '') return;
  45466. var id = self._getId(sch);
  45467. var baseId = baseIds[parentJsonPtr];
  45468. var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;
  45469. if (keyIndex !== undefined)
  45470. fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));
  45471. if (typeof id == 'string') {
  45472. id = baseId = normalizeId(baseId ? url.resolve(baseId, id) : id);
  45473. var refVal = self._refs[id];
  45474. if (typeof refVal == 'string') refVal = self._refs[refVal];
  45475. if (refVal && refVal.schema) {
  45476. if (!equal(sch, refVal.schema))
  45477. throw new Error('id "' + id + '" resolves to more than one schema');
  45478. } else if (id != normalizeId(fullPath)) {
  45479. if (id[0] == '#') {
  45480. if (localRefs[id] && !equal(sch, localRefs[id]))
  45481. throw new Error('id "' + id + '" resolves to more than one schema');
  45482. localRefs[id] = sch;
  45483. } else {
  45484. self._refs[id] = fullPath;
  45485. }
  45486. }
  45487. }
  45488. baseIds[jsonPtr] = baseId;
  45489. fullPaths[jsonPtr] = fullPath;
  45490. });
  45491. return localRefs;
  45492. }
  45493. /***/ }),
  45494. /* 237 */
  45495. /***/ (function(module, exports, __webpack_require__) {
  45496. "use strict";
  45497. var isArray = Array.isArray;
  45498. var keyList = Object.keys;
  45499. var hasProp = Object.prototype.hasOwnProperty;
  45500. module.exports = function equal(a, b) {
  45501. if (a === b) return true;
  45502. var arrA = isArray(a)
  45503. , arrB = isArray(b)
  45504. , i
  45505. , length
  45506. , key;
  45507. if (arrA && arrB) {
  45508. length = a.length;
  45509. if (length != b.length) return false;
  45510. for (i = 0; i < length; i++)
  45511. if (!equal(a[i], b[i])) return false;
  45512. return true;
  45513. }
  45514. if (arrA != arrB) return false;
  45515. var dateA = a instanceof Date
  45516. , dateB = b instanceof Date;
  45517. if (dateA != dateB) return false;
  45518. if (dateA && dateB) return a.getTime() == b.getTime();
  45519. var regexpA = a instanceof RegExp
  45520. , regexpB = b instanceof RegExp;
  45521. if (regexpA != regexpB) return false;
  45522. if (regexpA && regexpB) return a.toString() == b.toString();
  45523. if (a instanceof Object && b instanceof Object) {
  45524. var keys = keyList(a);
  45525. length = keys.length;
  45526. if (length !== keyList(b).length)
  45527. return false;
  45528. for (i = 0; i < length; i++)
  45529. if (!hasProp.call(b, keys[i])) return false;
  45530. for (i = 0; i < length; i++) {
  45531. key = keys[i];
  45532. if (!equal(a[key], b[key])) return false;
  45533. }
  45534. return true;
  45535. }
  45536. return false;
  45537. };
  45538. /***/ }),
  45539. /* 238 */
  45540. /***/ (function(module, exports) {
  45541. module.exports = [["0","\u0000",127,"€"],["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"],["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"],["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11],["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"],["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"],["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5],["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"],["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"],["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"],["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"],["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"],["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"],["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4],["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6],["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"],["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7],["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"],["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"],["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"],["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5],["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"],["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6],["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"],["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4],["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4],["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"],["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"],["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6],["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"],["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"],["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"],["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6],["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"],["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"],["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"],["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"],["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"],["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"],["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8],["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"],["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"],["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"],["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"],["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5],["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"],["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"],["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"],["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"],["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5],["9980","檧檨檪檭",114,"欥欦欨",6],["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"],["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"],["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"],["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"],["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"],["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5],["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"],["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"],["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6],["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"],["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"],["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4],["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19],["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"],["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"],["a2a1","ⅰ",9],["a2b1","⒈",19,"⑴",19,"①",9],["a2e5","㈠",9],["a2f1","Ⅰ",11],["a3a1","!"#¥%",88," ̄"],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"],["a6ee","︻︼︷︸︱"],["a6f4","︳︴"],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6],["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"],["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"],["a8bd","ńň"],["a8c0","ɡ"],["a8c5","ㄅ",36],["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"],["a959","℡㈱"],["a95c","‐"],["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8],["a980","﹢",4,"﹨﹩﹪﹫"],["a996","〇"],["a9a4","─",75],["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8],["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"],["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4],["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4],["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11],["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"],["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12],["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"],["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"],["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"],["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"],["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"],["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"],["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"],["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"],["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"],["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4],["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"],["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"],["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"],["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9],["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"],["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"],["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"],["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"],["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"],["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16],["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"],["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"],["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"],["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"],["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"],["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"],["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"],["bb40","籃",9,"籎",36,"籵",5,"籾",9],["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"],["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5],["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"],["bd40","紷",54,"絯",7],["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"],["be40","継",12,"綧",6,"綯",42],["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"],["bf40","緻",62],["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"],["c040","繞",35,"纃",23,"纜纝纞"],["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"],["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"],["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"],["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"],["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"],["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"],["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"],["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"],["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"],["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"],["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"],["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"],["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"],["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"],["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"],["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"],["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"],["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"],["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"],["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10],["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"],["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"],["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"],["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"],["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"],["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"],["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"],["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"],["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"],["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9],["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"],["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"],["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"],["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5],["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"],["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"],["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"],["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6],["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"],["d440","訞",31,"訿",8,"詉",21],["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"],["d540","誁",7,"誋",7,"誔",46],["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"],["d640","諤",34,"謈",27],["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"],["d740","譆",31,"譧",4,"譭",25],["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"],["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"],["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"],["d940","貮",62],["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"],["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"],["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"],["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"],["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"],["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7],["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"],["dd40","軥",62],["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"],["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"],["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"],["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"],["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"],["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"],["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"],["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"],["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"],["e240","釦",62],["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"],["e340","鉆",45,"鉵",16],["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"],["e440","銨",5,"銯",24,"鋉",31],["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"],["e540","錊",51,"錿",10],["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"],["e640","鍬",34,"鎐",27],["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"],["e740","鏎",7,"鏗",54],["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"],["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"],["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"],["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42],["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"],["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"],["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"],["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"],["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"],["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7],["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"],["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46],["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"],["ee40","頏",62],["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"],["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4],["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"],["f040","餈",4,"餎餏餑",28,"餯",26],["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"],["f140","馌馎馚",10,"馦馧馩",47],["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"],["f240","駺",62],["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"],["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"],["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"],["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5],["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"],["f540","魼",62],["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"],["f640","鯜",62],["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"],["f740","鰼",62],["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"],["f840","鳣",62],["f880","鴢",32],["f940","鵃",62],["f980","鶂",32],["fa40","鶣",62],["fa80","鷢",32],["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"],["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"],["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6],["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"],["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38],["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"],["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"]]
  45542. /***/ }),
  45543. /* 239 */
  45544. /***/ (function(module, exports, __webpack_require__) {
  45545. "use strict";
  45546. // Standard YAML's Failsafe schema.
  45547. // http://www.yaml.org/spec/1.2/spec.html#id2802346
  45548. var Schema = __webpack_require__(108);
  45549. module.exports = new Schema({
  45550. explicit: [
  45551. __webpack_require__(813),
  45552. __webpack_require__(811),
  45553. __webpack_require__(806)
  45554. ]
  45555. });
  45556. /***/ }),
  45557. /* 240 */
  45558. /***/ (function(module, exports, __webpack_require__) {
  45559. "use strict";
  45560. var win32 = process && process.platform === 'win32';
  45561. var path = __webpack_require__(1);
  45562. var fileRe = __webpack_require__(670);
  45563. var utils = module.exports;
  45564. /**
  45565. * Module dependencies
  45566. */
  45567. utils.diff = __webpack_require__(826);
  45568. utils.unique = __webpack_require__(827);
  45569. utils.braces = __webpack_require__(828);
  45570. utils.brackets = __webpack_require__(663);
  45571. utils.extglob = __webpack_require__(668);
  45572. utils.isExtglob = __webpack_require__(166);
  45573. utils.isGlob = __webpack_require__(167);
  45574. utils.typeOf = __webpack_require__(169);
  45575. utils.normalize = __webpack_require__(837);
  45576. utils.omit = __webpack_require__(841);
  45577. utils.parseGlob = __webpack_require__(845);
  45578. utils.cache = __webpack_require__(867);
  45579. /**
  45580. * Get the filename of a filepath
  45581. *
  45582. * @param {String} `string`
  45583. * @return {String}
  45584. */
  45585. utils.filename = function filename(fp) {
  45586. var seg = fp.match(fileRe());
  45587. return seg && seg[0];
  45588. };
  45589. /**
  45590. * Returns a function that returns true if the given
  45591. * pattern is the same as a given `filepath`
  45592. *
  45593. * @param {String} `pattern`
  45594. * @return {Function}
  45595. */
  45596. utils.isPath = function isPath(pattern, opts) {
  45597. opts = opts || {};
  45598. return function(fp) {
  45599. var unixified = utils.unixify(fp, opts);
  45600. if(opts.nocase){
  45601. return pattern.toLowerCase() === unixified.toLowerCase();
  45602. }
  45603. return pattern === unixified;
  45604. };
  45605. };
  45606. /**
  45607. * Returns a function that returns true if the given
  45608. * pattern contains a `filepath`
  45609. *
  45610. * @param {String} `pattern`
  45611. * @return {Function}
  45612. */
  45613. utils.hasPath = function hasPath(pattern, opts) {
  45614. return function(fp) {
  45615. return utils.unixify(pattern, opts).indexOf(fp) !== -1;
  45616. };
  45617. };
  45618. /**
  45619. * Returns a function that returns true if the given
  45620. * pattern matches or contains a `filepath`
  45621. *
  45622. * @param {String} `pattern`
  45623. * @return {Function}
  45624. */
  45625. utils.matchPath = function matchPath(pattern, opts) {
  45626. var fn = (opts && opts.contains)
  45627. ? utils.hasPath(pattern, opts)
  45628. : utils.isPath(pattern, opts);
  45629. return fn;
  45630. };
  45631. /**
  45632. * Returns a function that returns true if the given
  45633. * regex matches the `filename` of a file path.
  45634. *
  45635. * @param {RegExp} `re`
  45636. * @return {Boolean}
  45637. */
  45638. utils.hasFilename = function hasFilename(re) {
  45639. return function(fp) {
  45640. var name = utils.filename(fp);
  45641. return name && re.test(name);
  45642. };
  45643. };
  45644. /**
  45645. * Coerce `val` to an array
  45646. *
  45647. * @param {*} val
  45648. * @return {Array}
  45649. */
  45650. utils.arrayify = function arrayify(val) {
  45651. return !Array.isArray(val)
  45652. ? [val]
  45653. : val;
  45654. };
  45655. /**
  45656. * Normalize all slashes in a file path or glob pattern to
  45657. * forward slashes.
  45658. */
  45659. utils.unixify = function unixify(fp, opts) {
  45660. if (opts && opts.unixify === false) return fp;
  45661. if (opts && opts.unixify === true || win32 || path.sep === '\\') {
  45662. return utils.normalize(fp, false);
  45663. }
  45664. if (opts && opts.unescape === true) {
  45665. return fp ? fp.toString().replace(/\\(\w)/g, '$1') : '';
  45666. }
  45667. return fp;
  45668. };
  45669. /**
  45670. * Escape/unescape utils
  45671. */
  45672. utils.escapePath = function escapePath(fp) {
  45673. return fp.replace(/[\\.]/g, '\\$&');
  45674. };
  45675. utils.unescapeGlob = function unescapeGlob(fp) {
  45676. return fp.replace(/[\\"']/g, '');
  45677. };
  45678. utils.escapeRe = function escapeRe(str) {
  45679. return str.replace(/[-[\\$*+?.#^\s{}(|)\]]/g, '\\$&');
  45680. };
  45681. /**
  45682. * Expose `utils`
  45683. */
  45684. module.exports = utils;
  45685. /***/ }),
  45686. /* 241 */
  45687. /***/ (function(module, exports, __webpack_require__) {
  45688. var path = __webpack_require__(1);
  45689. var fs = __webpack_require__(12);
  45690. var _0777 = parseInt('0777', 8);
  45691. module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
  45692. function mkdirP (p, opts, f, made) {
  45693. if (typeof opts === 'function') {
  45694. f = opts;
  45695. opts = {};
  45696. }
  45697. else if (!opts || typeof opts !== 'object') {
  45698. opts = { mode: opts };
  45699. }
  45700. var mode = opts.mode;
  45701. var xfs = opts.fs || fs;
  45702. if (mode === undefined) {
  45703. mode = _0777 & (~process.umask());
  45704. }
  45705. if (!made) made = null;
  45706. var cb = f || function () {};
  45707. p = path.resolve(p);
  45708. xfs.mkdir(p, mode, function (er) {
  45709. if (!er) {
  45710. made = made || p;
  45711. return cb(null, made);
  45712. }
  45713. switch (er.code) {
  45714. case 'ENOENT':
  45715. mkdirP(path.dirname(p), opts, function (er, made) {
  45716. if (er) cb(er, made);
  45717. else mkdirP(p, opts, cb, made);
  45718. });
  45719. break;
  45720. // In the case of any other error, just see if there's a dir
  45721. // there already. If so, then hooray! If not, then something
  45722. // is borked.
  45723. default:
  45724. xfs.stat(p, function (er2, stat) {
  45725. // if the stat fails, then that's super weird.
  45726. // let the original error be the failure reason.
  45727. if (er2 || !stat.isDirectory()) cb(er, made)
  45728. else cb(null, made);
  45729. });
  45730. break;
  45731. }
  45732. });
  45733. }
  45734. mkdirP.sync = function sync (p, opts, made) {
  45735. if (!opts || typeof opts !== 'object') {
  45736. opts = { mode: opts };
  45737. }
  45738. var mode = opts.mode;
  45739. var xfs = opts.fs || fs;
  45740. if (mode === undefined) {
  45741. mode = _0777 & (~process.umask());
  45742. }
  45743. if (!made) made = null;
  45744. p = path.resolve(p);
  45745. try {
  45746. xfs.mkdirSync(p, mode);
  45747. made = made || p;
  45748. }
  45749. catch (err0) {
  45750. switch (err0.code) {
  45751. case 'ENOENT' :
  45752. made = sync(path.dirname(p), opts, made);
  45753. sync(p, opts, made);
  45754. break;
  45755. // In the case of any other error, just see if there's a dir
  45756. // there already. If so, then hooray! If not, then something
  45757. // is borked.
  45758. default:
  45759. var stat;
  45760. try {
  45761. stat = xfs.statSync(p);
  45762. }
  45763. catch (err1) {
  45764. throw err0;
  45765. }
  45766. if (!stat.isDirectory()) throw err0;
  45767. break;
  45768. }
  45769. }
  45770. return made;
  45771. };
  45772. /***/ }),
  45773. /* 242 */
  45774. /***/ (function(module, exports, __webpack_require__) {
  45775. module.exports = __webpack_require__(835);
  45776. /***/ }),
  45777. /* 243 */
  45778. /***/ (function(module, exports, __webpack_require__) {
  45779. "use strict";
  45780. /*
  45781. object-assign
  45782. (c) Sindre Sorhus
  45783. @license MIT
  45784. */
  45785. /* eslint-disable no-unused-vars */
  45786. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  45787. var hasOwnProperty = Object.prototype.hasOwnProperty;
  45788. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  45789. function toObject(val) {
  45790. if (val === null || val === undefined) {
  45791. throw new TypeError('Object.assign cannot be called with null or undefined');
  45792. }
  45793. return Object(val);
  45794. }
  45795. function shouldUseNative() {
  45796. try {
  45797. if (!Object.assign) {
  45798. return false;
  45799. }
  45800. // Detect buggy property enumeration order in older V8 versions.
  45801. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  45802. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  45803. test1[5] = 'de';
  45804. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  45805. return false;
  45806. }
  45807. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  45808. var test2 = {};
  45809. for (var i = 0; i < 10; i++) {
  45810. test2['_' + String.fromCharCode(i)] = i;
  45811. }
  45812. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  45813. return test2[n];
  45814. });
  45815. if (order2.join('') !== '0123456789') {
  45816. return false;
  45817. }
  45818. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  45819. var test3 = {};
  45820. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  45821. test3[letter] = letter;
  45822. });
  45823. if (Object.keys(Object.assign({}, test3)).join('') !==
  45824. 'abcdefghijklmnopqrst') {
  45825. return false;
  45826. }
  45827. return true;
  45828. } catch (err) {
  45829. // We don't expect any of the above to throw, but better to be safe.
  45830. return false;
  45831. }
  45832. }
  45833. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  45834. var from;
  45835. var to = toObject(target);
  45836. var symbols;
  45837. for (var s = 1; s < arguments.length; s++) {
  45838. from = Object(arguments[s]);
  45839. for (var key in from) {
  45840. if (hasOwnProperty.call(from, key)) {
  45841. to[key] = from[key];
  45842. }
  45843. }
  45844. if (getOwnPropertySymbols) {
  45845. symbols = getOwnPropertySymbols(from);
  45846. for (var i = 0; i < symbols.length; i++) {
  45847. if (propIsEnumerable.call(from, symbols[i])) {
  45848. to[symbols[i]] = from[symbols[i]];
  45849. }
  45850. }
  45851. }
  45852. }
  45853. return to;
  45854. };
  45855. /***/ }),
  45856. /* 244 */
  45857. /***/ (function(module, exports, __webpack_require__) {
  45858. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory){
  45859. 'use strict';
  45860. /*istanbul ignore next:cant test*/
  45861. if (typeof module === 'object' && typeof module.exports === 'object') {
  45862. module.exports = factory();
  45863. } else if (true) {
  45864. // AMD. Register as an anonymous module.
  45865. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  45866. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  45867. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  45868. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  45869. } else {
  45870. // Browser globals
  45871. root.objectPath = factory();
  45872. }
  45873. })(this, function(){
  45874. 'use strict';
  45875. var toStr = Object.prototype.toString;
  45876. function hasOwnProperty(obj, prop) {
  45877. if(obj == null) {
  45878. return false
  45879. }
  45880. //to handle objects with null prototypes (too edge case?)
  45881. return Object.prototype.hasOwnProperty.call(obj, prop)
  45882. }
  45883. function isEmpty(value){
  45884. if (!value) {
  45885. return true;
  45886. }
  45887. if (isArray(value) && value.length === 0) {
  45888. return true;
  45889. } else if (typeof value !== 'string') {
  45890. for (var i in value) {
  45891. if (hasOwnProperty(value, i)) {
  45892. return false;
  45893. }
  45894. }
  45895. return true;
  45896. }
  45897. return false;
  45898. }
  45899. function toString(type){
  45900. return toStr.call(type);
  45901. }
  45902. function isObject(obj){
  45903. return typeof obj === 'object' && toString(obj) === "[object Object]";
  45904. }
  45905. var isArray = Array.isArray || function(obj){
  45906. /*istanbul ignore next:cant test*/
  45907. return toStr.call(obj) === '[object Array]';
  45908. }
  45909. function isBoolean(obj){
  45910. return typeof obj === 'boolean' || toString(obj) === '[object Boolean]';
  45911. }
  45912. function getKey(key){
  45913. var intKey = parseInt(key);
  45914. if (intKey.toString() === key) {
  45915. return intKey;
  45916. }
  45917. return key;
  45918. }
  45919. function factory(options) {
  45920. options = options || {}
  45921. var objectPath = function(obj) {
  45922. return Object.keys(objectPath).reduce(function(proxy, prop) {
  45923. if(prop === 'create') {
  45924. return proxy;
  45925. }
  45926. /*istanbul ignore else*/
  45927. if (typeof objectPath[prop] === 'function') {
  45928. proxy[prop] = objectPath[prop].bind(objectPath, obj);
  45929. }
  45930. return proxy;
  45931. }, {});
  45932. };
  45933. function hasShallowProperty(obj, prop) {
  45934. return (options.includeInheritedProps || (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop))
  45935. }
  45936. function getShallowProperty(obj, prop) {
  45937. if (hasShallowProperty(obj, prop)) {
  45938. return obj[prop];
  45939. }
  45940. }
  45941. function set(obj, path, value, doNotReplace){
  45942. if (typeof path === 'number') {
  45943. path = [path];
  45944. }
  45945. if (!path || path.length === 0) {
  45946. return obj;
  45947. }
  45948. if (typeof path === 'string') {
  45949. return set(obj, path.split('.').map(getKey), value, doNotReplace);
  45950. }
  45951. var currentPath = path[0];
  45952. var currentValue = getShallowProperty(obj, currentPath);
  45953. if (path.length === 1) {
  45954. if (currentValue === void 0 || !doNotReplace) {
  45955. obj[currentPath] = value;
  45956. }
  45957. return currentValue;
  45958. }
  45959. if (currentValue === void 0) {
  45960. //check if we assume an array
  45961. if(typeof path[1] === 'number') {
  45962. obj[currentPath] = [];
  45963. } else {
  45964. obj[currentPath] = {};
  45965. }
  45966. }
  45967. return set(obj[currentPath], path.slice(1), value, doNotReplace);
  45968. }
  45969. objectPath.has = function (obj, path) {
  45970. if (typeof path === 'number') {
  45971. path = [path];
  45972. } else if (typeof path === 'string') {
  45973. path = path.split('.');
  45974. }
  45975. if (!path || path.length === 0) {
  45976. return !!obj;
  45977. }
  45978. for (var i = 0; i < path.length; i++) {
  45979. var j = getKey(path[i]);
  45980. if((typeof j === 'number' && isArray(obj) && j < obj.length) ||
  45981. (options.includeInheritedProps ? (j in Object(obj)) : hasOwnProperty(obj, j))) {
  45982. obj = obj[j];
  45983. } else {
  45984. return false;
  45985. }
  45986. }
  45987. return true;
  45988. };
  45989. objectPath.ensureExists = function (obj, path, value){
  45990. return set(obj, path, value, true);
  45991. };
  45992. objectPath.set = function (obj, path, value, doNotReplace){
  45993. return set(obj, path, value, doNotReplace);
  45994. };
  45995. objectPath.insert = function (obj, path, value, at){
  45996. var arr = objectPath.get(obj, path);
  45997. at = ~~at;
  45998. if (!isArray(arr)) {
  45999. arr = [];
  46000. objectPath.set(obj, path, arr);
  46001. }
  46002. arr.splice(at, 0, value);
  46003. };
  46004. objectPath.empty = function(obj, path) {
  46005. if (isEmpty(path)) {
  46006. return void 0;
  46007. }
  46008. if (obj == null) {
  46009. return void 0;
  46010. }
  46011. var value, i;
  46012. if (!(value = objectPath.get(obj, path))) {
  46013. return void 0;
  46014. }
  46015. if (typeof value === 'string') {
  46016. return objectPath.set(obj, path, '');
  46017. } else if (isBoolean(value)) {
  46018. return objectPath.set(obj, path, false);
  46019. } else if (typeof value === 'number') {
  46020. return objectPath.set(obj, path, 0);
  46021. } else if (isArray(value)) {
  46022. value.length = 0;
  46023. } else if (isObject(value)) {
  46024. for (i in value) {
  46025. if (hasShallowProperty(value, i)) {
  46026. delete value[i];
  46027. }
  46028. }
  46029. } else {
  46030. return objectPath.set(obj, path, null);
  46031. }
  46032. };
  46033. objectPath.push = function (obj, path /*, values */){
  46034. var arr = objectPath.get(obj, path);
  46035. if (!isArray(arr)) {
  46036. arr = [];
  46037. objectPath.set(obj, path, arr);
  46038. }
  46039. arr.push.apply(arr, Array.prototype.slice.call(arguments, 2));
  46040. };
  46041. objectPath.coalesce = function (obj, paths, defaultValue) {
  46042. var value;
  46043. for (var i = 0, len = paths.length; i < len; i++) {
  46044. if ((value = objectPath.get(obj, paths[i])) !== void 0) {
  46045. return value;
  46046. }
  46047. }
  46048. return defaultValue;
  46049. };
  46050. objectPath.get = function (obj, path, defaultValue){
  46051. if (typeof path === 'number') {
  46052. path = [path];
  46053. }
  46054. if (!path || path.length === 0) {
  46055. return obj;
  46056. }
  46057. if (obj == null) {
  46058. return defaultValue;
  46059. }
  46060. if (typeof path === 'string') {
  46061. return objectPath.get(obj, path.split('.'), defaultValue);
  46062. }
  46063. var currentPath = getKey(path[0]);
  46064. var nextObj = getShallowProperty(obj, currentPath)
  46065. if (nextObj === void 0) {
  46066. return defaultValue;
  46067. }
  46068. if (path.length === 1) {
  46069. return nextObj;
  46070. }
  46071. return objectPath.get(obj[currentPath], path.slice(1), defaultValue);
  46072. };
  46073. objectPath.del = function del(obj, path) {
  46074. if (typeof path === 'number') {
  46075. path = [path];
  46076. }
  46077. if (obj == null) {
  46078. return obj;
  46079. }
  46080. if (isEmpty(path)) {
  46081. return obj;
  46082. }
  46083. if(typeof path === 'string') {
  46084. return objectPath.del(obj, path.split('.'));
  46085. }
  46086. var currentPath = getKey(path[0]);
  46087. if (!hasShallowProperty(obj, currentPath)) {
  46088. return obj;
  46089. }
  46090. if(path.length === 1) {
  46091. if (isArray(obj)) {
  46092. obj.splice(currentPath, 1);
  46093. } else {
  46094. delete obj[currentPath];
  46095. }
  46096. } else {
  46097. return objectPath.del(obj[currentPath], path.slice(1));
  46098. }
  46099. return obj;
  46100. }
  46101. return objectPath;
  46102. }
  46103. var mod = factory();
  46104. mod.create = factory;
  46105. mod.withInheritedProps = factory({includeInheritedProps: true})
  46106. return mod;
  46107. });
  46108. /***/ }),
  46109. /* 245 */
  46110. /***/ (function(module, exports, __webpack_require__) {
  46111. "use strict";
  46112. function posix(path) {
  46113. return path.charAt(0) === '/';
  46114. }
  46115. function win32(path) {
  46116. // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
  46117. var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
  46118. var result = splitDeviceRe.exec(path);
  46119. var device = result[1] || '';
  46120. var isUnc = Boolean(device && device.charAt(1) !== ':');
  46121. // UNC paths are always absolute
  46122. return Boolean(result[2] || isUnc);
  46123. }
  46124. module.exports = process.platform === 'win32' ? win32 : posix;
  46125. module.exports.posix = posix;
  46126. module.exports.win32 = win32;
  46127. /***/ }),
  46128. /* 246 */
  46129. /***/ (function(module, exports, __webpack_require__) {
  46130. /* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */
  46131. ;(function(root) {
  46132. /** Detect free variables */
  46133. var freeExports = typeof exports == 'object' && exports &&
  46134. !exports.nodeType && exports;
  46135. var freeModule = typeof module == 'object' && module &&
  46136. !module.nodeType && module;
  46137. var freeGlobal = typeof global == 'object' && global;
  46138. if (
  46139. freeGlobal.global === freeGlobal ||
  46140. freeGlobal.window === freeGlobal ||
  46141. freeGlobal.self === freeGlobal
  46142. ) {
  46143. root = freeGlobal;
  46144. }
  46145. /**
  46146. * The `punycode` object.
  46147. * @name punycode
  46148. * @type Object
  46149. */
  46150. var punycode,
  46151. /** Highest positive signed 32-bit float value */
  46152. maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
  46153. /** Bootstring parameters */
  46154. base = 36,
  46155. tMin = 1,
  46156. tMax = 26,
  46157. skew = 38,
  46158. damp = 700,
  46159. initialBias = 72,
  46160. initialN = 128, // 0x80
  46161. delimiter = '-', // '\x2D'
  46162. /** Regular expressions */
  46163. regexPunycode = /^xn--/,
  46164. regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
  46165. regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
  46166. /** Error messages */
  46167. errors = {
  46168. 'overflow': 'Overflow: input needs wider integers to process',
  46169. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  46170. 'invalid-input': 'Invalid input'
  46171. },
  46172. /** Convenience shortcuts */
  46173. baseMinusTMin = base - tMin,
  46174. floor = Math.floor,
  46175. stringFromCharCode = String.fromCharCode,
  46176. /** Temporary variable */
  46177. key;
  46178. /*--------------------------------------------------------------------------*/
  46179. /**
  46180. * A generic error utility function.
  46181. * @private
  46182. * @param {String} type The error type.
  46183. * @returns {Error} Throws a `RangeError` with the applicable error message.
  46184. */
  46185. function error(type) {
  46186. throw new RangeError(errors[type]);
  46187. }
  46188. /**
  46189. * A generic `Array#map` utility function.
  46190. * @private
  46191. * @param {Array} array The array to iterate over.
  46192. * @param {Function} callback The function that gets called for every array
  46193. * item.
  46194. * @returns {Array} A new array of values returned by the callback function.
  46195. */
  46196. function map(array, fn) {
  46197. var length = array.length;
  46198. var result = [];
  46199. while (length--) {
  46200. result[length] = fn(array[length]);
  46201. }
  46202. return result;
  46203. }
  46204. /**
  46205. * A simple `Array#map`-like wrapper to work with domain name strings or email
  46206. * addresses.
  46207. * @private
  46208. * @param {String} domain The domain name or email address.
  46209. * @param {Function} callback The function that gets called for every
  46210. * character.
  46211. * @returns {Array} A new string of characters returned by the callback
  46212. * function.
  46213. */
  46214. function mapDomain(string, fn) {
  46215. var parts = string.split('@');
  46216. var result = '';
  46217. if (parts.length > 1) {
  46218. // In email addresses, only the domain name should be punycoded. Leave
  46219. // the local part (i.e. everything up to `@`) intact.
  46220. result = parts[0] + '@';
  46221. string = parts[1];
  46222. }
  46223. // Avoid `split(regex)` for IE8 compatibility. See #17.
  46224. string = string.replace(regexSeparators, '\x2E');
  46225. var labels = string.split('.');
  46226. var encoded = map(labels, fn).join('.');
  46227. return result + encoded;
  46228. }
  46229. /**
  46230. * Creates an array containing the numeric code points of each Unicode
  46231. * character in the string. While JavaScript uses UCS-2 internally,
  46232. * this function will convert a pair of surrogate halves (each of which
  46233. * UCS-2 exposes as separate characters) into a single code point,
  46234. * matching UTF-16.
  46235. * @see `punycode.ucs2.encode`
  46236. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  46237. * @memberOf punycode.ucs2
  46238. * @name decode
  46239. * @param {String} string The Unicode input string (UCS-2).
  46240. * @returns {Array} The new array of code points.
  46241. */
  46242. function ucs2decode(string) {
  46243. var output = [],
  46244. counter = 0,
  46245. length = string.length,
  46246. value,
  46247. extra;
  46248. while (counter < length) {
  46249. value = string.charCodeAt(counter++);
  46250. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  46251. // high surrogate, and there is a next character
  46252. extra = string.charCodeAt(counter++);
  46253. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  46254. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  46255. } else {
  46256. // unmatched surrogate; only append this code unit, in case the next
  46257. // code unit is the high surrogate of a surrogate pair
  46258. output.push(value);
  46259. counter--;
  46260. }
  46261. } else {
  46262. output.push(value);
  46263. }
  46264. }
  46265. return output;
  46266. }
  46267. /**
  46268. * Creates a string based on an array of numeric code points.
  46269. * @see `punycode.ucs2.decode`
  46270. * @memberOf punycode.ucs2
  46271. * @name encode
  46272. * @param {Array} codePoints The array of numeric code points.
  46273. * @returns {String} The new Unicode string (UCS-2).
  46274. */
  46275. function ucs2encode(array) {
  46276. return map(array, function(value) {
  46277. var output = '';
  46278. if (value > 0xFFFF) {
  46279. value -= 0x10000;
  46280. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  46281. value = 0xDC00 | value & 0x3FF;
  46282. }
  46283. output += stringFromCharCode(value);
  46284. return output;
  46285. }).join('');
  46286. }
  46287. /**
  46288. * Converts a basic code point into a digit/integer.
  46289. * @see `digitToBasic()`
  46290. * @private
  46291. * @param {Number} codePoint The basic numeric code point value.
  46292. * @returns {Number} The numeric value of a basic code point (for use in
  46293. * representing integers) in the range `0` to `base - 1`, or `base` if
  46294. * the code point does not represent a value.
  46295. */
  46296. function basicToDigit(codePoint) {
  46297. if (codePoint - 48 < 10) {
  46298. return codePoint - 22;
  46299. }
  46300. if (codePoint - 65 < 26) {
  46301. return codePoint - 65;
  46302. }
  46303. if (codePoint - 97 < 26) {
  46304. return codePoint - 97;
  46305. }
  46306. return base;
  46307. }
  46308. /**
  46309. * Converts a digit/integer into a basic code point.
  46310. * @see `basicToDigit()`
  46311. * @private
  46312. * @param {Number} digit The numeric value of a basic code point.
  46313. * @returns {Number} The basic code point whose value (when used for
  46314. * representing integers) is `digit`, which needs to be in the range
  46315. * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
  46316. * used; else, the lowercase form is used. The behavior is undefined
  46317. * if `flag` is non-zero and `digit` has no uppercase form.
  46318. */
  46319. function digitToBasic(digit, flag) {
  46320. // 0..25 map to ASCII a..z or A..Z
  46321. // 26..35 map to ASCII 0..9
  46322. return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
  46323. }
  46324. /**
  46325. * Bias adaptation function as per section 3.4 of RFC 3492.
  46326. * https://tools.ietf.org/html/rfc3492#section-3.4
  46327. * @private
  46328. */
  46329. function adapt(delta, numPoints, firstTime) {
  46330. var k = 0;
  46331. delta = firstTime ? floor(delta / damp) : delta >> 1;
  46332. delta += floor(delta / numPoints);
  46333. for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
  46334. delta = floor(delta / baseMinusTMin);
  46335. }
  46336. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  46337. }
  46338. /**
  46339. * Converts a Punycode string of ASCII-only symbols to a string of Unicode
  46340. * symbols.
  46341. * @memberOf punycode
  46342. * @param {String} input The Punycode string of ASCII-only symbols.
  46343. * @returns {String} The resulting string of Unicode symbols.
  46344. */
  46345. function decode(input) {
  46346. // Don't use UCS-2
  46347. var output = [],
  46348. inputLength = input.length,
  46349. out,
  46350. i = 0,
  46351. n = initialN,
  46352. bias = initialBias,
  46353. basic,
  46354. j,
  46355. index,
  46356. oldi,
  46357. w,
  46358. k,
  46359. digit,
  46360. t,
  46361. /** Cached calculation results */
  46362. baseMinusT;
  46363. // Handle the basic code points: let `basic` be the number of input code
  46364. // points before the last delimiter, or `0` if there is none, then copy
  46365. // the first basic code points to the output.
  46366. basic = input.lastIndexOf(delimiter);
  46367. if (basic < 0) {
  46368. basic = 0;
  46369. }
  46370. for (j = 0; j < basic; ++j) {
  46371. // if it's not a basic code point
  46372. if (input.charCodeAt(j) >= 0x80) {
  46373. error('not-basic');
  46374. }
  46375. output.push(input.charCodeAt(j));
  46376. }
  46377. // Main decoding loop: start just after the last delimiter if any basic code
  46378. // points were copied; start at the beginning otherwise.
  46379. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
  46380. // `index` is the index of the next character to be consumed.
  46381. // Decode a generalized variable-length integer into `delta`,
  46382. // which gets added to `i`. The overflow checking is easier
  46383. // if we increase `i` as we go, then subtract off its starting
  46384. // value at the end to obtain `delta`.
  46385. for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
  46386. if (index >= inputLength) {
  46387. error('invalid-input');
  46388. }
  46389. digit = basicToDigit(input.charCodeAt(index++));
  46390. if (digit >= base || digit > floor((maxInt - i) / w)) {
  46391. error('overflow');
  46392. }
  46393. i += digit * w;
  46394. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  46395. if (digit < t) {
  46396. break;
  46397. }
  46398. baseMinusT = base - t;
  46399. if (w > floor(maxInt / baseMinusT)) {
  46400. error('overflow');
  46401. }
  46402. w *= baseMinusT;
  46403. }
  46404. out = output.length + 1;
  46405. bias = adapt(i - oldi, out, oldi == 0);
  46406. // `i` was supposed to wrap around from `out` to `0`,
  46407. // incrementing `n` each time, so we'll fix that now:
  46408. if (floor(i / out) > maxInt - n) {
  46409. error('overflow');
  46410. }
  46411. n += floor(i / out);
  46412. i %= out;
  46413. // Insert `n` at position `i` of the output
  46414. output.splice(i++, 0, n);
  46415. }
  46416. return ucs2encode(output);
  46417. }
  46418. /**
  46419. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  46420. * Punycode string of ASCII-only symbols.
  46421. * @memberOf punycode
  46422. * @param {String} input The string of Unicode symbols.
  46423. * @returns {String} The resulting Punycode string of ASCII-only symbols.
  46424. */
  46425. function encode(input) {
  46426. var n,
  46427. delta,
  46428. handledCPCount,
  46429. basicLength,
  46430. bias,
  46431. j,
  46432. m,
  46433. q,
  46434. k,
  46435. t,
  46436. currentValue,
  46437. output = [],
  46438. /** `inputLength` will hold the number of code points in `input`. */
  46439. inputLength,
  46440. /** Cached calculation results */
  46441. handledCPCountPlusOne,
  46442. baseMinusT,
  46443. qMinusT;
  46444. // Convert the input in UCS-2 to Unicode
  46445. input = ucs2decode(input);
  46446. // Cache the length
  46447. inputLength = input.length;
  46448. // Initialize the state
  46449. n = initialN;
  46450. delta = 0;
  46451. bias = initialBias;
  46452. // Handle the basic code points
  46453. for (j = 0; j < inputLength; ++j) {
  46454. currentValue = input[j];
  46455. if (currentValue < 0x80) {
  46456. output.push(stringFromCharCode(currentValue));
  46457. }
  46458. }
  46459. handledCPCount = basicLength = output.length;
  46460. // `handledCPCount` is the number of code points that have been handled;
  46461. // `basicLength` is the number of basic code points.
  46462. // Finish the basic string - if it is not empty - with a delimiter
  46463. if (basicLength) {
  46464. output.push(delimiter);
  46465. }
  46466. // Main encoding loop:
  46467. while (handledCPCount < inputLength) {
  46468. // All non-basic code points < n have been handled already. Find the next
  46469. // larger one:
  46470. for (m = maxInt, j = 0; j < inputLength; ++j) {
  46471. currentValue = input[j];
  46472. if (currentValue >= n && currentValue < m) {
  46473. m = currentValue;
  46474. }
  46475. }
  46476. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
  46477. // but guard against overflow
  46478. handledCPCountPlusOne = handledCPCount + 1;
  46479. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  46480. error('overflow');
  46481. }
  46482. delta += (m - n) * handledCPCountPlusOne;
  46483. n = m;
  46484. for (j = 0; j < inputLength; ++j) {
  46485. currentValue = input[j];
  46486. if (currentValue < n && ++delta > maxInt) {
  46487. error('overflow');
  46488. }
  46489. if (currentValue == n) {
  46490. // Represent delta as a generalized variable-length integer
  46491. for (q = delta, k = base; /* no condition */; k += base) {
  46492. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  46493. if (q < t) {
  46494. break;
  46495. }
  46496. qMinusT = q - t;
  46497. baseMinusT = base - t;
  46498. output.push(
  46499. stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
  46500. );
  46501. q = floor(qMinusT / baseMinusT);
  46502. }
  46503. output.push(stringFromCharCode(digitToBasic(q, 0)));
  46504. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  46505. delta = 0;
  46506. ++handledCPCount;
  46507. }
  46508. }
  46509. ++delta;
  46510. ++n;
  46511. }
  46512. return output.join('');
  46513. }
  46514. /**
  46515. * Converts a Punycode string representing a domain name or an email address
  46516. * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
  46517. * it doesn't matter if you call it on a string that has already been
  46518. * converted to Unicode.
  46519. * @memberOf punycode
  46520. * @param {String} input The Punycoded domain name or email address to
  46521. * convert to Unicode.
  46522. * @returns {String} The Unicode representation of the given Punycode
  46523. * string.
  46524. */
  46525. function toUnicode(input) {
  46526. return mapDomain(input, function(string) {
  46527. return regexPunycode.test(string)
  46528. ? decode(string.slice(4).toLowerCase())
  46529. : string;
  46530. });
  46531. }
  46532. /**
  46533. * Converts a Unicode string representing a domain name or an email address to
  46534. * Punycode. Only the non-ASCII parts of the domain name will be converted,
  46535. * i.e. it doesn't matter if you call it with a domain that's already in
  46536. * ASCII.
  46537. * @memberOf punycode
  46538. * @param {String} input The domain name or email address to convert, as a
  46539. * Unicode string.
  46540. * @returns {String} The Punycode representation of the given domain name or
  46541. * email address.
  46542. */
  46543. function toASCII(input) {
  46544. return mapDomain(input, function(string) {
  46545. return regexNonASCII.test(string)
  46546. ? 'xn--' + encode(string)
  46547. : string;
  46548. });
  46549. }
  46550. /*--------------------------------------------------------------------------*/
  46551. /** Define the public API */
  46552. punycode = {
  46553. /**
  46554. * A string representing the current Punycode.js version number.
  46555. * @memberOf punycode
  46556. * @type String
  46557. */
  46558. 'version': '1.4.1',
  46559. /**
  46560. * An object of methods to convert from JavaScript's internal character
  46561. * representation (UCS-2) to Unicode code points, and back.
  46562. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  46563. * @memberOf punycode
  46564. * @type Object
  46565. */
  46566. 'ucs2': {
  46567. 'decode': ucs2decode,
  46568. 'encode': ucs2encode
  46569. },
  46570. 'decode': decode,
  46571. 'encode': encode,
  46572. 'toASCII': toASCII,
  46573. 'toUnicode': toUnicode
  46574. };
  46575. /** Expose `punycode` */
  46576. // Some AMD build optimizers, like r.js, check for specific condition patterns
  46577. // like the following:
  46578. if (
  46579. true
  46580. ) {
  46581. !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
  46582. return punycode;
  46583. }.call(exports, __webpack_require__, exports, module),
  46584. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  46585. } else if (freeExports && freeModule) {
  46586. if (module.exports == freeExports) {
  46587. // in Node.js, io.js, or RingoJS v0.8.0+
  46588. freeModule.exports = punycode;
  46589. } else {
  46590. // in Narwhal or RingoJS v0.7.0-
  46591. for (key in punycode) {
  46592. punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
  46593. }
  46594. }
  46595. } else {
  46596. // in Rhino or a web browser
  46597. root.punycode = punycode;
  46598. }
  46599. }(this));
  46600. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(115)(module)))
  46601. /***/ }),
  46602. /* 247 */
  46603. /***/ (function(module, exports, __webpack_require__) {
  46604. "use strict";
  46605. var jsonSafeStringify = __webpack_require__(816)
  46606. var crypto = __webpack_require__(21)
  46607. var Buffer = __webpack_require__(60).Buffer
  46608. var defer = typeof setImmediate === 'undefined'
  46609. ? process.nextTick
  46610. : setImmediate
  46611. function paramsHaveRequestBody (params) {
  46612. return (
  46613. params.body ||
  46614. params.requestBodyStream ||
  46615. (params.json && typeof params.json !== 'boolean') ||
  46616. params.multipart
  46617. )
  46618. }
  46619. function safeStringify (obj, replacer) {
  46620. var ret
  46621. try {
  46622. ret = JSON.stringify(obj, replacer)
  46623. } catch (e) {
  46624. ret = jsonSafeStringify(obj, replacer)
  46625. }
  46626. return ret
  46627. }
  46628. function md5 (str) {
  46629. return crypto.createHash('md5').update(str).digest('hex')
  46630. }
  46631. function isReadStream (rs) {
  46632. return rs.readable && rs.path && rs.mode
  46633. }
  46634. function toBase64 (str) {
  46635. return Buffer.from(str || '', 'utf8').toString('base64')
  46636. }
  46637. function copy (obj) {
  46638. var o = {}
  46639. Object.keys(obj).forEach(function (i) {
  46640. o[i] = obj[i]
  46641. })
  46642. return o
  46643. }
  46644. function version () {
  46645. var numbers = process.version.replace('v', '').split('.')
  46646. return {
  46647. major: parseInt(numbers[0], 10),
  46648. minor: parseInt(numbers[1], 10),
  46649. patch: parseInt(numbers[2], 10)
  46650. }
  46651. }
  46652. exports.paramsHaveRequestBody = paramsHaveRequestBody
  46653. exports.safeStringify = safeStringify
  46654. exports.md5 = md5
  46655. exports.isReadStream = isReadStream
  46656. exports.toBase64 = toBase64
  46657. exports.copy = copy
  46658. exports.version = version
  46659. exports.defer = defer
  46660. /***/ }),
  46661. /* 248 */
  46662. /***/ (function(module, exports, __webpack_require__) {
  46663. var current = (process.versions && process.versions.node && process.versions.node.split('.')) || [];
  46664. function specifierIncluded(specifier) {
  46665. var parts = specifier.split(' ');
  46666. var op = parts.length > 1 ? parts[0] : '=';
  46667. var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
  46668. for (var i = 0; i < 3; ++i) {
  46669. var cur = Number(current[i] || 0);
  46670. var ver = Number(versionParts[i] || 0);
  46671. if (cur === ver) {
  46672. continue; // eslint-disable-line no-restricted-syntax, no-continue
  46673. }
  46674. if (op === '<') {
  46675. return cur < ver;
  46676. } else if (op === '>=') {
  46677. return cur >= ver;
  46678. } else {
  46679. return false;
  46680. }
  46681. }
  46682. return op === '>=';
  46683. }
  46684. function matchesRange(range) {
  46685. var specifiers = range.split(/ ?&& ?/);
  46686. if (specifiers.length === 0) { return false; }
  46687. for (var i = 0; i < specifiers.length; ++i) {
  46688. if (!specifierIncluded(specifiers[i])) { return false; }
  46689. }
  46690. return true;
  46691. }
  46692. function versionIncluded(specifierValue) {
  46693. if (typeof specifierValue === 'boolean') { return specifierValue; }
  46694. if (specifierValue && typeof specifierValue === 'object') {
  46695. for (var i = 0; i < specifierValue.length; ++i) {
  46696. if (matchesRange(specifierValue[i])) { return true; }
  46697. }
  46698. return false;
  46699. }
  46700. return matchesRange(specifierValue);
  46701. }
  46702. var data = __webpack_require__(888);
  46703. var core = {};
  46704. for (var mod in data) { // eslint-disable-line no-restricted-syntax
  46705. if (Object.prototype.hasOwnProperty.call(data, mod)) {
  46706. core[mod] = versionIncluded(data[mod]);
  46707. }
  46708. }
  46709. module.exports = core;
  46710. /***/ }),
  46711. /* 249 */
  46712. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46713. "use strict";
  46714. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ReplaySubject; });
  46715. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  46716. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
  46717. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_queue__ = __webpack_require__(409);
  46718. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(31);
  46719. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__operators_observeOn__ = __webpack_require__(404);
  46720. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_ObjectUnsubscribedError__ = __webpack_require__(180);
  46721. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__SubjectSubscription__ = __webpack_require__(392);
  46722. /** PURE_IMPORTS_START tslib,_Subject,_scheduler_queue,_Subscription,_operators_observeOn,_util_ObjectUnsubscribedError,_SubjectSubscription PURE_IMPORTS_END */
  46723. var ReplaySubject = /*@__PURE__*/ (function (_super) {
  46724. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ReplaySubject, _super);
  46725. function ReplaySubject(bufferSize, windowTime, scheduler) {
  46726. if (bufferSize === void 0) {
  46727. bufferSize = Number.POSITIVE_INFINITY;
  46728. }
  46729. if (windowTime === void 0) {
  46730. windowTime = Number.POSITIVE_INFINITY;
  46731. }
  46732. var _this = _super.call(this) || this;
  46733. _this.scheduler = scheduler;
  46734. _this._events = [];
  46735. _this._infiniteTimeWindow = false;
  46736. _this._bufferSize = bufferSize < 1 ? 1 : bufferSize;
  46737. _this._windowTime = windowTime < 1 ? 1 : windowTime;
  46738. if (windowTime === Number.POSITIVE_INFINITY) {
  46739. _this._infiniteTimeWindow = true;
  46740. _this.next = _this.nextInfiniteTimeWindow;
  46741. }
  46742. else {
  46743. _this.next = _this.nextTimeWindow;
  46744. }
  46745. return _this;
  46746. }
  46747. ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) {
  46748. var _events = this._events;
  46749. _events.push(value);
  46750. if (_events.length > this._bufferSize) {
  46751. _events.shift();
  46752. }
  46753. _super.prototype.next.call(this, value);
  46754. };
  46755. ReplaySubject.prototype.nextTimeWindow = function (value) {
  46756. this._events.push(new ReplayEvent(this._getNow(), value));
  46757. this._trimBufferThenGetEvents();
  46758. _super.prototype.next.call(this, value);
  46759. };
  46760. ReplaySubject.prototype._subscribe = function (subscriber) {
  46761. var _infiniteTimeWindow = this._infiniteTimeWindow;
  46762. var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();
  46763. var scheduler = this.scheduler;
  46764. var len = _events.length;
  46765. var subscription;
  46766. if (this.closed) {
  46767. throw new __WEBPACK_IMPORTED_MODULE_5__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
  46768. }
  46769. else if (this.isStopped || this.hasError) {
  46770. subscription = __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY;
  46771. }
  46772. else {
  46773. this.observers.push(subscriber);
  46774. subscription = new __WEBPACK_IMPORTED_MODULE_6__SubjectSubscription__["a" /* SubjectSubscription */](this, subscriber);
  46775. }
  46776. if (scheduler) {
  46777. subscriber.add(subscriber = new __WEBPACK_IMPORTED_MODULE_4__operators_observeOn__["a" /* ObserveOnSubscriber */](subscriber, scheduler));
  46778. }
  46779. if (_infiniteTimeWindow) {
  46780. for (var i = 0; i < len && !subscriber.closed; i++) {
  46781. subscriber.next(_events[i]);
  46782. }
  46783. }
  46784. else {
  46785. for (var i = 0; i < len && !subscriber.closed; i++) {
  46786. subscriber.next(_events[i].value);
  46787. }
  46788. }
  46789. if (this.hasError) {
  46790. subscriber.error(this.thrownError);
  46791. }
  46792. else if (this.isStopped) {
  46793. subscriber.complete();
  46794. }
  46795. return subscription;
  46796. };
  46797. ReplaySubject.prototype._getNow = function () {
  46798. return (this.scheduler || __WEBPACK_IMPORTED_MODULE_2__scheduler_queue__["a" /* queue */]).now();
  46799. };
  46800. ReplaySubject.prototype._trimBufferThenGetEvents = function () {
  46801. var now = this._getNow();
  46802. var _bufferSize = this._bufferSize;
  46803. var _windowTime = this._windowTime;
  46804. var _events = this._events;
  46805. var eventsCount = _events.length;
  46806. var spliceCount = 0;
  46807. while (spliceCount < eventsCount) {
  46808. if ((now - _events[spliceCount].time) < _windowTime) {
  46809. break;
  46810. }
  46811. spliceCount++;
  46812. }
  46813. if (eventsCount > _bufferSize) {
  46814. spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);
  46815. }
  46816. if (spliceCount > 0) {
  46817. _events.splice(0, spliceCount);
  46818. }
  46819. return _events;
  46820. };
  46821. return ReplaySubject;
  46822. }(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]));
  46823. var ReplayEvent = /*@__PURE__*/ (function () {
  46824. function ReplayEvent(time, value) {
  46825. this.time = time;
  46826. this.value = value;
  46827. }
  46828. return ReplayEvent;
  46829. }());
  46830. //# sourceMappingURL=ReplaySubject.js.map
  46831. /***/ }),
  46832. /* 250 */
  46833. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46834. "use strict";
  46835. /* harmony export (immutable) */ __webpack_exports__["a"] = combineLatest;
  46836. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CombineLatestOperator; });
  46837. /* unused harmony export CombineLatestSubscriber */
  46838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  46839. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isScheduler__ = __webpack_require__(56);
  46840. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48);
  46841. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
  46842. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
  46843. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fromArray__ = __webpack_require__(81);
  46844. /** PURE_IMPORTS_START tslib,_util_isScheduler,_util_isArray,_OuterSubscriber,_util_subscribeToResult,_fromArray PURE_IMPORTS_END */
  46845. var NONE = {};
  46846. function combineLatest() {
  46847. var observables = [];
  46848. for (var _i = 0; _i < arguments.length; _i++) {
  46849. observables[_i] = arguments[_i];
  46850. }
  46851. var resultSelector = null;
  46852. var scheduler = null;
  46853. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isScheduler__["a" /* isScheduler */])(observables[observables.length - 1])) {
  46854. scheduler = observables.pop();
  46855. }
  46856. if (typeof observables[observables.length - 1] === 'function') {
  46857. resultSelector = observables.pop();
  46858. }
  46859. if (observables.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(observables[0])) {
  46860. observables = observables[0];
  46861. }
  46862. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__fromArray__["a" /* fromArray */])(observables, scheduler).lift(new CombineLatestOperator(resultSelector));
  46863. }
  46864. var CombineLatestOperator = /*@__PURE__*/ (function () {
  46865. function CombineLatestOperator(resultSelector) {
  46866. this.resultSelector = resultSelector;
  46867. }
  46868. CombineLatestOperator.prototype.call = function (subscriber, source) {
  46869. return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));
  46870. };
  46871. return CombineLatestOperator;
  46872. }());
  46873. var CombineLatestSubscriber = /*@__PURE__*/ (function (_super) {
  46874. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](CombineLatestSubscriber, _super);
  46875. function CombineLatestSubscriber(destination, resultSelector) {
  46876. var _this = _super.call(this, destination) || this;
  46877. _this.resultSelector = resultSelector;
  46878. _this.active = 0;
  46879. _this.values = [];
  46880. _this.observables = [];
  46881. return _this;
  46882. }
  46883. CombineLatestSubscriber.prototype._next = function (observable) {
  46884. this.values.push(NONE);
  46885. this.observables.push(observable);
  46886. };
  46887. CombineLatestSubscriber.prototype._complete = function () {
  46888. var observables = this.observables;
  46889. var len = observables.length;
  46890. if (len === 0) {
  46891. this.destination.complete();
  46892. }
  46893. else {
  46894. this.active = len;
  46895. this.toRespond = len;
  46896. for (var i = 0; i < len; i++) {
  46897. var observable = observables[i];
  46898. this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, observable, observable, i));
  46899. }
  46900. }
  46901. };
  46902. CombineLatestSubscriber.prototype.notifyComplete = function (unused) {
  46903. if ((this.active -= 1) === 0) {
  46904. this.destination.complete();
  46905. }
  46906. };
  46907. CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  46908. var values = this.values;
  46909. var oldVal = values[outerIndex];
  46910. var toRespond = !this.toRespond
  46911. ? 0
  46912. : oldVal === NONE ? --this.toRespond : this.toRespond;
  46913. values[outerIndex] = innerValue;
  46914. if (toRespond === 0) {
  46915. if (this.resultSelector) {
  46916. this._tryResultSelector(values);
  46917. }
  46918. else {
  46919. this.destination.next(values.slice());
  46920. }
  46921. }
  46922. };
  46923. CombineLatestSubscriber.prototype._tryResultSelector = function (values) {
  46924. var result;
  46925. try {
  46926. result = this.resultSelector.apply(this, values);
  46927. }
  46928. catch (err) {
  46929. this.destination.error(err);
  46930. return;
  46931. }
  46932. this.destination.next(result);
  46933. };
  46934. return CombineLatestSubscriber;
  46935. }(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
  46936. //# sourceMappingURL=combineLatest.js.map
  46937. /***/ }),
  46938. /* 251 */
  46939. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46940. "use strict";
  46941. /* harmony export (immutable) */ __webpack_exports__["a"] = defer;
  46942. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  46943. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__from__ = __webpack_require__(64);
  46944. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__empty__ = __webpack_require__(46);
  46945. /** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */
  46946. function defer(observableFactory) {
  46947. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  46948. var input;
  46949. try {
  46950. input = observableFactory();
  46951. }
  46952. catch (err) {
  46953. subscriber.error(err);
  46954. return undefined;
  46955. }
  46956. var source = input ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__from__["a" /* from */])(input) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__empty__["a" /* empty */])();
  46957. return source.subscribe(subscriber);
  46958. });
  46959. }
  46960. //# sourceMappingURL=defer.js.map
  46961. /***/ }),
  46962. /* 252 */
  46963. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46964. "use strict";
  46965. /* harmony export (immutable) */ __webpack_exports__["a"] = of;
  46966. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isScheduler__ = __webpack_require__(56);
  46967. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__fromArray__ = __webpack_require__(81);
  46968. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__empty__ = __webpack_require__(46);
  46969. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__scalar__ = __webpack_require__(253);
  46970. /** PURE_IMPORTS_START _util_isScheduler,_fromArray,_empty,_scalar PURE_IMPORTS_END */
  46971. function of() {
  46972. var args = [];
  46973. for (var _i = 0; _i < arguments.length; _i++) {
  46974. args[_i] = arguments[_i];
  46975. }
  46976. var scheduler = args[args.length - 1];
  46977. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isScheduler__["a" /* isScheduler */])(scheduler)) {
  46978. args.pop();
  46979. }
  46980. else {
  46981. scheduler = undefined;
  46982. }
  46983. switch (args.length) {
  46984. case 0:
  46985. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__empty__["a" /* empty */])(scheduler);
  46986. case 1:
  46987. return scheduler ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__fromArray__["a" /* fromArray */])(args, scheduler) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__scalar__["a" /* scalar */])(args[0]);
  46988. default:
  46989. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__fromArray__["a" /* fromArray */])(args, scheduler);
  46990. }
  46991. }
  46992. //# sourceMappingURL=of.js.map
  46993. /***/ }),
  46994. /* 253 */
  46995. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46996. "use strict";
  46997. /* harmony export (immutable) */ __webpack_exports__["a"] = scalar;
  46998. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  46999. /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
  47000. function scalar(value) {
  47001. var result = new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  47002. subscriber.next(value);
  47003. subscriber.complete();
  47004. });
  47005. result._isScalar = true;
  47006. result.value = value;
  47007. return result;
  47008. }
  47009. //# sourceMappingURL=scalar.js.map
  47010. /***/ }),
  47011. /* 254 */
  47012. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47013. "use strict";
  47014. /* harmony export (immutable) */ __webpack_exports__["a"] = throwError;
  47015. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  47016. /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
  47017. function throwError(error, scheduler) {
  47018. if (!scheduler) {
  47019. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return subscriber.error(error); });
  47020. }
  47021. else {
  47022. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); });
  47023. }
  47024. }
  47025. function dispatch(_a) {
  47026. var error = _a.error, subscriber = _a.subscriber;
  47027. subscriber.error(error);
  47028. }
  47029. //# sourceMappingURL=throwError.js.map
  47030. /***/ }),
  47031. /* 255 */
  47032. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47033. "use strict";
  47034. /* harmony export (immutable) */ __webpack_exports__["a"] = zip;
  47035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ZipOperator; });
  47036. /* unused harmony export ZipSubscriber */
  47037. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  47038. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__fromArray__ = __webpack_require__(81);
  47039. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48);
  47040. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(5);
  47041. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
  47042. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
  47043. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__ = __webpack_require__(140);
  47044. /** PURE_IMPORTS_START tslib,_fromArray,_util_isArray,_Subscriber,_OuterSubscriber,_util_subscribeToResult,_.._internal_symbol_iterator PURE_IMPORTS_END */
  47045. function zip() {
  47046. var observables = [];
  47047. for (var _i = 0; _i < arguments.length; _i++) {
  47048. observables[_i] = arguments[_i];
  47049. }
  47050. var resultSelector = observables[observables.length - 1];
  47051. if (typeof resultSelector === 'function') {
  47052. observables.pop();
  47053. }
  47054. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__fromArray__["a" /* fromArray */])(observables, undefined).lift(new ZipOperator(resultSelector));
  47055. }
  47056. var ZipOperator = /*@__PURE__*/ (function () {
  47057. function ZipOperator(resultSelector) {
  47058. this.resultSelector = resultSelector;
  47059. }
  47060. ZipOperator.prototype.call = function (subscriber, source) {
  47061. return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));
  47062. };
  47063. return ZipOperator;
  47064. }());
  47065. var ZipSubscriber = /*@__PURE__*/ (function (_super) {
  47066. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ZipSubscriber, _super);
  47067. function ZipSubscriber(destination, resultSelector, values) {
  47068. if (values === void 0) {
  47069. values = Object.create(null);
  47070. }
  47071. var _this = _super.call(this, destination) || this;
  47072. _this.iterators = [];
  47073. _this.active = 0;
  47074. _this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : null;
  47075. _this.values = values;
  47076. return _this;
  47077. }
  47078. ZipSubscriber.prototype._next = function (value) {
  47079. var iterators = this.iterators;
  47080. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(value)) {
  47081. iterators.push(new StaticArrayIterator(value));
  47082. }
  47083. else if (typeof value[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]] === 'function') {
  47084. iterators.push(new StaticIterator(value[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]]()));
  47085. }
  47086. else {
  47087. iterators.push(new ZipBufferIterator(this.destination, this, value));
  47088. }
  47089. };
  47090. ZipSubscriber.prototype._complete = function () {
  47091. var iterators = this.iterators;
  47092. var len = iterators.length;
  47093. this.unsubscribe();
  47094. if (len === 0) {
  47095. this.destination.complete();
  47096. return;
  47097. }
  47098. this.active = len;
  47099. for (var i = 0; i < len; i++) {
  47100. var iterator = iterators[i];
  47101. if (iterator.stillUnsubscribed) {
  47102. var destination = this.destination;
  47103. destination.add(iterator.subscribe(iterator, i));
  47104. }
  47105. else {
  47106. this.active--;
  47107. }
  47108. }
  47109. };
  47110. ZipSubscriber.prototype.notifyInactive = function () {
  47111. this.active--;
  47112. if (this.active === 0) {
  47113. this.destination.complete();
  47114. }
  47115. };
  47116. ZipSubscriber.prototype.checkIterators = function () {
  47117. var iterators = this.iterators;
  47118. var len = iterators.length;
  47119. var destination = this.destination;
  47120. for (var i = 0; i < len; i++) {
  47121. var iterator = iterators[i];
  47122. if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {
  47123. return;
  47124. }
  47125. }
  47126. var shouldComplete = false;
  47127. var args = [];
  47128. for (var i = 0; i < len; i++) {
  47129. var iterator = iterators[i];
  47130. var result = iterator.next();
  47131. if (iterator.hasCompleted()) {
  47132. shouldComplete = true;
  47133. }
  47134. if (result.done) {
  47135. destination.complete();
  47136. return;
  47137. }
  47138. args.push(result.value);
  47139. }
  47140. if (this.resultSelector) {
  47141. this._tryresultSelector(args);
  47142. }
  47143. else {
  47144. destination.next(args);
  47145. }
  47146. if (shouldComplete) {
  47147. destination.complete();
  47148. }
  47149. };
  47150. ZipSubscriber.prototype._tryresultSelector = function (args) {
  47151. var result;
  47152. try {
  47153. result = this.resultSelector.apply(this, args);
  47154. }
  47155. catch (err) {
  47156. this.destination.error(err);
  47157. return;
  47158. }
  47159. this.destination.next(result);
  47160. };
  47161. return ZipSubscriber;
  47162. }(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* Subscriber */]));
  47163. var StaticIterator = /*@__PURE__*/ (function () {
  47164. function StaticIterator(iterator) {
  47165. this.iterator = iterator;
  47166. this.nextResult = iterator.next();
  47167. }
  47168. StaticIterator.prototype.hasValue = function () {
  47169. return true;
  47170. };
  47171. StaticIterator.prototype.next = function () {
  47172. var result = this.nextResult;
  47173. this.nextResult = this.iterator.next();
  47174. return result;
  47175. };
  47176. StaticIterator.prototype.hasCompleted = function () {
  47177. var nextResult = this.nextResult;
  47178. return nextResult && nextResult.done;
  47179. };
  47180. return StaticIterator;
  47181. }());
  47182. var StaticArrayIterator = /*@__PURE__*/ (function () {
  47183. function StaticArrayIterator(array) {
  47184. this.array = array;
  47185. this.index = 0;
  47186. this.length = 0;
  47187. this.length = array.length;
  47188. }
  47189. StaticArrayIterator.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]] = function () {
  47190. return this;
  47191. };
  47192. StaticArrayIterator.prototype.next = function (value) {
  47193. var i = this.index++;
  47194. var array = this.array;
  47195. return i < this.length ? { value: array[i], done: false } : { value: null, done: true };
  47196. };
  47197. StaticArrayIterator.prototype.hasValue = function () {
  47198. return this.array.length > this.index;
  47199. };
  47200. StaticArrayIterator.prototype.hasCompleted = function () {
  47201. return this.array.length === this.index;
  47202. };
  47203. return StaticArrayIterator;
  47204. }());
  47205. var ZipBufferIterator = /*@__PURE__*/ (function (_super) {
  47206. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ZipBufferIterator, _super);
  47207. function ZipBufferIterator(destination, parent, observable) {
  47208. var _this = _super.call(this, destination) || this;
  47209. _this.parent = parent;
  47210. _this.observable = observable;
  47211. _this.stillUnsubscribed = true;
  47212. _this.buffer = [];
  47213. _this.isComplete = false;
  47214. return _this;
  47215. }
  47216. ZipBufferIterator.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]] = function () {
  47217. return this;
  47218. };
  47219. ZipBufferIterator.prototype.next = function () {
  47220. var buffer = this.buffer;
  47221. if (buffer.length === 0 && this.isComplete) {
  47222. return { value: null, done: true };
  47223. }
  47224. else {
  47225. return { value: buffer.shift(), done: false };
  47226. }
  47227. };
  47228. ZipBufferIterator.prototype.hasValue = function () {
  47229. return this.buffer.length > 0;
  47230. };
  47231. ZipBufferIterator.prototype.hasCompleted = function () {
  47232. return this.buffer.length === 0 && this.isComplete;
  47233. };
  47234. ZipBufferIterator.prototype.notifyComplete = function () {
  47235. if (this.buffer.length > 0) {
  47236. this.isComplete = true;
  47237. this.parent.notifyInactive();
  47238. }
  47239. else {
  47240. this.destination.complete();
  47241. }
  47242. };
  47243. ZipBufferIterator.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  47244. this.buffer.push(innerValue);
  47245. this.parent.checkIterators();
  47246. };
  47247. ZipBufferIterator.prototype.subscribe = function (value, index) {
  47248. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, this.observable, this, index);
  47249. };
  47250. return ZipBufferIterator;
  47251. }(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
  47252. //# sourceMappingURL=zip.js.map
  47253. /***/ }),
  47254. /* 256 */
  47255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47256. "use strict";
  47257. /* harmony export (immutable) */ __webpack_exports__["a"] = mergeAll;
  47258. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeMap__ = __webpack_require__(137);
  47259. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_identity__ = __webpack_require__(113);
  47260. /** PURE_IMPORTS_START _mergeMap,_util_identity PURE_IMPORTS_END */
  47261. function mergeAll(concurrent) {
  47262. if (concurrent === void 0) {
  47263. concurrent = Number.POSITIVE_INFINITY;
  47264. }
  47265. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(__WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */], concurrent);
  47266. }
  47267. //# sourceMappingURL=mergeAll.js.map
  47268. /***/ }),
  47269. /* 257 */
  47270. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47271. "use strict";
  47272. /* harmony export (immutable) */ __webpack_exports__["a"] = refCount;
  47273. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  47274. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  47275. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  47276. function refCount() {
  47277. return function refCountOperatorFunction(source) {
  47278. return source.lift(new RefCountOperator(source));
  47279. };
  47280. }
  47281. var RefCountOperator = /*@__PURE__*/ (function () {
  47282. function RefCountOperator(connectable) {
  47283. this.connectable = connectable;
  47284. }
  47285. RefCountOperator.prototype.call = function (subscriber, source) {
  47286. var connectable = this.connectable;
  47287. connectable._refCount++;
  47288. var refCounter = new RefCountSubscriber(subscriber, connectable);
  47289. var subscription = source.subscribe(refCounter);
  47290. if (!refCounter.closed) {
  47291. refCounter.connection = connectable.connect();
  47292. }
  47293. return subscription;
  47294. };
  47295. return RefCountOperator;
  47296. }());
  47297. var RefCountSubscriber = /*@__PURE__*/ (function (_super) {
  47298. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RefCountSubscriber, _super);
  47299. function RefCountSubscriber(destination, connectable) {
  47300. var _this = _super.call(this, destination) || this;
  47301. _this.connectable = connectable;
  47302. return _this;
  47303. }
  47304. RefCountSubscriber.prototype._unsubscribe = function () {
  47305. var connectable = this.connectable;
  47306. if (!connectable) {
  47307. this.connection = null;
  47308. return;
  47309. }
  47310. this.connectable = null;
  47311. var refCount = connectable._refCount;
  47312. if (refCount <= 0) {
  47313. this.connection = null;
  47314. return;
  47315. }
  47316. connectable._refCount = refCount - 1;
  47317. if (refCount > 1) {
  47318. this.connection = null;
  47319. return;
  47320. }
  47321. var connection = this.connection;
  47322. var sharedConnection = connectable._connection;
  47323. this.connection = null;
  47324. if (sharedConnection && (!connection || sharedConnection === connection)) {
  47325. sharedConnection.unsubscribe();
  47326. }
  47327. };
  47328. return RefCountSubscriber;
  47329. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  47330. //# sourceMappingURL=refCount.js.map
  47331. /***/ }),
  47332. /* 258 */
  47333. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47334. "use strict";
  47335. /* harmony export (immutable) */ __webpack_exports__["a"] = scan;
  47336. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  47337. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  47338. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  47339. function scan(accumulator, seed) {
  47340. var hasSeed = false;
  47341. if (arguments.length >= 2) {
  47342. hasSeed = true;
  47343. }
  47344. return function scanOperatorFunction(source) {
  47345. return source.lift(new ScanOperator(accumulator, seed, hasSeed));
  47346. };
  47347. }
  47348. var ScanOperator = /*@__PURE__*/ (function () {
  47349. function ScanOperator(accumulator, seed, hasSeed) {
  47350. if (hasSeed === void 0) {
  47351. hasSeed = false;
  47352. }
  47353. this.accumulator = accumulator;
  47354. this.seed = seed;
  47355. this.hasSeed = hasSeed;
  47356. }
  47357. ScanOperator.prototype.call = function (subscriber, source) {
  47358. return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));
  47359. };
  47360. return ScanOperator;
  47361. }());
  47362. var ScanSubscriber = /*@__PURE__*/ (function (_super) {
  47363. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ScanSubscriber, _super);
  47364. function ScanSubscriber(destination, accumulator, _seed, hasSeed) {
  47365. var _this = _super.call(this, destination) || this;
  47366. _this.accumulator = accumulator;
  47367. _this._seed = _seed;
  47368. _this.hasSeed = hasSeed;
  47369. _this.index = 0;
  47370. return _this;
  47371. }
  47372. Object.defineProperty(ScanSubscriber.prototype, "seed", {
  47373. get: function () {
  47374. return this._seed;
  47375. },
  47376. set: function (value) {
  47377. this.hasSeed = true;
  47378. this._seed = value;
  47379. },
  47380. enumerable: true,
  47381. configurable: true
  47382. });
  47383. ScanSubscriber.prototype._next = function (value) {
  47384. if (!this.hasSeed) {
  47385. this.seed = value;
  47386. this.destination.next(value);
  47387. }
  47388. else {
  47389. return this._tryNext(value);
  47390. }
  47391. };
  47392. ScanSubscriber.prototype._tryNext = function (value) {
  47393. var index = this.index++;
  47394. var result;
  47395. try {
  47396. result = this.accumulator(this.seed, value, index);
  47397. }
  47398. catch (err) {
  47399. this.destination.error(err);
  47400. }
  47401. this.seed = result;
  47402. this.destination.next(result);
  47403. };
  47404. return ScanSubscriber;
  47405. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  47406. //# sourceMappingURL=scan.js.map
  47407. /***/ }),
  47408. /* 259 */
  47409. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47410. "use strict";
  47411. /* harmony export (immutable) */ __webpack_exports__["a"] = switchMap;
  47412. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  47413. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  47414. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(80);
  47415. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
  47416. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(54);
  47417. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(64);
  47418. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */
  47419. function switchMap(project, resultSelector) {
  47420. if (typeof resultSelector === 'function') {
  47421. return function (source) { return source.pipe(switchMap(function (a, i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__observable_from__["a" /* from */])(project(a, i)).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__map__["a" /* map */])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
  47422. }
  47423. return function (source) { return source.lift(new SwitchMapOperator(project)); };
  47424. }
  47425. var SwitchMapOperator = /*@__PURE__*/ (function () {
  47426. function SwitchMapOperator(project) {
  47427. this.project = project;
  47428. }
  47429. SwitchMapOperator.prototype.call = function (subscriber, source) {
  47430. return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));
  47431. };
  47432. return SwitchMapOperator;
  47433. }());
  47434. var SwitchMapSubscriber = /*@__PURE__*/ (function (_super) {
  47435. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SwitchMapSubscriber, _super);
  47436. function SwitchMapSubscriber(destination, project) {
  47437. var _this = _super.call(this, destination) || this;
  47438. _this.project = project;
  47439. _this.index = 0;
  47440. return _this;
  47441. }
  47442. SwitchMapSubscriber.prototype._next = function (value) {
  47443. var result;
  47444. var index = this.index++;
  47445. try {
  47446. result = this.project(value, index);
  47447. }
  47448. catch (error) {
  47449. this.destination.error(error);
  47450. return;
  47451. }
  47452. this._innerSub(result, value, index);
  47453. };
  47454. SwitchMapSubscriber.prototype._innerSub = function (result, value, index) {
  47455. var innerSubscription = this.innerSubscription;
  47456. if (innerSubscription) {
  47457. innerSubscription.unsubscribe();
  47458. }
  47459. var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
  47460. var destination = this.destination;
  47461. destination.add(innerSubscriber);
  47462. this.innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, value, index, innerSubscriber);
  47463. };
  47464. SwitchMapSubscriber.prototype._complete = function () {
  47465. var innerSubscription = this.innerSubscription;
  47466. if (!innerSubscription || innerSubscription.closed) {
  47467. _super.prototype._complete.call(this);
  47468. }
  47469. this.unsubscribe();
  47470. };
  47471. SwitchMapSubscriber.prototype._unsubscribe = function () {
  47472. this.innerSubscription = null;
  47473. };
  47474. SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) {
  47475. var destination = this.destination;
  47476. destination.remove(innerSub);
  47477. this.innerSubscription = null;
  47478. if (this.isStopped) {
  47479. _super.prototype._complete.call(this);
  47480. }
  47481. };
  47482. SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  47483. this.destination.next(innerValue);
  47484. };
  47485. return SwitchMapSubscriber;
  47486. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  47487. //# sourceMappingURL=switchMap.js.map
  47488. /***/ }),
  47489. /* 260 */
  47490. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47491. "use strict";
  47492. /* harmony export (immutable) */ __webpack_exports__["a"] = take;
  47493. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  47494. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  47495. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__ = __webpack_require__(141);
  47496. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_empty__ = __webpack_require__(46);
  47497. /** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */
  47498. function take(count) {
  47499. return function (source) {
  47500. if (count === 0) {
  47501. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_empty__["a" /* empty */])();
  47502. }
  47503. else {
  47504. return source.lift(new TakeOperator(count));
  47505. }
  47506. };
  47507. }
  47508. var TakeOperator = /*@__PURE__*/ (function () {
  47509. function TakeOperator(total) {
  47510. this.total = total;
  47511. if (this.total < 0) {
  47512. throw new __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */];
  47513. }
  47514. }
  47515. TakeOperator.prototype.call = function (subscriber, source) {
  47516. return source.subscribe(new TakeSubscriber(subscriber, this.total));
  47517. };
  47518. return TakeOperator;
  47519. }());
  47520. var TakeSubscriber = /*@__PURE__*/ (function (_super) {
  47521. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TakeSubscriber, _super);
  47522. function TakeSubscriber(destination, total) {
  47523. var _this = _super.call(this, destination) || this;
  47524. _this.total = total;
  47525. _this.count = 0;
  47526. return _this;
  47527. }
  47528. TakeSubscriber.prototype._next = function (value) {
  47529. var total = this.total;
  47530. var count = ++this.count;
  47531. if (count <= total) {
  47532. this.destination.next(value);
  47533. if (count === total) {
  47534. this.destination.complete();
  47535. this.unsubscribe();
  47536. }
  47537. }
  47538. };
  47539. return TakeSubscriber;
  47540. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  47541. //# sourceMappingURL=take.js.map
  47542. /***/ }),
  47543. /* 261 */
  47544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47545. "use strict";
  47546. /* harmony export (immutable) */ __webpack_exports__["a"] = takeLast;
  47547. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  47548. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  47549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__ = __webpack_require__(141);
  47550. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_empty__ = __webpack_require__(46);
  47551. /** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */
  47552. function takeLast(count) {
  47553. return function takeLastOperatorFunction(source) {
  47554. if (count === 0) {
  47555. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_empty__["a" /* empty */])();
  47556. }
  47557. else {
  47558. return source.lift(new TakeLastOperator(count));
  47559. }
  47560. };
  47561. }
  47562. var TakeLastOperator = /*@__PURE__*/ (function () {
  47563. function TakeLastOperator(total) {
  47564. this.total = total;
  47565. if (this.total < 0) {
  47566. throw new __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */];
  47567. }
  47568. }
  47569. TakeLastOperator.prototype.call = function (subscriber, source) {
  47570. return source.subscribe(new TakeLastSubscriber(subscriber, this.total));
  47571. };
  47572. return TakeLastOperator;
  47573. }());
  47574. var TakeLastSubscriber = /*@__PURE__*/ (function (_super) {
  47575. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TakeLastSubscriber, _super);
  47576. function TakeLastSubscriber(destination, total) {
  47577. var _this = _super.call(this, destination) || this;
  47578. _this.total = total;
  47579. _this.ring = new Array();
  47580. _this.count = 0;
  47581. return _this;
  47582. }
  47583. TakeLastSubscriber.prototype._next = function (value) {
  47584. var ring = this.ring;
  47585. var total = this.total;
  47586. var count = this.count++;
  47587. if (ring.length < total) {
  47588. ring.push(value);
  47589. }
  47590. else {
  47591. var index = count % total;
  47592. ring[index] = value;
  47593. }
  47594. };
  47595. TakeLastSubscriber.prototype._complete = function () {
  47596. var destination = this.destination;
  47597. var count = this.count;
  47598. if (count > 0) {
  47599. var total = this.count >= this.total ? this.total : this.count;
  47600. var ring = this.ring;
  47601. for (var i = 0; i < total; i++) {
  47602. var idx = (count++) % total;
  47603. destination.next(ring[idx]);
  47604. }
  47605. }
  47606. destination.complete();
  47607. };
  47608. return TakeLastSubscriber;
  47609. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  47610. //# sourceMappingURL=takeLast.js.map
  47611. /***/ }),
  47612. /* 262 */
  47613. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47614. "use strict";
  47615. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return rxSubscriber; });
  47616. /* unused harmony export $$rxSubscriber */
  47617. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  47618. var rxSubscriber = typeof Symbol === 'function'
  47619. ? /*@__PURE__*/ Symbol('rxSubscriber')
  47620. : '@@rxSubscriber_' + /*@__PURE__*/ Math.random();
  47621. var $$rxSubscriber = rxSubscriber;
  47622. //# sourceMappingURL=rxSubscriber.js.map
  47623. /***/ }),
  47624. /* 263 */
  47625. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47626. "use strict";
  47627. /* harmony export (immutable) */ __webpack_exports__["a"] = canReportError;
  47628. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Subscriber__ = __webpack_require__(5);
  47629. /** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */
  47630. function canReportError(observer) {
  47631. while (observer) {
  47632. var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
  47633. if (closed_1 || isStopped) {
  47634. return false;
  47635. }
  47636. else if (destination && destination instanceof __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */]) {
  47637. observer = destination;
  47638. }
  47639. else {
  47640. observer = null;
  47641. }
  47642. }
  47643. return true;
  47644. }
  47645. //# sourceMappingURL=canReportError.js.map
  47646. /***/ }),
  47647. /* 264 */
  47648. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47649. "use strict";
  47650. /* harmony export (immutable) */ __webpack_exports__["a"] = hostReportError;
  47651. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  47652. function hostReportError(err) {
  47653. setTimeout(function () { throw err; });
  47654. }
  47655. //# sourceMappingURL=hostReportError.js.map
  47656. /***/ }),
  47657. /* 265 */
  47658. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47659. "use strict";
  47660. /* harmony export (immutable) */ __webpack_exports__["a"] = pipe;
  47661. /* harmony export (immutable) */ __webpack_exports__["b"] = pipeFromArray;
  47662. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__noop__ = __webpack_require__(182);
  47663. /** PURE_IMPORTS_START _noop PURE_IMPORTS_END */
  47664. function pipe() {
  47665. var fns = [];
  47666. for (var _i = 0; _i < arguments.length; _i++) {
  47667. fns[_i] = arguments[_i];
  47668. }
  47669. return pipeFromArray(fns);
  47670. }
  47671. function pipeFromArray(fns) {
  47672. if (!fns) {
  47673. return __WEBPACK_IMPORTED_MODULE_0__noop__["a" /* noop */];
  47674. }
  47675. if (fns.length === 1) {
  47676. return fns[0];
  47677. }
  47678. return function piped(input) {
  47679. return fns.reduce(function (prev, fn) { return fn(prev); }, input);
  47680. };
  47681. }
  47682. //# sourceMappingURL=pipe.js.map
  47683. /***/ }),
  47684. /* 266 */
  47685. /***/ (function(module, exports, __webpack_require__) {
  47686. // Copyright 2017 Joyent, Inc.
  47687. module.exports = {
  47688. DiffieHellman: DiffieHellman,
  47689. generateECDSA: generateECDSA,
  47690. generateED25519: generateED25519
  47691. };
  47692. var assert = __webpack_require__(22);
  47693. var crypto = __webpack_require__(21);
  47694. var Buffer = __webpack_require__(20).Buffer;
  47695. var algs = __webpack_require__(39);
  47696. var utils = __webpack_require__(32);
  47697. var nacl;
  47698. var Key = __webpack_require__(35);
  47699. var PrivateKey = __webpack_require__(40);
  47700. var CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined);
  47701. var ecdh, ec, jsbn;
  47702. function DiffieHellman(key) {
  47703. utils.assertCompatible(key, Key, [1, 4], 'key');
  47704. this._isPriv = PrivateKey.isPrivateKey(key, [1, 3]);
  47705. this._algo = key.type;
  47706. this._curve = key.curve;
  47707. this._key = key;
  47708. if (key.type === 'dsa') {
  47709. if (!CRYPTO_HAVE_ECDH) {
  47710. throw (new Error('Due to bugs in the node 0.10 ' +
  47711. 'crypto API, node 0.12.x or later is required ' +
  47712. 'to use DH'));
  47713. }
  47714. this._dh = crypto.createDiffieHellman(
  47715. key.part.p.data, undefined,
  47716. key.part.g.data, undefined);
  47717. this._p = key.part.p;
  47718. this._g = key.part.g;
  47719. if (this._isPriv)
  47720. this._dh.setPrivateKey(key.part.x.data);
  47721. this._dh.setPublicKey(key.part.y.data);
  47722. } else if (key.type === 'ecdsa') {
  47723. if (!CRYPTO_HAVE_ECDH) {
  47724. if (ecdh === undefined)
  47725. ecdh = __webpack_require__(350);
  47726. if (ec === undefined)
  47727. ec = __webpack_require__(130);
  47728. if (jsbn === undefined)
  47729. jsbn = __webpack_require__(79).BigInteger;
  47730. this._ecParams = new X9ECParameters(this._curve);
  47731. if (this._isPriv) {
  47732. this._priv = new ECPrivate(
  47733. this._ecParams, key.part.d.data);
  47734. }
  47735. return;
  47736. }
  47737. var curve = {
  47738. 'nistp256': 'prime256v1',
  47739. 'nistp384': 'secp384r1',
  47740. 'nistp521': 'secp521r1'
  47741. }[key.curve];
  47742. this._dh = crypto.createECDH(curve);
  47743. if (typeof (this._dh) !== 'object' ||
  47744. typeof (this._dh.setPrivateKey) !== 'function') {
  47745. CRYPTO_HAVE_ECDH = false;
  47746. DiffieHellman.call(this, key);
  47747. return;
  47748. }
  47749. if (this._isPriv)
  47750. this._dh.setPrivateKey(key.part.d.data);
  47751. this._dh.setPublicKey(key.part.Q.data);
  47752. } else if (key.type === 'curve25519') {
  47753. if (nacl === undefined)
  47754. nacl = __webpack_require__(72);
  47755. if (this._isPriv) {
  47756. utils.assertCompatible(key, PrivateKey, [1, 5], 'key');
  47757. this._priv = key.part.k.data;
  47758. }
  47759. } else {
  47760. throw (new Error('DH not supported for ' + key.type + ' keys'));
  47761. }
  47762. }
  47763. DiffieHellman.prototype.getPublicKey = function () {
  47764. if (this._isPriv)
  47765. return (this._key.toPublic());
  47766. return (this._key);
  47767. };
  47768. DiffieHellman.prototype.getPrivateKey = function () {
  47769. if (this._isPriv)
  47770. return (this._key);
  47771. else
  47772. return (undefined);
  47773. };
  47774. DiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey;
  47775. DiffieHellman.prototype._keyCheck = function (pk, isPub) {
  47776. assert.object(pk, 'key');
  47777. if (!isPub)
  47778. utils.assertCompatible(pk, PrivateKey, [1, 3], 'key');
  47779. utils.assertCompatible(pk, Key, [1, 4], 'key');
  47780. if (pk.type !== this._algo) {
  47781. throw (new Error('A ' + pk.type + ' key cannot be used in ' +
  47782. this._algo + ' Diffie-Hellman'));
  47783. }
  47784. if (pk.curve !== this._curve) {
  47785. throw (new Error('A key from the ' + pk.curve + ' curve ' +
  47786. 'cannot be used with a ' + this._curve +
  47787. ' Diffie-Hellman'));
  47788. }
  47789. if (pk.type === 'dsa') {
  47790. assert.deepEqual(pk.part.p, this._p,
  47791. 'DSA key prime does not match');
  47792. assert.deepEqual(pk.part.g, this._g,
  47793. 'DSA key generator does not match');
  47794. }
  47795. };
  47796. DiffieHellman.prototype.setKey = function (pk) {
  47797. this._keyCheck(pk);
  47798. if (pk.type === 'dsa') {
  47799. this._dh.setPrivateKey(pk.part.x.data);
  47800. this._dh.setPublicKey(pk.part.y.data);
  47801. } else if (pk.type === 'ecdsa') {
  47802. if (CRYPTO_HAVE_ECDH) {
  47803. this._dh.setPrivateKey(pk.part.d.data);
  47804. this._dh.setPublicKey(pk.part.Q.data);
  47805. } else {
  47806. this._priv = new ECPrivate(
  47807. this._ecParams, pk.part.d.data);
  47808. }
  47809. } else if (pk.type === 'curve25519') {
  47810. var k = pk.part.k;
  47811. if (!pk.part.k)
  47812. k = pk.part.r;
  47813. this._priv = k.data;
  47814. if (this._priv[0] === 0x00)
  47815. this._priv = this._priv.slice(1);
  47816. this._priv = this._priv.slice(0, 32);
  47817. }
  47818. this._key = pk;
  47819. this._isPriv = true;
  47820. };
  47821. DiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey;
  47822. DiffieHellman.prototype.computeSecret = function (otherpk) {
  47823. this._keyCheck(otherpk, true);
  47824. if (!this._isPriv)
  47825. throw (new Error('DH exchange has not been initialized with ' +
  47826. 'a private key yet'));
  47827. var pub;
  47828. if (this._algo === 'dsa') {
  47829. return (this._dh.computeSecret(
  47830. otherpk.part.y.data));
  47831. } else if (this._algo === 'ecdsa') {
  47832. if (CRYPTO_HAVE_ECDH) {
  47833. return (this._dh.computeSecret(
  47834. otherpk.part.Q.data));
  47835. } else {
  47836. pub = new ECPublic(
  47837. this._ecParams, otherpk.part.Q.data);
  47838. return (this._priv.deriveSharedSecret(pub));
  47839. }
  47840. } else if (this._algo === 'curve25519') {
  47841. pub = otherpk.part.A.data;
  47842. while (pub[0] === 0x00 && pub.length > 32)
  47843. pub = pub.slice(1);
  47844. var priv = this._priv;
  47845. assert.strictEqual(pub.length, 32);
  47846. assert.strictEqual(priv.length, 32);
  47847. var secret = nacl.box.before(new Uint8Array(pub),
  47848. new Uint8Array(priv));
  47849. return (Buffer.from(secret));
  47850. }
  47851. throw (new Error('Invalid algorithm: ' + this._algo));
  47852. };
  47853. DiffieHellman.prototype.generateKey = function () {
  47854. var parts = [];
  47855. var priv, pub;
  47856. if (this._algo === 'dsa') {
  47857. this._dh.generateKeys();
  47858. parts.push({name: 'p', data: this._p.data});
  47859. parts.push({name: 'q', data: this._key.part.q.data});
  47860. parts.push({name: 'g', data: this._g.data});
  47861. parts.push({name: 'y', data: this._dh.getPublicKey()});
  47862. parts.push({name: 'x', data: this._dh.getPrivateKey()});
  47863. this._key = new PrivateKey({
  47864. type: 'dsa',
  47865. parts: parts
  47866. });
  47867. this._isPriv = true;
  47868. return (this._key);
  47869. } else if (this._algo === 'ecdsa') {
  47870. if (CRYPTO_HAVE_ECDH) {
  47871. this._dh.generateKeys();
  47872. parts.push({name: 'curve',
  47873. data: Buffer.from(this._curve)});
  47874. parts.push({name: 'Q', data: this._dh.getPublicKey()});
  47875. parts.push({name: 'd', data: this._dh.getPrivateKey()});
  47876. this._key = new PrivateKey({
  47877. type: 'ecdsa',
  47878. curve: this._curve,
  47879. parts: parts
  47880. });
  47881. this._isPriv = true;
  47882. return (this._key);
  47883. } else {
  47884. var n = this._ecParams.getN();
  47885. var r = new jsbn(crypto.randomBytes(n.bitLength()));
  47886. var n1 = n.subtract(jsbn.ONE);
  47887. priv = r.mod(n1).add(jsbn.ONE);
  47888. pub = this._ecParams.getG().multiply(priv);
  47889. priv = Buffer.from(priv.toByteArray());
  47890. pub = Buffer.from(this._ecParams.getCurve().
  47891. encodePointHex(pub), 'hex');
  47892. this._priv = new ECPrivate(this._ecParams, priv);
  47893. parts.push({name: 'curve',
  47894. data: Buffer.from(this._curve)});
  47895. parts.push({name: 'Q', data: pub});
  47896. parts.push({name: 'd', data: priv});
  47897. this._key = new PrivateKey({
  47898. type: 'ecdsa',
  47899. curve: this._curve,
  47900. parts: parts
  47901. });
  47902. this._isPriv = true;
  47903. return (this._key);
  47904. }
  47905. } else if (this._algo === 'curve25519') {
  47906. var pair = nacl.box.keyPair();
  47907. priv = Buffer.from(pair.secretKey);
  47908. pub = Buffer.from(pair.publicKey);
  47909. priv = Buffer.concat([priv, pub]);
  47910. assert.strictEqual(priv.length, 64);
  47911. assert.strictEqual(pub.length, 32);
  47912. parts.push({name: 'A', data: pub});
  47913. parts.push({name: 'k', data: priv});
  47914. this._key = new PrivateKey({
  47915. type: 'curve25519',
  47916. parts: parts
  47917. });
  47918. this._isPriv = true;
  47919. return (this._key);
  47920. }
  47921. throw (new Error('Invalid algorithm: ' + this._algo));
  47922. };
  47923. DiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey;
  47924. /* These are helpers for using ecc-jsbn (for node 0.10 compatibility). */
  47925. function X9ECParameters(name) {
  47926. var params = algs.curves[name];
  47927. assert.object(params);
  47928. var p = new jsbn(params.p);
  47929. var a = new jsbn(params.a);
  47930. var b = new jsbn(params.b);
  47931. var n = new jsbn(params.n);
  47932. var h = jsbn.ONE;
  47933. var curve = new ec.ECCurveFp(p, a, b);
  47934. var G = curve.decodePointHex(params.G.toString('hex'));
  47935. this.curve = curve;
  47936. this.g = G;
  47937. this.n = n;
  47938. this.h = h;
  47939. }
  47940. X9ECParameters.prototype.getCurve = function () { return (this.curve); };
  47941. X9ECParameters.prototype.getG = function () { return (this.g); };
  47942. X9ECParameters.prototype.getN = function () { return (this.n); };
  47943. X9ECParameters.prototype.getH = function () { return (this.h); };
  47944. function ECPublic(params, buffer) {
  47945. this._params = params;
  47946. if (buffer[0] === 0x00)
  47947. buffer = buffer.slice(1);
  47948. this._pub = params.getCurve().decodePointHex(buffer.toString('hex'));
  47949. }
  47950. function ECPrivate(params, buffer) {
  47951. this._params = params;
  47952. this._priv = new jsbn(utils.mpNormalize(buffer));
  47953. }
  47954. ECPrivate.prototype.deriveSharedSecret = function (pubKey) {
  47955. assert.ok(pubKey instanceof ECPublic);
  47956. var S = pubKey._pub.multiply(this._priv);
  47957. return (Buffer.from(S.getX().toBigInteger().toByteArray()));
  47958. };
  47959. function generateED25519() {
  47960. if (nacl === undefined)
  47961. nacl = __webpack_require__(72);
  47962. var pair = nacl.sign.keyPair();
  47963. var priv = Buffer.from(pair.secretKey);
  47964. var pub = Buffer.from(pair.publicKey);
  47965. assert.strictEqual(priv.length, 64);
  47966. assert.strictEqual(pub.length, 32);
  47967. var parts = [];
  47968. parts.push({name: 'A', data: pub});
  47969. parts.push({name: 'k', data: priv.slice(0, 32)});
  47970. var key = new PrivateKey({
  47971. type: 'ed25519',
  47972. parts: parts
  47973. });
  47974. return (key);
  47975. }
  47976. /* Generates a new ECDSA private key on a given curve. */
  47977. function generateECDSA(curve) {
  47978. var parts = [];
  47979. var key;
  47980. if (CRYPTO_HAVE_ECDH) {
  47981. /*
  47982. * Node crypto doesn't expose key generation directly, but the
  47983. * ECDH instances can generate keys. It turns out this just
  47984. * calls into the OpenSSL generic key generator, and we can
  47985. * read its output happily without doing an actual DH. So we
  47986. * use that here.
  47987. */
  47988. var osCurve = {
  47989. 'nistp256': 'prime256v1',
  47990. 'nistp384': 'secp384r1',
  47991. 'nistp521': 'secp521r1'
  47992. }[curve];
  47993. var dh = crypto.createECDH(osCurve);
  47994. dh.generateKeys();
  47995. parts.push({name: 'curve',
  47996. data: Buffer.from(curve)});
  47997. parts.push({name: 'Q', data: dh.getPublicKey()});
  47998. parts.push({name: 'd', data: dh.getPrivateKey()});
  47999. key = new PrivateKey({
  48000. type: 'ecdsa',
  48001. curve: curve,
  48002. parts: parts
  48003. });
  48004. return (key);
  48005. } else {
  48006. if (ecdh === undefined)
  48007. ecdh = __webpack_require__(350);
  48008. if (ec === undefined)
  48009. ec = __webpack_require__(130);
  48010. if (jsbn === undefined)
  48011. jsbn = __webpack_require__(79).BigInteger;
  48012. var ecParams = new X9ECParameters(curve);
  48013. /* This algorithm taken from FIPS PUB 186-4 (section B.4.1) */
  48014. var n = ecParams.getN();
  48015. /*
  48016. * The crypto.randomBytes() function can only give us whole
  48017. * bytes, so taking a nod from X9.62, we round up.
  48018. */
  48019. var cByteLen = Math.ceil((n.bitLength() + 64) / 8);
  48020. var c = new jsbn(crypto.randomBytes(cByteLen));
  48021. var n1 = n.subtract(jsbn.ONE);
  48022. var priv = c.mod(n1).add(jsbn.ONE);
  48023. var pub = ecParams.getG().multiply(priv);
  48024. priv = Buffer.from(priv.toByteArray());
  48025. pub = Buffer.from(ecParams.getCurve().
  48026. encodePointHex(pub), 'hex');
  48027. parts.push({name: 'curve', data: Buffer.from(curve)});
  48028. parts.push({name: 'Q', data: pub});
  48029. parts.push({name: 'd', data: priv});
  48030. key = new PrivateKey({
  48031. type: 'ecdsa',
  48032. curve: curve,
  48033. parts: parts
  48034. });
  48035. return (key);
  48036. }
  48037. }
  48038. /***/ }),
  48039. /* 267 */
  48040. /***/ (function(module, exports, __webpack_require__) {
  48041. // Copyright 2017 Joyent, Inc.
  48042. module.exports = {
  48043. read: read,
  48044. write: write
  48045. };
  48046. var assert = __webpack_require__(22);
  48047. var Buffer = __webpack_require__(20).Buffer;
  48048. var Key = __webpack_require__(35);
  48049. var PrivateKey = __webpack_require__(40);
  48050. var utils = __webpack_require__(32);
  48051. var SSHBuffer = __webpack_require__(148);
  48052. var Dhe = __webpack_require__(266);
  48053. var supportedAlgos = {
  48054. 'rsa-sha1' : 5,
  48055. 'rsa-sha256' : 8,
  48056. 'rsa-sha512' : 10,
  48057. 'ecdsa-p256-sha256' : 13,
  48058. 'ecdsa-p384-sha384' : 14
  48059. /*
  48060. * ed25519 is hypothetically supported with id 15
  48061. * but the common tools available don't appear to be
  48062. * capable of generating/using ed25519 keys
  48063. */
  48064. };
  48065. var supportedAlgosById = {};
  48066. Object.keys(supportedAlgos).forEach(function (k) {
  48067. supportedAlgosById[supportedAlgos[k]] = k.toUpperCase();
  48068. });
  48069. function read(buf, options) {
  48070. if (typeof (buf) !== 'string') {
  48071. assert.buffer(buf, 'buf');
  48072. buf = buf.toString('ascii');
  48073. }
  48074. var lines = buf.split('\n');
  48075. if (lines[0].match(/^Private-key-format\: v1/)) {
  48076. var algElems = lines[1].split(' ');
  48077. var algoNum = parseInt(algElems[1], 10);
  48078. var algoName = algElems[2];
  48079. if (!supportedAlgosById[algoNum])
  48080. throw (new Error('Unsupported algorithm: ' + algoName));
  48081. return (readDNSSECPrivateKey(algoNum, lines.slice(2)));
  48082. }
  48083. // skip any comment-lines
  48084. var line = 0;
  48085. /* JSSTYLED */
  48086. while (lines[line].match(/^\;/))
  48087. line++;
  48088. // we should now have *one single* line left with our KEY on it.
  48089. if ((lines[line].match(/\. IN KEY /) ||
  48090. lines[line].match(/\. IN DNSKEY /)) && lines[line+1].length === 0) {
  48091. return (readRFC3110(lines[line]));
  48092. }
  48093. throw (new Error('Cannot parse dnssec key'));
  48094. }
  48095. function readRFC3110(keyString) {
  48096. var elems = keyString.split(' ');
  48097. //unused var flags = parseInt(elems[3], 10);
  48098. //unused var protocol = parseInt(elems[4], 10);
  48099. var algorithm = parseInt(elems[5], 10);
  48100. if (!supportedAlgosById[algorithm])
  48101. throw (new Error('Unsupported algorithm: ' + algorithm));
  48102. var base64key = elems.slice(6, elems.length).join();
  48103. var keyBuffer = Buffer.from(base64key, 'base64');
  48104. if (supportedAlgosById[algorithm].match(/^RSA-/)) {
  48105. // join the rest of the body into a single base64-blob
  48106. var publicExponentLen = keyBuffer.readUInt8(0);
  48107. if (publicExponentLen != 3 && publicExponentLen != 1)
  48108. throw (new Error('Cannot parse dnssec key: ' +
  48109. 'unsupported exponent length'));
  48110. var publicExponent = keyBuffer.slice(1, publicExponentLen+1);
  48111. publicExponent = utils.mpNormalize(publicExponent);
  48112. var modulus = keyBuffer.slice(1+publicExponentLen);
  48113. modulus = utils.mpNormalize(modulus);
  48114. // now, make the key
  48115. var rsaKey = {
  48116. type: 'rsa',
  48117. parts: []
  48118. };
  48119. rsaKey.parts.push({ name: 'e', data: publicExponent});
  48120. rsaKey.parts.push({ name: 'n', data: modulus});
  48121. return (new Key(rsaKey));
  48122. }
  48123. if (supportedAlgosById[algorithm] === 'ECDSA-P384-SHA384' ||
  48124. supportedAlgosById[algorithm] === 'ECDSA-P256-SHA256') {
  48125. var curve = 'nistp384';
  48126. var size = 384;
  48127. if (supportedAlgosById[algorithm].match(/^ECDSA-P256-SHA256/)) {
  48128. curve = 'nistp256';
  48129. size = 256;
  48130. }
  48131. var ecdsaKey = {
  48132. type: 'ecdsa',
  48133. curve: curve,
  48134. size: size,
  48135. parts: [
  48136. {name: 'curve', data: Buffer.from(curve) },
  48137. {name: 'Q', data: utils.ecNormalize(keyBuffer) }
  48138. ]
  48139. };
  48140. return (new Key(ecdsaKey));
  48141. }
  48142. throw (new Error('Unsupported algorithm: ' +
  48143. supportedAlgosById[algorithm]));
  48144. }
  48145. function elementToBuf(e) {
  48146. return (Buffer.from(e.split(' ')[1], 'base64'));
  48147. }
  48148. function readDNSSECRSAPrivateKey(elements) {
  48149. var rsaParams = {};
  48150. elements.forEach(function (element) {
  48151. if (element.split(' ')[0] === 'Modulus:')
  48152. rsaParams['n'] = elementToBuf(element);
  48153. else if (element.split(' ')[0] === 'PublicExponent:')
  48154. rsaParams['e'] = elementToBuf(element);
  48155. else if (element.split(' ')[0] === 'PrivateExponent:')
  48156. rsaParams['d'] = elementToBuf(element);
  48157. else if (element.split(' ')[0] === 'Prime1:')
  48158. rsaParams['p'] = elementToBuf(element);
  48159. else if (element.split(' ')[0] === 'Prime2:')
  48160. rsaParams['q'] = elementToBuf(element);
  48161. else if (element.split(' ')[0] === 'Exponent1:')
  48162. rsaParams['dmodp'] = elementToBuf(element);
  48163. else if (element.split(' ')[0] === 'Exponent2:')
  48164. rsaParams['dmodq'] = elementToBuf(element);
  48165. else if (element.split(' ')[0] === 'Coefficient:')
  48166. rsaParams['iqmp'] = elementToBuf(element);
  48167. });
  48168. // now, make the key
  48169. var key = {
  48170. type: 'rsa',
  48171. parts: [
  48172. { name: 'e', data: utils.mpNormalize(rsaParams['e'])},
  48173. { name: 'n', data: utils.mpNormalize(rsaParams['n'])},
  48174. { name: 'd', data: utils.mpNormalize(rsaParams['d'])},
  48175. { name: 'p', data: utils.mpNormalize(rsaParams['p'])},
  48176. { name: 'q', data: utils.mpNormalize(rsaParams['q'])},
  48177. { name: 'dmodp',
  48178. data: utils.mpNormalize(rsaParams['dmodp'])},
  48179. { name: 'dmodq',
  48180. data: utils.mpNormalize(rsaParams['dmodq'])},
  48181. { name: 'iqmp',
  48182. data: utils.mpNormalize(rsaParams['iqmp'])}
  48183. ]
  48184. };
  48185. return (new PrivateKey(key));
  48186. }
  48187. function readDNSSECPrivateKey(alg, elements) {
  48188. if (supportedAlgosById[alg].match(/^RSA-/)) {
  48189. return (readDNSSECRSAPrivateKey(elements));
  48190. }
  48191. if (supportedAlgosById[alg] === 'ECDSA-P384-SHA384' ||
  48192. supportedAlgosById[alg] === 'ECDSA-P256-SHA256') {
  48193. var d = Buffer.from(elements[0].split(' ')[1], 'base64');
  48194. var curve = 'nistp384';
  48195. var size = 384;
  48196. if (supportedAlgosById[alg] === 'ECDSA-P256-SHA256') {
  48197. curve = 'nistp256';
  48198. size = 256;
  48199. }
  48200. // DNSSEC generates the public-key on the fly (go calculate it)
  48201. var publicKey = utils.publicFromPrivateECDSA(curve, d);
  48202. var Q = publicKey.part['Q'].data;
  48203. var ecdsaKey = {
  48204. type: 'ecdsa',
  48205. curve: curve,
  48206. size: size,
  48207. parts: [
  48208. {name: 'curve', data: Buffer.from(curve) },
  48209. {name: 'd', data: d },
  48210. {name: 'Q', data: Q }
  48211. ]
  48212. };
  48213. return (new PrivateKey(ecdsaKey));
  48214. }
  48215. throw (new Error('Unsupported algorithm: ' + supportedAlgosById[alg]));
  48216. }
  48217. function dnssecTimestamp(date) {
  48218. var year = date.getFullYear() + ''; //stringify
  48219. var month = (date.getMonth() + 1);
  48220. var timestampStr = year + month + date.getUTCDate();
  48221. timestampStr += '' + date.getUTCHours() + date.getUTCMinutes();
  48222. timestampStr += date.getUTCSeconds();
  48223. return (timestampStr);
  48224. }
  48225. function rsaAlgFromOptions(opts) {
  48226. if (!opts || !opts.hashAlgo || opts.hashAlgo === 'sha1')
  48227. return ('5 (RSASHA1)');
  48228. else if (opts.hashAlgo === 'sha256')
  48229. return ('8 (RSASHA256)');
  48230. else if (opts.hashAlgo === 'sha512')
  48231. return ('10 (RSASHA512)');
  48232. else
  48233. throw (new Error('Unknown or unsupported hash: ' +
  48234. opts.hashAlgo));
  48235. }
  48236. function writeRSA(key, options) {
  48237. // if we're missing parts, add them.
  48238. if (!key.part.dmodp || !key.part.dmodq) {
  48239. utils.addRSAMissing(key);
  48240. }
  48241. var out = '';
  48242. out += 'Private-key-format: v1.3\n';
  48243. out += 'Algorithm: ' + rsaAlgFromOptions(options) + '\n';
  48244. var n = utils.mpDenormalize(key.part['n'].data);
  48245. out += 'Modulus: ' + n.toString('base64') + '\n';
  48246. var e = utils.mpDenormalize(key.part['e'].data);
  48247. out += 'PublicExponent: ' + e.toString('base64') + '\n';
  48248. var d = utils.mpDenormalize(key.part['d'].data);
  48249. out += 'PrivateExponent: ' + d.toString('base64') + '\n';
  48250. var p = utils.mpDenormalize(key.part['p'].data);
  48251. out += 'Prime1: ' + p.toString('base64') + '\n';
  48252. var q = utils.mpDenormalize(key.part['q'].data);
  48253. out += 'Prime2: ' + q.toString('base64') + '\n';
  48254. var dmodp = utils.mpDenormalize(key.part['dmodp'].data);
  48255. out += 'Exponent1: ' + dmodp.toString('base64') + '\n';
  48256. var dmodq = utils.mpDenormalize(key.part['dmodq'].data);
  48257. out += 'Exponent2: ' + dmodq.toString('base64') + '\n';
  48258. var iqmp = utils.mpDenormalize(key.part['iqmp'].data);
  48259. out += 'Coefficient: ' + iqmp.toString('base64') + '\n';
  48260. // Assume that we're valid as-of now
  48261. var timestamp = new Date();
  48262. out += 'Created: ' + dnssecTimestamp(timestamp) + '\n';
  48263. out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n';
  48264. out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n';
  48265. return (Buffer.from(out, 'ascii'));
  48266. }
  48267. function writeECDSA(key, options) {
  48268. var out = '';
  48269. out += 'Private-key-format: v1.3\n';
  48270. if (key.curve === 'nistp256') {
  48271. out += 'Algorithm: 13 (ECDSAP256SHA256)\n';
  48272. } else if (key.curve === 'nistp384') {
  48273. out += 'Algorithm: 14 (ECDSAP384SHA384)\n';
  48274. } else {
  48275. throw (new Error('Unsupported curve'));
  48276. }
  48277. var base64Key = key.part['d'].data.toString('base64');
  48278. out += 'PrivateKey: ' + base64Key + '\n';
  48279. // Assume that we're valid as-of now
  48280. var timestamp = new Date();
  48281. out += 'Created: ' + dnssecTimestamp(timestamp) + '\n';
  48282. out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n';
  48283. out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n';
  48284. return (Buffer.from(out, 'ascii'));
  48285. }
  48286. function write(key, options) {
  48287. if (PrivateKey.isPrivateKey(key)) {
  48288. if (key.type === 'rsa') {
  48289. return (writeRSA(key, options));
  48290. } else if (key.type === 'ecdsa') {
  48291. return (writeECDSA(key, options));
  48292. } else {
  48293. throw (new Error('Unsupported algorithm: ' + key.type));
  48294. }
  48295. } else if (Key.isKey(key)) {
  48296. /*
  48297. * RFC3110 requires a keyname, and a keytype, which we
  48298. * don't really have a mechanism for specifying such
  48299. * additional metadata.
  48300. */
  48301. throw (new Error('Format "dnssec" only supports ' +
  48302. 'writing private keys'));
  48303. } else {
  48304. throw (new Error('key is not a Key or PrivateKey'));
  48305. }
  48306. }
  48307. /***/ }),
  48308. /* 268 */
  48309. /***/ (function(module, exports, __webpack_require__) {
  48310. // Copyright 2015 Joyent, Inc.
  48311. module.exports = {
  48312. read: read,
  48313. readPkcs1: readPkcs1,
  48314. write: write,
  48315. writePkcs1: writePkcs1
  48316. };
  48317. var assert = __webpack_require__(22);
  48318. var asn1 = __webpack_require__(67);
  48319. var Buffer = __webpack_require__(20).Buffer;
  48320. var algs = __webpack_require__(39);
  48321. var utils = __webpack_require__(32);
  48322. var Key = __webpack_require__(35);
  48323. var PrivateKey = __webpack_require__(40);
  48324. var pem = __webpack_require__(82);
  48325. var pkcs8 = __webpack_require__(146);
  48326. var readECDSACurve = pkcs8.readECDSACurve;
  48327. function read(buf, options) {
  48328. return (pem.read(buf, options, 'pkcs1'));
  48329. }
  48330. function write(key, options) {
  48331. return (pem.write(key, options, 'pkcs1'));
  48332. }
  48333. /* Helper to read in a single mpint */
  48334. function readMPInt(der, nm) {
  48335. assert.strictEqual(der.peek(), asn1.Ber.Integer,
  48336. nm + ' is not an Integer');
  48337. return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));
  48338. }
  48339. function readPkcs1(alg, type, der) {
  48340. switch (alg) {
  48341. case 'RSA':
  48342. if (type === 'public')
  48343. return (readPkcs1RSAPublic(der));
  48344. else if (type === 'private')
  48345. return (readPkcs1RSAPrivate(der));
  48346. throw (new Error('Unknown key type: ' + type));
  48347. case 'DSA':
  48348. if (type === 'public')
  48349. return (readPkcs1DSAPublic(der));
  48350. else if (type === 'private')
  48351. return (readPkcs1DSAPrivate(der));
  48352. throw (new Error('Unknown key type: ' + type));
  48353. case 'EC':
  48354. case 'ECDSA':
  48355. if (type === 'private')
  48356. return (readPkcs1ECDSAPrivate(der));
  48357. else if (type === 'public')
  48358. return (readPkcs1ECDSAPublic(der));
  48359. throw (new Error('Unknown key type: ' + type));
  48360. case 'EDDSA':
  48361. case 'EdDSA':
  48362. if (type === 'private')
  48363. return (readPkcs1EdDSAPrivate(der));
  48364. throw (new Error(type + ' keys not supported with EdDSA'));
  48365. default:
  48366. throw (new Error('Unknown key algo: ' + alg));
  48367. }
  48368. }
  48369. function readPkcs1RSAPublic(der) {
  48370. // modulus and exponent
  48371. var n = readMPInt(der, 'modulus');
  48372. var e = readMPInt(der, 'exponent');
  48373. // now, make the key
  48374. var key = {
  48375. type: 'rsa',
  48376. parts: [
  48377. { name: 'e', data: e },
  48378. { name: 'n', data: n }
  48379. ]
  48380. };
  48381. return (new Key(key));
  48382. }
  48383. function readPkcs1RSAPrivate(der) {
  48384. var version = readMPInt(der, 'version');
  48385. assert.strictEqual(version[0], 0);
  48386. // modulus then public exponent
  48387. var n = readMPInt(der, 'modulus');
  48388. var e = readMPInt(der, 'public exponent');
  48389. var d = readMPInt(der, 'private exponent');
  48390. var p = readMPInt(der, 'prime1');
  48391. var q = readMPInt(der, 'prime2');
  48392. var dmodp = readMPInt(der, 'exponent1');
  48393. var dmodq = readMPInt(der, 'exponent2');
  48394. var iqmp = readMPInt(der, 'iqmp');
  48395. // now, make the key
  48396. var key = {
  48397. type: 'rsa',
  48398. parts: [
  48399. { name: 'n', data: n },
  48400. { name: 'e', data: e },
  48401. { name: 'd', data: d },
  48402. { name: 'iqmp', data: iqmp },
  48403. { name: 'p', data: p },
  48404. { name: 'q', data: q },
  48405. { name: 'dmodp', data: dmodp },
  48406. { name: 'dmodq', data: dmodq }
  48407. ]
  48408. };
  48409. return (new PrivateKey(key));
  48410. }
  48411. function readPkcs1DSAPrivate(der) {
  48412. var version = readMPInt(der, 'version');
  48413. assert.strictEqual(version.readUInt8(0), 0);
  48414. var p = readMPInt(der, 'p');
  48415. var q = readMPInt(der, 'q');
  48416. var g = readMPInt(der, 'g');
  48417. var y = readMPInt(der, 'y');
  48418. var x = readMPInt(der, 'x');
  48419. // now, make the key
  48420. var key = {
  48421. type: 'dsa',
  48422. parts: [
  48423. { name: 'p', data: p },
  48424. { name: 'q', data: q },
  48425. { name: 'g', data: g },
  48426. { name: 'y', data: y },
  48427. { name: 'x', data: x }
  48428. ]
  48429. };
  48430. return (new PrivateKey(key));
  48431. }
  48432. function readPkcs1EdDSAPrivate(der) {
  48433. var version = readMPInt(der, 'version');
  48434. assert.strictEqual(version.readUInt8(0), 1);
  48435. // private key
  48436. var k = der.readString(asn1.Ber.OctetString, true);
  48437. der.readSequence(0xa0);
  48438. var oid = der.readOID();
  48439. assert.strictEqual(oid, '1.3.101.112', 'the ed25519 curve identifier');
  48440. der.readSequence(0xa1);
  48441. var A = utils.readBitString(der);
  48442. var key = {
  48443. type: 'ed25519',
  48444. parts: [
  48445. { name: 'A', data: utils.zeroPadToLength(A, 32) },
  48446. { name: 'k', data: k }
  48447. ]
  48448. };
  48449. return (new PrivateKey(key));
  48450. }
  48451. function readPkcs1DSAPublic(der) {
  48452. var y = readMPInt(der, 'y');
  48453. var p = readMPInt(der, 'p');
  48454. var q = readMPInt(der, 'q');
  48455. var g = readMPInt(der, 'g');
  48456. var key = {
  48457. type: 'dsa',
  48458. parts: [
  48459. { name: 'y', data: y },
  48460. { name: 'p', data: p },
  48461. { name: 'q', data: q },
  48462. { name: 'g', data: g }
  48463. ]
  48464. };
  48465. return (new Key(key));
  48466. }
  48467. function readPkcs1ECDSAPublic(der) {
  48468. der.readSequence();
  48469. var oid = der.readOID();
  48470. assert.strictEqual(oid, '1.2.840.10045.2.1', 'must be ecPublicKey');
  48471. var curveOid = der.readOID();
  48472. var curve;
  48473. var curves = Object.keys(algs.curves);
  48474. for (var j = 0; j < curves.length; ++j) {
  48475. var c = curves[j];
  48476. var cd = algs.curves[c];
  48477. if (cd.pkcs8oid === curveOid) {
  48478. curve = c;
  48479. break;
  48480. }
  48481. }
  48482. assert.string(curve, 'a known ECDSA named curve');
  48483. var Q = der.readString(asn1.Ber.BitString, true);
  48484. Q = utils.ecNormalize(Q);
  48485. var key = {
  48486. type: 'ecdsa',
  48487. parts: [
  48488. { name: 'curve', data: Buffer.from(curve) },
  48489. { name: 'Q', data: Q }
  48490. ]
  48491. };
  48492. return (new Key(key));
  48493. }
  48494. function readPkcs1ECDSAPrivate(der) {
  48495. var version = readMPInt(der, 'version');
  48496. assert.strictEqual(version.readUInt8(0), 1);
  48497. // private key
  48498. var d = der.readString(asn1.Ber.OctetString, true);
  48499. der.readSequence(0xa0);
  48500. var curve = readECDSACurve(der);
  48501. assert.string(curve, 'a known elliptic curve');
  48502. der.readSequence(0xa1);
  48503. var Q = der.readString(asn1.Ber.BitString, true);
  48504. Q = utils.ecNormalize(Q);
  48505. var key = {
  48506. type: 'ecdsa',
  48507. parts: [
  48508. { name: 'curve', data: Buffer.from(curve) },
  48509. { name: 'Q', data: Q },
  48510. { name: 'd', data: d }
  48511. ]
  48512. };
  48513. return (new PrivateKey(key));
  48514. }
  48515. function writePkcs1(der, key) {
  48516. der.startSequence();
  48517. switch (key.type) {
  48518. case 'rsa':
  48519. if (PrivateKey.isPrivateKey(key))
  48520. writePkcs1RSAPrivate(der, key);
  48521. else
  48522. writePkcs1RSAPublic(der, key);
  48523. break;
  48524. case 'dsa':
  48525. if (PrivateKey.isPrivateKey(key))
  48526. writePkcs1DSAPrivate(der, key);
  48527. else
  48528. writePkcs1DSAPublic(der, key);
  48529. break;
  48530. case 'ecdsa':
  48531. if (PrivateKey.isPrivateKey(key))
  48532. writePkcs1ECDSAPrivate(der, key);
  48533. else
  48534. writePkcs1ECDSAPublic(der, key);
  48535. break;
  48536. case 'ed25519':
  48537. if (PrivateKey.isPrivateKey(key))
  48538. writePkcs1EdDSAPrivate(der, key);
  48539. else
  48540. writePkcs1EdDSAPublic(der, key);
  48541. break;
  48542. default:
  48543. throw (new Error('Unknown key algo: ' + key.type));
  48544. }
  48545. der.endSequence();
  48546. }
  48547. function writePkcs1RSAPublic(der, key) {
  48548. der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
  48549. der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
  48550. }
  48551. function writePkcs1RSAPrivate(der, key) {
  48552. var ver = Buffer.from([0]);
  48553. der.writeBuffer(ver, asn1.Ber.Integer);
  48554. der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
  48555. der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
  48556. der.writeBuffer(key.part.d.data, asn1.Ber.Integer);
  48557. der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
  48558. der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
  48559. if (!key.part.dmodp || !key.part.dmodq)
  48560. utils.addRSAMissing(key);
  48561. der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);
  48562. der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);
  48563. der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);
  48564. }
  48565. function writePkcs1DSAPrivate(der, key) {
  48566. var ver = Buffer.from([0]);
  48567. der.writeBuffer(ver, asn1.Ber.Integer);
  48568. der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
  48569. der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
  48570. der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
  48571. der.writeBuffer(key.part.y.data, asn1.Ber.Integer);
  48572. der.writeBuffer(key.part.x.data, asn1.Ber.Integer);
  48573. }
  48574. function writePkcs1DSAPublic(der, key) {
  48575. der.writeBuffer(key.part.y.data, asn1.Ber.Integer);
  48576. der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
  48577. der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
  48578. der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
  48579. }
  48580. function writePkcs1ECDSAPublic(der, key) {
  48581. der.startSequence();
  48582. der.writeOID('1.2.840.10045.2.1'); /* ecPublicKey */
  48583. var curve = key.part.curve.data.toString();
  48584. var curveOid = algs.curves[curve].pkcs8oid;
  48585. assert.string(curveOid, 'a known ECDSA named curve');
  48586. der.writeOID(curveOid);
  48587. der.endSequence();
  48588. var Q = utils.ecNormalize(key.part.Q.data, true);
  48589. der.writeBuffer(Q, asn1.Ber.BitString);
  48590. }
  48591. function writePkcs1ECDSAPrivate(der, key) {
  48592. var ver = Buffer.from([1]);
  48593. der.writeBuffer(ver, asn1.Ber.Integer);
  48594. der.writeBuffer(key.part.d.data, asn1.Ber.OctetString);
  48595. der.startSequence(0xa0);
  48596. var curve = key.part.curve.data.toString();
  48597. var curveOid = algs.curves[curve].pkcs8oid;
  48598. assert.string(curveOid, 'a known ECDSA named curve');
  48599. der.writeOID(curveOid);
  48600. der.endSequence();
  48601. der.startSequence(0xa1);
  48602. var Q = utils.ecNormalize(key.part.Q.data, true);
  48603. der.writeBuffer(Q, asn1.Ber.BitString);
  48604. der.endSequence();
  48605. }
  48606. function writePkcs1EdDSAPrivate(der, key) {
  48607. var ver = Buffer.from([1]);
  48608. der.writeBuffer(ver, asn1.Ber.Integer);
  48609. der.writeBuffer(key.part.k.data, asn1.Ber.OctetString);
  48610. der.startSequence(0xa0);
  48611. der.writeOID('1.3.101.112');
  48612. der.endSequence();
  48613. der.startSequence(0xa1);
  48614. utils.writeBitString(der, key.part.A.data);
  48615. der.endSequence();
  48616. }
  48617. function writePkcs1EdDSAPublic(der, key) {
  48618. throw (new Error('Public keys are not supported for EdDSA PKCS#1'));
  48619. }
  48620. /***/ }),
  48621. /* 269 */
  48622. /***/ (function(module, exports, __webpack_require__) {
  48623. // Copyright 2015 Joyent, Inc.
  48624. var Key = __webpack_require__(35);
  48625. var Fingerprint = __webpack_require__(145);
  48626. var Signature = __webpack_require__(71);
  48627. var PrivateKey = __webpack_require__(40);
  48628. var Certificate = __webpack_require__(144);
  48629. var Identity = __webpack_require__(147);
  48630. var errs = __webpack_require__(70);
  48631. module.exports = {
  48632. /* top-level classes */
  48633. Key: Key,
  48634. parseKey: Key.parse,
  48635. Fingerprint: Fingerprint,
  48636. parseFingerprint: Fingerprint.parse,
  48637. Signature: Signature,
  48638. parseSignature: Signature.parse,
  48639. PrivateKey: PrivateKey,
  48640. parsePrivateKey: PrivateKey.parse,
  48641. generatePrivateKey: PrivateKey.generate,
  48642. Certificate: Certificate,
  48643. parseCertificate: Certificate.parse,
  48644. createSelfSignedCertificate: Certificate.createSelfSigned,
  48645. createCertificate: Certificate.create,
  48646. Identity: Identity,
  48647. identityFromDN: Identity.parseDN,
  48648. identityForHost: Identity.forHost,
  48649. identityForUser: Identity.forUser,
  48650. identityForEmail: Identity.forEmail,
  48651. /* errors */
  48652. FingerprintFormatError: errs.FingerprintFormatError,
  48653. InvalidAlgorithmError: errs.InvalidAlgorithmError,
  48654. KeyParseError: errs.KeyParseError,
  48655. SignatureParseError: errs.SignatureParseError,
  48656. KeyEncryptedError: errs.KeyEncryptedError,
  48657. CertificateParseError: errs.CertificateParseError
  48658. };
  48659. /***/ }),
  48660. /* 270 */
  48661. /***/ (function(module, exports, __webpack_require__) {
  48662. "use strict";
  48663. const ansiRegex = __webpack_require__(1020);
  48664. module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
  48665. /***/ }),
  48666. /* 271 */
  48667. /***/ (function(module, exports) {
  48668. module.exports = require("child_process");
  48669. /***/ }),
  48670. /* 272 */
  48671. /***/ (function(module, exports) {
  48672. module.exports = require("string_decoder");
  48673. /***/ }),
  48674. /* 273 */
  48675. /***/ (function(module, exports, __webpack_require__) {
  48676. "use strict";
  48677. Object.defineProperty(exports, "__esModule", {
  48678. value: true
  48679. });
  48680. var _constants;
  48681. function _load_constants() {
  48682. return _constants = _interopRequireWildcard(__webpack_require__(13));
  48683. }
  48684. var _access;
  48685. function _load_access() {
  48686. return _access = _interopRequireWildcard(__webpack_require__(480));
  48687. }
  48688. var _add;
  48689. function _load_add() {
  48690. return _add = _interopRequireWildcard(__webpack_require__(154));
  48691. }
  48692. var _audit;
  48693. function _load_audit() {
  48694. return _audit = _interopRequireWildcard(__webpack_require__(289));
  48695. }
  48696. var _autoclean;
  48697. function _load_autoclean() {
  48698. return _autoclean = _interopRequireWildcard(__webpack_require__(290));
  48699. }
  48700. var _bin;
  48701. function _load_bin() {
  48702. return _bin = _interopRequireWildcard(__webpack_require__(481));
  48703. }
  48704. var _cache;
  48705. function _load_cache() {
  48706. return _cache = _interopRequireWildcard(__webpack_require__(291));
  48707. }
  48708. var _check;
  48709. function _load_check() {
  48710. return _check = _interopRequireWildcard(__webpack_require__(292));
  48711. }
  48712. var _config;
  48713. function _load_config() {
  48714. return _config = _interopRequireWildcard(__webpack_require__(482));
  48715. }
  48716. var _create;
  48717. function _load_create() {
  48718. return _create = _interopRequireWildcard(__webpack_require__(483));
  48719. }
  48720. var _exec;
  48721. function _load_exec() {
  48722. return _exec = _interopRequireWildcard(__webpack_require__(484));
  48723. }
  48724. var _generateLockEntry;
  48725. function _load_generateLockEntry() {
  48726. return _generateLockEntry = _interopRequireWildcard(__webpack_require__(485));
  48727. }
  48728. var _global;
  48729. function _load_global() {
  48730. return _global = _interopRequireWildcard(__webpack_require__(116));
  48731. }
  48732. var _help;
  48733. function _load_help() {
  48734. return _help = _interopRequireWildcard(__webpack_require__(486));
  48735. }
  48736. var _import;
  48737. function _load_import() {
  48738. return _import = _interopRequireWildcard(__webpack_require__(487));
  48739. }
  48740. var _info;
  48741. function _load_info() {
  48742. return _info = _interopRequireWildcard(__webpack_require__(488));
  48743. }
  48744. var _init;
  48745. function _load_init() {
  48746. return _init = _interopRequireWildcard(__webpack_require__(489));
  48747. }
  48748. var _install;
  48749. function _load_install() {
  48750. return _install = _interopRequireWildcard(__webpack_require__(41));
  48751. }
  48752. var _licenses;
  48753. function _load_licenses() {
  48754. return _licenses = _interopRequireWildcard(__webpack_require__(490));
  48755. }
  48756. var _link;
  48757. function _load_link() {
  48758. return _link = _interopRequireWildcard(__webpack_require__(293));
  48759. }
  48760. var _login;
  48761. function _load_login() {
  48762. return _login = _interopRequireWildcard(__webpack_require__(97));
  48763. }
  48764. var _logout;
  48765. function _load_logout() {
  48766. return _logout = _interopRequireWildcard(__webpack_require__(491));
  48767. }
  48768. var _list;
  48769. function _load_list() {
  48770. return _list = _interopRequireWildcard(__webpack_require__(294));
  48771. }
  48772. var _node;
  48773. function _load_node() {
  48774. return _node = _interopRequireWildcard(__webpack_require__(492));
  48775. }
  48776. var _outdated;
  48777. function _load_outdated() {
  48778. return _outdated = _interopRequireWildcard(__webpack_require__(493));
  48779. }
  48780. var _owner;
  48781. function _load_owner() {
  48782. return _owner = _interopRequireWildcard(__webpack_require__(494));
  48783. }
  48784. var _pack;
  48785. function _load_pack() {
  48786. return _pack = _interopRequireWildcard(__webpack_require__(155));
  48787. }
  48788. var _policies;
  48789. function _load_policies() {
  48790. return _policies = _interopRequireWildcard(__webpack_require__(495));
  48791. }
  48792. var _publish;
  48793. function _load_publish() {
  48794. return _publish = _interopRequireWildcard(__webpack_require__(496));
  48795. }
  48796. var _remove;
  48797. function _load_remove() {
  48798. return _remove = _interopRequireWildcard(__webpack_require__(295));
  48799. }
  48800. var _run;
  48801. function _load_run() {
  48802. return _run = _interopRequireWildcard(__webpack_require__(296));
  48803. }
  48804. var _tag;
  48805. function _load_tag() {
  48806. return _tag = _interopRequireWildcard(__webpack_require__(297));
  48807. }
  48808. var _team;
  48809. function _load_team() {
  48810. return _team = _interopRequireWildcard(__webpack_require__(497));
  48811. }
  48812. var _unplug;
  48813. function _load_unplug() {
  48814. return _unplug = _interopRequireWildcard(__webpack_require__(499));
  48815. }
  48816. var _unlink;
  48817. function _load_unlink() {
  48818. return _unlink = _interopRequireWildcard(__webpack_require__(498));
  48819. }
  48820. var _upgrade;
  48821. function _load_upgrade() {
  48822. return _upgrade = _interopRequireWildcard(__webpack_require__(194));
  48823. }
  48824. var _version;
  48825. function _load_version() {
  48826. return _version = _interopRequireWildcard(__webpack_require__(299));
  48827. }
  48828. var _versions;
  48829. function _load_versions() {
  48830. return _versions = _interopRequireWildcard(__webpack_require__(500));
  48831. }
  48832. var _why;
  48833. function _load_why() {
  48834. return _why = _interopRequireWildcard(__webpack_require__(501));
  48835. }
  48836. var _workspaces;
  48837. function _load_workspaces() {
  48838. return _workspaces = _interopRequireWildcard(__webpack_require__(503));
  48839. }
  48840. var _workspace;
  48841. function _load_workspace() {
  48842. return _workspace = _interopRequireWildcard(__webpack_require__(502));
  48843. }
  48844. var _upgradeInteractive;
  48845. function _load_upgradeInteractive() {
  48846. return _upgradeInteractive = _interopRequireWildcard(__webpack_require__(298));
  48847. }
  48848. var _useless;
  48849. function _load_useless() {
  48850. return _useless = _interopRequireDefault(__webpack_require__(479));
  48851. }
  48852. var _aliases;
  48853. function _load_aliases() {
  48854. return _aliases = _interopRequireDefault(__webpack_require__(288));
  48855. }
  48856. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  48857. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  48858. var chalk = __webpack_require__(33);
  48859. var getDocsLink = function getDocsLink(name) {
  48860. return `${(_constants || _load_constants()).YARN_DOCS}${name || ''}`;
  48861. };
  48862. var getDocsInfo = function getDocsInfo(name) {
  48863. return 'Visit ' + chalk.bold(getDocsLink(name)) + ' for documentation about this command.';
  48864. };
  48865. var commands = {
  48866. access: _access || _load_access(),
  48867. add: _add || _load_add(),
  48868. audit: _audit || _load_audit(),
  48869. autoclean: _autoclean || _load_autoclean(),
  48870. bin: _bin || _load_bin(),
  48871. cache: _cache || _load_cache(),
  48872. check: _check || _load_check(),
  48873. config: _config || _load_config(),
  48874. create: _create || _load_create(),
  48875. dedupe: (0, (_useless || _load_useless()).default)("The dedupe command isn't necessary. `yarn install` will already dedupe."),
  48876. exec: _exec || _load_exec(),
  48877. generateLockEntry: _generateLockEntry || _load_generateLockEntry(),
  48878. global: _global || _load_global(),
  48879. help: _help || _load_help(),
  48880. import: _import || _load_import(),
  48881. info: _info || _load_info(),
  48882. init: _init || _load_init(),
  48883. install: _install || _load_install(),
  48884. licenses: _licenses || _load_licenses(),
  48885. link: _link || _load_link(),
  48886. lockfile: (0, (_useless || _load_useless()).default)("The lockfile command isn't necessary. `yarn install` will produce a lockfile."),
  48887. login: _login || _load_login(),
  48888. logout: _logout || _load_logout(),
  48889. list: _list || _load_list(),
  48890. node: _node || _load_node(),
  48891. outdated: _outdated || _load_outdated(),
  48892. owner: _owner || _load_owner(),
  48893. pack: _pack || _load_pack(),
  48894. policies: _policies || _load_policies(),
  48895. prune: (0, (_useless || _load_useless()).default)("The prune command isn't necessary. `yarn install` will prune extraneous packages."),
  48896. publish: _publish || _load_publish(),
  48897. remove: _remove || _load_remove(),
  48898. run: _run || _load_run(),
  48899. tag: _tag || _load_tag(),
  48900. team: _team || _load_team(),
  48901. unplug: _unplug || _load_unplug(),
  48902. unlink: _unlink || _load_unlink(),
  48903. upgrade: _upgrade || _load_upgrade(),
  48904. version: _version || _load_version(),
  48905. versions: _versions || _load_versions(),
  48906. why: _why || _load_why(),
  48907. workspaces: _workspaces || _load_workspaces(),
  48908. workspace: _workspace || _load_workspace(),
  48909. upgradeInteractive: _upgradeInteractive || _load_upgradeInteractive()
  48910. };
  48911. for (var key in commands) {
  48912. commands[key].getDocsInfo = getDocsInfo(key);
  48913. }
  48914. for (var _key in (_aliases || _load_aliases()).default) {
  48915. commands[_key] = commands[(_aliases || _load_aliases()).default[_key]];
  48916. commands[_key].getDocsInfo = getDocsInfo(_key);
  48917. }
  48918. exports.default = commands;
  48919. /***/ }),
  48920. /* 274 */
  48921. /***/ (function(module, exports, __webpack_require__) {
  48922. "use strict";
  48923. Object.defineProperty(exports, "__esModule", {
  48924. value: true
  48925. });
  48926. var _map;
  48927. function _load_map() {
  48928. return _map = _interopRequireDefault(__webpack_require__(42));
  48929. }
  48930. var _assign;
  48931. function _load_assign() {
  48932. return _assign = _interopRequireDefault(__webpack_require__(23));
  48933. }
  48934. var _set;
  48935. function _load_set() {
  48936. return _set = _interopRequireDefault(__webpack_require__(16));
  48937. }
  48938. exports.getRcConfigForCwd = getRcConfigForCwd;
  48939. exports.getRcConfigForFolder = getRcConfigForFolder;
  48940. exports.getRcArgs = getRcArgs;
  48941. var _fs;
  48942. function _load_fs() {
  48943. return _fs = __webpack_require__(12);
  48944. }
  48945. var _path;
  48946. function _load_path() {
  48947. return _path = __webpack_require__(1);
  48948. }
  48949. var _commander;
  48950. function _load_commander() {
  48951. return _commander = _interopRequireDefault(__webpack_require__(277));
  48952. }
  48953. var _lockfile;
  48954. function _load_lockfile() {
  48955. return _lockfile = __webpack_require__(25);
  48956. }
  48957. var _rc;
  48958. function _load_rc() {
  48959. return _rc = _interopRequireWildcard(__webpack_require__(547));
  48960. }
  48961. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  48962. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  48963. // Keys that will get resolved relative to the path of the rc file they belong to
  48964. var PATH_KEYS = new (_set || _load_set()).default(['yarn-path', 'cache-folder', 'global-folder', 'modules-folder', 'cwd', 'offline-cache-folder']);
  48965. // given a cwd, load all .yarnrc files relative to it
  48966. function getRcConfigForCwd(cwd, args) {
  48967. var config = {};
  48968. if (args.indexOf('--no-default-rc') === -1) {
  48969. (0, (_assign || _load_assign()).default)(config, (_rc || _load_rc()).findRc('yarn', cwd, function (fileText, filePath) {
  48970. return loadRcFile(fileText, filePath);
  48971. }));
  48972. }
  48973. for (var index = args.indexOf('--use-yarnrc'); index !== -1; index = args.indexOf('--use-yarnrc', index + 1)) {
  48974. var value = args[index + 1];
  48975. if (value && value.charAt(0) !== '-') {
  48976. (0, (_assign || _load_assign()).default)(config, loadRcFile((0, (_fs || _load_fs()).readFileSync)(value, 'utf8'), value));
  48977. }
  48978. }
  48979. return config;
  48980. }
  48981. function getRcConfigForFolder(cwd) {
  48982. var filePath = (0, (_path || _load_path()).resolve)(cwd, '.yarnrc');
  48983. if (!(0, (_fs || _load_fs()).existsSync)(filePath)) {
  48984. return {};
  48985. }
  48986. var fileText = (0, (_fs || _load_fs()).readFileSync)(filePath, 'utf8');
  48987. return loadRcFile(fileText, filePath);
  48988. }
  48989. function loadRcFile(fileText, filePath) {
  48990. var _parse = (0, (_lockfile || _load_lockfile()).parse)(fileText, filePath),
  48991. values = _parse.object;
  48992. if (filePath.match(/\.yml$/) && values && typeof values.yarnPath === 'string') {
  48993. values = { 'yarn-path': values.yarnPath };
  48994. }
  48995. // some keys reference directories so keep their relativity
  48996. for (var _key in values) {
  48997. if (PATH_KEYS.has(_key.replace(/^(--)?([^.]+\.)*/, ''))) {
  48998. values[_key] = (0, (_path || _load_path()).resolve)((0, (_path || _load_path()).dirname)(filePath), values[_key]);
  48999. }
  49000. }
  49001. return values;
  49002. }
  49003. // get the built of arguments of a .yarnrc chain of the passed cwd
  49004. function buildRcArgs(cwd, args) {
  49005. var config = getRcConfigForCwd(cwd, args);
  49006. var argsForCommands = new (_map || _load_map()).default();
  49007. for (var _key2 in config) {
  49008. // args can be prefixed with the command name they're meant for, eg.
  49009. // `--install.check-files true`
  49010. var keyMatch = _key2.match(/^--(?:([^.]+)\.)?(.*)$/);
  49011. if (!keyMatch) {
  49012. continue;
  49013. }
  49014. var commandName = keyMatch[1] || '*';
  49015. var arg = keyMatch[2];
  49016. var value = config[_key2];
  49017. // create args for this command name if we didn't previously have them
  49018. var _args = argsForCommands.get(commandName) || [];
  49019. argsForCommands.set(commandName, _args);
  49020. // turn config value into appropriate cli flag
  49021. var option = (_commander || _load_commander()).default.optionFor(`--${arg}`);
  49022. // If commander doesn't recognize the option or it takes a value after it
  49023. if (!option || option.optional || option.required) {
  49024. _args.push(`--${arg}`, value);
  49025. } else if (value === true) {
  49026. // we can't force remove an arg from cli
  49027. _args.push(`--${arg}`);
  49028. }
  49029. }
  49030. return argsForCommands;
  49031. }
  49032. // extract the value of a --cwd arg if present
  49033. function extractCwdArg(args) {
  49034. for (var i = 0, I = args.length; i < I; ++i) {
  49035. var arg = args[i];
  49036. if (arg === '--') {
  49037. return null;
  49038. } else if (arg === '--cwd') {
  49039. return args[i + 1];
  49040. }
  49041. }
  49042. return null;
  49043. }
  49044. // get a list of arguments from .yarnrc that apply to this commandName
  49045. function getRcArgs(commandName, args) {
  49046. var previousCwds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  49047. // for the cwd, use the --cwd arg if it was passed or else use process.cwd()
  49048. var origCwd = extractCwdArg(args) || process.cwd();
  49049. // get a map of command names and their arguments
  49050. var argMap = buildRcArgs(origCwd, args);
  49051. // concat wildcard arguments and arguments meant for this specific command
  49052. var newArgs = [].concat(argMap.get('*') || [], argMap.get(commandName) || []);
  49053. // check if the .yarnrc args specified a cwd
  49054. var newCwd = extractCwdArg(newArgs);
  49055. if (newCwd && newCwd !== origCwd) {
  49056. // ensure that we don't enter into a loop
  49057. if (previousCwds.indexOf(newCwd) !== -1) {
  49058. throw new Error(`Recursive .yarnrc files specifying --cwd flags. Bailing out.`);
  49059. }
  49060. // if we have a new cwd then let's refetch the .yarnrc args relative to it
  49061. return getRcArgs(commandName, newArgs, previousCwds.concat(origCwd));
  49062. }
  49063. return newArgs;
  49064. }
  49065. /***/ }),
  49066. /* 275 */
  49067. /***/ (function(module, exports, __webpack_require__) {
  49068. "use strict";
  49069. Object.defineProperty(exports, "__esModule", {
  49070. value: true
  49071. });
  49072. var _set;
  49073. function _load_set() {
  49074. return _set = _interopRequireDefault(__webpack_require__(16));
  49075. }
  49076. exports.boolify = boolify;
  49077. exports.boolifyWithDefault = boolifyWithDefault;
  49078. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  49079. var FALSY_STRINGS = new (_set || _load_set()).default(['0', 'false']);
  49080. function boolify(val) {
  49081. return !FALSY_STRINGS.has(val.toString().toLowerCase());
  49082. }
  49083. function boolifyWithDefault(val, defaultResult) {
  49084. return val === '' || val === null || val === undefined ? defaultResult : boolify(val);
  49085. }
  49086. /***/ }),
  49087. /* 276 */
  49088. /***/ (function(module, exports, __webpack_require__) {
  49089. "use strict";
  49090. Object.defineProperty(exports, "__esModule", {
  49091. value: true
  49092. });
  49093. var _getIterator2;
  49094. function _load_getIterator() {
  49095. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  49096. }
  49097. exports.isOffline = isOffline;
  49098. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  49099. var os = __webpack_require__(66);
  49100. var IGNORE_INTERFACES = ['lo0', 'awdl0', 'bridge0'];
  49101. var LOCAL_IPS = ['127.0.0.1', '::1'];
  49102. function isOffline() {
  49103. var interfaces = void 0;
  49104. try {
  49105. interfaces = os.networkInterfaces();
  49106. } catch (e) {
  49107. // As of October 2016, Windows Subsystem for Linux (WSL) does not support
  49108. // the os.networkInterfaces() call and throws instead. For this platform,
  49109. // assume we are online.
  49110. if (e.syscall === 'uv_interface_addresses') {
  49111. return false;
  49112. } else {
  49113. throw e;
  49114. }
  49115. }
  49116. for (var name in interfaces) {
  49117. if (IGNORE_INTERFACES.indexOf(name) >= 0) {
  49118. continue;
  49119. }
  49120. var addrs = interfaces[name];
  49121. for (var _iterator = addrs, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  49122. var _ref;
  49123. if (_isArray) {
  49124. if (_i >= _iterator.length) break;
  49125. _ref = _iterator[_i++];
  49126. } else {
  49127. _i = _iterator.next();
  49128. if (_i.done) break;
  49129. _ref = _i.value;
  49130. }
  49131. var addr = _ref;
  49132. if (LOCAL_IPS.indexOf(addr.address) < 0) {
  49133. // found a possible remote ip
  49134. return false;
  49135. }
  49136. }
  49137. }
  49138. return true;
  49139. }
  49140. /***/ }),
  49141. /* 277 */
  49142. /***/ (function(module, exports, __webpack_require__) {
  49143. /**
  49144. * Module dependencies.
  49145. */
  49146. var EventEmitter = __webpack_require__(95).EventEmitter;
  49147. var spawn = __webpack_require__(271).spawn;
  49148. var path = __webpack_require__(1);
  49149. var dirname = path.dirname;
  49150. var basename = path.basename;
  49151. var fs = __webpack_require__(12);
  49152. /**
  49153. * Inherit `Command` from `EventEmitter.prototype`.
  49154. */
  49155. __webpack_require__(9).inherits(Command, EventEmitter);
  49156. /**
  49157. * Expose the root command.
  49158. */
  49159. exports = module.exports = new Command();
  49160. /**
  49161. * Expose `Command`.
  49162. */
  49163. exports.Command = Command;
  49164. /**
  49165. * Expose `Option`.
  49166. */
  49167. exports.Option = Option;
  49168. /**
  49169. * Initialize a new `Option` with the given `flags` and `description`.
  49170. *
  49171. * @param {String} flags
  49172. * @param {String} description
  49173. * @api public
  49174. */
  49175. function Option(flags, description) {
  49176. this.flags = flags;
  49177. this.required = flags.indexOf('<') >= 0;
  49178. this.optional = flags.indexOf('[') >= 0;
  49179. this.bool = flags.indexOf('-no-') === -1;
  49180. flags = flags.split(/[ ,|]+/);
  49181. if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
  49182. this.long = flags.shift();
  49183. this.description = description || '';
  49184. }
  49185. /**
  49186. * Return option name.
  49187. *
  49188. * @return {String}
  49189. * @api private
  49190. */
  49191. Option.prototype.name = function() {
  49192. return this.long
  49193. .replace('--', '')
  49194. .replace('no-', '');
  49195. };
  49196. /**
  49197. * Return option name, in a camelcase format that can be used
  49198. * as a object attribute key.
  49199. *
  49200. * @return {String}
  49201. * @api private
  49202. */
  49203. Option.prototype.attributeName = function() {
  49204. return camelcase(this.name());
  49205. };
  49206. /**
  49207. * Check if `arg` matches the short or long flag.
  49208. *
  49209. * @param {String} arg
  49210. * @return {Boolean}
  49211. * @api private
  49212. */
  49213. Option.prototype.is = function(arg) {
  49214. return this.short === arg || this.long === arg;
  49215. };
  49216. /**
  49217. * Initialize a new `Command`.
  49218. *
  49219. * @param {String} name
  49220. * @api public
  49221. */
  49222. function Command(name) {
  49223. this.commands = [];
  49224. this.options = [];
  49225. this._execs = {};
  49226. this._allowUnknownOption = false;
  49227. this._args = [];
  49228. this._name = name || '';
  49229. }
  49230. /**
  49231. * Add command `name`.
  49232. *
  49233. * The `.action()` callback is invoked when the
  49234. * command `name` is specified via __ARGV__,
  49235. * and the remaining arguments are applied to the
  49236. * function for access.
  49237. *
  49238. * When the `name` is "*" an un-matched command
  49239. * will be passed as the first arg, followed by
  49240. * the rest of __ARGV__ remaining.
  49241. *
  49242. * Examples:
  49243. *
  49244. * program
  49245. * .version('0.0.1')
  49246. * .option('-C, --chdir <path>', 'change the working directory')
  49247. * .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
  49248. * .option('-T, --no-tests', 'ignore test hook')
  49249. *
  49250. * program
  49251. * .command('setup')
  49252. * .description('run remote setup commands')
  49253. * .action(function() {
  49254. * console.log('setup');
  49255. * });
  49256. *
  49257. * program
  49258. * .command('exec <cmd>')
  49259. * .description('run the given remote command')
  49260. * .action(function(cmd) {
  49261. * console.log('exec "%s"', cmd);
  49262. * });
  49263. *
  49264. * program
  49265. * .command('teardown <dir> [otherDirs...]')
  49266. * .description('run teardown commands')
  49267. * .action(function(dir, otherDirs) {
  49268. * console.log('dir "%s"', dir);
  49269. * if (otherDirs) {
  49270. * otherDirs.forEach(function (oDir) {
  49271. * console.log('dir "%s"', oDir);
  49272. * });
  49273. * }
  49274. * });
  49275. *
  49276. * program
  49277. * .command('*')
  49278. * .description('deploy the given env')
  49279. * .action(function(env) {
  49280. * console.log('deploying "%s"', env);
  49281. * });
  49282. *
  49283. * program.parse(process.argv);
  49284. *
  49285. * @param {String} name
  49286. * @param {String} [desc] for git-style sub-commands
  49287. * @return {Command} the new command
  49288. * @api public
  49289. */
  49290. Command.prototype.command = function(name, desc, opts) {
  49291. if (typeof desc === 'object' && desc !== null) {
  49292. opts = desc;
  49293. desc = null;
  49294. }
  49295. opts = opts || {};
  49296. var args = name.split(/ +/);
  49297. var cmd = new Command(args.shift());
  49298. if (desc) {
  49299. cmd.description(desc);
  49300. this.executables = true;
  49301. this._execs[cmd._name] = true;
  49302. if (opts.isDefault) this.defaultExecutable = cmd._name;
  49303. }
  49304. cmd._noHelp = !!opts.noHelp;
  49305. this.commands.push(cmd);
  49306. cmd.parseExpectedArgs(args);
  49307. cmd.parent = this;
  49308. if (desc) return this;
  49309. return cmd;
  49310. };
  49311. /**
  49312. * Define argument syntax for the top-level command.
  49313. *
  49314. * @api public
  49315. */
  49316. Command.prototype.arguments = function(desc) {
  49317. return this.parseExpectedArgs(desc.split(/ +/));
  49318. };
  49319. /**
  49320. * Add an implicit `help [cmd]` subcommand
  49321. * which invokes `--help` for the given command.
  49322. *
  49323. * @api private
  49324. */
  49325. Command.prototype.addImplicitHelpCommand = function() {
  49326. this.command('help [cmd]', 'display help for [cmd]');
  49327. };
  49328. /**
  49329. * Parse expected `args`.
  49330. *
  49331. * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
  49332. *
  49333. * @param {Array} args
  49334. * @return {Command} for chaining
  49335. * @api public
  49336. */
  49337. Command.prototype.parseExpectedArgs = function(args) {
  49338. if (!args.length) return;
  49339. var self = this;
  49340. args.forEach(function(arg) {
  49341. var argDetails = {
  49342. required: false,
  49343. name: '',
  49344. variadic: false
  49345. };
  49346. switch (arg[0]) {
  49347. case '<':
  49348. argDetails.required = true;
  49349. argDetails.name = arg.slice(1, -1);
  49350. break;
  49351. case '[':
  49352. argDetails.name = arg.slice(1, -1);
  49353. break;
  49354. }
  49355. if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') {
  49356. argDetails.variadic = true;
  49357. argDetails.name = argDetails.name.slice(0, -3);
  49358. }
  49359. if (argDetails.name) {
  49360. self._args.push(argDetails);
  49361. }
  49362. });
  49363. return this;
  49364. };
  49365. /**
  49366. * Register callback `fn` for the command.
  49367. *
  49368. * Examples:
  49369. *
  49370. * program
  49371. * .command('help')
  49372. * .description('display verbose help')
  49373. * .action(function() {
  49374. * // output help here
  49375. * });
  49376. *
  49377. * @param {Function} fn
  49378. * @return {Command} for chaining
  49379. * @api public
  49380. */
  49381. Command.prototype.action = function(fn) {
  49382. var self = this;
  49383. var listener = function(args, unknown) {
  49384. // Parse any so-far unknown options
  49385. args = args || [];
  49386. unknown = unknown || [];
  49387. var parsed = self.parseOptions(unknown);
  49388. // Output help if necessary
  49389. outputHelpIfNecessary(self, parsed.unknown);
  49390. // If there are still any unknown options, then we simply
  49391. // die, unless someone asked for help, in which case we give it
  49392. // to them, and then we die.
  49393. if (parsed.unknown.length > 0) {
  49394. self.unknownOption(parsed.unknown[0]);
  49395. }
  49396. // Leftover arguments need to be pushed back. Fixes issue #56
  49397. if (parsed.args.length) args = parsed.args.concat(args);
  49398. self._args.forEach(function(arg, i) {
  49399. if (arg.required && args[i] == null) {
  49400. self.missingArgument(arg.name);
  49401. } else if (arg.variadic) {
  49402. if (i !== self._args.length - 1) {
  49403. self.variadicArgNotLast(arg.name);
  49404. }
  49405. args[i] = args.splice(i);
  49406. }
  49407. });
  49408. // Always append ourselves to the end of the arguments,
  49409. // to make sure we match the number of arguments the user
  49410. // expects
  49411. if (self._args.length) {
  49412. args[self._args.length] = self;
  49413. } else {
  49414. args.push(self);
  49415. }
  49416. fn.apply(self, args);
  49417. };
  49418. var parent = this.parent || this;
  49419. var name = parent === this ? '*' : this._name;
  49420. parent.on('command:' + name, listener);
  49421. if (this._alias) parent.on('command:' + this._alias, listener);
  49422. return this;
  49423. };
  49424. /**
  49425. * Define option with `flags`, `description` and optional
  49426. * coercion `fn`.
  49427. *
  49428. * The `flags` string should contain both the short and long flags,
  49429. * separated by comma, a pipe or space. The following are all valid
  49430. * all will output this way when `--help` is used.
  49431. *
  49432. * "-p, --pepper"
  49433. * "-p|--pepper"
  49434. * "-p --pepper"
  49435. *
  49436. * Examples:
  49437. *
  49438. * // simple boolean defaulting to false
  49439. * program.option('-p, --pepper', 'add pepper');
  49440. *
  49441. * --pepper
  49442. * program.pepper
  49443. * // => Boolean
  49444. *
  49445. * // simple boolean defaulting to true
  49446. * program.option('-C, --no-cheese', 'remove cheese');
  49447. *
  49448. * program.cheese
  49449. * // => true
  49450. *
  49451. * --no-cheese
  49452. * program.cheese
  49453. * // => false
  49454. *
  49455. * // required argument
  49456. * program.option('-C, --chdir <path>', 'change the working directory');
  49457. *
  49458. * --chdir /tmp
  49459. * program.chdir
  49460. * // => "/tmp"
  49461. *
  49462. * // optional argument
  49463. * program.option('-c, --cheese [type]', 'add cheese [marble]');
  49464. *
  49465. * @param {String} flags
  49466. * @param {String} description
  49467. * @param {Function|*} [fn] or default
  49468. * @param {*} [defaultValue]
  49469. * @return {Command} for chaining
  49470. * @api public
  49471. */
  49472. Command.prototype.option = function(flags, description, fn, defaultValue) {
  49473. var self = this,
  49474. option = new Option(flags, description),
  49475. oname = option.name(),
  49476. name = option.attributeName();
  49477. // default as 3rd arg
  49478. if (typeof fn !== 'function') {
  49479. if (fn instanceof RegExp) {
  49480. var regex = fn;
  49481. fn = function(val, def) {
  49482. var m = regex.exec(val);
  49483. return m ? m[0] : def;
  49484. };
  49485. } else {
  49486. defaultValue = fn;
  49487. fn = null;
  49488. }
  49489. }
  49490. // preassign default value only for --no-*, [optional], or <required>
  49491. if (!option.bool || option.optional || option.required) {
  49492. // when --no-* we make sure default is true
  49493. if (!option.bool) defaultValue = true;
  49494. // preassign only if we have a default
  49495. if (defaultValue !== undefined) {
  49496. self[name] = defaultValue;
  49497. option.defaultValue = defaultValue;
  49498. }
  49499. }
  49500. // register the option
  49501. this.options.push(option);
  49502. // when it's passed assign the value
  49503. // and conditionally invoke the callback
  49504. this.on('option:' + oname, function(val) {
  49505. // coercion
  49506. if (val !== null && fn) {
  49507. val = fn(val, self[name] === undefined ? defaultValue : self[name]);
  49508. }
  49509. // unassigned or bool
  49510. if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') {
  49511. // if no value, bool true, and we have a default, then use it!
  49512. if (val == null) {
  49513. self[name] = option.bool
  49514. ? defaultValue || true
  49515. : false;
  49516. } else {
  49517. self[name] = val;
  49518. }
  49519. } else if (val !== null) {
  49520. // reassign
  49521. self[name] = val;
  49522. }
  49523. });
  49524. return this;
  49525. };
  49526. /**
  49527. * Allow unknown options on the command line.
  49528. *
  49529. * @param {Boolean} arg if `true` or omitted, no error will be thrown
  49530. * for unknown options.
  49531. * @api public
  49532. */
  49533. Command.prototype.allowUnknownOption = function(arg) {
  49534. this._allowUnknownOption = arguments.length === 0 || arg;
  49535. return this;
  49536. };
  49537. /**
  49538. * Parse `argv`, settings options and invoking commands when defined.
  49539. *
  49540. * @param {Array} argv
  49541. * @return {Command} for chaining
  49542. * @api public
  49543. */
  49544. Command.prototype.parse = function(argv) {
  49545. // implicit help
  49546. if (this.executables) this.addImplicitHelpCommand();
  49547. // store raw args
  49548. this.rawArgs = argv;
  49549. // guess name
  49550. this._name = this._name || basename(argv[1], '.js');
  49551. // github-style sub-commands with no sub-command
  49552. if (this.executables && argv.length < 3 && !this.defaultExecutable) {
  49553. // this user needs help
  49554. argv.push('--help');
  49555. }
  49556. // process argv
  49557. var parsed = this.parseOptions(this.normalize(argv.slice(2)));
  49558. var args = this.args = parsed.args;
  49559. var result = this.parseArgs(this.args, parsed.unknown);
  49560. // executable sub-commands
  49561. var name = result.args[0];
  49562. var aliasCommand = null;
  49563. // check alias of sub commands
  49564. if (name) {
  49565. aliasCommand = this.commands.filter(function(command) {
  49566. return command.alias() === name;
  49567. })[0];
  49568. }
  49569. if (this._execs[name] && typeof this._execs[name] !== 'function') {
  49570. return this.executeSubCommand(argv, args, parsed.unknown);
  49571. } else if (aliasCommand) {
  49572. // is alias of a subCommand
  49573. args[0] = aliasCommand._name;
  49574. return this.executeSubCommand(argv, args, parsed.unknown);
  49575. } else if (this.defaultExecutable) {
  49576. // use the default subcommand
  49577. args.unshift(this.defaultExecutable);
  49578. return this.executeSubCommand(argv, args, parsed.unknown);
  49579. }
  49580. return result;
  49581. };
  49582. /**
  49583. * Execute a sub-command executable.
  49584. *
  49585. * @param {Array} argv
  49586. * @param {Array} args
  49587. * @param {Array} unknown
  49588. * @api private
  49589. */
  49590. Command.prototype.executeSubCommand = function(argv, args, unknown) {
  49591. args = args.concat(unknown);
  49592. if (!args.length) this.help();
  49593. if (args[0] === 'help' && args.length === 1) this.help();
  49594. // <cmd> --help
  49595. if (args[0] === 'help') {
  49596. args[0] = args[1];
  49597. args[1] = '--help';
  49598. }
  49599. // executable
  49600. var f = argv[1];
  49601. // name of the subcommand, link `pm-install`
  49602. var bin = basename(f, '.js') + '-' + args[0];
  49603. // In case of globally installed, get the base dir where executable
  49604. // subcommand file should be located at
  49605. var baseDir,
  49606. link = fs.lstatSync(f).isSymbolicLink() ? fs.readlinkSync(f) : f;
  49607. // when symbolink is relative path
  49608. if (link !== f && link.charAt(0) !== '/') {
  49609. link = path.join(dirname(f), link);
  49610. }
  49611. baseDir = dirname(link);
  49612. // prefer local `./<bin>` to bin in the $PATH
  49613. var localBin = path.join(baseDir, bin);
  49614. // whether bin file is a js script with explicit `.js` extension
  49615. var isExplicitJS = false;
  49616. if (exists(localBin + '.js')) {
  49617. bin = localBin + '.js';
  49618. isExplicitJS = true;
  49619. } else if (exists(localBin)) {
  49620. bin = localBin;
  49621. }
  49622. args = args.slice(1);
  49623. var proc;
  49624. if (process.platform !== 'win32') {
  49625. if (isExplicitJS) {
  49626. args.unshift(bin);
  49627. // add executable arguments to spawn
  49628. args = (process.execArgv || []).concat(args);
  49629. proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] });
  49630. } else {
  49631. proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });
  49632. }
  49633. } else {
  49634. args.unshift(bin);
  49635. proc = spawn(process.execPath, args, { stdio: 'inherit' });
  49636. }
  49637. var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];
  49638. signals.forEach(function(signal) {
  49639. process.on(signal, function() {
  49640. if (proc.killed === false && proc.exitCode === null) {
  49641. proc.kill(signal);
  49642. }
  49643. });
  49644. });
  49645. proc.on('close', process.exit.bind(process));
  49646. proc.on('error', function(err) {
  49647. if (err.code === 'ENOENT') {
  49648. console.error('\n %s(1) does not exist, try --help\n', bin);
  49649. } else if (err.code === 'EACCES') {
  49650. console.error('\n %s(1) not executable. try chmod or run with root\n', bin);
  49651. }
  49652. process.exit(1);
  49653. });
  49654. // Store the reference to the child process
  49655. this.runningCommand = proc;
  49656. };
  49657. /**
  49658. * Normalize `args`, splitting joined short flags. For example
  49659. * the arg "-abc" is equivalent to "-a -b -c".
  49660. * This also normalizes equal sign and splits "--abc=def" into "--abc def".
  49661. *
  49662. * @param {Array} args
  49663. * @return {Array}
  49664. * @api private
  49665. */
  49666. Command.prototype.normalize = function(args) {
  49667. var ret = [],
  49668. arg,
  49669. lastOpt,
  49670. index;
  49671. for (var i = 0, len = args.length; i < len; ++i) {
  49672. arg = args[i];
  49673. if (i > 0) {
  49674. lastOpt = this.optionFor(args[i - 1]);
  49675. }
  49676. if (arg === '--') {
  49677. // Honor option terminator
  49678. ret = ret.concat(args.slice(i));
  49679. break;
  49680. } else if (lastOpt && lastOpt.required) {
  49681. ret.push(arg);
  49682. } else if (arg.length > 1 && arg[0] === '-' && arg[1] !== '-') {
  49683. arg.slice(1).split('').forEach(function(c) {
  49684. ret.push('-' + c);
  49685. });
  49686. } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {
  49687. ret.push(arg.slice(0, index), arg.slice(index + 1));
  49688. } else {
  49689. ret.push(arg);
  49690. }
  49691. }
  49692. return ret;
  49693. };
  49694. /**
  49695. * Parse command `args`.
  49696. *
  49697. * When listener(s) are available those
  49698. * callbacks are invoked, otherwise the "*"
  49699. * event is emitted and those actions are invoked.
  49700. *
  49701. * @param {Array} args
  49702. * @return {Command} for chaining
  49703. * @api private
  49704. */
  49705. Command.prototype.parseArgs = function(args, unknown) {
  49706. var name;
  49707. if (args.length) {
  49708. name = args[0];
  49709. if (this.listeners('command:' + name).length) {
  49710. this.emit('command:' + args.shift(), args, unknown);
  49711. } else {
  49712. this.emit('command:*', args);
  49713. }
  49714. } else {
  49715. outputHelpIfNecessary(this, unknown);
  49716. // If there were no args and we have unknown options,
  49717. // then they are extraneous and we need to error.
  49718. if (unknown.length > 0) {
  49719. this.unknownOption(unknown[0]);
  49720. }
  49721. }
  49722. return this;
  49723. };
  49724. /**
  49725. * Return an option matching `arg` if any.
  49726. *
  49727. * @param {String} arg
  49728. * @return {Option}
  49729. * @api private
  49730. */
  49731. Command.prototype.optionFor = function(arg) {
  49732. for (var i = 0, len = this.options.length; i < len; ++i) {
  49733. if (this.options[i].is(arg)) {
  49734. return this.options[i];
  49735. }
  49736. }
  49737. };
  49738. /**
  49739. * Parse options from `argv` returning `argv`
  49740. * void of these options.
  49741. *
  49742. * @param {Array} argv
  49743. * @return {Array}
  49744. * @api public
  49745. */
  49746. Command.prototype.parseOptions = function(argv) {
  49747. var args = [],
  49748. len = argv.length,
  49749. literal,
  49750. option,
  49751. arg;
  49752. var unknownOptions = [];
  49753. // parse options
  49754. for (var i = 0; i < len; ++i) {
  49755. arg = argv[i];
  49756. // literal args after --
  49757. if (literal) {
  49758. args.push(arg);
  49759. continue;
  49760. }
  49761. if (arg === '--') {
  49762. literal = true;
  49763. continue;
  49764. }
  49765. // find matching Option
  49766. option = this.optionFor(arg);
  49767. // option is defined
  49768. if (option) {
  49769. // requires arg
  49770. if (option.required) {
  49771. arg = argv[++i];
  49772. if (arg == null) return this.optionMissingArgument(option);
  49773. this.emit('option:' + option.name(), arg);
  49774. // optional arg
  49775. } else if (option.optional) {
  49776. arg = argv[i + 1];
  49777. if (arg == null || (arg[0] === '-' && arg !== '-')) {
  49778. arg = null;
  49779. } else {
  49780. ++i;
  49781. }
  49782. this.emit('option:' + option.name(), arg);
  49783. // bool
  49784. } else {
  49785. this.emit('option:' + option.name());
  49786. }
  49787. continue;
  49788. }
  49789. // looks like an option
  49790. if (arg.length > 1 && arg[0] === '-') {
  49791. unknownOptions.push(arg);
  49792. // If the next argument looks like it might be
  49793. // an argument for this option, we pass it on.
  49794. // If it isn't, then it'll simply be ignored
  49795. if ((i + 1) < argv.length && argv[i + 1][0] !== '-') {
  49796. unknownOptions.push(argv[++i]);
  49797. }
  49798. continue;
  49799. }
  49800. // arg
  49801. args.push(arg);
  49802. }
  49803. return { args: args, unknown: unknownOptions };
  49804. };
  49805. /**
  49806. * Return an object containing options as key-value pairs
  49807. *
  49808. * @return {Object}
  49809. * @api public
  49810. */
  49811. Command.prototype.opts = function() {
  49812. var result = {},
  49813. len = this.options.length;
  49814. for (var i = 0; i < len; i++) {
  49815. var key = this.options[i].attributeName();
  49816. result[key] = key === this._versionOptionName ? this._version : this[key];
  49817. }
  49818. return result;
  49819. };
  49820. /**
  49821. * Argument `name` is missing.
  49822. *
  49823. * @param {String} name
  49824. * @api private
  49825. */
  49826. Command.prototype.missingArgument = function(name) {
  49827. console.error();
  49828. console.error(" error: missing required argument `%s'", name);
  49829. console.error();
  49830. process.exit(1);
  49831. };
  49832. /**
  49833. * `Option` is missing an argument, but received `flag` or nothing.
  49834. *
  49835. * @param {String} option
  49836. * @param {String} flag
  49837. * @api private
  49838. */
  49839. Command.prototype.optionMissingArgument = function(option, flag) {
  49840. console.error();
  49841. if (flag) {
  49842. console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
  49843. } else {
  49844. console.error(" error: option `%s' argument missing", option.flags);
  49845. }
  49846. console.error();
  49847. process.exit(1);
  49848. };
  49849. /**
  49850. * Unknown option `flag`.
  49851. *
  49852. * @param {String} flag
  49853. * @api private
  49854. */
  49855. Command.prototype.unknownOption = function(flag) {
  49856. if (this._allowUnknownOption) return;
  49857. console.error();
  49858. console.error(" error: unknown option `%s'", flag);
  49859. console.error();
  49860. process.exit(1);
  49861. };
  49862. /**
  49863. * Variadic argument with `name` is not the last argument as required.
  49864. *
  49865. * @param {String} name
  49866. * @api private
  49867. */
  49868. Command.prototype.variadicArgNotLast = function(name) {
  49869. console.error();
  49870. console.error(" error: variadic arguments must be last `%s'", name);
  49871. console.error();
  49872. process.exit(1);
  49873. };
  49874. /**
  49875. * Set the program version to `str`.
  49876. *
  49877. * This method auto-registers the "-V, --version" flag
  49878. * which will print the version number when passed.
  49879. *
  49880. * @param {String} str
  49881. * @param {String} [flags]
  49882. * @return {Command} for chaining
  49883. * @api public
  49884. */
  49885. Command.prototype.version = function(str, flags) {
  49886. if (arguments.length === 0) return this._version;
  49887. this._version = str;
  49888. flags = flags || '-V, --version';
  49889. var versionOption = new Option(flags, 'output the version number');
  49890. this._versionOptionName = versionOption.long.substr(2) || 'version';
  49891. this.options.push(versionOption);
  49892. this.on('option:' + this._versionOptionName, function() {
  49893. process.stdout.write(str + '\n');
  49894. process.exit(0);
  49895. });
  49896. return this;
  49897. };
  49898. /**
  49899. * Set the description to `str`.
  49900. *
  49901. * @param {String} str
  49902. * @param {Object} argsDescription
  49903. * @return {String|Command}
  49904. * @api public
  49905. */
  49906. Command.prototype.description = function(str, argsDescription) {
  49907. if (arguments.length === 0) return this._description;
  49908. this._description = str;
  49909. this._argsDescription = argsDescription;
  49910. return this;
  49911. };
  49912. /**
  49913. * Set an alias for the command
  49914. *
  49915. * @param {String} alias
  49916. * @return {String|Command}
  49917. * @api public
  49918. */
  49919. Command.prototype.alias = function(alias) {
  49920. var command = this;
  49921. if (this.commands.length !== 0) {
  49922. command = this.commands[this.commands.length - 1];
  49923. }
  49924. if (arguments.length === 0) return command._alias;
  49925. if (alias === command._name) throw new Error('Command alias can\'t be the same as its name');
  49926. command._alias = alias;
  49927. return this;
  49928. };
  49929. /**
  49930. * Set / get the command usage `str`.
  49931. *
  49932. * @param {String} str
  49933. * @return {String|Command}
  49934. * @api public
  49935. */
  49936. Command.prototype.usage = function(str) {
  49937. var args = this._args.map(function(arg) {
  49938. return humanReadableArgName(arg);
  49939. });
  49940. var usage = '[options]' +
  49941. (this.commands.length ? ' [command]' : '') +
  49942. (this._args.length ? ' ' + args.join(' ') : '');
  49943. if (arguments.length === 0) return this._usage || usage;
  49944. this._usage = str;
  49945. return this;
  49946. };
  49947. /**
  49948. * Get or set the name of the command
  49949. *
  49950. * @param {String} str
  49951. * @return {String|Command}
  49952. * @api public
  49953. */
  49954. Command.prototype.name = function(str) {
  49955. if (arguments.length === 0) return this._name;
  49956. this._name = str;
  49957. return this;
  49958. };
  49959. /**
  49960. * Return prepared commands.
  49961. *
  49962. * @return {Array}
  49963. * @api private
  49964. */
  49965. Command.prototype.prepareCommands = function() {
  49966. return this.commands.filter(function(cmd) {
  49967. return !cmd._noHelp;
  49968. }).map(function(cmd) {
  49969. var args = cmd._args.map(function(arg) {
  49970. return humanReadableArgName(arg);
  49971. }).join(' ');
  49972. return [
  49973. cmd._name +
  49974. (cmd._alias ? '|' + cmd._alias : '') +
  49975. (cmd.options.length ? ' [options]' : '') +
  49976. (args ? ' ' + args : ''),
  49977. cmd._description
  49978. ];
  49979. });
  49980. };
  49981. /**
  49982. * Return the largest command length.
  49983. *
  49984. * @return {Number}
  49985. * @api private
  49986. */
  49987. Command.prototype.largestCommandLength = function() {
  49988. var commands = this.prepareCommands();
  49989. return commands.reduce(function(max, command) {
  49990. return Math.max(max, command[0].length);
  49991. }, 0);
  49992. };
  49993. /**
  49994. * Return the largest option length.
  49995. *
  49996. * @return {Number}
  49997. * @api private
  49998. */
  49999. Command.prototype.largestOptionLength = function() {
  50000. var options = [].slice.call(this.options);
  50001. options.push({
  50002. flags: '-h, --help'
  50003. });
  50004. return options.reduce(function(max, option) {
  50005. return Math.max(max, option.flags.length);
  50006. }, 0);
  50007. };
  50008. /**
  50009. * Return the largest arg length.
  50010. *
  50011. * @return {Number}
  50012. * @api private
  50013. */
  50014. Command.prototype.largestArgLength = function() {
  50015. return this._args.reduce(function(max, arg) {
  50016. return Math.max(max, arg.name.length);
  50017. }, 0);
  50018. };
  50019. /**
  50020. * Return the pad width.
  50021. *
  50022. * @return {Number}
  50023. * @api private
  50024. */
  50025. Command.prototype.padWidth = function() {
  50026. var width = this.largestOptionLength();
  50027. if (this._argsDescription && this._args.length) {
  50028. if (this.largestArgLength() > width) {
  50029. width = this.largestArgLength();
  50030. }
  50031. }
  50032. if (this.commands && this.commands.length) {
  50033. if (this.largestCommandLength() > width) {
  50034. width = this.largestCommandLength();
  50035. }
  50036. }
  50037. return width;
  50038. };
  50039. /**
  50040. * Return help for options.
  50041. *
  50042. * @return {String}
  50043. * @api private
  50044. */
  50045. Command.prototype.optionHelp = function() {
  50046. var width = this.padWidth();
  50047. // Append the help information
  50048. return this.options.map(function(option) {
  50049. return pad(option.flags, width) + ' ' + option.description +
  50050. ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + option.defaultValue + ')' : '');
  50051. }).concat([pad('-h, --help', width) + ' ' + 'output usage information'])
  50052. .join('\n');
  50053. };
  50054. /**
  50055. * Return command help documentation.
  50056. *
  50057. * @return {String}
  50058. * @api private
  50059. */
  50060. Command.prototype.commandHelp = function() {
  50061. if (!this.commands.length) return '';
  50062. var commands = this.prepareCommands();
  50063. var width = this.padWidth();
  50064. return [
  50065. ' Commands:',
  50066. '',
  50067. commands.map(function(cmd) {
  50068. var desc = cmd[1] ? ' ' + cmd[1] : '';
  50069. return (desc ? pad(cmd[0], width) : cmd[0]) + desc;
  50070. }).join('\n').replace(/^/gm, ' '),
  50071. ''
  50072. ].join('\n');
  50073. };
  50074. /**
  50075. * Return program help documentation.
  50076. *
  50077. * @return {String}
  50078. * @api private
  50079. */
  50080. Command.prototype.helpInformation = function() {
  50081. var desc = [];
  50082. if (this._description) {
  50083. desc = [
  50084. ' ' + this._description,
  50085. ''
  50086. ];
  50087. var argsDescription = this._argsDescription;
  50088. if (argsDescription && this._args.length) {
  50089. var width = this.padWidth();
  50090. desc.push(' Arguments:');
  50091. desc.push('');
  50092. this._args.forEach(function(arg) {
  50093. desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]);
  50094. });
  50095. desc.push('');
  50096. }
  50097. }
  50098. var cmdName = this._name;
  50099. if (this._alias) {
  50100. cmdName = cmdName + '|' + this._alias;
  50101. }
  50102. var usage = [
  50103. '',
  50104. ' Usage: ' + cmdName + ' ' + this.usage(),
  50105. ''
  50106. ];
  50107. var cmds = [];
  50108. var commandHelp = this.commandHelp();
  50109. if (commandHelp) cmds = [commandHelp];
  50110. var options = [
  50111. ' Options:',
  50112. '',
  50113. '' + this.optionHelp().replace(/^/gm, ' '),
  50114. ''
  50115. ];
  50116. return usage
  50117. .concat(desc)
  50118. .concat(options)
  50119. .concat(cmds)
  50120. .join('\n');
  50121. };
  50122. /**
  50123. * Output help information for this command
  50124. *
  50125. * @api public
  50126. */
  50127. Command.prototype.outputHelp = function(cb) {
  50128. if (!cb) {
  50129. cb = function(passthru) {
  50130. return passthru;
  50131. };
  50132. }
  50133. process.stdout.write(cb(this.helpInformation()));
  50134. this.emit('--help');
  50135. };
  50136. /**
  50137. * Output help information and exit.
  50138. *
  50139. * @api public
  50140. */
  50141. Command.prototype.help = function(cb) {
  50142. this.outputHelp(cb);
  50143. process.exit();
  50144. };
  50145. /**
  50146. * Camel-case the given `flag`
  50147. *
  50148. * @param {String} flag
  50149. * @return {String}
  50150. * @api private
  50151. */
  50152. function camelcase(flag) {
  50153. return flag.split('-').reduce(function(str, word) {
  50154. return str + word[0].toUpperCase() + word.slice(1);
  50155. });
  50156. }
  50157. /**
  50158. * Pad `str` to `width`.
  50159. *
  50160. * @param {String} str
  50161. * @param {Number} width
  50162. * @return {String}
  50163. * @api private
  50164. */
  50165. function pad(str, width) {
  50166. var len = Math.max(0, width - str.length);
  50167. return str + Array(len + 1).join(' ');
  50168. }
  50169. /**
  50170. * Output help information if necessary
  50171. *
  50172. * @param {Command} command to output help for
  50173. * @param {Array} array of options to search for -h or --help
  50174. * @api private
  50175. */
  50176. function outputHelpIfNecessary(cmd, options) {
  50177. options = options || [];
  50178. for (var i = 0; i < options.length; i++) {
  50179. if (options[i] === '--help' || options[i] === '-h') {
  50180. cmd.outputHelp();
  50181. process.exit(0);
  50182. }
  50183. }
  50184. }
  50185. /**
  50186. * Takes an argument an returns its human readable equivalent for help usage.
  50187. *
  50188. * @param {Object} arg
  50189. * @return {String}
  50190. * @api private
  50191. */
  50192. function humanReadableArgName(arg) {
  50193. var nameOutput = arg.name + (arg.variadic === true ? '...' : '');
  50194. return arg.required
  50195. ? '<' + nameOutput + '>'
  50196. : '[' + nameOutput + ']';
  50197. }
  50198. // for versions before node v0.8 when there weren't `fs.existsSync`
  50199. function exists(file) {
  50200. try {
  50201. if (fs.statSync(file).isFile()) {
  50202. return true;
  50203. }
  50204. } catch (e) {
  50205. return false;
  50206. }
  50207. }
  50208. /***/ }),
  50209. /* 278 */
  50210. /***/ (function(module, exports, __webpack_require__) {
  50211. module.exports = __webpack_require__(450)().Promise
  50212. /***/ }),
  50213. /* 279 */
  50214. /***/ (function(module, exports) {
  50215. // API
  50216. module.exports = abort;
  50217. /**
  50218. * Aborts leftover active jobs
  50219. *
  50220. * @param {object} state - current state object
  50221. */
  50222. function abort(state)
  50223. {
  50224. Object.keys(state.jobs).forEach(clean.bind(state));
  50225. // reset leftover jobs
  50226. state.jobs = {};
  50227. }
  50228. /**
  50229. * Cleans up leftover job by invoking abort function for the provided job id
  50230. *
  50231. * @this state
  50232. * @param {string|number} key - job id to abort
  50233. */
  50234. function clean(key)
  50235. {
  50236. if (typeof this.jobs[key] == 'function')
  50237. {
  50238. this.jobs[key]();
  50239. }
  50240. }
  50241. /***/ }),
  50242. /* 280 */
  50243. /***/ (function(module, exports, __webpack_require__) {
  50244. var defer = __webpack_require__(459);
  50245. // API
  50246. module.exports = async;
  50247. /**
  50248. * Runs provided callback asynchronously
  50249. * even if callback itself is not
  50250. *
  50251. * @param {function} callback - callback to invoke
  50252. * @returns {function} - augmented callback
  50253. */
  50254. function async(callback)
  50255. {
  50256. var isAsync = false;
  50257. // check if async happened
  50258. defer(function() { isAsync = true; });
  50259. return function async_callback(err, result)
  50260. {
  50261. if (isAsync)
  50262. {
  50263. callback(err, result);
  50264. }
  50265. else
  50266. {
  50267. defer(function nextTick_callback()
  50268. {
  50269. callback(err, result);
  50270. });
  50271. }
  50272. };
  50273. }
  50274. /***/ }),
  50275. /* 281 */
  50276. /***/ (function(module, exports, __webpack_require__) {
  50277. var async = __webpack_require__(280)
  50278. , abort = __webpack_require__(279)
  50279. ;
  50280. // API
  50281. module.exports = iterate;
  50282. /**
  50283. * Iterates over each job object
  50284. *
  50285. * @param {array|object} list - array or object (named list) to iterate over
  50286. * @param {function} iterator - iterator to run
  50287. * @param {object} state - current job status
  50288. * @param {function} callback - invoked when all elements processed
  50289. */
  50290. function iterate(list, iterator, state, callback)
  50291. {
  50292. // store current index
  50293. var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
  50294. state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
  50295. {
  50296. // don't repeat yourself
  50297. // skip secondary callbacks
  50298. if (!(key in state.jobs))
  50299. {
  50300. return;
  50301. }
  50302. // clean up jobs
  50303. delete state.jobs[key];
  50304. if (error)
  50305. {
  50306. // don't process rest of the results
  50307. // stop still active jobs
  50308. // and reset the list
  50309. abort(state);
  50310. }
  50311. else
  50312. {
  50313. state.results[key] = output;
  50314. }
  50315. // return salvaged results
  50316. callback(error, state.results);
  50317. });
  50318. }
  50319. /**
  50320. * Runs iterator over provided job element
  50321. *
  50322. * @param {function} iterator - iterator to invoke
  50323. * @param {string|number} key - key/index of the element in the list of jobs
  50324. * @param {mixed} item - job description
  50325. * @param {function} callback - invoked after iterator is done with the job
  50326. * @returns {function|mixed} - job abort function or something else
  50327. */
  50328. function runJob(iterator, key, item, callback)
  50329. {
  50330. var aborter;
  50331. // allow shortcut if iterator expects only two arguments
  50332. if (iterator.length == 2)
  50333. {
  50334. aborter = iterator(item, async(callback));
  50335. }
  50336. // otherwise go with full three arguments
  50337. else
  50338. {
  50339. aborter = iterator(item, key, async(callback));
  50340. }
  50341. return aborter;
  50342. }
  50343. /***/ }),
  50344. /* 282 */
  50345. /***/ (function(module, exports) {
  50346. // API
  50347. module.exports = state;
  50348. /**
  50349. * Creates initial state object
  50350. * for iteration over list
  50351. *
  50352. * @param {array|object} list - list to iterate over
  50353. * @param {function|null} sortMethod - function to use for keys sort,
  50354. * or `null` to keep them as is
  50355. * @returns {object} - initial state object
  50356. */
  50357. function state(list, sortMethod)
  50358. {
  50359. var isNamedList = !Array.isArray(list)
  50360. , initState =
  50361. {
  50362. index : 0,
  50363. keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
  50364. jobs : {},
  50365. results : isNamedList ? {} : [],
  50366. size : isNamedList ? Object.keys(list).length : list.length
  50367. }
  50368. ;
  50369. if (sortMethod)
  50370. {
  50371. // sort array keys based on it's values
  50372. // sort object's keys just on own merit
  50373. initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)
  50374. {
  50375. return sortMethod(list[a], list[b]);
  50376. });
  50377. }
  50378. return initState;
  50379. }
  50380. /***/ }),
  50381. /* 283 */
  50382. /***/ (function(module, exports, __webpack_require__) {
  50383. var abort = __webpack_require__(279)
  50384. , async = __webpack_require__(280)
  50385. ;
  50386. // API
  50387. module.exports = terminator;
  50388. /**
  50389. * Terminates jobs in the attached state context
  50390. *
  50391. * @this AsyncKitState#
  50392. * @param {function} callback - final callback to invoke after termination
  50393. */
  50394. function terminator(callback)
  50395. {
  50396. if (!Object.keys(this.jobs).length)
  50397. {
  50398. return;
  50399. }
  50400. // fast forward iteration index
  50401. this.index = this.size;
  50402. // abort jobs
  50403. abort(this);
  50404. // send back results we have so far
  50405. async(callback)(null, this.results);
  50406. }
  50407. /***/ }),
  50408. /* 284 */
  50409. /***/ (function(module, exports, __webpack_require__) {
  50410. var iterate = __webpack_require__(281)
  50411. , initState = __webpack_require__(282)
  50412. , terminator = __webpack_require__(283)
  50413. ;
  50414. // Public API
  50415. module.exports = serialOrdered;
  50416. // sorting helpers
  50417. module.exports.ascending = ascending;
  50418. module.exports.descending = descending;
  50419. /**
  50420. * Runs iterator over provided sorted array elements in series
  50421. *
  50422. * @param {array|object} list - array or object (named list) to iterate over
  50423. * @param {function} iterator - iterator to run
  50424. * @param {function} sortMethod - custom sort function
  50425. * @param {function} callback - invoked when all elements processed
  50426. * @returns {function} - jobs terminator
  50427. */
  50428. function serialOrdered(list, iterator, sortMethod, callback)
  50429. {
  50430. var state = initState(list, sortMethod);
  50431. iterate(list, iterator, state, function iteratorHandler(error, result)
  50432. {
  50433. if (error)
  50434. {
  50435. callback(error, result);
  50436. return;
  50437. }
  50438. state.index++;
  50439. // are we there yet?
  50440. if (state.index < (state['keyedList'] || list).length)
  50441. {
  50442. iterate(list, iterator, state, iteratorHandler);
  50443. return;
  50444. }
  50445. // done here
  50446. callback(null, state.results);
  50447. });
  50448. return terminator.bind(state, callback);
  50449. }
  50450. /*
  50451. * -- Sort methods
  50452. */
  50453. /**
  50454. * sort helper to sort array elements in ascending order
  50455. *
  50456. * @param {mixed} a - an item to compare
  50457. * @param {mixed} b - an item to compare
  50458. * @returns {number} - comparison result
  50459. */
  50460. function ascending(a, b)
  50461. {
  50462. return a < b ? -1 : a > b ? 1 : 0;
  50463. }
  50464. /**
  50465. * sort helper to sort array elements in descending order
  50466. *
  50467. * @param {mixed} a - an item to compare
  50468. * @param {mixed} b - an item to compare
  50469. * @returns {number} - comparison result
  50470. */
  50471. function descending(a, b)
  50472. {
  50473. return -1 * ascending(a, b);
  50474. }
  50475. /***/ }),
  50476. /* 285 */
  50477. /***/ (function(module, exports, __webpack_require__) {
  50478. "use strict";
  50479. /**
  50480. * `input` type prompt
  50481. */
  50482. var _classCallCheck2;
  50483. function _load_classCallCheck() {
  50484. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  50485. }
  50486. var _possibleConstructorReturn2;
  50487. function _load_possibleConstructorReturn() {
  50488. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  50489. }
  50490. var _inherits2;
  50491. function _load_inherits() {
  50492. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  50493. }
  50494. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  50495. var chalk = __webpack_require__(33);
  50496. var _require = __webpack_require__(65),
  50497. map = _require.map,
  50498. takeUntil = _require.takeUntil;
  50499. var Base = __webpack_require__(73);
  50500. var observe = __webpack_require__(74);
  50501. var InputPrompt = function (_Base) {
  50502. (0, (_inherits2 || _load_inherits()).default)(InputPrompt, _Base);
  50503. function InputPrompt() {
  50504. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, InputPrompt);
  50505. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.apply(this, arguments));
  50506. }
  50507. /**
  50508. * Start the Inquiry session
  50509. * @param {Function} cb Callback when prompt is done
  50510. * @return {this}
  50511. */
  50512. InputPrompt.prototype._run = function _run(cb) {
  50513. this.done = cb;
  50514. // Once user confirm (enter key)
  50515. var events = observe(this.rl);
  50516. var submit = events.line.pipe(map(this.filterInput.bind(this)));
  50517. var validation = this.handleSubmitEvents(submit);
  50518. validation.success.forEach(this.onEnd.bind(this));
  50519. validation.error.forEach(this.onError.bind(this));
  50520. events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this));
  50521. // Init
  50522. this.render();
  50523. return this;
  50524. };
  50525. /**
  50526. * Render the prompt to screen
  50527. * @return {InputPrompt} self
  50528. */
  50529. InputPrompt.prototype.render = function render(error) {
  50530. var bottomContent = '';
  50531. var appendContent = '';
  50532. var message = this.getQuestion();
  50533. var transformer = this.opt.transformer;
  50534. var isFinal = this.status === 'answered';
  50535. if (isFinal) {
  50536. appendContent = this.answer;
  50537. } else {
  50538. appendContent = this.rl.line;
  50539. }
  50540. if (transformer) {
  50541. message += transformer(appendContent, this.answers, { isFinal });
  50542. } else {
  50543. message += isFinal ? chalk.cyan(appendContent) : appendContent;
  50544. }
  50545. if (error) {
  50546. bottomContent = chalk.red('>> ') + error;
  50547. }
  50548. this.screen.render(message, bottomContent);
  50549. };
  50550. /**
  50551. * When user press `enter` key
  50552. */
  50553. InputPrompt.prototype.filterInput = function filterInput(input) {
  50554. if (!input) {
  50555. return this.opt.default == null ? '' : this.opt.default;
  50556. }
  50557. return input;
  50558. };
  50559. InputPrompt.prototype.onEnd = function onEnd(state) {
  50560. this.answer = state.value;
  50561. this.status = 'answered';
  50562. // Re-render prompt
  50563. this.render();
  50564. this.screen.done();
  50565. this.done(state.value);
  50566. };
  50567. InputPrompt.prototype.onError = function onError(state) {
  50568. this.render(state.isValid);
  50569. };
  50570. /**
  50571. * When user press a key
  50572. */
  50573. InputPrompt.prototype.onKeypress = function onKeypress() {
  50574. // If user press a key, just clear the default value
  50575. if (this.opt.default) {
  50576. this.opt.default = undefined;
  50577. }
  50578. this.render();
  50579. };
  50580. return InputPrompt;
  50581. }(Base);
  50582. module.exports = InputPrompt;
  50583. /***/ }),
  50584. /* 286 */
  50585. /***/ (function(module, exports, __webpack_require__) {
  50586. "use strict";
  50587. var _classCallCheck2;
  50588. function _load_classCallCheck() {
  50589. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  50590. }
  50591. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  50592. var _ = __webpack_require__(45);
  50593. var MuteStream = __webpack_require__(371);
  50594. var readline = __webpack_require__(187);
  50595. /**
  50596. * Base interface class other can inherits from
  50597. */
  50598. var UI = function () {
  50599. function UI(opt) {
  50600. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, UI);
  50601. // Instantiate the Readline interface
  50602. // @Note: Don't reassign if already present (allow test to override the Stream)
  50603. if (!this.rl) {
  50604. this.rl = readline.createInterface(setupReadlineOptions(opt));
  50605. }
  50606. this.rl.resume();
  50607. this.onForceClose = this.onForceClose.bind(this);
  50608. // Make sure new prompt start on a newline when closing
  50609. process.on('exit', this.onForceClose);
  50610. // Terminate process on SIGINT (which will call process.on('exit') in return)
  50611. this.rl.on('SIGINT', this.onForceClose);
  50612. }
  50613. /**
  50614. * Handle the ^C exit
  50615. * @return {null}
  50616. */
  50617. UI.prototype.onForceClose = function onForceClose() {
  50618. this.close();
  50619. process.kill(process.pid, 'SIGINT');
  50620. console.log('');
  50621. };
  50622. /**
  50623. * Close the interface and cleanup listeners
  50624. */
  50625. UI.prototype.close = function close() {
  50626. // Remove events listeners
  50627. this.rl.removeListener('SIGINT', this.onForceClose);
  50628. process.removeListener('exit', this.onForceClose);
  50629. this.rl.output.unmute();
  50630. if (this.activePrompt && typeof this.activePrompt.close === 'function') {
  50631. this.activePrompt.close();
  50632. }
  50633. // Close the readline
  50634. this.rl.output.end();
  50635. this.rl.pause();
  50636. this.rl.close();
  50637. };
  50638. return UI;
  50639. }();
  50640. function setupReadlineOptions(opt) {
  50641. opt = opt || {};
  50642. // Default `input` to stdin
  50643. var input = opt.input || process.stdin;
  50644. // Add mute capabilities to the output
  50645. var ms = new MuteStream();
  50646. ms.pipe(opt.output || process.stdout);
  50647. var output = ms;
  50648. return _.extend({
  50649. terminal: true,
  50650. input: input,
  50651. output: output
  50652. }, _.omit(opt, ['input', 'output']));
  50653. }
  50654. module.exports = UI;
  50655. /***/ }),
  50656. /* 287 */
  50657. /***/ (function(module, exports, __webpack_require__) {
  50658. "use strict";
  50659. var ansiEscapes = __webpack_require__(445);
  50660. /**
  50661. * Move cursor left by `x`
  50662. * @param {Readline} rl - Readline instance
  50663. * @param {Number} x - How far to go left (default to 1)
  50664. */
  50665. exports.left = function (rl, x) {
  50666. rl.output.write(ansiEscapes.cursorBackward(x));
  50667. };
  50668. /**
  50669. * Move cursor right by `x`
  50670. * @param {Readline} rl - Readline instance
  50671. * @param {Number} x - How far to go left (default to 1)
  50672. */
  50673. exports.right = function (rl, x) {
  50674. rl.output.write(ansiEscapes.cursorForward(x));
  50675. };
  50676. /**
  50677. * Move cursor up by `x`
  50678. * @param {Readline} rl - Readline instance
  50679. * @param {Number} x - How far to go up (default to 1)
  50680. */
  50681. exports.up = function (rl, x) {
  50682. rl.output.write(ansiEscapes.cursorUp(x));
  50683. };
  50684. /**
  50685. * Move cursor down by `x`
  50686. * @param {Readline} rl - Readline instance
  50687. * @param {Number} x - How far to go down (default to 1)
  50688. */
  50689. exports.down = function (rl, x) {
  50690. rl.output.write(ansiEscapes.cursorDown(x));
  50691. };
  50692. /**
  50693. * Clear current line
  50694. * @param {Readline} rl - Readline instance
  50695. * @param {Number} len - number of line to delete
  50696. */
  50697. exports.clearLine = function (rl, len) {
  50698. rl.output.write(ansiEscapes.eraseLines(len));
  50699. };
  50700. /***/ }),
  50701. /* 288 */
  50702. /***/ (function(module, exports, __webpack_require__) {
  50703. "use strict";
  50704. Object.defineProperty(exports, "__esModule", {
  50705. value: true
  50706. });
  50707. exports.default = {
  50708. 'upgrade-interactive': 'upgradeInteractive',
  50709. 'generate-lock-entry': 'generateLockEntry'
  50710. };
  50711. /***/ }),
  50712. /* 289 */
  50713. /***/ (function(module, exports, __webpack_require__) {
  50714. "use strict";
  50715. Object.defineProperty(exports, "__esModule", {
  50716. value: true
  50717. });
  50718. exports.run = undefined;
  50719. var _stringify;
  50720. function _load_stringify() {
  50721. return _stringify = _interopRequireDefault(__webpack_require__(37));
  50722. }
  50723. var _keys;
  50724. function _load_keys() {
  50725. return _keys = _interopRequireDefault(__webpack_require__(14));
  50726. }
  50727. var _assign;
  50728. function _load_assign() {
  50729. return _assign = _interopRequireDefault(__webpack_require__(23));
  50730. }
  50731. var _getIterator2;
  50732. function _load_getIterator() {
  50733. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  50734. }
  50735. var _classCallCheck2;
  50736. function _load_classCallCheck() {
  50737. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  50738. }
  50739. var _asyncToGenerator2;
  50740. function _load_asyncToGenerator() {
  50741. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  50742. }
  50743. var run = exports.run = function () {
  50744. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  50745. var DEFAULT_LOG_LEVEL = 'info';
  50746. var audit = new Audit(config, reporter, {
  50747. groups: flags.groups || (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES,
  50748. level: flags.level || DEFAULT_LOG_LEVEL
  50749. });
  50750. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
  50751. var install = new (_install || _load_install()).Install({}, config, reporter, lockfile);
  50752. var _ref2 = yield install.fetchRequestFromCwd(),
  50753. manifest = _ref2.manifest,
  50754. requests = _ref2.requests,
  50755. patterns = _ref2.patterns,
  50756. workspaceLayout = _ref2.workspaceLayout;
  50757. yield install.resolver.init(requests, {
  50758. workspaceLayout
  50759. });
  50760. var vulnerabilities = yield audit.performAudit(manifest, lockfile, install.resolver, install.linker, patterns);
  50761. var EXIT_INFO = 1;
  50762. var EXIT_LOW = 2;
  50763. var EXIT_MODERATE = 4;
  50764. var EXIT_HIGH = 8;
  50765. var EXIT_CRITICAL = 16;
  50766. var exitCode = (vulnerabilities.info ? EXIT_INFO : 0) + (vulnerabilities.low ? EXIT_LOW : 0) + (vulnerabilities.moderate ? EXIT_MODERATE : 0) + (vulnerabilities.high ? EXIT_HIGH : 0) + (vulnerabilities.critical ? EXIT_CRITICAL : 0);
  50767. if (flags.summary) {
  50768. audit.summary();
  50769. } else {
  50770. audit.report();
  50771. }
  50772. return exitCode;
  50773. });
  50774. return function run(_x, _x2, _x3, _x4) {
  50775. return _ref.apply(this, arguments);
  50776. };
  50777. }();
  50778. exports.setFlags = setFlags;
  50779. exports.hasWrapper = hasWrapper;
  50780. var _promise;
  50781. function _load_promise() {
  50782. return _promise = __webpack_require__(86);
  50783. }
  50784. var _hoistedTreeBuilder;
  50785. function _load_hoistedTreeBuilder() {
  50786. return _hoistedTreeBuilder = __webpack_require__(509);
  50787. }
  50788. var _getTransitiveDevDependencies;
  50789. function _load_getTransitiveDevDependencies() {
  50790. return _getTransitiveDevDependencies = __webpack_require__(537);
  50791. }
  50792. var _install;
  50793. function _load_install() {
  50794. return _install = __webpack_require__(41);
  50795. }
  50796. var _lockfile;
  50797. function _load_lockfile() {
  50798. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  50799. }
  50800. var _constants;
  50801. function _load_constants() {
  50802. return _constants = __webpack_require__(13);
  50803. }
  50804. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  50805. var zlib = __webpack_require__(188);
  50806. var gzip = (0, (_promise || _load_promise()).promisify)(zlib.gzip);
  50807. function setFlags(commander) {
  50808. commander.description('Checks for known security issues with the installed packages.');
  50809. commander.option('--summary', 'Only print the summary.');
  50810. commander.option('--groups <group_name> [<group_name> ...]', `Only audit dependencies from listed groups. Default: ${(_constants || _load_constants()).OWNED_DEPENDENCY_TYPES.join(', ')}`, function (groups) {
  50811. return groups.split(' ');
  50812. }, (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES);
  50813. commander.option('--level <severity>', `Only print advisories with severity greater than or equal to one of the following: \
  50814. info|low|moderate|high|critical. Default: info`, 'info');
  50815. }
  50816. function hasWrapper(commander, args) {
  50817. return true;
  50818. }
  50819. var Audit = function () {
  50820. function Audit(config, reporter, options) {
  50821. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Audit);
  50822. this.severityLevels = ['info', 'low', 'moderate', 'high', 'critical'];
  50823. this.config = config;
  50824. this.reporter = reporter;
  50825. this.options = options;
  50826. }
  50827. Audit.prototype._mapHoistedNodes = function _mapHoistedNodes(auditNode, hoistedNodes, transitiveDevDeps) {
  50828. for (var _iterator = hoistedNodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  50829. var _ref3;
  50830. if (_isArray) {
  50831. if (_i >= _iterator.length) break;
  50832. _ref3 = _iterator[_i++];
  50833. } else {
  50834. _i = _iterator.next();
  50835. if (_i.done) break;
  50836. _ref3 = _i.value;
  50837. }
  50838. var node = _ref3;
  50839. var pkg = node.manifest.pkg;
  50840. var _requires = (0, (_assign || _load_assign()).default)({}, pkg.dependencies || {}, pkg.optionalDependencies || {});
  50841. for (var _iterator2 = (0, (_keys || _load_keys()).default)(_requires), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  50842. var _ref4;
  50843. if (_isArray2) {
  50844. if (_i2 >= _iterator2.length) break;
  50845. _ref4 = _iterator2[_i2++];
  50846. } else {
  50847. _i2 = _iterator2.next();
  50848. if (_i2.done) break;
  50849. _ref4 = _i2.value;
  50850. }
  50851. var _name = _ref4;
  50852. if (!_requires[_name]) {
  50853. _requires[_name] = '*';
  50854. }
  50855. }
  50856. auditNode.dependencies[node.name] = {
  50857. version: node.version,
  50858. integrity: pkg._remote ? pkg._remote.integrity || '' : '',
  50859. requires: _requires,
  50860. dependencies: {},
  50861. dev: transitiveDevDeps.has(`${node.name}@${node.version}`)
  50862. };
  50863. if (node.children) {
  50864. this._mapHoistedNodes(auditNode.dependencies[node.name], node.children, transitiveDevDeps);
  50865. }
  50866. }
  50867. };
  50868. Audit.prototype._mapHoistedTreesToAuditTree = function _mapHoistedTreesToAuditTree(manifest, hoistedTrees, transitiveDevDeps) {
  50869. var requiresGroups = this.options.groups.map(function (group) {
  50870. return manifest[group] || {};
  50871. });
  50872. var auditTree = {
  50873. name: manifest.name || undefined,
  50874. version: manifest.version || undefined,
  50875. install: [],
  50876. remove: [],
  50877. metadata: {
  50878. //TODO: What do we send here? npm sends npm version, node version, etc.
  50879. },
  50880. requires: (_assign || _load_assign()).default.apply(Object, [{}].concat(requiresGroups)),
  50881. integrity: undefined,
  50882. dependencies: {},
  50883. dev: false
  50884. };
  50885. this._mapHoistedNodes(auditTree, hoistedTrees, transitiveDevDeps);
  50886. return auditTree;
  50887. };
  50888. Audit.prototype._fetchAudit = function () {
  50889. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (auditTree) {
  50890. var responseJson = void 0;
  50891. var registry = (_constants || _load_constants()).YARN_REGISTRY;
  50892. this.reporter.verbose(`Audit Request: ${(0, (_stringify || _load_stringify()).default)(auditTree, null, 2)}`);
  50893. var requestBody = yield gzip((0, (_stringify || _load_stringify()).default)(auditTree));
  50894. var response = yield this.config.requestManager.request({
  50895. url: `${registry}/-/npm/v1/security/audits`,
  50896. method: 'POST',
  50897. body: requestBody,
  50898. headers: {
  50899. 'Content-Encoding': 'gzip',
  50900. 'Content-Type': 'application/json',
  50901. Accept: 'application/json'
  50902. }
  50903. });
  50904. try {
  50905. responseJson = JSON.parse(response);
  50906. } catch (ex) {
  50907. throw new Error(`Unexpected audit response (Invalid JSON): ${response}`);
  50908. }
  50909. if (!responseJson.metadata) {
  50910. throw new Error(`Unexpected audit response (Missing Metadata): ${(0, (_stringify || _load_stringify()).default)(responseJson, null, 2)}`);
  50911. }
  50912. this.reporter.verbose(`Audit Response: ${(0, (_stringify || _load_stringify()).default)(responseJson, null, 2)}`);
  50913. return responseJson;
  50914. });
  50915. function _fetchAudit(_x5) {
  50916. return _ref5.apply(this, arguments);
  50917. }
  50918. return _fetchAudit;
  50919. }();
  50920. Audit.prototype._insertWorkspacePackagesIntoManifest = function _insertWorkspacePackagesIntoManifest(manifest, resolver) {
  50921. if (resolver.workspaceLayout) {
  50922. var workspaceAggregatorName = resolver.workspaceLayout.virtualManifestName;
  50923. var workspaceManifest = resolver.workspaceLayout.workspaces[workspaceAggregatorName].manifest;
  50924. manifest.dependencies = (0, (_assign || _load_assign()).default)(manifest.dependencies || {}, workspaceManifest.dependencies);
  50925. manifest.devDependencies = (0, (_assign || _load_assign()).default)(manifest.devDependencies || {}, workspaceManifest.devDependencies);
  50926. manifest.optionalDependencies = (0, (_assign || _load_assign()).default)(manifest.optionalDependencies || {}, workspaceManifest.optionalDependencies);
  50927. }
  50928. };
  50929. Audit.prototype.performAudit = function () {
  50930. var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (manifest, lockfile, resolver, linker, patterns) {
  50931. this._insertWorkspacePackagesIntoManifest(manifest, resolver);
  50932. var transitiveDevDeps = (0, (_getTransitiveDevDependencies || _load_getTransitiveDevDependencies()).getTransitiveDevDependencies)(manifest, resolver.workspaceLayout, lockfile);
  50933. var hoistedTrees = yield (0, (_hoistedTreeBuilder || _load_hoistedTreeBuilder()).buildTree)(resolver, linker, patterns);
  50934. var auditTree = this._mapHoistedTreesToAuditTree(manifest, hoistedTrees, transitiveDevDeps);
  50935. this.auditData = yield this._fetchAudit(auditTree);
  50936. return this.auditData.metadata.vulnerabilities;
  50937. });
  50938. function performAudit(_x6, _x7, _x8, _x9, _x10) {
  50939. return _ref6.apply(this, arguments);
  50940. }
  50941. return performAudit;
  50942. }();
  50943. Audit.prototype.summary = function summary() {
  50944. if (!this.auditData) {
  50945. return;
  50946. }
  50947. this.reporter.auditSummary(this.auditData.metadata);
  50948. };
  50949. Audit.prototype.report = function report() {
  50950. var _this = this;
  50951. if (!this.auditData) {
  50952. return;
  50953. }
  50954. var startLoggingAt = Math.max(0, this.severityLevels.indexOf(this.options.level));
  50955. var reportAdvisory = function reportAdvisory(resolution) {
  50956. var advisory = _this.auditData.advisories[resolution.id.toString()];
  50957. if (_this.severityLevels.indexOf(advisory.severity) >= startLoggingAt) {
  50958. _this.reporter.auditAdvisory(resolution, advisory);
  50959. }
  50960. };
  50961. if ((0, (_keys || _load_keys()).default)(this.auditData.advisories).length !== 0) {
  50962. // let printedManualReviewHeader = false;
  50963. this.auditData.actions.forEach(function (action) {
  50964. action.resolves.forEach(reportAdvisory);
  50965. /* The following block has been temporarily removed
  50966. * because the actions returned by npm are not valid for yarn.
  50967. * Removing this action reporting until we can come up with a way
  50968. * to correctly resolve issues.
  50969. */
  50970. // if (action.action === 'update' || action.action === 'install') {
  50971. // // these advisories can be resolved automatically by running a yarn command
  50972. // const recommendation: AuditActionRecommendation = {
  50973. // cmd: `yarn upgrade ${action.module}@${action.target}`,
  50974. // isBreaking: action.isMajor,
  50975. // action,
  50976. // };
  50977. // this.reporter.auditAction(recommendation);
  50978. // action.resolves.forEach(reportAdvisory);
  50979. // }
  50980. // if (action.action === 'review') {
  50981. // // these advisories cannot be resolved automatically and require manual review
  50982. // if (!printedManualReviewHeader) {
  50983. // this.reporter.auditManualReview();
  50984. // }
  50985. // printedManualReviewHeader = true;
  50986. // action.resolves.forEach(reportAdvisory);
  50987. // }
  50988. });
  50989. }
  50990. this.summary();
  50991. };
  50992. return Audit;
  50993. }();
  50994. exports.default = Audit;
  50995. /***/ }),
  50996. /* 290 */
  50997. /***/ (function(module, exports, __webpack_require__) {
  50998. "use strict";
  50999. Object.defineProperty(exports, "__esModule", {
  51000. value: true
  51001. });
  51002. exports.run = exports.clean = exports.noArguments = exports.requireLockfile = undefined;
  51003. var _getIterator2;
  51004. function _load_getIterator() {
  51005. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  51006. }
  51007. var _keys;
  51008. function _load_keys() {
  51009. return _keys = _interopRequireDefault(__webpack_require__(14));
  51010. }
  51011. var _set;
  51012. function _load_set() {
  51013. return _set = _interopRequireDefault(__webpack_require__(16));
  51014. }
  51015. var _asyncToGenerator2;
  51016. function _load_asyncToGenerator() {
  51017. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  51018. }
  51019. var clean = exports.clean = function () {
  51020. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) {
  51021. var loc = path.join(config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME);
  51022. var file = yield (_fs || _load_fs()).readFile(loc);
  51023. var lines = file.split('\n');
  51024. var filters = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines);
  51025. var removedFiles = 0;
  51026. var removedSize = 0;
  51027. // build list of possible module folders
  51028. var locs = new (_set || _load_set()).default();
  51029. for (var _iterator = config.registryFolders, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  51030. var _ref2;
  51031. if (_isArray) {
  51032. if (_i >= _iterator.length) break;
  51033. _ref2 = _iterator[_i++];
  51034. } else {
  51035. _i = _iterator.next();
  51036. if (_i.done) break;
  51037. _ref2 = _i.value;
  51038. }
  51039. var registryFolder = _ref2;
  51040. locs.add(path.resolve(config.lockfileFolder, registryFolder));
  51041. }
  51042. var workspaceRootFolder = config.workspaceRootFolder;
  51043. if (workspaceRootFolder) {
  51044. var manifest = yield config.findManifest(workspaceRootFolder, false);
  51045. invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property');
  51046. var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest);
  51047. for (var _iterator2 = (0, (_keys || _load_keys()).default)(workspaces), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  51048. var _ref3;
  51049. if (_isArray2) {
  51050. if (_i2 >= _iterator2.length) break;
  51051. _ref3 = _iterator2[_i2++];
  51052. } else {
  51053. _i2 = _iterator2.next();
  51054. if (_i2.done) break;
  51055. _ref3 = _i2.value;
  51056. }
  51057. var workspaceName = _ref3;
  51058. for (var _iterator3 = (_index || _load_index()).registryNames, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  51059. var _ref4;
  51060. if (_isArray3) {
  51061. if (_i3 >= _iterator3.length) break;
  51062. _ref4 = _iterator3[_i3++];
  51063. } else {
  51064. _i3 = _iterator3.next();
  51065. if (_i3.done) break;
  51066. _ref4 = _i3.value;
  51067. }
  51068. var name = _ref4;
  51069. var registry = config.registries[name];
  51070. locs.add(path.join(workspaces[workspaceName].loc, registry.folder));
  51071. }
  51072. }
  51073. }
  51074. for (var _iterator4 = locs, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  51075. var _ref5;
  51076. if (_isArray4) {
  51077. if (_i4 >= _iterator4.length) break;
  51078. _ref5 = _iterator4[_i4++];
  51079. } else {
  51080. _i4 = _iterator4.next();
  51081. if (_i4.done) break;
  51082. _ref5 = _i4.value;
  51083. }
  51084. var folder = _ref5;
  51085. if (!(yield (_fs || _load_fs()).exists(folder))) {
  51086. continue;
  51087. }
  51088. var spinner = reporter.activity();
  51089. var files = yield (_fs || _load_fs()).walk(folder);
  51090. var _sortFilter = (0, (_filter || _load_filter()).sortFilter)(files, filters),
  51091. ignoreFiles = _sortFilter.ignoreFiles;
  51092. spinner.end();
  51093. var tick = reporter.progress(ignoreFiles.size);
  51094. // TODO make sure `main` field of all modules isn't ignored
  51095. for (var _iterator5 = ignoreFiles, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  51096. var _ref6;
  51097. if (_isArray5) {
  51098. if (_i5 >= _iterator5.length) break;
  51099. _ref6 = _iterator5[_i5++];
  51100. } else {
  51101. _i5 = _iterator5.next();
  51102. if (_i5.done) break;
  51103. _ref6 = _i5.value;
  51104. }
  51105. var _file = _ref6;
  51106. var _loc = path.join(folder, _file);
  51107. var stat = yield (_fs || _load_fs()).lstat(_loc);
  51108. removedSize += stat.size;
  51109. removedFiles++;
  51110. }
  51111. for (var _iterator6 = ignoreFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  51112. var _ref7;
  51113. if (_isArray6) {
  51114. if (_i6 >= _iterator6.length) break;
  51115. _ref7 = _iterator6[_i6++];
  51116. } else {
  51117. _i6 = _iterator6.next();
  51118. if (_i6.done) break;
  51119. _ref7 = _i6.value;
  51120. }
  51121. var _file2 = _ref7;
  51122. var _loc2 = path.join(folder, _file2);
  51123. yield (_fs || _load_fs()).unlink(_loc2);
  51124. tick();
  51125. }
  51126. }
  51127. return { removedFiles, removedSize };
  51128. });
  51129. return function clean(_x, _x2) {
  51130. return _ref.apply(this, arguments);
  51131. };
  51132. }();
  51133. var runInit = function () {
  51134. var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cwd, reporter) {
  51135. reporter.step(1, 1, reporter.lang('cleanCreatingFile', (_constants || _load_constants()).CLEAN_FILENAME));
  51136. var cleanLoc = path.join(cwd, (_constants || _load_constants()).CLEAN_FILENAME);
  51137. yield (_fs || _load_fs()).writeFile(cleanLoc, `${DEFAULT_FILTER}\n`, { flag: 'wx' });
  51138. reporter.info(reporter.lang('cleanCreatedFile', (_constants || _load_constants()).CLEAN_FILENAME));
  51139. });
  51140. return function runInit(_x3, _x4) {
  51141. return _ref8.apply(this, arguments);
  51142. };
  51143. }();
  51144. var runAutoClean = function () {
  51145. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) {
  51146. reporter.step(1, 1, reporter.lang('cleaning'));
  51147. var _ref10 = yield clean(config, reporter),
  51148. removedFiles = _ref10.removedFiles,
  51149. removedSize = _ref10.removedSize;
  51150. reporter.info(reporter.lang('cleanRemovedFiles', removedFiles));
  51151. reporter.info(reporter.lang('cleanSavedSize', Number((removedSize / 1024 / 1024).toFixed(2))));
  51152. });
  51153. return function runAutoClean(_x5, _x6) {
  51154. return _ref9.apply(this, arguments);
  51155. };
  51156. }();
  51157. var checkForCleanFile = function () {
  51158. var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cwd) {
  51159. var cleanLoc = path.join(cwd, (_constants || _load_constants()).CLEAN_FILENAME);
  51160. var exists = yield (_fs || _load_fs()).exists(cleanLoc);
  51161. return exists;
  51162. });
  51163. return function checkForCleanFile(_x7) {
  51164. return _ref11.apply(this, arguments);
  51165. };
  51166. }();
  51167. var run = exports.run = function () {
  51168. var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  51169. var cleanFileExists = yield checkForCleanFile(config.cwd);
  51170. if (flags.init && cleanFileExists) {
  51171. reporter.info(reporter.lang('cleanAlreadyExists', (_constants || _load_constants()).CLEAN_FILENAME));
  51172. } else if (flags.init) {
  51173. yield runInit(config.cwd, reporter);
  51174. } else if (flags.force && cleanFileExists) {
  51175. yield runAutoClean(config, reporter);
  51176. } else if (cleanFileExists) {
  51177. reporter.info(reporter.lang('cleanRequiresForce', (_constants || _load_constants()).CLEAN_FILENAME));
  51178. } else {
  51179. reporter.info(reporter.lang('cleanDoesNotExist', (_constants || _load_constants()).CLEAN_FILENAME));
  51180. }
  51181. });
  51182. return function run(_x8, _x9, _x10, _x11) {
  51183. return _ref12.apply(this, arguments);
  51184. };
  51185. }();
  51186. exports.setFlags = setFlags;
  51187. exports.hasWrapper = hasWrapper;
  51188. var _index;
  51189. function _load_index() {
  51190. return _index = __webpack_require__(61);
  51191. }
  51192. var _filter;
  51193. function _load_filter() {
  51194. return _filter = __webpack_require__(309);
  51195. }
  51196. var _constants;
  51197. function _load_constants() {
  51198. return _constants = __webpack_require__(13);
  51199. }
  51200. var _fs;
  51201. function _load_fs() {
  51202. return _fs = _interopRequireWildcard(__webpack_require__(8));
  51203. }
  51204. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  51205. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  51206. var invariant = __webpack_require__(15);
  51207. var path = __webpack_require__(1);
  51208. var requireLockfile = exports.requireLockfile = true;
  51209. var noArguments = exports.noArguments = true;
  51210. var DEFAULT_FILTER = `
  51211. # test directories
  51212. __tests__
  51213. test
  51214. tests
  51215. powered-test
  51216. # asset directories
  51217. docs
  51218. doc
  51219. website
  51220. images
  51221. assets
  51222. # examples
  51223. example
  51224. examples
  51225. # code coverage directories
  51226. coverage
  51227. .nyc_output
  51228. # build scripts
  51229. Makefile
  51230. Gulpfile.js
  51231. Gruntfile.js
  51232. # configs
  51233. appveyor.yml
  51234. circle.yml
  51235. codeship-services.yml
  51236. codeship-steps.yml
  51237. wercker.yml
  51238. .tern-project
  51239. .gitattributes
  51240. .editorconfig
  51241. .*ignore
  51242. .eslintrc
  51243. .jshintrc
  51244. .flowconfig
  51245. .documentup.json
  51246. .yarn-metadata.json
  51247. .travis.yml
  51248. # misc
  51249. *.md
  51250. `.trim();
  51251. function setFlags(commander) {
  51252. commander.description('Cleans and removes unnecessary files from package dependencies.');
  51253. commander.usage('autoclean [flags]');
  51254. commander.option('-I, --init', `Create "${(_constants || _load_constants()).CLEAN_FILENAME}" file with the default entries.`);
  51255. commander.option('-F, --force', `Run autoclean using the existing "${(_constants || _load_constants()).CLEAN_FILENAME}" file.`);
  51256. }
  51257. function hasWrapper(commander) {
  51258. return true;
  51259. }
  51260. /***/ }),
  51261. /* 291 */
  51262. /***/ (function(module, exports, __webpack_require__) {
  51263. "use strict";
  51264. Object.defineProperty(exports, "__esModule", {
  51265. value: true
  51266. });
  51267. exports.examples = exports.run = exports.getCachedPackagesDirs = undefined;
  51268. var _promise;
  51269. function _load_promise() {
  51270. return _promise = _interopRequireDefault(__webpack_require__(7));
  51271. }
  51272. var _getIterator2;
  51273. function _load_getIterator() {
  51274. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  51275. }
  51276. var _asyncToGenerator2;
  51277. function _load_asyncToGenerator() {
  51278. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  51279. }
  51280. var getCachedPackagesDirs = exports.getCachedPackagesDirs = function () {
  51281. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, currentPath) {
  51282. var results = [];
  51283. var stat = yield (_fs || _load_fs()).lstat(currentPath);
  51284. if (!stat.isDirectory()) {
  51285. return results;
  51286. }
  51287. var folders = yield (_fs || _load_fs()).readdir(currentPath);
  51288. for (var _iterator = folders, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  51289. var _ref2;
  51290. if (_isArray) {
  51291. if (_i >= _iterator.length) break;
  51292. _ref2 = _iterator[_i++];
  51293. } else {
  51294. _i = _iterator.next();
  51295. if (_i.done) break;
  51296. _ref2 = _i.value;
  51297. }
  51298. var folder = _ref2;
  51299. if (folder[0] === '.') {
  51300. continue;
  51301. }
  51302. var packageParentPath = path.join(currentPath, folder, 'node_modules');
  51303. var candidates = yield (_fs || _load_fs()).readdir(packageParentPath);
  51304. invariant(candidates.length === 1, `There should only be one folder in a package cache (got ${candidates.join(',')} in ${packageParentPath})`);
  51305. for (var _iterator2 = candidates, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  51306. var _ref3;
  51307. if (_isArray2) {
  51308. if (_i2 >= _iterator2.length) break;
  51309. _ref3 = _iterator2[_i2++];
  51310. } else {
  51311. _i2 = _iterator2.next();
  51312. if (_i2.done) break;
  51313. _ref3 = _i2.value;
  51314. }
  51315. var candidate = _ref3;
  51316. var candidatePath = path.join(packageParentPath, candidate);
  51317. if (candidate.charAt(0) === '@') {
  51318. var subCandidates = yield (_fs || _load_fs()).readdir(candidatePath);
  51319. invariant(subCandidates.length === 1, `There should only be one folder in a package cache (got ${subCandidates.join(',')} in ${candidatePath})`);
  51320. for (var _iterator3 = subCandidates, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  51321. var _ref4;
  51322. if (_isArray3) {
  51323. if (_i3 >= _iterator3.length) break;
  51324. _ref4 = _iterator3[_i3++];
  51325. } else {
  51326. _i3 = _iterator3.next();
  51327. if (_i3.done) break;
  51328. _ref4 = _i3.value;
  51329. }
  51330. var subCandidate = _ref4;
  51331. var subCandidatePath = path.join(candidatePath, subCandidate);
  51332. results.push(subCandidatePath);
  51333. }
  51334. } else {
  51335. results.push(candidatePath);
  51336. }
  51337. }
  51338. }
  51339. return results;
  51340. });
  51341. return function getCachedPackagesDirs(_x, _x2) {
  51342. return _ref.apply(this, arguments);
  51343. };
  51344. }();
  51345. var getCachedPackages = function () {
  51346. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
  51347. var paths = yield getCachedPackagesDirs(config, config.cacheFolder);
  51348. return _getMetadataWithPath(config.readPackageMetadata.bind(config), paths).then(function (packages) {
  51349. return packages.filter(function (p) {
  51350. return !!p;
  51351. });
  51352. });
  51353. });
  51354. return function getCachedPackages(_x3) {
  51355. return _ref5.apply(this, arguments);
  51356. };
  51357. }();
  51358. var list = function () {
  51359. var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  51360. var filterOut = function filterOut() {
  51361. var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  51362. registry = _ref7.registry,
  51363. manifest = _ref7.package,
  51364. remote = _ref7.remote;
  51365. if (flags.pattern && !micromatch.contains(manifest.name, flags.pattern)) {
  51366. return false;
  51367. }
  51368. return true;
  51369. };
  51370. var forReport = function forReport() {
  51371. var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  51372. registry = _ref8.registry,
  51373. manifest = _ref8.package,
  51374. remote = _ref8.remote;
  51375. return [manifest.name, manifest.version, registry, remote && remote.resolved || ''];
  51376. };
  51377. var packages = yield getCachedPackages(config);
  51378. var body = packages.filter(filterOut).map(forReport);
  51379. reporter.table(['Name', 'Version', 'Registry', 'Resolved'], body);
  51380. });
  51381. return function list(_x4, _x5, _x6, _x7) {
  51382. return _ref6.apply(this, arguments);
  51383. };
  51384. }();
  51385. var clean = function () {
  51386. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  51387. if (config.cacheFolder) {
  51388. var activity = reporter.activity();
  51389. if (args.length > 0) {
  51390. // Clear named packages from cache
  51391. var packages = yield getCachedPackages(config);
  51392. var shouldDelete = function shouldDelete() {
  51393. var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  51394. registry = _ref10.registry,
  51395. manifest = _ref10.package,
  51396. remote = _ref10.remote;
  51397. return args.indexOf(manifest.name) !== -1;
  51398. };
  51399. var packagesToDelete = packages.filter(shouldDelete);
  51400. for (var _iterator4 = packagesToDelete, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  51401. var _ref11;
  51402. if (_isArray4) {
  51403. if (_i4 >= _iterator4.length) break;
  51404. _ref11 = _iterator4[_i4++];
  51405. } else {
  51406. _i4 = _iterator4.next();
  51407. if (_i4.done) break;
  51408. _ref11 = _i4.value;
  51409. }
  51410. var manifest = _ref11;
  51411. var relativePath = path.relative(config.cacheFolder, manifest._path);
  51412. while (relativePath && relativePath !== '.') {
  51413. yield (_fs || _load_fs()).unlink(path.resolve(config.cacheFolder, relativePath));
  51414. relativePath = path.dirname(relativePath);
  51415. }
  51416. }
  51417. activity.end();
  51418. reporter.success(reporter.lang('clearedPackageFromCache', args[0]));
  51419. } else {
  51420. // Clear all cache
  51421. yield (_fs || _load_fs()).unlink(config._cacheRootFolder);
  51422. yield (_fs || _load_fs()).mkdirp(config.cacheFolder);
  51423. activity.end();
  51424. reporter.success(reporter.lang('clearedCache'));
  51425. }
  51426. }
  51427. });
  51428. return function clean(_x10, _x11, _x12, _x13) {
  51429. return _ref9.apply(this, arguments);
  51430. };
  51431. }();
  51432. exports.hasWrapper = hasWrapper;
  51433. exports.setFlags = setFlags;
  51434. var _buildSubCommands2;
  51435. function _load_buildSubCommands() {
  51436. return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
  51437. }
  51438. var _fs;
  51439. function _load_fs() {
  51440. return _fs = _interopRequireWildcard(__webpack_require__(8));
  51441. }
  51442. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  51443. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  51444. var invariant = __webpack_require__(15);
  51445. var path = __webpack_require__(1);
  51446. var micromatch = __webpack_require__(109);
  51447. function hasWrapper(flags, args) {
  51448. return args[0] !== 'dir';
  51449. }
  51450. function _getMetadataWithPath(getMetadataFn, paths) {
  51451. return (_promise || _load_promise()).default.all(paths.map(function (path) {
  51452. return getMetadataFn(path).then(function (r) {
  51453. r._path = path;
  51454. return r;
  51455. }).catch(function (error) {
  51456. return undefined;
  51457. });
  51458. }));
  51459. }
  51460. var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('cache', {
  51461. ls(config, reporter, flags, args) {
  51462. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  51463. reporter.warn(`\`yarn cache ls\` is deprecated. Please use \`yarn cache list\`.`);
  51464. yield list(config, reporter, flags, args);
  51465. })();
  51466. },
  51467. list,
  51468. clean,
  51469. dir(config, reporter) {
  51470. reporter.log(config.cacheFolder, { force: true });
  51471. }
  51472. }),
  51473. run = _buildSubCommands.run,
  51474. _setFlags = _buildSubCommands.setFlags,
  51475. examples = _buildSubCommands.examples;
  51476. exports.run = run;
  51477. exports.examples = examples;
  51478. function setFlags(commander) {
  51479. _setFlags(commander);
  51480. commander.description('Yarn cache list will print out every cached package.');
  51481. commander.option('--pattern [pattern]', 'filter cached packages by pattern');
  51482. }
  51483. /***/ }),
  51484. /* 292 */
  51485. /***/ (function(module, exports, __webpack_require__) {
  51486. "use strict";
  51487. Object.defineProperty(exports, "__esModule", {
  51488. value: true
  51489. });
  51490. exports.run = exports.verifyTreeCheck = exports.noArguments = exports.requireLockfile = undefined;
  51491. var _assign;
  51492. function _load_assign() {
  51493. return _assign = _interopRequireDefault(__webpack_require__(23));
  51494. }
  51495. var _getIterator2;
  51496. function _load_getIterator() {
  51497. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  51498. }
  51499. var _set;
  51500. function _load_set() {
  51501. return _set = _interopRequireDefault(__webpack_require__(16));
  51502. }
  51503. var _asyncToGenerator2;
  51504. function _load_asyncToGenerator() {
  51505. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  51506. }
  51507. var verifyTreeCheck = exports.verifyTreeCheck = function () {
  51508. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  51509. var errCount = 0;
  51510. function reportError(msg) {
  51511. for (var _len = arguments.length, vars = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  51512. vars[_key - 1] = arguments[_key];
  51513. }
  51514. reporter.error(reporter.lang.apply(reporter, [msg].concat(vars)));
  51515. errCount++;
  51516. }
  51517. // check all dependencies recursively without relying on internal resolver
  51518. var registryName = 'yarn';
  51519. var registryFolder = config.registryFolders[0];
  51520. var cwd = config.workspaceRootFolder ? config.lockfileFolder : config.cwd;
  51521. var rootManifest = yield config.readManifest(cwd, registryName);
  51522. var dependenciesToCheckVersion = [];
  51523. if (rootManifest.dependencies) {
  51524. for (var _name in rootManifest.dependencies) {
  51525. var _version = rootManifest.dependencies[_name];
  51526. // skip linked dependencies
  51527. var isLinkedDependency = /^link:/i.test(_version) || /^file:/i.test(_version) && config.linkFileDependencies;
  51528. if (isLinkedDependency) {
  51529. continue;
  51530. }
  51531. dependenciesToCheckVersion.push({
  51532. name: _name,
  51533. originalKey: _name,
  51534. parentCwd: cwd,
  51535. version: _version
  51536. });
  51537. }
  51538. }
  51539. if (rootManifest.devDependencies && !config.production) {
  51540. for (var _name2 in rootManifest.devDependencies) {
  51541. var _version2 = rootManifest.devDependencies[_name2];
  51542. // skip linked dependencies
  51543. var _isLinkedDependency = /^link:/i.test(_version2) || /^file:/i.test(_version2) && config.linkFileDependencies;
  51544. if (_isLinkedDependency) {
  51545. continue;
  51546. }
  51547. dependenciesToCheckVersion.push({
  51548. name: _name2,
  51549. originalKey: _name2,
  51550. parentCwd: cwd,
  51551. version: _version2
  51552. });
  51553. }
  51554. }
  51555. var locationsVisited = new (_set || _load_set()).default();
  51556. while (dependenciesToCheckVersion.length) {
  51557. var dep = dependenciesToCheckVersion.shift();
  51558. var manifestLoc = path.resolve(dep.parentCwd, registryFolder, dep.name);
  51559. if (locationsVisited.has(manifestLoc + `@${dep.version}`)) {
  51560. continue;
  51561. }
  51562. locationsVisited.add(manifestLoc + `@${dep.version}`);
  51563. // When plugnplay is enabled, packages aren't copied to the node_modules folder, so this check doesn't make sense
  51564. // TODO: We ideally should check that the packages are located inside the cache instead
  51565. if (config.plugnplayEnabled) {
  51566. continue;
  51567. }
  51568. if (!(yield (_fs || _load_fs()).exists(manifestLoc))) {
  51569. reportError('packageNotInstalled', `${dep.originalKey}`);
  51570. continue;
  51571. }
  51572. if (!(yield (_fs || _load_fs()).exists(path.join(manifestLoc, 'package.json')))) {
  51573. continue;
  51574. }
  51575. var pkg = yield config.readManifest(manifestLoc, registryName);
  51576. if (semver.validRange(dep.version, config.looseSemver) && !semver.satisfies(pkg.version, dep.version, config.looseSemver)) {
  51577. reportError('packageWrongVersion', dep.originalKey, dep.version, pkg.version);
  51578. continue;
  51579. }
  51580. var dependencies = pkg.dependencies;
  51581. if (dependencies) {
  51582. for (var subdep in dependencies) {
  51583. var subDepPath = path.resolve(manifestLoc, registryFolder, subdep);
  51584. var found = false;
  51585. var relative = path.relative(cwd, subDepPath);
  51586. var locations = path.normalize(relative).split(registryFolder + path.sep).filter(function (dir) {
  51587. return !!dir;
  51588. });
  51589. locations.pop();
  51590. while (locations.length >= 0) {
  51591. var possiblePath = void 0;
  51592. if (locations.length > 0) {
  51593. possiblePath = path.join(cwd, registryFolder, locations.join(path.sep + registryFolder + path.sep));
  51594. } else {
  51595. possiblePath = cwd;
  51596. }
  51597. if (yield (_fs || _load_fs()).exists(path.resolve(possiblePath, registryFolder, subdep))) {
  51598. dependenciesToCheckVersion.push({
  51599. name: subdep,
  51600. originalKey: `${dep.originalKey}#${subdep}`,
  51601. parentCwd: possiblePath,
  51602. version: dependencies[subdep]
  51603. });
  51604. found = true;
  51605. break;
  51606. }
  51607. if (!locations.length) {
  51608. break;
  51609. }
  51610. locations.pop();
  51611. }
  51612. if (!found) {
  51613. reportError('packageNotInstalled', `${dep.originalKey}#${subdep}`);
  51614. }
  51615. }
  51616. }
  51617. }
  51618. if (errCount > 0) {
  51619. throw new (_errors || _load_errors()).MessageError(reporter.lang('foundErrors', errCount));
  51620. } else {
  51621. reporter.success(reporter.lang('folderInSync'));
  51622. }
  51623. });
  51624. return function verifyTreeCheck(_x, _x2, _x3, _x4) {
  51625. return _ref.apply(this, arguments);
  51626. };
  51627. }();
  51628. var integrityHashCheck = function () {
  51629. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  51630. var errCount = 0;
  51631. function reportError(msg) {
  51632. for (var _len2 = arguments.length, vars = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  51633. vars[_key2 - 1] = arguments[_key2];
  51634. }
  51635. reporter.error(reporter.lang.apply(reporter, [msg].concat(vars)));
  51636. errCount++;
  51637. }
  51638. var integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config);
  51639. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd);
  51640. var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
  51641. // get patterns that are installed when running `yarn install`
  51642. var _ref3 = yield install.fetchRequestFromCwd(),
  51643. patterns = _ref3.patterns,
  51644. workspaceLayout = _ref3.workspaceLayout;
  51645. var match = yield integrityChecker.check(patterns, lockfile.cache, flags, workspaceLayout);
  51646. for (var _iterator = match.missingPatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  51647. var _ref4;
  51648. if (_isArray) {
  51649. if (_i >= _iterator.length) break;
  51650. _ref4 = _iterator[_i++];
  51651. } else {
  51652. _i = _iterator.next();
  51653. if (_i.done) break;
  51654. _ref4 = _i.value;
  51655. }
  51656. var pattern = _ref4;
  51657. reportError('lockfileNotContainPattern', pattern);
  51658. }
  51659. if (match.integrityFileMissing) {
  51660. reportError('noIntegrityFile');
  51661. }
  51662. if (match.integrityMatches === false) {
  51663. reporter.warn(reporter.lang((_integrityChecker2 || _load_integrityChecker2()).integrityErrors[match.integrityError]));
  51664. reportError('integrityCheckFailed');
  51665. }
  51666. if (errCount > 0) {
  51667. throw new (_errors || _load_errors()).MessageError(reporter.lang('foundErrors', errCount));
  51668. } else {
  51669. reporter.success(reporter.lang('folderInSync'));
  51670. }
  51671. });
  51672. return function integrityHashCheck(_x5, _x6, _x7, _x8) {
  51673. return _ref2.apply(this, arguments);
  51674. };
  51675. }();
  51676. var run = exports.run = function () {
  51677. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  51678. if (flags.verifyTree) {
  51679. yield verifyTreeCheck(config, reporter, flags, args);
  51680. return;
  51681. } else if (flags.integrity) {
  51682. yield integrityHashCheck(config, reporter, flags, args);
  51683. return;
  51684. }
  51685. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd);
  51686. var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
  51687. function humaniseLocation(loc) {
  51688. var relative = path.relative(path.join(config.cwd, 'node_modules'), loc);
  51689. var normalized = path.normalize(relative).split(path.sep);
  51690. return normalized.filter(function (p) {
  51691. return p !== 'node_modules';
  51692. }).reduce(function (result, part) {
  51693. var length = result.length;
  51694. if (length && result[length - 1].startsWith('@') && result[length - 1].indexOf(path.sep) === -1) {
  51695. result[length - 1] += path.sep + part;
  51696. } else {
  51697. result.push(part);
  51698. }
  51699. return result;
  51700. }, []);
  51701. }
  51702. var warningCount = 0;
  51703. var errCount = 0;
  51704. function reportError(msg) {
  51705. for (var _len3 = arguments.length, vars = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  51706. vars[_key3 - 1] = arguments[_key3];
  51707. }
  51708. reporter.error(reporter.lang.apply(reporter, [msg].concat(vars)));
  51709. errCount++;
  51710. }
  51711. // get patterns that are installed when running `yarn install`
  51712. var _ref6 = yield install.hydrate(),
  51713. rawPatterns = _ref6.patterns,
  51714. workspaceLayout = _ref6.workspaceLayout;
  51715. var patterns = yield install.flatten(rawPatterns);
  51716. // check if patterns exist in lockfile
  51717. for (var _iterator2 = patterns, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  51718. var _ref7;
  51719. if (_isArray2) {
  51720. if (_i2 >= _iterator2.length) break;
  51721. _ref7 = _iterator2[_i2++];
  51722. } else {
  51723. _i2 = _iterator2.next();
  51724. if (_i2.done) break;
  51725. _ref7 = _i2.value;
  51726. }
  51727. var pattern = _ref7;
  51728. if (!lockfile.getLocked(pattern) && (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern))) {
  51729. reportError('lockfileNotContainPattern', pattern);
  51730. }
  51731. }
  51732. var bundledDeps = {};
  51733. // check if any of the node_modules are out of sync
  51734. var res = yield install.linker.getFlatHoistedTree(patterns, workspaceLayout);
  51735. for (var _iterator3 = res, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  51736. var _ref9;
  51737. if (_isArray3) {
  51738. if (_i3 >= _iterator3.length) break;
  51739. _ref9 = _iterator3[_i3++];
  51740. } else {
  51741. _i3 = _iterator3.next();
  51742. if (_i3.done) break;
  51743. _ref9 = _i3.value;
  51744. }
  51745. var _ref8 = _ref9;
  51746. var loc = _ref8[0];
  51747. var _ref8$ = _ref8[1];
  51748. var _originalKey = _ref8$.originalKey;
  51749. var pkg = _ref8$.pkg;
  51750. var ignore = _ref8$.ignore;
  51751. if (ignore) {
  51752. continue;
  51753. }
  51754. var parts = humaniseLocation(loc);
  51755. // grey out hoisted portions of key
  51756. var human = _originalKey;
  51757. var hoistedParts = parts.slice();
  51758. var hoistedKey = parts.join('#');
  51759. if (human !== hoistedKey) {
  51760. var humanParts = human.split('#');
  51761. for (var i = 0; i < humanParts.length; i++) {
  51762. var humanPart = humanParts[i];
  51763. if (hoistedParts[0] === humanPart) {
  51764. hoistedParts.shift();
  51765. if (i < humanParts.length - 1) {
  51766. humanParts[i] += '#';
  51767. }
  51768. } else {
  51769. humanParts[i] = reporter.format.dim(`${humanPart}#`);
  51770. }
  51771. }
  51772. human = humanParts.join('');
  51773. }
  51774. // skip unnecessary checks for linked dependencies
  51775. var remoteType = pkg._reference.remote.type;
  51776. var isLinkedDependency = remoteType === 'link' || remoteType === 'workspace' || remoteType === 'file' && config.linkFileDependencies;
  51777. var isResolution = pkg._reference.hint === 'resolution';
  51778. if (isLinkedDependency || isResolution) {
  51779. continue;
  51780. }
  51781. if (!(yield (_fs || _load_fs()).exists(loc))) {
  51782. if (pkg._reference.optional) {
  51783. reporter.warn(reporter.lang('optionalDepNotInstalled', human));
  51784. } else {
  51785. reportError('packageNotInstalled', human);
  51786. }
  51787. continue;
  51788. }
  51789. var pkgLoc = path.join(loc, 'package.json');
  51790. if (yield (_fs || _load_fs()).exists(pkgLoc)) {
  51791. var packageJson = yield config.readJson(pkgLoc);
  51792. packageJson.version = semver.clean(packageJson.version);
  51793. if (pkg.version !== packageJson.version) {
  51794. // node_modules contains wrong version
  51795. reportError('packageWrongVersion', human, pkg.version, packageJson.version);
  51796. }
  51797. var deps = (0, (_assign || _load_assign()).default)({}, packageJson.dependencies, packageJson.peerDependencies);
  51798. bundledDeps[packageJson.name] = packageJson.bundledDependencies || [];
  51799. for (var _name3 in deps) {
  51800. var range = deps[_name3];
  51801. if (!semver.validRange(range, config.looseSemver)) {
  51802. continue; // exotic
  51803. }
  51804. var subHuman = `${human}#${_name3}@${range}`;
  51805. // find the package that this will resolve to, factoring in hoisting
  51806. var possibles = [];
  51807. var depLoc = void 0;
  51808. for (var _i4 = parts.length; _i4 >= 0; _i4--) {
  51809. var myParts = parts.slice(0, _i4).concat(_name3);
  51810. // build package.json location for this position
  51811. var myDepPkgLoc = path.join(config.cwd, 'node_modules', myParts.join(`${path.sep}node_modules${path.sep}`));
  51812. possibles.push(myDepPkgLoc);
  51813. }
  51814. while (possibles.length) {
  51815. var _myDepPkgLoc = possibles.shift();
  51816. if (yield (_fs || _load_fs()).exists(_myDepPkgLoc)) {
  51817. depLoc = _myDepPkgLoc;
  51818. break;
  51819. }
  51820. }
  51821. if (!depLoc) {
  51822. // we'll hit the module not install error above when this module is hit
  51823. continue;
  51824. }
  51825. var depPkgLoc = path.join(depLoc, 'package.json');
  51826. if (yield (_fs || _load_fs()).exists(depPkgLoc)) {
  51827. var depPkg = yield config.readJson(depPkgLoc);
  51828. var foundHuman = `${humaniseLocation(path.dirname(depPkgLoc)).join('#')}@${depPkg.version}`;
  51829. if (!semver.satisfies(depPkg.version, range, config.looseSemver)) {
  51830. // module isn't correct semver
  51831. var resPattern = install.resolutionMap.find(_name3, _originalKey.split('#'));
  51832. if (resPattern) {
  51833. var resHuman = `${human}#${resPattern}`;
  51834. var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(resPattern),
  51835. resRange = _normalizePattern.range;
  51836. if (semver.satisfies(depPkg.version, resRange, config.looseSemver)) {
  51837. reporter.warn(reporter.lang('incompatibleResolutionVersion', foundHuman, subHuman));
  51838. warningCount++;
  51839. } else {
  51840. reportError('packageDontSatisfy', resHuman, foundHuman);
  51841. }
  51842. } else {
  51843. reportError('packageDontSatisfy', subHuman, foundHuman);
  51844. }
  51845. continue;
  51846. }
  51847. // check for modules above us that this could be deduped to
  51848. for (var _iterator4 = possibles, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  51849. var _ref10;
  51850. if (_isArray4) {
  51851. if (_i5 >= _iterator4.length) break;
  51852. _ref10 = _iterator4[_i5++];
  51853. } else {
  51854. _i5 = _iterator4.next();
  51855. if (_i5.done) break;
  51856. _ref10 = _i5.value;
  51857. }
  51858. var _loc = _ref10;
  51859. var locPkg = path.join(_loc, 'package.json');
  51860. if (!(yield (_fs || _load_fs()).exists(locPkg))) {
  51861. continue;
  51862. }
  51863. var _packageJson = yield config.readJson(locPkg);
  51864. var packagePath = _originalKey.split('#');
  51865. var rootDep = packagePath[0];
  51866. var packageName = packagePath[1] || _packageJson.name;
  51867. var bundledDep = bundledDeps[rootDep] && bundledDeps[rootDep].indexOf(packageName) !== -1;
  51868. if (!bundledDep && (_packageJson.version === depPkg.version || semver.satisfies(_packageJson.version, range, config.looseSemver) && semver.gt(_packageJson.version, depPkg.version, config.looseSemver))) {
  51869. reporter.warn(reporter.lang('couldBeDeduped', subHuman, _packageJson.version, `${humaniseLocation(path.dirname(locPkg)).join('#')}@${_packageJson.version}`));
  51870. warningCount++;
  51871. }
  51872. break;
  51873. }
  51874. }
  51875. }
  51876. }
  51877. }
  51878. if (warningCount > 1) {
  51879. reporter.info(reporter.lang('foundWarnings', warningCount));
  51880. }
  51881. if (errCount > 0) {
  51882. throw new (_errors || _load_errors()).MessageError(reporter.lang('foundErrors', errCount));
  51883. } else {
  51884. reporter.success(reporter.lang('folderInSync'));
  51885. }
  51886. });
  51887. return function run(_x9, _x10, _x11, _x12) {
  51888. return _ref5.apply(this, arguments);
  51889. };
  51890. }();
  51891. exports.hasWrapper = hasWrapper;
  51892. exports.setFlags = setFlags;
  51893. var _errors;
  51894. function _load_errors() {
  51895. return _errors = __webpack_require__(6);
  51896. }
  51897. var _integrityChecker;
  51898. function _load_integrityChecker() {
  51899. return _integrityChecker = _interopRequireDefault(__webpack_require__(195));
  51900. }
  51901. var _integrityChecker2;
  51902. function _load_integrityChecker2() {
  51903. return _integrityChecker2 = __webpack_require__(195);
  51904. }
  51905. var _lockfile;
  51906. function _load_lockfile() {
  51907. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  51908. }
  51909. var _fs;
  51910. function _load_fs() {
  51911. return _fs = _interopRequireWildcard(__webpack_require__(8));
  51912. }
  51913. var _install;
  51914. function _load_install() {
  51915. return _install = __webpack_require__(41);
  51916. }
  51917. var _normalizePattern2;
  51918. function _load_normalizePattern() {
  51919. return _normalizePattern2 = __webpack_require__(52);
  51920. }
  51921. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  51922. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  51923. var semver = __webpack_require__(27);
  51924. var path = __webpack_require__(1);
  51925. var requireLockfile = exports.requireLockfile = false;
  51926. var noArguments = exports.noArguments = true;
  51927. function hasWrapper(commander) {
  51928. return true;
  51929. }
  51930. function setFlags(commander) {
  51931. commander.description('Verifies if versions in the current project’s package.json match that of yarn’s lock file.');
  51932. commander.option('--integrity');
  51933. commander.option('--verify-tree');
  51934. }
  51935. /***/ }),
  51936. /* 293 */
  51937. /***/ (function(module, exports, __webpack_require__) {
  51938. "use strict";
  51939. Object.defineProperty(exports, "__esModule", {
  51940. value: true
  51941. });
  51942. exports.run = exports.getRegistryFolder = undefined;
  51943. var _getIterator2;
  51944. function _load_getIterator() {
  51945. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  51946. }
  51947. var _asyncToGenerator2;
  51948. function _load_asyncToGenerator() {
  51949. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  51950. }
  51951. var getRegistryFolder = exports.getRegistryFolder = function () {
  51952. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, name) {
  51953. if (config.modulesFolder) {
  51954. return config.modulesFolder;
  51955. }
  51956. var src = path.join(config.linkFolder, name);
  51957. var _ref2 = yield config.readManifest(src),
  51958. _registry = _ref2._registry;
  51959. invariant(_registry, 'expected registry');
  51960. var registryFolder = config.registries[_registry].folder;
  51961. return path.join(config.cwd, registryFolder);
  51962. });
  51963. return function getRegistryFolder(_x, _x2) {
  51964. return _ref.apply(this, arguments);
  51965. };
  51966. }();
  51967. var run = exports.run = function () {
  51968. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  51969. if (args.length) {
  51970. for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  51971. var _ref4;
  51972. if (_isArray) {
  51973. if (_i >= _iterator.length) break;
  51974. _ref4 = _iterator[_i++];
  51975. } else {
  51976. _i = _iterator.next();
  51977. if (_i.done) break;
  51978. _ref4 = _i.value;
  51979. }
  51980. var name = _ref4;
  51981. var src = path.join(config.linkFolder, name);
  51982. if (yield (_fs || _load_fs()).exists(src)) {
  51983. var folder = yield getRegistryFolder(config, name);
  51984. var dest = path.join(folder, name);
  51985. yield (_fs || _load_fs()).unlink(dest);
  51986. yield (_fs || _load_fs()).mkdirp(path.dirname(dest));
  51987. yield (_fs || _load_fs()).symlink(src, dest);
  51988. reporter.success(reporter.lang('linkUsing', name));
  51989. } else {
  51990. throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', name));
  51991. }
  51992. }
  51993. } else {
  51994. // add cwd module to the global registry
  51995. var manifest = yield config.readRootManifest();
  51996. var _name = manifest.name;
  51997. if (!_name) {
  51998. throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownPackageName'));
  51999. }
  52000. var linkLoc = path.join(config.linkFolder, _name);
  52001. if (yield (_fs || _load_fs()).exists(linkLoc)) {
  52002. reporter.warn(reporter.lang('linkCollision', _name));
  52003. } else {
  52004. yield (_fs || _load_fs()).mkdirp(path.dirname(linkLoc));
  52005. yield (_fs || _load_fs()).symlink(config.cwd, linkLoc);
  52006. // If there is a `bin` defined in the package.json,
  52007. // link each bin to the global bin
  52008. if (manifest.bin) {
  52009. var globalBinFolder = yield (0, (_global || _load_global()).getBinFolder)(config, flags);
  52010. for (var binName in manifest.bin) {
  52011. var binSrc = manifest.bin[binName];
  52012. var binSrcLoc = path.join(linkLoc, binSrc);
  52013. var binDestLoc = path.join(globalBinFolder, binName);
  52014. if (yield (_fs || _load_fs()).exists(binDestLoc)) {
  52015. reporter.warn(reporter.lang('binLinkCollision', binName));
  52016. } else {
  52017. if (process.platform === 'win32') {
  52018. yield cmdShim(binSrcLoc, binDestLoc, { createPwshFile: false });
  52019. } else {
  52020. yield (_fs || _load_fs()).symlink(binSrcLoc, binDestLoc);
  52021. }
  52022. }
  52023. }
  52024. }
  52025. reporter.success(reporter.lang('linkRegistered', _name));
  52026. reporter.info(reporter.lang('linkRegisteredMessage', _name));
  52027. }
  52028. }
  52029. });
  52030. return function run(_x3, _x4, _x5, _x6) {
  52031. return _ref3.apply(this, arguments);
  52032. };
  52033. }();
  52034. exports.hasWrapper = hasWrapper;
  52035. exports.setFlags = setFlags;
  52036. var _errors;
  52037. function _load_errors() {
  52038. return _errors = __webpack_require__(6);
  52039. }
  52040. var _fs;
  52041. function _load_fs() {
  52042. return _fs = _interopRequireWildcard(__webpack_require__(8));
  52043. }
  52044. var _global;
  52045. function _load_global() {
  52046. return _global = __webpack_require__(116);
  52047. }
  52048. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  52049. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  52050. var invariant = __webpack_require__(15);
  52051. var cmdShim = __webpack_require__(190);
  52052. var path = __webpack_require__(1);
  52053. function hasWrapper(commander, args) {
  52054. return true;
  52055. }
  52056. function setFlags(commander) {
  52057. commander.description('Symlink a package folder during development.');
  52058. }
  52059. /***/ }),
  52060. /* 294 */
  52061. /***/ (function(module, exports, __webpack_require__) {
  52062. "use strict";
  52063. Object.defineProperty(exports, "__esModule", {
  52064. value: true
  52065. });
  52066. exports.run = exports.buildTree = exports.requireLockfile = undefined;
  52067. var _keys;
  52068. function _load_keys() {
  52069. return _keys = _interopRequireDefault(__webpack_require__(14));
  52070. }
  52071. var _set;
  52072. function _load_set() {
  52073. return _set = _interopRequireDefault(__webpack_require__(16));
  52074. }
  52075. var _asyncToGenerator2;
  52076. function _load_asyncToGenerator() {
  52077. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  52078. }
  52079. var _getIterator2;
  52080. function _load_getIterator() {
  52081. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  52082. }
  52083. var buildTree = exports.buildTree = function () {
  52084. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (resolver, linker, patterns, opts, onlyFresh, ignoreHoisted) {
  52085. var treesByKey = {};
  52086. var trees = [];
  52087. var flatTree = yield linker.getFlatHoistedTree(patterns);
  52088. // If using workspaces, filter out the virtual manifest
  52089. var workspaceLayout = resolver.workspaceLayout;
  52090. var hoisted = workspaceLayout && workspaceLayout.virtualManifestName ? flatTree.filter(function (_ref3) {
  52091. var key = _ref3[0];
  52092. return key.indexOf(workspaceLayout.virtualManifestName) === -1;
  52093. }) : flatTree;
  52094. var hoistedByKey = {};
  52095. for (var _iterator2 = hoisted, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  52096. var _ref5;
  52097. if (_isArray2) {
  52098. if (_i2 >= _iterator2.length) break;
  52099. _ref5 = _iterator2[_i2++];
  52100. } else {
  52101. _i2 = _iterator2.next();
  52102. if (_i2.done) break;
  52103. _ref5 = _i2.value;
  52104. }
  52105. var _ref4 = _ref5;
  52106. var key = _ref4[0];
  52107. var info = _ref4[1];
  52108. hoistedByKey[key] = info;
  52109. }
  52110. // build initial trees
  52111. for (var _iterator3 = hoisted, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  52112. var _ref7;
  52113. if (_isArray3) {
  52114. if (_i3 >= _iterator3.length) break;
  52115. _ref7 = _iterator3[_i3++];
  52116. } else {
  52117. _i3 = _iterator3.next();
  52118. if (_i3.done) break;
  52119. _ref7 = _i3.value;
  52120. }
  52121. var _ref6 = _ref7;
  52122. var _info = _ref6[1];
  52123. var ref = _info.pkg._reference;
  52124. var hint = null;
  52125. var parent = getParent(_info.key, treesByKey);
  52126. var children = [];
  52127. var depth = 0;
  52128. var color = 'bold';
  52129. invariant(ref, 'expected reference');
  52130. if (onlyFresh) {
  52131. var isFresh = false;
  52132. for (var _iterator5 = ref.patterns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  52133. var _ref10;
  52134. if (_isArray5) {
  52135. if (_i5 >= _iterator5.length) break;
  52136. _ref10 = _iterator5[_i5++];
  52137. } else {
  52138. _i5 = _iterator5.next();
  52139. if (_i5.done) break;
  52140. _ref10 = _i5.value;
  52141. }
  52142. var pattern = _ref10;
  52143. if (resolver.isNewPattern(pattern)) {
  52144. isFresh = true;
  52145. break;
  52146. }
  52147. }
  52148. if (!isFresh) {
  52149. continue;
  52150. }
  52151. }
  52152. if (_info.originalKey !== _info.key || opts.reqDepth === 0) {
  52153. // was hoisted
  52154. color = null;
  52155. }
  52156. // check parent to obtain next depth
  52157. if (parent && parent.depth > 0) {
  52158. depth = parent.depth + 1;
  52159. } else {
  52160. depth = 0;
  52161. }
  52162. var topLevel = opts.reqDepth === 0 && !parent;
  52163. var showAll = opts.reqDepth === -1;
  52164. var nextDepthIsValid = depth + 1 <= Number(opts.reqDepth);
  52165. if (topLevel || nextDepthIsValid || showAll) {
  52166. treesByKey[_info.key] = {
  52167. name: `${_info.pkg.name}@${_info.pkg.version}`,
  52168. children,
  52169. hint,
  52170. color,
  52171. depth
  52172. };
  52173. }
  52174. // add in dummy children for hoisted dependencies
  52175. var nextChildDepthIsValid = depth + 1 < Number(opts.reqDepth);
  52176. invariant(ref, 'expected reference');
  52177. if (!ignoreHoisted && nextDepthIsValid || showAll) {
  52178. for (var _iterator6 = resolver.dedupePatterns(ref.dependencies), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  52179. var _ref11;
  52180. if (_isArray6) {
  52181. if (_i6 >= _iterator6.length) break;
  52182. _ref11 = _iterator6[_i6++];
  52183. } else {
  52184. _i6 = _iterator6.next();
  52185. if (_i6.done) break;
  52186. _ref11 = _i6.value;
  52187. }
  52188. var _pattern = _ref11;
  52189. var pkg = resolver.getStrictResolvedPattern(_pattern);
  52190. if (!hoistedByKey[`${_info.key}#${pkg.name}`] && (nextChildDepthIsValid || showAll)) {
  52191. children.push({
  52192. name: _pattern,
  52193. color: 'dim',
  52194. shadow: true
  52195. });
  52196. }
  52197. }
  52198. }
  52199. }
  52200. // add children
  52201. for (var _iterator4 = hoisted, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  52202. var _ref9;
  52203. if (_isArray4) {
  52204. if (_i4 >= _iterator4.length) break;
  52205. _ref9 = _iterator4[_i4++];
  52206. } else {
  52207. _i4 = _iterator4.next();
  52208. if (_i4.done) break;
  52209. _ref9 = _i4.value;
  52210. }
  52211. var _ref8 = _ref9;
  52212. var _info2 = _ref8[1];
  52213. var tree = treesByKey[_info2.key];
  52214. var parent = getParent(_info2.key, treesByKey);
  52215. if (!tree) {
  52216. continue;
  52217. }
  52218. if (_info2.key.split('#').length === 1) {
  52219. trees.push(tree);
  52220. continue;
  52221. }
  52222. if (parent) {
  52223. parent.children.push(tree);
  52224. }
  52225. }
  52226. return { trees, count: buildCount(trees) };
  52227. });
  52228. return function buildTree(_x, _x2, _x3, _x4, _x5, _x6) {
  52229. return _ref2.apply(this, arguments);
  52230. };
  52231. }();
  52232. var run = exports.run = function () {
  52233. var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  52234. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
  52235. var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
  52236. var _ref13 = yield install.fetchRequestFromCwd(),
  52237. depRequests = _ref13.requests,
  52238. patterns = _ref13.patterns,
  52239. manifest = _ref13.manifest,
  52240. workspaceLayout = _ref13.workspaceLayout;
  52241. yield install.resolver.init(depRequests, {
  52242. isFlat: install.flags.flat,
  52243. isFrozen: install.flags.frozenLockfile,
  52244. workspaceLayout
  52245. });
  52246. var activePatterns = [];
  52247. if (config.production) {
  52248. var devDeps = getDevDeps(manifest);
  52249. activePatterns = patterns.filter(function (pattern) {
  52250. return !devDeps.has(pattern);
  52251. });
  52252. } else {
  52253. activePatterns = patterns;
  52254. }
  52255. var opts = {
  52256. reqDepth: getReqDepth(flags.depth)
  52257. };
  52258. var _ref14 = yield buildTree(install.resolver, install.linker, activePatterns, opts),
  52259. trees = _ref14.trees;
  52260. if (args.length) {
  52261. reporter.warn(reporter.lang('deprecatedListArgs'));
  52262. }
  52263. if (args.length || flags.pattern) {
  52264. trees = trees.filter(function (tree) {
  52265. return filterTree(tree, args, flags.pattern);
  52266. });
  52267. }
  52268. reporter.tree('list', trees, { force: true });
  52269. });
  52270. return function run(_x8, _x9, _x10, _x11) {
  52271. return _ref12.apply(this, arguments);
  52272. };
  52273. }();
  52274. exports.getParent = getParent;
  52275. exports.hasWrapper = hasWrapper;
  52276. exports.setFlags = setFlags;
  52277. exports.getReqDepth = getReqDepth;
  52278. exports.filterTree = filterTree;
  52279. exports.getDevDeps = getDevDeps;
  52280. var _install;
  52281. function _load_install() {
  52282. return _install = __webpack_require__(41);
  52283. }
  52284. var _lockfile;
  52285. function _load_lockfile() {
  52286. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  52287. }
  52288. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  52289. var invariant = __webpack_require__(15);
  52290. var micromatch = __webpack_require__(109);
  52291. var requireLockfile = exports.requireLockfile = true;
  52292. function buildCount(trees) {
  52293. if (!trees || !trees.length) {
  52294. return 0;
  52295. }
  52296. var count = 0;
  52297. for (var _iterator = trees, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  52298. var _ref;
  52299. if (_isArray) {
  52300. if (_i >= _iterator.length) break;
  52301. _ref = _iterator[_i++];
  52302. } else {
  52303. _i = _iterator.next();
  52304. if (_i.done) break;
  52305. _ref = _i.value;
  52306. }
  52307. var tree = _ref;
  52308. if (tree.shadow) {
  52309. continue;
  52310. }
  52311. count++;
  52312. count += buildCount(tree.children);
  52313. }
  52314. return count;
  52315. }
  52316. function getParent(key, treesByKey) {
  52317. var parentKey = key.slice(0, key.lastIndexOf('#'));
  52318. return treesByKey[parentKey];
  52319. }
  52320. function hasWrapper(commander, args) {
  52321. return true;
  52322. }
  52323. function setFlags(commander) {
  52324. commander.description('Lists installed packages.');
  52325. commander.option('--depth [depth]', 'Limit the depth of the shown dependencies');
  52326. commander.option('--pattern [pattern]', 'Filter dependencies by pattern');
  52327. }
  52328. function getReqDepth(inputDepth) {
  52329. return inputDepth && /^\d+$/.test(inputDepth) ? Number(inputDepth) : -1;
  52330. }
  52331. function filterTree(tree, filters) {
  52332. var pattern = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  52333. if (tree.children) {
  52334. tree.children = tree.children.filter(function (child) {
  52335. return filterTree(child, filters, pattern);
  52336. });
  52337. }
  52338. var notDim = tree.color !== 'dim';
  52339. var hasChildren = tree.children == null ? false : tree.children.length > 0;
  52340. var name = tree.name.slice(0, tree.name.lastIndexOf('@'));
  52341. var found = micromatch.any(name, filters) || micromatch.contains(name, pattern);
  52342. return notDim && (found || hasChildren);
  52343. }
  52344. function getDevDeps(manifest) {
  52345. if (manifest.devDependencies) {
  52346. return new (_set || _load_set()).default((0, (_keys || _load_keys()).default)(manifest.devDependencies).map(function (key) {
  52347. return `${key}@${manifest.devDependencies[key]}`;
  52348. }));
  52349. } else {
  52350. return new (_set || _load_set()).default();
  52351. }
  52352. }
  52353. /***/ }),
  52354. /* 295 */
  52355. /***/ (function(module, exports, __webpack_require__) {
  52356. "use strict";
  52357. Object.defineProperty(exports, "__esModule", {
  52358. value: true
  52359. });
  52360. exports.run = exports.requireLockfile = undefined;
  52361. var _keys;
  52362. function _load_keys() {
  52363. return _keys = _interopRequireDefault(__webpack_require__(14));
  52364. }
  52365. var _getIterator2;
  52366. function _load_getIterator() {
  52367. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  52368. }
  52369. var _extends2;
  52370. function _load_extends() {
  52371. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  52372. }
  52373. var _asyncToGenerator2;
  52374. function _load_asyncToGenerator() {
  52375. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  52376. }
  52377. var run = exports.run = function () {
  52378. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  52379. var isWorkspaceRoot = config.workspaceRootFolder && config.cwd === config.workspaceRootFolder;
  52380. if (!args.length) {
  52381. throw new (_errors || _load_errors()).MessageError(reporter.lang('tooFewArguments', 1));
  52382. }
  52383. // running "yarn remove something" in a workspace root is often a mistake
  52384. if (isWorkspaceRoot && !flags.ignoreWorkspaceRootCheck) {
  52385. throw new (_errors || _load_errors()).MessageError(reporter.lang('workspacesRemoveRootCheck'));
  52386. }
  52387. var totalSteps = args.length + 1;
  52388. var step = 0;
  52389. // load manifests
  52390. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder);
  52391. var rootManifests = yield config.getRootManifests();
  52392. var manifests = [];
  52393. for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  52394. var _ref2;
  52395. if (_isArray) {
  52396. if (_i >= _iterator.length) break;
  52397. _ref2 = _iterator[_i++];
  52398. } else {
  52399. _i = _iterator.next();
  52400. if (_i.done) break;
  52401. _ref2 = _i.value;
  52402. }
  52403. var name = _ref2;
  52404. reporter.step(++step, totalSteps, `Removing module ${name}`, emoji.get('wastebasket'));
  52405. var found = false;
  52406. for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index || _load_index()).registries), _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  52407. var _ref3;
  52408. if (_isArray2) {
  52409. if (_i3 >= _iterator2.length) break;
  52410. _ref3 = _iterator2[_i3++];
  52411. } else {
  52412. _i3 = _iterator2.next();
  52413. if (_i3.done) break;
  52414. _ref3 = _i3.value;
  52415. }
  52416. var registryName = _ref3;
  52417. var registry = config.registries[registryName];
  52418. var object = rootManifests[registryName].object;
  52419. for (var _iterator3 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  52420. var _ref4;
  52421. if (_isArray3) {
  52422. if (_i4 >= _iterator3.length) break;
  52423. _ref4 = _iterator3[_i4++];
  52424. } else {
  52425. _i4 = _iterator3.next();
  52426. if (_i4.done) break;
  52427. _ref4 = _i4.value;
  52428. }
  52429. var type = _ref4;
  52430. var deps = object[type];
  52431. if (deps && deps[name]) {
  52432. found = true;
  52433. delete deps[name];
  52434. }
  52435. }
  52436. var possibleManifestLoc = path.join(config.cwd, registry.folder, name);
  52437. if (yield (_fs || _load_fs()).exists(possibleManifestLoc)) {
  52438. var manifest = yield config.maybeReadManifest(possibleManifestLoc, registryName);
  52439. if (manifest) {
  52440. manifests.push([possibleManifestLoc, manifest]);
  52441. }
  52442. }
  52443. }
  52444. if (!found) {
  52445. throw new (_errors || _load_errors()).MessageError(reporter.lang('moduleNotInManifest'));
  52446. }
  52447. }
  52448. // save manifests
  52449. yield config.saveRootManifests(rootManifests);
  52450. // run hooks - npm runs these one after another
  52451. var _arr = ['preuninstall', 'uninstall', 'postuninstall'];
  52452. for (var _i2 = 0; _i2 < _arr.length; _i2++) {
  52453. var action = _arr[_i2];
  52454. for (var _iterator4 = manifests, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  52455. var _ref6;
  52456. if (_isArray4) {
  52457. if (_i5 >= _iterator4.length) break;
  52458. _ref6 = _iterator4[_i5++];
  52459. } else {
  52460. _i5 = _iterator4.next();
  52461. if (_i5.done) break;
  52462. _ref6 = _i5.value;
  52463. }
  52464. var _ref5 = _ref6;
  52465. var loc = _ref5[0];
  52466. yield config.executeLifecycleScript(action, loc);
  52467. }
  52468. }
  52469. // reinstall so we can get the updated lockfile
  52470. reporter.step(++step, totalSteps, reporter.lang('uninstallRegenerate'), emoji.get('hammer'));
  52471. var installFlags = (0, (_extends2 || _load_extends()).default)({ force: true, workspaceRootIsCwd: true }, flags);
  52472. var reinstall = new (_install || _load_install()).Install(installFlags, config, new (_index2 || _load_index2()).NoopReporter(), lockfile);
  52473. yield reinstall.init();
  52474. //
  52475. reporter.success(reporter.lang('uninstalledPackages'));
  52476. });
  52477. return function run(_x, _x2, _x3, _x4) {
  52478. return _ref.apply(this, arguments);
  52479. };
  52480. }();
  52481. exports.setFlags = setFlags;
  52482. exports.hasWrapper = hasWrapper;
  52483. var _lockfile;
  52484. function _load_lockfile() {
  52485. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  52486. }
  52487. var _index;
  52488. function _load_index() {
  52489. return _index = __webpack_require__(61);
  52490. }
  52491. var _install;
  52492. function _load_install() {
  52493. return _install = __webpack_require__(41);
  52494. }
  52495. var _errors;
  52496. function _load_errors() {
  52497. return _errors = __webpack_require__(6);
  52498. }
  52499. var _index2;
  52500. function _load_index2() {
  52501. return _index2 = __webpack_require__(189);
  52502. }
  52503. var _fs;
  52504. function _load_fs() {
  52505. return _fs = _interopRequireWildcard(__webpack_require__(8));
  52506. }
  52507. var _constants;
  52508. function _load_constants() {
  52509. return _constants = _interopRequireWildcard(__webpack_require__(13));
  52510. }
  52511. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  52512. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  52513. var path = __webpack_require__(1);
  52514. var emoji = __webpack_require__(242);
  52515. var requireLockfile = exports.requireLockfile = true;
  52516. function setFlags(commander) {
  52517. commander.description('Removes a package from your direct dependencies updating your package.json and yarn.lock.');
  52518. commander.usage('remove [packages ...] [flags]');
  52519. commander.option('-W, --ignore-workspace-root-check', 'required to run yarn remove inside a workspace root');
  52520. }
  52521. function hasWrapper(commander, args) {
  52522. return true;
  52523. }
  52524. /***/ }),
  52525. /* 296 */
  52526. /***/ (function(module, exports, __webpack_require__) {
  52527. "use strict";
  52528. Object.defineProperty(exports, "__esModule", {
  52529. value: true
  52530. });
  52531. exports.run = exports.getBinEntries = undefined;
  52532. var _promise;
  52533. function _load_promise() {
  52534. return _promise = _interopRequireDefault(__webpack_require__(7));
  52535. }
  52536. var _from;
  52537. function _load_from() {
  52538. return _from = _interopRequireDefault(__webpack_require__(53));
  52539. }
  52540. var _stringify;
  52541. function _load_stringify() {
  52542. return _stringify = _interopRequireDefault(__webpack_require__(37));
  52543. }
  52544. var _keys;
  52545. function _load_keys() {
  52546. return _keys = _interopRequireDefault(__webpack_require__(14));
  52547. }
  52548. var _map;
  52549. function _load_map() {
  52550. return _map = _interopRequireDefault(__webpack_require__(42));
  52551. }
  52552. var _set;
  52553. function _load_set() {
  52554. return _set = _interopRequireDefault(__webpack_require__(16));
  52555. }
  52556. var _asyncToGenerator2;
  52557. function _load_asyncToGenerator() {
  52558. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  52559. }
  52560. var _getIterator2;
  52561. function _load_getIterator() {
  52562. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  52563. }
  52564. var _create;
  52565. function _load_create() {
  52566. return _create = _interopRequireDefault(__webpack_require__(210));
  52567. }
  52568. var getBinEntries = exports.getBinEntries = function () {
  52569. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
  52570. var binFolders = new (_set || _load_set()).default();
  52571. var binEntries = new (_map || _load_map()).default();
  52572. // Setup the node_modules/.bin folders for analysis
  52573. for (var _iterator2 = config.registryFolders, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  52574. var _ref4;
  52575. if (_isArray2) {
  52576. if (_i2 >= _iterator2.length) break;
  52577. _ref4 = _iterator2[_i2++];
  52578. } else {
  52579. _i2 = _iterator2.next();
  52580. if (_i2.done) break;
  52581. _ref4 = _i2.value;
  52582. }
  52583. var registryFolder = _ref4;
  52584. binFolders.add(path.resolve(config.cwd, registryFolder, '.bin'));
  52585. binFolders.add(path.resolve(config.lockfileFolder, registryFolder, '.bin'));
  52586. }
  52587. // Same thing, but for the pnp dependencies, located inside the cache
  52588. if (yield (_fs || _load_fs()).exists(`${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`)) {
  52589. var pnpApi = (0, (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)(`${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`);
  52590. var packageLocator = pnpApi.findPackageLocator(`${config.cwd}/`);
  52591. var packageInformation = pnpApi.getPackageInformation(packageLocator);
  52592. for (var _iterator3 = packageInformation.packageDependencies.entries(), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  52593. var _ref6;
  52594. if (_isArray3) {
  52595. if (_i3 >= _iterator3.length) break;
  52596. _ref6 = _iterator3[_i3++];
  52597. } else {
  52598. _i3 = _iterator3.next();
  52599. if (_i3.done) break;
  52600. _ref6 = _i3.value;
  52601. }
  52602. var _ref5 = _ref6;
  52603. var name = _ref5[0];
  52604. var reference = _ref5[1];
  52605. var dependencyInformation = pnpApi.getPackageInformation({ name, reference });
  52606. if (dependencyInformation.packageLocation) {
  52607. binFolders.add(`${dependencyInformation.packageLocation}/.bin`);
  52608. }
  52609. }
  52610. }
  52611. // Build up a list of possible scripts by exploring the folders marked for analysis
  52612. for (var _iterator4 = binFolders, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  52613. var _ref7;
  52614. if (_isArray4) {
  52615. if (_i4 >= _iterator4.length) break;
  52616. _ref7 = _iterator4[_i4++];
  52617. } else {
  52618. _i4 = _iterator4.next();
  52619. if (_i4.done) break;
  52620. _ref7 = _i4.value;
  52621. }
  52622. var binFolder = _ref7;
  52623. if (yield (_fs || _load_fs()).exists(binFolder)) {
  52624. for (var _iterator5 = yield (_fs || _load_fs()).readdir(binFolder), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  52625. var _ref8;
  52626. if (_isArray5) {
  52627. if (_i5 >= _iterator5.length) break;
  52628. _ref8 = _iterator5[_i5++];
  52629. } else {
  52630. _i5 = _iterator5.next();
  52631. if (_i5.done) break;
  52632. _ref8 = _i5.value;
  52633. }
  52634. var _name = _ref8;
  52635. binEntries.set(_name, path.join(binFolder, _name));
  52636. }
  52637. }
  52638. }
  52639. return binEntries;
  52640. });
  52641. return function getBinEntries(_x) {
  52642. return _ref3.apply(this, arguments);
  52643. };
  52644. }();
  52645. var run = exports.run = function () {
  52646. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  52647. var realRunCommand = function () {
  52648. var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (action, args) {
  52649. // build up list of commands
  52650. var cmds = [];
  52651. if (pkgScripts && action in pkgScripts) {
  52652. var preAction = `pre${action}`;
  52653. if (preAction in pkgScripts) {
  52654. cmds.push([preAction, pkgScripts[preAction]]);
  52655. }
  52656. var script = scripts.get(action);
  52657. invariant(script, 'Script must exist');
  52658. cmds.push([action, script]);
  52659. var postAction = `post${action}`;
  52660. if (postAction in pkgScripts) {
  52661. cmds.push([postAction, pkgScripts[postAction]]);
  52662. }
  52663. } else if (scripts.has(action)) {
  52664. var _script = scripts.get(action);
  52665. invariant(_script, 'Script must exist');
  52666. cmds.push([action, _script]);
  52667. }
  52668. if (cmds.length) {
  52669. var ignoreEngines = !!(flags.ignoreEngines || config.getOption('ignore-engines'));
  52670. try {
  52671. yield (0, (_packageCompatibility || _load_packageCompatibility()).checkOne)(pkg, config, ignoreEngines);
  52672. } catch (err) {
  52673. throw err instanceof (_errors || _load_errors()).MessageError ? new (_errors || _load_errors()).MessageError(reporter.lang('cannotRunWithIncompatibleEnv')) : err;
  52674. }
  52675. // Disable wrapper in executed commands
  52676. process.env.YARN_WRAP_OUTPUT = 'false';
  52677. for (var _iterator8 = cmds, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
  52678. var _ref16;
  52679. if (_isArray8) {
  52680. if (_i8 >= _iterator8.length) break;
  52681. _ref16 = _iterator8[_i8++];
  52682. } else {
  52683. _i8 = _iterator8.next();
  52684. if (_i8.done) break;
  52685. _ref16 = _i8.value;
  52686. }
  52687. var _ref15 = _ref16;
  52688. var stage = _ref15[0];
  52689. var cmd = _ref15[1];
  52690. // only tack on trailing arguments for default script, ignore for pre and post - #1595
  52691. var cmdWithArgs = stage === action ? sh`${unquoted(cmd)} ${args}` : cmd;
  52692. var customShell = config.getOption('script-shell');
  52693. yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execCommand)({
  52694. stage,
  52695. config,
  52696. cmd: cmdWithArgs,
  52697. cwd: flags.into || config.cwd,
  52698. isInteractive: true,
  52699. customShell: customShell ? String(customShell) : undefined
  52700. });
  52701. }
  52702. } else if (action === 'env') {
  52703. reporter.log((0, (_stringify || _load_stringify()).default)((yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)('env', config.cwd, config)), null, 2), { force: true });
  52704. } else {
  52705. var suggestion = void 0;
  52706. for (var _iterator9 = scripts.keys(), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
  52707. var _ref17;
  52708. if (_isArray9) {
  52709. if (_i9 >= _iterator9.length) break;
  52710. _ref17 = _iterator9[_i9++];
  52711. } else {
  52712. _i9 = _iterator9.next();
  52713. if (_i9.done) break;
  52714. _ref17 = _i9.value;
  52715. }
  52716. var commandName = _ref17;
  52717. var steps = leven(commandName, action);
  52718. if (steps < 2) {
  52719. suggestion = commandName;
  52720. }
  52721. }
  52722. var msg = `Command ${(0, (_stringify || _load_stringify()).default)(action)} not found.`;
  52723. if (suggestion) {
  52724. msg += ` Did you mean ${(0, (_stringify || _load_stringify()).default)(suggestion)}?`;
  52725. }
  52726. throw new (_errors || _load_errors()).MessageError(msg);
  52727. }
  52728. });
  52729. return function realRunCommand(_x6, _x7) {
  52730. return _ref14.apply(this, arguments);
  52731. };
  52732. }();
  52733. // list possible scripts if none specified
  52734. var pkg = yield config.readManifest(config.cwd);
  52735. var binCommands = new (_set || _load_set()).default();
  52736. var pkgCommands = new (_set || _load_set()).default();
  52737. var scripts = new (_map || _load_map()).default();
  52738. for (var _iterator6 = yield getBinEntries(config), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  52739. var _ref11;
  52740. if (_isArray6) {
  52741. if (_i6 >= _iterator6.length) break;
  52742. _ref11 = _iterator6[_i6++];
  52743. } else {
  52744. _i6 = _iterator6.next();
  52745. if (_i6.done) break;
  52746. _ref11 = _i6.value;
  52747. }
  52748. var _ref10 = _ref11;
  52749. var name = _ref10[0];
  52750. var loc = _ref10[1];
  52751. scripts.set(name, quoteForShell(loc));
  52752. binCommands.add(name);
  52753. }
  52754. var pkgScripts = pkg.scripts;
  52755. if (pkgScripts) {
  52756. for (var _iterator7 = (0, (_keys || _load_keys()).default)(pkgScripts).sort(), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  52757. var _ref12;
  52758. if (_isArray7) {
  52759. if (_i7 >= _iterator7.length) break;
  52760. _ref12 = _iterator7[_i7++];
  52761. } else {
  52762. _i7 = _iterator7.next();
  52763. if (_i7.done) break;
  52764. _ref12 = _i7.value;
  52765. }
  52766. var _name2 = _ref12;
  52767. scripts.set(_name2, pkgScripts[_name2] || '');
  52768. pkgCommands.add(_name2);
  52769. }
  52770. }
  52771. function runCommand(_ref13) {
  52772. var action = _ref13[0],
  52773. args = _ref13.slice(1);
  52774. return (0, (_hooks || _load_hooks()).callThroughHook)('runScript', function () {
  52775. return realRunCommand(action, args);
  52776. }, { action, args });
  52777. }
  52778. if (args.length === 0) {
  52779. if (binCommands.size > 0) {
  52780. reporter.info(`${reporter.lang('binCommands') + (0, (_from || _load_from()).default)(binCommands).join(', ')}`);
  52781. } else {
  52782. reporter.error(reporter.lang('noBinAvailable'));
  52783. }
  52784. var printedCommands = new (_map || _load_map()).default();
  52785. for (var _iterator10 = pkgCommands, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
  52786. var _ref18;
  52787. if (_isArray10) {
  52788. if (_i10 >= _iterator10.length) break;
  52789. _ref18 = _iterator10[_i10++];
  52790. } else {
  52791. _i10 = _iterator10.next();
  52792. if (_i10.done) break;
  52793. _ref18 = _i10.value;
  52794. }
  52795. var pkgCommand = _ref18;
  52796. var action = scripts.get(pkgCommand);
  52797. invariant(action, 'Action must exists');
  52798. printedCommands.set(pkgCommand, action);
  52799. }
  52800. if (pkgCommands.size > 0) {
  52801. reporter.info(`${reporter.lang('possibleCommands')}`);
  52802. reporter.list('possibleCommands', (0, (_from || _load_from()).default)(pkgCommands), toObject(printedCommands));
  52803. if (!flags.nonInteractive) {
  52804. yield reporter.question(reporter.lang('commandQuestion')).then(function (answer) {
  52805. return runCommand(answer.trim().split(' '));
  52806. }, function () {
  52807. return reporter.error(reporter.lang('commandNotSpecified'));
  52808. });
  52809. }
  52810. } else {
  52811. reporter.error(reporter.lang('noScriptsAvailable'));
  52812. }
  52813. return (_promise || _load_promise()).default.resolve();
  52814. } else {
  52815. return runCommand(args);
  52816. }
  52817. });
  52818. return function run(_x2, _x3, _x4, _x5) {
  52819. return _ref9.apply(this, arguments);
  52820. };
  52821. }();
  52822. exports.setFlags = setFlags;
  52823. exports.hasWrapper = hasWrapper;
  52824. var _executeLifecycleScript;
  52825. function _load_executeLifecycleScript() {
  52826. return _executeLifecycleScript = __webpack_require__(100);
  52827. }
  52828. var _dynamicRequire;
  52829. function _load_dynamicRequire() {
  52830. return _dynamicRequire = __webpack_require__(308);
  52831. }
  52832. var _hooks;
  52833. function _load_hooks() {
  52834. return _hooks = __webpack_require__(311);
  52835. }
  52836. var _errors;
  52837. function _load_errors() {
  52838. return _errors = __webpack_require__(6);
  52839. }
  52840. var _packageCompatibility;
  52841. function _load_packageCompatibility() {
  52842. return _packageCompatibility = __webpack_require__(196);
  52843. }
  52844. var _fs;
  52845. function _load_fs() {
  52846. return _fs = _interopRequireWildcard(__webpack_require__(8));
  52847. }
  52848. var _constants;
  52849. function _load_constants() {
  52850. return _constants = _interopRequireWildcard(__webpack_require__(13));
  52851. }
  52852. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  52853. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  52854. var invariant = __webpack_require__(15);
  52855. var leven = __webpack_require__(818);
  52856. var path = __webpack_require__(1);
  52857. var _require = __webpack_require__(852),
  52858. quoteForShell = _require.quoteForShell,
  52859. sh = _require.sh,
  52860. unquoted = _require.unquoted;
  52861. function toObject(input) {
  52862. var output = (0, (_create || _load_create()).default)(null);
  52863. for (var _iterator = input.entries(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  52864. var _ref2;
  52865. if (_isArray) {
  52866. if (_i >= _iterator.length) break;
  52867. _ref2 = _iterator[_i++];
  52868. } else {
  52869. _i = _iterator.next();
  52870. if (_i.done) break;
  52871. _ref2 = _i.value;
  52872. }
  52873. var _ref = _ref2;
  52874. var key = _ref[0];
  52875. var val = _ref[1];
  52876. output[key] = val;
  52877. }
  52878. return output;
  52879. }
  52880. function setFlags(commander) {
  52881. commander.description('Runs a defined package script.');
  52882. }
  52883. function hasWrapper(commander, args) {
  52884. return true;
  52885. }
  52886. /***/ }),
  52887. /* 297 */
  52888. /***/ (function(module, exports, __webpack_require__) {
  52889. "use strict";
  52890. Object.defineProperty(exports, "__esModule", {
  52891. value: true
  52892. });
  52893. exports.examples = exports.hasWrapper = exports.run = exports.getName = undefined;
  52894. var _asyncToGenerator2;
  52895. function _load_asyncToGenerator() {
  52896. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  52897. }
  52898. var getName = exports.getName = function () {
  52899. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (args, config) {
  52900. var name = args.shift();
  52901. if (!name) {
  52902. var pkg = yield config.readRootManifest();
  52903. name = pkg.name;
  52904. }
  52905. if (name) {
  52906. if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) {
  52907. throw new (_errors || _load_errors()).MessageError(config.reporter.lang('invalidPackageName'));
  52908. }
  52909. return (_npmRegistry || _load_npmRegistry()).default.escapeName(name);
  52910. } else {
  52911. throw new (_errors || _load_errors()).MessageError(config.reporter.lang('unknownPackageName'));
  52912. }
  52913. });
  52914. return function getName(_x, _x2) {
  52915. return _ref.apply(this, arguments);
  52916. };
  52917. }();
  52918. var list = function () {
  52919. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  52920. var name = yield getName(args, config);
  52921. reporter.step(1, 1, reporter.lang('gettingTags'));
  52922. var tags = yield config.registries.npm.request(`-/package/${name}/dist-tags`);
  52923. if (tags) {
  52924. reporter.info(`Package ${name}`);
  52925. for (var _name in tags) {
  52926. reporter.info(`${_name}: ${tags[_name]}`);
  52927. }
  52928. }
  52929. if (!tags) {
  52930. throw new (_errors || _load_errors()).MessageError(reporter.lang('packageNotFoundRegistry', name, 'npm'));
  52931. }
  52932. });
  52933. return function list(_x3, _x4, _x5, _x6) {
  52934. return _ref2.apply(this, arguments);
  52935. };
  52936. }();
  52937. var remove = function () {
  52938. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  52939. if (args.length !== 2) {
  52940. return false;
  52941. }
  52942. var name = yield getName(args, config);
  52943. var tag = args.shift();
  52944. reporter.step(1, 3, reporter.lang('loggingIn'));
  52945. var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name);
  52946. reporter.step(2, 3, reporter.lang('deletingTags'));
  52947. var result = yield config.registries.npm.request(`-/package/${name}/dist-tags/${encodeURI(tag)}`, {
  52948. method: 'DELETE'
  52949. });
  52950. if (result === false) {
  52951. reporter.error(reporter.lang('deletedTagFail'));
  52952. } else {
  52953. reporter.success(reporter.lang('deletedTag'));
  52954. }
  52955. reporter.step(3, 3, reporter.lang('revokingToken'));
  52956. yield revoke();
  52957. if (result === false) {
  52958. throw new Error();
  52959. } else {
  52960. return true;
  52961. }
  52962. });
  52963. return function remove(_x7, _x8, _x9, _x10) {
  52964. return _ref3.apply(this, arguments);
  52965. };
  52966. }();
  52967. exports.setFlags = setFlags;
  52968. var _buildSubCommands2;
  52969. function _load_buildSubCommands() {
  52970. return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
  52971. }
  52972. var _login;
  52973. function _load_login() {
  52974. return _login = __webpack_require__(97);
  52975. }
  52976. var _npmRegistry;
  52977. function _load_npmRegistry() {
  52978. return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
  52979. }
  52980. var _errors;
  52981. function _load_errors() {
  52982. return _errors = __webpack_require__(6);
  52983. }
  52984. var _normalizePattern2;
  52985. function _load_normalizePattern() {
  52986. return _normalizePattern2 = __webpack_require__(52);
  52987. }
  52988. var _validate;
  52989. function _load_validate() {
  52990. return _validate = __webpack_require__(120);
  52991. }
  52992. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  52993. function setFlags(commander) {
  52994. commander.description('Add, remove, or list tags on a package.');
  52995. }
  52996. var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('tag', {
  52997. add(config, reporter, flags, args) {
  52998. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  52999. if (args.length !== 2) {
  53000. return false;
  53001. }
  53002. var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(args.shift()),
  53003. name = _normalizePattern.name,
  53004. range = _normalizePattern.range,
  53005. hasVersion = _normalizePattern.hasVersion;
  53006. if (!hasVersion) {
  53007. throw new (_errors || _load_errors()).MessageError(reporter.lang('requiredVersionInRange'));
  53008. }
  53009. if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) {
  53010. throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName'));
  53011. }
  53012. var tag = args.shift();
  53013. reporter.step(1, 3, reporter.lang('loggingIn'));
  53014. var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name);
  53015. reporter.step(2, 3, reporter.lang('creatingTag', tag, range));
  53016. var result = yield config.registries.npm.request(`-/package/${(_npmRegistry || _load_npmRegistry()).default.escapeName(name)}/dist-tags/${encodeURI(tag)}`, {
  53017. method: 'PUT',
  53018. body: range
  53019. });
  53020. if (result != null && result.ok) {
  53021. reporter.success(reporter.lang('createdTag'));
  53022. } else {
  53023. reporter.error(reporter.lang('createdTagFail'));
  53024. }
  53025. reporter.step(3, 3, reporter.lang('revokingToken'));
  53026. yield revoke();
  53027. if (result != null && result.ok) {
  53028. return true;
  53029. } else {
  53030. throw new Error();
  53031. }
  53032. })();
  53033. },
  53034. rm(config, reporter, flags, args) {
  53035. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  53036. reporter.warn(`\`yarn tag rm\` is deprecated. Please use \`yarn tag remove\`.`);
  53037. yield remove(config, reporter, flags, args);
  53038. })();
  53039. },
  53040. remove(config, reporter, flags, args) {
  53041. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  53042. yield remove(config, reporter, flags, args);
  53043. })();
  53044. },
  53045. ls(config, reporter, flags, args) {
  53046. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  53047. reporter.warn(`\`yarn tag ls\` is deprecated. Please use \`yarn tag list\`.`);
  53048. yield list(config, reporter, flags, args);
  53049. })();
  53050. },
  53051. list(config, reporter, flags, args) {
  53052. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  53053. yield list(config, reporter, flags, args);
  53054. })();
  53055. }
  53056. }, ['add <pkg>@<version> [<tag>]', 'remove <pkg> <tag>', 'list [<pkg>]']),
  53057. run = _buildSubCommands.run,
  53058. hasWrapper = _buildSubCommands.hasWrapper,
  53059. examples = _buildSubCommands.examples;
  53060. exports.run = run;
  53061. exports.hasWrapper = hasWrapper;
  53062. exports.examples = examples;
  53063. /***/ }),
  53064. /* 298 */
  53065. /***/ (function(module, exports, __webpack_require__) {
  53066. "use strict";
  53067. Object.defineProperty(exports, "__esModule", {
  53068. value: true
  53069. });
  53070. exports.run = exports.requireLockfile = undefined;
  53071. var _promise;
  53072. function _load_promise() {
  53073. return _promise = _interopRequireDefault(__webpack_require__(7));
  53074. }
  53075. var _getIterator2;
  53076. function _load_getIterator() {
  53077. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  53078. }
  53079. var _keys;
  53080. function _load_keys() {
  53081. return _keys = _interopRequireDefault(__webpack_require__(14));
  53082. }
  53083. var _extends2;
  53084. function _load_extends() {
  53085. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  53086. }
  53087. var _asyncToGenerator2;
  53088. function _load_asyncToGenerator() {
  53089. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  53090. }
  53091. var run = exports.run = function () {
  53092. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  53093. var outdatedFieldName = flags.latest ? 'latest' : 'wanted';
  53094. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder);
  53095. var deps = yield (0, (_upgrade || _load_upgrade()).getOutdated)(config, reporter, (0, (_extends2 || _load_extends()).default)({}, flags, { includeWorkspaceDeps: true }), lockfile, args);
  53096. if (deps.length === 0) {
  53097. reporter.success(reporter.lang('allDependenciesUpToDate'));
  53098. return;
  53099. }
  53100. // Fail early with runtime compatibility checks so that it doesn't fail after you've made your selections
  53101. var install = new (_install2 || _load_install()).Install(flags, config, reporter, lockfile);
  53102. yield install.checkCompatibility();
  53103. var usesWorkspaces = !!config.workspaceRootFolder;
  53104. var maxLengthArr = {
  53105. name: 'name'.length,
  53106. current: 'from'.length,
  53107. range: 'latest'.length,
  53108. [outdatedFieldName]: 'to'.length,
  53109. workspaceName: 'workspace'.length
  53110. };
  53111. var keysWithDynamicLength = ['name', 'current', outdatedFieldName];
  53112. if (!flags.latest) {
  53113. maxLengthArr.range = 'range'.length;
  53114. keysWithDynamicLength.push('range');
  53115. }
  53116. if (usesWorkspaces) {
  53117. keysWithDynamicLength.push('workspaceName');
  53118. }
  53119. deps.forEach(function (dep) {
  53120. return keysWithDynamicLength.forEach(function (key) {
  53121. maxLengthArr[key] = Math.max(maxLengthArr[key], dep[key].length);
  53122. });
  53123. });
  53124. // Depends on maxLengthArr
  53125. var addPadding = function addPadding(dep) {
  53126. return function (key) {
  53127. return `${dep[key]}${' '.repeat(maxLengthArr[key] - dep[key].length)}`;
  53128. };
  53129. };
  53130. var headerPadding = function headerPadding(header, key) {
  53131. return `${reporter.format.bold.underline(header)}${' '.repeat(maxLengthArr[key] - header.length)}`;
  53132. };
  53133. var colorizeName = function colorizeName(from, to) {
  53134. return reporter.format[(0, (_colorForVersions || _load_colorForVersions()).default)(from, to)];
  53135. };
  53136. var getNameFromHint = function getNameFromHint(hint) {
  53137. return hint ? `${hint}Dependencies` : 'dependencies';
  53138. };
  53139. var makeRow = function makeRow(dep) {
  53140. var padding = addPadding(dep);
  53141. var name = colorizeName(dep.current, dep[outdatedFieldName])(padding('name'));
  53142. var current = reporter.format.blue(padding('current'));
  53143. var latest = (0, (_colorizeDiff || _load_colorizeDiff()).default)(dep.current, padding(outdatedFieldName), reporter);
  53144. var url = reporter.format.cyan(dep.url);
  53145. var range = reporter.format.blue(flags.latest ? 'latest' : padding('range'));
  53146. if (usesWorkspaces) {
  53147. var workspace = padding('workspaceName');
  53148. return `${name} ${range} ${current} ❯ ${latest} ${workspace} ${url}`;
  53149. } else {
  53150. return `${name} ${range} ${current} ❯ ${latest} ${url}`;
  53151. }
  53152. };
  53153. var makeHeaderRow = function makeHeaderRow() {
  53154. var name = headerPadding('name', 'name');
  53155. var range = headerPadding('range', 'range');
  53156. var from = headerPadding('from', 'current');
  53157. var to = headerPadding('to', outdatedFieldName);
  53158. var url = reporter.format.bold.underline('url');
  53159. if (usesWorkspaces) {
  53160. var workspace = headerPadding('workspace', 'workspaceName');
  53161. return ` ${name} ${range} ${from} ${to} ${workspace} ${url}`;
  53162. } else {
  53163. return ` ${name} ${range} ${from} ${to} ${url}`;
  53164. }
  53165. };
  53166. var groupedDeps = deps.reduce(function (acc, dep) {
  53167. var hint = dep.hint,
  53168. name = dep.name,
  53169. upgradeTo = dep.upgradeTo;
  53170. var version = dep[outdatedFieldName];
  53171. var key = getNameFromHint(hint);
  53172. var xs = acc[key] || [];
  53173. acc[key] = xs.concat({
  53174. name: makeRow(dep),
  53175. value: dep,
  53176. short: `${name}@${version}`,
  53177. upgradeTo
  53178. });
  53179. return acc;
  53180. }, {});
  53181. var flatten = function flatten(xs) {
  53182. return xs.reduce(function (ys, y) {
  53183. return ys.concat(Array.isArray(y) ? flatten(y) : y);
  53184. }, []);
  53185. };
  53186. var choices = flatten((0, (_keys || _load_keys()).default)(groupedDeps).map(function (key) {
  53187. return [new (_inquirer || _load_inquirer()).default.Separator(reporter.format.bold.underline.green(key)), new (_inquirer || _load_inquirer()).default.Separator(makeHeaderRow()), groupedDeps[key], new (_inquirer || _load_inquirer()).default.Separator(' ')];
  53188. }));
  53189. try {
  53190. var red = reporter.format.red('<red>');
  53191. var yellow = reporter.format.yellow('<yellow>');
  53192. var green = reporter.format.green('<green>');
  53193. reporter.info(reporter.lang('legendColorsForVersionUpdates', red, yellow, green));
  53194. var answers = yield reporter.prompt('Choose which packages to update.', choices, {
  53195. name: 'packages',
  53196. type: 'checkbox',
  53197. validate: function validate(answer) {
  53198. return !!answer.length || 'You must choose at least one package.';
  53199. }
  53200. });
  53201. var getPattern = function getPattern(_ref2) {
  53202. var upgradeTo = _ref2.upgradeTo;
  53203. return upgradeTo;
  53204. };
  53205. var isHint = function isHint(x) {
  53206. return function (_ref3) {
  53207. var hint = _ref3.hint;
  53208. return hint === x;
  53209. };
  53210. };
  53211. var _arr = [null, 'dev', 'optional', 'peer'];
  53212. for (var _i = 0; _i < _arr.length; _i++) {
  53213. var hint = _arr[_i];
  53214. // Reset dependency flags
  53215. flags.dev = hint === 'dev';
  53216. flags.peer = hint === 'peer';
  53217. flags.optional = hint === 'optional';
  53218. flags.ignoreWorkspaceRootCheck = true;
  53219. flags.includeWorkspaceDeps = false;
  53220. flags.workspaceRootIsCwd = false;
  53221. var _deps = answers.filter(isHint(hint));
  53222. if (_deps.length) {
  53223. var _install = new (_install2 || _load_install()).Install(flags, config, reporter, lockfile);
  53224. var _ref4 = yield _install.fetchRequestFromCwd(),
  53225. packagePatterns = _ref4.requests;
  53226. var depsByWorkspace = _deps.reduce(function (acc, dep) {
  53227. var workspaceLoc = dep.workspaceLoc;
  53228. var xs = acc[workspaceLoc] || [];
  53229. acc[workspaceLoc] = xs.concat(dep);
  53230. return acc;
  53231. }, {});
  53232. var cwd = config.cwd;
  53233. for (var _iterator = (0, (_keys || _load_keys()).default)(depsByWorkspace), _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  53234. var _ref5;
  53235. if (_isArray) {
  53236. if (_i2 >= _iterator.length) break;
  53237. _ref5 = _iterator[_i2++];
  53238. } else {
  53239. _i2 = _iterator.next();
  53240. if (_i2.done) break;
  53241. _ref5 = _i2.value;
  53242. }
  53243. var loc = _ref5;
  53244. var patterns = depsByWorkspace[loc].map(getPattern);
  53245. (0, (_upgrade || _load_upgrade()).cleanLockfile)(lockfile, _deps, packagePatterns, reporter);
  53246. reporter.info(reporter.lang('updateInstalling', getNameFromHint(hint)));
  53247. if (loc !== '') {
  53248. config.cwd = path.resolve(path.dirname(loc));
  53249. }
  53250. var add = new (_add || _load_add()).Add(patterns, flags, config, reporter, lockfile);
  53251. yield add.init();
  53252. config.cwd = cwd;
  53253. }
  53254. }
  53255. }
  53256. } catch (e) {
  53257. (_promise || _load_promise()).default.reject(e);
  53258. }
  53259. });
  53260. return function run(_x, _x2, _x3, _x4) {
  53261. return _ref.apply(this, arguments);
  53262. };
  53263. }();
  53264. exports.setFlags = setFlags;
  53265. exports.hasWrapper = hasWrapper;
  53266. var _inquirer;
  53267. function _load_inquirer() {
  53268. return _inquirer = _interopRequireDefault(__webpack_require__(193));
  53269. }
  53270. var _lockfile;
  53271. function _load_lockfile() {
  53272. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  53273. }
  53274. var _add;
  53275. function _load_add() {
  53276. return _add = __webpack_require__(154);
  53277. }
  53278. var _upgrade;
  53279. function _load_upgrade() {
  53280. return _upgrade = __webpack_require__(194);
  53281. }
  53282. var _colorForVersions;
  53283. function _load_colorForVersions() {
  53284. return _colorForVersions = _interopRequireDefault(__webpack_require__(306));
  53285. }
  53286. var _colorizeDiff;
  53287. function _load_colorizeDiff() {
  53288. return _colorizeDiff = _interopRequireDefault(__webpack_require__(307));
  53289. }
  53290. var _install2;
  53291. function _load_install() {
  53292. return _install2 = __webpack_require__(41);
  53293. }
  53294. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  53295. var path = __webpack_require__(1);
  53296. var requireLockfile = exports.requireLockfile = true;
  53297. function setFlags(commander) {
  53298. commander.description('Provides an easy way to update outdated packages.');
  53299. commander.usage('upgrade-interactive [flags]');
  53300. commander.option('-S, --scope <scope>', 'upgrade packages under the specified scope');
  53301. commander.option('--latest', 'list the latest version of packages, ignoring version ranges in package.json');
  53302. commander.option('-E, --exact', 'install exact version. Only used when --latest is specified.');
  53303. commander.option('-T, --tilde', 'install most recent release with the same minor version. Only used when --latest is specified.');
  53304. commander.option('-C, --caret', 'install most recent release with the same major version. Only used when --latest is specified.');
  53305. }
  53306. function hasWrapper(commander, args) {
  53307. return true;
  53308. }
  53309. /***/ }),
  53310. /* 299 */
  53311. /***/ (function(module, exports, __webpack_require__) {
  53312. "use strict";
  53313. Object.defineProperty(exports, "__esModule", {
  53314. value: true
  53315. });
  53316. exports.run = exports.setVersion = undefined;
  53317. var _getIterator2;
  53318. function _load_getIterator() {
  53319. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  53320. }
  53321. var _assign;
  53322. function _load_assign() {
  53323. return _assign = _interopRequireDefault(__webpack_require__(23));
  53324. }
  53325. var _promise;
  53326. function _load_promise() {
  53327. return _promise = _interopRequireDefault(__webpack_require__(7));
  53328. }
  53329. var _asyncToGenerator2;
  53330. function _load_asyncToGenerator() {
  53331. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  53332. }
  53333. var setVersion = exports.setVersion = function () {
  53334. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args, required) {
  53335. var pkg = yield config.readRootManifest();
  53336. var pkgLoc = pkg._loc;
  53337. var scripts = (0, (_map || _load_map()).default)();
  53338. var newVersion = flags.newVersion;
  53339. var identifier = undefined;
  53340. if (flags.preid) {
  53341. identifier = flags.preid;
  53342. }
  53343. invariant(pkgLoc, 'expected package location');
  53344. if (args.length && !newVersion) {
  53345. throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidVersionArgument', NEW_VERSION_FLAG));
  53346. }
  53347. function runLifecycle(lifecycle) {
  53348. if (scripts[lifecycle]) {
  53349. return (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execCommand)({ stage: lifecycle, config, cmd: scripts[lifecycle], cwd: config.cwd, isInteractive: true });
  53350. }
  53351. return (_promise || _load_promise()).default.resolve();
  53352. }
  53353. function isCommitHooksDisabled() {
  53354. return flags.commitHooks === false || config.getOption('version-commit-hooks') === false;
  53355. }
  53356. if (pkg.scripts) {
  53357. // inherit `scripts` from manifest
  53358. (0, (_assign || _load_assign()).default)(scripts, pkg.scripts);
  53359. }
  53360. // get old version
  53361. var oldVersion = pkg.version;
  53362. if (oldVersion) {
  53363. reporter.info(`${reporter.lang('currentVersion')}: ${oldVersion}`);
  53364. } else {
  53365. oldVersion = '0.0.0';
  53366. }
  53367. // get new version
  53368. if (newVersion && !isValidNewVersion(oldVersion, newVersion, config.looseSemver, identifier)) {
  53369. throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidVersion'));
  53370. }
  53371. // get new version by bumping old version, if requested
  53372. if (!newVersion) {
  53373. if (flags.major) {
  53374. newVersion = semver.inc(oldVersion, 'major');
  53375. } else if (flags.minor) {
  53376. newVersion = semver.inc(oldVersion, 'minor');
  53377. } else if (flags.patch) {
  53378. newVersion = semver.inc(oldVersion, 'patch');
  53379. } else if (flags.premajor) {
  53380. newVersion = semver.inc(oldVersion, 'premajor', identifier);
  53381. } else if (flags.preminor) {
  53382. newVersion = semver.inc(oldVersion, 'preminor', identifier);
  53383. } else if (flags.prepatch) {
  53384. newVersion = semver.inc(oldVersion, 'prepatch', identifier);
  53385. } else if (flags.prerelease) {
  53386. newVersion = semver.inc(oldVersion, 'prerelease', identifier);
  53387. }
  53388. }
  53389. // wasn't passed a version arg so ask interactively
  53390. while (!newVersion) {
  53391. // make sure we're not running in non-interactive mode before asking for new version
  53392. if (flags.nonInteractive || config.nonInteractive) {
  53393. // if no version is specified, use current version in package.json
  53394. newVersion = oldVersion;
  53395. break;
  53396. }
  53397. // Make sure we dont exit with an error message when pressing Ctrl-C or enter to abort
  53398. try {
  53399. newVersion = yield reporter.question(reporter.lang('newVersion'));
  53400. if (!newVersion) {
  53401. newVersion = oldVersion;
  53402. }
  53403. } catch (err) {
  53404. newVersion = oldVersion;
  53405. }
  53406. if (!required && !newVersion) {
  53407. reporter.info(`${reporter.lang('noVersionOnPublish')}: ${oldVersion}`);
  53408. return function () {
  53409. return (_promise || _load_promise()).default.resolve();
  53410. };
  53411. }
  53412. if (isValidNewVersion(oldVersion, newVersion, config.looseSemver, identifier)) {
  53413. break;
  53414. } else {
  53415. newVersion = null;
  53416. reporter.error(reporter.lang('invalidSemver'));
  53417. }
  53418. }
  53419. if (newVersion) {
  53420. newVersion = semver.inc(oldVersion, newVersion, config.looseSemver, identifier) || newVersion;
  53421. }
  53422. invariant(newVersion, 'expected new version');
  53423. if (newVersion === pkg.version) {
  53424. return function () {
  53425. return (_promise || _load_promise()).default.resolve();
  53426. };
  53427. }
  53428. yield runLifecycle('preversion');
  53429. // update version
  53430. reporter.info(`${reporter.lang('newVersion')}: ${newVersion}`);
  53431. pkg.version = newVersion;
  53432. // update versions in manifests
  53433. var manifests = yield config.getRootManifests();
  53434. for (var _iterator = (_index || _load_index()).registryNames, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  53435. var _ref2;
  53436. if (_isArray) {
  53437. if (_i >= _iterator.length) break;
  53438. _ref2 = _iterator[_i++];
  53439. } else {
  53440. _i = _iterator.next();
  53441. if (_i.done) break;
  53442. _ref2 = _i.value;
  53443. }
  53444. var registryName = _ref2;
  53445. var manifest = manifests[registryName];
  53446. if (manifest.exists) {
  53447. manifest.object.version = newVersion;
  53448. }
  53449. }
  53450. yield config.saveRootManifests(manifests);
  53451. yield runLifecycle('version');
  53452. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  53453. invariant(newVersion, 'expected version');
  53454. // check if a new git tag should be created
  53455. if (flags.gitTagVersion && config.getOption('version-git-tag')) {
  53456. // add git commit and tag
  53457. var isGit = false;
  53458. var parts = config.cwd.split(path.sep);
  53459. while (parts.length) {
  53460. isGit = yield (_fs || _load_fs()).exists(path.join(parts.join(path.sep), '.git'));
  53461. if (isGit) {
  53462. break;
  53463. } else {
  53464. parts.pop();
  53465. }
  53466. }
  53467. if (isGit) {
  53468. var message = (flags.message || String(config.getOption('version-git-message'))).replace(/%s/g, newVersion);
  53469. var sign = Boolean(config.getOption('version-sign-git-tag'));
  53470. var flag = sign ? '-sm' : '-am';
  53471. var prefix = String(config.getOption('version-tag-prefix'));
  53472. var _args = ['commit', '-m', message].concat(isCommitHooksDisabled() ? ['-n'] : []);
  53473. var gitRoot = (yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['rev-parse', '--show-toplevel'], { cwd: config.cwd })).trim();
  53474. // add manifest
  53475. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['add', path.relative(gitRoot, pkgLoc)], { cwd: gitRoot });
  53476. // create git commit
  53477. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(_args, { cwd: gitRoot });
  53478. // create git tag
  53479. yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['tag', `${prefix}${newVersion}`, flag, message], { cwd: gitRoot });
  53480. }
  53481. }
  53482. yield runLifecycle('postversion');
  53483. });
  53484. });
  53485. return function setVersion(_x, _x2, _x3, _x4, _x5) {
  53486. return _ref.apply(this, arguments);
  53487. };
  53488. }();
  53489. var run = exports.run = function () {
  53490. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  53491. var commit = yield setVersion(config, reporter, flags, args, true);
  53492. yield commit();
  53493. });
  53494. return function run(_x6, _x7, _x8, _x9) {
  53495. return _ref4.apply(this, arguments);
  53496. };
  53497. }();
  53498. exports.setFlags = setFlags;
  53499. exports.hasWrapper = hasWrapper;
  53500. var _index;
  53501. function _load_index() {
  53502. return _index = __webpack_require__(61);
  53503. }
  53504. var _executeLifecycleScript;
  53505. function _load_executeLifecycleScript() {
  53506. return _executeLifecycleScript = __webpack_require__(100);
  53507. }
  53508. var _errors;
  53509. function _load_errors() {
  53510. return _errors = __webpack_require__(6);
  53511. }
  53512. var _gitSpawn;
  53513. function _load_gitSpawn() {
  53514. return _gitSpawn = __webpack_require__(310);
  53515. }
  53516. var _fs;
  53517. function _load_fs() {
  53518. return _fs = _interopRequireWildcard(__webpack_require__(8));
  53519. }
  53520. var _map;
  53521. function _load_map() {
  53522. return _map = _interopRequireDefault(__webpack_require__(51));
  53523. }
  53524. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  53525. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  53526. var invariant = __webpack_require__(15);
  53527. var semver = __webpack_require__(27);
  53528. var path = __webpack_require__(1);
  53529. var NEW_VERSION_FLAG = '--new-version [version]';
  53530. function isValidNewVersion(oldVersion, newVersion, looseSemver, identifier) {
  53531. return !!(semver.valid(newVersion, looseSemver) || semver.inc(oldVersion, newVersion, looseSemver, identifier));
  53532. }
  53533. function setFlags(commander) {
  53534. commander.description('Update the version of your package via the command line.');
  53535. commander.option(NEW_VERSION_FLAG, 'new version');
  53536. commander.option('--major', 'auto-increment major version number');
  53537. commander.option('--minor', 'auto-increment minor version number');
  53538. commander.option('--patch', 'auto-increment patch version number');
  53539. commander.option('--premajor', 'auto-increment premajor version number');
  53540. commander.option('--preminor', 'auto-increment preminor version number');
  53541. commander.option('--prepatch', 'auto-increment prepatch version number');
  53542. commander.option('--prerelease', 'auto-increment prerelease version number');
  53543. commander.option('--preid [preid]', 'add a custom identifier to the prerelease');
  53544. commander.option('--message [message]', 'message');
  53545. commander.option('--no-git-tag-version', 'no git tag version');
  53546. commander.option('--no-commit-hooks', 'bypass git hooks when committing new version');
  53547. }
  53548. function hasWrapper(commander, args) {
  53549. return true;
  53550. }
  53551. /***/ }),
  53552. /* 300 */
  53553. /***/ (function(module, exports, __webpack_require__) {
  53554. "use strict";
  53555. Object.defineProperty(exports, "__esModule", {
  53556. value: true
  53557. });
  53558. exports.LocalTarballFetcher = undefined;
  53559. var _getIterator2;
  53560. function _load_getIterator() {
  53561. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  53562. }
  53563. var _from;
  53564. function _load_from() {
  53565. return _from = _interopRequireDefault(__webpack_require__(53));
  53566. }
  53567. var _set;
  53568. function _load_set() {
  53569. return _set = _interopRequireDefault(__webpack_require__(16));
  53570. }
  53571. var _extends2;
  53572. function _load_extends() {
  53573. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  53574. }
  53575. var _promise;
  53576. function _load_promise() {
  53577. return _promise = _interopRequireDefault(__webpack_require__(7));
  53578. }
  53579. var _keys;
  53580. function _load_keys() {
  53581. return _keys = _interopRequireDefault(__webpack_require__(14));
  53582. }
  53583. var _assign;
  53584. function _load_assign() {
  53585. return _assign = _interopRequireDefault(__webpack_require__(23));
  53586. }
  53587. var _asyncToGenerator2;
  53588. function _load_asyncToGenerator() {
  53589. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  53590. }
  53591. var _classCallCheck2;
  53592. function _load_classCallCheck() {
  53593. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  53594. }
  53595. var _possibleConstructorReturn2;
  53596. function _load_possibleConstructorReturn() {
  53597. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  53598. }
  53599. var _inherits2;
  53600. function _load_inherits() {
  53601. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  53602. }
  53603. var _errors;
  53604. function _load_errors() {
  53605. return _errors = __webpack_require__(6);
  53606. }
  53607. var _constants;
  53608. function _load_constants() {
  53609. return _constants = _interopRequireWildcard(__webpack_require__(13));
  53610. }
  53611. var _baseFetcher;
  53612. function _load_baseFetcher() {
  53613. return _baseFetcher = _interopRequireDefault(__webpack_require__(156));
  53614. }
  53615. var _fs;
  53616. function _load_fs() {
  53617. return _fs = _interopRequireWildcard(__webpack_require__(8));
  53618. }
  53619. var _misc;
  53620. function _load_misc() {
  53621. return _misc = __webpack_require__(28);
  53622. }
  53623. var _normalizeUrl;
  53624. function _load_normalizeUrl() {
  53625. return _normalizeUrl = _interopRequireDefault(__webpack_require__(372));
  53626. }
  53627. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  53628. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  53629. var crypto = __webpack_require__(21);
  53630. var path = __webpack_require__(1);
  53631. var tarFs = __webpack_require__(184);
  53632. var url = __webpack_require__(29);
  53633. var fs = __webpack_require__(12);
  53634. var stream = __webpack_require__(36);
  53635. var gunzip = __webpack_require__(682);
  53636. var invariant = __webpack_require__(15);
  53637. var ssri = __webpack_require__(93);
  53638. var RE_URL_NAME_MATCH = /\/(?:(@[^/]+)(?:\/|%2f))?[^/]+\/(?:-|_attachments)\/(?:@[^/]+\/)?([^/]+)$/;
  53639. var isHashAlgorithmSupported = function isHashAlgorithmSupported(name) {
  53640. var cachedResult = isHashAlgorithmSupported.__cache[name];
  53641. if (cachedResult != null) {
  53642. return cachedResult;
  53643. }
  53644. var supported = true;
  53645. try {
  53646. crypto.createHash(name);
  53647. } catch (error) {
  53648. if (error.message !== 'Digest method not supported') {
  53649. throw error;
  53650. }
  53651. supported = false;
  53652. }
  53653. isHashAlgorithmSupported.__cache[name] = supported;
  53654. return supported;
  53655. };
  53656. isHashAlgorithmSupported.__cache = {};
  53657. var TarballFetcher = function (_BaseFetcher) {
  53658. (0, (_inherits2 || _load_inherits()).default)(TarballFetcher, _BaseFetcher);
  53659. function TarballFetcher() {
  53660. var _temp, _this, _ret;
  53661. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, TarballFetcher);
  53662. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  53663. args[_key] = arguments[_key];
  53664. }
  53665. return _ret = (_temp = (_this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseFetcher.call.apply(_BaseFetcher, [this].concat(args))), _this), _this.validateError = null, _this.validateIntegrity = null, _temp), (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(_this, _ret);
  53666. }
  53667. TarballFetcher.prototype.setupMirrorFromCache = function () {
  53668. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  53669. var tarballMirrorPath = this.getTarballMirrorPath();
  53670. var tarballCachePath = this.getTarballCachePath();
  53671. if (tarballMirrorPath == null) {
  53672. return;
  53673. }
  53674. if (!(yield (_fs || _load_fs()).exists(tarballMirrorPath)) && (yield (_fs || _load_fs()).exists(tarballCachePath))) {
  53675. // The tarball doesn't exists in the offline cache but does in the cache; we import it to the mirror
  53676. yield (_fs || _load_fs()).mkdirp(path.dirname(tarballMirrorPath));
  53677. yield (_fs || _load_fs()).copy(tarballCachePath, tarballMirrorPath, this.reporter);
  53678. }
  53679. });
  53680. function setupMirrorFromCache() {
  53681. return _ref.apply(this, arguments);
  53682. }
  53683. return setupMirrorFromCache;
  53684. }();
  53685. TarballFetcher.prototype.getTarballCachePath = function getTarballCachePath() {
  53686. return path.join(this.dest, (_constants || _load_constants()).TARBALL_FILENAME);
  53687. };
  53688. TarballFetcher.prototype.getTarballMirrorPath = function getTarballMirrorPath() {
  53689. var _url$parse = url.parse(this.reference),
  53690. pathname = _url$parse.pathname;
  53691. if (pathname == null) {
  53692. return null;
  53693. }
  53694. var match = pathname.match(RE_URL_NAME_MATCH);
  53695. var packageFilename = void 0;
  53696. if (match) {
  53697. var scope = match[1],
  53698. tarballBasename = match[2];
  53699. packageFilename = scope ? `${scope}-${tarballBasename}` : tarballBasename;
  53700. } else {
  53701. // fallback to base name
  53702. packageFilename = path.basename(pathname);
  53703. }
  53704. return this.config.getOfflineMirrorPath(packageFilename);
  53705. };
  53706. TarballFetcher.prototype.createExtractor = function createExtractor(resolve, reject, tarballPath) {
  53707. var _this2 = this;
  53708. var hashInfo = this._supportedIntegrity({ hashOnly: true });
  53709. var integrityInfo = this._supportedIntegrity({ hashOnly: false });
  53710. var now = new Date();
  53711. var fs = __webpack_require__(12);
  53712. var patchedFs = (0, (_assign || _load_assign()).default)({}, fs, {
  53713. utimes: function utimes(path, atime, mtime, cb) {
  53714. fs.stat(path, function (err, stat) {
  53715. if (err) {
  53716. cb(err);
  53717. return;
  53718. }
  53719. if (stat.isDirectory()) {
  53720. fs.utimes(path, atime, mtime, cb);
  53721. return;
  53722. }
  53723. fs.open(path, 'a', function (err, fd) {
  53724. if (err) {
  53725. cb(err);
  53726. return;
  53727. }
  53728. fs.futimes(fd, atime, mtime, function (err) {
  53729. if (err) {
  53730. fs.close(fd, function () {
  53731. return cb(err);
  53732. });
  53733. } else {
  53734. fs.close(fd, function (err) {
  53735. return cb(err);
  53736. });
  53737. }
  53738. });
  53739. });
  53740. });
  53741. }
  53742. });
  53743. var hashValidateStream = new ssri.integrityStream(hashInfo);
  53744. var integrityValidateStream = new ssri.integrityStream(integrityInfo);
  53745. var untarStream = tarFs.extract(this.dest, {
  53746. strip: 1,
  53747. dmode: 0o755, // all dirs should be readable
  53748. fmode: 0o644, // all files should be readable
  53749. chown: false, // don't chown. just leave as it is
  53750. map: function map(header) {
  53751. header.mtime = now;
  53752. if (header.linkname) {
  53753. var basePath = path.posix.dirname(path.join('/', header.name));
  53754. var jailPath = path.posix.join(basePath, header.linkname);
  53755. header.linkname = path.posix.relative('/', jailPath);
  53756. }
  53757. return header;
  53758. },
  53759. fs: patchedFs
  53760. });
  53761. var extractorStream = gunzip();
  53762. hashValidateStream.once('error', function (err) {
  53763. _this2.validateError = err;
  53764. });
  53765. integrityValidateStream.once('error', function (err) {
  53766. _this2.validateError = err;
  53767. });
  53768. integrityValidateStream.once('integrity', function (sri) {
  53769. _this2.validateIntegrity = sri;
  53770. });
  53771. untarStream.on('error', function (err) {
  53772. reject(new (_errors || _load_errors()).MessageError(_this2.config.reporter.lang('errorExtractingTarball', err.message, tarballPath)));
  53773. });
  53774. extractorStream.pipe(untarStream).on('finish', function () {
  53775. var error = _this2.validateError;
  53776. var hexDigest = _this2.validateIntegrity ? _this2.validateIntegrity.hexDigest() : '';
  53777. if (_this2.config.updateChecksums && _this2.remote.integrity && _this2.validateIntegrity && _this2.remote.integrity !== _this2.validateIntegrity.toString()) {
  53778. _this2.remote.integrity = _this2.validateIntegrity.toString();
  53779. } else if (_this2.validateIntegrity) {
  53780. _this2.remote.cacheIntegrity = _this2.validateIntegrity.toString();
  53781. }
  53782. if (integrityInfo.integrity && (0, (_keys || _load_keys()).default)(integrityInfo.integrity).length === 0) {
  53783. return reject(new (_errors || _load_errors()).SecurityError(_this2.config.reporter.lang('fetchBadIntegrityAlgorithm', _this2.packageName, _this2.remote.reference)));
  53784. }
  53785. if (error) {
  53786. if (_this2.config.updateChecksums) {
  53787. _this2.remote.integrity = error.found.toString();
  53788. } else {
  53789. return reject(new (_errors || _load_errors()).SecurityError(_this2.config.reporter.lang('fetchBadHashWithPath', _this2.packageName, _this2.remote.reference, error.found.toString(), error.expected.toString())));
  53790. }
  53791. }
  53792. return resolve({
  53793. hash: _this2.hash || hexDigest
  53794. });
  53795. });
  53796. return { hashValidateStream, integrityValidateStream, extractorStream };
  53797. };
  53798. TarballFetcher.prototype.getLocalPaths = function getLocalPaths(override) {
  53799. var paths = [override ? path.resolve(this.config.cwd, override) : null, this.getTarballMirrorPath(), this.getTarballCachePath()];
  53800. // $FlowFixMe: https://github.com/facebook/flow/issues/1414
  53801. return paths.filter(function (path) {
  53802. return path != null;
  53803. });
  53804. };
  53805. TarballFetcher.prototype.fetchFromLocal = function () {
  53806. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (override) {
  53807. var _this3 = this;
  53808. var tarPaths = this.getLocalPaths(override);
  53809. var stream = yield (_fs || _load_fs()).readFirstAvailableStream(tarPaths);
  53810. return new (_promise || _load_promise()).default(function (resolve, reject) {
  53811. if (!stream) {
  53812. reject(new (_errors || _load_errors()).MessageError(_this3.reporter.lang('tarballNotInNetworkOrCache', _this3.reference, tarPaths)));
  53813. return;
  53814. }
  53815. invariant(stream, 'stream should be available at this point');
  53816. // $FlowFixMe - This is available https://nodejs.org/api/fs.html#fs_readstream_path
  53817. var tarballPath = stream.path;
  53818. var _createExtractor = _this3.createExtractor(resolve, reject, tarballPath),
  53819. hashValidateStream = _createExtractor.hashValidateStream,
  53820. integrityValidateStream = _createExtractor.integrityValidateStream,
  53821. extractorStream = _createExtractor.extractorStream;
  53822. stream.pipe(hashValidateStream);
  53823. hashValidateStream.pipe(integrityValidateStream);
  53824. integrityValidateStream.pipe(extractorStream).on('error', function (err) {
  53825. reject(new (_errors || _load_errors()).MessageError(_this3.config.reporter.lang('fetchErrorCorrupt', err.message, tarballPath)));
  53826. });
  53827. });
  53828. });
  53829. function fetchFromLocal(_x) {
  53830. return _ref2.apply(this, arguments);
  53831. }
  53832. return fetchFromLocal;
  53833. }();
  53834. TarballFetcher.prototype.fetchFromExternal = function () {
  53835. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  53836. var _this4 = this;
  53837. var registry = this.config.registries[this.registry];
  53838. try {
  53839. var headers = this.requestHeaders();
  53840. return yield registry.request(this.reference, {
  53841. headers: (0, (_extends2 || _load_extends()).default)({
  53842. 'Accept-Encoding': 'gzip'
  53843. }, headers),
  53844. buffer: true,
  53845. process: function process(req, resolve, reject) {
  53846. // should we save this to the offline cache?
  53847. var tarballMirrorPath = _this4.getTarballMirrorPath();
  53848. var tarballCachePath = _this4.getTarballCachePath();
  53849. var _createExtractor2 = _this4.createExtractor(resolve, reject),
  53850. hashValidateStream = _createExtractor2.hashValidateStream,
  53851. integrityValidateStream = _createExtractor2.integrityValidateStream,
  53852. extractorStream = _createExtractor2.extractorStream;
  53853. req.pipe(hashValidateStream);
  53854. hashValidateStream.pipe(integrityValidateStream);
  53855. if (tarballMirrorPath) {
  53856. integrityValidateStream.pipe(fs.createWriteStream(tarballMirrorPath)).on('error', reject);
  53857. }
  53858. if (tarballCachePath) {
  53859. integrityValidateStream.pipe(fs.createWriteStream(tarballCachePath)).on('error', reject);
  53860. }
  53861. integrityValidateStream.pipe(extractorStream).on('error', reject);
  53862. }
  53863. }, this.packageName);
  53864. } catch (err) {
  53865. var tarballMirrorPath = this.getTarballMirrorPath();
  53866. var tarballCachePath = this.getTarballCachePath();
  53867. if (tarballMirrorPath && (yield (_fs || _load_fs()).exists(tarballMirrorPath))) {
  53868. yield (_fs || _load_fs()).unlink(tarballMirrorPath);
  53869. }
  53870. if (tarballCachePath && (yield (_fs || _load_fs()).exists(tarballCachePath))) {
  53871. yield (_fs || _load_fs()).unlink(tarballCachePath);
  53872. }
  53873. throw err;
  53874. }
  53875. });
  53876. function fetchFromExternal() {
  53877. return _ref3.apply(this, arguments);
  53878. }
  53879. return fetchFromExternal;
  53880. }();
  53881. TarballFetcher.prototype.requestHeaders = function requestHeaders() {
  53882. var registry = this.config.registries.yarn;
  53883. var config = registry.config;
  53884. var requestParts = urlParts(this.reference);
  53885. return (0, (_keys || _load_keys()).default)(config).reduce(function (headers, option) {
  53886. var parts = option.split(':');
  53887. if (parts.length === 3 && parts[1] === '_header') {
  53888. var registryParts = urlParts(parts[0]);
  53889. if (requestParts.host === registryParts.host && requestParts.path.startsWith(registryParts.path)) {
  53890. var headerName = parts[2];
  53891. var headerValue = config[option];
  53892. headers[headerName] = headerValue;
  53893. }
  53894. }
  53895. return headers;
  53896. }, {});
  53897. };
  53898. TarballFetcher.prototype._fetch = function _fetch() {
  53899. var _this5 = this;
  53900. var isFilePath = this.reference.startsWith('file:');
  53901. this.reference = (0, (_misc || _load_misc()).removePrefix)(this.reference, 'file:');
  53902. var urlParse = url.parse(this.reference);
  53903. // legacy support for local paths in yarn.lock entries
  53904. var isRelativePath = urlParse.protocol ? urlParse.protocol.match(/^[a-z]:$/i) : urlParse.pathname ? urlParse.pathname.match(/^(?:\.{1,2})?[\\\/]/) : false;
  53905. if (isFilePath || isRelativePath) {
  53906. return this.fetchFromLocal(this.reference);
  53907. }
  53908. return this.fetchFromLocal().catch(function (err) {
  53909. return _this5.fetchFromExternal();
  53910. });
  53911. };
  53912. TarballFetcher.prototype._findIntegrity = function _findIntegrity(_ref4) {
  53913. var hashOnly = _ref4.hashOnly;
  53914. if (this.remote.integrity && !hashOnly) {
  53915. return ssri.parse(this.remote.integrity);
  53916. }
  53917. if (this.hash) {
  53918. return ssri.fromHex(this.hash, 'sha1');
  53919. }
  53920. return null;
  53921. };
  53922. TarballFetcher.prototype._supportedIntegrity = function _supportedIntegrity(_ref5) {
  53923. var hashOnly = _ref5.hashOnly;
  53924. var expectedIntegrity = this._findIntegrity({ hashOnly }) || {};
  53925. var expectedIntegrityAlgorithms = (0, (_keys || _load_keys()).default)(expectedIntegrity);
  53926. var shouldValidateIntegrity = (this.hash || this.remote.integrity) && !this.config.updateChecksums;
  53927. if (expectedIntegrityAlgorithms.length === 0 && (!shouldValidateIntegrity || hashOnly)) {
  53928. var _algorithms = this.config.updateChecksums ? ['sha512'] : ['sha1'];
  53929. // for consistency, return sha1 for packages without a remote integrity (eg. github)
  53930. return { integrity: null, algorithms: _algorithms };
  53931. }
  53932. var algorithms = new (_set || _load_set()).default(['sha512', 'sha1']);
  53933. var integrity = {};
  53934. for (var _iterator = expectedIntegrityAlgorithms, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  53935. var _ref6;
  53936. if (_isArray) {
  53937. if (_i >= _iterator.length) break;
  53938. _ref6 = _iterator[_i++];
  53939. } else {
  53940. _i = _iterator.next();
  53941. if (_i.done) break;
  53942. _ref6 = _i.value;
  53943. }
  53944. var algorithm = _ref6;
  53945. if (isHashAlgorithmSupported(algorithm)) {
  53946. algorithms.add(algorithm);
  53947. integrity[algorithm] = expectedIntegrity[algorithm];
  53948. }
  53949. }
  53950. return { integrity, algorithms: (0, (_from || _load_from()).default)(algorithms) };
  53951. };
  53952. return TarballFetcher;
  53953. }((_baseFetcher || _load_baseFetcher()).default);
  53954. exports.default = TarballFetcher;
  53955. var LocalTarballFetcher = exports.LocalTarballFetcher = function (_TarballFetcher) {
  53956. (0, (_inherits2 || _load_inherits()).default)(LocalTarballFetcher, _TarballFetcher);
  53957. function LocalTarballFetcher() {
  53958. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, LocalTarballFetcher);
  53959. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _TarballFetcher.apply(this, arguments));
  53960. }
  53961. LocalTarballFetcher.prototype._fetch = function _fetch() {
  53962. return this.fetchFromLocal(this.reference);
  53963. };
  53964. return LocalTarballFetcher;
  53965. }(TarballFetcher);
  53966. function urlParts(requestUrl) {
  53967. var normalizedUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(requestUrl);
  53968. var parsed = url.parse(normalizedUrl);
  53969. var host = parsed.host || '';
  53970. var path = parsed.path || '';
  53971. return { host, path };
  53972. }
  53973. /***/ }),
  53974. /* 301 */
  53975. /***/ (function(module, exports, __webpack_require__) {
  53976. "use strict";
  53977. Object.defineProperty(exports, "__esModule", {
  53978. value: true
  53979. });
  53980. var _assign;
  53981. function _load_assign() {
  53982. return _assign = _interopRequireDefault(__webpack_require__(23));
  53983. }
  53984. var _getIterator2;
  53985. function _load_getIterator() {
  53986. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  53987. }
  53988. var _classCallCheck2;
  53989. function _load_classCallCheck() {
  53990. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  53991. }
  53992. exports.default = function (str) {
  53993. var fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile';
  53994. str = (0, (_stripBom || _load_stripBom()).default)(str);
  53995. return hasMergeConflicts(str) ? parseWithConflict(str, fileLoc) : { type: 'success', object: parse(str, fileLoc) };
  53996. };
  53997. var _util;
  53998. function _load_util() {
  53999. return _util = _interopRequireDefault(__webpack_require__(9));
  54000. }
  54001. var _invariant;
  54002. function _load_invariant() {
  54003. return _invariant = _interopRequireDefault(__webpack_require__(15));
  54004. }
  54005. var _stripBom;
  54006. function _load_stripBom() {
  54007. return _stripBom = _interopRequireDefault(__webpack_require__(429));
  54008. }
  54009. var _constants;
  54010. function _load_constants() {
  54011. return _constants = __webpack_require__(13);
  54012. }
  54013. var _errors;
  54014. function _load_errors() {
  54015. return _errors = __webpack_require__(6);
  54016. }
  54017. var _map;
  54018. function _load_map() {
  54019. return _map = _interopRequireDefault(__webpack_require__(51));
  54020. }
  54021. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  54022. /* eslint quotes: 0 */
  54023. var _require = __webpack_require__(794),
  54024. safeLoad = _require.safeLoad,
  54025. FAILSAFE_SCHEMA = _require.FAILSAFE_SCHEMA;
  54026. var VERSION_REGEX = /^yarn lockfile v(\d+)$/;
  54027. var TOKEN_TYPES = {
  54028. boolean: 'BOOLEAN',
  54029. string: 'STRING',
  54030. identifier: 'IDENTIFIER',
  54031. eof: 'EOF',
  54032. colon: 'COLON',
  54033. newline: 'NEWLINE',
  54034. comment: 'COMMENT',
  54035. indent: 'INDENT',
  54036. invalid: 'INVALID',
  54037. number: 'NUMBER',
  54038. comma: 'COMMA'
  54039. };
  54040. var VALID_PROP_VALUE_TOKENS = [TOKEN_TYPES.boolean, TOKEN_TYPES.string, TOKEN_TYPES.number];
  54041. function isValidPropValueToken(token) {
  54042. return VALID_PROP_VALUE_TOKENS.indexOf(token.type) >= 0;
  54043. }
  54044. function* tokenise(input) {
  54045. var lastNewline = false;
  54046. var line = 1;
  54047. var col = 0;
  54048. function buildToken(type, value) {
  54049. return { line, col, type, value };
  54050. }
  54051. while (input.length) {
  54052. var chop = 0;
  54053. if (input[0] === '\n' || input[0] === '\r') {
  54054. chop++;
  54055. // If this is a \r\n line, ignore both chars but only add one new line
  54056. if (input[1] === '\n') {
  54057. chop++;
  54058. }
  54059. line++;
  54060. col = 0;
  54061. yield buildToken(TOKEN_TYPES.newline);
  54062. } else if (input[0] === '#') {
  54063. chop++;
  54064. var nextNewline = input.indexOf('\n', chop);
  54065. if (nextNewline === -1) {
  54066. nextNewline = input.length;
  54067. }
  54068. var val = input.substring(chop, nextNewline);
  54069. chop = nextNewline;
  54070. yield buildToken(TOKEN_TYPES.comment, val);
  54071. } else if (input[0] === ' ') {
  54072. if (lastNewline) {
  54073. var indentSize = 1;
  54074. for (var i = 1; input[i] === ' '; i++) {
  54075. indentSize++;
  54076. }
  54077. if (indentSize % 2) {
  54078. throw new TypeError('Invalid number of spaces');
  54079. } else {
  54080. chop = indentSize;
  54081. yield buildToken(TOKEN_TYPES.indent, indentSize / 2);
  54082. }
  54083. } else {
  54084. chop++;
  54085. }
  54086. } else if (input[0] === '"') {
  54087. var _i = 1;
  54088. for (; _i < input.length; _i++) {
  54089. if (input[_i] === '"') {
  54090. var isEscaped = input[_i - 1] === '\\' && input[_i - 2] !== '\\';
  54091. if (!isEscaped) {
  54092. _i++;
  54093. break;
  54094. }
  54095. }
  54096. }
  54097. var _val = input.substring(0, _i);
  54098. chop = _i;
  54099. try {
  54100. yield buildToken(TOKEN_TYPES.string, JSON.parse(_val));
  54101. } catch (err) {
  54102. if (err instanceof SyntaxError) {
  54103. yield buildToken(TOKEN_TYPES.invalid);
  54104. } else {
  54105. throw err;
  54106. }
  54107. }
  54108. } else if (/^[0-9]/.test(input)) {
  54109. var _val2 = /^[0-9]+/.exec(input)[0];
  54110. chop = _val2.length;
  54111. yield buildToken(TOKEN_TYPES.number, +_val2);
  54112. } else if (/^true/.test(input)) {
  54113. yield buildToken(TOKEN_TYPES.boolean, true);
  54114. chop = 4;
  54115. } else if (/^false/.test(input)) {
  54116. yield buildToken(TOKEN_TYPES.boolean, false);
  54117. chop = 5;
  54118. } else if (input[0] === ':') {
  54119. yield buildToken(TOKEN_TYPES.colon);
  54120. chop++;
  54121. } else if (input[0] === ',') {
  54122. yield buildToken(TOKEN_TYPES.comma);
  54123. chop++;
  54124. } else if (/^[a-zA-Z\/.-]/g.test(input)) {
  54125. var _i2 = 0;
  54126. for (; _i2 < input.length; _i2++) {
  54127. var char = input[_i2];
  54128. if (char === ':' || char === ' ' || char === '\n' || char === '\r' || char === ',') {
  54129. break;
  54130. }
  54131. }
  54132. var name = input.substring(0, _i2);
  54133. chop = _i2;
  54134. yield buildToken(TOKEN_TYPES.string, name);
  54135. } else {
  54136. yield buildToken(TOKEN_TYPES.invalid);
  54137. }
  54138. if (!chop) {
  54139. // will trigger infinite recursion
  54140. yield buildToken(TOKEN_TYPES.invalid);
  54141. }
  54142. col += chop;
  54143. lastNewline = input[0] === '\n' || input[0] === '\r' && input[1] === '\n';
  54144. input = input.slice(chop);
  54145. }
  54146. yield buildToken(TOKEN_TYPES.eof);
  54147. }
  54148. var Parser = function () {
  54149. function Parser(input) {
  54150. var fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile';
  54151. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Parser);
  54152. this.comments = [];
  54153. this.tokens = tokenise(input);
  54154. this.fileLoc = fileLoc;
  54155. }
  54156. Parser.prototype.onComment = function onComment(token) {
  54157. var value = token.value;
  54158. (0, (_invariant || _load_invariant()).default)(typeof value === 'string', 'expected token value to be a string');
  54159. var comment = value.trim();
  54160. var versionMatch = comment.match(VERSION_REGEX);
  54161. if (versionMatch) {
  54162. var version = +versionMatch[1];
  54163. if (version > (_constants || _load_constants()).LOCKFILE_VERSION) {
  54164. throw new (_errors || _load_errors()).MessageError(`Can't install from a lockfile of version ${version} as you're on an old yarn version that only supports ` + `versions up to ${(_constants || _load_constants()).LOCKFILE_VERSION}. Run \`$ yarn self-update\` to upgrade to the latest version.`);
  54165. }
  54166. }
  54167. this.comments.push(comment);
  54168. };
  54169. Parser.prototype.next = function next() {
  54170. var item = this.tokens.next();
  54171. (0, (_invariant || _load_invariant()).default)(item, 'expected a token');
  54172. var done = item.done,
  54173. value = item.value;
  54174. if (done || !value) {
  54175. throw new Error('No more tokens');
  54176. } else if (value.type === TOKEN_TYPES.comment) {
  54177. this.onComment(value);
  54178. return this.next();
  54179. } else {
  54180. return this.token = value;
  54181. }
  54182. };
  54183. Parser.prototype.unexpected = function unexpected() {
  54184. var msg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Unexpected token';
  54185. throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`);
  54186. };
  54187. Parser.prototype.expect = function expect(tokType) {
  54188. if (this.token.type === tokType) {
  54189. this.next();
  54190. } else {
  54191. this.unexpected();
  54192. }
  54193. };
  54194. Parser.prototype.eat = function eat(tokType) {
  54195. if (this.token.type === tokType) {
  54196. this.next();
  54197. return true;
  54198. } else {
  54199. return false;
  54200. }
  54201. };
  54202. Parser.prototype.parse = function parse() {
  54203. var indent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  54204. var obj = (0, (_map || _load_map()).default)();
  54205. while (true) {
  54206. var propToken = this.token;
  54207. if (propToken.type === TOKEN_TYPES.newline) {
  54208. var nextToken = this.next();
  54209. if (!indent) {
  54210. // if we have 0 indentation then the next token doesn't matter
  54211. continue;
  54212. }
  54213. if (nextToken.type !== TOKEN_TYPES.indent) {
  54214. // if we have no indentation after a newline then we've gone down a level
  54215. break;
  54216. }
  54217. if (nextToken.value === indent) {
  54218. // all is good, the indent is on our level
  54219. this.next();
  54220. } else {
  54221. // the indentation is less than our level
  54222. break;
  54223. }
  54224. } else if (propToken.type === TOKEN_TYPES.indent) {
  54225. if (propToken.value === indent) {
  54226. this.next();
  54227. } else {
  54228. break;
  54229. }
  54230. } else if (propToken.type === TOKEN_TYPES.eof) {
  54231. break;
  54232. } else if (propToken.type === TOKEN_TYPES.string) {
  54233. // property key
  54234. var key = propToken.value;
  54235. (0, (_invariant || _load_invariant()).default)(key, 'Expected a key');
  54236. var keys = [key];
  54237. this.next();
  54238. // support multiple keys
  54239. while (this.token.type === TOKEN_TYPES.comma) {
  54240. this.next(); // skip comma
  54241. var keyToken = this.token;
  54242. if (keyToken.type !== TOKEN_TYPES.string) {
  54243. this.unexpected('Expected string');
  54244. }
  54245. var _key = keyToken.value;
  54246. (0, (_invariant || _load_invariant()).default)(_key, 'Expected a key');
  54247. keys.push(_key);
  54248. this.next();
  54249. }
  54250. var wasColon = this.token.type === TOKEN_TYPES.colon;
  54251. if (wasColon) {
  54252. this.next();
  54253. }
  54254. if (isValidPropValueToken(this.token)) {
  54255. // plain value
  54256. for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i3 = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  54257. var _ref;
  54258. if (_isArray) {
  54259. if (_i3 >= _iterator.length) break;
  54260. _ref = _iterator[_i3++];
  54261. } else {
  54262. _i3 = _iterator.next();
  54263. if (_i3.done) break;
  54264. _ref = _i3.value;
  54265. }
  54266. var _key2 = _ref;
  54267. obj[_key2] = this.token.value;
  54268. }
  54269. this.next();
  54270. } else if (wasColon) {
  54271. // parse object
  54272. var val = this.parse(indent + 1);
  54273. for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i4 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  54274. var _ref2;
  54275. if (_isArray2) {
  54276. if (_i4 >= _iterator2.length) break;
  54277. _ref2 = _iterator2[_i4++];
  54278. } else {
  54279. _i4 = _iterator2.next();
  54280. if (_i4.done) break;
  54281. _ref2 = _i4.value;
  54282. }
  54283. var _key3 = _ref2;
  54284. obj[_key3] = val;
  54285. }
  54286. if (indent && this.token.type !== TOKEN_TYPES.indent) {
  54287. break;
  54288. }
  54289. } else {
  54290. this.unexpected('Invalid value type');
  54291. }
  54292. } else {
  54293. this.unexpected(`Unknown token: ${(_util || _load_util()).default.inspect(propToken)}`);
  54294. }
  54295. }
  54296. return obj;
  54297. };
  54298. return Parser;
  54299. }();
  54300. var MERGE_CONFLICT_ANCESTOR = '|||||||';
  54301. var MERGE_CONFLICT_END = '>>>>>>>';
  54302. var MERGE_CONFLICT_SEP = '=======';
  54303. var MERGE_CONFLICT_START = '<<<<<<<';
  54304. /**
  54305. * Extract the two versions of the lockfile from a merge conflict.
  54306. */
  54307. function extractConflictVariants(str) {
  54308. var variants = [[], []];
  54309. var lines = str.split(/\r?\n/g);
  54310. var skip = false;
  54311. while (lines.length) {
  54312. var _line = lines.shift();
  54313. if (_line.startsWith(MERGE_CONFLICT_START)) {
  54314. // get the first variant
  54315. while (lines.length) {
  54316. var conflictLine = lines.shift();
  54317. if (conflictLine === MERGE_CONFLICT_SEP) {
  54318. skip = false;
  54319. break;
  54320. } else if (skip || conflictLine.startsWith(MERGE_CONFLICT_ANCESTOR)) {
  54321. skip = true;
  54322. continue;
  54323. } else {
  54324. variants[0].push(conflictLine);
  54325. }
  54326. }
  54327. // get the second variant
  54328. while (lines.length) {
  54329. var _conflictLine = lines.shift();
  54330. if (_conflictLine.startsWith(MERGE_CONFLICT_END)) {
  54331. break;
  54332. } else {
  54333. variants[1].push(_conflictLine);
  54334. }
  54335. }
  54336. } else {
  54337. variants[0].push(_line);
  54338. variants[1].push(_line);
  54339. }
  54340. }
  54341. return [variants[0].join('\n'), variants[1].join('\n')];
  54342. }
  54343. /**
  54344. * Check if a lockfile has merge conflicts.
  54345. */
  54346. function hasMergeConflicts(str) {
  54347. return str.indexOf(MERGE_CONFLICT_START) !== -1 && str.indexOf(MERGE_CONFLICT_SEP) !== -1 && str.indexOf(MERGE_CONFLICT_END) !== -1;
  54348. }
  54349. /**
  54350. * Parse the lockfile.
  54351. */
  54352. function parse(str, fileLoc) {
  54353. var parser = new Parser(str, fileLoc);
  54354. parser.next();
  54355. if (!fileLoc.endsWith(`.yml`)) {
  54356. try {
  54357. return parser.parse();
  54358. } catch (error1) {
  54359. try {
  54360. return safeLoad(str, {
  54361. schema: FAILSAFE_SCHEMA
  54362. });
  54363. } catch (error2) {
  54364. throw error1;
  54365. }
  54366. }
  54367. } else {
  54368. var result = safeLoad(str, {
  54369. schema: FAILSAFE_SCHEMA
  54370. });
  54371. if (typeof result === 'object') {
  54372. return result;
  54373. } else {
  54374. return {};
  54375. }
  54376. }
  54377. }
  54378. /**
  54379. * Parse and merge the two variants in a conflicted lockfile.
  54380. */
  54381. function parseWithConflict(str, fileLoc) {
  54382. var variants = extractConflictVariants(str);
  54383. try {
  54384. return { type: 'merge', object: (0, (_assign || _load_assign()).default)({}, parse(variants[0], fileLoc), parse(variants[1], fileLoc)) };
  54385. } catch (err) {
  54386. if (err instanceof SyntaxError) {
  54387. return { type: 'conflict', object: {} };
  54388. } else {
  54389. throw err;
  54390. }
  54391. }
  54392. }
  54393. /***/ }),
  54394. /* 302 */
  54395. /***/ (function(module, exports, __webpack_require__) {
  54396. "use strict";
  54397. Object.defineProperty(exports, "__esModule", {
  54398. value: true
  54399. });
  54400. var _getIterator2;
  54401. function _load_getIterator() {
  54402. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  54403. }
  54404. var _classCallCheck2;
  54405. function _load_classCallCheck() {
  54406. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  54407. }
  54408. var _misc;
  54409. function _load_misc() {
  54410. return _misc = __webpack_require__(28);
  54411. }
  54412. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  54413. var PackageReference = function () {
  54414. function PackageReference(request, info, remote) {
  54415. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageReference);
  54416. this.resolver = request.resolver;
  54417. this.lockfile = request.lockfile;
  54418. this.requests = [];
  54419. this.config = request.config;
  54420. this.hint = request.hint;
  54421. this.isPlugnplay = false;
  54422. this.registry = remote.registry;
  54423. this.version = info.version;
  54424. this.name = info.name;
  54425. this.uid = info._uid;
  54426. this.remote = remote;
  54427. this.dependencies = [];
  54428. this.permissions = {};
  54429. this.patterns = [];
  54430. this.optional = null;
  54431. this.level = Infinity;
  54432. this.ignore = false;
  54433. this.incompatible = false;
  54434. this.fresh = false;
  54435. this.locations = [];
  54436. this.addRequest(request);
  54437. }
  54438. PackageReference.prototype.setFresh = function setFresh(fresh) {
  54439. this.fresh = fresh;
  54440. };
  54441. PackageReference.prototype.addLocation = function addLocation(loc) {
  54442. if (this.locations.indexOf(loc) === -1) {
  54443. this.locations.push(loc);
  54444. }
  54445. };
  54446. PackageReference.prototype.addRequest = function addRequest(request) {
  54447. this.requests.push(request);
  54448. this.level = Math.min(this.level, request.parentNames.length);
  54449. };
  54450. PackageReference.prototype.prune = function prune() {
  54451. for (var _iterator = this.patterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  54452. var _ref;
  54453. if (_isArray) {
  54454. if (_i >= _iterator.length) break;
  54455. _ref = _iterator[_i++];
  54456. } else {
  54457. _i = _iterator.next();
  54458. if (_i.done) break;
  54459. _ref = _i.value;
  54460. }
  54461. var selfPattern = _ref;
  54462. // remove ourselves from the resolver
  54463. this.resolver.removePattern(selfPattern);
  54464. }
  54465. };
  54466. PackageReference.prototype.addDependencies = function addDependencies(deps) {
  54467. this.dependencies = this.dependencies.concat(deps);
  54468. };
  54469. PackageReference.prototype.setPermission = function setPermission(key, val) {
  54470. this.permissions[key] = val;
  54471. };
  54472. PackageReference.prototype.hasPermission = function hasPermission(key) {
  54473. if (key in this.permissions) {
  54474. return this.permissions[key];
  54475. } else {
  54476. return false;
  54477. }
  54478. };
  54479. PackageReference.prototype.addPattern = function addPattern(pattern, manifest) {
  54480. this.resolver.addPattern(pattern, manifest);
  54481. this.patterns.push(pattern);
  54482. var shrunk = this.lockfile.getLocked(pattern);
  54483. if (shrunk && shrunk.permissions) {
  54484. for (var _iterator2 = (0, (_misc || _load_misc()).entries)(shrunk.permissions), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  54485. var _ref3;
  54486. if (_isArray2) {
  54487. if (_i2 >= _iterator2.length) break;
  54488. _ref3 = _iterator2[_i2++];
  54489. } else {
  54490. _i2 = _iterator2.next();
  54491. if (_i2.done) break;
  54492. _ref3 = _i2.value;
  54493. }
  54494. var _ref2 = _ref3;
  54495. var _key = _ref2[0];
  54496. var perm = _ref2[1];
  54497. this.setPermission(_key, perm);
  54498. }
  54499. }
  54500. };
  54501. PackageReference.prototype.addOptional = function addOptional(optional) {
  54502. if (this.optional == null) {
  54503. // optional is uninitialised
  54504. this.optional = optional;
  54505. } else if (!optional) {
  54506. // otherwise, ignore all subsequent optional assignments and only accept ones making
  54507. // this not optional
  54508. this.optional = false;
  54509. }
  54510. };
  54511. return PackageReference;
  54512. }();
  54513. exports.default = PackageReference;
  54514. /***/ }),
  54515. /* 303 */
  54516. /***/ (function(module, exports, __webpack_require__) {
  54517. "use strict";
  54518. Object.defineProperty(exports, "__esModule", {
  54519. value: true
  54520. });
  54521. var _asyncToGenerator2;
  54522. function _load_asyncToGenerator() {
  54523. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  54524. }
  54525. var _getIterator2;
  54526. function _load_getIterator() {
  54527. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  54528. }
  54529. var _promise;
  54530. function _load_promise() {
  54531. return _promise = _interopRequireDefault(__webpack_require__(7));
  54532. }
  54533. var _set;
  54534. function _load_set() {
  54535. return _set = _interopRequireDefault(__webpack_require__(16));
  54536. }
  54537. var _classCallCheck2;
  54538. function _load_classCallCheck() {
  54539. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  54540. }
  54541. var _index;
  54542. function _load_index() {
  54543. return _index = __webpack_require__(75);
  54544. }
  54545. var _packageRequest;
  54546. function _load_packageRequest() {
  54547. return _packageRequest = _interopRequireDefault(__webpack_require__(117));
  54548. }
  54549. var _normalizePattern2;
  54550. function _load_normalizePattern() {
  54551. return _normalizePattern2 = __webpack_require__(52);
  54552. }
  54553. var _requestManager;
  54554. function _load_requestManager() {
  54555. return _requestManager = _interopRequireDefault(__webpack_require__(315));
  54556. }
  54557. var _blockingQueue;
  54558. function _load_blockingQueue() {
  54559. return _blockingQueue = _interopRequireDefault(__webpack_require__(157));
  54560. }
  54561. var _lockfile;
  54562. function _load_lockfile() {
  54563. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  54564. }
  54565. var _map;
  54566. function _load_map() {
  54567. return _map = _interopRequireDefault(__webpack_require__(51));
  54568. }
  54569. var _workspaceLayout;
  54570. function _load_workspaceLayout() {
  54571. return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
  54572. }
  54573. var _resolutionMap;
  54574. function _load_resolutionMap() {
  54575. return _resolutionMap = _interopRequireDefault(__webpack_require__(201));
  54576. }
  54577. var _resolutionMap2;
  54578. function _load_resolutionMap2() {
  54579. return _resolutionMap2 = __webpack_require__(201);
  54580. }
  54581. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  54582. var invariant = __webpack_require__(15);
  54583. var semver = __webpack_require__(27);
  54584. var PackageResolver = function () {
  54585. function PackageResolver(config, lockfile) {
  54586. var resolutionMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_resolutionMap || _load_resolutionMap()).default(config);
  54587. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageResolver);
  54588. this.patternsByPackage = (0, (_map || _load_map()).default)();
  54589. this.fetchingPatterns = new (_set || _load_set()).default();
  54590. this.fetchingQueue = new (_blockingQueue || _load_blockingQueue()).default('resolver fetching');
  54591. this.patterns = (0, (_map || _load_map()).default)();
  54592. this.resolutionMap = resolutionMap;
  54593. this.usedRegistries = new (_set || _load_set()).default();
  54594. this.flat = false;
  54595. this.reporter = config.reporter;
  54596. this.lockfile = lockfile;
  54597. this.config = config;
  54598. this.delayedResolveQueue = [];
  54599. }
  54600. // whether the dependency graph will be flattened
  54601. // list of registries that have been used in this resolution
  54602. // activity monitor
  54603. // patterns we've already resolved or are in the process of resolving
  54604. // TODO
  54605. // manages and throttles json api http requests
  54606. // list of patterns associated with a package
  54607. // lockfile instance which we can use to retrieve version info
  54608. // a map of dependency patterns to packages
  54609. // reporter instance, abstracts out display logic
  54610. // environment specific config methods and options
  54611. // list of packages need to be resolved later (they found a matching version in the
  54612. // resolver, but better matches can still arrive later in the resolve process)
  54613. /**
  54614. * TODO description
  54615. */
  54616. PackageResolver.prototype.isNewPattern = function isNewPattern(pattern) {
  54617. return !!this.patterns[pattern].fresh;
  54618. };
  54619. PackageResolver.prototype.updateManifest = function updateManifest(ref, newPkg) {
  54620. // inherit fields
  54621. var oldPkg = this.patterns[ref.patterns[0]];
  54622. newPkg._reference = ref;
  54623. newPkg._remote = ref.remote;
  54624. newPkg.name = oldPkg.name;
  54625. newPkg.fresh = oldPkg.fresh;
  54626. newPkg.prebuiltVariants = oldPkg.prebuiltVariants;
  54627. // update patterns
  54628. for (var _iterator = ref.patterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  54629. var _ref;
  54630. if (_isArray) {
  54631. if (_i >= _iterator.length) break;
  54632. _ref = _iterator[_i++];
  54633. } else {
  54634. _i = _iterator.next();
  54635. if (_i.done) break;
  54636. _ref = _i.value;
  54637. }
  54638. var pattern = _ref;
  54639. this.patterns[pattern] = newPkg;
  54640. }
  54641. return (_promise || _load_promise()).default.resolve();
  54642. };
  54643. PackageResolver.prototype.updateManifests = function updateManifests(newPkgs) {
  54644. for (var _iterator2 = newPkgs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  54645. var _ref2;
  54646. if (_isArray2) {
  54647. if (_i2 >= _iterator2.length) break;
  54648. _ref2 = _iterator2[_i2++];
  54649. } else {
  54650. _i2 = _iterator2.next();
  54651. if (_i2.done) break;
  54652. _ref2 = _i2.value;
  54653. }
  54654. var newPkg = _ref2;
  54655. if (newPkg._reference) {
  54656. for (var _iterator3 = newPkg._reference.patterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  54657. var _ref3;
  54658. if (_isArray3) {
  54659. if (_i3 >= _iterator3.length) break;
  54660. _ref3 = _iterator3[_i3++];
  54661. } else {
  54662. _i3 = _iterator3.next();
  54663. if (_i3.done) break;
  54664. _ref3 = _i3.value;
  54665. }
  54666. var pattern = _ref3;
  54667. var oldPkg = this.patterns[pattern];
  54668. newPkg.prebuiltVariants = oldPkg.prebuiltVariants;
  54669. this.patterns[pattern] = newPkg;
  54670. }
  54671. }
  54672. }
  54673. return (_promise || _load_promise()).default.resolve();
  54674. };
  54675. /**
  54676. * Given a list of patterns, dedupe them to a list of unique patterns.
  54677. */
  54678. PackageResolver.prototype.dedupePatterns = function dedupePatterns(patterns) {
  54679. var deduped = [];
  54680. var seen = new (_set || _load_set()).default();
  54681. for (var _iterator4 = patterns, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  54682. var _ref4;
  54683. if (_isArray4) {
  54684. if (_i4 >= _iterator4.length) break;
  54685. _ref4 = _iterator4[_i4++];
  54686. } else {
  54687. _i4 = _iterator4.next();
  54688. if (_i4.done) break;
  54689. _ref4 = _i4.value;
  54690. }
  54691. var pattern = _ref4;
  54692. var _info = this.getResolvedPattern(pattern);
  54693. if (seen.has(_info)) {
  54694. continue;
  54695. }
  54696. seen.add(_info);
  54697. deduped.push(pattern);
  54698. }
  54699. return deduped;
  54700. };
  54701. /**
  54702. * Get a list of all manifests by topological order.
  54703. */
  54704. PackageResolver.prototype.getTopologicalManifests = function getTopologicalManifests(seedPatterns) {
  54705. var _this = this;
  54706. var pkgs = new (_set || _load_set()).default();
  54707. var skip = new (_set || _load_set()).default();
  54708. var add = function add(seedPatterns) {
  54709. for (var _iterator5 = seedPatterns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  54710. var _ref5;
  54711. if (_isArray5) {
  54712. if (_i5 >= _iterator5.length) break;
  54713. _ref5 = _iterator5[_i5++];
  54714. } else {
  54715. _i5 = _iterator5.next();
  54716. if (_i5.done) break;
  54717. _ref5 = _i5.value;
  54718. }
  54719. var pattern = _ref5;
  54720. var pkg = _this.getStrictResolvedPattern(pattern);
  54721. if (skip.has(pkg)) {
  54722. continue;
  54723. }
  54724. var ref = pkg._reference;
  54725. invariant(ref, 'expected reference');
  54726. skip.add(pkg);
  54727. add(ref.dependencies);
  54728. pkgs.add(pkg);
  54729. }
  54730. };
  54731. add(seedPatterns);
  54732. return pkgs;
  54733. };
  54734. /**
  54735. * Get a list of all manifests by level sort order.
  54736. */
  54737. PackageResolver.prototype.getLevelOrderManifests = function getLevelOrderManifests(seedPatterns) {
  54738. var _this2 = this;
  54739. var pkgs = new (_set || _load_set()).default();
  54740. var skip = new (_set || _load_set()).default();
  54741. var add = function add(seedPatterns) {
  54742. var refs = [];
  54743. for (var _iterator6 = seedPatterns, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  54744. var _ref6;
  54745. if (_isArray6) {
  54746. if (_i6 >= _iterator6.length) break;
  54747. _ref6 = _iterator6[_i6++];
  54748. } else {
  54749. _i6 = _iterator6.next();
  54750. if (_i6.done) break;
  54751. _ref6 = _i6.value;
  54752. }
  54753. var pattern = _ref6;
  54754. var pkg = _this2.getStrictResolvedPattern(pattern);
  54755. if (skip.has(pkg)) {
  54756. continue;
  54757. }
  54758. var ref = pkg._reference;
  54759. invariant(ref, 'expected reference');
  54760. refs.push(ref);
  54761. skip.add(pkg);
  54762. pkgs.add(pkg);
  54763. }
  54764. for (var _iterator7 = refs, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  54765. var _ref7;
  54766. if (_isArray7) {
  54767. if (_i7 >= _iterator7.length) break;
  54768. _ref7 = _iterator7[_i7++];
  54769. } else {
  54770. _i7 = _iterator7.next();
  54771. if (_i7.done) break;
  54772. _ref7 = _i7.value;
  54773. }
  54774. var ref = _ref7;
  54775. add(ref.dependencies);
  54776. }
  54777. };
  54778. add(seedPatterns);
  54779. return pkgs;
  54780. };
  54781. /**
  54782. * Get a list of all package names in the dependency graph.
  54783. */
  54784. PackageResolver.prototype.getAllDependencyNamesByLevelOrder = function getAllDependencyNamesByLevelOrder(seedPatterns) {
  54785. var names = new (_set || _load_set()).default();
  54786. for (var _iterator8 = this.getLevelOrderManifests(seedPatterns), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
  54787. var _ref9;
  54788. if (_isArray8) {
  54789. if (_i8 >= _iterator8.length) break;
  54790. _ref9 = _iterator8[_i8++];
  54791. } else {
  54792. _i8 = _iterator8.next();
  54793. if (_i8.done) break;
  54794. _ref9 = _i8.value;
  54795. }
  54796. var _ref8 = _ref9;
  54797. var _name = _ref8.name;
  54798. names.add(_name);
  54799. }
  54800. return names;
  54801. };
  54802. /**
  54803. * Retrieve all the package info stored for this package name.
  54804. */
  54805. PackageResolver.prototype.getAllInfoForPackageName = function getAllInfoForPackageName(name) {
  54806. var patterns = this.patternsByPackage[name] || [];
  54807. return this.getAllInfoForPatterns(patterns);
  54808. };
  54809. /**
  54810. * Retrieve all the package info stored for a list of patterns.
  54811. */
  54812. PackageResolver.prototype.getAllInfoForPatterns = function getAllInfoForPatterns(patterns) {
  54813. var infos = [];
  54814. var seen = new (_set || _load_set()).default();
  54815. for (var _iterator9 = patterns, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
  54816. var _ref10;
  54817. if (_isArray9) {
  54818. if (_i9 >= _iterator9.length) break;
  54819. _ref10 = _iterator9[_i9++];
  54820. } else {
  54821. _i9 = _iterator9.next();
  54822. if (_i9.done) break;
  54823. _ref10 = _i9.value;
  54824. }
  54825. var pattern = _ref10;
  54826. var _info2 = this.patterns[pattern];
  54827. if (seen.has(_info2)) {
  54828. continue;
  54829. }
  54830. seen.add(_info2);
  54831. infos.push(_info2);
  54832. }
  54833. return infos;
  54834. };
  54835. /**
  54836. * Get a flat list of all package info.
  54837. */
  54838. PackageResolver.prototype.getManifests = function getManifests() {
  54839. var infos = [];
  54840. var seen = new (_set || _load_set()).default();
  54841. for (var pattern in this.patterns) {
  54842. var _info3 = this.patterns[pattern];
  54843. if (seen.has(_info3)) {
  54844. continue;
  54845. }
  54846. infos.push(_info3);
  54847. seen.add(_info3);
  54848. }
  54849. return infos;
  54850. };
  54851. /**
  54852. * replace pattern in resolver, e.g. `name` is replaced with `name@^1.0.1`
  54853. */
  54854. PackageResolver.prototype.replacePattern = function replacePattern(pattern, newPattern) {
  54855. var pkg = this.getResolvedPattern(pattern);
  54856. invariant(pkg, `missing package ${pattern}`);
  54857. var ref = pkg._reference;
  54858. invariant(ref, 'expected package reference');
  54859. ref.patterns = [newPattern];
  54860. this.addPattern(newPattern, pkg);
  54861. this.removePattern(pattern);
  54862. };
  54863. /**
  54864. * Make all versions of this package resolve to it.
  54865. */
  54866. PackageResolver.prototype.collapseAllVersionsOfPackage = function collapseAllVersionsOfPackage(name, version) {
  54867. var patterns = this.dedupePatterns(this.patternsByPackage[name]);
  54868. return this.collapsePackageVersions(name, version, patterns);
  54869. };
  54870. /**
  54871. * Make all given patterns resolve to version.
  54872. */
  54873. PackageResolver.prototype.collapsePackageVersions = function collapsePackageVersions(name, version, patterns) {
  54874. var human = `${name}@${version}`;
  54875. // get manifest that matches the version we're collapsing too
  54876. var collapseToReference = void 0;
  54877. var collapseToManifest = void 0;
  54878. var collapseToPattern = void 0;
  54879. for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
  54880. var _ref11;
  54881. if (_isArray10) {
  54882. if (_i10 >= _iterator10.length) break;
  54883. _ref11 = _iterator10[_i10++];
  54884. } else {
  54885. _i10 = _iterator10.next();
  54886. if (_i10.done) break;
  54887. _ref11 = _i10.value;
  54888. }
  54889. var pattern = _ref11;
  54890. var _manifest = this.patterns[pattern];
  54891. if (_manifest.version === version) {
  54892. collapseToReference = _manifest._reference;
  54893. collapseToManifest = _manifest;
  54894. collapseToPattern = pattern;
  54895. break;
  54896. }
  54897. }
  54898. invariant(collapseToReference && collapseToManifest && collapseToPattern, `Couldn't find package manifest for ${human}`);
  54899. for (var _iterator11 = patterns, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
  54900. var _ref12;
  54901. if (_isArray11) {
  54902. if (_i11 >= _iterator11.length) break;
  54903. _ref12 = _iterator11[_i11++];
  54904. } else {
  54905. _i11 = _iterator11.next();
  54906. if (_i11.done) break;
  54907. _ref12 = _i11.value;
  54908. }
  54909. var _pattern = _ref12;
  54910. // don't touch the pattern we're collapsing to
  54911. if (_pattern === collapseToPattern) {
  54912. continue;
  54913. }
  54914. // remove this pattern
  54915. var ref = this.getStrictResolvedPattern(_pattern)._reference;
  54916. invariant(ref, 'expected package reference');
  54917. var refPatterns = ref.patterns.slice();
  54918. ref.prune();
  54919. // add pattern to the manifest we're collapsing to
  54920. for (var _iterator12 = refPatterns, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
  54921. var _ref13;
  54922. if (_isArray12) {
  54923. if (_i12 >= _iterator12.length) break;
  54924. _ref13 = _iterator12[_i12++];
  54925. } else {
  54926. _i12 = _iterator12.next();
  54927. if (_i12.done) break;
  54928. _ref13 = _i12.value;
  54929. }
  54930. var _pattern2 = _ref13;
  54931. collapseToReference.addPattern(_pattern2, collapseToManifest);
  54932. }
  54933. }
  54934. return collapseToPattern;
  54935. };
  54936. /**
  54937. * TODO description
  54938. */
  54939. PackageResolver.prototype.addPattern = function addPattern(pattern, info) {
  54940. this.patterns[pattern] = info;
  54941. var byName = this.patternsByPackage[info.name] = this.patternsByPackage[info.name] || [];
  54942. if (byName.indexOf(pattern) === -1) {
  54943. byName.push(pattern);
  54944. }
  54945. };
  54946. /**
  54947. * TODO description
  54948. */
  54949. PackageResolver.prototype.removePattern = function removePattern(pattern) {
  54950. var pkg = this.patterns[pattern];
  54951. if (!pkg) {
  54952. return;
  54953. }
  54954. var byName = this.patternsByPackage[pkg.name];
  54955. if (!byName) {
  54956. return;
  54957. }
  54958. byName.splice(byName.indexOf(pattern), 1);
  54959. delete this.patterns[pattern];
  54960. };
  54961. /**
  54962. * TODO description
  54963. */
  54964. PackageResolver.prototype.getResolvedPattern = function getResolvedPattern(pattern) {
  54965. return this.patterns[pattern];
  54966. };
  54967. /**
  54968. * TODO description
  54969. */
  54970. PackageResolver.prototype.getStrictResolvedPattern = function getStrictResolvedPattern(pattern) {
  54971. var manifest = this.getResolvedPattern(pattern);
  54972. invariant(manifest, 'expected manifest');
  54973. return manifest;
  54974. };
  54975. /**
  54976. * TODO description
  54977. */
  54978. PackageResolver.prototype.getExactVersionMatch = function getExactVersionMatch(name, version, manifest) {
  54979. var patterns = this.patternsByPackage[name];
  54980. if (!patterns) {
  54981. return null;
  54982. }
  54983. for (var _iterator13 = patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) {
  54984. var _ref14;
  54985. if (_isArray13) {
  54986. if (_i13 >= _iterator13.length) break;
  54987. _ref14 = _iterator13[_i13++];
  54988. } else {
  54989. _i13 = _iterator13.next();
  54990. if (_i13.done) break;
  54991. _ref14 = _i13.value;
  54992. }
  54993. var pattern = _ref14;
  54994. var _info4 = this.getStrictResolvedPattern(pattern);
  54995. if (_info4.version === version) {
  54996. return _info4;
  54997. }
  54998. }
  54999. if (manifest && (0, (_index || _load_index()).getExoticResolver)(version)) {
  55000. return this.exoticRangeMatch(patterns.map(this.getStrictResolvedPattern.bind(this)), manifest);
  55001. }
  55002. return null;
  55003. };
  55004. /**
  55005. * Get the manifest of the highest known version that satisfies a package range
  55006. */
  55007. PackageResolver.prototype.getHighestRangeVersionMatch = function getHighestRangeVersionMatch(name, range, manifest) {
  55008. var _this3 = this;
  55009. var patterns = this.patternsByPackage[name];
  55010. if (!patterns) {
  55011. return null;
  55012. }
  55013. var versionNumbers = [];
  55014. var resolvedPatterns = patterns.map(function (pattern) {
  55015. var info = _this3.getStrictResolvedPattern(pattern);
  55016. versionNumbers.push(info.version);
  55017. return info;
  55018. });
  55019. var maxValidRange = semver.maxSatisfying(versionNumbers, range);
  55020. if (!maxValidRange) {
  55021. return manifest && (0, (_index || _load_index()).getExoticResolver)(range) ? this.exoticRangeMatch(resolvedPatterns, manifest) : null;
  55022. }
  55023. var indexOfmaxValidRange = versionNumbers.indexOf(maxValidRange);
  55024. var maxValidRangeManifest = resolvedPatterns[indexOfmaxValidRange];
  55025. return maxValidRangeManifest;
  55026. };
  55027. /**
  55028. * Get the manifest of the package that matches an exotic range
  55029. */
  55030. PackageResolver.prototype.exoticRangeMatch = function exoticRangeMatch(resolvedPkgs, manifest) {
  55031. var remote = manifest._remote;
  55032. if (!(remote && remote.reference && remote.type === 'copy')) {
  55033. return null;
  55034. }
  55035. var matchedPkg = resolvedPkgs.find(function (_ref15) {
  55036. var pkgRemote = _ref15._remote;
  55037. return pkgRemote && pkgRemote.reference === remote.reference && pkgRemote.type === 'copy';
  55038. });
  55039. if (matchedPkg) {
  55040. manifest._remote = matchedPkg._remote;
  55041. }
  55042. return matchedPkg;
  55043. };
  55044. /**
  55045. * Determine if LockfileEntry is incorrect, remove it from lockfile cache and consider the pattern as new
  55046. */
  55047. PackageResolver.prototype.isLockfileEntryOutdated = function isLockfileEntryOutdated(version, range, hasVersion) {
  55048. return !!(semver.validRange(range) && semver.valid(version) && !(0, (_index || _load_index()).getExoticResolver)(range) && hasVersion && !semver.satisfies(version, range));
  55049. };
  55050. /**
  55051. * TODO description
  55052. */
  55053. PackageResolver.prototype.find = function () {
  55054. var _ref16 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (initialReq) {
  55055. var req = this.resolveToResolution(initialReq);
  55056. // we've already resolved it with a resolution
  55057. if (!req) {
  55058. return;
  55059. }
  55060. var request = new (_packageRequest || _load_packageRequest()).default(req, this);
  55061. var fetchKey = `${req.registry}:${req.pattern}:${String(req.optional)}`;
  55062. var initialFetch = !this.fetchingPatterns.has(fetchKey);
  55063. var fresh = false;
  55064. if (this.activity) {
  55065. this.activity.tick(req.pattern);
  55066. }
  55067. if (initialFetch) {
  55068. this.fetchingPatterns.add(fetchKey);
  55069. var lockfileEntry = this.lockfile.getLocked(req.pattern);
  55070. if (lockfileEntry) {
  55071. var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(req.pattern),
  55072. range = _normalizePattern.range,
  55073. hasVersion = _normalizePattern.hasVersion;
  55074. if (this.isLockfileEntryOutdated(lockfileEntry.version, range, hasVersion)) {
  55075. this.reporter.warn(this.reporter.lang('incorrectLockfileEntry', req.pattern));
  55076. this.removePattern(req.pattern);
  55077. this.lockfile.removePattern(req.pattern);
  55078. fresh = true;
  55079. }
  55080. } else {
  55081. fresh = true;
  55082. }
  55083. request.init();
  55084. }
  55085. yield request.find({ fresh, frozen: this.frozen });
  55086. });
  55087. function find(_x2) {
  55088. return _ref16.apply(this, arguments);
  55089. }
  55090. return find;
  55091. }();
  55092. /**
  55093. * TODO description
  55094. */
  55095. PackageResolver.prototype.init = function () {
  55096. var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) {
  55097. var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
  55098. isFlat: false,
  55099. isFrozen: false,
  55100. workspaceLayout: undefined
  55101. },
  55102. isFlat = _ref18.isFlat,
  55103. isFrozen = _ref18.isFrozen,
  55104. workspaceLayout = _ref18.workspaceLayout;
  55105. this.flat = Boolean(isFlat);
  55106. this.frozen = Boolean(isFrozen);
  55107. this.workspaceLayout = workspaceLayout;
  55108. var activity = this.activity = this.reporter.activity();
  55109. for (var _iterator14 = deps, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) {
  55110. var _ref19;
  55111. if (_isArray14) {
  55112. if (_i14 >= _iterator14.length) break;
  55113. _ref19 = _iterator14[_i14++];
  55114. } else {
  55115. _i14 = _iterator14.next();
  55116. if (_i14.done) break;
  55117. _ref19 = _i14.value;
  55118. }
  55119. var _req = _ref19;
  55120. yield this.find(_req);
  55121. }
  55122. // all required package versions have been discovered, so now packages that
  55123. // resolved to existing versions can be resolved to their best available version
  55124. this.resolvePackagesWithExistingVersions();
  55125. for (var _iterator15 = this.resolutionMap.delayQueue, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) {
  55126. var _ref20;
  55127. if (_isArray15) {
  55128. if (_i15 >= _iterator15.length) break;
  55129. _ref20 = _iterator15[_i15++];
  55130. } else {
  55131. _i15 = _iterator15.next();
  55132. if (_i15.done) break;
  55133. _ref20 = _i15.value;
  55134. }
  55135. var _req2 = _ref20;
  55136. this.resolveToResolution(_req2);
  55137. }
  55138. if (isFlat) {
  55139. for (var _iterator16 = deps, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) {
  55140. var _ref21;
  55141. if (_isArray16) {
  55142. if (_i16 >= _iterator16.length) break;
  55143. _ref21 = _iterator16[_i16++];
  55144. } else {
  55145. _i16 = _iterator16.next();
  55146. if (_i16.done) break;
  55147. _ref21 = _i16.value;
  55148. }
  55149. var dep = _ref21;
  55150. var _name2 = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(dep.pattern).name;
  55151. this.optimizeResolutions(_name2);
  55152. }
  55153. }
  55154. activity.end();
  55155. this.activity = null;
  55156. });
  55157. function init(_x3) {
  55158. return _ref17.apply(this, arguments);
  55159. }
  55160. return init;
  55161. }();
  55162. // for a given package, see if a single manifest can satisfy all ranges
  55163. PackageResolver.prototype.optimizeResolutions = function optimizeResolutions(name) {
  55164. var _this4 = this;
  55165. var patterns = this.dedupePatterns(this.patternsByPackage[name] || []);
  55166. // don't optimize things that already have a lockfile entry:
  55167. // https://github.com/yarnpkg/yarn/issues/79
  55168. var collapsablePatterns = patterns.filter(function (pattern) {
  55169. var remote = _this4.patterns[pattern]._remote;
  55170. return !_this4.lockfile.getLocked(pattern) && (!remote || remote.type !== 'workspace');
  55171. });
  55172. if (collapsablePatterns.length < 2) {
  55173. return;
  55174. }
  55175. // reverse sort, so we'll find the maximum satisfying version first
  55176. var availableVersions = this.getAllInfoForPatterns(collapsablePatterns).map(function (manifest) {
  55177. return manifest.version;
  55178. });
  55179. availableVersions.sort(semver.rcompare);
  55180. var ranges = collapsablePatterns.map(function (pattern) {
  55181. return (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern).range;
  55182. });
  55183. // find the most recent version that satisfies all patterns (if one exists), and
  55184. // collapse to that version.
  55185. var _loop = function _loop(version) {
  55186. if (ranges.every(function (range) {
  55187. return semver.satisfies(version, range);
  55188. })) {
  55189. _this4.collapsePackageVersions(name, version, collapsablePatterns);
  55190. return {
  55191. v: void 0
  55192. };
  55193. }
  55194. };
  55195. for (var _iterator17 = availableVersions, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator17);;) {
  55196. var _ref22;
  55197. if (_isArray17) {
  55198. if (_i17 >= _iterator17.length) break;
  55199. _ref22 = _iterator17[_i17++];
  55200. } else {
  55201. _i17 = _iterator17.next();
  55202. if (_i17.done) break;
  55203. _ref22 = _i17.value;
  55204. }
  55205. var version = _ref22;
  55206. var _ret = _loop(version);
  55207. if (typeof _ret === "object") return _ret.v;
  55208. }
  55209. };
  55210. /**
  55211. * Called by the package requester for packages that this resolver already had
  55212. * a matching version for. Delay the resolve, because better matches can still be
  55213. * discovered.
  55214. */
  55215. PackageResolver.prototype.reportPackageWithExistingVersion = function reportPackageWithExistingVersion(req, info) {
  55216. this.delayedResolveQueue.push({ req, info });
  55217. };
  55218. /**
  55219. * Executes the resolve to existing versions for packages after the find process,
  55220. * when all versions that are going to be used have been discovered.
  55221. */
  55222. PackageResolver.prototype.resolvePackagesWithExistingVersions = function resolvePackagesWithExistingVersions() {
  55223. for (var _iterator18 = this.delayedResolveQueue, _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator18);;) {
  55224. var _ref24;
  55225. if (_isArray18) {
  55226. if (_i18 >= _iterator18.length) break;
  55227. _ref24 = _iterator18[_i18++];
  55228. } else {
  55229. _i18 = _iterator18.next();
  55230. if (_i18.done) break;
  55231. _ref24 = _i18.value;
  55232. }
  55233. var _ref23 = _ref24;
  55234. var _req3 = _ref23.req,
  55235. _info5 = _ref23.info;
  55236. _req3.resolveToExistingVersion(_info5);
  55237. }
  55238. };
  55239. PackageResolver.prototype.resolveToResolution = function resolveToResolution(req) {
  55240. var parentNames = req.parentNames,
  55241. pattern = req.pattern;
  55242. if (!parentNames || this.flat) {
  55243. return req;
  55244. }
  55245. var resolution = this.resolutionMap.find(pattern, parentNames);
  55246. if (resolution) {
  55247. var resolutionManifest = this.getResolvedPattern(resolution);
  55248. if (resolutionManifest) {
  55249. invariant(resolutionManifest._reference, 'resolutions should have a resolved reference');
  55250. resolutionManifest._reference.patterns.push(pattern);
  55251. this.addPattern(pattern, resolutionManifest);
  55252. var lockManifest = this.lockfile.getLocked(pattern);
  55253. if ((0, (_resolutionMap2 || _load_resolutionMap2()).shouldUpdateLockfile)(lockManifest, resolutionManifest._reference)) {
  55254. this.lockfile.removePattern(pattern);
  55255. }
  55256. } else {
  55257. this.resolutionMap.addToDelayQueue(req);
  55258. }
  55259. return null;
  55260. }
  55261. return req;
  55262. };
  55263. return PackageResolver;
  55264. }();
  55265. exports.default = PackageResolver;
  55266. /***/ }),
  55267. /* 304 */
  55268. /***/ (function(module, exports, __webpack_require__) {
  55269. "use strict";
  55270. Object.defineProperty(exports, "__esModule", {
  55271. value: true
  55272. });
  55273. var _classCallCheck2;
  55274. function _load_classCallCheck() {
  55275. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  55276. }
  55277. var _possibleConstructorReturn2;
  55278. function _load_possibleConstructorReturn() {
  55279. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  55280. }
  55281. var _inherits2;
  55282. function _load_inherits() {
  55283. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  55284. }
  55285. var _hostedGitResolver;
  55286. function _load_hostedGitResolver() {
  55287. return _hostedGitResolver = _interopRequireDefault(__webpack_require__(99));
  55288. }
  55289. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  55290. var GitHubResolver = function (_HostedGitResolver) {
  55291. (0, (_inherits2 || _load_inherits()).default)(GitHubResolver, _HostedGitResolver);
  55292. function GitHubResolver() {
  55293. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitHubResolver);
  55294. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _HostedGitResolver.apply(this, arguments));
  55295. }
  55296. GitHubResolver.isVersion = function isVersion(pattern) {
  55297. // github proto
  55298. if (pattern.startsWith('github:')) {
  55299. return true;
  55300. }
  55301. // github shorthand
  55302. if (/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(pattern)) {
  55303. return true;
  55304. }
  55305. return false;
  55306. };
  55307. GitHubResolver.getTarballUrl = function getTarballUrl(parts, hash) {
  55308. return `https://codeload.${this.hostname}/${parts.user}/${parts.repo}/tar.gz/${hash}`;
  55309. };
  55310. GitHubResolver.getGitSSHUrl = function getGitSSHUrl(parts) {
  55311. return `git+ssh://git@${this.hostname}/${parts.user}/${parts.repo}.git` + `${parts.hash ? '#' + decodeURIComponent(parts.hash) : ''}`;
  55312. };
  55313. GitHubResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(parts) {
  55314. return `https://${this.hostname}/${parts.user}/${parts.repo}`;
  55315. };
  55316. GitHubResolver.getGitHTTPUrl = function getGitHTTPUrl(parts) {
  55317. return `${GitHubResolver.getGitHTTPBaseUrl(parts)}.git`;
  55318. };
  55319. GitHubResolver.getHTTPFileUrl = function getHTTPFileUrl(parts, filename, commit) {
  55320. return `https://raw.githubusercontent.com/${parts.user}/${parts.repo}/${commit}/${filename}`;
  55321. };
  55322. return GitHubResolver;
  55323. }((_hostedGitResolver || _load_hostedGitResolver()).default);
  55324. GitHubResolver.protocol = 'github';
  55325. GitHubResolver.hostname = 'github.com';
  55326. exports.default = GitHubResolver;
  55327. /***/ }),
  55328. /* 305 */
  55329. /***/ (function(module, exports, __webpack_require__) {
  55330. "use strict";
  55331. Object.defineProperty(exports, "__esModule", {
  55332. value: true
  55333. });
  55334. exports.LINK_PROTOCOL_PREFIX = undefined;
  55335. var _asyncToGenerator2;
  55336. function _load_asyncToGenerator() {
  55337. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  55338. }
  55339. var _classCallCheck2;
  55340. function _load_classCallCheck() {
  55341. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  55342. }
  55343. var _possibleConstructorReturn2;
  55344. function _load_possibleConstructorReturn() {
  55345. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  55346. }
  55347. var _inherits2;
  55348. function _load_inherits() {
  55349. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  55350. }
  55351. var _exoticResolver;
  55352. function _load_exoticResolver() {
  55353. return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
  55354. }
  55355. var _misc;
  55356. function _load_misc() {
  55357. return _misc = _interopRequireWildcard(__webpack_require__(28));
  55358. }
  55359. var _fs;
  55360. function _load_fs() {
  55361. return _fs = _interopRequireWildcard(__webpack_require__(8));
  55362. }
  55363. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  55364. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  55365. var path = __webpack_require__(1);
  55366. var LINK_PROTOCOL_PREFIX = exports.LINK_PROTOCOL_PREFIX = 'link:';
  55367. var LinkResolver = function (_ExoticResolver) {
  55368. (0, (_inherits2 || _load_inherits()).default)(LinkResolver, _ExoticResolver);
  55369. function LinkResolver(request, fragment) {
  55370. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, LinkResolver);
  55371. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
  55372. _this.loc = (_misc || _load_misc()).removePrefix(fragment, LINK_PROTOCOL_PREFIX);
  55373. return _this;
  55374. }
  55375. LinkResolver.prototype.resolve = function () {
  55376. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  55377. var loc = this.loc;
  55378. if (!path.isAbsolute(loc)) {
  55379. loc = path.resolve(this.config.lockfileFolder, loc);
  55380. }
  55381. var name = path.basename(loc);
  55382. var registry = 'npm';
  55383. var manifest = !(yield (_fs || _load_fs()).exists(`${loc}/package.json`)) || loc === this.config.lockfileFolder ? { _uid: '', name, version: '0.0.0', _registry: registry } : yield this.config.readManifest(loc, this.registry);
  55384. manifest._remote = {
  55385. type: 'link',
  55386. registry,
  55387. hash: null,
  55388. reference: loc
  55389. };
  55390. manifest._uid = manifest.version;
  55391. return manifest;
  55392. });
  55393. function resolve() {
  55394. return _ref.apply(this, arguments);
  55395. }
  55396. return resolve;
  55397. }();
  55398. return LinkResolver;
  55399. }((_exoticResolver || _load_exoticResolver()).default);
  55400. LinkResolver.protocol = 'link';
  55401. exports.default = LinkResolver;
  55402. /***/ }),
  55403. /* 306 */
  55404. /***/ (function(module, exports, __webpack_require__) {
  55405. "use strict";
  55406. Object.defineProperty(exports, "__esModule", {
  55407. value: true
  55408. });
  55409. exports.default = function (from, to) {
  55410. var validFrom = (_semver || _load_semver()).default.valid(from);
  55411. var validTo = (_semver || _load_semver()).default.valid(to);
  55412. var versionBump = 'unknown';
  55413. if (validFrom && validTo) {
  55414. versionBump = (0, (_semver2 || _load_semver2()).diffWithUnstable)(validFrom, validTo) || 'unchanged';
  55415. }
  55416. return (_constants || _load_constants()).VERSION_COLOR_SCHEME[versionBump];
  55417. };
  55418. var _semver;
  55419. function _load_semver() {
  55420. return _semver = _interopRequireDefault(__webpack_require__(27));
  55421. }
  55422. var _semver2;
  55423. function _load_semver2() {
  55424. return _semver2 = __webpack_require__(160);
  55425. }
  55426. var _constants;
  55427. function _load_constants() {
  55428. return _constants = __webpack_require__(13);
  55429. }
  55430. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  55431. /***/ }),
  55432. /* 307 */
  55433. /***/ (function(module, exports, __webpack_require__) {
  55434. "use strict";
  55435. Object.defineProperty(exports, "__esModule", {
  55436. value: true
  55437. });
  55438. exports.default = function (from, to, reporter) {
  55439. var parts = to.split('.');
  55440. var fromParts = from.split('.');
  55441. var splitIndex = parts.findIndex(function (part, i) {
  55442. return part !== fromParts[i];
  55443. });
  55444. if (splitIndex === -1) {
  55445. return from;
  55446. }
  55447. var colorized = reporter.format.green(parts.slice(splitIndex).join('.'));
  55448. return parts.slice(0, splitIndex).concat(colorized).join('.');
  55449. };
  55450. /***/ }),
  55451. /* 308 */
  55452. /***/ (function(module, exports, __webpack_require__) {
  55453. "use strict";
  55454. // $FlowFixMe We want this require to be dynamic
  55455. exports.dynamicRequire = true ? require : require; // eslint-disable-line
  55456. /***/ }),
  55457. /* 309 */
  55458. /***/ (function(module, exports, __webpack_require__) {
  55459. "use strict";
  55460. Object.defineProperty(exports, "__esModule", {
  55461. value: true
  55462. });
  55463. var _getIterator2;
  55464. function _load_getIterator() {
  55465. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  55466. }
  55467. var _set;
  55468. function _load_set() {
  55469. return _set = _interopRequireDefault(__webpack_require__(16));
  55470. }
  55471. exports.sortFilter = sortFilter;
  55472. exports.matchesFilter = matchesFilter;
  55473. exports.ignoreLinesToRegex = ignoreLinesToRegex;
  55474. exports.filterOverridenGitignores = filterOverridenGitignores;
  55475. var _misc;
  55476. function _load_misc() {
  55477. return _misc = __webpack_require__(28);
  55478. }
  55479. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  55480. var mm = __webpack_require__(109);
  55481. var path = __webpack_require__(1);
  55482. var WHITESPACE_RE = /^\s+$/;
  55483. function sortFilter(files, filters) {
  55484. var keepFiles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default();
  55485. var possibleKeepFiles = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new (_set || _load_set()).default();
  55486. var ignoreFiles = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : new (_set || _load_set()).default();
  55487. for (var _iterator = files, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  55488. var _ref;
  55489. if (_isArray) {
  55490. if (_i >= _iterator.length) break;
  55491. _ref = _iterator[_i++];
  55492. } else {
  55493. _i = _iterator.next();
  55494. if (_i.done) break;
  55495. _ref = _i.value;
  55496. }
  55497. var file = _ref;
  55498. var keep = false;
  55499. // always keep a file if a ! pattern matches it
  55500. for (var _iterator5 = filters, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  55501. var _ref5;
  55502. if (_isArray5) {
  55503. if (_i5 >= _iterator5.length) break;
  55504. _ref5 = _iterator5[_i5++];
  55505. } else {
  55506. _i5 = _iterator5.next();
  55507. if (_i5.done) break;
  55508. _ref5 = _i5.value;
  55509. }
  55510. var filter = _ref5;
  55511. if (filter.isNegation && matchesFilter(filter, file.basename, file.relative)) {
  55512. keep = true;
  55513. break;
  55514. }
  55515. }
  55516. //
  55517. if (keep) {
  55518. keepFiles.add(file.relative);
  55519. continue;
  55520. }
  55521. // otherwise don't keep it if a pattern matches it
  55522. keep = true;
  55523. for (var _iterator6 = filters, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  55524. var _ref6;
  55525. if (_isArray6) {
  55526. if (_i6 >= _iterator6.length) break;
  55527. _ref6 = _iterator6[_i6++];
  55528. } else {
  55529. _i6 = _iterator6.next();
  55530. if (_i6.done) break;
  55531. _ref6 = _i6.value;
  55532. }
  55533. var _filter = _ref6;
  55534. if (!_filter.isNegation && matchesFilter(_filter, file.basename, file.relative)) {
  55535. keep = false;
  55536. break;
  55537. }
  55538. }
  55539. if (keep) {
  55540. possibleKeepFiles.add(file.relative);
  55541. } else {
  55542. ignoreFiles.add(file.relative);
  55543. }
  55544. }
  55545. // exclude file
  55546. for (var _iterator2 = possibleKeepFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  55547. var _ref2;
  55548. if (_isArray2) {
  55549. if (_i2 >= _iterator2.length) break;
  55550. _ref2 = _iterator2[_i2++];
  55551. } else {
  55552. _i2 = _iterator2.next();
  55553. if (_i2.done) break;
  55554. _ref2 = _i2.value;
  55555. }
  55556. var _file = _ref2;
  55557. var parts = path.dirname(_file).split(path.sep);
  55558. while (parts.length) {
  55559. var folder = parts.join(path.sep);
  55560. if (ignoreFiles.has(folder)) {
  55561. ignoreFiles.add(_file);
  55562. break;
  55563. }
  55564. parts.pop();
  55565. }
  55566. }
  55567. //
  55568. for (var _iterator3 = possibleKeepFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  55569. var _ref3;
  55570. if (_isArray3) {
  55571. if (_i3 >= _iterator3.length) break;
  55572. _ref3 = _iterator3[_i3++];
  55573. } else {
  55574. _i3 = _iterator3.next();
  55575. if (_i3.done) break;
  55576. _ref3 = _i3.value;
  55577. }
  55578. var _file2 = _ref3;
  55579. if (!ignoreFiles.has(_file2)) {
  55580. keepFiles.add(_file2);
  55581. }
  55582. }
  55583. //
  55584. for (var _iterator4 = keepFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  55585. var _ref4;
  55586. if (_isArray4) {
  55587. if (_i4 >= _iterator4.length) break;
  55588. _ref4 = _iterator4[_i4++];
  55589. } else {
  55590. _i4 = _iterator4.next();
  55591. if (_i4.done) break;
  55592. _ref4 = _i4.value;
  55593. }
  55594. var _file3 = _ref4;
  55595. var parts = path.dirname(_file3).split(path.sep);
  55596. while (parts.length) {
  55597. // deregister this folder from being ignored, any files inside
  55598. // will still be marked as ignored
  55599. ignoreFiles.delete(parts.join(path.sep));
  55600. parts.pop();
  55601. }
  55602. }
  55603. return { ignoreFiles, keepFiles };
  55604. }
  55605. function matchesFilter(filter, basename, loc) {
  55606. var filterByBasename = true;
  55607. if (filter.base && filter.base !== '.') {
  55608. loc = path.relative(filter.base, loc);
  55609. filterByBasename = false;
  55610. }
  55611. // the micromatch regex expects unix path separators
  55612. loc = loc.replace(/\\/g, '/');
  55613. return filter.regex.test(loc) || filter.regex.test(`/${loc}`) || filterByBasename && filter.regex.test(basename) || mm.isMatch(loc, filter.pattern);
  55614. }
  55615. function ignoreLinesToRegex(lines) {
  55616. var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
  55617. return lines
  55618. // create regex
  55619. .map(function (line) {
  55620. // remove empty lines, comments, etc
  55621. if (line === '' || line === '!' || line[0] === '#' || WHITESPACE_RE.test(line)) {
  55622. return null;
  55623. }
  55624. var pattern = line;
  55625. var isNegation = false;
  55626. // hide the fact that it's a negation from minimatch since we'll handle this specifically
  55627. // ourselves
  55628. if (pattern[0] === '!') {
  55629. isNegation = true;
  55630. pattern = pattern.slice(1);
  55631. }
  55632. // remove trailing slash
  55633. pattern = (0, (_misc || _load_misc()).removeSuffix)(pattern, '/');
  55634. var regex = mm.makeRe(pattern.trim(), { dot: true, nocase: true });
  55635. if (regex) {
  55636. return {
  55637. base,
  55638. isNegation,
  55639. pattern,
  55640. regex
  55641. };
  55642. } else {
  55643. return null;
  55644. }
  55645. }).filter(Boolean);
  55646. }
  55647. function filterOverridenGitignores(files) {
  55648. var IGNORE_FILENAMES = ['.yarnignore', '.npmignore', '.gitignore'];
  55649. var GITIGNORE_NAME = IGNORE_FILENAMES[2];
  55650. return files.filter(function (file) {
  55651. return IGNORE_FILENAMES.indexOf(file.basename) > -1;
  55652. }).reduce(function (acc, file) {
  55653. if (file.basename !== GITIGNORE_NAME) {
  55654. return [].concat(acc, [file]);
  55655. } else {
  55656. //don't include .gitignore if .npmignore or .yarnignore are present
  55657. var dir = path.dirname(file.absolute);
  55658. var higherPriorityIgnoreFilePaths = [path.join(dir, IGNORE_FILENAMES[0]), path.join(dir, IGNORE_FILENAMES[1])];
  55659. var hasHigherPriorityFiles = files.find(function (file) {
  55660. return higherPriorityIgnoreFilePaths.indexOf(path.normalize(file.absolute)) > -1;
  55661. });
  55662. if (!hasHigherPriorityFiles) {
  55663. return [].concat(acc, [file]);
  55664. }
  55665. }
  55666. return acc;
  55667. }, []);
  55668. }
  55669. /***/ }),
  55670. /* 310 */
  55671. /***/ (function(module, exports, __webpack_require__) {
  55672. "use strict";
  55673. Object.defineProperty(exports, "__esModule", {
  55674. value: true
  55675. });
  55676. exports.spawn = undefined;
  55677. var _extends2;
  55678. function _load_extends() {
  55679. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  55680. }
  55681. var _map;
  55682. function _load_map() {
  55683. return _map = _interopRequireDefault(__webpack_require__(42));
  55684. }
  55685. var _path;
  55686. function _load_path() {
  55687. return _path = _interopRequireDefault(__webpack_require__(1));
  55688. }
  55689. var _child;
  55690. function _load_child() {
  55691. return _child = _interopRequireWildcard(__webpack_require__(57));
  55692. }
  55693. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  55694. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  55695. var BATCH_MODE_ARGS = new (_map || _load_map()).default([['ssh', '-oBatchMode=yes'], ['plink', '-batch']]);
  55696. // Suppress any password prompts since we run these in the background
  55697. var env = (0, (_extends2 || _load_extends()).default)({
  55698. GIT_ASKPASS: '',
  55699. GIT_TERMINAL_PROMPT: 0
  55700. }, process.env);
  55701. var sshCommand = env.GIT_SSH || 'ssh';
  55702. var sshExecutable = (_path || _load_path()).default.basename(sshCommand.toLowerCase(), '.exe');
  55703. var sshBatchArgs = BATCH_MODE_ARGS.get(sshExecutable);
  55704. if (!env.GIT_SSH_COMMAND && sshBatchArgs) {
  55705. // We have to manually specify `GIT_SSH_VARIANT`,
  55706. // because it's not automatically set when using `GIT_SSH_COMMAND` instead of `GIT_SSH`
  55707. // See: https://github.com/yarnpkg/yarn/issues/4729
  55708. env.GIT_SSH_VARIANT = sshExecutable;
  55709. env.GIT_SSH_COMMAND = `"${sshCommand}" ${sshBatchArgs}`;
  55710. }
  55711. var spawn = exports.spawn = function spawn(args) {
  55712. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  55713. return (_child || _load_child()).spawn('git', args, (0, (_extends2 || _load_extends()).default)({}, opts, { env }));
  55714. };
  55715. /***/ }),
  55716. /* 311 */
  55717. /***/ (function(module, exports, __webpack_require__) {
  55718. "use strict";
  55719. Object.defineProperty(exports, "__esModule", {
  55720. value: true
  55721. });
  55722. exports.callThroughHook = callThroughHook;
  55723. var YARN_HOOKS_KEY = 'experimentalYarnHooks';
  55724. function callThroughHook(type, fn, context) {
  55725. if (typeof global === 'undefined') {
  55726. return fn();
  55727. }
  55728. if (typeof global[YARN_HOOKS_KEY] !== 'object' || !global[YARN_HOOKS_KEY]) {
  55729. return fn();
  55730. }
  55731. var hook = global[YARN_HOOKS_KEY][type];
  55732. if (!hook) {
  55733. return fn();
  55734. }
  55735. return hook(fn, context);
  55736. }
  55737. /***/ }),
  55738. /* 312 */
  55739. /***/ (function(module, exports, __webpack_require__) {
  55740. "use strict";
  55741. Object.defineProperty(exports, "__esModule", {
  55742. value: true
  55743. });
  55744. var _promise;
  55745. function _load_promise() {
  55746. return _promise = _interopRequireDefault(__webpack_require__(7));
  55747. }
  55748. var _map;
  55749. function _load_map() {
  55750. return _map = _interopRequireDefault(__webpack_require__(42));
  55751. }
  55752. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  55753. var lockPromises = new (_map || _load_map()).default();
  55754. /**
  55755. * Acquires a mutex lock over the given key. If the lock can't be acquired, it waits until it's available.
  55756. * @param key Key to get the lock for.
  55757. * @return {Promise.<Function>} A Promise that resolves when the lock is acquired, with the function that
  55758. * must be called to release the lock.
  55759. */
  55760. exports.default = function (key) {
  55761. var unlockNext = void 0;
  55762. var willLock = new (_promise || _load_promise()).default(function (resolve) {
  55763. return unlockNext = resolve;
  55764. });
  55765. var lockPromise = lockPromises.get(key) || (_promise || _load_promise()).default.resolve();
  55766. var willUnlock = lockPromise.then(function () {
  55767. return unlockNext;
  55768. });
  55769. lockPromises.set(key, lockPromise.then(function () {
  55770. return willLock;
  55771. }));
  55772. return willUnlock;
  55773. };
  55774. /***/ }),
  55775. /* 313 */
  55776. /***/ (function(module, exports, __webpack_require__) {
  55777. "use strict";
  55778. Object.defineProperty(exports, "__esModule", {
  55779. value: true
  55780. });
  55781. exports.default = parsePackagePath;
  55782. exports.isValidPackagePath = isValidPackagePath;
  55783. /**
  55784. * Parse input strings like `package-1/package-2` to an array of packages
  55785. */
  55786. function parsePackagePath(input) {
  55787. return input.match(/(@[^\/]+\/)?([^/]+)/g) || [];
  55788. }
  55789. var WRONG_PATTERNS = /\/$|\/{2,}|\*+$/;
  55790. function isValidPackagePath(input) {
  55791. return !WRONG_PATTERNS.test(input);
  55792. }
  55793. /***/ }),
  55794. /* 314 */
  55795. /***/ (function(module, exports, __webpack_require__) {
  55796. "use strict";
  55797. Object.defineProperty(exports, "__esModule", {
  55798. value: true
  55799. });
  55800. exports.getPosixPath = getPosixPath;
  55801. exports.resolveWithHome = resolveWithHome;
  55802. var _path;
  55803. function _load_path() {
  55804. return _path = __webpack_require__(1);
  55805. }
  55806. var userHome = __webpack_require__(101).default;
  55807. function getPosixPath(path) {
  55808. return path.replace(/\\/g, '/');
  55809. }
  55810. function resolveWithHome(path) {
  55811. var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//;
  55812. if (homePattern.test(path)) {
  55813. return (0, (_path || _load_path()).resolve)(userHome, path.substr(2));
  55814. }
  55815. return (0, (_path || _load_path()).resolve)(path);
  55816. }
  55817. /***/ }),
  55818. /* 315 */
  55819. /***/ (function(module, exports, __webpack_require__) {
  55820. "use strict";
  55821. Object.defineProperty(exports, "__esModule", {
  55822. value: true
  55823. });
  55824. var _getIterator2;
  55825. function _load_getIterator() {
  55826. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  55827. }
  55828. var _assign;
  55829. function _load_assign() {
  55830. return _assign = _interopRequireDefault(__webpack_require__(23));
  55831. }
  55832. var _promise;
  55833. function _load_promise() {
  55834. return _promise = _interopRequireDefault(__webpack_require__(7));
  55835. }
  55836. var _classCallCheck2;
  55837. function _load_classCallCheck() {
  55838. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  55839. }
  55840. var _fs;
  55841. function _load_fs() {
  55842. return _fs = _interopRequireDefault(__webpack_require__(12));
  55843. }
  55844. var _http;
  55845. function _load_http() {
  55846. return _http = _interopRequireDefault(__webpack_require__(83));
  55847. }
  55848. var _url;
  55849. function _load_url() {
  55850. return _url = _interopRequireDefault(__webpack_require__(29));
  55851. }
  55852. var _dnscache;
  55853. function _load_dnscache() {
  55854. return _dnscache = _interopRequireDefault(__webpack_require__(660));
  55855. }
  55856. var _invariant;
  55857. function _load_invariant() {
  55858. return _invariant = _interopRequireDefault(__webpack_require__(15));
  55859. }
  55860. var _requestCaptureHar;
  55861. function _load_requestCaptureHar() {
  55862. return _requestCaptureHar = _interopRequireDefault(__webpack_require__(871));
  55863. }
  55864. var _errors;
  55865. function _load_errors() {
  55866. return _errors = __webpack_require__(6);
  55867. }
  55868. var _blockingQueue;
  55869. function _load_blockingQueue() {
  55870. return _blockingQueue = _interopRequireDefault(__webpack_require__(157));
  55871. }
  55872. var _constants;
  55873. function _load_constants() {
  55874. return _constants = _interopRequireWildcard(__webpack_require__(13));
  55875. }
  55876. var _network;
  55877. function _load_network() {
  55878. return _network = _interopRequireWildcard(__webpack_require__(276));
  55879. }
  55880. var _map;
  55881. function _load_map() {
  55882. return _map = _interopRequireDefault(__webpack_require__(51));
  55883. }
  55884. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  55885. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  55886. // Initialize DNS cache so we don't look up the same
  55887. // domains like registry.yarnpkg.com over and over again
  55888. // for each request.
  55889. (0, (_dnscache || _load_dnscache()).default)({
  55890. enable: true,
  55891. ttl: 300,
  55892. cachesize: 10
  55893. });
  55894. var successHosts = (0, (_map || _load_map()).default)();
  55895. var controlOffline = (_network || _load_network()).isOffline();
  55896. var RequestManager = function () {
  55897. function RequestManager(reporter) {
  55898. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, RequestManager);
  55899. this.offlineNoRequests = false;
  55900. this._requestCaptureHar = null;
  55901. this._requestModule = null;
  55902. this.offlineQueue = [];
  55903. this.captureHar = false;
  55904. this.httpsProxy = '';
  55905. this.ca = null;
  55906. this.httpProxy = '';
  55907. this.strictSSL = true;
  55908. this.userAgent = '';
  55909. this.reporter = reporter;
  55910. this.running = 0;
  55911. this.queue = [];
  55912. this.cache = {};
  55913. this.max = (_constants || _load_constants()).NETWORK_CONCURRENCY;
  55914. this.maxRetryAttempts = 5;
  55915. }
  55916. RequestManager.prototype.setOptions = function setOptions(opts) {
  55917. if (opts.userAgent != null) {
  55918. this.userAgent = opts.userAgent;
  55919. }
  55920. if (opts.offline != null) {
  55921. this.offlineNoRequests = opts.offline;
  55922. }
  55923. if (opts.captureHar != null) {
  55924. this.captureHar = opts.captureHar;
  55925. }
  55926. if (opts.httpProxy != null) {
  55927. this.httpProxy = opts.httpProxy || '';
  55928. }
  55929. if (opts.httpsProxy === '') {
  55930. this.httpsProxy = opts.httpProxy || '';
  55931. } else if (opts.httpsProxy === false) {
  55932. this.httpsProxy = false;
  55933. } else {
  55934. this.httpsProxy = opts.httpsProxy || '';
  55935. }
  55936. if (opts.strictSSL !== null && typeof opts.strictSSL !== 'undefined') {
  55937. this.strictSSL = opts.strictSSL;
  55938. }
  55939. if (opts.ca != null && opts.ca.length > 0) {
  55940. this.ca = opts.ca;
  55941. }
  55942. if (opts.networkConcurrency != null) {
  55943. this.max = opts.networkConcurrency;
  55944. }
  55945. if (opts.networkTimeout != null) {
  55946. this.timeout = opts.networkTimeout;
  55947. }
  55948. if (opts.maxRetryAttempts != null) {
  55949. this.maxRetryAttempts = opts.maxRetryAttempts;
  55950. }
  55951. if (opts.cafile != null && opts.cafile != '') {
  55952. // The CA bundle file can contain one or more certificates with comments/text between each PEM block.
  55953. // tls.connect wants an array of certificates without any comments/text, so we need to split the string
  55954. // and strip out any text in between the certificates
  55955. try {
  55956. var bundle = (_fs || _load_fs()).default.readFileSync(opts.cafile).toString();
  55957. var hasPemPrefix = function hasPemPrefix(block) {
  55958. return block.startsWith('-----BEGIN ');
  55959. };
  55960. // opts.cafile overrides opts.ca, this matches with npm behavior
  55961. this.ca = bundle.split(/(-----BEGIN .*\r?\n[^-]+\r?\n--.*)/).filter(hasPemPrefix);
  55962. } catch (err) {
  55963. this.reporter.error(`Could not open cafile: ${err.message}`);
  55964. }
  55965. }
  55966. if (opts.cert != null) {
  55967. this.cert = opts.cert;
  55968. }
  55969. if (opts.key != null) {
  55970. this.key = opts.key;
  55971. }
  55972. };
  55973. /**
  55974. * Lazy load `request` since it is exceptionally expensive to load and is
  55975. * often not needed at all.
  55976. */
  55977. RequestManager.prototype._getRequestModule = function _getRequestModule() {
  55978. if (!this._requestModule) {
  55979. var request = __webpack_require__(872);
  55980. if (this.captureHar) {
  55981. this._requestCaptureHar = new (_requestCaptureHar || _load_requestCaptureHar()).default(request);
  55982. this._requestModule = this._requestCaptureHar.request.bind(this._requestCaptureHar);
  55983. } else {
  55984. this._requestModule = request;
  55985. }
  55986. }
  55987. return this._requestModule;
  55988. };
  55989. /**
  55990. * Queue up a request.
  55991. */
  55992. RequestManager.prototype.request = function request(params) {
  55993. var _this = this;
  55994. if (this.offlineNoRequests) {
  55995. return (_promise || _load_promise()).default.reject(new (_errors || _load_errors()).MessageError(this.reporter.lang('cantRequestOffline', params.url)));
  55996. }
  55997. var cached = this.cache[params.url];
  55998. if (cached) {
  55999. return cached;
  56000. }
  56001. params.method = params.method || 'GET';
  56002. params.forever = true;
  56003. params.retryAttempts = 0;
  56004. params.strictSSL = this.strictSSL;
  56005. params.headers = (0, (_assign || _load_assign()).default)({
  56006. 'User-Agent': this.userAgent
  56007. }, params.headers);
  56008. var promise = new (_promise || _load_promise()).default(function (resolve, reject) {
  56009. _this.queue.push({ params, reject, resolve });
  56010. _this.shiftQueue();
  56011. });
  56012. // we can't cache a request with a processor
  56013. if (!params.process) {
  56014. this.cache[params.url] = promise;
  56015. }
  56016. return promise;
  56017. };
  56018. /**
  56019. * Clear the request cache. This is important as we cache all HTTP requests so you'll
  56020. * want to do this as soon as you can.
  56021. */
  56022. RequestManager.prototype.clearCache = function clearCache() {
  56023. this.cache = {};
  56024. if (this._requestCaptureHar != null) {
  56025. this._requestCaptureHar.clear();
  56026. }
  56027. };
  56028. /**
  56029. * Check if an error is possibly due to lost or poor network connectivity.
  56030. */
  56031. RequestManager.prototype.isPossibleOfflineError = function isPossibleOfflineError(err) {
  56032. var code = err.code,
  56033. hostname = err.hostname;
  56034. if (!code) {
  56035. return false;
  56036. }
  56037. // network was previously online but now we're offline
  56038. var possibleOfflineChange = !controlOffline && !(_network || _load_network()).isOffline();
  56039. if (code === 'ENOTFOUND' && possibleOfflineChange) {
  56040. // can't resolve a domain
  56041. return true;
  56042. }
  56043. // used to be able to resolve this domain! something is wrong
  56044. if (code === 'ENOTFOUND' && hostname && successHosts[hostname]) {
  56045. // can't resolve this domain but we've successfully resolved it before
  56046. return true;
  56047. }
  56048. // network was previously offline and we can't resolve the domain
  56049. if (code === 'ENOTFOUND' && controlOffline) {
  56050. return true;
  56051. }
  56052. // connection was reset or dropped
  56053. if (code === 'ECONNRESET') {
  56054. return true;
  56055. }
  56056. // TCP timeout
  56057. if (code === 'ESOCKETTIMEDOUT' || code === 'ETIMEDOUT') {
  56058. return true;
  56059. }
  56060. return false;
  56061. };
  56062. /**
  56063. * Queue up request arguments to be retried. Start a network connectivity timer if there
  56064. * isn't already one.
  56065. */
  56066. RequestManager.prototype.queueForRetry = function queueForRetry(opts) {
  56067. if (opts.retryReason) {
  56068. var containsReason = false;
  56069. for (var _iterator = this.offlineQueue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  56070. var _ref;
  56071. if (_isArray) {
  56072. if (_i >= _iterator.length) break;
  56073. _ref = _iterator[_i++];
  56074. } else {
  56075. _i = _iterator.next();
  56076. if (_i.done) break;
  56077. _ref = _i.value;
  56078. }
  56079. var queuedOpts = _ref;
  56080. if (queuedOpts.retryReason === opts.retryReason) {
  56081. containsReason = true;
  56082. break;
  56083. }
  56084. }
  56085. if (!containsReason) {
  56086. this.reporter.info(opts.retryReason);
  56087. }
  56088. }
  56089. if (!this.offlineQueue.length) {
  56090. this.initOfflineRetry();
  56091. }
  56092. this.offlineQueue.push(opts);
  56093. };
  56094. /**
  56095. * Begin timers to retry failed requests when we possibly establish network connectivity
  56096. * again.
  56097. */
  56098. RequestManager.prototype.initOfflineRetry = function initOfflineRetry() {
  56099. var _this2 = this;
  56100. setTimeout(function () {
  56101. var queue = _this2.offlineQueue;
  56102. _this2.offlineQueue = [];
  56103. for (var _iterator2 = queue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  56104. var _ref2;
  56105. if (_isArray2) {
  56106. if (_i2 >= _iterator2.length) break;
  56107. _ref2 = _iterator2[_i2++];
  56108. } else {
  56109. _i2 = _iterator2.next();
  56110. if (_i2.done) break;
  56111. _ref2 = _i2.value;
  56112. }
  56113. var opts = _ref2;
  56114. _this2.execute(opts);
  56115. }
  56116. }, 3000);
  56117. };
  56118. /**
  56119. * Execute a request.
  56120. */
  56121. RequestManager.prototype.execute = function execute(opts) {
  56122. var _this3 = this;
  56123. var params = opts.params;
  56124. var reporter = this.reporter;
  56125. var buildNext = function buildNext(fn) {
  56126. return function (data) {
  56127. fn(data);
  56128. _this3.running--;
  56129. _this3.shiftQueue();
  56130. };
  56131. };
  56132. var resolve = buildNext(opts.resolve);
  56133. var rejectNext = buildNext(opts.reject);
  56134. var reject = function reject(err) {
  56135. err.message = `${params.url}: ${err.message}`;
  56136. rejectNext(err);
  56137. };
  56138. var rejectWithoutUrl = function rejectWithoutUrl(err) {
  56139. err.message = err.message;
  56140. rejectNext(err);
  56141. };
  56142. var queueForRetry = function queueForRetry(reason) {
  56143. var attempts = params.retryAttempts || 0;
  56144. if (attempts >= _this3.maxRetryAttempts - 1) {
  56145. return false;
  56146. }
  56147. if (opts.params.method && opts.params.method.toUpperCase() !== 'GET') {
  56148. return false;
  56149. }
  56150. params.retryAttempts = attempts + 1;
  56151. if (typeof params.cleanup === 'function') {
  56152. params.cleanup();
  56153. }
  56154. opts.retryReason = reason;
  56155. _this3.queueForRetry(opts);
  56156. return true;
  56157. };
  56158. var calledOnError = false;
  56159. var onError = function onError(err) {
  56160. if (calledOnError) {
  56161. return;
  56162. }
  56163. calledOnError = true;
  56164. if (_this3.isPossibleOfflineError(err)) {
  56165. if (!queueForRetry(_this3.reporter.lang('offlineRetrying'))) {
  56166. reject(err);
  56167. }
  56168. } else {
  56169. reject(err);
  56170. }
  56171. };
  56172. if (!params.process) {
  56173. var parts = (_url || _load_url()).default.parse(params.url);
  56174. params.callback = function (err, res, body) {
  56175. if (err) {
  56176. onError(err);
  56177. return;
  56178. }
  56179. successHosts[parts.hostname] = true;
  56180. _this3.reporter.verbose(_this3.reporter.lang('verboseRequestFinish', params.url, res.statusCode));
  56181. if (res.statusCode === 408 || res.statusCode >= 500) {
  56182. var description = `${res.statusCode} ${(_http || _load_http()).default.STATUS_CODES[res.statusCode]}`;
  56183. if (!queueForRetry(_this3.reporter.lang('internalServerErrorRetrying', description))) {
  56184. throw new (_errors || _load_errors()).ResponseError(_this3.reporter.lang('requestFailed', description), res.statusCode);
  56185. } else {
  56186. return;
  56187. }
  56188. }
  56189. if (res.statusCode === 401 && res.caseless && res.caseless.get('server') === 'GitHub.com') {
  56190. var message = `${res.body.message}. If using GITHUB_TOKEN in your env, check that it is valid.`;
  56191. rejectWithoutUrl(new Error(_this3.reporter.lang('unauthorizedResponse', res.caseless.get('server'), message)));
  56192. }
  56193. if (res.statusCode === 401 && res.headers['www-authenticate']) {
  56194. var authMethods = res.headers['www-authenticate'].split(/,\s*/).map(function (s) {
  56195. return s.toLowerCase();
  56196. });
  56197. if (authMethods.indexOf('otp') !== -1) {
  56198. reject(new (_errors || _load_errors()).OneTimePasswordError(res.headers['npm-notice']));
  56199. return;
  56200. }
  56201. }
  56202. if (body && typeof body.error === 'string') {
  56203. reject(new Error(body.error));
  56204. return;
  56205. }
  56206. if ([400, 401, 404].concat(params.rejectStatusCode || []).indexOf(res.statusCode) !== -1) {
  56207. // So this is actually a rejection ... the hosted git resolver uses this to know whether http is supported
  56208. resolve(false);
  56209. } else if (res.statusCode >= 400) {
  56210. var errMsg = body && body.message || reporter.lang('requestError', params.url, res.statusCode);
  56211. reject(new Error(errMsg));
  56212. } else {
  56213. resolve(body);
  56214. }
  56215. };
  56216. }
  56217. if (params.buffer) {
  56218. params.encoding = null;
  56219. }
  56220. var proxy = this.httpProxy;
  56221. if (params.url.startsWith('https:')) {
  56222. proxy = this.httpsProxy;
  56223. }
  56224. if (proxy) {
  56225. // if no proxy is set, do not pass a proxy down to request.
  56226. // the request library will internally check the HTTP_PROXY and HTTPS_PROXY env vars.
  56227. params.proxy = String(proxy);
  56228. } else if (proxy === false) {
  56229. // passing empty string prevents the underlying library from falling back to the env vars.
  56230. // an explicit false in the yarn config should override the env var. See #4546.
  56231. params.proxy = '';
  56232. }
  56233. if (this.ca != null) {
  56234. params.ca = this.ca;
  56235. }
  56236. if (this.cert != null) {
  56237. params.cert = this.cert;
  56238. }
  56239. if (this.key != null) {
  56240. params.key = this.key;
  56241. }
  56242. if (this.timeout != null) {
  56243. params.timeout = this.timeout;
  56244. }
  56245. var request = this._getRequestModule();
  56246. var req = request(params);
  56247. this.reporter.verbose(this.reporter.lang('verboseRequestStart', params.method, params.url));
  56248. req.on('error', onError);
  56249. var queue = params.queue;
  56250. if (queue) {
  56251. req.on('data', queue.stillActive.bind(queue));
  56252. }
  56253. var process = params.process;
  56254. if (process) {
  56255. req.on('response', function (res) {
  56256. if (res.statusCode >= 200 && res.statusCode < 300) {
  56257. return;
  56258. }
  56259. var description = `${res.statusCode} ${(_http || _load_http()).default.STATUS_CODES[res.statusCode]}`;
  56260. reject(new (_errors || _load_errors()).ResponseError(_this3.reporter.lang('requestFailed', description), res.statusCode));
  56261. req.abort();
  56262. });
  56263. process(req, resolve, reject);
  56264. }
  56265. };
  56266. /**
  56267. * Remove an item from the queue. Create it's request options and execute it.
  56268. */
  56269. RequestManager.prototype.shiftQueue = function shiftQueue() {
  56270. if (this.running >= this.max || !this.queue.length) {
  56271. return;
  56272. }
  56273. var opts = this.queue.shift();
  56274. this.running++;
  56275. this.execute(opts);
  56276. };
  56277. RequestManager.prototype.saveHar = function saveHar(filename) {
  56278. if (!this.captureHar) {
  56279. throw new Error(this.reporter.lang('requestManagerNotSetupHAR'));
  56280. }
  56281. // No request may have occurred at all.
  56282. this._getRequestModule();
  56283. (0, (_invariant || _load_invariant()).default)(this._requestCaptureHar != null, 'request-capture-har not setup');
  56284. this._requestCaptureHar.saveHar(filename);
  56285. };
  56286. return RequestManager;
  56287. }();
  56288. exports.default = RequestManager;
  56289. /***/ }),
  56290. /* 316 */
  56291. /***/ (function(module, exports, __webpack_require__) {
  56292. "use strict";
  56293. exports.__esModule = true;
  56294. var _iterator = __webpack_require__(554);
  56295. var _iterator2 = _interopRequireDefault(_iterator);
  56296. var _symbol = __webpack_require__(553);
  56297. var _symbol2 = _interopRequireDefault(_symbol);
  56298. var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
  56299. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  56300. exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
  56301. return typeof obj === "undefined" ? "undefined" : _typeof(obj);
  56302. } : function (obj) {
  56303. return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
  56304. };
  56305. /***/ }),
  56306. /* 317 */
  56307. /***/ (function(module, exports, __webpack_require__) {
  56308. "use strict";
  56309. var crypto_hash_sha512 = __webpack_require__(72).lowlevel.crypto_hash;
  56310. /*
  56311. * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a
  56312. * result, it retains the original copyright and license. The two files are
  56313. * under slightly different (but compatible) licenses, and are here combined in
  56314. * one file.
  56315. *
  56316. * Credit for the actual porting work goes to:
  56317. * Devi Mandiri <me@devi.web.id>
  56318. */
  56319. /*
  56320. * The Blowfish portions are under the following license:
  56321. *
  56322. * Blowfish block cipher for OpenBSD
  56323. * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
  56324. * All rights reserved.
  56325. *
  56326. * Implementation advice by David Mazieres <dm@lcs.mit.edu>.
  56327. *
  56328. * Redistribution and use in source and binary forms, with or without
  56329. * modification, are permitted provided that the following conditions
  56330. * are met:
  56331. * 1. Redistributions of source code must retain the above copyright
  56332. * notice, this list of conditions and the following disclaimer.
  56333. * 2. Redistributions in binary form must reproduce the above copyright
  56334. * notice, this list of conditions and the following disclaimer in the
  56335. * documentation and/or other materials provided with the distribution.
  56336. * 3. The name of the author may not be used to endorse or promote products
  56337. * derived from this software without specific prior written permission.
  56338. *
  56339. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  56340. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  56341. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  56342. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  56343. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  56344. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  56345. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  56346. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  56347. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  56348. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  56349. */
  56350. /*
  56351. * The bcrypt_pbkdf portions are under the following license:
  56352. *
  56353. * Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
  56354. *
  56355. * Permission to use, copy, modify, and distribute this software for any
  56356. * purpose with or without fee is hereby granted, provided that the above
  56357. * copyright notice and this permission notice appear in all copies.
  56358. *
  56359. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  56360. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  56361. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  56362. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  56363. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  56364. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  56365. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  56366. */
  56367. /*
  56368. * Performance improvements (Javascript-specific):
  56369. *
  56370. * Copyright 2016, Joyent Inc
  56371. * Author: Alex Wilson <alex.wilson@joyent.com>
  56372. *
  56373. * Permission to use, copy, modify, and distribute this software for any
  56374. * purpose with or without fee is hereby granted, provided that the above
  56375. * copyright notice and this permission notice appear in all copies.
  56376. *
  56377. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  56378. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  56379. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  56380. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  56381. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  56382. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  56383. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  56384. */
  56385. // Ported from OpenBSD bcrypt_pbkdf.c v1.9
  56386. var BLF_J = 0;
  56387. var Blowfish = function() {
  56388. this.S = [
  56389. new Uint32Array([
  56390. 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
  56391. 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
  56392. 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
  56393. 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
  56394. 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
  56395. 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
  56396. 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
  56397. 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
  56398. 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
  56399. 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
  56400. 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
  56401. 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
  56402. 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
  56403. 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
  56404. 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
  56405. 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
  56406. 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
  56407. 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
  56408. 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
  56409. 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
  56410. 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
  56411. 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
  56412. 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
  56413. 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
  56414. 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
  56415. 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
  56416. 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
  56417. 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
  56418. 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
  56419. 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
  56420. 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
  56421. 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
  56422. 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
  56423. 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
  56424. 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
  56425. 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
  56426. 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
  56427. 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
  56428. 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
  56429. 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
  56430. 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
  56431. 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
  56432. 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
  56433. 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
  56434. 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
  56435. 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
  56436. 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
  56437. 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
  56438. 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
  56439. 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
  56440. 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
  56441. 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
  56442. 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
  56443. 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
  56444. 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
  56445. 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
  56446. 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
  56447. 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
  56448. 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
  56449. 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
  56450. 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
  56451. 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
  56452. 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
  56453. 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]),
  56454. new Uint32Array([
  56455. 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
  56456. 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
  56457. 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
  56458. 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
  56459. 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
  56460. 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
  56461. 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
  56462. 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
  56463. 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
  56464. 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
  56465. 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
  56466. 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
  56467. 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
  56468. 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
  56469. 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
  56470. 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
  56471. 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
  56472. 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
  56473. 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
  56474. 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
  56475. 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
  56476. 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
  56477. 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
  56478. 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
  56479. 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
  56480. 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
  56481. 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
  56482. 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
  56483. 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
  56484. 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
  56485. 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
  56486. 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
  56487. 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
  56488. 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
  56489. 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
  56490. 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
  56491. 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
  56492. 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
  56493. 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
  56494. 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
  56495. 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
  56496. 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
  56497. 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
  56498. 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
  56499. 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
  56500. 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
  56501. 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
  56502. 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
  56503. 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
  56504. 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
  56505. 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
  56506. 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
  56507. 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
  56508. 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
  56509. 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
  56510. 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
  56511. 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
  56512. 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
  56513. 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
  56514. 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
  56515. 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
  56516. 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
  56517. 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
  56518. 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]),
  56519. new Uint32Array([
  56520. 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
  56521. 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
  56522. 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
  56523. 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
  56524. 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
  56525. 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
  56526. 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
  56527. 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
  56528. 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
  56529. 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
  56530. 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
  56531. 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
  56532. 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
  56533. 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
  56534. 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
  56535. 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
  56536. 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
  56537. 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
  56538. 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
  56539. 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
  56540. 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
  56541. 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
  56542. 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
  56543. 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
  56544. 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
  56545. 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
  56546. 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
  56547. 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
  56548. 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
  56549. 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
  56550. 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
  56551. 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
  56552. 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
  56553. 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
  56554. 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
  56555. 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
  56556. 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
  56557. 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
  56558. 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
  56559. 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
  56560. 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
  56561. 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
  56562. 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
  56563. 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
  56564. 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
  56565. 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
  56566. 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
  56567. 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
  56568. 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
  56569. 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
  56570. 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
  56571. 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
  56572. 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
  56573. 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
  56574. 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
  56575. 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
  56576. 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
  56577. 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
  56578. 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
  56579. 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
  56580. 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
  56581. 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
  56582. 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
  56583. 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]),
  56584. new Uint32Array([
  56585. 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
  56586. 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
  56587. 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
  56588. 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
  56589. 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
  56590. 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
  56591. 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
  56592. 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
  56593. 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
  56594. 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
  56595. 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
  56596. 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
  56597. 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
  56598. 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
  56599. 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
  56600. 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
  56601. 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
  56602. 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
  56603. 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
  56604. 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
  56605. 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
  56606. 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
  56607. 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
  56608. 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
  56609. 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
  56610. 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
  56611. 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
  56612. 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
  56613. 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
  56614. 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
  56615. 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
  56616. 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
  56617. 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
  56618. 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
  56619. 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
  56620. 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
  56621. 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
  56622. 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
  56623. 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
  56624. 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
  56625. 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
  56626. 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
  56627. 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
  56628. 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
  56629. 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
  56630. 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
  56631. 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
  56632. 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
  56633. 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
  56634. 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
  56635. 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
  56636. 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
  56637. 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
  56638. 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
  56639. 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
  56640. 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
  56641. 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
  56642. 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
  56643. 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
  56644. 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
  56645. 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
  56646. 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
  56647. 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
  56648. 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6])
  56649. ];
  56650. this.P = new Uint32Array([
  56651. 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
  56652. 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
  56653. 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
  56654. 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
  56655. 0x9216d5d9, 0x8979fb1b]);
  56656. };
  56657. function F(S, x8, i) {
  56658. return (((S[0][x8[i+3]] +
  56659. S[1][x8[i+2]]) ^
  56660. S[2][x8[i+1]]) +
  56661. S[3][x8[i]]);
  56662. };
  56663. Blowfish.prototype.encipher = function(x, x8) {
  56664. if (x8 === undefined) {
  56665. x8 = new Uint8Array(x.buffer);
  56666. if (x.byteOffset !== 0)
  56667. x8 = x8.subarray(x.byteOffset);
  56668. }
  56669. x[0] ^= this.P[0];
  56670. for (var i = 1; i < 16; i += 2) {
  56671. x[1] ^= F(this.S, x8, 0) ^ this.P[i];
  56672. x[0] ^= F(this.S, x8, 4) ^ this.P[i+1];
  56673. }
  56674. var t = x[0];
  56675. x[0] = x[1] ^ this.P[17];
  56676. x[1] = t;
  56677. };
  56678. Blowfish.prototype.decipher = function(x) {
  56679. var x8 = new Uint8Array(x.buffer);
  56680. if (x.byteOffset !== 0)
  56681. x8 = x8.subarray(x.byteOffset);
  56682. x[0] ^= this.P[17];
  56683. for (var i = 16; i > 0; i -= 2) {
  56684. x[1] ^= F(this.S, x8, 0) ^ this.P[i];
  56685. x[0] ^= F(this.S, x8, 4) ^ this.P[i-1];
  56686. }
  56687. var t = x[0];
  56688. x[0] = x[1] ^ this.P[0];
  56689. x[1] = t;
  56690. };
  56691. function stream2word(data, databytes){
  56692. var i, temp = 0;
  56693. for (i = 0; i < 4; i++, BLF_J++) {
  56694. if (BLF_J >= databytes) BLF_J = 0;
  56695. temp = (temp << 8) | data[BLF_J];
  56696. }
  56697. return temp;
  56698. };
  56699. Blowfish.prototype.expand0state = function(key, keybytes) {
  56700. var d = new Uint32Array(2), i, k;
  56701. var d8 = new Uint8Array(d.buffer);
  56702. for (i = 0, BLF_J = 0; i < 18; i++) {
  56703. this.P[i] ^= stream2word(key, keybytes);
  56704. }
  56705. BLF_J = 0;
  56706. for (i = 0; i < 18; i += 2) {
  56707. this.encipher(d, d8);
  56708. this.P[i] = d[0];
  56709. this.P[i+1] = d[1];
  56710. }
  56711. for (i = 0; i < 4; i++) {
  56712. for (k = 0; k < 256; k += 2) {
  56713. this.encipher(d, d8);
  56714. this.S[i][k] = d[0];
  56715. this.S[i][k+1] = d[1];
  56716. }
  56717. }
  56718. };
  56719. Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) {
  56720. var d = new Uint32Array(2), i, k;
  56721. for (i = 0, BLF_J = 0; i < 18; i++) {
  56722. this.P[i] ^= stream2word(key, keybytes);
  56723. }
  56724. for (i = 0, BLF_J = 0; i < 18; i += 2) {
  56725. d[0] ^= stream2word(data, databytes);
  56726. d[1] ^= stream2word(data, databytes);
  56727. this.encipher(d);
  56728. this.P[i] = d[0];
  56729. this.P[i+1] = d[1];
  56730. }
  56731. for (i = 0; i < 4; i++) {
  56732. for (k = 0; k < 256; k += 2) {
  56733. d[0] ^= stream2word(data, databytes);
  56734. d[1] ^= stream2word(data, databytes);
  56735. this.encipher(d);
  56736. this.S[i][k] = d[0];
  56737. this.S[i][k+1] = d[1];
  56738. }
  56739. }
  56740. BLF_J = 0;
  56741. };
  56742. Blowfish.prototype.enc = function(data, blocks) {
  56743. for (var i = 0; i < blocks; i++) {
  56744. this.encipher(data.subarray(i*2));
  56745. }
  56746. };
  56747. Blowfish.prototype.dec = function(data, blocks) {
  56748. for (var i = 0; i < blocks; i++) {
  56749. this.decipher(data.subarray(i*2));
  56750. }
  56751. };
  56752. var BCRYPT_BLOCKS = 8,
  56753. BCRYPT_HASHSIZE = 32;
  56754. function bcrypt_hash(sha2pass, sha2salt, out) {
  56755. var state = new Blowfish(),
  56756. cdata = new Uint32Array(BCRYPT_BLOCKS), i,
  56757. ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,
  56758. 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,
  56759. 105,116,101]); //"OxychromaticBlowfishSwatDynamite"
  56760. state.expandstate(sha2salt, 64, sha2pass, 64);
  56761. for (i = 0; i < 64; i++) {
  56762. state.expand0state(sha2salt, 64);
  56763. state.expand0state(sha2pass, 64);
  56764. }
  56765. for (i = 0; i < BCRYPT_BLOCKS; i++)
  56766. cdata[i] = stream2word(ciphertext, ciphertext.byteLength);
  56767. for (i = 0; i < 64; i++)
  56768. state.enc(cdata, cdata.byteLength / 8);
  56769. for (i = 0; i < BCRYPT_BLOCKS; i++) {
  56770. out[4*i+3] = cdata[i] >>> 24;
  56771. out[4*i+2] = cdata[i] >>> 16;
  56772. out[4*i+1] = cdata[i] >>> 8;
  56773. out[4*i+0] = cdata[i];
  56774. }
  56775. };
  56776. function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) {
  56777. var sha2pass = new Uint8Array(64),
  56778. sha2salt = new Uint8Array(64),
  56779. out = new Uint8Array(BCRYPT_HASHSIZE),
  56780. tmpout = new Uint8Array(BCRYPT_HASHSIZE),
  56781. countsalt = new Uint8Array(saltlen+4),
  56782. i, j, amt, stride, dest, count,
  56783. origkeylen = keylen;
  56784. if (rounds < 1)
  56785. return -1;
  56786. if (passlen === 0 || saltlen === 0 || keylen === 0 ||
  56787. keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20))
  56788. return -1;
  56789. stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength);
  56790. amt = Math.floor((keylen + stride - 1) / stride);
  56791. for (i = 0; i < saltlen; i++)
  56792. countsalt[i] = salt[i];
  56793. crypto_hash_sha512(sha2pass, pass, passlen);
  56794. for (count = 1; keylen > 0; count++) {
  56795. countsalt[saltlen+0] = count >>> 24;
  56796. countsalt[saltlen+1] = count >>> 16;
  56797. countsalt[saltlen+2] = count >>> 8;
  56798. countsalt[saltlen+3] = count;
  56799. crypto_hash_sha512(sha2salt, countsalt, saltlen + 4);
  56800. bcrypt_hash(sha2pass, sha2salt, tmpout);
  56801. for (i = out.byteLength; i--;)
  56802. out[i] = tmpout[i];
  56803. for (i = 1; i < rounds; i++) {
  56804. crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength);
  56805. bcrypt_hash(sha2pass, sha2salt, tmpout);
  56806. for (j = 0; j < out.byteLength; j++)
  56807. out[j] ^= tmpout[j];
  56808. }
  56809. amt = Math.min(amt, keylen);
  56810. for (i = 0; i < amt; i++) {
  56811. dest = i * stride + (count - 1);
  56812. if (dest >= origkeylen)
  56813. break;
  56814. key[dest] = out[i];
  56815. }
  56816. keylen -= i;
  56817. }
  56818. return 0;
  56819. };
  56820. module.exports = {
  56821. BLOCKS: BCRYPT_BLOCKS,
  56822. HASHSIZE: BCRYPT_HASHSIZE,
  56823. hash: bcrypt_hash,
  56824. pbkdf: bcrypt_pbkdf
  56825. };
  56826. /***/ }),
  56827. /* 318 */
  56828. /***/ (function(module, exports, __webpack_require__) {
  56829. var bufferFill = __webpack_require__(559)
  56830. var allocUnsafe = __webpack_require__(558)
  56831. module.exports = function alloc (size, fill, encoding) {
  56832. if (typeof size !== 'number') {
  56833. throw new TypeError('"size" argument must be a number')
  56834. }
  56835. if (size < 0) {
  56836. throw new RangeError('"size" argument must not be negative')
  56837. }
  56838. if (Buffer.alloc) {
  56839. return Buffer.alloc(size, fill, encoding)
  56840. }
  56841. var buffer = allocUnsafe(size)
  56842. if (size === 0) {
  56843. return buffer
  56844. }
  56845. if (fill === undefined) {
  56846. return bufferFill(buffer, 0)
  56847. }
  56848. if (typeof encoding !== 'string') {
  56849. encoding = undefined
  56850. }
  56851. return bufferFill(buffer, fill, encoding)
  56852. }
  56853. /***/ }),
  56854. /* 319 */
  56855. /***/ (function(module, exports, __webpack_require__) {
  56856. "use strict";
  56857. const restoreCursor = __webpack_require__(890);
  56858. let hidden = false;
  56859. exports.show = stream => {
  56860. const s = stream || process.stderr;
  56861. if (!s.isTTY) {
  56862. return;
  56863. }
  56864. hidden = false;
  56865. s.write('\u001b[?25h');
  56866. };
  56867. exports.hide = stream => {
  56868. const s = stream || process.stderr;
  56869. if (!s.isTTY) {
  56870. return;
  56871. }
  56872. restoreCursor();
  56873. hidden = true;
  56874. s.write('\u001b[?25l');
  56875. };
  56876. exports.toggle = (force, stream) => {
  56877. if (force !== undefined) {
  56878. hidden = force;
  56879. }
  56880. if (hidden) {
  56881. exports.show(stream);
  56882. } else {
  56883. exports.hide(stream);
  56884. }
  56885. };
  56886. /***/ }),
  56887. /* 320 */
  56888. /***/ (function(module, exports, __webpack_require__) {
  56889. var objectAssign = __webpack_require__(243);
  56890. var stringWidth = __webpack_require__(1017);
  56891. function codeRegex(capture){
  56892. return capture ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g
  56893. }
  56894. function strlen(str){
  56895. var code = codeRegex();
  56896. var stripped = ("" + str).replace(code,'');
  56897. var split = stripped.split("\n");
  56898. return split.reduce(function (memo, s) { return (stringWidth(s) > memo) ? stringWidth(s) : memo }, 0);
  56899. }
  56900. function repeat(str,times){
  56901. return Array(times + 1).join(str);
  56902. }
  56903. function pad(str, len, pad, dir) {
  56904. var length = strlen(str);
  56905. if (len + 1 >= length) {
  56906. var padlen = len - length;
  56907. switch (dir) {
  56908. case 'right':
  56909. str = repeat(pad, padlen) + str;
  56910. break;
  56911. case 'center':
  56912. var right = Math.ceil((padlen) / 2);
  56913. var left = padlen - right;
  56914. str = repeat(pad, left) + str + repeat(pad, right);
  56915. break;
  56916. default :
  56917. str = str + repeat(pad,padlen);
  56918. break;
  56919. }
  56920. }
  56921. return str;
  56922. }
  56923. var codeCache = {};
  56924. function addToCodeCache(name,on,off){
  56925. on = '\u001b[' + on + 'm';
  56926. off = '\u001b[' + off + 'm';
  56927. codeCache[on] = {set:name,to:true};
  56928. codeCache[off] = {set:name,to:false};
  56929. codeCache[name] = {on:on,off:off};
  56930. }
  56931. //https://github.com/Marak/colors.js/blob/master/lib/styles.js
  56932. addToCodeCache('bold', 1, 22);
  56933. addToCodeCache('italics', 3, 23);
  56934. addToCodeCache('underline', 4, 24);
  56935. addToCodeCache('inverse', 7, 27);
  56936. addToCodeCache('strikethrough', 9, 29);
  56937. function updateState(state, controlChars){
  56938. var controlCode = controlChars[1] ? parseInt(controlChars[1].split(';')[0]) : 0;
  56939. if ( (controlCode >= 30 && controlCode <= 39)
  56940. || (controlCode >= 90 && controlCode <= 97)
  56941. ) {
  56942. state.lastForegroundAdded = controlChars[0];
  56943. return;
  56944. }
  56945. if ( (controlCode >= 40 && controlCode <= 49)
  56946. || (controlCode >= 100 && controlCode <= 107)
  56947. ) {
  56948. state.lastBackgroundAdded = controlChars[0];
  56949. return;
  56950. }
  56951. if (controlCode === 0) {
  56952. for (var i in state) {
  56953. /* istanbul ignore else */
  56954. if (state.hasOwnProperty(i)) {
  56955. delete state[i];
  56956. }
  56957. }
  56958. return;
  56959. }
  56960. var info = codeCache[controlChars[0]];
  56961. if (info) {
  56962. state[info.set] = info.to;
  56963. }
  56964. }
  56965. function readState(line){
  56966. var code = codeRegex(true);
  56967. var controlChars = code.exec(line);
  56968. var state = {};
  56969. while(controlChars !== null){
  56970. updateState(state, controlChars);
  56971. controlChars = code.exec(line);
  56972. }
  56973. return state;
  56974. }
  56975. function unwindState(state,ret){
  56976. var lastBackgroundAdded = state.lastBackgroundAdded;
  56977. var lastForegroundAdded = state.lastForegroundAdded;
  56978. delete state.lastBackgroundAdded;
  56979. delete state.lastForegroundAdded;
  56980. Object.keys(state).forEach(function(key){
  56981. if(state[key]){
  56982. ret += codeCache[key].off;
  56983. }
  56984. });
  56985. if(lastBackgroundAdded && (lastBackgroundAdded != '\u001b[49m')){
  56986. ret += '\u001b[49m';
  56987. }
  56988. if(lastForegroundAdded && (lastForegroundAdded != '\u001b[39m')){
  56989. ret += '\u001b[39m';
  56990. }
  56991. return ret;
  56992. }
  56993. function rewindState(state,ret){
  56994. var lastBackgroundAdded = state.lastBackgroundAdded;
  56995. var lastForegroundAdded = state.lastForegroundAdded;
  56996. delete state.lastBackgroundAdded;
  56997. delete state.lastForegroundAdded;
  56998. Object.keys(state).forEach(function(key){
  56999. if(state[key]){
  57000. ret = codeCache[key].on + ret;
  57001. }
  57002. });
  57003. if(lastBackgroundAdded && (lastBackgroundAdded != '\u001b[49m')){
  57004. ret = lastBackgroundAdded + ret;
  57005. }
  57006. if(lastForegroundAdded && (lastForegroundAdded != '\u001b[39m')){
  57007. ret = lastForegroundAdded + ret;
  57008. }
  57009. return ret;
  57010. }
  57011. function truncateWidth(str, desiredLength){
  57012. if (str.length === strlen(str)) {
  57013. return str.substr(0, desiredLength);
  57014. }
  57015. while (strlen(str) > desiredLength){
  57016. str = str.slice(0, -1);
  57017. }
  57018. return str;
  57019. }
  57020. function truncateWidthWithAnsi(str, desiredLength){
  57021. var code = codeRegex(true);
  57022. var split = str.split(codeRegex());
  57023. var splitIndex = 0;
  57024. var retLen = 0;
  57025. var ret = '';
  57026. var myArray;
  57027. var state = {};
  57028. while(retLen < desiredLength){
  57029. myArray = code.exec(str);
  57030. var toAdd = split[splitIndex];
  57031. splitIndex++;
  57032. if (retLen + strlen(toAdd) > desiredLength){
  57033. toAdd = truncateWidth(toAdd, desiredLength - retLen);
  57034. }
  57035. ret += toAdd;
  57036. retLen += strlen(toAdd);
  57037. if(retLen < desiredLength){
  57038. if (!myArray) { break; } // full-width chars may cause a whitespace which cannot be filled
  57039. ret += myArray[0];
  57040. updateState(state,myArray);
  57041. }
  57042. }
  57043. return unwindState(state,ret);
  57044. }
  57045. function truncate(str, desiredLength, truncateChar){
  57046. truncateChar = truncateChar || '…';
  57047. var lengthOfStr = strlen(str);
  57048. if(lengthOfStr <= desiredLength){
  57049. return str;
  57050. }
  57051. desiredLength -= strlen(truncateChar);
  57052. var ret = truncateWidthWithAnsi(str, desiredLength);
  57053. return ret + truncateChar;
  57054. }
  57055. function defaultOptions(){
  57056. return{
  57057. chars: {
  57058. 'top': '─'
  57059. , 'top-mid': '┬'
  57060. , 'top-left': '┌'
  57061. , 'top-right': '┐'
  57062. , 'bottom': '─'
  57063. , 'bottom-mid': '┴'
  57064. , 'bottom-left': '└'
  57065. , 'bottom-right': '┘'
  57066. , 'left': '│'
  57067. , 'left-mid': '├'
  57068. , 'mid': '─'
  57069. , 'mid-mid': '┼'
  57070. , 'right': '│'
  57071. , 'right-mid': '┤'
  57072. , 'middle': '│'
  57073. }
  57074. , truncate: '…'
  57075. , colWidths: []
  57076. , rowHeights: []
  57077. , colAligns: []
  57078. , rowAligns: []
  57079. , style: {
  57080. 'padding-left': 1
  57081. , 'padding-right': 1
  57082. , head: ['red']
  57083. , border: ['grey']
  57084. , compact : false
  57085. }
  57086. , head: []
  57087. };
  57088. }
  57089. function mergeOptions(options,defaults){
  57090. options = options || {};
  57091. defaults = defaults || defaultOptions();
  57092. var ret = objectAssign({}, defaults, options);
  57093. ret.chars = objectAssign({}, defaults.chars, options.chars);
  57094. ret.style = objectAssign({}, defaults.style, options.style);
  57095. return ret;
  57096. }
  57097. function wordWrap(maxLength,input){
  57098. var lines = [];
  57099. var split = input.split(/(\s+)/g);
  57100. var line = [];
  57101. var lineLength = 0;
  57102. var whitespace;
  57103. for (var i = 0; i < split.length; i += 2) {
  57104. var word = split[i];
  57105. var newLength = lineLength + strlen(word);
  57106. if (lineLength > 0 && whitespace) {
  57107. newLength += whitespace.length;
  57108. }
  57109. if(newLength > maxLength){
  57110. if(lineLength !== 0){
  57111. lines.push(line.join(''));
  57112. }
  57113. line = [word];
  57114. lineLength = strlen(word);
  57115. } else {
  57116. line.push(whitespace || '', word);
  57117. lineLength = newLength;
  57118. }
  57119. whitespace = split[i+1];
  57120. }
  57121. if(lineLength){
  57122. lines.push(line.join(''));
  57123. }
  57124. return lines;
  57125. }
  57126. function multiLineWordWrap(maxLength, input){
  57127. var output = [];
  57128. input = input.split('\n');
  57129. for(var i = 0; i < input.length; i++){
  57130. output.push.apply(output,wordWrap(maxLength,input[i]));
  57131. }
  57132. return output;
  57133. }
  57134. function colorizeLines(input){
  57135. var state = {};
  57136. var output = [];
  57137. for(var i = 0; i < input.length; i++){
  57138. var line = rewindState(state,input[i]) ;
  57139. state = readState(line);
  57140. var temp = objectAssign({},state);
  57141. output.push(unwindState(temp,line));
  57142. }
  57143. return output;
  57144. }
  57145. module.exports = {
  57146. strlen:strlen,
  57147. repeat:repeat,
  57148. pad:pad,
  57149. truncate:truncate,
  57150. mergeOptions:mergeOptions,
  57151. wordWrap:multiLineWordWrap,
  57152. colorizeLines:colorizeLines
  57153. };
  57154. /***/ }),
  57155. /* 321 */
  57156. /***/ (function(module, exports) {
  57157. /**
  57158. * slice() reference.
  57159. */
  57160. var slice = Array.prototype.slice;
  57161. /**
  57162. * Expose `co`.
  57163. */
  57164. module.exports = co['default'] = co.co = co;
  57165. /**
  57166. * Wrap the given generator `fn` into a
  57167. * function that returns a promise.
  57168. * This is a separate function so that
  57169. * every `co()` call doesn't create a new,
  57170. * unnecessary closure.
  57171. *
  57172. * @param {GeneratorFunction} fn
  57173. * @return {Function}
  57174. * @api public
  57175. */
  57176. co.wrap = function (fn) {
  57177. createPromise.__generatorFunction__ = fn;
  57178. return createPromise;
  57179. function createPromise() {
  57180. return co.call(this, fn.apply(this, arguments));
  57181. }
  57182. };
  57183. /**
  57184. * Execute the generator function or a generator
  57185. * and return a promise.
  57186. *
  57187. * @param {Function} fn
  57188. * @return {Promise}
  57189. * @api public
  57190. */
  57191. function co(gen) {
  57192. var ctx = this;
  57193. var args = slice.call(arguments, 1)
  57194. // we wrap everything in a promise to avoid promise chaining,
  57195. // which leads to memory leak errors.
  57196. // see https://github.com/tj/co/issues/180
  57197. return new Promise(function(resolve, reject) {
  57198. if (typeof gen === 'function') gen = gen.apply(ctx, args);
  57199. if (!gen || typeof gen.next !== 'function') return resolve(gen);
  57200. onFulfilled();
  57201. /**
  57202. * @param {Mixed} res
  57203. * @return {Promise}
  57204. * @api private
  57205. */
  57206. function onFulfilled(res) {
  57207. var ret;
  57208. try {
  57209. ret = gen.next(res);
  57210. } catch (e) {
  57211. return reject(e);
  57212. }
  57213. next(ret);
  57214. }
  57215. /**
  57216. * @param {Error} err
  57217. * @return {Promise}
  57218. * @api private
  57219. */
  57220. function onRejected(err) {
  57221. var ret;
  57222. try {
  57223. ret = gen.throw(err);
  57224. } catch (e) {
  57225. return reject(e);
  57226. }
  57227. next(ret);
  57228. }
  57229. /**
  57230. * Get the next value in the generator,
  57231. * return a promise.
  57232. *
  57233. * @param {Object} ret
  57234. * @return {Promise}
  57235. * @api private
  57236. */
  57237. function next(ret) {
  57238. if (ret.done) return resolve(ret.value);
  57239. var value = toPromise.call(ctx, ret.value);
  57240. if (value && isPromise(value)) return value.then(onFulfilled, onRejected);
  57241. return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, '
  57242. + 'but the following object was passed: "' + String(ret.value) + '"'));
  57243. }
  57244. });
  57245. }
  57246. /**
  57247. * Convert a `yield`ed value into a promise.
  57248. *
  57249. * @param {Mixed} obj
  57250. * @return {Promise}
  57251. * @api private
  57252. */
  57253. function toPromise(obj) {
  57254. if (!obj) return obj;
  57255. if (isPromise(obj)) return obj;
  57256. if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj);
  57257. if ('function' == typeof obj) return thunkToPromise.call(this, obj);
  57258. if (Array.isArray(obj)) return arrayToPromise.call(this, obj);
  57259. if (isObject(obj)) return objectToPromise.call(this, obj);
  57260. return obj;
  57261. }
  57262. /**
  57263. * Convert a thunk to a promise.
  57264. *
  57265. * @param {Function}
  57266. * @return {Promise}
  57267. * @api private
  57268. */
  57269. function thunkToPromise(fn) {
  57270. var ctx = this;
  57271. return new Promise(function (resolve, reject) {
  57272. fn.call(ctx, function (err, res) {
  57273. if (err) return reject(err);
  57274. if (arguments.length > 2) res = slice.call(arguments, 1);
  57275. resolve(res);
  57276. });
  57277. });
  57278. }
  57279. /**
  57280. * Convert an array of "yieldables" to a promise.
  57281. * Uses `Promise.all()` internally.
  57282. *
  57283. * @param {Array} obj
  57284. * @return {Promise}
  57285. * @api private
  57286. */
  57287. function arrayToPromise(obj) {
  57288. return Promise.all(obj.map(toPromise, this));
  57289. }
  57290. /**
  57291. * Convert an object of "yieldables" to a promise.
  57292. * Uses `Promise.all()` internally.
  57293. *
  57294. * @param {Object} obj
  57295. * @return {Promise}
  57296. * @api private
  57297. */
  57298. function objectToPromise(obj){
  57299. var results = new obj.constructor();
  57300. var keys = Object.keys(obj);
  57301. var promises = [];
  57302. for (var i = 0; i < keys.length; i++) {
  57303. var key = keys[i];
  57304. var promise = toPromise.call(this, obj[key]);
  57305. if (promise && isPromise(promise)) defer(promise, key);
  57306. else results[key] = obj[key];
  57307. }
  57308. return Promise.all(promises).then(function () {
  57309. return results;
  57310. });
  57311. function defer(promise, key) {
  57312. // predefine the key in the result
  57313. results[key] = undefined;
  57314. promises.push(promise.then(function (res) {
  57315. results[key] = res;
  57316. }));
  57317. }
  57318. }
  57319. /**
  57320. * Check if `obj` is a promise.
  57321. *
  57322. * @param {Object} obj
  57323. * @return {Boolean}
  57324. * @api private
  57325. */
  57326. function isPromise(obj) {
  57327. return 'function' == typeof obj.then;
  57328. }
  57329. /**
  57330. * Check if `obj` is a generator.
  57331. *
  57332. * @param {Mixed} obj
  57333. * @return {Boolean}
  57334. * @api private
  57335. */
  57336. function isGenerator(obj) {
  57337. return 'function' == typeof obj.next && 'function' == typeof obj.throw;
  57338. }
  57339. /**
  57340. * Check if `obj` is a generator function.
  57341. *
  57342. * @param {Mixed} obj
  57343. * @return {Boolean}
  57344. * @api private
  57345. */
  57346. function isGeneratorFunction(obj) {
  57347. var constructor = obj.constructor;
  57348. if (!constructor) return false;
  57349. if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true;
  57350. return isGenerator(constructor.prototype);
  57351. }
  57352. /**
  57353. * Check for plain object.
  57354. *
  57355. * @param {Mixed} val
  57356. * @return {Boolean}
  57357. * @api private
  57358. */
  57359. function isObject(val) {
  57360. return Object == val.constructor;
  57361. }
  57362. /***/ }),
  57363. /* 322 */
  57364. /***/ (function(module, exports, __webpack_require__) {
  57365. /* MIT license */
  57366. var cssKeywords = __webpack_require__(576);
  57367. // NOTE: conversions should only return primitive values (i.e. arrays, or
  57368. // values that give correct `typeof` results).
  57369. // do not use box values types (i.e. Number(), String(), etc.)
  57370. var reverseKeywords = {};
  57371. for (var key in cssKeywords) {
  57372. if (cssKeywords.hasOwnProperty(key)) {
  57373. reverseKeywords[cssKeywords[key]] = key;
  57374. }
  57375. }
  57376. var convert = module.exports = {
  57377. rgb: {channels: 3, labels: 'rgb'},
  57378. hsl: {channels: 3, labels: 'hsl'},
  57379. hsv: {channels: 3, labels: 'hsv'},
  57380. hwb: {channels: 3, labels: 'hwb'},
  57381. cmyk: {channels: 4, labels: 'cmyk'},
  57382. xyz: {channels: 3, labels: 'xyz'},
  57383. lab: {channels: 3, labels: 'lab'},
  57384. lch: {channels: 3, labels: 'lch'},
  57385. hex: {channels: 1, labels: ['hex']},
  57386. keyword: {channels: 1, labels: ['keyword']},
  57387. ansi16: {channels: 1, labels: ['ansi16']},
  57388. ansi256: {channels: 1, labels: ['ansi256']},
  57389. hcg: {channels: 3, labels: ['h', 'c', 'g']},
  57390. apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
  57391. gray: {channels: 1, labels: ['gray']}
  57392. };
  57393. // hide .channels and .labels properties
  57394. for (var model in convert) {
  57395. if (convert.hasOwnProperty(model)) {
  57396. if (!('channels' in convert[model])) {
  57397. throw new Error('missing channels property: ' + model);
  57398. }
  57399. if (!('labels' in convert[model])) {
  57400. throw new Error('missing channel labels property: ' + model);
  57401. }
  57402. if (convert[model].labels.length !== convert[model].channels) {
  57403. throw new Error('channel and label counts mismatch: ' + model);
  57404. }
  57405. var channels = convert[model].channels;
  57406. var labels = convert[model].labels;
  57407. delete convert[model].channels;
  57408. delete convert[model].labels;
  57409. Object.defineProperty(convert[model], 'channels', {value: channels});
  57410. Object.defineProperty(convert[model], 'labels', {value: labels});
  57411. }
  57412. }
  57413. convert.rgb.hsl = function (rgb) {
  57414. var r = rgb[0] / 255;
  57415. var g = rgb[1] / 255;
  57416. var b = rgb[2] / 255;
  57417. var min = Math.min(r, g, b);
  57418. var max = Math.max(r, g, b);
  57419. var delta = max - min;
  57420. var h;
  57421. var s;
  57422. var l;
  57423. if (max === min) {
  57424. h = 0;
  57425. } else if (r === max) {
  57426. h = (g - b) / delta;
  57427. } else if (g === max) {
  57428. h = 2 + (b - r) / delta;
  57429. } else if (b === max) {
  57430. h = 4 + (r - g) / delta;
  57431. }
  57432. h = Math.min(h * 60, 360);
  57433. if (h < 0) {
  57434. h += 360;
  57435. }
  57436. l = (min + max) / 2;
  57437. if (max === min) {
  57438. s = 0;
  57439. } else if (l <= 0.5) {
  57440. s = delta / (max + min);
  57441. } else {
  57442. s = delta / (2 - max - min);
  57443. }
  57444. return [h, s * 100, l * 100];
  57445. };
  57446. convert.rgb.hsv = function (rgb) {
  57447. var rdif;
  57448. var gdif;
  57449. var bdif;
  57450. var h;
  57451. var s;
  57452. var r = rgb[0] / 255;
  57453. var g = rgb[1] / 255;
  57454. var b = rgb[2] / 255;
  57455. var v = Math.max(r, g, b);
  57456. var diff = v - Math.min(r, g, b);
  57457. var diffc = function (c) {
  57458. return (v - c) / 6 / diff + 1 / 2;
  57459. };
  57460. if (diff === 0) {
  57461. h = s = 0;
  57462. } else {
  57463. s = diff / v;
  57464. rdif = diffc(r);
  57465. gdif = diffc(g);
  57466. bdif = diffc(b);
  57467. if (r === v) {
  57468. h = bdif - gdif;
  57469. } else if (g === v) {
  57470. h = (1 / 3) + rdif - bdif;
  57471. } else if (b === v) {
  57472. h = (2 / 3) + gdif - rdif;
  57473. }
  57474. if (h < 0) {
  57475. h += 1;
  57476. } else if (h > 1) {
  57477. h -= 1;
  57478. }
  57479. }
  57480. return [
  57481. h * 360,
  57482. s * 100,
  57483. v * 100
  57484. ];
  57485. };
  57486. convert.rgb.hwb = function (rgb) {
  57487. var r = rgb[0];
  57488. var g = rgb[1];
  57489. var b = rgb[2];
  57490. var h = convert.rgb.hsl(rgb)[0];
  57491. var w = 1 / 255 * Math.min(r, Math.min(g, b));
  57492. b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
  57493. return [h, w * 100, b * 100];
  57494. };
  57495. convert.rgb.cmyk = function (rgb) {
  57496. var r = rgb[0] / 255;
  57497. var g = rgb[1] / 255;
  57498. var b = rgb[2] / 255;
  57499. var c;
  57500. var m;
  57501. var y;
  57502. var k;
  57503. k = Math.min(1 - r, 1 - g, 1 - b);
  57504. c = (1 - r - k) / (1 - k) || 0;
  57505. m = (1 - g - k) / (1 - k) || 0;
  57506. y = (1 - b - k) / (1 - k) || 0;
  57507. return [c * 100, m * 100, y * 100, k * 100];
  57508. };
  57509. /**
  57510. * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
  57511. * */
  57512. function comparativeDistance(x, y) {
  57513. return (
  57514. Math.pow(x[0] - y[0], 2) +
  57515. Math.pow(x[1] - y[1], 2) +
  57516. Math.pow(x[2] - y[2], 2)
  57517. );
  57518. }
  57519. convert.rgb.keyword = function (rgb) {
  57520. var reversed = reverseKeywords[rgb];
  57521. if (reversed) {
  57522. return reversed;
  57523. }
  57524. var currentClosestDistance = Infinity;
  57525. var currentClosestKeyword;
  57526. for (var keyword in cssKeywords) {
  57527. if (cssKeywords.hasOwnProperty(keyword)) {
  57528. var value = cssKeywords[keyword];
  57529. // Compute comparative distance
  57530. var distance = comparativeDistance(rgb, value);
  57531. // Check if its less, if so set as closest
  57532. if (distance < currentClosestDistance) {
  57533. currentClosestDistance = distance;
  57534. currentClosestKeyword = keyword;
  57535. }
  57536. }
  57537. }
  57538. return currentClosestKeyword;
  57539. };
  57540. convert.keyword.rgb = function (keyword) {
  57541. return cssKeywords[keyword];
  57542. };
  57543. convert.rgb.xyz = function (rgb) {
  57544. var r = rgb[0] / 255;
  57545. var g = rgb[1] / 255;
  57546. var b = rgb[2] / 255;
  57547. // assume sRGB
  57548. r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
  57549. g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
  57550. b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
  57551. var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
  57552. var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
  57553. var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
  57554. return [x * 100, y * 100, z * 100];
  57555. };
  57556. convert.rgb.lab = function (rgb) {
  57557. var xyz = convert.rgb.xyz(rgb);
  57558. var x = xyz[0];
  57559. var y = xyz[1];
  57560. var z = xyz[2];
  57561. var l;
  57562. var a;
  57563. var b;
  57564. x /= 95.047;
  57565. y /= 100;
  57566. z /= 108.883;
  57567. x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
  57568. y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
  57569. z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
  57570. l = (116 * y) - 16;
  57571. a = 500 * (x - y);
  57572. b = 200 * (y - z);
  57573. return [l, a, b];
  57574. };
  57575. convert.hsl.rgb = function (hsl) {
  57576. var h = hsl[0] / 360;
  57577. var s = hsl[1] / 100;
  57578. var l = hsl[2] / 100;
  57579. var t1;
  57580. var t2;
  57581. var t3;
  57582. var rgb;
  57583. var val;
  57584. if (s === 0) {
  57585. val = l * 255;
  57586. return [val, val, val];
  57587. }
  57588. if (l < 0.5) {
  57589. t2 = l * (1 + s);
  57590. } else {
  57591. t2 = l + s - l * s;
  57592. }
  57593. t1 = 2 * l - t2;
  57594. rgb = [0, 0, 0];
  57595. for (var i = 0; i < 3; i++) {
  57596. t3 = h + 1 / 3 * -(i - 1);
  57597. if (t3 < 0) {
  57598. t3++;
  57599. }
  57600. if (t3 > 1) {
  57601. t3--;
  57602. }
  57603. if (6 * t3 < 1) {
  57604. val = t1 + (t2 - t1) * 6 * t3;
  57605. } else if (2 * t3 < 1) {
  57606. val = t2;
  57607. } else if (3 * t3 < 2) {
  57608. val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
  57609. } else {
  57610. val = t1;
  57611. }
  57612. rgb[i] = val * 255;
  57613. }
  57614. return rgb;
  57615. };
  57616. convert.hsl.hsv = function (hsl) {
  57617. var h = hsl[0];
  57618. var s = hsl[1] / 100;
  57619. var l = hsl[2] / 100;
  57620. var smin = s;
  57621. var lmin = Math.max(l, 0.01);
  57622. var sv;
  57623. var v;
  57624. l *= 2;
  57625. s *= (l <= 1) ? l : 2 - l;
  57626. smin *= lmin <= 1 ? lmin : 2 - lmin;
  57627. v = (l + s) / 2;
  57628. sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
  57629. return [h, sv * 100, v * 100];
  57630. };
  57631. convert.hsv.rgb = function (hsv) {
  57632. var h = hsv[0] / 60;
  57633. var s = hsv[1] / 100;
  57634. var v = hsv[2] / 100;
  57635. var hi = Math.floor(h) % 6;
  57636. var f = h - Math.floor(h);
  57637. var p = 255 * v * (1 - s);
  57638. var q = 255 * v * (1 - (s * f));
  57639. var t = 255 * v * (1 - (s * (1 - f)));
  57640. v *= 255;
  57641. switch (hi) {
  57642. case 0:
  57643. return [v, t, p];
  57644. case 1:
  57645. return [q, v, p];
  57646. case 2:
  57647. return [p, v, t];
  57648. case 3:
  57649. return [p, q, v];
  57650. case 4:
  57651. return [t, p, v];
  57652. case 5:
  57653. return [v, p, q];
  57654. }
  57655. };
  57656. convert.hsv.hsl = function (hsv) {
  57657. var h = hsv[0];
  57658. var s = hsv[1] / 100;
  57659. var v = hsv[2] / 100;
  57660. var vmin = Math.max(v, 0.01);
  57661. var lmin;
  57662. var sl;
  57663. var l;
  57664. l = (2 - s) * v;
  57665. lmin = (2 - s) * vmin;
  57666. sl = s * vmin;
  57667. sl /= (lmin <= 1) ? lmin : 2 - lmin;
  57668. sl = sl || 0;
  57669. l /= 2;
  57670. return [h, sl * 100, l * 100];
  57671. };
  57672. // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
  57673. convert.hwb.rgb = function (hwb) {
  57674. var h = hwb[0] / 360;
  57675. var wh = hwb[1] / 100;
  57676. var bl = hwb[2] / 100;
  57677. var ratio = wh + bl;
  57678. var i;
  57679. var v;
  57680. var f;
  57681. var n;
  57682. // wh + bl cant be > 1
  57683. if (ratio > 1) {
  57684. wh /= ratio;
  57685. bl /= ratio;
  57686. }
  57687. i = Math.floor(6 * h);
  57688. v = 1 - bl;
  57689. f = 6 * h - i;
  57690. if ((i & 0x01) !== 0) {
  57691. f = 1 - f;
  57692. }
  57693. n = wh + f * (v - wh); // linear interpolation
  57694. var r;
  57695. var g;
  57696. var b;
  57697. switch (i) {
  57698. default:
  57699. case 6:
  57700. case 0: r = v; g = n; b = wh; break;
  57701. case 1: r = n; g = v; b = wh; break;
  57702. case 2: r = wh; g = v; b = n; break;
  57703. case 3: r = wh; g = n; b = v; break;
  57704. case 4: r = n; g = wh; b = v; break;
  57705. case 5: r = v; g = wh; b = n; break;
  57706. }
  57707. return [r * 255, g * 255, b * 255];
  57708. };
  57709. convert.cmyk.rgb = function (cmyk) {
  57710. var c = cmyk[0] / 100;
  57711. var m = cmyk[1] / 100;
  57712. var y = cmyk[2] / 100;
  57713. var k = cmyk[3] / 100;
  57714. var r;
  57715. var g;
  57716. var b;
  57717. r = 1 - Math.min(1, c * (1 - k) + k);
  57718. g = 1 - Math.min(1, m * (1 - k) + k);
  57719. b = 1 - Math.min(1, y * (1 - k) + k);
  57720. return [r * 255, g * 255, b * 255];
  57721. };
  57722. convert.xyz.rgb = function (xyz) {
  57723. var x = xyz[0] / 100;
  57724. var y = xyz[1] / 100;
  57725. var z = xyz[2] / 100;
  57726. var r;
  57727. var g;
  57728. var b;
  57729. r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
  57730. g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
  57731. b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
  57732. // assume sRGB
  57733. r = r > 0.0031308
  57734. ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
  57735. : r * 12.92;
  57736. g = g > 0.0031308
  57737. ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
  57738. : g * 12.92;
  57739. b = b > 0.0031308
  57740. ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
  57741. : b * 12.92;
  57742. r = Math.min(Math.max(0, r), 1);
  57743. g = Math.min(Math.max(0, g), 1);
  57744. b = Math.min(Math.max(0, b), 1);
  57745. return [r * 255, g * 255, b * 255];
  57746. };
  57747. convert.xyz.lab = function (xyz) {
  57748. var x = xyz[0];
  57749. var y = xyz[1];
  57750. var z = xyz[2];
  57751. var l;
  57752. var a;
  57753. var b;
  57754. x /= 95.047;
  57755. y /= 100;
  57756. z /= 108.883;
  57757. x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
  57758. y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
  57759. z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
  57760. l = (116 * y) - 16;
  57761. a = 500 * (x - y);
  57762. b = 200 * (y - z);
  57763. return [l, a, b];
  57764. };
  57765. convert.lab.xyz = function (lab) {
  57766. var l = lab[0];
  57767. var a = lab[1];
  57768. var b = lab[2];
  57769. var x;
  57770. var y;
  57771. var z;
  57772. y = (l + 16) / 116;
  57773. x = a / 500 + y;
  57774. z = y - b / 200;
  57775. var y2 = Math.pow(y, 3);
  57776. var x2 = Math.pow(x, 3);
  57777. var z2 = Math.pow(z, 3);
  57778. y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
  57779. x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
  57780. z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
  57781. x *= 95.047;
  57782. y *= 100;
  57783. z *= 108.883;
  57784. return [x, y, z];
  57785. };
  57786. convert.lab.lch = function (lab) {
  57787. var l = lab[0];
  57788. var a = lab[1];
  57789. var b = lab[2];
  57790. var hr;
  57791. var h;
  57792. var c;
  57793. hr = Math.atan2(b, a);
  57794. h = hr * 360 / 2 / Math.PI;
  57795. if (h < 0) {
  57796. h += 360;
  57797. }
  57798. c = Math.sqrt(a * a + b * b);
  57799. return [l, c, h];
  57800. };
  57801. convert.lch.lab = function (lch) {
  57802. var l = lch[0];
  57803. var c = lch[1];
  57804. var h = lch[2];
  57805. var a;
  57806. var b;
  57807. var hr;
  57808. hr = h / 360 * 2 * Math.PI;
  57809. a = c * Math.cos(hr);
  57810. b = c * Math.sin(hr);
  57811. return [l, a, b];
  57812. };
  57813. convert.rgb.ansi16 = function (args) {
  57814. var r = args[0];
  57815. var g = args[1];
  57816. var b = args[2];
  57817. var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
  57818. value = Math.round(value / 50);
  57819. if (value === 0) {
  57820. return 30;
  57821. }
  57822. var ansi = 30
  57823. + ((Math.round(b / 255) << 2)
  57824. | (Math.round(g / 255) << 1)
  57825. | Math.round(r / 255));
  57826. if (value === 2) {
  57827. ansi += 60;
  57828. }
  57829. return ansi;
  57830. };
  57831. convert.hsv.ansi16 = function (args) {
  57832. // optimization here; we already know the value and don't need to get
  57833. // it converted for us.
  57834. return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
  57835. };
  57836. convert.rgb.ansi256 = function (args) {
  57837. var r = args[0];
  57838. var g = args[1];
  57839. var b = args[2];
  57840. // we use the extended greyscale palette here, with the exception of
  57841. // black and white. normal palette only has 4 greyscale shades.
  57842. if (r === g && g === b) {
  57843. if (r < 8) {
  57844. return 16;
  57845. }
  57846. if (r > 248) {
  57847. return 231;
  57848. }
  57849. return Math.round(((r - 8) / 247) * 24) + 232;
  57850. }
  57851. var ansi = 16
  57852. + (36 * Math.round(r / 255 * 5))
  57853. + (6 * Math.round(g / 255 * 5))
  57854. + Math.round(b / 255 * 5);
  57855. return ansi;
  57856. };
  57857. convert.ansi16.rgb = function (args) {
  57858. var color = args % 10;
  57859. // handle greyscale
  57860. if (color === 0 || color === 7) {
  57861. if (args > 50) {
  57862. color += 3.5;
  57863. }
  57864. color = color / 10.5 * 255;
  57865. return [color, color, color];
  57866. }
  57867. var mult = (~~(args > 50) + 1) * 0.5;
  57868. var r = ((color & 1) * mult) * 255;
  57869. var g = (((color >> 1) & 1) * mult) * 255;
  57870. var b = (((color >> 2) & 1) * mult) * 255;
  57871. return [r, g, b];
  57872. };
  57873. convert.ansi256.rgb = function (args) {
  57874. // handle greyscale
  57875. if (args >= 232) {
  57876. var c = (args - 232) * 10 + 8;
  57877. return [c, c, c];
  57878. }
  57879. args -= 16;
  57880. var rem;
  57881. var r = Math.floor(args / 36) / 5 * 255;
  57882. var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
  57883. var b = (rem % 6) / 5 * 255;
  57884. return [r, g, b];
  57885. };
  57886. convert.rgb.hex = function (args) {
  57887. var integer = ((Math.round(args[0]) & 0xFF) << 16)
  57888. + ((Math.round(args[1]) & 0xFF) << 8)
  57889. + (Math.round(args[2]) & 0xFF);
  57890. var string = integer.toString(16).toUpperCase();
  57891. return '000000'.substring(string.length) + string;
  57892. };
  57893. convert.hex.rgb = function (args) {
  57894. var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
  57895. if (!match) {
  57896. return [0, 0, 0];
  57897. }
  57898. var colorString = match[0];
  57899. if (match[0].length === 3) {
  57900. colorString = colorString.split('').map(function (char) {
  57901. return char + char;
  57902. }).join('');
  57903. }
  57904. var integer = parseInt(colorString, 16);
  57905. var r = (integer >> 16) & 0xFF;
  57906. var g = (integer >> 8) & 0xFF;
  57907. var b = integer & 0xFF;
  57908. return [r, g, b];
  57909. };
  57910. convert.rgb.hcg = function (rgb) {
  57911. var r = rgb[0] / 255;
  57912. var g = rgb[1] / 255;
  57913. var b = rgb[2] / 255;
  57914. var max = Math.max(Math.max(r, g), b);
  57915. var min = Math.min(Math.min(r, g), b);
  57916. var chroma = (max - min);
  57917. var grayscale;
  57918. var hue;
  57919. if (chroma < 1) {
  57920. grayscale = min / (1 - chroma);
  57921. } else {
  57922. grayscale = 0;
  57923. }
  57924. if (chroma <= 0) {
  57925. hue = 0;
  57926. } else
  57927. if (max === r) {
  57928. hue = ((g - b) / chroma) % 6;
  57929. } else
  57930. if (max === g) {
  57931. hue = 2 + (b - r) / chroma;
  57932. } else {
  57933. hue = 4 + (r - g) / chroma + 4;
  57934. }
  57935. hue /= 6;
  57936. hue %= 1;
  57937. return [hue * 360, chroma * 100, grayscale * 100];
  57938. };
  57939. convert.hsl.hcg = function (hsl) {
  57940. var s = hsl[1] / 100;
  57941. var l = hsl[2] / 100;
  57942. var c = 1;
  57943. var f = 0;
  57944. if (l < 0.5) {
  57945. c = 2.0 * s * l;
  57946. } else {
  57947. c = 2.0 * s * (1.0 - l);
  57948. }
  57949. if (c < 1.0) {
  57950. f = (l - 0.5 * c) / (1.0 - c);
  57951. }
  57952. return [hsl[0], c * 100, f * 100];
  57953. };
  57954. convert.hsv.hcg = function (hsv) {
  57955. var s = hsv[1] / 100;
  57956. var v = hsv[2] / 100;
  57957. var c = s * v;
  57958. var f = 0;
  57959. if (c < 1.0) {
  57960. f = (v - c) / (1 - c);
  57961. }
  57962. return [hsv[0], c * 100, f * 100];
  57963. };
  57964. convert.hcg.rgb = function (hcg) {
  57965. var h = hcg[0] / 360;
  57966. var c = hcg[1] / 100;
  57967. var g = hcg[2] / 100;
  57968. if (c === 0.0) {
  57969. return [g * 255, g * 255, g * 255];
  57970. }
  57971. var pure = [0, 0, 0];
  57972. var hi = (h % 1) * 6;
  57973. var v = hi % 1;
  57974. var w = 1 - v;
  57975. var mg = 0;
  57976. switch (Math.floor(hi)) {
  57977. case 0:
  57978. pure[0] = 1; pure[1] = v; pure[2] = 0; break;
  57979. case 1:
  57980. pure[0] = w; pure[1] = 1; pure[2] = 0; break;
  57981. case 2:
  57982. pure[0] = 0; pure[1] = 1; pure[2] = v; break;
  57983. case 3:
  57984. pure[0] = 0; pure[1] = w; pure[2] = 1; break;
  57985. case 4:
  57986. pure[0] = v; pure[1] = 0; pure[2] = 1; break;
  57987. default:
  57988. pure[0] = 1; pure[1] = 0; pure[2] = w;
  57989. }
  57990. mg = (1.0 - c) * g;
  57991. return [
  57992. (c * pure[0] + mg) * 255,
  57993. (c * pure[1] + mg) * 255,
  57994. (c * pure[2] + mg) * 255
  57995. ];
  57996. };
  57997. convert.hcg.hsv = function (hcg) {
  57998. var c = hcg[1] / 100;
  57999. var g = hcg[2] / 100;
  58000. var v = c + g * (1.0 - c);
  58001. var f = 0;
  58002. if (v > 0.0) {
  58003. f = c / v;
  58004. }
  58005. return [hcg[0], f * 100, v * 100];
  58006. };
  58007. convert.hcg.hsl = function (hcg) {
  58008. var c = hcg[1] / 100;
  58009. var g = hcg[2] / 100;
  58010. var l = g * (1.0 - c) + 0.5 * c;
  58011. var s = 0;
  58012. if (l > 0.0 && l < 0.5) {
  58013. s = c / (2 * l);
  58014. } else
  58015. if (l >= 0.5 && l < 1.0) {
  58016. s = c / (2 * (1 - l));
  58017. }
  58018. return [hcg[0], s * 100, l * 100];
  58019. };
  58020. convert.hcg.hwb = function (hcg) {
  58021. var c = hcg[1] / 100;
  58022. var g = hcg[2] / 100;
  58023. var v = c + g * (1.0 - c);
  58024. return [hcg[0], (v - c) * 100, (1 - v) * 100];
  58025. };
  58026. convert.hwb.hcg = function (hwb) {
  58027. var w = hwb[1] / 100;
  58028. var b = hwb[2] / 100;
  58029. var v = 1 - b;
  58030. var c = v - w;
  58031. var g = 0;
  58032. if (c < 1) {
  58033. g = (v - c) / (1 - c);
  58034. }
  58035. return [hwb[0], c * 100, g * 100];
  58036. };
  58037. convert.apple.rgb = function (apple) {
  58038. return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
  58039. };
  58040. convert.rgb.apple = function (rgb) {
  58041. return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
  58042. };
  58043. convert.gray.rgb = function (args) {
  58044. return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
  58045. };
  58046. convert.gray.hsl = convert.gray.hsv = function (args) {
  58047. return [0, 0, args[0]];
  58048. };
  58049. convert.gray.hwb = function (gray) {
  58050. return [0, 100, gray[0]];
  58051. };
  58052. convert.gray.cmyk = function (gray) {
  58053. return [0, 0, 0, gray[0]];
  58054. };
  58055. convert.gray.lab = function (gray) {
  58056. return [gray[0], 0, 0];
  58057. };
  58058. convert.gray.hex = function (gray) {
  58059. var val = Math.round(gray[0] / 100 * 255) & 0xFF;
  58060. var integer = (val << 16) + (val << 8) + val;
  58061. var string = integer.toString(16).toUpperCase();
  58062. return '000000'.substring(string.length) + string;
  58063. };
  58064. convert.rgb.gray = function (rgb) {
  58065. var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
  58066. return [val / 255 * 100];
  58067. };
  58068. /***/ }),
  58069. /* 323 */
  58070. /***/ (function(module, exports, __webpack_require__) {
  58071. var util = __webpack_require__(9);
  58072. var Stream = __webpack_require__(36).Stream;
  58073. var DelayedStream = __webpack_require__(657);
  58074. var defer = __webpack_require__(588);
  58075. module.exports = CombinedStream;
  58076. function CombinedStream() {
  58077. this.writable = false;
  58078. this.readable = true;
  58079. this.dataSize = 0;
  58080. this.maxDataSize = 2 * 1024 * 1024;
  58081. this.pauseStreams = true;
  58082. this._released = false;
  58083. this._streams = [];
  58084. this._currentStream = null;
  58085. }
  58086. util.inherits(CombinedStream, Stream);
  58087. CombinedStream.create = function(options) {
  58088. var combinedStream = new this();
  58089. options = options || {};
  58090. for (var option in options) {
  58091. combinedStream[option] = options[option];
  58092. }
  58093. return combinedStream;
  58094. };
  58095. CombinedStream.isStreamLike = function(stream) {
  58096. return (typeof stream !== 'function')
  58097. && (typeof stream !== 'string')
  58098. && (typeof stream !== 'boolean')
  58099. && (typeof stream !== 'number')
  58100. && (!Buffer.isBuffer(stream));
  58101. };
  58102. CombinedStream.prototype.append = function(stream) {
  58103. var isStreamLike = CombinedStream.isStreamLike(stream);
  58104. if (isStreamLike) {
  58105. if (!(stream instanceof DelayedStream)) {
  58106. var newStream = DelayedStream.create(stream, {
  58107. maxDataSize: Infinity,
  58108. pauseStream: this.pauseStreams,
  58109. });
  58110. stream.on('data', this._checkDataSize.bind(this));
  58111. stream = newStream;
  58112. }
  58113. this._handleErrors(stream);
  58114. if (this.pauseStreams) {
  58115. stream.pause();
  58116. }
  58117. }
  58118. this._streams.push(stream);
  58119. return this;
  58120. };
  58121. CombinedStream.prototype.pipe = function(dest, options) {
  58122. Stream.prototype.pipe.call(this, dest, options);
  58123. this.resume();
  58124. return dest;
  58125. };
  58126. CombinedStream.prototype._getNext = function() {
  58127. this._currentStream = null;
  58128. var stream = this._streams.shift();
  58129. if (typeof stream == 'undefined') {
  58130. this.end();
  58131. return;
  58132. }
  58133. if (typeof stream !== 'function') {
  58134. this._pipeNext(stream);
  58135. return;
  58136. }
  58137. var getStream = stream;
  58138. getStream(function(stream) {
  58139. var isStreamLike = CombinedStream.isStreamLike(stream);
  58140. if (isStreamLike) {
  58141. stream.on('data', this._checkDataSize.bind(this));
  58142. this._handleErrors(stream);
  58143. }
  58144. defer(this._pipeNext.bind(this, stream));
  58145. }.bind(this));
  58146. };
  58147. CombinedStream.prototype._pipeNext = function(stream) {
  58148. this._currentStream = stream;
  58149. var isStreamLike = CombinedStream.isStreamLike(stream);
  58150. if (isStreamLike) {
  58151. stream.on('end', this._getNext.bind(this));
  58152. stream.pipe(this, {end: false});
  58153. return;
  58154. }
  58155. var value = stream;
  58156. this.write(value);
  58157. this._getNext();
  58158. };
  58159. CombinedStream.prototype._handleErrors = function(stream) {
  58160. var self = this;
  58161. stream.on('error', function(err) {
  58162. self._emitError(err);
  58163. });
  58164. };
  58165. CombinedStream.prototype.write = function(data) {
  58166. this.emit('data', data);
  58167. };
  58168. CombinedStream.prototype.pause = function() {
  58169. if (!this.pauseStreams) {
  58170. return;
  58171. }
  58172. if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
  58173. this.emit('pause');
  58174. };
  58175. CombinedStream.prototype.resume = function() {
  58176. if (!this._released) {
  58177. this._released = true;
  58178. this.writable = true;
  58179. this._getNext();
  58180. }
  58181. if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
  58182. this.emit('resume');
  58183. };
  58184. CombinedStream.prototype.end = function() {
  58185. this._reset();
  58186. this.emit('end');
  58187. };
  58188. CombinedStream.prototype.destroy = function() {
  58189. this._reset();
  58190. this.emit('close');
  58191. };
  58192. CombinedStream.prototype._reset = function() {
  58193. this.writable = false;
  58194. this._streams = [];
  58195. this._currentStream = null;
  58196. };
  58197. CombinedStream.prototype._checkDataSize = function() {
  58198. this._updateDataSize();
  58199. if (this.dataSize <= this.maxDataSize) {
  58200. return;
  58201. }
  58202. var message =
  58203. 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
  58204. this._emitError(new Error(message));
  58205. };
  58206. CombinedStream.prototype._updateDataSize = function() {
  58207. this.dataSize = 0;
  58208. var self = this;
  58209. this._streams.forEach(function(stream) {
  58210. if (!stream.dataSize) {
  58211. return;
  58212. }
  58213. self.dataSize += stream.dataSize;
  58214. });
  58215. if (this._currentStream && this._currentStream.dataSize) {
  58216. this.dataSize += this._currentStream.dataSize;
  58217. }
  58218. };
  58219. CombinedStream.prototype._emitError = function(err) {
  58220. this._reset();
  58221. this.emit('error', err);
  58222. };
  58223. /***/ }),
  58224. /* 324 */
  58225. /***/ (function(module, exports, __webpack_require__) {
  58226. "use strict";
  58227. var dP = __webpack_require__(63).f;
  58228. var create = __webpack_require__(125);
  58229. var redefineAll = __webpack_require__(223);
  58230. var ctx = __webpack_require__(68);
  58231. var anInstance = __webpack_require__(213);
  58232. var forOf = __webpack_require__(122);
  58233. var $iterDefine = __webpack_require__(219);
  58234. var step = __webpack_require__(334);
  58235. var setSpecies = __webpack_require__(345);
  58236. var DESCRIPTORS = __webpack_require__(69);
  58237. var fastKey = __webpack_require__(220).fastKey;
  58238. var validate = __webpack_require__(228);
  58239. var SIZE = DESCRIPTORS ? '_s' : 'size';
  58240. var getEntry = function (that, key) {
  58241. // fast case
  58242. var index = fastKey(key);
  58243. var entry;
  58244. if (index !== 'F') return that._i[index];
  58245. // frozen object case
  58246. for (entry = that._f; entry; entry = entry.n) {
  58247. if (entry.k == key) return entry;
  58248. }
  58249. };
  58250. module.exports = {
  58251. getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
  58252. var C = wrapper(function (that, iterable) {
  58253. anInstance(that, C, NAME, '_i');
  58254. that._t = NAME; // collection type
  58255. that._i = create(null); // index
  58256. that._f = undefined; // first entry
  58257. that._l = undefined; // last entry
  58258. that[SIZE] = 0; // size
  58259. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  58260. });
  58261. redefineAll(C.prototype, {
  58262. // 23.1.3.1 Map.prototype.clear()
  58263. // 23.2.3.2 Set.prototype.clear()
  58264. clear: function clear() {
  58265. for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
  58266. entry.r = true;
  58267. if (entry.p) entry.p = entry.p.n = undefined;
  58268. delete data[entry.i];
  58269. }
  58270. that._f = that._l = undefined;
  58271. that[SIZE] = 0;
  58272. },
  58273. // 23.1.3.3 Map.prototype.delete(key)
  58274. // 23.2.3.4 Set.prototype.delete(value)
  58275. 'delete': function (key) {
  58276. var that = validate(this, NAME);
  58277. var entry = getEntry(that, key);
  58278. if (entry) {
  58279. var next = entry.n;
  58280. var prev = entry.p;
  58281. delete that._i[entry.i];
  58282. entry.r = true;
  58283. if (prev) prev.n = next;
  58284. if (next) next.p = prev;
  58285. if (that._f == entry) that._f = next;
  58286. if (that._l == entry) that._l = prev;
  58287. that[SIZE]--;
  58288. } return !!entry;
  58289. },
  58290. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  58291. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  58292. forEach: function forEach(callbackfn /* , that = undefined */) {
  58293. validate(this, NAME);
  58294. var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  58295. var entry;
  58296. while (entry = entry ? entry.n : this._f) {
  58297. f(entry.v, entry.k, this);
  58298. // revert to the last existing entry
  58299. while (entry && entry.r) entry = entry.p;
  58300. }
  58301. },
  58302. // 23.1.3.7 Map.prototype.has(key)
  58303. // 23.2.3.7 Set.prototype.has(value)
  58304. has: function has(key) {
  58305. return !!getEntry(validate(this, NAME), key);
  58306. }
  58307. });
  58308. if (DESCRIPTORS) dP(C.prototype, 'size', {
  58309. get: function () {
  58310. return validate(this, NAME)[SIZE];
  58311. }
  58312. });
  58313. return C;
  58314. },
  58315. def: function (that, key, value) {
  58316. var entry = getEntry(that, key);
  58317. var prev, index;
  58318. // change existing entry
  58319. if (entry) {
  58320. entry.v = value;
  58321. // create new entry
  58322. } else {
  58323. that._l = entry = {
  58324. i: index = fastKey(key, true), // <- index
  58325. k: key, // <- key
  58326. v: value, // <- value
  58327. p: prev = that._l, // <- previous entry
  58328. n: undefined, // <- next entry
  58329. r: false // <- removed
  58330. };
  58331. if (!that._f) that._f = entry;
  58332. if (prev) prev.n = entry;
  58333. that[SIZE]++;
  58334. // add to index
  58335. if (index !== 'F') that._i[index] = entry;
  58336. } return that;
  58337. },
  58338. getEntry: getEntry,
  58339. setStrong: function (C, NAME, IS_MAP) {
  58340. // add .keys, .values, .entries, [@@iterator]
  58341. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  58342. $iterDefine(C, NAME, function (iterated, kind) {
  58343. this._t = validate(iterated, NAME); // target
  58344. this._k = kind; // kind
  58345. this._l = undefined; // previous
  58346. }, function () {
  58347. var that = this;
  58348. var kind = that._k;
  58349. var entry = that._l;
  58350. // revert to the last existing entry
  58351. while (entry && entry.r) entry = entry.p;
  58352. // get next entry
  58353. if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
  58354. // or finish the iteration
  58355. that._t = undefined;
  58356. return step(1);
  58357. }
  58358. // return step by kind
  58359. if (kind == 'keys') return step(0, entry.k);
  58360. if (kind == 'values') return step(0, entry.v);
  58361. return step(0, [entry.k, entry.v]);
  58362. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  58363. // add [@@species], 23.1.2.2, 23.2.2.2
  58364. setSpecies(NAME);
  58365. }
  58366. };
  58367. /***/ }),
  58368. /* 325 */
  58369. /***/ (function(module, exports, __webpack_require__) {
  58370. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  58371. var classof = __webpack_require__(214);
  58372. var from = __webpack_require__(606);
  58373. module.exports = function (NAME) {
  58374. return function toJSON() {
  58375. if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
  58376. return from(this);
  58377. };
  58378. };
  58379. /***/ }),
  58380. /* 326 */
  58381. /***/ (function(module, exports, __webpack_require__) {
  58382. "use strict";
  58383. var global = __webpack_require__(38);
  58384. var $export = __webpack_require__(34);
  58385. var meta = __webpack_require__(220);
  58386. var fails = __webpack_require__(76);
  58387. var hide = __webpack_require__(77);
  58388. var redefineAll = __webpack_require__(223);
  58389. var forOf = __webpack_require__(122);
  58390. var anInstance = __webpack_require__(213);
  58391. var isObject = __webpack_require__(49);
  58392. var setToStringTag = __webpack_require__(128);
  58393. var dP = __webpack_require__(63).f;
  58394. var each = __webpack_require__(608)(0);
  58395. var DESCRIPTORS = __webpack_require__(69);
  58396. module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
  58397. var Base = global[NAME];
  58398. var C = Base;
  58399. var ADDER = IS_MAP ? 'set' : 'add';
  58400. var proto = C && C.prototype;
  58401. var O = {};
  58402. if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
  58403. new C().entries().next();
  58404. }))) {
  58405. // create collection constructor
  58406. C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
  58407. redefineAll(C.prototype, methods);
  58408. meta.NEED = true;
  58409. } else {
  58410. C = wrapper(function (target, iterable) {
  58411. anInstance(target, C, NAME, '_c');
  58412. target._c = new Base();
  58413. if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);
  58414. });
  58415. each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {
  58416. var IS_ADDER = KEY == 'add' || KEY == 'set';
  58417. if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {
  58418. anInstance(this, C, KEY);
  58419. if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
  58420. var result = this._c[KEY](a === 0 ? 0 : a, b);
  58421. return IS_ADDER ? this : result;
  58422. });
  58423. });
  58424. IS_WEAK || dP(C.prototype, 'size', {
  58425. get: function () {
  58426. return this._c.size;
  58427. }
  58428. });
  58429. }
  58430. setToStringTag(C, NAME);
  58431. O[NAME] = C;
  58432. $export($export.G + $export.W + $export.F, O);
  58433. if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
  58434. return C;
  58435. };
  58436. /***/ }),
  58437. /* 327 */
  58438. /***/ (function(module, exports, __webpack_require__) {
  58439. var document = __webpack_require__(38).document;
  58440. module.exports = document && document.documentElement;
  58441. /***/ }),
  58442. /* 328 */
  58443. /***/ (function(module, exports, __webpack_require__) {
  58444. module.exports = !__webpack_require__(69) && !__webpack_require__(76)(function () {
  58445. return Object.defineProperty(__webpack_require__(216)('div'), 'a', { get: function () { return 7; } }).a != 7;
  58446. });
  58447. /***/ }),
  58448. /* 329 */
  58449. /***/ (function(module, exports) {
  58450. // fast apply, http://jsperf.lnkit.com/fast-apply/5
  58451. module.exports = function (fn, args, that) {
  58452. var un = that === undefined;
  58453. switch (args.length) {
  58454. case 0: return un ? fn()
  58455. : fn.call(that);
  58456. case 1: return un ? fn(args[0])
  58457. : fn.call(that, args[0]);
  58458. case 2: return un ? fn(args[0], args[1])
  58459. : fn.call(that, args[0], args[1]);
  58460. case 3: return un ? fn(args[0], args[1], args[2])
  58461. : fn.call(that, args[0], args[1], args[2]);
  58462. case 4: return un ? fn(args[0], args[1], args[2], args[3])
  58463. : fn.call(that, args[0], args[1], args[2], args[3]);
  58464. } return fn.apply(that, args);
  58465. };
  58466. /***/ }),
  58467. /* 330 */
  58468. /***/ (function(module, exports, __webpack_require__) {
  58469. // check on default Array iterator
  58470. var Iterators = __webpack_require__(123);
  58471. var ITERATOR = __webpack_require__(44)('iterator');
  58472. var ArrayProto = Array.prototype;
  58473. module.exports = function (it) {
  58474. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  58475. };
  58476. /***/ }),
  58477. /* 331 */
  58478. /***/ (function(module, exports, __webpack_require__) {
  58479. // 7.2.2 IsArray(argument)
  58480. var cof = __webpack_require__(121);
  58481. module.exports = Array.isArray || function isArray(arg) {
  58482. return cof(arg) == 'Array';
  58483. };
  58484. /***/ }),
  58485. /* 332 */
  58486. /***/ (function(module, exports, __webpack_require__) {
  58487. // call something on iterator step with safe closing on error
  58488. var anObject = __webpack_require__(58);
  58489. module.exports = function (iterator, fn, value, entries) {
  58490. try {
  58491. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  58492. // 7.4.6 IteratorClose(iterator, completion)
  58493. } catch (e) {
  58494. var ret = iterator['return'];
  58495. if (ret !== undefined) anObject(ret.call(iterator));
  58496. throw e;
  58497. }
  58498. };
  58499. /***/ }),
  58500. /* 333 */
  58501. /***/ (function(module, exports, __webpack_require__) {
  58502. var ITERATOR = __webpack_require__(44)('iterator');
  58503. var SAFE_CLOSING = false;
  58504. try {
  58505. var riter = [7][ITERATOR]();
  58506. riter['return'] = function () { SAFE_CLOSING = true; };
  58507. // eslint-disable-next-line no-throw-literal
  58508. Array.from(riter, function () { throw 2; });
  58509. } catch (e) { /* empty */ }
  58510. module.exports = function (exec, skipClosing) {
  58511. if (!skipClosing && !SAFE_CLOSING) return false;
  58512. var safe = false;
  58513. try {
  58514. var arr = [7];
  58515. var iter = arr[ITERATOR]();
  58516. iter.next = function () { return { done: safe = true }; };
  58517. arr[ITERATOR] = function () { return iter; };
  58518. exec(arr);
  58519. } catch (e) { /* empty */ }
  58520. return safe;
  58521. };
  58522. /***/ }),
  58523. /* 334 */
  58524. /***/ (function(module, exports) {
  58525. module.exports = function (done, value) {
  58526. return { value: value, done: !!done };
  58527. };
  58528. /***/ }),
  58529. /* 335 */
  58530. /***/ (function(module, exports, __webpack_require__) {
  58531. var pIE = __webpack_require__(126);
  58532. var createDesc = __webpack_require__(127);
  58533. var toIObject = __webpack_require__(90);
  58534. var toPrimitive = __webpack_require__(227);
  58535. var has = __webpack_require__(89);
  58536. var IE8_DOM_DEFINE = __webpack_require__(328);
  58537. var gOPD = Object.getOwnPropertyDescriptor;
  58538. exports.f = __webpack_require__(69) ? gOPD : function getOwnPropertyDescriptor(O, P) {
  58539. O = toIObject(O);
  58540. P = toPrimitive(P, true);
  58541. if (IE8_DOM_DEFINE) try {
  58542. return gOPD(O, P);
  58543. } catch (e) { /* empty */ }
  58544. if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
  58545. };
  58546. /***/ }),
  58547. /* 336 */
  58548. /***/ (function(module, exports, __webpack_require__) {
  58549. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  58550. var $keys = __webpack_require__(338);
  58551. var hiddenKeys = __webpack_require__(217).concat('length', 'prototype');
  58552. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  58553. return $keys(O, hiddenKeys);
  58554. };
  58555. /***/ }),
  58556. /* 337 */
  58557. /***/ (function(module, exports, __webpack_require__) {
  58558. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  58559. var has = __webpack_require__(89);
  58560. var toObject = __webpack_require__(103);
  58561. var IE_PROTO = __webpack_require__(224)('IE_PROTO');
  58562. var ObjectProto = Object.prototype;
  58563. module.exports = Object.getPrototypeOf || function (O) {
  58564. O = toObject(O);
  58565. if (has(O, IE_PROTO)) return O[IE_PROTO];
  58566. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  58567. return O.constructor.prototype;
  58568. } return O instanceof Object ? ObjectProto : null;
  58569. };
  58570. /***/ }),
  58571. /* 338 */
  58572. /***/ (function(module, exports, __webpack_require__) {
  58573. var has = __webpack_require__(89);
  58574. var toIObject = __webpack_require__(90);
  58575. var arrayIndexOf = __webpack_require__(607)(false);
  58576. var IE_PROTO = __webpack_require__(224)('IE_PROTO');
  58577. module.exports = function (object, names) {
  58578. var O = toIObject(object);
  58579. var i = 0;
  58580. var result = [];
  58581. var key;
  58582. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  58583. // Don't enum bug & hidden keys
  58584. while (names.length > i) if (has(O, key = names[i++])) {
  58585. ~arrayIndexOf(result, key) || result.push(key);
  58586. }
  58587. return result;
  58588. };
  58589. /***/ }),
  58590. /* 339 */
  58591. /***/ (function(module, exports, __webpack_require__) {
  58592. // most Object methods by ES6 should accept primitives
  58593. var $export = __webpack_require__(34);
  58594. var core = __webpack_require__(26);
  58595. var fails = __webpack_require__(76);
  58596. module.exports = function (KEY, exec) {
  58597. var fn = (core.Object || {})[KEY] || Object[KEY];
  58598. var exp = {};
  58599. exp[KEY] = exec(fn);
  58600. $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
  58601. };
  58602. /***/ }),
  58603. /* 340 */
  58604. /***/ (function(module, exports) {
  58605. module.exports = function (exec) {
  58606. try {
  58607. return { e: false, v: exec() };
  58608. } catch (e) {
  58609. return { e: true, v: e };
  58610. }
  58611. };
  58612. /***/ }),
  58613. /* 341 */
  58614. /***/ (function(module, exports, __webpack_require__) {
  58615. var anObject = __webpack_require__(58);
  58616. var isObject = __webpack_require__(49);
  58617. var newPromiseCapability = __webpack_require__(221);
  58618. module.exports = function (C, x) {
  58619. anObject(C);
  58620. if (isObject(x) && x.constructor === C) return x;
  58621. var promiseCapability = newPromiseCapability.f(C);
  58622. var resolve = promiseCapability.resolve;
  58623. resolve(x);
  58624. return promiseCapability.promise;
  58625. };
  58626. /***/ }),
  58627. /* 342 */
  58628. /***/ (function(module, exports, __webpack_require__) {
  58629. module.exports = __webpack_require__(77);
  58630. /***/ }),
  58631. /* 343 */
  58632. /***/ (function(module, exports, __webpack_require__) {
  58633. "use strict";
  58634. // https://tc39.github.io/proposal-setmap-offrom/
  58635. var $export = __webpack_require__(34);
  58636. var aFunction = __webpack_require__(88);
  58637. var ctx = __webpack_require__(68);
  58638. var forOf = __webpack_require__(122);
  58639. module.exports = function (COLLECTION) {
  58640. $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
  58641. var mapFn = arguments[1];
  58642. var mapping, A, n, cb;
  58643. aFunction(this);
  58644. mapping = mapFn !== undefined;
  58645. if (mapping) aFunction(mapFn);
  58646. if (source == undefined) return new this();
  58647. A = [];
  58648. if (mapping) {
  58649. n = 0;
  58650. cb = ctx(mapFn, arguments[2], 2);
  58651. forOf(source, false, function (nextItem) {
  58652. A.push(cb(nextItem, n++));
  58653. });
  58654. } else {
  58655. forOf(source, false, A.push, A);
  58656. }
  58657. return new this(A);
  58658. } });
  58659. };
  58660. /***/ }),
  58661. /* 344 */
  58662. /***/ (function(module, exports, __webpack_require__) {
  58663. "use strict";
  58664. // https://tc39.github.io/proposal-setmap-offrom/
  58665. var $export = __webpack_require__(34);
  58666. module.exports = function (COLLECTION) {
  58667. $export($export.S, COLLECTION, { of: function of() {
  58668. var length = arguments.length;
  58669. var A = new Array(length);
  58670. while (length--) A[length] = arguments[length];
  58671. return new this(A);
  58672. } });
  58673. };
  58674. /***/ }),
  58675. /* 345 */
  58676. /***/ (function(module, exports, __webpack_require__) {
  58677. "use strict";
  58678. var global = __webpack_require__(38);
  58679. var core = __webpack_require__(26);
  58680. var dP = __webpack_require__(63);
  58681. var DESCRIPTORS = __webpack_require__(69);
  58682. var SPECIES = __webpack_require__(44)('species');
  58683. module.exports = function (KEY) {
  58684. var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
  58685. if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
  58686. configurable: true,
  58687. get: function () { return this; }
  58688. });
  58689. };
  58690. /***/ }),
  58691. /* 346 */
  58692. /***/ (function(module, exports, __webpack_require__) {
  58693. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  58694. var anObject = __webpack_require__(58);
  58695. var aFunction = __webpack_require__(88);
  58696. var SPECIES = __webpack_require__(44)('species');
  58697. module.exports = function (O, D) {
  58698. var C = anObject(O).constructor;
  58699. var S;
  58700. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  58701. };
  58702. /***/ }),
  58703. /* 347 */
  58704. /***/ (function(module, exports, __webpack_require__) {
  58705. var ctx = __webpack_require__(68);
  58706. var invoke = __webpack_require__(329);
  58707. var html = __webpack_require__(327);
  58708. var cel = __webpack_require__(216);
  58709. var global = __webpack_require__(38);
  58710. var process = global.process;
  58711. var setTask = global.setImmediate;
  58712. var clearTask = global.clearImmediate;
  58713. var MessageChannel = global.MessageChannel;
  58714. var Dispatch = global.Dispatch;
  58715. var counter = 0;
  58716. var queue = {};
  58717. var ONREADYSTATECHANGE = 'onreadystatechange';
  58718. var defer, channel, port;
  58719. var run = function () {
  58720. var id = +this;
  58721. // eslint-disable-next-line no-prototype-builtins
  58722. if (queue.hasOwnProperty(id)) {
  58723. var fn = queue[id];
  58724. delete queue[id];
  58725. fn();
  58726. }
  58727. };
  58728. var listener = function (event) {
  58729. run.call(event.data);
  58730. };
  58731. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  58732. if (!setTask || !clearTask) {
  58733. setTask = function setImmediate(fn) {
  58734. var args = [];
  58735. var i = 1;
  58736. while (arguments.length > i) args.push(arguments[i++]);
  58737. queue[++counter] = function () {
  58738. // eslint-disable-next-line no-new-func
  58739. invoke(typeof fn == 'function' ? fn : Function(fn), args);
  58740. };
  58741. defer(counter);
  58742. return counter;
  58743. };
  58744. clearTask = function clearImmediate(id) {
  58745. delete queue[id];
  58746. };
  58747. // Node.js 0.8-
  58748. if (__webpack_require__(121)(process) == 'process') {
  58749. defer = function (id) {
  58750. process.nextTick(ctx(run, id, 1));
  58751. };
  58752. // Sphere (JS game engine) Dispatch API
  58753. } else if (Dispatch && Dispatch.now) {
  58754. defer = function (id) {
  58755. Dispatch.now(ctx(run, id, 1));
  58756. };
  58757. // Browsers with MessageChannel, includes WebWorkers
  58758. } else if (MessageChannel) {
  58759. channel = new MessageChannel();
  58760. port = channel.port2;
  58761. channel.port1.onmessage = listener;
  58762. defer = ctx(port.postMessage, port, 1);
  58763. // Browsers with postMessage, skip WebWorkers
  58764. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  58765. } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
  58766. defer = function (id) {
  58767. global.postMessage(id + '', '*');
  58768. };
  58769. global.addEventListener('message', listener, false);
  58770. // IE8-
  58771. } else if (ONREADYSTATECHANGE in cel('script')) {
  58772. defer = function (id) {
  58773. html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
  58774. html.removeChild(this);
  58775. run.call(id);
  58776. };
  58777. };
  58778. // Rest old browsers
  58779. } else {
  58780. defer = function (id) {
  58781. setTimeout(ctx(run, id, 1), 0);
  58782. };
  58783. }
  58784. }
  58785. module.exports = {
  58786. set: setTask,
  58787. clear: clearTask
  58788. };
  58789. /***/ }),
  58790. /* 348 */
  58791. /***/ (function(module, exports, __webpack_require__) {
  58792. /**
  58793. * This is the common logic for both the Node.js and web browser
  58794. * implementations of `debug()`.
  58795. *
  58796. * Expose `debug()` as the module.
  58797. */
  58798. exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
  58799. exports.coerce = coerce;
  58800. exports.disable = disable;
  58801. exports.enable = enable;
  58802. exports.enabled = enabled;
  58803. exports.humanize = __webpack_require__(833);
  58804. /**
  58805. * Active `debug` instances.
  58806. */
  58807. exports.instances = [];
  58808. /**
  58809. * The currently active debug mode names, and names to skip.
  58810. */
  58811. exports.names = [];
  58812. exports.skips = [];
  58813. /**
  58814. * Map of special "%n" handling functions, for the debug "format" argument.
  58815. *
  58816. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  58817. */
  58818. exports.formatters = {};
  58819. /**
  58820. * Select a color.
  58821. * @param {String} namespace
  58822. * @return {Number}
  58823. * @api private
  58824. */
  58825. function selectColor(namespace) {
  58826. var hash = 0, i;
  58827. for (i in namespace) {
  58828. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  58829. hash |= 0; // Convert to 32bit integer
  58830. }
  58831. return exports.colors[Math.abs(hash) % exports.colors.length];
  58832. }
  58833. /**
  58834. * Create a debugger with the given `namespace`.
  58835. *
  58836. * @param {String} namespace
  58837. * @return {Function}
  58838. * @api public
  58839. */
  58840. function createDebug(namespace) {
  58841. var prevTime;
  58842. function debug() {
  58843. // disabled?
  58844. if (!debug.enabled) return;
  58845. var self = debug;
  58846. // set `diff` timestamp
  58847. var curr = +new Date();
  58848. var ms = curr - (prevTime || curr);
  58849. self.diff = ms;
  58850. self.prev = prevTime;
  58851. self.curr = curr;
  58852. prevTime = curr;
  58853. // turn the `arguments` into a proper Array
  58854. var args = new Array(arguments.length);
  58855. for (var i = 0; i < args.length; i++) {
  58856. args[i] = arguments[i];
  58857. }
  58858. args[0] = exports.coerce(args[0]);
  58859. if ('string' !== typeof args[0]) {
  58860. // anything else let's inspect with %O
  58861. args.unshift('%O');
  58862. }
  58863. // apply any `formatters` transformations
  58864. var index = 0;
  58865. args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
  58866. // if we encounter an escaped % then don't increase the array index
  58867. if (match === '%%') return match;
  58868. index++;
  58869. var formatter = exports.formatters[format];
  58870. if ('function' === typeof formatter) {
  58871. var val = args[index];
  58872. match = formatter.call(self, val);
  58873. // now we need to remove `args[index]` since it's inlined in the `format`
  58874. args.splice(index, 1);
  58875. index--;
  58876. }
  58877. return match;
  58878. });
  58879. // apply env-specific formatting (colors, etc.)
  58880. exports.formatArgs.call(self, args);
  58881. var logFn = debug.log || exports.log || console.log.bind(console);
  58882. logFn.apply(self, args);
  58883. }
  58884. debug.namespace = namespace;
  58885. debug.enabled = exports.enabled(namespace);
  58886. debug.useColors = exports.useColors();
  58887. debug.color = selectColor(namespace);
  58888. debug.destroy = destroy;
  58889. // env-specific initialization logic for debug instances
  58890. if ('function' === typeof exports.init) {
  58891. exports.init(debug);
  58892. }
  58893. exports.instances.push(debug);
  58894. return debug;
  58895. }
  58896. function destroy () {
  58897. var index = exports.instances.indexOf(this);
  58898. if (index !== -1) {
  58899. exports.instances.splice(index, 1);
  58900. return true;
  58901. } else {
  58902. return false;
  58903. }
  58904. }
  58905. /**
  58906. * Enables a debug mode by namespaces. This can include modes
  58907. * separated by a colon and wildcards.
  58908. *
  58909. * @param {String} namespaces
  58910. * @api public
  58911. */
  58912. function enable(namespaces) {
  58913. exports.save(namespaces);
  58914. exports.names = [];
  58915. exports.skips = [];
  58916. var i;
  58917. var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  58918. var len = split.length;
  58919. for (i = 0; i < len; i++) {
  58920. if (!split[i]) continue; // ignore empty strings
  58921. namespaces = split[i].replace(/\*/g, '.*?');
  58922. if (namespaces[0] === '-') {
  58923. exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  58924. } else {
  58925. exports.names.push(new RegExp('^' + namespaces + '$'));
  58926. }
  58927. }
  58928. for (i = 0; i < exports.instances.length; i++) {
  58929. var instance = exports.instances[i];
  58930. instance.enabled = exports.enabled(instance.namespace);
  58931. }
  58932. }
  58933. /**
  58934. * Disable debug output.
  58935. *
  58936. * @api public
  58937. */
  58938. function disable() {
  58939. exports.enable('');
  58940. }
  58941. /**
  58942. * Returns true if the given mode name is enabled, false otherwise.
  58943. *
  58944. * @param {String} name
  58945. * @return {Boolean}
  58946. * @api public
  58947. */
  58948. function enabled(name) {
  58949. if (name[name.length - 1] === '*') {
  58950. return true;
  58951. }
  58952. var i, len;
  58953. for (i = 0, len = exports.skips.length; i < len; i++) {
  58954. if (exports.skips[i].test(name)) {
  58955. return false;
  58956. }
  58957. }
  58958. for (i = 0, len = exports.names.length; i < len; i++) {
  58959. if (exports.names[i].test(name)) {
  58960. return true;
  58961. }
  58962. }
  58963. return false;
  58964. }
  58965. /**
  58966. * Coerce `val`.
  58967. *
  58968. * @param {Mixed} val
  58969. * @return {Mixed}
  58970. * @api private
  58971. */
  58972. function coerce(val) {
  58973. if (val instanceof Error) return val.stack || val.message;
  58974. return val;
  58975. }
  58976. /***/ }),
  58977. /* 349 */
  58978. /***/ (function(module, exports, __webpack_require__) {
  58979. var stream = __webpack_require__(91)
  58980. var eos = __webpack_require__(164)
  58981. var inherits = __webpack_require__(78)
  58982. var shift = __webpack_require__(1015)
  58983. var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from)
  58984. ? Buffer.from([0])
  58985. : new Buffer([0])
  58986. var onuncork = function(self, fn) {
  58987. if (self._corked) self.once('uncork', fn)
  58988. else fn()
  58989. }
  58990. var autoDestroy = function (self, err) {
  58991. if (self._autoDestroy) self.destroy(err)
  58992. }
  58993. var destroyer = function(self, end) {
  58994. return function(err) {
  58995. if (err) autoDestroy(self, err.message === 'premature close' ? null : err)
  58996. else if (end && !self._ended) self.end()
  58997. }
  58998. }
  58999. var end = function(ws, fn) {
  59000. if (!ws) return fn()
  59001. if (ws._writableState && ws._writableState.finished) return fn()
  59002. if (ws._writableState) return ws.end(fn)
  59003. ws.end()
  59004. fn()
  59005. }
  59006. var toStreams2 = function(rs) {
  59007. return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs)
  59008. }
  59009. var Duplexify = function(writable, readable, opts) {
  59010. if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts)
  59011. stream.Duplex.call(this, opts)
  59012. this._writable = null
  59013. this._readable = null
  59014. this._readable2 = null
  59015. this._autoDestroy = !opts || opts.autoDestroy !== false
  59016. this._forwardDestroy = !opts || opts.destroy !== false
  59017. this._forwardEnd = !opts || opts.end !== false
  59018. this._corked = 1 // start corked
  59019. this._ondrain = null
  59020. this._drained = false
  59021. this._forwarding = false
  59022. this._unwrite = null
  59023. this._unread = null
  59024. this._ended = false
  59025. this.destroyed = false
  59026. if (writable) this.setWritable(writable)
  59027. if (readable) this.setReadable(readable)
  59028. }
  59029. inherits(Duplexify, stream.Duplex)
  59030. Duplexify.obj = function(writable, readable, opts) {
  59031. if (!opts) opts = {}
  59032. opts.objectMode = true
  59033. opts.highWaterMark = 16
  59034. return new Duplexify(writable, readable, opts)
  59035. }
  59036. Duplexify.prototype.cork = function() {
  59037. if (++this._corked === 1) this.emit('cork')
  59038. }
  59039. Duplexify.prototype.uncork = function() {
  59040. if (this._corked && --this._corked === 0) this.emit('uncork')
  59041. }
  59042. Duplexify.prototype.setWritable = function(writable) {
  59043. if (this._unwrite) this._unwrite()
  59044. if (this.destroyed) {
  59045. if (writable && writable.destroy) writable.destroy()
  59046. return
  59047. }
  59048. if (writable === null || writable === false) {
  59049. this.end()
  59050. return
  59051. }
  59052. var self = this
  59053. var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd))
  59054. var ondrain = function() {
  59055. var ondrain = self._ondrain
  59056. self._ondrain = null
  59057. if (ondrain) ondrain()
  59058. }
  59059. var clear = function() {
  59060. self._writable.removeListener('drain', ondrain)
  59061. unend()
  59062. }
  59063. if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks
  59064. this._writable = writable
  59065. this._writable.on('drain', ondrain)
  59066. this._unwrite = clear
  59067. this.uncork() // always uncork setWritable
  59068. }
  59069. Duplexify.prototype.setReadable = function(readable) {
  59070. if (this._unread) this._unread()
  59071. if (this.destroyed) {
  59072. if (readable && readable.destroy) readable.destroy()
  59073. return
  59074. }
  59075. if (readable === null || readable === false) {
  59076. this.push(null)
  59077. this.resume()
  59078. return
  59079. }
  59080. var self = this
  59081. var unend = eos(readable, {writable:false, readable:true}, destroyer(this))
  59082. var onreadable = function() {
  59083. self._forward()
  59084. }
  59085. var onend = function() {
  59086. self.push(null)
  59087. }
  59088. var clear = function() {
  59089. self._readable2.removeListener('readable', onreadable)
  59090. self._readable2.removeListener('end', onend)
  59091. unend()
  59092. }
  59093. this._drained = true
  59094. this._readable = readable
  59095. this._readable2 = readable._readableState ? readable : toStreams2(readable)
  59096. this._readable2.on('readable', onreadable)
  59097. this._readable2.on('end', onend)
  59098. this._unread = clear
  59099. this._forward()
  59100. }
  59101. Duplexify.prototype._read = function() {
  59102. this._drained = true
  59103. this._forward()
  59104. }
  59105. Duplexify.prototype._forward = function() {
  59106. if (this._forwarding || !this._readable2 || !this._drained) return
  59107. this._forwarding = true
  59108. var data
  59109. while (this._drained && (data = shift(this._readable2)) !== null) {
  59110. if (this.destroyed) continue
  59111. this._drained = this.push(data)
  59112. }
  59113. this._forwarding = false
  59114. }
  59115. Duplexify.prototype.destroy = function(err) {
  59116. if (this.destroyed) return
  59117. this.destroyed = true
  59118. var self = this
  59119. process.nextTick(function() {
  59120. self._destroy(err)
  59121. })
  59122. }
  59123. Duplexify.prototype._destroy = function(err) {
  59124. if (err) {
  59125. var ondrain = this._ondrain
  59126. this._ondrain = null
  59127. if (ondrain) ondrain(err)
  59128. else this.emit('error', err)
  59129. }
  59130. if (this._forwardDestroy) {
  59131. if (this._readable && this._readable.destroy) this._readable.destroy()
  59132. if (this._writable && this._writable.destroy) this._writable.destroy()
  59133. }
  59134. this.emit('close')
  59135. }
  59136. Duplexify.prototype._write = function(data, enc, cb) {
  59137. if (this.destroyed) return cb()
  59138. if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb))
  59139. if (data === SIGNAL_FLUSH) return this._finish(cb)
  59140. if (!this._writable) return cb()
  59141. if (this._writable.write(data) === false) this._ondrain = cb
  59142. else cb()
  59143. }
  59144. Duplexify.prototype._finish = function(cb) {
  59145. var self = this
  59146. this.emit('preend')
  59147. onuncork(this, function() {
  59148. end(self._forwardEnd && self._writable, function() {
  59149. // haxx to not emit prefinish twice
  59150. if (self._writableState.prefinished === false) self._writableState.prefinished = true
  59151. self.emit('prefinish')
  59152. onuncork(self, cb)
  59153. })
  59154. })
  59155. }
  59156. Duplexify.prototype.end = function(data, enc, cb) {
  59157. if (typeof data === 'function') return this.end(null, null, data)
  59158. if (typeof enc === 'function') return this.end(data, null, enc)
  59159. this._ended = true
  59160. if (data) this.write(data)
  59161. if (!this._writableState.ending) this.write(SIGNAL_FLUSH)
  59162. return stream.Writable.prototype.end.call(this, cb)
  59163. }
  59164. module.exports = Duplexify
  59165. /***/ }),
  59166. /* 350 */
  59167. /***/ (function(module, exports, __webpack_require__) {
  59168. var crypto = __webpack_require__(21);
  59169. var BigInteger = __webpack_require__(79).BigInteger;
  59170. var ECPointFp = __webpack_require__(130).ECPointFp;
  59171. var Buffer = __webpack_require__(20).Buffer;
  59172. exports.ECCurves = __webpack_require__(661);
  59173. // zero prepad
  59174. function unstupid(hex,len)
  59175. {
  59176. return (hex.length >= len) ? hex : unstupid("0"+hex,len);
  59177. }
  59178. exports.ECKey = function(curve, key, isPublic)
  59179. {
  59180. var priv;
  59181. var c = curve();
  59182. var n = c.getN();
  59183. var bytes = Math.floor(n.bitLength()/8);
  59184. if(key)
  59185. {
  59186. if(isPublic)
  59187. {
  59188. var curve = c.getCurve();
  59189. // var x = key.slice(1,bytes+1); // skip the 04 for uncompressed format
  59190. // var y = key.slice(bytes+1);
  59191. // this.P = new ECPointFp(curve,
  59192. // curve.fromBigInteger(new BigInteger(x.toString("hex"), 16)),
  59193. // curve.fromBigInteger(new BigInteger(y.toString("hex"), 16)));
  59194. this.P = curve.decodePointHex(key.toString("hex"));
  59195. }else{
  59196. if(key.length != bytes) return false;
  59197. priv = new BigInteger(key.toString("hex"), 16);
  59198. }
  59199. }else{
  59200. var n1 = n.subtract(BigInteger.ONE);
  59201. var r = new BigInteger(crypto.randomBytes(n.bitLength()));
  59202. priv = r.mod(n1).add(BigInteger.ONE);
  59203. this.P = c.getG().multiply(priv);
  59204. }
  59205. if(this.P)
  59206. {
  59207. // var pubhex = unstupid(this.P.getX().toBigInteger().toString(16),bytes*2)+unstupid(this.P.getY().toBigInteger().toString(16),bytes*2);
  59208. // this.PublicKey = Buffer.from("04"+pubhex,"hex");
  59209. this.PublicKey = Buffer.from(c.getCurve().encodeCompressedPointHex(this.P),"hex");
  59210. }
  59211. if(priv)
  59212. {
  59213. this.PrivateKey = Buffer.from(unstupid(priv.toString(16),bytes*2),"hex");
  59214. this.deriveSharedSecret = function(key)
  59215. {
  59216. if(!key || !key.P) return false;
  59217. var S = key.P.multiply(priv);
  59218. return Buffer.from(unstupid(S.getX().toBigInteger().toString(16),bytes*2),"hex");
  59219. }
  59220. }
  59221. }
  59222. /***/ }),
  59223. /* 351 */
  59224. /***/ (function(module, exports, __webpack_require__) {
  59225. "use strict";
  59226. var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
  59227. module.exports = function (str) {
  59228. if (typeof str !== 'string') {
  59229. throw new TypeError('Expected a string');
  59230. }
  59231. return str.replace(matchOperatorsRe, '\\$&');
  59232. };
  59233. /***/ }),
  59234. /* 352 */
  59235. /***/ (function(module, exports, __webpack_require__) {
  59236. "use strict";
  59237. module.exports = function (data, opts) {
  59238. if (!opts) opts = {};
  59239. if (typeof opts === 'function') opts = { cmp: opts };
  59240. var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;
  59241. var cmp = opts.cmp && (function (f) {
  59242. return function (node) {
  59243. return function (a, b) {
  59244. var aobj = { key: a, value: node[a] };
  59245. var bobj = { key: b, value: node[b] };
  59246. return f(aobj, bobj);
  59247. };
  59248. };
  59249. })(opts.cmp);
  59250. var seen = [];
  59251. return (function stringify (node) {
  59252. if (node && node.toJSON && typeof node.toJSON === 'function') {
  59253. node = node.toJSON();
  59254. }
  59255. if (node === undefined) return;
  59256. if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';
  59257. if (typeof node !== 'object') return JSON.stringify(node);
  59258. var i, out;
  59259. if (Array.isArray(node)) {
  59260. out = '[';
  59261. for (i = 0; i < node.length; i++) {
  59262. if (i) out += ',';
  59263. out += stringify(node[i]) || 'null';
  59264. }
  59265. return out + ']';
  59266. }
  59267. if (node === null) return 'null';
  59268. if (seen.indexOf(node) !== -1) {
  59269. if (cycles) return JSON.stringify('__cycle__');
  59270. throw new TypeError('Converting circular structure to JSON');
  59271. }
  59272. var seenIndex = seen.push(node) - 1;
  59273. var keys = Object.keys(node).sort(cmp && cmp(node));
  59274. out = '';
  59275. for (i = 0; i < keys.length; i++) {
  59276. var key = keys[i];
  59277. var value = stringify(node[key]);
  59278. if (!value) continue;
  59279. if (out) out += ',';
  59280. out += JSON.stringify(key) + ':' + value;
  59281. }
  59282. seen.splice(seenIndex, 1);
  59283. return '{' + out + '}';
  59284. })(data);
  59285. };
  59286. /***/ }),
  59287. /* 353 */
  59288. /***/ (function(module, exports, __webpack_require__) {
  59289. module.exports = realpath
  59290. realpath.realpath = realpath
  59291. realpath.sync = realpathSync
  59292. realpath.realpathSync = realpathSync
  59293. realpath.monkeypatch = monkeypatch
  59294. realpath.unmonkeypatch = unmonkeypatch
  59295. var fs = __webpack_require__(12)
  59296. var origRealpath = fs.realpath
  59297. var origRealpathSync = fs.realpathSync
  59298. var version = process.version
  59299. var ok = /^v[0-5]\./.test(version)
  59300. var old = __webpack_require__(676)
  59301. function newError (er) {
  59302. return er && er.syscall === 'realpath' && (
  59303. er.code === 'ELOOP' ||
  59304. er.code === 'ENOMEM' ||
  59305. er.code === 'ENAMETOOLONG'
  59306. )
  59307. }
  59308. function realpath (p, cache, cb) {
  59309. if (ok) {
  59310. return origRealpath(p, cache, cb)
  59311. }
  59312. if (typeof cache === 'function') {
  59313. cb = cache
  59314. cache = null
  59315. }
  59316. origRealpath(p, cache, function (er, result) {
  59317. if (newError(er)) {
  59318. old.realpath(p, cache, cb)
  59319. } else {
  59320. cb(er, result)
  59321. }
  59322. })
  59323. }
  59324. function realpathSync (p, cache) {
  59325. if (ok) {
  59326. return origRealpathSync(p, cache)
  59327. }
  59328. try {
  59329. return origRealpathSync(p, cache)
  59330. } catch (er) {
  59331. if (newError(er)) {
  59332. return old.realpathSync(p, cache)
  59333. } else {
  59334. throw er
  59335. }
  59336. }
  59337. }
  59338. function monkeypatch () {
  59339. fs.realpath = realpath
  59340. fs.realpathSync = realpathSync
  59341. }
  59342. function unmonkeypatch () {
  59343. fs.realpath = origRealpath
  59344. fs.realpathSync = origRealpathSync
  59345. }
  59346. /***/ }),
  59347. /* 354 */
  59348. /***/ (function(module, exports, __webpack_require__) {
  59349. exports.alphasort = alphasort
  59350. exports.alphasorti = alphasorti
  59351. exports.setopts = setopts
  59352. exports.ownProp = ownProp
  59353. exports.makeAbs = makeAbs
  59354. exports.finish = finish
  59355. exports.mark = mark
  59356. exports.isIgnored = isIgnored
  59357. exports.childrenIgnored = childrenIgnored
  59358. function ownProp (obj, field) {
  59359. return Object.prototype.hasOwnProperty.call(obj, field)
  59360. }
  59361. var path = __webpack_require__(1)
  59362. var minimatch = __webpack_require__(170)
  59363. var isAbsolute = __webpack_require__(245)
  59364. var Minimatch = minimatch.Minimatch
  59365. function alphasorti (a, b) {
  59366. return a.toLowerCase().localeCompare(b.toLowerCase())
  59367. }
  59368. function alphasort (a, b) {
  59369. return a.localeCompare(b)
  59370. }
  59371. function setupIgnores (self, options) {
  59372. self.ignore = options.ignore || []
  59373. if (!Array.isArray(self.ignore))
  59374. self.ignore = [self.ignore]
  59375. if (self.ignore.length) {
  59376. self.ignore = self.ignore.map(ignoreMap)
  59377. }
  59378. }
  59379. // ignore patterns are always in dot:true mode.
  59380. function ignoreMap (pattern) {
  59381. var gmatcher = null
  59382. if (pattern.slice(-3) === '/**') {
  59383. var gpattern = pattern.replace(/(\/\*\*)+$/, '')
  59384. gmatcher = new Minimatch(gpattern, { dot: true })
  59385. }
  59386. return {
  59387. matcher: new Minimatch(pattern, { dot: true }),
  59388. gmatcher: gmatcher
  59389. }
  59390. }
  59391. function setopts (self, pattern, options) {
  59392. if (!options)
  59393. options = {}
  59394. // base-matching: just use globstar for that.
  59395. if (options.matchBase && -1 === pattern.indexOf("/")) {
  59396. if (options.noglobstar) {
  59397. throw new Error("base matching requires globstar")
  59398. }
  59399. pattern = "**/" + pattern
  59400. }
  59401. self.silent = !!options.silent
  59402. self.pattern = pattern
  59403. self.strict = options.strict !== false
  59404. self.realpath = !!options.realpath
  59405. self.realpathCache = options.realpathCache || Object.create(null)
  59406. self.follow = !!options.follow
  59407. self.dot = !!options.dot
  59408. self.mark = !!options.mark
  59409. self.nodir = !!options.nodir
  59410. if (self.nodir)
  59411. self.mark = true
  59412. self.sync = !!options.sync
  59413. self.nounique = !!options.nounique
  59414. self.nonull = !!options.nonull
  59415. self.nosort = !!options.nosort
  59416. self.nocase = !!options.nocase
  59417. self.stat = !!options.stat
  59418. self.noprocess = !!options.noprocess
  59419. self.absolute = !!options.absolute
  59420. self.maxLength = options.maxLength || Infinity
  59421. self.cache = options.cache || Object.create(null)
  59422. self.statCache = options.statCache || Object.create(null)
  59423. self.symlinks = options.symlinks || Object.create(null)
  59424. setupIgnores(self, options)
  59425. self.changedCwd = false
  59426. var cwd = process.cwd()
  59427. if (!ownProp(options, "cwd"))
  59428. self.cwd = cwd
  59429. else {
  59430. self.cwd = path.resolve(options.cwd)
  59431. self.changedCwd = self.cwd !== cwd
  59432. }
  59433. self.root = options.root || path.resolve(self.cwd, "/")
  59434. self.root = path.resolve(self.root)
  59435. if (process.platform === "win32")
  59436. self.root = self.root.replace(/\\/g, "/")
  59437. // TODO: is an absolute `cwd` supposed to be resolved against `root`?
  59438. // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
  59439. self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)
  59440. if (process.platform === "win32")
  59441. self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")
  59442. self.nomount = !!options.nomount
  59443. // disable comments and negation in Minimatch.
  59444. // Note that they are not supported in Glob itself anyway.
  59445. options.nonegate = true
  59446. options.nocomment = true
  59447. self.minimatch = new Minimatch(pattern, options)
  59448. self.options = self.minimatch.options
  59449. }
  59450. function finish (self) {
  59451. var nou = self.nounique
  59452. var all = nou ? [] : Object.create(null)
  59453. for (var i = 0, l = self.matches.length; i < l; i ++) {
  59454. var matches = self.matches[i]
  59455. if (!matches || Object.keys(matches).length === 0) {
  59456. if (self.nonull) {
  59457. // do like the shell, and spit out the literal glob
  59458. var literal = self.minimatch.globSet[i]
  59459. if (nou)
  59460. all.push(literal)
  59461. else
  59462. all[literal] = true
  59463. }
  59464. } else {
  59465. // had matches
  59466. var m = Object.keys(matches)
  59467. if (nou)
  59468. all.push.apply(all, m)
  59469. else
  59470. m.forEach(function (m) {
  59471. all[m] = true
  59472. })
  59473. }
  59474. }
  59475. if (!nou)
  59476. all = Object.keys(all)
  59477. if (!self.nosort)
  59478. all = all.sort(self.nocase ? alphasorti : alphasort)
  59479. // at *some* point we statted all of these
  59480. if (self.mark) {
  59481. for (var i = 0; i < all.length; i++) {
  59482. all[i] = self._mark(all[i])
  59483. }
  59484. if (self.nodir) {
  59485. all = all.filter(function (e) {
  59486. var notDir = !(/\/$/.test(e))
  59487. var c = self.cache[e] || self.cache[makeAbs(self, e)]
  59488. if (notDir && c)
  59489. notDir = c !== 'DIR' && !Array.isArray(c)
  59490. return notDir
  59491. })
  59492. }
  59493. }
  59494. if (self.ignore.length)
  59495. all = all.filter(function(m) {
  59496. return !isIgnored(self, m)
  59497. })
  59498. self.found = all
  59499. }
  59500. function mark (self, p) {
  59501. var abs = makeAbs(self, p)
  59502. var c = self.cache[abs]
  59503. var m = p
  59504. if (c) {
  59505. var isDir = c === 'DIR' || Array.isArray(c)
  59506. var slash = p.slice(-1) === '/'
  59507. if (isDir && !slash)
  59508. m += '/'
  59509. else if (!isDir && slash)
  59510. m = m.slice(0, -1)
  59511. if (m !== p) {
  59512. var mabs = makeAbs(self, m)
  59513. self.statCache[mabs] = self.statCache[abs]
  59514. self.cache[mabs] = self.cache[abs]
  59515. }
  59516. }
  59517. return m
  59518. }
  59519. // lotta situps...
  59520. function makeAbs (self, f) {
  59521. var abs = f
  59522. if (f.charAt(0) === '/') {
  59523. abs = path.join(self.root, f)
  59524. } else if (isAbsolute(f) || f === '') {
  59525. abs = f
  59526. } else if (self.changedCwd) {
  59527. abs = path.resolve(self.cwd, f)
  59528. } else {
  59529. abs = path.resolve(f)
  59530. }
  59531. if (process.platform === 'win32')
  59532. abs = abs.replace(/\\/g, '/')
  59533. return abs
  59534. }
  59535. // Return true, if pattern ends with globstar '**', for the accompanying parent directory.
  59536. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
  59537. function isIgnored (self, path) {
  59538. if (!self.ignore.length)
  59539. return false
  59540. return self.ignore.some(function(item) {
  59541. return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
  59542. })
  59543. }
  59544. function childrenIgnored (self, path) {
  59545. if (!self.ignore.length)
  59546. return false
  59547. return self.ignore.some(function(item) {
  59548. return !!(item.gmatcher && item.gmatcher.match(path))
  59549. })
  59550. }
  59551. /***/ }),
  59552. /* 355 */
  59553. /***/ (function(module, exports, __webpack_require__) {
  59554. "use strict";
  59555. var fs = __webpack_require__(12)
  59556. module.exports = clone(fs)
  59557. function clone (obj) {
  59558. if (obj === null || typeof obj !== 'object')
  59559. return obj
  59560. if (obj instanceof Object)
  59561. var copy = { __proto__: obj.__proto__ }
  59562. else
  59563. var copy = Object.create(null)
  59564. Object.getOwnPropertyNames(obj).forEach(function (key) {
  59565. Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
  59566. })
  59567. return copy
  59568. }
  59569. /***/ }),
  59570. /* 356 */
  59571. /***/ (function(module, exports, __webpack_require__) {
  59572. var fs = __webpack_require__(12)
  59573. var polyfills = __webpack_require__(681)
  59574. var legacy = __webpack_require__(680)
  59575. var queue = []
  59576. var util = __webpack_require__(9)
  59577. function noop () {}
  59578. var debug = noop
  59579. if (util.debuglog)
  59580. debug = util.debuglog('gfs4')
  59581. else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
  59582. debug = function() {
  59583. var m = util.format.apply(util, arguments)
  59584. m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
  59585. console.error(m)
  59586. }
  59587. if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
  59588. process.on('exit', function() {
  59589. debug(queue)
  59590. __webpack_require__(50).equal(queue.length, 0)
  59591. })
  59592. }
  59593. module.exports = patch(__webpack_require__(355))
  59594. if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) {
  59595. module.exports = patch(fs)
  59596. }
  59597. // Always patch fs.close/closeSync, because we want to
  59598. // retry() whenever a close happens *anywhere* in the program.
  59599. // This is essential when multiple graceful-fs instances are
  59600. // in play at the same time.
  59601. module.exports.close =
  59602. fs.close = (function (fs$close) { return function (fd, cb) {
  59603. return fs$close.call(fs, fd, function (err) {
  59604. if (!err)
  59605. retry()
  59606. if (typeof cb === 'function')
  59607. cb.apply(this, arguments)
  59608. })
  59609. }})(fs.close)
  59610. module.exports.closeSync =
  59611. fs.closeSync = (function (fs$closeSync) { return function (fd) {
  59612. // Note that graceful-fs also retries when fs.closeSync() fails.
  59613. // Looks like a bug to me, although it's probably a harmless one.
  59614. var rval = fs$closeSync.apply(fs, arguments)
  59615. retry()
  59616. return rval
  59617. }})(fs.closeSync)
  59618. function patch (fs) {
  59619. // Everything that references the open() function needs to be in here
  59620. polyfills(fs)
  59621. fs.gracefulify = patch
  59622. fs.FileReadStream = ReadStream; // Legacy name.
  59623. fs.FileWriteStream = WriteStream; // Legacy name.
  59624. fs.createReadStream = createReadStream
  59625. fs.createWriteStream = createWriteStream
  59626. var fs$readFile = fs.readFile
  59627. fs.readFile = readFile
  59628. function readFile (path, options, cb) {
  59629. if (typeof options === 'function')
  59630. cb = options, options = null
  59631. return go$readFile(path, options, cb)
  59632. function go$readFile (path, options, cb) {
  59633. return fs$readFile(path, options, function (err) {
  59634. if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
  59635. enqueue([go$readFile, [path, options, cb]])
  59636. else {
  59637. if (typeof cb === 'function')
  59638. cb.apply(this, arguments)
  59639. retry()
  59640. }
  59641. })
  59642. }
  59643. }
  59644. var fs$writeFile = fs.writeFile
  59645. fs.writeFile = writeFile
  59646. function writeFile (path, data, options, cb) {
  59647. if (typeof options === 'function')
  59648. cb = options, options = null
  59649. return go$writeFile(path, data, options, cb)
  59650. function go$writeFile (path, data, options, cb) {
  59651. return fs$writeFile(path, data, options, function (err) {
  59652. if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
  59653. enqueue([go$writeFile, [path, data, options, cb]])
  59654. else {
  59655. if (typeof cb === 'function')
  59656. cb.apply(this, arguments)
  59657. retry()
  59658. }
  59659. })
  59660. }
  59661. }
  59662. var fs$appendFile = fs.appendFile
  59663. if (fs$appendFile)
  59664. fs.appendFile = appendFile
  59665. function appendFile (path, data, options, cb) {
  59666. if (typeof options === 'function')
  59667. cb = options, options = null
  59668. return go$appendFile(path, data, options, cb)
  59669. function go$appendFile (path, data, options, cb) {
  59670. return fs$appendFile(path, data, options, function (err) {
  59671. if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
  59672. enqueue([go$appendFile, [path, data, options, cb]])
  59673. else {
  59674. if (typeof cb === 'function')
  59675. cb.apply(this, arguments)
  59676. retry()
  59677. }
  59678. })
  59679. }
  59680. }
  59681. var fs$readdir = fs.readdir
  59682. fs.readdir = readdir
  59683. function readdir (path, options, cb) {
  59684. var args = [path]
  59685. if (typeof options !== 'function') {
  59686. args.push(options)
  59687. } else {
  59688. cb = options
  59689. }
  59690. args.push(go$readdir$cb)
  59691. return go$readdir(args)
  59692. function go$readdir$cb (err, files) {
  59693. if (files && files.sort)
  59694. files.sort()
  59695. if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
  59696. enqueue([go$readdir, [args]])
  59697. else {
  59698. if (typeof cb === 'function')
  59699. cb.apply(this, arguments)
  59700. retry()
  59701. }
  59702. }
  59703. }
  59704. function go$readdir (args) {
  59705. return fs$readdir.apply(fs, args)
  59706. }
  59707. if (process.version.substr(0, 4) === 'v0.8') {
  59708. var legStreams = legacy(fs)
  59709. ReadStream = legStreams.ReadStream
  59710. WriteStream = legStreams.WriteStream
  59711. }
  59712. var fs$ReadStream = fs.ReadStream
  59713. ReadStream.prototype = Object.create(fs$ReadStream.prototype)
  59714. ReadStream.prototype.open = ReadStream$open
  59715. var fs$WriteStream = fs.WriteStream
  59716. WriteStream.prototype = Object.create(fs$WriteStream.prototype)
  59717. WriteStream.prototype.open = WriteStream$open
  59718. fs.ReadStream = ReadStream
  59719. fs.WriteStream = WriteStream
  59720. function ReadStream (path, options) {
  59721. if (this instanceof ReadStream)
  59722. return fs$ReadStream.apply(this, arguments), this
  59723. else
  59724. return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
  59725. }
  59726. function ReadStream$open () {
  59727. var that = this
  59728. open(that.path, that.flags, that.mode, function (err, fd) {
  59729. if (err) {
  59730. if (that.autoClose)
  59731. that.destroy()
  59732. that.emit('error', err)
  59733. } else {
  59734. that.fd = fd
  59735. that.emit('open', fd)
  59736. that.read()
  59737. }
  59738. })
  59739. }
  59740. function WriteStream (path, options) {
  59741. if (this instanceof WriteStream)
  59742. return fs$WriteStream.apply(this, arguments), this
  59743. else
  59744. return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
  59745. }
  59746. function WriteStream$open () {
  59747. var that = this
  59748. open(that.path, that.flags, that.mode, function (err, fd) {
  59749. if (err) {
  59750. that.destroy()
  59751. that.emit('error', err)
  59752. } else {
  59753. that.fd = fd
  59754. that.emit('open', fd)
  59755. }
  59756. })
  59757. }
  59758. function createReadStream (path, options) {
  59759. return new ReadStream(path, options)
  59760. }
  59761. function createWriteStream (path, options) {
  59762. return new WriteStream(path, options)
  59763. }
  59764. var fs$open = fs.open
  59765. fs.open = open
  59766. function open (path, flags, mode, cb) {
  59767. if (typeof mode === 'function')
  59768. cb = mode, mode = null
  59769. return go$open(path, flags, mode, cb)
  59770. function go$open (path, flags, mode, cb) {
  59771. return fs$open(path, flags, mode, function (err, fd) {
  59772. if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
  59773. enqueue([go$open, [path, flags, mode, cb]])
  59774. else {
  59775. if (typeof cb === 'function')
  59776. cb.apply(this, arguments)
  59777. retry()
  59778. }
  59779. })
  59780. }
  59781. }
  59782. return fs
  59783. }
  59784. function enqueue (elem) {
  59785. debug('ENQUEUE', elem[0].name, elem[1])
  59786. queue.push(elem)
  59787. }
  59788. function retry () {
  59789. var elem = queue.shift()
  59790. if (elem) {
  59791. debug('RETRY', elem[0].name, elem[1])
  59792. elem[0].apply(null, elem[1])
  59793. }
  59794. }
  59795. /***/ }),
  59796. /* 357 */
  59797. /***/ (function(module, exports, __webpack_require__) {
  59798. "use strict";
  59799. var util = __webpack_require__(106);
  59800. module.exports = SchemaObject;
  59801. function SchemaObject(obj) {
  59802. util.copy(obj, this);
  59803. }
  59804. /***/ }),
  59805. /* 358 */
  59806. /***/ (function(module, exports, __webpack_require__) {
  59807. "use strict";
  59808. module.exports = function generate__limit(it, $keyword, $ruleType) {
  59809. var out = ' ';
  59810. var $lvl = it.level;
  59811. var $dataLvl = it.dataLevel;
  59812. var $schema = it.schema[$keyword];
  59813. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  59814. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  59815. var $breakOnError = !it.opts.allErrors;
  59816. var $errorKeyword;
  59817. var $data = 'data' + ($dataLvl || '');
  59818. var $isData = it.opts.$data && $schema && $schema.$data,
  59819. $schemaValue;
  59820. if ($isData) {
  59821. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  59822. $schemaValue = 'schema' + $lvl;
  59823. } else {
  59824. $schemaValue = $schema;
  59825. }
  59826. var $isMax = $keyword == 'maximum',
  59827. $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum',
  59828. $schemaExcl = it.schema[$exclusiveKeyword],
  59829. $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data,
  59830. $op = $isMax ? '<' : '>',
  59831. $notOp = $isMax ? '>' : '<',
  59832. $errorKeyword = undefined;
  59833. if ($isDataExcl) {
  59834. var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),
  59835. $exclusive = 'exclusive' + $lvl,
  59836. $exclType = 'exclType' + $lvl,
  59837. $exclIsNumber = 'exclIsNumber' + $lvl,
  59838. $opExpr = 'op' + $lvl,
  59839. $opStr = '\' + ' + $opExpr + ' + \'';
  59840. out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; ';
  59841. $schemaValueExcl = 'schemaExcl' + $lvl;
  59842. out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { ';
  59843. var $errorKeyword = $exclusiveKeyword;
  59844. var $$outStack = $$outStack || [];
  59845. $$outStack.push(out);
  59846. out = ''; /* istanbul ignore else */
  59847. if (it.createErrors !== false) {
  59848. out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
  59849. if (it.opts.messages !== false) {
  59850. out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' ';
  59851. }
  59852. if (it.opts.verbose) {
  59853. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  59854. }
  59855. out += ' } ';
  59856. } else {
  59857. out += ' {} ';
  59858. }
  59859. var __err = out;
  59860. out = $$outStack.pop();
  59861. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  59862. if (it.async) {
  59863. out += ' throw new ValidationError([' + (__err) + ']); ';
  59864. } else {
  59865. out += ' validate.errors = [' + (__err) + ']; return false; ';
  59866. }
  59867. } else {
  59868. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  59869. }
  59870. out += ' } else if ( ';
  59871. if ($isData) {
  59872. out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  59873. }
  59874. out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';';
  59875. } else {
  59876. var $exclIsNumber = typeof $schemaExcl == 'number',
  59877. $opStr = $op;
  59878. if ($exclIsNumber && $isData) {
  59879. var $opExpr = '\'' + $opStr + '\'';
  59880. out += ' if ( ';
  59881. if ($isData) {
  59882. out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  59883. }
  59884. out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { ';
  59885. } else {
  59886. if ($exclIsNumber && $schema === undefined) {
  59887. $exclusive = true;
  59888. $errorKeyword = $exclusiveKeyword;
  59889. $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
  59890. $schemaValue = $schemaExcl;
  59891. $notOp += '=';
  59892. } else {
  59893. if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema);
  59894. if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) {
  59895. $exclusive = true;
  59896. $errorKeyword = $exclusiveKeyword;
  59897. $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
  59898. $notOp += '=';
  59899. } else {
  59900. $exclusive = false;
  59901. $opStr += '=';
  59902. }
  59903. }
  59904. var $opExpr = '\'' + $opStr + '\'';
  59905. out += ' if ( ';
  59906. if ($isData) {
  59907. out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  59908. }
  59909. out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { ';
  59910. }
  59911. }
  59912. $errorKeyword = $errorKeyword || $keyword;
  59913. var $$outStack = $$outStack || [];
  59914. $$outStack.push(out);
  59915. out = ''; /* istanbul ignore else */
  59916. if (it.createErrors !== false) {
  59917. out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } ';
  59918. if (it.opts.messages !== false) {
  59919. out += ' , message: \'should be ' + ($opStr) + ' ';
  59920. if ($isData) {
  59921. out += '\' + ' + ($schemaValue);
  59922. } else {
  59923. out += '' + ($schemaValue) + '\'';
  59924. }
  59925. }
  59926. if (it.opts.verbose) {
  59927. out += ' , schema: ';
  59928. if ($isData) {
  59929. out += 'validate.schema' + ($schemaPath);
  59930. } else {
  59931. out += '' + ($schema);
  59932. }
  59933. out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  59934. }
  59935. out += ' } ';
  59936. } else {
  59937. out += ' {} ';
  59938. }
  59939. var __err = out;
  59940. out = $$outStack.pop();
  59941. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  59942. if (it.async) {
  59943. out += ' throw new ValidationError([' + (__err) + ']); ';
  59944. } else {
  59945. out += ' validate.errors = [' + (__err) + ']; return false; ';
  59946. }
  59947. } else {
  59948. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  59949. }
  59950. out += ' } ';
  59951. if ($breakOnError) {
  59952. out += ' else { ';
  59953. }
  59954. return out;
  59955. }
  59956. /***/ }),
  59957. /* 359 */
  59958. /***/ (function(module, exports, __webpack_require__) {
  59959. "use strict";
  59960. module.exports = function generate__limitItems(it, $keyword, $ruleType) {
  59961. var out = ' ';
  59962. var $lvl = it.level;
  59963. var $dataLvl = it.dataLevel;
  59964. var $schema = it.schema[$keyword];
  59965. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  59966. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  59967. var $breakOnError = !it.opts.allErrors;
  59968. var $errorKeyword;
  59969. var $data = 'data' + ($dataLvl || '');
  59970. var $isData = it.opts.$data && $schema && $schema.$data,
  59971. $schemaValue;
  59972. if ($isData) {
  59973. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  59974. $schemaValue = 'schema' + $lvl;
  59975. } else {
  59976. $schemaValue = $schema;
  59977. }
  59978. var $op = $keyword == 'maxItems' ? '>' : '<';
  59979. out += 'if ( ';
  59980. if ($isData) {
  59981. out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  59982. }
  59983. out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { ';
  59984. var $errorKeyword = $keyword;
  59985. var $$outStack = $$outStack || [];
  59986. $$outStack.push(out);
  59987. out = ''; /* istanbul ignore else */
  59988. if (it.createErrors !== false) {
  59989. out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
  59990. if (it.opts.messages !== false) {
  59991. out += ' , message: \'should NOT have ';
  59992. if ($keyword == 'maxItems') {
  59993. out += 'more';
  59994. } else {
  59995. out += 'less';
  59996. }
  59997. out += ' than ';
  59998. if ($isData) {
  59999. out += '\' + ' + ($schemaValue) + ' + \'';
  60000. } else {
  60001. out += '' + ($schema);
  60002. }
  60003. out += ' items\' ';
  60004. }
  60005. if (it.opts.verbose) {
  60006. out += ' , schema: ';
  60007. if ($isData) {
  60008. out += 'validate.schema' + ($schemaPath);
  60009. } else {
  60010. out += '' + ($schema);
  60011. }
  60012. out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  60013. }
  60014. out += ' } ';
  60015. } else {
  60016. out += ' {} ';
  60017. }
  60018. var __err = out;
  60019. out = $$outStack.pop();
  60020. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  60021. if (it.async) {
  60022. out += ' throw new ValidationError([' + (__err) + ']); ';
  60023. } else {
  60024. out += ' validate.errors = [' + (__err) + ']; return false; ';
  60025. }
  60026. } else {
  60027. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  60028. }
  60029. out += '} ';
  60030. if ($breakOnError) {
  60031. out += ' else { ';
  60032. }
  60033. return out;
  60034. }
  60035. /***/ }),
  60036. /* 360 */
  60037. /***/ (function(module, exports, __webpack_require__) {
  60038. "use strict";
  60039. module.exports = function generate__limitLength(it, $keyword, $ruleType) {
  60040. var out = ' ';
  60041. var $lvl = it.level;
  60042. var $dataLvl = it.dataLevel;
  60043. var $schema = it.schema[$keyword];
  60044. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  60045. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  60046. var $breakOnError = !it.opts.allErrors;
  60047. var $errorKeyword;
  60048. var $data = 'data' + ($dataLvl || '');
  60049. var $isData = it.opts.$data && $schema && $schema.$data,
  60050. $schemaValue;
  60051. if ($isData) {
  60052. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  60053. $schemaValue = 'schema' + $lvl;
  60054. } else {
  60055. $schemaValue = $schema;
  60056. }
  60057. var $op = $keyword == 'maxLength' ? '>' : '<';
  60058. out += 'if ( ';
  60059. if ($isData) {
  60060. out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  60061. }
  60062. if (it.opts.unicode === false) {
  60063. out += ' ' + ($data) + '.length ';
  60064. } else {
  60065. out += ' ucs2length(' + ($data) + ') ';
  60066. }
  60067. out += ' ' + ($op) + ' ' + ($schemaValue) + ') { ';
  60068. var $errorKeyword = $keyword;
  60069. var $$outStack = $$outStack || [];
  60070. $$outStack.push(out);
  60071. out = ''; /* istanbul ignore else */
  60072. if (it.createErrors !== false) {
  60073. out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
  60074. if (it.opts.messages !== false) {
  60075. out += ' , message: \'should NOT be ';
  60076. if ($keyword == 'maxLength') {
  60077. out += 'longer';
  60078. } else {
  60079. out += 'shorter';
  60080. }
  60081. out += ' than ';
  60082. if ($isData) {
  60083. out += '\' + ' + ($schemaValue) + ' + \'';
  60084. } else {
  60085. out += '' + ($schema);
  60086. }
  60087. out += ' characters\' ';
  60088. }
  60089. if (it.opts.verbose) {
  60090. out += ' , schema: ';
  60091. if ($isData) {
  60092. out += 'validate.schema' + ($schemaPath);
  60093. } else {
  60094. out += '' + ($schema);
  60095. }
  60096. out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  60097. }
  60098. out += ' } ';
  60099. } else {
  60100. out += ' {} ';
  60101. }
  60102. var __err = out;
  60103. out = $$outStack.pop();
  60104. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  60105. if (it.async) {
  60106. out += ' throw new ValidationError([' + (__err) + ']); ';
  60107. } else {
  60108. out += ' validate.errors = [' + (__err) + ']; return false; ';
  60109. }
  60110. } else {
  60111. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  60112. }
  60113. out += '} ';
  60114. if ($breakOnError) {
  60115. out += ' else { ';
  60116. }
  60117. return out;
  60118. }
  60119. /***/ }),
  60120. /* 361 */
  60121. /***/ (function(module, exports, __webpack_require__) {
  60122. "use strict";
  60123. module.exports = function generate__limitProperties(it, $keyword, $ruleType) {
  60124. var out = ' ';
  60125. var $lvl = it.level;
  60126. var $dataLvl = it.dataLevel;
  60127. var $schema = it.schema[$keyword];
  60128. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  60129. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  60130. var $breakOnError = !it.opts.allErrors;
  60131. var $errorKeyword;
  60132. var $data = 'data' + ($dataLvl || '');
  60133. var $isData = it.opts.$data && $schema && $schema.$data,
  60134. $schemaValue;
  60135. if ($isData) {
  60136. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  60137. $schemaValue = 'schema' + $lvl;
  60138. } else {
  60139. $schemaValue = $schema;
  60140. }
  60141. var $op = $keyword == 'maxProperties' ? '>' : '<';
  60142. out += 'if ( ';
  60143. if ($isData) {
  60144. out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  60145. }
  60146. out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { ';
  60147. var $errorKeyword = $keyword;
  60148. var $$outStack = $$outStack || [];
  60149. $$outStack.push(out);
  60150. out = ''; /* istanbul ignore else */
  60151. if (it.createErrors !== false) {
  60152. out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
  60153. if (it.opts.messages !== false) {
  60154. out += ' , message: \'should NOT have ';
  60155. if ($keyword == 'maxProperties') {
  60156. out += 'more';
  60157. } else {
  60158. out += 'less';
  60159. }
  60160. out += ' than ';
  60161. if ($isData) {
  60162. out += '\' + ' + ($schemaValue) + ' + \'';
  60163. } else {
  60164. out += '' + ($schema);
  60165. }
  60166. out += ' properties\' ';
  60167. }
  60168. if (it.opts.verbose) {
  60169. out += ' , schema: ';
  60170. if ($isData) {
  60171. out += 'validate.schema' + ($schemaPath);
  60172. } else {
  60173. out += '' + ($schema);
  60174. }
  60175. out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  60176. }
  60177. out += ' } ';
  60178. } else {
  60179. out += ' {} ';
  60180. }
  60181. var __err = out;
  60182. out = $$outStack.pop();
  60183. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  60184. if (it.async) {
  60185. out += ' throw new ValidationError([' + (__err) + ']); ';
  60186. } else {
  60187. out += ' validate.errors = [' + (__err) + ']; return false; ';
  60188. }
  60189. } else {
  60190. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  60191. }
  60192. out += '} ';
  60193. if ($breakOnError) {
  60194. out += ' else { ';
  60195. }
  60196. return out;
  60197. }
  60198. /***/ }),
  60199. /* 362 */
  60200. /***/ (function(module, exports, __webpack_require__) {
  60201. "use strict";
  60202. module.exports = function generate_validate(it, $keyword, $ruleType) {
  60203. var out = '';
  60204. var $async = it.schema.$async === true,
  60205. $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),
  60206. $id = it.self._getId(it.schema);
  60207. if (it.isTop) {
  60208. if ($async) {
  60209. it.async = true;
  60210. var $es7 = it.opts.async == 'es7';
  60211. it.yieldAwait = $es7 ? 'await' : 'yield';
  60212. }
  60213. out += ' var validate = ';
  60214. if ($async) {
  60215. if ($es7) {
  60216. out += ' (async function ';
  60217. } else {
  60218. if (it.opts.async != '*') {
  60219. out += 'co.wrap';
  60220. }
  60221. out += '(function* ';
  60222. }
  60223. } else {
  60224. out += ' (function ';
  60225. }
  60226. out += ' (data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; ';
  60227. if ($id && (it.opts.sourceCode || it.opts.processCode)) {
  60228. out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' ';
  60229. }
  60230. }
  60231. if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) {
  60232. var $keyword = 'false schema';
  60233. var $lvl = it.level;
  60234. var $dataLvl = it.dataLevel;
  60235. var $schema = it.schema[$keyword];
  60236. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  60237. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  60238. var $breakOnError = !it.opts.allErrors;
  60239. var $errorKeyword;
  60240. var $data = 'data' + ($dataLvl || '');
  60241. var $valid = 'valid' + $lvl;
  60242. if (it.schema === false) {
  60243. if (it.isTop) {
  60244. $breakOnError = true;
  60245. } else {
  60246. out += ' var ' + ($valid) + ' = false; ';
  60247. }
  60248. var $$outStack = $$outStack || [];
  60249. $$outStack.push(out);
  60250. out = ''; /* istanbul ignore else */
  60251. if (it.createErrors !== false) {
  60252. out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
  60253. if (it.opts.messages !== false) {
  60254. out += ' , message: \'boolean schema is false\' ';
  60255. }
  60256. if (it.opts.verbose) {
  60257. out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  60258. }
  60259. out += ' } ';
  60260. } else {
  60261. out += ' {} ';
  60262. }
  60263. var __err = out;
  60264. out = $$outStack.pop();
  60265. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  60266. if (it.async) {
  60267. out += ' throw new ValidationError([' + (__err) + ']); ';
  60268. } else {
  60269. out += ' validate.errors = [' + (__err) + ']; return false; ';
  60270. }
  60271. } else {
  60272. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  60273. }
  60274. } else {
  60275. if (it.isTop) {
  60276. if ($async) {
  60277. out += ' return data; ';
  60278. } else {
  60279. out += ' validate.errors = null; return true; ';
  60280. }
  60281. } else {
  60282. out += ' var ' + ($valid) + ' = true; ';
  60283. }
  60284. }
  60285. if (it.isTop) {
  60286. out += ' }); return validate; ';
  60287. }
  60288. return out;
  60289. }
  60290. if (it.isTop) {
  60291. var $top = it.isTop,
  60292. $lvl = it.level = 0,
  60293. $dataLvl = it.dataLevel = 0,
  60294. $data = 'data';
  60295. it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));
  60296. it.baseId = it.baseId || it.rootId;
  60297. delete it.isTop;
  60298. it.dataPathArr = [undefined];
  60299. out += ' var vErrors = null; ';
  60300. out += ' var errors = 0; ';
  60301. out += ' if (rootData === undefined) rootData = data; ';
  60302. } else {
  60303. var $lvl = it.level,
  60304. $dataLvl = it.dataLevel,
  60305. $data = 'data' + ($dataLvl || '');
  60306. if ($id) it.baseId = it.resolve.url(it.baseId, $id);
  60307. if ($async && !it.async) throw new Error('async schema in sync schema');
  60308. out += ' var errs_' + ($lvl) + ' = errors;';
  60309. }
  60310. var $valid = 'valid' + $lvl,
  60311. $breakOnError = !it.opts.allErrors,
  60312. $closingBraces1 = '',
  60313. $closingBraces2 = '';
  60314. var $errorKeyword;
  60315. var $typeSchema = it.schema.type,
  60316. $typeIsArray = Array.isArray($typeSchema);
  60317. if ($typeIsArray && $typeSchema.length == 1) {
  60318. $typeSchema = $typeSchema[0];
  60319. $typeIsArray = false;
  60320. }
  60321. if (it.schema.$ref && $refKeywords) {
  60322. if (it.opts.extendRefs == 'fail') {
  60323. throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)');
  60324. } else if (it.opts.extendRefs !== true) {
  60325. $refKeywords = false;
  60326. it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"');
  60327. }
  60328. }
  60329. if ($typeSchema) {
  60330. if (it.opts.coerceTypes) {
  60331. var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema);
  60332. }
  60333. var $rulesGroup = it.RULES.types[$typeSchema];
  60334. if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) {
  60335. var $schemaPath = it.schemaPath + '.type',
  60336. $errSchemaPath = it.errSchemaPath + '/type';
  60337. var $schemaPath = it.schemaPath + '.type',
  60338. $errSchemaPath = it.errSchemaPath + '/type',
  60339. $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';
  60340. out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { ';
  60341. if ($coerceToTypes) {
  60342. var $dataType = 'dataType' + $lvl,
  60343. $coerced = 'coerced' + $lvl;
  60344. out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; ';
  60345. if (it.opts.coerceTypes == 'array') {
  60346. out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; ';
  60347. }
  60348. out += ' var ' + ($coerced) + ' = undefined; ';
  60349. var $bracesCoercion = '';
  60350. var arr1 = $coerceToTypes;
  60351. if (arr1) {
  60352. var $type, $i = -1,
  60353. l1 = arr1.length - 1;
  60354. while ($i < l1) {
  60355. $type = arr1[$i += 1];
  60356. if ($i) {
  60357. out += ' if (' + ($coerced) + ' === undefined) { ';
  60358. $bracesCoercion += '}';
  60359. }
  60360. if (it.opts.coerceTypes == 'array' && $type != 'array') {
  60361. out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } ';
  60362. }
  60363. if ($type == 'string') {
  60364. out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; ';
  60365. } else if ($type == 'number' || $type == 'integer') {
  60366. out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';
  60367. if ($type == 'integer') {
  60368. out += ' && !(' + ($data) + ' % 1)';
  60369. }
  60370. out += ')) ' + ($coerced) + ' = +' + ($data) + '; ';
  60371. } else if ($type == 'boolean') {
  60372. out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';
  60373. } else if ($type == 'null') {
  60374. out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';
  60375. } else if (it.opts.coerceTypes == 'array' && $type == 'array') {
  60376. out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';
  60377. }
  60378. }
  60379. }
  60380. out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { ';
  60381. var $$outStack = $$outStack || [];
  60382. $$outStack.push(out);
  60383. out = ''; /* istanbul ignore else */
  60384. if (it.createErrors !== false) {
  60385. out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
  60386. if ($typeIsArray) {
  60387. out += '' + ($typeSchema.join(","));
  60388. } else {
  60389. out += '' + ($typeSchema);
  60390. }
  60391. out += '\' } ';
  60392. if (it.opts.messages !== false) {
  60393. out += ' , message: \'should be ';
  60394. if ($typeIsArray) {
  60395. out += '' + ($typeSchema.join(","));
  60396. } else {
  60397. out += '' + ($typeSchema);
  60398. }
  60399. out += '\' ';
  60400. }
  60401. if (it.opts.verbose) {
  60402. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  60403. }
  60404. out += ' } ';
  60405. } else {
  60406. out += ' {} ';
  60407. }
  60408. var __err = out;
  60409. out = $$outStack.pop();
  60410. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  60411. if (it.async) {
  60412. out += ' throw new ValidationError([' + (__err) + ']); ';
  60413. } else {
  60414. out += ' validate.errors = [' + (__err) + ']; return false; ';
  60415. }
  60416. } else {
  60417. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  60418. }
  60419. out += ' } else { ';
  60420. var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
  60421. $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
  60422. out += ' ' + ($data) + ' = ' + ($coerced) + '; ';
  60423. if (!$dataLvl) {
  60424. out += 'if (' + ($parentData) + ' !== undefined)';
  60425. }
  60426. out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } ';
  60427. } else {
  60428. var $$outStack = $$outStack || [];
  60429. $$outStack.push(out);
  60430. out = ''; /* istanbul ignore else */
  60431. if (it.createErrors !== false) {
  60432. out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
  60433. if ($typeIsArray) {
  60434. out += '' + ($typeSchema.join(","));
  60435. } else {
  60436. out += '' + ($typeSchema);
  60437. }
  60438. out += '\' } ';
  60439. if (it.opts.messages !== false) {
  60440. out += ' , message: \'should be ';
  60441. if ($typeIsArray) {
  60442. out += '' + ($typeSchema.join(","));
  60443. } else {
  60444. out += '' + ($typeSchema);
  60445. }
  60446. out += '\' ';
  60447. }
  60448. if (it.opts.verbose) {
  60449. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  60450. }
  60451. out += ' } ';
  60452. } else {
  60453. out += ' {} ';
  60454. }
  60455. var __err = out;
  60456. out = $$outStack.pop();
  60457. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  60458. if (it.async) {
  60459. out += ' throw new ValidationError([' + (__err) + ']); ';
  60460. } else {
  60461. out += ' validate.errors = [' + (__err) + ']; return false; ';
  60462. }
  60463. } else {
  60464. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  60465. }
  60466. }
  60467. out += ' } ';
  60468. }
  60469. }
  60470. if (it.schema.$ref && !$refKeywords) {
  60471. out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' ';
  60472. if ($breakOnError) {
  60473. out += ' } if (errors === ';
  60474. if ($top) {
  60475. out += '0';
  60476. } else {
  60477. out += 'errs_' + ($lvl);
  60478. }
  60479. out += ') { ';
  60480. $closingBraces2 += '}';
  60481. }
  60482. } else {
  60483. if (it.opts.v5 && it.schema.patternGroups) {
  60484. it.logger.warn('keyword "patternGroups" is deprecated and disabled. Use option patternGroups: true to enable.');
  60485. }
  60486. var arr2 = it.RULES;
  60487. if (arr2) {
  60488. var $rulesGroup, i2 = -1,
  60489. l2 = arr2.length - 1;
  60490. while (i2 < l2) {
  60491. $rulesGroup = arr2[i2 += 1];
  60492. if ($shouldUseGroup($rulesGroup)) {
  60493. if ($rulesGroup.type) {
  60494. out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { ';
  60495. }
  60496. if (it.opts.useDefaults && !it.compositeRule) {
  60497. if ($rulesGroup.type == 'object' && it.schema.properties) {
  60498. var $schema = it.schema.properties,
  60499. $schemaKeys = Object.keys($schema);
  60500. var arr3 = $schemaKeys;
  60501. if (arr3) {
  60502. var $propertyKey, i3 = -1,
  60503. l3 = arr3.length - 1;
  60504. while (i3 < l3) {
  60505. $propertyKey = arr3[i3 += 1];
  60506. var $sch = $schema[$propertyKey];
  60507. if ($sch.default !== undefined) {
  60508. var $passData = $data + it.util.getProperty($propertyKey);
  60509. out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = ';
  60510. if (it.opts.useDefaults == 'shared') {
  60511. out += ' ' + (it.useDefault($sch.default)) + ' ';
  60512. } else {
  60513. out += ' ' + (JSON.stringify($sch.default)) + ' ';
  60514. }
  60515. out += '; ';
  60516. }
  60517. }
  60518. }
  60519. } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) {
  60520. var arr4 = it.schema.items;
  60521. if (arr4) {
  60522. var $sch, $i = -1,
  60523. l4 = arr4.length - 1;
  60524. while ($i < l4) {
  60525. $sch = arr4[$i += 1];
  60526. if ($sch.default !== undefined) {
  60527. var $passData = $data + '[' + $i + ']';
  60528. out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = ';
  60529. if (it.opts.useDefaults == 'shared') {
  60530. out += ' ' + (it.useDefault($sch.default)) + ' ';
  60531. } else {
  60532. out += ' ' + (JSON.stringify($sch.default)) + ' ';
  60533. }
  60534. out += '; ';
  60535. }
  60536. }
  60537. }
  60538. }
  60539. }
  60540. var arr5 = $rulesGroup.rules;
  60541. if (arr5) {
  60542. var $rule, i5 = -1,
  60543. l5 = arr5.length - 1;
  60544. while (i5 < l5) {
  60545. $rule = arr5[i5 += 1];
  60546. if ($shouldUseRule($rule)) {
  60547. var $code = $rule.code(it, $rule.keyword, $rulesGroup.type);
  60548. if ($code) {
  60549. out += ' ' + ($code) + ' ';
  60550. if ($breakOnError) {
  60551. $closingBraces1 += '}';
  60552. }
  60553. }
  60554. }
  60555. }
  60556. }
  60557. if ($breakOnError) {
  60558. out += ' ' + ($closingBraces1) + ' ';
  60559. $closingBraces1 = '';
  60560. }
  60561. if ($rulesGroup.type) {
  60562. out += ' } ';
  60563. if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) {
  60564. out += ' else { ';
  60565. var $schemaPath = it.schemaPath + '.type',
  60566. $errSchemaPath = it.errSchemaPath + '/type';
  60567. var $$outStack = $$outStack || [];
  60568. $$outStack.push(out);
  60569. out = ''; /* istanbul ignore else */
  60570. if (it.createErrors !== false) {
  60571. out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
  60572. if ($typeIsArray) {
  60573. out += '' + ($typeSchema.join(","));
  60574. } else {
  60575. out += '' + ($typeSchema);
  60576. }
  60577. out += '\' } ';
  60578. if (it.opts.messages !== false) {
  60579. out += ' , message: \'should be ';
  60580. if ($typeIsArray) {
  60581. out += '' + ($typeSchema.join(","));
  60582. } else {
  60583. out += '' + ($typeSchema);
  60584. }
  60585. out += '\' ';
  60586. }
  60587. if (it.opts.verbose) {
  60588. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  60589. }
  60590. out += ' } ';
  60591. } else {
  60592. out += ' {} ';
  60593. }
  60594. var __err = out;
  60595. out = $$outStack.pop();
  60596. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  60597. if (it.async) {
  60598. out += ' throw new ValidationError([' + (__err) + ']); ';
  60599. } else {
  60600. out += ' validate.errors = [' + (__err) + ']; return false; ';
  60601. }
  60602. } else {
  60603. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  60604. }
  60605. out += ' } ';
  60606. }
  60607. }
  60608. if ($breakOnError) {
  60609. out += ' if (errors === ';
  60610. if ($top) {
  60611. out += '0';
  60612. } else {
  60613. out += 'errs_' + ($lvl);
  60614. }
  60615. out += ') { ';
  60616. $closingBraces2 += '}';
  60617. }
  60618. }
  60619. }
  60620. }
  60621. }
  60622. if ($breakOnError) {
  60623. out += ' ' + ($closingBraces2) + ' ';
  60624. }
  60625. if ($top) {
  60626. if ($async) {
  60627. out += ' if (errors === 0) return data; ';
  60628. out += ' else throw new ValidationError(vErrors); ';
  60629. } else {
  60630. out += ' validate.errors = vErrors; ';
  60631. out += ' return errors === 0; ';
  60632. }
  60633. out += ' }); return validate;';
  60634. } else {
  60635. out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';';
  60636. }
  60637. out = it.util.cleanUpCode(out);
  60638. if ($top) {
  60639. out = it.util.finalCleanUpCode(out, $async);
  60640. }
  60641. function $shouldUseGroup($rulesGroup) {
  60642. var rules = $rulesGroup.rules;
  60643. for (var i = 0; i < rules.length; i++)
  60644. if ($shouldUseRule(rules[i])) return true;
  60645. }
  60646. function $shouldUseRule($rule) {
  60647. return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule));
  60648. }
  60649. function $ruleImplementsSomeKeyword($rule) {
  60650. var impl = $rule.implements;
  60651. for (var i = 0; i < impl.length; i++)
  60652. if (it.schema[impl[i]] !== undefined) return true;
  60653. }
  60654. return out;
  60655. }
  60656. /***/ }),
  60657. /* 363 */
  60658. /***/ (function(module, exports) {
  60659. module.exports = [["0","\u0000",127],["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"],["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"],["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"],["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21],["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10],["a3a1","ㄐ",25,"˙ˉˊˇˋ"],["a3e1","€"],["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"],["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"],["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"],["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"],["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"],["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"],["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"],["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"],["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"],["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"],["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"],["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"],["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"],["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"],["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"],["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"],["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"],["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"],["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"],["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"],["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"],["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"],["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"],["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"],["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"],["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"],["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"],["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"],["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"],["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"],["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"],["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"],["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"],["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"],["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"],["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"],["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"],["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"],["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"],["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"],["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"],["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"],["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"],["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"],["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"],["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"],["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"],["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"],["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"],["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"],["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"],["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"],["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"],["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"],["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"],["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"],["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"],["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"],["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"],["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"],["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"],["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"],["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"],["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"],["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"],["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"],["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"],["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"],["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"],["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"],["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"],["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"],["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"],["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"],["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"],["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"],["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"],["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"],["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"],["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"],["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"],["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"],["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"],["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"],["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"],["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"],["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"],["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"],["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"],["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"],["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"],["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"],["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"],["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"],["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"],["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"],["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"],["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"],["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"],["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"],["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"],["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"],["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"],["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"],["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"],["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"],["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"],["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"],["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"],["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"],["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"],["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"],["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"],["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"],["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"],["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"],["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"],["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"],["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"],["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"],["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"],["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"],["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"],["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"],["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"],["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"],["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"],["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"],["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"],["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"],["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"],["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"],["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"],["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"],["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"],["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"],["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"],["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"],["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"],["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"],["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"],["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"],["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"],["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"],["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"],["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"],["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"],["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"],["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"],["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"],["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"],["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"],["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"],["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"],["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"],["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"],["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"],["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"],["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"],["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"],["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"],["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"],["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"],["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"],["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"],["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"],["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"]]
  60660. /***/ }),
  60661. /* 364 */
  60662. /***/ (function(module, exports) {
  60663. module.exports = [["a140","",62],["a180","",32],["a240","",62],["a280","",32],["a2ab","",5],["a2e3","€"],["a2ef",""],["a2fd",""],["a340","",62],["a380","",31," "],["a440","",62],["a480","",32],["a4f4","",10],["a540","",62],["a580","",32],["a5f7","",7],["a640","",62],["a680","",32],["a6b9","",7],["a6d9","",6],["a6ec",""],["a6f3",""],["a6f6","",8],["a740","",62],["a780","",32],["a7c2","",14],["a7f2","",12],["a896","",10],["a8bc",""],["a8bf","ǹ"],["a8c1",""],["a8ea","",20],["a958",""],["a95b",""],["a95d",""],["a989","〾⿰",11],["a997","",12],["a9f0","",14],["aaa1","",93],["aba1","",93],["aca1","",93],["ada1","",93],["aea1","",93],["afa1","",93],["d7fa","",4],["f8a1","",93],["f9a1","",93],["faa1","",93],["fba1","",93],["fca1","",93],["fda1","",93],["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"],["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93]]
  60664. /***/ }),
  60665. /* 365 */
  60666. /***/ (function(module, exports, __webpack_require__) {
  60667. "use strict";
  60668. module.exports = __webpack_require__(567).isCI
  60669. /***/ }),
  60670. /* 366 */
  60671. /***/ (function(module, exports) {
  60672. var toString = {}.toString;
  60673. module.exports = Array.isArray || function (arr) {
  60674. return toString.call(arr) == '[object Array]';
  60675. };
  60676. /***/ }),
  60677. /* 367 */
  60678. /***/ (function(module, exports, __webpack_require__) {
  60679. var stream = __webpack_require__(36)
  60680. function isStream (obj) {
  60681. return obj instanceof stream.Stream
  60682. }
  60683. function isReadable (obj) {
  60684. return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object'
  60685. }
  60686. function isWritable (obj) {
  60687. return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object'
  60688. }
  60689. function isDuplex (obj) {
  60690. return isReadable(obj) && isWritable(obj)
  60691. }
  60692. module.exports = isStream
  60693. module.exports.isReadable = isReadable
  60694. module.exports.isWritable = isWritable
  60695. module.exports.isDuplex = isDuplex
  60696. /***/ }),
  60697. /* 368 */
  60698. /***/ (function(module, exports, __webpack_require__) {
  60699. "use strict";
  60700. // Standard YAML's Core schema.
  60701. // http://www.yaml.org/spec/1.2/spec.html#id2804923
  60702. //
  60703. // NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
  60704. // So, Core schema has no distinctions from JSON schema is JS-YAML.
  60705. var Schema = __webpack_require__(108);
  60706. module.exports = new Schema({
  60707. include: [
  60708. __webpack_require__(369)
  60709. ]
  60710. });
  60711. /***/ }),
  60712. /* 369 */
  60713. /***/ (function(module, exports, __webpack_require__) {
  60714. "use strict";
  60715. // Standard YAML's JSON schema.
  60716. // http://www.yaml.org/spec/1.2/spec.html#id2803231
  60717. //
  60718. // NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
  60719. // So, this schema is not such strict as defined in the YAML specification.
  60720. // It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
  60721. var Schema = __webpack_require__(108);
  60722. module.exports = new Schema({
  60723. include: [
  60724. __webpack_require__(239)
  60725. ],
  60726. implicit: [
  60727. __webpack_require__(808),
  60728. __webpack_require__(800),
  60729. __webpack_require__(802),
  60730. __webpack_require__(801)
  60731. ]
  60732. });
  60733. /***/ }),
  60734. /* 370 */
  60735. /***/ (function(module, exports, __webpack_require__) {
  60736. "use strict";
  60737. /*!
  60738. * mime-types
  60739. * Copyright(c) 2014 Jonathan Ong
  60740. * Copyright(c) 2015 Douglas Christopher Wilson
  60741. * MIT Licensed
  60742. */
  60743. /**
  60744. * Module dependencies.
  60745. * @private
  60746. */
  60747. var db = __webpack_require__(830)
  60748. var extname = __webpack_require__(1).extname
  60749. /**
  60750. * Module variables.
  60751. * @private
  60752. */
  60753. var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
  60754. var TEXT_TYPE_REGEXP = /^text\//i
  60755. /**
  60756. * Module exports.
  60757. * @public
  60758. */
  60759. exports.charset = charset
  60760. exports.charsets = { lookup: charset }
  60761. exports.contentType = contentType
  60762. exports.extension = extension
  60763. exports.extensions = Object.create(null)
  60764. exports.lookup = lookup
  60765. exports.types = Object.create(null)
  60766. // Populate the extensions/types maps
  60767. populateMaps(exports.extensions, exports.types)
  60768. /**
  60769. * Get the default charset for a MIME type.
  60770. *
  60771. * @param {string} type
  60772. * @return {boolean|string}
  60773. */
  60774. function charset (type) {
  60775. if (!type || typeof type !== 'string') {
  60776. return false
  60777. }
  60778. // TODO: use media-typer
  60779. var match = EXTRACT_TYPE_REGEXP.exec(type)
  60780. var mime = match && db[match[1].toLowerCase()]
  60781. if (mime && mime.charset) {
  60782. return mime.charset
  60783. }
  60784. // default text/* to utf-8
  60785. if (match && TEXT_TYPE_REGEXP.test(match[1])) {
  60786. return 'UTF-8'
  60787. }
  60788. return false
  60789. }
  60790. /**
  60791. * Create a full Content-Type header given a MIME type or extension.
  60792. *
  60793. * @param {string} str
  60794. * @return {boolean|string}
  60795. */
  60796. function contentType (str) {
  60797. // TODO: should this even be in this module?
  60798. if (!str || typeof str !== 'string') {
  60799. return false
  60800. }
  60801. var mime = str.indexOf('/') === -1
  60802. ? exports.lookup(str)
  60803. : str
  60804. if (!mime) {
  60805. return false
  60806. }
  60807. // TODO: use content-type or other module
  60808. if (mime.indexOf('charset') === -1) {
  60809. var charset = exports.charset(mime)
  60810. if (charset) mime += '; charset=' + charset.toLowerCase()
  60811. }
  60812. return mime
  60813. }
  60814. /**
  60815. * Get the default extension for a MIME type.
  60816. *
  60817. * @param {string} type
  60818. * @return {boolean|string}
  60819. */
  60820. function extension (type) {
  60821. if (!type || typeof type !== 'string') {
  60822. return false
  60823. }
  60824. // TODO: use media-typer
  60825. var match = EXTRACT_TYPE_REGEXP.exec(type)
  60826. // get extensions
  60827. var exts = match && exports.extensions[match[1].toLowerCase()]
  60828. if (!exts || !exts.length) {
  60829. return false
  60830. }
  60831. return exts[0]
  60832. }
  60833. /**
  60834. * Lookup the MIME type for a file path/extension.
  60835. *
  60836. * @param {string} path
  60837. * @return {boolean|string}
  60838. */
  60839. function lookup (path) {
  60840. if (!path || typeof path !== 'string') {
  60841. return false
  60842. }
  60843. // get the extension ("ext" or ".ext" or full path)
  60844. var extension = extname('x.' + path)
  60845. .toLowerCase()
  60846. .substr(1)
  60847. if (!extension) {
  60848. return false
  60849. }
  60850. return exports.types[extension] || false
  60851. }
  60852. /**
  60853. * Populate the extensions and types maps.
  60854. * @private
  60855. */
  60856. function populateMaps (extensions, types) {
  60857. // source preference (least -> most)
  60858. var preference = ['nginx', 'apache', undefined, 'iana']
  60859. Object.keys(db).forEach(function forEachMimeType (type) {
  60860. var mime = db[type]
  60861. var exts = mime.extensions
  60862. if (!exts || !exts.length) {
  60863. return
  60864. }
  60865. // mime -> extensions
  60866. extensions[type] = exts
  60867. // extension -> mime
  60868. for (var i = 0; i < exts.length; i++) {
  60869. var extension = exts[i]
  60870. if (types[extension]) {
  60871. var from = preference.indexOf(db[types[extension]].source)
  60872. var to = preference.indexOf(mime.source)
  60873. if (types[extension] !== 'application/octet-stream' &&
  60874. (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
  60875. // skip the remapping
  60876. continue
  60877. }
  60878. }
  60879. // set the extension -> mime
  60880. types[extension] = type
  60881. }
  60882. })
  60883. }
  60884. /***/ }),
  60885. /* 371 */
  60886. /***/ (function(module, exports, __webpack_require__) {
  60887. var Stream = __webpack_require__(36)
  60888. module.exports = MuteStream
  60889. // var out = new MuteStream(process.stdout)
  60890. // argument auto-pipes
  60891. function MuteStream (opts) {
  60892. Stream.apply(this)
  60893. opts = opts || {}
  60894. this.writable = this.readable = true
  60895. this.muted = false
  60896. this.on('pipe', this._onpipe)
  60897. this.replace = opts.replace
  60898. // For readline-type situations
  60899. // This much at the start of a line being redrawn after a ctrl char
  60900. // is seen (such as backspace) won't be redrawn as the replacement
  60901. this._prompt = opts.prompt || null
  60902. this._hadControl = false
  60903. }
  60904. MuteStream.prototype = Object.create(Stream.prototype)
  60905. Object.defineProperty(MuteStream.prototype, 'constructor', {
  60906. value: MuteStream,
  60907. enumerable: false
  60908. })
  60909. MuteStream.prototype.mute = function () {
  60910. this.muted = true
  60911. }
  60912. MuteStream.prototype.unmute = function () {
  60913. this.muted = false
  60914. }
  60915. Object.defineProperty(MuteStream.prototype, '_onpipe', {
  60916. value: onPipe,
  60917. enumerable: false,
  60918. writable: true,
  60919. configurable: true
  60920. })
  60921. function onPipe (src) {
  60922. this._src = src
  60923. }
  60924. Object.defineProperty(MuteStream.prototype, 'isTTY', {
  60925. get: getIsTTY,
  60926. set: setIsTTY,
  60927. enumerable: true,
  60928. configurable: true
  60929. })
  60930. function getIsTTY () {
  60931. return( (this._dest) ? this._dest.isTTY
  60932. : (this._src) ? this._src.isTTY
  60933. : false
  60934. )
  60935. }
  60936. // basically just get replace the getter/setter with a regular value
  60937. function setIsTTY (isTTY) {
  60938. Object.defineProperty(this, 'isTTY', {
  60939. value: isTTY,
  60940. enumerable: true,
  60941. writable: true,
  60942. configurable: true
  60943. })
  60944. }
  60945. Object.defineProperty(MuteStream.prototype, 'rows', {
  60946. get: function () {
  60947. return( this._dest ? this._dest.rows
  60948. : this._src ? this._src.rows
  60949. : undefined )
  60950. }, enumerable: true, configurable: true })
  60951. Object.defineProperty(MuteStream.prototype, 'columns', {
  60952. get: function () {
  60953. return( this._dest ? this._dest.columns
  60954. : this._src ? this._src.columns
  60955. : undefined )
  60956. }, enumerable: true, configurable: true })
  60957. MuteStream.prototype.pipe = function (dest, options) {
  60958. this._dest = dest
  60959. return Stream.prototype.pipe.call(this, dest, options)
  60960. }
  60961. MuteStream.prototype.pause = function () {
  60962. if (this._src) return this._src.pause()
  60963. }
  60964. MuteStream.prototype.resume = function () {
  60965. if (this._src) return this._src.resume()
  60966. }
  60967. MuteStream.prototype.write = function (c) {
  60968. if (this.muted) {
  60969. if (!this.replace) return true
  60970. if (c.match(/^\u001b/)) {
  60971. if(c.indexOf(this._prompt) === 0) {
  60972. c = c.substr(this._prompt.length);
  60973. c = c.replace(/./g, this.replace);
  60974. c = this._prompt + c;
  60975. }
  60976. this._hadControl = true
  60977. return this.emit('data', c)
  60978. } else {
  60979. if (this._prompt && this._hadControl &&
  60980. c.indexOf(this._prompt) === 0) {
  60981. this._hadControl = false
  60982. this.emit('data', this._prompt)
  60983. c = c.substr(this._prompt.length)
  60984. }
  60985. c = c.toString().replace(/./g, this.replace)
  60986. }
  60987. }
  60988. this.emit('data', c)
  60989. }
  60990. MuteStream.prototype.end = function (c) {
  60991. if (this.muted) {
  60992. if (c && this.replace) {
  60993. c = c.toString().replace(/./g, this.replace)
  60994. } else {
  60995. c = null
  60996. }
  60997. }
  60998. if (c) this.emit('data', c)
  60999. this.emit('end')
  61000. }
  61001. function proxy (fn) { return function () {
  61002. var d = this._dest
  61003. var s = this._src
  61004. if (d && d[fn]) d[fn].apply(d, arguments)
  61005. if (s && s[fn]) s[fn].apply(s, arguments)
  61006. }}
  61007. MuteStream.prototype.destroy = proxy('destroy')
  61008. MuteStream.prototype.destroySoon = proxy('destroySoon')
  61009. MuteStream.prototype.close = proxy('close')
  61010. /***/ }),
  61011. /* 372 */
  61012. /***/ (function(module, exports, __webpack_require__) {
  61013. "use strict";
  61014. const url = __webpack_require__(29);
  61015. const punycode = __webpack_require__(246);
  61016. const queryString = __webpack_require__(858);
  61017. const prependHttp = __webpack_require__(849);
  61018. const sortKeys = __webpack_require__(1007);
  61019. const DEFAULT_PORTS = {
  61020. 'http:': 80,
  61021. 'https:': 443,
  61022. 'ftp:': 21
  61023. };
  61024. // Protocols that always contain a `//`` bit
  61025. const slashedProtocol = {
  61026. http: true,
  61027. https: true,
  61028. ftp: true,
  61029. gopher: true,
  61030. file: true,
  61031. 'http:': true,
  61032. 'https:': true,
  61033. 'ftp:': true,
  61034. 'gopher:': true,
  61035. 'file:': true
  61036. };
  61037. function testParameter(name, filters) {
  61038. return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name);
  61039. }
  61040. module.exports = (str, opts) => {
  61041. opts = Object.assign({
  61042. normalizeProtocol: true,
  61043. normalizeHttps: false,
  61044. stripFragment: true,
  61045. stripWWW: true,
  61046. removeQueryParameters: [/^utm_\w+/i],
  61047. removeTrailingSlash: true,
  61048. removeDirectoryIndex: false,
  61049. sortQueryParameters: true
  61050. }, opts);
  61051. if (typeof str !== 'string') {
  61052. throw new TypeError('Expected a string');
  61053. }
  61054. const hasRelativeProtocol = str.startsWith('//');
  61055. // Prepend protocol
  61056. str = prependHttp(str.trim()).replace(/^\/\//, 'http://');
  61057. const urlObj = url.parse(str);
  61058. if (opts.normalizeHttps && urlObj.protocol === 'https:') {
  61059. urlObj.protocol = 'http:';
  61060. }
  61061. if (!urlObj.hostname && !urlObj.pathname) {
  61062. throw new Error('Invalid URL');
  61063. }
  61064. // Prevent these from being used by `url.format`
  61065. delete urlObj.host;
  61066. delete urlObj.query;
  61067. // Remove fragment
  61068. if (opts.stripFragment) {
  61069. delete urlObj.hash;
  61070. }
  61071. // Remove default port
  61072. const port = DEFAULT_PORTS[urlObj.protocol];
  61073. if (Number(urlObj.port) === port) {
  61074. delete urlObj.port;
  61075. }
  61076. // Remove duplicate slashes
  61077. if (urlObj.pathname) {
  61078. urlObj.pathname = urlObj.pathname.replace(/\/{2,}/g, '/');
  61079. }
  61080. // Decode URI octets
  61081. if (urlObj.pathname) {
  61082. urlObj.pathname = decodeURI(urlObj.pathname);
  61083. }
  61084. // Remove directory index
  61085. if (opts.removeDirectoryIndex === true) {
  61086. opts.removeDirectoryIndex = [/^index\.[a-z]+$/];
  61087. }
  61088. if (Array.isArray(opts.removeDirectoryIndex) && opts.removeDirectoryIndex.length > 0) {
  61089. let pathComponents = urlObj.pathname.split('/');
  61090. const lastComponent = pathComponents[pathComponents.length - 1];
  61091. if (testParameter(lastComponent, opts.removeDirectoryIndex)) {
  61092. pathComponents = pathComponents.slice(0, pathComponents.length - 1);
  61093. urlObj.pathname = pathComponents.slice(1).join('/') + '/';
  61094. }
  61095. }
  61096. // Resolve relative paths, but only for slashed protocols
  61097. if (slashedProtocol[urlObj.protocol]) {
  61098. const domain = urlObj.protocol + '//' + urlObj.hostname;
  61099. const relative = url.resolve(domain, urlObj.pathname);
  61100. urlObj.pathname = relative.replace(domain, '');
  61101. }
  61102. if (urlObj.hostname) {
  61103. // IDN to Unicode
  61104. urlObj.hostname = punycode.toUnicode(urlObj.hostname).toLowerCase();
  61105. // Remove trailing dot
  61106. urlObj.hostname = urlObj.hostname.replace(/\.$/, '');
  61107. // Remove `www.`
  61108. if (opts.stripWWW) {
  61109. urlObj.hostname = urlObj.hostname.replace(/^www\./, '');
  61110. }
  61111. }
  61112. // Remove URL with empty query string
  61113. if (urlObj.search === '?') {
  61114. delete urlObj.search;
  61115. }
  61116. const queryParameters = queryString.parse(urlObj.search);
  61117. // Remove query unwanted parameters
  61118. if (Array.isArray(opts.removeQueryParameters)) {
  61119. for (const key in queryParameters) {
  61120. if (testParameter(key, opts.removeQueryParameters)) {
  61121. delete queryParameters[key];
  61122. }
  61123. }
  61124. }
  61125. // Sort query parameters
  61126. if (opts.sortQueryParameters) {
  61127. urlObj.search = queryString.stringify(sortKeys(queryParameters));
  61128. }
  61129. // Decode query parameters
  61130. if (urlObj.search !== null) {
  61131. urlObj.search = decodeURIComponent(urlObj.search);
  61132. }
  61133. // Take advantage of many of the Node `url` normalizations
  61134. str = url.format(urlObj);
  61135. // Remove ending `/`
  61136. if (opts.removeTrailingSlash || urlObj.pathname === '/') {
  61137. str = str.replace(/\/$/, '');
  61138. }
  61139. // Restore relative protocol, if applicable
  61140. if (hasRelativeProtocol && !opts.normalizeProtocol) {
  61141. str = str.replace(/^http:\/\//, '//');
  61142. }
  61143. return str;
  61144. };
  61145. /***/ }),
  61146. /* 373 */
  61147. /***/ (function(module, exports, __webpack_require__) {
  61148. "use strict";
  61149. var replace = String.prototype.replace;
  61150. var percentTwenties = /%20/g;
  61151. module.exports = {
  61152. 'default': 'RFC3986',
  61153. formatters: {
  61154. RFC1738: function (value) {
  61155. return replace.call(value, percentTwenties, '+');
  61156. },
  61157. RFC3986: function (value) {
  61158. return value;
  61159. }
  61160. },
  61161. RFC1738: 'RFC1738',
  61162. RFC3986: 'RFC3986'
  61163. };
  61164. /***/ }),
  61165. /* 374 */
  61166. /***/ (function(module, exports, __webpack_require__) {
  61167. "use strict";
  61168. var stringify = __webpack_require__(857);
  61169. var parse = __webpack_require__(856);
  61170. var formats = __webpack_require__(373);
  61171. module.exports = {
  61172. formats: formats,
  61173. parse: parse,
  61174. stringify: stringify
  61175. };
  61176. /***/ }),
  61177. /* 375 */
  61178. /***/ (function(module, exports, __webpack_require__) {
  61179. "use strict";
  61180. var has = Object.prototype.hasOwnProperty;
  61181. var hexTable = (function () {
  61182. var array = [];
  61183. for (var i = 0; i < 256; ++i) {
  61184. array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
  61185. }
  61186. return array;
  61187. }());
  61188. var compactQueue = function compactQueue(queue) {
  61189. var obj;
  61190. while (queue.length) {
  61191. var item = queue.pop();
  61192. obj = item.obj[item.prop];
  61193. if (Array.isArray(obj)) {
  61194. var compacted = [];
  61195. for (var j = 0; j < obj.length; ++j) {
  61196. if (typeof obj[j] !== 'undefined') {
  61197. compacted.push(obj[j]);
  61198. }
  61199. }
  61200. item.obj[item.prop] = compacted;
  61201. }
  61202. }
  61203. return obj;
  61204. };
  61205. var arrayToObject = function arrayToObject(source, options) {
  61206. var obj = options && options.plainObjects ? Object.create(null) : {};
  61207. for (var i = 0; i < source.length; ++i) {
  61208. if (typeof source[i] !== 'undefined') {
  61209. obj[i] = source[i];
  61210. }
  61211. }
  61212. return obj;
  61213. };
  61214. var merge = function merge(target, source, options) {
  61215. if (!source) {
  61216. return target;
  61217. }
  61218. if (typeof source !== 'object') {
  61219. if (Array.isArray(target)) {
  61220. target.push(source);
  61221. } else if (typeof target === 'object') {
  61222. if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
  61223. target[source] = true;
  61224. }
  61225. } else {
  61226. return [target, source];
  61227. }
  61228. return target;
  61229. }
  61230. if (typeof target !== 'object') {
  61231. return [target].concat(source);
  61232. }
  61233. var mergeTarget = target;
  61234. if (Array.isArray(target) && !Array.isArray(source)) {
  61235. mergeTarget = arrayToObject(target, options);
  61236. }
  61237. if (Array.isArray(target) && Array.isArray(source)) {
  61238. source.forEach(function (item, i) {
  61239. if (has.call(target, i)) {
  61240. if (target[i] && typeof target[i] === 'object') {
  61241. target[i] = merge(target[i], item, options);
  61242. } else {
  61243. target.push(item);
  61244. }
  61245. } else {
  61246. target[i] = item;
  61247. }
  61248. });
  61249. return target;
  61250. }
  61251. return Object.keys(source).reduce(function (acc, key) {
  61252. var value = source[key];
  61253. if (has.call(acc, key)) {
  61254. acc[key] = merge(acc[key], value, options);
  61255. } else {
  61256. acc[key] = value;
  61257. }
  61258. return acc;
  61259. }, mergeTarget);
  61260. };
  61261. var assign = function assignSingleSource(target, source) {
  61262. return Object.keys(source).reduce(function (acc, key) {
  61263. acc[key] = source[key];
  61264. return acc;
  61265. }, target);
  61266. };
  61267. var decode = function (str) {
  61268. try {
  61269. return decodeURIComponent(str.replace(/\+/g, ' '));
  61270. } catch (e) {
  61271. return str;
  61272. }
  61273. };
  61274. var encode = function encode(str) {
  61275. // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
  61276. // It has been adapted here for stricter adherence to RFC 3986
  61277. if (str.length === 0) {
  61278. return str;
  61279. }
  61280. var string = typeof str === 'string' ? str : String(str);
  61281. var out = '';
  61282. for (var i = 0; i < string.length; ++i) {
  61283. var c = string.charCodeAt(i);
  61284. if (
  61285. c === 0x2D // -
  61286. || c === 0x2E // .
  61287. || c === 0x5F // _
  61288. || c === 0x7E // ~
  61289. || (c >= 0x30 && c <= 0x39) // 0-9
  61290. || (c >= 0x41 && c <= 0x5A) // a-z
  61291. || (c >= 0x61 && c <= 0x7A) // A-Z
  61292. ) {
  61293. out += string.charAt(i);
  61294. continue;
  61295. }
  61296. if (c < 0x80) {
  61297. out = out + hexTable[c];
  61298. continue;
  61299. }
  61300. if (c < 0x800) {
  61301. out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
  61302. continue;
  61303. }
  61304. if (c < 0xD800 || c >= 0xE000) {
  61305. out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
  61306. continue;
  61307. }
  61308. i += 1;
  61309. c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
  61310. out += hexTable[0xF0 | (c >> 18)]
  61311. + hexTable[0x80 | ((c >> 12) & 0x3F)]
  61312. + hexTable[0x80 | ((c >> 6) & 0x3F)]
  61313. + hexTable[0x80 | (c & 0x3F)];
  61314. }
  61315. return out;
  61316. };
  61317. var compact = function compact(value) {
  61318. var queue = [{ obj: { o: value }, prop: 'o' }];
  61319. var refs = [];
  61320. for (var i = 0; i < queue.length; ++i) {
  61321. var item = queue[i];
  61322. var obj = item.obj[item.prop];
  61323. var keys = Object.keys(obj);
  61324. for (var j = 0; j < keys.length; ++j) {
  61325. var key = keys[j];
  61326. var val = obj[key];
  61327. if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
  61328. queue.push({ obj: obj, prop: key });
  61329. refs.push(val);
  61330. }
  61331. }
  61332. }
  61333. return compactQueue(queue);
  61334. };
  61335. var isRegExp = function isRegExp(obj) {
  61336. return Object.prototype.toString.call(obj) === '[object RegExp]';
  61337. };
  61338. var isBuffer = function isBuffer(obj) {
  61339. if (obj === null || typeof obj === 'undefined') {
  61340. return false;
  61341. }
  61342. return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
  61343. };
  61344. module.exports = {
  61345. arrayToObject: arrayToObject,
  61346. assign: assign,
  61347. compact: compact,
  61348. decode: decode,
  61349. encode: encode,
  61350. isBuffer: isBuffer,
  61351. isRegExp: isRegExp,
  61352. merge: merge
  61353. };
  61354. /***/ }),
  61355. /* 376 */
  61356. /***/ (function(module, exports, __webpack_require__) {
  61357. "use strict";
  61358. // Copyright Joyent, Inc. and other Node contributors.
  61359. //
  61360. // Permission is hereby granted, free of charge, to any person obtaining a
  61361. // copy of this software and associated documentation files (the
  61362. // "Software"), to deal in the Software without restriction, including
  61363. // without limitation the rights to use, copy, modify, merge, publish,
  61364. // distribute, sublicense, and/or sell copies of the Software, and to permit
  61365. // persons to whom the Software is furnished to do so, subject to the
  61366. // following conditions:
  61367. //
  61368. // The above copyright notice and this permission notice shall be included
  61369. // in all copies or substantial portions of the Software.
  61370. //
  61371. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  61372. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  61373. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  61374. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  61375. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  61376. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  61377. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  61378. /*<replacement>*/
  61379. var pna = __webpack_require__(171);
  61380. /*</replacement>*/
  61381. module.exports = Readable;
  61382. /*<replacement>*/
  61383. var isArray = __webpack_require__(366);
  61384. /*</replacement>*/
  61385. /*<replacement>*/
  61386. var Duplex;
  61387. /*</replacement>*/
  61388. Readable.ReadableState = ReadableState;
  61389. /*<replacement>*/
  61390. var EE = __webpack_require__(95).EventEmitter;
  61391. var EElistenerCount = function (emitter, type) {
  61392. return emitter.listeners(type).length;
  61393. };
  61394. /*</replacement>*/
  61395. /*<replacement>*/
  61396. var Stream = __webpack_require__(380);
  61397. /*</replacement>*/
  61398. /*<replacement>*/
  61399. var Buffer = __webpack_require__(60).Buffer;
  61400. var OurUint8Array = global.Uint8Array || function () {};
  61401. function _uint8ArrayToBuffer(chunk) {
  61402. return Buffer.from(chunk);
  61403. }
  61404. function _isUint8Array(obj) {
  61405. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  61406. }
  61407. /*</replacement>*/
  61408. /*<replacement>*/
  61409. var util = __webpack_require__(105);
  61410. util.inherits = __webpack_require__(78);
  61411. /*</replacement>*/
  61412. /*<replacement>*/
  61413. var debugUtil = __webpack_require__(9);
  61414. var debug = void 0;
  61415. if (debugUtil && debugUtil.debuglog) {
  61416. debug = debugUtil.debuglog('stream');
  61417. } else {
  61418. debug = function () {};
  61419. }
  61420. /*</replacement>*/
  61421. var BufferList = __webpack_require__(865);
  61422. var destroyImpl = __webpack_require__(379);
  61423. var StringDecoder;
  61424. util.inherits(Readable, Stream);
  61425. var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
  61426. function prependListener(emitter, event, fn) {
  61427. // Sadly this is not cacheable as some libraries bundle their own
  61428. // event emitter implementation with them.
  61429. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
  61430. // This is a hack to make sure that our error handler is attached before any
  61431. // userland ones. NEVER DO THIS. This is here only because this code needs
  61432. // to continue to work with older versions of Node.js that do not include
  61433. // the prependListener() method. The goal is to eventually remove this hack.
  61434. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
  61435. }
  61436. function ReadableState(options, stream) {
  61437. Duplex = Duplex || __webpack_require__(110);
  61438. options = options || {};
  61439. // Duplex streams are both readable and writable, but share
  61440. // the same options object.
  61441. // However, some cases require setting options to different
  61442. // values for the readable and the writable sides of the duplex stream.
  61443. // These options can be provided separately as readableXXX and writableXXX.
  61444. var isDuplex = stream instanceof Duplex;
  61445. // object stream flag. Used to make read(n) ignore n and to
  61446. // make all the buffer merging and length checks go away
  61447. this.objectMode = !!options.objectMode;
  61448. if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
  61449. // the point at which it stops calling _read() to fill the buffer
  61450. // Note: 0 is a valid value, means "don't call _read preemptively ever"
  61451. var hwm = options.highWaterMark;
  61452. var readableHwm = options.readableHighWaterMark;
  61453. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  61454. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
  61455. // cast to ints.
  61456. this.highWaterMark = Math.floor(this.highWaterMark);
  61457. // A linked list is used to store data chunks instead of an array because the
  61458. // linked list can remove elements from the beginning faster than
  61459. // array.shift()
  61460. this.buffer = new BufferList();
  61461. this.length = 0;
  61462. this.pipes = null;
  61463. this.pipesCount = 0;
  61464. this.flowing = null;
  61465. this.ended = false;
  61466. this.endEmitted = false;
  61467. this.reading = false;
  61468. // a flag to be able to tell if the event 'readable'/'data' is emitted
  61469. // immediately, or on a later tick. We set this to true at first, because
  61470. // any actions that shouldn't happen until "later" should generally also
  61471. // not happen before the first read call.
  61472. this.sync = true;
  61473. // whenever we return null, then we set a flag to say
  61474. // that we're awaiting a 'readable' event emission.
  61475. this.needReadable = false;
  61476. this.emittedReadable = false;
  61477. this.readableListening = false;
  61478. this.resumeScheduled = false;
  61479. // has it been destroyed
  61480. this.destroyed = false;
  61481. // Crypto is kind of old and crusty. Historically, its default string
  61482. // encoding is 'binary' so we have to make this configurable.
  61483. // Everything else in the universe uses 'utf8', though.
  61484. this.defaultEncoding = options.defaultEncoding || 'utf8';
  61485. // the number of writers that are awaiting a drain event in .pipe()s
  61486. this.awaitDrain = 0;
  61487. // if true, a maybeReadMore has been scheduled
  61488. this.readingMore = false;
  61489. this.decoder = null;
  61490. this.encoding = null;
  61491. if (options.encoding) {
  61492. if (!StringDecoder) StringDecoder = __webpack_require__(428).StringDecoder;
  61493. this.decoder = new StringDecoder(options.encoding);
  61494. this.encoding = options.encoding;
  61495. }
  61496. }
  61497. function Readable(options) {
  61498. Duplex = Duplex || __webpack_require__(110);
  61499. if (!(this instanceof Readable)) return new Readable(options);
  61500. this._readableState = new ReadableState(options, this);
  61501. // legacy
  61502. this.readable = true;
  61503. if (options) {
  61504. if (typeof options.read === 'function') this._read = options.read;
  61505. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  61506. }
  61507. Stream.call(this);
  61508. }
  61509. Object.defineProperty(Readable.prototype, 'destroyed', {
  61510. get: function () {
  61511. if (this._readableState === undefined) {
  61512. return false;
  61513. }
  61514. return this._readableState.destroyed;
  61515. },
  61516. set: function (value) {
  61517. // we ignore the value if the stream
  61518. // has not been initialized yet
  61519. if (!this._readableState) {
  61520. return;
  61521. }
  61522. // backward compatibility, the user is explicitly
  61523. // managing destroyed
  61524. this._readableState.destroyed = value;
  61525. }
  61526. });
  61527. Readable.prototype.destroy = destroyImpl.destroy;
  61528. Readable.prototype._undestroy = destroyImpl.undestroy;
  61529. Readable.prototype._destroy = function (err, cb) {
  61530. this.push(null);
  61531. cb(err);
  61532. };
  61533. // Manually shove something into the read() buffer.
  61534. // This returns true if the highWaterMark has not been hit yet,
  61535. // similar to how Writable.write() returns true if you should
  61536. // write() some more.
  61537. Readable.prototype.push = function (chunk, encoding) {
  61538. var state = this._readableState;
  61539. var skipChunkCheck;
  61540. if (!state.objectMode) {
  61541. if (typeof chunk === 'string') {
  61542. encoding = encoding || state.defaultEncoding;
  61543. if (encoding !== state.encoding) {
  61544. chunk = Buffer.from(chunk, encoding);
  61545. encoding = '';
  61546. }
  61547. skipChunkCheck = true;
  61548. }
  61549. } else {
  61550. skipChunkCheck = true;
  61551. }
  61552. return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
  61553. };
  61554. // Unshift should *always* be something directly out of read()
  61555. Readable.prototype.unshift = function (chunk) {
  61556. return readableAddChunk(this, chunk, null, true, false);
  61557. };
  61558. function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  61559. var state = stream._readableState;
  61560. if (chunk === null) {
  61561. state.reading = false;
  61562. onEofChunk(stream, state);
  61563. } else {
  61564. var er;
  61565. if (!skipChunkCheck) er = chunkInvalid(state, chunk);
  61566. if (er) {
  61567. stream.emit('error', er);
  61568. } else if (state.objectMode || chunk && chunk.length > 0) {
  61569. if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  61570. chunk = _uint8ArrayToBuffer(chunk);
  61571. }
  61572. if (addToFront) {
  61573. if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
  61574. } else if (state.ended) {
  61575. stream.emit('error', new Error('stream.push() after EOF'));
  61576. } else {
  61577. state.reading = false;
  61578. if (state.decoder && !encoding) {
  61579. chunk = state.decoder.write(chunk);
  61580. if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
  61581. } else {
  61582. addChunk(stream, state, chunk, false);
  61583. }
  61584. }
  61585. } else if (!addToFront) {
  61586. state.reading = false;
  61587. }
  61588. }
  61589. return needMoreData(state);
  61590. }
  61591. function addChunk(stream, state, chunk, addToFront) {
  61592. if (state.flowing && state.length === 0 && !state.sync) {
  61593. stream.emit('data', chunk);
  61594. stream.read(0);
  61595. } else {
  61596. // update the buffer info.
  61597. state.length += state.objectMode ? 1 : chunk.length;
  61598. if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
  61599. if (state.needReadable) emitReadable(stream);
  61600. }
  61601. maybeReadMore(stream, state);
  61602. }
  61603. function chunkInvalid(state, chunk) {
  61604. var er;
  61605. if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  61606. er = new TypeError('Invalid non-string/buffer chunk');
  61607. }
  61608. return er;
  61609. }
  61610. // if it's past the high water mark, we can push in some more.
  61611. // Also, if we have no data yet, we can stand some
  61612. // more bytes. This is to work around cases where hwm=0,
  61613. // such as the repl. Also, if the push() triggered a
  61614. // readable event, and the user called read(largeNumber) such that
  61615. // needReadable was set, then we ought to push more, so that another
  61616. // 'readable' event will be triggered.
  61617. function needMoreData(state) {
  61618. return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
  61619. }
  61620. Readable.prototype.isPaused = function () {
  61621. return this._readableState.flowing === false;
  61622. };
  61623. // backwards compatibility.
  61624. Readable.prototype.setEncoding = function (enc) {
  61625. if (!StringDecoder) StringDecoder = __webpack_require__(428).StringDecoder;
  61626. this._readableState.decoder = new StringDecoder(enc);
  61627. this._readableState.encoding = enc;
  61628. return this;
  61629. };
  61630. // Don't raise the hwm > 8MB
  61631. var MAX_HWM = 0x800000;
  61632. function computeNewHighWaterMark(n) {
  61633. if (n >= MAX_HWM) {
  61634. n = MAX_HWM;
  61635. } else {
  61636. // Get the next highest power of 2 to prevent increasing hwm excessively in
  61637. // tiny amounts
  61638. n--;
  61639. n |= n >>> 1;
  61640. n |= n >>> 2;
  61641. n |= n >>> 4;
  61642. n |= n >>> 8;
  61643. n |= n >>> 16;
  61644. n++;
  61645. }
  61646. return n;
  61647. }
  61648. // This function is designed to be inlinable, so please take care when making
  61649. // changes to the function body.
  61650. function howMuchToRead(n, state) {
  61651. if (n <= 0 || state.length === 0 && state.ended) return 0;
  61652. if (state.objectMode) return 1;
  61653. if (n !== n) {
  61654. // Only flow one buffer at a time
  61655. if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  61656. }
  61657. // If we're asking for more than the current hwm, then raise the hwm.
  61658. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  61659. if (n <= state.length) return n;
  61660. // Don't have enough
  61661. if (!state.ended) {
  61662. state.needReadable = true;
  61663. return 0;
  61664. }
  61665. return state.length;
  61666. }
  61667. // you can override either this method, or the async _read(n) below.
  61668. Readable.prototype.read = function (n) {
  61669. debug('read', n);
  61670. n = parseInt(n, 10);
  61671. var state = this._readableState;
  61672. var nOrig = n;
  61673. if (n !== 0) state.emittedReadable = false;
  61674. // if we're doing read(0) to trigger a readable event, but we
  61675. // already have a bunch of data in the buffer, then just trigger
  61676. // the 'readable' event and move on.
  61677. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
  61678. debug('read: emitReadable', state.length, state.ended);
  61679. if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
  61680. return null;
  61681. }
  61682. n = howMuchToRead(n, state);
  61683. // if we've ended, and we're now clear, then finish it up.
  61684. if (n === 0 && state.ended) {
  61685. if (state.length === 0) endReadable(this);
  61686. return null;
  61687. }
  61688. // All the actual chunk generation logic needs to be
  61689. // *below* the call to _read. The reason is that in certain
  61690. // synthetic stream cases, such as passthrough streams, _read
  61691. // may be a completely synchronous operation which may change
  61692. // the state of the read buffer, providing enough data when
  61693. // before there was *not* enough.
  61694. //
  61695. // So, the steps are:
  61696. // 1. Figure out what the state of things will be after we do
  61697. // a read from the buffer.
  61698. //
  61699. // 2. If that resulting state will trigger a _read, then call _read.
  61700. // Note that this may be asynchronous, or synchronous. Yes, it is
  61701. // deeply ugly to write APIs this way, but that still doesn't mean
  61702. // that the Readable class should behave improperly, as streams are
  61703. // designed to be sync/async agnostic.
  61704. // Take note if the _read call is sync or async (ie, if the read call
  61705. // has returned yet), so that we know whether or not it's safe to emit
  61706. // 'readable' etc.
  61707. //
  61708. // 3. Actually pull the requested chunks out of the buffer and return.
  61709. // if we need a readable event, then we need to do some reading.
  61710. var doRead = state.needReadable;
  61711. debug('need readable', doRead);
  61712. // if we currently have less than the highWaterMark, then also read some
  61713. if (state.length === 0 || state.length - n < state.highWaterMark) {
  61714. doRead = true;
  61715. debug('length less than watermark', doRead);
  61716. }
  61717. // however, if we've ended, then there's no point, and if we're already
  61718. // reading, then it's unnecessary.
  61719. if (state.ended || state.reading) {
  61720. doRead = false;
  61721. debug('reading or ended', doRead);
  61722. } else if (doRead) {
  61723. debug('do read');
  61724. state.reading = true;
  61725. state.sync = true;
  61726. // if the length is currently zero, then we *need* a readable event.
  61727. if (state.length === 0) state.needReadable = true;
  61728. // call internal read method
  61729. this._read(state.highWaterMark);
  61730. state.sync = false;
  61731. // If _read pushed data synchronously, then `reading` will be false,
  61732. // and we need to re-evaluate how much data we can return to the user.
  61733. if (!state.reading) n = howMuchToRead(nOrig, state);
  61734. }
  61735. var ret;
  61736. if (n > 0) ret = fromList(n, state);else ret = null;
  61737. if (ret === null) {
  61738. state.needReadable = true;
  61739. n = 0;
  61740. } else {
  61741. state.length -= n;
  61742. }
  61743. if (state.length === 0) {
  61744. // If we have nothing in the buffer, then we want to know
  61745. // as soon as we *do* get something into the buffer.
  61746. if (!state.ended) state.needReadable = true;
  61747. // If we tried to read() past the EOF, then emit end on the next tick.
  61748. if (nOrig !== n && state.ended) endReadable(this);
  61749. }
  61750. if (ret !== null) this.emit('data', ret);
  61751. return ret;
  61752. };
  61753. function onEofChunk(stream, state) {
  61754. if (state.ended) return;
  61755. if (state.decoder) {
  61756. var chunk = state.decoder.end();
  61757. if (chunk && chunk.length) {
  61758. state.buffer.push(chunk);
  61759. state.length += state.objectMode ? 1 : chunk.length;
  61760. }
  61761. }
  61762. state.ended = true;
  61763. // emit 'readable' now to make sure it gets picked up.
  61764. emitReadable(stream);
  61765. }
  61766. // Don't emit readable right away in sync mode, because this can trigger
  61767. // another read() call => stack overflow. This way, it might trigger
  61768. // a nextTick recursion warning, but that's not so bad.
  61769. function emitReadable(stream) {
  61770. var state = stream._readableState;
  61771. state.needReadable = false;
  61772. if (!state.emittedReadable) {
  61773. debug('emitReadable', state.flowing);
  61774. state.emittedReadable = true;
  61775. if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
  61776. }
  61777. }
  61778. function emitReadable_(stream) {
  61779. debug('emit readable');
  61780. stream.emit('readable');
  61781. flow(stream);
  61782. }
  61783. // at this point, the user has presumably seen the 'readable' event,
  61784. // and called read() to consume some data. that may have triggered
  61785. // in turn another _read(n) call, in which case reading = true if
  61786. // it's in progress.
  61787. // However, if we're not ended, or reading, and the length < hwm,
  61788. // then go ahead and try to read some more preemptively.
  61789. function maybeReadMore(stream, state) {
  61790. if (!state.readingMore) {
  61791. state.readingMore = true;
  61792. pna.nextTick(maybeReadMore_, stream, state);
  61793. }
  61794. }
  61795. function maybeReadMore_(stream, state) {
  61796. var len = state.length;
  61797. while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
  61798. debug('maybeReadMore read 0');
  61799. stream.read(0);
  61800. if (len === state.length)
  61801. // didn't get any data, stop spinning.
  61802. break;else len = state.length;
  61803. }
  61804. state.readingMore = false;
  61805. }
  61806. // abstract method. to be overridden in specific implementation classes.
  61807. // call cb(er, data) where data is <= n in length.
  61808. // for virtual (non-string, non-buffer) streams, "length" is somewhat
  61809. // arbitrary, and perhaps not very meaningful.
  61810. Readable.prototype._read = function (n) {
  61811. this.emit('error', new Error('_read() is not implemented'));
  61812. };
  61813. Readable.prototype.pipe = function (dest, pipeOpts) {
  61814. var src = this;
  61815. var state = this._readableState;
  61816. switch (state.pipesCount) {
  61817. case 0:
  61818. state.pipes = dest;
  61819. break;
  61820. case 1:
  61821. state.pipes = [state.pipes, dest];
  61822. break;
  61823. default:
  61824. state.pipes.push(dest);
  61825. break;
  61826. }
  61827. state.pipesCount += 1;
  61828. debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  61829. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  61830. var endFn = doEnd ? onend : unpipe;
  61831. if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
  61832. dest.on('unpipe', onunpipe);
  61833. function onunpipe(readable, unpipeInfo) {
  61834. debug('onunpipe');
  61835. if (readable === src) {
  61836. if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  61837. unpipeInfo.hasUnpiped = true;
  61838. cleanup();
  61839. }
  61840. }
  61841. }
  61842. function onend() {
  61843. debug('onend');
  61844. dest.end();
  61845. }
  61846. // when the dest drains, it reduces the awaitDrain counter
  61847. // on the source. This would be more elegant with a .once()
  61848. // handler in flow(), but adding and removing repeatedly is
  61849. // too slow.
  61850. var ondrain = pipeOnDrain(src);
  61851. dest.on('drain', ondrain);
  61852. var cleanedUp = false;
  61853. function cleanup() {
  61854. debug('cleanup');
  61855. // cleanup event handlers once the pipe is broken
  61856. dest.removeListener('close', onclose);
  61857. dest.removeListener('finish', onfinish);
  61858. dest.removeListener('drain', ondrain);
  61859. dest.removeListener('error', onerror);
  61860. dest.removeListener('unpipe', onunpipe);
  61861. src.removeListener('end', onend);
  61862. src.removeListener('end', unpipe);
  61863. src.removeListener('data', ondata);
  61864. cleanedUp = true;
  61865. // if the reader is waiting for a drain event from this
  61866. // specific writer, then it would cause it to never start
  61867. // flowing again.
  61868. // So, if this is awaiting a drain, then we just call it now.
  61869. // If we don't know, then assume that we are waiting for one.
  61870. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  61871. }
  61872. // If the user pushes more data while we're writing to dest then we'll end up
  61873. // in ondata again. However, we only want to increase awaitDrain once because
  61874. // dest will only emit one 'drain' event for the multiple writes.
  61875. // => Introduce a guard on increasing awaitDrain.
  61876. var increasedAwaitDrain = false;
  61877. src.on('data', ondata);
  61878. function ondata(chunk) {
  61879. debug('ondata');
  61880. increasedAwaitDrain = false;
  61881. var ret = dest.write(chunk);
  61882. if (false === ret && !increasedAwaitDrain) {
  61883. // If the user unpiped during `dest.write()`, it is possible
  61884. // to get stuck in a permanently paused state if that write
  61885. // also returned false.
  61886. // => Check whether `dest` is still a piping destination.
  61887. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  61888. debug('false write response, pause', src._readableState.awaitDrain);
  61889. src._readableState.awaitDrain++;
  61890. increasedAwaitDrain = true;
  61891. }
  61892. src.pause();
  61893. }
  61894. }
  61895. // if the dest has an error, then stop piping into it.
  61896. // however, don't suppress the throwing behavior for this.
  61897. function onerror(er) {
  61898. debug('onerror', er);
  61899. unpipe();
  61900. dest.removeListener('error', onerror);
  61901. if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
  61902. }
  61903. // Make sure our error handler is attached before userland ones.
  61904. prependListener(dest, 'error', onerror);
  61905. // Both close and finish should trigger unpipe, but only once.
  61906. function onclose() {
  61907. dest.removeListener('finish', onfinish);
  61908. unpipe();
  61909. }
  61910. dest.once('close', onclose);
  61911. function onfinish() {
  61912. debug('onfinish');
  61913. dest.removeListener('close', onclose);
  61914. unpipe();
  61915. }
  61916. dest.once('finish', onfinish);
  61917. function unpipe() {
  61918. debug('unpipe');
  61919. src.unpipe(dest);
  61920. }
  61921. // tell the dest that it's being piped to
  61922. dest.emit('pipe', src);
  61923. // start the flow if it hasn't been started already.
  61924. if (!state.flowing) {
  61925. debug('pipe resume');
  61926. src.resume();
  61927. }
  61928. return dest;
  61929. };
  61930. function pipeOnDrain(src) {
  61931. return function () {
  61932. var state = src._readableState;
  61933. debug('pipeOnDrain', state.awaitDrain);
  61934. if (state.awaitDrain) state.awaitDrain--;
  61935. if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
  61936. state.flowing = true;
  61937. flow(src);
  61938. }
  61939. };
  61940. }
  61941. Readable.prototype.unpipe = function (dest) {
  61942. var state = this._readableState;
  61943. var unpipeInfo = { hasUnpiped: false };
  61944. // if we're not piping anywhere, then do nothing.
  61945. if (state.pipesCount === 0) return this;
  61946. // just one destination. most common case.
  61947. if (state.pipesCount === 1) {
  61948. // passed in one, but it's not the right one.
  61949. if (dest && dest !== state.pipes) return this;
  61950. if (!dest) dest = state.pipes;
  61951. // got a match.
  61952. state.pipes = null;
  61953. state.pipesCount = 0;
  61954. state.flowing = false;
  61955. if (dest) dest.emit('unpipe', this, unpipeInfo);
  61956. return this;
  61957. }
  61958. // slow case. multiple pipe destinations.
  61959. if (!dest) {
  61960. // remove all.
  61961. var dests = state.pipes;
  61962. var len = state.pipesCount;
  61963. state.pipes = null;
  61964. state.pipesCount = 0;
  61965. state.flowing = false;
  61966. for (var i = 0; i < len; i++) {
  61967. dests[i].emit('unpipe', this, unpipeInfo);
  61968. }return this;
  61969. }
  61970. // try to find the right one.
  61971. var index = indexOf(state.pipes, dest);
  61972. if (index === -1) return this;
  61973. state.pipes.splice(index, 1);
  61974. state.pipesCount -= 1;
  61975. if (state.pipesCount === 1) state.pipes = state.pipes[0];
  61976. dest.emit('unpipe', this, unpipeInfo);
  61977. return this;
  61978. };
  61979. // set up data events if they are asked for
  61980. // Ensure readable listeners eventually get something
  61981. Readable.prototype.on = function (ev, fn) {
  61982. var res = Stream.prototype.on.call(this, ev, fn);
  61983. if (ev === 'data') {
  61984. // Start flowing on next tick if stream isn't explicitly paused
  61985. if (this._readableState.flowing !== false) this.resume();
  61986. } else if (ev === 'readable') {
  61987. var state = this._readableState;
  61988. if (!state.endEmitted && !state.readableListening) {
  61989. state.readableListening = state.needReadable = true;
  61990. state.emittedReadable = false;
  61991. if (!state.reading) {
  61992. pna.nextTick(nReadingNextTick, this);
  61993. } else if (state.length) {
  61994. emitReadable(this);
  61995. }
  61996. }
  61997. }
  61998. return res;
  61999. };
  62000. Readable.prototype.addListener = Readable.prototype.on;
  62001. function nReadingNextTick(self) {
  62002. debug('readable nexttick read 0');
  62003. self.read(0);
  62004. }
  62005. // pause() and resume() are remnants of the legacy readable stream API
  62006. // If the user uses them, then switch into old mode.
  62007. Readable.prototype.resume = function () {
  62008. var state = this._readableState;
  62009. if (!state.flowing) {
  62010. debug('resume');
  62011. state.flowing = true;
  62012. resume(this, state);
  62013. }
  62014. return this;
  62015. };
  62016. function resume(stream, state) {
  62017. if (!state.resumeScheduled) {
  62018. state.resumeScheduled = true;
  62019. pna.nextTick(resume_, stream, state);
  62020. }
  62021. }
  62022. function resume_(stream, state) {
  62023. if (!state.reading) {
  62024. debug('resume read 0');
  62025. stream.read(0);
  62026. }
  62027. state.resumeScheduled = false;
  62028. state.awaitDrain = 0;
  62029. stream.emit('resume');
  62030. flow(stream);
  62031. if (state.flowing && !state.reading) stream.read(0);
  62032. }
  62033. Readable.prototype.pause = function () {
  62034. debug('call pause flowing=%j', this._readableState.flowing);
  62035. if (false !== this._readableState.flowing) {
  62036. debug('pause');
  62037. this._readableState.flowing = false;
  62038. this.emit('pause');
  62039. }
  62040. return this;
  62041. };
  62042. function flow(stream) {
  62043. var state = stream._readableState;
  62044. debug('flow', state.flowing);
  62045. while (state.flowing && stream.read() !== null) {}
  62046. }
  62047. // wrap an old-style stream as the async data source.
  62048. // This is *not* part of the readable stream interface.
  62049. // It is an ugly unfortunate mess of history.
  62050. Readable.prototype.wrap = function (stream) {
  62051. var _this = this;
  62052. var state = this._readableState;
  62053. var paused = false;
  62054. stream.on('end', function () {
  62055. debug('wrapped end');
  62056. if (state.decoder && !state.ended) {
  62057. var chunk = state.decoder.end();
  62058. if (chunk && chunk.length) _this.push(chunk);
  62059. }
  62060. _this.push(null);
  62061. });
  62062. stream.on('data', function (chunk) {
  62063. debug('wrapped data');
  62064. if (state.decoder) chunk = state.decoder.write(chunk);
  62065. // don't skip over falsy values in objectMode
  62066. if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
  62067. var ret = _this.push(chunk);
  62068. if (!ret) {
  62069. paused = true;
  62070. stream.pause();
  62071. }
  62072. });
  62073. // proxy all the other methods.
  62074. // important when wrapping filters and duplexes.
  62075. for (var i in stream) {
  62076. if (this[i] === undefined && typeof stream[i] === 'function') {
  62077. this[i] = function (method) {
  62078. return function () {
  62079. return stream[method].apply(stream, arguments);
  62080. };
  62081. }(i);
  62082. }
  62083. }
  62084. // proxy certain important events.
  62085. for (var n = 0; n < kProxyEvents.length; n++) {
  62086. stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  62087. }
  62088. // when we try to consume some more bytes, simply unpause the
  62089. // underlying stream.
  62090. this._read = function (n) {
  62091. debug('wrapped _read', n);
  62092. if (paused) {
  62093. paused = false;
  62094. stream.resume();
  62095. }
  62096. };
  62097. return this;
  62098. };
  62099. Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
  62100. // making it explicit this property is not enumerable
  62101. // because otherwise some prototype manipulation in
  62102. // userland will fail
  62103. enumerable: false,
  62104. get: function () {
  62105. return this._readableState.highWaterMark;
  62106. }
  62107. });
  62108. // exposed for testing purposes only.
  62109. Readable._fromList = fromList;
  62110. // Pluck off n bytes from an array of buffers.
  62111. // Length is the combined lengths of all the buffers in the list.
  62112. // This function is designed to be inlinable, so please take care when making
  62113. // changes to the function body.
  62114. function fromList(n, state) {
  62115. // nothing buffered
  62116. if (state.length === 0) return null;
  62117. var ret;
  62118. if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
  62119. // read it all, truncate the list
  62120. if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
  62121. state.buffer.clear();
  62122. } else {
  62123. // read part of list
  62124. ret = fromListPartial(n, state.buffer, state.decoder);
  62125. }
  62126. return ret;
  62127. }
  62128. // Extracts only enough buffered data to satisfy the amount requested.
  62129. // This function is designed to be inlinable, so please take care when making
  62130. // changes to the function body.
  62131. function fromListPartial(n, list, hasStrings) {
  62132. var ret;
  62133. if (n < list.head.data.length) {
  62134. // slice is the same for buffers and strings
  62135. ret = list.head.data.slice(0, n);
  62136. list.head.data = list.head.data.slice(n);
  62137. } else if (n === list.head.data.length) {
  62138. // first chunk is a perfect match
  62139. ret = list.shift();
  62140. } else {
  62141. // result spans more than one buffer
  62142. ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
  62143. }
  62144. return ret;
  62145. }
  62146. // Copies a specified amount of characters from the list of buffered data
  62147. // chunks.
  62148. // This function is designed to be inlinable, so please take care when making
  62149. // changes to the function body.
  62150. function copyFromBufferString(n, list) {
  62151. var p = list.head;
  62152. var c = 1;
  62153. var ret = p.data;
  62154. n -= ret.length;
  62155. while (p = p.next) {
  62156. var str = p.data;
  62157. var nb = n > str.length ? str.length : n;
  62158. if (nb === str.length) ret += str;else ret += str.slice(0, n);
  62159. n -= nb;
  62160. if (n === 0) {
  62161. if (nb === str.length) {
  62162. ++c;
  62163. if (p.next) list.head = p.next;else list.head = list.tail = null;
  62164. } else {
  62165. list.head = p;
  62166. p.data = str.slice(nb);
  62167. }
  62168. break;
  62169. }
  62170. ++c;
  62171. }
  62172. list.length -= c;
  62173. return ret;
  62174. }
  62175. // Copies a specified amount of bytes from the list of buffered data chunks.
  62176. // This function is designed to be inlinable, so please take care when making
  62177. // changes to the function body.
  62178. function copyFromBuffer(n, list) {
  62179. var ret = Buffer.allocUnsafe(n);
  62180. var p = list.head;
  62181. var c = 1;
  62182. p.data.copy(ret);
  62183. n -= p.data.length;
  62184. while (p = p.next) {
  62185. var buf = p.data;
  62186. var nb = n > buf.length ? buf.length : n;
  62187. buf.copy(ret, ret.length - n, 0, nb);
  62188. n -= nb;
  62189. if (n === 0) {
  62190. if (nb === buf.length) {
  62191. ++c;
  62192. if (p.next) list.head = p.next;else list.head = list.tail = null;
  62193. } else {
  62194. list.head = p;
  62195. p.data = buf.slice(nb);
  62196. }
  62197. break;
  62198. }
  62199. ++c;
  62200. }
  62201. list.length -= c;
  62202. return ret;
  62203. }
  62204. function endReadable(stream) {
  62205. var state = stream._readableState;
  62206. // If we get here before consuming all the bytes, then that is a
  62207. // bug in node. Should never happen.
  62208. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  62209. if (!state.endEmitted) {
  62210. state.ended = true;
  62211. pna.nextTick(endReadableNT, state, stream);
  62212. }
  62213. }
  62214. function endReadableNT(state, stream) {
  62215. // Check that we didn't get one last unshift.
  62216. if (!state.endEmitted && state.length === 0) {
  62217. state.endEmitted = true;
  62218. stream.readable = false;
  62219. stream.emit('end');
  62220. }
  62221. }
  62222. function indexOf(xs, x) {
  62223. for (var i = 0, l = xs.length; i < l; i++) {
  62224. if (xs[i] === x) return i;
  62225. }
  62226. return -1;
  62227. }
  62228. /***/ }),
  62229. /* 377 */
  62230. /***/ (function(module, exports, __webpack_require__) {
  62231. "use strict";
  62232. // Copyright Joyent, Inc. and other Node contributors.
  62233. //
  62234. // Permission is hereby granted, free of charge, to any person obtaining a
  62235. // copy of this software and associated documentation files (the
  62236. // "Software"), to deal in the Software without restriction, including
  62237. // without limitation the rights to use, copy, modify, merge, publish,
  62238. // distribute, sublicense, and/or sell copies of the Software, and to permit
  62239. // persons to whom the Software is furnished to do so, subject to the
  62240. // following conditions:
  62241. //
  62242. // The above copyright notice and this permission notice shall be included
  62243. // in all copies or substantial portions of the Software.
  62244. //
  62245. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  62246. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  62247. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  62248. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  62249. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  62250. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  62251. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  62252. // a transform stream is a readable/writable stream where you do
  62253. // something with the data. Sometimes it's called a "filter",
  62254. // but that's not a great name for it, since that implies a thing where
  62255. // some bits pass through, and others are simply ignored. (That would
  62256. // be a valid example of a transform, of course.)
  62257. //
  62258. // While the output is causally related to the input, it's not a
  62259. // necessarily symmetric or synchronous transformation. For example,
  62260. // a zlib stream might take multiple plain-text writes(), and then
  62261. // emit a single compressed chunk some time in the future.
  62262. //
  62263. // Here's how this works:
  62264. //
  62265. // The Transform stream has all the aspects of the readable and writable
  62266. // stream classes. When you write(chunk), that calls _write(chunk,cb)
  62267. // internally, and returns false if there's a lot of pending writes
  62268. // buffered up. When you call read(), that calls _read(n) until
  62269. // there's enough pending readable data buffered up.
  62270. //
  62271. // In a transform stream, the written data is placed in a buffer. When
  62272. // _read(n) is called, it transforms the queued up data, calling the
  62273. // buffered _write cb's as it consumes chunks. If consuming a single
  62274. // written chunk would result in multiple output chunks, then the first
  62275. // outputted bit calls the readcb, and subsequent chunks just go into
  62276. // the read buffer, and will cause it to emit 'readable' if necessary.
  62277. //
  62278. // This way, back-pressure is actually determined by the reading side,
  62279. // since _read has to be called to start processing a new chunk. However,
  62280. // a pathological inflate type of transform can cause excessive buffering
  62281. // here. For example, imagine a stream where every byte of input is
  62282. // interpreted as an integer from 0-255, and then results in that many
  62283. // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
  62284. // 1kb of data being output. In this case, you could write a very small
  62285. // amount of input, and end up with a very large amount of output. In
  62286. // such a pathological inflating mechanism, there'd be no way to tell
  62287. // the system to stop doing the transform. A single 4MB write could
  62288. // cause the system to run out of memory.
  62289. //
  62290. // However, even in such a pathological case, only a single written chunk
  62291. // would be consumed, and then the rest would wait (un-transformed) until
  62292. // the results of the previous transformed chunk were consumed.
  62293. module.exports = Transform;
  62294. var Duplex = __webpack_require__(110);
  62295. /*<replacement>*/
  62296. var util = __webpack_require__(105);
  62297. util.inherits = __webpack_require__(78);
  62298. /*</replacement>*/
  62299. util.inherits(Transform, Duplex);
  62300. function afterTransform(er, data) {
  62301. var ts = this._transformState;
  62302. ts.transforming = false;
  62303. var cb = ts.writecb;
  62304. if (!cb) {
  62305. return this.emit('error', new Error('write callback called multiple times'));
  62306. }
  62307. ts.writechunk = null;
  62308. ts.writecb = null;
  62309. if (data != null) // single equals check for both `null` and `undefined`
  62310. this.push(data);
  62311. cb(er);
  62312. var rs = this._readableState;
  62313. rs.reading = false;
  62314. if (rs.needReadable || rs.length < rs.highWaterMark) {
  62315. this._read(rs.highWaterMark);
  62316. }
  62317. }
  62318. function Transform(options) {
  62319. if (!(this instanceof Transform)) return new Transform(options);
  62320. Duplex.call(this, options);
  62321. this._transformState = {
  62322. afterTransform: afterTransform.bind(this),
  62323. needTransform: false,
  62324. transforming: false,
  62325. writecb: null,
  62326. writechunk: null,
  62327. writeencoding: null
  62328. };
  62329. // start out asking for a readable event once data is transformed.
  62330. this._readableState.needReadable = true;
  62331. // we have implemented the _read method, and done the other things
  62332. // that Readable wants before the first _read call, so unset the
  62333. // sync guard flag.
  62334. this._readableState.sync = false;
  62335. if (options) {
  62336. if (typeof options.transform === 'function') this._transform = options.transform;
  62337. if (typeof options.flush === 'function') this._flush = options.flush;
  62338. }
  62339. // When the writable side finishes, then flush out anything remaining.
  62340. this.on('prefinish', prefinish);
  62341. }
  62342. function prefinish() {
  62343. var _this = this;
  62344. if (typeof this._flush === 'function') {
  62345. this._flush(function (er, data) {
  62346. done(_this, er, data);
  62347. });
  62348. } else {
  62349. done(this, null, null);
  62350. }
  62351. }
  62352. Transform.prototype.push = function (chunk, encoding) {
  62353. this._transformState.needTransform = false;
  62354. return Duplex.prototype.push.call(this, chunk, encoding);
  62355. };
  62356. // This is the part where you do stuff!
  62357. // override this function in implementation classes.
  62358. // 'chunk' is an input chunk.
  62359. //
  62360. // Call `push(newChunk)` to pass along transformed output
  62361. // to the readable side. You may call 'push' zero or more times.
  62362. //
  62363. // Call `cb(err)` when you are done with this chunk. If you pass
  62364. // an error, then that'll put the hurt on the whole operation. If you
  62365. // never call cb(), then you'll never get another chunk.
  62366. Transform.prototype._transform = function (chunk, encoding, cb) {
  62367. throw new Error('_transform() is not implemented');
  62368. };
  62369. Transform.prototype._write = function (chunk, encoding, cb) {
  62370. var ts = this._transformState;
  62371. ts.writecb = cb;
  62372. ts.writechunk = chunk;
  62373. ts.writeencoding = encoding;
  62374. if (!ts.transforming) {
  62375. var rs = this._readableState;
  62376. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  62377. }
  62378. };
  62379. // Doesn't matter what the args are here.
  62380. // _transform does all the work.
  62381. // That we got here means that the readable side wants more data.
  62382. Transform.prototype._read = function (n) {
  62383. var ts = this._transformState;
  62384. if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
  62385. ts.transforming = true;
  62386. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  62387. } else {
  62388. // mark that we need a transform, so that any data that comes in
  62389. // will get processed, now that we've asked for it.
  62390. ts.needTransform = true;
  62391. }
  62392. };
  62393. Transform.prototype._destroy = function (err, cb) {
  62394. var _this2 = this;
  62395. Duplex.prototype._destroy.call(this, err, function (err2) {
  62396. cb(err2);
  62397. _this2.emit('close');
  62398. });
  62399. };
  62400. function done(stream, er, data) {
  62401. if (er) return stream.emit('error', er);
  62402. if (data != null) // single equals check for both `null` and `undefined`
  62403. stream.push(data);
  62404. // if there's nothing in the write buffer, then that means
  62405. // that nothing more will ever be provided
  62406. if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
  62407. if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
  62408. return stream.push(null);
  62409. }
  62410. /***/ }),
  62411. /* 378 */
  62412. /***/ (function(module, exports, __webpack_require__) {
  62413. "use strict";
  62414. // Copyright Joyent, Inc. and other Node contributors.
  62415. //
  62416. // Permission is hereby granted, free of charge, to any person obtaining a
  62417. // copy of this software and associated documentation files (the
  62418. // "Software"), to deal in the Software without restriction, including
  62419. // without limitation the rights to use, copy, modify, merge, publish,
  62420. // distribute, sublicense, and/or sell copies of the Software, and to permit
  62421. // persons to whom the Software is furnished to do so, subject to the
  62422. // following conditions:
  62423. //
  62424. // The above copyright notice and this permission notice shall be included
  62425. // in all copies or substantial portions of the Software.
  62426. //
  62427. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  62428. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  62429. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  62430. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  62431. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  62432. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  62433. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  62434. // A bit simpler than readable streams.
  62435. // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  62436. // the drain event emission and buffering.
  62437. /*<replacement>*/
  62438. var pna = __webpack_require__(171);
  62439. /*</replacement>*/
  62440. module.exports = Writable;
  62441. /* <replacement> */
  62442. function WriteReq(chunk, encoding, cb) {
  62443. this.chunk = chunk;
  62444. this.encoding = encoding;
  62445. this.callback = cb;
  62446. this.next = null;
  62447. }
  62448. // It seems a linked list but it is not
  62449. // there will be only 2 of these for each stream
  62450. function CorkedRequest(state) {
  62451. var _this = this;
  62452. this.next = null;
  62453. this.entry = null;
  62454. this.finish = function () {
  62455. onCorkedFinish(_this, state);
  62456. };
  62457. }
  62458. /* </replacement> */
  62459. /*<replacement>*/
  62460. var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
  62461. /*</replacement>*/
  62462. /*<replacement>*/
  62463. var Duplex;
  62464. /*</replacement>*/
  62465. Writable.WritableState = WritableState;
  62466. /*<replacement>*/
  62467. var util = __webpack_require__(105);
  62468. util.inherits = __webpack_require__(78);
  62469. /*</replacement>*/
  62470. /*<replacement>*/
  62471. var internalUtil = {
  62472. deprecate: __webpack_require__(1029)
  62473. };
  62474. /*</replacement>*/
  62475. /*<replacement>*/
  62476. var Stream = __webpack_require__(380);
  62477. /*</replacement>*/
  62478. /*<replacement>*/
  62479. var Buffer = __webpack_require__(60).Buffer;
  62480. var OurUint8Array = global.Uint8Array || function () {};
  62481. function _uint8ArrayToBuffer(chunk) {
  62482. return Buffer.from(chunk);
  62483. }
  62484. function _isUint8Array(obj) {
  62485. return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
  62486. }
  62487. /*</replacement>*/
  62488. var destroyImpl = __webpack_require__(379);
  62489. util.inherits(Writable, Stream);
  62490. function nop() {}
  62491. function WritableState(options, stream) {
  62492. Duplex = Duplex || __webpack_require__(110);
  62493. options = options || {};
  62494. // Duplex streams are both readable and writable, but share
  62495. // the same options object.
  62496. // However, some cases require setting options to different
  62497. // values for the readable and the writable sides of the duplex stream.
  62498. // These options can be provided separately as readableXXX and writableXXX.
  62499. var isDuplex = stream instanceof Duplex;
  62500. // object stream flag to indicate whether or not this stream
  62501. // contains buffers or objects.
  62502. this.objectMode = !!options.objectMode;
  62503. if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
  62504. // the point at which write() starts returning false
  62505. // Note: 0 is a valid value, means that we always return false if
  62506. // the entire buffer is not flushed immediately on write()
  62507. var hwm = options.highWaterMark;
  62508. var writableHwm = options.writableHighWaterMark;
  62509. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  62510. if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
  62511. // cast to ints.
  62512. this.highWaterMark = Math.floor(this.highWaterMark);
  62513. // if _final has been called
  62514. this.finalCalled = false;
  62515. // drain event flag.
  62516. this.needDrain = false;
  62517. // at the start of calling end()
  62518. this.ending = false;
  62519. // when end() has been called, and returned
  62520. this.ended = false;
  62521. // when 'finish' is emitted
  62522. this.finished = false;
  62523. // has it been destroyed
  62524. this.destroyed = false;
  62525. // should we decode strings into buffers before passing to _write?
  62526. // this is here so that some node-core streams can optimize string
  62527. // handling at a lower level.
  62528. var noDecode = options.decodeStrings === false;
  62529. this.decodeStrings = !noDecode;
  62530. // Crypto is kind of old and crusty. Historically, its default string
  62531. // encoding is 'binary' so we have to make this configurable.
  62532. // Everything else in the universe uses 'utf8', though.
  62533. this.defaultEncoding = options.defaultEncoding || 'utf8';
  62534. // not an actual buffer we keep track of, but a measurement
  62535. // of how much we're waiting to get pushed to some underlying
  62536. // socket or file.
  62537. this.length = 0;
  62538. // a flag to see when we're in the middle of a write.
  62539. this.writing = false;
  62540. // when true all writes will be buffered until .uncork() call
  62541. this.corked = 0;
  62542. // a flag to be able to tell if the onwrite cb is called immediately,
  62543. // or on a later tick. We set this to true at first, because any
  62544. // actions that shouldn't happen until "later" should generally also
  62545. // not happen before the first write call.
  62546. this.sync = true;
  62547. // a flag to know if we're processing previously buffered items, which
  62548. // may call the _write() callback in the same tick, so that we don't
  62549. // end up in an overlapped onwrite situation.
  62550. this.bufferProcessing = false;
  62551. // the callback that's passed to _write(chunk,cb)
  62552. this.onwrite = function (er) {
  62553. onwrite(stream, er);
  62554. };
  62555. // the callback that the user supplies to write(chunk,encoding,cb)
  62556. this.writecb = null;
  62557. // the amount that is being written when _write is called.
  62558. this.writelen = 0;
  62559. this.bufferedRequest = null;
  62560. this.lastBufferedRequest = null;
  62561. // number of pending user-supplied write callbacks
  62562. // this must be 0 before 'finish' can be emitted
  62563. this.pendingcb = 0;
  62564. // emit prefinish if the only thing we're waiting for is _write cbs
  62565. // This is relevant for synchronous Transform streams
  62566. this.prefinished = false;
  62567. // True if the error was already emitted and should not be thrown again
  62568. this.errorEmitted = false;
  62569. // count buffered requests
  62570. this.bufferedRequestCount = 0;
  62571. // allocate the first CorkedRequest, there is always
  62572. // one allocated and free to use, and we maintain at most two
  62573. this.corkedRequestsFree = new CorkedRequest(this);
  62574. }
  62575. WritableState.prototype.getBuffer = function getBuffer() {
  62576. var current = this.bufferedRequest;
  62577. var out = [];
  62578. while (current) {
  62579. out.push(current);
  62580. current = current.next;
  62581. }
  62582. return out;
  62583. };
  62584. (function () {
  62585. try {
  62586. Object.defineProperty(WritableState.prototype, 'buffer', {
  62587. get: internalUtil.deprecate(function () {
  62588. return this.getBuffer();
  62589. }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
  62590. });
  62591. } catch (_) {}
  62592. })();
  62593. // Test _writableState for inheritance to account for Duplex streams,
  62594. // whose prototype chain only points to Readable.
  62595. var realHasInstance;
  62596. if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
  62597. realHasInstance = Function.prototype[Symbol.hasInstance];
  62598. Object.defineProperty(Writable, Symbol.hasInstance, {
  62599. value: function (object) {
  62600. if (realHasInstance.call(this, object)) return true;
  62601. if (this !== Writable) return false;
  62602. return object && object._writableState instanceof WritableState;
  62603. }
  62604. });
  62605. } else {
  62606. realHasInstance = function (object) {
  62607. return object instanceof this;
  62608. };
  62609. }
  62610. function Writable(options) {
  62611. Duplex = Duplex || __webpack_require__(110);
  62612. // Writable ctor is applied to Duplexes, too.
  62613. // `realHasInstance` is necessary because using plain `instanceof`
  62614. // would return false, as no `_writableState` property is attached.
  62615. // Trying to use the custom `instanceof` for Writable here will also break the
  62616. // Node.js LazyTransform implementation, which has a non-trivial getter for
  62617. // `_writableState` that would lead to infinite recursion.
  62618. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
  62619. return new Writable(options);
  62620. }
  62621. this._writableState = new WritableState(options, this);
  62622. // legacy.
  62623. this.writable = true;
  62624. if (options) {
  62625. if (typeof options.write === 'function') this._write = options.write;
  62626. if (typeof options.writev === 'function') this._writev = options.writev;
  62627. if (typeof options.destroy === 'function') this._destroy = options.destroy;
  62628. if (typeof options.final === 'function') this._final = options.final;
  62629. }
  62630. Stream.call(this);
  62631. }
  62632. // Otherwise people can pipe Writable streams, which is just wrong.
  62633. Writable.prototype.pipe = function () {
  62634. this.emit('error', new Error('Cannot pipe, not readable'));
  62635. };
  62636. function writeAfterEnd(stream, cb) {
  62637. var er = new Error('write after end');
  62638. // TODO: defer error events consistently everywhere, not just the cb
  62639. stream.emit('error', er);
  62640. pna.nextTick(cb, er);
  62641. }
  62642. // Checks that a user-supplied chunk is valid, especially for the particular
  62643. // mode the stream is in. Currently this means that `null` is never accepted
  62644. // and undefined/non-string values are only allowed in object mode.
  62645. function validChunk(stream, state, chunk, cb) {
  62646. var valid = true;
  62647. var er = false;
  62648. if (chunk === null) {
  62649. er = new TypeError('May not write null values to stream');
  62650. } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  62651. er = new TypeError('Invalid non-string/buffer chunk');
  62652. }
  62653. if (er) {
  62654. stream.emit('error', er);
  62655. pna.nextTick(cb, er);
  62656. valid = false;
  62657. }
  62658. return valid;
  62659. }
  62660. Writable.prototype.write = function (chunk, encoding, cb) {
  62661. var state = this._writableState;
  62662. var ret = false;
  62663. var isBuf = !state.objectMode && _isUint8Array(chunk);
  62664. if (isBuf && !Buffer.isBuffer(chunk)) {
  62665. chunk = _uint8ArrayToBuffer(chunk);
  62666. }
  62667. if (typeof encoding === 'function') {
  62668. cb = encoding;
  62669. encoding = null;
  62670. }
  62671. if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  62672. if (typeof cb !== 'function') cb = nop;
  62673. if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
  62674. state.pendingcb++;
  62675. ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  62676. }
  62677. return ret;
  62678. };
  62679. Writable.prototype.cork = function () {
  62680. var state = this._writableState;
  62681. state.corked++;
  62682. };
  62683. Writable.prototype.uncork = function () {
  62684. var state = this._writableState;
  62685. if (state.corked) {
  62686. state.corked--;
  62687. if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  62688. }
  62689. };
  62690. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  62691. // node::ParseEncoding() requires lower case.
  62692. if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  62693. if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
  62694. this._writableState.defaultEncoding = encoding;
  62695. return this;
  62696. };
  62697. function decodeChunk(state, chunk, encoding) {
  62698. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
  62699. chunk = Buffer.from(chunk, encoding);
  62700. }
  62701. return chunk;
  62702. }
  62703. Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
  62704. // making it explicit this property is not enumerable
  62705. // because otherwise some prototype manipulation in
  62706. // userland will fail
  62707. enumerable: false,
  62708. get: function () {
  62709. return this._writableState.highWaterMark;
  62710. }
  62711. });
  62712. // if we're already writing something, then just put this
  62713. // in the queue, and wait our turn. Otherwise, call _write
  62714. // If we return false, then we need a drain event, so set that flag.
  62715. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  62716. if (!isBuf) {
  62717. var newChunk = decodeChunk(state, chunk, encoding);
  62718. if (chunk !== newChunk) {
  62719. isBuf = true;
  62720. encoding = 'buffer';
  62721. chunk = newChunk;
  62722. }
  62723. }
  62724. var len = state.objectMode ? 1 : chunk.length;
  62725. state.length += len;
  62726. var ret = state.length < state.highWaterMark;
  62727. // we must ensure that previous needDrain will not be reset to false.
  62728. if (!ret) state.needDrain = true;
  62729. if (state.writing || state.corked) {
  62730. var last = state.lastBufferedRequest;
  62731. state.lastBufferedRequest = {
  62732. chunk: chunk,
  62733. encoding: encoding,
  62734. isBuf: isBuf,
  62735. callback: cb,
  62736. next: null
  62737. };
  62738. if (last) {
  62739. last.next = state.lastBufferedRequest;
  62740. } else {
  62741. state.bufferedRequest = state.lastBufferedRequest;
  62742. }
  62743. state.bufferedRequestCount += 1;
  62744. } else {
  62745. doWrite(stream, state, false, len, chunk, encoding, cb);
  62746. }
  62747. return ret;
  62748. }
  62749. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  62750. state.writelen = len;
  62751. state.writecb = cb;
  62752. state.writing = true;
  62753. state.sync = true;
  62754. if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  62755. state.sync = false;
  62756. }
  62757. function onwriteError(stream, state, sync, er, cb) {
  62758. --state.pendingcb;
  62759. if (sync) {
  62760. // defer the callback if we are being called synchronously
  62761. // to avoid piling up things on the stack
  62762. pna.nextTick(cb, er);
  62763. // this can emit finish, and it will always happen
  62764. // after error
  62765. pna.nextTick(finishMaybe, stream, state);
  62766. stream._writableState.errorEmitted = true;
  62767. stream.emit('error', er);
  62768. } else {
  62769. // the caller expect this to happen before if
  62770. // it is async
  62771. cb(er);
  62772. stream._writableState.errorEmitted = true;
  62773. stream.emit('error', er);
  62774. // this can emit finish, but finish must
  62775. // always follow error
  62776. finishMaybe(stream, state);
  62777. }
  62778. }
  62779. function onwriteStateUpdate(state) {
  62780. state.writing = false;
  62781. state.writecb = null;
  62782. state.length -= state.writelen;
  62783. state.writelen = 0;
  62784. }
  62785. function onwrite(stream, er) {
  62786. var state = stream._writableState;
  62787. var sync = state.sync;
  62788. var cb = state.writecb;
  62789. onwriteStateUpdate(state);
  62790. if (er) onwriteError(stream, state, sync, er, cb);else {
  62791. // Check if we're actually ready to finish, but don't emit yet
  62792. var finished = needFinish(state);
  62793. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  62794. clearBuffer(stream, state);
  62795. }
  62796. if (sync) {
  62797. /*<replacement>*/
  62798. asyncWrite(afterWrite, stream, state, finished, cb);
  62799. /*</replacement>*/
  62800. } else {
  62801. afterWrite(stream, state, finished, cb);
  62802. }
  62803. }
  62804. }
  62805. function afterWrite(stream, state, finished, cb) {
  62806. if (!finished) onwriteDrain(stream, state);
  62807. state.pendingcb--;
  62808. cb();
  62809. finishMaybe(stream, state);
  62810. }
  62811. // Must force callback to be called on nextTick, so that we don't
  62812. // emit 'drain' before the write() consumer gets the 'false' return
  62813. // value, and has a chance to attach a 'drain' listener.
  62814. function onwriteDrain(stream, state) {
  62815. if (state.length === 0 && state.needDrain) {
  62816. state.needDrain = false;
  62817. stream.emit('drain');
  62818. }
  62819. }
  62820. // if there's something in the buffer waiting, then process it
  62821. function clearBuffer(stream, state) {
  62822. state.bufferProcessing = true;
  62823. var entry = state.bufferedRequest;
  62824. if (stream._writev && entry && entry.next) {
  62825. // Fast case, write everything using _writev()
  62826. var l = state.bufferedRequestCount;
  62827. var buffer = new Array(l);
  62828. var holder = state.corkedRequestsFree;
  62829. holder.entry = entry;
  62830. var count = 0;
  62831. var allBuffers = true;
  62832. while (entry) {
  62833. buffer[count] = entry;
  62834. if (!entry.isBuf) allBuffers = false;
  62835. entry = entry.next;
  62836. count += 1;
  62837. }
  62838. buffer.allBuffers = allBuffers;
  62839. doWrite(stream, state, true, state.length, buffer, '', holder.finish);
  62840. // doWrite is almost always async, defer these to save a bit of time
  62841. // as the hot path ends with doWrite
  62842. state.pendingcb++;
  62843. state.lastBufferedRequest = null;
  62844. if (holder.next) {
  62845. state.corkedRequestsFree = holder.next;
  62846. holder.next = null;
  62847. } else {
  62848. state.corkedRequestsFree = new CorkedRequest(state);
  62849. }
  62850. state.bufferedRequestCount = 0;
  62851. } else {
  62852. // Slow case, write chunks one-by-one
  62853. while (entry) {
  62854. var chunk = entry.chunk;
  62855. var encoding = entry.encoding;
  62856. var cb = entry.callback;
  62857. var len = state.objectMode ? 1 : chunk.length;
  62858. doWrite(stream, state, false, len, chunk, encoding, cb);
  62859. entry = entry.next;
  62860. state.bufferedRequestCount--;
  62861. // if we didn't call the onwrite immediately, then
  62862. // it means that we need to wait until it does.
  62863. // also, that means that the chunk and cb are currently
  62864. // being processed, so move the buffer counter past them.
  62865. if (state.writing) {
  62866. break;
  62867. }
  62868. }
  62869. if (entry === null) state.lastBufferedRequest = null;
  62870. }
  62871. state.bufferedRequest = entry;
  62872. state.bufferProcessing = false;
  62873. }
  62874. Writable.prototype._write = function (chunk, encoding, cb) {
  62875. cb(new Error('_write() is not implemented'));
  62876. };
  62877. Writable.prototype._writev = null;
  62878. Writable.prototype.end = function (chunk, encoding, cb) {
  62879. var state = this._writableState;
  62880. if (typeof chunk === 'function') {
  62881. cb = chunk;
  62882. chunk = null;
  62883. encoding = null;
  62884. } else if (typeof encoding === 'function') {
  62885. cb = encoding;
  62886. encoding = null;
  62887. }
  62888. if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
  62889. // .end() fully uncorks
  62890. if (state.corked) {
  62891. state.corked = 1;
  62892. this.uncork();
  62893. }
  62894. // ignore unnecessary end() calls.
  62895. if (!state.ending && !state.finished) endWritable(this, state, cb);
  62896. };
  62897. function needFinish(state) {
  62898. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  62899. }
  62900. function callFinal(stream, state) {
  62901. stream._final(function (err) {
  62902. state.pendingcb--;
  62903. if (err) {
  62904. stream.emit('error', err);
  62905. }
  62906. state.prefinished = true;
  62907. stream.emit('prefinish');
  62908. finishMaybe(stream, state);
  62909. });
  62910. }
  62911. function prefinish(stream, state) {
  62912. if (!state.prefinished && !state.finalCalled) {
  62913. if (typeof stream._final === 'function') {
  62914. state.pendingcb++;
  62915. state.finalCalled = true;
  62916. pna.nextTick(callFinal, stream, state);
  62917. } else {
  62918. state.prefinished = true;
  62919. stream.emit('prefinish');
  62920. }
  62921. }
  62922. }
  62923. function finishMaybe(stream, state) {
  62924. var need = needFinish(state);
  62925. if (need) {
  62926. prefinish(stream, state);
  62927. if (state.pendingcb === 0) {
  62928. state.finished = true;
  62929. stream.emit('finish');
  62930. }
  62931. }
  62932. return need;
  62933. }
  62934. function endWritable(stream, state, cb) {
  62935. state.ending = true;
  62936. finishMaybe(stream, state);
  62937. if (cb) {
  62938. if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
  62939. }
  62940. state.ended = true;
  62941. stream.writable = false;
  62942. }
  62943. function onCorkedFinish(corkReq, state, err) {
  62944. var entry = corkReq.entry;
  62945. corkReq.entry = null;
  62946. while (entry) {
  62947. var cb = entry.callback;
  62948. state.pendingcb--;
  62949. cb(err);
  62950. entry = entry.next;
  62951. }
  62952. if (state.corkedRequestsFree) {
  62953. state.corkedRequestsFree.next = corkReq;
  62954. } else {
  62955. state.corkedRequestsFree = corkReq;
  62956. }
  62957. }
  62958. Object.defineProperty(Writable.prototype, 'destroyed', {
  62959. get: function () {
  62960. if (this._writableState === undefined) {
  62961. return false;
  62962. }
  62963. return this._writableState.destroyed;
  62964. },
  62965. set: function (value) {
  62966. // we ignore the value if the stream
  62967. // has not been initialized yet
  62968. if (!this._writableState) {
  62969. return;
  62970. }
  62971. // backward compatibility, the user is explicitly
  62972. // managing destroyed
  62973. this._writableState.destroyed = value;
  62974. }
  62975. });
  62976. Writable.prototype.destroy = destroyImpl.destroy;
  62977. Writable.prototype._undestroy = destroyImpl.undestroy;
  62978. Writable.prototype._destroy = function (err, cb) {
  62979. this.end();
  62980. cb(err);
  62981. };
  62982. /***/ }),
  62983. /* 379 */
  62984. /***/ (function(module, exports, __webpack_require__) {
  62985. "use strict";
  62986. /*<replacement>*/
  62987. var pna = __webpack_require__(171);
  62988. /*</replacement>*/
  62989. // undocumented cb() API, needed for core, not for public API
  62990. function destroy(err, cb) {
  62991. var _this = this;
  62992. var readableDestroyed = this._readableState && this._readableState.destroyed;
  62993. var writableDestroyed = this._writableState && this._writableState.destroyed;
  62994. if (readableDestroyed || writableDestroyed) {
  62995. if (cb) {
  62996. cb(err);
  62997. } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
  62998. pna.nextTick(emitErrorNT, this, err);
  62999. }
  63000. return this;
  63001. }
  63002. // we set destroyed to true before firing error callbacks in order
  63003. // to make it re-entrance safe in case destroy() is called within callbacks
  63004. if (this._readableState) {
  63005. this._readableState.destroyed = true;
  63006. }
  63007. // if this is a duplex stream mark the writable part as destroyed as well
  63008. if (this._writableState) {
  63009. this._writableState.destroyed = true;
  63010. }
  63011. this._destroy(err || null, function (err) {
  63012. if (!cb && err) {
  63013. pna.nextTick(emitErrorNT, _this, err);
  63014. if (_this._writableState) {
  63015. _this._writableState.errorEmitted = true;
  63016. }
  63017. } else if (cb) {
  63018. cb(err);
  63019. }
  63020. });
  63021. return this;
  63022. }
  63023. function undestroy() {
  63024. if (this._readableState) {
  63025. this._readableState.destroyed = false;
  63026. this._readableState.reading = false;
  63027. this._readableState.ended = false;
  63028. this._readableState.endEmitted = false;
  63029. }
  63030. if (this._writableState) {
  63031. this._writableState.destroyed = false;
  63032. this._writableState.ended = false;
  63033. this._writableState.ending = false;
  63034. this._writableState.finished = false;
  63035. this._writableState.errorEmitted = false;
  63036. }
  63037. }
  63038. function emitErrorNT(self, err) {
  63039. self.emit('error', err);
  63040. }
  63041. module.exports = {
  63042. destroy: destroy,
  63043. undestroy: undestroy
  63044. };
  63045. /***/ }),
  63046. /* 380 */
  63047. /***/ (function(module, exports, __webpack_require__) {
  63048. module.exports = __webpack_require__(36);
  63049. /***/ }),
  63050. /* 381 */
  63051. /***/ (function(module, exports, __webpack_require__) {
  63052. "use strict";
  63053. /*!
  63054. * repeat-element <https://github.com/jonschlinkert/repeat-element>
  63055. *
  63056. * Copyright (c) 2015 Jon Schlinkert.
  63057. * Licensed under the MIT license.
  63058. */
  63059. module.exports = function repeat(ele, num) {
  63060. var arr = new Array(num);
  63061. for (var i = 0; i < num; i++) {
  63062. arr[i] = ele;
  63063. }
  63064. return arr;
  63065. };
  63066. /***/ }),
  63067. /* 382 */
  63068. /***/ (function(module, exports, __webpack_require__) {
  63069. "use strict";
  63070. var tough = __webpack_require__(882)
  63071. var Cookie = tough.Cookie
  63072. var CookieJar = tough.CookieJar
  63073. exports.parse = function (str) {
  63074. if (str && str.uri) {
  63075. str = str.uri
  63076. }
  63077. if (typeof str !== 'string') {
  63078. throw new Error('The cookie function only accepts STRING as param')
  63079. }
  63080. return Cookie.parse(str, {loose: true})
  63081. }
  63082. // Adapt the sometimes-Async api of tough.CookieJar to our requirements
  63083. function RequestJar (store) {
  63084. var self = this
  63085. self._jar = new CookieJar(store, {looseMode: true})
  63086. }
  63087. RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {
  63088. var self = this
  63089. return self._jar.setCookieSync(cookieOrStr, uri, options || {})
  63090. }
  63091. RequestJar.prototype.getCookieString = function (uri) {
  63092. var self = this
  63093. return self._jar.getCookieStringSync(uri)
  63094. }
  63095. RequestJar.prototype.getCookies = function (uri) {
  63096. var self = this
  63097. return self._jar.getCookiesSync(uri)
  63098. }
  63099. exports.jar = function (store) {
  63100. return new RequestJar(store)
  63101. }
  63102. /***/ }),
  63103. /* 383 */
  63104. /***/ (function(module, exports, __webpack_require__) {
  63105. "use strict";
  63106. /*!
  63107. * Copyright (c) 2015, Salesforce.com, Inc.
  63108. * All rights reserved.
  63109. *
  63110. * Redistribution and use in source and binary forms, with or without
  63111. * modification, are permitted provided that the following conditions are met:
  63112. *
  63113. * 1. Redistributions of source code must retain the above copyright notice,
  63114. * this list of conditions and the following disclaimer.
  63115. *
  63116. * 2. Redistributions in binary form must reproduce the above copyright notice,
  63117. * this list of conditions and the following disclaimer in the documentation
  63118. * and/or other materials provided with the distribution.
  63119. *
  63120. * 3. Neither the name of Salesforce.com nor the names of its contributors may
  63121. * be used to endorse or promote products derived from this software without
  63122. * specific prior written permission.
  63123. *
  63124. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  63125. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  63126. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  63127. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  63128. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  63129. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  63130. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  63131. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  63132. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  63133. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  63134. * POSSIBILITY OF SUCH DAMAGE.
  63135. */
  63136. /*
  63137. * "A request-path path-matches a given cookie-path if at least one of the
  63138. * following conditions holds:"
  63139. */
  63140. function pathMatch (reqPath, cookiePath) {
  63141. // "o The cookie-path and the request-path are identical."
  63142. if (cookiePath === reqPath) {
  63143. return true;
  63144. }
  63145. var idx = reqPath.indexOf(cookiePath);
  63146. if (idx === 0) {
  63147. // "o The cookie-path is a prefix of the request-path, and the last
  63148. // character of the cookie-path is %x2F ("/")."
  63149. if (cookiePath.substr(-1) === "/") {
  63150. return true;
  63151. }
  63152. // " o The cookie-path is a prefix of the request-path, and the first
  63153. // character of the request-path that is not included in the cookie- path
  63154. // is a %x2F ("/") character."
  63155. if (reqPath.substr(cookiePath.length, 1) === "/") {
  63156. return true;
  63157. }
  63158. }
  63159. return false;
  63160. }
  63161. exports.pathMatch = pathMatch;
  63162. /***/ }),
  63163. /* 384 */
  63164. /***/ (function(module, exports, __webpack_require__) {
  63165. "use strict";
  63166. /*!
  63167. * Copyright (c) 2015, Salesforce.com, Inc.
  63168. * All rights reserved.
  63169. *
  63170. * Redistribution and use in source and binary forms, with or without
  63171. * modification, are permitted provided that the following conditions are met:
  63172. *
  63173. * 1. Redistributions of source code must retain the above copyright notice,
  63174. * this list of conditions and the following disclaimer.
  63175. *
  63176. * 2. Redistributions in binary form must reproduce the above copyright notice,
  63177. * this list of conditions and the following disclaimer in the documentation
  63178. * and/or other materials provided with the distribution.
  63179. *
  63180. * 3. Neither the name of Salesforce.com nor the names of its contributors may
  63181. * be used to endorse or promote products derived from this software without
  63182. * specific prior written permission.
  63183. *
  63184. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  63185. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  63186. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  63187. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  63188. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  63189. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  63190. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  63191. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  63192. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  63193. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  63194. * POSSIBILITY OF SUCH DAMAGE.
  63195. */
  63196. var pubsuffix = __webpack_require__(385);
  63197. // Gives the permutation of all possible domainMatch()es of a given domain. The
  63198. // array is in shortest-to-longest order. Handy for indexing.
  63199. function permuteDomain (domain) {
  63200. var pubSuf = pubsuffix.getPublicSuffix(domain);
  63201. if (!pubSuf) {
  63202. return null;
  63203. }
  63204. if (pubSuf == domain) {
  63205. return [domain];
  63206. }
  63207. var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com"
  63208. var parts = prefix.split('.').reverse();
  63209. var cur = pubSuf;
  63210. var permutations = [cur];
  63211. while (parts.length) {
  63212. cur = parts.shift() + '.' + cur;
  63213. permutations.push(cur);
  63214. }
  63215. return permutations;
  63216. }
  63217. exports.permuteDomain = permuteDomain;
  63218. /***/ }),
  63219. /* 385 */
  63220. /***/ (function(module, exports, __webpack_require__) {
  63221. "use strict";
  63222. /****************************************************
  63223. * AUTOMATICALLY GENERATED by generate-pubsuffix.js *
  63224. * DO NOT EDIT! *
  63225. ****************************************************/
  63226. var punycode = __webpack_require__(246);
  63227. module.exports.getPublicSuffix = function getPublicSuffix(domain) {
  63228. /*!
  63229. * Copyright (c) 2015, Salesforce.com, Inc.
  63230. * All rights reserved.
  63231. *
  63232. * Redistribution and use in source and binary forms, with or without
  63233. * modification, are permitted provided that the following conditions are met:
  63234. *
  63235. * 1. Redistributions of source code must retain the above copyright notice,
  63236. * this list of conditions and the following disclaimer.
  63237. *
  63238. * 2. Redistributions in binary form must reproduce the above copyright notice,
  63239. * this list of conditions and the following disclaimer in the documentation
  63240. * and/or other materials provided with the distribution.
  63241. *
  63242. * 3. Neither the name of Salesforce.com nor the names of its contributors may
  63243. * be used to endorse or promote products derived from this software without
  63244. * specific prior written permission.
  63245. *
  63246. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  63247. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  63248. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  63249. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  63250. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  63251. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  63252. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  63253. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  63254. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  63255. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  63256. * POSSIBILITY OF SUCH DAMAGE.
  63257. */
  63258. if (!domain) {
  63259. return null;
  63260. }
  63261. if (domain.match(/^\./)) {
  63262. return null;
  63263. }
  63264. var asciiDomain = punycode.toASCII(domain);
  63265. var converted = false;
  63266. if (asciiDomain !== domain) {
  63267. domain = asciiDomain;
  63268. converted = true;
  63269. }
  63270. if (index[domain]) {
  63271. return null;
  63272. }
  63273. domain = domain.toLowerCase();
  63274. var parts = domain.split('.').reverse();
  63275. var suffix = '';
  63276. var suffixLen = 0;
  63277. for (var i=0; i<parts.length; i++) {
  63278. var part = parts[i];
  63279. var starstr = '*'+suffix;
  63280. var partstr = part+suffix;
  63281. if (index[starstr]) { // star rule matches
  63282. suffixLen = i+1;
  63283. if (index[partstr] === false) { // exception rule matches (NB: false, not undefined)
  63284. suffixLen--;
  63285. }
  63286. } else if (index[partstr]) { // exact match, not exception
  63287. suffixLen = i+1;
  63288. }
  63289. suffix = '.'+partstr;
  63290. }
  63291. if (index['*'+suffix]) { // *.domain exists (e.g. *.kyoto.jp for domain='kyoto.jp');
  63292. return null;
  63293. }
  63294. suffixLen = suffixLen || 1;
  63295. if (parts.length > suffixLen) {
  63296. var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.');
  63297. return converted ? punycode.toUnicode(publicSuffix) : publicSuffix;
  63298. }
  63299. return null;
  63300. };
  63301. // The following generated structure is used under the MPL version 2.0
  63302. // See public-suffix.txt for more information
  63303. var index = module.exports.index = Object.freeze(
  63304. {"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"musica.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"com.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"net.ba":true,"org.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"web.bo":true,"academia.bo":true,"agro.bo":true,"arte.bo":true,"blog.bo":true,"bolivia.bo":true,"ciencia.bo":true,"cooperativa.bo":true,"democracia.bo":true,"deporte.bo":true,"ecologia.bo":true,"economia.bo":true,"empresa.bo":true,"indigena.bo":true,"industria.bo":true,"info.bo":true,"medicina.bo":true,"movimiento.bo":true,"musica.bo":true,"natural.bo":true,"nombre.bo":true,"noticias.bo":true,"patria.bo":true,"politica.bo":true,"profesional.bo":true,"plurinacional.bo":true,"pueblo.bo":true,"revista.bo":true,"salud.bo":true,"tecnologia.bo":true,"tksat.bo":true,"transporte.bo":true,"wiki.bo":true,"br":true,"9guacu.br":true,"abc.br":true,"adm.br":true,"adv.br":true,"agr.br":true,"aju.br":true,"am.br":true,"anani.br":true,"aparecida.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"belem.br":true,"bhz.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"boavista.br":true,"bsb.br":true,"campinagrande.br":true,"campinas.br":true,"caxias.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"contagem.br":true,"coop.br":true,"cri.br":true,"cuiaba.br":true,"curitiba.br":true,"def.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"feira.br":true,"flog.br":true,"floripa.br":true,"fm.br":true,"fnd.br":true,"fortal.br":true,"fot.br":true,"foz.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"goiania.br":true,"gov.br":true,"ac.gov.br":true,"al.gov.br":true,"am.gov.br":true,"ap.gov.br":true,"ba.gov.br":true,"ce.gov.br":true,"df.gov.br":true,"es.gov.br":true,"go.gov.br":true,"ma.gov.br":true,"mg.gov.br":true,"ms.gov.br":true,"mt.gov.br":true,"pa.gov.br":true,"pb.gov.br":true,"pe.gov.br":true,"pi.gov.br":true,"pr.gov.br":true,"rj.gov.br":true,"rn.gov.br":true,"ro.gov.br":true,"rr.gov.br":true,"rs.gov.br":true,"sc.gov.br":true,"se.gov.br":true,"sp.gov.br":true,"to.gov.br":true,"gru.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jab.br":true,"jampa.br":true,"jdf.br":true,"joinville.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"londrina.br":true,"macapa.br":true,"maceio.br":true,"manaus.br":true,"maringa.br":true,"mat.br":true,"med.br":true,"mil.br":true,"morena.br":true,"mp.br":true,"mus.br":true,"natal.br":true,"net.br":true,"niteroi.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"osasco.br":true,"palmas.br":true,"poa.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"pvh.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"recife.br":true,"ribeirao.br":true,"rio.br":true,"riobranco.br":true,"riopreto.br":true,"salvador.br":true,"sampa.br":true,"santamaria.br":true,"santoandre.br":true,"saobernardo.br":true,"saogonca.br":true,"sjc.br":true,"slg.br":true,"slz.br":true,"sorocaba.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"the.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"udi.br":true,"vet.br":true,"vix.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"cy":true,"ac.cy":true,"biz.cy":true,"com.cy":true,"ekloges.cy":true,"gov.cy":true,"ltd.cy":true,"name.cy":true,"net.cy":true,"org.cy":true,"parliament.cy":true,"press.cy":true,"pro.cy":true,"tm.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"net.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"co.gl":true,"com.gl":true,"edu.gl":true,"net.gl":true,"org.gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"edu.gy":true,"gov.gy":true,"net.gy":true,"org.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"il":true,"ac.il":true,"co.il":true,"gov.il":true,"idf.il":true,"k12.il":true,"muni.il":true,"net.il":true,"org.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"catanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":true,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pescara.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"trani-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehime.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn--efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takahama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gonohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":true,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"shonai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kitakata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiroshima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkaido.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokkaido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.ibaraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagawa.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagawa.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.jp":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.kumamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mie.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":true,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasaki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.niigata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":true,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"higashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shimane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shizuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"komatsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koganei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"yazu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":true,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikawamisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"ke":true,"ac.ke":true,"co.ke":true,"go.ke":true,"info.ke":true,"me.ke":true,"mobi.ke":true,"ne.ke":true,"or.ke":true,"sc.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"ac.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"co.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"mz":true,"ac.mz":true,"adv.mz":true,"co.mz":true,"edu.mz":true,"gov.mz":true,"mil.mz":true,"net.mz":true,"org.mz":true,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"nom.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"gov.ng":true,"i.ng":true,"mil.ng":true,"mobi.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"sch.ng":true,"ni":true,"ac.ni":true,"biz.ni":true,"co.ni":true,"com.ni":true,"edu.ni":true,"gob.ni":true,"in.ni":true,"info.ni":true,"int.ni":true,"mil.ni":true,"net.ni":true,"nom.ni":true,"org.ni":true,"web.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"nz":true,"ac.nz":true,"co.nz":true,"cri.nz":true,"geek.nz":true,"gen.nz":true,"govt.nz":true,"health.nz":true,"iwi.nz":true,"kiwi.nz":true,"maori.nz":true,"mil.nz":true,"xn--mori-qsa.nz":true,"net.nz":true,"org.nz":true,"parliament.nz":true,"school.nz":true,"om":true,"co.om":true,"com.om":true,"edu.om":true,"gov.om":true,"med.om":true,"museum.om":true,"net.om":true,"org.om":true,"pro.om":true,"onion":true,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"com.pl":true,"net.pl":true,"org.pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"info.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"gov.pl":true,"ap.gov.pl":true,"ic.gov.pl":true,"is.gov.pl":true,"us.gov.pl":true,"kmpsp.gov.pl":true,"kppsp.gov.pl":true,"kwpsp.gov.pl":true,"psp.gov.pl":true,"wskr.gov.pl":true,"kwp.gov.pl":true,"mw.gov.pl":true,"ug.gov.pl":true,"um.gov.pl":true,"umig.gov.pl":true,"ugim.gov.pl":true,"upow.gov.pl":true,"uw.gov.pl":true,"starostwo.gov.pl":true,"pa.gov.pl":true,"po.gov.pl":true,"psse.gov.pl":true,"pup.gov.pl":true,"rzgw.gov.pl":true,"sa.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"wsa.gov.pl":true,"sko.gov.pl":true,"uzs.gov.pl":true,"wiih.gov.pl":true,"winb.gov.pl":true,"pinb.gov.pl":true,"wios.gov.pl":true,"witd.gov.pl":true,"wzmiuw.gov.pl":true,"piw.gov.pl":true,"wiw.gov.pl":true,"griw.gov.pl":true,"wif.gov.pl":true,"oum.gov.pl":true,"sdn.gov.pl":true,"zp.gov.pl":true,"uppo.gov.pl":true,"mup.gov.pl":true,"wuoz.gov.pl":true,"konsulat.gov.pl":true,"oirm.gov.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"waw.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"post":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aaa.pro":true,"aca.pro":true,"acct.pro":true,"avocat.pro":true,"bar.pro":true,"cpa.pro":true,"eng.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"recht.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"py":true,"com.py":true,"coop.py":true,"edu.py":true,"gov.py":true,"mil.py":true,"net.py":true,"org.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"asso.re":true,"com.re":true,"nom.re":true,"ro":true,"arts.ro":true,"com.ro":true,"firm.ro":true,"info.ro":true,"nom.ro":true,"nt.ro":true,"org.ro":true,"rec.ro":true,"store.ro":true,"tm.ro":true,"www.ro":true,"rs":true,"ac.rs":true,"co.rs":true,"edu.rs":true,"gov.rs":true,"in.rs":true,"org.rs":true,"ru":true,"ac.ru":true,"edu.ru":true,"gov.ru":true,"int.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"tv.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"com.sh":true,"net.sh":true,"gov.sh":true,"org.sh":true,"mil.sh":true,"si":true,"sj":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"sv":true,"com.sv":true,"edu.sv":true,"gob.sv":true,"org.sv":true,"red.sv":true,"sx":true,"gov.sx":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"com.tm":true,"co.tm":true,"org.tm":true,"net.tm":true,"nom.tm":true,"gov.tm":true,"mil.tm":true,"edu.tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"tr":true,"com.tr":true,"info.tr":true,"biz.tr":true,"net.tr":true,"org.tr":true,"web.tr":true,"gen.tr":true,"tv.tr":true,"av.tr":true,"dr.tr":true,"bbs.tr":true,"name.tr":true,"tel.tr":true,"gov.tr":true,"bel.tr":true,"pol.tr":true,"mil.tr":true,"k12.tr":true,"edu.tr":true,"kep.tr":true,"nc.tr":true,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"tz":true,"ac.tz":true,"co.tz":true,"go.tz":true,"hotel.tz":true,"info.tz":true,"me.tz":true,"mil.tz":true,"mobi.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"tv.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"cherkasy.ua":true,"chernigov.ua":true,"chernihiv.ua":true,"chernivtsi.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"cr.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"dnipropetrovsk.ua":true,"dominic.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkiv.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"khmelnytskyi.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"krym.ua":true,"ks.ua":true,"kv.ua":true,"kyiv.ua":true,"lg.ua":true,"lt.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lv.ua":true,"lviv.ua":true,"mk.ua":true,"mykolaiv.ua":true,"nikolaev.ua":true,"od.ua":true,"odesa.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rivne.ua":true,"rovno.ua":true,"rv.ua":true,"sb.ua":true,"sebastopol.ua":true,"sevastopol.ua":true,"sm.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uz.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vinnytsia.ua":true,"vn.ua":true,"volyn.ua":true,"yalta.ua":true,"zaporizhzhe.ua":true,"zaporizhzhia.ua":true,"zhitomir.ua":true,"zhytomyr.ua":true,"zp.ua":true,"zt.ua":true,"ug":true,"co.ug":true,"or.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"com.ug":true,"org.ug":true,"uk":true,"ac.uk":true,"co.uk":true,"gov.uk":true,"ltd.uk":true,"me.uk":true,"net.uk":true,"nhs.uk":true,"org.uk":true,"plc.uk":true,"police.uk":true,"*.sch.uk":true,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"ann-arbor.mi.us":true,"cog.mi.us":true,"dst.mi.us":true,"eaton.mi.us":true,"gen.mi.us":true,"mus.mi.us":true,"tec.mi.us":true,"washtenaw.mi.us":true,"uy":true,"com.uy":true,"edu.uy":true,"gub.uy":true,"mil.uy":true,"net.uy":true,"org.uy":true,"uz":true,"co.uz":true,"com.uz":true,"net.uz":true,"org.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"ve":true,"arts.ve":true,"co.ve":true,"com.ve":true,"e12.ve":true,"edu.ve":true,"firm.ve":true,"gob.ve":true,"gov.ve":true,"info.ve":true,"int.ve":true,"mil.ve":true,"net.ve":true,"org.ve":true,"rec.ve":true,"store.ve":true,"tec.ve":true,"web.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"com.vu":true,"edu.vu":true,"net.vu":true,"org.vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--y9a3aq":true,"xn--54b7fta0cc":true,"xn--90ae":true,"xn--90ais":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--e1a4c":true,"xn--node":true,"xn--qxam":true,"xn--j6w193g":true,"xn--2scrj9c":true,"xn--3hcrj9c":true,"xn--45br5cyl":true,"xn--h2breg3eve":true,"xn--h2brj9c8c":true,"xn--mgbgu82a":true,"xn--rvc1e0am3e":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbtx2b":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--80ao21a":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--d1alf":true,"xn--l1acc":true,"xn--mix891f":true,"xn--mix082f":true,"xn--mgbx4cd0ab":true,"xn--mgb9awbf":true,"xn--mgbai9azgqp6j":true,"xn--mgbai9a5eva00b":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--o1ac.xn--90a3ac":true,"xn--c1avg.xn--90a3ac":true,"xn--90azh.xn--90a3ac":true,"xn--d1at.xn--90a3ac":true,"xn--o1ach.xn--90a3ac":true,"xn--80au.xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--mgbpl2fh":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--o3cw4h":true,"xn--12c1fe0br.xn--o3cw4h":true,"xn--12co0c3b4eva.xn--o3cw4h":true,"xn--h3cuzk1di.xn--o3cw4h":true,"xn--o3cyx2a.xn--o3cw4h":true,"xn--m3ch0j3a.xn--o3cw4h":true,"xn--12cfi8ixb8l.xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"ac.za":true,"agric.za":true,"alt.za":true,"co.za":true,"edu.za":true,"gov.za":true,"grondar.za":true,"law.za":true,"mil.za":true,"net.za":true,"ngo.za":true,"nis.za":true,"nom.za":true,"org.za":true,"school.za":true,"tm.za":true,"web.za":true,"zm":true,"ac.zm":true,"biz.zm":true,"co.zm":true,"com.zm":true,"edu.zm":true,"gov.zm":true,"info.zm":true,"mil.zm":true,"net.zm":true,"org.zm":true,"sch.zm":true,"zw":true,"ac.zw":true,"co.zw":true,"gov.zw":true,"mil.zw":true,"org.zw":true,"aaa":true,"aarp":true,"abarth":true,"abb":true,"abbott":true,"abbvie":true,"abc":true,"able":true,"abogado":true,"abudhabi":true,"academy":true,"accenture":true,"accountant":true,"accountants":true,"aco":true,"active":true,"actor":true,"adac":true,"ads":true,"adult":true,"aeg":true,"aetna":true,"afamilycompany":true,"afl":true,"africa":true,"agakhan":true,"agency":true,"aig":true,"aigo":true,"airbus":true,"airforce":true,"airtel":true,"akdn":true,"alfaromeo":true,"alibaba":true,"alipay":true,"allfinanz":true,"allstate":true,"ally":true,"alsace":true,"alstom":true,"americanexpress":true,"americanfamily":true,"amex":true,"amfam":true,"amica":true,"amsterdam":true,"analytics":true,"android":true,"anquan":true,"anz":true,"aol":true,"apartments":true,"app":true,"apple":true,"aquarelle":true,"arab":true,"aramco":true,"archi":true,"army":true,"art":true,"arte":true,"asda":true,"associates":true,"athleta":true,"attorney":true,"auction":true,"audi":true,"audible":true,"audio":true,"auspost":true,"author":true,"auto":true,"autos":true,"avianca":true,"aws":true,"axa":true,"azure":true,"baby":true,"baidu":true,"banamex":true,"bananarepublic":true,"band":true,"bank":true,"bar":true,"barcelona":true,"barclaycard":true,"barclays":true,"barefoot":true,"bargains":true,"baseball":true,"basketball":true,"bauhaus":true,"bayern":true,"bbc":true,"bbt":true,"bbva":true,"bcg":true,"bcn":true,"beats":true,"beauty":true,"beer":true,"bentley":true,"berlin":true,"best":true,"bestbuy":true,"bet":true,"bharti":true,"bible":true,"bid":true,"bike":true,"bing":true,"bingo":true,"bio":true,"black":true,"blackfriday":true,"blanco":true,"blockbuster":true,"blog":true,"bloomberg":true,"blue":true,"bms":true,"bmw":true,"bnl":true,"bnpparibas":true,"boats":true,"boehringer":true,"bofa":true,"bom":true,"bond":true,"boo":true,"book":true,"booking":true,"boots":true,"bosch":true,"bostik":true,"boston":true,"bot":true,"boutique":true,"box":true,"bradesco":true,"bridgestone":true,"broadway":true,"broker":true,"brother":true,"brussels":true,"budapest":true,"bugatti":true,"build":true,"builders":true,"business":true,"buy":true,"buzz":true,"bzh":true,"cab":true,"cafe":true,"cal":true,"call":true,"calvinklein":true,"cam":true,"camera":true,"camp":true,"cancerresearch":true,"canon":true,"capetown":true,"capital":true,"capitalone":true,"car":true,"caravan":true,"cards":true,"care":true,"career":true,"careers":true,"cars":true,"cartier":true,"casa":true,"case":true,"caseih":true,"cash":true,"casino":true,"catering":true,"catholic":true,"cba":true,"cbn":true,"cbre":true,"cbs":true,"ceb":true,"center":true,"ceo":true,"cern":true,"cfa":true,"cfd":true,"chanel":true,"channel":true,"chase":true,"chat":true,"cheap":true,"chintai":true,"christmas":true,"chrome":true,"chrysler":true,"church":true,"cipriani":true,"circle":true,"cisco":true,"citadel":true,"citi":true,"citic":true,"city":true,"cityeats":true,"claims":true,"cleaning":true,"click":true,"clinic":true,"clinique":true,"clothing":true,"cloud":true,"club":true,"clubmed":true,"coach":true,"codes":true,"coffee":true,"college":true,"cologne":true,"comcast":true,"commbank":true,"community":true,"company":true,"compare":true,"computer":true,"comsec":true,"condos":true,"construction":true,"consulting":true,"contact":true,"contractors":true,"cooking":true,"cookingchannel":true,"cool":true,"corsica":true,"country":true,"coupon":true,"coupons":true,"courses":true,"credit":true,"creditcard":true,"creditunion":true,"cricket":true,"crown":true,"crs":true,"cruise":true,"cruises":true,"csc":true,"cuisinella":true,"cymru":true,"cyou":true,"dabur":true,"dad":true,"dance":true,"data":true,"date":true,"dating":true,"datsun":true,"day":true,"dclk":true,"dds":true,"deal":true,"dealer":true,"deals":true,"degree":true,"delivery":true,"dell":true,"deloitte":true,"delta":true,"democrat":true,"dental":true,"dentist":true,"desi":true,"design":true,"dev":true,"dhl":true,"diamonds":true,"diet":true,"digital":true,"direct":true,"directory":true,"discount":true,"discover":true,"dish":true,"diy":true,"dnp":true,"docs":true,"doctor":true,"dodge":true,"dog":true,"doha":true,"domains":true,"dot":true,"download":true,"drive":true,"dtv":true,"dubai":true,"duck":true,"dunlop":true,"duns":true,"dupont":true,"durban":true,"dvag":true,"dvr":true,"earth":true,"eat":true,"eco":true,"edeka":true,"education":true,"email":true,"emerck":true,"energy":true,"engineer":true,"engineering":true,"enterprises":true,"epost":true,"epson":true,"equipment":true,"ericsson":true,"erni":true,"esq":true,"estate":true,"esurance":true,"etisalat":true,"eurovision":true,"eus":true,"events":true,"everbank":true,"exchange":true,"expert":true,"exposed":true,"express":true,"extraspace":true,"fage":true,"fail":true,"fairwinds":true,"faith":true,"family":true,"fan":true,"fans":true,"farm":true,"farmers":true,"fashion":true,"fast":true,"fedex":true,"feedback":true,"ferrari":true,"ferrero":true,"fiat":true,"fidelity":true,"fido":true,"film":true,"final":true,"finance":true,"financial":true,"fire":true,"firestone":true,"firmdale":true,"fish":true,"fishing":true,"fit":true,"fitness":true,"flickr":true,"flights":true,"flir":true,"florist":true,"flowers":true,"fly":true,"foo":true,"food":true,"foodnetwork":true,"football":true,"ford":true,"forex":true,"forsale":true,"forum":true,"foundation":true,"fox":true,"free":true,"fresenius":true,"frl":true,"frogans":true,"frontdoor":true,"frontier":true,"ftr":true,"fujitsu":true,"fujixerox":true,"fun":true,"fund":true,"furniture":true,"futbol":true,"fyi":true,"gal":true,"gallery":true,"gallo":true,"gallup":true,"game":true,"games":true,"gap":true,"garden":true,"gbiz":true,"gdn":true,"gea":true,"gent":true,"genting":true,"george":true,"ggee":true,"gift":true,"gifts":true,"gives":true,"giving":true,"glade":true,"glass":true,"gle":true,"global":true,"globo":true,"gmail":true,"gmbh":true,"gmo":true,"gmx":true,"godaddy":true,"gold":true,"goldpoint":true,"golf":true,"goo":true,"goodhands":true,"goodyear":true,"goog":true,"google":true,"gop":true,"got":true,"grainger":true,"graphics":true,"gratis":true,"green":true,"gripe":true,"grocery":true,"group":true,"guardian":true,"gucci":true,"guge":true,"guide":true,"guitars":true,"guru":true,"hair":true,"hamburg":true,"hangout":true,"haus":true,"hbo":true,"hdfc":true,"hdfcbank":true,"health":true,"healthcare":true,"help":true,"helsinki":true,"here":true,"hermes":true,"hgtv":true,"hiphop":true,"hisamitsu":true,"hitachi":true,"hiv":true,"hkt":true,"hockey":true,"holdings":true,"holiday":true,"homedepot":true,"homegoods":true,"homes":true,"homesense":true,"honda":true,"honeywell":true,"horse":true,"hospital":true,"host":true,"hosting":true,"hot":true,"hoteles":true,"hotels":true,"hotmail":true,"house":true,"how":true,"hsbc":true,"hughes":true,"hyatt":true,"hyundai":true,"ibm":true,"icbc":true,"ice":true,"icu":true,"ieee":true,"ifm":true,"ikano":true,"imamat":true,"imdb":true,"immo":true,"immobilien":true,"industries":true,"infiniti":true,"ing":true,"ink":true,"institute":true,"insurance":true,"insure":true,"intel":true,"international":true,"intuit":true,"investments":true,"ipiranga":true,"irish":true,"iselect":true,"ismaili":true,"ist":true,"istanbul":true,"itau":true,"itv":true,"iveco":true,"iwc":true,"jaguar":true,"java":true,"jcb":true,"jcp":true,"jeep":true,"jetzt":true,"jewelry":true,"jio":true,"jlc":true,"jll":true,"jmp":true,"jnj":true,"joburg":true,"jot":true,"joy":true,"jpmorgan":true,"jprs":true,"juegos":true,"juniper":true,"kaufen":true,"kddi":true,"kerryhotels":true,"kerrylogistics":true,"kerryproperties":true,"kfh":true,"kia":true,"kim":true,"kinder":true,"kindle":true,"kitchen":true,"kiwi":true,"koeln":true,"komatsu":true,"kosher":true,"kpmg":true,"kpn":true,"krd":true,"kred":true,"kuokgroup":true,"kyoto":true,"lacaixa":true,"ladbrokes":true,"lamborghini":true,"lamer":true,"lancaster":true,"lancia":true,"lancome":true,"land":true,"landrover":true,"lanxess":true,"lasalle":true,"lat":true,"latino":true,"latrobe":true,"law":true,"lawyer":true,"lds":true,"lease":true,"leclerc":true,"lefrak":true,"legal":true,"lego":true,"lexus":true,"lgbt":true,"liaison":true,"lidl":true,"life":true,"lifeinsurance":true,"lifestyle":true,"lighting":true,"like":true,"lilly":true,"limited":true,"limo":true,"lincoln":true,"linde":true,"link":true,"lipsy":true,"live":true,"living":true,"lixil":true,"loan":true,"loans":true,"locker":true,"locus":true,"loft":true,"lol":true,"london":true,"lotte":true,"lotto":true,"love":true,"lpl":true,"lplfinancial":true,"ltd":true,"ltda":true,"lundbeck":true,"lupin":true,"luxe":true,"luxury":true,"macys":true,"madrid":true,"maif":true,"maison":true,"makeup":true,"man":true,"management":true,"mango":true,"map":true,"market":true,"marketing":true,"markets":true,"marriott":true,"marshalls":true,"maserati":true,"mattel":true,"mba":true,"mckinsey":true,"med":true,"media":true,"meet":true,"melbourne":true,"meme":true,"memorial":true,"men":true,"menu":true,"meo":true,"merckmsd":true,"metlife":true,"miami":true,"microsoft":true,"mini":true,"mint":true,"mit":true,"mitsubishi":true,"mlb":true,"mls":true,"mma":true,"mobile":true,"mobily":true,"moda":true,"moe":true,"moi":true,"mom":true,"monash":true,"money":true,"monster":true,"mopar":true,"mormon":true,"mortgage":true,"moscow":true,"moto":true,"motorcycles":true,"mov":true,"movie":true,"movistar":true,"msd":true,"mtn":true,"mtpc":true,"mtr":true,"mutual":true,"nab":true,"nadex":true,"nagoya":true,"nationwide":true,"natura":true,"navy":true,"nba":true,"nec":true,"netbank":true,"netflix":true,"network":true,"neustar":true,"new":true,"newholland":true,"news":true,"next":true,"nextdirect":true,"nexus":true,"nfl":true,"ngo":true,"nhk":true,"nico":true,"nike":true,"nikon":true,"ninja":true,"nissan":true,"nissay":true,"nokia":true,"northwesternmutual":true,"norton":true,"now":true,"nowruz":true,"nowtv":true,"nra":true,"nrw":true,"ntt":true,"nyc":true,"obi":true,"observer":true,"off":true,"office":true,"okinawa":true,"olayan":true,"olayangroup":true,"oldnavy":true,"ollo":true,"omega":true,"one":true,"ong":true,"onl":true,"online":true,"onyourside":true,"ooo":true,"open":true,"oracle":true,"orange":true,"organic":true,"origins":true,"osaka":true,"otsuka":true,"ott":true,"ovh":true,"page":true,"panasonic":true,"panerai":true,"paris":true,"pars":true,"partners":true,"parts":true,"party":true,"passagens":true,"pay":true,"pccw":true,"pet":true,"pfizer":true,"pharmacy":true,"phd":true,"philips":true,"phone":true,"photo":true,"photography":true,"photos":true,"physio":true,"piaget":true,"pics":true,"pictet":true,"pictures":true,"pid":true,"pin":true,"ping":true,"pink":true,"pioneer":true,"pizza":true,"place":true,"play":true,"playstation":true,"plumbing":true,"plus":true,"pnc":true,"pohl":true,"poker":true,"politie":true,"porn":true,"pramerica":true,"praxi":true,"press":true,"prime":true,"prod":true,"productions":true,"prof":true,"progressive":true,"promo":true,"properties":true,"property":true,"protection":true,"pru":true,"prudential":true,"pub":true,"pwc":true,"qpon":true,"quebec":true,"quest":true,"qvc":true,"racing":true,"radio":true,"raid":true,"read":true,"realestate":true,"realtor":true,"realty":true,"recipes":true,"red":true,"redstone":true,"redumbrella":true,"rehab":true,"reise":true,"reisen":true,"reit":true,"reliance":true,"ren":true,"rent":true,"rentals":true,"repair":true,"report":true,"republican":true,"rest":true,"restaurant":true,"review":true,"reviews":true,"rexroth":true,"rich":true,"richardli":true,"ricoh":true,"rightathome":true,"ril":true,"rio":true,"rip":true,"rmit":true,"rocher":true,"rocks":true,"rodeo":true,"rogers":true,"room":true,"rsvp":true,"rugby":true,"ruhr":true,"run":true,"rwe":true,"ryukyu":true,"saarland":true,"safe":true,"safety":true,"sakura":true,"sale":true,"salon":true,"samsclub":true,"samsung":true,"sandvik":true,"sandvikcoromant":true,"sanofi":true,"sap":true,"sapo":true,"sarl":true,"sas":true,"save":true,"saxo":true,"sbi":true,"sbs":true,"sca":true,"scb":true,"schaeffler":true,"schmidt":true,"scholarships":true,"school":true,"schule":true,"schwarz":true,"science":true,"scjohnson":true,"scor":true,"scot":true,"search":true,"seat":true,"secure":true,"security":true,"seek":true,"select":true,"sener":true,"services":true,"ses":true,"seven":true,"sew":true,"sex":true,"sexy":true,"sfr":true,"shangrila":true,"sharp":true,"shaw":true,"shell":true,"shia":true,"shiksha":true,"shoes":true,"shop":true,"shopping":true,"shouji":true,"show":true,"showtime":true,"shriram":true,"silk":true,"sina":true,"singles":true,"site":true,"ski":true,"skin":true,"sky":true,"skype":true,"sling":true,"smart":true,"smile":true,"sncf":true,"soccer":true,"social":true,"softbank":true,"software":true,"sohu":true,"solar":true,"solutions":true,"song":true,"sony":true,"soy":true,"space":true,"spiegel":true,"spot":true,"spreadbetting":true,"srl":true,"srt":true,"stada":true,"staples":true,"star":true,"starhub":true,"statebank":true,"statefarm":true,"statoil":true,"stc":true,"stcgroup":true,"stockholm":true,"storage":true,"store":true,"stream":true,"studio":true,"study":true,"style":true,"sucks":true,"supplies":true,"supply":true,"support":true,"surf":true,"surgery":true,"suzuki":true,"swatch":true,"swiftcover":true,"swiss":true,"sydney":true,"symantec":true,"systems":true,"tab":true,"taipei":true,"talk":true,"taobao":true,"target":true,"tatamotors":true,"tatar":true,"tattoo":true,"tax":true,"taxi":true,"tci":true,"tdk":true,"team":true,"tech":true,"technology":true,"telecity":true,"telefonica":true,"temasek":true,"tennis":true,"teva":true,"thd":true,"theater":true,"theatre":true,"tiaa":true,"tickets":true,"tienda":true,"tiffany":true,"tips":true,"tires":true,"tirol":true,"tjmaxx":true,"tjx":true,"tkmaxx":true,"tmall":true,"today":true,"tokyo":true,"tools":true,"top":true,"toray":true,"toshiba":true,"total":true,"tours":true,"town":true,"toyota":true,"toys":true,"trade":true,"trading":true,"training":true,"travelchannel":true,"travelers":true,"travelersinsurance":true,"trust":true,"trv":true,"tube":true,"tui":true,"tunes":true,"tushu":true,"tvs":true,"ubank":true,"ubs":true,"uconnect":true,"unicom":true,"university":true,"uno":true,"uol":true,"ups":true,"vacations":true,"vana":true,"vanguard":true,"vegas":true,"ventures":true,"verisign":true,"versicherung":true,"vet":true,"viajes":true,"video":true,"vig":true,"viking":true,"villas":true,"vin":true,"vip":true,"virgin":true,"visa":true,"vision":true,"vista":true,"vistaprint":true,"viva":true,"vivo":true,"vlaanderen":true,"vodka":true,"volkswagen":true,"volvo":true,"vote":true,"voting":true,"voto":true,"voyage":true,"vuelos":true,"wales":true,"walmart":true,"walter":true,"wang":true,"wanggou":true,"warman":true,"watch":true,"watches":true,"weather":true,"weatherchannel":true,"webcam":true,"weber":true,"website":true,"wed":true,"wedding":true,"weibo":true,"weir":true,"whoswho":true,"wien":true,"wiki":true,"williamhill":true,"win":true,"windows":true,"wine":true,"winners":true,"wme":true,"wolterskluwer":true,"woodside":true,"work":true,"works":true,"world":true,"wow":true,"wtc":true,"wtf":true,"xbox":true,"xerox":true,"xfinity":true,"xihuan":true,"xin":true,"xn--11b4c3d":true,"xn--1ck2e1b":true,"xn--1qqw23a":true,"xn--30rr7y":true,"xn--3bst00m":true,"xn--3ds443g":true,"xn--3oq18vl8pn36a":true,"xn--3pxu8k":true,"xn--42c2d9a":true,"xn--45q11c":true,"xn--4gbrim":true,"xn--55qw42g":true,"xn--55qx5d":true,"xn--5su34j936bgsg":true,"xn--5tzm5g":true,"xn--6frz82g":true,"xn--6qq986b3xl":true,"xn--80adxhks":true,"xn--80aqecdr1a":true,"xn--80asehdb":true,"xn--80aswg":true,"xn--8y0a063a":true,"xn--9dbq2a":true,"xn--9et52u":true,"xn--9krt00a":true,"xn--b4w605ferd":true,"xn--bck1b9a5dre4c":true,"xn--c1avg":true,"xn--c2br7g":true,"xn--cck2b3b":true,"xn--cg4bki":true,"xn--czr694b":true,"xn--czrs0t":true,"xn--czru2d":true,"xn--d1acj3b":true,"xn--eckvdtc9d":true,"xn--efvy88h":true,"xn--estv75g":true,"xn--fct429k":true,"xn--fhbei":true,"xn--fiq228c5hs":true,"xn--fiq64b":true,"xn--fjq720a":true,"xn--flw351e":true,"xn--fzys8d69uvgm":true,"xn--g2xx48c":true,"xn--gckr3f0f":true,"xn--gk3at1e":true,"xn--hxt814e":true,"xn--i1b6b1a6a2e":true,"xn--imr513n":true,"xn--io0a7i":true,"xn--j1aef":true,"xn--jlq61u9w7b":true,"xn--jvr189m":true,"xn--kcrx77d1x4a":true,"xn--kpu716f":true,"xn--kput3i":true,"xn--mgba3a3ejt":true,"xn--mgba7c0bbn0a":true,"xn--mgbaakc7dvf":true,"xn--mgbab2bd":true,"xn--mgbb9fbpob":true,"xn--mgbca7dzdo":true,"xn--mgbi4ecexp":true,"xn--mgbt3dhd":true,"xn--mk1bu44c":true,"xn--mxtq1m":true,"xn--ngbc5azd":true,"xn--ngbe9e0a":true,"xn--ngbrx":true,"xn--nqv7f":true,"xn--nqv7fs00ema":true,"xn--nyqy26a":true,"xn--p1acf":true,"xn--pbt977c":true,"xn--pssy2u":true,"xn--q9jyb4c":true,"xn--qcka1pmc":true,"xn--rhqv96g":true,"xn--rovu88b":true,"xn--ses554g":true,"xn--t60b56a":true,"xn--tckwe":true,"xn--tiq49xqyj":true,"xn--unup4y":true,"xn--vermgensberater-ctb":true,"xn--vermgensberatung-pwb":true,"xn--vhquv":true,"xn--vuq861b":true,"xn--w4r85el8fhu5dnra":true,"xn--w4rs40l":true,"xn--xhq521b":true,"xn--zfr164b":true,"xperia":true,"xyz":true,"yachts":true,"yahoo":true,"yamaxun":true,"yandex":true,"yodobashi":true,"yoga":true,"yokohama":true,"you":true,"youtube":true,"yun":true,"zappos":true,"zara":true,"zero":true,"zip":true,"zippo":true,"zone":true,"zuerich":true,"cc.ua":true,"inf.ua":true,"ltd.ua":true,"1password.ca":true,"1password.com":true,"1password.eu":true,"beep.pl":true,"*.compute.estate":true,"*.alces.network":true,"alwaysdata.net":true,"cloudfront.net":true,"*.compute.amazonaws.com":true,"*.compute-1.amazonaws.com":true,"*.compute.amazonaws.com.cn":true,"us-east-1.amazonaws.com":true,"cn-north-1.eb.amazonaws.com.cn":true,"elasticbeanstalk.com":true,"ap-northeast-1.elasticbeanstalk.com":true,"ap-northeast-2.elasticbeanstalk.com":true,"ap-south-1.elasticbeanstalk.com":true,"ap-southeast-1.elasticbeanstalk.com":true,"ap-southeast-2.elasticbeanstalk.com":true,"ca-central-1.elasticbeanstalk.com":true,"eu-central-1.elasticbeanstalk.com":true,"eu-west-1.elasticbeanstalk.com":true,"eu-west-2.elasticbeanstalk.com":true,"eu-west-3.elasticbeanstalk.com":true,"sa-east-1.elasticbeanstalk.com":true,"us-east-1.elasticbeanstalk.com":true,"us-east-2.elasticbeanstalk.com":true,"us-gov-west-1.elasticbeanstalk.com":true,"us-west-1.elasticbeanstalk.com":true,"us-west-2.elasticbeanstalk.com":true,"*.elb.amazonaws.com":true,"*.elb.amazonaws.com.cn":true,"s3.amazonaws.com":true,"s3-ap-northeast-1.amazonaws.com":true,"s3-ap-northeast-2.amazonaws.com":true,"s3-ap-south-1.amazonaws.com":true,"s3-ap-southeast-1.amazonaws.com":true,"s3-ap-southeast-2.amazonaws.com":true,"s3-ca-central-1.amazonaws.com":true,"s3-eu-central-1.amazonaws.com":true,"s3-eu-west-1.amazonaws.com":true,"s3-eu-west-2.amazonaws.com":true,"s3-eu-west-3.amazonaws.com":true,"s3-external-1.amazonaws.com":true,"s3-fips-us-gov-west-1.amazonaws.com":true,"s3-sa-east-1.amazonaws.com":true,"s3-us-gov-west-1.amazonaws.com":true,"s3-us-east-2.amazonaws.com":true,"s3-us-west-1.amazonaws.com":true,"s3-us-west-2.amazonaws.com":true,"s3.ap-northeast-2.amazonaws.com":true,"s3.ap-south-1.amazonaws.com":true,"s3.cn-north-1.amazonaws.com.cn":true,"s3.ca-central-1.amazonaws.com":true,"s3.eu-central-1.amazonaws.com":true,"s3.eu-west-2.amazonaws.com":true,"s3.eu-west-3.amazonaws.com":true,"s3.us-east-2.amazonaws.com":true,"s3.dualstack.ap-northeast-1.amazonaws.com":true,"s3.dualstack.ap-northeast-2.amazonaws.com":true,"s3.dualstack.ap-south-1.amazonaws.com":true,"s3.dualstack.ap-southeast-1.amazonaws.com":true,"s3.dualstack.ap-southeast-2.amazonaws.com":true,"s3.dualstack.ca-central-1.amazonaws.com":true,"s3.dualstack.eu-central-1.amazonaws.com":true,"s3.dualstack.eu-west-1.amazonaws.com":true,"s3.dualstack.eu-west-2.amazonaws.com":true,"s3.dualstack.eu-west-3.amazonaws.com":true,"s3.dualstack.sa-east-1.amazonaws.com":true,"s3.dualstack.us-east-1.amazonaws.com":true,"s3.dualstack.us-east-2.amazonaws.com":true,"s3-website-us-east-1.amazonaws.com":true,"s3-website-us-west-1.amazonaws.com":true,"s3-website-us-west-2.amazonaws.com":true,"s3-website-ap-northeast-1.amazonaws.com":true,"s3-website-ap-southeast-1.amazonaws.com":true,"s3-website-ap-southeast-2.amazonaws.com":true,"s3-website-eu-west-1.amazonaws.com":true,"s3-website-sa-east-1.amazonaws.com":true,"s3-website.ap-northeast-2.amazonaws.com":true,"s3-website.ap-south-1.amazonaws.com":true,"s3-website.ca-central-1.amazonaws.com":true,"s3-website.eu-central-1.amazonaws.com":true,"s3-website.eu-west-2.amazonaws.com":true,"s3-website.eu-west-3.amazonaws.com":true,"s3-website.us-east-2.amazonaws.com":true,"t3l3p0rt.net":true,"tele.amune.org":true,"on-aptible.com":true,"user.party.eus":true,"pimienta.org":true,"poivron.org":true,"potager.org":true,"sweetpepper.org":true,"myasustor.com":true,"myfritz.net":true,"*.awdev.ca":true,"*.advisor.ws":true,"backplaneapp.io":true,"betainabox.com":true,"bnr.la":true,"boomla.net":true,"boxfuse.io":true,"square7.ch":true,"bplaced.com":true,"bplaced.de":true,"square7.de":true,"bplaced.net":true,"square7.net":true,"browsersafetymark.io":true,"mycd.eu":true,"ae.org":true,"ar.com":true,"br.com":true,"cn.com":true,"com.de":true,"com.se":true,"de.com":true,"eu.com":true,"gb.com":true,"gb.net":true,"hu.com":true,"hu.net":true,"jp.net":true,"jpn.com":true,"kr.com":true,"mex.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"se.net":true,"uk.com":true,"uk.net":true,"us.com":true,"uy.com":true,"za.bz":true,"za.com":true,"africa.com":true,"gr.com":true,"in.net":true,"us.org":true,"co.com":true,"c.la":true,"certmgr.org":true,"xenapponazure.com":true,"virtueeldomein.nl":true,"c66.me":true,"cloud66.ws":true,"jdevcloud.com":true,"wpdevcloud.com":true,"cloudaccess.host":true,"freesite.host":true,"cloudaccess.net":true,"cloudcontrolled.com":true,"cloudcontrolapp.com":true,"co.ca":true,"co.cz":true,"c.cdn77.org":true,"cdn77-ssl.net":true,"r.cdn77.net":true,"rsc.cdn77.org":true,"ssl.origin.cdn77-secure.org":true,"cloudns.asia":true,"cloudns.biz":true,"cloudns.club":true,"cloudns.cc":true,"cloudns.eu":true,"cloudns.in":true,"cloudns.info":true,"cloudns.org":true,"cloudns.pro":true,"cloudns.pw":true,"cloudns.us":true,"co.nl":true,"co.no":true,"webhosting.be":true,"hosting-cluster.nl":true,"dyn.cosidns.de":true,"dynamisches-dns.de":true,"dnsupdater.de":true,"internet-dns.de":true,"l-o-g-i-n.de":true,"dynamic-dns.info":true,"feste-ip.net":true,"knx-server.net":true,"static-access.net":true,"realm.cz":true,"*.cryptonomic.net":true,"cupcake.is":true,"cyon.link":true,"cyon.site":true,"daplie.me":true,"localhost.daplie.me":true,"biz.dk":true,"co.dk":true,"firm.dk":true,"reg.dk":true,"store.dk":true,"debian.net":true,"dedyn.io":true,"dnshome.de":true,"drayddns.com":true,"dreamhosters.com":true,"mydrobo.com":true,"drud.io":true,"drud.us":true,"duckdns.org":true,"dy.fi":true,"tunk.org":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true,"ddnss.de":true,"dyn.ddnss.de":true,"dyndns.ddnss.de":true,"dyndns1.de":true,"dyn-ip24.de":true,"home-webserver.de":true,"dyn.home-webserver.de":true,"myhome-server.de":true,"ddnss.org":true,"definima.net":true,"definima.io":true,"ddnsfree.com":true,"ddnsgeek.com":true,"giize.com":true,"gleeze.com":true,"kozow.com":true,"loseyourip.com":true,"ooguy.com":true,"theworkpc.com":true,"casacam.net":true,"dynu.net":true,"accesscam.org":true,"camdvr.org":true,"freeddns.org":true,"mywire.org":true,"webredirect.org":true,"myddns.rocks":true,"blogsite.xyz":true,"dynv6.net":true,"e4.cz":true,"mytuleap.com":true,"enonic.io":true,"customer.enonic.io":true,"eu.org":true,"al.eu.org":true,"asso.eu.org":true,"at.eu.org":true,"au.eu.org":true,"be.eu.org":true,"bg.eu.org":true,"ca.eu.org":true,"cd.eu.org":true,"ch.eu.org":true,"cn.eu.org":true,"cy.eu.org":true,"cz.eu.org":true,"de.eu.org":true,"dk.eu.org":true,"edu.eu.org":true,"ee.eu.org":true,"es.eu.org":true,"fi.eu.org":true,"fr.eu.org":true,"gr.eu.org":true,"hr.eu.org":true,"hu.eu.org":true,"ie.eu.org":true,"il.eu.org":true,"in.eu.org":true,"int.eu.org":true,"is.eu.org":true,"it.eu.org":true,"jp.eu.org":true,"kr.eu.org":true,"lt.eu.org":true,"lu.eu.org":true,"lv.eu.org":true,"mc.eu.org":true,"me.eu.org":true,"mk.eu.org":true,"mt.eu.org":true,"my.eu.org":true,"net.eu.org":true,"ng.eu.org":true,"nl.eu.org":true,"no.eu.org":true,"nz.eu.org":true,"paris.eu.org":true,"pl.eu.org":true,"pt.eu.org":true,"q-a.eu.org":true,"ro.eu.org":true,"ru.eu.org":true,"se.eu.org":true,"si.eu.org":true,"sk.eu.org":true,"tr.eu.org":true,"uk.eu.org":true,"us.eu.org":true,"eu-1.evennode.com":true,"eu-2.evennode.com":true,"eu-3.evennode.com":true,"eu-4.evennode.com":true,"us-1.evennode.com":true,"us-2.evennode.com":true,"us-3.evennode.com":true,"us-4.evennode.com":true,"twmail.cc":true,"twmail.net":true,"twmail.org":true,"mymailer.com.tw":true,"url.tw":true,"apps.fbsbx.com":true,"ru.net":true,"adygeya.ru":true,"bashkiria.ru":true,"bir.ru":true,"cbg.ru":true,"com.ru":true,"dagestan.ru":true,"grozny.ru":true,"kalmykia.ru":true,"kustanai.ru":true,"marine.ru":true,"mordovia.ru":true,"msk.ru":true,"mytis.ru":true,"nalchik.ru":true,"nov.ru":true,"pyatigorsk.ru":true,"spb.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"abkhazia.su":true,"adygeya.su":true,"aktyubinsk.su":true,"arkhangelsk.su":true,"armenia.su":true,"ashgabad.su":true,"azerbaijan.su":true,"balashov.su":true,"bashkiria.su":true,"bryansk.su":true,"bukhara.su":true,"chimkent.su":true,"dagestan.su":true,"east-kazakhstan.su":true,"exnet.su":true,"georgia.su":true,"grozny.su":true,"ivanovo.su":true,"jambyl.su":true,"kalmykia.su":true,"kaluga.su":true,"karacol.su":true,"karaganda.su":true,"karelia.su":true,"khakassia.su":true,"krasnodar.su":true,"kurgan.su":true,"kustanai.su":true,"lenug.su":true,"mangyshlak.su":true,"mordovia.su":true,"msk.su":true,"murmansk.su":true,"nalchik.su":true,"navoi.su":true,"north-kazakhstan.su":true,"nov.su":true,"obninsk.su":true,"penza.su":true,"pokrovsk.su":true,"sochi.su":true,"spb.su":true,"tashkent.su":true,"termez.su":true,"togliatti.su":true,"troitsk.su":true,"tselinograd.su":true,"tula.su":true,"tuva.su":true,"vladikavkaz.su":true,"vladimir.su":true,"vologda.su":true,"channelsdvr.net":true,"fastlylb.net":true,"map.fastlylb.net":true,"freetls.fastly.net":true,"map.fastly.net":true,"a.prod.fastly.net":true,"global.prod.fastly.net":true,"a.ssl.fastly.net":true,"b.ssl.fastly.net":true,"global.ssl.fastly.net":true,"fhapp.xyz":true,"fedorainfracloud.org":true,"fedorapeople.org":true,"cloud.fedoraproject.org":true,"app.os.fedoraproject.org":true,"app.os.stg.fedoraproject.org":true,"filegear.me":true,"firebaseapp.com":true,"flynnhub.com":true,"flynnhosting.net":true,"freebox-os.com":true,"freeboxos.com":true,"fbx-os.fr":true,"fbxos.fr":true,"freebox-os.fr":true,"freeboxos.fr":true,"*.futurecms.at":true,"futurehosting.at":true,"futuremailing.at":true,"*.ex.ortsinfo.at":true,"*.kunden.ortsinfo.at":true,"*.statics.cloud":true,"service.gov.uk":true,"github.io":true,"githubusercontent.com":true,"gitlab.io":true,"homeoffice.gov.uk":true,"ro.im":true,"shop.ro":true,"goip.de":true,"*.0emm.com":true,"appspot.com":true,"blogspot.ae":true,"blogspot.al":true,"blogspot.am":true,"blogspot.ba":true,"blogspot.be":true,"blogspot.bg":true,"blogspot.bj":true,"blogspot.ca":true,"blogspot.cf":true,"blogspot.ch":true,"blogspot.cl":true,"blogspot.co.at":true,"blogspot.co.id":true,"blogspot.co.il":true,"blogspot.co.ke":true,"blogspot.co.nz":true,"blogspot.co.uk":true,"blogspot.co.za":true,"blogspot.com":true,"blogspot.com.ar":true,"blogspot.com.au":true,"blogspot.com.br":true,"blogspot.com.by":true,"blogspot.com.co":true,"blogspot.com.cy":true,"blogspot.com.ee":true,"blogspot.com.eg":true,"blogspot.com.es":true,"blogspot.com.mt":true,"blogspot.com.ng":true,"blogspot.com.tr":true,"blogspot.com.uy":true,"blogspot.cv":true,"blogspot.cz":true,"blogspot.de":true,"blogspot.dk":true,"blogspot.fi":true,"blogspot.fr":true,"blogspot.gr":true,"blogspot.hk":true,"blogspot.hr":true,"blogspot.hu":true,"blogspot.ie":true,"blogspot.in":true,"blogspot.is":true,"blogspot.it":true,"blogspot.jp":true,"blogspot.kr":true,"blogspot.li":true,"blogspot.lt":true,"blogspot.lu":true,"blogspot.md":true,"blogspot.mk":true,"blogspot.mr":true,"blogspot.mx":true,"blogspot.my":true,"blogspot.nl":true,"blogspot.no":true,"blogspot.pe":true,"blogspot.pt":true,"blogspot.qa":true,"blogspot.re":true,"blogspot.ro":true,"blogspot.rs":true,"blogspot.ru":true,"blogspot.se":true,"blogspot.sg":true,"blogspot.si":true,"blogspot.sk":true,"blogspot.sn":true,"blogspot.td":true,"blogspot.tw":true,"blogspot.ug":true,"blogspot.vn":true,"cloudfunctions.net":true,"cloud.goog":true,"codespot.com":true,"googleapis.com":true,"googlecode.com":true,"pagespeedmobilizer.com":true,"publishproxy.com":true,"withgoogle.com":true,"withyoutube.com":true,"hashbang.sh":true,"hasura-app.io":true,"hepforge.org":true,"herokuapp.com":true,"herokussl.com":true,"moonscale.net":true,"iki.fi":true,"biz.at":true,"info.at":true,"info.cx":true,"ac.leg.br":true,"al.leg.br":true,"am.leg.br":true,"ap.leg.br":true,"ba.leg.br":true,"ce.leg.br":true,"df.leg.br":true,"es.leg.br":true,"go.leg.br":true,"ma.leg.br":true,"mg.leg.br":true,"ms.leg.br":true,"mt.leg.br":true,"pa.leg.br":true,"pb.leg.br":true,"pe.leg.br":true,"pi.leg.br":true,"pr.leg.br":true,"rj.leg.br":true,"rn.leg.br":true,"ro.leg.br":true,"rr.leg.br":true,"rs.leg.br":true,"sc.leg.br":true,"se.leg.br":true,"sp.leg.br":true,"to.leg.br":true,"pixolino.com":true,"ipifony.net":true,"*.triton.zone":true,"*.cns.joyent.com":true,"js.org":true,"keymachine.de":true,"knightpoint.systems":true,"co.krd":true,"edu.krd":true,"git-repos.de":true,"lcube-server.de":true,"svn-repos.de":true,"linkyard.cloud":true,"linkyard-cloud.ch":true,"we.bs":true,"barsy.bg":true,"barsyonline.com":true,"barsy.de":true,"barsy.eu":true,"barsy.in":true,"barsy.net":true,"barsy.online":true,"barsy.support":true,"*.magentosite.cloud":true,"hb.cldmail.ru":true,"cloud.metacentrum.cz":true,"custom.metacentrum.cz":true,"meteorapp.com":true,"eu.meteorapp.com":true,"co.pl":true,"azurewebsites.net":true,"azure-mobile.net":true,"cloudapp.net":true,"mozilla-iot.org":true,"bmoattachments.org":true,"net.ru":true,"org.ru":true,"pp.ru":true,"bitballoon.com":true,"netlify.com":true,"4u.com":true,"ngrok.io":true,"nh-serv.co.uk":true,"nfshost.com":true,"nsupdate.info":true,"nerdpol.ovh":true,"blogsyte.com":true,"brasilia.me":true,"cable-modem.org":true,"ciscofreak.com":true,"collegefan.org":true,"couchpotatofries.org":true,"damnserver.com":true,"ddns.me":true,"ditchyourip.com":true,"dnsfor.me":true,"dnsiskinky.com":true,"dvrcam.info":true,"dynns.com":true,"eating-organic.net":true,"fantasyleague.cc":true,"geekgalaxy.com":true,"golffan.us":true,"health-carereform.com":true,"homesecuritymac.com":true,"homesecuritypc.com":true,"hopto.me":true,"ilovecollege.info":true,"loginto.me":true,"mlbfan.org":true,"mmafan.biz":true,"myactivedirectory.com":true,"mydissent.net":true,"myeffect.net":true,"mymediapc.net":true,"mypsx.net":true,"mysecuritycamera.com":true,"mysecuritycamera.net":true,"mysecuritycamera.org":true,"net-freaks.com":true,"nflfan.org":true,"nhlfan.net":true,"no-ip.ca":true,"no-ip.co.uk":true,"no-ip.net":true,"noip.us":true,"onthewifi.com":true,"pgafan.net":true,"point2this.com":true,"pointto.us":true,"privatizehealthinsurance.net":true,"quicksytes.com":true,"read-books.org":true,"securitytactics.com":true,"serveexchange.com":true,"servehumour.com":true,"servep2p.com":true,"servesarcasm.com":true,"stufftoread.com":true,"ufcfan.org":true,"unusualperson.com":true,"workisboring.com":true,"3utilities.com":true,"bounceme.net":true,"ddns.net":true,"ddnsking.com":true,"gotdns.ch":true,"hopto.org":true,"myftp.biz":true,"myftp.org":true,"myvnc.com":true,"no-ip.biz":true,"no-ip.info":true,"no-ip.org":true,"noip.me":true,"redirectme.net":true,"servebeer.com":true,"serveblog.net":true,"servecounterstrike.com":true,"serveftp.com":true,"servegame.com":true,"servehalflife.com":true,"servehttp.com":true,"serveirc.com":true,"serveminecraft.net":true,"servemp3.com":true,"servepics.com":true,"servequake.com":true,"sytes.net":true,"webhop.me":true,"zapto.org":true,"stage.nodeart.io":true,"nodum.co":true,"nodum.io":true,"nyc.mn":true,"nom.ae":true,"nom.ai":true,"nom.al":true,"nym.by":true,"nym.bz":true,"nom.cl":true,"nom.gd":true,"nom.gl":true,"nym.gr":true,"nom.gt":true,"nom.hn":true,"nom.im":true,"nym.kz":true,"nym.la":true,"nom.li":true,"nym.li":true,"nym.lt":true,"nym.lu":true,"nym.me":true,"nom.mk":true,"nym.mx":true,"nom.nu":true,"nym.nz":true,"nym.pe":true,"nym.pt":true,"nom.pw":true,"nom.qa":true,"nom.rs":true,"nom.si":true,"nym.sk":true,"nym.su":true,"nym.sx":true,"nym.tw":true,"nom.ug":true,"nom.uy":true,"nom.vc":true,"nom.vg":true,"cya.gg":true,"nid.io":true,"opencraft.hosting":true,"operaunite.com":true,"outsystemscloud.com":true,"ownprovider.com":true,"oy.lc":true,"pgfog.com":true,"pagefrontapp.com":true,"art.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"pantheonsite.io":true,"gotpantheon.com":true,"mypep.link":true,"on-web.fr":true,"*.platform.sh":true,"*.platformsh.site":true,"xen.prgmr.com":true,"priv.at":true,"protonet.io":true,"chirurgiens-dentistes-en-france.fr":true,"byen.site":true,"qa2.com":true,"dev-myqnapcloud.com":true,"alpha-myqnapcloud.com":true,"myqnapcloud.com":true,"*.quipelements.com":true,"vapor.cloud":true,"vaporcloud.io":true,"rackmaze.com":true,"rackmaze.net":true,"rhcloud.com":true,"resindevice.io":true,"devices.resinstaging.io":true,"hzc.io":true,"wellbeingzone.eu":true,"ptplus.fit":true,"wellbeingzone.co.uk":true,"sandcats.io":true,"logoip.de":true,"logoip.com":true,"schokokeks.net":true,"scrysec.com":true,"firewall-gateway.com":true,"firewall-gateway.de":true,"my-gateway.de":true,"my-router.de":true,"spdns.de":true,"spdns.eu":true,"firewall-gateway.net":true,"my-firewall.org":true,"myfirewall.org":true,"spdns.org":true,"*.s5y.io":true,"*.sensiosite.cloud":true,"biz.ua":true,"co.ua":true,"pp.ua":true,"shiftedit.io":true,"myshopblocks.com":true,"1kapp.com":true,"appchizi.com":true,"applinzi.com":true,"sinaapp.com":true,"vipsinaapp.com":true,"bounty-full.com":true,"alpha.bounty-full.com":true,"beta.bounty-full.com":true,"static.land":true,"dev.static.land":true,"sites.static.land":true,"apps.lair.io":true,"*.stolos.io":true,"spacekit.io":true,"stackspace.space":true,"storj.farm":true,"temp-dns.com":true,"diskstation.me":true,"dscloud.biz":true,"dscloud.me":true,"dscloud.mobi":true,"dsmynas.com":true,"dsmynas.net":true,"dsmynas.org":true,"familyds.com":true,"familyds.net":true,"familyds.org":true,"i234.me":true,"myds.me":true,"synology.me":true,"vpnplus.to":true,"taifun-dns.de":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"cust.dev.thingdust.io":true,"cust.disrec.thingdust.io":true,"cust.prod.thingdust.io":true,"cust.testing.thingdust.io":true,"bloxcms.com":true,"townnews-staging.com":true,"12hp.at":true,"2ix.at":true,"4lima.at":true,"lima-city.at":true,"12hp.ch":true,"2ix.ch":true,"4lima.ch":true,"lima-city.ch":true,"trafficplex.cloud":true,"de.cool":true,"12hp.de":true,"2ix.de":true,"4lima.de":true,"lima-city.de":true,"1337.pictures":true,"clan.rip":true,"lima-city.rocks":true,"webspace.rocks":true,"lima.zone":true,"*.transurl.be":true,"*.transurl.eu":true,"*.transurl.nl":true,"tuxfamily.org":true,"dd-dns.de":true,"diskstation.eu":true,"diskstation.org":true,"dray-dns.de":true,"draydns.de":true,"dyn-vpn.de":true,"dynvpn.de":true,"mein-vigor.de":true,"my-vigor.de":true,"my-wan.de":true,"syno-ds.de":true,"synology-diskstation.de":true,"synology-ds.de":true,"uber.space":true,"hk.com":true,"hk.org":true,"ltd.hk":true,"inc.hk":true,"lib.de.us":true,"2038.io":true,"router.management":true,"v-info.info":true,"wedeploy.io":true,"wedeploy.me":true,"wedeploy.sh":true,"remotewd.com":true,"wmflabs.org":true,"cistron.nl":true,"demon.nl":true,"xs4all.space":true,"official.academy":true,"yolasite.com":true,"ybo.faith":true,"yombo.me":true,"homelink.one":true,"ybo.party":true,"ybo.review":true,"ybo.science":true,"ybo.trade":true,"za.net":true,"za.org":true,"now.sh":true});
  63305. // END of automatically generated file
  63306. /***/ }),
  63307. /* 386 */
  63308. /***/ (function(module, exports, __webpack_require__) {
  63309. "use strict";
  63310. /*!
  63311. * Copyright (c) 2015, Salesforce.com, Inc.
  63312. * All rights reserved.
  63313. *
  63314. * Redistribution and use in source and binary forms, with or without
  63315. * modification, are permitted provided that the following conditions are met:
  63316. *
  63317. * 1. Redistributions of source code must retain the above copyright notice,
  63318. * this list of conditions and the following disclaimer.
  63319. *
  63320. * 2. Redistributions in binary form must reproduce the above copyright notice,
  63321. * this list of conditions and the following disclaimer in the documentation
  63322. * and/or other materials provided with the distribution.
  63323. *
  63324. * 3. Neither the name of Salesforce.com nor the names of its contributors may
  63325. * be used to endorse or promote products derived from this software without
  63326. * specific prior written permission.
  63327. *
  63328. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  63329. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  63330. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  63331. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  63332. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  63333. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  63334. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  63335. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  63336. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  63337. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  63338. * POSSIBILITY OF SUCH DAMAGE.
  63339. */
  63340. /*jshint unused:false */
  63341. function Store() {
  63342. }
  63343. exports.Store = Store;
  63344. // Stores may be synchronous, but are still required to use a
  63345. // Continuation-Passing Style API. The CookieJar itself will expose a "*Sync"
  63346. // API that converts from synchronous-callbacks to imperative style.
  63347. Store.prototype.synchronous = false;
  63348. Store.prototype.findCookie = function(domain, path, key, cb) {
  63349. throw new Error('findCookie is not implemented');
  63350. };
  63351. Store.prototype.findCookies = function(domain, path, cb) {
  63352. throw new Error('findCookies is not implemented');
  63353. };
  63354. Store.prototype.putCookie = function(cookie, cb) {
  63355. throw new Error('putCookie is not implemented');
  63356. };
  63357. Store.prototype.updateCookie = function(oldCookie, newCookie, cb) {
  63358. // recommended default implementation:
  63359. // return this.putCookie(newCookie, cb);
  63360. throw new Error('updateCookie is not implemented');
  63361. };
  63362. Store.prototype.removeCookie = function(domain, path, key, cb) {
  63363. throw new Error('removeCookie is not implemented');
  63364. };
  63365. Store.prototype.removeCookies = function(domain, path, cb) {
  63366. throw new Error('removeCookies is not implemented');
  63367. };
  63368. Store.prototype.getAllCookies = function(cb) {
  63369. throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)');
  63370. };
  63371. /***/ }),
  63372. /* 387 */
  63373. /***/ (function(module, exports) {
  63374. module.exports = function () {
  63375. // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
  63376. var origPrepareStackTrace = Error.prepareStackTrace;
  63377. Error.prepareStackTrace = function (_, stack) { return stack; };
  63378. var stack = (new Error()).stack;
  63379. Error.prepareStackTrace = origPrepareStackTrace;
  63380. return stack[2].getFileName();
  63381. };
  63382. /***/ }),
  63383. /* 388 */
  63384. /***/ (function(module, exports, __webpack_require__) {
  63385. var path = __webpack_require__(1);
  63386. var fs = __webpack_require__(12);
  63387. var parse = path.parse || __webpack_require__(846);
  63388. module.exports = function nodeModulesPaths(start, opts) {
  63389. var modules = opts && opts.moduleDirectory
  63390. ? [].concat(opts.moduleDirectory)
  63391. : ['node_modules'];
  63392. // ensure that `start` is an absolute path at this point,
  63393. // resolving against the process' current working directory
  63394. var absoluteStart = path.resolve(start);
  63395. if (opts && opts.preserveSymlinks === false) {
  63396. try {
  63397. absoluteStart = fs.realpathSync(absoluteStart);
  63398. } catch (err) {
  63399. if (err.code !== 'ENOENT') {
  63400. throw err;
  63401. }
  63402. }
  63403. }
  63404. var prefix = '/';
  63405. if (/^([A-Za-z]:)/.test(absoluteStart)) {
  63406. prefix = '';
  63407. } else if (/^\\\\/.test(absoluteStart)) {
  63408. prefix = '\\\\';
  63409. }
  63410. var paths = [absoluteStart];
  63411. var parsed = parse(absoluteStart);
  63412. while (parsed.dir !== paths[paths.length - 1]) {
  63413. paths.push(parsed.dir);
  63414. parsed = parse(parsed.dir);
  63415. }
  63416. var dirs = paths.reduce(function (dirs, aPath) {
  63417. return dirs.concat(modules.map(function (moduleDir) {
  63418. return path.join(prefix, aPath, moduleDir);
  63419. }));
  63420. }, []);
  63421. return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
  63422. };
  63423. /***/ }),
  63424. /* 389 */
  63425. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63426. "use strict";
  63427. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BehaviorSubject; });
  63428. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  63429. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
  63430. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ObjectUnsubscribedError__ = __webpack_require__(180);
  63431. /** PURE_IMPORTS_START tslib,_Subject,_util_ObjectUnsubscribedError PURE_IMPORTS_END */
  63432. var BehaviorSubject = /*@__PURE__*/ (function (_super) {
  63433. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BehaviorSubject, _super);
  63434. function BehaviorSubject(_value) {
  63435. var _this = _super.call(this) || this;
  63436. _this._value = _value;
  63437. return _this;
  63438. }
  63439. Object.defineProperty(BehaviorSubject.prototype, "value", {
  63440. get: function () {
  63441. return this.getValue();
  63442. },
  63443. enumerable: true,
  63444. configurable: true
  63445. });
  63446. BehaviorSubject.prototype._subscribe = function (subscriber) {
  63447. var subscription = _super.prototype._subscribe.call(this, subscriber);
  63448. if (subscription && !subscription.closed) {
  63449. subscriber.next(this._value);
  63450. }
  63451. return subscription;
  63452. };
  63453. BehaviorSubject.prototype.getValue = function () {
  63454. if (this.hasError) {
  63455. throw this.thrownError;
  63456. }
  63457. else if (this.closed) {
  63458. throw new __WEBPACK_IMPORTED_MODULE_2__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
  63459. }
  63460. else {
  63461. return this._value;
  63462. }
  63463. };
  63464. BehaviorSubject.prototype.next = function (value) {
  63465. _super.prototype.next.call(this, this._value = value);
  63466. };
  63467. return BehaviorSubject;
  63468. }(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]));
  63469. //# sourceMappingURL=BehaviorSubject.js.map
  63470. /***/ }),
  63471. /* 390 */
  63472. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63473. "use strict";
  63474. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return empty; });
  63475. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__config__ = __webpack_require__(176);
  63476. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_hostReportError__ = __webpack_require__(264);
  63477. /** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */
  63478. var empty = {
  63479. closed: true,
  63480. next: function (value) { },
  63481. error: function (err) {
  63482. if (__WEBPACK_IMPORTED_MODULE_0__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
  63483. throw err;
  63484. }
  63485. else {
  63486. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_hostReportError__["a" /* hostReportError */])(err);
  63487. }
  63488. },
  63489. complete: function () { }
  63490. };
  63491. //# sourceMappingURL=Observer.js.map
  63492. /***/ }),
  63493. /* 391 */
  63494. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63495. "use strict";
  63496. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Scheduler; });
  63497. var Scheduler = /*@__PURE__*/ (function () {
  63498. function Scheduler(SchedulerAction, now) {
  63499. if (now === void 0) {
  63500. now = Scheduler.now;
  63501. }
  63502. this.SchedulerAction = SchedulerAction;
  63503. this.now = now;
  63504. }
  63505. Scheduler.prototype.schedule = function (work, delay, state) {
  63506. if (delay === void 0) {
  63507. delay = 0;
  63508. }
  63509. return new this.SchedulerAction(this, work).schedule(state, delay);
  63510. };
  63511. Scheduler.now = function () { return Date.now(); };
  63512. return Scheduler;
  63513. }());
  63514. //# sourceMappingURL=Scheduler.js.map
  63515. /***/ }),
  63516. /* 392 */
  63517. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63518. "use strict";
  63519. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SubjectSubscription; });
  63520. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  63521. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
  63522. /** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */
  63523. var SubjectSubscription = /*@__PURE__*/ (function (_super) {
  63524. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubjectSubscription, _super);
  63525. function SubjectSubscription(subject, subscriber) {
  63526. var _this = _super.call(this) || this;
  63527. _this.subject = subject;
  63528. _this.subscriber = subscriber;
  63529. _this.closed = false;
  63530. return _this;
  63531. }
  63532. SubjectSubscription.prototype.unsubscribe = function () {
  63533. if (this.closed) {
  63534. return;
  63535. }
  63536. this.closed = true;
  63537. var subject = this.subject;
  63538. var observers = subject.observers;
  63539. this.subject = null;
  63540. if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
  63541. return;
  63542. }
  63543. var subscriberIndex = observers.indexOf(this.subscriber);
  63544. if (subscriberIndex !== -1) {
  63545. observers.splice(subscriberIndex, 1);
  63546. }
  63547. };
  63548. return SubjectSubscription;
  63549. }(__WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]));
  63550. //# sourceMappingURL=SubjectSubscription.js.map
  63551. /***/ }),
  63552. /* 393 */
  63553. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63554. "use strict";
  63555. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ConnectableObservable; });
  63556. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return connectableObservableDescriptor; });
  63557. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  63558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
  63559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observable__ = __webpack_require__(17);
  63560. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(5);
  63561. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Subscription__ = __webpack_require__(31);
  63562. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__operators_refCount__ = __webpack_require__(257);
  63563. /** PURE_IMPORTS_START tslib,_Subject,_Observable,_Subscriber,_Subscription,_operators_refCount PURE_IMPORTS_END */
  63564. var ConnectableObservable = /*@__PURE__*/ (function (_super) {
  63565. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ConnectableObservable, _super);
  63566. function ConnectableObservable(source, subjectFactory) {
  63567. var _this = _super.call(this) || this;
  63568. _this.source = source;
  63569. _this.subjectFactory = subjectFactory;
  63570. _this._refCount = 0;
  63571. _this._isComplete = false;
  63572. return _this;
  63573. }
  63574. ConnectableObservable.prototype._subscribe = function (subscriber) {
  63575. return this.getSubject().subscribe(subscriber);
  63576. };
  63577. ConnectableObservable.prototype.getSubject = function () {
  63578. var subject = this._subject;
  63579. if (!subject || subject.isStopped) {
  63580. this._subject = this.subjectFactory();
  63581. }
  63582. return this._subject;
  63583. };
  63584. ConnectableObservable.prototype.connect = function () {
  63585. var connection = this._connection;
  63586. if (!connection) {
  63587. this._isComplete = false;
  63588. connection = this._connection = new __WEBPACK_IMPORTED_MODULE_4__Subscription__["a" /* Subscription */]();
  63589. connection.add(this.source
  63590. .subscribe(new ConnectableSubscriber(this.getSubject(), this)));
  63591. if (connection.closed) {
  63592. this._connection = null;
  63593. connection = __WEBPACK_IMPORTED_MODULE_4__Subscription__["a" /* Subscription */].EMPTY;
  63594. }
  63595. else {
  63596. this._connection = connection;
  63597. }
  63598. }
  63599. return connection;
  63600. };
  63601. ConnectableObservable.prototype.refCount = function () {
  63602. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__operators_refCount__["a" /* refCount */])()(this);
  63603. };
  63604. return ConnectableObservable;
  63605. }(__WEBPACK_IMPORTED_MODULE_2__Observable__["a" /* Observable */]));
  63606. var connectableProto = ConnectableObservable.prototype;
  63607. var connectableObservableDescriptor = {
  63608. operator: { value: null },
  63609. _refCount: { value: 0, writable: true },
  63610. _subject: { value: null, writable: true },
  63611. _connection: { value: null, writable: true },
  63612. _subscribe: { value: connectableProto._subscribe },
  63613. _isComplete: { value: connectableProto._isComplete, writable: true },
  63614. getSubject: { value: connectableProto.getSubject },
  63615. connect: { value: connectableProto.connect },
  63616. refCount: { value: connectableProto.refCount }
  63617. };
  63618. var ConnectableSubscriber = /*@__PURE__*/ (function (_super) {
  63619. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ConnectableSubscriber, _super);
  63620. function ConnectableSubscriber(destination, connectable) {
  63621. var _this = _super.call(this, destination) || this;
  63622. _this.connectable = connectable;
  63623. return _this;
  63624. }
  63625. ConnectableSubscriber.prototype._error = function (err) {
  63626. this._unsubscribe();
  63627. _super.prototype._error.call(this, err);
  63628. };
  63629. ConnectableSubscriber.prototype._complete = function () {
  63630. this.connectable._isComplete = true;
  63631. this._unsubscribe();
  63632. _super.prototype._complete.call(this);
  63633. };
  63634. ConnectableSubscriber.prototype._unsubscribe = function () {
  63635. var connectable = this.connectable;
  63636. if (connectable) {
  63637. this.connectable = null;
  63638. var connection = connectable._connection;
  63639. connectable._refCount = 0;
  63640. connectable._subject = null;
  63641. connectable._connection = null;
  63642. if (connection) {
  63643. connection.unsubscribe();
  63644. }
  63645. }
  63646. };
  63647. return ConnectableSubscriber;
  63648. }(__WEBPACK_IMPORTED_MODULE_1__Subject__["b" /* SubjectSubscriber */]));
  63649. var RefCountOperator = /*@__PURE__*/ (function () {
  63650. function RefCountOperator(connectable) {
  63651. this.connectable = connectable;
  63652. }
  63653. RefCountOperator.prototype.call = function (subscriber, source) {
  63654. var connectable = this.connectable;
  63655. connectable._refCount++;
  63656. var refCounter = new RefCountSubscriber(subscriber, connectable);
  63657. var subscription = source.subscribe(refCounter);
  63658. if (!refCounter.closed) {
  63659. refCounter.connection = connectable.connect();
  63660. }
  63661. return subscription;
  63662. };
  63663. return RefCountOperator;
  63664. }());
  63665. var RefCountSubscriber = /*@__PURE__*/ (function (_super) {
  63666. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RefCountSubscriber, _super);
  63667. function RefCountSubscriber(destination, connectable) {
  63668. var _this = _super.call(this, destination) || this;
  63669. _this.connectable = connectable;
  63670. return _this;
  63671. }
  63672. RefCountSubscriber.prototype._unsubscribe = function () {
  63673. var connectable = this.connectable;
  63674. if (!connectable) {
  63675. this.connection = null;
  63676. return;
  63677. }
  63678. this.connectable = null;
  63679. var refCount = connectable._refCount;
  63680. if (refCount <= 0) {
  63681. this.connection = null;
  63682. return;
  63683. }
  63684. connectable._refCount = refCount - 1;
  63685. if (refCount > 1) {
  63686. this.connection = null;
  63687. return;
  63688. }
  63689. var connection = this.connection;
  63690. var sharedConnection = connectable._connection;
  63691. this.connection = null;
  63692. if (sharedConnection && (!connection || sharedConnection === connection)) {
  63693. sharedConnection.unsubscribe();
  63694. }
  63695. };
  63696. return RefCountSubscriber;
  63697. }(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* Subscriber */]));
  63698. //# sourceMappingURL=ConnectableObservable.js.map
  63699. /***/ }),
  63700. /* 394 */
  63701. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63702. "use strict";
  63703. /* harmony export (immutable) */ __webpack_exports__["a"] = merge;
  63704. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  63705. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isScheduler__ = __webpack_require__(56);
  63706. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__operators_mergeAll__ = __webpack_require__(256);
  63707. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__fromArray__ = __webpack_require__(81);
  63708. /** PURE_IMPORTS_START _Observable,_util_isScheduler,_operators_mergeAll,_fromArray PURE_IMPORTS_END */
  63709. function merge() {
  63710. var observables = [];
  63711. for (var _i = 0; _i < arguments.length; _i++) {
  63712. observables[_i] = arguments[_i];
  63713. }
  63714. var concurrent = Number.POSITIVE_INFINITY;
  63715. var scheduler = null;
  63716. var last = observables[observables.length - 1];
  63717. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isScheduler__["a" /* isScheduler */])(last)) {
  63718. scheduler = observables.pop();
  63719. if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
  63720. concurrent = observables.pop();
  63721. }
  63722. }
  63723. else if (typeof last === 'number') {
  63724. concurrent = observables.pop();
  63725. }
  63726. if (scheduler === null && observables.length === 1 && observables[0] instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */]) {
  63727. return observables[0];
  63728. }
  63729. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__operators_mergeAll__["a" /* mergeAll */])(concurrent)(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__fromArray__["a" /* fromArray */])(observables, scheduler));
  63730. }
  63731. //# sourceMappingURL=merge.js.map
  63732. /***/ }),
  63733. /* 395 */
  63734. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63735. "use strict";
  63736. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NEVER; });
  63737. /* harmony export (immutable) */ __webpack_exports__["a"] = never;
  63738. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  63739. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_noop__ = __webpack_require__(182);
  63740. /** PURE_IMPORTS_START _Observable,_util_noop PURE_IMPORTS_END */
  63741. var NEVER = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__WEBPACK_IMPORTED_MODULE_1__util_noop__["a" /* noop */]);
  63742. function never() {
  63743. return NEVER;
  63744. }
  63745. //# sourceMappingURL=never.js.map
  63746. /***/ }),
  63747. /* 396 */
  63748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63749. "use strict";
  63750. /* harmony export (immutable) */ __webpack_exports__["a"] = race;
  63751. /* unused harmony export RaceOperator */
  63752. /* unused harmony export RaceSubscriber */
  63753. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  63754. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isArray__ = __webpack_require__(48);
  63755. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__fromArray__ = __webpack_require__(81);
  63756. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
  63757. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
  63758. /** PURE_IMPORTS_START tslib,_util_isArray,_fromArray,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  63759. function race() {
  63760. var observables = [];
  63761. for (var _i = 0; _i < arguments.length; _i++) {
  63762. observables[_i] = arguments[_i];
  63763. }
  63764. if (observables.length === 1) {
  63765. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isArray__["a" /* isArray */])(observables[0])) {
  63766. observables = observables[0];
  63767. }
  63768. else {
  63769. return observables[0];
  63770. }
  63771. }
  63772. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__fromArray__["a" /* fromArray */])(observables, undefined).lift(new RaceOperator());
  63773. }
  63774. var RaceOperator = /*@__PURE__*/ (function () {
  63775. function RaceOperator() {
  63776. }
  63777. RaceOperator.prototype.call = function (subscriber, source) {
  63778. return source.subscribe(new RaceSubscriber(subscriber));
  63779. };
  63780. return RaceOperator;
  63781. }());
  63782. var RaceSubscriber = /*@__PURE__*/ (function (_super) {
  63783. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RaceSubscriber, _super);
  63784. function RaceSubscriber(destination) {
  63785. var _this = _super.call(this, destination) || this;
  63786. _this.hasFirst = false;
  63787. _this.observables = [];
  63788. _this.subscriptions = [];
  63789. return _this;
  63790. }
  63791. RaceSubscriber.prototype._next = function (observable) {
  63792. this.observables.push(observable);
  63793. };
  63794. RaceSubscriber.prototype._complete = function () {
  63795. var observables = this.observables;
  63796. var len = observables.length;
  63797. if (len === 0) {
  63798. this.destination.complete();
  63799. }
  63800. else {
  63801. for (var i = 0; i < len && !this.hasFirst; i++) {
  63802. var observable = observables[i];
  63803. var subscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, observable, observable, i);
  63804. if (this.subscriptions) {
  63805. this.subscriptions.push(subscription);
  63806. }
  63807. this.add(subscription);
  63808. }
  63809. this.observables = null;
  63810. }
  63811. };
  63812. RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  63813. if (!this.hasFirst) {
  63814. this.hasFirst = true;
  63815. for (var i = 0; i < this.subscriptions.length; i++) {
  63816. if (i !== outerIndex) {
  63817. var subscription = this.subscriptions[i];
  63818. subscription.unsubscribe();
  63819. this.remove(subscription);
  63820. }
  63821. }
  63822. this.subscriptions = null;
  63823. }
  63824. this.destination.next(innerValue);
  63825. };
  63826. return RaceSubscriber;
  63827. }(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
  63828. //# sourceMappingURL=race.js.map
  63829. /***/ }),
  63830. /* 397 */
  63831. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63832. "use strict";
  63833. /* harmony export (immutable) */ __webpack_exports__["a"] = timer;
  63834. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  63835. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47);
  63836. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isNumeric__ = __webpack_require__(181);
  63837. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isScheduler__ = __webpack_require__(56);
  63838. /** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */
  63839. function timer(dueTime, periodOrScheduler, scheduler) {
  63840. if (dueTime === void 0) {
  63841. dueTime = 0;
  63842. }
  63843. var period = -1;
  63844. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isNumeric__["a" /* isNumeric */])(periodOrScheduler)) {
  63845. period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);
  63846. }
  63847. else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isScheduler__["a" /* isScheduler */])(periodOrScheduler)) {
  63848. scheduler = periodOrScheduler;
  63849. }
  63850. if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isScheduler__["a" /* isScheduler */])(scheduler)) {
  63851. scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
  63852. }
  63853. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  63854. var due = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isNumeric__["a" /* isNumeric */])(dueTime)
  63855. ? dueTime
  63856. : (+dueTime - scheduler.now());
  63857. return scheduler.schedule(dispatch, due, {
  63858. index: 0, period: period, subscriber: subscriber
  63859. });
  63860. });
  63861. }
  63862. function dispatch(state) {
  63863. var index = state.index, period = state.period, subscriber = state.subscriber;
  63864. subscriber.next(index);
  63865. if (subscriber.closed) {
  63866. return;
  63867. }
  63868. else if (period === -1) {
  63869. return subscriber.complete();
  63870. }
  63871. state.index = index + 1;
  63872. this.schedule(state, period);
  63873. }
  63874. //# sourceMappingURL=timer.js.map
  63875. /***/ }),
  63876. /* 398 */
  63877. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63878. "use strict";
  63879. /* harmony export (immutable) */ __webpack_exports__["a"] = audit;
  63880. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  63881. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_tryCatch__ = __webpack_require__(59);
  63882. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_errorObject__ = __webpack_require__(55);
  63883. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
  63884. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
  63885. /** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  63886. function audit(durationSelector) {
  63887. return function auditOperatorFunction(source) {
  63888. return source.lift(new AuditOperator(durationSelector));
  63889. };
  63890. }
  63891. var AuditOperator = /*@__PURE__*/ (function () {
  63892. function AuditOperator(durationSelector) {
  63893. this.durationSelector = durationSelector;
  63894. }
  63895. AuditOperator.prototype.call = function (subscriber, source) {
  63896. return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector));
  63897. };
  63898. return AuditOperator;
  63899. }());
  63900. var AuditSubscriber = /*@__PURE__*/ (function (_super) {
  63901. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AuditSubscriber, _super);
  63902. function AuditSubscriber(destination, durationSelector) {
  63903. var _this = _super.call(this, destination) || this;
  63904. _this.durationSelector = durationSelector;
  63905. _this.hasValue = false;
  63906. return _this;
  63907. }
  63908. AuditSubscriber.prototype._next = function (value) {
  63909. this.value = value;
  63910. this.hasValue = true;
  63911. if (!this.throttled) {
  63912. var duration = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_tryCatch__["a" /* tryCatch */])(this.durationSelector)(value);
  63913. if (duration === __WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */]) {
  63914. this.destination.error(__WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */].e);
  63915. }
  63916. else {
  63917. var innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, duration);
  63918. if (!innerSubscription || innerSubscription.closed) {
  63919. this.clearThrottle();
  63920. }
  63921. else {
  63922. this.add(this.throttled = innerSubscription);
  63923. }
  63924. }
  63925. }
  63926. };
  63927. AuditSubscriber.prototype.clearThrottle = function () {
  63928. var _a = this, value = _a.value, hasValue = _a.hasValue, throttled = _a.throttled;
  63929. if (throttled) {
  63930. this.remove(throttled);
  63931. this.throttled = null;
  63932. throttled.unsubscribe();
  63933. }
  63934. if (hasValue) {
  63935. this.value = null;
  63936. this.hasValue = false;
  63937. this.destination.next(value);
  63938. }
  63939. };
  63940. AuditSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) {
  63941. this.clearThrottle();
  63942. };
  63943. AuditSubscriber.prototype.notifyComplete = function () {
  63944. this.clearThrottle();
  63945. };
  63946. return AuditSubscriber;
  63947. }(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
  63948. //# sourceMappingURL=audit.js.map
  63949. /***/ }),
  63950. /* 399 */
  63951. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63952. "use strict";
  63953. /* harmony export (immutable) */ __webpack_exports__["a"] = concatAll;
  63954. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeAll__ = __webpack_require__(256);
  63955. /** PURE_IMPORTS_START _mergeAll PURE_IMPORTS_END */
  63956. function concatAll() {
  63957. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeAll__["a" /* mergeAll */])(1);
  63958. }
  63959. //# sourceMappingURL=concatAll.js.map
  63960. /***/ }),
  63961. /* 400 */
  63962. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63963. "use strict";
  63964. /* harmony export (immutable) */ __webpack_exports__["a"] = concatMap;
  63965. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeMap__ = __webpack_require__(137);
  63966. /** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */
  63967. function concatMap(project, resultSelector) {
  63968. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(project, resultSelector, 1);
  63969. }
  63970. //# sourceMappingURL=concatMap.js.map
  63971. /***/ }),
  63972. /* 401 */
  63973. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63974. "use strict";
  63975. /* harmony export (immutable) */ __webpack_exports__["a"] = distinctUntilChanged;
  63976. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  63977. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  63978. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
  63979. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
  63980. /** PURE_IMPORTS_START tslib,_Subscriber,_util_tryCatch,_util_errorObject PURE_IMPORTS_END */
  63981. function distinctUntilChanged(compare, keySelector) {
  63982. return function (source) { return source.lift(new DistinctUntilChangedOperator(compare, keySelector)); };
  63983. }
  63984. var DistinctUntilChangedOperator = /*@__PURE__*/ (function () {
  63985. function DistinctUntilChangedOperator(compare, keySelector) {
  63986. this.compare = compare;
  63987. this.keySelector = keySelector;
  63988. }
  63989. DistinctUntilChangedOperator.prototype.call = function (subscriber, source) {
  63990. return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));
  63991. };
  63992. return DistinctUntilChangedOperator;
  63993. }());
  63994. var DistinctUntilChangedSubscriber = /*@__PURE__*/ (function (_super) {
  63995. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DistinctUntilChangedSubscriber, _super);
  63996. function DistinctUntilChangedSubscriber(destination, compare, keySelector) {
  63997. var _this = _super.call(this, destination) || this;
  63998. _this.keySelector = keySelector;
  63999. _this.hasKey = false;
  64000. if (typeof compare === 'function') {
  64001. _this.compare = compare;
  64002. }
  64003. return _this;
  64004. }
  64005. DistinctUntilChangedSubscriber.prototype.compare = function (x, y) {
  64006. return x === y;
  64007. };
  64008. DistinctUntilChangedSubscriber.prototype._next = function (value) {
  64009. var keySelector = this.keySelector;
  64010. var key = value;
  64011. if (keySelector) {
  64012. key = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.keySelector)(value);
  64013. if (key === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
  64014. return this.destination.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e);
  64015. }
  64016. }
  64017. var result = false;
  64018. if (this.hasKey) {
  64019. result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.compare)(this.key, key);
  64020. if (result === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
  64021. return this.destination.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e);
  64022. }
  64023. }
  64024. else {
  64025. this.hasKey = true;
  64026. }
  64027. if (Boolean(result) === false) {
  64028. this.key = key;
  64029. this.destination.next(value);
  64030. }
  64031. };
  64032. return DistinctUntilChangedSubscriber;
  64033. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  64034. //# sourceMappingURL=distinctUntilChanged.js.map
  64035. /***/ }),
  64036. /* 402 */
  64037. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64038. "use strict";
  64039. /* harmony export (immutable) */ __webpack_exports__["a"] = find;
  64040. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return FindValueOperator; });
  64041. /* unused harmony export FindValueSubscriber */
  64042. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  64043. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  64044. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  64045. function find(predicate, thisArg) {
  64046. if (typeof predicate !== 'function') {
  64047. throw new TypeError('predicate is not a function');
  64048. }
  64049. return function (source) { return source.lift(new FindValueOperator(predicate, source, false, thisArg)); };
  64050. }
  64051. var FindValueOperator = /*@__PURE__*/ (function () {
  64052. function FindValueOperator(predicate, source, yieldIndex, thisArg) {
  64053. this.predicate = predicate;
  64054. this.source = source;
  64055. this.yieldIndex = yieldIndex;
  64056. this.thisArg = thisArg;
  64057. }
  64058. FindValueOperator.prototype.call = function (observer, source) {
  64059. return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));
  64060. };
  64061. return FindValueOperator;
  64062. }());
  64063. var FindValueSubscriber = /*@__PURE__*/ (function (_super) {
  64064. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](FindValueSubscriber, _super);
  64065. function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) {
  64066. var _this = _super.call(this, destination) || this;
  64067. _this.predicate = predicate;
  64068. _this.source = source;
  64069. _this.yieldIndex = yieldIndex;
  64070. _this.thisArg = thisArg;
  64071. _this.index = 0;
  64072. return _this;
  64073. }
  64074. FindValueSubscriber.prototype.notifyComplete = function (value) {
  64075. var destination = this.destination;
  64076. destination.next(value);
  64077. destination.complete();
  64078. this.unsubscribe();
  64079. };
  64080. FindValueSubscriber.prototype._next = function (value) {
  64081. var _a = this, predicate = _a.predicate, thisArg = _a.thisArg;
  64082. var index = this.index++;
  64083. try {
  64084. var result = predicate.call(thisArg || this, value, index, this.source);
  64085. if (result) {
  64086. this.notifyComplete(this.yieldIndex ? index : value);
  64087. }
  64088. }
  64089. catch (err) {
  64090. this.destination.error(err);
  64091. }
  64092. };
  64093. FindValueSubscriber.prototype._complete = function () {
  64094. this.notifyComplete(this.yieldIndex ? -1 : undefined);
  64095. };
  64096. return FindValueSubscriber;
  64097. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  64098. //# sourceMappingURL=find.js.map
  64099. /***/ }),
  64100. /* 403 */
  64101. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64102. "use strict";
  64103. /* harmony export (immutable) */ __webpack_exports__["b"] = groupBy;
  64104. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupedObservable; });
  64105. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  64106. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  64107. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(31);
  64108. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Observable__ = __webpack_require__(17);
  64109. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Subject__ = __webpack_require__(43);
  64110. /** PURE_IMPORTS_START tslib,_Subscriber,_Subscription,_Observable,_Subject PURE_IMPORTS_END */
  64111. function groupBy(keySelector, elementSelector, durationSelector, subjectSelector) {
  64112. return function (source) {
  64113. return source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector));
  64114. };
  64115. }
  64116. var GroupByOperator = /*@__PURE__*/ (function () {
  64117. function GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector) {
  64118. this.keySelector = keySelector;
  64119. this.elementSelector = elementSelector;
  64120. this.durationSelector = durationSelector;
  64121. this.subjectSelector = subjectSelector;
  64122. }
  64123. GroupByOperator.prototype.call = function (subscriber, source) {
  64124. return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector));
  64125. };
  64126. return GroupByOperator;
  64127. }());
  64128. var GroupBySubscriber = /*@__PURE__*/ (function (_super) {
  64129. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](GroupBySubscriber, _super);
  64130. function GroupBySubscriber(destination, keySelector, elementSelector, durationSelector, subjectSelector) {
  64131. var _this = _super.call(this, destination) || this;
  64132. _this.keySelector = keySelector;
  64133. _this.elementSelector = elementSelector;
  64134. _this.durationSelector = durationSelector;
  64135. _this.subjectSelector = subjectSelector;
  64136. _this.groups = null;
  64137. _this.attemptedToUnsubscribe = false;
  64138. _this.count = 0;
  64139. return _this;
  64140. }
  64141. GroupBySubscriber.prototype._next = function (value) {
  64142. var key;
  64143. try {
  64144. key = this.keySelector(value);
  64145. }
  64146. catch (err) {
  64147. this.error(err);
  64148. return;
  64149. }
  64150. this._group(value, key);
  64151. };
  64152. GroupBySubscriber.prototype._group = function (value, key) {
  64153. var groups = this.groups;
  64154. if (!groups) {
  64155. groups = this.groups = new Map();
  64156. }
  64157. var group = groups.get(key);
  64158. var element;
  64159. if (this.elementSelector) {
  64160. try {
  64161. element = this.elementSelector(value);
  64162. }
  64163. catch (err) {
  64164. this.error(err);
  64165. }
  64166. }
  64167. else {
  64168. element = value;
  64169. }
  64170. if (!group) {
  64171. group = (this.subjectSelector ? this.subjectSelector() : new __WEBPACK_IMPORTED_MODULE_4__Subject__["a" /* Subject */]());
  64172. groups.set(key, group);
  64173. var groupedObservable = new GroupedObservable(key, group, this);
  64174. this.destination.next(groupedObservable);
  64175. if (this.durationSelector) {
  64176. var duration = void 0;
  64177. try {
  64178. duration = this.durationSelector(new GroupedObservable(key, group));
  64179. }
  64180. catch (err) {
  64181. this.error(err);
  64182. return;
  64183. }
  64184. this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));
  64185. }
  64186. }
  64187. if (!group.closed) {
  64188. group.next(element);
  64189. }
  64190. };
  64191. GroupBySubscriber.prototype._error = function (err) {
  64192. var groups = this.groups;
  64193. if (groups) {
  64194. groups.forEach(function (group, key) {
  64195. group.error(err);
  64196. });
  64197. groups.clear();
  64198. }
  64199. this.destination.error(err);
  64200. };
  64201. GroupBySubscriber.prototype._complete = function () {
  64202. var groups = this.groups;
  64203. if (groups) {
  64204. groups.forEach(function (group, key) {
  64205. group.complete();
  64206. });
  64207. groups.clear();
  64208. }
  64209. this.destination.complete();
  64210. };
  64211. GroupBySubscriber.prototype.removeGroup = function (key) {
  64212. this.groups.delete(key);
  64213. };
  64214. GroupBySubscriber.prototype.unsubscribe = function () {
  64215. if (!this.closed) {
  64216. this.attemptedToUnsubscribe = true;
  64217. if (this.count === 0) {
  64218. _super.prototype.unsubscribe.call(this);
  64219. }
  64220. }
  64221. };
  64222. return GroupBySubscriber;
  64223. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  64224. var GroupDurationSubscriber = /*@__PURE__*/ (function (_super) {
  64225. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](GroupDurationSubscriber, _super);
  64226. function GroupDurationSubscriber(key, group, parent) {
  64227. var _this = _super.call(this, group) || this;
  64228. _this.key = key;
  64229. _this.group = group;
  64230. _this.parent = parent;
  64231. return _this;
  64232. }
  64233. GroupDurationSubscriber.prototype._next = function (value) {
  64234. this.complete();
  64235. };
  64236. GroupDurationSubscriber.prototype._unsubscribe = function () {
  64237. var _a = this, parent = _a.parent, key = _a.key;
  64238. this.key = this.parent = null;
  64239. if (parent) {
  64240. parent.removeGroup(key);
  64241. }
  64242. };
  64243. return GroupDurationSubscriber;
  64244. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  64245. var GroupedObservable = /*@__PURE__*/ (function (_super) {
  64246. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](GroupedObservable, _super);
  64247. function GroupedObservable(key, groupSubject, refCountSubscription) {
  64248. var _this = _super.call(this) || this;
  64249. _this.key = key;
  64250. _this.groupSubject = groupSubject;
  64251. _this.refCountSubscription = refCountSubscription;
  64252. return _this;
  64253. }
  64254. GroupedObservable.prototype._subscribe = function (subscriber) {
  64255. var subscription = new __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */]();
  64256. var _a = this, refCountSubscription = _a.refCountSubscription, groupSubject = _a.groupSubject;
  64257. if (refCountSubscription && !refCountSubscription.closed) {
  64258. subscription.add(new InnerRefCountSubscription(refCountSubscription));
  64259. }
  64260. subscription.add(groupSubject.subscribe(subscriber));
  64261. return subscription;
  64262. };
  64263. return GroupedObservable;
  64264. }(__WEBPACK_IMPORTED_MODULE_3__Observable__["a" /* Observable */]));
  64265. var InnerRefCountSubscription = /*@__PURE__*/ (function (_super) {
  64266. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](InnerRefCountSubscription, _super);
  64267. function InnerRefCountSubscription(parent) {
  64268. var _this = _super.call(this) || this;
  64269. _this.parent = parent;
  64270. parent.count++;
  64271. return _this;
  64272. }
  64273. InnerRefCountSubscription.prototype.unsubscribe = function () {
  64274. var parent = this.parent;
  64275. if (!parent.closed && !this.closed) {
  64276. _super.prototype.unsubscribe.call(this);
  64277. parent.count -= 1;
  64278. if (parent.count === 0 && parent.attemptedToUnsubscribe) {
  64279. parent.unsubscribe();
  64280. }
  64281. }
  64282. };
  64283. return InnerRefCountSubscription;
  64284. }(__WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */]));
  64285. //# sourceMappingURL=groupBy.js.map
  64286. /***/ }),
  64287. /* 404 */
  64288. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64289. "use strict";
  64290. /* harmony export (immutable) */ __webpack_exports__["b"] = observeOn;
  64291. /* unused harmony export ObserveOnOperator */
  64292. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ObserveOnSubscriber; });
  64293. /* unused harmony export ObserveOnMessage */
  64294. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  64295. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  64296. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Notification__ = __webpack_require__(175);
  64297. /** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */
  64298. function observeOn(scheduler, delay) {
  64299. if (delay === void 0) {
  64300. delay = 0;
  64301. }
  64302. return function observeOnOperatorFunction(source) {
  64303. return source.lift(new ObserveOnOperator(scheduler, delay));
  64304. };
  64305. }
  64306. var ObserveOnOperator = /*@__PURE__*/ (function () {
  64307. function ObserveOnOperator(scheduler, delay) {
  64308. if (delay === void 0) {
  64309. delay = 0;
  64310. }
  64311. this.scheduler = scheduler;
  64312. this.delay = delay;
  64313. }
  64314. ObserveOnOperator.prototype.call = function (subscriber, source) {
  64315. return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));
  64316. };
  64317. return ObserveOnOperator;
  64318. }());
  64319. var ObserveOnSubscriber = /*@__PURE__*/ (function (_super) {
  64320. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ObserveOnSubscriber, _super);
  64321. function ObserveOnSubscriber(destination, scheduler, delay) {
  64322. if (delay === void 0) {
  64323. delay = 0;
  64324. }
  64325. var _this = _super.call(this, destination) || this;
  64326. _this.scheduler = scheduler;
  64327. _this.delay = delay;
  64328. return _this;
  64329. }
  64330. ObserveOnSubscriber.dispatch = function (arg) {
  64331. var notification = arg.notification, destination = arg.destination;
  64332. notification.observe(destination);
  64333. this.unsubscribe();
  64334. };
  64335. ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {
  64336. var destination = this.destination;
  64337. destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));
  64338. };
  64339. ObserveOnSubscriber.prototype._next = function (value) {
  64340. this.scheduleMessage(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createNext(value));
  64341. };
  64342. ObserveOnSubscriber.prototype._error = function (err) {
  64343. this.scheduleMessage(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createError(err));
  64344. this.unsubscribe();
  64345. };
  64346. ObserveOnSubscriber.prototype._complete = function () {
  64347. this.scheduleMessage(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createComplete());
  64348. this.unsubscribe();
  64349. };
  64350. return ObserveOnSubscriber;
  64351. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  64352. var ObserveOnMessage = /*@__PURE__*/ (function () {
  64353. function ObserveOnMessage(notification, destination) {
  64354. this.notification = notification;
  64355. this.destination = destination;
  64356. }
  64357. return ObserveOnMessage;
  64358. }());
  64359. //# sourceMappingURL=observeOn.js.map
  64360. /***/ }),
  64361. /* 405 */
  64362. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64363. "use strict";
  64364. /* harmony export (immutable) */ __webpack_exports__["a"] = tap;
  64365. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  64366. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  64367. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_noop__ = __webpack_require__(182);
  64368. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isFunction__ = __webpack_require__(143);
  64369. /** PURE_IMPORTS_START tslib,_Subscriber,_util_noop,_util_isFunction PURE_IMPORTS_END */
  64370. function tap(nextOrObserver, error, complete) {
  64371. return function tapOperatorFunction(source) {
  64372. return source.lift(new DoOperator(nextOrObserver, error, complete));
  64373. };
  64374. }
  64375. var DoOperator = /*@__PURE__*/ (function () {
  64376. function DoOperator(nextOrObserver, error, complete) {
  64377. this.nextOrObserver = nextOrObserver;
  64378. this.error = error;
  64379. this.complete = complete;
  64380. }
  64381. DoOperator.prototype.call = function (subscriber, source) {
  64382. return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));
  64383. };
  64384. return DoOperator;
  64385. }());
  64386. var TapSubscriber = /*@__PURE__*/ (function (_super) {
  64387. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TapSubscriber, _super);
  64388. function TapSubscriber(destination, observerOrNext, error, complete) {
  64389. var _this = _super.call(this, destination) || this;
  64390. _this._tapNext = __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
  64391. _this._tapError = __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
  64392. _this._tapComplete = __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
  64393. _this._tapError = error || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
  64394. _this._tapComplete = complete || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
  64395. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isFunction__["a" /* isFunction */])(observerOrNext)) {
  64396. _this._context = _this;
  64397. _this._tapNext = observerOrNext;
  64398. }
  64399. else if (observerOrNext) {
  64400. _this._context = observerOrNext;
  64401. _this._tapNext = observerOrNext.next || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
  64402. _this._tapError = observerOrNext.error || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
  64403. _this._tapComplete = observerOrNext.complete || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
  64404. }
  64405. return _this;
  64406. }
  64407. TapSubscriber.prototype._next = function (value) {
  64408. try {
  64409. this._tapNext.call(this._context, value);
  64410. }
  64411. catch (err) {
  64412. this.destination.error(err);
  64413. return;
  64414. }
  64415. this.destination.next(value);
  64416. };
  64417. TapSubscriber.prototype._error = function (err) {
  64418. try {
  64419. this._tapError.call(this._context, err);
  64420. }
  64421. catch (err) {
  64422. this.destination.error(err);
  64423. return;
  64424. }
  64425. this.destination.error(err);
  64426. };
  64427. TapSubscriber.prototype._complete = function () {
  64428. try {
  64429. this._tapComplete.call(this._context);
  64430. }
  64431. catch (err) {
  64432. this.destination.error(err);
  64433. return;
  64434. }
  64435. return this.destination.complete();
  64436. };
  64437. return TapSubscriber;
  64438. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  64439. //# sourceMappingURL=tap.js.map
  64440. /***/ }),
  64441. /* 406 */
  64442. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64443. "use strict";
  64444. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return defaultThrottleConfig; });
  64445. /* harmony export (immutable) */ __webpack_exports__["a"] = throttle;
  64446. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  64447. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  64448. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
  64449. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  64450. var defaultThrottleConfig = {
  64451. leading: true,
  64452. trailing: false
  64453. };
  64454. function throttle(durationSelector, config) {
  64455. if (config === void 0) {
  64456. config = defaultThrottleConfig;
  64457. }
  64458. return function (source) { return source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing)); };
  64459. }
  64460. var ThrottleOperator = /*@__PURE__*/ (function () {
  64461. function ThrottleOperator(durationSelector, leading, trailing) {
  64462. this.durationSelector = durationSelector;
  64463. this.leading = leading;
  64464. this.trailing = trailing;
  64465. }
  64466. ThrottleOperator.prototype.call = function (subscriber, source) {
  64467. return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing));
  64468. };
  64469. return ThrottleOperator;
  64470. }());
  64471. var ThrottleSubscriber = /*@__PURE__*/ (function (_super) {
  64472. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ThrottleSubscriber, _super);
  64473. function ThrottleSubscriber(destination, durationSelector, _leading, _trailing) {
  64474. var _this = _super.call(this, destination) || this;
  64475. _this.destination = destination;
  64476. _this.durationSelector = durationSelector;
  64477. _this._leading = _leading;
  64478. _this._trailing = _trailing;
  64479. _this._hasValue = false;
  64480. return _this;
  64481. }
  64482. ThrottleSubscriber.prototype._next = function (value) {
  64483. this._hasValue = true;
  64484. this._sendValue = value;
  64485. if (!this._throttled) {
  64486. if (this._leading) {
  64487. this.send();
  64488. }
  64489. else {
  64490. this.throttle(value);
  64491. }
  64492. }
  64493. };
  64494. ThrottleSubscriber.prototype.send = function () {
  64495. var _a = this, _hasValue = _a._hasValue, _sendValue = _a._sendValue;
  64496. if (_hasValue) {
  64497. this.destination.next(_sendValue);
  64498. this.throttle(_sendValue);
  64499. }
  64500. this._hasValue = false;
  64501. this._sendValue = null;
  64502. };
  64503. ThrottleSubscriber.prototype.throttle = function (value) {
  64504. var duration = this.tryDurationSelector(value);
  64505. if (duration) {
  64506. this.add(this._throttled = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(this, duration));
  64507. }
  64508. };
  64509. ThrottleSubscriber.prototype.tryDurationSelector = function (value) {
  64510. try {
  64511. return this.durationSelector(value);
  64512. }
  64513. catch (err) {
  64514. this.destination.error(err);
  64515. return null;
  64516. }
  64517. };
  64518. ThrottleSubscriber.prototype.throttlingDone = function () {
  64519. var _a = this, _throttled = _a._throttled, _trailing = _a._trailing;
  64520. if (_throttled) {
  64521. _throttled.unsubscribe();
  64522. }
  64523. this._throttled = null;
  64524. if (_trailing) {
  64525. this.send();
  64526. }
  64527. };
  64528. ThrottleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  64529. this.throttlingDone();
  64530. };
  64531. ThrottleSubscriber.prototype.notifyComplete = function () {
  64532. this.throttlingDone();
  64533. };
  64534. return ThrottleSubscriber;
  64535. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  64536. //# sourceMappingURL=throttle.js.map
  64537. /***/ }),
  64538. /* 407 */
  64539. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64540. "use strict";
  64541. /* harmony export (immutable) */ __webpack_exports__["a"] = timeoutWith;
  64542. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  64543. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47);
  64544. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isDate__ = __webpack_require__(413);
  64545. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
  64546. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
  64547. /** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  64548. function timeoutWith(due, withObservable, scheduler) {
  64549. if (scheduler === void 0) {
  64550. scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
  64551. }
  64552. return function (source) {
  64553. var absoluteTimeout = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isDate__["a" /* isDate */])(due);
  64554. var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);
  64555. return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler));
  64556. };
  64557. }
  64558. var TimeoutWithOperator = /*@__PURE__*/ (function () {
  64559. function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) {
  64560. this.waitFor = waitFor;
  64561. this.absoluteTimeout = absoluteTimeout;
  64562. this.withObservable = withObservable;
  64563. this.scheduler = scheduler;
  64564. }
  64565. TimeoutWithOperator.prototype.call = function (subscriber, source) {
  64566. return source.subscribe(new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler));
  64567. };
  64568. return TimeoutWithOperator;
  64569. }());
  64570. var TimeoutWithSubscriber = /*@__PURE__*/ (function (_super) {
  64571. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TimeoutWithSubscriber, _super);
  64572. function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) {
  64573. var _this = _super.call(this, destination) || this;
  64574. _this.absoluteTimeout = absoluteTimeout;
  64575. _this.waitFor = waitFor;
  64576. _this.withObservable = withObservable;
  64577. _this.scheduler = scheduler;
  64578. _this.action = null;
  64579. _this.scheduleTimeout();
  64580. return _this;
  64581. }
  64582. TimeoutWithSubscriber.dispatchTimeout = function (subscriber) {
  64583. var withObservable = subscriber.withObservable;
  64584. subscriber._unsubscribeAndRecycle();
  64585. subscriber.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(subscriber, withObservable));
  64586. };
  64587. TimeoutWithSubscriber.prototype.scheduleTimeout = function () {
  64588. var action = this.action;
  64589. if (action) {
  64590. this.action = action.schedule(this, this.waitFor);
  64591. }
  64592. else {
  64593. this.add(this.action = this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this));
  64594. }
  64595. };
  64596. TimeoutWithSubscriber.prototype._next = function (value) {
  64597. if (!this.absoluteTimeout) {
  64598. this.scheduleTimeout();
  64599. }
  64600. _super.prototype._next.call(this, value);
  64601. };
  64602. TimeoutWithSubscriber.prototype._unsubscribe = function () {
  64603. this.action = null;
  64604. this.scheduler = null;
  64605. this.withObservable = null;
  64606. };
  64607. return TimeoutWithSubscriber;
  64608. }(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
  64609. //# sourceMappingURL=timeoutWith.js.map
  64610. /***/ }),
  64611. /* 408 */
  64612. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64613. "use strict";
  64614. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return asap; });
  64615. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AsapAction__ = __webpack_require__(994);
  64616. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsapScheduler__ = __webpack_require__(995);
  64617. /** PURE_IMPORTS_START _AsapAction,_AsapScheduler PURE_IMPORTS_END */
  64618. var asap = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__AsapScheduler__["a" /* AsapScheduler */](__WEBPACK_IMPORTED_MODULE_0__AsapAction__["a" /* AsapAction */]);
  64619. //# sourceMappingURL=asap.js.map
  64620. /***/ }),
  64621. /* 409 */
  64622. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64623. "use strict";
  64624. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return queue; });
  64625. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__QueueAction__ = __webpack_require__(996);
  64626. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__QueueScheduler__ = __webpack_require__(997);
  64627. /** PURE_IMPORTS_START _QueueAction,_QueueScheduler PURE_IMPORTS_END */
  64628. var queue = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__QueueScheduler__["a" /* QueueScheduler */](__WEBPACK_IMPORTED_MODULE_0__QueueAction__["a" /* QueueAction */]);
  64629. //# sourceMappingURL=queue.js.map
  64630. /***/ }),
  64631. /* 410 */
  64632. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64633. "use strict";
  64634. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TimeoutError; });
  64635. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  64636. function TimeoutErrorImpl() {
  64637. Error.call(this);
  64638. this.message = 'Timeout has occurred';
  64639. this.name = 'TimeoutError';
  64640. return this;
  64641. }
  64642. TimeoutErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
  64643. var TimeoutError = TimeoutErrorImpl;
  64644. //# sourceMappingURL=TimeoutError.js.map
  64645. /***/ }),
  64646. /* 411 */
  64647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64648. "use strict";
  64649. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UnsubscriptionError; });
  64650. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  64651. function UnsubscriptionErrorImpl(errors) {
  64652. Error.call(this);
  64653. this.message = errors ?
  64654. errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : '';
  64655. this.name = 'UnsubscriptionError';
  64656. this.errors = errors;
  64657. return this;
  64658. }
  64659. UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
  64660. var UnsubscriptionError = UnsubscriptionErrorImpl;
  64661. //# sourceMappingURL=UnsubscriptionError.js.map
  64662. /***/ }),
  64663. /* 412 */
  64664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64665. "use strict";
  64666. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isArrayLike; });
  64667. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  64668. var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });
  64669. //# sourceMappingURL=isArrayLike.js.map
  64670. /***/ }),
  64671. /* 413 */
  64672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64673. "use strict";
  64674. /* harmony export (immutable) */ __webpack_exports__["a"] = isDate;
  64675. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  64676. function isDate(value) {
  64677. return value instanceof Date && !isNaN(+value);
  64678. }
  64679. //# sourceMappingURL=isDate.js.map
  64680. /***/ }),
  64681. /* 414 */
  64682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64683. "use strict";
  64684. /* harmony export (immutable) */ __webpack_exports__["a"] = isObject;
  64685. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  64686. function isObject(x) {
  64687. return x != null && typeof x === 'object';
  64688. }
  64689. //# sourceMappingURL=isObject.js.map
  64690. /***/ }),
  64691. /* 415 */
  64692. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64693. "use strict";
  64694. /* harmony export (immutable) */ __webpack_exports__["a"] = isPromise;
  64695. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  64696. function isPromise(value) {
  64697. return value && typeof value.subscribe !== 'function' && typeof value.then === 'function';
  64698. }
  64699. //# sourceMappingURL=isPromise.js.map
  64700. /***/ }),
  64701. /* 416 */
  64702. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64703. "use strict";
  64704. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeTo; });
  64705. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  64706. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeToArray__ = __webpack_require__(417);
  64707. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__subscribeToPromise__ = __webpack_require__(420);
  64708. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__subscribeToIterable__ = __webpack_require__(418);
  64709. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__subscribeToObservable__ = __webpack_require__(419);
  64710. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isArrayLike__ = __webpack_require__(412);
  64711. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isPromise__ = __webpack_require__(415);
  64712. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isObject__ = __webpack_require__(414);
  64713. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__symbol_iterator__ = __webpack_require__(140);
  64714. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__symbol_observable__ = __webpack_require__(112);
  64715. /** PURE_IMPORTS_START _Observable,_subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */
  64716. var subscribeTo = function (result) {
  64717. if (result instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */]) {
  64718. return function (subscriber) {
  64719. if (result._isScalar) {
  64720. subscriber.next(result.value);
  64721. subscriber.complete();
  64722. return undefined;
  64723. }
  64724. else {
  64725. return result.subscribe(subscriber);
  64726. }
  64727. };
  64728. }
  64729. else if (result && typeof result[__WEBPACK_IMPORTED_MODULE_9__symbol_observable__["a" /* observable */]] === 'function') {
  64730. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__subscribeToObservable__["a" /* subscribeToObservable */])(result);
  64731. }
  64732. else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__isArrayLike__["a" /* isArrayLike */])(result)) {
  64733. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__subscribeToArray__["a" /* subscribeToArray */])(result);
  64734. }
  64735. else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__isPromise__["a" /* isPromise */])(result)) {
  64736. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__subscribeToPromise__["a" /* subscribeToPromise */])(result);
  64737. }
  64738. else if (result && typeof result[__WEBPACK_IMPORTED_MODULE_8__symbol_iterator__["a" /* iterator */]] === 'function') {
  64739. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__subscribeToIterable__["a" /* subscribeToIterable */])(result);
  64740. }
  64741. else {
  64742. var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__isObject__["a" /* isObject */])(result) ? 'an invalid object' : "'" + result + "'";
  64743. var msg = "You provided " + value + " where a stream was expected."
  64744. + ' You can provide an Observable, Promise, Array, or Iterable.';
  64745. throw new TypeError(msg);
  64746. }
  64747. };
  64748. //# sourceMappingURL=subscribeTo.js.map
  64749. /***/ }),
  64750. /* 417 */
  64751. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64752. "use strict";
  64753. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToArray; });
  64754. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  64755. var subscribeToArray = function (array) {
  64756. return function (subscriber) {
  64757. for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {
  64758. subscriber.next(array[i]);
  64759. }
  64760. if (!subscriber.closed) {
  64761. subscriber.complete();
  64762. }
  64763. };
  64764. };
  64765. //# sourceMappingURL=subscribeToArray.js.map
  64766. /***/ }),
  64767. /* 418 */
  64768. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64769. "use strict";
  64770. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToIterable; });
  64771. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_iterator__ = __webpack_require__(140);
  64772. /** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */
  64773. var subscribeToIterable = function (iterable) {
  64774. return function (subscriber) {
  64775. var iterator = iterable[__WEBPACK_IMPORTED_MODULE_0__symbol_iterator__["a" /* iterator */]]();
  64776. do {
  64777. var item = iterator.next();
  64778. if (item.done) {
  64779. subscriber.complete();
  64780. break;
  64781. }
  64782. subscriber.next(item.value);
  64783. if (subscriber.closed) {
  64784. break;
  64785. }
  64786. } while (true);
  64787. if (typeof iterator.return === 'function') {
  64788. subscriber.add(function () {
  64789. if (iterator.return) {
  64790. iterator.return();
  64791. }
  64792. });
  64793. }
  64794. return subscriber;
  64795. };
  64796. };
  64797. //# sourceMappingURL=subscribeToIterable.js.map
  64798. /***/ }),
  64799. /* 419 */
  64800. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64801. "use strict";
  64802. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToObservable; });
  64803. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_observable__ = __webpack_require__(112);
  64804. /** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */
  64805. var subscribeToObservable = function (obj) {
  64806. return function (subscriber) {
  64807. var obs = obj[__WEBPACK_IMPORTED_MODULE_0__symbol_observable__["a" /* observable */]]();
  64808. if (typeof obs.subscribe !== 'function') {
  64809. throw new TypeError('Provided object does not correctly implement Symbol.observable');
  64810. }
  64811. else {
  64812. return obs.subscribe(subscriber);
  64813. }
  64814. };
  64815. };
  64816. //# sourceMappingURL=subscribeToObservable.js.map
  64817. /***/ }),
  64818. /* 420 */
  64819. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64820. "use strict";
  64821. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToPromise; });
  64822. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__hostReportError__ = __webpack_require__(264);
  64823. /** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */
  64824. var subscribeToPromise = function (promise) {
  64825. return function (subscriber) {
  64826. promise.then(function (value) {
  64827. if (!subscriber.closed) {
  64828. subscriber.next(value);
  64829. subscriber.complete();
  64830. }
  64831. }, function (err) { return subscriber.error(err); })
  64832. .then(null, __WEBPACK_IMPORTED_MODULE_0__hostReportError__["a" /* hostReportError */]);
  64833. return subscriber;
  64834. };
  64835. };
  64836. //# sourceMappingURL=subscribeToPromise.js.map
  64837. /***/ }),
  64838. /* 421 */
  64839. /***/ (function(module, exports, __webpack_require__) {
  64840. // Note: since nyc uses this module to output coverage, any lines
  64841. // that are in the direct sync flow of nyc's outputCoverage are
  64842. // ignored, since we can never get coverage for them.
  64843. var assert = __webpack_require__(50)
  64844. var signals = __webpack_require__(1006)
  64845. var EE = __webpack_require__(95)
  64846. /* istanbul ignore if */
  64847. if (typeof EE !== 'function') {
  64848. EE = EE.EventEmitter
  64849. }
  64850. var emitter
  64851. if (process.__signal_exit_emitter__) {
  64852. emitter = process.__signal_exit_emitter__
  64853. } else {
  64854. emitter = process.__signal_exit_emitter__ = new EE()
  64855. emitter.count = 0
  64856. emitter.emitted = {}
  64857. }
  64858. // Because this emitter is a global, we have to check to see if a
  64859. // previous version of this library failed to enable infinite listeners.
  64860. // I know what you're about to say. But literally everything about
  64861. // signal-exit is a compromise with evil. Get used to it.
  64862. if (!emitter.infinite) {
  64863. emitter.setMaxListeners(Infinity)
  64864. emitter.infinite = true
  64865. }
  64866. module.exports = function (cb, opts) {
  64867. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  64868. if (loaded === false) {
  64869. load()
  64870. }
  64871. var ev = 'exit'
  64872. if (opts && opts.alwaysLast) {
  64873. ev = 'afterexit'
  64874. }
  64875. var remove = function () {
  64876. emitter.removeListener(ev, cb)
  64877. if (emitter.listeners('exit').length === 0 &&
  64878. emitter.listeners('afterexit').length === 0) {
  64879. unload()
  64880. }
  64881. }
  64882. emitter.on(ev, cb)
  64883. return remove
  64884. }
  64885. module.exports.unload = unload
  64886. function unload () {
  64887. if (!loaded) {
  64888. return
  64889. }
  64890. loaded = false
  64891. signals.forEach(function (sig) {
  64892. try {
  64893. process.removeListener(sig, sigListeners[sig])
  64894. } catch (er) {}
  64895. })
  64896. process.emit = originalProcessEmit
  64897. process.reallyExit = originalProcessReallyExit
  64898. emitter.count -= 1
  64899. }
  64900. function emit (event, code, signal) {
  64901. if (emitter.emitted[event]) {
  64902. return
  64903. }
  64904. emitter.emitted[event] = true
  64905. emitter.emit(event, code, signal)
  64906. }
  64907. // { <signal>: <listener fn>, ... }
  64908. var sigListeners = {}
  64909. signals.forEach(function (sig) {
  64910. sigListeners[sig] = function listener () {
  64911. // If there are no other listeners, an exit is coming!
  64912. // Simplest way: remove us and then re-send the signal.
  64913. // We know that this will kill the process, so we can
  64914. // safely emit now.
  64915. var listeners = process.listeners(sig)
  64916. if (listeners.length === emitter.count) {
  64917. unload()
  64918. emit('exit', null, sig)
  64919. /* istanbul ignore next */
  64920. emit('afterexit', null, sig)
  64921. /* istanbul ignore next */
  64922. process.kill(process.pid, sig)
  64923. }
  64924. }
  64925. })
  64926. module.exports.signals = function () {
  64927. return signals
  64928. }
  64929. module.exports.load = load
  64930. var loaded = false
  64931. function load () {
  64932. if (loaded) {
  64933. return
  64934. }
  64935. loaded = true
  64936. // This is the number of onSignalExit's that are in play.
  64937. // It's important so that we can count the correct number of
  64938. // listeners on signals, and don't wait for the other one to
  64939. // handle it instead of us.
  64940. emitter.count += 1
  64941. signals = signals.filter(function (sig) {
  64942. try {
  64943. process.on(sig, sigListeners[sig])
  64944. return true
  64945. } catch (er) {
  64946. return false
  64947. }
  64948. })
  64949. process.emit = processEmit
  64950. process.reallyExit = processReallyExit
  64951. }
  64952. var originalProcessReallyExit = process.reallyExit
  64953. function processReallyExit (code) {
  64954. process.exitCode = code || 0
  64955. emit('exit', process.exitCode, null)
  64956. /* istanbul ignore next */
  64957. emit('afterexit', process.exitCode, null)
  64958. /* istanbul ignore next */
  64959. originalProcessReallyExit.call(process, process.exitCode)
  64960. }
  64961. var originalProcessEmit = process.emit
  64962. function processEmit (ev, arg) {
  64963. if (ev === 'exit') {
  64964. if (arg !== undefined) {
  64965. process.exitCode = arg
  64966. }
  64967. var ret = originalProcessEmit.apply(this, arguments)
  64968. emit('exit', process.exitCode, null)
  64969. /* istanbul ignore next */
  64970. emit('afterexit', process.exitCode, null)
  64971. return ret
  64972. } else {
  64973. return originalProcessEmit.apply(this, arguments)
  64974. }
  64975. }
  64976. /***/ }),
  64977. /* 422 */
  64978. /***/ (function(module, exports, __webpack_require__) {
  64979. "use strict";
  64980. var scan = __webpack_require__(1011)
  64981. var parse = __webpack_require__(1010)
  64982. module.exports = function (source) {
  64983. return parse(scan(source))
  64984. }
  64985. /***/ }),
  64986. /* 423 */
  64987. /***/ (function(module, exports) {
  64988. module.exports = ["0BSD","AAL","Abstyles","Adobe-2006","Adobe-Glyph","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","Afmparse","AGPL-1.0","AGPL-3.0-only","AGPL-3.0-or-later","Aladdin","AMDPLPA","AML","AMPAS","ANTLR-PD","Apache-1.0","Apache-1.1","Apache-2.0","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","Artistic-1.0-cl8","Artistic-1.0-Perl","Artistic-1.0","Artistic-2.0","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Borceux","BSD-1-Clause","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","BSD-2-Clause-Patent","BSD-2-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-LBNL","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause","BSD-4-Clause-UC","BSD-4-Clause","BSD-Protection","BSD-Source-Code","BSL-1.0","bzip2-1.0.5","bzip2-1.0.6","Caldera","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-3.0","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-4.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDLA-Permissive-1.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","ClArtistic","CNRI-Jython","CNRI-Python-GPL-Compatible","CNRI-Python","Condor-1.1","CPAL-1.0","CPL-1.0","CPOL-1.02","Crossword","CrystalStacker","CUA-OPL-1.0","Cube","curl","D-FSL-1.0","diffmark","DOC","Dotseqn","DSDP","dvipdfm","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","eGenix","Entessa","EPL-1.0","EPL-2.0","ErlPL-1.1","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Eurosym","Fair","Frameworx-1.0","FreeImage","FSFAP","FSFUL","FSFULLR","FTL","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-only","GFDL-1.3-or-later","Giftware","GL2PS","Glide","Glulxe","gnuplot","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","gSOAP-1.3b","HaskellReport","HPND","IBM-pibs","ICU","IJG","ImageMagick","iMatix","Imlib2","Info-ZIP","Intel-ACPI","Intel","Interbase-1.0","IPA","IPL-1.0","ISC","JasPer-2.0","JSON","LAL-1.2","LAL-1.3","Latex2e","Leptonica","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","Libpng","libtiff","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","MakeIndex","MirOS","MIT-advertising","MIT-CMU","MIT-enna","MIT-feh","MIT","MITNFA","Motosoto","mpich2","MPL-1.0","MPL-1.1","MPL-2.0-no-copyleft-exception","MPL-2.0","MS-PL","MS-RL","MTLL","Multics","Mup","NASA-1.3","Naumen","NBPL-1.0","NCSA","Net-SNMP","NetCDF","Newsletr","NGPL","NLOD-1.0","NLPL","Nokia","NOSL","Noweb","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTP","OCCT-PL","OCLC-2.0","ODbL-1.0","OFL-1.0","OFL-1.1","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0.1","OLDAP-2.0","OLDAP-2.1","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OML","OpenSSL","OPL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","PDDL-1.0","PHP-3.0","PHP-3.01","Plexus","PostgreSQL","psfrag","psutils","Python-2.0","Qhull","QPL-1.0","Rdisc","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Ruby","SAX-PD","Saxpath","SCEA","Sendmail","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SimPL-2.0","SISSL-1.2","SISSL","Sleepycat","SMLNJ","SMPPL","SNIA","Spencer-86","Spencer-94","Spencer-99","SPL-1.0","SugarCRM-1.1.3","SWL","TCL","TCP-wrappers","TMate","TORQUE-1.1","TOSL","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","Unlicense","UPL-1.0","Vim","VOSTROM","VSL-1.0","W3C-19980720","W3C-20150513","W3C","Watcom-1.0","Wsuipa","WTFPL","X11","Xerox","XFree86-1.1","xinetd","Xnet","xpp","XSkat","YPL-1.0","YPL-1.1","Zed","Zend-2.0","Zimbra-1.3","Zimbra-1.4","zlib-acknowledgement","Zlib","ZPL-1.1","ZPL-2.0","ZPL-2.1"]
  64989. /***/ }),
  64990. /* 424 */
  64991. /***/ (function(module, exports, __webpack_require__) {
  64992. // Copyright 2015 Joyent, Inc.
  64993. module.exports = {
  64994. Verifier: Verifier,
  64995. Signer: Signer
  64996. };
  64997. var nacl;
  64998. var stream = __webpack_require__(36);
  64999. var util = __webpack_require__(9);
  65000. var assert = __webpack_require__(22);
  65001. var Buffer = __webpack_require__(20).Buffer;
  65002. var Signature = __webpack_require__(71);
  65003. function Verifier(key, hashAlgo) {
  65004. if (nacl === undefined)
  65005. nacl = __webpack_require__(72);
  65006. if (hashAlgo.toLowerCase() !== 'sha512')
  65007. throw (new Error('ED25519 only supports the use of ' +
  65008. 'SHA-512 hashes'));
  65009. this.key = key;
  65010. this.chunks = [];
  65011. stream.Writable.call(this, {});
  65012. }
  65013. util.inherits(Verifier, stream.Writable);
  65014. Verifier.prototype._write = function (chunk, enc, cb) {
  65015. this.chunks.push(chunk);
  65016. cb();
  65017. };
  65018. Verifier.prototype.update = function (chunk) {
  65019. if (typeof (chunk) === 'string')
  65020. chunk = Buffer.from(chunk, 'binary');
  65021. this.chunks.push(chunk);
  65022. };
  65023. Verifier.prototype.verify = function (signature, fmt) {
  65024. var sig;
  65025. if (Signature.isSignature(signature, [2, 0])) {
  65026. if (signature.type !== 'ed25519')
  65027. return (false);
  65028. sig = signature.toBuffer('raw');
  65029. } else if (typeof (signature) === 'string') {
  65030. sig = Buffer.from(signature, 'base64');
  65031. } else if (Signature.isSignature(signature, [1, 0])) {
  65032. throw (new Error('signature was created by too old ' +
  65033. 'a version of sshpk and cannot be verified'));
  65034. }
  65035. assert.buffer(sig);
  65036. return (nacl.sign.detached.verify(
  65037. new Uint8Array(Buffer.concat(this.chunks)),
  65038. new Uint8Array(sig),
  65039. new Uint8Array(this.key.part.A.data)));
  65040. };
  65041. function Signer(key, hashAlgo) {
  65042. if (nacl === undefined)
  65043. nacl = __webpack_require__(72);
  65044. if (hashAlgo.toLowerCase() !== 'sha512')
  65045. throw (new Error('ED25519 only supports the use of ' +
  65046. 'SHA-512 hashes'));
  65047. this.key = key;
  65048. this.chunks = [];
  65049. stream.Writable.call(this, {});
  65050. }
  65051. util.inherits(Signer, stream.Writable);
  65052. Signer.prototype._write = function (chunk, enc, cb) {
  65053. this.chunks.push(chunk);
  65054. cb();
  65055. };
  65056. Signer.prototype.update = function (chunk) {
  65057. if (typeof (chunk) === 'string')
  65058. chunk = Buffer.from(chunk, 'binary');
  65059. this.chunks.push(chunk);
  65060. };
  65061. Signer.prototype.sign = function () {
  65062. var sig = nacl.sign.detached(
  65063. new Uint8Array(Buffer.concat(this.chunks)),
  65064. new Uint8Array(Buffer.concat([
  65065. this.key.part.k.data, this.key.part.A.data])));
  65066. var sigBuf = Buffer.from(sig);
  65067. var sigObj = Signature.parse(sigBuf, 'ed25519', 'raw');
  65068. sigObj.hashAlgorithm = 'sha512';
  65069. return (sigObj);
  65070. };
  65071. /***/ }),
  65072. /* 425 */
  65073. /***/ (function(module, exports, __webpack_require__) {
  65074. // Copyright 2015 Joyent, Inc.
  65075. module.exports = {
  65076. read: read,
  65077. write: write
  65078. };
  65079. var assert = __webpack_require__(22);
  65080. var Buffer = __webpack_require__(20).Buffer;
  65081. var utils = __webpack_require__(32);
  65082. var Key = __webpack_require__(35);
  65083. var PrivateKey = __webpack_require__(40);
  65084. var pem = __webpack_require__(82);
  65085. var ssh = __webpack_require__(426);
  65086. var rfc4253 = __webpack_require__(92);
  65087. var dnssec = __webpack_require__(267);
  65088. var DNSSEC_PRIVKEY_HEADER_PREFIX = 'Private-key-format: v1';
  65089. function read(buf, options) {
  65090. if (typeof (buf) === 'string') {
  65091. if (buf.trim().match(/^[-]+[ ]*BEGIN/))
  65092. return (pem.read(buf, options));
  65093. if (buf.match(/^\s*ssh-[a-z]/))
  65094. return (ssh.read(buf, options));
  65095. if (buf.match(/^\s*ecdsa-/))
  65096. return (ssh.read(buf, options));
  65097. if (findDNSSECHeader(buf))
  65098. return (dnssec.read(buf, options));
  65099. buf = Buffer.from(buf, 'binary');
  65100. } else {
  65101. assert.buffer(buf);
  65102. if (findPEMHeader(buf))
  65103. return (pem.read(buf, options));
  65104. if (findSSHHeader(buf))
  65105. return (ssh.read(buf, options));
  65106. if (findDNSSECHeader(buf))
  65107. return (dnssec.read(buf, options));
  65108. }
  65109. if (buf.readUInt32BE(0) < buf.length)
  65110. return (rfc4253.read(buf, options));
  65111. throw (new Error('Failed to auto-detect format of key'));
  65112. }
  65113. function findSSHHeader(buf) {
  65114. var offset = 0;
  65115. while (offset < buf.length &&
  65116. (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9))
  65117. ++offset;
  65118. if (offset + 4 <= buf.length &&
  65119. buf.slice(offset, offset + 4).toString('ascii') === 'ssh-')
  65120. return (true);
  65121. if (offset + 6 <= buf.length &&
  65122. buf.slice(offset, offset + 6).toString('ascii') === 'ecdsa-')
  65123. return (true);
  65124. return (false);
  65125. }
  65126. function findPEMHeader(buf) {
  65127. var offset = 0;
  65128. while (offset < buf.length &&
  65129. (buf[offset] === 32 || buf[offset] === 10))
  65130. ++offset;
  65131. if (buf[offset] !== 45)
  65132. return (false);
  65133. while (offset < buf.length &&
  65134. (buf[offset] === 45))
  65135. ++offset;
  65136. while (offset < buf.length &&
  65137. (buf[offset] === 32))
  65138. ++offset;
  65139. if (offset + 5 > buf.length ||
  65140. buf.slice(offset, offset + 5).toString('ascii') !== 'BEGIN')
  65141. return (false);
  65142. return (true);
  65143. }
  65144. function findDNSSECHeader(buf) {
  65145. // private case first
  65146. if (buf.length <= DNSSEC_PRIVKEY_HEADER_PREFIX.length)
  65147. return (false);
  65148. var headerCheck = buf.slice(0, DNSSEC_PRIVKEY_HEADER_PREFIX.length);
  65149. if (headerCheck.toString('ascii') === DNSSEC_PRIVKEY_HEADER_PREFIX)
  65150. return (true);
  65151. // public-key RFC3110 ?
  65152. // 'domain.com. IN KEY ...' or 'domain.com. IN DNSKEY ...'
  65153. // skip any comment-lines
  65154. if (typeof (buf) !== 'string') {
  65155. buf = buf.toString('ascii');
  65156. }
  65157. var lines = buf.split('\n');
  65158. var line = 0;
  65159. /* JSSTYLED */
  65160. while (lines[line].match(/^\;/))
  65161. line++;
  65162. if (lines[line].toString('ascii').match(/\. IN KEY /))
  65163. return (true);
  65164. if (lines[line].toString('ascii').match(/\. IN DNSKEY /))
  65165. return (true);
  65166. return (false);
  65167. }
  65168. function write(key, options) {
  65169. throw (new Error('"auto" format cannot be used for writing'));
  65170. }
  65171. /***/ }),
  65172. /* 426 */
  65173. /***/ (function(module, exports, __webpack_require__) {
  65174. // Copyright 2015 Joyent, Inc.
  65175. module.exports = {
  65176. read: read,
  65177. write: write
  65178. };
  65179. var assert = __webpack_require__(22);
  65180. var Buffer = __webpack_require__(20).Buffer;
  65181. var rfc4253 = __webpack_require__(92);
  65182. var utils = __webpack_require__(32);
  65183. var Key = __webpack_require__(35);
  65184. var PrivateKey = __webpack_require__(40);
  65185. var sshpriv = __webpack_require__(183);
  65186. /*JSSTYLED*/
  65187. var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/;
  65188. /*JSSTYLED*/
  65189. var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/;
  65190. function read(buf, options) {
  65191. if (typeof (buf) !== 'string') {
  65192. assert.buffer(buf, 'buf');
  65193. buf = buf.toString('ascii');
  65194. }
  65195. var trimmed = buf.trim().replace(/[\\\r]/g, '');
  65196. var m = trimmed.match(SSHKEY_RE);
  65197. if (!m)
  65198. m = trimmed.match(SSHKEY_RE2);
  65199. assert.ok(m, 'key must match regex');
  65200. var type = rfc4253.algToKeyType(m[1]);
  65201. var kbuf = Buffer.from(m[2], 'base64');
  65202. /*
  65203. * This is a bit tricky. If we managed to parse the key and locate the
  65204. * key comment with the regex, then do a non-partial read and assert
  65205. * that we have consumed all bytes. If we couldn't locate the key
  65206. * comment, though, there may be whitespace shenanigans going on that
  65207. * have conjoined the comment to the rest of the key. We do a partial
  65208. * read in this case to try to make the best out of a sorry situation.
  65209. */
  65210. var key;
  65211. var ret = {};
  65212. if (m[4]) {
  65213. try {
  65214. key = rfc4253.read(kbuf);
  65215. } catch (e) {
  65216. m = trimmed.match(SSHKEY_RE2);
  65217. assert.ok(m, 'key must match regex');
  65218. kbuf = Buffer.from(m[2], 'base64');
  65219. key = rfc4253.readInternal(ret, 'public', kbuf);
  65220. }
  65221. } else {
  65222. key = rfc4253.readInternal(ret, 'public', kbuf);
  65223. }
  65224. assert.strictEqual(type, key.type);
  65225. if (m[4] && m[4].length > 0) {
  65226. key.comment = m[4];
  65227. } else if (ret.consumed) {
  65228. /*
  65229. * Now the magic: trying to recover the key comment when it's
  65230. * gotten conjoined to the key or otherwise shenanigan'd.
  65231. *
  65232. * Work out how much base64 we used, then drop all non-base64
  65233. * chars from the beginning up to this point in the the string.
  65234. * Then offset in this and try to make up for missing = chars.
  65235. */
  65236. var data = m[2] + (m[3] ? m[3] : '');
  65237. var realOffset = Math.ceil(ret.consumed / 3) * 4;
  65238. data = data.slice(0, realOffset - 2). /*JSSTYLED*/
  65239. replace(/[^a-zA-Z0-9+\/=]/g, '') +
  65240. data.slice(realOffset - 2);
  65241. var padding = ret.consumed % 3;
  65242. if (padding > 0 &&
  65243. data.slice(realOffset - 1, realOffset) !== '=')
  65244. realOffset--;
  65245. while (data.slice(realOffset, realOffset + 1) === '=')
  65246. realOffset++;
  65247. /* Finally, grab what we think is the comment & clean it up. */
  65248. var trailer = data.slice(realOffset);
  65249. trailer = trailer.replace(/[\r\n]/g, ' ').
  65250. replace(/^\s+/, '');
  65251. if (trailer.match(/^[a-zA-Z0-9]/))
  65252. key.comment = trailer;
  65253. }
  65254. return (key);
  65255. }
  65256. function write(key, options) {
  65257. assert.object(key);
  65258. if (!Key.isKey(key))
  65259. throw (new Error('Must be a public key'));
  65260. var parts = [];
  65261. var alg = rfc4253.keyTypeToAlg(key);
  65262. parts.push(alg);
  65263. var buf = rfc4253.write(key);
  65264. parts.push(buf.toString('base64'));
  65265. if (key.comment)
  65266. parts.push(key.comment);
  65267. return (Buffer.from(parts.join(' ')));
  65268. }
  65269. /***/ }),
  65270. /* 427 */
  65271. /***/ (function(module, exports, __webpack_require__) {
  65272. // Copyright 2017 Joyent, Inc.
  65273. module.exports = {
  65274. read: read,
  65275. verify: verify,
  65276. sign: sign,
  65277. signAsync: signAsync,
  65278. write: write
  65279. };
  65280. var assert = __webpack_require__(22);
  65281. var asn1 = __webpack_require__(67);
  65282. var Buffer = __webpack_require__(20).Buffer;
  65283. var algs = __webpack_require__(39);
  65284. var utils = __webpack_require__(32);
  65285. var Key = __webpack_require__(35);
  65286. var PrivateKey = __webpack_require__(40);
  65287. var pem = __webpack_require__(82);
  65288. var Identity = __webpack_require__(147);
  65289. var Signature = __webpack_require__(71);
  65290. var Certificate = __webpack_require__(144);
  65291. var pkcs8 = __webpack_require__(146);
  65292. /*
  65293. * This file is based on RFC5280 (X.509).
  65294. */
  65295. /* Helper to read in a single mpint */
  65296. function readMPInt(der, nm) {
  65297. assert.strictEqual(der.peek(), asn1.Ber.Integer,
  65298. nm + ' is not an Integer');
  65299. return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));
  65300. }
  65301. function verify(cert, key) {
  65302. var sig = cert.signatures.x509;
  65303. assert.object(sig, 'x509 signature');
  65304. var algParts = sig.algo.split('-');
  65305. if (algParts[0] !== key.type)
  65306. return (false);
  65307. var blob = sig.cache;
  65308. if (blob === undefined) {
  65309. var der = new asn1.BerWriter();
  65310. writeTBSCert(cert, der);
  65311. blob = der.buffer;
  65312. }
  65313. var verifier = key.createVerify(algParts[1]);
  65314. verifier.write(blob);
  65315. return (verifier.verify(sig.signature));
  65316. }
  65317. function Local(i) {
  65318. return (asn1.Ber.Context | asn1.Ber.Constructor | i);
  65319. }
  65320. function Context(i) {
  65321. return (asn1.Ber.Context | i);
  65322. }
  65323. var SIGN_ALGS = {
  65324. 'rsa-md5': '1.2.840.113549.1.1.4',
  65325. 'rsa-sha1': '1.2.840.113549.1.1.5',
  65326. 'rsa-sha256': '1.2.840.113549.1.1.11',
  65327. 'rsa-sha384': '1.2.840.113549.1.1.12',
  65328. 'rsa-sha512': '1.2.840.113549.1.1.13',
  65329. 'dsa-sha1': '1.2.840.10040.4.3',
  65330. 'dsa-sha256': '2.16.840.1.101.3.4.3.2',
  65331. 'ecdsa-sha1': '1.2.840.10045.4.1',
  65332. 'ecdsa-sha256': '1.2.840.10045.4.3.2',
  65333. 'ecdsa-sha384': '1.2.840.10045.4.3.3',
  65334. 'ecdsa-sha512': '1.2.840.10045.4.3.4',
  65335. 'ed25519-sha512': '1.3.101.112'
  65336. };
  65337. Object.keys(SIGN_ALGS).forEach(function (k) {
  65338. SIGN_ALGS[SIGN_ALGS[k]] = k;
  65339. });
  65340. SIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5';
  65341. SIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1';
  65342. var EXTS = {
  65343. 'issuerKeyId': '2.5.29.35',
  65344. 'altName': '2.5.29.17',
  65345. 'basicConstraints': '2.5.29.19',
  65346. 'keyUsage': '2.5.29.15',
  65347. 'extKeyUsage': '2.5.29.37'
  65348. };
  65349. function read(buf, options) {
  65350. if (typeof (buf) === 'string') {
  65351. buf = Buffer.from(buf, 'binary');
  65352. }
  65353. assert.buffer(buf, 'buf');
  65354. var der = new asn1.BerReader(buf);
  65355. der.readSequence();
  65356. if (Math.abs(der.length - der.remain) > 1) {
  65357. throw (new Error('DER sequence does not contain whole byte ' +
  65358. 'stream'));
  65359. }
  65360. var tbsStart = der.offset;
  65361. der.readSequence();
  65362. var sigOffset = der.offset + der.length;
  65363. var tbsEnd = sigOffset;
  65364. if (der.peek() === Local(0)) {
  65365. der.readSequence(Local(0));
  65366. var version = der.readInt();
  65367. assert.ok(version <= 3,
  65368. 'only x.509 versions up to v3 supported');
  65369. }
  65370. var cert = {};
  65371. cert.signatures = {};
  65372. var sig = (cert.signatures.x509 = {});
  65373. sig.extras = {};
  65374. cert.serial = readMPInt(der, 'serial');
  65375. der.readSequence();
  65376. var after = der.offset + der.length;
  65377. var certAlgOid = der.readOID();
  65378. var certAlg = SIGN_ALGS[certAlgOid];
  65379. if (certAlg === undefined)
  65380. throw (new Error('unknown signature algorithm ' + certAlgOid));
  65381. der._offset = after;
  65382. cert.issuer = Identity.parseAsn1(der);
  65383. der.readSequence();
  65384. cert.validFrom = readDate(der);
  65385. cert.validUntil = readDate(der);
  65386. cert.subjects = [Identity.parseAsn1(der)];
  65387. der.readSequence();
  65388. after = der.offset + der.length;
  65389. cert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der);
  65390. der._offset = after;
  65391. /* issuerUniqueID */
  65392. if (der.peek() === Local(1)) {
  65393. der.readSequence(Local(1));
  65394. sig.extras.issuerUniqueID =
  65395. buf.slice(der.offset, der.offset + der.length);
  65396. der._offset += der.length;
  65397. }
  65398. /* subjectUniqueID */
  65399. if (der.peek() === Local(2)) {
  65400. der.readSequence(Local(2));
  65401. sig.extras.subjectUniqueID =
  65402. buf.slice(der.offset, der.offset + der.length);
  65403. der._offset += der.length;
  65404. }
  65405. /* extensions */
  65406. if (der.peek() === Local(3)) {
  65407. der.readSequence(Local(3));
  65408. var extEnd = der.offset + der.length;
  65409. der.readSequence();
  65410. while (der.offset < extEnd)
  65411. readExtension(cert, buf, der);
  65412. assert.strictEqual(der.offset, extEnd);
  65413. }
  65414. assert.strictEqual(der.offset, sigOffset);
  65415. der.readSequence();
  65416. after = der.offset + der.length;
  65417. var sigAlgOid = der.readOID();
  65418. var sigAlg = SIGN_ALGS[sigAlgOid];
  65419. if (sigAlg === undefined)
  65420. throw (new Error('unknown signature algorithm ' + sigAlgOid));
  65421. der._offset = after;
  65422. var sigData = der.readString(asn1.Ber.BitString, true);
  65423. if (sigData[0] === 0)
  65424. sigData = sigData.slice(1);
  65425. var algParts = sigAlg.split('-');
  65426. sig.signature = Signature.parse(sigData, algParts[0], 'asn1');
  65427. sig.signature.hashAlgorithm = algParts[1];
  65428. sig.algo = sigAlg;
  65429. sig.cache = buf.slice(tbsStart, tbsEnd);
  65430. return (new Certificate(cert));
  65431. }
  65432. function readDate(der) {
  65433. if (der.peek() === asn1.Ber.UTCTime) {
  65434. return (utcTimeToDate(der.readString(asn1.Ber.UTCTime)));
  65435. } else if (der.peek() === asn1.Ber.GeneralizedTime) {
  65436. return (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime)));
  65437. } else {
  65438. throw (new Error('Unsupported date format'));
  65439. }
  65440. }
  65441. /* RFC5280, section 4.2.1.6 (GeneralName type) */
  65442. var ALTNAME = {
  65443. OtherName: Local(0),
  65444. RFC822Name: Context(1),
  65445. DNSName: Context(2),
  65446. X400Address: Local(3),
  65447. DirectoryName: Local(4),
  65448. EDIPartyName: Local(5),
  65449. URI: Context(6),
  65450. IPAddress: Context(7),
  65451. OID: Context(8)
  65452. };
  65453. /* RFC5280, section 4.2.1.12 (KeyPurposeId) */
  65454. var EXTPURPOSE = {
  65455. 'serverAuth': '1.3.6.1.5.5.7.3.1',
  65456. 'clientAuth': '1.3.6.1.5.5.7.3.2',
  65457. 'codeSigning': '1.3.6.1.5.5.7.3.3',
  65458. /* See https://github.com/joyent/oid-docs/blob/master/root.md */
  65459. 'joyentDocker': '1.3.6.1.4.1.38678.1.4.1',
  65460. 'joyentCmon': '1.3.6.1.4.1.38678.1.4.2'
  65461. };
  65462. var EXTPURPOSE_REV = {};
  65463. Object.keys(EXTPURPOSE).forEach(function (k) {
  65464. EXTPURPOSE_REV[EXTPURPOSE[k]] = k;
  65465. });
  65466. var KEYUSEBITS = [
  65467. 'signature', 'identity', 'keyEncryption',
  65468. 'encryption', 'keyAgreement', 'ca', 'crl'
  65469. ];
  65470. function readExtension(cert, buf, der) {
  65471. der.readSequence();
  65472. var after = der.offset + der.length;
  65473. var extId = der.readOID();
  65474. var id;
  65475. var sig = cert.signatures.x509;
  65476. sig.extras.exts = [];
  65477. var critical;
  65478. if (der.peek() === asn1.Ber.Boolean)
  65479. critical = der.readBoolean();
  65480. switch (extId) {
  65481. case (EXTS.basicConstraints):
  65482. der.readSequence(asn1.Ber.OctetString);
  65483. der.readSequence();
  65484. var bcEnd = der.offset + der.length;
  65485. var ca = false;
  65486. if (der.peek() === asn1.Ber.Boolean)
  65487. ca = der.readBoolean();
  65488. if (cert.purposes === undefined)
  65489. cert.purposes = [];
  65490. if (ca === true)
  65491. cert.purposes.push('ca');
  65492. var bc = { oid: extId, critical: critical };
  65493. if (der.offset < bcEnd && der.peek() === asn1.Ber.Integer)
  65494. bc.pathLen = der.readInt();
  65495. sig.extras.exts.push(bc);
  65496. break;
  65497. case (EXTS.extKeyUsage):
  65498. der.readSequence(asn1.Ber.OctetString);
  65499. der.readSequence();
  65500. if (cert.purposes === undefined)
  65501. cert.purposes = [];
  65502. var ekEnd = der.offset + der.length;
  65503. while (der.offset < ekEnd) {
  65504. var oid = der.readOID();
  65505. cert.purposes.push(EXTPURPOSE_REV[oid] || oid);
  65506. }
  65507. /*
  65508. * This is a bit of a hack: in the case where we have a cert
  65509. * that's only allowed to do serverAuth or clientAuth (and not
  65510. * the other), we want to make sure all our Subjects are of
  65511. * the right type. But we already parsed our Subjects and
  65512. * decided if they were hosts or users earlier (since it appears
  65513. * first in the cert).
  65514. *
  65515. * So we go through and mutate them into the right kind here if
  65516. * it doesn't match. This might not be hugely beneficial, as it
  65517. * seems that single-purpose certs are not often seen in the
  65518. * wild.
  65519. */
  65520. if (cert.purposes.indexOf('serverAuth') !== -1 &&
  65521. cert.purposes.indexOf('clientAuth') === -1) {
  65522. cert.subjects.forEach(function (ide) {
  65523. if (ide.type !== 'host') {
  65524. ide.type = 'host';
  65525. ide.hostname = ide.uid ||
  65526. ide.email ||
  65527. ide.components[0].value;
  65528. }
  65529. });
  65530. } else if (cert.purposes.indexOf('clientAuth') !== -1 &&
  65531. cert.purposes.indexOf('serverAuth') === -1) {
  65532. cert.subjects.forEach(function (ide) {
  65533. if (ide.type !== 'user') {
  65534. ide.type = 'user';
  65535. ide.uid = ide.hostname ||
  65536. ide.email ||
  65537. ide.components[0].value;
  65538. }
  65539. });
  65540. }
  65541. sig.extras.exts.push({ oid: extId, critical: critical });
  65542. break;
  65543. case (EXTS.keyUsage):
  65544. der.readSequence(asn1.Ber.OctetString);
  65545. var bits = der.readString(asn1.Ber.BitString, true);
  65546. var setBits = readBitField(bits, KEYUSEBITS);
  65547. setBits.forEach(function (bit) {
  65548. if (cert.purposes === undefined)
  65549. cert.purposes = [];
  65550. if (cert.purposes.indexOf(bit) === -1)
  65551. cert.purposes.push(bit);
  65552. });
  65553. sig.extras.exts.push({ oid: extId, critical: critical,
  65554. bits: bits });
  65555. break;
  65556. case (EXTS.altName):
  65557. der.readSequence(asn1.Ber.OctetString);
  65558. der.readSequence();
  65559. var aeEnd = der.offset + der.length;
  65560. while (der.offset < aeEnd) {
  65561. switch (der.peek()) {
  65562. case ALTNAME.OtherName:
  65563. case ALTNAME.EDIPartyName:
  65564. der.readSequence();
  65565. der._offset += der.length;
  65566. break;
  65567. case ALTNAME.OID:
  65568. der.readOID(ALTNAME.OID);
  65569. break;
  65570. case ALTNAME.RFC822Name:
  65571. /* RFC822 specifies email addresses */
  65572. var email = der.readString(ALTNAME.RFC822Name);
  65573. id = Identity.forEmail(email);
  65574. if (!cert.subjects[0].equals(id))
  65575. cert.subjects.push(id);
  65576. break;
  65577. case ALTNAME.DirectoryName:
  65578. der.readSequence(ALTNAME.DirectoryName);
  65579. id = Identity.parseAsn1(der);
  65580. if (!cert.subjects[0].equals(id))
  65581. cert.subjects.push(id);
  65582. break;
  65583. case ALTNAME.DNSName:
  65584. var host = der.readString(
  65585. ALTNAME.DNSName);
  65586. id = Identity.forHost(host);
  65587. if (!cert.subjects[0].equals(id))
  65588. cert.subjects.push(id);
  65589. break;
  65590. default:
  65591. der.readString(der.peek());
  65592. break;
  65593. }
  65594. }
  65595. sig.extras.exts.push({ oid: extId, critical: critical });
  65596. break;
  65597. default:
  65598. sig.extras.exts.push({
  65599. oid: extId,
  65600. critical: critical,
  65601. data: der.readString(asn1.Ber.OctetString, true)
  65602. });
  65603. break;
  65604. }
  65605. der._offset = after;
  65606. }
  65607. var UTCTIME_RE =
  65608. /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;
  65609. function utcTimeToDate(t) {
  65610. var m = t.match(UTCTIME_RE);
  65611. assert.ok(m, 'timestamps must be in UTC');
  65612. var d = new Date();
  65613. var thisYear = d.getUTCFullYear();
  65614. var century = Math.floor(thisYear / 100) * 100;
  65615. var year = parseInt(m[1], 10);
  65616. if (thisYear % 100 < 50 && year >= 60)
  65617. year += (century - 1);
  65618. else
  65619. year += century;
  65620. d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10));
  65621. d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));
  65622. if (m[6] && m[6].length > 0)
  65623. d.setUTCSeconds(parseInt(m[6], 10));
  65624. return (d);
  65625. }
  65626. var GTIME_RE =
  65627. /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;
  65628. function gTimeToDate(t) {
  65629. var m = t.match(GTIME_RE);
  65630. assert.ok(m);
  65631. var d = new Date();
  65632. d.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1,
  65633. parseInt(m[3], 10));
  65634. d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));
  65635. if (m[6] && m[6].length > 0)
  65636. d.setUTCSeconds(parseInt(m[6], 10));
  65637. return (d);
  65638. }
  65639. function zeroPad(n) {
  65640. var s = '' + n;
  65641. while (s.length < 2)
  65642. s = '0' + s;
  65643. return (s);
  65644. }
  65645. function dateToUTCTime(d) {
  65646. var s = '';
  65647. s += zeroPad(d.getUTCFullYear() % 100);
  65648. s += zeroPad(d.getUTCMonth() + 1);
  65649. s += zeroPad(d.getUTCDate());
  65650. s += zeroPad(d.getUTCHours());
  65651. s += zeroPad(d.getUTCMinutes());
  65652. s += zeroPad(d.getUTCSeconds());
  65653. s += 'Z';
  65654. return (s);
  65655. }
  65656. function sign(cert, key) {
  65657. if (cert.signatures.x509 === undefined)
  65658. cert.signatures.x509 = {};
  65659. var sig = cert.signatures.x509;
  65660. sig.algo = key.type + '-' + key.defaultHashAlgorithm();
  65661. if (SIGN_ALGS[sig.algo] === undefined)
  65662. return (false);
  65663. var der = new asn1.BerWriter();
  65664. writeTBSCert(cert, der);
  65665. var blob = der.buffer;
  65666. sig.cache = blob;
  65667. var signer = key.createSign();
  65668. signer.write(blob);
  65669. cert.signatures.x509.signature = signer.sign();
  65670. return (true);
  65671. }
  65672. function signAsync(cert, signer, done) {
  65673. if (cert.signatures.x509 === undefined)
  65674. cert.signatures.x509 = {};
  65675. var sig = cert.signatures.x509;
  65676. var der = new asn1.BerWriter();
  65677. writeTBSCert(cert, der);
  65678. var blob = der.buffer;
  65679. sig.cache = blob;
  65680. signer(blob, function (err, signature) {
  65681. if (err) {
  65682. done(err);
  65683. return;
  65684. }
  65685. sig.algo = signature.type + '-' + signature.hashAlgorithm;
  65686. if (SIGN_ALGS[sig.algo] === undefined) {
  65687. done(new Error('Invalid signing algorithm "' +
  65688. sig.algo + '"'));
  65689. return;
  65690. }
  65691. sig.signature = signature;
  65692. done();
  65693. });
  65694. }
  65695. function write(cert, options) {
  65696. var sig = cert.signatures.x509;
  65697. assert.object(sig, 'x509 signature');
  65698. var der = new asn1.BerWriter();
  65699. der.startSequence();
  65700. if (sig.cache) {
  65701. der._ensure(sig.cache.length);
  65702. sig.cache.copy(der._buf, der._offset);
  65703. der._offset += sig.cache.length;
  65704. } else {
  65705. writeTBSCert(cert, der);
  65706. }
  65707. der.startSequence();
  65708. der.writeOID(SIGN_ALGS[sig.algo]);
  65709. if (sig.algo.match(/^rsa-/))
  65710. der.writeNull();
  65711. der.endSequence();
  65712. var sigData = sig.signature.toBuffer('asn1');
  65713. var data = Buffer.alloc(sigData.length + 1);
  65714. data[0] = 0;
  65715. sigData.copy(data, 1);
  65716. der.writeBuffer(data, asn1.Ber.BitString);
  65717. der.endSequence();
  65718. return (der.buffer);
  65719. }
  65720. function writeTBSCert(cert, der) {
  65721. var sig = cert.signatures.x509;
  65722. assert.object(sig, 'x509 signature');
  65723. der.startSequence();
  65724. der.startSequence(Local(0));
  65725. der.writeInt(2);
  65726. der.endSequence();
  65727. der.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer);
  65728. der.startSequence();
  65729. der.writeOID(SIGN_ALGS[sig.algo]);
  65730. if (sig.algo.match(/^rsa-/))
  65731. der.writeNull();
  65732. der.endSequence();
  65733. cert.issuer.toAsn1(der);
  65734. der.startSequence();
  65735. der.writeString(dateToUTCTime(cert.validFrom), asn1.Ber.UTCTime);
  65736. der.writeString(dateToUTCTime(cert.validUntil), asn1.Ber.UTCTime);
  65737. der.endSequence();
  65738. var subject = cert.subjects[0];
  65739. var altNames = cert.subjects.slice(1);
  65740. subject.toAsn1(der);
  65741. pkcs8.writePkcs8(der, cert.subjectKey);
  65742. if (sig.extras && sig.extras.issuerUniqueID) {
  65743. der.writeBuffer(sig.extras.issuerUniqueID, Local(1));
  65744. }
  65745. if (sig.extras && sig.extras.subjectUniqueID) {
  65746. der.writeBuffer(sig.extras.subjectUniqueID, Local(2));
  65747. }
  65748. if (altNames.length > 0 || subject.type === 'host' ||
  65749. (cert.purposes !== undefined && cert.purposes.length > 0) ||
  65750. (sig.extras && sig.extras.exts)) {
  65751. der.startSequence(Local(3));
  65752. der.startSequence();
  65753. var exts = [];
  65754. if (cert.purposes !== undefined && cert.purposes.length > 0) {
  65755. exts.push({
  65756. oid: EXTS.basicConstraints,
  65757. critical: true
  65758. });
  65759. exts.push({
  65760. oid: EXTS.keyUsage,
  65761. critical: true
  65762. });
  65763. exts.push({
  65764. oid: EXTS.extKeyUsage,
  65765. critical: true
  65766. });
  65767. }
  65768. exts.push({ oid: EXTS.altName });
  65769. if (sig.extras && sig.extras.exts)
  65770. exts = sig.extras.exts;
  65771. for (var i = 0; i < exts.length; ++i) {
  65772. der.startSequence();
  65773. der.writeOID(exts[i].oid);
  65774. if (exts[i].critical !== undefined)
  65775. der.writeBoolean(exts[i].critical);
  65776. if (exts[i].oid === EXTS.altName) {
  65777. der.startSequence(asn1.Ber.OctetString);
  65778. der.startSequence();
  65779. if (subject.type === 'host') {
  65780. der.writeString(subject.hostname,
  65781. Context(2));
  65782. }
  65783. for (var j = 0; j < altNames.length; ++j) {
  65784. if (altNames[j].type === 'host') {
  65785. der.writeString(
  65786. altNames[j].hostname,
  65787. ALTNAME.DNSName);
  65788. } else if (altNames[j].type ===
  65789. 'email') {
  65790. der.writeString(
  65791. altNames[j].email,
  65792. ALTNAME.RFC822Name);
  65793. } else {
  65794. /*
  65795. * Encode anything else as a
  65796. * DN style name for now.
  65797. */
  65798. der.startSequence(
  65799. ALTNAME.DirectoryName);
  65800. altNames[j].toAsn1(der);
  65801. der.endSequence();
  65802. }
  65803. }
  65804. der.endSequence();
  65805. der.endSequence();
  65806. } else if (exts[i].oid === EXTS.basicConstraints) {
  65807. der.startSequence(asn1.Ber.OctetString);
  65808. der.startSequence();
  65809. var ca = (cert.purposes.indexOf('ca') !== -1);
  65810. var pathLen = exts[i].pathLen;
  65811. der.writeBoolean(ca);
  65812. if (pathLen !== undefined)
  65813. der.writeInt(pathLen);
  65814. der.endSequence();
  65815. der.endSequence();
  65816. } else if (exts[i].oid === EXTS.extKeyUsage) {
  65817. der.startSequence(asn1.Ber.OctetString);
  65818. der.startSequence();
  65819. cert.purposes.forEach(function (purpose) {
  65820. if (purpose === 'ca')
  65821. return;
  65822. if (KEYUSEBITS.indexOf(purpose) !== -1)
  65823. return;
  65824. var oid = purpose;
  65825. if (EXTPURPOSE[purpose] !== undefined)
  65826. oid = EXTPURPOSE[purpose];
  65827. der.writeOID(oid);
  65828. });
  65829. der.endSequence();
  65830. der.endSequence();
  65831. } else if (exts[i].oid === EXTS.keyUsage) {
  65832. der.startSequence(asn1.Ber.OctetString);
  65833. /*
  65834. * If we parsed this certificate from a byte
  65835. * stream (i.e. we didn't generate it in sshpk)
  65836. * then we'll have a ".bits" property on the
  65837. * ext with the original raw byte contents.
  65838. *
  65839. * If we have this, use it here instead of
  65840. * regenerating it. This guarantees we output
  65841. * the same data we parsed, so signatures still
  65842. * validate.
  65843. */
  65844. if (exts[i].bits !== undefined) {
  65845. der.writeBuffer(exts[i].bits,
  65846. asn1.Ber.BitString);
  65847. } else {
  65848. var bits = writeBitField(cert.purposes,
  65849. KEYUSEBITS);
  65850. der.writeBuffer(bits,
  65851. asn1.Ber.BitString);
  65852. }
  65853. der.endSequence();
  65854. } else {
  65855. der.writeBuffer(exts[i].data,
  65856. asn1.Ber.OctetString);
  65857. }
  65858. der.endSequence();
  65859. }
  65860. der.endSequence();
  65861. der.endSequence();
  65862. }
  65863. der.endSequence();
  65864. }
  65865. /*
  65866. * Reads an ASN.1 BER bitfield out of the Buffer produced by doing
  65867. * `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw
  65868. * contents of the BitString tag, which is a count of unused bits followed by
  65869. * the bits as a right-padded byte string.
  65870. *
  65871. * `bits` is the Buffer, `bitIndex` should contain an array of string names
  65872. * for the bits in the string, ordered starting with bit #0 in the ASN.1 spec.
  65873. *
  65874. * Returns an array of Strings, the names of the bits that were set to 1.
  65875. */
  65876. function readBitField(bits, bitIndex) {
  65877. var bitLen = 8 * (bits.length - 1) - bits[0];
  65878. var setBits = {};
  65879. for (var i = 0; i < bitLen; ++i) {
  65880. var byteN = 1 + Math.floor(i / 8);
  65881. var bit = 7 - (i % 8);
  65882. var mask = 1 << bit;
  65883. var bitVal = ((bits[byteN] & mask) !== 0);
  65884. var name = bitIndex[i];
  65885. if (bitVal && typeof (name) === 'string') {
  65886. setBits[name] = true;
  65887. }
  65888. }
  65889. return (Object.keys(setBits));
  65890. }
  65891. /*
  65892. * `setBits` is an array of strings, containing the names for each bit that
  65893. * sould be set to 1. `bitIndex` is same as in `readBitField()`.
  65894. *
  65895. * Returns a Buffer, ready to be written out with `BerWriter#writeString()`.
  65896. */
  65897. function writeBitField(setBits, bitIndex) {
  65898. var bitLen = bitIndex.length;
  65899. var blen = Math.ceil(bitLen / 8);
  65900. var unused = blen * 8 - bitLen;
  65901. var bits = Buffer.alloc(1 + blen); // zero-filled
  65902. bits[0] = unused;
  65903. for (var i = 0; i < bitLen; ++i) {
  65904. var byteN = 1 + Math.floor(i / 8);
  65905. var bit = 7 - (i % 8);
  65906. var mask = 1 << bit;
  65907. var name = bitIndex[i];
  65908. if (name === undefined)
  65909. continue;
  65910. var bitVal = (setBits.indexOf(name) !== -1);
  65911. if (bitVal) {
  65912. bits[byteN] |= mask;
  65913. }
  65914. }
  65915. return (bits);
  65916. }
  65917. /***/ }),
  65918. /* 428 */
  65919. /***/ (function(module, exports, __webpack_require__) {
  65920. "use strict";
  65921. // Copyright Joyent, Inc. and other Node contributors.
  65922. //
  65923. // Permission is hereby granted, free of charge, to any person obtaining a
  65924. // copy of this software and associated documentation files (the
  65925. // "Software"), to deal in the Software without restriction, including
  65926. // without limitation the rights to use, copy, modify, merge, publish,
  65927. // distribute, sublicense, and/or sell copies of the Software, and to permit
  65928. // persons to whom the Software is furnished to do so, subject to the
  65929. // following conditions:
  65930. //
  65931. // The above copyright notice and this permission notice shall be included
  65932. // in all copies or substantial portions of the Software.
  65933. //
  65934. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  65935. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  65936. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  65937. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  65938. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  65939. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  65940. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  65941. /*<replacement>*/
  65942. var Buffer = __webpack_require__(60).Buffer;
  65943. /*</replacement>*/
  65944. var isEncoding = Buffer.isEncoding || function (encoding) {
  65945. encoding = '' + encoding;
  65946. switch (encoding && encoding.toLowerCase()) {
  65947. case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
  65948. return true;
  65949. default:
  65950. return false;
  65951. }
  65952. };
  65953. function _normalizeEncoding(enc) {
  65954. if (!enc) return 'utf8';
  65955. var retried;
  65956. while (true) {
  65957. switch (enc) {
  65958. case 'utf8':
  65959. case 'utf-8':
  65960. return 'utf8';
  65961. case 'ucs2':
  65962. case 'ucs-2':
  65963. case 'utf16le':
  65964. case 'utf-16le':
  65965. return 'utf16le';
  65966. case 'latin1':
  65967. case 'binary':
  65968. return 'latin1';
  65969. case 'base64':
  65970. case 'ascii':
  65971. case 'hex':
  65972. return enc;
  65973. default:
  65974. if (retried) return; // undefined
  65975. enc = ('' + enc).toLowerCase();
  65976. retried = true;
  65977. }
  65978. }
  65979. };
  65980. // Do not cache `Buffer.isEncoding` when checking encoding names as some
  65981. // modules monkey-patch it to support additional encodings
  65982. function normalizeEncoding(enc) {
  65983. var nenc = _normalizeEncoding(enc);
  65984. if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
  65985. return nenc || enc;
  65986. }
  65987. // StringDecoder provides an interface for efficiently splitting a series of
  65988. // buffers into a series of JS strings without breaking apart multi-byte
  65989. // characters.
  65990. exports.StringDecoder = StringDecoder;
  65991. function StringDecoder(encoding) {
  65992. this.encoding = normalizeEncoding(encoding);
  65993. var nb;
  65994. switch (this.encoding) {
  65995. case 'utf16le':
  65996. this.text = utf16Text;
  65997. this.end = utf16End;
  65998. nb = 4;
  65999. break;
  66000. case 'utf8':
  66001. this.fillLast = utf8FillLast;
  66002. nb = 4;
  66003. break;
  66004. case 'base64':
  66005. this.text = base64Text;
  66006. this.end = base64End;
  66007. nb = 3;
  66008. break;
  66009. default:
  66010. this.write = simpleWrite;
  66011. this.end = simpleEnd;
  66012. return;
  66013. }
  66014. this.lastNeed = 0;
  66015. this.lastTotal = 0;
  66016. this.lastChar = Buffer.allocUnsafe(nb);
  66017. }
  66018. StringDecoder.prototype.write = function (buf) {
  66019. if (buf.length === 0) return '';
  66020. var r;
  66021. var i;
  66022. if (this.lastNeed) {
  66023. r = this.fillLast(buf);
  66024. if (r === undefined) return '';
  66025. i = this.lastNeed;
  66026. this.lastNeed = 0;
  66027. } else {
  66028. i = 0;
  66029. }
  66030. if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
  66031. return r || '';
  66032. };
  66033. StringDecoder.prototype.end = utf8End;
  66034. // Returns only complete characters in a Buffer
  66035. StringDecoder.prototype.text = utf8Text;
  66036. // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
  66037. StringDecoder.prototype.fillLast = function (buf) {
  66038. if (this.lastNeed <= buf.length) {
  66039. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
  66040. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  66041. }
  66042. buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
  66043. this.lastNeed -= buf.length;
  66044. };
  66045. // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
  66046. // continuation byte. If an invalid byte is detected, -2 is returned.
  66047. function utf8CheckByte(byte) {
  66048. if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
  66049. return byte >> 6 === 0x02 ? -1 : -2;
  66050. }
  66051. // Checks at most 3 bytes at the end of a Buffer in order to detect an
  66052. // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
  66053. // needed to complete the UTF-8 character (if applicable) are returned.
  66054. function utf8CheckIncomplete(self, buf, i) {
  66055. var j = buf.length - 1;
  66056. if (j < i) return 0;
  66057. var nb = utf8CheckByte(buf[j]);
  66058. if (nb >= 0) {
  66059. if (nb > 0) self.lastNeed = nb - 1;
  66060. return nb;
  66061. }
  66062. if (--j < i || nb === -2) return 0;
  66063. nb = utf8CheckByte(buf[j]);
  66064. if (nb >= 0) {
  66065. if (nb > 0) self.lastNeed = nb - 2;
  66066. return nb;
  66067. }
  66068. if (--j < i || nb === -2) return 0;
  66069. nb = utf8CheckByte(buf[j]);
  66070. if (nb >= 0) {
  66071. if (nb > 0) {
  66072. if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
  66073. }
  66074. return nb;
  66075. }
  66076. return 0;
  66077. }
  66078. // Validates as many continuation bytes for a multi-byte UTF-8 character as
  66079. // needed or are available. If we see a non-continuation byte where we expect
  66080. // one, we "replace" the validated continuation bytes we've seen so far with
  66081. // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
  66082. // behavior. The continuation byte check is included three times in the case
  66083. // where all of the continuation bytes for a character exist in the same buffer.
  66084. // It is also done this way as a slight performance increase instead of using a
  66085. // loop.
  66086. function utf8CheckExtraBytes(self, buf, p) {
  66087. if ((buf[0] & 0xC0) !== 0x80) {
  66088. self.lastNeed = 0;
  66089. return '\ufffd';
  66090. }
  66091. if (self.lastNeed > 1 && buf.length > 1) {
  66092. if ((buf[1] & 0xC0) !== 0x80) {
  66093. self.lastNeed = 1;
  66094. return '\ufffd';
  66095. }
  66096. if (self.lastNeed > 2 && buf.length > 2) {
  66097. if ((buf[2] & 0xC0) !== 0x80) {
  66098. self.lastNeed = 2;
  66099. return '\ufffd';
  66100. }
  66101. }
  66102. }
  66103. }
  66104. // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
  66105. function utf8FillLast(buf) {
  66106. var p = this.lastTotal - this.lastNeed;
  66107. var r = utf8CheckExtraBytes(this, buf, p);
  66108. if (r !== undefined) return r;
  66109. if (this.lastNeed <= buf.length) {
  66110. buf.copy(this.lastChar, p, 0, this.lastNeed);
  66111. return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  66112. }
  66113. buf.copy(this.lastChar, p, 0, buf.length);
  66114. this.lastNeed -= buf.length;
  66115. }
  66116. // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
  66117. // partial character, the character's bytes are buffered until the required
  66118. // number of bytes are available.
  66119. function utf8Text(buf, i) {
  66120. var total = utf8CheckIncomplete(this, buf, i);
  66121. if (!this.lastNeed) return buf.toString('utf8', i);
  66122. this.lastTotal = total;
  66123. var end = buf.length - (total - this.lastNeed);
  66124. buf.copy(this.lastChar, 0, end);
  66125. return buf.toString('utf8', i, end);
  66126. }
  66127. // For UTF-8, a replacement character is added when ending on a partial
  66128. // character.
  66129. function utf8End(buf) {
  66130. var r = buf && buf.length ? this.write(buf) : '';
  66131. if (this.lastNeed) return r + '\ufffd';
  66132. return r;
  66133. }
  66134. // UTF-16LE typically needs two bytes per character, but even if we have an even
  66135. // number of bytes available, we need to check if we end on a leading/high
  66136. // surrogate. In that case, we need to wait for the next two bytes in order to
  66137. // decode the last character properly.
  66138. function utf16Text(buf, i) {
  66139. if ((buf.length - i) % 2 === 0) {
  66140. var r = buf.toString('utf16le', i);
  66141. if (r) {
  66142. var c = r.charCodeAt(r.length - 1);
  66143. if (c >= 0xD800 && c <= 0xDBFF) {
  66144. this.lastNeed = 2;
  66145. this.lastTotal = 4;
  66146. this.lastChar[0] = buf[buf.length - 2];
  66147. this.lastChar[1] = buf[buf.length - 1];
  66148. return r.slice(0, -1);
  66149. }
  66150. }
  66151. return r;
  66152. }
  66153. this.lastNeed = 1;
  66154. this.lastTotal = 2;
  66155. this.lastChar[0] = buf[buf.length - 1];
  66156. return buf.toString('utf16le', i, buf.length - 1);
  66157. }
  66158. // For UTF-16LE we do not explicitly append special replacement characters if we
  66159. // end on a partial character, we simply let v8 handle that.
  66160. function utf16End(buf) {
  66161. var r = buf && buf.length ? this.write(buf) : '';
  66162. if (this.lastNeed) {
  66163. var end = this.lastTotal - this.lastNeed;
  66164. return r + this.lastChar.toString('utf16le', 0, end);
  66165. }
  66166. return r;
  66167. }
  66168. function base64Text(buf, i) {
  66169. var n = (buf.length - i) % 3;
  66170. if (n === 0) return buf.toString('base64', i);
  66171. this.lastNeed = 3 - n;
  66172. this.lastTotal = 3;
  66173. if (n === 1) {
  66174. this.lastChar[0] = buf[buf.length - 1];
  66175. } else {
  66176. this.lastChar[0] = buf[buf.length - 2];
  66177. this.lastChar[1] = buf[buf.length - 1];
  66178. }
  66179. return buf.toString('base64', i, buf.length - n);
  66180. }
  66181. function base64End(buf) {
  66182. var r = buf && buf.length ? this.write(buf) : '';
  66183. if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
  66184. return r;
  66185. }
  66186. // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
  66187. function simpleWrite(buf) {
  66188. return buf.toString(this.encoding);
  66189. }
  66190. function simpleEnd(buf) {
  66191. return buf && buf.length ? this.write(buf) : '';
  66192. }
  66193. /***/ }),
  66194. /* 429 */
  66195. /***/ (function(module, exports, __webpack_require__) {
  66196. "use strict";
  66197. module.exports = x => {
  66198. if (typeof x !== 'string') {
  66199. throw new TypeError('Expected a string, got ' + typeof x);
  66200. }
  66201. // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string
  66202. // conversion translates it to FEFF (UTF-16 BOM)
  66203. if (x.charCodeAt(0) === 0xFEFF) {
  66204. return x.slice(1);
  66205. }
  66206. return x;
  66207. };
  66208. /***/ }),
  66209. /* 430 */
  66210. /***/ (function(module, exports, __webpack_require__) {
  66211. var toBuffer = __webpack_require__(433)
  66212. var alloc = __webpack_require__(318)
  66213. var ZEROS = '0000000000000000000'
  66214. var SEVENS = '7777777777777777777'
  66215. var ZERO_OFFSET = '0'.charCodeAt(0)
  66216. var USTAR = 'ustar\x0000'
  66217. var MASK = parseInt('7777', 8)
  66218. var clamp = function (index, len, defaultValue) {
  66219. if (typeof index !== 'number') return defaultValue
  66220. index = ~~index // Coerce to integer.
  66221. if (index >= len) return len
  66222. if (index >= 0) return index
  66223. index += len
  66224. if (index >= 0) return index
  66225. return 0
  66226. }
  66227. var toType = function (flag) {
  66228. switch (flag) {
  66229. case 0:
  66230. return 'file'
  66231. case 1:
  66232. return 'link'
  66233. case 2:
  66234. return 'symlink'
  66235. case 3:
  66236. return 'character-device'
  66237. case 4:
  66238. return 'block-device'
  66239. case 5:
  66240. return 'directory'
  66241. case 6:
  66242. return 'fifo'
  66243. case 7:
  66244. return 'contiguous-file'
  66245. case 72:
  66246. return 'pax-header'
  66247. case 55:
  66248. return 'pax-global-header'
  66249. case 27:
  66250. return 'gnu-long-link-path'
  66251. case 28:
  66252. case 30:
  66253. return 'gnu-long-path'
  66254. }
  66255. return null
  66256. }
  66257. var toTypeflag = function (flag) {
  66258. switch (flag) {
  66259. case 'file':
  66260. return 0
  66261. case 'link':
  66262. return 1
  66263. case 'symlink':
  66264. return 2
  66265. case 'character-device':
  66266. return 3
  66267. case 'block-device':
  66268. return 4
  66269. case 'directory':
  66270. return 5
  66271. case 'fifo':
  66272. return 6
  66273. case 'contiguous-file':
  66274. return 7
  66275. case 'pax-header':
  66276. return 72
  66277. }
  66278. return 0
  66279. }
  66280. var indexOf = function (block, num, offset, end) {
  66281. for (; offset < end; offset++) {
  66282. if (block[offset] === num) return offset
  66283. }
  66284. return end
  66285. }
  66286. var cksum = function (block) {
  66287. var sum = 8 * 32
  66288. for (var i = 0; i < 148; i++) sum += block[i]
  66289. for (var j = 156; j < 512; j++) sum += block[j]
  66290. return sum
  66291. }
  66292. var encodeOct = function (val, n) {
  66293. val = val.toString(8)
  66294. if (val.length > n) return SEVENS.slice(0, n) + ' '
  66295. else return ZEROS.slice(0, n - val.length) + val + ' '
  66296. }
  66297. /* Copied from the node-tar repo and modified to meet
  66298. * tar-stream coding standard.
  66299. *
  66300. * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349
  66301. */
  66302. function parse256 (buf) {
  66303. // first byte MUST be either 80 or FF
  66304. // 80 for positive, FF for 2's comp
  66305. var positive
  66306. if (buf[0] === 0x80) positive = true
  66307. else if (buf[0] === 0xFF) positive = false
  66308. else return null
  66309. // build up a base-256 tuple from the least sig to the highest
  66310. var zero = false
  66311. var tuple = []
  66312. for (var i = buf.length - 1; i > 0; i--) {
  66313. var byte = buf[i]
  66314. if (positive) tuple.push(byte)
  66315. else if (zero && byte === 0) tuple.push(0)
  66316. else if (zero) {
  66317. zero = false
  66318. tuple.push(0x100 - byte)
  66319. } else tuple.push(0xFF - byte)
  66320. }
  66321. var sum = 0
  66322. var l = tuple.length
  66323. for (i = 0; i < l; i++) {
  66324. sum += tuple[i] * Math.pow(256, i)
  66325. }
  66326. return positive ? sum : -1 * sum
  66327. }
  66328. var decodeOct = function (val, offset, length) {
  66329. val = val.slice(offset, offset + length)
  66330. offset = 0
  66331. // If prefixed with 0x80 then parse as a base-256 integer
  66332. if (val[offset] & 0x80) {
  66333. return parse256(val)
  66334. } else {
  66335. // Older versions of tar can prefix with spaces
  66336. while (offset < val.length && val[offset] === 32) offset++
  66337. var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length)
  66338. while (offset < end && val[offset] === 0) offset++
  66339. if (end === offset) return 0
  66340. return parseInt(val.slice(offset, end).toString(), 8)
  66341. }
  66342. }
  66343. var decodeStr = function (val, offset, length, encoding) {
  66344. return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding)
  66345. }
  66346. var addLength = function (str) {
  66347. var len = Buffer.byteLength(str)
  66348. var digits = Math.floor(Math.log(len) / Math.log(10)) + 1
  66349. if (len + digits >= Math.pow(10, digits)) digits++
  66350. return (len + digits) + str
  66351. }
  66352. exports.decodeLongPath = function (buf, encoding) {
  66353. return decodeStr(buf, 0, buf.length, encoding)
  66354. }
  66355. exports.encodePax = function (opts) { // TODO: encode more stuff in pax
  66356. var result = ''
  66357. if (opts.name) result += addLength(' path=' + opts.name + '\n')
  66358. if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n')
  66359. var pax = opts.pax
  66360. if (pax) {
  66361. for (var key in pax) {
  66362. result += addLength(' ' + key + '=' + pax[key] + '\n')
  66363. }
  66364. }
  66365. return toBuffer(result)
  66366. }
  66367. exports.decodePax = function (buf) {
  66368. var result = {}
  66369. while (buf.length) {
  66370. var i = 0
  66371. while (i < buf.length && buf[i] !== 32) i++
  66372. var len = parseInt(buf.slice(0, i).toString(), 10)
  66373. if (!len) return result
  66374. var b = buf.slice(i + 1, len - 1).toString()
  66375. var keyIndex = b.indexOf('=')
  66376. if (keyIndex === -1) return result
  66377. result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1)
  66378. buf = buf.slice(len)
  66379. }
  66380. return result
  66381. }
  66382. exports.encode = function (opts) {
  66383. var buf = alloc(512)
  66384. var name = opts.name
  66385. var prefix = ''
  66386. if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/'
  66387. if (Buffer.byteLength(name) !== name.length) return null // utf-8
  66388. while (Buffer.byteLength(name) > 100) {
  66389. var i = name.indexOf('/')
  66390. if (i === -1) return null
  66391. prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i)
  66392. name = name.slice(i + 1)
  66393. }
  66394. if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null
  66395. if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null
  66396. buf.write(name)
  66397. buf.write(encodeOct(opts.mode & MASK, 6), 100)
  66398. buf.write(encodeOct(opts.uid, 6), 108)
  66399. buf.write(encodeOct(opts.gid, 6), 116)
  66400. buf.write(encodeOct(opts.size, 11), 124)
  66401. buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136)
  66402. buf[156] = ZERO_OFFSET + toTypeflag(opts.type)
  66403. if (opts.linkname) buf.write(opts.linkname, 157)
  66404. buf.write(USTAR, 257)
  66405. if (opts.uname) buf.write(opts.uname, 265)
  66406. if (opts.gname) buf.write(opts.gname, 297)
  66407. buf.write(encodeOct(opts.devmajor || 0, 6), 329)
  66408. buf.write(encodeOct(opts.devminor || 0, 6), 337)
  66409. if (prefix) buf.write(prefix, 345)
  66410. buf.write(encodeOct(cksum(buf), 6), 148)
  66411. return buf
  66412. }
  66413. exports.decode = function (buf, filenameEncoding) {
  66414. var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET
  66415. var name = decodeStr(buf, 0, 100, filenameEncoding)
  66416. var mode = decodeOct(buf, 100, 8)
  66417. var uid = decodeOct(buf, 108, 8)
  66418. var gid = decodeOct(buf, 116, 8)
  66419. var size = decodeOct(buf, 124, 12)
  66420. var mtime = decodeOct(buf, 136, 12)
  66421. var type = toType(typeflag)
  66422. var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding)
  66423. var uname = decodeStr(buf, 265, 32)
  66424. var gname = decodeStr(buf, 297, 32)
  66425. var devmajor = decodeOct(buf, 329, 8)
  66426. var devminor = decodeOct(buf, 337, 8)
  66427. if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name
  66428. // to support old tar versions that use trailing / to indicate dirs
  66429. if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5
  66430. var c = cksum(buf)
  66431. // checksum is still initial value if header was null.
  66432. if (c === 8 * 32) return null
  66433. // valid checksum
  66434. if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?')
  66435. return {
  66436. name: name,
  66437. mode: mode,
  66438. uid: uid,
  66439. gid: gid,
  66440. size: size,
  66441. mtime: new Date(1000 * mtime),
  66442. type: type,
  66443. linkname: linkname,
  66444. uname: uname,
  66445. gname: gname,
  66446. devmajor: devmajor,
  66447. devminor: devminor
  66448. }
  66449. }
  66450. /***/ }),
  66451. /* 431 */
  66452. /***/ (function(module, exports, __webpack_require__) {
  66453. exports.extract = __webpack_require__(1022)
  66454. exports.pack = __webpack_require__(1023)
  66455. /***/ }),
  66456. /* 432 */
  66457. /***/ (function(module, exports, __webpack_require__) {
  66458. var Transform = __webpack_require__(866)
  66459. , inherits = __webpack_require__(9).inherits
  66460. , xtend = __webpack_require__(437)
  66461. function DestroyableTransform(opts) {
  66462. Transform.call(this, opts)
  66463. this._destroyed = false
  66464. }
  66465. inherits(DestroyableTransform, Transform)
  66466. DestroyableTransform.prototype.destroy = function(err) {
  66467. if (this._destroyed) return
  66468. this._destroyed = true
  66469. var self = this
  66470. process.nextTick(function() {
  66471. if (err)
  66472. self.emit('error', err)
  66473. self.emit('close')
  66474. })
  66475. }
  66476. // a noop _transform function
  66477. function noop (chunk, enc, callback) {
  66478. callback(null, chunk)
  66479. }
  66480. // create a new export function, used by both the main export and
  66481. // the .ctor export, contains common logic for dealing with arguments
  66482. function through2 (construct) {
  66483. return function (options, transform, flush) {
  66484. if (typeof options == 'function') {
  66485. flush = transform
  66486. transform = options
  66487. options = {}
  66488. }
  66489. if (typeof transform != 'function')
  66490. transform = noop
  66491. if (typeof flush != 'function')
  66492. flush = null
  66493. return construct(options, transform, flush)
  66494. }
  66495. }
  66496. // main export, just make me a transform stream!
  66497. module.exports = through2(function (options, transform, flush) {
  66498. var t2 = new DestroyableTransform(options)
  66499. t2._transform = transform
  66500. if (flush)
  66501. t2._flush = flush
  66502. return t2
  66503. })
  66504. // make me a reusable prototype that I can `new`, or implicitly `new`
  66505. // with a constructor call
  66506. module.exports.ctor = through2(function (options, transform, flush) {
  66507. function Through2 (override) {
  66508. if (!(this instanceof Through2))
  66509. return new Through2(override)
  66510. this.options = xtend(options, override)
  66511. DestroyableTransform.call(this, this.options)
  66512. }
  66513. inherits(Through2, DestroyableTransform)
  66514. Through2.prototype._transform = transform
  66515. if (flush)
  66516. Through2.prototype._flush = flush
  66517. return Through2
  66518. })
  66519. module.exports.obj = through2(function (options, transform, flush) {
  66520. var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options))
  66521. t2._transform = transform
  66522. if (flush)
  66523. t2._flush = flush
  66524. return t2
  66525. })
  66526. /***/ }),
  66527. /* 433 */
  66528. /***/ (function(module, exports) {
  66529. module.exports = toBuffer
  66530. var makeBuffer = Buffer.from && Buffer.from !== Uint8Array.from ? Buffer.from : bufferFrom
  66531. function bufferFrom (buf, enc) {
  66532. return new Buffer(buf, enc)
  66533. }
  66534. function toBuffer (buf, enc) {
  66535. if (Buffer.isBuffer(buf)) return buf
  66536. if (typeof buf === 'string') return makeBuffer(buf, enc)
  66537. if (Array.isArray(buf)) return makeBuffer(buf)
  66538. throw new Error('Input should be a buffer or a string')
  66539. }
  66540. /***/ }),
  66541. /* 434 */
  66542. /***/ (function(module, exports) {
  66543. /**
  66544. * Convert array of 16 byte values to UUID string format of the form:
  66545. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  66546. */
  66547. var byteToHex = [];
  66548. for (var i = 0; i < 256; ++i) {
  66549. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  66550. }
  66551. function bytesToUuid(buf, offset) {
  66552. var i = offset || 0;
  66553. var bth = byteToHex;
  66554. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  66555. return ([bth[buf[i++]], bth[buf[i++]],
  66556. bth[buf[i++]], bth[buf[i++]], '-',
  66557. bth[buf[i++]], bth[buf[i++]], '-',
  66558. bth[buf[i++]], bth[buf[i++]], '-',
  66559. bth[buf[i++]], bth[buf[i++]], '-',
  66560. bth[buf[i++]], bth[buf[i++]],
  66561. bth[buf[i++]], bth[buf[i++]],
  66562. bth[buf[i++]], bth[buf[i++]]]).join('');
  66563. }
  66564. module.exports = bytesToUuid;
  66565. /***/ }),
  66566. /* 435 */
  66567. /***/ (function(module, exports, __webpack_require__) {
  66568. // Unique ID creation requires a high quality random # generator. In node.js
  66569. // this is pretty straight-forward - we use the crypto API.
  66570. var crypto = __webpack_require__(21);
  66571. module.exports = function nodeRNG() {
  66572. return crypto.randomBytes(16);
  66573. };
  66574. /***/ }),
  66575. /* 436 */
  66576. /***/ (function(module, exports) {
  66577. // Returns a wrapper function that returns a wrapped callback
  66578. // The wrapper function should do some stuff, and return a
  66579. // presumably different callback function.
  66580. // This makes sure that own properties are retained, so that
  66581. // decorations and such are not lost along the way.
  66582. module.exports = wrappy
  66583. function wrappy (fn, cb) {
  66584. if (fn && cb) return wrappy(fn)(cb)
  66585. if (typeof fn !== 'function')
  66586. throw new TypeError('need wrapper function')
  66587. Object.keys(fn).forEach(function (k) {
  66588. wrapper[k] = fn[k]
  66589. })
  66590. return wrapper
  66591. function wrapper() {
  66592. var args = new Array(arguments.length)
  66593. for (var i = 0; i < args.length; i++) {
  66594. args[i] = arguments[i]
  66595. }
  66596. var ret = fn.apply(this, args)
  66597. var cb = args[args.length-1]
  66598. if (typeof ret === 'function' && ret !== cb) {
  66599. Object.keys(cb).forEach(function (k) {
  66600. ret[k] = cb[k]
  66601. })
  66602. }
  66603. return ret
  66604. }
  66605. }
  66606. /***/ }),
  66607. /* 437 */
  66608. /***/ (function(module, exports) {
  66609. module.exports = extend
  66610. var hasOwnProperty = Object.prototype.hasOwnProperty;
  66611. function extend() {
  66612. var target = {}
  66613. for (var i = 0; i < arguments.length; i++) {
  66614. var source = arguments[i]
  66615. for (var key in source) {
  66616. if (hasOwnProperty.call(source, key)) {
  66617. target[key] = source[key]
  66618. }
  66619. }
  66620. }
  66621. return target
  66622. }
  66623. /***/ }),
  66624. /* 438 */
  66625. /***/ (function(module, exports) {
  66626. module.exports = {"name":"yarn","installationMethod":"unknown","version":"1.22.22","packageManager":"yarn@1.22.17","license":"BSD-2-Clause","preferGlobal":true,"description":"📦🐈 Fast, reliable, and secure dependency management.","dependencies":{"@zkochan/cmd-shim":"^3.1.0","babel-runtime":"^6.26.0","bytes":"^3.0.0","camelcase":"^4.0.0","chalk":"^2.1.0","cli-table3":"^0.4.0","commander":"^2.9.0","death":"^1.0.0","debug":"^3.0.0","deep-equal":"^1.0.1","detect-indent":"^5.0.0","dnscache":"^1.0.1","glob":"^7.1.1","gunzip-maybe":"^1.4.0","hash-for-dep":"^1.2.3","imports-loader":"^0.8.0","ini":"^1.3.4","inquirer":"^6.2.0","invariant":"^2.2.0","is-builtin-module":"^2.0.0","is-ci":"^1.0.10","is-webpack-bundle":"^1.0.0","js-yaml":"^3.13.1","leven":"^2.0.0","loud-rejection":"^1.2.0","micromatch":"^2.3.11","mkdirp":"^0.5.1","node-emoji":"^1.6.1","normalize-url":"^2.0.0","npm-logical-tree":"^1.2.1","object-path":"^0.11.2","proper-lockfile":"^2.0.0","puka":"^1.0.0","punycode":"1.4.1","read":"^1.0.7","request":"^2.87.0","request-capture-har":"^1.2.2","rimraf":"^2.5.0","semver":"^5.1.0","ssri":"^5.3.0","strip-ansi":"^4.0.0","strip-bom":"^3.0.0","tar-fs":"^1.16.0","tar-stream":"^1.6.1","uuid":"^3.0.1","v8-compile-cache":"^2.0.0","validate-npm-package-license":"^3.0.4","yn":"^2.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^7.2.3","babel-loader":"^6.2.5","babel-plugin-array-includes":"^2.0.3","babel-plugin-inline-import":"^3.0.0","babel-plugin-transform-builtin-extend":"^1.1.2","babel-plugin-transform-inline-imports-commonjs":"^1.0.0","babel-plugin-transform-runtime":"^6.4.3","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","babel-preset-stage-0":"^6.0.0","babylon":"^6.5.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.3.0","eslint-config-fb-strict":"^22.0.0","eslint-plugin-babel":"^5.0.0","eslint-plugin-flowtype":"^2.35.0","eslint-plugin-jasmine":"^2.6.2","eslint-plugin-jest":"^21.0.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prefer-object-spread":"^1.2.1","eslint-plugin-prettier":"^2.1.2","eslint-plugin-react":"^7.1.0","eslint-plugin-relay":"^0.0.28","eslint-plugin-yarn-internal":"file:scripts/eslint-rules","execa":"^0.11.0","fancy-log":"^1.3.2","flow-bin":"^0.66.0","git-release-notes":"^3.0.0","gulp":"^4.0.0","gulp-babel":"^7.0.0","gulp-if":"^2.0.1","gulp-newer":"^1.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.2.0","jest":"^22.4.4","jsinspect":"^0.12.6","minimatch":"^3.0.4","mock-stdin":"^0.3.0","prettier":"^1.5.2","string-replace-loader":"^2.1.1","temp":"^0.8.3","webpack":"^2.1.0-beta.25","yargs":"^6.3.0"},"resolutions":{"sshpk":"^1.14.2"},"engines":{"node":">=4.0.0"},"repository":"yarnpkg/yarn","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"scripts":{"build":"gulp build","build-bundle":"node ./scripts/build-webpack.js","build-chocolatey":"powershell ./scripts/build-chocolatey.ps1","build-deb":"./scripts/build-deb.sh","build-dist":"bash ./scripts/build-dist.sh","build-win-installer":"scripts\\build-windows-installer.bat","changelog":"git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md","dupe-check":"yarn jsinspect ./src","lint":"eslint . && flow check","pkg-tests":"yarn --cwd packages/pkg-tests jest yarn.test.js","prettier":"eslint src __tests__ --fix","release-branch":"./scripts/release-branch.sh","test":"yarn lint && yarn test-only","test-only":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose","test-only-debug":"node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose","test-coverage":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose","watch":"gulp watch","commit":"git-cz"},"jest":{"collectCoverageFrom":["src/**/*.js"],"testEnvironment":"node","modulePathIgnorePatterns":["__tests__/fixtures/","packages/pkg-tests/pkg-tests-fixtures","dist/"],"testPathIgnorePatterns":["__tests__/(fixtures|__mocks__)/","updates/","_(temp|mock|install|init|helpers).js$","packages/pkg-tests"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}}
  66627. /***/ }),
  66628. /* 439 */
  66629. /***/ (function(module, exports) {
  66630. module.exports = require("constants");
  66631. /***/ }),
  66632. /* 440 */
  66633. /***/ (function(module, exports) {
  66634. module.exports = require("tls");
  66635. /***/ }),
  66636. /* 441 */
  66637. /***/ (function(module, exports, __webpack_require__) {
  66638. "use strict";
  66639. Object.defineProperty(exports, "__esModule", {
  66640. value: true
  66641. });
  66642. exports.default = handleSignals;
  66643. var _child;
  66644. function _load_child() {
  66645. return _child = __webpack_require__(57);
  66646. }
  66647. function forwardSignalAndExit(signal) {
  66648. (0, (_child || _load_child()).forwardSignalToSpawnedProcesses)(signal);
  66649. // We want to exit immediately here since `SIGTERM` means that
  66650. // If we lose stdout messages due to abrupt exit, shoot the messenger?
  66651. process.exit(1); // eslint-disable-line no-process-exit
  66652. }
  66653. function handleSignals() {
  66654. process.on('SIGTERM', function () {
  66655. forwardSignalAndExit('SIGTERM');
  66656. });
  66657. }
  66658. /***/ }),
  66659. /* 442 */
  66660. /***/ (function(module, exports) {
  66661. var defaultConfig = {
  66662. uncaughtException: false,
  66663. SIGINT: true,
  66664. SIGTERM: true,
  66665. SIGQUIT: true
  66666. }
  66667. var DEBUG = false
  66668. function ON_DEATH (callback) {
  66669. var handlers = [];
  66670. Object.keys(defaultConfig).forEach(function(key) {
  66671. var val = defaultConfig[key]
  66672. var handler = null;
  66673. if (val) {
  66674. if (DEBUG) {
  66675. handler = function() {
  66676. var args = Array.prototype.slice.call(arguments, 0)
  66677. args.unshift(key)
  66678. console.log('Trapped ' + key)
  66679. callback.apply(null, args)
  66680. };
  66681. process.on(key, handler)
  66682. } else {
  66683. handler = function() {
  66684. var args = Array.prototype.slice.call(arguments, 0)
  66685. args.unshift(key)
  66686. callback.apply(null, args)
  66687. }
  66688. process.on(key, handler)
  66689. }
  66690. handlers.push([key, handler])
  66691. }
  66692. })
  66693. return function OFF_DEATH() {
  66694. handlers.forEach(function (args) {
  66695. var key = args[0];
  66696. var handler = args[1];
  66697. process.removeListener(key, handler);
  66698. })
  66699. }
  66700. }
  66701. module.exports = function (arg) {
  66702. if (typeof arg === 'object') {
  66703. if (arg['debug'])
  66704. DEBUG = arg.debug
  66705. if (arg['DEBUG'])
  66706. DEBUG = arg.DEBUG
  66707. delete arg.debug; delete arg.DEBUG;
  66708. Object.keys(arg).forEach(function(key) {
  66709. defaultConfig[key] = arg[key]
  66710. })
  66711. if (DEBUG)
  66712. console.log('ON_DEATH: debug mode enabled for pid [%d]', process.pid)
  66713. return ON_DEATH
  66714. } else if (typeof arg === 'function') {
  66715. return ON_DEATH(arg)
  66716. }
  66717. }
  66718. /***/ }),
  66719. /* 443 */
  66720. /***/ (function(module, exports, __webpack_require__) {
  66721. "use strict";
  66722. var util = __webpack_require__(9);
  66723. var onExit = __webpack_require__(421);
  66724. var currentlyUnhandled = __webpack_require__(649);
  66725. var installed = false;
  66726. module.exports = function (log) {
  66727. if (installed) {
  66728. return;
  66729. }
  66730. installed = true;
  66731. log = log || console.error;
  66732. var listUnhandled = currentlyUnhandled();
  66733. onExit(function () {
  66734. var unhandledRejections = listUnhandled();
  66735. if (unhandledRejections.length > 0) {
  66736. unhandledRejections.forEach(function (x) {
  66737. var err = x.reason;
  66738. if (!(err instanceof Error)) {
  66739. err = new Error('Promise rejected with value: ' + util.inspect(err));
  66740. }
  66741. log(err.stack);
  66742. });
  66743. process.exitCode = 1;
  66744. }
  66745. });
  66746. };
  66747. /***/ }),
  66748. /* 444 */
  66749. /***/ (function(module, exports, __webpack_require__) {
  66750. "use strict";
  66751. const fs = __webpack_require__(356);
  66752. const path = __webpack_require__(1);
  66753. const retry = __webpack_require__(891);
  66754. const syncFs = __webpack_require__(851);
  66755. const locks = {};
  66756. function getLockFile(file) {
  66757. return `${file}.lock`;
  66758. }
  66759. function canonicalPath(file, options, callback) {
  66760. if (!options.realpath) {
  66761. return callback(null, path.resolve(file));
  66762. }
  66763. // Use realpath to resolve symlinks
  66764. // It also resolves relative paths
  66765. options.fs.realpath(file, callback);
  66766. }
  66767. function acquireLock(file, options, callback) {
  66768. // Use mkdir to create the lockfile (atomic operation)
  66769. options.fs.mkdir(getLockFile(file), (err) => {
  66770. // If successful, we are done
  66771. if (!err) {
  66772. return callback();
  66773. }
  66774. // If error is not EEXIST then some other error occurred while locking
  66775. if (err.code !== 'EEXIST') {
  66776. return callback(err);
  66777. }
  66778. // Otherwise, check if lock is stale by analyzing the file mtime
  66779. if (options.stale <= 0) {
  66780. return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file }));
  66781. }
  66782. options.fs.stat(getLockFile(file), (err, stat) => {
  66783. if (err) {
  66784. // Retry if the lockfile has been removed (meanwhile)
  66785. // Skip stale check to avoid recursiveness
  66786. if (err.code === 'ENOENT') {
  66787. return acquireLock(file, Object.assign({}, options, { stale: 0 }), callback);
  66788. }
  66789. return callback(err);
  66790. }
  66791. if (!isLockStale(stat, options)) {
  66792. return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file }));
  66793. }
  66794. // If it's stale, remove it and try again!
  66795. // Skip stale check to avoid recursiveness
  66796. removeLock(file, options, (err) => {
  66797. if (err) {
  66798. return callback(err);
  66799. }
  66800. acquireLock(file, Object.assign({}, options, { stale: 0 }), callback);
  66801. });
  66802. });
  66803. });
  66804. }
  66805. function isLockStale(stat, options) {
  66806. return stat.mtime.getTime() < Date.now() - options.stale;
  66807. }
  66808. function removeLock(file, options, callback) {
  66809. // Remove lockfile, ignoring ENOENT errors
  66810. options.fs.rmdir(getLockFile(file), (err) => {
  66811. if (err && err.code !== 'ENOENT') {
  66812. return callback(err);
  66813. }
  66814. callback();
  66815. });
  66816. }
  66817. function updateLock(file, options) {
  66818. const lock = locks[file];
  66819. /* istanbul ignore next */
  66820. if (lock.updateTimeout) {
  66821. return;
  66822. }
  66823. lock.updateDelay = lock.updateDelay || options.update;
  66824. lock.updateTimeout = setTimeout(() => {
  66825. const mtime = Date.now() / 1000;
  66826. lock.updateTimeout = null;
  66827. options.fs.utimes(getLockFile(file), mtime, mtime, (err) => {
  66828. // Ignore if the lock was released
  66829. if (lock.released) {
  66830. return;
  66831. }
  66832. // Verify if we are within the stale threshold
  66833. if (lock.lastUpdate <= Date.now() - options.stale &&
  66834. lock.lastUpdate > Date.now() - options.stale * 2) {
  66835. return compromisedLock(file, lock, Object.assign(new Error(lock.updateError || 'Unable to update lock within the stale \
  66836. threshold'), { code: 'ECOMPROMISED' }));
  66837. }
  66838. // If the file is older than (stale * 2), we assume the clock is moved manually,
  66839. // which we consider a valid case
  66840. // If it failed to update the lockfile, keep trying unless
  66841. // the lockfile was deleted!
  66842. if (err) {
  66843. if (err.code === 'ENOENT') {
  66844. return compromisedLock(file, lock, Object.assign(err, { code: 'ECOMPROMISED' }));
  66845. }
  66846. lock.updateError = err;
  66847. lock.updateDelay = 1000;
  66848. return updateLock(file, options);
  66849. }
  66850. // All ok, keep updating..
  66851. lock.lastUpdate = Date.now();
  66852. lock.updateError = null;
  66853. lock.updateDelay = null;
  66854. updateLock(file, options);
  66855. });
  66856. }, lock.updateDelay);
  66857. // Unref the timer so that the nodejs process can exit freely
  66858. // This is safe because all acquired locks will be automatically released
  66859. // on process exit
  66860. // We first check that `lock.updateTimeout.unref` exists because some users
  66861. // may be using this module outside of NodeJS (e.g., in an electron app),
  66862. // and in those cases `setTimeout` return an integer.
  66863. if (lock.updateTimeout.unref) {
  66864. lock.updateTimeout.unref();
  66865. }
  66866. }
  66867. function compromisedLock(file, lock, err) {
  66868. lock.released = true; // Signal the lock has been released
  66869. /* istanbul ignore next */
  66870. lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update
  66871. if (locks[file] === lock) {
  66872. delete locks[file];
  66873. }
  66874. lock.compromised(err);
  66875. }
  66876. // -----------------------------------------
  66877. function lock(file, options, compromised, callback) {
  66878. if (typeof options === 'function') {
  66879. callback = compromised;
  66880. compromised = options;
  66881. options = null;
  66882. }
  66883. if (!callback) {
  66884. callback = compromised;
  66885. compromised = null;
  66886. }
  66887. options = Object.assign({
  66888. stale: 10000,
  66889. update: null,
  66890. realpath: true,
  66891. retries: 0,
  66892. fs,
  66893. }, options);
  66894. options.retries = options.retries || 0;
  66895. options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries;
  66896. options.stale = Math.max(options.stale || 0, 2000);
  66897. options.update = options.update == null ? options.stale / 2 : options.update || 0;
  66898. options.update = Math.max(Math.min(options.update, options.stale / 2), 1000);
  66899. compromised = compromised || function (err) { throw err; };
  66900. // Resolve to a canonical file path
  66901. canonicalPath(file, options, (err, file) => {
  66902. if (err) {
  66903. return callback(err);
  66904. }
  66905. // Attempt to acquire the lock
  66906. const operation = retry.operation(options.retries);
  66907. operation.attempt(() => {
  66908. acquireLock(file, options, (err) => {
  66909. if (operation.retry(err)) {
  66910. return;
  66911. }
  66912. if (err) {
  66913. return callback(operation.mainError());
  66914. }
  66915. // We now own the lock
  66916. const lock = locks[file] = {
  66917. options,
  66918. compromised,
  66919. lastUpdate: Date.now(),
  66920. };
  66921. // We must keep the lock fresh to avoid staleness
  66922. updateLock(file, options);
  66923. callback(null, (releasedCallback) => {
  66924. if (lock.released) {
  66925. return releasedCallback &&
  66926. releasedCallback(Object.assign(new Error('Lock is already released'), { code: 'ERELEASED' }));
  66927. }
  66928. // Not necessary to use realpath twice when unlocking
  66929. unlock(file, Object.assign({}, options, { realpath: false }), releasedCallback);
  66930. });
  66931. });
  66932. });
  66933. });
  66934. }
  66935. function unlock(file, options, callback) {
  66936. if (typeof options === 'function') {
  66937. callback = options;
  66938. options = null;
  66939. }
  66940. options = Object.assign({
  66941. fs,
  66942. realpath: true,
  66943. }, options);
  66944. callback = callback || function () {};
  66945. // Resolve to a canonical file path
  66946. canonicalPath(file, options, (err, file) => {
  66947. if (err) {
  66948. return callback(err);
  66949. }
  66950. // Skip if the lock is not acquired
  66951. const lock = locks[file];
  66952. if (!lock) {
  66953. return callback(Object.assign(new Error('Lock is not acquired/owned by you'), { code: 'ENOTACQUIRED' }));
  66954. }
  66955. lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update
  66956. lock.released = true; // Signal the lock has been released
  66957. delete locks[file]; // Delete from locks
  66958. removeLock(file, options, callback);
  66959. });
  66960. }
  66961. function lockSync(file, options, compromised) {
  66962. if (typeof options === 'function') {
  66963. compromised = options;
  66964. options = null;
  66965. }
  66966. options = options || {};
  66967. options.fs = syncFs(options.fs || fs);
  66968. options.retries = options.retries || 0;
  66969. options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries;
  66970. // Retries are not allowed because it requires the flow to be sync
  66971. if (options.retries.retries) {
  66972. throw Object.assign(new Error('Cannot use retries with the sync api'), { code: 'ESYNC' });
  66973. }
  66974. let err;
  66975. let release;
  66976. lock(file, options, compromised, (_err, _release) => {
  66977. err = _err;
  66978. release = _release;
  66979. });
  66980. if (err) {
  66981. throw err;
  66982. }
  66983. return release;
  66984. }
  66985. function unlockSync(file, options) {
  66986. options = options || {};
  66987. options.fs = syncFs(options.fs || fs);
  66988. let err;
  66989. unlock(file, options, (_err) => {
  66990. err = _err;
  66991. });
  66992. if (err) {
  66993. throw err;
  66994. }
  66995. }
  66996. function check(file, options, callback) {
  66997. if (typeof options === 'function') {
  66998. callback = options;
  66999. options = null;
  67000. }
  67001. options = Object.assign({
  67002. stale: 10000,
  67003. realpath: true,
  67004. fs,
  67005. }, options);
  67006. options.stale = Math.max(options.stale || 0, 2000);
  67007. // Resolve to a canonical file path
  67008. canonicalPath(file, options, (err, file) => {
  67009. if (err) {
  67010. return callback(err);
  67011. }
  67012. // Check if lockfile exists
  67013. options.fs.stat(getLockFile(file), (err, stat) => {
  67014. if (err) {
  67015. // if does not exist, file is not locked. Otherwise, callback with error
  67016. return (err.code === 'ENOENT') ? callback(null, false) : callback(err);
  67017. }
  67018. if (options.stale <= 0) { return callback(null, true); }
  67019. // Otherwise, check if lock is stale by analyzing the file mtime
  67020. return callback(null, !isLockStale(stat, options));
  67021. });
  67022. });
  67023. }
  67024. function checkSync(file, options) {
  67025. options = options || {};
  67026. options.fs = syncFs(options.fs || fs);
  67027. let err;
  67028. let locked;
  67029. check(file, options, (_err, _locked) => {
  67030. err = _err;
  67031. locked = _locked;
  67032. });
  67033. if (err) {
  67034. throw err;
  67035. }
  67036. return locked;
  67037. }
  67038. // Remove acquired locks on exit
  67039. /* istanbul ignore next */
  67040. process.on('exit', () => {
  67041. Object.keys(locks).forEach((file) => {
  67042. try { locks[file].options.fs.rmdirSync(getLockFile(file)); } catch (e) { /* empty */ }
  67043. });
  67044. });
  67045. module.exports = lock;
  67046. module.exports.lock = lock;
  67047. module.exports.unlock = unlock;
  67048. module.exports.lockSync = lockSync;
  67049. module.exports.unlockSync = unlockSync;
  67050. module.exports.check = check;
  67051. module.exports.checkSync = checkSync;
  67052. /***/ }),
  67053. /* 445 */
  67054. /***/ (function(module, exports, __webpack_require__) {
  67055. "use strict";
  67056. const x = module.exports;
  67057. const ESC = '\u001B[';
  67058. const OSC = '\u001B]';
  67059. const BEL = '\u0007';
  67060. const SEP = ';';
  67061. const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';
  67062. x.cursorTo = (x, y) => {
  67063. if (typeof x !== 'number') {
  67064. throw new TypeError('The `x` argument is required');
  67065. }
  67066. if (typeof y !== 'number') {
  67067. return ESC + (x + 1) + 'G';
  67068. }
  67069. return ESC + (y + 1) + ';' + (x + 1) + 'H';
  67070. };
  67071. x.cursorMove = (x, y) => {
  67072. if (typeof x !== 'number') {
  67073. throw new TypeError('The `x` argument is required');
  67074. }
  67075. let ret = '';
  67076. if (x < 0) {
  67077. ret += ESC + (-x) + 'D';
  67078. } else if (x > 0) {
  67079. ret += ESC + x + 'C';
  67080. }
  67081. if (y < 0) {
  67082. ret += ESC + (-y) + 'A';
  67083. } else if (y > 0) {
  67084. ret += ESC + y + 'B';
  67085. }
  67086. return ret;
  67087. };
  67088. x.cursorUp = count => ESC + (typeof count === 'number' ? count : 1) + 'A';
  67089. x.cursorDown = count => ESC + (typeof count === 'number' ? count : 1) + 'B';
  67090. x.cursorForward = count => ESC + (typeof count === 'number' ? count : 1) + 'C';
  67091. x.cursorBackward = count => ESC + (typeof count === 'number' ? count : 1) + 'D';
  67092. x.cursorLeft = ESC + 'G';
  67093. x.cursorSavePosition = ESC + (isTerminalApp ? '7' : 's');
  67094. x.cursorRestorePosition = ESC + (isTerminalApp ? '8' : 'u');
  67095. x.cursorGetPosition = ESC + '6n';
  67096. x.cursorNextLine = ESC + 'E';
  67097. x.cursorPrevLine = ESC + 'F';
  67098. x.cursorHide = ESC + '?25l';
  67099. x.cursorShow = ESC + '?25h';
  67100. x.eraseLines = count => {
  67101. let clear = '';
  67102. for (let i = 0; i < count; i++) {
  67103. clear += x.eraseLine + (i < count - 1 ? x.cursorUp() : '');
  67104. }
  67105. if (count) {
  67106. clear += x.cursorLeft;
  67107. }
  67108. return clear;
  67109. };
  67110. x.eraseEndLine = ESC + 'K';
  67111. x.eraseStartLine = ESC + '1K';
  67112. x.eraseLine = ESC + '2K';
  67113. x.eraseDown = ESC + 'J';
  67114. x.eraseUp = ESC + '1J';
  67115. x.eraseScreen = ESC + '2J';
  67116. x.scrollUp = ESC + 'S';
  67117. x.scrollDown = ESC + 'T';
  67118. x.clearScreen = '\u001Bc';
  67119. x.beep = BEL;
  67120. x.link = (text, url) => {
  67121. return [
  67122. OSC,
  67123. '8',
  67124. SEP,
  67125. SEP,
  67126. url,
  67127. BEL,
  67128. text,
  67129. OSC,
  67130. '8',
  67131. SEP,
  67132. SEP,
  67133. BEL
  67134. ].join('');
  67135. };
  67136. x.image = (buf, opts) => {
  67137. opts = opts || {};
  67138. let ret = OSC + '1337;File=inline=1';
  67139. if (opts.width) {
  67140. ret += `;width=${opts.width}`;
  67141. }
  67142. if (opts.height) {
  67143. ret += `;height=${opts.height}`;
  67144. }
  67145. if (opts.preserveAspectRatio === false) {
  67146. ret += ';preserveAspectRatio=0';
  67147. }
  67148. return ret + ':' + buf.toString('base64') + BEL;
  67149. };
  67150. x.iTerm = {};
  67151. x.iTerm.setCwd = cwd => OSC + '50;CurrentDir=' + (cwd || process.cwd()) + BEL;
  67152. /***/ }),
  67153. /* 446 */
  67154. /***/ (function(module, exports, __webpack_require__) {
  67155. "use strict";
  67156. module.exports = function () {
  67157. return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
  67158. };
  67159. /***/ }),
  67160. /* 447 */
  67161. /***/ (function(module, exports, __webpack_require__) {
  67162. "use strict";
  67163. /* WEBPACK VAR INJECTION */(function(module) {
  67164. const colorConvert = __webpack_require__(574);
  67165. const wrapAnsi16 = (fn, offset) => function () {
  67166. const code = fn.apply(colorConvert, arguments);
  67167. return `\u001B[${code + offset}m`;
  67168. };
  67169. const wrapAnsi256 = (fn, offset) => function () {
  67170. const code = fn.apply(colorConvert, arguments);
  67171. return `\u001B[${38 + offset};5;${code}m`;
  67172. };
  67173. const wrapAnsi16m = (fn, offset) => function () {
  67174. const rgb = fn.apply(colorConvert, arguments);
  67175. return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
  67176. };
  67177. function assembleStyles() {
  67178. const codes = new Map();
  67179. const styles = {
  67180. modifier: {
  67181. reset: [0, 0],
  67182. // 21 isn't widely supported and 22 does the same thing
  67183. bold: [1, 22],
  67184. dim: [2, 22],
  67185. italic: [3, 23],
  67186. underline: [4, 24],
  67187. inverse: [7, 27],
  67188. hidden: [8, 28],
  67189. strikethrough: [9, 29]
  67190. },
  67191. color: {
  67192. black: [30, 39],
  67193. red: [31, 39],
  67194. green: [32, 39],
  67195. yellow: [33, 39],
  67196. blue: [34, 39],
  67197. magenta: [35, 39],
  67198. cyan: [36, 39],
  67199. white: [37, 39],
  67200. gray: [90, 39],
  67201. // Bright color
  67202. redBright: [91, 39],
  67203. greenBright: [92, 39],
  67204. yellowBright: [93, 39],
  67205. blueBright: [94, 39],
  67206. magentaBright: [95, 39],
  67207. cyanBright: [96, 39],
  67208. whiteBright: [97, 39]
  67209. },
  67210. bgColor: {
  67211. bgBlack: [40, 49],
  67212. bgRed: [41, 49],
  67213. bgGreen: [42, 49],
  67214. bgYellow: [43, 49],
  67215. bgBlue: [44, 49],
  67216. bgMagenta: [45, 49],
  67217. bgCyan: [46, 49],
  67218. bgWhite: [47, 49],
  67219. // Bright color
  67220. bgBlackBright: [100, 49],
  67221. bgRedBright: [101, 49],
  67222. bgGreenBright: [102, 49],
  67223. bgYellowBright: [103, 49],
  67224. bgBlueBright: [104, 49],
  67225. bgMagentaBright: [105, 49],
  67226. bgCyanBright: [106, 49],
  67227. bgWhiteBright: [107, 49]
  67228. }
  67229. };
  67230. // Fix humans
  67231. styles.color.grey = styles.color.gray;
  67232. for (const groupName of Object.keys(styles)) {
  67233. const group = styles[groupName];
  67234. for (const styleName of Object.keys(group)) {
  67235. const style = group[styleName];
  67236. styles[styleName] = {
  67237. open: `\u001B[${style[0]}m`,
  67238. close: `\u001B[${style[1]}m`
  67239. };
  67240. group[styleName] = styles[styleName];
  67241. codes.set(style[0], style[1]);
  67242. }
  67243. Object.defineProperty(styles, groupName, {
  67244. value: group,
  67245. enumerable: false
  67246. });
  67247. Object.defineProperty(styles, 'codes', {
  67248. value: codes,
  67249. enumerable: false
  67250. });
  67251. }
  67252. const ansi2ansi = n => n;
  67253. const rgb2rgb = (r, g, b) => [r, g, b];
  67254. styles.color.close = '\u001B[39m';
  67255. styles.bgColor.close = '\u001B[49m';
  67256. styles.color.ansi = {
  67257. ansi: wrapAnsi16(ansi2ansi, 0)
  67258. };
  67259. styles.color.ansi256 = {
  67260. ansi256: wrapAnsi256(ansi2ansi, 0)
  67261. };
  67262. styles.color.ansi16m = {
  67263. rgb: wrapAnsi16m(rgb2rgb, 0)
  67264. };
  67265. styles.bgColor.ansi = {
  67266. ansi: wrapAnsi16(ansi2ansi, 10)
  67267. };
  67268. styles.bgColor.ansi256 = {
  67269. ansi256: wrapAnsi256(ansi2ansi, 10)
  67270. };
  67271. styles.bgColor.ansi16m = {
  67272. rgb: wrapAnsi16m(rgb2rgb, 10)
  67273. };
  67274. for (let key of Object.keys(colorConvert)) {
  67275. if (typeof colorConvert[key] !== 'object') {
  67276. continue;
  67277. }
  67278. const suite = colorConvert[key];
  67279. if (key === 'ansi16') {
  67280. key = 'ansi';
  67281. }
  67282. if ('ansi16' in suite) {
  67283. styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
  67284. styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
  67285. }
  67286. if ('ansi256' in suite) {
  67287. styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
  67288. styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
  67289. }
  67290. if ('rgb' in suite) {
  67291. styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
  67292. styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
  67293. }
  67294. }
  67295. return styles;
  67296. }
  67297. // Make the export immutable
  67298. Object.defineProperty(module, 'exports', {
  67299. enumerable: true,
  67300. get: assembleStyles
  67301. });
  67302. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(115)(module)))
  67303. /***/ }),
  67304. /* 448 */
  67305. /***/ (function(module, exports) {
  67306. function webpackEmptyContext(req) {
  67307. throw new Error("Cannot find module '" + req + "'.");
  67308. }
  67309. webpackEmptyContext.keys = function() { return []; };
  67310. webpackEmptyContext.resolve = webpackEmptyContext;
  67311. module.exports = webpackEmptyContext;
  67312. webpackEmptyContext.id = 448;
  67313. /***/ }),
  67314. /* 449 */
  67315. /***/ (function(module, exports, __webpack_require__) {
  67316. "use strict";
  67317. // global key for user preferred registration
  67318. var REGISTRATION_KEY = '@@any-promise/REGISTRATION',
  67319. // Prior registration (preferred or detected)
  67320. registered = null
  67321. /**
  67322. * Registers the given implementation. An implementation must
  67323. * be registered prior to any call to `require("any-promise")`,
  67324. * typically on application load.
  67325. *
  67326. * If called with no arguments, will return registration in
  67327. * following priority:
  67328. *
  67329. * For Node.js:
  67330. *
  67331. * 1. Previous registration
  67332. * 2. global.Promise if node.js version >= 0.12
  67333. * 3. Auto detected promise based on first sucessful require of
  67334. * known promise libraries. Note this is a last resort, as the
  67335. * loaded library is non-deterministic. node.js >= 0.12 will
  67336. * always use global.Promise over this priority list.
  67337. * 4. Throws error.
  67338. *
  67339. * For Browser:
  67340. *
  67341. * 1. Previous registration
  67342. * 2. window.Promise
  67343. * 3. Throws error.
  67344. *
  67345. * Options:
  67346. *
  67347. * Promise: Desired Promise constructor
  67348. * global: Boolean - Should the registration be cached in a global variable to
  67349. * allow cross dependency/bundle registration? (default true)
  67350. */
  67351. module.exports = function(root, loadImplementation){
  67352. return function register(implementation, opts){
  67353. implementation = implementation || null
  67354. opts = opts || {}
  67355. // global registration unless explicitly {global: false} in options (default true)
  67356. var registerGlobal = opts.global !== false;
  67357. // load any previous global registration
  67358. if(registered === null && registerGlobal){
  67359. registered = root[REGISTRATION_KEY] || null
  67360. }
  67361. if(registered !== null
  67362. && implementation !== null
  67363. && registered.implementation !== implementation){
  67364. // Throw error if attempting to redefine implementation
  67365. throw new Error('any-promise already defined as "'+registered.implementation+
  67366. '". You can only register an implementation before the first '+
  67367. ' call to require("any-promise") and an implementation cannot be changed')
  67368. }
  67369. if(registered === null){
  67370. // use provided implementation
  67371. if(implementation !== null && typeof opts.Promise !== 'undefined'){
  67372. registered = {
  67373. Promise: opts.Promise,
  67374. implementation: implementation
  67375. }
  67376. } else {
  67377. // require implementation if implementation is specified but not provided
  67378. registered = loadImplementation(implementation)
  67379. }
  67380. if(registerGlobal){
  67381. // register preference globally in case multiple installations
  67382. root[REGISTRATION_KEY] = registered
  67383. }
  67384. }
  67385. return registered
  67386. }
  67387. }
  67388. /***/ }),
  67389. /* 450 */
  67390. /***/ (function(module, exports, __webpack_require__) {
  67391. "use strict";
  67392. module.exports = __webpack_require__(449)(global, loadImplementation);
  67393. /**
  67394. * Node.js version of loadImplementation.
  67395. *
  67396. * Requires the given implementation and returns the registration
  67397. * containing {Promise, implementation}
  67398. *
  67399. * If implementation is undefined or global.Promise, loads it
  67400. * Otherwise uses require
  67401. */
  67402. function loadImplementation(implementation){
  67403. var impl = null
  67404. if(shouldPreferGlobalPromise(implementation)){
  67405. // if no implementation or env specified use global.Promise
  67406. impl = {
  67407. Promise: global.Promise,
  67408. implementation: 'global.Promise'
  67409. }
  67410. } else if(implementation){
  67411. // if implementation specified, require it
  67412. var lib = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())
  67413. impl = {
  67414. Promise: lib.Promise || lib,
  67415. implementation: implementation
  67416. }
  67417. } else {
  67418. // try to auto detect implementation. This is non-deterministic
  67419. // and should prefer other branches, but this is our last chance
  67420. // to load something without throwing error
  67421. impl = tryAutoDetect()
  67422. }
  67423. if(impl === null){
  67424. throw new Error('Cannot find any-promise implementation nor'+
  67425. ' global.Promise. You must install polyfill or call'+
  67426. ' require("any-promise/register") with your preferred'+
  67427. ' implementation, e.g. require("any-promise/register/bluebird")'+
  67428. ' on application load prior to any require("any-promise").')
  67429. }
  67430. return impl
  67431. }
  67432. /**
  67433. * Determines if the global.Promise should be preferred if an implementation
  67434. * has not been registered.
  67435. */
  67436. function shouldPreferGlobalPromise(implementation){
  67437. if(implementation){
  67438. return implementation === 'global.Promise'
  67439. } else if(typeof global.Promise !== 'undefined'){
  67440. // Load global promise if implementation not specified
  67441. // Versions < 0.11 did not have global Promise
  67442. // Do not use for version < 0.12 as version 0.11 contained buggy versions
  67443. var version = (/v(\d+)\.(\d+)\.(\d+)/).exec(process.version)
  67444. return !(version && +version[1] == 0 && +version[2] < 12)
  67445. }
  67446. // do not have global.Promise or another implementation was specified
  67447. return false
  67448. }
  67449. /**
  67450. * Look for common libs as last resort there is no guarantee that
  67451. * this will return a desired implementation or even be deterministic.
  67452. * The priority is also nearly arbitrary. We are only doing this
  67453. * for older versions of Node.js <0.12 that do not have a reasonable
  67454. * global.Promise implementation and we the user has not registered
  67455. * the preference. This preserves the behavior of any-promise <= 0.1
  67456. * and may be deprecated or removed in the future
  67457. */
  67458. function tryAutoDetect(){
  67459. var libs = [
  67460. "es6-promise",
  67461. "promise",
  67462. "native-promise-only",
  67463. "bluebird",
  67464. "rsvp",
  67465. "when",
  67466. "q",
  67467. "pinkie",
  67468. "lie",
  67469. "vow"]
  67470. var i = 0, len = libs.length
  67471. for(; i < len; i++){
  67472. try {
  67473. return loadImplementation(libs[i])
  67474. } catch(e){}
  67475. }
  67476. return null
  67477. }
  67478. /***/ }),
  67479. /* 451 */
  67480. /***/ (function(module, exports, __webpack_require__) {
  67481. "use strict";
  67482. /*!
  67483. * arr-flatten <https://github.com/jonschlinkert/arr-flatten>
  67484. *
  67485. * Copyright (c) 2014-2017, Jon Schlinkert.
  67486. * Released under the MIT License.
  67487. */
  67488. module.exports = function (arr) {
  67489. return flat(arr, []);
  67490. };
  67491. function flat(arr, res) {
  67492. var i = 0, cur;
  67493. var len = arr.length;
  67494. for (; i < len; i++) {
  67495. cur = arr[i];
  67496. Array.isArray(cur) ? flat(cur, res) : res.push(cur);
  67497. }
  67498. return res;
  67499. }
  67500. /***/ }),
  67501. /* 452 */
  67502. /***/ (function(module, exports, __webpack_require__) {
  67503. "use strict";
  67504. module.exports = function (arr, predicate, ctx) {
  67505. if (typeof Array.prototype.findIndex === 'function') {
  67506. return arr.findIndex(predicate, ctx);
  67507. }
  67508. if (typeof predicate !== 'function') {
  67509. throw new TypeError('predicate must be a function');
  67510. }
  67511. var list = Object(arr);
  67512. var len = list.length;
  67513. if (len === 0) {
  67514. return -1;
  67515. }
  67516. for (var i = 0; i < len; i++) {
  67517. if (predicate.call(ctx, list[i], i, list)) {
  67518. return i;
  67519. }
  67520. }
  67521. return -1;
  67522. };
  67523. /***/ }),
  67524. /* 453 */
  67525. /***/ (function(module, exports, __webpack_require__) {
  67526. "use strict";
  67527. var rawAsap = __webpack_require__(454);
  67528. var freeTasks = [];
  67529. /**
  67530. * Calls a task as soon as possible after returning, in its own event, with
  67531. * priority over IO events. An exception thrown in a task can be handled by
  67532. * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise
  67533. * crash the process. If the error is handled, all subsequent tasks will
  67534. * resume.
  67535. *
  67536. * @param {{call}} task A callable object, typically a function that takes no
  67537. * arguments.
  67538. */
  67539. module.exports = asap;
  67540. function asap(task) {
  67541. var rawTask;
  67542. if (freeTasks.length) {
  67543. rawTask = freeTasks.pop();
  67544. } else {
  67545. rawTask = new RawTask();
  67546. }
  67547. rawTask.task = task;
  67548. rawTask.domain = process.domain;
  67549. rawAsap(rawTask);
  67550. }
  67551. function RawTask() {
  67552. this.task = null;
  67553. this.domain = null;
  67554. }
  67555. RawTask.prototype.call = function () {
  67556. if (this.domain) {
  67557. this.domain.enter();
  67558. }
  67559. var threw = true;
  67560. try {
  67561. this.task.call();
  67562. threw = false;
  67563. // If the task throws an exception (presumably) Node.js restores the
  67564. // domain stack for the next event.
  67565. if (this.domain) {
  67566. this.domain.exit();
  67567. }
  67568. } finally {
  67569. // We use try/finally and a threw flag to avoid messing up stack traces
  67570. // when we catch and release errors.
  67571. if (threw) {
  67572. // In Node.js, uncaught exceptions are considered fatal errors.
  67573. // Re-throw them to interrupt flushing!
  67574. // Ensure that flushing continues if an uncaught exception is
  67575. // suppressed listening process.on("uncaughtException") or
  67576. // domain.on("error").
  67577. rawAsap.requestFlush();
  67578. }
  67579. // If the task threw an error, we do not want to exit the domain here.
  67580. // Exiting the domain would prevent the domain from catching the error.
  67581. this.task = null;
  67582. this.domain = null;
  67583. freeTasks.push(this);
  67584. }
  67585. };
  67586. /***/ }),
  67587. /* 454 */
  67588. /***/ (function(module, exports, __webpack_require__) {
  67589. "use strict";
  67590. var domain; // The domain module is executed on demand
  67591. var hasSetImmediate = typeof setImmediate === "function";
  67592. // Use the fastest means possible to execute a task in its own turn, with
  67593. // priority over other events including network IO events in Node.js.
  67594. //
  67595. // An exception thrown by a task will permanently interrupt the processing of
  67596. // subsequent tasks. The higher level `asap` function ensures that if an
  67597. // exception is thrown by a task, that the task queue will continue flushing as
  67598. // soon as possible, but if you use `rawAsap` directly, you are responsible to
  67599. // either ensure that no exceptions are thrown from your task, or to manually
  67600. // call `rawAsap.requestFlush` if an exception is thrown.
  67601. module.exports = rawAsap;
  67602. function rawAsap(task) {
  67603. if (!queue.length) {
  67604. requestFlush();
  67605. flushing = true;
  67606. }
  67607. // Avoids a function call
  67608. queue[queue.length] = task;
  67609. }
  67610. var queue = [];
  67611. // Once a flush has been requested, no further calls to `requestFlush` are
  67612. // necessary until the next `flush` completes.
  67613. var flushing = false;
  67614. // The position of the next task to execute in the task queue. This is
  67615. // preserved between calls to `flush` so that it can be resumed if
  67616. // a task throws an exception.
  67617. var index = 0;
  67618. // If a task schedules additional tasks recursively, the task queue can grow
  67619. // unbounded. To prevent memory excaustion, the task queue will periodically
  67620. // truncate already-completed tasks.
  67621. var capacity = 1024;
  67622. // The flush function processes all tasks that have been scheduled with
  67623. // `rawAsap` unless and until one of those tasks throws an exception.
  67624. // If a task throws an exception, `flush` ensures that its state will remain
  67625. // consistent and will resume where it left off when called again.
  67626. // However, `flush` does not make any arrangements to be called again if an
  67627. // exception is thrown.
  67628. function flush() {
  67629. while (index < queue.length) {
  67630. var currentIndex = index;
  67631. // Advance the index before calling the task. This ensures that we will
  67632. // begin flushing on the next task the task throws an error.
  67633. index = index + 1;
  67634. queue[currentIndex].call();
  67635. // Prevent leaking memory for long chains of recursive calls to `asap`.
  67636. // If we call `asap` within tasks scheduled by `asap`, the queue will
  67637. // grow, but to avoid an O(n) walk for every task we execute, we don't
  67638. // shift tasks off the queue after they have been executed.
  67639. // Instead, we periodically shift 1024 tasks off the queue.
  67640. if (index > capacity) {
  67641. // Manually shift all values starting at the index back to the
  67642. // beginning of the queue.
  67643. for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
  67644. queue[scan] = queue[scan + index];
  67645. }
  67646. queue.length -= index;
  67647. index = 0;
  67648. }
  67649. }
  67650. queue.length = 0;
  67651. index = 0;
  67652. flushing = false;
  67653. }
  67654. rawAsap.requestFlush = requestFlush;
  67655. function requestFlush() {
  67656. // Ensure flushing is not bound to any domain.
  67657. // It is not sufficient to exit the domain, because domains exist on a stack.
  67658. // To execute code outside of any domain, the following dance is necessary.
  67659. var parentDomain = process.domain;
  67660. if (parentDomain) {
  67661. if (!domain) {
  67662. // Lazy execute the domain module.
  67663. // Only employed if the user elects to use domains.
  67664. domain = __webpack_require__(1038);
  67665. }
  67666. domain.active = process.domain = null;
  67667. }
  67668. // `setImmediate` is slower that `process.nextTick`, but `process.nextTick`
  67669. // cannot handle recursion.
  67670. // `requestFlush` will only be called recursively from `asap.js`, to resume
  67671. // flushing after an error is thrown into a domain.
  67672. // Conveniently, `setImmediate` was introduced in the same version
  67673. // `process.nextTick` started throwing recursion errors.
  67674. if (flushing && hasSetImmediate) {
  67675. setImmediate(flush);
  67676. } else {
  67677. process.nextTick(flush);
  67678. }
  67679. if (parentDomain) {
  67680. domain.active = process.domain = parentDomain;
  67681. }
  67682. }
  67683. /***/ }),
  67684. /* 455 */
  67685. /***/ (function(module, exports, __webpack_require__) {
  67686. // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
  67687. var errors = __webpack_require__(191);
  67688. var types = __webpack_require__(192);
  67689. var Reader = __webpack_require__(456);
  67690. var Writer = __webpack_require__(457);
  67691. // --- Exports
  67692. module.exports = {
  67693. Reader: Reader,
  67694. Writer: Writer
  67695. };
  67696. for (var t in types) {
  67697. if (types.hasOwnProperty(t))
  67698. module.exports[t] = types[t];
  67699. }
  67700. for (var e in errors) {
  67701. if (errors.hasOwnProperty(e))
  67702. module.exports[e] = errors[e];
  67703. }
  67704. /***/ }),
  67705. /* 456 */
  67706. /***/ (function(module, exports, __webpack_require__) {
  67707. // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
  67708. var assert = __webpack_require__(50);
  67709. var Buffer = __webpack_require__(20).Buffer;
  67710. var ASN1 = __webpack_require__(192);
  67711. var errors = __webpack_require__(191);
  67712. // --- Globals
  67713. var newInvalidAsn1Error = errors.newInvalidAsn1Error;
  67714. // --- API
  67715. function Reader(data) {
  67716. if (!data || !Buffer.isBuffer(data))
  67717. throw new TypeError('data must be a node Buffer');
  67718. this._buf = data;
  67719. this._size = data.length;
  67720. // These hold the "current" state
  67721. this._len = 0;
  67722. this._offset = 0;
  67723. }
  67724. Object.defineProperty(Reader.prototype, 'length', {
  67725. enumerable: true,
  67726. get: function () { return (this._len); }
  67727. });
  67728. Object.defineProperty(Reader.prototype, 'offset', {
  67729. enumerable: true,
  67730. get: function () { return (this._offset); }
  67731. });
  67732. Object.defineProperty(Reader.prototype, 'remain', {
  67733. get: function () { return (this._size - this._offset); }
  67734. });
  67735. Object.defineProperty(Reader.prototype, 'buffer', {
  67736. get: function () { return (this._buf.slice(this._offset)); }
  67737. });
  67738. /**
  67739. * Reads a single byte and advances offset; you can pass in `true` to make this
  67740. * a "peek" operation (i.e., get the byte, but don't advance the offset).
  67741. *
  67742. * @param {Boolean} peek true means don't move offset.
  67743. * @return {Number} the next byte, null if not enough data.
  67744. */
  67745. Reader.prototype.readByte = function (peek) {
  67746. if (this._size - this._offset < 1)
  67747. return null;
  67748. var b = this._buf[this._offset] & 0xff;
  67749. if (!peek)
  67750. this._offset += 1;
  67751. return b;
  67752. };
  67753. Reader.prototype.peek = function () {
  67754. return this.readByte(true);
  67755. };
  67756. /**
  67757. * Reads a (potentially) variable length off the BER buffer. This call is
  67758. * not really meant to be called directly, as callers have to manipulate
  67759. * the internal buffer afterwards.
  67760. *
  67761. * As a result of this call, you can call `Reader.length`, until the
  67762. * next thing called that does a readLength.
  67763. *
  67764. * @return {Number} the amount of offset to advance the buffer.
  67765. * @throws {InvalidAsn1Error} on bad ASN.1
  67766. */
  67767. Reader.prototype.readLength = function (offset) {
  67768. if (offset === undefined)
  67769. offset = this._offset;
  67770. if (offset >= this._size)
  67771. return null;
  67772. var lenB = this._buf[offset++] & 0xff;
  67773. if (lenB === null)
  67774. return null;
  67775. if ((lenB & 0x80) === 0x80) {
  67776. lenB &= 0x7f;
  67777. if (lenB === 0)
  67778. throw newInvalidAsn1Error('Indefinite length not supported');
  67779. if (lenB > 4)
  67780. throw newInvalidAsn1Error('encoding too long');
  67781. if (this._size - offset < lenB)
  67782. return null;
  67783. this._len = 0;
  67784. for (var i = 0; i < lenB; i++)
  67785. this._len = (this._len << 8) + (this._buf[offset++] & 0xff);
  67786. } else {
  67787. // Wasn't a variable length
  67788. this._len = lenB;
  67789. }
  67790. return offset;
  67791. };
  67792. /**
  67793. * Parses the next sequence in this BER buffer.
  67794. *
  67795. * To get the length of the sequence, call `Reader.length`.
  67796. *
  67797. * @return {Number} the sequence's tag.
  67798. */
  67799. Reader.prototype.readSequence = function (tag) {
  67800. var seq = this.peek();
  67801. if (seq === null)
  67802. return null;
  67803. if (tag !== undefined && tag !== seq)
  67804. throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
  67805. ': got 0x' + seq.toString(16));
  67806. var o = this.readLength(this._offset + 1); // stored in `length`
  67807. if (o === null)
  67808. return null;
  67809. this._offset = o;
  67810. return seq;
  67811. };
  67812. Reader.prototype.readInt = function () {
  67813. return this._readTag(ASN1.Integer);
  67814. };
  67815. Reader.prototype.readBoolean = function () {
  67816. return (this._readTag(ASN1.Boolean) === 0 ? false : true);
  67817. };
  67818. Reader.prototype.readEnumeration = function () {
  67819. return this._readTag(ASN1.Enumeration);
  67820. };
  67821. Reader.prototype.readString = function (tag, retbuf) {
  67822. if (!tag)
  67823. tag = ASN1.OctetString;
  67824. var b = this.peek();
  67825. if (b === null)
  67826. return null;
  67827. if (b !== tag)
  67828. throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
  67829. ': got 0x' + b.toString(16));
  67830. var o = this.readLength(this._offset + 1); // stored in `length`
  67831. if (o === null)
  67832. return null;
  67833. if (this.length > this._size - o)
  67834. return null;
  67835. this._offset = o;
  67836. if (this.length === 0)
  67837. return retbuf ? Buffer.alloc(0) : '';
  67838. var str = this._buf.slice(this._offset, this._offset + this.length);
  67839. this._offset += this.length;
  67840. return retbuf ? str : str.toString('utf8');
  67841. };
  67842. Reader.prototype.readOID = function (tag) {
  67843. if (!tag)
  67844. tag = ASN1.OID;
  67845. var b = this.readString(tag, true);
  67846. if (b === null)
  67847. return null;
  67848. var values = [];
  67849. var value = 0;
  67850. for (var i = 0; i < b.length; i++) {
  67851. var byte = b[i] & 0xff;
  67852. value <<= 7;
  67853. value += byte & 0x7f;
  67854. if ((byte & 0x80) === 0) {
  67855. values.push(value);
  67856. value = 0;
  67857. }
  67858. }
  67859. value = values.shift();
  67860. values.unshift(value % 40);
  67861. values.unshift((value / 40) >> 0);
  67862. return values.join('.');
  67863. };
  67864. Reader.prototype._readTag = function (tag) {
  67865. assert.ok(tag !== undefined);
  67866. var b = this.peek();
  67867. if (b === null)
  67868. return null;
  67869. if (b !== tag)
  67870. throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
  67871. ': got 0x' + b.toString(16));
  67872. var o = this.readLength(this._offset + 1); // stored in `length`
  67873. if (o === null)
  67874. return null;
  67875. if (this.length > 4)
  67876. throw newInvalidAsn1Error('Integer too long: ' + this.length);
  67877. if (this.length > this._size - o)
  67878. return null;
  67879. this._offset = o;
  67880. var fb = this._buf[this._offset];
  67881. var value = 0;
  67882. for (var i = 0; i < this.length; i++) {
  67883. value <<= 8;
  67884. value |= (this._buf[this._offset++] & 0xff);
  67885. }
  67886. if ((fb & 0x80) === 0x80 && i !== 4)
  67887. value -= (1 << (i * 8));
  67888. return value >> 0;
  67889. };
  67890. // --- Exported API
  67891. module.exports = Reader;
  67892. /***/ }),
  67893. /* 457 */
  67894. /***/ (function(module, exports, __webpack_require__) {
  67895. // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
  67896. var assert = __webpack_require__(50);
  67897. var Buffer = __webpack_require__(20).Buffer;
  67898. var ASN1 = __webpack_require__(192);
  67899. var errors = __webpack_require__(191);
  67900. // --- Globals
  67901. var newInvalidAsn1Error = errors.newInvalidAsn1Error;
  67902. var DEFAULT_OPTS = {
  67903. size: 1024,
  67904. growthFactor: 8
  67905. };
  67906. // --- Helpers
  67907. function merge(from, to) {
  67908. assert.ok(from);
  67909. assert.equal(typeof (from), 'object');
  67910. assert.ok(to);
  67911. assert.equal(typeof (to), 'object');
  67912. var keys = Object.getOwnPropertyNames(from);
  67913. keys.forEach(function (key) {
  67914. if (to[key])
  67915. return;
  67916. var value = Object.getOwnPropertyDescriptor(from, key);
  67917. Object.defineProperty(to, key, value);
  67918. });
  67919. return to;
  67920. }
  67921. // --- API
  67922. function Writer(options) {
  67923. options = merge(DEFAULT_OPTS, options || {});
  67924. this._buf = Buffer.alloc(options.size || 1024);
  67925. this._size = this._buf.length;
  67926. this._offset = 0;
  67927. this._options = options;
  67928. // A list of offsets in the buffer where we need to insert
  67929. // sequence tag/len pairs.
  67930. this._seq = [];
  67931. }
  67932. Object.defineProperty(Writer.prototype, 'buffer', {
  67933. get: function () {
  67934. if (this._seq.length)
  67935. throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)');
  67936. return (this._buf.slice(0, this._offset));
  67937. }
  67938. });
  67939. Writer.prototype.writeByte = function (b) {
  67940. if (typeof (b) !== 'number')
  67941. throw new TypeError('argument must be a Number');
  67942. this._ensure(1);
  67943. this._buf[this._offset++] = b;
  67944. };
  67945. Writer.prototype.writeInt = function (i, tag) {
  67946. if (typeof (i) !== 'number')
  67947. throw new TypeError('argument must be a Number');
  67948. if (typeof (tag) !== 'number')
  67949. tag = ASN1.Integer;
  67950. var sz = 4;
  67951. while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) &&
  67952. (sz > 1)) {
  67953. sz--;
  67954. i <<= 8;
  67955. }
  67956. if (sz > 4)
  67957. throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff');
  67958. this._ensure(2 + sz);
  67959. this._buf[this._offset++] = tag;
  67960. this._buf[this._offset++] = sz;
  67961. while (sz-- > 0) {
  67962. this._buf[this._offset++] = ((i & 0xff000000) >>> 24);
  67963. i <<= 8;
  67964. }
  67965. };
  67966. Writer.prototype.writeNull = function () {
  67967. this.writeByte(ASN1.Null);
  67968. this.writeByte(0x00);
  67969. };
  67970. Writer.prototype.writeEnumeration = function (i, tag) {
  67971. if (typeof (i) !== 'number')
  67972. throw new TypeError('argument must be a Number');
  67973. if (typeof (tag) !== 'number')
  67974. tag = ASN1.Enumeration;
  67975. return this.writeInt(i, tag);
  67976. };
  67977. Writer.prototype.writeBoolean = function (b, tag) {
  67978. if (typeof (b) !== 'boolean')
  67979. throw new TypeError('argument must be a Boolean');
  67980. if (typeof (tag) !== 'number')
  67981. tag = ASN1.Boolean;
  67982. this._ensure(3);
  67983. this._buf[this._offset++] = tag;
  67984. this._buf[this._offset++] = 0x01;
  67985. this._buf[this._offset++] = b ? 0xff : 0x00;
  67986. };
  67987. Writer.prototype.writeString = function (s, tag) {
  67988. if (typeof (s) !== 'string')
  67989. throw new TypeError('argument must be a string (was: ' + typeof (s) + ')');
  67990. if (typeof (tag) !== 'number')
  67991. tag = ASN1.OctetString;
  67992. var len = Buffer.byteLength(s);
  67993. this.writeByte(tag);
  67994. this.writeLength(len);
  67995. if (len) {
  67996. this._ensure(len);
  67997. this._buf.write(s, this._offset);
  67998. this._offset += len;
  67999. }
  68000. };
  68001. Writer.prototype.writeBuffer = function (buf, tag) {
  68002. if (typeof (tag) !== 'number')
  68003. throw new TypeError('tag must be a number');
  68004. if (!Buffer.isBuffer(buf))
  68005. throw new TypeError('argument must be a buffer');
  68006. this.writeByte(tag);
  68007. this.writeLength(buf.length);
  68008. this._ensure(buf.length);
  68009. buf.copy(this._buf, this._offset, 0, buf.length);
  68010. this._offset += buf.length;
  68011. };
  68012. Writer.prototype.writeStringArray = function (strings) {
  68013. if ((!strings instanceof Array))
  68014. throw new TypeError('argument must be an Array[String]');
  68015. var self = this;
  68016. strings.forEach(function (s) {
  68017. self.writeString(s);
  68018. });
  68019. };
  68020. // This is really to solve DER cases, but whatever for now
  68021. Writer.prototype.writeOID = function (s, tag) {
  68022. if (typeof (s) !== 'string')
  68023. throw new TypeError('argument must be a string');
  68024. if (typeof (tag) !== 'number')
  68025. tag = ASN1.OID;
  68026. if (!/^([0-9]+\.){3,}[0-9]+$/.test(s))
  68027. throw new Error('argument is not a valid OID string');
  68028. function encodeOctet(bytes, octet) {
  68029. if (octet < 128) {
  68030. bytes.push(octet);
  68031. } else if (octet < 16384) {
  68032. bytes.push((octet >>> 7) | 0x80);
  68033. bytes.push(octet & 0x7F);
  68034. } else if (octet < 2097152) {
  68035. bytes.push((octet >>> 14) | 0x80);
  68036. bytes.push(((octet >>> 7) | 0x80) & 0xFF);
  68037. bytes.push(octet & 0x7F);
  68038. } else if (octet < 268435456) {
  68039. bytes.push((octet >>> 21) | 0x80);
  68040. bytes.push(((octet >>> 14) | 0x80) & 0xFF);
  68041. bytes.push(((octet >>> 7) | 0x80) & 0xFF);
  68042. bytes.push(octet & 0x7F);
  68043. } else {
  68044. bytes.push(((octet >>> 28) | 0x80) & 0xFF);
  68045. bytes.push(((octet >>> 21) | 0x80) & 0xFF);
  68046. bytes.push(((octet >>> 14) | 0x80) & 0xFF);
  68047. bytes.push(((octet >>> 7) | 0x80) & 0xFF);
  68048. bytes.push(octet & 0x7F);
  68049. }
  68050. }
  68051. var tmp = s.split('.');
  68052. var bytes = [];
  68053. bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));
  68054. tmp.slice(2).forEach(function (b) {
  68055. encodeOctet(bytes, parseInt(b, 10));
  68056. });
  68057. var self = this;
  68058. this._ensure(2 + bytes.length);
  68059. this.writeByte(tag);
  68060. this.writeLength(bytes.length);
  68061. bytes.forEach(function (b) {
  68062. self.writeByte(b);
  68063. });
  68064. };
  68065. Writer.prototype.writeLength = function (len) {
  68066. if (typeof (len) !== 'number')
  68067. throw new TypeError('argument must be a Number');
  68068. this._ensure(4);
  68069. if (len <= 0x7f) {
  68070. this._buf[this._offset++] = len;
  68071. } else if (len <= 0xff) {
  68072. this._buf[this._offset++] = 0x81;
  68073. this._buf[this._offset++] = len;
  68074. } else if (len <= 0xffff) {
  68075. this._buf[this._offset++] = 0x82;
  68076. this._buf[this._offset++] = len >> 8;
  68077. this._buf[this._offset++] = len;
  68078. } else if (len <= 0xffffff) {
  68079. this._buf[this._offset++] = 0x83;
  68080. this._buf[this._offset++] = len >> 16;
  68081. this._buf[this._offset++] = len >> 8;
  68082. this._buf[this._offset++] = len;
  68083. } else {
  68084. throw newInvalidAsn1Error('Length too long (> 4 bytes)');
  68085. }
  68086. };
  68087. Writer.prototype.startSequence = function (tag) {
  68088. if (typeof (tag) !== 'number')
  68089. tag = ASN1.Sequence | ASN1.Constructor;
  68090. this.writeByte(tag);
  68091. this._seq.push(this._offset);
  68092. this._ensure(3);
  68093. this._offset += 3;
  68094. };
  68095. Writer.prototype.endSequence = function () {
  68096. var seq = this._seq.pop();
  68097. var start = seq + 3;
  68098. var len = this._offset - start;
  68099. if (len <= 0x7f) {
  68100. this._shift(start, len, -2);
  68101. this._buf[seq] = len;
  68102. } else if (len <= 0xff) {
  68103. this._shift(start, len, -1);
  68104. this._buf[seq] = 0x81;
  68105. this._buf[seq + 1] = len;
  68106. } else if (len <= 0xffff) {
  68107. this._buf[seq] = 0x82;
  68108. this._buf[seq + 1] = len >> 8;
  68109. this._buf[seq + 2] = len;
  68110. } else if (len <= 0xffffff) {
  68111. this._shift(start, len, 1);
  68112. this._buf[seq] = 0x83;
  68113. this._buf[seq + 1] = len >> 16;
  68114. this._buf[seq + 2] = len >> 8;
  68115. this._buf[seq + 3] = len;
  68116. } else {
  68117. throw newInvalidAsn1Error('Sequence too long');
  68118. }
  68119. };
  68120. Writer.prototype._shift = function (start, len, shift) {
  68121. assert.ok(start !== undefined);
  68122. assert.ok(len !== undefined);
  68123. assert.ok(shift);
  68124. this._buf.copy(this._buf, start + shift, start, start + len);
  68125. this._offset += shift;
  68126. };
  68127. Writer.prototype._ensure = function (len) {
  68128. assert.ok(len);
  68129. if (this._size - this._offset < len) {
  68130. var sz = this._size * this._options.growthFactor;
  68131. if (sz - this._offset < len)
  68132. sz += len;
  68133. var buf = Buffer.alloc(sz);
  68134. this._buf.copy(buf, 0, 0, this._offset);
  68135. this._buf = buf;
  68136. this._size = sz;
  68137. }
  68138. };
  68139. // --- Exported API
  68140. module.exports = Writer;
  68141. /***/ }),
  68142. /* 458 */
  68143. /***/ (function(module, exports, __webpack_require__) {
  68144. module.exports =
  68145. {
  68146. parallel : __webpack_require__(460),
  68147. serial : __webpack_require__(461),
  68148. serialOrdered : __webpack_require__(284)
  68149. };
  68150. /***/ }),
  68151. /* 459 */
  68152. /***/ (function(module, exports) {
  68153. module.exports = defer;
  68154. /**
  68155. * Runs provided function on next iteration of the event loop
  68156. *
  68157. * @param {function} fn - function to run
  68158. */
  68159. function defer(fn)
  68160. {
  68161. var nextTick = typeof setImmediate == 'function'
  68162. ? setImmediate
  68163. : (
  68164. typeof process == 'object' && typeof process.nextTick == 'function'
  68165. ? process.nextTick
  68166. : null
  68167. );
  68168. if (nextTick)
  68169. {
  68170. nextTick(fn);
  68171. }
  68172. else
  68173. {
  68174. setTimeout(fn, 0);
  68175. }
  68176. }
  68177. /***/ }),
  68178. /* 460 */
  68179. /***/ (function(module, exports, __webpack_require__) {
  68180. var iterate = __webpack_require__(281)
  68181. , initState = __webpack_require__(282)
  68182. , terminator = __webpack_require__(283)
  68183. ;
  68184. // Public API
  68185. module.exports = parallel;
  68186. /**
  68187. * Runs iterator over provided array elements in parallel
  68188. *
  68189. * @param {array|object} list - array or object (named list) to iterate over
  68190. * @param {function} iterator - iterator to run
  68191. * @param {function} callback - invoked when all elements processed
  68192. * @returns {function} - jobs terminator
  68193. */
  68194. function parallel(list, iterator, callback)
  68195. {
  68196. var state = initState(list);
  68197. while (state.index < (state['keyedList'] || list).length)
  68198. {
  68199. iterate(list, iterator, state, function(error, result)
  68200. {
  68201. if (error)
  68202. {
  68203. callback(error, result);
  68204. return;
  68205. }
  68206. // looks like it's the last one
  68207. if (Object.keys(state.jobs).length === 0)
  68208. {
  68209. callback(null, state.results);
  68210. return;
  68211. }
  68212. });
  68213. state.index++;
  68214. }
  68215. return terminator.bind(state, callback);
  68216. }
  68217. /***/ }),
  68218. /* 461 */
  68219. /***/ (function(module, exports, __webpack_require__) {
  68220. var serialOrdered = __webpack_require__(284);
  68221. // Public API
  68222. module.exports = serial;
  68223. /**
  68224. * Runs iterator over provided array elements in series
  68225. *
  68226. * @param {array|object} list - array or object (named list) to iterate over
  68227. * @param {function} iterator - iterator to run
  68228. * @param {function} callback - invoked when all elements processed
  68229. * @returns {function} - jobs terminator
  68230. */
  68231. function serial(list, iterator, callback)
  68232. {
  68233. return serialOrdered(list, iterator, null, callback);
  68234. }
  68235. /***/ }),
  68236. /* 462 */
  68237. /***/ (function(module, exports, __webpack_require__) {
  68238. /*!
  68239. * Copyright 2010 LearnBoost <dev@learnboost.com>
  68240. *
  68241. * Licensed under the Apache License, Version 2.0 (the "License");
  68242. * you may not use this file except in compliance with the License.
  68243. * You may obtain a copy of the License at
  68244. *
  68245. * http://www.apache.org/licenses/LICENSE-2.0
  68246. *
  68247. * Unless required by applicable law or agreed to in writing, software
  68248. * distributed under the License is distributed on an "AS IS" BASIS,
  68249. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  68250. * See the License for the specific language governing permissions and
  68251. * limitations under the License.
  68252. */
  68253. /**
  68254. * Module dependencies.
  68255. */
  68256. var crypto = __webpack_require__(21)
  68257. , parse = __webpack_require__(29).parse
  68258. ;
  68259. /**
  68260. * Valid keys.
  68261. */
  68262. var keys =
  68263. [ 'acl'
  68264. , 'location'
  68265. , 'logging'
  68266. , 'notification'
  68267. , 'partNumber'
  68268. , 'policy'
  68269. , 'requestPayment'
  68270. , 'torrent'
  68271. , 'uploadId'
  68272. , 'uploads'
  68273. , 'versionId'
  68274. , 'versioning'
  68275. , 'versions'
  68276. , 'website'
  68277. ]
  68278. /**
  68279. * Return an "Authorization" header value with the given `options`
  68280. * in the form of "AWS <key>:<signature>"
  68281. *
  68282. * @param {Object} options
  68283. * @return {String}
  68284. * @api private
  68285. */
  68286. function authorization (options) {
  68287. return 'AWS ' + options.key + ':' + sign(options)
  68288. }
  68289. module.exports = authorization
  68290. module.exports.authorization = authorization
  68291. /**
  68292. * Simple HMAC-SHA1 Wrapper
  68293. *
  68294. * @param {Object} options
  68295. * @return {String}
  68296. * @api private
  68297. */
  68298. function hmacSha1 (options) {
  68299. return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64')
  68300. }
  68301. module.exports.hmacSha1 = hmacSha1
  68302. /**
  68303. * Create a base64 sha1 HMAC for `options`.
  68304. *
  68305. * @param {Object} options
  68306. * @return {String}
  68307. * @api private
  68308. */
  68309. function sign (options) {
  68310. options.message = stringToSign(options)
  68311. return hmacSha1(options)
  68312. }
  68313. module.exports.sign = sign
  68314. /**
  68315. * Create a base64 sha1 HMAC for `options`.
  68316. *
  68317. * Specifically to be used with S3 presigned URLs
  68318. *
  68319. * @param {Object} options
  68320. * @return {String}
  68321. * @api private
  68322. */
  68323. function signQuery (options) {
  68324. options.message = queryStringToSign(options)
  68325. return hmacSha1(options)
  68326. }
  68327. module.exports.signQuery= signQuery
  68328. /**
  68329. * Return a string for sign() with the given `options`.
  68330. *
  68331. * Spec:
  68332. *
  68333. * <verb>\n
  68334. * <md5>\n
  68335. * <content-type>\n
  68336. * <date>\n
  68337. * [headers\n]
  68338. * <resource>
  68339. *
  68340. * @param {Object} options
  68341. * @return {String}
  68342. * @api private
  68343. */
  68344. function stringToSign (options) {
  68345. var headers = options.amazonHeaders || ''
  68346. if (headers) headers += '\n'
  68347. var r =
  68348. [ options.verb
  68349. , options.md5
  68350. , options.contentType
  68351. , options.date ? options.date.toUTCString() : ''
  68352. , headers + options.resource
  68353. ]
  68354. return r.join('\n')
  68355. }
  68356. module.exports.stringToSign = stringToSign
  68357. /**
  68358. * Return a string for sign() with the given `options`, but is meant exclusively
  68359. * for S3 presigned URLs
  68360. *
  68361. * Spec:
  68362. *
  68363. * <date>\n
  68364. * <resource>
  68365. *
  68366. * @param {Object} options
  68367. * @return {String}
  68368. * @api private
  68369. */
  68370. function queryStringToSign (options){
  68371. return 'GET\n\n\n' + options.date + '\n' + options.resource
  68372. }
  68373. module.exports.queryStringToSign = queryStringToSign
  68374. /**
  68375. * Perform the following:
  68376. *
  68377. * - ignore non-amazon headers
  68378. * - lowercase fields
  68379. * - sort lexicographically
  68380. * - trim whitespace between ":"
  68381. * - join with newline
  68382. *
  68383. * @param {Object} headers
  68384. * @return {String}
  68385. * @api private
  68386. */
  68387. function canonicalizeHeaders (headers) {
  68388. var buf = []
  68389. , fields = Object.keys(headers)
  68390. ;
  68391. for (var i = 0, len = fields.length; i < len; ++i) {
  68392. var field = fields[i]
  68393. , val = headers[field]
  68394. , field = field.toLowerCase()
  68395. ;
  68396. if (0 !== field.indexOf('x-amz')) continue
  68397. buf.push(field + ':' + val)
  68398. }
  68399. return buf.sort().join('\n')
  68400. }
  68401. module.exports.canonicalizeHeaders = canonicalizeHeaders
  68402. /**
  68403. * Perform the following:
  68404. *
  68405. * - ignore non sub-resources
  68406. * - sort lexicographically
  68407. *
  68408. * @param {String} resource
  68409. * @return {String}
  68410. * @api private
  68411. */
  68412. function canonicalizeResource (resource) {
  68413. var url = parse(resource, true)
  68414. , path = url.pathname
  68415. , buf = []
  68416. ;
  68417. Object.keys(url.query).forEach(function(key){
  68418. if (!~keys.indexOf(key)) return
  68419. var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key])
  68420. buf.push(key + val)
  68421. })
  68422. return path + (buf.length ? '?' + buf.sort().join('&') : '')
  68423. }
  68424. module.exports.canonicalizeResource = canonicalizeResource
  68425. /***/ }),
  68426. /* 463 */
  68427. /***/ (function(module, exports, __webpack_require__) {
  68428. var aws4 = exports,
  68429. url = __webpack_require__(29),
  68430. querystring = __webpack_require__(186),
  68431. crypto = __webpack_require__(21),
  68432. lru = __webpack_require__(464),
  68433. credentialsCache = lru(1000)
  68434. // http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html
  68435. function hmac(key, string, encoding) {
  68436. return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding)
  68437. }
  68438. function hash(string, encoding) {
  68439. return crypto.createHash('sha256').update(string, 'utf8').digest(encoding)
  68440. }
  68441. // This function assumes the string has already been percent encoded
  68442. function encodeRfc3986(urlEncodedString) {
  68443. return urlEncodedString.replace(/[!'()*]/g, function(c) {
  68444. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  68445. })
  68446. }
  68447. // request: { path | body, [host], [method], [headers], [service], [region] }
  68448. // credentials: { accessKeyId, secretAccessKey, [sessionToken] }
  68449. function RequestSigner(request, credentials) {
  68450. if (typeof request === 'string') request = url.parse(request)
  68451. var headers = request.headers = (request.headers || {}),
  68452. hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host)
  68453. this.request = request
  68454. this.credentials = credentials || this.defaultCredentials()
  68455. this.service = request.service || hostParts[0] || ''
  68456. this.region = request.region || hostParts[1] || 'us-east-1'
  68457. // SES uses a different domain from the service name
  68458. if (this.service === 'email') this.service = 'ses'
  68459. if (!request.method && request.body)
  68460. request.method = 'POST'
  68461. if (!headers.Host && !headers.host) {
  68462. headers.Host = request.hostname || request.host || this.createHost()
  68463. // If a port is specified explicitly, use it as is
  68464. if (request.port)
  68465. headers.Host += ':' + request.port
  68466. }
  68467. if (!request.hostname && !request.host)
  68468. request.hostname = headers.Host || headers.host
  68469. this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT'
  68470. }
  68471. RequestSigner.prototype.matchHost = function(host) {
  68472. var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/)
  68473. var hostParts = (match || []).slice(1, 3)
  68474. // ES's hostParts are sometimes the other way round, if the value that is expected
  68475. // to be region equals ‘es’ switch them back
  68476. // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com
  68477. if (hostParts[1] === 'es')
  68478. hostParts = hostParts.reverse()
  68479. return hostParts
  68480. }
  68481. // http://docs.aws.amazon.com/general/latest/gr/rande.html
  68482. RequestSigner.prototype.isSingleRegion = function() {
  68483. // Special case for S3 and SimpleDB in us-east-1
  68484. if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true
  68485. return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts']
  68486. .indexOf(this.service) >= 0
  68487. }
  68488. RequestSigner.prototype.createHost = function() {
  68489. var region = this.isSingleRegion() ? '' :
  68490. (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region,
  68491. service = this.service === 'ses' ? 'email' : this.service
  68492. return service + region + '.amazonaws.com'
  68493. }
  68494. RequestSigner.prototype.prepareRequest = function() {
  68495. this.parsePath()
  68496. var request = this.request, headers = request.headers, query
  68497. if (request.signQuery) {
  68498. this.parsedPath.query = query = this.parsedPath.query || {}
  68499. if (this.credentials.sessionToken)
  68500. query['X-Amz-Security-Token'] = this.credentials.sessionToken
  68501. if (this.service === 's3' && !query['X-Amz-Expires'])
  68502. query['X-Amz-Expires'] = 86400
  68503. if (query['X-Amz-Date'])
  68504. this.datetime = query['X-Amz-Date']
  68505. else
  68506. query['X-Amz-Date'] = this.getDateTime()
  68507. query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'
  68508. query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString()
  68509. query['X-Amz-SignedHeaders'] = this.signedHeaders()
  68510. } else {
  68511. if (!request.doNotModifyHeaders && !this.isCodeCommitGit) {
  68512. if (request.body && !headers['Content-Type'] && !headers['content-type'])
  68513. headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'
  68514. if (request.body && !headers['Content-Length'] && !headers['content-length'])
  68515. headers['Content-Length'] = Buffer.byteLength(request.body)
  68516. if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token'])
  68517. headers['X-Amz-Security-Token'] = this.credentials.sessionToken
  68518. if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256'])
  68519. headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex')
  68520. if (headers['X-Amz-Date'] || headers['x-amz-date'])
  68521. this.datetime = headers['X-Amz-Date'] || headers['x-amz-date']
  68522. else
  68523. headers['X-Amz-Date'] = this.getDateTime()
  68524. }
  68525. delete headers.Authorization
  68526. delete headers.authorization
  68527. }
  68528. }
  68529. RequestSigner.prototype.sign = function() {
  68530. if (!this.parsedPath) this.prepareRequest()
  68531. if (this.request.signQuery) {
  68532. this.parsedPath.query['X-Amz-Signature'] = this.signature()
  68533. } else {
  68534. this.request.headers.Authorization = this.authHeader()
  68535. }
  68536. this.request.path = this.formatPath()
  68537. return this.request
  68538. }
  68539. RequestSigner.prototype.getDateTime = function() {
  68540. if (!this.datetime) {
  68541. var headers = this.request.headers,
  68542. date = new Date(headers.Date || headers.date || new Date)
  68543. this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '')
  68544. // Remove the trailing 'Z' on the timestamp string for CodeCommit git access
  68545. if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1)
  68546. }
  68547. return this.datetime
  68548. }
  68549. RequestSigner.prototype.getDate = function() {
  68550. return this.getDateTime().substr(0, 8)
  68551. }
  68552. RequestSigner.prototype.authHeader = function() {
  68553. return [
  68554. 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(),
  68555. 'SignedHeaders=' + this.signedHeaders(),
  68556. 'Signature=' + this.signature(),
  68557. ].join(', ')
  68558. }
  68559. RequestSigner.prototype.signature = function() {
  68560. var date = this.getDate(),
  68561. cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(),
  68562. kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey)
  68563. if (!kCredentials) {
  68564. kDate = hmac('AWS4' + this.credentials.secretAccessKey, date)
  68565. kRegion = hmac(kDate, this.region)
  68566. kService = hmac(kRegion, this.service)
  68567. kCredentials = hmac(kService, 'aws4_request')
  68568. credentialsCache.set(cacheKey, kCredentials)
  68569. }
  68570. return hmac(kCredentials, this.stringToSign(), 'hex')
  68571. }
  68572. RequestSigner.prototype.stringToSign = function() {
  68573. return [
  68574. 'AWS4-HMAC-SHA256',
  68575. this.getDateTime(),
  68576. this.credentialString(),
  68577. hash(this.canonicalString(), 'hex'),
  68578. ].join('\n')
  68579. }
  68580. RequestSigner.prototype.canonicalString = function() {
  68581. if (!this.parsedPath) this.prepareRequest()
  68582. var pathStr = this.parsedPath.path,
  68583. query = this.parsedPath.query,
  68584. headers = this.request.headers,
  68585. queryStr = '',
  68586. normalizePath = this.service !== 's3',
  68587. decodePath = this.service === 's3' || this.request.doNotEncodePath,
  68588. decodeSlashesInPath = this.service === 's3',
  68589. firstValOnly = this.service === 's3',
  68590. bodyHash
  68591. if (this.service === 's3' && this.request.signQuery) {
  68592. bodyHash = 'UNSIGNED-PAYLOAD'
  68593. } else if (this.isCodeCommitGit) {
  68594. bodyHash = ''
  68595. } else {
  68596. bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] ||
  68597. hash(this.request.body || '', 'hex')
  68598. }
  68599. if (query) {
  68600. queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) {
  68601. if (!key) return obj
  68602. obj[key] = !Array.isArray(query[key]) ? query[key] :
  68603. (firstValOnly ? query[key][0] : query[key].slice().sort())
  68604. return obj
  68605. }, {})))
  68606. }
  68607. if (pathStr !== '/') {
  68608. if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/')
  68609. pathStr = pathStr.split('/').reduce(function(path, piece) {
  68610. if (normalizePath && piece === '..') {
  68611. path.pop()
  68612. } else if (!normalizePath || piece !== '.') {
  68613. if (decodePath) piece = decodeURIComponent(piece)
  68614. path.push(encodeRfc3986(encodeURIComponent(piece)))
  68615. }
  68616. return path
  68617. }, []).join('/')
  68618. if (pathStr[0] !== '/') pathStr = '/' + pathStr
  68619. if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/')
  68620. }
  68621. return [
  68622. this.request.method || 'GET',
  68623. pathStr,
  68624. queryStr,
  68625. this.canonicalHeaders() + '\n',
  68626. this.signedHeaders(),
  68627. bodyHash,
  68628. ].join('\n')
  68629. }
  68630. RequestSigner.prototype.canonicalHeaders = function() {
  68631. var headers = this.request.headers
  68632. function trimAll(header) {
  68633. return header.toString().trim().replace(/\s+/g, ' ')
  68634. }
  68635. return Object.keys(headers)
  68636. .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 })
  68637. .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) })
  68638. .join('\n')
  68639. }
  68640. RequestSigner.prototype.signedHeaders = function() {
  68641. return Object.keys(this.request.headers)
  68642. .map(function(key) { return key.toLowerCase() })
  68643. .sort()
  68644. .join(';')
  68645. }
  68646. RequestSigner.prototype.credentialString = function() {
  68647. return [
  68648. this.getDate(),
  68649. this.region,
  68650. this.service,
  68651. 'aws4_request',
  68652. ].join('/')
  68653. }
  68654. RequestSigner.prototype.defaultCredentials = function() {
  68655. var env = process.env
  68656. return {
  68657. accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY,
  68658. secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY,
  68659. sessionToken: env.AWS_SESSION_TOKEN,
  68660. }
  68661. }
  68662. RequestSigner.prototype.parsePath = function() {
  68663. var path = this.request.path || '/',
  68664. queryIx = path.indexOf('?'),
  68665. query = null
  68666. if (queryIx >= 0) {
  68667. query = querystring.parse(path.slice(queryIx + 1))
  68668. path = path.slice(0, queryIx)
  68669. }
  68670. // S3 doesn't always encode characters > 127 correctly and
  68671. // all services don't encode characters > 255 correctly
  68672. // So if there are non-reserved chars (and it's not already all % encoded), just encode them all
  68673. if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) {
  68674. path = path.split('/').map(function(piece) {
  68675. return encodeURIComponent(decodeURIComponent(piece))
  68676. }).join('/')
  68677. }
  68678. this.parsedPath = {
  68679. path: path,
  68680. query: query,
  68681. }
  68682. }
  68683. RequestSigner.prototype.formatPath = function() {
  68684. var path = this.parsedPath.path,
  68685. query = this.parsedPath.query
  68686. if (!query) return path
  68687. // Services don't support empty query string keys
  68688. if (query[''] != null) delete query['']
  68689. return path + '?' + encodeRfc3986(querystring.stringify(query))
  68690. }
  68691. aws4.RequestSigner = RequestSigner
  68692. aws4.sign = function(request, credentials) {
  68693. return new RequestSigner(request, credentials).sign()
  68694. }
  68695. /***/ }),
  68696. /* 464 */
  68697. /***/ (function(module, exports) {
  68698. module.exports = function(size) {
  68699. return new LruCache(size)
  68700. }
  68701. function LruCache(size) {
  68702. this.capacity = size | 0
  68703. this.map = Object.create(null)
  68704. this.list = new DoublyLinkedList()
  68705. }
  68706. LruCache.prototype.get = function(key) {
  68707. var node = this.map[key]
  68708. if (node == null) return undefined
  68709. this.used(node)
  68710. return node.val
  68711. }
  68712. LruCache.prototype.set = function(key, val) {
  68713. var node = this.map[key]
  68714. if (node != null) {
  68715. node.val = val
  68716. } else {
  68717. if (!this.capacity) this.prune()
  68718. if (!this.capacity) return false
  68719. node = new DoublyLinkedNode(key, val)
  68720. this.map[key] = node
  68721. this.capacity--
  68722. }
  68723. this.used(node)
  68724. return true
  68725. }
  68726. LruCache.prototype.used = function(node) {
  68727. this.list.moveToFront(node)
  68728. }
  68729. LruCache.prototype.prune = function() {
  68730. var node = this.list.pop()
  68731. if (node != null) {
  68732. delete this.map[node.key]
  68733. this.capacity++
  68734. }
  68735. }
  68736. function DoublyLinkedList() {
  68737. this.firstNode = null
  68738. this.lastNode = null
  68739. }
  68740. DoublyLinkedList.prototype.moveToFront = function(node) {
  68741. if (this.firstNode == node) return
  68742. this.remove(node)
  68743. if (this.firstNode == null) {
  68744. this.firstNode = node
  68745. this.lastNode = node
  68746. node.prev = null
  68747. node.next = null
  68748. } else {
  68749. node.prev = null
  68750. node.next = this.firstNode
  68751. node.next.prev = node
  68752. this.firstNode = node
  68753. }
  68754. }
  68755. DoublyLinkedList.prototype.pop = function() {
  68756. var lastNode = this.lastNode
  68757. if (lastNode != null) {
  68758. this.remove(lastNode)
  68759. }
  68760. return lastNode
  68761. }
  68762. DoublyLinkedList.prototype.remove = function(node) {
  68763. if (this.firstNode == node) {
  68764. this.firstNode = node.next
  68765. } else if (node.prev != null) {
  68766. node.prev.next = node.next
  68767. }
  68768. if (this.lastNode == node) {
  68769. this.lastNode = node.prev
  68770. } else if (node.next != null) {
  68771. node.next.prev = node.prev
  68772. }
  68773. }
  68774. function DoublyLinkedNode(key, val) {
  68775. this.key = key
  68776. this.val = val
  68777. this.prev = null
  68778. this.next = null
  68779. }
  68780. /***/ }),
  68781. /* 465 */
  68782. /***/ (function(module, exports, __webpack_require__) {
  68783. "use strict";
  68784. var _classCallCheck2;
  68785. function _load_classCallCheck() {
  68786. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  68787. }
  68788. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  68789. var _ = __webpack_require__(45);
  68790. /**
  68791. * Choice object
  68792. * Normalize input as choice object
  68793. * @constructor
  68794. * @param {String|Object} val Choice value. If an object is passed, it should contains
  68795. * at least one of `value` or `name` property
  68796. */
  68797. module.exports = function Choice(val, answers) {
  68798. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Choice);
  68799. // Don't process Choice and Separator object
  68800. if (val instanceof Choice || val.type === 'separator') {
  68801. return val;
  68802. }
  68803. if (_.isString(val)) {
  68804. this.name = val;
  68805. this.value = val;
  68806. this.short = val;
  68807. } else {
  68808. _.extend(this, val, {
  68809. name: val.name || val.value,
  68810. value: 'value' in val ? val.value : val.name,
  68811. short: val.short || val.name || val.value
  68812. });
  68813. }
  68814. if (_.isFunction(val.disabled)) {
  68815. this.disabled = val.disabled(answers);
  68816. } else {
  68817. this.disabled = val.disabled;
  68818. }
  68819. };
  68820. /***/ }),
  68821. /* 466 */
  68822. /***/ (function(module, exports, __webpack_require__) {
  68823. "use strict";
  68824. var _classCallCheck2;
  68825. function _load_classCallCheck() {
  68826. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  68827. }
  68828. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  68829. var assert = __webpack_require__(50);
  68830. var _ = __webpack_require__(45);
  68831. var Separator = __webpack_require__(152);
  68832. var Choice = __webpack_require__(465);
  68833. /**
  68834. * Choices collection
  68835. * Collection of multiple `choice` object
  68836. * @constructor
  68837. * @param {Array} choices All `choice` to keep in the collection
  68838. */
  68839. module.exports = function () {
  68840. function Choices(choices, answers) {
  68841. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Choices);
  68842. this.choices = choices.map(function (val) {
  68843. if (val.type === 'separator') {
  68844. if (!(val instanceof Separator)) {
  68845. val = new Separator(val.line);
  68846. }
  68847. return val;
  68848. }
  68849. return new Choice(val, answers);
  68850. });
  68851. this.realChoices = this.choices.filter(Separator.exclude).filter(function (item) {
  68852. return !item.disabled;
  68853. });
  68854. Object.defineProperty(this, 'length', {
  68855. get() {
  68856. return this.choices.length;
  68857. },
  68858. set(val) {
  68859. this.choices.length = val;
  68860. }
  68861. });
  68862. Object.defineProperty(this, 'realLength', {
  68863. get() {
  68864. return this.realChoices.length;
  68865. },
  68866. set() {
  68867. throw new Error('Cannot set `realLength` of a Choices collection');
  68868. }
  68869. });
  68870. }
  68871. /**
  68872. * Get a valid choice from the collection
  68873. * @param {Number} selector The selected choice index
  68874. * @return {Choice|Undefined} Return the matched choice or undefined
  68875. */
  68876. Choices.prototype.getChoice = function getChoice(selector) {
  68877. assert(_.isNumber(selector));
  68878. return this.realChoices[selector];
  68879. };
  68880. /**
  68881. * Get a raw element from the collection
  68882. * @param {Number} selector The selected index value
  68883. * @return {Choice|Undefined} Return the matched choice or undefined
  68884. */
  68885. Choices.prototype.get = function get(selector) {
  68886. assert(_.isNumber(selector));
  68887. return this.choices[selector];
  68888. };
  68889. /**
  68890. * Match the valid choices against a where clause
  68891. * @param {Object} whereClause Lodash `where` clause
  68892. * @return {Array} Matching choices or empty array
  68893. */
  68894. Choices.prototype.where = function where(whereClause) {
  68895. return _.filter(this.realChoices, whereClause);
  68896. };
  68897. /**
  68898. * Pluck a particular key from the choices
  68899. * @param {String} propertyName Property name to select
  68900. * @return {Array} Selected properties
  68901. */
  68902. Choices.prototype.pluck = function pluck(propertyName) {
  68903. return _.map(this.realChoices, propertyName);
  68904. };
  68905. // Expose usual Array methods
  68906. Choices.prototype.indexOf = function indexOf() {
  68907. return this.choices.indexOf.apply(this.choices, arguments);
  68908. };
  68909. Choices.prototype.forEach = function forEach() {
  68910. return this.choices.forEach.apply(this.choices, arguments);
  68911. };
  68912. Choices.prototype.filter = function filter() {
  68913. return this.choices.filter.apply(this.choices, arguments);
  68914. };
  68915. Choices.prototype.find = function find(func) {
  68916. return _.find(this.choices, func);
  68917. };
  68918. Choices.prototype.push = function push() {
  68919. var objs = _.map(arguments, function (val) {
  68920. return new Choice(val);
  68921. });
  68922. this.choices.push.apply(this.choices, objs);
  68923. this.realChoices = this.choices.filter(Separator.exclude);
  68924. return this.choices;
  68925. };
  68926. return Choices;
  68927. }();
  68928. /***/ }),
  68929. /* 467 */
  68930. /***/ (function(module, exports, __webpack_require__) {
  68931. "use strict";
  68932. /**
  68933. * `list` type prompt
  68934. */
  68935. var _classCallCheck2;
  68936. function _load_classCallCheck() {
  68937. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  68938. }
  68939. var _possibleConstructorReturn2;
  68940. function _load_possibleConstructorReturn() {
  68941. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  68942. }
  68943. var _inherits2;
  68944. function _load_inherits() {
  68945. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  68946. }
  68947. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  68948. var _ = __webpack_require__(45);
  68949. var chalk = __webpack_require__(33);
  68950. var cliCursor = __webpack_require__(319);
  68951. var figures = __webpack_require__(233);
  68952. var _require = __webpack_require__(65),
  68953. map = _require.map,
  68954. takeUntil = _require.takeUntil;
  68955. var Base = __webpack_require__(73);
  68956. var observe = __webpack_require__(74);
  68957. var Paginator = __webpack_require__(153);
  68958. var CheckboxPrompt = function (_Base) {
  68959. (0, (_inherits2 || _load_inherits()).default)(CheckboxPrompt, _Base);
  68960. function CheckboxPrompt(questions, rl, answers) {
  68961. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, CheckboxPrompt);
  68962. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers));
  68963. if (!_this.opt.choices) {
  68964. _this.throwParamError('choices');
  68965. }
  68966. if (_.isArray(_this.opt.default)) {
  68967. _this.opt.choices.forEach(function (choice) {
  68968. if (this.opt.default.indexOf(choice.value) >= 0) {
  68969. choice.checked = true;
  68970. }
  68971. }, _this);
  68972. }
  68973. _this.pointer = 0;
  68974. _this.firstRender = true;
  68975. // Make sure no default is set (so it won't be printed)
  68976. _this.opt.default = null;
  68977. _this.paginator = new Paginator(_this.screen);
  68978. return _this;
  68979. }
  68980. /**
  68981. * Start the Inquiry session
  68982. * @param {Function} cb Callback when prompt is done
  68983. * @return {this}
  68984. */
  68985. CheckboxPrompt.prototype._run = function _run(cb) {
  68986. this.done = cb;
  68987. var events = observe(this.rl);
  68988. var validation = this.handleSubmitEvents(events.line.pipe(map(this.getCurrentValue.bind(this))));
  68989. validation.success.forEach(this.onEnd.bind(this));
  68990. validation.error.forEach(this.onError.bind(this));
  68991. events.normalizedUpKey.pipe(takeUntil(validation.success)).forEach(this.onUpKey.bind(this));
  68992. events.normalizedDownKey.pipe(takeUntil(validation.success)).forEach(this.onDownKey.bind(this));
  68993. events.numberKey.pipe(takeUntil(validation.success)).forEach(this.onNumberKey.bind(this));
  68994. events.spaceKey.pipe(takeUntil(validation.success)).forEach(this.onSpaceKey.bind(this));
  68995. events.aKey.pipe(takeUntil(validation.success)).forEach(this.onAllKey.bind(this));
  68996. events.iKey.pipe(takeUntil(validation.success)).forEach(this.onInverseKey.bind(this));
  68997. // Init the prompt
  68998. cliCursor.hide();
  68999. this.render();
  69000. this.firstRender = false;
  69001. return this;
  69002. };
  69003. /**
  69004. * Render the prompt to screen
  69005. * @return {CheckboxPrompt} self
  69006. */
  69007. CheckboxPrompt.prototype.render = function render(error) {
  69008. // Render question
  69009. var message = this.getQuestion();
  69010. var bottomContent = '';
  69011. if (this.firstRender) {
  69012. message += '(Press ' + chalk.cyan.bold('<space>') + ' to select, ' + chalk.cyan.bold('<a>') + ' to toggle all, ' + chalk.cyan.bold('<i>') + ' to invert selection)';
  69013. }
  69014. // Render choices or answer depending on the state
  69015. if (this.status === 'answered') {
  69016. message += chalk.cyan(this.selection.join(', '));
  69017. } else {
  69018. var choicesStr = renderChoices(this.opt.choices, this.pointer);
  69019. var indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.pointer));
  69020. message += '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize);
  69021. }
  69022. if (error) {
  69023. bottomContent = chalk.red('>> ') + error;
  69024. }
  69025. this.screen.render(message, bottomContent);
  69026. };
  69027. /**
  69028. * When user press `enter` key
  69029. */
  69030. CheckboxPrompt.prototype.onEnd = function onEnd(state) {
  69031. this.status = 'answered';
  69032. // Rerender prompt (and clean subline error)
  69033. this.render();
  69034. this.screen.done();
  69035. cliCursor.show();
  69036. this.done(state.value);
  69037. };
  69038. CheckboxPrompt.prototype.onError = function onError(state) {
  69039. this.render(state.isValid);
  69040. };
  69041. CheckboxPrompt.prototype.getCurrentValue = function getCurrentValue() {
  69042. var choices = this.opt.choices.filter(function (choice) {
  69043. return Boolean(choice.checked) && !choice.disabled;
  69044. });
  69045. this.selection = _.map(choices, 'short');
  69046. return _.map(choices, 'value');
  69047. };
  69048. CheckboxPrompt.prototype.onUpKey = function onUpKey() {
  69049. var len = this.opt.choices.realLength;
  69050. this.pointer = this.pointer > 0 ? this.pointer - 1 : len - 1;
  69051. this.render();
  69052. };
  69053. CheckboxPrompt.prototype.onDownKey = function onDownKey() {
  69054. var len = this.opt.choices.realLength;
  69055. this.pointer = this.pointer < len - 1 ? this.pointer + 1 : 0;
  69056. this.render();
  69057. };
  69058. CheckboxPrompt.prototype.onNumberKey = function onNumberKey(input) {
  69059. if (input <= this.opt.choices.realLength) {
  69060. this.pointer = input - 1;
  69061. this.toggleChoice(this.pointer);
  69062. }
  69063. this.render();
  69064. };
  69065. CheckboxPrompt.prototype.onSpaceKey = function onSpaceKey() {
  69066. this.toggleChoice(this.pointer);
  69067. this.render();
  69068. };
  69069. CheckboxPrompt.prototype.onAllKey = function onAllKey() {
  69070. var shouldBeChecked = Boolean(this.opt.choices.find(function (choice) {
  69071. return choice.type !== 'separator' && !choice.checked;
  69072. }));
  69073. this.opt.choices.forEach(function (choice) {
  69074. if (choice.type !== 'separator') {
  69075. choice.checked = shouldBeChecked;
  69076. }
  69077. });
  69078. this.render();
  69079. };
  69080. CheckboxPrompt.prototype.onInverseKey = function onInverseKey() {
  69081. this.opt.choices.forEach(function (choice) {
  69082. if (choice.type !== 'separator') {
  69083. choice.checked = !choice.checked;
  69084. }
  69085. });
  69086. this.render();
  69087. };
  69088. CheckboxPrompt.prototype.toggleChoice = function toggleChoice(index) {
  69089. var item = this.opt.choices.getChoice(index);
  69090. if (item !== undefined) {
  69091. this.opt.choices.getChoice(index).checked = !item.checked;
  69092. }
  69093. };
  69094. return CheckboxPrompt;
  69095. }(Base);
  69096. /**
  69097. * Function for rendering checkbox choices
  69098. * @param {Number} pointer Position of the pointer
  69099. * @return {String} Rendered content
  69100. */
  69101. function renderChoices(choices, pointer) {
  69102. var output = '';
  69103. var separatorOffset = 0;
  69104. choices.forEach(function (choice, i) {
  69105. if (choice.type === 'separator') {
  69106. separatorOffset++;
  69107. output += ' ' + choice + '\n';
  69108. return;
  69109. }
  69110. if (choice.disabled) {
  69111. separatorOffset++;
  69112. output += ' - ' + choice.name;
  69113. output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')';
  69114. } else {
  69115. var line = getCheckbox(choice.checked) + ' ' + choice.name;
  69116. if (i - separatorOffset === pointer) {
  69117. output += chalk.cyan(figures.pointer + line);
  69118. } else {
  69119. output += ' ' + line;
  69120. }
  69121. }
  69122. output += '\n';
  69123. });
  69124. return output.replace(/\n$/, '');
  69125. }
  69126. /**
  69127. * Get the checkbox
  69128. * @param {Boolean} checked - add a X or not to the checkbox
  69129. * @return {String} Composited checkbox string
  69130. */
  69131. function getCheckbox(checked) {
  69132. return checked ? chalk.green(figures.radioOn) : figures.radioOff;
  69133. }
  69134. module.exports = CheckboxPrompt;
  69135. /***/ }),
  69136. /* 468 */
  69137. /***/ (function(module, exports, __webpack_require__) {
  69138. "use strict";
  69139. /**
  69140. * `confirm` type prompt
  69141. */
  69142. var _classCallCheck2;
  69143. function _load_classCallCheck() {
  69144. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  69145. }
  69146. var _possibleConstructorReturn2;
  69147. function _load_possibleConstructorReturn() {
  69148. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  69149. }
  69150. var _inherits2;
  69151. function _load_inherits() {
  69152. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  69153. }
  69154. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  69155. var _ = __webpack_require__(45);
  69156. var chalk = __webpack_require__(33);
  69157. var _require = __webpack_require__(65),
  69158. take = _require.take,
  69159. takeUntil = _require.takeUntil;
  69160. var Base = __webpack_require__(73);
  69161. var observe = __webpack_require__(74);
  69162. var ConfirmPrompt = function (_Base) {
  69163. (0, (_inherits2 || _load_inherits()).default)(ConfirmPrompt, _Base);
  69164. function ConfirmPrompt(questions, rl, answers) {
  69165. var _ret;
  69166. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ConfirmPrompt);
  69167. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers));
  69168. var rawDefault = true;
  69169. _.extend(_this.opt, {
  69170. filter: function filter(input) {
  69171. var value = rawDefault;
  69172. if (input != null && input !== '') {
  69173. value = /^y(es)?/i.test(input);
  69174. }
  69175. return value;
  69176. }
  69177. });
  69178. if (_.isBoolean(_this.opt.default)) {
  69179. rawDefault = _this.opt.default;
  69180. }
  69181. _this.opt.default = rawDefault ? 'Y/n' : 'y/N';
  69182. return _ret = _this, (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(_this, _ret);
  69183. }
  69184. /**
  69185. * Start the Inquiry session
  69186. * @param {Function} cb Callback when prompt is done
  69187. * @return {this}
  69188. */
  69189. ConfirmPrompt.prototype._run = function _run(cb) {
  69190. this.done = cb;
  69191. // Once user confirm (enter key)
  69192. var events = observe(this.rl);
  69193. events.keypress.pipe(takeUntil(events.line)).forEach(this.onKeypress.bind(this));
  69194. events.line.pipe(take(1)).forEach(this.onEnd.bind(this));
  69195. // Init
  69196. this.render();
  69197. return this;
  69198. };
  69199. /**
  69200. * Render the prompt to screen
  69201. * @return {ConfirmPrompt} self
  69202. */
  69203. ConfirmPrompt.prototype.render = function render(answer) {
  69204. var message = this.getQuestion();
  69205. if (typeof answer === 'boolean') {
  69206. message += chalk.cyan(answer ? 'Yes' : 'No');
  69207. } else {
  69208. message += this.rl.line;
  69209. }
  69210. this.screen.render(message);
  69211. return this;
  69212. };
  69213. /**
  69214. * When user press `enter` key
  69215. */
  69216. ConfirmPrompt.prototype.onEnd = function onEnd(input) {
  69217. this.status = 'answered';
  69218. var output = this.opt.filter(input);
  69219. this.render(output);
  69220. this.screen.done();
  69221. this.done(output);
  69222. };
  69223. /**
  69224. * When user press a key
  69225. */
  69226. ConfirmPrompt.prototype.onKeypress = function onKeypress() {
  69227. this.render();
  69228. };
  69229. return ConfirmPrompt;
  69230. }(Base);
  69231. module.exports = ConfirmPrompt;
  69232. /***/ }),
  69233. /* 469 */
  69234. /***/ (function(module, exports, __webpack_require__) {
  69235. "use strict";
  69236. /**
  69237. * `editor` type prompt
  69238. */
  69239. var _classCallCheck2;
  69240. function _load_classCallCheck() {
  69241. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  69242. }
  69243. var _possibleConstructorReturn2;
  69244. function _load_possibleConstructorReturn() {
  69245. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  69246. }
  69247. var _inherits2;
  69248. function _load_inherits() {
  69249. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  69250. }
  69251. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  69252. var chalk = __webpack_require__(33);
  69253. var editAsync = __webpack_require__(758).editAsync;
  69254. var Base = __webpack_require__(73);
  69255. var observe = __webpack_require__(74);
  69256. var _require = __webpack_require__(173),
  69257. Subject = _require.Subject;
  69258. var EditorPrompt = function (_Base) {
  69259. (0, (_inherits2 || _load_inherits()).default)(EditorPrompt, _Base);
  69260. function EditorPrompt() {
  69261. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, EditorPrompt);
  69262. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.apply(this, arguments));
  69263. }
  69264. /**
  69265. * Start the Inquiry session
  69266. * @param {Function} cb Callback when prompt is done
  69267. * @return {this}
  69268. */
  69269. EditorPrompt.prototype._run = function _run(cb) {
  69270. this.done = cb;
  69271. this.editorResult = new Subject();
  69272. // Open Editor on "line" (Enter Key)
  69273. var events = observe(this.rl);
  69274. this.lineSubscription = events.line.subscribe(this.startExternalEditor.bind(this));
  69275. // Trigger Validation when editor closes
  69276. var validation = this.handleSubmitEvents(this.editorResult);
  69277. validation.success.forEach(this.onEnd.bind(this));
  69278. validation.error.forEach(this.onError.bind(this));
  69279. // Prevents default from being printed on screen (can look weird with multiple lines)
  69280. this.currentText = this.opt.default;
  69281. this.opt.default = null;
  69282. // Init
  69283. this.render();
  69284. return this;
  69285. };
  69286. /**
  69287. * Render the prompt to screen
  69288. * @return {EditorPrompt} self
  69289. */
  69290. EditorPrompt.prototype.render = function render(error) {
  69291. var bottomContent = '';
  69292. var message = this.getQuestion();
  69293. if (this.status === 'answered') {
  69294. message += chalk.dim('Received');
  69295. } else {
  69296. message += chalk.dim('Press <enter> to launch your preferred editor.');
  69297. }
  69298. if (error) {
  69299. bottomContent = chalk.red('>> ') + error;
  69300. }
  69301. this.screen.render(message, bottomContent);
  69302. };
  69303. /**
  69304. * Launch $EDITOR on user press enter
  69305. */
  69306. EditorPrompt.prototype.startExternalEditor = function startExternalEditor() {
  69307. // Pause Readline to prevent stdin and stdout from being modified while the editor is showing
  69308. this.rl.pause();
  69309. editAsync(this.currentText, this.endExternalEditor.bind(this));
  69310. };
  69311. EditorPrompt.prototype.endExternalEditor = function endExternalEditor(error, result) {
  69312. this.rl.resume();
  69313. if (error) {
  69314. this.editorResult.error(error);
  69315. } else {
  69316. this.editorResult.next(result);
  69317. }
  69318. };
  69319. EditorPrompt.prototype.onEnd = function onEnd(state) {
  69320. this.editorResult.unsubscribe();
  69321. this.lineSubscription.unsubscribe();
  69322. this.answer = state.value;
  69323. this.status = 'answered';
  69324. // Re-render prompt
  69325. this.render();
  69326. this.screen.done();
  69327. this.done(this.answer);
  69328. };
  69329. EditorPrompt.prototype.onError = function onError(state) {
  69330. this.render(state.isValid);
  69331. };
  69332. return EditorPrompt;
  69333. }(Base);
  69334. module.exports = EditorPrompt;
  69335. /***/ }),
  69336. /* 470 */
  69337. /***/ (function(module, exports, __webpack_require__) {
  69338. "use strict";
  69339. /**
  69340. * `rawlist` type prompt
  69341. */
  69342. var _classCallCheck2;
  69343. function _load_classCallCheck() {
  69344. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  69345. }
  69346. var _possibleConstructorReturn2;
  69347. function _load_possibleConstructorReturn() {
  69348. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  69349. }
  69350. var _inherits2;
  69351. function _load_inherits() {
  69352. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  69353. }
  69354. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  69355. var _ = __webpack_require__(45);
  69356. var chalk = __webpack_require__(33);
  69357. var _require = __webpack_require__(65),
  69358. map = _require.map,
  69359. takeUntil = _require.takeUntil;
  69360. var Base = __webpack_require__(73);
  69361. var Separator = __webpack_require__(152);
  69362. var observe = __webpack_require__(74);
  69363. var Paginator = __webpack_require__(153);
  69364. var ExpandPrompt = function (_Base) {
  69365. (0, (_inherits2 || _load_inherits()).default)(ExpandPrompt, _Base);
  69366. function ExpandPrompt(questions, rl, answers) {
  69367. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ExpandPrompt);
  69368. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers));
  69369. if (!_this.opt.choices) {
  69370. _this.throwParamError('choices');
  69371. }
  69372. _this.validateChoices(_this.opt.choices);
  69373. // Add the default `help` (/expand) option
  69374. _this.opt.choices.push({
  69375. key: 'h',
  69376. name: 'Help, list all options',
  69377. value: 'help'
  69378. });
  69379. _this.opt.validate = function (choice) {
  69380. if (choice == null) {
  69381. return 'Please enter a valid command';
  69382. }
  69383. return choice !== 'help';
  69384. };
  69385. // Setup the default string (capitalize the default key)
  69386. _this.opt.default = _this.generateChoicesString(_this.opt.choices, _this.opt.default);
  69387. _this.paginator = new Paginator(_this.screen);
  69388. return _this;
  69389. }
  69390. /**
  69391. * Start the Inquiry session
  69392. * @param {Function} cb Callback when prompt is done
  69393. * @return {this}
  69394. */
  69395. ExpandPrompt.prototype._run = function _run(cb) {
  69396. this.done = cb;
  69397. // Save user answer and update prompt to show selected option.
  69398. var events = observe(this.rl);
  69399. var validation = this.handleSubmitEvents(events.line.pipe(map(this.getCurrentValue.bind(this))));
  69400. validation.success.forEach(this.onSubmit.bind(this));
  69401. validation.error.forEach(this.onError.bind(this));
  69402. this.keypressObs = events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this));
  69403. // Init the prompt
  69404. this.render();
  69405. return this;
  69406. };
  69407. /**
  69408. * Render the prompt to screen
  69409. * @return {ExpandPrompt} self
  69410. */
  69411. ExpandPrompt.prototype.render = function render(error, hint) {
  69412. var message = this.getQuestion();
  69413. var bottomContent = '';
  69414. if (this.status === 'answered') {
  69415. message += chalk.cyan(this.answer);
  69416. } else if (this.status === 'expanded') {
  69417. var choicesStr = renderChoices(this.opt.choices, this.selectedKey);
  69418. message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize);
  69419. message += '\n Answer: ';
  69420. }
  69421. message += this.rl.line;
  69422. if (error) {
  69423. bottomContent = chalk.red('>> ') + error;
  69424. }
  69425. if (hint) {
  69426. bottomContent = chalk.cyan('>> ') + hint;
  69427. }
  69428. this.screen.render(message, bottomContent);
  69429. };
  69430. ExpandPrompt.prototype.getCurrentValue = function getCurrentValue(input) {
  69431. if (!input) {
  69432. input = this.rawDefault;
  69433. }
  69434. var selected = this.opt.choices.where({ key: input.toLowerCase().trim() })[0];
  69435. if (!selected) {
  69436. return null;
  69437. }
  69438. return selected.value;
  69439. };
  69440. /**
  69441. * Generate the prompt choices string
  69442. * @return {String} Choices string
  69443. */
  69444. ExpandPrompt.prototype.getChoices = function getChoices() {
  69445. var _this2 = this;
  69446. var output = '';
  69447. this.opt.choices.forEach(function (choice) {
  69448. output += '\n ';
  69449. if (choice.type === 'separator') {
  69450. output += ' ' + choice;
  69451. return;
  69452. }
  69453. var choiceStr = choice.key + ') ' + choice.name;
  69454. if (_this2.selectedKey === choice.key) {
  69455. choiceStr = chalk.cyan(choiceStr);
  69456. }
  69457. output += choiceStr;
  69458. });
  69459. return output;
  69460. };
  69461. ExpandPrompt.prototype.onError = function onError(state) {
  69462. if (state.value === 'help') {
  69463. this.selectedKey = '';
  69464. this.status = 'expanded';
  69465. this.render();
  69466. return;
  69467. }
  69468. this.render(state.isValid);
  69469. };
  69470. /**
  69471. * When user press `enter` key
  69472. */
  69473. ExpandPrompt.prototype.onSubmit = function onSubmit(state) {
  69474. this.status = 'answered';
  69475. var choice = this.opt.choices.where({ value: state.value })[0];
  69476. this.answer = choice.short || choice.name;
  69477. // Re-render prompt
  69478. this.render();
  69479. this.screen.done();
  69480. this.done(state.value);
  69481. };
  69482. /**
  69483. * When user press a key
  69484. */
  69485. ExpandPrompt.prototype.onKeypress = function onKeypress() {
  69486. this.selectedKey = this.rl.line.toLowerCase();
  69487. var selected = this.opt.choices.where({ key: this.selectedKey })[0];
  69488. if (this.status === 'expanded') {
  69489. this.render();
  69490. } else {
  69491. this.render(null, selected ? selected.name : null);
  69492. }
  69493. };
  69494. /**
  69495. * Validate the choices
  69496. * @param {Array} choices
  69497. */
  69498. ExpandPrompt.prototype.validateChoices = function validateChoices(choices) {
  69499. var formatError;
  69500. var errors = [];
  69501. var keymap = {};
  69502. choices.filter(Separator.exclude).forEach(function (choice) {
  69503. if (!choice.key || choice.key.length !== 1) {
  69504. formatError = true;
  69505. }
  69506. if (keymap[choice.key]) {
  69507. errors.push(choice.key);
  69508. }
  69509. keymap[choice.key] = true;
  69510. choice.key = String(choice.key).toLowerCase();
  69511. });
  69512. if (formatError) {
  69513. throw new Error('Format error: `key` param must be a single letter and is required.');
  69514. }
  69515. if (keymap.h) {
  69516. throw new Error('Reserved key error: `key` param cannot be `h` - this value is reserved.');
  69517. }
  69518. if (errors.length) {
  69519. throw new Error('Duplicate key error: `key` param must be unique. Duplicates: ' + _.uniq(errors).join(', '));
  69520. }
  69521. };
  69522. /**
  69523. * Generate a string out of the choices keys
  69524. * @param {Array} choices
  69525. * @param {Number|String} default - the choice index or name to capitalize
  69526. * @return {String} The rendered choices key string
  69527. */
  69528. ExpandPrompt.prototype.generateChoicesString = function generateChoicesString(choices, defaultChoice) {
  69529. var defIndex = choices.realLength - 1;
  69530. if (_.isNumber(defaultChoice) && this.opt.choices.getChoice(defaultChoice)) {
  69531. defIndex = defaultChoice;
  69532. } else if (_.isString(defaultChoice)) {
  69533. var index = _.findIndex(choices.realChoices, function (_ref) {
  69534. var value = _ref.value;
  69535. return value === defaultChoice;
  69536. });
  69537. defIndex = index === -1 ? defIndex : index;
  69538. }
  69539. var defStr = this.opt.choices.pluck('key');
  69540. this.rawDefault = defStr[defIndex];
  69541. defStr[defIndex] = String(defStr[defIndex]).toUpperCase();
  69542. return defStr.join('');
  69543. };
  69544. return ExpandPrompt;
  69545. }(Base);
  69546. /**
  69547. * Function for rendering checkbox choices
  69548. * @param {String} pointer Selected key
  69549. * @return {String} Rendered content
  69550. */
  69551. function renderChoices(choices, pointer) {
  69552. var output = '';
  69553. choices.forEach(function (choice) {
  69554. output += '\n ';
  69555. if (choice.type === 'separator') {
  69556. output += ' ' + choice;
  69557. return;
  69558. }
  69559. var choiceStr = choice.key + ') ' + choice.name;
  69560. if (pointer === choice.key) {
  69561. choiceStr = chalk.cyan(choiceStr);
  69562. }
  69563. output += choiceStr;
  69564. });
  69565. return output;
  69566. }
  69567. module.exports = ExpandPrompt;
  69568. /***/ }),
  69569. /* 471 */
  69570. /***/ (function(module, exports, __webpack_require__) {
  69571. "use strict";
  69572. /**
  69573. * `list` type prompt
  69574. */
  69575. var _classCallCheck2;
  69576. function _load_classCallCheck() {
  69577. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  69578. }
  69579. var _possibleConstructorReturn2;
  69580. function _load_possibleConstructorReturn() {
  69581. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  69582. }
  69583. var _inherits2;
  69584. function _load_inherits() {
  69585. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  69586. }
  69587. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  69588. var _ = __webpack_require__(45);
  69589. var chalk = __webpack_require__(33);
  69590. var figures = __webpack_require__(233);
  69591. var cliCursor = __webpack_require__(319);
  69592. var runAsync = __webpack_require__(172);
  69593. var _require = __webpack_require__(65),
  69594. flatMap = _require.flatMap,
  69595. map = _require.map,
  69596. take = _require.take,
  69597. takeUntil = _require.takeUntil;
  69598. var Base = __webpack_require__(73);
  69599. var observe = __webpack_require__(74);
  69600. var Paginator = __webpack_require__(153);
  69601. var ListPrompt = function (_Base) {
  69602. (0, (_inherits2 || _load_inherits()).default)(ListPrompt, _Base);
  69603. function ListPrompt(questions, rl, answers) {
  69604. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ListPrompt);
  69605. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers));
  69606. if (!_this.opt.choices) {
  69607. _this.throwParamError('choices');
  69608. }
  69609. _this.firstRender = true;
  69610. _this.selected = 0;
  69611. var def = _this.opt.default;
  69612. // If def is a Number, then use as index. Otherwise, check for value.
  69613. if (_.isNumber(def) && def >= 0 && def < _this.opt.choices.realLength) {
  69614. _this.selected = def;
  69615. } else if (!_.isNumber(def) && def != null) {
  69616. var index = _.findIndex(_this.opt.choices.realChoices, function (_ref) {
  69617. var value = _ref.value;
  69618. return value === def;
  69619. });
  69620. _this.selected = Math.max(index, 0);
  69621. }
  69622. // Make sure no default is set (so it won't be printed)
  69623. _this.opt.default = null;
  69624. _this.paginator = new Paginator(_this.screen);
  69625. return _this;
  69626. }
  69627. /**
  69628. * Start the Inquiry session
  69629. * @param {Function} cb Callback when prompt is done
  69630. * @return {this}
  69631. */
  69632. ListPrompt.prototype._run = function _run(cb) {
  69633. this.done = cb;
  69634. var self = this;
  69635. var events = observe(this.rl);
  69636. events.normalizedUpKey.pipe(takeUntil(events.line)).forEach(this.onUpKey.bind(this));
  69637. events.normalizedDownKey.pipe(takeUntil(events.line)).forEach(this.onDownKey.bind(this));
  69638. events.numberKey.pipe(takeUntil(events.line)).forEach(this.onNumberKey.bind(this));
  69639. events.line.pipe(take(1), map(this.getCurrentValue.bind(this)), flatMap(function (value) {
  69640. return runAsync(self.opt.filter)(value).catch(function (err) {
  69641. return err;
  69642. });
  69643. })).forEach(this.onSubmit.bind(this));
  69644. // Init the prompt
  69645. cliCursor.hide();
  69646. this.render();
  69647. return this;
  69648. };
  69649. /**
  69650. * Render the prompt to screen
  69651. * @return {ListPrompt} self
  69652. */
  69653. ListPrompt.prototype.render = function render() {
  69654. // Render question
  69655. var message = this.getQuestion();
  69656. if (this.firstRender) {
  69657. message += chalk.dim('(Use arrow keys)');
  69658. }
  69659. // Render choices or answer depending on the state
  69660. if (this.status === 'answered') {
  69661. message += chalk.cyan(this.opt.choices.getChoice(this.selected).short);
  69662. } else {
  69663. var choicesStr = listRender(this.opt.choices, this.selected);
  69664. var indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.selected));
  69665. message += '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize);
  69666. }
  69667. this.firstRender = false;
  69668. this.screen.render(message);
  69669. };
  69670. /**
  69671. * When user press `enter` key
  69672. */
  69673. ListPrompt.prototype.onSubmit = function onSubmit(value) {
  69674. this.status = 'answered';
  69675. // Rerender prompt
  69676. this.render();
  69677. this.screen.done();
  69678. cliCursor.show();
  69679. this.done(value);
  69680. };
  69681. ListPrompt.prototype.getCurrentValue = function getCurrentValue() {
  69682. return this.opt.choices.getChoice(this.selected).value;
  69683. };
  69684. /**
  69685. * When user press a key
  69686. */
  69687. ListPrompt.prototype.onUpKey = function onUpKey() {
  69688. var len = this.opt.choices.realLength;
  69689. this.selected = this.selected > 0 ? this.selected - 1 : len - 1;
  69690. this.render();
  69691. };
  69692. ListPrompt.prototype.onDownKey = function onDownKey() {
  69693. var len = this.opt.choices.realLength;
  69694. this.selected = this.selected < len - 1 ? this.selected + 1 : 0;
  69695. this.render();
  69696. };
  69697. ListPrompt.prototype.onNumberKey = function onNumberKey(input) {
  69698. if (input <= this.opt.choices.realLength) {
  69699. this.selected = input - 1;
  69700. }
  69701. this.render();
  69702. };
  69703. return ListPrompt;
  69704. }(Base);
  69705. /**
  69706. * Function for rendering list choices
  69707. * @param {Number} pointer Position of the pointer
  69708. * @return {String} Rendered content
  69709. */
  69710. function listRender(choices, pointer) {
  69711. var output = '';
  69712. var separatorOffset = 0;
  69713. choices.forEach(function (choice, i) {
  69714. if (choice.type === 'separator') {
  69715. separatorOffset++;
  69716. output += ' ' + choice + '\n';
  69717. return;
  69718. }
  69719. if (choice.disabled) {
  69720. separatorOffset++;
  69721. output += ' - ' + choice.name;
  69722. output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')';
  69723. output += '\n';
  69724. return;
  69725. }
  69726. var isSelected = i - separatorOffset === pointer;
  69727. var line = (isSelected ? figures.pointer + ' ' : ' ') + choice.name;
  69728. if (isSelected) {
  69729. line = chalk.cyan(line);
  69730. }
  69731. output += line + ' \n';
  69732. });
  69733. return output.replace(/\n$/, '');
  69734. }
  69735. module.exports = ListPrompt;
  69736. /***/ }),
  69737. /* 472 */
  69738. /***/ (function(module, exports, __webpack_require__) {
  69739. "use strict";
  69740. /**
  69741. * `input` type prompt
  69742. */
  69743. var _classCallCheck2;
  69744. function _load_classCallCheck() {
  69745. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  69746. }
  69747. var _possibleConstructorReturn2;
  69748. function _load_possibleConstructorReturn() {
  69749. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  69750. }
  69751. var _inherits2;
  69752. function _load_inherits() {
  69753. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  69754. }
  69755. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  69756. var Input = __webpack_require__(285);
  69757. /**
  69758. * Extention of the Input prompt specifically for use with number inputs.
  69759. */
  69760. var NumberPrompt = function (_Input) {
  69761. (0, (_inherits2 || _load_inherits()).default)(NumberPrompt, _Input);
  69762. function NumberPrompt() {
  69763. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NumberPrompt);
  69764. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Input.apply(this, arguments));
  69765. }
  69766. NumberPrompt.prototype.filterInput = function filterInput(input) {
  69767. if (input && typeof input === 'string') {
  69768. input = input.trim();
  69769. // Match a number in the input
  69770. var numberMatch = input.match(/(^-?\d+|^\d+\.\d*|^\d*\.\d+)(e\d+)?$/);
  69771. // If a number is found, return that input.
  69772. if (numberMatch) {
  69773. return Number(numberMatch[0]);
  69774. }
  69775. }
  69776. // If the input was invalid return the default value.
  69777. return this.opt.default == null ? NaN : this.opt.default;
  69778. };
  69779. return NumberPrompt;
  69780. }(Input);
  69781. module.exports = NumberPrompt;
  69782. /***/ }),
  69783. /* 473 */
  69784. /***/ (function(module, exports, __webpack_require__) {
  69785. "use strict";
  69786. /**
  69787. * `password` type prompt
  69788. */
  69789. var _classCallCheck2;
  69790. function _load_classCallCheck() {
  69791. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  69792. }
  69793. var _possibleConstructorReturn2;
  69794. function _load_possibleConstructorReturn() {
  69795. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  69796. }
  69797. var _inherits2;
  69798. function _load_inherits() {
  69799. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  69800. }
  69801. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  69802. var chalk = __webpack_require__(33);
  69803. var _require = __webpack_require__(65),
  69804. map = _require.map,
  69805. takeUntil = _require.takeUntil;
  69806. var Base = __webpack_require__(73);
  69807. var observe = __webpack_require__(74);
  69808. function mask(input, maskChar) {
  69809. input = String(input);
  69810. maskChar = typeof maskChar === 'string' ? maskChar : '*';
  69811. if (input.length === 0) {
  69812. return '';
  69813. }
  69814. return new Array(input.length + 1).join(maskChar);
  69815. }
  69816. var PasswordPrompt = function (_Base) {
  69817. (0, (_inherits2 || _load_inherits()).default)(PasswordPrompt, _Base);
  69818. function PasswordPrompt() {
  69819. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PasswordPrompt);
  69820. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.apply(this, arguments));
  69821. }
  69822. /**
  69823. * Start the Inquiry session
  69824. * @param {Function} cb Callback when prompt is done
  69825. * @return {this}
  69826. */
  69827. PasswordPrompt.prototype._run = function _run(cb) {
  69828. this.done = cb;
  69829. var events = observe(this.rl);
  69830. // Once user confirm (enter key)
  69831. var submit = events.line.pipe(map(this.filterInput.bind(this)));
  69832. var validation = this.handleSubmitEvents(submit);
  69833. validation.success.forEach(this.onEnd.bind(this));
  69834. validation.error.forEach(this.onError.bind(this));
  69835. if (this.opt.mask) {
  69836. events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this));
  69837. }
  69838. // Init
  69839. this.render();
  69840. return this;
  69841. };
  69842. /**
  69843. * Render the prompt to screen
  69844. * @return {PasswordPrompt} self
  69845. */
  69846. PasswordPrompt.prototype.render = function render(error) {
  69847. var message = this.getQuestion();
  69848. var bottomContent = '';
  69849. if (this.status === 'answered') {
  69850. message += this.opt.mask ? chalk.cyan(mask(this.answer, this.opt.mask)) : chalk.italic.dim('[hidden]');
  69851. } else if (this.opt.mask) {
  69852. message += mask(this.rl.line || '', this.opt.mask);
  69853. } else {
  69854. message += chalk.italic.dim('[input is hidden] ');
  69855. }
  69856. if (error) {
  69857. bottomContent = '\n' + chalk.red('>> ') + error;
  69858. }
  69859. this.screen.render(message, bottomContent);
  69860. };
  69861. /**
  69862. * When user press `enter` key
  69863. */
  69864. PasswordPrompt.prototype.filterInput = function filterInput(input) {
  69865. if (!input) {
  69866. return this.opt.default == null ? '' : this.opt.default;
  69867. }
  69868. return input;
  69869. };
  69870. PasswordPrompt.prototype.onEnd = function onEnd(state) {
  69871. this.status = 'answered';
  69872. this.answer = state.value;
  69873. // Re-render prompt
  69874. this.render();
  69875. this.screen.done();
  69876. this.done(state.value);
  69877. };
  69878. PasswordPrompt.prototype.onError = function onError(state) {
  69879. this.render(state.isValid);
  69880. };
  69881. PasswordPrompt.prototype.onKeypress = function onKeypress() {
  69882. this.render();
  69883. };
  69884. return PasswordPrompt;
  69885. }(Base);
  69886. module.exports = PasswordPrompt;
  69887. /***/ }),
  69888. /* 474 */
  69889. /***/ (function(module, exports, __webpack_require__) {
  69890. "use strict";
  69891. /**
  69892. * `rawlist` type prompt
  69893. */
  69894. var _classCallCheck2;
  69895. function _load_classCallCheck() {
  69896. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  69897. }
  69898. var _possibleConstructorReturn2;
  69899. function _load_possibleConstructorReturn() {
  69900. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  69901. }
  69902. var _inherits2;
  69903. function _load_inherits() {
  69904. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  69905. }
  69906. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  69907. var _ = __webpack_require__(45);
  69908. var chalk = __webpack_require__(33);
  69909. var _require = __webpack_require__(65),
  69910. map = _require.map,
  69911. takeUntil = _require.takeUntil;
  69912. var Base = __webpack_require__(73);
  69913. var Separator = __webpack_require__(152);
  69914. var observe = __webpack_require__(74);
  69915. var Paginator = __webpack_require__(153);
  69916. var RawListPrompt = function (_Base) {
  69917. (0, (_inherits2 || _load_inherits()).default)(RawListPrompt, _Base);
  69918. function RawListPrompt(questions, rl, answers) {
  69919. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, RawListPrompt);
  69920. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers));
  69921. if (!_this.opt.choices) {
  69922. _this.throwParamError('choices');
  69923. }
  69924. _this.opt.validChoices = _this.opt.choices.filter(Separator.exclude);
  69925. _this.selected = 0;
  69926. _this.rawDefault = 0;
  69927. _.extend(_this.opt, {
  69928. validate: function validate(val) {
  69929. return val != null;
  69930. }
  69931. });
  69932. var def = _this.opt.default;
  69933. if (_.isNumber(def) && def >= 0 && def < _this.opt.choices.realLength) {
  69934. _this.selected = def;
  69935. _this.rawDefault = def;
  69936. } else if (!_.isNumber(def) && def != null) {
  69937. var index = _.findIndex(_this.opt.choices.realChoices, function (_ref) {
  69938. var value = _ref.value;
  69939. return value === def;
  69940. });
  69941. var safeIndex = Math.max(index, 0);
  69942. _this.selected = safeIndex;
  69943. _this.rawDefault = safeIndex;
  69944. }
  69945. // Make sure no default is set (so it won't be printed)
  69946. _this.opt.default = null;
  69947. _this.paginator = new Paginator();
  69948. return _this;
  69949. }
  69950. /**
  69951. * Start the Inquiry session
  69952. * @param {Function} cb Callback when prompt is done
  69953. * @return {this}
  69954. */
  69955. RawListPrompt.prototype._run = function _run(cb) {
  69956. this.done = cb;
  69957. // Once user confirm (enter key)
  69958. var events = observe(this.rl);
  69959. var submit = events.line.pipe(map(this.getCurrentValue.bind(this)));
  69960. var validation = this.handleSubmitEvents(submit);
  69961. validation.success.forEach(this.onEnd.bind(this));
  69962. validation.error.forEach(this.onError.bind(this));
  69963. events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this));
  69964. // Init the prompt
  69965. this.render();
  69966. return this;
  69967. };
  69968. /**
  69969. * Render the prompt to screen
  69970. * @return {RawListPrompt} self
  69971. */
  69972. RawListPrompt.prototype.render = function render(error) {
  69973. // Render question
  69974. var message = this.getQuestion();
  69975. var bottomContent = '';
  69976. if (this.status === 'answered') {
  69977. message += chalk.cyan(this.answer);
  69978. } else {
  69979. var choicesStr = renderChoices(this.opt.choices, this.selected);
  69980. message += this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize);
  69981. message += '\n Answer: ';
  69982. }
  69983. message += this.rl.line;
  69984. if (error) {
  69985. bottomContent = '\n' + chalk.red('>> ') + error;
  69986. }
  69987. this.screen.render(message, bottomContent);
  69988. };
  69989. /**
  69990. * When user press `enter` key
  69991. */
  69992. RawListPrompt.prototype.getCurrentValue = function getCurrentValue(index) {
  69993. if (index == null || index === '') {
  69994. index = this.rawDefault;
  69995. } else {
  69996. index -= 1;
  69997. }
  69998. var choice = this.opt.choices.getChoice(index);
  69999. return choice ? choice.value : null;
  70000. };
  70001. RawListPrompt.prototype.onEnd = function onEnd(state) {
  70002. this.status = 'answered';
  70003. this.answer = state.value;
  70004. // Re-render prompt
  70005. this.render();
  70006. this.screen.done();
  70007. this.done(state.value);
  70008. };
  70009. RawListPrompt.prototype.onError = function onError() {
  70010. this.render('Please enter a valid index');
  70011. };
  70012. /**
  70013. * When user press a key
  70014. */
  70015. RawListPrompt.prototype.onKeypress = function onKeypress() {
  70016. var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0;
  70017. if (this.opt.choices.getChoice(index)) {
  70018. this.selected = index;
  70019. } else {
  70020. this.selected = undefined;
  70021. }
  70022. this.render();
  70023. };
  70024. return RawListPrompt;
  70025. }(Base);
  70026. /**
  70027. * Function for rendering list choices
  70028. * @param {Number} pointer Position of the pointer
  70029. * @return {String} Rendered content
  70030. */
  70031. function renderChoices(choices, pointer) {
  70032. var output = '';
  70033. var separatorOffset = 0;
  70034. choices.forEach(function (choice, i) {
  70035. output += '\n ';
  70036. if (choice.type === 'separator') {
  70037. separatorOffset++;
  70038. output += ' ' + choice;
  70039. return;
  70040. }
  70041. var index = i - separatorOffset;
  70042. var display = index + 1 + ') ' + choice.name;
  70043. if (index === pointer) {
  70044. display = chalk.cyan(display);
  70045. }
  70046. output += display;
  70047. });
  70048. return output;
  70049. }
  70050. module.exports = RawListPrompt;
  70051. /***/ }),
  70052. /* 475 */
  70053. /***/ (function(module, exports, __webpack_require__) {
  70054. "use strict";
  70055. /**
  70056. * Sticky bottom bar user interface
  70057. */
  70058. var _classCallCheck2;
  70059. function _load_classCallCheck() {
  70060. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  70061. }
  70062. var _possibleConstructorReturn2;
  70063. function _load_possibleConstructorReturn() {
  70064. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  70065. }
  70066. var _inherits2;
  70067. function _load_inherits() {
  70068. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  70069. }
  70070. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70071. var through = __webpack_require__(1026);
  70072. var Base = __webpack_require__(286);
  70073. var rlUtils = __webpack_require__(287);
  70074. var _ = __webpack_require__(45);
  70075. var BottomBar = function (_Base) {
  70076. (0, (_inherits2 || _load_inherits()).default)(BottomBar, _Base);
  70077. function BottomBar(opt) {
  70078. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BottomBar);
  70079. opt = opt || {};
  70080. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, opt));
  70081. _this.log = through(_this.writeLog.bind(_this));
  70082. _this.bottomBar = opt.bottomBar || '';
  70083. _this.render();
  70084. return _this;
  70085. }
  70086. /**
  70087. * Render the prompt to screen
  70088. * @return {BottomBar} self
  70089. */
  70090. BottomBar.prototype.render = function render() {
  70091. this.write(this.bottomBar);
  70092. return this;
  70093. };
  70094. BottomBar.prototype.clean = function clean() {
  70095. rlUtils.clearLine(this.rl, this.bottomBar.split('\n').length);
  70096. return this;
  70097. };
  70098. /**
  70099. * Update the bottom bar content and rerender
  70100. * @param {String} bottomBar Bottom bar content
  70101. * @return {BottomBar} self
  70102. */
  70103. BottomBar.prototype.updateBottomBar = function updateBottomBar(bottomBar) {
  70104. rlUtils.clearLine(this.rl, 1);
  70105. this.rl.output.unmute();
  70106. this.clean();
  70107. this.bottomBar = bottomBar;
  70108. this.render();
  70109. this.rl.output.mute();
  70110. return this;
  70111. };
  70112. /**
  70113. * Write out log data
  70114. * @param {String} data - The log data to be output
  70115. * @return {BottomBar} self
  70116. */
  70117. BottomBar.prototype.writeLog = function writeLog(data) {
  70118. this.rl.output.unmute();
  70119. this.clean();
  70120. this.rl.output.write(this.enforceLF(data.toString()));
  70121. this.render();
  70122. this.rl.output.mute();
  70123. return this;
  70124. };
  70125. /**
  70126. * Make sure line end on a line feed
  70127. * @param {String} str Input string
  70128. * @return {String} The input string with a final line feed
  70129. */
  70130. BottomBar.prototype.enforceLF = function enforceLF(str) {
  70131. return str.match(/[\r\n]$/) ? str : str + '\n';
  70132. };
  70133. /**
  70134. * Helper for writing message in Prompt
  70135. * @param {BottomBar} prompt - The Prompt object that extends tty
  70136. * @param {String} message - The message to be output
  70137. */
  70138. BottomBar.prototype.write = function write(message) {
  70139. var msgLines = message.split(/\n/);
  70140. this.height = msgLines.length;
  70141. // Write message to screen and setPrompt to control backspace
  70142. this.rl.setPrompt(_.last(msgLines));
  70143. if (this.rl.output.rows === 0 && this.rl.output.columns === 0) {
  70144. /* When it's a tty through serial port there's no terminal info and the render will malfunction,
  70145. so we need enforce the cursor to locate to the leftmost position for rendering. */
  70146. rlUtils.left(this.rl, message.length + this.rl.line.length);
  70147. }
  70148. this.rl.output.write(message);
  70149. };
  70150. return BottomBar;
  70151. }(Base);
  70152. module.exports = BottomBar;
  70153. /***/ }),
  70154. /* 476 */
  70155. /***/ (function(module, exports, __webpack_require__) {
  70156. "use strict";
  70157. var _promise;
  70158. function _load_promise() {
  70159. return _promise = _interopRequireDefault(__webpack_require__(7));
  70160. }
  70161. var _classCallCheck2;
  70162. function _load_classCallCheck() {
  70163. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  70164. }
  70165. var _possibleConstructorReturn2;
  70166. function _load_possibleConstructorReturn() {
  70167. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  70168. }
  70169. var _inherits2;
  70170. function _load_inherits() {
  70171. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  70172. }
  70173. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70174. var _ = __webpack_require__(45);
  70175. var _require = __webpack_require__(173),
  70176. defer = _require.defer,
  70177. empty = _require.empty,
  70178. from = _require.from,
  70179. of = _require.of;
  70180. var _require2 = __webpack_require__(65),
  70181. concatMap = _require2.concatMap,
  70182. filter = _require2.filter,
  70183. publish = _require2.publish,
  70184. reduce = _require2.reduce;
  70185. var runAsync = __webpack_require__(172);
  70186. var utils = __webpack_require__(478);
  70187. var Base = __webpack_require__(286);
  70188. /**
  70189. * Base interface class other can inherits from
  70190. */
  70191. var PromptUI = function (_Base) {
  70192. (0, (_inherits2 || _load_inherits()).default)(PromptUI, _Base);
  70193. function PromptUI(prompts, opt) {
  70194. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PromptUI);
  70195. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, opt));
  70196. _this.prompts = prompts;
  70197. return _this;
  70198. }
  70199. PromptUI.prototype.run = function run(questions) {
  70200. var _this2 = this;
  70201. // Keep global reference to the answers
  70202. this.answers = {};
  70203. // Make sure questions is an array.
  70204. if (_.isPlainObject(questions)) {
  70205. questions = [questions];
  70206. }
  70207. // Create an observable, unless we received one as parameter.
  70208. // Note: As this is a public interface, we cannot do an instanceof check as we won't
  70209. // be using the exact same object in memory.
  70210. var obs = _.isArray(questions) ? from(questions) : questions;
  70211. this.process = obs.pipe(concatMap(this.processQuestion.bind(this)), publish() // Creates a hot Observable. It prevents duplicating prompts.
  70212. );
  70213. this.process.connect();
  70214. return this.process.pipe(reduce(function (answers, answer) {
  70215. _.set(_this2.answers, answer.name, answer.answer);
  70216. return _this2.answers;
  70217. }, {})).toPromise((_promise || _load_promise()).default).then(this.onCompletion.bind(this));
  70218. };
  70219. /**
  70220. * Once all prompt are over
  70221. */
  70222. PromptUI.prototype.onCompletion = function onCompletion() {
  70223. this.close();
  70224. return this.answers;
  70225. };
  70226. PromptUI.prototype.processQuestion = function processQuestion(question) {
  70227. var _this3 = this;
  70228. question = _.clone(question);
  70229. return defer(function () {
  70230. var obs = of(question);
  70231. return obs.pipe(concatMap(_this3.setDefaultType.bind(_this3)), concatMap(_this3.filterIfRunnable.bind(_this3)), concatMap(function () {
  70232. return utils.fetchAsyncQuestionProperty(question, 'message', _this3.answers);
  70233. }), concatMap(function () {
  70234. return utils.fetchAsyncQuestionProperty(question, 'default', _this3.answers);
  70235. }), concatMap(function () {
  70236. return utils.fetchAsyncQuestionProperty(question, 'choices', _this3.answers);
  70237. }), concatMap(_this3.fetchAnswer.bind(_this3)));
  70238. });
  70239. };
  70240. PromptUI.prototype.fetchAnswer = function fetchAnswer(question) {
  70241. var _this4 = this;
  70242. var Prompt = this.prompts[question.type];
  70243. this.activePrompt = new Prompt(question, this.rl, this.answers);
  70244. return defer(function () {
  70245. return from(_this4.activePrompt.run().then(function (answer) {
  70246. return { name: question.name, answer: answer };
  70247. }));
  70248. });
  70249. };
  70250. PromptUI.prototype.setDefaultType = function setDefaultType(question) {
  70251. // Default type to input
  70252. if (!this.prompts[question.type]) {
  70253. question.type = 'input';
  70254. }
  70255. return defer(function () {
  70256. return of(question);
  70257. });
  70258. };
  70259. PromptUI.prototype.filterIfRunnable = function filterIfRunnable(question) {
  70260. if (question.when === false) {
  70261. return empty();
  70262. }
  70263. if (!_.isFunction(question.when)) {
  70264. return of(question);
  70265. }
  70266. var answers = this.answers;
  70267. return defer(function () {
  70268. return from(runAsync(question.when)(answers).then(function (shouldRun) {
  70269. if (shouldRun) {
  70270. return question;
  70271. }
  70272. })).pipe(filter(function (val) {
  70273. return val != null;
  70274. }));
  70275. });
  70276. };
  70277. return PromptUI;
  70278. }(Base);
  70279. module.exports = PromptUI;
  70280. /***/ }),
  70281. /* 477 */
  70282. /***/ (function(module, exports, __webpack_require__) {
  70283. "use strict";
  70284. var _classCallCheck2;
  70285. function _load_classCallCheck() {
  70286. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  70287. }
  70288. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70289. var _ = __webpack_require__(45);
  70290. var util = __webpack_require__(287);
  70291. var cliWidth = __webpack_require__(572);
  70292. var stripAnsi = __webpack_require__(270);
  70293. var stringWidth = __webpack_require__(777);
  70294. function height(content) {
  70295. return content.split('\n').length;
  70296. }
  70297. function lastLine(content) {
  70298. return _.last(content.split('\n'));
  70299. }
  70300. var ScreenManager = function () {
  70301. function ScreenManager(rl) {
  70302. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ScreenManager);
  70303. // These variables are keeping information to allow correct prompt re-rendering
  70304. this.height = 0;
  70305. this.extraLinesUnderPrompt = 0;
  70306. this.rl = rl;
  70307. }
  70308. ScreenManager.prototype.render = function render(content, bottomContent) {
  70309. this.rl.output.unmute();
  70310. this.clean(this.extraLinesUnderPrompt);
  70311. /**
  70312. * Write message to screen and setPrompt to control backspace
  70313. */
  70314. var promptLine = lastLine(content);
  70315. var rawPromptLine = stripAnsi(promptLine);
  70316. // Remove the rl.line from our prompt. We can't rely on the content of
  70317. // rl.line (mainly because of the password prompt), so just rely on it's
  70318. // length.
  70319. var prompt = rawPromptLine;
  70320. if (this.rl.line.length) {
  70321. prompt = prompt.slice(0, -this.rl.line.length);
  70322. }
  70323. this.rl.setPrompt(prompt);
  70324. // SetPrompt will change cursor position, now we can get correct value
  70325. var cursorPos = this.rl._getCursorPos();
  70326. var width = this.normalizedCliWidth();
  70327. content = this.forceLineReturn(content, width);
  70328. if (bottomContent) {
  70329. bottomContent = this.forceLineReturn(bottomContent, width);
  70330. }
  70331. // Manually insert an extra line if we're at the end of the line.
  70332. // This prevent the cursor from appearing at the beginning of the
  70333. // current line.
  70334. if (rawPromptLine.length % width === 0) {
  70335. content += '\n';
  70336. }
  70337. var fullContent = content + (bottomContent ? '\n' + bottomContent : '');
  70338. this.rl.output.write(fullContent);
  70339. /**
  70340. * Re-adjust the cursor at the correct position.
  70341. */
  70342. // We need to consider parts of the prompt under the cursor as part of the bottom
  70343. // content in order to correctly cleanup and re-render.
  70344. var promptLineUpDiff = Math.floor(rawPromptLine.length / width) - cursorPos.rows;
  70345. var bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
  70346. if (bottomContentHeight > 0) {
  70347. util.up(this.rl, bottomContentHeight);
  70348. }
  70349. // Reset cursor at the beginning of the line
  70350. util.left(this.rl, stringWidth(lastLine(fullContent)));
  70351. // Adjust cursor on the right
  70352. if (cursorPos.cols > 0) {
  70353. util.right(this.rl, cursorPos.cols);
  70354. }
  70355. /**
  70356. * Set up state for next re-rendering
  70357. */
  70358. this.extraLinesUnderPrompt = bottomContentHeight;
  70359. this.height = height(fullContent);
  70360. this.rl.output.mute();
  70361. };
  70362. ScreenManager.prototype.clean = function clean(extraLines) {
  70363. if (extraLines > 0) {
  70364. util.down(this.rl, extraLines);
  70365. }
  70366. util.clearLine(this.rl, this.height);
  70367. };
  70368. ScreenManager.prototype.done = function done() {
  70369. this.rl.setPrompt('');
  70370. this.rl.output.unmute();
  70371. this.rl.output.write('\n');
  70372. };
  70373. ScreenManager.prototype.releaseCursor = function releaseCursor() {
  70374. if (this.extraLinesUnderPrompt > 0) {
  70375. util.down(this.rl, this.extraLinesUnderPrompt);
  70376. }
  70377. };
  70378. ScreenManager.prototype.normalizedCliWidth = function normalizedCliWidth() {
  70379. var width = cliWidth({
  70380. defaultWidth: 80,
  70381. output: this.rl.output
  70382. });
  70383. return width;
  70384. };
  70385. ScreenManager.prototype.breakLines = function breakLines(lines, width) {
  70386. // Break lines who're longer than the cli width so we can normalize the natural line
  70387. // returns behavior across terminals.
  70388. width = width || this.normalizedCliWidth();
  70389. var regex = new RegExp('(?:(?:\\033[[0-9;]*m)*.?){1,' + width + '}', 'g');
  70390. return lines.map(function (line) {
  70391. var chunk = line.match(regex);
  70392. // Last match is always empty
  70393. chunk.pop();
  70394. return chunk || '';
  70395. });
  70396. };
  70397. ScreenManager.prototype.forceLineReturn = function forceLineReturn(content, width) {
  70398. width = width || this.normalizedCliWidth();
  70399. return _.flatten(this.breakLines(content.split('\n'), width)).join('\n');
  70400. };
  70401. return ScreenManager;
  70402. }();
  70403. module.exports = ScreenManager;
  70404. /***/ }),
  70405. /* 478 */
  70406. /***/ (function(module, exports, __webpack_require__) {
  70407. "use strict";
  70408. var _ = __webpack_require__(45);
  70409. var _require = __webpack_require__(173),
  70410. from = _require.from,
  70411. of = _require.of;
  70412. var runAsync = __webpack_require__(172);
  70413. /**
  70414. * Resolve a question property value if it is passed as a function.
  70415. * This method will overwrite the property on the question object with the received value.
  70416. * @param {Object} question - Question object
  70417. * @param {String} prop - Property to fetch name
  70418. * @param {Object} answers - Answers object
  70419. * @return {Rx.Observable} - Observable emitting once value is known
  70420. */
  70421. exports.fetchAsyncQuestionProperty = function (question, prop, answers) {
  70422. if (!_.isFunction(question[prop])) {
  70423. return of(question);
  70424. }
  70425. return from(runAsync(question[prop])(answers).then(function (value) {
  70426. question[prop] = value;
  70427. return question;
  70428. }));
  70429. };
  70430. /***/ }),
  70431. /* 479 */
  70432. /***/ (function(module, exports, __webpack_require__) {
  70433. "use strict";
  70434. Object.defineProperty(exports, "__esModule", {
  70435. value: true
  70436. });
  70437. exports.default = function (message) {
  70438. return {
  70439. useless: true,
  70440. run() {
  70441. throw new (_errors || _load_errors()).MessageError(message);
  70442. },
  70443. setFlags: function setFlags() {},
  70444. hasWrapper: function hasWrapper() {
  70445. return true;
  70446. }
  70447. };
  70448. };
  70449. var _errors;
  70450. function _load_errors() {
  70451. return _errors = __webpack_require__(6);
  70452. }
  70453. /***/ }),
  70454. /* 480 */
  70455. /***/ (function(module, exports, __webpack_require__) {
  70456. "use strict";
  70457. Object.defineProperty(exports, "__esModule", {
  70458. value: true
  70459. });
  70460. exports.examples = exports.hasWrapper = exports.run = undefined;
  70461. var _promise;
  70462. function _load_promise() {
  70463. return _promise = _interopRequireDefault(__webpack_require__(7));
  70464. }
  70465. exports.setFlags = setFlags;
  70466. var _buildSubCommands2;
  70467. function _load_buildSubCommands() {
  70468. return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
  70469. }
  70470. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70471. var notYetImplemented = function notYetImplemented() {
  70472. return (_promise || _load_promise()).default.reject(new Error('This command is not implemented yet.'));
  70473. };
  70474. function setFlags(commander) {
  70475. commander.description('Has not been implemented yet');
  70476. }
  70477. var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('access', {
  70478. public: notYetImplemented,
  70479. restricted: notYetImplemented,
  70480. grant: notYetImplemented,
  70481. revoke: notYetImplemented,
  70482. lsPackages: notYetImplemented,
  70483. lsCollaborators: notYetImplemented,
  70484. edit: notYetImplemented
  70485. }, ['WARNING: This command yet to be implemented.', 'public [<package>]', 'restricted [<package>]', 'grant <read-only|read-write> <scope:team> [<package>]', 'revoke <scope:team> [<package>]', 'ls-packages [<user>|<scope>|<scope:team>]', 'ls-collaborators [<package> [<user>]]', 'edit [<package>]']),
  70486. run = _buildSubCommands.run,
  70487. hasWrapper = _buildSubCommands.hasWrapper,
  70488. examples = _buildSubCommands.examples;
  70489. exports.run = run;
  70490. exports.hasWrapper = hasWrapper;
  70491. exports.examples = examples;
  70492. /***/ }),
  70493. /* 481 */
  70494. /***/ (function(module, exports, __webpack_require__) {
  70495. "use strict";
  70496. Object.defineProperty(exports, "__esModule", {
  70497. value: true
  70498. });
  70499. exports.run = undefined;
  70500. var _asyncToGenerator2;
  70501. function _load_asyncToGenerator() {
  70502. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  70503. }
  70504. var run = exports.run = function () {
  70505. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  70506. var binFolder = path.join(config.cwd, config.registryFolders[0], '.bin');
  70507. if (args.length === 0) {
  70508. reporter.log(binFolder, { force: true });
  70509. } else {
  70510. var binEntries = yield (0, (_run || _load_run()).getBinEntries)(config);
  70511. var binName = args[0];
  70512. var binPath = binEntries.get(binName);
  70513. if (binPath) {
  70514. reporter.log(binPath, { force: true });
  70515. } else {
  70516. reporter.error(reporter.lang('packageBinaryNotFound', binName));
  70517. }
  70518. }
  70519. });
  70520. return function run(_x, _x2, _x3, _x4) {
  70521. return _ref.apply(this, arguments);
  70522. };
  70523. }();
  70524. exports.hasWrapper = hasWrapper;
  70525. exports.setFlags = setFlags;
  70526. var _run;
  70527. function _load_run() {
  70528. return _run = __webpack_require__(296);
  70529. }
  70530. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70531. var path = __webpack_require__(1);
  70532. function hasWrapper(commander) {
  70533. return false;
  70534. }
  70535. function setFlags(commander) {
  70536. commander.description('Displays the location of the yarn bin folder.');
  70537. }
  70538. /***/ }),
  70539. /* 482 */
  70540. /***/ (function(module, exports, __webpack_require__) {
  70541. "use strict";
  70542. Object.defineProperty(exports, "__esModule", {
  70543. value: true
  70544. });
  70545. exports.examples = exports.run = undefined;
  70546. var _stringify;
  70547. function _load_stringify() {
  70548. return _stringify = _interopRequireDefault(__webpack_require__(37));
  70549. }
  70550. var _asyncToGenerator2;
  70551. function _load_asyncToGenerator() {
  70552. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  70553. }
  70554. exports.hasWrapper = hasWrapper;
  70555. exports.setFlags = setFlags;
  70556. var _buildSubCommands2;
  70557. function _load_buildSubCommands() {
  70558. return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
  70559. }
  70560. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70561. var CONFIG_KEYS = [
  70562. // 'reporter',
  70563. 'registryFolders', 'linkedModules',
  70564. // 'registries',
  70565. 'cache', 'cwd', 'looseSemver', 'commandName', 'preferOffline', 'modulesFolder', 'globalFolder', 'linkFolder', 'offline', 'binLinks', 'ignorePlatform', 'ignoreScripts', 'disablePrepublish', 'nonInteractive', 'workspaceRootFolder', 'lockfileFolder', 'networkConcurrency', 'childConcurrency', 'networkTimeout', 'workspacesEnabled', 'workspacesNohoistEnabled', 'pruneOfflineMirror', 'enableMetaFolder', 'enableLockfileVersions', 'linkFileDependencies', 'cacheFolder', 'tempFolder', 'production'];
  70566. /* eslint object-shorthand: 0 */
  70567. function hasWrapper(flags, args) {
  70568. return args[0] !== 'get';
  70569. }
  70570. function setFlags(commander) {
  70571. commander.description('Manages the yarn configuration files.');
  70572. }
  70573. var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('config', {
  70574. set(config, reporter, flags, args) {
  70575. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  70576. if (args.length === 0 || args.length > 2) {
  70577. return false;
  70578. }
  70579. var key = args[0],
  70580. _args$ = args[1],
  70581. val = _args$ === undefined ? true : _args$;
  70582. var yarnConfig = config.registries.yarn;
  70583. yield yarnConfig.saveHomeConfig({ [key]: val });
  70584. reporter.success(reporter.lang('configSet', key, val));
  70585. return true;
  70586. })();
  70587. },
  70588. get(config, reporter, flags, args) {
  70589. if (args.length !== 1) {
  70590. return false;
  70591. }
  70592. reporter.log(String(config.getOption(args[0])), { force: true });
  70593. return true;
  70594. },
  70595. delete: function () {
  70596. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  70597. if (args.length !== 1) {
  70598. return false;
  70599. }
  70600. var key = args[0];
  70601. var yarnConfig = config.registries.yarn;
  70602. yield yarnConfig.saveHomeConfig({ [key]: undefined });
  70603. reporter.success(reporter.lang('configDelete', key));
  70604. return true;
  70605. });
  70606. function _delete(_x, _x2, _x3, _x4) {
  70607. return _ref.apply(this, arguments);
  70608. }
  70609. return _delete;
  70610. }(),
  70611. list(config, reporter, flags, args) {
  70612. if (args.length) {
  70613. return false;
  70614. }
  70615. reporter.info(reporter.lang('configYarn'));
  70616. reporter.inspect(config.registries.yarn.config);
  70617. reporter.info(reporter.lang('configNpm'));
  70618. reporter.inspect(config.registries.npm.config);
  70619. return true;
  70620. },
  70621. current(config, reporter, flags, args) {
  70622. if (args.length) {
  70623. return false;
  70624. }
  70625. reporter.log((0, (_stringify || _load_stringify()).default)(config, CONFIG_KEYS, 2), { force: true });
  70626. return true;
  70627. }
  70628. }),
  70629. run = _buildSubCommands.run,
  70630. examples = _buildSubCommands.examples;
  70631. exports.run = run;
  70632. exports.examples = examples;
  70633. /***/ }),
  70634. /* 483 */
  70635. /***/ (function(module, exports, __webpack_require__) {
  70636. "use strict";
  70637. Object.defineProperty(exports, "__esModule", {
  70638. value: true
  70639. });
  70640. exports.run = undefined;
  70641. var _asyncToGenerator2;
  70642. function _load_asyncToGenerator() {
  70643. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  70644. }
  70645. var _extends2;
  70646. function _load_extends() {
  70647. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  70648. }
  70649. var run = exports.run = function () {
  70650. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  70651. var builderName = args[0],
  70652. rest = args.slice(1);
  70653. if (!builderName) {
  70654. throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName'));
  70655. }
  70656. var _coerceCreatePackageN = coerceCreatePackageName(builderName),
  70657. packageName = _coerceCreatePackageN.fullName,
  70658. commandName = _coerceCreatePackageN.name;
  70659. var linkLoc = path.join(config.linkFolder, commandName);
  70660. if (yield (_fs || _load_fs()).exists(linkLoc)) {
  70661. reporter.info(reporter.lang('linkUsing', packageName));
  70662. } else {
  70663. yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', packageName]);
  70664. }
  70665. var binFolder = yield (0, (_global || _load_global()).getBinFolder)(config, {});
  70666. var command = path.resolve(binFolder, commandName);
  70667. var env = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)('create', config.cwd, config);
  70668. yield (_child || _load_child()).spawn(command, rest, { stdio: `inherit`, shell: true, env });
  70669. });
  70670. return function run(_x, _x2, _x3, _x4) {
  70671. return _ref.apply(this, arguments);
  70672. };
  70673. }();
  70674. exports.setFlags = setFlags;
  70675. exports.hasWrapper = hasWrapper;
  70676. exports.parsePackageName = parsePackageName;
  70677. exports.coerceCreatePackageName = coerceCreatePackageName;
  70678. var _errors;
  70679. function _load_errors() {
  70680. return _errors = __webpack_require__(6);
  70681. }
  70682. var _child;
  70683. function _load_child() {
  70684. return _child = _interopRequireWildcard(__webpack_require__(57));
  70685. }
  70686. var _executeLifecycleScript;
  70687. function _load_executeLifecycleScript() {
  70688. return _executeLifecycleScript = __webpack_require__(100);
  70689. }
  70690. var _fs;
  70691. function _load_fs() {
  70692. return _fs = _interopRequireWildcard(__webpack_require__(8));
  70693. }
  70694. var _global;
  70695. function _load_global() {
  70696. return _global = __webpack_require__(116);
  70697. }
  70698. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  70699. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70700. var path = __webpack_require__(1);
  70701. function setFlags(commander) {
  70702. commander.description('Creates new projects from any create-* starter kits.');
  70703. }
  70704. function hasWrapper(commander, args) {
  70705. return true;
  70706. }
  70707. function parsePackageName(str) {
  70708. if (str.charAt(0) === '/') {
  70709. throw new Error(`Name should not start with "/", got "${str}"`);
  70710. }
  70711. if (str.charAt(0) === '.') {
  70712. throw new Error(`Name should not start with ".", got "${str}"`);
  70713. }
  70714. var parts = str.split('/');
  70715. var isScoped = str.charAt(0) === '@';
  70716. if (isScoped && parts[0] === '@') {
  70717. throw new Error(`Scope should not be empty, got "${str}"`);
  70718. }
  70719. var scope = isScoped ? parts[0] : '';
  70720. var name = parts[isScoped ? 1 : 0] || '';
  70721. var path = parts.slice(isScoped ? 2 : 1).join('/');
  70722. var fullName = [scope, name].filter(Boolean).join('/');
  70723. var full = [scope, name, path].filter(Boolean).join('/');
  70724. return { fullName, name, scope, path, full };
  70725. }
  70726. function coerceCreatePackageName(str) {
  70727. var pkgNameObj = parsePackageName(str);
  70728. var coercedName = pkgNameObj.name !== '' ? `create-${pkgNameObj.name}` : `create`;
  70729. var coercedPkgNameObj = (0, (_extends2 || _load_extends()).default)({}, pkgNameObj, {
  70730. name: coercedName,
  70731. fullName: [pkgNameObj.scope, coercedName].filter(Boolean).join('/'),
  70732. full: [pkgNameObj.scope, coercedName, pkgNameObj.path].filter(Boolean).join('/')
  70733. });
  70734. return coercedPkgNameObj;
  70735. }
  70736. /***/ }),
  70737. /* 484 */
  70738. /***/ (function(module, exports, __webpack_require__) {
  70739. "use strict";
  70740. Object.defineProperty(exports, "__esModule", {
  70741. value: true
  70742. });
  70743. exports.run = undefined;
  70744. var _asyncToGenerator2;
  70745. function _load_asyncToGenerator() {
  70746. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  70747. }
  70748. var run = exports.run = function () {
  70749. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  70750. var env = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)(`exec`, config.cwd, config);
  70751. if (args.length < 1) {
  70752. throw new (_errors || _load_errors()).MessageError(reporter.lang('execMissingCommand'));
  70753. }
  70754. var execName = args[0],
  70755. rest = args.slice(1);
  70756. yield (_child || _load_child()).spawn(execName, rest, { stdio: 'inherit', env });
  70757. });
  70758. return function run(_x, _x2, _x3, _x4) {
  70759. return _ref.apply(this, arguments);
  70760. };
  70761. }();
  70762. exports.setFlags = setFlags;
  70763. exports.hasWrapper = hasWrapper;
  70764. var _errors;
  70765. function _load_errors() {
  70766. return _errors = __webpack_require__(6);
  70767. }
  70768. var _child;
  70769. function _load_child() {
  70770. return _child = _interopRequireWildcard(__webpack_require__(57));
  70771. }
  70772. var _executeLifecycleScript;
  70773. function _load_executeLifecycleScript() {
  70774. return _executeLifecycleScript = __webpack_require__(100);
  70775. }
  70776. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  70777. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70778. function setFlags(commander) {}
  70779. function hasWrapper(commander, args) {
  70780. return true;
  70781. }
  70782. /***/ }),
  70783. /* 485 */
  70784. /***/ (function(module, exports, __webpack_require__) {
  70785. "use strict";
  70786. Object.defineProperty(exports, "__esModule", {
  70787. value: true
  70788. });
  70789. exports.examples = exports.run = undefined;
  70790. var _asyncToGenerator2;
  70791. function _load_asyncToGenerator() {
  70792. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  70793. }
  70794. var run = exports.run = function () {
  70795. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  70796. var manifest = void 0;
  70797. if (flags.useManifest) {
  70798. manifest = yield config.readJson(flags.useManifest);
  70799. } else {
  70800. manifest = yield config.readRootManifest();
  70801. }
  70802. if (!manifest.name) {
  70803. throw new (_errors || _load_errors()).MessageError(reporter.lang('noName'));
  70804. }
  70805. if (!manifest.version) {
  70806. throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion'));
  70807. }
  70808. var entry = {
  70809. name: manifest.name,
  70810. version: manifest.version,
  70811. resolved: flags.resolved,
  70812. registry: flags.registry || manifest._registry,
  70813. optionalDependencies: manifest.optionalDependencies,
  70814. dependencies: manifest.dependencies
  70815. };
  70816. var pattern = flags.pattern || `${entry.name}@${entry.version}`;
  70817. reporter.log((0, (_lockfile || _load_lockfile()).stringify)({
  70818. [pattern]: (0, (_lockfile || _load_lockfile()).implodeEntry)(pattern, entry)
  70819. }));
  70820. });
  70821. return function run(_x, _x2, _x3, _x4) {
  70822. return _ref.apply(this, arguments);
  70823. };
  70824. }();
  70825. exports.hasWrapper = hasWrapper;
  70826. exports.setFlags = setFlags;
  70827. var _errors;
  70828. function _load_errors() {
  70829. return _errors = __webpack_require__(6);
  70830. }
  70831. var _lockfile;
  70832. function _load_lockfile() {
  70833. return _lockfile = __webpack_require__(25);
  70834. }
  70835. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70836. function hasWrapper(commander, args) {
  70837. return false;
  70838. }
  70839. function setFlags(commander) {
  70840. commander.description('Generates a lock file entry.');
  70841. commander.option('--use-manifest <location>', 'description');
  70842. commander.option('--resolved <resolved>', 'description');
  70843. commander.option('--registry <registry>', 'description');
  70844. }
  70845. var examples = exports.examples = ['generate-lock-entry', 'generate-lock-entry --use-manifest ./package.json', 'generate-lock-entry --resolved local-file.tgz#hash'];
  70846. /***/ }),
  70847. /* 486 */
  70848. /***/ (function(module, exports, __webpack_require__) {
  70849. "use strict";
  70850. Object.defineProperty(exports, "__esModule", {
  70851. value: true
  70852. });
  70853. var _getIterator2;
  70854. function _load_getIterator() {
  70855. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  70856. }
  70857. var _keys;
  70858. function _load_keys() {
  70859. return _keys = _interopRequireDefault(__webpack_require__(14));
  70860. }
  70861. var _promise;
  70862. function _load_promise() {
  70863. return _promise = _interopRequireDefault(__webpack_require__(7));
  70864. }
  70865. exports.hasWrapper = hasWrapper;
  70866. exports.setFlags = setFlags;
  70867. exports.run = run;
  70868. var _index;
  70869. function _load_index() {
  70870. return _index = _interopRequireDefault(__webpack_require__(273));
  70871. }
  70872. var _constants;
  70873. function _load_constants() {
  70874. return _constants = _interopRequireWildcard(__webpack_require__(13));
  70875. }
  70876. var _misc;
  70877. function _load_misc() {
  70878. return _misc = __webpack_require__(28);
  70879. }
  70880. var _aliases;
  70881. function _load_aliases() {
  70882. return _aliases = _interopRequireDefault(__webpack_require__(288));
  70883. }
  70884. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  70885. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70886. var chalk = __webpack_require__(33);
  70887. function hasWrapper(flags, args) {
  70888. return false;
  70889. }
  70890. function setFlags(commander) {
  70891. commander.description('Displays help information.');
  70892. }
  70893. function run(config, reporter, commander, args) {
  70894. if (args.length) {
  70895. var commandName = args.shift();
  70896. if (Object.prototype.hasOwnProperty.call((_index || _load_index()).default, commandName)) {
  70897. var command = (_index || _load_index()).default[commandName];
  70898. if (command) {
  70899. command.setFlags(commander);
  70900. var examples = (command.examples || []).map(function (example) {
  70901. return ` $ yarn ${example}`;
  70902. });
  70903. if (examples.length) {
  70904. commander.on('--help', function () {
  70905. reporter.log(reporter.lang('helpExamples', reporter.rawText(examples.join('\n'))));
  70906. });
  70907. }
  70908. // eslint-disable-next-line yarn-internal/warn-language
  70909. commander.on('--help', function () {
  70910. return reporter.log(' ' + command.getDocsInfo + '\n');
  70911. });
  70912. commander.help();
  70913. return (_promise || _load_promise()).default.resolve();
  70914. }
  70915. }
  70916. }
  70917. commander.on('--help', function () {
  70918. var commandsText = [];
  70919. for (var _iterator = (0, (_keys || _load_keys()).default)((_index || _load_index()).default).sort((_misc || _load_misc()).sortAlpha), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  70920. var _ref;
  70921. if (_isArray) {
  70922. if (_i >= _iterator.length) break;
  70923. _ref = _iterator[_i++];
  70924. } else {
  70925. _i = _iterator.next();
  70926. if (_i.done) break;
  70927. _ref = _i.value;
  70928. }
  70929. var name = _ref;
  70930. if ((_index || _load_index()).default[name].useless || (0, (_keys || _load_keys()).default)((_aliases || _load_aliases()).default).map(function (key) {
  70931. return (_aliases || _load_aliases()).default[key];
  70932. }).indexOf(name) > -1) {
  70933. continue;
  70934. }
  70935. if ((_aliases || _load_aliases()).default[name]) {
  70936. commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)} / ${(_aliases || _load_aliases()).default[name]}`);
  70937. } else {
  70938. commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)}`);
  70939. }
  70940. }
  70941. reporter.log(reporter.lang('helpCommands', reporter.rawText(commandsText.join('\n'))));
  70942. reporter.log(reporter.lang('helpCommandsMore', reporter.rawText(chalk.bold('yarn help COMMAND'))));
  70943. reporter.log(reporter.lang('helpLearnMore', reporter.rawText(chalk.bold((_constants || _load_constants()).YARN_DOCS))));
  70944. });
  70945. commander.options.sort((_misc || _load_misc()).sortOptionsByFlags);
  70946. commander.help();
  70947. return (_promise || _load_promise()).default.resolve();
  70948. }
  70949. /***/ }),
  70950. /* 487 */
  70951. /***/ (function(module, exports, __webpack_require__) {
  70952. "use strict";
  70953. Object.defineProperty(exports, "__esModule", {
  70954. value: true
  70955. });
  70956. exports.run = exports.Import = exports.noArguments = undefined;
  70957. var _getIterator2;
  70958. function _load_getIterator() {
  70959. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  70960. }
  70961. var _promise;
  70962. function _load_promise() {
  70963. return _promise = _interopRequireDefault(__webpack_require__(7));
  70964. }
  70965. var _asyncToGenerator2;
  70966. function _load_asyncToGenerator() {
  70967. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  70968. }
  70969. var _classCallCheck2;
  70970. function _load_classCallCheck() {
  70971. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  70972. }
  70973. var _possibleConstructorReturn2;
  70974. function _load_possibleConstructorReturn() {
  70975. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  70976. }
  70977. var _inherits2;
  70978. function _load_inherits() {
  70979. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  70980. }
  70981. var run = exports.run = function () {
  70982. var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  70983. var imp = new Import(flags, config, reporter, new (_lockfile || _load_lockfile()).default({ cache: {} }));
  70984. yield imp.init();
  70985. });
  70986. return function run(_x7, _x8, _x9, _x10) {
  70987. return _ref15.apply(this, arguments);
  70988. };
  70989. }();
  70990. exports.setFlags = setFlags;
  70991. exports.hasWrapper = hasWrapper;
  70992. var _install;
  70993. function _load_install() {
  70994. return _install = __webpack_require__(41);
  70995. }
  70996. var _check;
  70997. function _load_check() {
  70998. return _check = __webpack_require__(292);
  70999. }
  71000. var _errors;
  71001. function _load_errors() {
  71002. return _errors = __webpack_require__(6);
  71003. }
  71004. var _index;
  71005. function _load_index() {
  71006. return _index = __webpack_require__(75);
  71007. }
  71008. var _baseResolver;
  71009. function _load_baseResolver() {
  71010. return _baseResolver = _interopRequireDefault(__webpack_require__(118));
  71011. }
  71012. var _hostedGitResolver;
  71013. function _load_hostedGitResolver() {
  71014. return _hostedGitResolver = _interopRequireDefault(__webpack_require__(99));
  71015. }
  71016. var _hostedGitResolver2;
  71017. function _load_hostedGitResolver2() {
  71018. return _hostedGitResolver2 = __webpack_require__(99);
  71019. }
  71020. var _gistResolver;
  71021. function _load_gistResolver() {
  71022. return _gistResolver = _interopRequireDefault(__webpack_require__(203));
  71023. }
  71024. var _gistResolver2;
  71025. function _load_gistResolver2() {
  71026. return _gistResolver2 = __webpack_require__(203);
  71027. }
  71028. var _gitResolver;
  71029. function _load_gitResolver() {
  71030. return _gitResolver = _interopRequireDefault(__webpack_require__(119));
  71031. }
  71032. var _fileResolver;
  71033. function _load_fileResolver() {
  71034. return _fileResolver = _interopRequireDefault(__webpack_require__(202));
  71035. }
  71036. var _packageResolver;
  71037. function _load_packageResolver() {
  71038. return _packageResolver = _interopRequireDefault(__webpack_require__(303));
  71039. }
  71040. var _packageRequest;
  71041. function _load_packageRequest() {
  71042. return _packageRequest = _interopRequireDefault(__webpack_require__(117));
  71043. }
  71044. var _packageReference;
  71045. function _load_packageReference() {
  71046. return _packageReference = _interopRequireDefault(__webpack_require__(302));
  71047. }
  71048. var _packageFetcher;
  71049. function _load_packageFetcher() {
  71050. return _packageFetcher = _interopRequireWildcard(__webpack_require__(197));
  71051. }
  71052. var _packageLinker;
  71053. function _load_packageLinker() {
  71054. return _packageLinker = _interopRequireDefault(__webpack_require__(198));
  71055. }
  71056. var _packageCompatibility;
  71057. function _load_packageCompatibility() {
  71058. return _packageCompatibility = _interopRequireWildcard(__webpack_require__(196));
  71059. }
  71060. var _lockfile;
  71061. function _load_lockfile() {
  71062. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  71063. }
  71064. var _normalizePattern9;
  71065. function _load_normalizePattern() {
  71066. return _normalizePattern9 = __webpack_require__(52);
  71067. }
  71068. var _logicalDependencyTree;
  71069. function _load_logicalDependencyTree() {
  71070. return _logicalDependencyTree = __webpack_require__(539);
  71071. }
  71072. var _fs;
  71073. function _load_fs() {
  71074. return _fs = _interopRequireWildcard(__webpack_require__(8));
  71075. }
  71076. var _misc;
  71077. function _load_misc() {
  71078. return _misc = _interopRequireWildcard(__webpack_require__(28));
  71079. }
  71080. var _constants;
  71081. function _load_constants() {
  71082. return _constants = __webpack_require__(13);
  71083. }
  71084. var _semver;
  71085. function _load_semver() {
  71086. return _semver = _interopRequireDefault(__webpack_require__(27));
  71087. }
  71088. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  71089. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71090. var invariant = __webpack_require__(15);
  71091. var path = __webpack_require__(1);
  71092. var uuid = __webpack_require__(114);
  71093. var ssri = __webpack_require__(93);
  71094. var nodeVersion = process.versions.node.split('-')[0];
  71095. var noArguments = exports.noArguments = true;
  71096. var ImportResolver = function (_BaseResolver) {
  71097. (0, (_inherits2 || _load_inherits()).default)(ImportResolver, _BaseResolver);
  71098. function ImportResolver() {
  71099. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportResolver);
  71100. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.apply(this, arguments));
  71101. }
  71102. ImportResolver.prototype.getCwd = function getCwd() {
  71103. if (this.request.parentRequest) {
  71104. var parent = this.resolver.getStrictResolvedPattern(this.request.parentRequest.pattern);
  71105. invariant(parent._loc, 'expected package location');
  71106. return path.dirname(parent._loc);
  71107. }
  71108. return this.config.cwd;
  71109. };
  71110. ImportResolver.prototype.resolveHostedGit = function resolveHostedGit(info, Resolver) {
  71111. var _normalizePattern = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
  71112. range = _normalizePattern.range;
  71113. var exploded = (0, (_hostedGitResolver2 || _load_hostedGitResolver2()).explodeHostedGitFragment)(range, this.reporter);
  71114. var hash = info.gitHead;
  71115. invariant(hash, 'expected package gitHead');
  71116. var url = Resolver.getTarballUrl(exploded, hash);
  71117. info._uid = hash;
  71118. info._remote = {
  71119. resolved: url,
  71120. type: 'tarball',
  71121. registry: this.registry,
  71122. reference: url,
  71123. hash: null
  71124. };
  71125. return info;
  71126. };
  71127. ImportResolver.prototype.resolveGist = function resolveGist(info, Resolver) {
  71128. var _normalizePattern2 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
  71129. range = _normalizePattern2.range;
  71130. var _explodeGistFragment = (0, (_gistResolver2 || _load_gistResolver2()).explodeGistFragment)(range, this.reporter),
  71131. id = _explodeGistFragment.id;
  71132. var hash = info.gitHead;
  71133. invariant(hash, 'expected package gitHead');
  71134. var url = `https://gist.github.com/${id}.git`;
  71135. info._uid = hash;
  71136. info._remote = {
  71137. resolved: `${url}#${hash}`,
  71138. type: 'git',
  71139. registry: this.registry,
  71140. reference: url,
  71141. hash
  71142. };
  71143. return info;
  71144. };
  71145. ImportResolver.prototype.resolveGit = function resolveGit(info, Resolver) {
  71146. var url = info._resolved;
  71147. var hash = info.gitHead;
  71148. invariant(url, 'expected package _resolved');
  71149. invariant(hash, 'expected package gitHead');
  71150. info._uid = hash;
  71151. info._remote = {
  71152. resolved: `${url}#${hash}`,
  71153. type: 'git',
  71154. registry: this.registry,
  71155. reference: url,
  71156. hash
  71157. };
  71158. return info;
  71159. };
  71160. ImportResolver.prototype.resolveFile = function resolveFile(info, Resolver) {
  71161. var _normalizePattern3 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
  71162. range = _normalizePattern3.range;
  71163. var loc = (_misc || _load_misc()).removePrefix(range, 'file:');
  71164. if (!path.isAbsolute(loc)) {
  71165. loc = path.join(this.config.cwd, loc);
  71166. }
  71167. info._uid = info.version;
  71168. info._remote = {
  71169. type: 'copy',
  71170. registry: this.registry,
  71171. hash: `${uuid.v4()}-${new Date().getTime()}`,
  71172. reference: loc
  71173. };
  71174. return info;
  71175. };
  71176. ImportResolver.prototype.resolveRegistry = function resolveRegistry(info) {
  71177. var url = info._resolved;
  71178. var hash = info._shasum;
  71179. invariant(url, 'expected package _resolved');
  71180. invariant(hash, 'expected package _shasum');
  71181. if (this.config.getOption('registry') === (_constants || _load_constants()).YARN_REGISTRY) {
  71182. url = url.replace((_constants || _load_constants()).NPM_REGISTRY_RE, (_constants || _load_constants()).YARN_REGISTRY);
  71183. }
  71184. info._uid = info.version;
  71185. info._remote = {
  71186. resolved: `${url}#${hash}`,
  71187. type: 'tarball',
  71188. registry: this.registry,
  71189. reference: url,
  71190. integrity: info._integrity ? ssri.parse(info._integrity) : ssri.fromHex(hash, 'sha1'),
  71191. hash
  71192. };
  71193. return info;
  71194. };
  71195. ImportResolver.prototype.resolveImport = function resolveImport(info) {
  71196. var _normalizePattern4 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
  71197. range = _normalizePattern4.range;
  71198. var Resolver = (0, (_index || _load_index()).getExoticResolver)(range);
  71199. if (Resolver && Resolver.prototype instanceof (_hostedGitResolver || _load_hostedGitResolver()).default) {
  71200. return this.resolveHostedGit(info, Resolver);
  71201. } else if (Resolver && Resolver === (_gistResolver || _load_gistResolver()).default) {
  71202. return this.resolveGist(info, Resolver);
  71203. } else if (Resolver && Resolver === (_gitResolver || _load_gitResolver()).default) {
  71204. return this.resolveGit(info, Resolver);
  71205. } else if (Resolver && Resolver === (_fileResolver || _load_fileResolver()).default) {
  71206. return this.resolveFile(info, Resolver);
  71207. }
  71208. return this.resolveRegistry(info);
  71209. };
  71210. ImportResolver.prototype.resolveLocation = function () {
  71211. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
  71212. var info = yield this.config.tryManifest(loc, 'npm', false);
  71213. if (!info) {
  71214. return null;
  71215. }
  71216. return this.resolveImport(info);
  71217. });
  71218. function resolveLocation(_x) {
  71219. return _ref.apply(this, arguments);
  71220. }
  71221. return resolveLocation;
  71222. }();
  71223. ImportResolver.prototype.resolveFixedVersion = function () {
  71224. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (fixedVersionPattern) {
  71225. var _normalizePattern5 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(fixedVersionPattern),
  71226. range = _normalizePattern5.range;
  71227. var exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range);
  71228. var manifest = exoticResolver ? yield this.request.findExoticVersionInfo(exoticResolver, range) : yield this.request.findVersionOnRegistry(fixedVersionPattern);
  71229. return manifest;
  71230. });
  71231. function resolveFixedVersion(_x2) {
  71232. return _ref2.apply(this, arguments);
  71233. }
  71234. return resolveFixedVersion;
  71235. }();
  71236. ImportResolver.prototype._resolveFromFixedVersions = function () {
  71237. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  71238. var _this2 = this;
  71239. invariant(this.request instanceof ImportPackageRequest, 'request must be ImportPackageRequest');
  71240. var _normalizePattern6 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
  71241. name = _normalizePattern6.name;
  71242. invariant(this.request.dependencyTree instanceof (_logicalDependencyTree || _load_logicalDependencyTree()).LogicalDependencyTree, 'dependencyTree on request must be LogicalDependencyTree');
  71243. var fixedVersionPattern = this.request.dependencyTree.getFixedVersionPattern(name, this.request.parentNames);
  71244. var info = yield this.config.getCache(`import-resolver-${fixedVersionPattern}`, function () {
  71245. return _this2.resolveFixedVersion(fixedVersionPattern);
  71246. });
  71247. if (info) {
  71248. return info;
  71249. }
  71250. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importResolveFailed', name, this.getCwd()));
  71251. });
  71252. function _resolveFromFixedVersions() {
  71253. return _ref3.apply(this, arguments);
  71254. }
  71255. return _resolveFromFixedVersions;
  71256. }();
  71257. ImportResolver.prototype._resolveFromNodeModules = function () {
  71258. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  71259. var _this3 = this;
  71260. var _normalizePattern7 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
  71261. name = _normalizePattern7.name;
  71262. var cwd = this.getCwd();
  71263. var _loop = function* _loop() {
  71264. var loc = path.join(cwd, 'node_modules', name);
  71265. var info = yield _this3.config.getCache(`import-resolver-${loc}`, function () {
  71266. return _this3.resolveLocation(loc);
  71267. });
  71268. if (info) {
  71269. return {
  71270. v: info
  71271. };
  71272. }
  71273. cwd = path.resolve(cwd, '../..');
  71274. };
  71275. while (!path.relative(this.config.cwd, cwd).startsWith('..')) {
  71276. var _ret = yield* _loop();
  71277. if (typeof _ret === "object") return _ret.v;
  71278. }
  71279. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importResolveFailed', name, this.getCwd()));
  71280. });
  71281. function _resolveFromNodeModules() {
  71282. return _ref4.apply(this, arguments);
  71283. }
  71284. return _resolveFromNodeModules;
  71285. }();
  71286. ImportResolver.prototype.resolve = function resolve() {
  71287. if (this.request instanceof ImportPackageRequest && this.request.dependencyTree) {
  71288. return this._resolveFromFixedVersions();
  71289. } else {
  71290. return this._resolveFromNodeModules();
  71291. }
  71292. };
  71293. return ImportResolver;
  71294. }((_baseResolver || _load_baseResolver()).default);
  71295. var ImportPackageRequest = function (_PackageRequest) {
  71296. (0, (_inherits2 || _load_inherits()).default)(ImportPackageRequest, _PackageRequest);
  71297. function ImportPackageRequest(req, dependencyTree, resolver) {
  71298. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportPackageRequest);
  71299. var _this4 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _PackageRequest.call(this, req, resolver));
  71300. _this4.import = _this4.parentRequest instanceof ImportPackageRequest ? _this4.parentRequest.import : true;
  71301. _this4.dependencyTree = dependencyTree;
  71302. return _this4;
  71303. }
  71304. ImportPackageRequest.prototype.getRootName = function getRootName() {
  71305. return this.resolver instanceof ImportPackageResolver && this.resolver.rootName || 'root';
  71306. };
  71307. ImportPackageRequest.prototype.getParentHumanName = function getParentHumanName() {
  71308. return [this.getRootName()].concat(this.parentNames).join(' > ');
  71309. };
  71310. ImportPackageRequest.prototype.reportResolvedRangeMatch = function reportResolvedRangeMatch(info, resolved) {
  71311. if (info.version === resolved.version) {
  71312. return;
  71313. }
  71314. this.reporter.warn(this.reporter.lang('importResolvedRangeMatch', resolved.version, resolved.name, info.version, this.getParentHumanName()));
  71315. };
  71316. ImportPackageRequest.prototype._findResolvedManifest = function _findResolvedManifest(info) {
  71317. var _normalizePattern8 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
  71318. range = _normalizePattern8.range,
  71319. name = _normalizePattern8.name;
  71320. var solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range;
  71321. var resolved = this.resolver.getExactVersionMatch(name, solvedRange, info);
  71322. if (resolved) {
  71323. return resolved;
  71324. }
  71325. invariant(info._remote, 'expected package remote');
  71326. var ref = new (_packageReference || _load_packageReference()).default(this, info, info._remote);
  71327. info._reference = ref;
  71328. return info;
  71329. };
  71330. ImportPackageRequest.prototype.resolveToExistingVersion = function resolveToExistingVersion(info) {
  71331. var resolved = this._findResolvedManifest(info);
  71332. invariant(resolved, 'should have found a resolved reference');
  71333. var ref = resolved._reference;
  71334. invariant(ref, 'should have a package reference');
  71335. ref.addRequest(this);
  71336. ref.addPattern(this.pattern, resolved);
  71337. ref.addOptional(this.optional);
  71338. };
  71339. ImportPackageRequest.prototype.findVersionInfo = function findVersionInfo() {
  71340. var _this5 = this;
  71341. if (!this.import) {
  71342. this.reporter.verbose(this.reporter.lang('skippingImport', this.pattern, this.getParentHumanName()));
  71343. return _PackageRequest.prototype.findVersionInfo.call(this);
  71344. }
  71345. var resolver = new ImportResolver(this, this.pattern);
  71346. return resolver.resolve().catch(function () {
  71347. _this5.import = false;
  71348. _this5.reporter.warn(_this5.reporter.lang('importFailed', _this5.pattern, _this5.getParentHumanName()));
  71349. return _PackageRequest.prototype.findVersionInfo.call(_this5);
  71350. });
  71351. };
  71352. return ImportPackageRequest;
  71353. }((_packageRequest || _load_packageRequest()).default);
  71354. var ImportPackageResolver = function (_PackageResolver) {
  71355. (0, (_inherits2 || _load_inherits()).default)(ImportPackageResolver, _PackageResolver);
  71356. function ImportPackageResolver(config, lockfile) {
  71357. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportPackageResolver);
  71358. var _this6 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _PackageResolver.call(this, config, lockfile));
  71359. _this6.next = [];
  71360. _this6.rootName = 'root';
  71361. return _this6;
  71362. }
  71363. ImportPackageResolver.prototype.find = function find(req) {
  71364. this.next.push(req);
  71365. return (_promise || _load_promise()).default.resolve();
  71366. };
  71367. ImportPackageResolver.prototype.findOne = function () {
  71368. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (req) {
  71369. if (this.activity) {
  71370. this.activity.tick(req.pattern);
  71371. }
  71372. var request = new ImportPackageRequest(req, this.dependencyTree, this);
  71373. yield request.find({ fresh: false });
  71374. });
  71375. function findOne(_x3) {
  71376. return _ref5.apply(this, arguments);
  71377. }
  71378. return findOne;
  71379. }();
  71380. ImportPackageResolver.prototype.findAll = function () {
  71381. var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) {
  71382. var _this7 = this;
  71383. yield (_promise || _load_promise()).default.all(deps.map(function (dep) {
  71384. return _this7.findOne(dep);
  71385. }));
  71386. deps = this.next;
  71387. this.next = [];
  71388. if (!deps.length) {
  71389. // all required package versions have been discovered, so now packages that
  71390. // resolved to existing versions can be resolved to their best available version
  71391. this.resolvePackagesWithExistingVersions();
  71392. return;
  71393. }
  71394. yield this.findAll(deps);
  71395. });
  71396. function findAll(_x4) {
  71397. return _ref6.apply(this, arguments);
  71398. }
  71399. return findAll;
  71400. }();
  71401. ImportPackageResolver.prototype.resetOptional = function resetOptional() {
  71402. for (var pattern in this.patterns) {
  71403. var ref = this.patterns[pattern]._reference;
  71404. invariant(ref, 'expected reference');
  71405. ref.optional = null;
  71406. for (var _iterator = ref.requests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  71407. var _ref7;
  71408. if (_isArray) {
  71409. if (_i >= _iterator.length) break;
  71410. _ref7 = _iterator[_i++];
  71411. } else {
  71412. _i = _iterator.next();
  71413. if (_i.done) break;
  71414. _ref7 = _i.value;
  71415. }
  71416. var req = _ref7;
  71417. ref.addOptional(req.optional);
  71418. }
  71419. }
  71420. };
  71421. ImportPackageResolver.prototype.init = function () {
  71422. var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) {
  71423. var _ref9 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { isFlat: false, isFrozen: false, workspaceLayout: undefined },
  71424. isFlat = _ref9.isFlat,
  71425. isFrozen = _ref9.isFrozen,
  71426. workspaceLayout = _ref9.workspaceLayout;
  71427. this.flat = Boolean(isFlat);
  71428. var activity = this.activity = this.reporter.activity();
  71429. yield this.findAll(deps);
  71430. this.resetOptional();
  71431. activity.end();
  71432. this.activity = null;
  71433. });
  71434. function init(_x5) {
  71435. return _ref8.apply(this, arguments);
  71436. }
  71437. return init;
  71438. }();
  71439. return ImportPackageResolver;
  71440. }((_packageResolver || _load_packageResolver()).default);
  71441. var Import = exports.Import = function (_Install) {
  71442. (0, (_inherits2 || _load_inherits()).default)(Import, _Install);
  71443. function Import(flags, config, reporter, lockfile) {
  71444. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Import);
  71445. var _this8 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Install.call(this, flags, config, reporter, lockfile));
  71446. _this8.resolver = new ImportPackageResolver(_this8.config, _this8.lockfile);
  71447. _this8.linker = new (_packageLinker || _load_packageLinker()).default(config, _this8.resolver);
  71448. return _this8;
  71449. }
  71450. Import.prototype.createLogicalDependencyTree = function createLogicalDependencyTree(packageJson, packageLock) {
  71451. invariant(packageJson, 'package.json should exist');
  71452. invariant(packageLock, 'package-lock.json should exist');
  71453. invariant(this.resolver instanceof ImportPackageResolver, 'resolver should be an ImportPackageResolver');
  71454. try {
  71455. this.resolver.dependencyTree = new (_logicalDependencyTree || _load_logicalDependencyTree()).LogicalDependencyTree(packageJson, packageLock);
  71456. } catch (e) {
  71457. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importSourceFilesCorrupted'));
  71458. }
  71459. };
  71460. Import.prototype.getExternalLockfileContents = function () {
  71461. var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  71462. try {
  71463. var _ref11 = yield (_promise || _load_promise()).default.all([(_fs || _load_fs()).readFile(path.join(this.config.cwd, (_constants || _load_constants()).NODE_PACKAGE_JSON)), (_fs || _load_fs()).readFile(path.join(this.config.cwd, (_constants || _load_constants()).NPM_LOCK_FILENAME))]),
  71464. _packageJson = _ref11[0],
  71465. _packageLock = _ref11[1];
  71466. return { packageJson: _packageJson, packageLock: _packageLock };
  71467. } catch (e) {
  71468. return { packageJson: null, packageLock: null };
  71469. }
  71470. });
  71471. function getExternalLockfileContents() {
  71472. return _ref10.apply(this, arguments);
  71473. }
  71474. return getExternalLockfileContents;
  71475. }();
  71476. Import.prototype.init = function () {
  71477. var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  71478. if (yield (_fs || _load_fs()).exists(path.join(this.config.cwd, (_constants || _load_constants()).LOCKFILE_FILENAME))) {
  71479. throw new (_errors || _load_errors()).MessageError(this.reporter.lang('lockfileExists'));
  71480. }
  71481. var _ref13 = yield this.getExternalLockfileContents(),
  71482. packageJson = _ref13.packageJson,
  71483. packageLock = _ref13.packageLock;
  71484. var importSource = packageJson && packageLock && (_semver || _load_semver()).default.satisfies(nodeVersion, '>=5.0.0') ? 'package-lock.json' : 'node_modules';
  71485. if (importSource === 'package-lock.json') {
  71486. this.reporter.info(this.reporter.lang('importPackageLock'));
  71487. this.createLogicalDependencyTree(packageJson, packageLock);
  71488. }
  71489. if (importSource === 'node_modules') {
  71490. this.reporter.info(this.reporter.lang('importNodeModules'));
  71491. yield (0, (_check || _load_check()).verifyTreeCheck)(this.config, this.reporter, {}, []);
  71492. }
  71493. var _ref14 = yield this.fetchRequestFromCwd(),
  71494. requests = _ref14.requests,
  71495. patterns = _ref14.patterns,
  71496. manifest = _ref14.manifest;
  71497. if (manifest.name && this.resolver instanceof ImportPackageResolver) {
  71498. this.resolver.rootName = manifest.name;
  71499. }
  71500. yield this.resolver.init(requests, { isFlat: this.flags.flat, isFrozen: this.flags.frozenLockfile });
  71501. var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config);
  71502. this.resolver.updateManifests(manifests);
  71503. yield (_packageCompatibility || _load_packageCompatibility()).check(this.resolver.getManifests(), this.config, this.flags.ignoreEngines);
  71504. yield this.linker.resolvePeerModules();
  71505. yield this.saveLockfileAndIntegrity(patterns);
  71506. return patterns;
  71507. });
  71508. function init() {
  71509. return _ref12.apply(this, arguments);
  71510. }
  71511. return init;
  71512. }();
  71513. return Import;
  71514. }((_install || _load_install()).Install);
  71515. function setFlags(commander) {
  71516. commander.description('Generates yarn.lock from an npm package-lock.json file or an existing npm-installed node_modules folder.');
  71517. }
  71518. function hasWrapper(commander, args) {
  71519. return true;
  71520. }
  71521. /***/ }),
  71522. /* 488 */
  71523. /***/ (function(module, exports, __webpack_require__) {
  71524. "use strict";
  71525. Object.defineProperty(exports, "__esModule", {
  71526. value: true
  71527. });
  71528. exports.run = undefined;
  71529. var _assign;
  71530. function _load_assign() {
  71531. return _assign = _interopRequireDefault(__webpack_require__(23));
  71532. }
  71533. var _keys;
  71534. function _load_keys() {
  71535. return _keys = _interopRequireDefault(__webpack_require__(14));
  71536. }
  71537. var _asyncToGenerator2;
  71538. function _load_asyncToGenerator() {
  71539. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  71540. }
  71541. var run = exports.run = function () {
  71542. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  71543. if (args.length > 2) {
  71544. reporter.error(reporter.lang('tooManyArguments', 2));
  71545. return;
  71546. }
  71547. var packageName = args.shift() || '.';
  71548. // Handle the case when we are referencing a local package.
  71549. if (packageName === '.') {
  71550. packageName = (yield config.readRootManifest()).name;
  71551. }
  71552. var packageInput = (_npmRegistry || _load_npmRegistry()).default.escapeName(packageName);
  71553. var _parsePackageName = (0, (_parsePackageName2 || _load_parsePackageName()).default)(packageInput),
  71554. name = _parsePackageName.name,
  71555. version = _parsePackageName.version;
  71556. var result = void 0;
  71557. try {
  71558. result = yield config.registries.npm.request(name, { unfiltered: true });
  71559. } catch (e) {
  71560. reporter.error(reporter.lang('infoFail'));
  71561. return;
  71562. }
  71563. if (!result) {
  71564. reporter.error(reporter.lang('infoFail'));
  71565. return;
  71566. }
  71567. result = clean(result);
  71568. var versions = result.versions;
  71569. // $FlowFixMe
  71570. result.versions = (0, (_keys || _load_keys()).default)(versions).sort(semver.compareLoose);
  71571. result.version = version || result['dist-tags'].latest;
  71572. result = (0, (_assign || _load_assign()).default)(result, versions[result.version]);
  71573. var fieldPath = args.shift();
  71574. var fields = fieldPath ? fieldPath.split('.') : [];
  71575. // Readmes can be long so exclude them unless explicitly asked for.
  71576. if (fields[0] !== 'readme') {
  71577. delete result.readme;
  71578. }
  71579. result = fields.reduce(function (prev, cur) {
  71580. return prev && prev[cur];
  71581. }, result);
  71582. reporter.inspect(result);
  71583. });
  71584. return function run(_x, _x2, _x3, _x4) {
  71585. return _ref.apply(this, arguments);
  71586. };
  71587. }();
  71588. exports.setFlags = setFlags;
  71589. exports.hasWrapper = hasWrapper;
  71590. var _npmRegistry;
  71591. function _load_npmRegistry() {
  71592. return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
  71593. }
  71594. var _parsePackageName2;
  71595. function _load_parsePackageName() {
  71596. return _parsePackageName2 = _interopRequireDefault(__webpack_require__(545));
  71597. }
  71598. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71599. var semver = __webpack_require__(27);
  71600. function clean(object) {
  71601. if (Array.isArray(object)) {
  71602. var result = [];
  71603. object.forEach(function (item) {
  71604. item = clean(item);
  71605. if (item) {
  71606. result.push(item);
  71607. }
  71608. });
  71609. return result;
  71610. } else if (typeof object === 'object') {
  71611. var _result = {};
  71612. for (var key in object) {
  71613. if (key.startsWith('_')) {
  71614. continue;
  71615. }
  71616. var item = clean(object[key]);
  71617. if (item) {
  71618. _result[key] = item;
  71619. }
  71620. }
  71621. return _result;
  71622. } else if (object) {
  71623. return object;
  71624. } else {
  71625. return null;
  71626. }
  71627. }
  71628. function setFlags(commander) {
  71629. commander.description('Shows information about a package.');
  71630. }
  71631. function hasWrapper(commander, args) {
  71632. return true;
  71633. }
  71634. /***/ }),
  71635. /* 489 */
  71636. /***/ (function(module, exports, __webpack_require__) {
  71637. "use strict";
  71638. Object.defineProperty(exports, "__esModule", {
  71639. value: true
  71640. });
  71641. exports.getGitConfigInfo = exports.run = exports.shouldRunInCurrentCwd = undefined;
  71642. var _assign;
  71643. function _load_assign() {
  71644. return _assign = _interopRequireDefault(__webpack_require__(23));
  71645. }
  71646. var _getIterator2;
  71647. function _load_getIterator() {
  71648. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  71649. }
  71650. var _asyncToGenerator2;
  71651. function _load_asyncToGenerator() {
  71652. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  71653. }
  71654. var run = exports.run = function () {
  71655. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  71656. var installVersion = flags[`2`] ? `berry` : flags.install;
  71657. var forwardedArgs = process.argv.slice(process.argv.indexOf('init', 2) + 1);
  71658. if (installVersion) {
  71659. if (flags[`2`] && process.env.COREPACK_ROOT) {
  71660. yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [path.join(process.env.COREPACK_ROOT, 'dist/corepack.js'), `yarn@${flags.install || `stable`}`, `init`].concat(forwardedArgs, [`--install=self`]), {
  71661. stdio: 'inherit',
  71662. cwd: config.cwd
  71663. });
  71664. } else {
  71665. var lockfilePath = path.resolve(config.cwd, 'yarn.lock');
  71666. if (!(yield (_fs || _load_fs()).exists(lockfilePath))) {
  71667. yield (_fs || _load_fs()).writeFile(lockfilePath, '');
  71668. }
  71669. yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [process.argv[1], 'policies', 'set-version', installVersion, '--silent'], {
  71670. stdio: 'inherit',
  71671. cwd: config.cwd
  71672. });
  71673. yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [process.argv[1], 'init'].concat(forwardedArgs), {
  71674. stdio: 'inherit',
  71675. cwd: config.cwd
  71676. });
  71677. }
  71678. return;
  71679. }
  71680. var manifests = yield config.getRootManifests();
  71681. var repository = {};
  71682. var author = {
  71683. name: config.getOption('init-author-name'),
  71684. email: config.getOption('init-author-email'),
  71685. url: config.getOption('init-author-url')
  71686. };
  71687. if (yield (_fs || _load_fs()).exists(path.join(config.cwd, '.git'))) {
  71688. // get git origin of the cwd
  71689. try {
  71690. repository = {
  71691. type: 'git',
  71692. url: yield (_child || _load_child()).spawn('git', ['config', 'remote.origin.url'], {
  71693. cwd: config.cwd
  71694. })
  71695. };
  71696. } catch (ex) {
  71697. // Ignore - Git repo may not have an origin URL yet (eg. if it only exists locally)
  71698. }
  71699. if (author.name === undefined) {
  71700. author.name = yield getGitConfigInfo('user.name');
  71701. }
  71702. if (author.email === undefined) {
  71703. author.email = yield getGitConfigInfo('user.email');
  71704. }
  71705. }
  71706. var keys = [{
  71707. key: 'name',
  71708. question: 'name',
  71709. default: path.basename(config.cwd),
  71710. validation: (_validate || _load_validate()).isValidPackageName,
  71711. validationError: 'invalidPackageName'
  71712. }, {
  71713. key: 'version',
  71714. question: 'version',
  71715. default: String(config.getOption('init-version'))
  71716. }, {
  71717. key: 'description',
  71718. question: 'description',
  71719. default: ''
  71720. }, {
  71721. key: 'main',
  71722. question: 'entry point',
  71723. default: 'index.js'
  71724. }, {
  71725. key: 'repository',
  71726. question: 'repository url',
  71727. default: (0, (_util || _load_util()).extractRepositoryUrl)(repository)
  71728. }, {
  71729. key: 'author',
  71730. question: 'author',
  71731. default: (0, (_util || _load_util()).stringifyPerson)(author)
  71732. }, {
  71733. key: 'license',
  71734. question: 'license',
  71735. default: String(config.getOption('init-license'))
  71736. }, {
  71737. key: 'private',
  71738. question: 'private',
  71739. default: config.getOption('init-private') || '',
  71740. inputFormatter: yn
  71741. }];
  71742. // get answers
  71743. var pkg = {};
  71744. for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  71745. var _ref2;
  71746. if (_isArray) {
  71747. if (_i >= _iterator.length) break;
  71748. _ref2 = _iterator[_i++];
  71749. } else {
  71750. _i = _iterator.next();
  71751. if (_i.done) break;
  71752. _ref2 = _i.value;
  71753. }
  71754. var entry = _ref2;
  71755. var yes = flags.yes,
  71756. privateFlag = flags.private;
  71757. var manifestKey = entry.key;
  71758. var question = entry.question,
  71759. def = entry.default;
  71760. for (var _iterator4 = (_index || _load_index()).registryNames, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  71761. var _ref5;
  71762. if (_isArray4) {
  71763. if (_i4 >= _iterator4.length) break;
  71764. _ref5 = _iterator4[_i4++];
  71765. } else {
  71766. _i4 = _iterator4.next();
  71767. if (_i4.done) break;
  71768. _ref5 = _i4.value;
  71769. }
  71770. var _registryName = _ref5;
  71771. var object = manifests[_registryName].object;
  71772. var val = objectPath.get(object, manifestKey);
  71773. if (!val) {
  71774. break;
  71775. }
  71776. if (typeof val === 'object') {
  71777. if (manifestKey === 'author') {
  71778. val = (0, (_util || _load_util()).stringifyPerson)(val);
  71779. } else if (manifestKey === 'repository') {
  71780. val = (0, (_util || _load_util()).extractRepositoryUrl)(val);
  71781. }
  71782. }
  71783. def = val;
  71784. }
  71785. if (manifestKey === 'private' && privateFlag) {
  71786. def = true;
  71787. }
  71788. if (def) {
  71789. question += ` (${String(def)})`;
  71790. }
  71791. var answer = void 0;
  71792. var validAnswer = false;
  71793. if (yes) {
  71794. answer = def;
  71795. } else {
  71796. // loop until a valid answer is provided, if validation is on entry
  71797. if (entry.validation) {
  71798. while (!validAnswer) {
  71799. answer = (yield reporter.question(question)) || def;
  71800. // validate answer
  71801. if (entry.validation(String(answer))) {
  71802. validAnswer = true;
  71803. } else {
  71804. reporter.error(reporter.lang('invalidPackageName'));
  71805. }
  71806. }
  71807. } else {
  71808. answer = (yield reporter.question(question)) || def;
  71809. }
  71810. }
  71811. if (answer) {
  71812. if (entry.inputFormatter) {
  71813. answer = entry.inputFormatter(answer);
  71814. }
  71815. objectPath.set(pkg, manifestKey, answer);
  71816. }
  71817. }
  71818. if (pkg.repository && (_githubResolver || _load_githubResolver()).default.isVersion(pkg.repository)) {
  71819. pkg.repository = `https://github.com/${pkg.repository}`;
  71820. }
  71821. // save answers
  71822. var targetManifests = [];
  71823. for (var _iterator2 = (_index || _load_index()).registryNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  71824. var _ref3;
  71825. if (_isArray2) {
  71826. if (_i2 >= _iterator2.length) break;
  71827. _ref3 = _iterator2[_i2++];
  71828. } else {
  71829. _i2 = _iterator2.next();
  71830. if (_i2.done) break;
  71831. _ref3 = _i2.value;
  71832. }
  71833. var registryName = _ref3;
  71834. var info = manifests[registryName];
  71835. if (info.exists) {
  71836. targetManifests.push(info);
  71837. }
  71838. }
  71839. if (!targetManifests.length) {
  71840. targetManifests.push(manifests.npm);
  71841. }
  71842. for (var _iterator3 = targetManifests, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  71843. var _ref4;
  71844. if (_isArray3) {
  71845. if (_i3 >= _iterator3.length) break;
  71846. _ref4 = _iterator3[_i3++];
  71847. } else {
  71848. _i3 = _iterator3.next();
  71849. if (_i3.done) break;
  71850. _ref4 = _i3.value;
  71851. }
  71852. var targetManifest = _ref4;
  71853. (0, (_assign || _load_assign()).default)(targetManifest.object, pkg);
  71854. reporter.success(`Saved ${path.basename(targetManifest.loc)}`);
  71855. }
  71856. yield config.saveRootManifests(manifests);
  71857. });
  71858. return function run(_x, _x2, _x3, _x4) {
  71859. return _ref.apply(this, arguments);
  71860. };
  71861. }();
  71862. var getGitConfigInfo = exports.getGitConfigInfo = function () {
  71863. var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (credential) {
  71864. var spawn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_child || _load_child()).spawn;
  71865. try {
  71866. // try to get author default based on git config
  71867. return yield spawn('git', ['config', credential]);
  71868. } catch (e) {
  71869. return '';
  71870. }
  71871. });
  71872. return function getGitConfigInfo(_x5) {
  71873. return _ref6.apply(this, arguments);
  71874. };
  71875. }();
  71876. exports.setFlags = setFlags;
  71877. exports.hasWrapper = hasWrapper;
  71878. var _util;
  71879. function _load_util() {
  71880. return _util = __webpack_require__(207);
  71881. }
  71882. var _index;
  71883. function _load_index() {
  71884. return _index = __webpack_require__(61);
  71885. }
  71886. var _githubResolver;
  71887. function _load_githubResolver() {
  71888. return _githubResolver = _interopRequireDefault(__webpack_require__(304));
  71889. }
  71890. var _child;
  71891. function _load_child() {
  71892. return _child = _interopRequireWildcard(__webpack_require__(57));
  71893. }
  71894. var _fs;
  71895. function _load_fs() {
  71896. return _fs = _interopRequireWildcard(__webpack_require__(8));
  71897. }
  71898. var _validate;
  71899. function _load_validate() {
  71900. return _validate = _interopRequireWildcard(__webpack_require__(120));
  71901. }
  71902. var _constants;
  71903. function _load_constants() {
  71904. return _constants = __webpack_require__(13);
  71905. }
  71906. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  71907. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71908. var objectPath = __webpack_require__(244);
  71909. var path = __webpack_require__(1);
  71910. var yn = __webpack_require__(1035);
  71911. function setFlags(commander) {
  71912. commander.description('Interactively creates or updates a package.json file.');
  71913. commander.option('-y, --yes', 'use default options');
  71914. commander.option('-p, --private', 'use default options and private true');
  71915. commander.option('-i, --install <value>', 'install a specific Yarn release');
  71916. commander.option('-2', 'generates the project using Yarn 2');
  71917. }
  71918. function hasWrapper(commander, args) {
  71919. return true;
  71920. }
  71921. var shouldRunInCurrentCwd = exports.shouldRunInCurrentCwd = true;
  71922. /***/ }),
  71923. /* 490 */
  71924. /***/ (function(module, exports, __webpack_require__) {
  71925. "use strict";
  71926. Object.defineProperty(exports, "__esModule", {
  71927. value: true
  71928. });
  71929. exports.examples = exports.run = undefined;
  71930. var _getIterator2;
  71931. function _load_getIterator() {
  71932. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  71933. }
  71934. var _map;
  71935. function _load_map() {
  71936. return _map = _interopRequireDefault(__webpack_require__(42));
  71937. }
  71938. var _extends2;
  71939. function _load_extends() {
  71940. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  71941. }
  71942. var _asyncToGenerator2;
  71943. function _load_asyncToGenerator() {
  71944. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  71945. }
  71946. var getManifests = function () {
  71947. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) {
  71948. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd);
  71949. var install = new (_install || _load_install()).Install((0, (_extends2 || _load_extends()).default)({ skipIntegrityCheck: true }, flags), config, new (_baseReporter || _load_baseReporter()).default(), lockfile);
  71950. yield install.hydrate(true);
  71951. var manifests = install.resolver.getManifests();
  71952. // sort by name
  71953. manifests = manifests.sort(function (a, b) {
  71954. if (!a.name && !b.name) {
  71955. return 0;
  71956. }
  71957. if (!a.name) {
  71958. return 1;
  71959. }
  71960. if (!b.name) {
  71961. return -1;
  71962. }
  71963. return a.name.localeCompare(b.name);
  71964. });
  71965. // filter ignored manifests
  71966. manifests = manifests.filter(function (manifest) {
  71967. var ref = manifest._reference;
  71968. return !!ref && !ref.ignore;
  71969. });
  71970. return manifests;
  71971. });
  71972. return function getManifests(_x, _x2) {
  71973. return _ref.apply(this, arguments);
  71974. };
  71975. }();
  71976. var list = function () {
  71977. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  71978. var manifests = yield getManifests(config, flags);
  71979. var manifestsByLicense = new (_map || _load_map()).default();
  71980. for (var _iterator = manifests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  71981. var _ref4;
  71982. if (_isArray) {
  71983. if (_i >= _iterator.length) break;
  71984. _ref4 = _iterator[_i++];
  71985. } else {
  71986. _i = _iterator.next();
  71987. if (_i.done) break;
  71988. _ref4 = _i.value;
  71989. }
  71990. var _ref3 = _ref4;
  71991. var name = _ref3.name,
  71992. version = _ref3.version,
  71993. license = _ref3.license,
  71994. repository = _ref3.repository,
  71995. homepage = _ref3.homepage,
  71996. author = _ref3.author;
  71997. var licenseKey = license || 'UNKNOWN';
  71998. var url = repository ? repository.url : homepage;
  71999. var vendorUrl = homepage || author && author.url;
  72000. var vendorName = author && author.name;
  72001. if (!manifestsByLicense.has(licenseKey)) {
  72002. manifestsByLicense.set(licenseKey, new (_map || _load_map()).default());
  72003. }
  72004. var byLicense = manifestsByLicense.get(licenseKey);
  72005. invariant(byLicense, 'expected value');
  72006. byLicense.set(`${name}@${version}`, {
  72007. name,
  72008. version,
  72009. url,
  72010. vendorUrl,
  72011. vendorName
  72012. });
  72013. }
  72014. if (flags.json) {
  72015. var body = [];
  72016. manifestsByLicense.forEach(function (license, licenseKey) {
  72017. license.forEach(function (_ref5) {
  72018. var name = _ref5.name,
  72019. version = _ref5.version,
  72020. url = _ref5.url,
  72021. vendorUrl = _ref5.vendorUrl,
  72022. vendorName = _ref5.vendorName;
  72023. body.push([name, version, licenseKey, url || 'Unknown', vendorUrl || 'Unknown', vendorName || 'Unknown']);
  72024. });
  72025. });
  72026. reporter.table(['Name', 'Version', 'License', 'URL', 'VendorUrl', 'VendorName'], body);
  72027. } else {
  72028. var trees = [];
  72029. manifestsByLicense.forEach(function (license, licenseKey) {
  72030. var licenseTree = [];
  72031. license.forEach(function (_ref6) {
  72032. var name = _ref6.name,
  72033. version = _ref6.version,
  72034. url = _ref6.url,
  72035. vendorUrl = _ref6.vendorUrl,
  72036. vendorName = _ref6.vendorName;
  72037. var children = [];
  72038. if (url) {
  72039. children.push({ name: `${reporter.format.bold('URL:')} ${url}` });
  72040. }
  72041. if (vendorUrl) {
  72042. children.push({ name: `${reporter.format.bold('VendorUrl:')} ${vendorUrl}` });
  72043. }
  72044. if (vendorName) {
  72045. children.push({ name: `${reporter.format.bold('VendorName:')} ${vendorName}` });
  72046. }
  72047. licenseTree.push({
  72048. name: `${name}@${version}`,
  72049. children
  72050. });
  72051. });
  72052. trees.push({
  72053. name: licenseKey,
  72054. children: licenseTree
  72055. });
  72056. });
  72057. reporter.tree('licenses', trees, { force: true });
  72058. }
  72059. });
  72060. return function list(_x3, _x4, _x5, _x6) {
  72061. return _ref2.apply(this, arguments);
  72062. };
  72063. }();
  72064. exports.hasWrapper = hasWrapper;
  72065. exports.setFlags = setFlags;
  72066. var _baseReporter;
  72067. function _load_baseReporter() {
  72068. return _baseReporter = _interopRequireDefault(__webpack_require__(98));
  72069. }
  72070. var _install;
  72071. function _load_install() {
  72072. return _install = __webpack_require__(41);
  72073. }
  72074. var _lockfile;
  72075. function _load_lockfile() {
  72076. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  72077. }
  72078. var _buildSubCommands2;
  72079. function _load_buildSubCommands() {
  72080. return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
  72081. }
  72082. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  72083. var invariant = __webpack_require__(15);
  72084. function hasWrapper(flags, args) {
  72085. return args[0] != 'generate-disclaimer';
  72086. }
  72087. function setFlags(commander) {
  72088. commander.description('Lists licenses for installed packages.');
  72089. }
  72090. var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('licenses', {
  72091. ls(config, reporter, flags, args) {
  72092. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  72093. reporter.warn(`\`yarn licenses ls\` is deprecated. Please use \`yarn licenses list\`.`);
  72094. yield list(config, reporter, flags, args);
  72095. })();
  72096. },
  72097. list(config, reporter, flags, args) {
  72098. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  72099. yield list(config, reporter, flags, args);
  72100. })();
  72101. },
  72102. generateDisclaimer(config, reporter, flags, args) {
  72103. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  72104. /* eslint-disable no-console */
  72105. // `reporter.log` dumps a bunch of ANSI escapes to clear the current line and
  72106. // is for abstracting the console output so it can be consumed by other tools
  72107. // (JSON output being the primary one). This command is only for text consumption
  72108. // and you should just be dumping it to a TXT file. Using a reporter here has the
  72109. // potential to mess up the output since it might print ansi escapes.
  72110. var manifests = yield getManifests(config, flags);
  72111. var manifest = yield config.readRootManifest();
  72112. // Create a map of license text to manifest so that packages with exactly
  72113. // the same license text are grouped together.
  72114. var manifestsByLicense = new (_map || _load_map()).default();
  72115. for (var _iterator2 = manifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  72116. var _ref7;
  72117. if (_isArray2) {
  72118. if (_i2 >= _iterator2.length) break;
  72119. _ref7 = _iterator2[_i2++];
  72120. } else {
  72121. _i2 = _iterator2.next();
  72122. if (_i2.done) break;
  72123. _ref7 = _i2.value;
  72124. }
  72125. var _manifest = _ref7;
  72126. var licenseText = _manifest.licenseText,
  72127. noticeText = _manifest.noticeText;
  72128. var licenseKey = void 0;
  72129. if (!licenseText) {
  72130. continue;
  72131. }
  72132. if (!noticeText) {
  72133. licenseKey = licenseText;
  72134. } else {
  72135. licenseKey = `${licenseText}\n\nNOTICE\n\n${noticeText}`;
  72136. }
  72137. if (!manifestsByLicense.has(licenseKey)) {
  72138. manifestsByLicense.set(licenseKey, new (_map || _load_map()).default());
  72139. }
  72140. var byLicense = manifestsByLicense.get(licenseKey);
  72141. invariant(byLicense, 'expected value');
  72142. byLicense.set(_manifest.name, _manifest);
  72143. }
  72144. console.log('THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED ' + `IN PORTIONS OF THE ${String(manifest.name).toUpperCase().replace(/-/g, ' ')} PRODUCT.`);
  72145. console.log();
  72146. for (var _iterator3 = manifestsByLicense, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  72147. var _ref9;
  72148. if (_isArray3) {
  72149. if (_i3 >= _iterator3.length) break;
  72150. _ref9 = _iterator3[_i3++];
  72151. } else {
  72152. _i3 = _iterator3.next();
  72153. if (_i3.done) break;
  72154. _ref9 = _i3.value;
  72155. }
  72156. var _ref8 = _ref9;
  72157. var licenseKey = _ref8[0];
  72158. var _manifests = _ref8[1];
  72159. console.log('-----');
  72160. console.log();
  72161. var names = [];
  72162. var urls = [];
  72163. for (var _iterator4 = _manifests, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  72164. var _ref11;
  72165. if (_isArray4) {
  72166. if (_i4 >= _iterator4.length) break;
  72167. _ref11 = _iterator4[_i4++];
  72168. } else {
  72169. _i4 = _iterator4.next();
  72170. if (_i4.done) break;
  72171. _ref11 = _i4.value;
  72172. }
  72173. var _ref10 = _ref11;
  72174. var name = _ref10[0];
  72175. var repository = _ref10[1].repository;
  72176. names.push(name);
  72177. if (repository && repository.url) {
  72178. urls.push(_manifests.size === 1 ? repository.url : `${repository.url} (${name})`);
  72179. }
  72180. }
  72181. var heading = [];
  72182. heading.push(`The following software may be included in this product: ${names.join(', ')}.`);
  72183. if (urls.length > 0) {
  72184. heading.push(`A copy of the source code may be downloaded from ${urls.join(', ')}.`);
  72185. }
  72186. heading.push('This software contains the following license and notice below:');
  72187. console.log(heading.join(' '));
  72188. console.log();
  72189. if (licenseKey) {
  72190. console.log(licenseKey.trim());
  72191. } else {
  72192. // what do we do here? base it on `license`?
  72193. }
  72194. console.log();
  72195. }
  72196. })();
  72197. }
  72198. }),
  72199. run = _buildSubCommands.run,
  72200. examples = _buildSubCommands.examples;
  72201. exports.run = run;
  72202. exports.examples = examples;
  72203. /***/ }),
  72204. /* 491 */
  72205. /***/ (function(module, exports, __webpack_require__) {
  72206. "use strict";
  72207. Object.defineProperty(exports, "__esModule", {
  72208. value: true
  72209. });
  72210. exports.run = undefined;
  72211. var _asyncToGenerator2;
  72212. function _load_asyncToGenerator() {
  72213. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  72214. }
  72215. var run = exports.run = function () {
  72216. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  72217. yield config.registries.yarn.saveHomeConfig({
  72218. username: undefined,
  72219. email: undefined
  72220. });
  72221. reporter.success(reporter.lang('clearedCredentials'));
  72222. });
  72223. return function run(_x, _x2, _x3, _x4) {
  72224. return _ref.apply(this, arguments);
  72225. };
  72226. }();
  72227. exports.setFlags = setFlags;
  72228. exports.hasWrapper = hasWrapper;
  72229. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  72230. function setFlags(commander) {
  72231. commander.description('Clears registry username and email.');
  72232. }
  72233. function hasWrapper(commander, args) {
  72234. return true;
  72235. }
  72236. /***/ }),
  72237. /* 492 */
  72238. /***/ (function(module, exports, __webpack_require__) {
  72239. "use strict";
  72240. Object.defineProperty(exports, "__esModule", {
  72241. value: true
  72242. });
  72243. exports.run = undefined;
  72244. var _extends2;
  72245. function _load_extends() {
  72246. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  72247. }
  72248. var _asyncToGenerator2;
  72249. function _load_asyncToGenerator() {
  72250. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  72251. }
  72252. var run = exports.run = function () {
  72253. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  72254. var pnpPath = `${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`;
  72255. var nodeOptions = process.env.NODE_OPTIONS || '';
  72256. if (yield (_fs || _load_fs()).exists(pnpPath)) {
  72257. nodeOptions = `--require ${pnpPath} ${nodeOptions}`;
  72258. }
  72259. try {
  72260. yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, args, {
  72261. stdio: 'inherit',
  72262. cwd: flags.into || config.cwd,
  72263. env: (0, (_extends2 || _load_extends()).default)({}, process.env, { NODE_OPTIONS: nodeOptions })
  72264. });
  72265. } catch (err) {
  72266. throw err;
  72267. }
  72268. });
  72269. return function run(_x, _x2, _x3, _x4) {
  72270. return _ref.apply(this, arguments);
  72271. };
  72272. }();
  72273. exports.setFlags = setFlags;
  72274. exports.hasWrapper = hasWrapper;
  72275. var _child;
  72276. function _load_child() {
  72277. return _child = _interopRequireWildcard(__webpack_require__(57));
  72278. }
  72279. var _fs;
  72280. function _load_fs() {
  72281. return _fs = _interopRequireWildcard(__webpack_require__(8));
  72282. }
  72283. var _constants;
  72284. function _load_constants() {
  72285. return _constants = __webpack_require__(13);
  72286. }
  72287. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  72288. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  72289. function setFlags(commander) {
  72290. commander.description('Runs Node with the same version that the one used by Yarn itself, and by default from the project root');
  72291. commander.usage('node [--into PATH] [... args]');
  72292. commander.option('--into <path>', 'Sets the cwd to the specified location');
  72293. }
  72294. function hasWrapper(commander, args) {
  72295. return true;
  72296. }
  72297. /***/ }),
  72298. /* 493 */
  72299. /***/ (function(module, exports, __webpack_require__) {
  72300. "use strict";
  72301. Object.defineProperty(exports, "__esModule", {
  72302. value: true
  72303. });
  72304. exports.run = exports.requireLockfile = undefined;
  72305. var _set;
  72306. function _load_set() {
  72307. return _set = _interopRequireDefault(__webpack_require__(16));
  72308. }
  72309. var _extends2;
  72310. function _load_extends() {
  72311. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  72312. }
  72313. var _asyncToGenerator2;
  72314. function _load_asyncToGenerator() {
  72315. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  72316. }
  72317. var run = exports.run = function () {
  72318. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  72319. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder);
  72320. var install = new (_install || _load_install()).Install((0, (_extends2 || _load_extends()).default)({}, flags, { includeWorkspaceDeps: true }), config, reporter, lockfile);
  72321. var deps = yield (_packageRequest || _load_packageRequest()).default.getOutdatedPackages(lockfile, install, config, reporter);
  72322. if (args.length) {
  72323. var requested = new (_set || _load_set()).default(args);
  72324. deps = deps.filter(function (_ref2) {
  72325. var name = _ref2.name;
  72326. return requested.has(name);
  72327. });
  72328. }
  72329. var getNameFromHint = function getNameFromHint(hint) {
  72330. return hint ? `${hint}Dependencies` : 'dependencies';
  72331. };
  72332. var colorizeName = function colorizeName(_ref3) {
  72333. var current = _ref3.current,
  72334. latest = _ref3.latest,
  72335. name = _ref3.name;
  72336. return reporter.format[(0, (_colorForVersions || _load_colorForVersions()).default)(current, latest)](name);
  72337. };
  72338. if (deps.length) {
  72339. var usesWorkspaces = !!config.workspaceRootFolder;
  72340. var body = deps.map(function (info) {
  72341. var row = [colorizeName(info), info.current, (0, (_colorizeDiff || _load_colorizeDiff()).default)(info.current, info.wanted, reporter), reporter.format.cyan(info.latest), info.workspaceName || '', getNameFromHint(info.hint), reporter.format.cyan(info.url)];
  72342. if (!usesWorkspaces) {
  72343. row.splice(4, 1);
  72344. }
  72345. return row;
  72346. });
  72347. var red = reporter.format.red('<red>');
  72348. var yellow = reporter.format.yellow('<yellow>');
  72349. var green = reporter.format.green('<green>');
  72350. reporter.info(reporter.lang('legendColorsForVersionUpdates', red, yellow, green));
  72351. var header = ['Package', 'Current', 'Wanted', 'Latest', 'Workspace', 'Package Type', 'URL'];
  72352. if (!usesWorkspaces) {
  72353. header.splice(4, 1);
  72354. }
  72355. reporter.table(header, body);
  72356. return 1;
  72357. }
  72358. return 0;
  72359. });
  72360. return function run(_x, _x2, _x3, _x4) {
  72361. return _ref.apply(this, arguments);
  72362. };
  72363. }();
  72364. exports.setFlags = setFlags;
  72365. exports.hasWrapper = hasWrapper;
  72366. var _packageRequest;
  72367. function _load_packageRequest() {
  72368. return _packageRequest = _interopRequireDefault(__webpack_require__(117));
  72369. }
  72370. var _lockfile;
  72371. function _load_lockfile() {
  72372. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  72373. }
  72374. var _install;
  72375. function _load_install() {
  72376. return _install = __webpack_require__(41);
  72377. }
  72378. var _colorForVersions;
  72379. function _load_colorForVersions() {
  72380. return _colorForVersions = _interopRequireDefault(__webpack_require__(306));
  72381. }
  72382. var _colorizeDiff;
  72383. function _load_colorizeDiff() {
  72384. return _colorizeDiff = _interopRequireDefault(__webpack_require__(307));
  72385. }
  72386. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  72387. var requireLockfile = exports.requireLockfile = true;
  72388. function setFlags(commander) {
  72389. commander.description('Checks for outdated package dependencies.');
  72390. commander.usage('outdated [packages ...]');
  72391. }
  72392. function hasWrapper(commander, args) {
  72393. return true;
  72394. }
  72395. /***/ }),
  72396. /* 494 */
  72397. /***/ (function(module, exports, __webpack_require__) {
  72398. "use strict";
  72399. Object.defineProperty(exports, "__esModule", {
  72400. value: true
  72401. });
  72402. exports.examples = exports.hasWrapper = exports.run = exports.mutate = undefined;
  72403. var _getIterator2;
  72404. function _load_getIterator() {
  72405. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  72406. }
  72407. var _asyncToGenerator2;
  72408. function _load_asyncToGenerator() {
  72409. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  72410. }
  72411. var mutate = exports.mutate = function () {
  72412. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (args, config, reporter, buildMessages, mutator) {
  72413. if (args.length !== 2 && args.length !== 1) {
  72414. return false;
  72415. }
  72416. var username = args.shift();
  72417. var name = yield (0, (_tag || _load_tag()).getName)(args, config);
  72418. if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) {
  72419. throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName'));
  72420. }
  72421. var msgs = buildMessages(username, name);
  72422. reporter.step(1, 3, reporter.lang('loggingIn'));
  72423. var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name);
  72424. reporter.step(2, 3, msgs.info);
  72425. var user = yield config.registries.npm.request(`-/user/org.couchdb.user:${username}`);
  72426. var error = false;
  72427. if (user) {
  72428. // get package
  72429. var _pkg = yield config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(name));
  72430. if (_pkg) {
  72431. _pkg.maintainers = _pkg.maintainers || [];
  72432. error = mutator({ name: user.name, email: user.email }, _pkg);
  72433. } else {
  72434. error = true;
  72435. reporter.error(reporter.lang('unknownPackage', name));
  72436. }
  72437. // update package
  72438. if (_pkg && !error) {
  72439. var res = yield config.registries.npm.request(`${(_npmRegistry || _load_npmRegistry()).default.escapeName(name)}/-rev/${_pkg._rev}`, {
  72440. method: 'PUT',
  72441. body: {
  72442. _id: _pkg._id,
  72443. _rev: _pkg._rev,
  72444. maintainers: _pkg.maintainers
  72445. }
  72446. });
  72447. if (res != null && res.success) {
  72448. reporter.success(msgs.success);
  72449. } else {
  72450. error = true;
  72451. reporter.error(msgs.error);
  72452. }
  72453. }
  72454. } else {
  72455. error = true;
  72456. reporter.error(reporter.lang('unknownUser', username));
  72457. }
  72458. reporter.step(3, 3, reporter.lang('revokingToken'));
  72459. yield revoke();
  72460. if (error) {
  72461. throw new Error();
  72462. } else {
  72463. return true;
  72464. }
  72465. });
  72466. return function mutate(_x, _x2, _x3, _x4, _x5) {
  72467. return _ref.apply(this, arguments);
  72468. };
  72469. }();
  72470. var list = function () {
  72471. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  72472. if (args.length > 1) {
  72473. return false;
  72474. }
  72475. var name = yield (0, (_tag || _load_tag()).getName)(args, config);
  72476. reporter.step(1, 1, reporter.lang('ownerGetting', name));
  72477. var pkg = yield config.registries.npm.request(name, { unfiltered: true });
  72478. if (pkg) {
  72479. var owners = pkg.maintainers;
  72480. if (!owners || !owners.length) {
  72481. reporter.warn(reporter.lang('ownerNone'));
  72482. } else {
  72483. for (var _iterator = owners, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  72484. var _ref3;
  72485. if (_isArray) {
  72486. if (_i >= _iterator.length) break;
  72487. _ref3 = _iterator[_i++];
  72488. } else {
  72489. _i = _iterator.next();
  72490. if (_i.done) break;
  72491. _ref3 = _i.value;
  72492. }
  72493. var owner = _ref3;
  72494. reporter.info(`${owner.name} <${owner.email}>`);
  72495. }
  72496. }
  72497. } else {
  72498. reporter.error(reporter.lang('ownerGettingFailed'));
  72499. }
  72500. if (pkg) {
  72501. return true;
  72502. } else {
  72503. throw new Error();
  72504. }
  72505. });
  72506. return function list(_x6, _x7, _x8, _x9) {
  72507. return _ref2.apply(this, arguments);
  72508. };
  72509. }();
  72510. exports.setFlags = setFlags;
  72511. var _errors;
  72512. function _load_errors() {
  72513. return _errors = __webpack_require__(6);
  72514. }
  72515. var _buildSubCommands2;
  72516. function _load_buildSubCommands() {
  72517. return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
  72518. }
  72519. var _validate;
  72520. function _load_validate() {
  72521. return _validate = __webpack_require__(120);
  72522. }
  72523. var _tag;
  72524. function _load_tag() {
  72525. return _tag = __webpack_require__(297);
  72526. }
  72527. var _login;
  72528. function _load_login() {
  72529. return _login = __webpack_require__(97);
  72530. }
  72531. var _npmRegistry;
  72532. function _load_npmRegistry() {
  72533. return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
  72534. }
  72535. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  72536. function remove(config, reporter, flags, args) {
  72537. return mutate(args, config, reporter, function (username, name) {
  72538. return {
  72539. info: reporter.lang('ownerRemoving', username, name),
  72540. success: reporter.lang('ownerRemoved'),
  72541. error: reporter.lang('ownerRemoveError')
  72542. };
  72543. }, function (user, pkg) {
  72544. var found = false;
  72545. pkg.maintainers = pkg.maintainers.filter(function (o) {
  72546. var match = o.name === user.name;
  72547. found = found || match;
  72548. return !match;
  72549. });
  72550. if (!found) {
  72551. reporter.error(reporter.lang('userNotAnOwner', user.name));
  72552. }
  72553. return found;
  72554. });
  72555. }
  72556. function setFlags(commander) {
  72557. commander.description('Manages package owners.');
  72558. }
  72559. var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('owner', {
  72560. add(config, reporter, flags, args) {
  72561. return mutate(args, config, reporter, function (username, name) {
  72562. return {
  72563. info: reporter.lang('ownerAdding', username, name),
  72564. success: reporter.lang('ownerAdded'),
  72565. error: reporter.lang('ownerAddingFailed')
  72566. };
  72567. }, function (user, pkg) {
  72568. for (var _iterator2 = pkg.maintainers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  72569. var _ref4;
  72570. if (_isArray2) {
  72571. if (_i2 >= _iterator2.length) break;
  72572. _ref4 = _iterator2[_i2++];
  72573. } else {
  72574. _i2 = _iterator2.next();
  72575. if (_i2.done) break;
  72576. _ref4 = _i2.value;
  72577. }
  72578. var owner = _ref4;
  72579. if (owner.name === user) {
  72580. reporter.error(reporter.lang('ownerAlready'));
  72581. return true;
  72582. }
  72583. }
  72584. pkg.maintainers.push(user);
  72585. return false;
  72586. });
  72587. },
  72588. rm(config, reporter, flags, args) {
  72589. reporter.warn(`\`yarn owner rm\` is deprecated. Please use \`yarn owner remove\`.`);
  72590. return remove(config, reporter, flags, args);
  72591. },
  72592. remove(config, reporter, flags, args) {
  72593. return remove(config, reporter, flags, args);
  72594. },
  72595. ls(config, reporter, flags, args) {
  72596. reporter.warn(`\`yarn owner ls\` is deprecated. Please use \`yarn owner list\`.`);
  72597. return list(config, reporter, flags, args);
  72598. },
  72599. list(config, reporter, flags, args) {
  72600. return list(config, reporter, flags, args);
  72601. }
  72602. }, ['add <user> [[<@scope>/]<pkg>]', 'remove <user> [[<@scope>/]<pkg>]', 'list [<@scope>/]<pkg>']),
  72603. run = _buildSubCommands.run,
  72604. hasWrapper = _buildSubCommands.hasWrapper,
  72605. examples = _buildSubCommands.examples;
  72606. exports.run = run;
  72607. exports.hasWrapper = hasWrapper;
  72608. exports.examples = examples;
  72609. /***/ }),
  72610. /* 495 */
  72611. /***/ (function(module, exports, __webpack_require__) {
  72612. "use strict";
  72613. Object.defineProperty(exports, "__esModule", {
  72614. value: true
  72615. });
  72616. exports.examples = exports.setFlags = exports.run = undefined;
  72617. var _stringify;
  72618. function _load_stringify() {
  72619. return _stringify = _interopRequireDefault(__webpack_require__(37));
  72620. }
  72621. var _extends2;
  72622. function _load_extends() {
  72623. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  72624. }
  72625. var _asyncToGenerator2;
  72626. function _load_asyncToGenerator() {
  72627. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  72628. }
  72629. var fetchReleases = function () {
  72630. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
  72631. var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  72632. _ref2$includePrerelea = _ref2.includePrereleases,
  72633. includePrereleases = _ref2$includePrerelea === undefined ? false : _ref2$includePrerelea;
  72634. var token = process.env.GITHUB_TOKEN;
  72635. var tokenUrlParameter = token ? `?access_token=${token}` : '';
  72636. var request = yield config.requestManager.request({
  72637. url: `https://api.github.com/repos/yarnpkg/yarn/releases${tokenUrlParameter}`,
  72638. json: true
  72639. });
  72640. var releases = request.filter(function (release) {
  72641. if (release.draft) {
  72642. return false;
  72643. }
  72644. if (release.prerelease && !includePrereleases) {
  72645. return false;
  72646. }
  72647. // $FlowFixMe
  72648. release.version = semver.coerce(release.tag_name);
  72649. if (!release.version) {
  72650. return false;
  72651. }
  72652. if (!getBundleAsset(release)) {
  72653. return false;
  72654. }
  72655. return true;
  72656. });
  72657. releases.sort(function (a, b) {
  72658. // $FlowFixMe
  72659. return -semver.compare(a.version, b.version);
  72660. });
  72661. return releases;
  72662. });
  72663. return function fetchReleases(_x) {
  72664. return _ref.apply(this, arguments);
  72665. };
  72666. }();
  72667. exports.hasWrapper = hasWrapper;
  72668. var _yarnVersion;
  72669. function _load_yarnVersion() {
  72670. return _yarnVersion = __webpack_require__(96);
  72671. }
  72672. var _child;
  72673. function _load_child() {
  72674. return _child = _interopRequireWildcard(__webpack_require__(57));
  72675. }
  72676. var _buildSubCommands2;
  72677. function _load_buildSubCommands() {
  72678. return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
  72679. }
  72680. var _rc;
  72681. function _load_rc() {
  72682. return _rc = __webpack_require__(274);
  72683. }
  72684. var _fs;
  72685. function _load_fs() {
  72686. return _fs = _interopRequireWildcard(__webpack_require__(8));
  72687. }
  72688. var _lockfile;
  72689. function _load_lockfile() {
  72690. return _lockfile = __webpack_require__(25);
  72691. }
  72692. var _semver;
  72693. function _load_semver() {
  72694. return _semver = __webpack_require__(160);
  72695. }
  72696. var _constants;
  72697. function _load_constants() {
  72698. return _constants = __webpack_require__(13);
  72699. }
  72700. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  72701. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  72702. /* eslint-disable max-len */
  72703. var V2_NAMES = ['berry', 'stable', 'canary', 'v2', '2'];
  72704. var isLocalFile = function isLocalFile(version) {
  72705. return version.match(/^\.{0,2}[\\/]/) || path.isAbsolute(version);
  72706. };
  72707. var isV2Version = function isV2Version(version) {
  72708. return (0, (_semver || _load_semver()).satisfiesWithPrereleases)(version, '>=2.0.0');
  72709. };
  72710. var chalk = __webpack_require__(33);
  72711. var invariant = __webpack_require__(15);
  72712. var path = __webpack_require__(1);
  72713. var semver = __webpack_require__(27);
  72714. function getBundleAsset(release) {
  72715. return release.assets.find(function (asset) {
  72716. return asset.name.match(/^yarn-[0-9]+\.[0-9]+\.[0-9]+\.js$/);
  72717. });
  72718. }
  72719. function fetchBundle(config, url) {
  72720. return config.requestManager.request({
  72721. url,
  72722. buffer: true
  72723. });
  72724. }
  72725. function hasWrapper(flags, args) {
  72726. return false;
  72727. }
  72728. var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('policies', {
  72729. setVersion(config, reporter, flags, args) {
  72730. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  72731. var initialRange = args[0] || 'latest';
  72732. var range = initialRange;
  72733. var allowRc = flags.rc;
  72734. if (range === 'rc') {
  72735. reporter.log(`${chalk.yellow(`Warning:`)} Your current Yarn binary is currently Yarn ${(_yarnVersion || _load_yarnVersion()).version}; to avoid potential breaking changes, 'set version rc' won't receive upgrades past the 1.22.x branch.\n To upgrade to the latest versions, run ${chalk.cyan(`yarn set version`)} ${chalk.yellow.underline(`canary`)} instead. Sorry for the inconvenience.\n`);
  72736. range = '*';
  72737. allowRc = true;
  72738. }
  72739. if (range === 'latest') {
  72740. reporter.log(`${chalk.yellow(`Warning:`)} Your current Yarn binary is currently Yarn ${(_yarnVersion || _load_yarnVersion()).version}; to avoid potential breaking changes, 'set version latest' won't receive upgrades past the 1.22.x branch.\n To upgrade to the latest versions, run ${chalk.cyan(`yarn set version`)} ${chalk.yellow.underline(`stable`)} instead. Sorry for the inconvenience.\n`);
  72741. range = '*';
  72742. }
  72743. if (range === 'classic') {
  72744. range = '*';
  72745. }
  72746. var bundleUrl = void 0;
  72747. var bundleVersion = void 0;
  72748. var isV2 = false;
  72749. if (range === 'nightly' || range === 'nightlies') {
  72750. reporter.log(`${chalk.yellow(`Warning:`)} Nightlies only exist for Yarn 1.x; starting from 2.x onwards, you should use 'canary' instead`);
  72751. bundleUrl = 'https://nightly.yarnpkg.com/latest.js';
  72752. bundleVersion = 'nightly';
  72753. } else if (V2_NAMES.indexOf(range) !== -1 || isLocalFile(range) || isV2Version(range)) {
  72754. var normalizedRange = isV2Version(range) ? range : range === `canary` ? `canary` : `stable`;
  72755. if (process.env.COREPACK_ROOT) {
  72756. yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [path.join(process.env.COREPACK_ROOT, 'dist/corepack.js'), `yarn@${normalizedRange}`, `set`, `version`, normalizedRange], {
  72757. stdio: 'inherit',
  72758. cwd: config.cwd
  72759. });
  72760. return;
  72761. } else {
  72762. var _bundle = yield fetchBundle(config, 'https://github.com/yarnpkg/berry/raw/master/packages/yarnpkg-cli/bin/yarn.js');
  72763. var _yarnPath = path.resolve(config.lockfileFolder, `.yarn/releases/yarn-stable-temp.cjs`);
  72764. yield (_fs || _load_fs()).mkdirp(path.dirname(_yarnPath));
  72765. yield (_fs || _load_fs()).writeFile(_yarnPath, _bundle);
  72766. yield (_fs || _load_fs()).chmod(_yarnPath, 0o755);
  72767. try {
  72768. yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [_yarnPath, 'set', 'version', range], {
  72769. stdio: 'inherit',
  72770. cwd: config.lockfileFolder,
  72771. env: (0, (_extends2 || _load_extends()).default)({}, process.env, {
  72772. YARN_IGNORE_PATH: `1`
  72773. })
  72774. });
  72775. } catch (err) {
  72776. // eslint-disable-next-line no-process-exit
  72777. process.exit(1);
  72778. }
  72779. return;
  72780. }
  72781. } else {
  72782. reporter.log(`Resolving ${chalk.yellow(initialRange)} to a url...`);
  72783. var releases = [];
  72784. try {
  72785. releases = yield fetchReleases(config, {
  72786. includePrereleases: allowRc
  72787. });
  72788. } catch (e) {
  72789. reporter.error(e.message);
  72790. return;
  72791. }
  72792. var release = releases.find(function (release) {
  72793. // $FlowFixMe
  72794. return semver.satisfies(release.version, range);
  72795. });
  72796. if (!release) {
  72797. throw new Error(`Release not found: ${range}`);
  72798. }
  72799. var asset = getBundleAsset(release);
  72800. invariant(asset, 'The bundle asset should exist');
  72801. bundleUrl = asset.browser_download_url;
  72802. bundleVersion = release.version.version;
  72803. }
  72804. reporter.log(`Downloading ${chalk.green(bundleUrl)}...`);
  72805. var bundle = yield fetchBundle(config, bundleUrl);
  72806. var yarnPath = path.resolve(config.lockfileFolder, `.yarn/releases/yarn-${bundleVersion}.cjs`);
  72807. reporter.log(`Saving it into ${chalk.magenta(yarnPath)}...`);
  72808. yield (_fs || _load_fs()).mkdirp(path.dirname(yarnPath));
  72809. yield (_fs || _load_fs()).writeFile(yarnPath, bundle);
  72810. yield (_fs || _load_fs()).chmod(yarnPath, 0o755);
  72811. var targetPath = path.relative(config.lockfileFolder, yarnPath).replace(/\\/g, '/');
  72812. if (isV2) {
  72813. var rcPath = `${config.lockfileFolder}/.yarnrc.yml`;
  72814. reporter.log(`Updating ${chalk.magenta(rcPath)}...`);
  72815. yield (_fs || _load_fs()).writeFilePreservingEol(rcPath, `yarnPath: ${(0, (_stringify || _load_stringify()).default)(targetPath)}\n`);
  72816. } else {
  72817. var _rcPath = `${config.lockfileFolder}/.yarnrc`;
  72818. reporter.log(`Updating ${chalk.magenta(_rcPath)}...`);
  72819. var rc = (0, (_rc || _load_rc()).getRcConfigForFolder)(config.lockfileFolder);
  72820. rc['yarn-path'] = targetPath;
  72821. yield (_fs || _load_fs()).writeFilePreservingEol(_rcPath, `${(0, (_lockfile || _load_lockfile()).stringify)(rc)}\n`);
  72822. }
  72823. reporter.log(`Done!`);
  72824. })();
  72825. }
  72826. }),
  72827. run = _buildSubCommands.run,
  72828. setFlags = _buildSubCommands.setFlags,
  72829. examples = _buildSubCommands.examples;
  72830. exports.run = run;
  72831. exports.setFlags = setFlags;
  72832. exports.examples = examples;
  72833. /***/ }),
  72834. /* 496 */
  72835. /***/ (function(module, exports, __webpack_require__) {
  72836. "use strict";
  72837. Object.defineProperty(exports, "__esModule", {
  72838. value: true
  72839. });
  72840. exports.run = undefined;
  72841. var _assign;
  72842. function _load_assign() {
  72843. return _assign = _interopRequireDefault(__webpack_require__(23));
  72844. }
  72845. var _promise;
  72846. function _load_promise() {
  72847. return _promise = _interopRequireDefault(__webpack_require__(7));
  72848. }
  72849. var _asyncToGenerator2;
  72850. function _load_asyncToGenerator() {
  72851. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  72852. }
  72853. var publish = function () {
  72854. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, pkg, flags, dir) {
  72855. var access = flags.access;
  72856. // if no access level is provided, check package.json for `publishConfig.access`
  72857. // see: https://docs.npmjs.com/files/package.json#publishconfig
  72858. if (!access && pkg && pkg.publishConfig && pkg.publishConfig.access) {
  72859. access = pkg.publishConfig.access;
  72860. }
  72861. // validate access argument
  72862. if (access && access !== 'public' && access !== 'restricted') {
  72863. throw new (_errors || _load_errors()).MessageError(config.reporter.lang('invalidAccess'));
  72864. }
  72865. // TODO this might modify package.json, do we need to reload it?
  72866. yield config.executeLifecycleScript('prepublish');
  72867. yield config.executeLifecycleScript('prepare');
  72868. yield config.executeLifecycleScript('prepublishOnly');
  72869. yield config.executeLifecycleScript('prepack');
  72870. // get tarball stream
  72871. var stat = yield (_fs || _load_fs()).lstat(dir);
  72872. var stream = void 0;
  72873. if (stat.isDirectory()) {
  72874. stream = yield (0, (_pack || _load_pack()).pack)(config);
  72875. } else if (stat.isFile()) {
  72876. stream = fs2.createReadStream(dir);
  72877. } else {
  72878. throw new Error("Don't know how to handle this file type");
  72879. }
  72880. var buffer = yield new (_promise || _load_promise()).default(function (resolve, reject) {
  72881. var data = [];
  72882. invariant(stream, 'expected stream');
  72883. stream.on('data', data.push.bind(data)).on('end', function () {
  72884. return resolve(Buffer.concat(data));
  72885. }).on('error', reject);
  72886. });
  72887. yield config.executeLifecycleScript('postpack');
  72888. // copy normalized package and remove internal keys as they may be sensitive or yarn specific
  72889. pkg = (0, (_assign || _load_assign()).default)({}, pkg);
  72890. for (var key in pkg) {
  72891. if (key[0] === '_') {
  72892. delete pkg[key];
  72893. }
  72894. }
  72895. var tag = flags.tag || 'latest';
  72896. var tbName = `${pkg.name}-${pkg.version}.tgz`;
  72897. var tbURI = `${pkg.name}/-/${tbName}`;
  72898. // create body
  72899. var root = {
  72900. _id: pkg.name,
  72901. access,
  72902. name: pkg.name,
  72903. description: pkg.description,
  72904. 'dist-tags': {
  72905. [tag]: pkg.version
  72906. },
  72907. versions: {
  72908. [pkg.version]: pkg
  72909. },
  72910. readme: pkg.readme || '',
  72911. _attachments: {
  72912. [tbName]: {
  72913. content_type: 'application/octet-stream',
  72914. data: buffer.toString('base64'),
  72915. length: buffer.length
  72916. }
  72917. }
  72918. };
  72919. pkg._id = `${pkg.name}@${pkg.version}`;
  72920. pkg.dist = pkg.dist || {};
  72921. pkg.dist.shasum = crypto.createHash('sha1').update(buffer).digest('hex');
  72922. pkg.dist.integrity = ssri.fromData(buffer).toString();
  72923. var registry = String(config.getOption('registry'));
  72924. pkg.dist.tarball = url.resolve(registry, tbURI).replace(/^https:\/\//, 'http://');
  72925. // publish package
  72926. try {
  72927. yield config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(pkg.name), {
  72928. registry: pkg && pkg.publishConfig && pkg.publishConfig.registry,
  72929. method: 'PUT',
  72930. body: root
  72931. });
  72932. } catch (error) {
  72933. throw new (_errors || _load_errors()).MessageError(config.reporter.lang('publishFail', error.message));
  72934. }
  72935. yield config.executeLifecycleScript('publish');
  72936. yield config.executeLifecycleScript('postpublish');
  72937. });
  72938. return function publish(_x, _x2, _x3, _x4) {
  72939. return _ref.apply(this, arguments);
  72940. };
  72941. }();
  72942. var run = exports.run = function () {
  72943. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  72944. // validate arguments
  72945. var dir = args[0] ? (_path || _load_path()).default.resolve(config.cwd, args[0]) : config.cwd;
  72946. if (args.length > 1) {
  72947. throw new (_errors || _load_errors()).MessageError(reporter.lang('tooManyArguments', 1));
  72948. }
  72949. if (!(yield (_fs || _load_fs()).exists(dir))) {
  72950. throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownFolderOrTarball'));
  72951. }
  72952. var stat = yield (_fs || _load_fs()).lstat(dir);
  72953. var publishPath = dir;
  72954. if (stat.isDirectory()) {
  72955. config.cwd = (_path || _load_path()).default.resolve(dir);
  72956. publishPath = config.cwd;
  72957. }
  72958. // validate package fields that are required for publishing
  72959. // $FlowFixMe
  72960. var pkg = yield config.readRootManifest();
  72961. if (pkg.private) {
  72962. throw new (_errors || _load_errors()).MessageError(reporter.lang('publishPrivate'));
  72963. }
  72964. if (!pkg.name) {
  72965. throw new (_errors || _load_errors()).MessageError(reporter.lang('noName'));
  72966. }
  72967. var registry = '';
  72968. if (pkg && pkg.publishConfig && pkg.publishConfig.registry) {
  72969. registry = pkg.publishConfig.registry;
  72970. }
  72971. reporter.step(1, 4, reporter.lang('bumpingVersion'));
  72972. var commitVersion = yield (0, (_version || _load_version()).setVersion)(config, reporter, flags, [], false);
  72973. //
  72974. reporter.step(2, 4, reporter.lang('loggingIn'));
  72975. var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, pkg.name, flags, registry);
  72976. //
  72977. reporter.step(3, 4, reporter.lang('publishing'));
  72978. yield publish(config, pkg, flags, publishPath);
  72979. yield commitVersion();
  72980. reporter.success(reporter.lang('published'));
  72981. //
  72982. reporter.step(4, 4, reporter.lang('revokingToken'));
  72983. yield revoke();
  72984. });
  72985. return function run(_x5, _x6, _x7, _x8) {
  72986. return _ref2.apply(this, arguments);
  72987. };
  72988. }();
  72989. exports.setFlags = setFlags;
  72990. exports.hasWrapper = hasWrapper;
  72991. var _npmRegistry;
  72992. function _load_npmRegistry() {
  72993. return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
  72994. }
  72995. var _errors;
  72996. function _load_errors() {
  72997. return _errors = __webpack_require__(6);
  72998. }
  72999. var _version;
  73000. function _load_version() {
  73001. return _version = __webpack_require__(299);
  73002. }
  73003. var _fs;
  73004. function _load_fs() {
  73005. return _fs = _interopRequireWildcard(__webpack_require__(8));
  73006. }
  73007. var _pack;
  73008. function _load_pack() {
  73009. return _pack = __webpack_require__(155);
  73010. }
  73011. var _login;
  73012. function _load_login() {
  73013. return _login = __webpack_require__(97);
  73014. }
  73015. var _path;
  73016. function _load_path() {
  73017. return _path = _interopRequireDefault(__webpack_require__(1));
  73018. }
  73019. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  73020. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73021. var invariant = __webpack_require__(15);
  73022. var crypto = __webpack_require__(21);
  73023. var url = __webpack_require__(29);
  73024. var fs2 = __webpack_require__(12);
  73025. var ssri = __webpack_require__(93);
  73026. function setFlags(commander) {
  73027. (0, (_version || _load_version()).setFlags)(commander);
  73028. commander.description('Publishes a package to the npm registry.');
  73029. commander.usage('publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>]');
  73030. commander.option('--access [access]', 'access');
  73031. commander.option('--tag [tag]', 'tag');
  73032. }
  73033. function hasWrapper(commander, args) {
  73034. return true;
  73035. }
  73036. /***/ }),
  73037. /* 497 */
  73038. /***/ (function(module, exports, __webpack_require__) {
  73039. "use strict";
  73040. Object.defineProperty(exports, "__esModule", {
  73041. value: true
  73042. });
  73043. exports.examples = exports.hasWrapper = exports.run = undefined;
  73044. var _extends2;
  73045. function _load_extends() {
  73046. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  73047. }
  73048. var _asyncToGenerator2;
  73049. function _load_asyncToGenerator() {
  73050. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  73051. }
  73052. var removeTeamUser = function () {
  73053. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter) {
  73054. reporter.step(2, 3, reporter.lang('teamRemovingUser'));
  73055. reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user`, {
  73056. method: 'DELETE',
  73057. body: {
  73058. user: parts.user
  73059. }
  73060. })));
  73061. return true;
  73062. });
  73063. return function removeTeamUser(_x6, _x7, _x8) {
  73064. return _ref2.apply(this, arguments);
  73065. };
  73066. }();
  73067. var list = function () {
  73068. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter) {
  73069. reporter.step(2, 3, reporter.lang('teamListing'));
  73070. var uriParams = '?format=cli';
  73071. if (parts.team) {
  73072. reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user${uriParams}`)));
  73073. } else {
  73074. reporter.inspect((yield config.registries.npm.request(`org/${parts.scope}/team${uriParams}`)));
  73075. }
  73076. return true;
  73077. });
  73078. return function list(_x9, _x10, _x11) {
  73079. return _ref3.apply(this, arguments);
  73080. };
  73081. }();
  73082. exports.setFlags = setFlags;
  73083. var _buildSubCommands2;
  73084. function _load_buildSubCommands() {
  73085. return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
  73086. }
  73087. var _login;
  73088. function _load_login() {
  73089. return _login = __webpack_require__(97);
  73090. }
  73091. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73092. function explodeScopeTeam(arg, requireTeam, reporter) {
  73093. var _arg$split = arg.split(':'),
  73094. scope = _arg$split[0],
  73095. team = _arg$split[1],
  73096. parts = _arg$split.slice(2);
  73097. if (parts.length) {
  73098. return false;
  73099. }
  73100. if (requireTeam && !team) {
  73101. return false;
  73102. }
  73103. return {
  73104. scope: scope || '',
  73105. team: team || '',
  73106. user: ''
  73107. };
  73108. }
  73109. function warnDeprecation(reporter, deprecationWarning) {
  73110. var command = 'yarn team';
  73111. reporter.warn(reporter.lang('deprecatedCommand', `${command} ${deprecationWarning.deprecatedCommand}`, `${command} ${deprecationWarning.currentCommand}`));
  73112. }
  73113. function wrapRequired(callback, requireTeam, deprecationInfo) {
  73114. return function () {
  73115. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  73116. if (deprecationInfo) {
  73117. warnDeprecation(reporter, deprecationInfo);
  73118. }
  73119. if (!args.length) {
  73120. return false;
  73121. }
  73122. var parts = explodeScopeTeam(args[0], requireTeam, reporter);
  73123. if (!parts) {
  73124. return false;
  73125. }
  73126. reporter.step(1, 3, reporter.lang('loggingIn'));
  73127. var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter);
  73128. var res = yield callback(parts, config, reporter, flags, args);
  73129. if (!res) {
  73130. return res;
  73131. }
  73132. reporter.step(3, 3, reporter.lang('revokingToken'));
  73133. yield revoke();
  73134. return true;
  73135. });
  73136. return function (_x, _x2, _x3, _x4) {
  73137. return _ref.apply(this, arguments);
  73138. };
  73139. }();
  73140. }
  73141. function wrapRequiredTeam(callback) {
  73142. var requireTeam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  73143. var subCommandDeprecated = arguments[2];
  73144. return wrapRequired(function (parts, config, reporter, flags, args) {
  73145. if (args.length === 1) {
  73146. return callback(parts, config, reporter, flags, args);
  73147. } else {
  73148. return false;
  73149. }
  73150. }, requireTeam, subCommandDeprecated);
  73151. }
  73152. function wrapRequiredUser(callback, subCommandDeprecated) {
  73153. return wrapRequired(function (parts, config, reporter, flags, args) {
  73154. if (args.length === 2) {
  73155. return callback((0, (_extends2 || _load_extends()).default)({
  73156. user: args[1]
  73157. }, parts), config, reporter, flags, args);
  73158. } else {
  73159. return false;
  73160. }
  73161. }, true, subCommandDeprecated);
  73162. }
  73163. function setFlags(commander) {
  73164. commander.description('Maintain team memberships');
  73165. }
  73166. var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('team', {
  73167. create: wrapRequiredTeam(function () {
  73168. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) {
  73169. reporter.step(2, 3, reporter.lang('teamCreating'));
  73170. reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}`, {
  73171. method: 'PUT',
  73172. body: {
  73173. team: parts.team
  73174. }
  73175. })));
  73176. return true;
  73177. });
  73178. return function (_x12, _x13, _x14, _x15, _x16) {
  73179. return _ref4.apply(this, arguments);
  73180. };
  73181. }()),
  73182. destroy: wrapRequiredTeam(function () {
  73183. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) {
  73184. reporter.step(2, 3, reporter.lang('teamRemoving'));
  73185. reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}`, {
  73186. method: 'DELETE'
  73187. })));
  73188. return true;
  73189. });
  73190. return function (_x17, _x18, _x19, _x20, _x21) {
  73191. return _ref5.apply(this, arguments);
  73192. };
  73193. }()),
  73194. add: wrapRequiredUser(function () {
  73195. var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) {
  73196. reporter.step(2, 3, reporter.lang('teamAddingUser'));
  73197. reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user`, {
  73198. method: 'PUT',
  73199. body: {
  73200. user: parts.user
  73201. }
  73202. })));
  73203. return true;
  73204. });
  73205. return function (_x22, _x23, _x24, _x25, _x26) {
  73206. return _ref6.apply(this, arguments);
  73207. };
  73208. }()),
  73209. rm: wrapRequiredUser(function (parts, config, reporter, flags, args) {
  73210. removeTeamUser(parts, config, reporter);
  73211. }, {
  73212. deprecatedCommand: 'rm',
  73213. currentCommand: 'remove'
  73214. }),
  73215. remove: wrapRequiredUser(function (parts, config, reporter, flags, args) {
  73216. removeTeamUser(parts, config, reporter);
  73217. }),
  73218. ls: wrapRequiredTeam(function (parts, config, reporter, flags, args) {
  73219. list(parts, config, reporter);
  73220. }, false, {
  73221. deprecatedCommand: 'ls',
  73222. currentCommand: 'list'
  73223. }),
  73224. list: wrapRequiredTeam(function (parts, config, reporter, flags, args) {
  73225. list(parts, config, reporter);
  73226. }, false)
  73227. }, ['create <scope:team>', 'destroy <scope:team>', 'add <scope:team> <user>', 'remove <scope:team> <user>', 'list <scope>|<scope:team>']),
  73228. run = _buildSubCommands.run,
  73229. hasWrapper = _buildSubCommands.hasWrapper,
  73230. examples = _buildSubCommands.examples;
  73231. exports.run = run;
  73232. exports.hasWrapper = hasWrapper;
  73233. exports.examples = examples;
  73234. /***/ }),
  73235. /* 498 */
  73236. /***/ (function(module, exports, __webpack_require__) {
  73237. "use strict";
  73238. Object.defineProperty(exports, "__esModule", {
  73239. value: true
  73240. });
  73241. exports.run = undefined;
  73242. var _getIterator2;
  73243. function _load_getIterator() {
  73244. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  73245. }
  73246. var _asyncToGenerator2;
  73247. function _load_asyncToGenerator() {
  73248. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  73249. }
  73250. var run = exports.run = function () {
  73251. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  73252. if (args.length) {
  73253. for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  73254. var _ref2;
  73255. if (_isArray) {
  73256. if (_i >= _iterator.length) break;
  73257. _ref2 = _iterator[_i++];
  73258. } else {
  73259. _i = _iterator.next();
  73260. if (_i.done) break;
  73261. _ref2 = _i.value;
  73262. }
  73263. var name = _ref2;
  73264. var linkLoc = path.join(config.linkFolder, name);
  73265. if (yield (_fs || _load_fs()).exists(linkLoc)) {
  73266. yield (_fs || _load_fs()).unlink(path.join((yield (0, (_link || _load_link()).getRegistryFolder)(config, name)), name));
  73267. reporter.success(reporter.lang('linkDisusing', name));
  73268. reporter.info(reporter.lang('linkDisusingMessage', name));
  73269. } else {
  73270. throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', name));
  73271. }
  73272. }
  73273. } else {
  73274. // remove from registry
  73275. var manifest = yield config.readRootManifest();
  73276. var _name = manifest.name;
  73277. if (!_name) {
  73278. throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownPackageName'));
  73279. }
  73280. var _linkLoc = path.join(config.linkFolder, _name);
  73281. if (yield (_fs || _load_fs()).exists(_linkLoc)) {
  73282. // If there is a `bin` defined in the package.json,
  73283. // link each bin to the global bin
  73284. if (manifest.bin) {
  73285. var globalBinFolder = yield (0, (_global || _load_global()).getBinFolder)(config, flags);
  73286. for (var binName in manifest.bin) {
  73287. var binDestLoc = path.join(globalBinFolder, binName);
  73288. if (yield (_fs || _load_fs()).exists(binDestLoc)) {
  73289. yield (_fs || _load_fs()).unlink(binDestLoc);
  73290. if (process.platform === 'win32') {
  73291. yield (_fs || _load_fs()).unlink(binDestLoc + '.cmd');
  73292. }
  73293. }
  73294. }
  73295. }
  73296. yield (_fs || _load_fs()).unlink(_linkLoc);
  73297. reporter.success(reporter.lang('linkUnregistered', _name));
  73298. reporter.info(reporter.lang('linkUnregisteredMessage', _name));
  73299. } else {
  73300. throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', _name));
  73301. }
  73302. }
  73303. });
  73304. return function run(_x, _x2, _x3, _x4) {
  73305. return _ref.apply(this, arguments);
  73306. };
  73307. }();
  73308. exports.setFlags = setFlags;
  73309. exports.hasWrapper = hasWrapper;
  73310. var _errors;
  73311. function _load_errors() {
  73312. return _errors = __webpack_require__(6);
  73313. }
  73314. var _fs;
  73315. function _load_fs() {
  73316. return _fs = _interopRequireWildcard(__webpack_require__(8));
  73317. }
  73318. var _link;
  73319. function _load_link() {
  73320. return _link = __webpack_require__(293);
  73321. }
  73322. var _global;
  73323. function _load_global() {
  73324. return _global = __webpack_require__(116);
  73325. }
  73326. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  73327. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73328. var path = __webpack_require__(1);
  73329. function setFlags(commander) {
  73330. commander.description('Unlink a previously created symlink for a package.');
  73331. }
  73332. function hasWrapper(commander, args) {
  73333. return true;
  73334. }
  73335. /***/ }),
  73336. /* 499 */
  73337. /***/ (function(module, exports, __webpack_require__) {
  73338. "use strict";
  73339. Object.defineProperty(exports, "__esModule", {
  73340. value: true
  73341. });
  73342. exports.clearAll = exports.clearSome = exports.run = undefined;
  73343. var _getIterator2;
  73344. function _load_getIterator() {
  73345. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  73346. }
  73347. var _set;
  73348. function _load_set() {
  73349. return _set = _interopRequireDefault(__webpack_require__(16));
  73350. }
  73351. var _asyncToGenerator2;
  73352. function _load_asyncToGenerator() {
  73353. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  73354. }
  73355. var run = exports.run = function () {
  73356. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  73357. if (!config.plugnplayEnabled) {
  73358. throw new (_errors || _load_errors()).MessageError(reporter.lang('unplugDisabled'));
  73359. }
  73360. if (!args.length && flags.clear) {
  73361. throw new (_errors || _load_errors()).MessageError(reporter.lang('tooFewArguments', 1));
  73362. }
  73363. if (args.length && flags.clearAll) {
  73364. throw new (_errors || _load_errors()).MessageError(reporter.lang('noArguments'));
  73365. }
  73366. if (flags.clearAll) {
  73367. yield clearAll(config);
  73368. } else if (flags.clear) {
  73369. yield clearSome(config, new (_set || _load_set()).default(args));
  73370. } else if (args.length > 0) {
  73371. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
  73372. yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  73373. var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
  73374. install.linker.unplugged = args;
  73375. yield install.init();
  73376. }));
  73377. }
  73378. var unpluggedPackageFolders = yield config.listUnpluggedPackageFolders();
  73379. for (var _iterator = unpluggedPackageFolders.values(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  73380. var _ref3;
  73381. if (_isArray) {
  73382. if (_i >= _iterator.length) break;
  73383. _ref3 = _iterator[_i++];
  73384. } else {
  73385. _i = _iterator.next();
  73386. if (_i.done) break;
  73387. _ref3 = _i.value;
  73388. }
  73389. var target = _ref3;
  73390. reporter.log(target, { force: true });
  73391. }
  73392. });
  73393. return function run(_x, _x2, _x3, _x4) {
  73394. return _ref.apply(this, arguments);
  73395. };
  73396. }();
  73397. var clearSome = exports.clearSome = function () {
  73398. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, filters) {
  73399. var unpluggedPackageFolders = yield config.listUnpluggedPackageFolders();
  73400. var removeList = [];
  73401. for (var _iterator2 = unpluggedPackageFolders.entries(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  73402. var _ref6;
  73403. if (_isArray2) {
  73404. if (_i2 >= _iterator2.length) break;
  73405. _ref6 = _iterator2[_i2++];
  73406. } else {
  73407. _i2 = _iterator2.next();
  73408. if (_i2.done) break;
  73409. _ref6 = _i2.value;
  73410. }
  73411. var _ref5 = _ref6;
  73412. var unpluggedName = _ref5[0];
  73413. var target = _ref5[1];
  73414. var _ref8 = yield (_fs || _load_fs()).readJson(path.join(target, 'package.json')),
  73415. name = _ref8.name;
  73416. var toBeRemoved = filters.has(name);
  73417. if (toBeRemoved) {
  73418. removeList.push(path.join(config.getUnpluggedPath(), unpluggedName));
  73419. }
  73420. }
  73421. if (removeList.length === unpluggedPackageFolders.size) {
  73422. yield (_fs || _load_fs()).unlink(config.getUnpluggedPath());
  73423. } else {
  73424. for (var _iterator3 = removeList, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  73425. var _ref7;
  73426. if (_isArray3) {
  73427. if (_i3 >= _iterator3.length) break;
  73428. _ref7 = _iterator3[_i3++];
  73429. } else {
  73430. _i3 = _iterator3.next();
  73431. if (_i3.done) break;
  73432. _ref7 = _i3.value;
  73433. }
  73434. var unpluggedPackagePath = _ref7;
  73435. yield (_fs || _load_fs()).unlink(unpluggedPackagePath);
  73436. }
  73437. }
  73438. });
  73439. return function clearSome(_x5, _x6) {
  73440. return _ref4.apply(this, arguments);
  73441. };
  73442. }();
  73443. var clearAll = exports.clearAll = function () {
  73444. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
  73445. yield (_fs || _load_fs()).unlink(config.getUnpluggedPath());
  73446. });
  73447. return function clearAll(_x7) {
  73448. return _ref9.apply(this, arguments);
  73449. };
  73450. }();
  73451. exports.hasWrapper = hasWrapper;
  73452. exports.setFlags = setFlags;
  73453. var _lockfile;
  73454. function _load_lockfile() {
  73455. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  73456. }
  73457. var _install;
  73458. function _load_install() {
  73459. return _install = __webpack_require__(41);
  73460. }
  73461. var _errors;
  73462. function _load_errors() {
  73463. return _errors = __webpack_require__(6);
  73464. }
  73465. var _fs;
  73466. function _load_fs() {
  73467. return _fs = _interopRequireWildcard(__webpack_require__(8));
  73468. }
  73469. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  73470. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73471. var path = __webpack_require__(1);
  73472. function hasWrapper(commander) {
  73473. return true;
  73474. }
  73475. function setFlags(commander) {
  73476. commander.description('Temporarily copies a package (with an optional @range suffix) outside of the global cache for debugging purposes');
  73477. commander.usage('unplug [packages ...] [flags]');
  73478. commander.option('--clear', 'Delete the selected packages');
  73479. commander.option('--clear-all', 'Delete all unplugged packages');
  73480. }
  73481. /***/ }),
  73482. /* 500 */
  73483. /***/ (function(module, exports, __webpack_require__) {
  73484. "use strict";
  73485. Object.defineProperty(exports, "__esModule", {
  73486. value: true
  73487. });
  73488. exports.run = undefined;
  73489. var _assign;
  73490. function _load_assign() {
  73491. return _assign = _interopRequireDefault(__webpack_require__(23));
  73492. }
  73493. var _asyncToGenerator2;
  73494. function _load_asyncToGenerator() {
  73495. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  73496. }
  73497. var run = exports.run = function () {
  73498. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  73499. var versions = { yarn: (_yarnVersion || _load_yarnVersion()).version };
  73500. var pkg = yield config.maybeReadManifest(config.cwd);
  73501. if (pkg && pkg.name && pkg.version) {
  73502. versions[pkg.name] = pkg.version;
  73503. }
  73504. (0, (_assign || _load_assign()).default)(versions, process.versions);
  73505. reporter.inspect(versions);
  73506. });
  73507. return function run(_x, _x2, _x3, _x4) {
  73508. return _ref.apply(this, arguments);
  73509. };
  73510. }();
  73511. exports.setFlags = setFlags;
  73512. exports.hasWrapper = hasWrapper;
  73513. var _yarnVersion;
  73514. function _load_yarnVersion() {
  73515. return _yarnVersion = __webpack_require__(96);
  73516. }
  73517. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73518. function setFlags(commander) {
  73519. commander.description('Displays version information of currently installed Yarn, Node.js, and its dependencies.');
  73520. }
  73521. function hasWrapper(commander, args) {
  73522. return true;
  73523. }
  73524. /***/ }),
  73525. /* 501 */
  73526. /***/ (function(module, exports, __webpack_require__) {
  73527. "use strict";
  73528. Object.defineProperty(exports, "__esModule", {
  73529. value: true
  73530. });
  73531. exports.run = exports.requireLockfile = undefined;
  73532. var _from;
  73533. function _load_from() {
  73534. return _from = _interopRequireDefault(__webpack_require__(53));
  73535. }
  73536. var _getIterator2;
  73537. function _load_getIterator() {
  73538. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  73539. }
  73540. var _keys;
  73541. function _load_keys() {
  73542. return _keys = _interopRequireDefault(__webpack_require__(14));
  73543. }
  73544. var _promise;
  73545. function _load_promise() {
  73546. return _promise = _interopRequireDefault(__webpack_require__(7));
  73547. }
  73548. var _set;
  73549. function _load_set() {
  73550. return _set = _interopRequireDefault(__webpack_require__(16));
  73551. }
  73552. var _asyncToGenerator2;
  73553. function _load_asyncToGenerator() {
  73554. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  73555. }
  73556. var cleanQuery = function () {
  73557. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, query) {
  73558. // if a location was passed then turn it into a hash query
  73559. if (path.isAbsolute(query) && (yield (_fs || _load_fs()).exists(query))) {
  73560. // absolute path
  73561. query = path.relative(config.cwd, query);
  73562. }
  73563. // remove references to node_modules with hashes
  73564. query = query.replace(/([\\/]|^)node_modules[\\/]/g, '#');
  73565. // remove trailing hashes
  73566. query = query.replace(/^#+/g, '');
  73567. // remove trailing paths from each part of the query, skip second part of path for scoped packages
  73568. var queryParts = query.split('#');
  73569. queryParts = queryParts.map(function (part) {
  73570. var parts = part.split(/[\\/]/g);
  73571. if (part[0] === '@') {
  73572. parts = parts.slice(0, 2);
  73573. } else {
  73574. parts = parts.slice(0, 1);
  73575. }
  73576. return parts.join('/');
  73577. });
  73578. query = queryParts.join('#');
  73579. return query;
  73580. });
  73581. return function cleanQuery(_x, _x2) {
  73582. return _ref.apply(this, arguments);
  73583. };
  73584. }();
  73585. var getPackageSize = function () {
  73586. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (tuple) {
  73587. var loc = tuple[0];
  73588. var files = yield (_fs || _load_fs()).walk(loc, null, new (_set || _load_set()).default([(_constants || _load_constants()).METADATA_FILENAME, (_constants || _load_constants()).TARBALL_FILENAME]));
  73589. var sizes = yield (_promise || _load_promise()).default.all(files.map(function (walkFile) {
  73590. return (_fs || _load_fs()).getFileSizeOnDisk(walkFile.absolute);
  73591. }));
  73592. return sum(sizes);
  73593. });
  73594. return function getPackageSize(_x3) {
  73595. return _ref2.apply(this, arguments);
  73596. };
  73597. }();
  73598. var run = exports.run = function () {
  73599. var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  73600. if (!args.length) {
  73601. throw new (_errors || _load_errors()).MessageError(reporter.lang('missingWhyDependency'));
  73602. }
  73603. if (args.length > 1) {
  73604. throw new (_errors || _load_errors()).MessageError(reporter.lang('tooManyArguments', 1));
  73605. }
  73606. var query = yield cleanQuery(config, args[0]);
  73607. reporter.step(1, 4, reporter.lang('whyStart', args[0]), emoji.get('thinking_face'));
  73608. // init
  73609. reporter.step(2, 4, reporter.lang('whyInitGraph'), emoji.get('truck'));
  73610. var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
  73611. var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
  73612. var _ref8 = yield install.fetchRequestFromCwd(),
  73613. depRequests = _ref8.requests,
  73614. patterns = _ref8.patterns,
  73615. workspaceLayout = _ref8.workspaceLayout;
  73616. yield install.resolver.init(depRequests, {
  73617. isFlat: install.flags.flat,
  73618. isFrozen: install.flags.frozenLockfile,
  73619. workspaceLayout
  73620. });
  73621. var hoisted = yield install.linker.getFlatHoistedTree(patterns);
  73622. // finding
  73623. reporter.step(3, 4, reporter.lang('whyFinding'), emoji.get('mag'));
  73624. var matches = queryWhy(query, hoisted);
  73625. if (matches.length <= 0) {
  73626. reporter.error(reporter.lang('whyUnknownMatch'));
  73627. return;
  73628. }
  73629. var processMatch = function () {
  73630. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (match) {
  73631. var matchInfo = match[1];
  73632. var matchRef = matchInfo.pkg._reference;
  73633. invariant(matchRef, 'expected reference');
  73634. var distinctMatchPatterns = new (_set || _load_set()).default(matchRef.patterns);
  73635. var reasons = [];
  73636. // reason: dependency of these modules
  73637. if (matchInfo.originalParentPath.length > 0) {
  73638. reasons.push({
  73639. type: 'whyDependedOn',
  73640. typeSimple: 'whyDependedOnSimple',
  73641. value: toStandardPathString(matchInfo.originalParentPath)
  73642. });
  73643. }
  73644. // reason: exists in manifest
  73645. var rootType = void 0;
  73646. for (var _iterator3 = distinctMatchPatterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  73647. var _ref10;
  73648. if (_isArray3) {
  73649. if (_i3 >= _iterator3.length) break;
  73650. _ref10 = _iterator3[_i3++];
  73651. } else {
  73652. _i3 = _iterator3.next();
  73653. if (_i3.done) break;
  73654. _ref10 = _i3.value;
  73655. }
  73656. var pattern = _ref10;
  73657. rootType = install.rootPatternsToOrigin[pattern];
  73658. if (rootType) {
  73659. reasons.push({
  73660. type: 'whySpecified',
  73661. typeSimple: 'whySpecifiedSimple',
  73662. value: rootType
  73663. });
  73664. }
  73665. }
  73666. // reason: this is hoisted from these modules
  73667. for (var _iterator4 = matchInfo.previousPaths, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  73668. var _ref11;
  73669. if (_isArray4) {
  73670. if (_i4 >= _iterator4.length) break;
  73671. _ref11 = _iterator4[_i4++];
  73672. } else {
  73673. _i4 = _iterator4.next();
  73674. if (_i4.done) break;
  73675. _ref11 = _i4.value;
  73676. }
  73677. var _path = _ref11;
  73678. reasons.push({
  73679. type: 'whyHoistedFrom',
  73680. typeSimple: 'whyHoistedFromSimple',
  73681. value: toStandardPathString(_path)
  73682. });
  73683. }
  73684. // package sizes
  73685. var packageSize = 0;
  73686. var directSizes = [];
  73687. var transitiveSizes = [];
  73688. try {
  73689. packageSize = yield getPackageSize(match);
  73690. } catch (e) {}
  73691. var dependencies = (0, (_from || _load_from()).default)(collect(hoisted, new (_set || _load_set()).default(), match));
  73692. var transitiveDependencies = (0, (_from || _load_from()).default)(collect(hoisted, new (_set || _load_set()).default(), match, { recursive: true }));
  73693. try {
  73694. directSizes = yield (_promise || _load_promise()).default.all(dependencies.map(getPackageSize));
  73695. transitiveSizes = yield (_promise || _load_promise()).default.all(transitiveDependencies.map(getPackageSize));
  73696. } catch (e) {}
  73697. var transitiveKeys = new (_set || _load_set()).default(transitiveDependencies.map(function (_ref12) {
  73698. var info = _ref12[1];
  73699. return info.key;
  73700. }));
  73701. var sharedDependencies = getSharedDependencies(hoisted, transitiveKeys);
  73702. // prepare output: populate reporter
  73703. reporter.info(reporter.lang('whyMatch', `${matchInfo.key}@${matchInfo.pkg.version}`));
  73704. //
  73705. // reason: hoisted/nohoist
  73706. if (matchInfo.isNohoist) {
  73707. reasons.push({
  73708. type: 'whyNotHoisted',
  73709. typeSimple: 'whyNotHoistedSimple',
  73710. value: matchInfo.nohoistList
  73711. });
  73712. } else if (query === matchInfo.originalKey) {
  73713. reporter.info(reporter.lang('whyHoistedTo', matchInfo.key));
  73714. }
  73715. if (reasons.length === 1) {
  73716. reporter.info(reporter.lang(reasons[0].typeSimple, reasons[0].value));
  73717. } else if (reasons.length > 1) {
  73718. reporter.info(reporter.lang('whyReasons'));
  73719. reporter.list('reasons', reasons.map(function (reason) {
  73720. return reporter.lang(reason.type, reason.value);
  73721. }));
  73722. } else {
  73723. reporter.error(reporter.lang('whyWhoKnows'));
  73724. }
  73725. if (packageSize) {
  73726. // stats: file size of this dependency without any dependencies
  73727. reporter.info(reporter.lang('whyDiskSizeWithout', bytes(packageSize)));
  73728. // stats: file size of this dependency including dependencies that aren't shared
  73729. reporter.info(reporter.lang('whyDiskSizeUnique', bytes(packageSize + sum(directSizes))));
  73730. // stats: file size of this dependency including dependencies
  73731. reporter.info(reporter.lang('whyDiskSizeTransitive', bytes(packageSize + sum(transitiveSizes))));
  73732. // stats: shared transitive dependencies
  73733. reporter.info(reporter.lang('whySharedDependencies', sharedDependencies.size));
  73734. }
  73735. });
  73736. return function processMatch(_x9) {
  73737. return _ref9.apply(this, arguments);
  73738. };
  73739. }();
  73740. reporter.step(4, 4, reporter.lang('whyCalculating'), emoji.get('aerial_tramway'));
  73741. for (var _iterator5 = matches, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  73742. var _ref13;
  73743. if (_isArray5) {
  73744. if (_i5 >= _iterator5.length) break;
  73745. _ref13 = _iterator5[_i5++];
  73746. } else {
  73747. _i5 = _iterator5.next();
  73748. if (_i5.done) break;
  73749. _ref13 = _i5.value;
  73750. }
  73751. var match = _ref13;
  73752. yield processMatch(match);
  73753. }
  73754. });
  73755. return function run(_x5, _x6, _x7, _x8) {
  73756. return _ref7.apply(this, arguments);
  73757. };
  73758. }();
  73759. exports.setFlags = setFlags;
  73760. exports.hasWrapper = hasWrapper;
  73761. exports.queryWhy = queryWhy;
  73762. var _install;
  73763. function _load_install() {
  73764. return _install = __webpack_require__(41);
  73765. }
  73766. var _constants;
  73767. function _load_constants() {
  73768. return _constants = __webpack_require__(13);
  73769. }
  73770. var _fs;
  73771. function _load_fs() {
  73772. return _fs = _interopRequireWildcard(__webpack_require__(8));
  73773. }
  73774. var _lockfile;
  73775. function _load_lockfile() {
  73776. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  73777. }
  73778. var _errors;
  73779. function _load_errors() {
  73780. return _errors = __webpack_require__(6);
  73781. }
  73782. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  73783. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73784. var requireLockfile = exports.requireLockfile = true;
  73785. var invariant = __webpack_require__(15);
  73786. var bytes = __webpack_require__(561);
  73787. var emoji = __webpack_require__(242);
  73788. var path = __webpack_require__(1);
  73789. function sum(array) {
  73790. return array.length ? array.reduce(function (a, b) {
  73791. return a + b;
  73792. }, 0) : 0;
  73793. }
  73794. function collect(hoistManifests, allDependencies, dependency) {
  73795. var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { recursive: false },
  73796. recursive = _ref3.recursive;
  73797. var depInfo = dependency[1];
  73798. var deps = depInfo.pkg.dependencies;
  73799. if (!deps) {
  73800. return allDependencies;
  73801. }
  73802. var dependencyKeys = new (_set || _load_set()).default((0, (_keys || _load_keys()).default)(deps));
  73803. var directDependencies = [];
  73804. for (var _iterator = hoistManifests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  73805. var _ref4;
  73806. if (_isArray) {
  73807. if (_i >= _iterator.length) break;
  73808. _ref4 = _iterator[_i++];
  73809. } else {
  73810. _i = _iterator.next();
  73811. if (_i.done) break;
  73812. _ref4 = _i.value;
  73813. }
  73814. var dep = _ref4;
  73815. var info = dep[1];
  73816. if (!allDependencies.has(dep) && dependencyKeys.has(info.key)) {
  73817. allDependencies.add(dep);
  73818. directDependencies.push(dep);
  73819. }
  73820. }
  73821. if (recursive) {
  73822. directDependencies.forEach(function (dependency) {
  73823. return collect(hoistManifests, allDependencies, dependency, { recursive: true });
  73824. });
  73825. }
  73826. return allDependencies;
  73827. }
  73828. function getSharedDependencies(hoistManifests, transitiveKeys) {
  73829. var sharedDependencies = new (_set || _load_set()).default();
  73830. for (var _iterator2 = hoistManifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  73831. var _ref6;
  73832. if (_isArray2) {
  73833. if (_i2 >= _iterator2.length) break;
  73834. _ref6 = _iterator2[_i2++];
  73835. } else {
  73836. _i2 = _iterator2.next();
  73837. if (_i2.done) break;
  73838. _ref6 = _i2.value;
  73839. }
  73840. var _ref5 = _ref6;
  73841. var info = _ref5[1];
  73842. if (!transitiveKeys.has(info.key) && info.pkg.dependencies) {
  73843. (0, (_keys || _load_keys()).default)(info.pkg.dependencies).forEach(function (dependency) {
  73844. if (transitiveKeys.has(dependency) && !sharedDependencies.has(dependency)) {
  73845. sharedDependencies.add(dependency);
  73846. }
  73847. });
  73848. }
  73849. }
  73850. return sharedDependencies;
  73851. }
  73852. function setFlags(commander) {
  73853. commander.description('Identifies why a package has been installed, detailing which other packages depend on it.');
  73854. }
  73855. function hasWrapper(commander, args) {
  73856. return true;
  73857. }
  73858. // to conform to the current standard '#' as package tree separator
  73859. function toStandardPathString(pathString) {
  73860. var str = pathString.replace(/\//g, '#');
  73861. if (str[0] === '#') {
  73862. return str.slice(1);
  73863. }
  73864. return str;
  73865. }
  73866. function queryWhy(pattern, hoisted) {
  73867. var nohoistPattern = `#${pattern}`;
  73868. var found = [];
  73869. for (var _iterator6 = hoisted, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  73870. var _ref15;
  73871. if (_isArray6) {
  73872. if (_i6 >= _iterator6.length) break;
  73873. _ref15 = _iterator6[_i6++];
  73874. } else {
  73875. _i6 = _iterator6.next();
  73876. if (_i6.done) break;
  73877. _ref15 = _i6.value;
  73878. }
  73879. var _ref14 = _ref15;
  73880. var loc = _ref14[0];
  73881. var info = _ref14[1];
  73882. if (info.key === pattern || info.previousPaths.indexOf(pattern) >= 0 || info.key.endsWith(nohoistPattern)) {
  73883. found.push([loc, info]);
  73884. }
  73885. }
  73886. return found;
  73887. }
  73888. /***/ }),
  73889. /* 502 */
  73890. /***/ (function(module, exports, __webpack_require__) {
  73891. "use strict";
  73892. Object.defineProperty(exports, "__esModule", {
  73893. value: true
  73894. });
  73895. exports.run = undefined;
  73896. var _asyncToGenerator2;
  73897. function _load_asyncToGenerator() {
  73898. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  73899. }
  73900. var run = exports.run = function () {
  73901. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  73902. var workspaceRootFolder = config.workspaceRootFolder;
  73903. if (!workspaceRootFolder) {
  73904. throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd));
  73905. }
  73906. if (args.length < 1) {
  73907. throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceMissingWorkspace'));
  73908. }
  73909. if (args.length < 2) {
  73910. throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceMissingCommand'));
  73911. }
  73912. var manifest = yield config.findManifest(workspaceRootFolder, false);
  73913. invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property');
  73914. var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest);
  73915. var _ref2 = args || [],
  73916. workspaceName = _ref2[0],
  73917. rest = _ref2.slice(1);
  73918. if (!Object.prototype.hasOwnProperty.call(workspaces, workspaceName)) {
  73919. throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceUnknownWorkspace', workspaceName));
  73920. }
  73921. var workspace = workspaces[workspaceName];
  73922. try {
  73923. yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [(_constants || _load_constants()).YARN_BIN_PATH].concat(rest), {
  73924. stdio: 'inherit',
  73925. cwd: workspace.loc
  73926. });
  73927. } catch (err) {
  73928. throw err;
  73929. }
  73930. });
  73931. return function run(_x, _x2, _x3, _x4) {
  73932. return _ref.apply(this, arguments);
  73933. };
  73934. }();
  73935. exports.setFlags = setFlags;
  73936. exports.hasWrapper = hasWrapper;
  73937. var _errors;
  73938. function _load_errors() {
  73939. return _errors = __webpack_require__(6);
  73940. }
  73941. var _child;
  73942. function _load_child() {
  73943. return _child = _interopRequireWildcard(__webpack_require__(57));
  73944. }
  73945. var _constants;
  73946. function _load_constants() {
  73947. return _constants = __webpack_require__(13);
  73948. }
  73949. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  73950. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73951. var invariant = __webpack_require__(15);
  73952. function setFlags(commander) {}
  73953. function hasWrapper(commander, args) {
  73954. return true;
  73955. }
  73956. /***/ }),
  73957. /* 503 */
  73958. /***/ (function(module, exports, __webpack_require__) {
  73959. "use strict";
  73960. Object.defineProperty(exports, "__esModule", {
  73961. value: true
  73962. });
  73963. exports.examples = exports.setFlags = exports.run = exports.runScript = exports.info = undefined;
  73964. var _from;
  73965. function _load_from() {
  73966. return _from = _interopRequireDefault(__webpack_require__(53));
  73967. }
  73968. var _set;
  73969. function _load_set() {
  73970. return _set = _interopRequireDefault(__webpack_require__(16));
  73971. }
  73972. var _getIterator2;
  73973. function _load_getIterator() {
  73974. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  73975. }
  73976. var _keys;
  73977. function _load_keys() {
  73978. return _keys = _interopRequireDefault(__webpack_require__(14));
  73979. }
  73980. var _stringify;
  73981. function _load_stringify() {
  73982. return _stringify = _interopRequireDefault(__webpack_require__(37));
  73983. }
  73984. var _asyncToGenerator2;
  73985. function _load_asyncToGenerator() {
  73986. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  73987. }
  73988. var info = exports.info = function () {
  73989. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  73990. var workspaceRootFolder = config.workspaceRootFolder;
  73991. if (!workspaceRootFolder) {
  73992. throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd));
  73993. }
  73994. var manifest = yield config.findManifest(workspaceRootFolder, false);
  73995. invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property');
  73996. var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest);
  73997. var publicData = {};
  73998. for (var _iterator = (0, (_keys || _load_keys()).default)(workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  73999. var _ref2;
  74000. if (_isArray) {
  74001. if (_i >= _iterator.length) break;
  74002. _ref2 = _iterator[_i++];
  74003. } else {
  74004. _i = _iterator.next();
  74005. if (_i.done) break;
  74006. _ref2 = _i.value;
  74007. }
  74008. var workspaceName = _ref2;
  74009. var _workspaces$workspace = workspaces[workspaceName],
  74010. loc = _workspaces$workspace.loc,
  74011. _manifest = _workspaces$workspace.manifest;
  74012. var workspaceDependencies = new (_set || _load_set()).default();
  74013. var mismatchedWorkspaceDependencies = new (_set || _load_set()).default();
  74014. for (var _iterator2 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  74015. var _ref3;
  74016. if (_isArray2) {
  74017. if (_i2 >= _iterator2.length) break;
  74018. _ref3 = _iterator2[_i2++];
  74019. } else {
  74020. _i2 = _iterator2.next();
  74021. if (_i2.done) break;
  74022. _ref3 = _i2.value;
  74023. }
  74024. var dependencyType = _ref3;
  74025. if (dependencyType !== 'peerDependencies') {
  74026. for (var _iterator3 = (0, (_keys || _load_keys()).default)(_manifest[dependencyType] || {}), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  74027. var _ref4;
  74028. if (_isArray3) {
  74029. if (_i3 >= _iterator3.length) break;
  74030. _ref4 = _iterator3[_i3++];
  74031. } else {
  74032. _i3 = _iterator3.next();
  74033. if (_i3.done) break;
  74034. _ref4 = _i3.value;
  74035. }
  74036. var dependencyName = _ref4;
  74037. if (Object.prototype.hasOwnProperty.call(workspaces, dependencyName)) {
  74038. invariant(_manifest && _manifest[dependencyType], 'The request should exist');
  74039. var requestedRange = _manifest[dependencyType][dependencyName];
  74040. if (semver.satisfies(workspaces[dependencyName].manifest.version, requestedRange)) {
  74041. workspaceDependencies.add(dependencyName);
  74042. } else {
  74043. mismatchedWorkspaceDependencies.add(dependencyName);
  74044. }
  74045. }
  74046. }
  74047. }
  74048. }
  74049. publicData[workspaceName] = {
  74050. location: path.relative(config.lockfileFolder, loc).replace(/\\/g, '/'),
  74051. workspaceDependencies: (0, (_from || _load_from()).default)(workspaceDependencies),
  74052. mismatchedWorkspaceDependencies: (0, (_from || _load_from()).default)(mismatchedWorkspaceDependencies)
  74053. };
  74054. }
  74055. reporter.log((0, (_stringify || _load_stringify()).default)(publicData, null, 2), { force: true });
  74056. });
  74057. return function info(_x, _x2, _x3, _x4) {
  74058. return _ref.apply(this, arguments);
  74059. };
  74060. }();
  74061. var runScript = exports.runScript = function () {
  74062. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
  74063. var workspaceRootFolder = config.workspaceRootFolder;
  74064. if (!workspaceRootFolder) {
  74065. throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd));
  74066. }
  74067. var manifest = yield config.findManifest(workspaceRootFolder, false);
  74068. invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property');
  74069. var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest);
  74070. try {
  74071. for (var _iterator4 = (0, (_keys || _load_keys()).default)(workspaces), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  74072. var _ref6;
  74073. if (_isArray4) {
  74074. if (_i4 >= _iterator4.length) break;
  74075. _ref6 = _iterator4[_i4++];
  74076. } else {
  74077. _i4 = _iterator4.next();
  74078. if (_i4.done) break;
  74079. _ref6 = _i4.value;
  74080. }
  74081. var workspaceName = _ref6;
  74082. var loc = workspaces[workspaceName].loc;
  74083. reporter.log(`${os.EOL}> ${workspaceName}`);
  74084. yield (_child || _load_child()).spawn((_constants2 || _load_constants2()).NODE_BIN_PATH, [(_constants2 || _load_constants2()).YARN_BIN_PATH, 'run'].concat(args), {
  74085. stdio: 'inherit',
  74086. cwd: loc
  74087. });
  74088. }
  74089. } catch (err) {
  74090. throw err;
  74091. }
  74092. });
  74093. return function runScript(_x5, _x6, _x7, _x8) {
  74094. return _ref5.apply(this, arguments);
  74095. };
  74096. }();
  74097. exports.hasWrapper = hasWrapper;
  74098. var _errors;
  74099. function _load_errors() {
  74100. return _errors = __webpack_require__(6);
  74101. }
  74102. var _buildSubCommands2;
  74103. function _load_buildSubCommands() {
  74104. return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
  74105. }
  74106. var _constants;
  74107. function _load_constants() {
  74108. return _constants = __webpack_require__(13);
  74109. }
  74110. var _child;
  74111. function _load_child() {
  74112. return _child = _interopRequireWildcard(__webpack_require__(57));
  74113. }
  74114. var _constants2;
  74115. function _load_constants2() {
  74116. return _constants2 = __webpack_require__(13);
  74117. }
  74118. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  74119. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  74120. var invariant = __webpack_require__(15);
  74121. var path = __webpack_require__(1);
  74122. var os = __webpack_require__(66);
  74123. var semver = __webpack_require__(27);
  74124. function hasWrapper(commander, args) {
  74125. return true;
  74126. }
  74127. var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('workspaces', {
  74128. info(config, reporter, flags, args) {
  74129. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  74130. yield info(config, reporter, flags, args);
  74131. })();
  74132. },
  74133. run(config, reporter, flags, args) {
  74134. return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  74135. yield runScript(config, reporter, flags, args);
  74136. })();
  74137. }
  74138. }),
  74139. run = _buildSubCommands.run,
  74140. setFlags = _buildSubCommands.setFlags,
  74141. examples = _buildSubCommands.examples;
  74142. exports.run = run;
  74143. exports.setFlags = setFlags;
  74144. exports.examples = examples;
  74145. /***/ }),
  74146. /* 504 */
  74147. /***/ (function(module, exports, __webpack_require__) {
  74148. "use strict";
  74149. /* WEBPACK VAR INJECTION */(function(module) {
  74150. Object.defineProperty(exports, "__esModule", {
  74151. value: true
  74152. });
  74153. exports.autoRun = exports.main = undefined;
  74154. var _assign;
  74155. function _load_assign() {
  74156. return _assign = _interopRequireDefault(__webpack_require__(23));
  74157. }
  74158. var _extends2;
  74159. function _load_extends() {
  74160. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  74161. }
  74162. var _getIterator2;
  74163. function _load_getIterator() {
  74164. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  74165. }
  74166. var _stringify;
  74167. function _load_stringify() {
  74168. return _stringify = _interopRequireDefault(__webpack_require__(37));
  74169. }
  74170. var _set;
  74171. function _load_set() {
  74172. return _set = _interopRequireDefault(__webpack_require__(16));
  74173. }
  74174. var _promise;
  74175. function _load_promise() {
  74176. return _promise = _interopRequireDefault(__webpack_require__(7));
  74177. }
  74178. var _asyncToGenerator2;
  74179. function _load_asyncToGenerator() {
  74180. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  74181. }
  74182. var main = exports.main = function () {
  74183. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref2) {
  74184. var startArgs = _ref2.startArgs,
  74185. args = _ref2.args,
  74186. endArgs = _ref2.endArgs;
  74187. var collect = function collect(val, acc) {
  74188. acc.push(val);
  74189. return acc;
  74190. };
  74191. (0, (_loudRejection || _load_loudRejection()).default)();
  74192. (0, (_signalHandler || _load_signalHandler()).default)();
  74193. // set global options
  74194. (_commander || _load_commander()).default.version((_yarnVersion || _load_yarnVersion()).version, '-v, --version');
  74195. (_commander || _load_commander()).default.usage('[command] [flags]');
  74196. (_commander || _load_commander()).default.option('--no-default-rc', 'prevent Yarn from automatically detecting yarnrc and npmrc files');
  74197. (_commander || _load_commander()).default.option('--use-yarnrc <path>', 'specifies a yarnrc file that Yarn should use (.yarnrc only, not .npmrc)', collect, []);
  74198. (_commander || _load_commander()).default.option('--verbose', 'output verbose messages on internal operations');
  74199. (_commander || _load_commander()).default.option('--offline', 'trigger an error if any required dependencies are not available in local cache');
  74200. (_commander || _load_commander()).default.option('--prefer-offline', 'use network only if dependencies are not available in local cache');
  74201. (_commander || _load_commander()).default.option('--enable-pnp, --pnp', "enable the Plug'n'Play installation");
  74202. (_commander || _load_commander()).default.option('--disable-pnp', "disable the Plug'n'Play installation");
  74203. (_commander || _load_commander()).default.option('--strict-semver');
  74204. (_commander || _load_commander()).default.option('--json', 'format Yarn log messages as lines of JSON (see jsonlines.org)');
  74205. (_commander || _load_commander()).default.option('--ignore-scripts', "don't run lifecycle scripts");
  74206. (_commander || _load_commander()).default.option('--har', 'save HAR output of network traffic');
  74207. (_commander || _load_commander()).default.option('--ignore-platform', 'ignore platform checks');
  74208. (_commander || _load_commander()).default.option('--ignore-engines', 'ignore engines check');
  74209. (_commander || _load_commander()).default.option('--ignore-optional', 'ignore optional dependencies');
  74210. (_commander || _load_commander()).default.option('--force', 'install and build packages even if they were built before, overwrite lockfile');
  74211. (_commander || _load_commander()).default.option('--skip-integrity-check', 'run install without checking if node_modules is installed');
  74212. (_commander || _load_commander()).default.option('--check-files', 'install will verify file tree of packages for consistency');
  74213. (_commander || _load_commander()).default.option('--no-bin-links', "don't generate bin links when setting up packages");
  74214. (_commander || _load_commander()).default.option('--flat', 'only allow one version of a package');
  74215. (_commander || _load_commander()).default.option('--prod, --production [prod]', '', (_conversion || _load_conversion()).boolify);
  74216. (_commander || _load_commander()).default.option('--no-lockfile', "don't read or generate a lockfile");
  74217. (_commander || _load_commander()).default.option('--pure-lockfile', "don't generate a lockfile");
  74218. (_commander || _load_commander()).default.option('--frozen-lockfile', "don't generate a lockfile and fail if an update is needed");
  74219. (_commander || _load_commander()).default.option('--update-checksums', 'update package checksums from current repository');
  74220. (_commander || _load_commander()).default.option('--link-duplicates', 'create hardlinks to the repeated modules in node_modules');
  74221. (_commander || _load_commander()).default.option('--link-folder <path>', 'specify a custom folder to store global links');
  74222. (_commander || _load_commander()).default.option('--global-folder <path>', 'specify a custom folder to store global packages');
  74223. (_commander || _load_commander()).default.option('--modules-folder <path>', 'rather than installing modules into the node_modules folder relative to the cwd, output them here');
  74224. (_commander || _load_commander()).default.option('--preferred-cache-folder <path>', 'specify a custom folder to store the yarn cache if possible');
  74225. (_commander || _load_commander()).default.option('--cache-folder <path>', 'specify a custom folder that must be used to store the yarn cache');
  74226. (_commander || _load_commander()).default.option('--mutex <type>[:specifier]', 'use a mutex to ensure only one yarn instance is executing');
  74227. (_commander || _load_commander()).default.option('--emoji [bool]', 'enable emoji in output', (_conversion || _load_conversion()).boolify, process.platform === 'darwin' || process.env.TERM_PROGRAM === 'Hyper' || process.env.TERM_PROGRAM === 'HyperTerm' || process.env.TERM_PROGRAM === 'Terminus');
  74228. (_commander || _load_commander()).default.option('-s, --silent', 'skip Yarn console logs, other types of logs (script output) will be printed');
  74229. (_commander || _load_commander()).default.option('--cwd <cwd>', 'working directory to use', process.cwd());
  74230. (_commander || _load_commander()).default.option('--proxy <host>', '');
  74231. (_commander || _load_commander()).default.option('--https-proxy <host>', '');
  74232. (_commander || _load_commander()).default.option('--registry <url>', 'override configuration registry');
  74233. (_commander || _load_commander()).default.option('--no-progress', 'disable progress bar');
  74234. (_commander || _load_commander()).default.option('--network-concurrency <number>', 'maximum number of concurrent network requests', parseInt);
  74235. (_commander || _load_commander()).default.option('--network-timeout <milliseconds>', 'TCP timeout for network requests', parseInt);
  74236. (_commander || _load_commander()).default.option('--non-interactive', 'do not show interactive prompts');
  74237. (_commander || _load_commander()).default.option('--scripts-prepend-node-path [bool]', 'prepend the node executable dir to the PATH in scripts', (_conversion || _load_conversion()).boolify);
  74238. (_commander || _load_commander()).default.option('--no-node-version-check', 'do not warn when using a potentially unsupported Node version');
  74239. (_commander || _load_commander()).default.option('--focus', 'Focus on a single workspace by installing remote copies of its sibling workspaces.');
  74240. (_commander || _load_commander()).default.option('--otp <otpcode>', 'one-time password for two factor authentication');
  74241. // if -v is the first command, then always exit after returning the version
  74242. if (args[0] === '-v') {
  74243. console.log((_yarnVersion || _load_yarnVersion()).version.trim());
  74244. process.exitCode = 0;
  74245. return;
  74246. }
  74247. // get command name
  74248. var firstNonFlagIndex = args.findIndex(function (arg, idx, arr) {
  74249. var isOption = arg.startsWith('-');
  74250. var prev = idx > 0 && arr[idx - 1];
  74251. var prevOption = prev && prev.startsWith('-') && (_commander || _load_commander()).default.optionFor(prev);
  74252. var boundToPrevOption = prevOption && (prevOption.optional || prevOption.required);
  74253. return !isOption && !boundToPrevOption;
  74254. });
  74255. var preCommandArgs = void 0;
  74256. var commandName = '';
  74257. if (firstNonFlagIndex > -1) {
  74258. preCommandArgs = args.slice(0, firstNonFlagIndex);
  74259. commandName = args[firstNonFlagIndex];
  74260. args = args.slice(firstNonFlagIndex + 1);
  74261. } else {
  74262. preCommandArgs = args;
  74263. args = [];
  74264. }
  74265. var isKnownCommand = Object.prototype.hasOwnProperty.call((_index3 || _load_index3()).default, commandName);
  74266. var isHelp = function isHelp(arg) {
  74267. return arg === '--help' || arg === '-h';
  74268. };
  74269. var helpInPre = preCommandArgs.findIndex(isHelp);
  74270. var helpInArgs = args.findIndex(isHelp);
  74271. var setHelpMode = function setHelpMode() {
  74272. if (isKnownCommand) {
  74273. args.unshift(commandName);
  74274. }
  74275. commandName = 'help';
  74276. isKnownCommand = true;
  74277. };
  74278. if (helpInPre > -1) {
  74279. preCommandArgs.splice(helpInPre);
  74280. setHelpMode();
  74281. } else if (isKnownCommand && helpInArgs === 0) {
  74282. args.splice(helpInArgs);
  74283. setHelpMode();
  74284. }
  74285. if (!commandName) {
  74286. commandName = 'install';
  74287. isKnownCommand = true;
  74288. }
  74289. if (commandName === 'set' && args[0] === 'version') {
  74290. commandName = 'policies';
  74291. args.splice(0, 1, 'set-version');
  74292. isKnownCommand = true;
  74293. }
  74294. if (!isKnownCommand) {
  74295. // if command is not recognized, then set default to `run`
  74296. args.unshift(commandName);
  74297. commandName = 'run';
  74298. }
  74299. var command = (_index3 || _load_index3()).default[commandName];
  74300. var warnAboutRunDashDash = false;
  74301. // we are using "yarn <script> -abc", "yarn run <script> -abc", or "yarn node -abc", we want -abc
  74302. // to be script options, not yarn options
  74303. // PROXY_COMMANDS is a map of command name to the number of preservedArgs
  74304. var PROXY_COMMANDS = {
  74305. run: 1, // yarn run {command}
  74306. create: 1, // yarn create {project}
  74307. node: 0, // yarn node
  74308. workspaces: 1, // yarn workspaces {command}
  74309. workspace: 2 // yarn workspace {package} {command}
  74310. };
  74311. if (PROXY_COMMANDS.hasOwnProperty(commandName)) {
  74312. if (endArgs.length === 0) {
  74313. // $FlowFixMe doesn't like that PROXY_COMMANDS doesn't have keys for all commands.
  74314. var preservedArgs = PROXY_COMMANDS[commandName];
  74315. // If the --into option immediately follows the command (or the script name in the "run/create"
  74316. // case), we parse them as regular options so that we can cd into them
  74317. if (args[preservedArgs] === `--into`) {
  74318. preservedArgs += 2;
  74319. }
  74320. endArgs = ['--'].concat(args.splice(preservedArgs));
  74321. } else {
  74322. warnAboutRunDashDash = true;
  74323. }
  74324. }
  74325. args = [].concat(preCommandArgs, args);
  74326. command.setFlags((_commander || _load_commander()).default);
  74327. (_commander || _load_commander()).default.parse([].concat(startArgs, [
  74328. // we use this for https://github.com/tj/commander.js/issues/346, otherwise
  74329. // it will strip some args that match with any options
  74330. 'this-arg-will-get-stripped-later'], (0, (_rc || _load_rc()).getRcArgs)(commandName, args), args));
  74331. (_commander || _load_commander()).default.args = (_commander || _load_commander()).default.args.concat(endArgs.slice(1));
  74332. // we strip cmd
  74333. console.assert((_commander || _load_commander()).default.args.length >= 1);
  74334. console.assert((_commander || _load_commander()).default.args[0] === 'this-arg-will-get-stripped-later');
  74335. (_commander || _load_commander()).default.args.shift();
  74336. //
  74337. var Reporter = (_commander || _load_commander()).default.json ? (_index || _load_index()).JSONReporter : (_index || _load_index()).ConsoleReporter;
  74338. var reporter = new Reporter({
  74339. emoji: process.stdout.isTTY && (_commander || _load_commander()).default.emoji,
  74340. verbose: (_commander || _load_commander()).default.verbose,
  74341. noProgress: !(_commander || _load_commander()).default.progress,
  74342. isSilent: (0, (_conversion || _load_conversion()).boolifyWithDefault)(process.env.YARN_SILENT, false) || (_commander || _load_commander()).default.silent,
  74343. nonInteractive: (_commander || _load_commander()).default.nonInteractive
  74344. });
  74345. var exit = function exit(exitCode) {
  74346. process.exitCode = exitCode || 0;
  74347. reporter.close();
  74348. };
  74349. reporter.initPeakMemoryCounter();
  74350. var config = new (_config || _load_config()).default(reporter);
  74351. if (!process.env.COREPACK_ROOT && !process.env.SKIP_YARN_COREPACK_CHECK) {
  74352. var packageManager = findPackageManager((_commander || _load_commander()).default.cwd);
  74353. if (packageManager !== null) {
  74354. if (!packageManager.match(/^yarn@[01]\./)) {
  74355. reporter.error(`This project's package.json defines ${chalk.gray('"packageManager": "yarn@')}${chalk.yellow(`${packageManager.replace(/^yarn@/, ``).replace(/\+.*/, ``)}`)}${chalk.gray(`"`)}. However the current global version of Yarn is ${chalk.yellow((_yarnVersion || _load_yarnVersion()).version)}.`);
  74356. process.stderr.write(`\n`);
  74357. process.stderr.write(`Presence of the ${chalk.gray(`"packageManager"`
  74358. // eslint-disable-next-line max-len
  74359. )} field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.\n`);
  74360. process.stderr.write(`Corepack must currently be enabled by running ${chalk.magenta(`corepack enable`
  74361. // $FlowIgnore
  74362. )} in your terminal. For more information, check out ${chalk.blueBright(`https://yarnpkg.com/corepack`)}.\n`);
  74363. exit(1);
  74364. return;
  74365. }
  74366. }
  74367. }
  74368. var outputWrapperEnabled = (0, (_conversion || _load_conversion()).boolifyWithDefault)(process.env.YARN_WRAP_OUTPUT, true);
  74369. var shouldWrapOutput = outputWrapperEnabled && !(_commander || _load_commander()).default.json && command.hasWrapper((_commander || _load_commander()).default, (_commander || _load_commander()).default.args) && !(commandName === 'init' && (_commander || _load_commander()).default[`2`]);
  74370. if (shouldWrapOutput) {
  74371. reporter.header(commandName, { name: 'yarn', version: (_yarnVersion || _load_yarnVersion()).version });
  74372. }
  74373. if ((_commander || _load_commander()).default.nodeVersionCheck && !(_semver || _load_semver()).default.satisfies(process.versions.node, (_constants || _load_constants()).SUPPORTED_NODE_VERSIONS)) {
  74374. reporter.warn(reporter.lang('unsupportedNodeVersion', process.versions.node, (_constants || _load_constants()).SUPPORTED_NODE_VERSIONS));
  74375. }
  74376. if (command.noArguments && (_commander || _load_commander()).default.args.length) {
  74377. reporter.error(reporter.lang('noArguments'));
  74378. reporter.info(command.getDocsInfo);
  74379. exit(1);
  74380. return;
  74381. }
  74382. //
  74383. if ((_commander || _load_commander()).default.yes) {
  74384. reporter.warn(reporter.lang('yesWarning'));
  74385. }
  74386. //
  74387. if (!(_commander || _load_commander()).default.offline && (_network || _load_network()).isOffline()) {
  74388. reporter.warn(reporter.lang('networkWarning'));
  74389. }
  74390. //
  74391. var run = function run() {
  74392. (0, (_invariant || _load_invariant()).default)(command, 'missing command');
  74393. if (warnAboutRunDashDash) {
  74394. reporter.warn(reporter.lang('dashDashDeprecation'));
  74395. }
  74396. return command.run(config, reporter, (_commander || _load_commander()).default, (_commander || _load_commander()).default.args).then(function (exitCode) {
  74397. if (shouldWrapOutput) {
  74398. reporter.footer(false);
  74399. }
  74400. return exitCode;
  74401. });
  74402. };
  74403. //
  74404. var runEventuallyWithFile = function runEventuallyWithFile(mutexFilename, isFirstTime) {
  74405. return new (_promise || _load_promise()).default(function (resolve) {
  74406. var lockFilename = mutexFilename || (_path || _load_path()).default.join(config.cwd, (_constants || _load_constants()).SINGLE_INSTANCE_FILENAME);
  74407. (_properLockfile || _load_properLockfile()).default.lock(lockFilename, { realpath: false }, function (err, release) {
  74408. if (err) {
  74409. if (isFirstTime) {
  74410. reporter.warn(reporter.lang('waitingInstance'));
  74411. }
  74412. setTimeout(function () {
  74413. resolve(runEventuallyWithFile(mutexFilename, false));
  74414. }, 200); // do not starve the CPU
  74415. } else {
  74416. (0, (_death || _load_death()).default)(function () {
  74417. process.exitCode = 1;
  74418. });
  74419. resolve(run().then(function () {
  74420. return new (_promise || _load_promise()).default(function (resolve) {
  74421. return release(resolve);
  74422. });
  74423. }));
  74424. }
  74425. });
  74426. });
  74427. };
  74428. var runEventuallyWithNetwork = function runEventuallyWithNetwork(mutexPort) {
  74429. return new (_promise || _load_promise()).default(function (resolve, reject) {
  74430. var connectionOptions = {
  74431. port: +mutexPort || (_constants || _load_constants()).SINGLE_INSTANCE_PORT,
  74432. host: 'localhost'
  74433. };
  74434. function startServer() {
  74435. var clients = new (_set || _load_set()).default();
  74436. var server = (_http || _load_http()).default.createServer(manager);
  74437. // The server must not prevent us from exiting
  74438. server.unref();
  74439. // No socket must timeout, so that they aren't closed before we exit
  74440. server.timeout = 0;
  74441. // If we fail to setup the server, we ask the existing one for its name
  74442. server.on('error', function () {
  74443. reportServerName();
  74444. });
  74445. // If we succeed, keep track of all the connected sockets to close them later
  74446. server.on('connection', function (socket) {
  74447. clients.add(socket);
  74448. socket.on('close', function () {
  74449. clients.delete(socket);
  74450. });
  74451. });
  74452. server.listen(connectionOptions, function () {
  74453. // Don't forget to kill the sockets if we're being killed via signals
  74454. (0, (_death || _load_death()).default)(killSockets);
  74455. // Also kill the sockets if we finish, whether it's a success or a failure
  74456. run().then(function (res) {
  74457. killSockets();
  74458. resolve(res);
  74459. }, function (err) {
  74460. killSockets();
  74461. reject(err);
  74462. });
  74463. });
  74464. function manager(request, response) {
  74465. response.writeHead(200);
  74466. response.end((0, (_stringify || _load_stringify()).default)({ cwd: config.cwd, pid: process.pid }));
  74467. }
  74468. function killSockets() {
  74469. try {
  74470. server.close();
  74471. } catch (err) {
  74472. // best effort
  74473. }
  74474. for (var _iterator = clients, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  74475. var _ref3;
  74476. if (_isArray) {
  74477. if (_i >= _iterator.length) break;
  74478. _ref3 = _iterator[_i++];
  74479. } else {
  74480. _i = _iterator.next();
  74481. if (_i.done) break;
  74482. _ref3 = _i.value;
  74483. }
  74484. var socket = _ref3;
  74485. try {
  74486. socket.destroy();
  74487. } catch (err) {
  74488. // best effort
  74489. }
  74490. }
  74491. // If the process hasn't exited in the next 5s, it has stalled and we abort
  74492. var timeout = setTimeout(function () {
  74493. console.error('Process stalled');
  74494. if (process._getActiveHandles) {
  74495. console.error('Active handles:');
  74496. // $FlowFixMe: getActiveHandles is undocumented, but it exists
  74497. for (var _iterator2 = process._getActiveHandles(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  74498. var _ref4;
  74499. if (_isArray2) {
  74500. if (_i2 >= _iterator2.length) break;
  74501. _ref4 = _iterator2[_i2++];
  74502. } else {
  74503. _i2 = _iterator2.next();
  74504. if (_i2.done) break;
  74505. _ref4 = _i2.value;
  74506. }
  74507. var handle = _ref4;
  74508. console.error(` - ${handle.constructor.name}`);
  74509. }
  74510. }
  74511. // eslint-disable-next-line no-process-exit
  74512. process.exit(1);
  74513. }, 5000);
  74514. // This timeout must not prevent us from exiting
  74515. // $FlowFixMe: Node's setTimeout returns a Timeout, not a Number
  74516. timeout.unref();
  74517. }
  74518. }
  74519. function reportServerName() {
  74520. var request = (_http || _load_http()).default.get(connectionOptions, function (response) {
  74521. var buffers = [];
  74522. response.on('data', function (buffer) {
  74523. buffers.push(buffer);
  74524. });
  74525. response.on('end', function () {
  74526. try {
  74527. var _JSON$parse = JSON.parse(Buffer.concat(buffers).toString()),
  74528. _cwd = _JSON$parse.cwd,
  74529. pid = _JSON$parse.pid;
  74530. reporter.warn(reporter.lang('waitingNamedInstance', pid, _cwd));
  74531. } catch (error) {
  74532. reporter.verbose(error);
  74533. reject(new Error(reporter.lang('mutexPortBusy', connectionOptions.port)));
  74534. return;
  74535. }
  74536. waitForTheNetwork();
  74537. });
  74538. response.on('error', function () {
  74539. startServer();
  74540. });
  74541. });
  74542. request.on('error', function () {
  74543. startServer();
  74544. });
  74545. }
  74546. function waitForTheNetwork() {
  74547. var socket = (_net || _load_net()).default.createConnection(connectionOptions);
  74548. socket.on('error', function () {
  74549. // catch & ignore, the retry is handled in 'close'
  74550. });
  74551. socket.on('close', function () {
  74552. startServer();
  74553. });
  74554. }
  74555. startServer();
  74556. });
  74557. };
  74558. var cwd = command.shouldRunInCurrentCwd ? (_commander || _load_commander()).default.cwd : findProjectRoot((_commander || _load_commander()).default.cwd);
  74559. var folderOptionKeys = ['linkFolder', 'globalFolder', 'preferredCacheFolder', 'cacheFolder', 'modulesFolder'];
  74560. // Resolve all folder options relative to cwd
  74561. var resolvedFolderOptions = {};
  74562. folderOptionKeys.forEach(function (folderOptionKey) {
  74563. var folderOption = (_commander || _load_commander()).default[folderOptionKey];
  74564. var resolvedFolderOption = folderOption ? (_path || _load_path()).default.resolve((_commander || _load_commander()).default.cwd, folderOption) : folderOption;
  74565. resolvedFolderOptions[folderOptionKey] = resolvedFolderOption;
  74566. });
  74567. yield config.init((0, (_extends2 || _load_extends()).default)({
  74568. cwd,
  74569. commandName
  74570. }, resolvedFolderOptions, {
  74571. enablePnp: (_commander || _load_commander()).default.pnp,
  74572. disablePnp: (_commander || _load_commander()).default.disablePnp,
  74573. enableDefaultRc: (_commander || _load_commander()).default.defaultRc,
  74574. extraneousYarnrcFiles: (_commander || _load_commander()).default.useYarnrc,
  74575. binLinks: (_commander || _load_commander()).default.binLinks,
  74576. preferOffline: (_commander || _load_commander()).default.preferOffline,
  74577. captureHar: (_commander || _load_commander()).default.har,
  74578. ignorePlatform: (_commander || _load_commander()).default.ignorePlatform,
  74579. ignoreEngines: (_commander || _load_commander()).default.ignoreEngines,
  74580. ignoreScripts: (_commander || _load_commander()).default.ignoreScripts,
  74581. offline: (_commander || _load_commander()).default.preferOffline || (_commander || _load_commander()).default.offline,
  74582. looseSemver: !(_commander || _load_commander()).default.strictSemver,
  74583. production: (_commander || _load_commander()).default.production,
  74584. httpProxy: (_commander || _load_commander()).default.proxy,
  74585. httpsProxy: (_commander || _load_commander()).default.httpsProxy,
  74586. registry: (_commander || _load_commander()).default.registry,
  74587. networkConcurrency: (_commander || _load_commander()).default.networkConcurrency,
  74588. networkTimeout: (_commander || _load_commander()).default.networkTimeout,
  74589. nonInteractive: (_commander || _load_commander()).default.nonInteractive,
  74590. updateChecksums: (_commander || _load_commander()).default.updateChecksums,
  74591. focus: (_commander || _load_commander()).default.focus,
  74592. otp: (_commander || _load_commander()).default.otp
  74593. })).then(function () {
  74594. // lockfile check must happen after config.init sets lockfileFolder
  74595. if (command.requireLockfile && !(_fs || _load_fs()).default.existsSync((_path || _load_path()).default.join(config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME))) {
  74596. throw new (_errors || _load_errors()).MessageError(reporter.lang('noRequiredLockfile'));
  74597. }
  74598. // option "no-progress" stored in yarn config
  74599. var noProgressConfig = config.registries.yarn.getOption('no-progress');
  74600. if (noProgressConfig) {
  74601. reporter.disableProgress();
  74602. }
  74603. // verbose logs outputs process.uptime() with this line we can sync uptime to absolute time on the computer
  74604. reporter.verbose(`current time: ${new Date().toISOString()}`);
  74605. var mutex = (_commander || _load_commander()).default.mutex;
  74606. if (mutex && typeof mutex === 'string') {
  74607. var separatorLoc = mutex.indexOf(':');
  74608. var mutexType = void 0;
  74609. var mutexSpecifier = void 0;
  74610. if (separatorLoc === -1) {
  74611. mutexType = mutex;
  74612. mutexSpecifier = undefined;
  74613. } else {
  74614. mutexType = mutex.substring(0, separatorLoc);
  74615. mutexSpecifier = mutex.substring(separatorLoc + 1);
  74616. }
  74617. if (mutexType === 'file') {
  74618. return runEventuallyWithFile(mutexSpecifier, true).then(exit);
  74619. } else if (mutexType === 'network') {
  74620. return runEventuallyWithNetwork(mutexSpecifier).then(exit);
  74621. } else {
  74622. throw new (_errors || _load_errors()).MessageError(`Unknown single instance type ${mutexType}`);
  74623. }
  74624. } else {
  74625. return run().then(exit);
  74626. }
  74627. }).catch(function (err) {
  74628. reporter.verbose(err.stack);
  74629. if (err instanceof (_errors2 || _load_errors2()).ProcessTermError && reporter.isSilent) {
  74630. return exit(err.EXIT_CODE || 1);
  74631. }
  74632. if (err instanceof (_errors || _load_errors()).MessageError) {
  74633. reporter.error(err.message);
  74634. } else {
  74635. reporter.error(err.stack);
  74636. }
  74637. if (command.getDocsInfo) {
  74638. reporter.info(command.getDocsInfo);
  74639. }
  74640. if (err instanceof (_errors2 || _load_errors2()).ProcessTermError) {
  74641. return exit(err.EXIT_CODE || 1);
  74642. }
  74643. return exit(1);
  74644. });
  74645. });
  74646. return function main(_x) {
  74647. return _ref.apply(this, arguments);
  74648. };
  74649. }();
  74650. var start = function () {
  74651. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  74652. var rc = (0, (_rc || _load_rc()).getRcConfigForCwd)(process.cwd(), process.argv.slice(2));
  74653. var yarnPath = rc['yarn-path'] || rc['yarnPath'];
  74654. if (yarnPath && !(0, (_conversion || _load_conversion()).boolifyWithDefault)(process.env.YARN_IGNORE_PATH, false)) {
  74655. var argv = process.argv.slice(2);
  74656. var opts = { stdio: 'inherit', env: (0, (_assign || _load_assign()).default)({}, process.env, { YARN_IGNORE_PATH: 1 }) };
  74657. var exitCode = 0;
  74658. process.on(`SIGINT`, function () {
  74659. // We don't want SIGINT to kill our process; we want it to kill the
  74660. // innermost process, whose end will cause our own to exit.
  74661. });
  74662. (0, (_signalHandler || _load_signalHandler()).default)();
  74663. try {
  74664. if (/\.[cm]?js$/.test(yarnPath)) {
  74665. exitCode = yield (0, (_child || _load_child()).spawnp)(process.execPath, [yarnPath].concat(argv), opts);
  74666. } else {
  74667. exitCode = yield (0, (_child || _load_child()).spawnp)(yarnPath, argv, opts);
  74668. }
  74669. } catch (firstError) {
  74670. try {
  74671. exitCode = yield (0, (_child || _load_child()).forkp)(yarnPath, argv, opts);
  74672. } catch (error) {
  74673. throw firstError;
  74674. }
  74675. }
  74676. process.exitCode = exitCode;
  74677. } else {
  74678. // ignore all arguments after a --
  74679. var doubleDashIndex = process.argv.findIndex(function (element) {
  74680. return element === '--';
  74681. });
  74682. var startArgs = process.argv.slice(0, 2);
  74683. var args = process.argv.slice(2, doubleDashIndex === -1 ? process.argv.length : doubleDashIndex);
  74684. var endArgs = doubleDashIndex === -1 ? [] : process.argv.slice(doubleDashIndex);
  74685. yield main({ startArgs, args, endArgs });
  74686. }
  74687. });
  74688. return function start() {
  74689. return _ref5.apply(this, arguments);
  74690. };
  74691. }();
  74692. // When this module is compiled via Webpack, its child
  74693. // count will be 0 since it is a single-file bundle.
  74694. var _http;
  74695. function _load_http() {
  74696. return _http = _interopRequireDefault(__webpack_require__(83));
  74697. }
  74698. var _net;
  74699. function _load_net() {
  74700. return _net = _interopRequireDefault(__webpack_require__(151));
  74701. }
  74702. var _path;
  74703. function _load_path() {
  74704. return _path = _interopRequireDefault(__webpack_require__(1));
  74705. }
  74706. var _commander;
  74707. function _load_commander() {
  74708. return _commander = _interopRequireDefault(__webpack_require__(277));
  74709. }
  74710. var _fs;
  74711. function _load_fs() {
  74712. return _fs = _interopRequireDefault(__webpack_require__(12));
  74713. }
  74714. var _invariant;
  74715. function _load_invariant() {
  74716. return _invariant = _interopRequireDefault(__webpack_require__(15));
  74717. }
  74718. var _properLockfile;
  74719. function _load_properLockfile() {
  74720. return _properLockfile = _interopRequireDefault(__webpack_require__(444));
  74721. }
  74722. var _loudRejection;
  74723. function _load_loudRejection() {
  74724. return _loudRejection = _interopRequireDefault(__webpack_require__(443));
  74725. }
  74726. var _death;
  74727. function _load_death() {
  74728. return _death = _interopRequireDefault(__webpack_require__(442));
  74729. }
  74730. var _semver;
  74731. function _load_semver() {
  74732. return _semver = _interopRequireDefault(__webpack_require__(27));
  74733. }
  74734. var _index;
  74735. function _load_index() {
  74736. return _index = __webpack_require__(189);
  74737. }
  74738. var _index2;
  74739. function _load_index2() {
  74740. return _index2 = __webpack_require__(61);
  74741. }
  74742. var _index3;
  74743. function _load_index3() {
  74744. return _index3 = _interopRequireDefault(__webpack_require__(273));
  74745. }
  74746. var _constants;
  74747. function _load_constants() {
  74748. return _constants = _interopRequireWildcard(__webpack_require__(13));
  74749. }
  74750. var _network;
  74751. function _load_network() {
  74752. return _network = _interopRequireWildcard(__webpack_require__(276));
  74753. }
  74754. var _errors;
  74755. function _load_errors() {
  74756. return _errors = __webpack_require__(6);
  74757. }
  74758. var _config;
  74759. function _load_config() {
  74760. return _config = _interopRequireDefault(__webpack_require__(150));
  74761. }
  74762. var _rc;
  74763. function _load_rc() {
  74764. return _rc = __webpack_require__(274);
  74765. }
  74766. var _child;
  74767. function _load_child() {
  74768. return _child = __webpack_require__(57);
  74769. }
  74770. var _yarnVersion;
  74771. function _load_yarnVersion() {
  74772. return _yarnVersion = __webpack_require__(96);
  74773. }
  74774. var _signalHandler;
  74775. function _load_signalHandler() {
  74776. return _signalHandler = _interopRequireDefault(__webpack_require__(441));
  74777. }
  74778. var _conversion;
  74779. function _load_conversion() {
  74780. return _conversion = __webpack_require__(275);
  74781. }
  74782. var _errors2;
  74783. function _load_errors2() {
  74784. return _errors2 = __webpack_require__(6);
  74785. }
  74786. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  74787. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  74788. var chalk = __webpack_require__(33);
  74789. process.stdout.prependListener('error', function (err) {
  74790. // swallow err only if downstream consumer process closed pipe early
  74791. if (err.code === 'EPIPE' || err.code === 'ERR_STREAM_DESTROYED') {
  74792. return;
  74793. }
  74794. throw err;
  74795. });
  74796. function findPackageManager(base) {
  74797. var prev = null;
  74798. var dir = base;
  74799. do {
  74800. var p = (_path || _load_path()).default.join(dir, (_constants || _load_constants()).NODE_PACKAGE_JSON);
  74801. var data = void 0;
  74802. try {
  74803. data = JSON.parse((_fs || _load_fs()).default.readFileSync(p, `utf8`));
  74804. } catch (err) {}
  74805. if (data && typeof data.packageManager === `string`) {
  74806. return data.packageManager;
  74807. }
  74808. prev = dir;
  74809. dir = (_path || _load_path()).default.dirname(dir);
  74810. } while (dir !== prev);
  74811. return null;
  74812. }
  74813. function findProjectRoot(base) {
  74814. var prev = null;
  74815. var dir = base;
  74816. do {
  74817. if ((_fs || _load_fs()).default.existsSync((_path || _load_path()).default.join(dir, (_constants || _load_constants()).NODE_PACKAGE_JSON))) {
  74818. return dir;
  74819. }
  74820. prev = dir;
  74821. dir = (_path || _load_path()).default.dirname(dir);
  74822. } while (dir !== prev);
  74823. return base;
  74824. }
  74825. var autoRun = exports.autoRun = module.children.length === 0;
  74826. if (__webpack_require__.c[__webpack_require__.s] === module) {
  74827. start().catch(function (error) {
  74828. console.error(error.stack || error.message || error);
  74829. process.exitCode = 1;
  74830. });
  74831. }
  74832. exports.default = start;
  74833. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(115)(module)))
  74834. /***/ }),
  74835. /* 505 */
  74836. /***/ (function(module, exports, __webpack_require__) {
  74837. "use strict";
  74838. Object.defineProperty(exports, "__esModule", {
  74839. value: true
  74840. });
  74841. var _asyncToGenerator2;
  74842. function _load_asyncToGenerator() {
  74843. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  74844. }
  74845. var _classCallCheck2;
  74846. function _load_classCallCheck() {
  74847. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  74848. }
  74849. var _possibleConstructorReturn2;
  74850. function _load_possibleConstructorReturn() {
  74851. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  74852. }
  74853. var _inherits2;
  74854. function _load_inherits() {
  74855. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  74856. }
  74857. var _baseFetcher;
  74858. function _load_baseFetcher() {
  74859. return _baseFetcher = _interopRequireDefault(__webpack_require__(156));
  74860. }
  74861. var _fs;
  74862. function _load_fs() {
  74863. return _fs = _interopRequireWildcard(__webpack_require__(8));
  74864. }
  74865. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  74866. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  74867. var CopyFetcher = function (_BaseFetcher) {
  74868. (0, (_inherits2 || _load_inherits()).default)(CopyFetcher, _BaseFetcher);
  74869. function CopyFetcher() {
  74870. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, CopyFetcher);
  74871. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseFetcher.apply(this, arguments));
  74872. }
  74873. CopyFetcher.prototype._fetch = function () {
  74874. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  74875. yield (_fs || _load_fs()).copy(this.reference, this.dest, this.reporter);
  74876. return {
  74877. hash: this.hash || '',
  74878. resolved: null
  74879. };
  74880. });
  74881. function _fetch() {
  74882. return _ref.apply(this, arguments);
  74883. }
  74884. return _fetch;
  74885. }();
  74886. return CopyFetcher;
  74887. }((_baseFetcher || _load_baseFetcher()).default);
  74888. exports.default = CopyFetcher;
  74889. /***/ }),
  74890. /* 506 */
  74891. /***/ (function(module, exports, __webpack_require__) {
  74892. "use strict";
  74893. Object.defineProperty(exports, "__esModule", {
  74894. value: true
  74895. });
  74896. var _promise;
  74897. function _load_promise() {
  74898. return _promise = _interopRequireDefault(__webpack_require__(7));
  74899. }
  74900. var _asyncToGenerator2;
  74901. function _load_asyncToGenerator() {
  74902. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  74903. }
  74904. var _classCallCheck2;
  74905. function _load_classCallCheck() {
  74906. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  74907. }
  74908. var _possibleConstructorReturn2;
  74909. function _load_possibleConstructorReturn() {
  74910. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  74911. }
  74912. var _inherits2;
  74913. function _load_inherits() {
  74914. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  74915. }
  74916. var _errors;
  74917. function _load_errors() {
  74918. return _errors = __webpack_require__(6);
  74919. }
  74920. var _baseFetcher;
  74921. function _load_baseFetcher() {
  74922. return _baseFetcher = _interopRequireDefault(__webpack_require__(156));
  74923. }
  74924. var _git;
  74925. function _load_git() {
  74926. return _git = _interopRequireDefault(__webpack_require__(205));
  74927. }
  74928. var _fs;
  74929. function _load_fs() {
  74930. return _fs = _interopRequireWildcard(__webpack_require__(8));
  74931. }
  74932. var _constants;
  74933. function _load_constants() {
  74934. return _constants = _interopRequireWildcard(__webpack_require__(13));
  74935. }
  74936. var _crypto;
  74937. function _load_crypto() {
  74938. return _crypto = _interopRequireWildcard(__webpack_require__(158));
  74939. }
  74940. var _install;
  74941. function _load_install() {
  74942. return _install = __webpack_require__(41);
  74943. }
  74944. var _lockfile;
  74945. function _load_lockfile() {
  74946. return _lockfile = _interopRequireDefault(__webpack_require__(25));
  74947. }
  74948. var _config;
  74949. function _load_config() {
  74950. return _config = _interopRequireDefault(__webpack_require__(150));
  74951. }
  74952. var _pack;
  74953. function _load_pack() {
  74954. return _pack = __webpack_require__(155);
  74955. }
  74956. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  74957. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  74958. var tarFs = __webpack_require__(184);
  74959. var url = __webpack_require__(29);
  74960. var path = __webpack_require__(1);
  74961. var fs = __webpack_require__(12);
  74962. var invariant = __webpack_require__(15);
  74963. var PACKED_FLAG = '1';
  74964. var GitFetcher = function (_BaseFetcher) {
  74965. (0, (_inherits2 || _load_inherits()).default)(GitFetcher, _BaseFetcher);
  74966. function GitFetcher() {
  74967. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitFetcher);
  74968. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseFetcher.apply(this, arguments));
  74969. }
  74970. GitFetcher.prototype.setupMirrorFromCache = function () {
  74971. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  74972. var tarballMirrorPath = this.getTarballMirrorPath();
  74973. var tarballCachePath = this.getTarballCachePath();
  74974. if (tarballMirrorPath == null) {
  74975. return;
  74976. }
  74977. if (!(yield (_fs || _load_fs()).exists(tarballMirrorPath)) && (yield (_fs || _load_fs()).exists(tarballCachePath))) {
  74978. // The tarball doesn't exists in the offline cache but does in the cache; we import it to the mirror
  74979. yield (_fs || _load_fs()).mkdirp(path.dirname(tarballMirrorPath));
  74980. yield (_fs || _load_fs()).copy(tarballCachePath, tarballMirrorPath, this.reporter);
  74981. }
  74982. });
  74983. function setupMirrorFromCache() {
  74984. return _ref.apply(this, arguments);
  74985. }
  74986. return setupMirrorFromCache;
  74987. }();
  74988. GitFetcher.prototype.getTarballMirrorPath = function getTarballMirrorPath() {
  74989. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  74990. _ref2$withCommit = _ref2.withCommit,
  74991. withCommit = _ref2$withCommit === undefined ? true : _ref2$withCommit;
  74992. var _url$parse = url.parse(this.reference),
  74993. pathname = _url$parse.pathname;
  74994. if (pathname == null) {
  74995. return null;
  74996. }
  74997. var hash = this.hash;
  74998. var packageFilename = withCommit && hash ? `${path.basename(pathname)}-${hash}` : `${path.basename(pathname)}`;
  74999. if (packageFilename.startsWith(':')) {
  75000. packageFilename = packageFilename.substr(1);
  75001. }
  75002. return this.config.getOfflineMirrorPath(packageFilename);
  75003. };
  75004. GitFetcher.prototype.getTarballCachePath = function getTarballCachePath() {
  75005. return path.join(this.dest, (_constants || _load_constants()).TARBALL_FILENAME);
  75006. };
  75007. GitFetcher.prototype.getLocalPaths = function getLocalPaths(override) {
  75008. var paths = [override ? path.resolve(this.config.cwd, override) : null, this.getTarballMirrorPath(), this.getTarballMirrorPath({ withCommit: false }), this.getTarballCachePath()];
  75009. // $FlowFixMe: https://github.com/facebook/flow/issues/1414
  75010. return paths.filter(function (path) {
  75011. return path != null;
  75012. });
  75013. };
  75014. GitFetcher.prototype.fetchFromLocal = function () {
  75015. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (override) {
  75016. var _this2 = this;
  75017. var tarPaths = this.getLocalPaths(override);
  75018. var stream = yield (_fs || _load_fs()).readFirstAvailableStream(tarPaths);
  75019. return new (_promise || _load_promise()).default(function (resolve, reject) {
  75020. if (!stream) {
  75021. reject(new (_errors || _load_errors()).MessageError(_this2.reporter.lang('tarballNotInNetworkOrCache', _this2.reference, tarPaths)));
  75022. return;
  75023. }
  75024. invariant(stream, 'cachedStream should be available at this point');
  75025. // $FlowFixMe - This is available https://nodejs.org/api/fs.html#fs_readstream_path
  75026. var tarballPath = stream.path;
  75027. var untarStream = _this2._createUntarStream(_this2.dest);
  75028. var hashStream = new (_crypto || _load_crypto()).HashStream();
  75029. stream.pipe(hashStream).pipe(untarStream).on('finish', function () {
  75030. var expectHash = _this2.hash;
  75031. invariant(expectHash, 'Commit hash required');
  75032. var actualHash = hashStream.getHash();
  75033. // This condition is disabled because "expectHash" actually is the commit hash
  75034. // This is a design issue that we'll need to fix (https://github.com/yarnpkg/yarn/pull/3449)
  75035. if (true) {
  75036. resolve({
  75037. hash: expectHash
  75038. });
  75039. } else {
  75040. reject(new (_errors || _load_errors()).SecurityError(_this2.config.reporter.lang('fetchBadHashWithPath', _this2.packageName, _this2.remote.reference, expectHash, actualHash)));
  75041. }
  75042. }).on('error', function (err) {
  75043. reject(new (_errors || _load_errors()).MessageError(this.reporter.lang('fetchErrorCorrupt', err.message, tarballPath)));
  75044. });
  75045. });
  75046. });
  75047. function fetchFromLocal(_x2) {
  75048. return _ref3.apply(this, arguments);
  75049. }
  75050. return fetchFromLocal;
  75051. }();
  75052. GitFetcher.prototype.hasPrepareScript = function () {
  75053. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (git) {
  75054. var manifestFile = yield git.getFile('package.json');
  75055. if (manifestFile) {
  75056. var scripts = JSON.parse(manifestFile).scripts;
  75057. var _hasPrepareScript = Boolean(scripts && scripts.prepare);
  75058. return _hasPrepareScript;
  75059. }
  75060. return false;
  75061. });
  75062. function hasPrepareScript(_x3) {
  75063. return _ref4.apply(this, arguments);
  75064. }
  75065. return hasPrepareScript;
  75066. }();
  75067. GitFetcher.prototype.fetchFromExternal = function () {
  75068. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  75069. var hash = this.hash;
  75070. invariant(hash, 'Commit hash required');
  75071. var gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(this.reference);
  75072. var git = new (_git || _load_git()).default(this.config, gitUrl, hash);
  75073. yield git.init();
  75074. if (yield this.hasPrepareScript(git)) {
  75075. yield this.fetchFromInstallAndPack(git);
  75076. } else {
  75077. yield this.fetchFromGitArchive(git);
  75078. }
  75079. return {
  75080. hash
  75081. };
  75082. });
  75083. function fetchFromExternal() {
  75084. return _ref5.apply(this, arguments);
  75085. }
  75086. return fetchFromExternal;
  75087. }();
  75088. GitFetcher.prototype.fetchFromInstallAndPack = function () {
  75089. var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (git) {
  75090. var prepareDirectory = this.config.getTemp(`${(_crypto || _load_crypto()).hash(git.gitUrl.repository)}.${git.hash}.prepare`);
  75091. yield (_fs || _load_fs()).unlink(prepareDirectory);
  75092. yield git.clone(prepareDirectory);
  75093. var _ref7 = yield (_promise || _load_promise()).default.all([(_config || _load_config()).default.create({
  75094. binLinks: true,
  75095. cwd: prepareDirectory,
  75096. disablePrepublish: true,
  75097. production: false
  75098. }, this.reporter), (_lockfile || _load_lockfile()).default.fromDirectory(prepareDirectory, this.reporter)]),
  75099. prepareConfig = _ref7[0],
  75100. prepareLockFile = _ref7[1];
  75101. yield (0, (_install || _load_install()).install)(prepareConfig, this.reporter, {}, prepareLockFile);
  75102. var tarballMirrorPath = this.getTarballMirrorPath();
  75103. var tarballCachePath = this.getTarballCachePath();
  75104. if (tarballMirrorPath) {
  75105. yield this._packToTarball(prepareConfig, tarballMirrorPath);
  75106. }
  75107. if (tarballCachePath) {
  75108. yield this._packToTarball(prepareConfig, tarballCachePath);
  75109. }
  75110. yield this._packToDirectory(prepareConfig, this.dest);
  75111. yield (_fs || _load_fs()).unlink(prepareDirectory);
  75112. });
  75113. function fetchFromInstallAndPack(_x4) {
  75114. return _ref6.apply(this, arguments);
  75115. }
  75116. return fetchFromInstallAndPack;
  75117. }();
  75118. GitFetcher.prototype._packToTarball = function () {
  75119. var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, path) {
  75120. var tarballStream = yield this._createTarballStream(config);
  75121. yield new (_promise || _load_promise()).default(function (resolve, reject) {
  75122. var writeStream = fs.createWriteStream(path);
  75123. tarballStream.on('error', reject);
  75124. writeStream.on('error', reject);
  75125. writeStream.on('end', resolve);
  75126. writeStream.on('open', function () {
  75127. tarballStream.pipe(writeStream);
  75128. });
  75129. writeStream.once('finish', resolve);
  75130. });
  75131. });
  75132. function _packToTarball(_x5, _x6) {
  75133. return _ref8.apply(this, arguments);
  75134. }
  75135. return _packToTarball;
  75136. }();
  75137. GitFetcher.prototype._packToDirectory = function () {
  75138. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, dest) {
  75139. var _this3 = this;
  75140. var tarballStream = yield this._createTarballStream(config);
  75141. yield new (_promise || _load_promise()).default(function (resolve, reject) {
  75142. var untarStream = _this3._createUntarStream(dest);
  75143. tarballStream.on('error', reject);
  75144. untarStream.on('error', reject);
  75145. untarStream.on('end', resolve);
  75146. untarStream.once('finish', resolve);
  75147. tarballStream.pipe(untarStream);
  75148. });
  75149. });
  75150. function _packToDirectory(_x7, _x8) {
  75151. return _ref9.apply(this, arguments);
  75152. }
  75153. return _packToDirectory;
  75154. }();
  75155. GitFetcher.prototype._createTarballStream = function _createTarballStream(config) {
  75156. var savedPackedHeader = false;
  75157. return (0, (_pack || _load_pack()).packTarball)(config, {
  75158. mapHeader(header) {
  75159. if (!savedPackedHeader) {
  75160. savedPackedHeader = true;
  75161. header.pax = header.pax || {};
  75162. // add a custom data on the first header
  75163. // in order to distinguish a tar from "git archive" and a tar from "pack" command
  75164. header.pax.packed = PACKED_FLAG;
  75165. }
  75166. return header;
  75167. }
  75168. });
  75169. };
  75170. GitFetcher.prototype._createUntarStream = function _createUntarStream(dest) {
  75171. var PREFIX = 'package/';
  75172. var isPackedTarball = undefined;
  75173. return tarFs.extract(dest, {
  75174. dmode: 0o555, // all dirs should be readable
  75175. fmode: 0o444, // all files should be readable
  75176. chown: false, // don't chown. just leave as it is
  75177. map: function map(header) {
  75178. if (isPackedTarball === undefined) {
  75179. isPackedTarball = header.pax && header.pax.packed === PACKED_FLAG;
  75180. }
  75181. if (isPackedTarball) {
  75182. header.name = header.name.substr(PREFIX.length);
  75183. }
  75184. }
  75185. });
  75186. };
  75187. GitFetcher.prototype.fetchFromGitArchive = function () {
  75188. var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (git) {
  75189. yield git.clone(this.dest);
  75190. var tarballMirrorPath = this.getTarballMirrorPath();
  75191. var tarballCachePath = this.getTarballCachePath();
  75192. if (tarballMirrorPath) {
  75193. yield git.archive(tarballMirrorPath);
  75194. }
  75195. if (tarballCachePath) {
  75196. yield git.archive(tarballCachePath);
  75197. }
  75198. });
  75199. function fetchFromGitArchive(_x9) {
  75200. return _ref10.apply(this, arguments);
  75201. }
  75202. return fetchFromGitArchive;
  75203. }();
  75204. GitFetcher.prototype._fetch = function _fetch() {
  75205. var _this4 = this;
  75206. return this.fetchFromLocal().catch(function (err) {
  75207. return _this4.fetchFromExternal();
  75208. });
  75209. };
  75210. return GitFetcher;
  75211. }((_baseFetcher || _load_baseFetcher()).default);
  75212. exports.default = GitFetcher;
  75213. /***/ }),
  75214. /* 507 */
  75215. /***/ (function(module, exports, __webpack_require__) {
  75216. "use strict";
  75217. Object.defineProperty(exports, "__esModule", {
  75218. value: true
  75219. });
  75220. exports.workspace = exports.tarball = exports.git = exports.copy = exports.base = undefined;
  75221. var _baseFetcher;
  75222. function _load_baseFetcher() {
  75223. return _baseFetcher = _interopRequireDefault(__webpack_require__(156));
  75224. }
  75225. var _copyFetcher;
  75226. function _load_copyFetcher() {
  75227. return _copyFetcher = _interopRequireDefault(__webpack_require__(505));
  75228. }
  75229. var _gitFetcher;
  75230. function _load_gitFetcher() {
  75231. return _gitFetcher = _interopRequireDefault(__webpack_require__(506));
  75232. }
  75233. var _tarballFetcher;
  75234. function _load_tarballFetcher() {
  75235. return _tarballFetcher = _interopRequireDefault(__webpack_require__(300));
  75236. }
  75237. var _workspaceFetcher;
  75238. function _load_workspaceFetcher() {
  75239. return _workspaceFetcher = _interopRequireDefault(__webpack_require__(508));
  75240. }
  75241. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  75242. exports.base = (_baseFetcher || _load_baseFetcher()).default;
  75243. exports.copy = (_copyFetcher || _load_copyFetcher()).default;
  75244. exports.git = (_gitFetcher || _load_gitFetcher()).default;
  75245. exports.tarball = (_tarballFetcher || _load_tarballFetcher()).default;
  75246. exports.workspace = (_workspaceFetcher || _load_workspaceFetcher()).default;
  75247. /***/ }),
  75248. /* 508 */
  75249. /***/ (function(module, exports, __webpack_require__) {
  75250. "use strict";
  75251. Object.defineProperty(exports, "__esModule", {
  75252. value: true
  75253. });
  75254. var _extends2;
  75255. function _load_extends() {
  75256. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  75257. }
  75258. var _asyncToGenerator2;
  75259. function _load_asyncToGenerator() {
  75260. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  75261. }
  75262. var _promise;
  75263. function _load_promise() {
  75264. return _promise = _interopRequireDefault(__webpack_require__(7));
  75265. }
  75266. var _classCallCheck2;
  75267. function _load_classCallCheck() {
  75268. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  75269. }
  75270. var _packageFetcher;
  75271. function _load_packageFetcher() {
  75272. return _packageFetcher = __webpack_require__(197);
  75273. }
  75274. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  75275. var WorkspaceFetcher = function () {
  75276. function WorkspaceFetcher(dest, remote, config) {
  75277. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, WorkspaceFetcher);
  75278. this.config = config;
  75279. this.dest = dest;
  75280. this.registry = remote.registry;
  75281. this.workspaceDir = remote.reference;
  75282. this.registryRemote = remote.registryRemote;
  75283. }
  75284. WorkspaceFetcher.prototype.setupMirrorFromCache = function setupMirrorFromCache() {
  75285. return (_promise || _load_promise()).default.resolve();
  75286. };
  75287. WorkspaceFetcher.prototype.fetch = function () {
  75288. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  75289. var pkg = yield this.config.readManifest(this.workspaceDir, this.registry);
  75290. if (this.registryRemote) {
  75291. yield this.fetchRemoteWorkspace(this.registryRemote, pkg);
  75292. }
  75293. return {
  75294. resolved: null,
  75295. hash: '',
  75296. cached: false,
  75297. dest: this.dest,
  75298. package: (0, (_extends2 || _load_extends()).default)({}, pkg, {
  75299. _uid: pkg.version
  75300. })
  75301. };
  75302. });
  75303. function fetch() {
  75304. return _ref.apply(this, arguments);
  75305. }
  75306. return fetch;
  75307. }();
  75308. WorkspaceFetcher.prototype.fetchRemoteWorkspace = function fetchRemoteWorkspace(remote, manifest) {
  75309. return (0, (_packageFetcher || _load_packageFetcher()).fetchOneRemote)(remote, manifest.name, manifest.version, this.dest, this.config);
  75310. };
  75311. return WorkspaceFetcher;
  75312. }();
  75313. exports.default = WorkspaceFetcher;
  75314. /***/ }),
  75315. /* 509 */
  75316. /***/ (function(module, exports, __webpack_require__) {
  75317. "use strict";
  75318. Object.defineProperty(exports, "__esModule", {
  75319. value: true
  75320. });
  75321. exports.buildTree = undefined;
  75322. var _getIterator2;
  75323. function _load_getIterator() {
  75324. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  75325. }
  75326. var _asyncToGenerator2;
  75327. function _load_asyncToGenerator() {
  75328. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  75329. }
  75330. var buildTree = exports.buildTree = function () {
  75331. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (resolver, linker, patterns, ignoreHoisted) {
  75332. var treesByKey = {};
  75333. var trees = [];
  75334. var flatTree = yield linker.getFlatHoistedTree(patterns);
  75335. // If using workspaces, filter out the virtual manifest
  75336. var workspaceLayout = resolver.workspaceLayout;
  75337. var hoisted = workspaceLayout && workspaceLayout.virtualManifestName ? flatTree.filter(function (_ref2) {
  75338. var key = _ref2[0];
  75339. return key.indexOf(workspaceLayout.virtualManifestName) === -1;
  75340. }) : flatTree;
  75341. var hoistedByKey = {};
  75342. for (var _iterator = hoisted, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  75343. var _ref4;
  75344. if (_isArray) {
  75345. if (_i >= _iterator.length) break;
  75346. _ref4 = _iterator[_i++];
  75347. } else {
  75348. _i = _iterator.next();
  75349. if (_i.done) break;
  75350. _ref4 = _i.value;
  75351. }
  75352. var _ref3 = _ref4;
  75353. var key = _ref3[0];
  75354. var info = _ref3[1];
  75355. hoistedByKey[key] = info;
  75356. }
  75357. // build initial trees
  75358. for (var _iterator2 = hoisted, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  75359. var _ref6;
  75360. if (_isArray2) {
  75361. if (_i2 >= _iterator2.length) break;
  75362. _ref6 = _iterator2[_i2++];
  75363. } else {
  75364. _i2 = _iterator2.next();
  75365. if (_i2.done) break;
  75366. _ref6 = _i2.value;
  75367. }
  75368. var _ref5 = _ref6;
  75369. var _info = _ref5[1];
  75370. var ref = _info.pkg._reference;
  75371. // const parent = getParent(info.key, treesByKey);
  75372. var _children = [];
  75373. // let depth = 0;
  75374. invariant(ref, 'expected reference');
  75375. // check parent to obtain next depth
  75376. // if (parent && parent.depth > 0) {
  75377. // depth = parent.depth + 1;
  75378. // } else {
  75379. // depth = 0;
  75380. // }
  75381. treesByKey[_info.key] = {
  75382. name: _info.pkg.name,
  75383. version: _info.pkg.version,
  75384. children: _children,
  75385. manifest: _info
  75386. };
  75387. }
  75388. // add children
  75389. for (var _iterator3 = hoisted, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  75390. var _ref8;
  75391. if (_isArray3) {
  75392. if (_i3 >= _iterator3.length) break;
  75393. _ref8 = _iterator3[_i3++];
  75394. } else {
  75395. _i3 = _iterator3.next();
  75396. if (_i3.done) break;
  75397. _ref8 = _i3.value;
  75398. }
  75399. var _ref7 = _ref8;
  75400. var _info2 = _ref7[1];
  75401. var tree = treesByKey[_info2.key];
  75402. var parent = getParent(_info2.key, treesByKey);
  75403. if (!tree) {
  75404. continue;
  75405. }
  75406. if (_info2.key.split('#').length === 1) {
  75407. trees.push(tree);
  75408. continue;
  75409. }
  75410. if (parent) {
  75411. parent.children.push(tree);
  75412. }
  75413. }
  75414. return trees;
  75415. });
  75416. return function buildTree(_x, _x2, _x3, _x4) {
  75417. return _ref.apply(this, arguments);
  75418. };
  75419. }();
  75420. exports.getParent = getParent;
  75421. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  75422. var invariant = __webpack_require__(15);
  75423. function getParent(key, treesByKey) {
  75424. var parentKey = key.slice(0, key.lastIndexOf('#'));
  75425. return treesByKey[parentKey];
  75426. }
  75427. /***/ }),
  75428. /* 510 */
  75429. /***/ (function(module, exports, __webpack_require__) {
  75430. "use strict";
  75431. Object.defineProperty(exports, "__esModule", {
  75432. value: true
  75433. });
  75434. var _keys;
  75435. function _load_keys() {
  75436. return _keys = _interopRequireDefault(__webpack_require__(14));
  75437. }
  75438. var _stringify2;
  75439. function _load_stringify() {
  75440. return _stringify2 = _interopRequireDefault(__webpack_require__(37));
  75441. }
  75442. exports.default = stringify;
  75443. var _misc;
  75444. function _load_misc() {
  75445. return _misc = __webpack_require__(28);
  75446. }
  75447. var _constants;
  75448. function _load_constants() {
  75449. return _constants = __webpack_require__(13);
  75450. }
  75451. var _package;
  75452. function _load_package() {
  75453. return _package = __webpack_require__(438);
  75454. }
  75455. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  75456. var NODE_VERSION = process.version;
  75457. function shouldWrapKey(str) {
  75458. return str.indexOf('true') === 0 || str.indexOf('false') === 0 || /[:\s\n\\",\[\]]/g.test(str) || /^[0-9]/g.test(str) || !/^[a-zA-Z]/g.test(str);
  75459. }
  75460. function maybeWrap(str) {
  75461. if (typeof str === 'boolean' || typeof str === 'number' || shouldWrapKey(str)) {
  75462. return (0, (_stringify2 || _load_stringify()).default)(str);
  75463. } else {
  75464. return str;
  75465. }
  75466. }
  75467. var priorities = {
  75468. name: 1,
  75469. version: 2,
  75470. uid: 3,
  75471. resolved: 4,
  75472. integrity: 5,
  75473. registry: 6,
  75474. dependencies: 7
  75475. };
  75476. function priorityThenAlphaSort(a, b) {
  75477. if (priorities[a] || priorities[b]) {
  75478. return (priorities[a] || 100) > (priorities[b] || 100) ? 1 : -1;
  75479. } else {
  75480. return (0, (_misc || _load_misc()).sortAlpha)(a, b);
  75481. }
  75482. }
  75483. function _stringify(obj, options) {
  75484. if (typeof obj !== 'object') {
  75485. throw new TypeError();
  75486. }
  75487. var indent = options.indent;
  75488. var lines = [];
  75489. // Sorting order needs to be consistent between runs, we run native sort by name because there are no
  75490. // problems with it being unstable because there are no to keys the same
  75491. // However priorities can be duplicated and native sort can shuffle things from run to run
  75492. var keys = (0, (_keys || _load_keys()).default)(obj).sort(priorityThenAlphaSort);
  75493. var addedKeys = [];
  75494. for (var i = 0; i < keys.length; i++) {
  75495. var _key = keys[i];
  75496. var val = obj[_key];
  75497. if (val == null || addedKeys.indexOf(_key) >= 0) {
  75498. continue;
  75499. }
  75500. var valKeys = [_key];
  75501. // get all keys that have the same value equality, we only want this for objects
  75502. if (typeof val === 'object') {
  75503. for (var j = i + 1; j < keys.length; j++) {
  75504. var _key2 = keys[j];
  75505. if (val === obj[_key2]) {
  75506. valKeys.push(_key2);
  75507. }
  75508. }
  75509. }
  75510. var keyLine = valKeys.sort((_misc || _load_misc()).sortAlpha).map(maybeWrap).join(', ');
  75511. if (typeof val === 'string' || typeof val === 'boolean' || typeof val === 'number') {
  75512. lines.push(`${keyLine} ${maybeWrap(val)}`);
  75513. } else if (typeof val === 'object') {
  75514. lines.push(`${keyLine}:\n${_stringify(val, { indent: indent + ' ' })}` + (options.topLevel ? '\n' : ''));
  75515. } else {
  75516. throw new TypeError();
  75517. }
  75518. addedKeys = addedKeys.concat(valKeys);
  75519. }
  75520. return indent + lines.join(`\n${indent}`);
  75521. }
  75522. function stringify(obj, noHeader, enableVersions) {
  75523. var val = _stringify(obj, {
  75524. indent: '',
  75525. topLevel: true
  75526. });
  75527. if (noHeader) {
  75528. return val;
  75529. }
  75530. var lines = [];
  75531. lines.push('# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.');
  75532. lines.push(`# yarn lockfile v${(_constants || _load_constants()).LOCKFILE_VERSION}`);
  75533. if (enableVersions) {
  75534. lines.push(`# yarn v${(_package || _load_package()).version}`);
  75535. lines.push(`# node ${NODE_VERSION}`);
  75536. }
  75537. lines.push('\n');
  75538. lines.push(val);
  75539. return lines.join('\n');
  75540. }
  75541. /***/ }),
  75542. /* 511 */
  75543. /***/ (function(module, exports, __webpack_require__) {
  75544. "use strict";
  75545. Object.defineProperty(exports, "__esModule", {
  75546. value: true
  75547. });
  75548. var _promise;
  75549. function _load_promise() {
  75550. return _promise = _interopRequireDefault(__webpack_require__(7));
  75551. }
  75552. var _classCallCheck2;
  75553. function _load_classCallCheck() {
  75554. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  75555. }
  75556. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  75557. var semver = __webpack_require__(27);
  75558. // This isn't really a "proper" constraint resolver. We just return the highest semver
  75559. // version in the versions passed that satisfies the input range. This vastly reduces
  75560. // the complexity and is very efficient for package resolution.
  75561. var PackageConstraintResolver = function () {
  75562. function PackageConstraintResolver(config, reporter) {
  75563. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageConstraintResolver);
  75564. this.reporter = reporter;
  75565. this.config = config;
  75566. }
  75567. PackageConstraintResolver.prototype.reduce = function reduce(versions, range) {
  75568. if (range === 'latest') {
  75569. // Usually versions are already ordered and the last one is the latest
  75570. return (_promise || _load_promise()).default.resolve(versions[versions.length - 1]);
  75571. } else {
  75572. return (_promise || _load_promise()).default.resolve(semver.maxSatisfying(versions, range, this.config.looseSemver));
  75573. }
  75574. };
  75575. return PackageConstraintResolver;
  75576. }();
  75577. exports.default = PackageConstraintResolver;
  75578. /***/ }),
  75579. /* 512 */
  75580. /***/ (function(module, exports, __webpack_require__) {
  75581. "use strict";
  75582. Object.defineProperty(exports, "__esModule", {
  75583. value: true
  75584. });
  75585. exports.NohoistResolver = exports.HoistManifest = undefined;
  75586. var _extends2;
  75587. function _load_extends() {
  75588. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  75589. }
  75590. var _from;
  75591. function _load_from() {
  75592. return _from = _interopRequireDefault(__webpack_require__(53));
  75593. }
  75594. var _keys;
  75595. function _load_keys() {
  75596. return _keys = _interopRequireDefault(__webpack_require__(14));
  75597. }
  75598. var _getIterator2;
  75599. function _load_getIterator() {
  75600. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  75601. }
  75602. var _map;
  75603. function _load_map() {
  75604. return _map = _interopRequireDefault(__webpack_require__(42));
  75605. }
  75606. var _classCallCheck2;
  75607. function _load_classCallCheck() {
  75608. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  75609. }
  75610. var _set;
  75611. function _load_set() {
  75612. return _set = _interopRequireDefault(__webpack_require__(16));
  75613. }
  75614. var _config;
  75615. function _load_config() {
  75616. return _config = _interopRequireDefault(__webpack_require__(150));
  75617. }
  75618. var _misc;
  75619. function _load_misc() {
  75620. return _misc = __webpack_require__(28);
  75621. }
  75622. var _micromatch;
  75623. function _load_micromatch() {
  75624. return _micromatch = _interopRequireDefault(__webpack_require__(109));
  75625. }
  75626. var _workspaceLayout2;
  75627. function _load_workspaceLayout() {
  75628. return _workspaceLayout2 = _interopRequireDefault(__webpack_require__(87));
  75629. }
  75630. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  75631. var invariant = __webpack_require__(15);
  75632. var path = __webpack_require__(1);
  75633. var historyCounter = 0;
  75634. var LINK_TYPES = new (_set || _load_set()).default(['workspace', 'link']);
  75635. var HoistManifest = exports.HoistManifest = function () {
  75636. function HoistManifest(key, parts, pkg, loc, isDirectRequire, isRequired, isIncompatible) {
  75637. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, HoistManifest);
  75638. this.isDirectRequire = isDirectRequire;
  75639. this.isRequired = isRequired;
  75640. this.isIncompatible = isIncompatible;
  75641. this.loc = loc;
  75642. this.pkg = pkg;
  75643. this.key = key;
  75644. this.parts = parts;
  75645. this.originalKey = key;
  75646. this.previousPaths = [];
  75647. this.history = [];
  75648. this.addHistory(`Start position = ${key}`);
  75649. this.isNohoist = false;
  75650. this.originalParentPath = '';
  75651. this.shallowPaths = [];
  75652. this.isShallow = false;
  75653. }
  75654. //focus
  75655. // nohoist info
  75656. HoistManifest.prototype.addHistory = function addHistory(msg) {
  75657. this.history.push(`${++historyCounter}: ${msg}`);
  75658. };
  75659. return HoistManifest;
  75660. }();
  75661. var PackageHoister = function () {
  75662. function PackageHoister(config, resolver) {
  75663. var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  75664. ignoreOptional = _ref.ignoreOptional,
  75665. workspaceLayout = _ref.workspaceLayout;
  75666. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageHoister);
  75667. this.resolver = resolver;
  75668. this.config = config;
  75669. this.ignoreOptional = ignoreOptional;
  75670. this.taintedKeys = new (_map || _load_map()).default();
  75671. this.levelQueue = [];
  75672. this.tree = new (_map || _load_map()).default();
  75673. this.workspaceLayout = workspaceLayout;
  75674. this.nohoistResolver = new NohoistResolver(config, resolver);
  75675. }
  75676. /**
  75677. * Taint this key and prevent any modules from being hoisted to it.
  75678. */
  75679. PackageHoister.prototype.taintKey = function taintKey(key, info) {
  75680. var existingTaint = this.taintedKeys.get(key);
  75681. if (existingTaint && existingTaint.loc !== info.loc) {
  75682. return false;
  75683. } else {
  75684. this.taintedKeys.set(key, info);
  75685. return true;
  75686. }
  75687. };
  75688. /**
  75689. * Implode an array of ancestry parts into a key.
  75690. */
  75691. PackageHoister.prototype.implodeKey = function implodeKey(parts) {
  75692. return parts.join('#');
  75693. };
  75694. /**
  75695. * Seed the hoister with patterns taken from the included resolver.
  75696. */
  75697. PackageHoister.prototype.seed = function seed(patterns) {
  75698. var _this = this;
  75699. this.prepass(patterns);
  75700. for (var _iterator = this.resolver.dedupePatterns(patterns), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  75701. var _ref2;
  75702. if (_isArray) {
  75703. if (_i >= _iterator.length) break;
  75704. _ref2 = _iterator[_i++];
  75705. } else {
  75706. _i = _iterator.next();
  75707. if (_i.done) break;
  75708. _ref2 = _i.value;
  75709. }
  75710. var _pattern = _ref2;
  75711. this._seed(_pattern, { isDirectRequire: true });
  75712. }
  75713. var _loop = function _loop() {
  75714. var queue = _this.levelQueue;
  75715. if (!queue.length) {
  75716. _this._propagateRequired();
  75717. return {
  75718. v: void 0
  75719. };
  75720. }
  75721. _this.levelQueue = [];
  75722. // sort queue to get determinism between runs
  75723. queue = queue.sort(function (_ref3, _ref4) {
  75724. var aPattern = _ref3[0];
  75725. var bPattern = _ref4[0];
  75726. return (0, (_misc || _load_misc()).sortAlpha)(aPattern, bPattern);
  75727. });
  75728. // sort the queue again to hoist packages without peer dependencies first
  75729. var sortedQueue = [];
  75730. var availableSet = new (_set || _load_set()).default();
  75731. var hasChanged = true;
  75732. while (queue.length > 0 && hasChanged) {
  75733. hasChanged = false;
  75734. var queueCopy = queue;
  75735. queue = [];
  75736. for (var t = 0; t < queueCopy.length; ++t) {
  75737. var queueItem = queueCopy[t];
  75738. var _pattern2 = queueItem[0];
  75739. var _pkg = _this.resolver.getStrictResolvedPattern(_pattern2);
  75740. var peerDependencies = (0, (_keys || _load_keys()).default)(_pkg.peerDependencies || {});
  75741. var areDependenciesFulfilled = peerDependencies.every(function (peerDependency) {
  75742. return availableSet.has(peerDependency);
  75743. });
  75744. if (areDependenciesFulfilled) {
  75745. // Move the package inside our sorted queue
  75746. sortedQueue.push(queueItem);
  75747. // Add it to our set, so that we know it is available
  75748. availableSet.add(_pattern2);
  75749. // Schedule a next pass, in case other packages had peer dependencies on this one
  75750. hasChanged = true;
  75751. } else {
  75752. queue.push(queueItem);
  75753. }
  75754. }
  75755. }
  75756. // We might end up with some packages left in the queue, that have not been sorted. We reach this codepath if two
  75757. // packages have a cyclic dependency, or if the peer dependency is provided by a parent package. In these case,
  75758. // nothing we can do, so we just add all of these packages to the end of the sorted queue.
  75759. sortedQueue = sortedQueue.concat(queue);
  75760. for (var _iterator2 = sortedQueue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  75761. var _ref6;
  75762. if (_isArray2) {
  75763. if (_i2 >= _iterator2.length) break;
  75764. _ref6 = _iterator2[_i2++];
  75765. } else {
  75766. _i2 = _iterator2.next();
  75767. if (_i2.done) break;
  75768. _ref6 = _i2.value;
  75769. }
  75770. var _ref5 = _ref6;
  75771. var _pattern3 = _ref5[0];
  75772. var parent = _ref5[1];
  75773. var info = _this._seed(_pattern3, { isDirectRequire: false, parent });
  75774. if (info) {
  75775. _this.hoist(info);
  75776. }
  75777. }
  75778. };
  75779. while (true) {
  75780. var _ret = _loop();
  75781. if (typeof _ret === "object") return _ret.v;
  75782. }
  75783. };
  75784. /**
  75785. * Seed the hoister with a specific pattern.
  75786. */
  75787. PackageHoister.prototype._seed = function _seed(pattern, _ref7) {
  75788. var isDirectRequire = _ref7.isDirectRequire,
  75789. parent = _ref7.parent;
  75790. //
  75791. var pkg = this.resolver.getStrictResolvedPattern(pattern);
  75792. var ref = pkg._reference;
  75793. invariant(ref, 'expected reference');
  75794. //
  75795. var parentParts = [];
  75796. var isIncompatible = ref.incompatible;
  75797. var isMarkedAsOptional = ref.optional && this.ignoreOptional;
  75798. var isRequired = isDirectRequire && !ref.ignore && !isIncompatible && !isMarkedAsOptional;
  75799. if (parent) {
  75800. if (!this.tree.get(parent.key)) {
  75801. return null;
  75802. }
  75803. // non ignored dependencies inherit parent's ignored status
  75804. // parent may transition from ignored to non ignored when hoisted if it is used in another non ignored branch
  75805. if (!isDirectRequire && !isIncompatible && parent.isRequired && !isMarkedAsOptional) {
  75806. isRequired = true;
  75807. }
  75808. parentParts = parent.parts;
  75809. }
  75810. //
  75811. var loc = this.config.generateModuleCachePath(ref);
  75812. var parts = parentParts.concat(pkg.name);
  75813. var key = this.implodeKey(parts);
  75814. var info = new HoistManifest(key, parts, pkg, loc, isDirectRequire, isRequired, isIncompatible);
  75815. this.nohoistResolver.initNohoist(info, parent);
  75816. this.tree.set(key, info);
  75817. this.taintKey(key, info);
  75818. //
  75819. var pushed = new (_set || _load_set()).default();
  75820. for (var _iterator3 = ref.dependencies, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  75821. var _ref8;
  75822. if (_isArray3) {
  75823. if (_i3 >= _iterator3.length) break;
  75824. _ref8 = _iterator3[_i3++];
  75825. } else {
  75826. _i3 = _iterator3.next();
  75827. if (_i3.done) break;
  75828. _ref8 = _i3.value;
  75829. }
  75830. var depPattern = _ref8;
  75831. if (!pushed.has(depPattern)) {
  75832. this.levelQueue.push([depPattern, info]);
  75833. pushed.add(depPattern);
  75834. }
  75835. }
  75836. return info;
  75837. };
  75838. /**
  75839. * Propagate inherited ignore statuses from non-ignored to ignored packages
  75840. */
  75841. PackageHoister.prototype._propagateRequired = function _propagateRequired() {
  75842. //
  75843. var toVisit = [];
  75844. // enumerate all non-ignored packages
  75845. for (var _iterator4 = this.tree.entries(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  75846. var _ref9;
  75847. if (_isArray4) {
  75848. if (_i4 >= _iterator4.length) break;
  75849. _ref9 = _iterator4[_i4++];
  75850. } else {
  75851. _i4 = _iterator4.next();
  75852. if (_i4.done) break;
  75853. _ref9 = _i4.value;
  75854. }
  75855. var entry = _ref9;
  75856. if (entry[1].isRequired) {
  75857. toVisit.push(entry[1]);
  75858. }
  75859. }
  75860. // visit them
  75861. while (toVisit.length) {
  75862. var info = toVisit.shift();
  75863. var ref = info.pkg._reference;
  75864. invariant(ref, 'expected reference');
  75865. for (var _iterator5 = ref.dependencies, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  75866. var _ref10;
  75867. if (_isArray5) {
  75868. if (_i5 >= _iterator5.length) break;
  75869. _ref10 = _iterator5[_i5++];
  75870. } else {
  75871. _i5 = _iterator5.next();
  75872. if (_i5.done) break;
  75873. _ref10 = _i5.value;
  75874. }
  75875. var depPattern = _ref10;
  75876. var depinfo = this._lookupDependency(info, depPattern);
  75877. if (!depinfo) {
  75878. continue;
  75879. }
  75880. var depRef = depinfo.pkg._reference;
  75881. // If it's marked as optional, but the parent is required and the
  75882. // dependency was not listed in `optionalDependencies`, then we mark the
  75883. // dependency as required.
  75884. var isMarkedAsOptional = depRef && depRef.optional && this.ignoreOptional && !(info.isRequired && depRef.hint !== 'optional');
  75885. if (!depinfo.isRequired && !depinfo.isIncompatible && !isMarkedAsOptional) {
  75886. depinfo.isRequired = true;
  75887. depinfo.addHistory(`Mark as non-ignored because of usage by ${info.key}`);
  75888. toVisit.push(depinfo);
  75889. }
  75890. }
  75891. }
  75892. };
  75893. /**
  75894. * Looks up the package a dependency resolves to
  75895. */
  75896. PackageHoister.prototype._lookupDependency = function _lookupDependency(info, depPattern) {
  75897. //
  75898. var pkg = this.resolver.getStrictResolvedPattern(depPattern);
  75899. var ref = pkg._reference;
  75900. invariant(ref, 'expected reference');
  75901. //
  75902. for (var i = info.parts.length; i >= 0; i--) {
  75903. var checkParts = info.parts.slice(0, i).concat(pkg.name);
  75904. var checkKey = this.implodeKey(checkParts);
  75905. var existing = this.tree.get(checkKey);
  75906. if (existing) {
  75907. return existing;
  75908. }
  75909. }
  75910. return null;
  75911. };
  75912. /**
  75913. * Find the highest position we can hoist this module to.
  75914. */
  75915. PackageHoister.prototype.getNewParts = function getNewParts(key, info, parts) {
  75916. var _this2 = this;
  75917. var stepUp = false;
  75918. var highestHoistingPoint = this.nohoistResolver.highestHoistingPoint(info) || 0;
  75919. var fullKey = this.implodeKey(parts);
  75920. var stack = []; // stack of removed parts
  75921. var name = parts.pop();
  75922. if (info.isNohoist) {
  75923. info.addHistory(`Marked as nohoist, will not be hoisted above '${parts[highestHoistingPoint]}'`);
  75924. }
  75925. for (var i = parts.length - 1; i >= highestHoistingPoint; i--) {
  75926. var checkParts = parts.slice(0, i).concat(name);
  75927. var checkKey = this.implodeKey(checkParts);
  75928. info.addHistory(`Looked at ${checkKey} for a match`);
  75929. var existing = this.tree.get(checkKey);
  75930. if (existing) {
  75931. if (existing.loc === info.loc) {
  75932. // switch to non ignored if earlier deduped version was ignored (must be compatible)
  75933. if (!existing.isRequired && info.isRequired) {
  75934. existing.addHistory(`Deduped ${fullKey} to this item, marking as required`);
  75935. existing.isRequired = true;
  75936. } else {
  75937. existing.addHistory(`Deduped ${fullKey} to this item`);
  75938. }
  75939. return { parts: checkParts, duplicate: true };
  75940. } else {
  75941. // everything above will be shadowed and this is a conflict
  75942. info.addHistory(`Found a collision at ${checkKey}`);
  75943. break;
  75944. }
  75945. }
  75946. var existingTaint = this.taintedKeys.get(checkKey);
  75947. if (existingTaint && existingTaint.loc !== info.loc) {
  75948. info.addHistory(`Broken by ${checkKey}`);
  75949. break;
  75950. }
  75951. }
  75952. var peerDependencies = (0, (_keys || _load_keys()).default)(info.pkg.peerDependencies || {});
  75953. // remove redundant parts that wont collide
  75954. hoistLoop: while (parts.length > highestHoistingPoint) {
  75955. // we must not hoist a package higher than its peer dependencies
  75956. for (var _iterator6 = peerDependencies, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  75957. var _ref11;
  75958. if (_isArray6) {
  75959. if (_i6 >= _iterator6.length) break;
  75960. _ref11 = _iterator6[_i6++];
  75961. } else {
  75962. _i6 = _iterator6.next();
  75963. if (_i6.done) break;
  75964. _ref11 = _i6.value;
  75965. }
  75966. var peerDependency = _ref11;
  75967. var _checkParts2 = parts.concat(peerDependency);
  75968. var _checkKey2 = this.implodeKey(_checkParts2);
  75969. info.addHistory(`Looked at ${_checkKey2} for a peer dependency match`);
  75970. var _existing2 = this.tree.get(_checkKey2);
  75971. if (_existing2) {
  75972. info.addHistory(`Found a peer dependency requirement at ${_checkKey2}`);
  75973. break hoistLoop;
  75974. }
  75975. }
  75976. var _checkParts = parts.concat(name);
  75977. var _checkKey = this.implodeKey(_checkParts);
  75978. //
  75979. var _existing = this.tree.get(_checkKey);
  75980. if (_existing) {
  75981. stepUp = true;
  75982. break;
  75983. }
  75984. // check if we're trying to hoist ourselves to a previously unflattened module key,
  75985. // this will result in a conflict and we'll need to move ourselves up
  75986. if (key !== _checkKey && this.taintedKeys.has(_checkKey)) {
  75987. stepUp = true;
  75988. break;
  75989. }
  75990. //
  75991. stack.push(parts.pop());
  75992. }
  75993. //
  75994. parts.push(name);
  75995. //
  75996. var isValidPosition = function isValidPosition(parts) {
  75997. // nohoist package can't be hoisted to the "root"
  75998. if (parts.length <= highestHoistingPoint) {
  75999. return false;
  76000. }
  76001. var key = _this2.implodeKey(parts);
  76002. var existing = _this2.tree.get(key);
  76003. if (existing && existing.loc === info.loc) {
  76004. return true;
  76005. }
  76006. // ensure there's no taint or the taint is us
  76007. var existingTaint = _this2.taintedKeys.get(key);
  76008. if (existingTaint && existingTaint.loc !== info.loc) {
  76009. return false;
  76010. }
  76011. return true;
  76012. };
  76013. // we need to special case when we attempt to hoist to the top level as the `existing` logic
  76014. // wont be hit in the above `while` loop and we could conflict
  76015. if (!isValidPosition(parts)) {
  76016. stepUp = true;
  76017. }
  76018. // sometimes we need to step up to a parent module to install ourselves
  76019. while (stepUp && stack.length) {
  76020. info.addHistory(`Stepping up from ${this.implodeKey(parts)}`);
  76021. parts.pop(); // remove `name`
  76022. parts.push(stack.pop(), name);
  76023. if (isValidPosition(parts)) {
  76024. info.addHistory(`Found valid position ${this.implodeKey(parts)}`);
  76025. stepUp = false;
  76026. }
  76027. }
  76028. return { parts, duplicate: false };
  76029. };
  76030. /**
  76031. * Hoist all seeded patterns to their highest positions.
  76032. */
  76033. PackageHoister.prototype.hoist = function hoist(info) {
  76034. var oldKey = info.key,
  76035. rawParts = info.parts;
  76036. // remove this item from the `tree` map so we can ignore it
  76037. this.tree.delete(oldKey);
  76038. var _getNewParts = this.getNewParts(oldKey, info, rawParts.slice()),
  76039. parts = _getNewParts.parts,
  76040. duplicate = _getNewParts.duplicate;
  76041. var newKey = this.implodeKey(parts);
  76042. if (duplicate) {
  76043. info.addHistory(`Satisfied from above by ${newKey}`);
  76044. this.declareRename(info, rawParts, parts);
  76045. this.updateHoistHistory(this.nohoistResolver._originalPath(info), this.implodeKey(parts));
  76046. return;
  76047. }
  76048. // update to the new key
  76049. if (oldKey === newKey) {
  76050. info.addHistory(`Didn't hoist - see reason above`);
  76051. this.setKey(info, oldKey, rawParts);
  76052. return;
  76053. }
  76054. //
  76055. this.declareRename(info, rawParts, parts);
  76056. this.setKey(info, newKey, parts);
  76057. };
  76058. /**
  76059. * Declare that a module has been hoisted and update our internal references.
  76060. */
  76061. PackageHoister.prototype.declareRename = function declareRename(info, oldParts, newParts) {
  76062. // go down the tree from our new position reserving our name
  76063. this.taintParents(info, oldParts.slice(0, -1), newParts.length - 1);
  76064. };
  76065. /**
  76066. * Crawl upwards through a list of ancestry parts and taint a package name.
  76067. */
  76068. PackageHoister.prototype.taintParents = function taintParents(info, processParts, start) {
  76069. for (var i = start; i < processParts.length; i++) {
  76070. var _parts = processParts.slice(0, i).concat(info.pkg.name);
  76071. var key = this.implodeKey(_parts);
  76072. if (this.taintKey(key, info)) {
  76073. info.addHistory(`Tainted ${key} to prevent collisions`);
  76074. }
  76075. }
  76076. };
  76077. PackageHoister.prototype.updateHoistHistory = function updateHoistHistory(fromPath, toKey) {
  76078. var info = this.tree.get(toKey);
  76079. invariant(info, `expect to find hoist-to ${toKey}`);
  76080. info.previousPaths.push(fromPath);
  76081. };
  76082. /**
  76083. * Update the key of a module and update our references.
  76084. */
  76085. PackageHoister.prototype.setKey = function setKey(info, newKey, parts) {
  76086. var oldKey = info.key;
  76087. info.key = newKey;
  76088. info.parts = parts;
  76089. this.tree.set(newKey, info);
  76090. if (oldKey === newKey) {
  76091. return;
  76092. }
  76093. var fromInfo = this.tree.get(newKey);
  76094. invariant(fromInfo, `expect to find hoist-from ${newKey}`);
  76095. info.previousPaths.push(this.nohoistResolver._originalPath(fromInfo));
  76096. info.addHistory(`New position = ${newKey}`);
  76097. };
  76098. /**
  76099. * Perform a prepass and if there's multiple versions of the same package, hoist the one with
  76100. * the most dependents to the top.
  76101. */
  76102. PackageHoister.prototype.prepass = function prepass(patterns) {
  76103. var _this3 = this;
  76104. patterns = this.resolver.dedupePatterns(patterns).sort();
  76105. var visited = new (_map || _load_map()).default();
  76106. var occurences = {};
  76107. // visitor to be used inside add() to mark occurences of packages
  76108. var visitAdd = function visitAdd(pkg, ancestry, pattern) {
  76109. var versions = occurences[pkg.name] = occurences[pkg.name] || {};
  76110. var version = versions[pkg.version] = versions[pkg.version] || {
  76111. occurences: new (_set || _load_set()).default(),
  76112. pattern
  76113. };
  76114. if (ancestry.length) {
  76115. version.occurences.add(ancestry[ancestry.length - 1]);
  76116. }
  76117. };
  76118. // add an occurring package to the above data structure
  76119. var add = function add(pattern, ancestry, ancestryPatterns) {
  76120. var pkg = _this3.resolver.getStrictResolvedPattern(pattern);
  76121. if (ancestry.indexOf(pkg) >= 0) {
  76122. // prevent recursive dependencies
  76123. return;
  76124. }
  76125. var visitedPattern = visited.get(pattern);
  76126. if (visitedPattern) {
  76127. // if a package has been visited before, simply increment occurrences of packages
  76128. // like last time this package was visited
  76129. visitedPattern.forEach(function (visitPkg) {
  76130. visitAdd(visitPkg.pkg, visitPkg.ancestry, visitPkg.pattern);
  76131. });
  76132. visitAdd(pkg, ancestry, pattern);
  76133. return;
  76134. }
  76135. var ref = pkg._reference;
  76136. invariant(ref, 'expected reference');
  76137. visitAdd(pkg, ancestry, pattern);
  76138. for (var _iterator7 = ref.dependencies, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  76139. var _ref12;
  76140. if (_isArray7) {
  76141. if (_i7 >= _iterator7.length) break;
  76142. _ref12 = _iterator7[_i7++];
  76143. } else {
  76144. _i7 = _iterator7.next();
  76145. if (_i7.done) break;
  76146. _ref12 = _i7.value;
  76147. }
  76148. var depPattern = _ref12;
  76149. var depAncestry = ancestry.concat(pkg);
  76150. var depAncestryPatterns = ancestryPatterns.concat(depPattern);
  76151. add(depPattern, depAncestry, depAncestryPatterns);
  76152. }
  76153. visitedPattern = visited.get(pattern) || [];
  76154. visited.set(pattern, visitedPattern);
  76155. visitedPattern.push({ pkg, ancestry, pattern });
  76156. ancestryPatterns.forEach(function (ancestryPattern) {
  76157. var visitedAncestryPattern = visited.get(ancestryPattern);
  76158. if (visitedAncestryPattern) {
  76159. visitedAncestryPattern.push({ pkg, ancestry, pattern });
  76160. }
  76161. });
  76162. };
  76163. // get a list of root package names since we can't hoist other dependencies to these spots!
  76164. var rootPackageNames = new (_set || _load_set()).default();
  76165. for (var _iterator8 = patterns, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
  76166. var _ref13;
  76167. if (_isArray8) {
  76168. if (_i8 >= _iterator8.length) break;
  76169. _ref13 = _iterator8[_i8++];
  76170. } else {
  76171. _i8 = _iterator8.next();
  76172. if (_i8.done) break;
  76173. _ref13 = _i8.value;
  76174. }
  76175. var _pattern4 = _ref13;
  76176. var _pkg2 = this.resolver.getStrictResolvedPattern(_pattern4);
  76177. rootPackageNames.add(_pkg2.name);
  76178. add(_pattern4, [], []);
  76179. }
  76180. for (var _iterator9 = (0, (_keys || _load_keys()).default)(occurences).sort(), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
  76181. var _ref14;
  76182. if (_isArray9) {
  76183. if (_i9 >= _iterator9.length) break;
  76184. _ref14 = _iterator9[_i9++];
  76185. } else {
  76186. _i9 = _iterator9.next();
  76187. if (_i9.done) break;
  76188. _ref14 = _i9.value;
  76189. }
  76190. var _packageName = _ref14;
  76191. var versionOccurences = occurences[_packageName];
  76192. var versions = (0, (_keys || _load_keys()).default)(versionOccurences);
  76193. if (versions.length === 1) {
  76194. // only one package type so we'll hoist this to the top anyway
  76195. continue;
  76196. }
  76197. if (this.tree.get(_packageName)) {
  76198. // a transitive dependency of a previously hoisted dependency exists
  76199. continue;
  76200. }
  76201. if (rootPackageNames.has(_packageName)) {
  76202. // can't replace top level packages
  76203. continue;
  76204. }
  76205. var mostOccurenceCount = void 0;
  76206. var mostOccurencePattern = void 0;
  76207. for (var _iterator10 = (0, (_keys || _load_keys()).default)(versionOccurences).sort(), _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
  76208. var _ref15;
  76209. if (_isArray10) {
  76210. if (_i10 >= _iterator10.length) break;
  76211. _ref15 = _iterator10[_i10++];
  76212. } else {
  76213. _i10 = _iterator10.next();
  76214. if (_i10.done) break;
  76215. _ref15 = _i10.value;
  76216. }
  76217. var _version = _ref15;
  76218. var _versionOccurences$_v = versionOccurences[_version],
  76219. _occurences = _versionOccurences$_v.occurences,
  76220. _pattern5 = _versionOccurences$_v.pattern;
  76221. var occurenceCount = _occurences.size;
  76222. if (!mostOccurenceCount || occurenceCount > mostOccurenceCount) {
  76223. mostOccurenceCount = occurenceCount;
  76224. mostOccurencePattern = _pattern5;
  76225. }
  76226. }
  76227. invariant(mostOccurencePattern, 'expected most occurring pattern');
  76228. invariant(mostOccurenceCount, 'expected most occurring count');
  76229. // only hoist this module if it occured more than once
  76230. if (mostOccurenceCount > 1) {
  76231. this._seed(mostOccurencePattern, { isDirectRequire: false });
  76232. }
  76233. }
  76234. };
  76235. PackageHoister.prototype.markShallowWorkspaceEntries = function markShallowWorkspaceEntries() {
  76236. var _this4 = this;
  76237. var targetWorkspace = this.config.focusedWorkspaceName;
  76238. var targetHoistManifest = this.tree.get(targetWorkspace);
  76239. invariant(targetHoistManifest, `targetHoistManifest from ${targetWorkspace} missing`);
  76240. //dedupe with a set
  76241. var dependentWorkspaces = (0, (_from || _load_from()).default)(new (_set || _load_set()).default(this._getDependentWorkspaces(targetHoistManifest)));
  76242. var entries = (0, (_from || _load_from()).default)(this.tree);
  76243. entries.forEach(function (_ref16) {
  76244. var key = _ref16[0],
  76245. info = _ref16[1];
  76246. var splitPath = key.split('#');
  76247. //mark the workspace and any un-hoisted dependencies it has for shallow installation
  76248. var isShallowDependency = dependentWorkspaces.some(function (w) {
  76249. if (splitPath[0] !== w) {
  76250. //entry is not related to the workspace
  76251. return false;
  76252. }
  76253. if (!splitPath[1]) {
  76254. //entry is the workspace
  76255. return true;
  76256. }
  76257. //don't bother marking dev dependencies or nohoist packages for shallow installation
  76258. var treeEntry = _this4.tree.get(w);
  76259. invariant(treeEntry, 'treeEntry is not defined for ' + w);
  76260. var pkg = treeEntry.pkg;
  76261. return !info.isNohoist && (!pkg.devDependencies || !(splitPath[1] in pkg.devDependencies));
  76262. });
  76263. if (isShallowDependency) {
  76264. info.shallowPaths = [null];
  76265. return;
  76266. }
  76267. //if package foo is at TARGET_WORKSPACE/node_modules/foo, the hoisted version of foo
  76268. //should be installed under each shallow workspace that uses it
  76269. //(unless that workspace has its own version of foo, in which case that should be installed)
  76270. if (splitPath.length !== 2 || splitPath[0] !== targetWorkspace) {
  76271. return;
  76272. }
  76273. var unhoistedDependency = splitPath[1];
  76274. var unhoistedInfo = _this4.tree.get(unhoistedDependency);
  76275. if (!unhoistedInfo) {
  76276. return;
  76277. }
  76278. dependentWorkspaces.forEach(function (w) {
  76279. if (_this4._packageDependsOnHoistedPackage(w, unhoistedDependency, false)) {
  76280. unhoistedInfo.shallowPaths.push(w);
  76281. }
  76282. });
  76283. });
  76284. };
  76285. PackageHoister.prototype._getDependentWorkspaces = function _getDependentWorkspaces(parent) {
  76286. var _this5 = this;
  76287. var allowDevDeps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  76288. var alreadySeen = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default();
  76289. var parentName = parent.pkg.name;
  76290. if (alreadySeen.has(parentName)) {
  76291. return [];
  76292. }
  76293. alreadySeen.add(parentName);
  76294. invariant(this.workspaceLayout, 'missing workspaceLayout');
  76295. var _workspaceLayout = this.workspaceLayout,
  76296. virtualManifestName = _workspaceLayout.virtualManifestName,
  76297. workspaces = _workspaceLayout.workspaces;
  76298. var directDependencies = [];
  76299. var ignored = [];
  76300. (0, (_keys || _load_keys()).default)(workspaces).forEach(function (workspace) {
  76301. if (alreadySeen.has(workspace) || workspace === virtualManifestName) {
  76302. return;
  76303. }
  76304. //skip a workspace if a different version of it is already being installed under the parent workspace
  76305. var info = _this5.tree.get(`${parentName}#${workspace}`);
  76306. if (info) {
  76307. var workspaceVersion = workspaces[workspace].manifest.version;
  76308. if (info.isNohoist && info.originalParentPath.startsWith(`/${WS_ROOT_ALIAS}/${parentName}`) && info.pkg.version === workspaceVersion) {
  76309. //nohoist installations are exceptions
  76310. directDependencies.push(info.key);
  76311. } else {
  76312. ignored.push(workspace);
  76313. }
  76314. return;
  76315. }
  76316. var searchPath = `/${WS_ROOT_ALIAS}/${parentName}`;
  76317. info = _this5.tree.get(workspace);
  76318. invariant(info, 'missing workspace tree entry ' + workspace);
  76319. if (!info.previousPaths.some(function (p) {
  76320. return p.startsWith(searchPath);
  76321. })) {
  76322. return;
  76323. }
  76324. if (allowDevDeps || !parent.pkg.devDependencies || !(workspace in parent.pkg.devDependencies)) {
  76325. directDependencies.push(workspace);
  76326. }
  76327. });
  76328. var nested = directDependencies.map(function (d) {
  76329. var dependencyEntry = _this5.tree.get(d);
  76330. invariant(dependencyEntry, 'missing dependencyEntry ' + d);
  76331. return _this5._getDependentWorkspaces(dependencyEntry, false, alreadySeen);
  76332. });
  76333. nested = [].concat.apply([], nested); //flatten
  76334. var directDependencyNames = directDependencies.map(function (d) {
  76335. return d.split('#').slice(-1)[0];
  76336. });
  76337. return directDependencyNames.concat(nested).filter(function (w) {
  76338. return ignored.indexOf(w) === -1;
  76339. });
  76340. };
  76341. PackageHoister.prototype._packageDependsOnHoistedPackage = function _packageDependsOnHoistedPackage(p, hoisted) {
  76342. var _this6 = this;
  76343. var checkDevDeps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  76344. var checked = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new (_set || _load_set()).default();
  76345. //don't check the same package more than once, and ignore any package that has its own version of hoisted
  76346. if (checked.has(p) || this.tree.has(`${p}#${hoisted}`)) {
  76347. return false;
  76348. }
  76349. checked.add(p);
  76350. var info = this.tree.get(p);
  76351. if (!info) {
  76352. return false;
  76353. }
  76354. var pkg = info.pkg;
  76355. if (!pkg) {
  76356. return false;
  76357. }
  76358. var deps = [];
  76359. if (pkg.dependencies) {
  76360. deps = deps.concat((0, (_keys || _load_keys()).default)(pkg.dependencies));
  76361. }
  76362. if (checkDevDeps && pkg.devDependencies) {
  76363. deps = deps.concat((0, (_keys || _load_keys()).default)(pkg.devDependencies));
  76364. }
  76365. if (deps.indexOf(hoisted) !== -1) {
  76366. return true;
  76367. }
  76368. return deps.some(function (dep) {
  76369. return _this6._packageDependsOnHoistedPackage(dep, hoisted, false, checked);
  76370. });
  76371. };
  76372. /**
  76373. * Produce a flattened list of module locations and manifests.
  76374. */
  76375. PackageHoister.prototype.init = function init() {
  76376. var _this7 = this;
  76377. var flatTree = [];
  76378. //
  76379. var _loop2 = function _loop2(key, info) {
  76380. // decompress the location and push it to the flat tree. this path could be made
  76381. var parts = [];
  76382. var keyParts = key.split('#');
  76383. var isWorkspaceEntry = _this7.workspaceLayout && keyParts[0] === _this7.workspaceLayout.virtualManifestName;
  76384. // Don't add the virtual manifest (keyParts.length === 1)
  76385. // or ws childs which were not hoisted to the root (keyParts.length === 2).
  76386. // If a ws child was hoisted its key would not contain the virtual manifest name
  76387. if (isWorkspaceEntry && keyParts.length <= 2) {
  76388. return 'continue';
  76389. }
  76390. for (var i = 0; i < keyParts.length; i++) {
  76391. var _key = keyParts.slice(0, i + 1).join('#');
  76392. var hoisted = _this7.tree.get(_key);
  76393. invariant(hoisted, `expected hoisted manifest for "${_key}"`);
  76394. parts.push(_this7.config.getFolder(hoisted.pkg));
  76395. parts.push(keyParts[i]);
  76396. }
  76397. // Check if the destination is pointing to a sub folder of the virtualManifestName
  76398. // e.g. _project_/node_modules/workspace-aggregator-123456/node_modules/workspaceChild/node_modules/dependency
  76399. // This probably happened because the hoister was not able to hoist the workspace child to the root
  76400. // So we have to change the folder to the workspace package location
  76401. if (_this7.workspaceLayout && isWorkspaceEntry) {
  76402. var wspPkg = _this7.workspaceLayout.workspaces[keyParts[1]];
  76403. invariant(wspPkg, `expected workspace package to exist for "${keyParts[1]}"`);
  76404. parts.splice(0, 4, wspPkg.loc);
  76405. } else {
  76406. if (_this7.config.modulesFolder) {
  76407. // remove the first part which will be the folder name and replace it with a
  76408. // hardcoded modules folder
  76409. parts.splice(0, 1, _this7.config.modulesFolder);
  76410. } else {
  76411. // first part will be the registry-specific module folder
  76412. parts.splice(0, 0, _this7.config.lockfileFolder);
  76413. }
  76414. }
  76415. var shallowLocs = [];
  76416. info.shallowPaths.forEach(function (shallowPath) {
  76417. var shallowCopyParts = parts.slice();
  76418. shallowCopyParts[0] = _this7.config.cwd;
  76419. if (_this7.config.modulesFolder) {
  76420. //add back the module folder name for the shallow installation
  76421. var treeEntry = _this7.tree.get(keyParts[0]);
  76422. invariant(treeEntry, 'expected treeEntry for ' + keyParts[0]);
  76423. var moduleFolderName = _this7.config.getFolder(treeEntry.pkg);
  76424. shallowCopyParts.splice(1, 0, moduleFolderName);
  76425. }
  76426. if (shallowPath) {
  76427. var targetWorkspace = _this7.config.focusedWorkspaceName;
  76428. var _treeEntry = _this7.tree.get(`${targetWorkspace}#${shallowPath}`) || _this7.tree.get(shallowPath);
  76429. invariant(_treeEntry, 'expected treeEntry for ' + shallowPath);
  76430. var _moduleFolderName = _this7.config.getFolder(_treeEntry.pkg);
  76431. shallowCopyParts.splice(1, 0, _moduleFolderName, shallowPath);
  76432. }
  76433. shallowLocs.push(path.join.apply(path, shallowCopyParts));
  76434. });
  76435. var loc = path.join.apply(path, parts);
  76436. flatTree.push([loc, info]);
  76437. shallowLocs.forEach(function (shallowLoc) {
  76438. var newManifest = (0, (_extends2 || _load_extends()).default)({}, info, { isShallow: true });
  76439. flatTree.push([shallowLoc, newManifest]);
  76440. });
  76441. };
  76442. for (var _iterator11 = this.tree.entries(), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
  76443. var _ref18;
  76444. if (_isArray11) {
  76445. if (_i11 >= _iterator11.length) break;
  76446. _ref18 = _iterator11[_i11++];
  76447. } else {
  76448. _i11 = _iterator11.next();
  76449. if (_i11.done) break;
  76450. _ref18 = _i11.value;
  76451. }
  76452. var _ref17 = _ref18;
  76453. var key = _ref17[0];
  76454. var info = _ref17[1];
  76455. var _ret2 = _loop2(key, info);
  76456. if (_ret2 === 'continue') continue;
  76457. }
  76458. // remove ignored modules from the tree
  76459. var visibleFlatTree = [];
  76460. for (var _iterator12 = flatTree, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
  76461. var _ref20;
  76462. if (_isArray12) {
  76463. if (_i12 >= _iterator12.length) break;
  76464. _ref20 = _iterator12[_i12++];
  76465. } else {
  76466. _i12 = _iterator12.next();
  76467. if (_i12.done) break;
  76468. _ref20 = _i12.value;
  76469. }
  76470. var _ref19 = _ref20;
  76471. var loc = _ref19[0];
  76472. var info = _ref19[1];
  76473. var ref = info.pkg._reference;
  76474. invariant(ref, 'expected reference');
  76475. if (!info.isRequired) {
  76476. info.addHistory('Deleted as this module was ignored');
  76477. } else {
  76478. visibleFlatTree.push([loc, info]);
  76479. }
  76480. }
  76481. return visibleFlatTree;
  76482. };
  76483. return PackageHoister;
  76484. }();
  76485. exports.default = PackageHoister;
  76486. var WS_ROOT_ALIAS = '_project_';
  76487. var NohoistResolver = exports.NohoistResolver = function () {
  76488. function NohoistResolver(config, resolver) {
  76489. var _this8 = this;
  76490. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NohoistResolver);
  76491. this.initNohoist = function (info, parent) {
  76492. var parentNohoistList = void 0;
  76493. var originalParentPath = info.originalParentPath;
  76494. if (parent) {
  76495. parentNohoistList = parent.nohoistList;
  76496. originalParentPath = _this8._originalPath(parent);
  76497. } else {
  76498. invariant(_this8._isTopPackage(info), `${info.key} doesn't have parent nor a top package`);
  76499. if (info.pkg.name !== _this8._wsRootPackageName) {
  76500. parentNohoistList = _this8._wsRootNohoistList;
  76501. originalParentPath = _this8._wsRootPackageName || '';
  76502. }
  76503. }
  76504. info.originalParentPath = originalParentPath;
  76505. var nohoistList = _this8._extractNohoistList(info.pkg, _this8._originalPath(info)) || [];
  76506. if (parentNohoistList) {
  76507. nohoistList = nohoistList.concat(parentNohoistList);
  76508. }
  76509. info.nohoistList = nohoistList.length > 0 ? nohoistList : null;
  76510. info.isNohoist = _this8._isNohoist(info);
  76511. };
  76512. this.highestHoistingPoint = function (info) {
  76513. return info.isNohoist && info.parts.length > 1 ? 1 : null;
  76514. };
  76515. this._isNohoist = function (info) {
  76516. if (_this8._isTopPackage(info)) {
  76517. return false;
  76518. }
  76519. if (info.nohoistList && info.nohoistList.length > 0 && (_micromatch || _load_micromatch()).default.any(_this8._originalPath(info), info.nohoistList)) {
  76520. return true;
  76521. }
  76522. if (_this8._config.plugnplayEnabled) {
  76523. return true;
  76524. }
  76525. return false;
  76526. };
  76527. this._isRootPackage = function (pkg) {
  76528. return pkg.name === _this8._wsRootPackageName;
  76529. };
  76530. this._originalPath = function (info) {
  76531. return _this8._makePath(info.originalParentPath, info.pkg.name);
  76532. };
  76533. this._isTopPackage = function (info) {
  76534. var parentParts = info.parts.slice(0, -1);
  76535. var result = !parentParts || parentParts.length <= 0 || parentParts.length === 1 && parentParts[0] === _this8._wsRootPackageName;
  76536. return result;
  76537. };
  76538. this._isLink = function (info) {
  76539. return info.pkg._remote != null && LINK_TYPES.has(info.pkg._remote.type);
  76540. };
  76541. this._extractNohoistList = function (pkg, pathPrefix) {
  76542. var nohoistList = void 0;
  76543. var ws = _this8._config.getWorkspaces(pkg);
  76544. if (ws && ws.nohoist) {
  76545. nohoistList = ws.nohoist.map(function (p) {
  76546. return _this8._makePath(pathPrefix, p);
  76547. });
  76548. }
  76549. return nohoistList;
  76550. };
  76551. this._resolver = resolver;
  76552. this._config = config;
  76553. if (resolver.workspaceLayout) {
  76554. this._wsRootPackageName = resolver.workspaceLayout.virtualManifestName;
  76555. var _resolver$workspaceLa = resolver.workspaceLayout.getWorkspaceManifest(this._wsRootPackageName),
  76556. manifest = _resolver$workspaceLa.manifest;
  76557. this._wsRootNohoistList = this._extractNohoistList(manifest, manifest.name);
  76558. }
  76559. }
  76560. /**
  76561. * examine the top level packages to find the root package
  76562. */
  76563. /**
  76564. * find the highest hoisting point for the given HoistManifest.
  76565. * algorithm: a nohoist package should never be hoisted beyond the top of its branch, i.e.
  76566. * the first element of its parts. Therefore the highest possible hoisting index is 1,
  76567. * unless the package has only 1 part (itself), in such case returns null just like any hoisted package
  76568. *
  76569. */
  76570. // private functions
  76571. NohoistResolver.prototype._makePath = function _makePath() {
  76572. var _this9 = this;
  76573. for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) {
  76574. args[_key2] = arguments[_key2];
  76575. }
  76576. var parts = args.map(function (s) {
  76577. return s === _this9._wsRootPackageName ? WS_ROOT_ALIAS : s;
  76578. });
  76579. var result = parts.join('/');
  76580. return result[0] === '/' ? result : '/' + result;
  76581. };
  76582. // extract nohoist from package.json then prefix them with branch path
  76583. // so we can matched against the branch tree ("originalPath") later
  76584. return NohoistResolver;
  76585. }();
  76586. /***/ }),
  76587. /* 513 */
  76588. /***/ (function(module, exports, __webpack_require__) {
  76589. "use strict";
  76590. Object.defineProperty(exports, "__esModule", {
  76591. value: true
  76592. });
  76593. var _promise;
  76594. function _load_promise() {
  76595. return _promise = _interopRequireDefault(__webpack_require__(7));
  76596. }
  76597. var _map;
  76598. function _load_map() {
  76599. return _map = _interopRequireDefault(__webpack_require__(42));
  76600. }
  76601. var _set;
  76602. function _load_set() {
  76603. return _set = _interopRequireDefault(__webpack_require__(16));
  76604. }
  76605. var _asyncToGenerator2;
  76606. function _load_asyncToGenerator() {
  76607. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  76608. }
  76609. var _getIterator2;
  76610. function _load_getIterator() {
  76611. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  76612. }
  76613. var _classCallCheck2;
  76614. function _load_classCallCheck() {
  76615. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  76616. }
  76617. var _config;
  76618. function _load_config() {
  76619. return _config = _interopRequireDefault(__webpack_require__(150));
  76620. }
  76621. var _executeLifecycleScript;
  76622. function _load_executeLifecycleScript() {
  76623. return _executeLifecycleScript = _interopRequireDefault(__webpack_require__(100));
  76624. }
  76625. var _crypto;
  76626. function _load_crypto() {
  76627. return _crypto = _interopRequireWildcard(__webpack_require__(158));
  76628. }
  76629. var _fs;
  76630. function _load_fs() {
  76631. return _fs = _interopRequireWildcard(__webpack_require__(8));
  76632. }
  76633. var _packageNameUtils;
  76634. function _load_packageNameUtils() {
  76635. return _packageNameUtils = __webpack_require__(208);
  76636. }
  76637. var _pack;
  76638. function _load_pack() {
  76639. return _pack = __webpack_require__(155);
  76640. }
  76641. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  76642. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  76643. var fs = __webpack_require__(12);
  76644. var invariant = __webpack_require__(15);
  76645. var path = __webpack_require__(1);
  76646. var INSTALL_STAGES = ['preinstall', 'install', 'postinstall'];
  76647. var PackageInstallScripts = function () {
  76648. function PackageInstallScripts(config, resolver, force) {
  76649. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageInstallScripts);
  76650. this.installed = 0;
  76651. this.resolver = resolver;
  76652. this.reporter = config.reporter;
  76653. this.config = config;
  76654. this.force = force;
  76655. this.artifacts = {};
  76656. }
  76657. PackageInstallScripts.prototype.setForce = function setForce(force) {
  76658. this.force = force;
  76659. };
  76660. PackageInstallScripts.prototype.setArtifacts = function setArtifacts(artifacts) {
  76661. this.artifacts = artifacts;
  76662. };
  76663. PackageInstallScripts.prototype.getArtifacts = function getArtifacts() {
  76664. return this.artifacts;
  76665. };
  76666. PackageInstallScripts.prototype.getInstallCommands = function getInstallCommands(pkg) {
  76667. var scripts = pkg.scripts;
  76668. if (scripts) {
  76669. var cmds = [];
  76670. for (var _iterator = INSTALL_STAGES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  76671. var _ref;
  76672. if (_isArray) {
  76673. if (_i >= _iterator.length) break;
  76674. _ref = _iterator[_i++];
  76675. } else {
  76676. _i = _iterator.next();
  76677. if (_i.done) break;
  76678. _ref = _i.value;
  76679. }
  76680. var stage = _ref;
  76681. var cmd = scripts[stage];
  76682. if (cmd) {
  76683. cmds.push([stage, cmd]);
  76684. }
  76685. }
  76686. return cmds;
  76687. } else {
  76688. return [];
  76689. }
  76690. };
  76691. PackageInstallScripts.prototype.walk = function () {
  76692. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
  76693. var files = yield (_fs || _load_fs()).walk(loc, null, new (_set || _load_set()).default(this.config.registryFolders));
  76694. var mtimes = new (_map || _load_map()).default();
  76695. for (var _iterator2 = files, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  76696. var _ref3;
  76697. if (_isArray2) {
  76698. if (_i2 >= _iterator2.length) break;
  76699. _ref3 = _iterator2[_i2++];
  76700. } else {
  76701. _i2 = _iterator2.next();
  76702. if (_i2.done) break;
  76703. _ref3 = _i2.value;
  76704. }
  76705. var file = _ref3;
  76706. mtimes.set(file.relative, file.mtime);
  76707. }
  76708. return mtimes;
  76709. });
  76710. function walk(_x) {
  76711. return _ref2.apply(this, arguments);
  76712. }
  76713. return walk;
  76714. }();
  76715. PackageInstallScripts.prototype.saveBuildArtifacts = function () {
  76716. var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc, pkg, beforeFiles, spinner) {
  76717. var afterFiles = yield this.walk(loc);
  76718. // work out what files have been created/modified
  76719. var buildArtifacts = [];
  76720. for (var _iterator3 = afterFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  76721. var _ref6;
  76722. if (_isArray3) {
  76723. if (_i3 >= _iterator3.length) break;
  76724. _ref6 = _iterator3[_i3++];
  76725. } else {
  76726. _i3 = _iterator3.next();
  76727. if (_i3.done) break;
  76728. _ref6 = _i3.value;
  76729. }
  76730. var _ref5 = _ref6;
  76731. var file = _ref5[0];
  76732. var mtime = _ref5[1];
  76733. if (!beforeFiles.has(file) || beforeFiles.get(file) !== mtime) {
  76734. buildArtifacts.push(file);
  76735. }
  76736. }
  76737. if (!buildArtifacts.length) {
  76738. // nothing else to do here since we have no build artifacts
  76739. return;
  76740. }
  76741. // set build artifacts
  76742. var ref = pkg._reference;
  76743. invariant(ref, 'expected reference');
  76744. this.artifacts[`${pkg.name}@${pkg.version}`] = buildArtifacts;
  76745. });
  76746. function saveBuildArtifacts(_x2, _x3, _x4, _x5) {
  76747. return _ref4.apply(this, arguments);
  76748. }
  76749. return saveBuildArtifacts;
  76750. }();
  76751. PackageInstallScripts.prototype.install = function () {
  76752. var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cmds, pkg, spinner) {
  76753. var _this = this;
  76754. var ref = pkg._reference;
  76755. invariant(ref, 'expected reference');
  76756. var locs = ref.locations;
  76757. var updateProgress = void 0;
  76758. if (cmds.length > 0) {
  76759. updateProgress = function updateProgress(data) {
  76760. var dataStr = data.toString() // turn buffer into string
  76761. .trim(); // trim whitespace
  76762. invariant(spinner && spinner.tick, 'We should have spinner and its ticker here');
  76763. if (dataStr) {
  76764. spinner.tick(dataStr
  76765. // Only get the last line
  76766. .substr(dataStr.lastIndexOf('\n') + 1)
  76767. // change tabs to spaces as they can interfere with the console
  76768. .replace(/\t/g, ' '));
  76769. }
  76770. };
  76771. }
  76772. try {
  76773. var _loop = function* _loop(stage, cmd) {
  76774. yield (_promise || _load_promise()).default.all(locs.map(function () {
  76775. var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
  76776. var _ref11 = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).default)({
  76777. stage,
  76778. config: _this.config,
  76779. cwd: loc,
  76780. cmd,
  76781. isInteractive: false,
  76782. updateProgress
  76783. }),
  76784. stdout = _ref11.stdout;
  76785. _this.reporter.verbose(stdout);
  76786. });
  76787. return function (_x9) {
  76788. return _ref10.apply(this, arguments);
  76789. };
  76790. }()));
  76791. };
  76792. for (var _iterator4 = cmds, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  76793. var _ref9;
  76794. if (_isArray4) {
  76795. if (_i4 >= _iterator4.length) break;
  76796. _ref9 = _iterator4[_i4++];
  76797. } else {
  76798. _i4 = _iterator4.next();
  76799. if (_i4.done) break;
  76800. _ref9 = _i4.value;
  76801. }
  76802. var _ref8 = _ref9;
  76803. var stage = _ref8[0];
  76804. var cmd = _ref8[1];
  76805. yield* _loop(stage, cmd);
  76806. }
  76807. } catch (err) {
  76808. err.message = `${locs.join(', ')}: ${err.message}`;
  76809. invariant(ref, 'expected reference');
  76810. if (ref.optional) {
  76811. ref.ignore = true;
  76812. ref.incompatible = true;
  76813. this.reporter.warn(this.reporter.lang('optionalModuleScriptFail', err.message));
  76814. this.reporter.info(this.reporter.lang('optionalModuleFail'));
  76815. // Cleanup node_modules
  76816. try {
  76817. yield (_promise || _load_promise()).default.all(locs.map(function () {
  76818. var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
  76819. yield (_fs || _load_fs()).unlink(loc);
  76820. });
  76821. return function (_x10) {
  76822. return _ref12.apply(this, arguments);
  76823. };
  76824. }()));
  76825. } catch (e) {
  76826. this.reporter.error(this.reporter.lang('optionalModuleCleanupFail', e.message));
  76827. }
  76828. } else {
  76829. throw err;
  76830. }
  76831. }
  76832. });
  76833. function install(_x6, _x7, _x8) {
  76834. return _ref7.apply(this, arguments);
  76835. }
  76836. return install;
  76837. }();
  76838. PackageInstallScripts.prototype.packageCanBeInstalled = function packageCanBeInstalled(pkg) {
  76839. var cmds = this.getInstallCommands(pkg);
  76840. if (!cmds.length) {
  76841. return false;
  76842. }
  76843. if (this.config.packBuiltPackages && pkg.prebuiltVariants) {
  76844. for (var variant in pkg.prebuiltVariants) {
  76845. if (pkg._remote && pkg._remote.reference && pkg._remote.reference.indexOf(variant) !== -1) {
  76846. return false;
  76847. }
  76848. }
  76849. }
  76850. var ref = pkg._reference;
  76851. invariant(ref, 'Missing package reference');
  76852. if (!ref.fresh && !this.force) {
  76853. // this package hasn't been touched
  76854. return false;
  76855. }
  76856. // Don't run lifecycle scripts for hoisted packages
  76857. if (!ref.locations.length) {
  76858. return false;
  76859. }
  76860. // we haven't actually written this module out
  76861. if (ref.ignore) {
  76862. return false;
  76863. }
  76864. return true;
  76865. };
  76866. PackageInstallScripts.prototype.runCommand = function () {
  76867. var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (spinner, pkg) {
  76868. var cmds = this.getInstallCommands(pkg);
  76869. spinner.setPrefix(++this.installed, pkg.name);
  76870. yield this.install(cmds, pkg, spinner);
  76871. });
  76872. function runCommand(_x11, _x12) {
  76873. return _ref13.apply(this, arguments);
  76874. }
  76875. return runCommand;
  76876. }();
  76877. // detect if there is a circularDependency in the dependency tree
  76878. PackageInstallScripts.prototype.detectCircularDependencies = function detectCircularDependencies(root, seenManifests, pkg) {
  76879. var ref = pkg._reference;
  76880. invariant(ref, 'expected reference');
  76881. var deps = ref.dependencies;
  76882. for (var _iterator5 = deps, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  76883. var _ref14;
  76884. if (_isArray5) {
  76885. if (_i5 >= _iterator5.length) break;
  76886. _ref14 = _iterator5[_i5++];
  76887. } else {
  76888. _i5 = _iterator5.next();
  76889. if (_i5.done) break;
  76890. _ref14 = _i5.value;
  76891. }
  76892. var dep = _ref14;
  76893. var pkgDep = this.resolver.getStrictResolvedPattern(dep);
  76894. if (seenManifests.has(pkgDep)) {
  76895. // there is a cycle but not with the root
  76896. continue;
  76897. }
  76898. seenManifests.add(pkgDep);
  76899. // found a dependency pointing to root
  76900. if (pkgDep == root) {
  76901. return true;
  76902. }
  76903. if (this.detectCircularDependencies(root, seenManifests, pkgDep)) {
  76904. return true;
  76905. }
  76906. }
  76907. return false;
  76908. };
  76909. // find the next package to be installed
  76910. PackageInstallScripts.prototype.findInstallablePackage = function findInstallablePackage(workQueue, installed) {
  76911. for (var _iterator6 = workQueue, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  76912. var _ref15;
  76913. if (_isArray6) {
  76914. if (_i6 >= _iterator6.length) break;
  76915. _ref15 = _iterator6[_i6++];
  76916. } else {
  76917. _i6 = _iterator6.next();
  76918. if (_i6.done) break;
  76919. _ref15 = _i6.value;
  76920. }
  76921. var pkg = _ref15;
  76922. var ref = pkg._reference;
  76923. invariant(ref, 'expected reference');
  76924. var deps = ref.dependencies;
  76925. var dependenciesFulfilled = true;
  76926. for (var _iterator7 = deps, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  76927. var _ref16;
  76928. if (_isArray7) {
  76929. if (_i7 >= _iterator7.length) break;
  76930. _ref16 = _iterator7[_i7++];
  76931. } else {
  76932. _i7 = _iterator7.next();
  76933. if (_i7.done) break;
  76934. _ref16 = _i7.value;
  76935. }
  76936. var dep = _ref16;
  76937. var pkgDep = this.resolver.getStrictResolvedPattern(dep);
  76938. if (!installed.has(pkgDep)) {
  76939. dependenciesFulfilled = false;
  76940. break;
  76941. }
  76942. }
  76943. // all dependencies are installed
  76944. if (dependenciesFulfilled) {
  76945. return pkg;
  76946. }
  76947. // detect circular dependency, mark this pkg as installable to break the circle
  76948. if (this.detectCircularDependencies(pkg, new (_set || _load_set()).default(), pkg)) {
  76949. return pkg;
  76950. }
  76951. }
  76952. return null;
  76953. };
  76954. PackageInstallScripts.prototype.worker = function () {
  76955. var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (spinner, workQueue, installed, waitQueue) {
  76956. while (workQueue.size > 0) {
  76957. // find a installable package
  76958. var pkg = this.findInstallablePackage(workQueue, installed);
  76959. // can't find a package to install, register into waitQueue
  76960. if (pkg == null) {
  76961. spinner.clear();
  76962. yield new (_promise || _load_promise()).default(function (resolve) {
  76963. return waitQueue.add(resolve);
  76964. });
  76965. continue;
  76966. }
  76967. // found a package to install
  76968. workQueue.delete(pkg);
  76969. if (this.packageCanBeInstalled(pkg)) {
  76970. yield this.runCommand(spinner, pkg);
  76971. }
  76972. installed.add(pkg);
  76973. for (var _iterator8 = waitQueue, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
  76974. var _ref18;
  76975. if (_isArray8) {
  76976. if (_i8 >= _iterator8.length) break;
  76977. _ref18 = _iterator8[_i8++];
  76978. } else {
  76979. _i8 = _iterator8.next();
  76980. if (_i8.done) break;
  76981. _ref18 = _i8.value;
  76982. }
  76983. var workerResolve = _ref18;
  76984. workerResolve();
  76985. }
  76986. waitQueue.clear();
  76987. }
  76988. });
  76989. function worker(_x13, _x14, _x15, _x16) {
  76990. return _ref17.apply(this, arguments);
  76991. }
  76992. return worker;
  76993. }();
  76994. PackageInstallScripts.prototype.init = function () {
  76995. var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (seedPatterns) {
  76996. var _this2 = this;
  76997. var workQueue = new (_set || _load_set()).default();
  76998. var installed = new (_set || _load_set()).default();
  76999. var pkgs = this.resolver.getTopologicalManifests(seedPatterns);
  77000. var installablePkgs = 0;
  77001. // A map to keep track of what files exist before installation
  77002. var beforeFilesMap = new (_map || _load_map()).default();
  77003. for (var _iterator9 = pkgs, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
  77004. var _ref20;
  77005. if (_isArray9) {
  77006. if (_i9 >= _iterator9.length) break;
  77007. _ref20 = _iterator9[_i9++];
  77008. } else {
  77009. _i9 = _iterator9.next();
  77010. if (_i9.done) break;
  77011. _ref20 = _i9.value;
  77012. }
  77013. var pkg = _ref20;
  77014. if (this.packageCanBeInstalled(pkg)) {
  77015. var ref = pkg._reference;
  77016. invariant(ref, 'expected reference');
  77017. yield (_promise || _load_promise()).default.all(ref.locations.map(function () {
  77018. var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
  77019. beforeFilesMap.set(loc, (yield _this2.walk(loc)));
  77020. installablePkgs += 1;
  77021. });
  77022. return function (_x21) {
  77023. return _ref25.apply(this, arguments);
  77024. };
  77025. }()));
  77026. }
  77027. workQueue.add(pkg);
  77028. }
  77029. var set = this.reporter.activitySet(installablePkgs, Math.min(installablePkgs, this.config.childConcurrency));
  77030. // waitQueue acts like a semaphore to allow workers to register to be notified
  77031. // when there are more work added to the work queue
  77032. var waitQueue = new (_set || _load_set()).default();
  77033. yield (_promise || _load_promise()).default.all(set.spinners.map(function (spinner) {
  77034. return _this2.worker(spinner, workQueue, installed, waitQueue);
  77035. }));
  77036. // generate built package as prebuilt one for offline mirror
  77037. var offlineMirrorPath = this.config.getOfflineMirrorPath();
  77038. if (this.config.packBuiltPackages && offlineMirrorPath) {
  77039. var _loop2 = function* _loop2(_pkg) {
  77040. if (_this2.packageCanBeInstalled(_pkg)) {
  77041. var prebuiltPath = path.join(offlineMirrorPath, 'prebuilt');
  77042. yield (_fs || _load_fs()).mkdirp(prebuiltPath);
  77043. var prebuiltFilename = (0, (_packageNameUtils || _load_packageNameUtils()).getPlatformSpecificPackageFilename)(_pkg);
  77044. prebuiltPath = path.join(prebuiltPath, prebuiltFilename + '.tgz');
  77045. var ref = _pkg._reference;
  77046. invariant(ref, 'expected reference');
  77047. var builtPackagePaths = ref.locations;
  77048. yield (_promise || _load_promise()).default.all(builtPackagePaths.map(function () {
  77049. var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (builtPackagePath) {
  77050. // don't use pack command, we want to avoid the file filters logic
  77051. var stream = yield (0, (_pack || _load_pack()).packWithIgnoreAndHeaders)(builtPackagePath);
  77052. var hash = yield new (_promise || _load_promise()).default(function (resolve, reject) {
  77053. var validateStream = new (_crypto || _load_crypto()).HashStream();
  77054. stream.pipe(validateStream).pipe(fs.createWriteStream(prebuiltPath)).on('error', reject).on('close', function () {
  77055. return resolve(validateStream.getHash());
  77056. });
  77057. });
  77058. _pkg.prebuiltVariants = _pkg.prebuiltVariants || {};
  77059. _pkg.prebuiltVariants[prebuiltFilename] = hash;
  77060. });
  77061. return function (_x18) {
  77062. return _ref22.apply(this, arguments);
  77063. };
  77064. }()));
  77065. }
  77066. };
  77067. for (var _iterator10 = pkgs, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
  77068. var _ref21;
  77069. if (_isArray10) {
  77070. if (_i10 >= _iterator10.length) break;
  77071. _ref21 = _iterator10[_i10++];
  77072. } else {
  77073. _i10 = _iterator10.next();
  77074. if (_i10.done) break;
  77075. _ref21 = _i10.value;
  77076. }
  77077. var _pkg = _ref21;
  77078. yield* _loop2(_pkg);
  77079. }
  77080. } else {
  77081. var _loop3 = function* _loop3(_pkg2) {
  77082. if (_this2.packageCanBeInstalled(_pkg2)) {
  77083. var ref = _pkg2._reference;
  77084. invariant(ref, 'expected reference');
  77085. var beforeFiles = ref.locations.map(function (loc) {
  77086. return beforeFilesMap.get(loc);
  77087. });
  77088. yield (_promise || _load_promise()).default.all(beforeFiles.map(function () {
  77089. var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (b, index) {
  77090. invariant(b, 'files before installation should always be recorded');
  77091. yield _this2.saveBuildArtifacts(ref.locations[index], _pkg2, b, set.spinners[0]);
  77092. });
  77093. return function (_x19, _x20) {
  77094. return _ref24.apply(this, arguments);
  77095. };
  77096. }()));
  77097. }
  77098. };
  77099. // cache all build artifacts
  77100. for (var _iterator11 = pkgs, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
  77101. var _ref23;
  77102. if (_isArray11) {
  77103. if (_i11 >= _iterator11.length) break;
  77104. _ref23 = _iterator11[_i11++];
  77105. } else {
  77106. _i11 = _iterator11.next();
  77107. if (_i11.done) break;
  77108. _ref23 = _i11.value;
  77109. }
  77110. var _pkg2 = _ref23;
  77111. yield* _loop3(_pkg2);
  77112. }
  77113. }
  77114. set.end();
  77115. });
  77116. function init(_x17) {
  77117. return _ref19.apply(this, arguments);
  77118. }
  77119. return init;
  77120. }();
  77121. return PackageInstallScripts;
  77122. }();
  77123. exports.default = PackageInstallScripts;
  77124. /***/ }),
  77125. /* 514 */
  77126. /***/ (function(module, exports, __webpack_require__) {
  77127. "use strict";
  77128. Object.defineProperty(exports, "__esModule", {
  77129. value: true
  77130. });
  77131. var _getIterator2;
  77132. function _load_getIterator() {
  77133. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  77134. }
  77135. var _asyncToGenerator2;
  77136. function _load_asyncToGenerator() {
  77137. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  77138. }
  77139. var _extends2;
  77140. function _load_extends() {
  77141. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  77142. }
  77143. var _promise;
  77144. function _load_promise() {
  77145. return _promise = _interopRequireDefault(__webpack_require__(7));
  77146. }
  77147. var _keys;
  77148. function _load_keys() {
  77149. return _keys = _interopRequireDefault(__webpack_require__(14));
  77150. }
  77151. var _classCallCheck2;
  77152. function _load_classCallCheck() {
  77153. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  77154. }
  77155. var _misc;
  77156. function _load_misc() {
  77157. return _misc = __webpack_require__(28);
  77158. }
  77159. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  77160. var objectPath = __webpack_require__(244);
  77161. var path = __webpack_require__(1);
  77162. var BaseRegistry = function () {
  77163. function BaseRegistry(cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles) {
  77164. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseRegistry);
  77165. this.reporter = reporter;
  77166. this.requestManager = requestManager;
  77167. this.registries = registries;
  77168. this.config = {};
  77169. this.folder = '';
  77170. this.token = '';
  77171. this.loc = '';
  77172. this.cwd = cwd;
  77173. this.enableDefaultRc = enableDefaultRc;
  77174. this.extraneousRcFiles = extraneousRcFiles;
  77175. }
  77176. // the filename to use for package metadata
  77177. //
  77178. //
  77179. //
  77180. //
  77181. //
  77182. //
  77183. //
  77184. //
  77185. // absolute folder name to insert modules
  77186. // relative folder name to put these modules
  77187. BaseRegistry.prototype.setToken = function setToken(token) {
  77188. this.token = token;
  77189. };
  77190. BaseRegistry.prototype.setOtp = function setOtp(otp) {
  77191. this.otp = otp;
  77192. };
  77193. BaseRegistry.prototype.getOption = function getOption(key) {
  77194. return this.config[key];
  77195. };
  77196. BaseRegistry.prototype.getAvailableRegistries = function getAvailableRegistries() {
  77197. var config = this.config;
  77198. return (0, (_keys || _load_keys()).default)(config).reduce(function (registries, option) {
  77199. if (option === 'registry' || option.split(':')[1] === 'registry') {
  77200. registries.push(config[option]);
  77201. }
  77202. return registries;
  77203. }, []);
  77204. };
  77205. BaseRegistry.prototype.loadConfig = function loadConfig() {
  77206. return (_promise || _load_promise()).default.resolve();
  77207. };
  77208. BaseRegistry.prototype.checkOutdated = function checkOutdated(config, name, range) {
  77209. return (_promise || _load_promise()).default.reject(new Error('unimplemented'));
  77210. };
  77211. BaseRegistry.prototype.saveHomeConfig = function saveHomeConfig(config) {
  77212. return (_promise || _load_promise()).default.reject(new Error('unimplemented'));
  77213. };
  77214. BaseRegistry.prototype.request = function request(pathname) {
  77215. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  77216. return this.requestManager.request((0, (_extends2 || _load_extends()).default)({
  77217. url: pathname
  77218. }, opts));
  77219. };
  77220. BaseRegistry.prototype.init = function () {
  77221. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  77222. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  77223. this.mergeEnv('yarn_');
  77224. yield this.loadConfig();
  77225. for (var _iterator = (0, (_keys || _load_keys()).default)(overrides), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  77226. var _ref2;
  77227. if (_isArray) {
  77228. if (_i >= _iterator.length) break;
  77229. _ref2 = _iterator[_i++];
  77230. } else {
  77231. _i = _iterator.next();
  77232. if (_i.done) break;
  77233. _ref2 = _i.value;
  77234. }
  77235. var override = _ref2;
  77236. var val = overrides[override];
  77237. if (val !== undefined) {
  77238. this.config[override] = val;
  77239. }
  77240. }
  77241. this.loc = path.join(this.cwd, this.folder);
  77242. });
  77243. function init() {
  77244. return _ref.apply(this, arguments);
  77245. }
  77246. return init;
  77247. }();
  77248. BaseRegistry.normalizeConfig = function normalizeConfig(config) {
  77249. for (var key in config) {
  77250. config[key] = BaseRegistry.normalizeConfigOption(config[key]);
  77251. }
  77252. return config;
  77253. };
  77254. BaseRegistry.normalizeConfigOption = function normalizeConfigOption(val) {
  77255. if (val === 'true') {
  77256. return true;
  77257. } else if (val === 'false') {
  77258. return false;
  77259. } else {
  77260. return val;
  77261. }
  77262. };
  77263. BaseRegistry.prototype.mergeEnv = function mergeEnv(prefix) {
  77264. // try environment variables
  77265. for (var envKey in process.env) {
  77266. var key = envKey.toLowerCase();
  77267. // only accept keys prefixed with the prefix
  77268. if (key.indexOf(prefix.toLowerCase()) !== 0) {
  77269. continue;
  77270. }
  77271. var val = BaseRegistry.normalizeConfigOption(process.env[envKey]);
  77272. // remove config prefix
  77273. key = (0, (_misc || _load_misc()).removePrefix)(key, prefix.toLowerCase());
  77274. // replace dunders with dots
  77275. key = key.replace(/__/g, '.');
  77276. // replace underscores with dashes ignoring keys that start with an underscore
  77277. key = key.replace(/([^_])_/g, '$1-');
  77278. // set it via a path
  77279. objectPath.set(this.config, key, val);
  77280. }
  77281. };
  77282. return BaseRegistry;
  77283. }();
  77284. exports.default = BaseRegistry;
  77285. /***/ }),
  77286. /* 515 */
  77287. /***/ (function(module, exports, __webpack_require__) {
  77288. "use strict";
  77289. Object.defineProperty(exports, "__esModule", {
  77290. value: true
  77291. });
  77292. exports.DEFAULTS = undefined;
  77293. var _getIterator2;
  77294. function _load_getIterator() {
  77295. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  77296. }
  77297. var _assign;
  77298. function _load_assign() {
  77299. return _assign = _interopRequireDefault(__webpack_require__(23));
  77300. }
  77301. var _asyncToGenerator2;
  77302. function _load_asyncToGenerator() {
  77303. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  77304. }
  77305. var _classCallCheck2;
  77306. function _load_classCallCheck() {
  77307. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  77308. }
  77309. var _possibleConstructorReturn2;
  77310. function _load_possibleConstructorReturn() {
  77311. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  77312. }
  77313. var _inherits2;
  77314. function _load_inherits() {
  77315. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  77316. }
  77317. var _constants;
  77318. function _load_constants() {
  77319. return _constants = __webpack_require__(13);
  77320. }
  77321. var _npmRegistry;
  77322. function _load_npmRegistry() {
  77323. return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
  77324. }
  77325. var _lockfile;
  77326. function _load_lockfile() {
  77327. return _lockfile = __webpack_require__(25);
  77328. }
  77329. var _fs;
  77330. function _load_fs() {
  77331. return _fs = _interopRequireWildcard(__webpack_require__(8));
  77332. }
  77333. var _yarnVersion;
  77334. function _load_yarnVersion() {
  77335. return _yarnVersion = __webpack_require__(96);
  77336. }
  77337. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  77338. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  77339. var userHome = __webpack_require__(101).default;
  77340. var path = __webpack_require__(1);
  77341. var DEFAULTS = exports.DEFAULTS = {
  77342. 'version-tag-prefix': 'v',
  77343. 'version-git-tag': true,
  77344. 'version-commit-hooks': true,
  77345. 'version-git-sign': false,
  77346. 'version-git-message': 'v%s',
  77347. 'init-version': '1.0.0',
  77348. 'init-license': 'MIT',
  77349. 'save-prefix': '^',
  77350. 'bin-links': true,
  77351. 'ignore-scripts': false,
  77352. 'ignore-optional': false,
  77353. registry: (_constants || _load_constants()).YARN_REGISTRY,
  77354. 'strict-ssl': true,
  77355. 'user-agent': [`yarn/${(_yarnVersion || _load_yarnVersion()).version}`, 'npm/?', `node/${process.version}`, process.platform, process.arch].join(' ')
  77356. };
  77357. var RELATIVE_KEYS = ['yarn-offline-mirror', 'cache-folder', 'global-folder', 'offline-cache-folder', 'yarn-path'];
  77358. var FOLDER_KEY = ['yarn-offline-mirror', 'cache-folder', 'global-folder', 'offline-cache-folder'];
  77359. var npmMap = {
  77360. 'version-git-sign': 'sign-git-tag',
  77361. 'version-tag-prefix': 'tag-version-prefix',
  77362. 'version-git-tag': 'git-tag-version',
  77363. 'version-commit-hooks': 'commit-hooks',
  77364. 'version-git-message': 'message'
  77365. };
  77366. var YarnRegistry = function (_NpmRegistry) {
  77367. (0, (_inherits2 || _load_inherits()).default)(YarnRegistry, _NpmRegistry);
  77368. function YarnRegistry(cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles) {
  77369. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, YarnRegistry);
  77370. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _NpmRegistry.call(this, cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles));
  77371. _this.homeConfigLoc = path.join(userHome, '.yarnrc');
  77372. _this.homeConfig = {};
  77373. return _this;
  77374. }
  77375. YarnRegistry.prototype.getOption = function getOption(key) {
  77376. var val = this.config[key];
  77377. // if this isn't set in a yarn config, then use npm
  77378. if (typeof val === 'undefined') {
  77379. val = this.registries.npm.getOption(npmMap[key]);
  77380. }
  77381. if (typeof val === 'undefined') {
  77382. val = this.registries.npm.getOption(key);
  77383. }
  77384. // if this isn't set in a yarn config or npm config, then use the default (or undefined)
  77385. if (typeof val === 'undefined') {
  77386. val = DEFAULTS[key];
  77387. }
  77388. return val;
  77389. };
  77390. YarnRegistry.prototype.loadConfig = function () {
  77391. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  77392. var locations = yield this.getPossibleConfigLocations('yarnrc', this.reporter);
  77393. for (var _iterator = locations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  77394. var _ref3;
  77395. if (_isArray) {
  77396. if (_i >= _iterator.length) break;
  77397. _ref3 = _iterator[_i++];
  77398. } else {
  77399. _i = _iterator.next();
  77400. if (_i.done) break;
  77401. _ref3 = _i.value;
  77402. }
  77403. var _ref2 = _ref3;
  77404. var isHome = _ref2[0];
  77405. var loc = _ref2[1];
  77406. var file = _ref2[2];
  77407. var _parse = (0, (_lockfile || _load_lockfile()).parse)(file, loc),
  77408. config = _parse.object;
  77409. if (isHome) {
  77410. this.homeConfig = config;
  77411. }
  77412. for (var _iterator2 = RELATIVE_KEYS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  77413. var _ref4;
  77414. if (_isArray2) {
  77415. if (_i2 >= _iterator2.length) break;
  77416. _ref4 = _iterator2[_i2++];
  77417. } else {
  77418. _i2 = _iterator2.next();
  77419. if (_i2.done) break;
  77420. _ref4 = _i2.value;
  77421. }
  77422. var key = _ref4;
  77423. var valueLoc = config[key];
  77424. if (!this.config[key] && valueLoc) {
  77425. var resolvedLoc = config[key] = path.resolve(path.dirname(loc), valueLoc);
  77426. if (FOLDER_KEY.indexOf(key) !== -1) {
  77427. yield (_fs || _load_fs()).mkdirp(resolvedLoc);
  77428. }
  77429. }
  77430. }
  77431. // merge with any existing environment variables
  77432. var env = config.env;
  77433. if (env) {
  77434. var existingEnv = this.config.env;
  77435. if (existingEnv) {
  77436. this.config.env = (0, (_assign || _load_assign()).default)({}, env, existingEnv);
  77437. }
  77438. }
  77439. this.config = (0, (_assign || _load_assign()).default)({}, config, this.config);
  77440. }
  77441. // default yarn config
  77442. this.config = (0, (_assign || _load_assign()).default)({}, DEFAULTS, this.config);
  77443. });
  77444. function loadConfig() {
  77445. return _ref.apply(this, arguments);
  77446. }
  77447. return loadConfig;
  77448. }();
  77449. YarnRegistry.prototype.saveHomeConfig = function () {
  77450. var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
  77451. YarnRegistry.normalizeConfig(config);
  77452. for (var key in config) {
  77453. var val = config[key];
  77454. // if the current config key was taken from home config then update
  77455. // the global config
  77456. if (this.homeConfig[key] === this.config[key]) {
  77457. this.config[key] = val;
  77458. }
  77459. // update just the home config
  77460. this.homeConfig[key] = config[key];
  77461. }
  77462. yield (_fs || _load_fs()).writeFilePreservingEol(this.homeConfigLoc, `${(0, (_lockfile || _load_lockfile()).stringify)(this.homeConfig)}\n`);
  77463. });
  77464. function saveHomeConfig(_x) {
  77465. return _ref5.apply(this, arguments);
  77466. }
  77467. return saveHomeConfig;
  77468. }();
  77469. return YarnRegistry;
  77470. }((_npmRegistry || _load_npmRegistry()).default);
  77471. YarnRegistry.filename = 'yarn.json';
  77472. exports.default = YarnRegistry;
  77473. /***/ }),
  77474. /* 516 */
  77475. /***/ (function(module, exports, __webpack_require__) {
  77476. "use strict";
  77477. Object.defineProperty(exports, "__esModule", {
  77478. value: true
  77479. });
  77480. var _stringify;
  77481. function _load_stringify() {
  77482. return _stringify = _interopRequireDefault(__webpack_require__(37));
  77483. }
  77484. var _classCallCheck2;
  77485. function _load_classCallCheck() {
  77486. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  77487. }
  77488. var _possibleConstructorReturn2;
  77489. function _load_possibleConstructorReturn() {
  77490. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  77491. }
  77492. var _inherits2;
  77493. function _load_inherits() {
  77494. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  77495. }
  77496. var _jsonReporter;
  77497. function _load_jsonReporter() {
  77498. return _jsonReporter = _interopRequireDefault(__webpack_require__(200));
  77499. }
  77500. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  77501. var BufferReporter = function (_JSONReporter) {
  77502. (0, (_inherits2 || _load_inherits()).default)(BufferReporter, _JSONReporter);
  77503. function BufferReporter(opts) {
  77504. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BufferReporter);
  77505. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _JSONReporter.call(this, opts));
  77506. _this._buffer = [];
  77507. return _this;
  77508. }
  77509. BufferReporter.prototype._dump = function _dump(type, data, error) {
  77510. this._buffer.push({
  77511. type,
  77512. data,
  77513. error: !!error
  77514. });
  77515. };
  77516. BufferReporter.prototype.getBuffer = function getBuffer() {
  77517. return this._buffer;
  77518. };
  77519. BufferReporter.prototype.getBufferText = function getBufferText() {
  77520. return this._buffer.map(function (_ref) {
  77521. var data = _ref.data;
  77522. return typeof data === 'string' ? data : (0, (_stringify || _load_stringify()).default)(data);
  77523. }).join('');
  77524. };
  77525. BufferReporter.prototype.getBufferJson = function getBufferJson() {
  77526. return JSON.parse(this.getBufferText());
  77527. };
  77528. return BufferReporter;
  77529. }((_jsonReporter || _load_jsonReporter()).default);
  77530. exports.default = BufferReporter;
  77531. /***/ }),
  77532. /* 517 */
  77533. /***/ (function(module, exports, __webpack_require__) {
  77534. "use strict";
  77535. Object.defineProperty(exports, "__esModule", {
  77536. value: true
  77537. });
  77538. var _asyncToGenerator2;
  77539. function _load_asyncToGenerator() {
  77540. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  77541. }
  77542. var _promise;
  77543. function _load_promise() {
  77544. return _promise = _interopRequireDefault(__webpack_require__(7));
  77545. }
  77546. var _getIterator2;
  77547. function _load_getIterator() {
  77548. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  77549. }
  77550. var _set;
  77551. function _load_set() {
  77552. return _set = _interopRequireDefault(__webpack_require__(16));
  77553. }
  77554. var _classCallCheck2;
  77555. function _load_classCallCheck() {
  77556. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  77557. }
  77558. var _possibleConstructorReturn2;
  77559. function _load_possibleConstructorReturn() {
  77560. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  77561. }
  77562. var _inherits2;
  77563. function _load_inherits() {
  77564. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  77565. }
  77566. var _baseReporter;
  77567. function _load_baseReporter() {
  77568. return _baseReporter = _interopRequireDefault(__webpack_require__(98));
  77569. }
  77570. var _progressBar;
  77571. function _load_progressBar() {
  77572. return _progressBar = _interopRequireDefault(__webpack_require__(519));
  77573. }
  77574. var _spinnerProgress;
  77575. function _load_spinnerProgress() {
  77576. return _spinnerProgress = _interopRequireDefault(__webpack_require__(520));
  77577. }
  77578. var _util;
  77579. function _load_util() {
  77580. return _util = __webpack_require__(199);
  77581. }
  77582. var _misc;
  77583. function _load_misc() {
  77584. return _misc = __webpack_require__(28);
  77585. }
  77586. var _treeHelper;
  77587. function _load_treeHelper() {
  77588. return _treeHelper = __webpack_require__(518);
  77589. }
  77590. var _inquirer;
  77591. function _load_inquirer() {
  77592. return _inquirer = _interopRequireDefault(__webpack_require__(193));
  77593. }
  77594. var _cliTable;
  77595. function _load_cliTable() {
  77596. return _cliTable = _interopRequireDefault(__webpack_require__(568));
  77597. }
  77598. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  77599. var _require = __webpack_require__(9),
  77600. _inspect = _require.inspect;
  77601. var readline = __webpack_require__(187);
  77602. var chalk = __webpack_require__(33);
  77603. var stripAnsi = __webpack_require__(270);
  77604. var read = __webpack_require__(862);
  77605. var tty = __webpack_require__(149);
  77606. var AUDIT_COL_WIDTHS = [15, 62];
  77607. var auditSeverityColors = {
  77608. info: chalk.bold,
  77609. low: chalk.bold,
  77610. moderate: chalk.yellow,
  77611. high: chalk.red,
  77612. critical: chalk.bgRed
  77613. };
  77614. // fixes bold on windows
  77615. if (process.platform === 'win32' && !(process.env.TERM && /^xterm/i.test(process.env.TERM))) {
  77616. chalk.bold._styles[0].close += '\u001b[m';
  77617. }
  77618. var ConsoleReporter = function (_BaseReporter) {
  77619. (0, (_inherits2 || _load_inherits()).default)(ConsoleReporter, _BaseReporter);
  77620. function ConsoleReporter(opts) {
  77621. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ConsoleReporter);
  77622. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseReporter.call(this, opts));
  77623. _this._lastCategorySize = 0;
  77624. _this._spinners = new (_set || _load_set()).default();
  77625. _this.format = chalk;
  77626. _this.format.stripColor = stripAnsi;
  77627. _this.isSilent = !!opts.isSilent;
  77628. return _this;
  77629. }
  77630. ConsoleReporter.prototype._prependEmoji = function _prependEmoji(msg, emoji) {
  77631. if (this.emoji && emoji && this.isTTY) {
  77632. msg = `${emoji} ${msg}`;
  77633. }
  77634. return msg;
  77635. };
  77636. ConsoleReporter.prototype._logCategory = function _logCategory(category, color, msg) {
  77637. this._lastCategorySize = category.length;
  77638. this._log(`${this.format[color](category)} ${msg}`);
  77639. };
  77640. ConsoleReporter.prototype._verbose = function _verbose(msg) {
  77641. this._logCategory('verbose', 'grey', `${process.uptime()} ${msg}`);
  77642. };
  77643. ConsoleReporter.prototype._verboseInspect = function _verboseInspect(obj) {
  77644. this.inspect(obj);
  77645. };
  77646. ConsoleReporter.prototype.close = function close() {
  77647. for (var _iterator = this._spinners, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  77648. var _ref;
  77649. if (_isArray) {
  77650. if (_i >= _iterator.length) break;
  77651. _ref = _iterator[_i++];
  77652. } else {
  77653. _i = _iterator.next();
  77654. if (_i.done) break;
  77655. _ref = _i.value;
  77656. }
  77657. var spinner = _ref;
  77658. spinner.stop();
  77659. }
  77660. this._spinners.clear();
  77661. this.stopProgress();
  77662. _BaseReporter.prototype.close.call(this);
  77663. };
  77664. ConsoleReporter.prototype.table = function table(head, body) {
  77665. var _this2 = this;
  77666. //
  77667. head = head.map(function (field) {
  77668. return _this2.format.underline(field);
  77669. });
  77670. //
  77671. var rows = [head].concat(body);
  77672. // get column widths
  77673. var cols = [];
  77674. var _loop = function _loop(i) {
  77675. var widths = rows.map(function (row) {
  77676. return _this2.format.stripColor(row[i]).length;
  77677. });
  77678. cols[i] = Math.max.apply(Math, widths);
  77679. };
  77680. for (var i = 0; i < head.length; i++) {
  77681. _loop(i);
  77682. }
  77683. //
  77684. var builtRows = rows.map(function (row) {
  77685. for (var i = 0; i < row.length; i++) {
  77686. var field = row[i];
  77687. var padding = cols[i] - _this2.format.stripColor(field).length;
  77688. row[i] = field + ' '.repeat(padding);
  77689. }
  77690. return row.join(' ');
  77691. });
  77692. this.log(builtRows.join('\n'));
  77693. };
  77694. ConsoleReporter.prototype.step = function step(current, total, msg, emoji) {
  77695. msg = this._prependEmoji(msg, emoji);
  77696. if (msg.endsWith('?')) {
  77697. msg = `${(0, (_misc || _load_misc()).removeSuffix)(msg, '?')}...?`;
  77698. } else {
  77699. msg += '...';
  77700. }
  77701. this.log(`${this.format.dim(`[${current}/${total}]`)} ${msg}`);
  77702. };
  77703. ConsoleReporter.prototype.inspect = function inspect(value) {
  77704. if (typeof value !== 'number' && typeof value !== 'string') {
  77705. value = _inspect(value, {
  77706. breakLength: 0,
  77707. colors: this.isTTY,
  77708. depth: null,
  77709. maxArrayLength: null
  77710. });
  77711. }
  77712. this.log(String(value), { force: true });
  77713. };
  77714. ConsoleReporter.prototype.list = function list(key, items, hints) {
  77715. var gutterWidth = (this._lastCategorySize || 2) - 1;
  77716. if (hints) {
  77717. for (var _iterator2 = items, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  77718. var _ref2;
  77719. if (_isArray2) {
  77720. if (_i2 >= _iterator2.length) break;
  77721. _ref2 = _iterator2[_i2++];
  77722. } else {
  77723. _i2 = _iterator2.next();
  77724. if (_i2.done) break;
  77725. _ref2 = _i2.value;
  77726. }
  77727. var item = _ref2;
  77728. this._log(`${' '.repeat(gutterWidth)}- ${this.format.bold(item)}`);
  77729. this._log(` ${' '.repeat(gutterWidth)} ${hints[item]}`);
  77730. }
  77731. } else {
  77732. for (var _iterator3 = items, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  77733. var _ref3;
  77734. if (_isArray3) {
  77735. if (_i3 >= _iterator3.length) break;
  77736. _ref3 = _iterator3[_i3++];
  77737. } else {
  77738. _i3 = _iterator3.next();
  77739. if (_i3.done) break;
  77740. _ref3 = _i3.value;
  77741. }
  77742. var _item = _ref3;
  77743. this._log(`${' '.repeat(gutterWidth)}- ${_item}`);
  77744. }
  77745. }
  77746. };
  77747. ConsoleReporter.prototype.header = function header(command, pkg) {
  77748. this.log(this.format.bold(`${pkg.name} ${command} v${pkg.version}`));
  77749. };
  77750. ConsoleReporter.prototype.footer = function footer(showPeakMemory) {
  77751. this.stopProgress();
  77752. var totalTime = (this.getTotalTime() / 1000).toFixed(2);
  77753. var msg = `Done in ${totalTime}s.`;
  77754. if (showPeakMemory) {
  77755. var peakMemory = (this.peakMemory / 1024 / 1024).toFixed(2);
  77756. msg += ` Peak memory usage ${peakMemory}MB.`;
  77757. }
  77758. this.log(this._prependEmoji(msg, '✨'));
  77759. };
  77760. ConsoleReporter.prototype.log = function log(msg) {
  77761. var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  77762. _ref4$force = _ref4.force,
  77763. force = _ref4$force === undefined ? false : _ref4$force;
  77764. this._lastCategorySize = 0;
  77765. this._log(msg, { force });
  77766. };
  77767. ConsoleReporter.prototype._log = function _log(msg) {
  77768. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  77769. _ref5$force = _ref5.force,
  77770. force = _ref5$force === undefined ? false : _ref5$force;
  77771. if (this.isSilent && !force) {
  77772. return;
  77773. }
  77774. (0, (_util || _load_util()).clearLine)(this.stdout);
  77775. this.stdout.write(`${msg}\n`);
  77776. };
  77777. ConsoleReporter.prototype.success = function success(msg) {
  77778. this._logCategory('success', 'green', msg);
  77779. };
  77780. ConsoleReporter.prototype.error = function error(msg) {
  77781. (0, (_util || _load_util()).clearLine)(this.stderr);
  77782. this.stderr.write(`${this.format.red('error')} ${msg}\n`);
  77783. };
  77784. ConsoleReporter.prototype.info = function info(msg) {
  77785. this._logCategory('info', 'blue', msg);
  77786. };
  77787. ConsoleReporter.prototype.command = function command(_command) {
  77788. this.log(this.format.dim(`$ ${_command}`));
  77789. };
  77790. ConsoleReporter.prototype.warn = function warn(msg) {
  77791. (0, (_util || _load_util()).clearLine)(this.stderr);
  77792. this.stderr.write(`${this.format.yellow('warning')} ${msg}\n`);
  77793. };
  77794. ConsoleReporter.prototype.question = function question(_question) {
  77795. var _this3 = this;
  77796. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  77797. if (!process.stdout.isTTY) {
  77798. return (_promise || _load_promise()).default.reject(new Error("Can't answer a question unless a user TTY"));
  77799. }
  77800. return new (_promise || _load_promise()).default(function (resolve, reject) {
  77801. read({
  77802. prompt: `${_this3.format.dim('question')} ${_question}: `,
  77803. silent: !!options.password,
  77804. output: _this3.stdout,
  77805. input: _this3.stdin
  77806. }, function (err, answer) {
  77807. if (err) {
  77808. if (err.message === 'canceled') {
  77809. process.exitCode = 1;
  77810. }
  77811. reject(err);
  77812. } else {
  77813. if (!answer && options.required) {
  77814. _this3.error(_this3.lang('answerRequired'));
  77815. resolve(_this3.question(_question, options));
  77816. } else {
  77817. resolve(answer);
  77818. }
  77819. }
  77820. });
  77821. });
  77822. };
  77823. // handles basic tree output to console
  77824. ConsoleReporter.prototype.tree = function tree(key, trees) {
  77825. var _this4 = this;
  77826. var _ref6 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  77827. _ref6$force = _ref6.force,
  77828. force = _ref6$force === undefined ? false : _ref6$force;
  77829. this.stopProgress();
  77830. //
  77831. if (this.isSilent && !force) {
  77832. return;
  77833. }
  77834. var output = function output(_ref7, titlePrefix, childrenPrefix) {
  77835. var name = _ref7.name,
  77836. children = _ref7.children,
  77837. hint = _ref7.hint,
  77838. color = _ref7.color;
  77839. var formatter = _this4.format;
  77840. var out = (0, (_treeHelper || _load_treeHelper()).getFormattedOutput)({
  77841. prefix: titlePrefix,
  77842. hint,
  77843. color,
  77844. name,
  77845. formatter
  77846. });
  77847. _this4.stdout.write(out);
  77848. if (children && children.length) {
  77849. (0, (_treeHelper || _load_treeHelper()).recurseTree)((0, (_treeHelper || _load_treeHelper()).sortTrees)(children), childrenPrefix, output);
  77850. }
  77851. };
  77852. (0, (_treeHelper || _load_treeHelper()).recurseTree)((0, (_treeHelper || _load_treeHelper()).sortTrees)(trees), '', output);
  77853. };
  77854. ConsoleReporter.prototype.activitySet = function activitySet(total, workers) {
  77855. var _this5 = this;
  77856. if (!this.isTTY || this.noProgress) {
  77857. return _BaseReporter.prototype.activitySet.call(this, total, workers);
  77858. }
  77859. var spinners = [];
  77860. var reporterSpinners = this._spinners;
  77861. for (var i = 1; i < workers; i++) {
  77862. this.log('');
  77863. }
  77864. var _loop2 = function _loop2(_i4) {
  77865. var spinner = new (_spinnerProgress || _load_spinnerProgress()).default(_this5.stderr, _i4);
  77866. reporterSpinners.add(spinner);
  77867. spinner.start();
  77868. var prefix = null;
  77869. var current = 0;
  77870. var updatePrefix = function updatePrefix() {
  77871. spinner.setPrefix(`${_this5.format.dim(`[${current === 0 ? '-' : current}/${total}]`)} `);
  77872. };
  77873. var clear = function clear() {
  77874. prefix = null;
  77875. current = 0;
  77876. updatePrefix();
  77877. spinner.setText('waiting...');
  77878. };
  77879. clear();
  77880. spinners.unshift({
  77881. clear,
  77882. setPrefix(_current, _prefix) {
  77883. current = _current;
  77884. prefix = _prefix;
  77885. spinner.setText(prefix);
  77886. updatePrefix();
  77887. },
  77888. tick(msg) {
  77889. if (prefix) {
  77890. msg = `${prefix}: ${msg}`;
  77891. }
  77892. spinner.setText(msg);
  77893. },
  77894. end() {
  77895. spinner.stop();
  77896. reporterSpinners.delete(spinner);
  77897. }
  77898. });
  77899. };
  77900. for (var _i4 = 0; _i4 < workers; _i4++) {
  77901. _loop2(_i4);
  77902. }
  77903. return {
  77904. spinners,
  77905. end: function end() {
  77906. for (var _iterator4 = spinners, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  77907. var _ref8;
  77908. if (_isArray4) {
  77909. if (_i5 >= _iterator4.length) break;
  77910. _ref8 = _iterator4[_i5++];
  77911. } else {
  77912. _i5 = _iterator4.next();
  77913. if (_i5.done) break;
  77914. _ref8 = _i5.value;
  77915. }
  77916. var _spinner = _ref8;
  77917. _spinner.end();
  77918. }
  77919. readline.moveCursor(_this5.stdout, 0, -workers + 1);
  77920. }
  77921. };
  77922. };
  77923. ConsoleReporter.prototype.activity = function activity() {
  77924. if (!this.isTTY) {
  77925. return {
  77926. tick() {},
  77927. end() {}
  77928. };
  77929. }
  77930. var reporterSpinners = this._spinners;
  77931. var spinner = new (_spinnerProgress || _load_spinnerProgress()).default(this.stderr);
  77932. spinner.start();
  77933. reporterSpinners.add(spinner);
  77934. return {
  77935. tick(name) {
  77936. spinner.setText(name);
  77937. },
  77938. end() {
  77939. spinner.stop();
  77940. reporterSpinners.delete(spinner);
  77941. }
  77942. };
  77943. };
  77944. ConsoleReporter.prototype.select = function select(header, question, options) {
  77945. var _this6 = this;
  77946. if (!this.isTTY) {
  77947. return (_promise || _load_promise()).default.reject(new Error("Can't answer a question unless a user TTY"));
  77948. }
  77949. var rl = readline.createInterface({
  77950. input: this.stdin,
  77951. output: this.stdout,
  77952. terminal: true
  77953. });
  77954. var questions = options.map(function (opt) {
  77955. return opt.name;
  77956. });
  77957. var answers = options.map(function (opt) {
  77958. return opt.value;
  77959. });
  77960. function toIndex(input) {
  77961. var index = answers.indexOf(input);
  77962. if (index >= 0) {
  77963. return index;
  77964. } else {
  77965. return +input;
  77966. }
  77967. }
  77968. return new (_promise || _load_promise()).default(function (resolve) {
  77969. _this6.info(header);
  77970. for (var i = 0; i < questions.length; i++) {
  77971. _this6.log(` ${_this6.format.dim(`${i + 1})`)} ${questions[i]}`);
  77972. }
  77973. var ask = function ask() {
  77974. rl.question(`${question}: `, function (input) {
  77975. var index = toIndex(input);
  77976. if (isNaN(index)) {
  77977. _this6.log('Not a number');
  77978. ask();
  77979. return;
  77980. }
  77981. if (index <= 0 || index > options.length) {
  77982. _this6.log('Outside answer range');
  77983. ask();
  77984. return;
  77985. }
  77986. // get index
  77987. index--;
  77988. rl.close();
  77989. resolve(answers[index]);
  77990. });
  77991. };
  77992. ask();
  77993. });
  77994. };
  77995. ConsoleReporter.prototype.progress = function progress(count) {
  77996. var _this7 = this;
  77997. if (this.noProgress || count <= 0) {
  77998. return function () {
  77999. // noop
  78000. };
  78001. }
  78002. if (!this.isTTY) {
  78003. return function () {
  78004. // TODO what should the behaviour here be? we could buffer progress messages maybe
  78005. };
  78006. }
  78007. // Clear any potentially old progress bars
  78008. this.stopProgress();
  78009. var bar = this._progressBar = new (_progressBar || _load_progressBar()).default(count, this.stderr, function (progress) {
  78010. if (progress === _this7._progressBar) {
  78011. _this7._progressBar = null;
  78012. }
  78013. });
  78014. bar.render();
  78015. return function () {
  78016. bar.tick();
  78017. };
  78018. };
  78019. ConsoleReporter.prototype.stopProgress = function stopProgress() {
  78020. if (this._progressBar) {
  78021. this._progressBar.stop();
  78022. }
  78023. };
  78024. ConsoleReporter.prototype.prompt = function () {
  78025. var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (message, choices) {
  78026. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  78027. if (!process.stdout.isTTY) {
  78028. return (_promise || _load_promise()).default.reject(new Error("Can't answer a question unless a user TTY"));
  78029. }
  78030. var pageSize = void 0;
  78031. if (process.stdout instanceof tty.WriteStream) {
  78032. pageSize = process.stdout.rows - 2;
  78033. }
  78034. var rl = readline.createInterface({
  78035. input: this.stdin,
  78036. output: this.stdout,
  78037. terminal: true
  78038. });
  78039. // $FlowFixMe: Need to update the type of Inquirer
  78040. var prompt = (_inquirer || _load_inquirer()).default.createPromptModule({
  78041. input: this.stdin,
  78042. output: this.stdout
  78043. });
  78044. var _options$name = options.name,
  78045. name = _options$name === undefined ? 'prompt' : _options$name,
  78046. _options$type = options.type,
  78047. type = _options$type === undefined ? 'input' : _options$type,
  78048. validate = options.validate;
  78049. var answers = yield prompt([{ name, type, message, choices, pageSize, validate }]);
  78050. rl.close();
  78051. return answers[name];
  78052. });
  78053. function prompt(_x5, _x6) {
  78054. return _ref9.apply(this, arguments);
  78055. }
  78056. return prompt;
  78057. }();
  78058. ConsoleReporter.prototype.auditSummary = function auditSummary(auditMetadata) {
  78059. var totalDependencies = auditMetadata.totalDependencies,
  78060. vulnerabilities = auditMetadata.vulnerabilities;
  78061. var totalVulnerabilities = vulnerabilities.info + vulnerabilities.low + vulnerabilities.moderate + vulnerabilities.high + vulnerabilities.critical;
  78062. var summary = this.lang('auditSummary', totalVulnerabilities > 0 ? this.rawText(chalk.red(totalVulnerabilities.toString())) : totalVulnerabilities, totalDependencies);
  78063. this._log(summary);
  78064. if (totalVulnerabilities) {
  78065. var severities = [];
  78066. if (vulnerabilities.info) {
  78067. severities.push(this.lang('auditInfo', vulnerabilities.info));
  78068. }
  78069. if (vulnerabilities.low) {
  78070. severities.push(this.lang('auditLow', vulnerabilities.low));
  78071. }
  78072. if (vulnerabilities.moderate) {
  78073. severities.push(this.lang('auditModerate', vulnerabilities.moderate));
  78074. }
  78075. if (vulnerabilities.high) {
  78076. severities.push(this.lang('auditHigh', vulnerabilities.high));
  78077. }
  78078. if (vulnerabilities.critical) {
  78079. severities.push(this.lang('auditCritical', vulnerabilities.critical));
  78080. }
  78081. this._log(`${this.lang('auditSummarySeverity')} ${severities.join(' | ')}`);
  78082. }
  78083. };
  78084. ConsoleReporter.prototype.auditAction = function auditAction(recommendation) {
  78085. var label = recommendation.action.resolves.length === 1 ? 'vulnerability' : 'vulnerabilities';
  78086. this._log(this.lang('auditResolveCommand', this.rawText(chalk.inverse(recommendation.cmd)), recommendation.action.resolves.length, this.rawText(label)));
  78087. if (recommendation.isBreaking) {
  78088. this._log(this.lang('auditSemverMajorChange'));
  78089. }
  78090. };
  78091. ConsoleReporter.prototype.auditManualReview = function auditManualReview() {
  78092. var tableOptions = {
  78093. colWidths: [78]
  78094. };
  78095. var table = new (_cliTable || _load_cliTable()).default(tableOptions);
  78096. table.push([{
  78097. content: this.lang('auditManualReview'),
  78098. vAlign: 'center',
  78099. hAlign: 'center'
  78100. }]);
  78101. this._log(table.toString());
  78102. };
  78103. ConsoleReporter.prototype.auditAdvisory = function auditAdvisory(resolution, _auditAdvisory) {
  78104. function colorSeverity(severity, message) {
  78105. return auditSeverityColors[severity](message || severity);
  78106. }
  78107. function makeAdvisoryTableRow(patchedIn) {
  78108. var patchRows = [];
  78109. if (patchedIn) {
  78110. patchRows.push({ 'Patched in': patchedIn });
  78111. }
  78112. return [{ [chalk.bold(colorSeverity(_auditAdvisory.severity))]: chalk.bold(_auditAdvisory.title) }, { Package: _auditAdvisory.module_name }].concat(patchRows, [{ 'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}` }, { Path: resolution.path.split('>').join(' > ') }, { 'More info': `https://www.npmjs.com/advisories/${_auditAdvisory.id}` }]);
  78113. }
  78114. var tableOptions = {
  78115. colWidths: AUDIT_COL_WIDTHS,
  78116. wordWrap: true
  78117. };
  78118. var table = new (_cliTable || _load_cliTable()).default(tableOptions);
  78119. var patchedIn = _auditAdvisory.patched_versions.replace(' ', '') === '<0.0.0' ? 'No patch available' : _auditAdvisory.patched_versions;
  78120. table.push.apply(table, makeAdvisoryTableRow(patchedIn));
  78121. this._log(table.toString());
  78122. };
  78123. return ConsoleReporter;
  78124. }((_baseReporter || _load_baseReporter()).default);
  78125. exports.default = ConsoleReporter;
  78126. /***/ }),
  78127. /* 518 */
  78128. /***/ (function(module, exports, __webpack_require__) {
  78129. "use strict";
  78130. Object.defineProperty(exports, "__esModule", {
  78131. value: true
  78132. });
  78133. exports.sortTrees = sortTrees;
  78134. exports.recurseTree = recurseTree;
  78135. exports.getFormattedOutput = getFormattedOutput;
  78136. // public
  78137. // types
  78138. function sortTrees(trees) {
  78139. return trees.sort(function (tree1, tree2) {
  78140. return tree1.name.localeCompare(tree2.name);
  78141. });
  78142. }
  78143. function recurseTree(tree, prefix, recurseFunc) {
  78144. var treeLen = tree.length;
  78145. var treeEnd = treeLen - 1;
  78146. for (var i = 0; i < treeLen; i++) {
  78147. var atEnd = i === treeEnd;
  78148. recurseFunc(tree[i], prefix + getLastIndentChar(atEnd), prefix + getNextIndentChar(atEnd));
  78149. }
  78150. }
  78151. function getFormattedOutput(fmt) {
  78152. var item = formatColor(fmt.color, fmt.name, fmt.formatter);
  78153. var suffix = getSuffix(fmt.hint, fmt.formatter);
  78154. return `${fmt.prefix}─ ${item}${suffix}\n`;
  78155. }
  78156. function getNextIndentChar(end) {
  78157. return end ? ' ' : '│ ';
  78158. }
  78159. function getLastIndentChar(end) {
  78160. return end ? '└' : '├';
  78161. }
  78162. function getSuffix(hint, formatter) {
  78163. return hint ? ` (${formatter.grey(hint)})` : '';
  78164. }
  78165. function formatColor(color, strToFormat, formatter) {
  78166. return color ? formatter[color](strToFormat) : strToFormat;
  78167. }
  78168. /***/ }),
  78169. /* 519 */
  78170. /***/ (function(module, exports, __webpack_require__) {
  78171. "use strict";
  78172. Object.defineProperty(exports, "__esModule", {
  78173. value: true
  78174. });
  78175. var _classCallCheck2;
  78176. function _load_classCallCheck() {
  78177. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  78178. }
  78179. var _util;
  78180. function _load_util() {
  78181. return _util = __webpack_require__(199);
  78182. }
  78183. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  78184. var ProgressBar = function () {
  78185. function ProgressBar(total) {
  78186. var stdout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.stderr;
  78187. var callback = arguments[2];
  78188. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ProgressBar);
  78189. this.stdout = stdout;
  78190. this.total = total;
  78191. this.chars = ProgressBar.bars[0];
  78192. this.delay = 60;
  78193. this.curr = 0;
  78194. this._callback = callback;
  78195. (0, (_util || _load_util()).clearLine)(stdout);
  78196. }
  78197. ProgressBar.prototype.tick = function tick() {
  78198. var _this = this;
  78199. if (this.curr >= this.total) {
  78200. return;
  78201. }
  78202. this.curr++;
  78203. // schedule render
  78204. if (!this.id) {
  78205. this.id = setTimeout(function () {
  78206. return _this.render();
  78207. }, this.delay);
  78208. }
  78209. };
  78210. ProgressBar.prototype.cancelTick = function cancelTick() {
  78211. if (this.id) {
  78212. clearTimeout(this.id);
  78213. this.id = null;
  78214. }
  78215. };
  78216. ProgressBar.prototype.stop = function stop() {
  78217. // "stop" by setting current to end so `tick` becomes noop
  78218. this.curr = this.total;
  78219. this.cancelTick();
  78220. (0, (_util || _load_util()).clearLine)(this.stdout);
  78221. if (this._callback) {
  78222. this._callback(this);
  78223. }
  78224. };
  78225. ProgressBar.prototype.render = function render() {
  78226. // clear throttle
  78227. this.cancelTick();
  78228. var ratio = this.curr / this.total;
  78229. ratio = Math.min(Math.max(ratio, 0), 1);
  78230. // progress without bar
  78231. var bar = ` ${this.curr}/${this.total}`;
  78232. // calculate size of actual bar
  78233. // $FlowFixMe: investigate process.stderr.columns flow error
  78234. var availableSpace = Math.max(0, this.stdout.columns - bar.length - 3);
  78235. var width = Math.min(this.total, availableSpace);
  78236. var completeLength = Math.round(width * ratio);
  78237. var complete = this.chars[0].repeat(completeLength);
  78238. var incomplete = this.chars[1].repeat(width - completeLength);
  78239. bar = `[${complete}${incomplete}]${bar}`;
  78240. (0, (_util || _load_util()).toStartOfLine)(this.stdout);
  78241. this.stdout.write(bar);
  78242. };
  78243. return ProgressBar;
  78244. }();
  78245. ProgressBar.bars = [['#', '-']];
  78246. exports.default = ProgressBar;
  78247. /***/ }),
  78248. /* 520 */
  78249. /***/ (function(module, exports, __webpack_require__) {
  78250. "use strict";
  78251. Object.defineProperty(exports, "__esModule", {
  78252. value: true
  78253. });
  78254. var _classCallCheck2;
  78255. function _load_classCallCheck() {
  78256. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  78257. }
  78258. var _util;
  78259. function _load_util() {
  78260. return _util = __webpack_require__(199);
  78261. }
  78262. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  78263. var Spinner = function () {
  78264. function Spinner() {
  78265. var stdout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : process.stderr;
  78266. var lineNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  78267. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Spinner);
  78268. this.current = 0;
  78269. this.prefix = '';
  78270. this.lineNumber = lineNumber;
  78271. this.stdout = stdout;
  78272. this.delay = 60;
  78273. this.chars = Spinner.spinners[28].split('');
  78274. this.text = '';
  78275. this.id = null;
  78276. }
  78277. Spinner.prototype.setPrefix = function setPrefix(prefix) {
  78278. this.prefix = prefix;
  78279. };
  78280. Spinner.prototype.setText = function setText(text) {
  78281. this.text = text;
  78282. };
  78283. Spinner.prototype.start = function start() {
  78284. this.current = 0;
  78285. this.render();
  78286. };
  78287. Spinner.prototype.render = function render() {
  78288. var _this = this;
  78289. if (this.id) {
  78290. clearTimeout(this.id);
  78291. }
  78292. // build line ensuring we don't wrap to the next line
  78293. var msg = `${this.prefix}${this.chars[this.current]} ${this.text}`;
  78294. var columns = typeof this.stdout.columns === 'number' ? this.stdout.columns : 100;
  78295. msg = msg.slice(0, columns);
  78296. (0, (_util || _load_util()).writeOnNthLine)(this.stdout, this.lineNumber, msg);
  78297. this.current = ++this.current % this.chars.length;
  78298. this.id = setTimeout(function () {
  78299. return _this.render();
  78300. }, this.delay);
  78301. };
  78302. Spinner.prototype.stop = function stop() {
  78303. if (this.id) {
  78304. clearTimeout(this.id);
  78305. this.id = null;
  78306. }
  78307. (0, (_util || _load_util()).clearNthLine)(this.stdout, this.lineNumber);
  78308. };
  78309. return Spinner;
  78310. }();
  78311. Spinner.spinners = ['|/-\\', '⠂-–—–-', '◐◓◑◒', '◴◷◶◵', '◰◳◲◱', '▖▘▝▗', '■□▪▫', '▌▀▐▄', '▉▊▋▌▍▎▏▎▍▌▋▊▉', '▁▃▄▅▆▇█▇▆▅▄▃', '←↖↑↗→↘↓↙', '┤┘┴└├┌┬┐', '◢◣◤◥', '.oO°Oo.', '.oO@*', '🌍🌎🌏', '◡◡ ⊙⊙ ◠◠', '☱☲☴', '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', '⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓', '⠄⠆⠇⠋⠙⠸⠰⠠⠰⠸⠙⠋⠇⠆', '⠋⠙⠚⠒⠂⠂⠒⠲⠴⠦⠖⠒⠐⠐⠒⠓⠋', '⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁', '⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈', '⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈', '⢄⢂⢁⡁⡈⡐⡠', '⢹⢺⢼⣸⣇⡧⡗⡏', '⣾⣽⣻⢿⡿⣟⣯⣷', '⠁⠂⠄⡀⢀⠠⠐⠈'];
  78312. exports.default = Spinner;
  78313. /***/ }),
  78314. /* 521 */
  78315. /***/ (function(module, exports, __webpack_require__) {
  78316. "use strict";
  78317. Object.defineProperty(exports, "__esModule", {
  78318. value: true
  78319. });
  78320. var _assign;
  78321. function _load_assign() {
  78322. return _assign = _interopRequireDefault(__webpack_require__(23));
  78323. }
  78324. var _classCallCheck2;
  78325. function _load_classCallCheck() {
  78326. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  78327. }
  78328. var _possibleConstructorReturn2;
  78329. function _load_possibleConstructorReturn() {
  78330. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  78331. }
  78332. var _inherits2;
  78333. function _load_inherits() {
  78334. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  78335. }
  78336. var _jsonReporter;
  78337. function _load_jsonReporter() {
  78338. return _jsonReporter = _interopRequireDefault(__webpack_require__(200));
  78339. }
  78340. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  78341. var _require = __webpack_require__(95),
  78342. EventEmitter = _require.EventEmitter;
  78343. var EventReporter = function (_JSONReporter) {
  78344. (0, (_inherits2 || _load_inherits()).default)(EventReporter, _JSONReporter);
  78345. function EventReporter(opts) {
  78346. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, EventReporter);
  78347. // $FlowFixMe: looks like a flow bug
  78348. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _JSONReporter.call(this, opts));
  78349. EventEmitter.call(_this);
  78350. return _this;
  78351. }
  78352. EventReporter.prototype._dump = function _dump(type, data) {
  78353. this.emit(type, data);
  78354. };
  78355. return EventReporter;
  78356. }((_jsonReporter || _load_jsonReporter()).default);
  78357. exports.default = EventReporter;
  78358. (0, (_assign || _load_assign()).default)(EventReporter.prototype, EventEmitter.prototype);
  78359. /***/ }),
  78360. /* 522 */
  78361. /***/ (function(module, exports, __webpack_require__) {
  78362. "use strict";
  78363. Object.defineProperty(exports, "__esModule", {
  78364. value: true
  78365. });
  78366. function formatFunction() {
  78367. for (var _len = arguments.length, strs = Array(_len), _key = 0; _key < _len; _key++) {
  78368. strs[_key] = arguments[_key];
  78369. }
  78370. return strs.join(' ');
  78371. }
  78372. var defaultFormatter = exports.defaultFormatter = {
  78373. bold: formatFunction,
  78374. dim: formatFunction,
  78375. italic: formatFunction,
  78376. underline: formatFunction,
  78377. inverse: formatFunction,
  78378. strikethrough: formatFunction,
  78379. black: formatFunction,
  78380. red: formatFunction,
  78381. green: formatFunction,
  78382. yellow: formatFunction,
  78383. blue: formatFunction,
  78384. magenta: formatFunction,
  78385. cyan: formatFunction,
  78386. white: formatFunction,
  78387. gray: formatFunction,
  78388. grey: formatFunction,
  78389. stripColor: formatFunction
  78390. };
  78391. /***/ }),
  78392. /* 523 */
  78393. /***/ (function(module, exports, __webpack_require__) {
  78394. "use strict";
  78395. Object.defineProperty(exports, "__esModule", {
  78396. value: true
  78397. });
  78398. /* eslint max-len: 0 */
  78399. var messages = {
  78400. upToDate: 'Already up-to-date.',
  78401. folderInSync: 'Folder in sync.',
  78402. nothingToInstall: 'Nothing to install.',
  78403. resolvingPackages: 'Resolving packages',
  78404. checkingManifest: 'Validating package.json',
  78405. fetchingPackages: 'Fetching packages',
  78406. linkingDependencies: 'Linking dependencies',
  78407. rebuildingPackages: 'Rebuilding all packages',
  78408. buildingFreshPackages: 'Building fresh packages',
  78409. cleaningModules: 'Cleaning modules',
  78410. bumpingVersion: 'Bumping version',
  78411. savingHar: 'Saving HAR file: $0',
  78412. answer: 'Answer?',
  78413. usage: 'Usage',
  78414. installCommandRenamed: '`install` has been replaced with `add` to add new dependencies. Run $0 instead.',
  78415. globalFlagRemoved: '`--global` has been deprecated. Please run $0 instead.',
  78416. waitingInstance: 'Waiting for the other yarn instance to finish (pid $0, inside $1)',
  78417. waitingNamedInstance: 'Waiting for the other yarn instance to finish ($0)',
  78418. offlineRetrying: 'There appears to be trouble with your network connection. Retrying...',
  78419. internalServerErrorRetrying: 'There appears to be trouble with the npm registry (returned $1). Retrying...',
  78420. clearedCache: 'Cleared cache.',
  78421. couldntClearPackageFromCache: "Couldn't clear package $0 from cache",
  78422. clearedPackageFromCache: 'Cleared package $0 from cache',
  78423. packWroteTarball: 'Wrote tarball to $0.',
  78424. invalidBinField: 'Invalid bin field for $0.',
  78425. invalidBinEntry: 'Invalid bin entry for $1 (in $0).',
  78426. helpExamples: ' Examples:\n$0\n',
  78427. helpCommands: ' Commands:\n$0\n',
  78428. helpCommandsMore: ' Run `$0` for more information on specific commands.',
  78429. helpLearnMore: ' Visit $0 to learn more about Yarn.\n',
  78430. manifestPotentialTypo: 'Potential typo $0, did you mean $1?',
  78431. manifestBuiltinModule: '$0 is also the name of a node core module',
  78432. manifestNameDot: "Name can't start with a dot",
  78433. manifestNameIllegalChars: 'Name contains illegal characters',
  78434. manifestNameBlacklisted: 'Name is blacklisted',
  78435. manifestLicenseInvalid: 'License should be a valid SPDX license expression',
  78436. manifestLicenseNone: 'No license field',
  78437. manifestStringExpected: '$0 is not a string',
  78438. manifestDependencyCollision: '$0 has dependency $1 with range $2 that collides with a dependency in $3 of the same name with version $4',
  78439. manifestDirectoryNotFound: 'Unable to read $0 directory of module $1',
  78440. verboseFileCopy: 'Copying $0 to $1.',
  78441. verboseFileLink: 'Creating hardlink at $0 to $1.',
  78442. verboseFileSymlink: 'Creating symlink at $0 to $1.',
  78443. verboseFileSkip: 'Skipping copying of file $0 as the file at $1 is the same size ($2) and mtime ($3).',
  78444. verboseFileSkipSymlink: 'Skipping copying of $0 as the file at $1 is the same symlink ($2).',
  78445. verboseFileSkipHardlink: 'Skipping copying of $0 as the file at $1 is the same hardlink ($2).',
  78446. verboseFileRemoveExtraneous: 'Removing extraneous file $0.',
  78447. verboseFilePhantomExtraneous: "File $0 would be marked as extraneous but has been removed as it's listed as a phantom file.",
  78448. verboseFileSkipArtifact: 'Skipping copying of $0 as the file is marked as a built artifact and subject to change.',
  78449. verboseFileFolder: 'Creating directory $0.',
  78450. verboseRequestStart: 'Performing $0 request to $1.',
  78451. verboseRequestFinish: 'Request $0 finished with status code $1.',
  78452. configSet: 'Set $0 to $1.',
  78453. configDelete: 'Deleted $0.',
  78454. configNpm: 'npm config',
  78455. configYarn: 'yarn config',
  78456. couldntFindPackagejson: "Couldn't find a package.json file in $0",
  78457. couldntFindMatch: "Couldn't find match for $0 in $1 for $2.",
  78458. couldntFindPackageInCache: "Couldn't find any versions for $0 that matches $1 in our cache (possible versions are $2). This is usually caused by a missing entry in the lockfile, running Yarn without the --offline flag may help fix this issue.",
  78459. couldntFindVersionThatMatchesRange: "Couldn't find any versions for $0 that matches $1",
  78460. chooseVersionFromList: 'Please choose a version of $0 from this list:',
  78461. moduleNotInManifest: "This module isn't specified in a package.json file.",
  78462. moduleAlreadyInManifest: '$0 is already in $1. Please remove existing entry first before adding it to $2.',
  78463. unknownFolderOrTarball: "Passed folder/tarball doesn't exist,",
  78464. unknownPackage: "Couldn't find package $0.",
  78465. unknownPackageName: "Couldn't find package name.",
  78466. unknownUser: "Couldn't find user $0.",
  78467. unknownRegistryResolver: 'Unknown registry resolver $0',
  78468. userNotAnOwner: "User $0 isn't an owner of this package.",
  78469. invalidVersionArgument: 'Use the $0 flag to create a new version.',
  78470. invalidVersion: 'Invalid version supplied.',
  78471. requiredVersionInRange: 'Required version in range.',
  78472. packageNotFoundRegistry: "Couldn't find package $0 on the $1 registry.",
  78473. requiredPackageNotFoundRegistry: "Couldn't find package $0 required by $1 on the $2 registry.",
  78474. doesntExist: "Package $1 refers to a non-existing file '$0'.",
  78475. missingRequiredPackageKey: `Package $0 doesn't have a $1.`,
  78476. invalidAccess: 'Invalid argument for access, expected public or restricted.',
  78477. invalidCommand: 'Invalid subcommand. Try $0',
  78478. invalidGistFragment: 'Invalid gist fragment $0.',
  78479. invalidHostedGitFragment: 'Invalid hosted git fragment $0.',
  78480. invalidFragment: 'Invalid fragment $0.',
  78481. invalidPackageName: 'Invalid package name.',
  78482. invalidPackageVersion: "Can't add $0: invalid package version $1.",
  78483. couldntFindManifestIn: "Couldn't find manifest in $0.",
  78484. shrinkwrapWarning: 'npm-shrinkwrap.json found. This will not be updated or respected. See https://yarnpkg.com/en/docs/migrating-from-npm for more information.',
  78485. npmLockfileWarning: 'package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.',
  78486. lockfileOutdated: 'Outdated lockfile. Please run `yarn install` and try again.',
  78487. lockfileMerged: 'Merge conflict detected in yarn.lock and successfully merged.',
  78488. lockfileConflict: 'A merge conflict was found in yarn.lock but it could not be successfully merged, regenerating yarn.lock from scratch.',
  78489. ignoredScripts: 'Ignored scripts due to flag.',
  78490. missingAddDependencies: 'Missing list of packages to add to your project.',
  78491. yesWarning: 'The yes flag has been set. This will automatically answer yes to all questions, which may have security implications.',
  78492. networkWarning: "You don't appear to have an internet connection. Try the --offline flag to use the cache for registry queries.",
  78493. flatGlobalError: 'The package $0 requires a flat dependency graph. Add `"flat": true` to your package.json and try again.',
  78494. noName: `Package doesn't have a name.`,
  78495. noVersion: `Package doesn't have a version.`,
  78496. answerRequired: 'An answer is required.',
  78497. missingWhyDependency: 'Missing package name, folder or path to file to identify why a package has been installed',
  78498. bugReport: 'If you think this is a bug, please open a bug report with the information provided in $0.',
  78499. unexpectedError: 'An unexpected error occurred: $0.',
  78500. jsonError: 'Error parsing JSON at $0, $1.',
  78501. noPermission: 'Cannot create $0 due to insufficient permissions.',
  78502. noGlobalFolder: 'Cannot find a suitable global folder. Tried these: $0',
  78503. allDependenciesUpToDate: 'All of your dependencies are up to date.',
  78504. legendColorsForVersionUpdates: 'Color legend : \n $0 : Major Update backward-incompatible updates \n $1 : Minor Update backward-compatible features \n $2 : Patch Update backward-compatible bug fixes',
  78505. frozenLockfileError: 'Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.',
  78506. fileWriteError: 'Could not write file $0: $1',
  78507. multiplePackagesCantUnpackInSameDestination: 'Pattern $0 is trying to unpack in the same destination $1 as pattern $2. This could result in non-deterministic behavior, skipping.',
  78508. incorrectLockfileEntry: 'Lockfile has incorrect entry for $0. Ignoring it.',
  78509. invalidResolutionName: 'Resolution field $0 does not end with a valid package name and will be ignored',
  78510. invalidResolutionVersion: 'Resolution field $0 has an invalid version entry and may be ignored',
  78511. incompatibleResolutionVersion: 'Resolution field $0 is incompatible with requested version $1',
  78512. yarnOutdated: "Your current version of Yarn is out of date. The latest version is $0, while you're on $1.",
  78513. yarnOutdatedInstaller: 'To upgrade, download the latest installer at $0.',
  78514. yarnOutdatedCommand: 'To upgrade, run the following command:',
  78515. tooManyArguments: 'Too many arguments, maximum of $0.',
  78516. tooFewArguments: 'Not enough arguments, expected at least $0.',
  78517. noArguments: "This command doesn't require any arguments.",
  78518. ownerRemoving: 'Removing owner $0 from package $1.',
  78519. ownerRemoved: 'Owner removed.',
  78520. ownerRemoveError: "Couldn't remove owner.",
  78521. ownerGetting: 'Getting owners for package $0',
  78522. ownerGettingFailed: "Couldn't get list of owners.",
  78523. ownerAlready: 'This user is already an owner of this package.',
  78524. ownerAdded: 'Added owner.',
  78525. ownerAdding: 'Adding owner $0 to package $1',
  78526. ownerAddingFailed: "Couldn't add owner.",
  78527. ownerNone: 'No owners.',
  78528. teamCreating: 'Creating team',
  78529. teamRemoving: 'Removing team',
  78530. teamAddingUser: 'Adding user to team',
  78531. teamRemovingUser: 'Removing user from team',
  78532. teamListing: 'Listing teams',
  78533. cleaning: 'Cleaning modules',
  78534. cleanCreatingFile: 'Creating $0',
  78535. cleanCreatedFile: 'Created $0. Please review the contents of this file then run "yarn autoclean --force" to perform a clean.',
  78536. cleanAlreadyExists: '$0 already exists. To revert to the default file, delete $0 then rerun this command.',
  78537. cleanRequiresForce: 'This command required the "--force" flag to perform the clean. This is a destructive operation. Files specified in $0 will be deleted.',
  78538. cleanDoesNotExist: '$0 does not exist. Autoclean will delete files specified by $0. Run "autoclean --init" to create $0 with the default entries.',
  78539. binLinkCollision: "There's already a linked binary called $0 in your global Yarn bin. Could not link this package's $0 bin entry.",
  78540. linkCollision: "There's already a package called $0 registered. This command has had no effect. If this command was run in another folder with the same name, the other folder is still linked. Please run yarn unlink in the other folder if you want to register this folder.",
  78541. linkMissing: 'No registered package found called $0.',
  78542. linkRegistered: 'Registered $0.',
  78543. linkRegisteredMessage: 'You can now run `yarn link $0` in the projects where you want to use this package and it will be used instead.',
  78544. linkUnregistered: 'Unregistered $0.',
  78545. linkUnregisteredMessage: 'You can now run `yarn unlink $0` in the projects where you no longer want to use this package.',
  78546. linkUsing: 'Using linked package for $0.',
  78547. linkDisusing: 'Removed linked package $0.',
  78548. linkDisusingMessage: 'You will need to run `yarn install --force` to re-install the package that was linked.',
  78549. linkTargetMissing: 'The target of linked package $0 is missing. Removing link.',
  78550. createInvalidBin: 'Invalid bin entry found in package $0.',
  78551. createMissingPackage: 'Package not found - this is probably an internal error, and should be reported at https://github.com/yarnpkg/yarn/issues.',
  78552. workspacesAddRootCheck: 'Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).',
  78553. workspacesRemoveRootCheck: 'Running this command will remove the dependency from the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).',
  78554. workspacesFocusRootCheck: 'This command can only be run inside an individual workspace.',
  78555. workspacesRequirePrivateProjects: 'Workspaces can only be enabled in private projects.',
  78556. workspacesSettingMustBeArray: 'The workspaces field in package.json must be an array.',
  78557. workspacesDisabled: 'Your project root defines workspaces but the feature is disabled in your Yarn config. Please check "workspaces-experimental" in your .yarnrc file.',
  78558. workspacesNohoistRequirePrivatePackages: 'nohoist config is ignored in $0 because it is not a private package. If you think nohoist should be allowed in public packages, please submit an issue for your use case.',
  78559. workspacesNohoistDisabled: `$0 defines nohoist but the feature is disabled in your Yarn config ("workspaces-nohoist-experimental" in .yarnrc file)`,
  78560. workspaceRootNotFound: "Cannot find the root of your workspace - are you sure you're currently in a workspace?",
  78561. workspaceMissingWorkspace: 'Missing workspace name.',
  78562. workspaceMissingCommand: 'Missing command name.',
  78563. workspaceUnknownWorkspace: 'Unknown workspace $0.',
  78564. workspaceVersionMandatory: 'Missing version in workspace at $0, ignoring.',
  78565. workspaceNameMandatory: 'Missing name in workspace at $0, ignoring.',
  78566. workspaceNameDuplicate: 'There are more than one workspace with name $0',
  78567. cacheFolderSkipped: 'Skipping preferred cache folder $0 because it is not writable.',
  78568. cacheFolderMissing: "Yarn hasn't been able to find a cache folder it can use. Please use the explicit --cache-folder option to tell it what location to use, or make one of the preferred locations writable.",
  78569. cacheFolderSelected: 'Selected the next writable cache folder in the list, will be $0.',
  78570. execMissingCommand: 'Missing command name.',
  78571. noScriptsAvailable: 'There are no scripts specified inside package.json.',
  78572. noBinAvailable: 'There are no binary scripts available.',
  78573. dashDashDeprecation: `From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts.`,
  78574. commandNotSpecified: 'No command specified.',
  78575. binCommands: 'Commands available from binary scripts: ',
  78576. possibleCommands: 'Project commands',
  78577. commandQuestion: 'Which command would you like to run?',
  78578. commandFailedWithCode: 'Command failed with exit code $0.',
  78579. commandFailedWithSignal: 'Command failed with signal $0.',
  78580. packageRequiresNodeGyp: 'This package requires node-gyp, which is not currently installed. Yarn will attempt to automatically install it. If this fails, you can run "yarn global add node-gyp" to manually install it.',
  78581. nodeGypAutoInstallFailed: 'Failed to auto-install node-gyp. Please run "yarn global add node-gyp" manually. Error: $0',
  78582. foundIncompatible: 'Found incompatible module.',
  78583. incompatibleEngine: 'The engine $0 is incompatible with this module. Expected version $1. Got $2',
  78584. incompatibleCPU: 'The CPU architecture $0 is incompatible with this module.',
  78585. incompatibleOS: 'The platform $0 is incompatible with this module.',
  78586. invalidEngine: 'The engine $0 appears to be invalid.',
  78587. cannotRunWithIncompatibleEnv: 'Commands cannot run with an incompatible environment.',
  78588. optionalCompatibilityExcluded: '$0 is an optional dependency and failed compatibility check. Excluding it from installation.',
  78589. optionalModuleFail: 'This module is OPTIONAL, you can safely ignore this error',
  78590. optionalModuleScriptFail: 'Error running install script for optional dependency: $0',
  78591. optionalModuleCleanupFail: 'Could not cleanup build artifacts from failed install: $0',
  78592. unmetPeer: '$0 has unmet peer dependency $1.',
  78593. incorrectPeer: '$0 has incorrect peer dependency $1.',
  78594. selectedPeer: 'Selecting $1 at level $2 as the peer dependency of $0.',
  78595. missingBundledDependency: '$0 is missing a bundled dependency $1. This should be reported to the package maintainer.',
  78596. savedNewDependency: 'Saved 1 new dependency.',
  78597. savedNewDependencies: 'Saved $0 new dependencies.',
  78598. directDependencies: 'Direct dependencies',
  78599. allDependencies: 'All dependencies',
  78600. foundWarnings: 'Found $0 warnings.',
  78601. foundErrors: 'Found $0 errors.',
  78602. savedLockfile: 'Saved lockfile.',
  78603. noRequiredLockfile: 'No lockfile in this directory. Run `yarn install` to generate one.',
  78604. noLockfileFound: 'No lockfile found.',
  78605. invalidSemver: 'Invalid semver version',
  78606. newVersion: 'New version',
  78607. currentVersion: 'Current version',
  78608. noVersionOnPublish: 'Proceeding with current version',
  78609. manualVersionResolution: 'Unable to find a suitable version for $0, please choose one by typing one of the numbers below:',
  78610. manualVersionResolutionOption: '$0 which resolved to $1',
  78611. createdTag: 'Created tag.',
  78612. createdTagFail: "Couldn't add tag.",
  78613. deletedTag: 'Deleted tag.',
  78614. deletedTagFail: "Couldn't delete tag.",
  78615. gettingTags: 'Getting tags',
  78616. deletingTags: 'Deleting tag',
  78617. creatingTag: 'Creating tag $0 = $1',
  78618. whyStart: 'Why do we have the module $0?',
  78619. whyFinding: 'Finding dependency',
  78620. whyCalculating: 'Calculating file sizes',
  78621. whyUnknownMatch: "We couldn't find a match!",
  78622. whyInitGraph: 'Initialising dependency graph',
  78623. whyWhoKnows: "We don't know why this module exists",
  78624. whyDiskSizeWithout: 'Disk size without dependencies: $0',
  78625. whyDiskSizeUnique: 'Disk size with unique dependencies: $0',
  78626. whyDiskSizeTransitive: 'Disk size with transitive dependencies: $0',
  78627. whySharedDependencies: 'Number of shared dependencies: $0',
  78628. whyHoistedTo: `Has been hoisted to $0`,
  78629. whyHoistedFromSimple: `This module exists because it's hoisted from $0.`,
  78630. whyNotHoistedSimple: `This module exists here because it's in the nohoist list $0.`,
  78631. whyDependedOnSimple: `This module exists because $0 depends on it.`,
  78632. whySpecifiedSimple: `This module exists because it's specified in $0.`,
  78633. whyReasons: 'Reasons this module exists',
  78634. whyHoistedFrom: 'Hoisted from $0',
  78635. whyNotHoisted: `in the nohoist list $0`,
  78636. whyDependedOn: '$0 depends on it',
  78637. whySpecified: `Specified in $0`,
  78638. whyMatch: `\r=> Found $0`,
  78639. uninstalledPackages: 'Uninstalled packages.',
  78640. uninstallRegenerate: 'Regenerating lockfile and installing missing dependencies',
  78641. cleanRemovedFiles: 'Removed $0 files',
  78642. cleanSavedSize: 'Saved $0 MB.',
  78643. configFileFound: 'Found configuration file $0.',
  78644. configPossibleFile: 'Checking for configuration file $0.',
  78645. npmUsername: 'npm username',
  78646. npmPassword: 'npm password',
  78647. npmEmail: 'npm email',
  78648. npmOneTimePassword: 'npm one-time password',
  78649. loggingIn: 'Logging in',
  78650. loggedIn: 'Logged in.',
  78651. notRevokingEnvToken: 'Not revoking login token, specified via environment variable.',
  78652. notRevokingConfigToken: 'Not revoking login token, specified via config file.',
  78653. noTokenToRevoke: 'No login token to revoke.',
  78654. revokingToken: 'Revoking token',
  78655. revokedToken: 'Revoked login token.',
  78656. loginAsPublic: 'Logging in as public',
  78657. incorrectCredentials: 'Incorrect username or password.',
  78658. incorrectOneTimePassword: 'Incorrect one-time password.',
  78659. twoFactorAuthenticationEnabled: 'Two factor authentication enabled.',
  78660. clearedCredentials: 'Cleared login credentials.',
  78661. publishFail: "Couldn't publish package: $0",
  78662. publishPrivate: 'Package marked as private, not publishing.',
  78663. published: 'Published.',
  78664. publishing: 'Publishing',
  78665. nonInteractiveNoVersionSpecified: 'You must specify a new version with --new-version when running with --non-interactive.',
  78666. nonInteractiveNoToken: "No token found and can't prompt for login when running with --non-interactive.",
  78667. infoFail: 'Received invalid response from npm.',
  78668. malformedRegistryResponse: 'Received malformed response from registry for $0. The registry may be down.',
  78669. registryNoVersions: 'No valid versions found for $0. The package may be unpublished.',
  78670. cantRequestOffline: "Can't make a request in offline mode ($0)",
  78671. requestManagerNotSetupHAR: 'RequestManager was not setup to capture HAR files',
  78672. requestError: 'Request $0 returned a $1',
  78673. requestFailed: 'Request failed $0',
  78674. tarballNotInNetworkOrCache: '$0: Tarball is not in network and can not be located in cache ($1)',
  78675. fetchBadIntegrityCache: 'Incorrect integrity when fetching from the cache for $0. Cache has $1 and remote has $2. Run `yarn cache clean` to fix the problem',
  78676. fetchBadHashCache: 'Incorrect hash when fetching from the cache for $0. Cache has $1 and remote has $2. Run `yarn cache clean` to fix the problem',
  78677. fetchBadHashWithPath: "Integrity check failed for $0 (computed integrity doesn't match our records, got $2)",
  78678. fetchBadIntegrityAlgorithm: 'Integrity checked failed for $0 (none of the specified algorithms are supported)',
  78679. fetchErrorCorrupt: '$0. Mirror tarball appears to be corrupt. You can resolve this by running:\n\n rm -rf $1\n yarn install',
  78680. errorExtractingTarball: 'Extracting tar content of $1 failed, the file appears to be corrupt: $0',
  78681. updateInstalling: 'Installing $0...',
  78682. hostedGitResolveError: 'Error connecting to repository. Please, check the url.',
  78683. unauthorizedResponse: 'Received a 401 from $0. $1',
  78684. unknownFetcherFor: 'Unknown fetcher for $0',
  78685. downloadGitWithoutCommit: 'Downloading the git repo $0 over plain git without a commit hash',
  78686. downloadHTTPWithoutCommit: 'Downloading the git repo $0 over HTTP without a commit hash',
  78687. unplugDisabled: "Packages can only be unplugged when Plug'n'Play is enabled.",
  78688. plugnplaySuggestV2L1: "Plug'n'Play support has been greatly improved on the Yarn v2 development branch.",
  78689. plugnplaySuggestV2L2: 'Please give it a try and tell us what you think! - https://next.yarnpkg.com/getting-started/install',
  78690. plugnplayWindowsSupport: "Plug'n'Play on Windows doesn't support the cache and project to be kept on separate drives",
  78691. packageInstalledWithBinaries: 'Installed $0 with binaries:',
  78692. packageHasBinaries: '$0 has binaries:',
  78693. packageHasNoBinaries: '$0 has no binaries',
  78694. packageBinaryNotFound: "Couldn't find a binary named $0",
  78695. couldBeDeduped: '$0 could be deduped from $1 to $2',
  78696. lockfileNotContainPattern: 'Lockfile does not contain pattern: $0',
  78697. integrityCheckFailed: 'Integrity check failed',
  78698. noIntegrityFile: "Couldn't find an integrity file",
  78699. integrityFailedExpectedIsNotAJSON: 'Integrity check: integrity file is not a json',
  78700. integrityCheckLinkedModulesDontMatch: "Integrity check: Linked modules don't match",
  78701. integrityFlagsDontMatch: "Integrity check: Flags don't match",
  78702. integrityLockfilesDontMatch: "Integrity check: Lock files don't match",
  78703. integrityFailedFilesMissing: 'Integrity check: Files are missing',
  78704. integrityPatternsDontMatch: "Integrity check: Top level patterns don't match",
  78705. integrityModulesFoldersMissing: 'Integrity check: Some module folders are missing',
  78706. integritySystemParamsDontMatch: "Integrity check: System parameters don't match",
  78707. packageNotInstalled: '$0 not installed',
  78708. optionalDepNotInstalled: 'Optional dependency $0 not installed',
  78709. packageWrongVersion: '$0 is wrong version: expected $1, got $2',
  78710. packageDontSatisfy: "$0 doesn't satisfy found match of $1",
  78711. lockfileExists: 'Lockfile already exists, not importing.',
  78712. skippingImport: 'Skipping import of $0 for $1',
  78713. importFailed: 'Import of $0 for $1 failed, resolving normally.',
  78714. importResolveFailed: 'Import of $0 failed starting in $1',
  78715. importResolvedRangeMatch: 'Using version $0 of $1 instead of $2 for $3',
  78716. importSourceFilesCorrupted: 'Failed to import from package-lock.json, source file(s) corrupted',
  78717. importPackageLock: 'found npm package-lock.json, converting to yarn.lock',
  78718. importNodeModules: 'creating yarn.lock from local node_modules folder',
  78719. packageContainsYarnAsGlobal: 'Installing Yarn via Yarn will result in you having two separate versions of Yarn installed at the same time, which is not recommended. To update Yarn please follow https://yarnpkg.com/en/docs/install .',
  78720. scopeNotValid: 'The specified scope is not valid.',
  78721. deprecatedCommand: '$0 is deprecated. Please use $1.',
  78722. deprecatedListArgs: 'Filtering by arguments is deprecated. Please use the pattern option instead.',
  78723. implicitFileDeprecated: 'Using the "file:" protocol implicitly is deprecated. Please either prepend the protocol or prepend the path $0 with "./".',
  78724. unsupportedNodeVersion: 'You are using Node $0 which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: $1',
  78725. verboseUpgradeBecauseRequested: 'Considering upgrade of $0 to $1 because it was directly requested.',
  78726. verboseUpgradeBecauseOutdated: 'Considering upgrade of $0 to $1 because a newer version exists in the registry.',
  78727. verboseUpgradeNotUnlocking: 'Not unlocking $0 in the lockfile because it is a new or direct dependency.',
  78728. verboseUpgradeUnlocking: 'Unlocking $0 in the lockfile.',
  78729. folderMissing: "Directory $0 doesn't exist",
  78730. mutexPortBusy: 'Cannot use the network mutex on port $0. It is probably used by another app.',
  78731. auditRunning: 'Auditing packages',
  78732. auditSummary: '$0 vulnerabilities found - Packages audited: $1',
  78733. auditSummarySeverity: 'Severity:',
  78734. auditCritical: '$0 Critical',
  78735. auditHigh: '$0 High',
  78736. auditModerate: '$0 Moderate',
  78737. auditLow: '$0 Low',
  78738. auditInfo: '$0 Info',
  78739. auditResolveCommand: '# Run $0 to resolve $1 $2',
  78740. auditSemverMajorChange: 'SEMVER WARNING: Recommended action is a potentially breaking change',
  78741. auditManualReview: 'Manual Review\nSome vulnerabilities require your attention to resolve\n\nVisit https://go.npm.me/audit-guide for additional guidance',
  78742. auditRunAuditForDetails: 'Security audit found potential problems. Run "yarn audit" for additional details.',
  78743. auditOffline: 'Skipping audit. Security audit cannot be performed in offline mode.'
  78744. };
  78745. exports.default = messages;
  78746. /***/ }),
  78747. /* 524 */
  78748. /***/ (function(module, exports, __webpack_require__) {
  78749. "use strict";
  78750. Object.defineProperty(exports, "__esModule", {
  78751. value: true
  78752. });
  78753. exports.en = undefined;
  78754. var _en;
  78755. function _load_en() {
  78756. return _en = _interopRequireDefault(__webpack_require__(523));
  78757. }
  78758. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  78759. exports.en = (_en || _load_en()).default;
  78760. /***/ }),
  78761. /* 525 */
  78762. /***/ (function(module, exports, __webpack_require__) {
  78763. "use strict";
  78764. Object.defineProperty(exports, "__esModule", {
  78765. value: true
  78766. });
  78767. var _asyncToGenerator2;
  78768. function _load_asyncToGenerator() {
  78769. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  78770. }
  78771. var _promise;
  78772. function _load_promise() {
  78773. return _promise = _interopRequireDefault(__webpack_require__(7));
  78774. }
  78775. var _classCallCheck2;
  78776. function _load_classCallCheck() {
  78777. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  78778. }
  78779. var _possibleConstructorReturn2;
  78780. function _load_possibleConstructorReturn() {
  78781. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  78782. }
  78783. var _inherits2;
  78784. function _load_inherits() {
  78785. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  78786. }
  78787. var _baseReporter;
  78788. function _load_baseReporter() {
  78789. return _baseReporter = _interopRequireDefault(__webpack_require__(98));
  78790. }
  78791. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  78792. /* eslint no-unused-vars: 0 */
  78793. var NoopReporter = function (_BaseReporter) {
  78794. (0, (_inherits2 || _load_inherits()).default)(NoopReporter, _BaseReporter);
  78795. function NoopReporter() {
  78796. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NoopReporter);
  78797. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseReporter.apply(this, arguments));
  78798. }
  78799. NoopReporter.prototype.lang = function lang(key) {
  78800. return 'do nothing';
  78801. };
  78802. NoopReporter.prototype.verbose = function verbose(msg) {};
  78803. NoopReporter.prototype.verboseInspect = function verboseInspect(val) {};
  78804. NoopReporter.prototype.initPeakMemoryCounter = function initPeakMemoryCounter() {};
  78805. NoopReporter.prototype.checkPeakMemory = function checkPeakMemory() {};
  78806. NoopReporter.prototype.close = function close() {};
  78807. NoopReporter.prototype.getTotalTime = function getTotalTime() {
  78808. return 0;
  78809. };
  78810. NoopReporter.prototype.list = function list(key, items, hints) {};
  78811. NoopReporter.prototype.tree = function tree(key, obj) {};
  78812. NoopReporter.prototype.step = function step(current, total, message, emoji) {};
  78813. NoopReporter.prototype.error = function error(message) {};
  78814. NoopReporter.prototype.info = function info(message) {};
  78815. NoopReporter.prototype.warn = function warn(message) {};
  78816. NoopReporter.prototype.success = function success(message) {};
  78817. NoopReporter.prototype.log = function log(message) {};
  78818. NoopReporter.prototype.command = function command(_command) {};
  78819. NoopReporter.prototype.inspect = function inspect(value) {};
  78820. NoopReporter.prototype.header = function header(command, pkg) {};
  78821. NoopReporter.prototype.footer = function footer(showPeakMemory) {};
  78822. NoopReporter.prototype.table = function table(head, body) {};
  78823. NoopReporter.prototype.activity = function activity() {
  78824. return {
  78825. tick(name) {},
  78826. end() {}
  78827. };
  78828. };
  78829. NoopReporter.prototype.activitySet = function activitySet(total, workers) {
  78830. return {
  78831. spinners: Array(workers).fill({
  78832. clear() {},
  78833. setPrefix() {},
  78834. tick() {},
  78835. end() {}
  78836. }),
  78837. end() {}
  78838. };
  78839. };
  78840. NoopReporter.prototype.question = function question(_question) {
  78841. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  78842. return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
  78843. };
  78844. NoopReporter.prototype.questionAffirm = function () {
  78845. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (question) {
  78846. yield this.question(question);
  78847. return false;
  78848. });
  78849. function questionAffirm(_x2) {
  78850. return _ref.apply(this, arguments);
  78851. }
  78852. return questionAffirm;
  78853. }();
  78854. NoopReporter.prototype.select = function select(header, question, options) {
  78855. return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
  78856. };
  78857. NoopReporter.prototype.progress = function progress(total) {
  78858. return function () {};
  78859. };
  78860. NoopReporter.prototype.disableProgress = function disableProgress() {
  78861. this.noProgress = true;
  78862. };
  78863. NoopReporter.prototype.prompt = function prompt(message, choices) {
  78864. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  78865. return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
  78866. };
  78867. return NoopReporter;
  78868. }((_baseReporter || _load_baseReporter()).default);
  78869. exports.default = NoopReporter;
  78870. /***/ }),
  78871. /* 526 */
  78872. /***/ (function(module, exports, __webpack_require__) {
  78873. "use strict";
  78874. Object.defineProperty(exports, "__esModule", {
  78875. value: true
  78876. });
  78877. var _extends2;
  78878. function _load_extends() {
  78879. return _extends2 = _interopRequireDefault(__webpack_require__(24));
  78880. }
  78881. var _assign;
  78882. function _load_assign() {
  78883. return _assign = _interopRequireDefault(__webpack_require__(23));
  78884. }
  78885. var _keys;
  78886. function _load_keys() {
  78887. return _keys = _interopRequireDefault(__webpack_require__(14));
  78888. }
  78889. var _promise;
  78890. function _load_promise() {
  78891. return _promise = _interopRequireDefault(__webpack_require__(7));
  78892. }
  78893. var _classCallCheck2;
  78894. function _load_classCallCheck() {
  78895. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  78896. }
  78897. var _possibleConstructorReturn2;
  78898. function _load_possibleConstructorReturn() {
  78899. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  78900. }
  78901. var _inherits2;
  78902. function _load_inherits() {
  78903. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  78904. }
  78905. var _packageRequest;
  78906. function _load_packageRequest() {
  78907. return _packageRequest = _interopRequireDefault(__webpack_require__(117));
  78908. }
  78909. var _baseResolver;
  78910. function _load_baseResolver() {
  78911. return _baseResolver = _interopRequireDefault(__webpack_require__(118));
  78912. }
  78913. var _workspaceLayout;
  78914. function _load_workspaceLayout() {
  78915. return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
  78916. }
  78917. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  78918. var invariant = __webpack_require__(15);
  78919. var WorkspaceResolver = function (_BaseResolver) {
  78920. (0, (_inherits2 || _load_inherits()).default)(WorkspaceResolver, _BaseResolver);
  78921. WorkspaceResolver.isWorkspace = function isWorkspace(pattern, workspaceLayout) {
  78922. return !!workspaceLayout && !!workspaceLayout.getManifestByPattern(pattern);
  78923. };
  78924. function WorkspaceResolver(request, fragment, workspaceLayout) {
  78925. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, WorkspaceResolver);
  78926. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.call(this, request, fragment));
  78927. _this.workspaceLayout = workspaceLayout;
  78928. return _this;
  78929. }
  78930. WorkspaceResolver.prototype.resolve = function resolve(downloadedManifest) {
  78931. var workspace = this.workspaceLayout.getManifestByPattern(this.request.pattern);
  78932. invariant(workspace, 'expected workspace');
  78933. var manifest = workspace.manifest,
  78934. loc = workspace.loc;
  78935. if (manifest._remote && manifest._remote.registryRemote) {
  78936. return (_promise || _load_promise()).default.resolve(manifest); //already downloaded
  78937. }
  78938. var registry = manifest._registry;
  78939. invariant(registry, 'expected reference');
  78940. var hash = '';
  78941. var registryRemote = void 0;
  78942. if (downloadedManifest && manifest.version === downloadedManifest.version) {
  78943. registryRemote = downloadedManifest._remote;
  78944. invariant(registryRemote, 'missing remote info');
  78945. hash = registryRemote.hash;
  78946. //override any local changes to manifest
  78947. (0, (_keys || _load_keys()).default)(manifest).forEach(function (k) {
  78948. return k.startsWith('_') || delete manifest[k];
  78949. });
  78950. (0, (_assign || _load_assign()).default)(manifest, downloadedManifest);
  78951. } else if (manifest._remote && manifest._remote.hash) {
  78952. invariant(workspace.manifest._remote, 'missing remote info');
  78953. registryRemote = workspace.manifest._remote.registryRemote;
  78954. hash = manifest._remote.hash;
  78955. }
  78956. if (registryRemote) {
  78957. registryRemote = (0, (_extends2 || _load_extends()).default)({}, registryRemote);
  78958. }
  78959. manifest._remote = (0, (_assign || _load_assign()).default)(manifest._remote || {}, {
  78960. type: 'workspace',
  78961. registryRemote,
  78962. registry,
  78963. hash,
  78964. reference: loc
  78965. });
  78966. manifest._uid = manifest.version;
  78967. return (_promise || _load_promise()).default.resolve(manifest);
  78968. };
  78969. return WorkspaceResolver;
  78970. }((_baseResolver || _load_baseResolver()).default);
  78971. exports.default = WorkspaceResolver;
  78972. /***/ }),
  78973. /* 527 */
  78974. /***/ (function(module, exports, __webpack_require__) {
  78975. "use strict";
  78976. Object.defineProperty(exports, "__esModule", {
  78977. value: true
  78978. });
  78979. var _asyncToGenerator2;
  78980. function _load_asyncToGenerator() {
  78981. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  78982. }
  78983. var _classCallCheck2;
  78984. function _load_classCallCheck() {
  78985. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  78986. }
  78987. var _possibleConstructorReturn2;
  78988. function _load_possibleConstructorReturn() {
  78989. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  78990. }
  78991. var _inherits2;
  78992. function _load_inherits() {
  78993. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  78994. }
  78995. var _hostedGitResolver;
  78996. function _load_hostedGitResolver() {
  78997. return _hostedGitResolver = _interopRequireDefault(__webpack_require__(99));
  78998. }
  78999. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79000. var BitbucketResolver = function (_HostedGitResolver) {
  79001. (0, (_inherits2 || _load_inherits()).default)(BitbucketResolver, _HostedGitResolver);
  79002. function BitbucketResolver() {
  79003. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BitbucketResolver);
  79004. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _HostedGitResolver.apply(this, arguments));
  79005. }
  79006. BitbucketResolver.getTarballUrl = function getTarballUrl(parts, hash) {
  79007. return `https://${this.hostname}/${parts.user}/${parts.repo}/get/${hash}.tar.gz`;
  79008. };
  79009. BitbucketResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(parts) {
  79010. return `https://${this.hostname}/${parts.user}/${parts.repo}`;
  79011. };
  79012. BitbucketResolver.getGitHTTPUrl = function getGitHTTPUrl(parts) {
  79013. return `${BitbucketResolver.getGitHTTPBaseUrl(parts)}.git`;
  79014. };
  79015. BitbucketResolver.getGitSSHUrl = function getGitSSHUrl(parts) {
  79016. return `git+ssh://git@${this.hostname}/${parts.user}/${parts.repo}.git` + `${parts.hash ? '#' + decodeURIComponent(parts.hash) : ''}`;
  79017. };
  79018. BitbucketResolver.getHTTPFileUrl = function getHTTPFileUrl(parts, filename, commit) {
  79019. return `https://${this.hostname}/${parts.user}/${parts.repo}/raw/${commit}/${filename}`;
  79020. };
  79021. BitbucketResolver.prototype.hasHTTPCapability = function () {
  79022. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) {
  79023. // We don't follow redirects and reject a 302 since this means BitBucket
  79024. // won't allow us to use the HTTP protocol for `git` access.
  79025. // Most probably a private repo and this 302 is to a login page.
  79026. var bitbucketHTTPSupport = yield this.config.requestManager.request({
  79027. url,
  79028. method: 'HEAD',
  79029. queue: this.resolver.fetchingQueue,
  79030. followRedirect: false,
  79031. rejectStatusCode: 302
  79032. });
  79033. return bitbucketHTTPSupport !== false;
  79034. });
  79035. function hasHTTPCapability(_x) {
  79036. return _ref.apply(this, arguments);
  79037. }
  79038. return hasHTTPCapability;
  79039. }();
  79040. return BitbucketResolver;
  79041. }((_hostedGitResolver || _load_hostedGitResolver()).default);
  79042. BitbucketResolver.hostname = 'bitbucket.org';
  79043. BitbucketResolver.protocol = 'bitbucket';
  79044. exports.default = BitbucketResolver;
  79045. /***/ }),
  79046. /* 528 */
  79047. /***/ (function(module, exports, __webpack_require__) {
  79048. "use strict";
  79049. Object.defineProperty(exports, "__esModule", {
  79050. value: true
  79051. });
  79052. var _classCallCheck2;
  79053. function _load_classCallCheck() {
  79054. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  79055. }
  79056. var _possibleConstructorReturn2;
  79057. function _load_possibleConstructorReturn() {
  79058. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  79059. }
  79060. var _inherits2;
  79061. function _load_inherits() {
  79062. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  79063. }
  79064. var _hostedGitResolver;
  79065. function _load_hostedGitResolver() {
  79066. return _hostedGitResolver = _interopRequireDefault(__webpack_require__(99));
  79067. }
  79068. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79069. var GitLabResolver = function (_HostedGitResolver) {
  79070. (0, (_inherits2 || _load_inherits()).default)(GitLabResolver, _HostedGitResolver);
  79071. function GitLabResolver() {
  79072. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitLabResolver);
  79073. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _HostedGitResolver.apply(this, arguments));
  79074. }
  79075. GitLabResolver.getTarballUrl = function getTarballUrl(parts, hash) {
  79076. return `https://${this.hostname}/${parts.user}/${parts.repo}/repository/archive.tar.gz?ref=${hash}`;
  79077. };
  79078. GitLabResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(parts) {
  79079. return `https://${this.hostname}/${parts.user}/${parts.repo}`;
  79080. };
  79081. GitLabResolver.getGitHTTPUrl = function getGitHTTPUrl(parts) {
  79082. return `${GitLabResolver.getGitHTTPBaseUrl(parts)}.git`;
  79083. };
  79084. GitLabResolver.getGitSSHUrl = function getGitSSHUrl(parts) {
  79085. return `git+ssh://git@${this.hostname}/${parts.user}/${parts.repo}.git` + `${parts.hash ? '#' + decodeURIComponent(parts.hash) : ''}`;
  79086. };
  79087. GitLabResolver.getHTTPFileUrl = function getHTTPFileUrl(parts, filename, commit) {
  79088. return `https://${this.hostname}/${parts.user}/${parts.repo}/raw/${commit}/${filename}`;
  79089. };
  79090. return GitLabResolver;
  79091. }((_hostedGitResolver || _load_hostedGitResolver()).default);
  79092. GitLabResolver.hostname = 'gitlab.com';
  79093. GitLabResolver.protocol = 'gitlab';
  79094. exports.default = GitLabResolver;
  79095. /***/ }),
  79096. /* 529 */
  79097. /***/ (function(module, exports, __webpack_require__) {
  79098. "use strict";
  79099. Object.defineProperty(exports, "__esModule", {
  79100. value: true
  79101. });
  79102. var _classCallCheck2;
  79103. function _load_classCallCheck() {
  79104. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  79105. }
  79106. var _possibleConstructorReturn2;
  79107. function _load_possibleConstructorReturn() {
  79108. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  79109. }
  79110. var _inherits2;
  79111. function _load_inherits() {
  79112. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  79113. }
  79114. var _errors;
  79115. function _load_errors() {
  79116. return _errors = __webpack_require__(6);
  79117. }
  79118. var _exoticResolver;
  79119. function _load_exoticResolver() {
  79120. return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
  79121. }
  79122. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79123. var RegistryResolver = function (_ExoticResolver) {
  79124. (0, (_inherits2 || _load_inherits()).default)(RegistryResolver, _ExoticResolver);
  79125. function RegistryResolver(request, fragment) {
  79126. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, RegistryResolver);
  79127. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
  79128. var match = fragment.match(/^(\S+):(@?.*?)(@(.*?)|)$/);
  79129. if (match) {
  79130. _this.range = match[4] || 'latest';
  79131. _this.name = match[2];
  79132. } else {
  79133. throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('invalidFragment', fragment));
  79134. }
  79135. // $FlowFixMe
  79136. _this.registry = _this.constructor.protocol;
  79137. return _this;
  79138. }
  79139. RegistryResolver.prototype.resolve = function resolve() {
  79140. return this.fork(this.constructor.factory, false, this.name, this.range);
  79141. };
  79142. return RegistryResolver;
  79143. }((_exoticResolver || _load_exoticResolver()).default);
  79144. exports.default = RegistryResolver;
  79145. /***/ }),
  79146. /* 530 */
  79147. /***/ (function(module, exports, __webpack_require__) {
  79148. "use strict";
  79149. Object.defineProperty(exports, "__esModule", {
  79150. value: true
  79151. });
  79152. var _asyncToGenerator2;
  79153. function _load_asyncToGenerator() {
  79154. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  79155. }
  79156. var _classCallCheck2;
  79157. function _load_classCallCheck() {
  79158. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  79159. }
  79160. var _possibleConstructorReturn2;
  79161. function _load_possibleConstructorReturn() {
  79162. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  79163. }
  79164. var _inherits2;
  79165. function _load_inherits() {
  79166. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  79167. }
  79168. var _tarballFetcher;
  79169. function _load_tarballFetcher() {
  79170. return _tarballFetcher = _interopRequireDefault(__webpack_require__(300));
  79171. }
  79172. var _exoticResolver;
  79173. function _load_exoticResolver() {
  79174. return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
  79175. }
  79176. var _gitResolver;
  79177. function _load_gitResolver() {
  79178. return _gitResolver = _interopRequireDefault(__webpack_require__(119));
  79179. }
  79180. var _guessName;
  79181. function _load_guessName() {
  79182. return _guessName = _interopRequireDefault(__webpack_require__(159));
  79183. }
  79184. var _version;
  79185. function _load_version() {
  79186. return _version = _interopRequireWildcard(__webpack_require__(209));
  79187. }
  79188. var _crypto;
  79189. function _load_crypto() {
  79190. return _crypto = _interopRequireWildcard(__webpack_require__(158));
  79191. }
  79192. var _fs;
  79193. function _load_fs() {
  79194. return _fs = _interopRequireWildcard(__webpack_require__(8));
  79195. }
  79196. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  79197. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79198. var invariant = __webpack_require__(15);
  79199. var TarballResolver = function (_ExoticResolver) {
  79200. (0, (_inherits2 || _load_inherits()).default)(TarballResolver, _ExoticResolver);
  79201. function TarballResolver(request, fragment) {
  79202. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, TarballResolver);
  79203. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
  79204. var _versionUtil$explodeH = (_version || _load_version()).explodeHashedUrl(fragment),
  79205. hash = _versionUtil$explodeH.hash,
  79206. url = _versionUtil$explodeH.url;
  79207. _this.hash = hash;
  79208. _this.url = url;
  79209. return _this;
  79210. }
  79211. TarballResolver.isVersion = function isVersion(pattern) {
  79212. // we can sometimes match git urls which we don't want
  79213. if ((_gitResolver || _load_gitResolver()).default.isVersion(pattern)) {
  79214. return false;
  79215. }
  79216. // full http url
  79217. if (pattern.startsWith('http://') || pattern.startsWith('https://')) {
  79218. return true;
  79219. }
  79220. // local file reference - ignore patterns with names
  79221. if (pattern.indexOf('@') < 0) {
  79222. if (pattern.endsWith('.tgz') || pattern.endsWith('.tar.gz')) {
  79223. return true;
  79224. }
  79225. }
  79226. return false;
  79227. };
  79228. TarballResolver.prototype.resolve = function () {
  79229. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
  79230. var shrunk = this.request.getLocked('tarball');
  79231. if (shrunk) {
  79232. return shrunk;
  79233. }
  79234. var url = this.url;
  79235. var hash = this.hash,
  79236. registry = this.registry;
  79237. var pkgJson = void 0;
  79238. // generate temp directory
  79239. var dest = this.config.getTemp((_crypto || _load_crypto()).hash(url));
  79240. if (yield this.config.isValidModuleDest(dest)) {
  79241. var _ref2 = yield this.config.readPackageMetadata(dest);
  79242. // load from local cache
  79243. pkgJson = _ref2.package;
  79244. hash = _ref2.hash;
  79245. registry = _ref2.registry;
  79246. } else {
  79247. // delete if invalid
  79248. yield (_fs || _load_fs()).unlink(dest);
  79249. var fetcher = new (_tarballFetcher || _load_tarballFetcher()).default(dest, {
  79250. type: 'tarball',
  79251. reference: url,
  79252. registry,
  79253. hash
  79254. }, this.config);
  79255. // fetch file and get it's hash
  79256. var fetched = yield fetcher.fetch({
  79257. name: (0, (_guessName || _load_guessName()).default)(url),
  79258. version: '0.0.0',
  79259. _registry: 'npm'
  79260. });
  79261. pkgJson = fetched.package;
  79262. hash = fetched.hash;
  79263. registry = pkgJson._registry;
  79264. invariant(registry, 'expected registry');
  79265. }
  79266. // use the commit/tarball hash as the uid as we can't rely on the version as it's not
  79267. // in the registry
  79268. pkgJson._uid = hash;
  79269. // set remote so it can be "fetched"
  79270. pkgJson._remote = {
  79271. type: 'copy',
  79272. resolved: `${url}#${hash}`,
  79273. hash,
  79274. registry,
  79275. reference: dest
  79276. };
  79277. return pkgJson;
  79278. });
  79279. function resolve() {
  79280. return _ref.apply(this, arguments);
  79281. }
  79282. return resolve;
  79283. }();
  79284. return TarballResolver;
  79285. }((_exoticResolver || _load_exoticResolver()).default);
  79286. exports.default = TarballResolver;
  79287. /***/ }),
  79288. /* 531 */
  79289. /***/ (function(module, exports, __webpack_require__) {
  79290. "use strict";
  79291. Object.defineProperty(exports, "__esModule", {
  79292. value: true
  79293. });
  79294. var _classCallCheck2;
  79295. function _load_classCallCheck() {
  79296. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  79297. }
  79298. var _possibleConstructorReturn2;
  79299. function _load_possibleConstructorReturn() {
  79300. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  79301. }
  79302. var _inherits2;
  79303. function _load_inherits() {
  79304. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  79305. }
  79306. var _baseResolver;
  79307. function _load_baseResolver() {
  79308. return _baseResolver = _interopRequireDefault(__webpack_require__(118));
  79309. }
  79310. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79311. var RegistryResolver = function (_BaseResolver) {
  79312. (0, (_inherits2 || _load_inherits()).default)(RegistryResolver, _BaseResolver);
  79313. function RegistryResolver(request, name, range) {
  79314. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, RegistryResolver);
  79315. var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.call(this, request, `${name}@${range}`));
  79316. _this.name = name;
  79317. _this.range = range;
  79318. _this.registryConfig = request.config.registries[_this.constructor.registry].config;
  79319. return _this;
  79320. }
  79321. return RegistryResolver;
  79322. }((_baseResolver || _load_baseResolver()).default);
  79323. exports.default = RegistryResolver;
  79324. /***/ }),
  79325. /* 532 */
  79326. /***/ (function(module, exports, __webpack_require__) {
  79327. "use strict";
  79328. Object.defineProperty(exports, "__esModule", {
  79329. value: true
  79330. });
  79331. var _classCallCheck2;
  79332. function _load_classCallCheck() {
  79333. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  79334. }
  79335. var _possibleConstructorReturn2;
  79336. function _load_possibleConstructorReturn() {
  79337. return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
  79338. }
  79339. var _inherits2;
  79340. function _load_inherits() {
  79341. return _inherits2 = _interopRequireDefault(__webpack_require__(10));
  79342. }
  79343. var _npmResolver;
  79344. function _load_npmResolver() {
  79345. return _npmResolver = _interopRequireDefault(__webpack_require__(204));
  79346. }
  79347. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79348. var YarnResolver = function (_NpmResolver) {
  79349. (0, (_inherits2 || _load_inherits()).default)(YarnResolver, _NpmResolver);
  79350. function YarnResolver() {
  79351. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, YarnResolver);
  79352. return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _NpmResolver.apply(this, arguments));
  79353. }
  79354. return YarnResolver;
  79355. }((_npmResolver || _load_npmResolver()).default);
  79356. exports.default = YarnResolver;
  79357. /***/ }),
  79358. /* 533 */
  79359. /***/ (function(module, exports, __webpack_require__) {
  79360. "use strict";
  79361. Object.defineProperty(exports, "__esModule", {
  79362. value: true
  79363. });
  79364. exports.default = envReplace;
  79365. var ENV_EXPR = /(\\*)\$\{([^}]+)\}/g;
  79366. function envReplace(value) {
  79367. var env = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.env;
  79368. if (typeof value !== 'string' || !value) {
  79369. return value;
  79370. }
  79371. return value.replace(ENV_EXPR, function (match, esc, envVarName) {
  79372. if (esc.length && esc.length % 2) {
  79373. return match;
  79374. }
  79375. if (undefined === env[envVarName]) {
  79376. throw new Error('Failed to replace env in config: ' + match);
  79377. }
  79378. return env[envVarName] || '';
  79379. });
  79380. }
  79381. /***/ }),
  79382. /* 534 */
  79383. /***/ (function(module, exports, __webpack_require__) {
  79384. "use strict";
  79385. Object.defineProperty(exports, "__esModule", {
  79386. value: true
  79387. });
  79388. exports.fixCmdWinSlashes = fixCmdWinSlashes;
  79389. function fixCmdWinSlashes(cmd) {
  79390. function findQuotes(quoteSymbol) {
  79391. var quotes = [];
  79392. var addQuote = function addQuote(_, index) {
  79393. quotes.push({ from: index, to: index + _.length });
  79394. return _;
  79395. };
  79396. var regEx = new RegExp(quoteSymbol + '.*' + quoteSymbol);
  79397. cmd.replace(regEx, addQuote);
  79398. return quotes;
  79399. }
  79400. var quotes = findQuotes('"').concat(findQuotes("'"));
  79401. function isInsideQuotes(index) {
  79402. return quotes.reduce(function (result, quote) {
  79403. return result || quote.from <= index && index <= quote.to;
  79404. }, false);
  79405. }
  79406. var cmdPrePattern = '((?:^|&&|&|\\|\\||\\|)\\s*)';
  79407. var cmdPattern = '(".*?"|\'.*?\'|\\S*)';
  79408. var regExp = new RegExp(`${cmdPrePattern}${cmdPattern}`, 'g');
  79409. return cmd.replace(regExp, function (whole, pre, cmd, index) {
  79410. if ((pre[0] === '&' || pre[0] === '|') && isInsideQuotes(index)) {
  79411. return whole;
  79412. }
  79413. return pre + cmd.replace(/\//g, '\\');
  79414. });
  79415. }
  79416. /***/ }),
  79417. /* 535 */
  79418. /***/ (function(module, exports, __webpack_require__) {
  79419. "use strict";
  79420. Object.defineProperty(exports, "__esModule", {
  79421. value: true
  79422. });
  79423. exports.fileDatesEqual = exports.copyFile = exports.unlink = undefined;
  79424. var _promise;
  79425. function _load_promise() {
  79426. return _promise = _interopRequireDefault(__webpack_require__(7));
  79427. }
  79428. var _asyncToGenerator2;
  79429. function _load_asyncToGenerator() {
  79430. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  79431. }
  79432. // We want to preserve file timestamps when copying a file, since yarn uses them to decide if a file has
  79433. // changed compared to the cache.
  79434. // There are some OS specific cases here:
  79435. // * On linux, fs.copyFile does not preserve timestamps, but does on OSX and Win.
  79436. // * On windows, you must open a file with write permissions to call `fs.futimes`.
  79437. // * On OSX you can open with read permissions and still call `fs.futimes`.
  79438. var fixTimes = function () {
  79439. var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (fd, dest, data) {
  79440. var doOpen = fd === undefined;
  79441. var openfd = fd ? fd : -1;
  79442. if (disableTimestampCorrection === undefined) {
  79443. // if timestamps match already, no correction is needed.
  79444. // the need to correct timestamps varies based on OS and node versions.
  79445. var destStat = yield lstat(dest);
  79446. disableTimestampCorrection = fileDatesEqual(destStat.mtime, data.mtime);
  79447. }
  79448. if (disableTimestampCorrection) {
  79449. return;
  79450. }
  79451. if (doOpen) {
  79452. try {
  79453. openfd = yield open(dest, 'a', data.mode);
  79454. } catch (er) {
  79455. // file is likely read-only
  79456. try {
  79457. openfd = yield open(dest, 'r', data.mode);
  79458. } catch (err) {
  79459. // We can't even open this file for reading.
  79460. return;
  79461. }
  79462. }
  79463. }
  79464. try {
  79465. if (openfd) {
  79466. yield futimes(openfd, data.atime, data.mtime);
  79467. }
  79468. } catch (er) {
  79469. // If `futimes` throws an exception, we probably have a case of a read-only file on Windows.
  79470. // In this case we can just return. The incorrect timestamp will just cause that file to be recopied
  79471. // on subsequent installs, which will effect yarn performance but not break anything.
  79472. } finally {
  79473. if (doOpen && openfd) {
  79474. yield close(openfd);
  79475. }
  79476. }
  79477. });
  79478. return function fixTimes(_x7, _x8, _x9) {
  79479. return _ref3.apply(this, arguments);
  79480. };
  79481. }();
  79482. // Compare file timestamps.
  79483. // Some versions of Node on windows zero the milliseconds when utime is used.
  79484. var _fs;
  79485. function _load_fs() {
  79486. return _fs = _interopRequireDefault(__webpack_require__(12));
  79487. }
  79488. var _promise2;
  79489. function _load_promise2() {
  79490. return _promise2 = __webpack_require__(86);
  79491. }
  79492. var _fs2;
  79493. function _load_fs2() {
  79494. return _fs2 = __webpack_require__(8);
  79495. }
  79496. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79497. var disableTimestampCorrection = undefined; // OS dependent. will be detected on first file copy.
  79498. // This module serves as a wrapper for file operations that are inconsistant across node and OS versions.
  79499. var readFileBuffer = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readFile);
  79500. var close = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.close);
  79501. var lstat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.lstat);
  79502. var open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open);
  79503. var futimes = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.futimes);
  79504. var write = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.write);
  79505. var unlink = exports.unlink = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(894));
  79506. /**
  79507. * Unlinks the destination to force a recreation. This is needed on case-insensitive file systems
  79508. * to force the correct naming when the filename has changed only in character-casing. (Jest -> jest).
  79509. */
  79510. var copyFile = exports.copyFile = function () {
  79511. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data, cleanup) {
  79512. // $FlowFixMe: Flow doesn't currently support COPYFILE_FICLONE
  79513. var ficloneFlag = (_fs2 || _load_fs2()).constants.COPYFILE_FICLONE || 0;
  79514. try {
  79515. yield unlink(data.dest);
  79516. yield copyFilePoly(data.src, data.dest, ficloneFlag, data);
  79517. } finally {
  79518. if (cleanup) {
  79519. cleanup();
  79520. }
  79521. }
  79522. });
  79523. return function copyFile(_x, _x2) {
  79524. return _ref.apply(this, arguments);
  79525. };
  79526. }();
  79527. // Node 8.5.0 introduced `fs.copyFile` which is much faster, so use that when available.
  79528. // Otherwise we fall back to reading and writing files as buffers.
  79529. var copyFilePoly = function copyFilePoly(src, dest, flags, data) {
  79530. if ((_fs || _load_fs()).default.copyFile) {
  79531. return new (_promise || _load_promise()).default(function (resolve, reject) {
  79532. return (_fs || _load_fs()).default.copyFile(src, dest, flags, function (err) {
  79533. if (err) {
  79534. reject(err);
  79535. } else {
  79536. fixTimes(undefined, dest, data).then(function () {
  79537. return resolve();
  79538. }).catch(function (ex) {
  79539. return reject(ex);
  79540. });
  79541. }
  79542. });
  79543. });
  79544. } else {
  79545. return copyWithBuffer(src, dest, flags, data);
  79546. }
  79547. };
  79548. var copyWithBuffer = function () {
  79549. var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest, flags, data) {
  79550. // Use open -> write -> futimes -> close sequence to avoid opening the file twice:
  79551. // one with writeFile and one with utimes
  79552. var fd = yield open(dest, 'w', data.mode);
  79553. try {
  79554. var _buffer = yield readFileBuffer(src);
  79555. yield write(fd, _buffer, 0, _buffer.length);
  79556. yield fixTimes(fd, dest, data);
  79557. } finally {
  79558. yield close(fd);
  79559. }
  79560. });
  79561. return function copyWithBuffer(_x3, _x4, _x5, _x6) {
  79562. return _ref2.apply(this, arguments);
  79563. };
  79564. }();var fileDatesEqual = exports.fileDatesEqual = function fileDatesEqual(a, b) {
  79565. var aTime = a.getTime();
  79566. var bTime = b.getTime();
  79567. if (process.platform !== 'win32') {
  79568. return aTime === bTime;
  79569. }
  79570. // See https://github.com/nodejs/node/pull/12607
  79571. // Submillisecond times from stat and utimes are truncated on Windows,
  79572. // causing a file with mtime 8.0079998 and 8.0081144 to become 8.007 and 8.008
  79573. // and making it impossible to update these files to their correct timestamps.
  79574. if (Math.abs(aTime - bTime) <= 1) {
  79575. return true;
  79576. }
  79577. var aTimeSec = Math.floor(aTime / 1000);
  79578. var bTimeSec = Math.floor(bTime / 1000);
  79579. // See https://github.com/nodejs/node/issues/2069
  79580. // Some versions of Node on windows zero the milliseconds when utime is used
  79581. // So if any of the time has a milliseconds part of zero we suspect that the
  79582. // bug is present and compare only seconds.
  79583. if (aTime - aTimeSec * 1000 === 0 || bTime - bTimeSec * 1000 === 0) {
  79584. return aTimeSec === bTimeSec;
  79585. }
  79586. return aTime === bTime;
  79587. };
  79588. /***/ }),
  79589. /* 536 */
  79590. /***/ (function(module, exports, __webpack_require__) {
  79591. "use strict";
  79592. Object.defineProperty(exports, "__esModule", {
  79593. value: true
  79594. });
  79595. exports.generatePnpMap = undefined;
  79596. var _keys;
  79597. function _load_keys() {
  79598. return _keys = _interopRequireDefault(__webpack_require__(14));
  79599. }
  79600. var _set;
  79601. function _load_set() {
  79602. return _set = _interopRequireDefault(__webpack_require__(16));
  79603. }
  79604. var _asyncToGenerator2;
  79605. function _load_asyncToGenerator() {
  79606. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  79607. }
  79608. var _from;
  79609. function _load_from() {
  79610. return _from = _interopRequireDefault(__webpack_require__(53));
  79611. }
  79612. var _map;
  79613. function _load_map() {
  79614. return _map = _interopRequireDefault(__webpack_require__(42));
  79615. }
  79616. var _stringify;
  79617. function _load_stringify() {
  79618. return _stringify = _interopRequireDefault(__webpack_require__(37));
  79619. }
  79620. var _getIterator2;
  79621. function _load_getIterator() {
  79622. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  79623. }
  79624. var getPackageInformationStores = function () {
  79625. var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, seedPatterns, _ref18) {
  79626. var resolver = _ref18.resolver,
  79627. reporter = _ref18.reporter,
  79628. targetPath = _ref18.targetPath,
  79629. workspaceLayout = _ref18.workspaceLayout;
  79630. var targetDirectory = path.dirname(targetPath);
  79631. var offlineCacheFolder = config.offlineCacheFolder;
  79632. var packageInformationStores = new (_map || _load_map()).default();
  79633. var blacklistedLocations = new (_set || _load_set()).default();
  79634. var getCachePath = function getCachePath(fsPath) {
  79635. var cacheRelativePath = normalizePath(path.relative(config.cacheFolder, fsPath));
  79636. // if fsPath is not inside cacheRelativePath, we just skip it
  79637. if (cacheRelativePath.match(/^\.\.\//)) {
  79638. return null;
  79639. }
  79640. return cacheRelativePath;
  79641. };
  79642. var resolveOfflineCacheFolder = function resolveOfflineCacheFolder(fsPath) {
  79643. if (!offlineCacheFolder) {
  79644. return fsPath;
  79645. }
  79646. var cacheRelativePath = getCachePath(fsPath);
  79647. // if fsPath is not inside the cache, we shouldn't replace it (workspace)
  79648. if (!cacheRelativePath) {
  79649. return fsPath;
  79650. }
  79651. var components = cacheRelativePath.split(/\//g);
  79652. var cacheEntry = components[0],
  79653. internalPath = components.slice(1);
  79654. return path.resolve(offlineCacheFolder, `${cacheEntry}${OFFLINE_CACHE_EXTENSION}`, internalPath.join('/'));
  79655. };
  79656. var normalizePath = function normalizePath(fsPath) {
  79657. return process.platform === 'win32' ? fsPath.replace(backwardSlashRegExp, '/') : fsPath;
  79658. };
  79659. var normalizeDirectoryPath = function normalizeDirectoryPath(fsPath) {
  79660. var relativePath = normalizePath(path.relative(targetDirectory, resolveOfflineCacheFolder(fsPath)));
  79661. if (!relativePath.match(/^\.{0,2}\//) && !path.isAbsolute(relativePath)) {
  79662. relativePath = `./${relativePath}`;
  79663. }
  79664. return relativePath.replace(/\/?$/, '/');
  79665. };
  79666. var getHashFrom = function getHashFrom(data) {
  79667. var hashGenerator = crypto.createHash('sha1');
  79668. for (var _iterator10 = data, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
  79669. var _ref19;
  79670. if (_isArray10) {
  79671. if (_i10 >= _iterator10.length) break;
  79672. _ref19 = _iterator10[_i10++];
  79673. } else {
  79674. _i10 = _iterator10.next();
  79675. if (_i10.done) break;
  79676. _ref19 = _i10.value;
  79677. }
  79678. var datum = _ref19;
  79679. hashGenerator.update(datum);
  79680. }
  79681. return hashGenerator.digest('hex');
  79682. };
  79683. var getResolverEntry = function getResolverEntry(pattern) {
  79684. var pkg = resolver.getStrictResolvedPattern(pattern);
  79685. var ref = pkg._reference;
  79686. if (!ref) {
  79687. return null;
  79688. }
  79689. invariant(ref.locations.length <= 1, 'Must have at most one location (usually in the cache)');
  79690. var loc = ref.locations[0];
  79691. if (!loc) {
  79692. return null;
  79693. }
  79694. return { pkg, ref, loc };
  79695. };
  79696. var visit = function () {
  79697. var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (precomputedResolutions, seedPatterns) {
  79698. var parentData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  79699. var resolutions = new (_map || _load_map()).default(precomputedResolutions);
  79700. var locations = new (_map || _load_map()).default();
  79701. // This first pass will compute the package reference of each of the given patterns
  79702. // They will usually be the package version, but not always. We need to do this in a pre-process pass, because the
  79703. // dependencies might depend on one another, so if we need to replace one of them, we need to compute it first
  79704. var _loop = function* _loop(pattern) {
  79705. var entry = getResolverEntry(pattern);
  79706. if (!entry) {
  79707. return 'continue';
  79708. }
  79709. var pkg = entry.pkg,
  79710. ref = entry.ref;
  79711. var loc = entry.loc;
  79712. var packageName = pkg.name;
  79713. var packageReference = pkg.version;
  79714. // If we have peer dependencies, then we generate a new virtual reference based on the parent one
  79715. // We cannot generate this reference based on what those peer references resolve to, because they might not have
  79716. // been computed yet (for example, consider the case where A has a peer dependency on B, and B a peer dependency
  79717. // on A; it's valid, but it prevents us from computing A and B - and it's even worse with 3+ packages involved)
  79718. var peerDependencies = new (_set || _load_set()).default((0, (_from || _load_from()).default)((0, (_keys || _load_keys()).default)(pkg.peerDependencies || {})));
  79719. // As an optimization, we only setup virtual packages if their underlying packages are referenced multiple times
  79720. // in the tree. This allow us to avoid having to create symlinks in the majority of cases
  79721. if (peerDependencies.size > 0 && ref.requests.length > 1) {
  79722. var hash = getHashFrom([].concat(parentData, [packageName, packageReference]));
  79723. var symlinkSource = void 0;
  79724. var symlinkFile = void 0;
  79725. switch (ref.remote.type) {
  79726. case 'workspace':
  79727. {
  79728. symlinkSource = loc;
  79729. symlinkFile = path.resolve(config.lockfileFolder, '.pnp', 'workspaces', `pnp-${hash}`, packageName);
  79730. loc = symlinkFile;
  79731. }
  79732. break;
  79733. default:
  79734. {
  79735. var isFromCache = getCachePath(loc);
  79736. var hashName = isFromCache && offlineCacheFolder ? `pnp-${hash}${OFFLINE_CACHE_EXTENSION}` : `pnp-${hash}`;
  79737. var newLoc = path.resolve(config.lockfileFolder, '.pnp', 'externals', hashName, 'node_modules', packageName);
  79738. // The `node_modules/<pkgName>` part is already there when the package comes from the cache
  79739. if (isFromCache) {
  79740. var getBase = function getBase(source) {
  79741. return path.resolve(source, '../'.repeat(1 + packageName.split('/').length));
  79742. };
  79743. symlinkSource = resolveOfflineCacheFolder(getBase(loc));
  79744. symlinkFile = getBase(newLoc);
  79745. } else {
  79746. symlinkSource = loc;
  79747. symlinkFile = newLoc;
  79748. }
  79749. loc = newLoc;
  79750. }
  79751. break;
  79752. }
  79753. yield (_fs || _load_fs()).mkdirp(path.dirname(symlinkFile));
  79754. yield (_fs || _load_fs()).symlink(symlinkSource, symlinkFile);
  79755. packageReference = `pnp:${hash}`;
  79756. // We blacklist this path so that we can print a nicer error message if someone tries to require it (it usually
  79757. // means that they're using realpath on the return value of require.resolve)
  79758. blacklistedLocations.add(normalizeDirectoryPath(loc));
  79759. }
  79760. // Now that we have the final reference, we need to store it
  79761. resolutions.set(packageName, packageReference);
  79762. locations.set(packageName, loc);
  79763. };
  79764. for (var _iterator11 = seedPatterns, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
  79765. var _ref21;
  79766. if (_isArray11) {
  79767. if (_i11 >= _iterator11.length) break;
  79768. _ref21 = _iterator11[_i11++];
  79769. } else {
  79770. _i11 = _iterator11.next();
  79771. if (_i11.done) break;
  79772. _ref21 = _i11.value;
  79773. }
  79774. var pattern = _ref21;
  79775. var _ret = yield* _loop(pattern);
  79776. if (_ret === 'continue') continue;
  79777. }
  79778. // Now that we have the final references, we can start the main loop, which will insert the packages into the store
  79779. // if they aren't already there, and recurse over their own children
  79780. var _loop2 = function* _loop2(pattern) {
  79781. var entry = getResolverEntry(pattern);
  79782. if (!entry) {
  79783. return 'continue';
  79784. }
  79785. var pkg = entry.pkg,
  79786. ref = entry.ref;
  79787. var packageName = pkg.name;
  79788. var packageReference = resolutions.get(packageName);
  79789. invariant(packageReference, `Package reference should have been computed during the pre-pass`);
  79790. var loc = locations.get(packageName);
  79791. invariant(loc, `Package location should have been computed during the pre-pass`);
  79792. // We can early exit if the package is already registered with the exact same name and reference, since even if
  79793. // we might get slightly different dependencies (depending on how things were optimized), both sets are valid
  79794. var packageInformationStore = packageInformationStores.get(packageName);
  79795. if (!packageInformationStore) {
  79796. packageInformationStore = new (_map || _load_map()).default();
  79797. packageInformationStores.set(packageName, packageInformationStore);
  79798. }
  79799. var packageInformation = packageInformationStore.get(packageReference);
  79800. if (packageInformation) {
  79801. return 'continue';
  79802. }
  79803. packageInformation = {
  79804. packageLocation: normalizeDirectoryPath(loc),
  79805. packageDependencies: new (_map || _load_map()).default()
  79806. };
  79807. // Split the dependencies between direct/peer - we will only recurse on the former
  79808. var peerDependencies = new (_set || _load_set()).default((0, (_from || _load_from()).default)((0, (_keys || _load_keys()).default)(pkg.peerDependencies || {})));
  79809. var directDependencies = ref.dependencies.filter(function (pattern) {
  79810. var pkg = resolver.getStrictResolvedPattern(pattern);
  79811. return !pkg || !peerDependencies.has(pkg.name);
  79812. });
  79813. // We inject the partial information in the store right now so that we won't cycle indefinitely
  79814. packageInformationStore.set(packageReference, packageInformation);
  79815. // We must inject the peer dependencies before iterating; one of our dependencies might have a peer dependency
  79816. // on one of our peer dependencies, so it must be available from the start (we don't have to do that for direct
  79817. // dependencies, because the "visit" function that will iterate over them will automatically add the to the
  79818. // candidate resolutions as part of the first step, cf above)
  79819. for (var _iterator13 = peerDependencies, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) {
  79820. var _ref23;
  79821. if (_isArray13) {
  79822. if (_i13 >= _iterator13.length) break;
  79823. _ref23 = _iterator13[_i13++];
  79824. } else {
  79825. _i13 = _iterator13.next();
  79826. if (_i13.done) break;
  79827. _ref23 = _i13.value;
  79828. }
  79829. var dependencyName = _ref23;
  79830. var dependencyReference = resolutions.get(dependencyName);
  79831. if (dependencyReference) {
  79832. packageInformation.packageDependencies.set(dependencyName, dependencyReference);
  79833. }
  79834. }
  79835. var childResolutions = yield visit(packageInformation.packageDependencies, directDependencies, [packageName, packageReference]);
  79836. // We can now inject into our package the resolutions we got from the visit function
  79837. for (var _iterator14 = childResolutions.entries(), _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) {
  79838. var _ref25;
  79839. if (_isArray14) {
  79840. if (_i14 >= _iterator14.length) break;
  79841. _ref25 = _iterator14[_i14++];
  79842. } else {
  79843. _i14 = _iterator14.next();
  79844. if (_i14.done) break;
  79845. _ref25 = _i14.value;
  79846. }
  79847. var _ref24 = _ref25;
  79848. var name = _ref24[0];
  79849. var reference = _ref24[1];
  79850. packageInformation.packageDependencies.set(name, reference);
  79851. }
  79852. // Finally, unless a package depends on a previous version of itself (that would be weird but correct...), we
  79853. // inject them an implicit dependency to themselves (so that they can require themselves)
  79854. if (!packageInformation.packageDependencies.has(packageName)) {
  79855. packageInformation.packageDependencies.set(packageName, packageReference);
  79856. }
  79857. };
  79858. for (var _iterator12 = seedPatterns, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
  79859. var _ref22;
  79860. if (_isArray12) {
  79861. if (_i12 >= _iterator12.length) break;
  79862. _ref22 = _iterator12[_i12++];
  79863. } else {
  79864. _i12 = _iterator12.next();
  79865. if (_i12.done) break;
  79866. _ref22 = _i12.value;
  79867. }
  79868. var pattern = _ref22;
  79869. var _ret2 = yield* _loop2(pattern);
  79870. if (_ret2 === 'continue') continue;
  79871. }
  79872. return resolutions;
  79873. });
  79874. return function visit(_x4, _x5) {
  79875. return _ref20.apply(this, arguments);
  79876. };
  79877. }();
  79878. // If we have workspaces, we need to iterate over them all in order to add them to the map
  79879. // This is because they might not be declared as dependencies of the top-level project (and with reason, since the
  79880. // top-level package might depend on a different than the one provided in the workspaces - cf Babel, which depends
  79881. // on an old version of itself in order to compile itself)
  79882. if (workspaceLayout) {
  79883. for (var _iterator15 = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) {
  79884. var _ref27;
  79885. if (_isArray15) {
  79886. if (_i15 >= _iterator15.length) break;
  79887. _ref27 = _iterator15[_i15++];
  79888. } else {
  79889. _i15 = _iterator15.next();
  79890. if (_i15.done) break;
  79891. _ref27 = _i15.value;
  79892. }
  79893. var name = _ref27;
  79894. var pkg = workspaceLayout.workspaces[name].manifest;
  79895. // Skip the aggregator, since it's essentially a duplicate of the top-level package that we'll iterate later on
  79896. if (pkg.workspaces) {
  79897. continue;
  79898. }
  79899. var _ref26 = pkg._reference;
  79900. invariant(_ref26, `Workspaces should have a reference`);
  79901. invariant(_ref26.locations.length === 1, `Workspaces should have exactly one location`);
  79902. var _loc = _ref26.locations[0];
  79903. invariant(_loc, `Workspaces should have a location`);
  79904. var _packageInformationStore2 = packageInformationStores.get(name);
  79905. if (!_packageInformationStore2) {
  79906. _packageInformationStore2 = new (_map || _load_map()).default();
  79907. packageInformationStores.set(name, _packageInformationStore2);
  79908. }
  79909. _packageInformationStore2.set(pkg.version, {
  79910. packageLocation: normalizeDirectoryPath(_loc),
  79911. packageDependencies: yield visit(new (_map || _load_map()).default(), _ref26.dependencies, [name, pkg.version])
  79912. });
  79913. }
  79914. }
  79915. // Register the top-level package in our map
  79916. // This will recurse on each of its dependencies as well.
  79917. packageInformationStores.set(null, new (_map || _load_map()).default([[null, {
  79918. packageLocation: normalizeDirectoryPath(config.lockfileFolder),
  79919. packageDependencies: yield visit(new (_map || _load_map()).default(), seedPatterns)
  79920. }]]));
  79921. return [packageInformationStores, blacklistedLocations];
  79922. });
  79923. return function getPackageInformationStores(_x, _x2, _x3) {
  79924. return _ref17.apply(this, arguments);
  79925. };
  79926. }();
  79927. var generatePnpMap = exports.generatePnpMap = function () {
  79928. var _ref28 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, seedPatterns, _ref29) {
  79929. var resolver = _ref29.resolver,
  79930. reporter = _ref29.reporter,
  79931. workspaceLayout = _ref29.workspaceLayout,
  79932. targetPath = _ref29.targetPath;
  79933. var _ref30 = yield getPackageInformationStores(config, seedPatterns, {
  79934. resolver,
  79935. reporter,
  79936. targetPath,
  79937. workspaceLayout
  79938. }),
  79939. packageInformationStores = _ref30[0],
  79940. blacklistedLocations = _ref30[1];
  79941. var setupStaticTables = [generateMaps(packageInformationStores, blacklistedLocations), generateFindPackageLocator(packageInformationStores)].join(``);
  79942. return pnpApi.replace(/\$\$SHEBANG/g, config.plugnplayShebang).replace(/\$\$BLACKLIST/g, (0, (_stringify || _load_stringify()).default)(config.plugnplayBlacklist)).replace(/\$\$SETUP_STATIC_TABLES\(\);/g, setupStaticTables);
  79943. });
  79944. return function generatePnpMap(_x7, _x8, _x9) {
  79945. return _ref28.apply(this, arguments);
  79946. };
  79947. }();
  79948. var _fs;
  79949. function _load_fs() {
  79950. return _fs = _interopRequireWildcard(__webpack_require__(8));
  79951. }
  79952. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  79953. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79954. /* babel-plugin-inline-import './generate-pnp-map-api.tpl.js' */var pnpApi = '#!$$SHEBANG\n\n/* eslint-disable max-len, flowtype/require-valid-file-annotation, flowtype/require-return-type */\n/* global packageInformationStores, $$BLACKLIST, $$SETUP_STATIC_TABLES */\n\n// Used for the resolveUnqualified part of the resolution (ie resolving folder/index.js & file extensions)\n// Deconstructed so that they aren\'t affected by any fs monkeypatching occuring later during the execution\nconst {statSync, lstatSync, readlinkSync, readFileSync, existsSync, realpathSync} = require(\'fs\');\n\nconst Module = require(\'module\');\nconst path = require(\'path\');\nconst StringDecoder = require(\'string_decoder\');\n\nconst ignorePattern = $$BLACKLIST ? new RegExp($$BLACKLIST) : null;\n\nconst pnpFile = path.resolve(__dirname, __filename);\nconst builtinModules = new Set(Module.builtinModules || Object.keys(process.binding(\'natives\')));\n\nconst topLevelLocator = {name: null, reference: null};\nconst blacklistedLocator = {name: NaN, reference: NaN};\n\n// Used for compatibility purposes - cf setupCompatibilityLayer\nconst patchedModules = [];\nconst fallbackLocators = [topLevelLocator];\n\n// Matches backslashes of Windows paths\nconst backwardSlashRegExp = /\\\\/g;\n\n// Matches if the path must point to a directory (ie ends with /)\nconst isDirRegExp = /\\/$/;\n\n// Matches if the path starts with a valid path qualifier (./, ../, /)\n// eslint-disable-next-line no-unused-vars\nconst isStrictRegExp = /^\\.{0,2}\\//;\n\n// Splits a require request into its components, or return null if the request is a file path\nconst pathRegExp = /^(?![a-zA-Z]:[\\\\\\/]|\\\\\\\\|\\.{0,2}(?:\\/|$))((?:@[^\\/]+\\/)?[^\\/]+)\\/?(.*|)$/;\n\n// Keep a reference around ("module" is a common name in this context, so better rename it to something more significant)\nconst pnpModule = module;\n\n/**\n * Used to disable the resolution hooks (for when we want to fallback to the previous resolution - we then need\n * a way to "reset" the environment temporarily)\n */\n\nlet enableNativeHooks = true;\n\n/**\n * Simple helper function that assign an error code to an error, so that it can more easily be caught and used\n * by third-parties.\n */\n\nfunction makeError(code, message, data = {}) {\n const error = new Error(message);\n return Object.assign(error, {code, data});\n}\n\n/**\n * Ensures that the returned locator isn\'t a blacklisted one.\n *\n * Blacklisted packages are packages that cannot be used because their dependencies cannot be deduced. This only\n * happens with peer dependencies, which effectively have different sets of dependencies depending on their parents.\n *\n * In order to deambiguate those different sets of dependencies, the Yarn implementation of PnP will generate a\n * symlink for each combination of <package name>/<package version>/<dependent package> it will find, and will\n * blacklist the target of those symlinks. By doing this, we ensure that files loaded through a specific path\n * will always have the same set of dependencies, provided the symlinks are correctly preserved.\n *\n * Unfortunately, some tools do not preserve them, and when it happens PnP isn\'t able anymore to deduce the set of\n * dependencies based on the path of the file that makes the require calls. But since we\'ve blacklisted those paths,\n * we\'re able to print a more helpful error message that points out that a third-party package is doing something\n * incompatible!\n */\n\n// eslint-disable-next-line no-unused-vars\nfunction blacklistCheck(locator) {\n if (locator === blacklistedLocator) {\n throw makeError(\n `BLACKLISTED`,\n [\n `A package has been resolved through a blacklisted path - this is usually caused by one of your tools calling`,\n `"realpath" on the return value of "require.resolve". Since the returned values use symlinks to disambiguate`,\n `peer dependencies, they must be passed untransformed to "require".`,\n ].join(` `)\n );\n }\n\n return locator;\n}\n\n$$SETUP_STATIC_TABLES();\n\n/**\n * Returns the module that should be used to resolve require calls. It\'s usually the direct parent, except if we\'re\n * inside an eval expression.\n */\n\nfunction getIssuerModule(parent) {\n let issuer = parent;\n\n while (issuer && (issuer.id === \'[eval]\' || issuer.id === \'<repl>\' || !issuer.filename)) {\n issuer = issuer.parent;\n }\n\n return issuer;\n}\n\n/**\n * Returns information about a package in a safe way (will throw if they cannot be retrieved)\n */\n\nfunction getPackageInformationSafe(packageLocator) {\n const packageInformation = exports.getPackageInformation(packageLocator);\n\n if (!packageInformation) {\n throw makeError(\n `INTERNAL`,\n `Couldn\'t find a matching entry in the dependency tree for the specified parent (this is probably an internal error)`\n );\n }\n\n return packageInformation;\n}\n\n/**\n * Implements the node resolution for folder access and extension selection\n */\n\nfunction applyNodeExtensionResolution(unqualifiedPath, {extensions}) {\n // We use this "infinite while" so that we can restart the process as long as we hit package folders\n while (true) {\n let stat;\n\n try {\n stat = statSync(unqualifiedPath);\n } catch (error) {}\n\n // If the file exists and is a file, we can stop right there\n\n if (stat && !stat.isDirectory()) {\n // If the very last component of the resolved path is a symlink to a file, we then resolve it to a file. We only\n // do this first the last component, and not the rest of the path! This allows us to support the case of bin\n // symlinks, where a symlink in "/xyz/pkg-name/.bin/bin-name" will point somewhere else (like "/xyz/pkg-name/index.js").\n // In such a case, we want relative requires to be resolved relative to "/xyz/pkg-name/" rather than "/xyz/pkg-name/.bin/".\n //\n // Also note that the reason we must use readlink on the last component (instead of realpath on the whole path)\n // is that we must preserve the other symlinks, in particular those used by pnp to deambiguate packages using\n // peer dependencies. For example, "/xyz/.pnp/local/pnp-01234569/.bin/bin-name" should see its relative requires\n // be resolved relative to "/xyz/.pnp/local/pnp-0123456789/" rather than "/xyz/pkg-with-peers/", because otherwise\n // we would lose the information that would tell us what are the dependencies of pkg-with-peers relative to its\n // ancestors.\n\n if (lstatSync(unqualifiedPath).isSymbolicLink()) {\n unqualifiedPath = path.normalize(path.resolve(path.dirname(unqualifiedPath), readlinkSync(unqualifiedPath)));\n }\n\n return unqualifiedPath;\n }\n\n // If the file is a directory, we must check if it contains a package.json with a "main" entry\n\n if (stat && stat.isDirectory()) {\n let pkgJson;\n\n try {\n pkgJson = JSON.parse(readFileSync(`${unqualifiedPath}/package.json`, \'utf-8\'));\n } catch (error) {}\n\n let nextUnqualifiedPath;\n\n if (pkgJson && pkgJson.main) {\n nextUnqualifiedPath = path.resolve(unqualifiedPath, pkgJson.main);\n }\n\n // If the "main" field changed the path, we start again from this new location\n\n if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) {\n const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, {extensions});\n\n if (resolution !== null) {\n return resolution;\n }\n }\n }\n\n // Otherwise we check if we find a file that match one of the supported extensions\n\n const qualifiedPath = extensions\n .map(extension => {\n return `${unqualifiedPath}${extension}`;\n })\n .find(candidateFile => {\n return existsSync(candidateFile);\n });\n\n if (qualifiedPath) {\n return qualifiedPath;\n }\n\n // Otherwise, we check if the path is a folder - in such a case, we try to use its index\n\n if (stat && stat.isDirectory()) {\n const indexPath = extensions\n .map(extension => {\n return `${unqualifiedPath}/index${extension}`;\n })\n .find(candidateFile => {\n return existsSync(candidateFile);\n });\n\n if (indexPath) {\n return indexPath;\n }\n }\n\n // Otherwise there\'s nothing else we can do :(\n\n return null;\n }\n}\n\n/**\n * This function creates fake modules that can be used with the _resolveFilename function.\n * Ideally it would be nice to be able to avoid this, since it causes useless allocations\n * and cannot be cached efficiently (we recompute the nodeModulePaths every time).\n *\n * Fortunately, this should only affect the fallback, and there hopefully shouldn\'t be a\n * lot of them.\n */\n\nfunction makeFakeModule(path) {\n const fakeModule = new Module(path, false);\n fakeModule.filename = path;\n fakeModule.paths = Module._nodeModulePaths(path);\n return fakeModule;\n}\n\n/**\n * Normalize path to posix format.\n */\n\nfunction normalizePath(fsPath) {\n fsPath = path.normalize(fsPath);\n\n if (process.platform === \'win32\') {\n fsPath = fsPath.replace(backwardSlashRegExp, \'/\');\n }\n\n return fsPath;\n}\n\n/**\n * Forward the resolution to the next resolver (usually the native one)\n */\n\nfunction callNativeResolution(request, issuer) {\n if (issuer.endsWith(\'/\')) {\n issuer += \'internal.js\';\n }\n\n try {\n enableNativeHooks = false;\n\n // Since we would need to create a fake module anyway (to call _resolveLookupPath that\n // would give us the paths to give to _resolveFilename), we can as well not use\n // the {paths} option at all, since it internally makes _resolveFilename create another\n // fake module anyway.\n return Module._resolveFilename(request, makeFakeModule(issuer), false);\n } finally {\n enableNativeHooks = true;\n }\n}\n\n/**\n * This key indicates which version of the standard is implemented by this resolver. The `std` key is the\n * Plug\'n\'Play standard, and any other key are third-party extensions. Third-party extensions are not allowed\n * to override the standard, and can only offer new methods.\n *\n * If an new version of the Plug\'n\'Play standard is released and some extensions conflict with newly added\n * functions, they\'ll just have to fix the conflicts and bump their own version number.\n */\n\nexports.VERSIONS = {std: 1};\n\n/**\n * Useful when used together with getPackageInformation to fetch information about the top-level package.\n */\n\nexports.topLevel = {name: null, reference: null};\n\n/**\n * Gets the package information for a given locator. Returns null if they cannot be retrieved.\n */\n\nexports.getPackageInformation = function getPackageInformation({name, reference}) {\n const packageInformationStore = packageInformationStores.get(name);\n\n if (!packageInformationStore) {\n return null;\n }\n\n const packageInformation = packageInformationStore.get(reference);\n\n if (!packageInformation) {\n return null;\n }\n\n return packageInformation;\n};\n\n/**\n * Transforms a request (what\'s typically passed as argument to the require function) into an unqualified path.\n * This path is called "unqualified" because it only changes the package name to the package location on the disk,\n * which means that the end result still cannot be directly accessed (for example, it doesn\'t try to resolve the\n * file extension, or to resolve directories to their "index.js" content). Use the "resolveUnqualified" function\n * to convert them to fully-qualified paths, or just use "resolveRequest" that do both operations in one go.\n *\n * Note that it is extremely important that the `issuer` path ends with a forward slash if the issuer is to be\n * treated as a folder (ie. "/tmp/foo/" rather than "/tmp/foo" if "foo" is a directory). Otherwise relative\n * imports won\'t be computed correctly (they\'ll get resolved relative to "/tmp/" instead of "/tmp/foo/").\n */\n\nexports.resolveToUnqualified = function resolveToUnqualified(request, issuer, {considerBuiltins = true} = {}) {\n // The \'pnpapi\' request is reserved and will always return the path to the PnP file, from everywhere\n\n if (request === `pnpapi`) {\n return pnpFile;\n }\n\n // Bailout if the request is a native module\n\n if (considerBuiltins && builtinModules.has(request)) {\n return null;\n }\n\n // We allow disabling the pnp resolution for some subpaths. This is because some projects, often legacy,\n // contain multiple levels of dependencies (ie. a yarn.lock inside a subfolder of a yarn.lock). This is\n // typically solved using workspaces, but not all of them have been converted already.\n\n if (ignorePattern && ignorePattern.test(normalizePath(issuer))) {\n const result = callNativeResolution(request, issuer);\n\n if (result === false) {\n throw makeError(\n `BUILTIN_NODE_RESOLUTION_FAIL`,\n `The builtin node resolution algorithm was unable to resolve the module referenced by "${request}" and requested from "${issuer}" (it didn\'t go through the pnp resolver because the issuer was explicitely ignored by the regexp "$$BLACKLIST")`,\n {\n request,\n issuer,\n }\n );\n }\n\n return result;\n }\n\n let unqualifiedPath;\n\n // If the request is a relative or absolute path, we just return it normalized\n\n const dependencyNameMatch = request.match(pathRegExp);\n\n if (!dependencyNameMatch) {\n if (path.isAbsolute(request)) {\n unqualifiedPath = path.normalize(request);\n } else if (issuer.match(isDirRegExp)) {\n unqualifiedPath = path.normalize(path.resolve(issuer, request));\n } else {\n unqualifiedPath = path.normalize(path.resolve(path.dirname(issuer), request));\n }\n }\n\n // Things are more hairy if it\'s a package require - we then need to figure out which package is needed, and in\n // particular the exact version for the given location on the dependency tree\n\n if (dependencyNameMatch) {\n const [, dependencyName, subPath] = dependencyNameMatch;\n\n const issuerLocator = exports.findPackageLocator(issuer);\n\n // If the issuer file doesn\'t seem to be owned by a package managed through pnp, then we resort to using the next\n // resolution algorithm in the chain, usually the native Node resolution one\n\n if (!issuerLocator) {\n const result = callNativeResolution(request, issuer);\n\n if (result === false) {\n throw makeError(\n `BUILTIN_NODE_RESOLUTION_FAIL`,\n `The builtin node resolution algorithm was unable to resolve the module referenced by "${request}" and requested from "${issuer}" (it didn\'t go through the pnp resolver because the issuer doesn\'t seem to be part of the Yarn-managed dependency tree)`,\n {\n request,\n issuer,\n }\n );\n }\n\n return result;\n }\n\n const issuerInformation = getPackageInformationSafe(issuerLocator);\n\n // We obtain the dependency reference in regard to the package that request it\n\n let dependencyReference = issuerInformation.packageDependencies.get(dependencyName);\n\n // If we can\'t find it, we check if we can potentially load it from the packages that have been defined as potential fallbacks.\n // It\'s a bit of a hack, but it improves compatibility with the existing Node ecosystem. Hopefully we should eventually be able\n // to kill this logic and become stricter once pnp gets enough traction and the affected packages fix themselves.\n\n if (issuerLocator !== topLevelLocator) {\n for (let t = 0, T = fallbackLocators.length; dependencyReference === undefined && t < T; ++t) {\n const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]);\n dependencyReference = fallbackInformation.packageDependencies.get(dependencyName);\n }\n }\n\n // If we can\'t find the path, and if the package making the request is the top-level, we can offer nicer error messages\n\n if (!dependencyReference) {\n if (dependencyReference === null) {\n if (issuerLocator === topLevelLocator) {\n throw makeError(\n `MISSING_PEER_DEPENDENCY`,\n `You seem to be requiring a peer dependency ("${dependencyName}"), but it is not installed (which might be because you\'re the top-level package)`,\n {request, issuer, dependencyName}\n );\n } else {\n throw makeError(\n `MISSING_PEER_DEPENDENCY`,\n `Package "${issuerLocator.name}@${issuerLocator.reference}" is trying to access a peer dependency ("${dependencyName}") that should be provided by its direct ancestor but isn\'t`,\n {request, issuer, issuerLocator: Object.assign({}, issuerLocator), dependencyName}\n );\n }\n } else {\n if (issuerLocator === topLevelLocator) {\n throw makeError(\n `UNDECLARED_DEPENDENCY`,\n `You cannot require a package ("${dependencyName}") that is not declared in your dependencies (via "${issuer}")`,\n {request, issuer, dependencyName}\n );\n } else {\n const candidates = Array.from(issuerInformation.packageDependencies.keys());\n throw makeError(\n `UNDECLARED_DEPENDENCY`,\n `Package "${issuerLocator.name}@${issuerLocator.reference}" (via "${issuer}") is trying to require the package "${dependencyName}" (via "${request}") without it being listed in its dependencies (${candidates.join(\n `, `\n )})`,\n {request, issuer, issuerLocator: Object.assign({}, issuerLocator), dependencyName, candidates}\n );\n }\n }\n }\n\n // We need to check that the package exists on the filesystem, because it might not have been installed\n\n const dependencyLocator = {name: dependencyName, reference: dependencyReference};\n const dependencyInformation = exports.getPackageInformation(dependencyLocator);\n const dependencyLocation = path.resolve(__dirname, dependencyInformation.packageLocation);\n\n if (!dependencyLocation) {\n throw makeError(\n `MISSING_DEPENDENCY`,\n `Package "${dependencyLocator.name}@${dependencyLocator.reference}" is a valid dependency, but hasn\'t been installed and thus cannot be required (it might be caused if you install a partial tree, such as on production environments)`,\n {request, issuer, dependencyLocator: Object.assign({}, dependencyLocator)}\n );\n }\n\n // Now that we know which package we should resolve to, we only have to find out the file location\n\n if (subPath) {\n unqualifiedPath = path.resolve(dependencyLocation, subPath);\n } else {\n unqualifiedPath = dependencyLocation;\n }\n }\n\n return path.normalize(unqualifiedPath);\n};\n\n/**\n * Transforms an unqualified path into a qualified path by using the Node resolution algorithm (which automatically\n * appends ".js" / ".json", and transforms directory accesses into "index.js").\n */\n\nexports.resolveUnqualified = function resolveUnqualified(\n unqualifiedPath,\n {extensions = Object.keys(Module._extensions)} = {}\n) {\n const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, {extensions});\n\n if (qualifiedPath) {\n return path.normalize(qualifiedPath);\n } else {\n throw makeError(\n `QUALIFIED_PATH_RESOLUTION_FAILED`,\n `Couldn\'t find a suitable Node resolution for unqualified path "${unqualifiedPath}"`,\n {unqualifiedPath}\n );\n }\n};\n\n/**\n * Transforms a request into a fully qualified path.\n *\n * Note that it is extremely important that the `issuer` path ends with a forward slash if the issuer is to be\n * treated as a folder (ie. "/tmp/foo/" rather than "/tmp/foo" if "foo" is a directory). Otherwise relative\n * imports won\'t be computed correctly (they\'ll get resolved relative to "/tmp/" instead of "/tmp/foo/").\n */\n\nexports.resolveRequest = function resolveRequest(request, issuer, {considerBuiltins, extensions} = {}) {\n let unqualifiedPath;\n\n try {\n unqualifiedPath = exports.resolveToUnqualified(request, issuer, {considerBuiltins});\n } catch (originalError) {\n // If we get a BUILTIN_NODE_RESOLUTION_FAIL error there, it means that we\'ve had to use the builtin node\n // resolution, which usually shouldn\'t happen. It might be because the user is trying to require something\n // from a path loaded through a symlink (which is not possible, because we need something normalized to\n // figure out which package is making the require call), so we try to make the same request using a fully\n // resolved issuer and throws a better and more actionable error if it works.\n if (originalError.code === `BUILTIN_NODE_RESOLUTION_FAIL`) {\n let realIssuer;\n\n try {\n realIssuer = realpathSync(issuer);\n } catch (error) {}\n\n if (realIssuer) {\n if (issuer.endsWith(`/`)) {\n realIssuer = realIssuer.replace(/\\/?$/, `/`);\n }\n\n try {\n exports.resolveToUnqualified(request, realIssuer, {considerBuiltins});\n } catch (error) {\n // If an error was thrown, the problem doesn\'t seem to come from a path not being normalized, so we\n // can just throw the original error which was legit.\n throw originalError;\n }\n\n // If we reach this stage, it means that resolveToUnqualified didn\'t fail when using the fully resolved\n // file path, which is very likely caused by a module being invoked through Node with a path not being\n // correctly normalized (ie you should use "node $(realpath script.js)" instead of "node script.js").\n throw makeError(\n `SYMLINKED_PATH_DETECTED`,\n `A pnp module ("${request}") has been required from what seems to be a symlinked path ("${issuer}"). This is not possible, you must ensure that your modules are invoked through their fully resolved path on the filesystem (in this case "${realIssuer}").`,\n {\n request,\n issuer,\n realIssuer,\n }\n );\n }\n }\n throw originalError;\n }\n\n if (unqualifiedPath === null) {\n return null;\n }\n\n try {\n return exports.resolveUnqualified(unqualifiedPath, {extensions});\n } catch (resolutionError) {\n if (resolutionError.code === \'QUALIFIED_PATH_RESOLUTION_FAILED\') {\n Object.assign(resolutionError.data, {request, issuer});\n }\n throw resolutionError;\n }\n};\n\n/**\n * Setups the hook into the Node environment.\n *\n * From this point on, any call to `require()` will go through the "resolveRequest" function, and the result will\n * be used as path of the file to load.\n */\n\nexports.setup = function setup() {\n // A small note: we don\'t replace the cache here (and instead use the native one). This is an effort to not\n // break code similar to "delete require.cache[require.resolve(FOO)]", where FOO is a package located outside\n // of the Yarn dependency tree. In this case, we defer the load to the native loader. If we were to replace the\n // cache by our own, the native loader would populate its own cache, which wouldn\'t be exposed anymore, so the\n // delete call would be broken.\n\n const originalModuleLoad = Module._load;\n\n Module._load = function(request, parent, isMain) {\n if (!enableNativeHooks) {\n return originalModuleLoad.call(Module, request, parent, isMain);\n }\n\n // Builtins are managed by the regular Node loader\n\n if (builtinModules.has(request)) {\n try {\n enableNativeHooks = false;\n return originalModuleLoad.call(Module, request, parent, isMain);\n } finally {\n enableNativeHooks = true;\n }\n }\n\n // The \'pnpapi\' name is reserved to return the PnP api currently in use by the program\n\n if (request === `pnpapi`) {\n return pnpModule.exports;\n }\n\n // Request `Module._resolveFilename` (ie. `resolveRequest`) to tell us which file we should load\n\n const modulePath = Module._resolveFilename(request, parent, isMain);\n\n // Check if the module has already been created for the given file\n\n const cacheEntry = Module._cache[modulePath];\n\n if (cacheEntry) {\n return cacheEntry.exports;\n }\n\n // Create a new module and store it into the cache\n\n const module = new Module(modulePath, parent);\n Module._cache[modulePath] = module;\n\n // The main module is exposed as global variable\n\n if (isMain) {\n process.mainModule = module;\n module.id = \'.\';\n }\n\n // Try to load the module, and remove it from the cache if it fails\n\n let hasThrown = true;\n\n try {\n module.load(modulePath);\n hasThrown = false;\n } finally {\n if (hasThrown) {\n delete Module._cache[modulePath];\n }\n }\n\n // Some modules might have to be patched for compatibility purposes\n\n for (const [filter, patchFn] of patchedModules) {\n if (filter.test(request)) {\n module.exports = patchFn(exports.findPackageLocator(parent.filename), module.exports);\n }\n }\n\n return module.exports;\n };\n\n const originalModuleResolveFilename = Module._resolveFilename;\n\n Module._resolveFilename = function(request, parent, isMain, options) {\n if (!enableNativeHooks) {\n return originalModuleResolveFilename.call(Module, request, parent, isMain, options);\n }\n\n let issuers;\n\n if (options) {\n const optionNames = new Set(Object.keys(options));\n optionNames.delete(\'paths\');\n\n if (optionNames.size > 0) {\n throw makeError(\n `UNSUPPORTED`,\n `Some options passed to require() aren\'t supported by PnP yet (${Array.from(optionNames).join(\', \')})`\n );\n }\n\n if (options.paths) {\n issuers = options.paths.map(entry => `${path.normalize(entry)}/`);\n }\n }\n\n if (!issuers) {\n const issuerModule = getIssuerModule(parent);\n const issuer = issuerModule ? issuerModule.filename : `${process.cwd()}/`;\n\n issuers = [issuer];\n }\n\n let firstError;\n\n for (const issuer of issuers) {\n let resolution;\n\n try {\n resolution = exports.resolveRequest(request, issuer);\n } catch (error) {\n firstError = firstError || error;\n continue;\n }\n\n return resolution !== null ? resolution : request;\n }\n\n throw firstError;\n };\n\n const originalFindPath = Module._findPath;\n\n Module._findPath = function(request, paths, isMain) {\n if (!enableNativeHooks) {\n return originalFindPath.call(Module, request, paths, isMain);\n }\n\n for (const path of paths || []) {\n let resolution;\n\n try {\n resolution = exports.resolveRequest(request, path);\n } catch (error) {\n continue;\n }\n\n if (resolution) {\n return resolution;\n }\n }\n\n return false;\n };\n\n process.versions.pnp = String(exports.VERSIONS.std);\n};\n\nexports.setupCompatibilityLayer = () => {\n // ESLint currently doesn\'t have any portable way for shared configs to specify their own\n // plugins that should be used (https://github.com/eslint/eslint/issues/10125). This will\n // likely get fixed at some point, but it\'ll take time and in the meantime we\'ll just add\n // additional fallback entries for common shared configs.\n\n for (const name of [`react-scripts`]) {\n const packageInformationStore = packageInformationStores.get(name);\n if (packageInformationStore) {\n for (const reference of packageInformationStore.keys()) {\n fallbackLocators.push({name, reference});\n }\n }\n }\n\n // Modern versions of `resolve` support a specific entry point that custom resolvers can use\n // to inject a specific resolution logic without having to patch the whole package.\n //\n // Cf: https://github.com/browserify/resolve/pull/174\n\n patchedModules.push([\n /^\\.\\/normalize-options\\.js$/,\n (issuer, normalizeOptions) => {\n if (!issuer || issuer.name !== \'resolve\') {\n return normalizeOptions;\n }\n\n return (request, opts) => {\n opts = opts || {};\n\n if (opts.forceNodeResolution) {\n return opts;\n }\n\n opts.preserveSymlinks = true;\n opts.paths = function(request, basedir, getNodeModulesDir, opts) {\n // Extract the name of the package being requested (1=full name, 2=scope name, 3=local name)\n const parts = request.match(/^((?:(@[^\\/]+)\\/)?([^\\/]+))/);\n\n // make sure that basedir ends with a slash\n if (basedir.charAt(basedir.length - 1) !== \'/\') {\n basedir = path.join(basedir, \'/\');\n }\n // This is guaranteed to return the path to the "package.json" file from the given package\n const manifestPath = exports.resolveToUnqualified(`${parts[1]}/package.json`, basedir);\n\n // The first dirname strips the package.json, the second strips the local named folder\n let nodeModules = path.dirname(path.dirname(manifestPath));\n\n // Strips the scope named folder if needed\n if (parts[2]) {\n nodeModules = path.dirname(nodeModules);\n }\n\n return [nodeModules];\n };\n\n return opts;\n };\n },\n ]);\n};\n\nif (module.parent && module.parent.id === \'internal/preload\') {\n exports.setupCompatibilityLayer();\n\n exports.setup();\n}\n\nif (process.mainModule === module) {\n exports.setupCompatibilityLayer();\n\n const reportError = (code, message, data) => {\n process.stdout.write(`${JSON.stringify([{code, message, data}, null])}\\n`);\n };\n\n const reportSuccess = resolution => {\n process.stdout.write(`${JSON.stringify([null, resolution])}\\n`);\n };\n\n const processResolution = (request, issuer) => {\n try {\n reportSuccess(exports.resolveRequest(request, issuer));\n } catch (error) {\n reportError(error.code, error.message, error.data);\n }\n };\n\n const processRequest = data => {\n try {\n const [request, issuer] = JSON.parse(data);\n processResolution(request, issuer);\n } catch (error) {\n reportError(`INVALID_JSON`, error.message, error.data);\n }\n };\n\n if (process.argv.length > 2) {\n if (process.argv.length !== 4) {\n process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} <request> <issuer>\\n`);\n process.exitCode = 64; /* EX_USAGE */\n } else {\n processResolution(process.argv[2], process.argv[3]);\n }\n } else {\n let buffer = \'\';\n const decoder = new StringDecoder.StringDecoder();\n\n process.stdin.on(\'data\', chunk => {\n buffer += decoder.write(chunk);\n\n do {\n const index = buffer.indexOf(\'\\n\');\n if (index === -1) {\n break;\n }\n\n const line = buffer.slice(0, index);\n buffer = buffer.slice(index + 1);\n\n processRequest(line);\n } while (true);\n });\n }\n}\n';
  79955. var crypto = __webpack_require__(21);
  79956. var invariant = __webpack_require__(15);
  79957. var path = __webpack_require__(1);
  79958. var backwardSlashRegExp = /\\/g;
  79959. var OFFLINE_CACHE_EXTENSION = `.zip`;
  79960. function generateMaps(packageInformationStores, blacklistedLocations) {
  79961. var code = ``;
  79962. // Bake the information stores into our generated code
  79963. code += `let packageInformationStores = new Map([\n`;
  79964. for (var _iterator = packageInformationStores, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  79965. var _ref2;
  79966. if (_isArray) {
  79967. if (_i >= _iterator.length) break;
  79968. _ref2 = _iterator[_i++];
  79969. } else {
  79970. _i = _iterator.next();
  79971. if (_i.done) break;
  79972. _ref2 = _i.value;
  79973. }
  79974. var _ref = _ref2;
  79975. var packageName = _ref[0];
  79976. var packageInformationStore = _ref[1];
  79977. code += ` [${(0, (_stringify || _load_stringify()).default)(packageName)}, new Map([\n`;
  79978. for (var _iterator4 = packageInformationStore, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  79979. var _ref7;
  79980. if (_isArray4) {
  79981. if (_i4 >= _iterator4.length) break;
  79982. _ref7 = _iterator4[_i4++];
  79983. } else {
  79984. _i4 = _iterator4.next();
  79985. if (_i4.done) break;
  79986. _ref7 = _i4.value;
  79987. }
  79988. var _ref6 = _ref7;
  79989. var packageReference = _ref6[0];
  79990. var _ref6$ = _ref6[1];
  79991. var _packageLocation = _ref6$.packageLocation;
  79992. var _packageDependencies = _ref6$.packageDependencies;
  79993. code += ` [${(0, (_stringify || _load_stringify()).default)(packageReference)}, {\n`;
  79994. code += ` packageLocation: path.resolve(__dirname, ${(0, (_stringify || _load_stringify()).default)(_packageLocation)}),\n`;
  79995. code += ` packageDependencies: new Map([\n`;
  79996. for (var _iterator5 = _packageDependencies.entries(), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  79997. var _ref9;
  79998. if (_isArray5) {
  79999. if (_i5 >= _iterator5.length) break;
  80000. _ref9 = _iterator5[_i5++];
  80001. } else {
  80002. _i5 = _iterator5.next();
  80003. if (_i5.done) break;
  80004. _ref9 = _i5.value;
  80005. }
  80006. var _ref8 = _ref9;
  80007. var dependencyName = _ref8[0];
  80008. var dependencyReference = _ref8[1];
  80009. code += ` [${(0, (_stringify || _load_stringify()).default)(dependencyName)}, ${(0, (_stringify || _load_stringify()).default)(dependencyReference)}],\n`;
  80010. }
  80011. code += ` ]),\n`;
  80012. code += ` }],\n`;
  80013. }
  80014. code += ` ])],\n`;
  80015. }
  80016. code += `]);\n`;
  80017. code += `\n`;
  80018. // Also bake an inverse map that will allow us to find the package information based on the path
  80019. code += `let locatorsByLocations = new Map([\n`;
  80020. for (var _iterator2 = blacklistedLocations, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  80021. var _ref3;
  80022. if (_isArray2) {
  80023. if (_i2 >= _iterator2.length) break;
  80024. _ref3 = _iterator2[_i2++];
  80025. } else {
  80026. _i2 = _iterator2.next();
  80027. if (_i2.done) break;
  80028. _ref3 = _i2.value;
  80029. }
  80030. var blacklistedLocation = _ref3;
  80031. code += ` [${(0, (_stringify || _load_stringify()).default)(blacklistedLocation)}, blacklistedLocator],\n`;
  80032. }
  80033. for (var _iterator3 = packageInformationStores, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  80034. var _ref5;
  80035. if (_isArray3) {
  80036. if (_i3 >= _iterator3.length) break;
  80037. _ref5 = _iterator3[_i3++];
  80038. } else {
  80039. _i3 = _iterator3.next();
  80040. if (_i3.done) break;
  80041. _ref5 = _i3.value;
  80042. }
  80043. var _ref4 = _ref5;
  80044. var _packageName = _ref4[0];
  80045. var _packageInformationStore = _ref4[1];
  80046. for (var _iterator6 = _packageInformationStore, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  80047. var _ref11;
  80048. if (_isArray6) {
  80049. if (_i6 >= _iterator6.length) break;
  80050. _ref11 = _iterator6[_i6++];
  80051. } else {
  80052. _i6 = _iterator6.next();
  80053. if (_i6.done) break;
  80054. _ref11 = _i6.value;
  80055. }
  80056. var _ref10 = _ref11;
  80057. var _packageReference = _ref10[0];
  80058. var _packageLocation2 = _ref10[1].packageLocation;
  80059. if (_packageName !== null) {
  80060. code += ` [${(0, (_stringify || _load_stringify()).default)(_packageLocation2)}, ${(0, (_stringify || _load_stringify()).default)({
  80061. name: _packageName,
  80062. reference: _packageReference
  80063. })}],\n`;
  80064. } else {
  80065. code += ` [${(0, (_stringify || _load_stringify()).default)(_packageLocation2)}, topLevelLocator],\n`;
  80066. }
  80067. }
  80068. }
  80069. code += `]);\n`;
  80070. return code;
  80071. }
  80072. function generateFindPackageLocator(packageInformationStores) {
  80073. var code = ``;
  80074. // We get the list of each string length we'll need to check in order to find the current package context
  80075. var lengths = new (_map || _load_map()).default();
  80076. for (var _iterator7 = packageInformationStores.values(), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  80077. var _ref12;
  80078. if (_isArray7) {
  80079. if (_i7 >= _iterator7.length) break;
  80080. _ref12 = _iterator7[_i7++];
  80081. } else {
  80082. _i7 = _iterator7.next();
  80083. if (_i7.done) break;
  80084. _ref12 = _i7.value;
  80085. }
  80086. var packageInformationStore = _ref12;
  80087. for (var _iterator9 = packageInformationStore.values(), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
  80088. var _ref16;
  80089. if (_isArray9) {
  80090. if (_i9 >= _iterator9.length) break;
  80091. _ref16 = _iterator9[_i9++];
  80092. } else {
  80093. _i9 = _iterator9.next();
  80094. if (_i9.done) break;
  80095. _ref16 = _i9.value;
  80096. }
  80097. var _ref15 = _ref16;
  80098. var _packageLocation3 = _ref15.packageLocation;
  80099. if (_packageLocation3 === null) {
  80100. continue;
  80101. }
  80102. var _length = _packageLocation3.length;
  80103. var count = (lengths.get(_length) || 0) + 1;
  80104. lengths.set(_length, count);
  80105. }
  80106. }
  80107. // We must try the larger lengths before the smaller ones, because smaller ones might also match the longest ones
  80108. // (for instance, /project/path will match /project/path/.pnp/global/node_modules/pnp-cf5f9c17b8f8db)
  80109. var sortedLengths = (0, (_from || _load_from()).default)(lengths.entries()).sort(function (a, b) {
  80110. return b[0] - a[0];
  80111. });
  80112. // Generate a function that, given a file path, returns the associated package name
  80113. code += `exports.findPackageLocator = function findPackageLocator(location) {\n`;
  80114. code += ` let relativeLocation = normalizePath(path.relative(__dirname, location));\n`;
  80115. code += `\n`;
  80116. code += ` if (!relativeLocation.match(isStrictRegExp))\n`;
  80117. code += ` relativeLocation = \`./\${relativeLocation}\`;\n`;
  80118. code += `\n`;
  80119. code += ` if (location.match(isDirRegExp) && relativeLocation.charAt(relativeLocation.length - 1) !== '/')\n`;
  80120. code += ` relativeLocation = \`\${relativeLocation}/\`;\n`;
  80121. code += `\n`;
  80122. code += ` let match;\n`;
  80123. for (var _iterator8 = sortedLengths, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
  80124. var _ref14;
  80125. if (_isArray8) {
  80126. if (_i8 >= _iterator8.length) break;
  80127. _ref14 = _iterator8[_i8++];
  80128. } else {
  80129. _i8 = _iterator8.next();
  80130. if (_i8.done) break;
  80131. _ref14 = _i8.value;
  80132. }
  80133. var _ref13 = _ref14;
  80134. var length = _ref13[0];
  80135. code += `\n`;
  80136. code += ` if (relativeLocation.length >= ${length} && relativeLocation[${length - 1}] === '/')\n`;
  80137. code += ` if (match = locatorsByLocations.get(relativeLocation.substr(0, ${length})))\n`;
  80138. code += ` return blacklistCheck(match);\n`;
  80139. }
  80140. code += `\n`;
  80141. code += ` return null;\n`;
  80142. code += `};\n`;
  80143. return code;
  80144. }
  80145. /***/ }),
  80146. /* 537 */
  80147. /***/ (function(module, exports, __webpack_require__) {
  80148. "use strict";
  80149. Object.defineProperty(exports, "__esModule", {
  80150. value: true
  80151. });
  80152. var _getIterator2;
  80153. function _load_getIterator() {
  80154. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  80155. }
  80156. var _set;
  80157. function _load_set() {
  80158. return _set = _interopRequireDefault(__webpack_require__(16));
  80159. }
  80160. var _keys;
  80161. function _load_keys() {
  80162. return _keys = _interopRequireDefault(__webpack_require__(14));
  80163. }
  80164. exports.getTransitiveDevDependencies = getTransitiveDevDependencies;
  80165. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80166. function dependenciesObjectToPatterns(dependencies) {
  80167. if (!dependencies) {
  80168. return [];
  80169. }
  80170. return (0, (_keys || _load_keys()).default)(dependencies).map(function (name) {
  80171. return `${name}@${(dependencies || {})[name]}`;
  80172. });
  80173. }
  80174. // Enumerate all the transitive dependencies of a set of top-level packages
  80175. function getTransitiveDependencies(lockfile, roots) {
  80176. // Queue of dependency patterns to visit; set of already-visited patterns
  80177. var queue = [];
  80178. var patterns = new (_set || _load_set()).default();
  80179. var enqueue = function enqueue(pattern) {
  80180. if (patterns.has(pattern)) {
  80181. return;
  80182. }
  80183. patterns.add(pattern);
  80184. queue.push(pattern);
  80185. };
  80186. roots.forEach(enqueue);
  80187. // Final result set
  80188. var transitiveDependencies = new (_set || _load_set()).default();
  80189. while (queue.length > 0) {
  80190. var pattern = queue.shift();
  80191. var lockManifest = lockfile.getLocked(pattern);
  80192. if (!lockManifest) {
  80193. continue;
  80194. }
  80195. // Add the dependency to the result set
  80196. transitiveDependencies.add(`${lockManifest.name}@${lockManifest.version}`);
  80197. // Enqueue any dependencies of the dependency for processing
  80198. var dependencyPatterns = dependenciesObjectToPatterns(lockManifest.dependencies);
  80199. dependencyPatterns.forEach(enqueue);
  80200. var optionalDependencyPatterns = dependenciesObjectToPatterns(lockManifest.optionalDependencies);
  80201. optionalDependencyPatterns.forEach(enqueue);
  80202. }
  80203. return transitiveDependencies;
  80204. }
  80205. function setDifference(x, y) {
  80206. return new (_set || _load_set()).default([].concat(x).filter(function (value) {
  80207. return !y.has(value);
  80208. }));
  80209. }
  80210. // Given a manifest, an optional workspace layout, and a lockfile, enumerate
  80211. // all package versions that:
  80212. // i) are present in the lockfile
  80213. // ii) are a transitive dependency of some top-level devDependency
  80214. // iii) are not a transitive dependency of some top-level production dependency
  80215. function getTransitiveDevDependencies(packageManifest, workspaceLayout, lockfile) {
  80216. // Enumerate the top-level package manifest as well as any workspace manifests
  80217. var manifests = [packageManifest];
  80218. if (workspaceLayout) {
  80219. for (var _iterator = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  80220. var _ref;
  80221. if (_isArray) {
  80222. if (_i >= _iterator.length) break;
  80223. _ref = _iterator[_i++];
  80224. } else {
  80225. _i = _iterator.next();
  80226. if (_i.done) break;
  80227. _ref = _i.value;
  80228. }
  80229. var name = _ref;
  80230. manifests.push(workspaceLayout.workspaces[name].manifest);
  80231. }
  80232. }
  80233. // Collect all the top-level production and development dependencies across all manifests
  80234. var productionRoots = [];
  80235. var developmentRoots = [];
  80236. for (var _iterator2 = manifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  80237. var _ref2;
  80238. if (_isArray2) {
  80239. if (_i2 >= _iterator2.length) break;
  80240. _ref2 = _iterator2[_i2++];
  80241. } else {
  80242. _i2 = _iterator2.next();
  80243. if (_i2.done) break;
  80244. _ref2 = _i2.value;
  80245. }
  80246. var manifest = _ref2;
  80247. productionRoots = productionRoots.concat(dependenciesObjectToPatterns(manifest.dependencies));
  80248. productionRoots = productionRoots.concat(dependenciesObjectToPatterns(manifest.optionalDependencies));
  80249. developmentRoots = developmentRoots.concat(dependenciesObjectToPatterns(manifest.devDependencies));
  80250. }
  80251. // Enumerate all the transitive production and development dependencies
  80252. var productionDependencies = getTransitiveDependencies(lockfile, productionRoots);
  80253. var developmentDependencies = getTransitiveDependencies(lockfile, developmentRoots);
  80254. // Exclude any development dependencies that are also production dependencies
  80255. return setDifference(developmentDependencies, productionDependencies);
  80256. }
  80257. /***/ }),
  80258. /* 538 */
  80259. /***/ (function(module, exports, __webpack_require__) {
  80260. "use strict";
  80261. Object.defineProperty(exports, "__esModule", {
  80262. value: true
  80263. });
  80264. exports.parseRefs = exports.resolveVersion = exports.isCommitSha = undefined;
  80265. var _map;
  80266. function _load_map() {
  80267. return _map = _interopRequireDefault(__webpack_require__(42));
  80268. }
  80269. var _asyncToGenerator2;
  80270. function _load_asyncToGenerator() {
  80271. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  80272. }
  80273. var _getIterator2;
  80274. function _load_getIterator() {
  80275. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  80276. }
  80277. var _promise;
  80278. function _load_promise() {
  80279. return _promise = _interopRequireDefault(__webpack_require__(7));
  80280. }
  80281. var _misc;
  80282. function _load_misc() {
  80283. return _misc = __webpack_require__(28);
  80284. }
  80285. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80286. var semver = __webpack_require__(27);
  80287. var REF_PREFIX = 'refs/';
  80288. var REF_TAG_PREFIX = 'refs/tags/';
  80289. var REF_BRANCH_PREFIX = 'refs/heads/';
  80290. var REF_PR_PREFIX = 'refs/pull/';
  80291. // This regex is designed to match output from git of the style:
  80292. // ebeb6eafceb61dd08441ffe086c77eb472842494 refs/tags/v0.21.0
  80293. // and extract the hash and ref name as capture groups
  80294. var GIT_REF_LINE_REGEXP = /^([a-fA-F0-9]+)\s+(refs\/(?:tags|heads|pull|remotes)\/.*)$/;
  80295. var COMMIT_SHA_REGEXP = /^[a-f0-9]{5,40}$/;
  80296. var REF_NAME_REGEXP = /^refs\/(tags|heads)\/(.+)$/;
  80297. var isCommitSha = exports.isCommitSha = function isCommitSha(target) {
  80298. return COMMIT_SHA_REGEXP.test(target);
  80299. };
  80300. var tryVersionAsGitCommit = function tryVersionAsGitCommit(_ref) {
  80301. var version = _ref.version,
  80302. refs = _ref.refs,
  80303. git = _ref.git;
  80304. var lowercaseVersion = version.toLowerCase();
  80305. if (!isCommitSha(lowercaseVersion)) {
  80306. return (_promise || _load_promise()).default.resolve(null);
  80307. }
  80308. for (var _iterator = refs.entries(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  80309. var _ref4;
  80310. if (_isArray) {
  80311. if (_i >= _iterator.length) break;
  80312. _ref4 = _iterator[_i++];
  80313. } else {
  80314. _i = _iterator.next();
  80315. if (_i.done) break;
  80316. _ref4 = _i.value;
  80317. }
  80318. var _ref3 = _ref4;
  80319. var _ref2 = _ref3[0];
  80320. var _sha = _ref3[1];
  80321. if (_sha.startsWith(lowercaseVersion)) {
  80322. return (_promise || _load_promise()).default.resolve({ sha: _sha, ref: _ref2 });
  80323. }
  80324. }
  80325. return git.resolveCommit(lowercaseVersion);
  80326. };
  80327. var tryEmptyVersionAsDefaultBranch = function tryEmptyVersionAsDefaultBranch(_ref5) {
  80328. var version = _ref5.version,
  80329. git = _ref5.git;
  80330. return version.trim() === '' ? git.resolveDefaultBranch() : (_promise || _load_promise()).default.resolve(null);
  80331. };
  80332. var tryWildcardVersionAsDefaultBranch = function tryWildcardVersionAsDefaultBranch(_ref6) {
  80333. var version = _ref6.version,
  80334. git = _ref6.git;
  80335. return version === '*' ? git.resolveDefaultBranch() : (_promise || _load_promise()).default.resolve(null);
  80336. };
  80337. var tryRef = function tryRef(refs, ref) {
  80338. var sha = refs.get(ref);
  80339. return sha ? { sha, ref } : null;
  80340. };
  80341. var tryVersionAsFullRef = function tryVersionAsFullRef(_ref7) {
  80342. var version = _ref7.version,
  80343. refs = _ref7.refs;
  80344. return version.startsWith('refs/') ? tryRef(refs, version) : null;
  80345. };
  80346. var tryVersionAsTagName = function tryVersionAsTagName(_ref8) {
  80347. var version = _ref8.version,
  80348. refs = _ref8.refs;
  80349. return tryRef(refs, `${REF_TAG_PREFIX}${version}`);
  80350. };
  80351. var tryVersionAsPullRequestNo = function tryVersionAsPullRequestNo(_ref9) {
  80352. var version = _ref9.version,
  80353. refs = _ref9.refs;
  80354. return tryRef(refs, `${REF_PR_PREFIX}${version}`);
  80355. };
  80356. var tryVersionAsBranchName = function tryVersionAsBranchName(_ref10) {
  80357. var version = _ref10.version,
  80358. refs = _ref10.refs;
  80359. return tryRef(refs, `${REF_BRANCH_PREFIX}${version}`);
  80360. };
  80361. var tryVersionAsDirectRef = function tryVersionAsDirectRef(_ref11) {
  80362. var version = _ref11.version,
  80363. refs = _ref11.refs;
  80364. return tryRef(refs, `${REF_PREFIX}${version}`);
  80365. };
  80366. var computeSemverNames = function computeSemverNames(_ref12) {
  80367. var config = _ref12.config,
  80368. refs = _ref12.refs;
  80369. var names = {
  80370. tags: [],
  80371. heads: []
  80372. };
  80373. for (var _iterator2 = refs.keys(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  80374. var _ref14;
  80375. if (_isArray2) {
  80376. if (_i2 >= _iterator2.length) break;
  80377. _ref14 = _iterator2[_i2++];
  80378. } else {
  80379. _i2 = _iterator2.next();
  80380. if (_i2.done) break;
  80381. _ref14 = _i2.value;
  80382. }
  80383. var _ref13 = _ref14;
  80384. var match = REF_NAME_REGEXP.exec(_ref13);
  80385. if (!match) {
  80386. continue;
  80387. }
  80388. var type = match[1],
  80389. name = match[2];
  80390. if (semver.valid(name, config.looseSemver)) {
  80391. names[type].push(name);
  80392. }
  80393. }
  80394. return names;
  80395. };
  80396. var findSemver = function findSemver(version, config, namesList) {
  80397. return config.resolveConstraints(namesList, version);
  80398. };
  80399. var tryVersionAsTagSemver = function () {
  80400. var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref16, names) {
  80401. var version = _ref16.version,
  80402. config = _ref16.config,
  80403. refs = _ref16.refs;
  80404. var result = yield findSemver(version.replace(/^semver:/, ''), config, names.tags);
  80405. return result ? tryRef(refs, `${REF_TAG_PREFIX}${result}`) : null;
  80406. });
  80407. return function tryVersionAsTagSemver(_x, _x2) {
  80408. return _ref15.apply(this, arguments);
  80409. };
  80410. }();
  80411. var tryVersionAsBranchSemver = function () {
  80412. var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref18, names) {
  80413. var version = _ref18.version,
  80414. config = _ref18.config,
  80415. refs = _ref18.refs;
  80416. var result = yield findSemver(version.replace(/^semver:/, ''), config, names.heads);
  80417. return result ? tryRef(refs, `${REF_BRANCH_PREFIX}${result}`) : null;
  80418. });
  80419. return function tryVersionAsBranchSemver(_x3, _x4) {
  80420. return _ref17.apply(this, arguments);
  80421. };
  80422. }();
  80423. var tryVersionAsSemverRange = function () {
  80424. var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (options) {
  80425. var names = computeSemverNames(options);
  80426. return (yield tryVersionAsTagSemver(options, names)) || tryVersionAsBranchSemver(options, names);
  80427. });
  80428. return function tryVersionAsSemverRange(_x5) {
  80429. return _ref19.apply(this, arguments);
  80430. };
  80431. }();
  80432. var VERSION_RESOLUTION_STEPS = [tryEmptyVersionAsDefaultBranch, tryVersionAsGitCommit, tryVersionAsFullRef, tryVersionAsTagName, tryVersionAsPullRequestNo, tryVersionAsBranchName, tryVersionAsSemverRange, tryWildcardVersionAsDefaultBranch, tryVersionAsDirectRef];
  80433. /**
  80434. * Resolve a git-url hash (version) to a git commit sha and branch/tag ref
  80435. * Returns null if the version cannot be resolved to any commit
  80436. */
  80437. var resolveVersion = exports.resolveVersion = function () {
  80438. var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (options) {
  80439. for (var _iterator3 = VERSION_RESOLUTION_STEPS, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  80440. var _ref21;
  80441. if (_isArray3) {
  80442. if (_i3 >= _iterator3.length) break;
  80443. _ref21 = _iterator3[_i3++];
  80444. } else {
  80445. _i3 = _iterator3.next();
  80446. if (_i3.done) break;
  80447. _ref21 = _i3.value;
  80448. }
  80449. var testFunction = _ref21;
  80450. var result = yield testFunction(options);
  80451. if (result !== null) {
  80452. return result;
  80453. }
  80454. }
  80455. return null;
  80456. });
  80457. return function resolveVersion(_x6) {
  80458. return _ref20.apply(this, arguments);
  80459. };
  80460. }();
  80461. /**
  80462. * Parse Git ref lines into hash of ref names to SHA hashes
  80463. */
  80464. var parseRefs = exports.parseRefs = function parseRefs(stdout) {
  80465. // store references
  80466. var refs = new (_map || _load_map()).default();
  80467. // line delimited
  80468. var refLines = stdout.split('\n');
  80469. for (var _iterator4 = refLines, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  80470. var _ref22;
  80471. if (_isArray4) {
  80472. if (_i4 >= _iterator4.length) break;
  80473. _ref22 = _iterator4[_i4++];
  80474. } else {
  80475. _i4 = _iterator4.next();
  80476. if (_i4.done) break;
  80477. _ref22 = _i4.value;
  80478. }
  80479. var line = _ref22;
  80480. var match = GIT_REF_LINE_REGEXP.exec(line);
  80481. if (match) {
  80482. var _sha2 = match[1],
  80483. tagName = match[2];
  80484. // As documented in gitrevisions:
  80485. // https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html#_specifying_revisions
  80486. // "A suffix ^ followed by an empty brace pair means the object could be a tag,
  80487. // and dereference the tag recursively until a non-tag object is found."
  80488. // In other words, the hash without ^{} is the hash of the tag,
  80489. // and the hash with ^{} is the hash of the commit at which the tag was made.
  80490. var name = (0, (_misc || _load_misc()).removeSuffix)(tagName, '^{}');
  80491. refs.set(name, _sha2);
  80492. }
  80493. }
  80494. return refs;
  80495. };
  80496. /***/ }),
  80497. /* 539 */
  80498. /***/ (function(module, exports, __webpack_require__) {
  80499. "use strict";
  80500. Object.defineProperty(exports, "__esModule", {
  80501. value: true
  80502. });
  80503. exports.LogicalDependencyTree = undefined;
  80504. var _classCallCheck2;
  80505. function _load_classCallCheck() {
  80506. return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
  80507. }
  80508. var _npmLogicalTree;
  80509. function _load_npmLogicalTree() {
  80510. return _npmLogicalTree = _interopRequireDefault(__webpack_require__(838));
  80511. }
  80512. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80513. var LogicalDependencyTree = exports.LogicalDependencyTree = function () {
  80514. function LogicalDependencyTree(packageJson, packageLock) {
  80515. (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, LogicalDependencyTree);
  80516. this.tree = (0, (_npmLogicalTree || _load_npmLogicalTree()).default)(JSON.parse(packageJson), JSON.parse(packageLock));
  80517. }
  80518. LogicalDependencyTree.prototype._findNode = function _findNode(name, parentNames) {
  80519. var parentTree = parentNames ? parentNames.reduce(function (node, ancestor) {
  80520. var ancestorNode = node.dependencies.get(ancestor);
  80521. return ancestorNode;
  80522. }, this.tree) : this.tree;
  80523. var node = parentTree.dependencies.get(name);
  80524. return node;
  80525. };
  80526. LogicalDependencyTree.prototype.getFixedVersionPattern = function getFixedVersionPattern(name, parentNames) {
  80527. var node = this._findNode(name, parentNames);
  80528. var version = node.version;
  80529. return `${node.name}@${version}`;
  80530. };
  80531. return LogicalDependencyTree;
  80532. }();
  80533. /***/ }),
  80534. /* 540 */
  80535. /***/ (function(module, exports, __webpack_require__) {
  80536. "use strict";
  80537. Object.defineProperty(exports, "__esModule", {
  80538. value: true
  80539. });
  80540. var _keys;
  80541. function _load_keys() {
  80542. return _keys = _interopRequireDefault(__webpack_require__(14));
  80543. }
  80544. var _getIterator2;
  80545. function _load_getIterator() {
  80546. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  80547. }
  80548. var _asyncToGenerator2;
  80549. function _load_asyncToGenerator() {
  80550. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  80551. }
  80552. var _constants;
  80553. function _load_constants() {
  80554. return _constants = __webpack_require__(13);
  80555. }
  80556. var _util;
  80557. function _load_util() {
  80558. return _util = __webpack_require__(207);
  80559. }
  80560. var _index;
  80561. function _load_index() {
  80562. return _index = __webpack_require__(75);
  80563. }
  80564. var _inferLicense;
  80565. function _load_inferLicense() {
  80566. return _inferLicense = _interopRequireDefault(__webpack_require__(541));
  80567. }
  80568. var _fs;
  80569. function _load_fs() {
  80570. return _fs = _interopRequireWildcard(__webpack_require__(8));
  80571. }
  80572. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  80573. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80574. var semver = __webpack_require__(27);
  80575. var path = __webpack_require__(1);
  80576. var url = __webpack_require__(29);
  80577. var VALID_BIN_KEYS = /^(?!\.{0,2}$)[a-z0-9._-]+$/i;
  80578. var LICENSE_RENAMES = {
  80579. 'MIT/X11': 'MIT',
  80580. X11: 'MIT'
  80581. };
  80582. exports.default = function () {
  80583. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (info, moduleLoc, reporter, warn, looseSemver) {
  80584. var files = yield (_fs || _load_fs()).readdir(moduleLoc);
  80585. // clean info.version
  80586. if (typeof info.version === 'string') {
  80587. info.version = semver.clean(info.version, looseSemver) || info.version;
  80588. }
  80589. // if name or version aren't set then set them to empty strings
  80590. info.name = info.name || '';
  80591. info.version = info.version || '';
  80592. // if the man field is a string then coerce it to an array
  80593. if (typeof info.man === 'string') {
  80594. info.man = [info.man];
  80595. }
  80596. // if the keywords field is a string then split it on any whitespace
  80597. if (typeof info.keywords === 'string') {
  80598. info.keywords = info.keywords.split(/\s+/g);
  80599. }
  80600. // if there's no contributors field but an authors field then expand it
  80601. if (!info.contributors && files.indexOf('AUTHORS') >= 0) {
  80602. var authorsFilepath = path.join(moduleLoc, 'AUTHORS');
  80603. var authorsFilestats = yield (_fs || _load_fs()).stat(authorsFilepath);
  80604. if (authorsFilestats.isFile()) {
  80605. var authors = yield (_fs || _load_fs()).readFile(authorsFilepath);
  80606. authors = authors.split(/\r?\n/g) // split on lines
  80607. .map(function (line) {
  80608. return line.replace(/^\s*#.*$/, '').trim();
  80609. }) // remove comments
  80610. .filter(function (line) {
  80611. return !!line;
  80612. }); // remove empty lines
  80613. info.contributors = authors;
  80614. }
  80615. }
  80616. // expand people fields to objects
  80617. if (typeof info.author === 'string' || typeof info.author === 'object') {
  80618. info.author = (0, (_util || _load_util()).normalizePerson)(info.author);
  80619. }
  80620. if (Array.isArray(info.contributors)) {
  80621. info.contributors = info.contributors.map((_util || _load_util()).normalizePerson);
  80622. }
  80623. if (Array.isArray(info.maintainers)) {
  80624. info.maintainers = info.maintainers.map((_util || _load_util()).normalizePerson);
  80625. }
  80626. // if there's no readme field then load the README file from the cwd
  80627. if (!info.readme) {
  80628. var readmeCandidates = files.filter(function (filename) {
  80629. var lower = filename.toLowerCase();
  80630. return lower === 'readme' || lower.indexOf('readme.') === 0;
  80631. }).sort(function (filename1, filename2) {
  80632. // favor files with extensions
  80633. return filename2.indexOf('.') - filename1.indexOf('.');
  80634. });
  80635. for (var _iterator = readmeCandidates, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  80636. var _ref2;
  80637. if (_isArray) {
  80638. if (_i >= _iterator.length) break;
  80639. _ref2 = _iterator[_i++];
  80640. } else {
  80641. _i = _iterator.next();
  80642. if (_i.done) break;
  80643. _ref2 = _i.value;
  80644. }
  80645. var readmeFilename = _ref2;
  80646. var readmeFilepath = path.join(moduleLoc, readmeFilename);
  80647. var readmeFileStats = yield (_fs || _load_fs()).stat(readmeFilepath);
  80648. if (readmeFileStats.isFile()) {
  80649. info.readmeFilename = readmeFilename;
  80650. info.readme = yield (_fs || _load_fs()).readFile(readmeFilepath);
  80651. break;
  80652. }
  80653. }
  80654. }
  80655. // if there's no description then take the first paragraph from the readme
  80656. if (!info.description && info.readme) {
  80657. var desc = (0, (_util || _load_util()).extractDescription)(info.readme);
  80658. if (desc) {
  80659. info.description = desc;
  80660. }
  80661. }
  80662. // support array of engine keys
  80663. if (Array.isArray(info.engines)) {
  80664. var engines = {};
  80665. for (var _iterator2 = info.engines, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  80666. var _ref3;
  80667. if (_isArray2) {
  80668. if (_i2 >= _iterator2.length) break;
  80669. _ref3 = _iterator2[_i2++];
  80670. } else {
  80671. _i2 = _iterator2.next();
  80672. if (_i2.done) break;
  80673. _ref3 = _i2.value;
  80674. }
  80675. var str = _ref3;
  80676. if (typeof str === 'string') {
  80677. var _str$trim$split = str.trim().split(/ +/g),
  80678. name = _str$trim$split[0],
  80679. patternParts = _str$trim$split.slice(1);
  80680. engines[name] = patternParts.join(' ');
  80681. }
  80682. }
  80683. info.engines = engines;
  80684. }
  80685. // if the repository field is a string then assume it's a git repo and expand it
  80686. if (typeof info.repository === 'string') {
  80687. info.repository = {
  80688. type: 'git',
  80689. url: info.repository
  80690. };
  80691. }
  80692. var repo = info.repository;
  80693. // explode info.repository.url if it's a hosted git shorthand
  80694. if (repo && typeof repo === 'object' && typeof repo.url === 'string') {
  80695. repo.url = (0, (_index || _load_index()).hostedGitFragmentToGitUrl)(repo.url, reporter);
  80696. }
  80697. // allow bugs to be specified as a string, expand it to an object with a single url prop
  80698. if (typeof info.bugs === 'string') {
  80699. info.bugs = { url: info.bugs };
  80700. }
  80701. // normalize homepage url to http
  80702. if (typeof info.homepage === 'string') {
  80703. var parts = url.parse(info.homepage);
  80704. parts.protocol = parts.protocol || 'http:';
  80705. if (parts.pathname && !parts.hostname) {
  80706. parts.hostname = parts.pathname;
  80707. parts.pathname = '';
  80708. }
  80709. info.homepage = url.format(parts);
  80710. }
  80711. // if the `bin` field is as string then expand it to an object with a single property
  80712. // based on the original `bin` field and `name field`
  80713. // { name: "foo", bin: "cli.js" } -> { name: "foo", bin: { foo: "cli.js" } }
  80714. if (typeof info.name === 'string' && typeof info.bin === 'string' && info.bin.length > 0) {
  80715. // Remove scoped package name for consistency with NPM's bin field fixing behaviour
  80716. var _name = info.name.replace(/^@[^\/]+\//, '');
  80717. info.bin = { [_name]: info.bin };
  80718. }
  80719. // Validate that the bin entries reference only files within their package, and that
  80720. // their name is a valid file name
  80721. if (typeof info.bin === 'object' && info.bin !== null) {
  80722. var bin = info.bin;
  80723. for (var _iterator3 = (0, (_keys || _load_keys()).default)(bin), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
  80724. var _ref4;
  80725. if (_isArray3) {
  80726. if (_i3 >= _iterator3.length) break;
  80727. _ref4 = _iterator3[_i3++];
  80728. } else {
  80729. _i3 = _iterator3.next();
  80730. if (_i3.done) break;
  80731. _ref4 = _i3.value;
  80732. }
  80733. var _key = _ref4;
  80734. var target = bin[_key];
  80735. if (!VALID_BIN_KEYS.test(_key) || !(0, (_util || _load_util()).isValidBin)(target)) {
  80736. delete bin[_key];
  80737. warn(reporter.lang('invalidBinEntry', info.name, _key));
  80738. } else {
  80739. bin[_key] = path.normalize(target);
  80740. }
  80741. }
  80742. } else if (typeof info.bin !== 'undefined') {
  80743. delete info.bin;
  80744. warn(reporter.lang('invalidBinField', info.name));
  80745. }
  80746. // bundleDependencies is an alias for bundledDependencies
  80747. if (info.bundledDependencies) {
  80748. info.bundleDependencies = info.bundledDependencies;
  80749. delete info.bundledDependencies;
  80750. }
  80751. var scripts = void 0;
  80752. // dummy script object to shove file inferred scripts onto
  80753. if (info.scripts && typeof info.scripts === 'object') {
  80754. scripts = info.scripts;
  80755. } else {
  80756. scripts = {};
  80757. }
  80758. // if there's a server.js file and no start script then set it to `node server.js`
  80759. if (!scripts.start && files.indexOf('server.js') >= 0) {
  80760. scripts.start = 'node server.js';
  80761. }
  80762. // if there's a binding.gyp file and no install script then set it to `node-gyp rebuild`
  80763. if (!scripts.install && files.indexOf('binding.gyp') >= 0) {
  80764. scripts.install = 'node-gyp rebuild';
  80765. }
  80766. // set scripts if we've polluted the empty object
  80767. if ((0, (_keys || _load_keys()).default)(scripts).length) {
  80768. info.scripts = scripts;
  80769. }
  80770. var dirs = info.directories;
  80771. if (dirs && typeof dirs === 'object') {
  80772. var binDir = dirs.bin;
  80773. if (!info.bin && binDir && typeof binDir === 'string') {
  80774. var _bin = info.bin = {};
  80775. var fullBinDir = path.join(moduleLoc, binDir);
  80776. if (yield (_fs || _load_fs()).exists(fullBinDir)) {
  80777. for (var _iterator4 = yield (_fs || _load_fs()).readdir(fullBinDir), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
  80778. var _ref5;
  80779. if (_isArray4) {
  80780. if (_i4 >= _iterator4.length) break;
  80781. _ref5 = _iterator4[_i4++];
  80782. } else {
  80783. _i4 = _iterator4.next();
  80784. if (_i4.done) break;
  80785. _ref5 = _i4.value;
  80786. }
  80787. var scriptName = _ref5;
  80788. if (scriptName[0] === '.') {
  80789. continue;
  80790. }
  80791. _bin[scriptName] = path.join('.', binDir, scriptName);
  80792. }
  80793. } else {
  80794. warn(reporter.lang('manifestDirectoryNotFound', binDir, info.name));
  80795. }
  80796. }
  80797. var manDir = dirs.man;
  80798. if (!info.man && typeof manDir === 'string') {
  80799. var man = info.man = [];
  80800. var fullManDir = path.join(moduleLoc, manDir);
  80801. if (yield (_fs || _load_fs()).exists(fullManDir)) {
  80802. for (var _iterator5 = yield (_fs || _load_fs()).readdir(fullManDir), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
  80803. var _ref6;
  80804. if (_isArray5) {
  80805. if (_i5 >= _iterator5.length) break;
  80806. _ref6 = _iterator5[_i5++];
  80807. } else {
  80808. _i5 = _iterator5.next();
  80809. if (_i5.done) break;
  80810. _ref6 = _i5.value;
  80811. }
  80812. var filename = _ref6;
  80813. if (/^(.*?)\.[0-9]$/.test(filename)) {
  80814. man.push(path.join('.', manDir, filename));
  80815. }
  80816. }
  80817. } else {
  80818. warn(reporter.lang('manifestDirectoryNotFound', manDir, info.name));
  80819. }
  80820. }
  80821. }
  80822. delete info.directories;
  80823. // normalize licenses field
  80824. var licenses = info.licenses;
  80825. if (Array.isArray(licenses) && !info.license) {
  80826. var licenseTypes = [];
  80827. for (var _iterator6 = licenses, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
  80828. var _ref7;
  80829. if (_isArray6) {
  80830. if (_i6 >= _iterator6.length) break;
  80831. _ref7 = _iterator6[_i6++];
  80832. } else {
  80833. _i6 = _iterator6.next();
  80834. if (_i6.done) break;
  80835. _ref7 = _i6.value;
  80836. }
  80837. var _license = _ref7;
  80838. if (_license && typeof _license === 'object') {
  80839. _license = _license.type;
  80840. }
  80841. if (typeof _license === 'string') {
  80842. licenseTypes.push(_license);
  80843. }
  80844. }
  80845. licenseTypes = licenseTypes.filter((_util || _load_util()).isValidLicense);
  80846. if (licenseTypes.length === 1) {
  80847. info.license = licenseTypes[0];
  80848. } else if (licenseTypes.length) {
  80849. info.license = `(${licenseTypes.join(' OR ')})`;
  80850. }
  80851. }
  80852. var license = info.license;
  80853. // normalize license
  80854. if (license && typeof license === 'object') {
  80855. info.license = license.type;
  80856. }
  80857. // get license file
  80858. var licenseFile = files.find(function (filename) {
  80859. var lower = filename.toLowerCase();
  80860. return lower === 'license' || lower.startsWith('license.') || lower === 'unlicense' || lower.startsWith('unlicense.');
  80861. });
  80862. if (licenseFile) {
  80863. var licenseFilepath = path.join(moduleLoc, licenseFile);
  80864. var licenseFileStats = yield (_fs || _load_fs()).stat(licenseFilepath);
  80865. if (licenseFileStats.isFile()) {
  80866. var licenseContent = yield (_fs || _load_fs()).readFile(licenseFilepath);
  80867. var inferredLicense = (0, (_inferLicense || _load_inferLicense()).default)(licenseContent);
  80868. info.licenseText = licenseContent;
  80869. var _license2 = info.license;
  80870. if (typeof _license2 === 'string') {
  80871. if (inferredLicense && (0, (_util || _load_util()).isValidLicense)(inferredLicense) && !(0, (_util || _load_util()).isValidLicense)(_license2)) {
  80872. // some packages don't specify their license version but we can infer it based on their license file
  80873. var basicLicense = _license2.toLowerCase().replace(/(-like|\*)$/g, '');
  80874. var expandedLicense = inferredLicense.toLowerCase();
  80875. if (expandedLicense.startsWith(basicLicense)) {
  80876. // TODO consider doing something to notify the user
  80877. info.license = inferredLicense;
  80878. }
  80879. }
  80880. } else if (inferredLicense) {
  80881. // if there's no license then infer it based on the license file
  80882. info.license = inferredLicense;
  80883. } else {
  80884. // valid expression to refer to a license in a file
  80885. info.license = `SEE LICENSE IN ${licenseFile}`;
  80886. }
  80887. }
  80888. }
  80889. if (typeof info.license === 'string') {
  80890. // sometimes licenses are known by different names, reduce them
  80891. info.license = LICENSE_RENAMES[info.license] || info.license;
  80892. } else if (typeof info.readme === 'string') {
  80893. // the license might be at the bottom of the README
  80894. var _inferredLicense = (0, (_inferLicense || _load_inferLicense()).default)(info.readme);
  80895. if (_inferredLicense) {
  80896. info.license = _inferredLicense;
  80897. }
  80898. }
  80899. // get notice file
  80900. var noticeFile = files.find(function (filename) {
  80901. var lower = filename.toLowerCase();
  80902. return lower === 'notice' || lower.startsWith('notice.');
  80903. });
  80904. if (noticeFile) {
  80905. var noticeFilepath = path.join(moduleLoc, noticeFile);
  80906. var noticeFileStats = yield (_fs || _load_fs()).stat(noticeFilepath);
  80907. if (noticeFileStats.isFile()) {
  80908. info.noticeText = yield (_fs || _load_fs()).readFile(noticeFilepath);
  80909. }
  80910. }
  80911. for (var _iterator7 = (_constants || _load_constants()).MANIFEST_FIELDS, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
  80912. var _ref8;
  80913. if (_isArray7) {
  80914. if (_i7 >= _iterator7.length) break;
  80915. _ref8 = _iterator7[_i7++];
  80916. } else {
  80917. _i7 = _iterator7.next();
  80918. if (_i7.done) break;
  80919. _ref8 = _i7.value;
  80920. }
  80921. var dependencyType = _ref8;
  80922. var dependencyList = info[dependencyType];
  80923. if (dependencyList && typeof dependencyList === 'object') {
  80924. delete dependencyList['//'];
  80925. for (var _name2 in dependencyList) {
  80926. dependencyList[_name2] = dependencyList[_name2] || '';
  80927. }
  80928. }
  80929. }
  80930. });
  80931. return function (_x, _x2, _x3, _x4, _x5) {
  80932. return _ref.apply(this, arguments);
  80933. };
  80934. }();
  80935. /***/ }),
  80936. /* 541 */
  80937. /***/ (function(module, exports, __webpack_require__) {
  80938. "use strict";
  80939. Object.defineProperty(exports, "__esModule", {
  80940. value: true
  80941. });
  80942. var _getIterator2;
  80943. function _load_getIterator() {
  80944. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  80945. }
  80946. exports.default = inferLicense;
  80947. var _licenses;
  80948. function _load_licenses() {
  80949. return _licenses = _interopRequireDefault(__webpack_require__(542));
  80950. }
  80951. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80952. function clean(str) {
  80953. return str.replace(/[^A-Za-z\s]/g, ' ').replace(/[\s]+/g, ' ').trim().toLowerCase();
  80954. }
  80955. var REGEXES = {
  80956. Apache: [/Apache License\b/],
  80957. BSD: [/BSD\b/],
  80958. ISC: [/The ISC License/, /ISC\b/],
  80959. MIT: [/MIT\b/],
  80960. Unlicense: [/http:\/\/unlicense.org\//],
  80961. WTFPL: [/DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE/, /WTFPL\b/]
  80962. };
  80963. function inferLicense(license) {
  80964. // check if we have any explicit licenses
  80965. var cleanLicense = clean(license);
  80966. for (var licenseName in (_licenses || _load_licenses()).default) {
  80967. var testLicense = (_licenses || _load_licenses()).default[licenseName];
  80968. if (cleanLicense.search(testLicense) >= 0) {
  80969. return licenseName;
  80970. }
  80971. }
  80972. // infer based on some keywords
  80973. for (var _licenseName in REGEXES) {
  80974. for (var _iterator = REGEXES[_licenseName], _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  80975. var _ref;
  80976. if (_isArray) {
  80977. if (_i >= _iterator.length) break;
  80978. _ref = _iterator[_i++];
  80979. } else {
  80980. _i = _iterator.next();
  80981. if (_i.done) break;
  80982. _ref = _i.value;
  80983. }
  80984. var regex = _ref;
  80985. if (license.search(regex) >= 0) {
  80986. return `${_licenseName}*`;
  80987. }
  80988. }
  80989. }
  80990. return null;
  80991. }
  80992. /***/ }),
  80993. /* 542 */
  80994. /***/ (function(module, exports, __webpack_require__) {
  80995. "use strict";
  80996. Object.defineProperty(exports, "__esModule", {
  80997. value: true
  80998. });
  80999. /* eslint-disable max-len */
  81000. /**
  81001. * DO NOT EDIT THIS FILE MANUALLY.
  81002. * THIS FILE WAS GENERATED BY "generate-licenses-js.js".
  81003. */
  81004. exports.default = {
  81005. 'Apache-2.0': new RegExp('(licensed under the apache license version the license you may not use this file except in compliance with the license you may obtain a copy of the license at http www apache org licenses license unless required by applicable law or agreed to in writing software distributed under the license is distributed on an as is basis without warranties or conditions of any kind either express or implied see the license for the specific language governing permissions and limitations under the license$|apache license version january http www apache org licenses terms and conditions for use reproduction and distribution definitions license shall mean the terms and conditions for use reproduction and distribution as defined by sections through of this document licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the license legal entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity for the purposes of this definition control means i the power direct or indirect to cause the direction or management of such entity whether by contract or otherwise or ii ownership of fifty percent or more of the outstanding shares or iii beneficial ownership of such entity you or your shall mean an individual or legal entity exercising permissions granted by this license source form shall mean the preferred form for making modifications including but not limited to software source code documentation source and configuration files object form shall mean any form resulting from mechanical transformation or translation of a source form including but not limited to compiled object code generated documentation and conversions to other media types work shall mean the work of authorship whether in source or object form made available under the license as indicated by a copyright notice that is included in or attached to the work an example is provided in the appendix below derivative works shall mean any work whether in source or object form that is based on or derived from the work and for which the editorial revisions annotations elaborations or other modifications represent as a whole an original work of authorship for the purposes of this license derivative works shall not include works that remain separable from or merely link or bind by name to the interfaces of the work and derivative works thereof contribution shall mean any work of authorship including the original version of the work and any modifications or additions to that work or derivative works thereof that is intentionally submitted to licensor for inclusion in the work by the copyright owner or by an individual or legal entity authorized to submit on behalf of the copyright owner for the purposes of this definition submitted means any form of electronic verbal or written communication sent to the licensor or its representatives including but not limited to communication on electronic mailing lists source code control systems and issue tracking systems that are managed by or on behalf of the licensor for the purpose of discussing and improving the work but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as not a contribution contributor shall mean licensor and any individual or legal entity on behalf of whom a contribution has been received by licensor and subsequently incorporated within the work grant of copyright license subject to the terms and conditions of this license each contributor hereby grants to you a perpetual worldwide non exclusive no charge royalty free irrevocable copyright license to reproduce prepare derivative works of publicly display publicly perform sublicense and distribute the work and such derivative works in source or object form grant of patent license subject to the terms and conditions of this license each contributor hereby grants to you a perpetual worldwide non exclusive no charge royalty free irrevocable except as stated in this section patent license to make have made use offer to sell sell import and otherwise transfer the work where such license applies only to those patent claims licensable by such contributor that are necessarily infringed by their contribution s alone or by combination of their contribution s with the work to which such contribution s was submitted if you institute patent litigation against any entity including a cross claim or counterclaim in a lawsuit alleging that the work or a contribution incorporated within the work constitutes direct or contributory patent infringement then any patent licenses granted to you under this license for that work shall terminate as of the date such litigation is filed redistribution you may reproduce and distribute copies of the work or derivative works thereof in any medium with or without modifications and in source or object form provided that you meet the following conditions a you must give any other recipients of the work or derivative works a copy of this license and b you must cause any modified files to carry prominent notices stating that you changed the files and c you must retain in the source form of any derivative works that you distribute all copyright patent trademark and attribution notices from the source form of the work excluding those notices that do not pertain to any part of the derivative works and d if the work includes a notice text file as part of its distribution then any derivative works that you distribute must include a readable copy of the attribution notices contained within such notice file excluding those notices that do not pertain to any part of the derivative works in at least one of the following places within a notice text file distributed as part of the derivative works within the source form or documentation if provided along with the derivative works or within a display generated by the derivative works if and wherever such third party notices normally appear the contents of the notice file are for informational purposes only and do not modify the license you may add your own attribution notices within derivative works that you distribute alongside or as an addendum to the notice text from the work provided that such additional attribution notices cannot be construed as modifying the license you may add your own copyright statement to your modifications and may provide additional or different license terms and conditions for use reproduction or distribution of your modifications or for any such derivative works as a whole provided your use reproduction and distribution of the work otherwise complies with the conditions stated in this license submission of contributions unless you explicitly state otherwise any contribution intentionally submitted for inclusion in the work by you to the licensor shall be under the terms and conditions of this license without any additional terms or conditions notwithstanding the above nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with licensor regarding such contributions trademarks this license does not grant permission to use the trade names trademarks service marks or product names of the licensor except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the notice file disclaimer of warranty unless required by applicable law or agreed to in writing licensor provides the work and each contributor provides its contributions on an as is basis without warranties or conditions of any kind either express or implied including without limitation any warranties or conditions of title non infringement merchantability or fitness for a particular purpose you are solely responsible for determining the appropriateness of using or redistributing the work and assume any risks associated with your exercise of permissions under this license limitation of liability in no event and under no legal theory whether in tort including negligence contract or otherwise unless required by applicable law such as deliberate and grossly negligent acts or agreed to in writing shall any contributor be liable to you for damages including any direct indirect special incidental or consequential damages of any character arising as a result of this license or out of the use or inability to use the work including but not limited to damages for loss of goodwill work stoppage computer failure or malfunction or any and all other commercial damages or losses even if such contributor has been advised of the possibility of such damages accepting warranty or additional liability while redistributing the work or derivative works thereof you may choose to offer and charge a fee for acceptance of support warranty indemnity or other liability obligations and or rights consistent with this license however in accepting such obligations you may act only on your own behalf and on your sole responsibility not on behalf of any other contributor and only if you agree to indemnify defend and hold each contributor harmless for any liability incurred by or claims asserted against such contributor by reason of your accepting any such warranty or additional liability end of terms and conditions$)', 'g'),
  81006. 'BSD-2-Clause': new RegExp('(redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution this(.*?| )is provided by the copyright holders and contributors as is and any express or implied warranties including but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed in no event shall(.*?| )be liable for any direct indirect incidental special exemplary or consequential damages including but not limited to procurement of substitute goods or services loss of use data or profits or business interruption however caused and on any theory of liability whether in contract strict liability or tort including negligence or otherwise arising in any way out of the use of this(.*?| )even if advised of the possibility of such damage$|redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution this software is provided by the copyright holders and contributors as is and any express or implied warranties including but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed in no event shall(.*?| )be liable for any direct indirect incidental special exemplary or consequential damages including but not limited to procurement of substitute goods or services loss of use data or profits or business interruption however caused and on any theory of liability whether in contract strict liability or tort including negligence or otherwise arising in any way out of the use of this software even if advised of the possibility of such damage$)', 'g'),
  81007. 'BSD-3-Clause': new RegExp('(redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution neither the name of(.*?| )nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission this software is provided by the copyright holders and contributors as is and any express or implied warranties including but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed in no event shall(.*?| )be liable for any direct indirect incidental special exemplary or consequential damages including but not limited to procurement of substitute goods or services loss of use data or profits or business interruption however caused and on any theory of liability whether in contract strict liability or tort including negligence or otherwise arising in any way out of the use of this software even if advised of the possibility of such damage$|(redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution the names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission this software is provided by the copyright holders and contributors as is and any express or implied warranties including but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed in no event shall the copyright holders and contributors be liable for any direct indirect incidental special exemplary or consequential damages including but not limited to procurement of substitute goods or services loss of use data or profits or business interruption however caused and on any theory of liability whether in contract strict liability or tort including negligence or otherwise arising in any way out of the use of this software even if advised of the possibility of such damage$|redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution neither the name(.*?| )nor the names of(.*?| )contributors may be used to endorse or promote products derived from this software without specific prior written permission this software is provided by(.*?| )as is and any express or implied warranties including but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed in no event shall(.*?| )be liable for any direct indirect incidental special exemplary or consequential damages including but not limited to procurement of substitute goods or services loss of use data or profits or business interruption however caused and on any theory of liability whether in contract strict liability or tort including negligence or otherwise arising in any way out of the use of this software even if advised of the possibility of such damage$))', 'g'),
  81008. MIT: new RegExp('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$', 'g'),
  81009. Unlicense: new RegExp('this is free and unencumbered software released into the public domain anyone is free to copy modify publish use compile sell or distribute this software either in source code form or as a compiled binary for any purpose commercial or non commercial and by any means in jurisdictions that recognize copyright laws the author or authors of this software dedicate any and all copyright interest in the software to the public domain we make this dedication for the benefit of the public at large and to the detriment of our heirs and successors we intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law 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 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 for more information please refer to wildcard$', 'g')
  81010. };
  81011. /***/ }),
  81012. /* 543 */
  81013. /***/ (function(module, exports, __webpack_require__) {
  81014. "use strict";
  81015. Object.defineProperty(exports, "__esModule", {
  81016. value: true
  81017. });
  81018. var _keys;
  81019. function _load_keys() {
  81020. return _keys = _interopRequireDefault(__webpack_require__(14));
  81021. }
  81022. var _getIterator2;
  81023. function _load_getIterator() {
  81024. return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
  81025. }
  81026. exports.default = function (info, moduleLoc, lockfileFolder) {
  81027. // It won't work if we don't yet know what's the folder we'll use as root. It's not a
  81028. // big deal tho, because it only happens when trying to figure out the root, and we
  81029. // don't need to know the dependencies / devDependencies at this time.
  81030. if (!lockfileFolder) {
  81031. return;
  81032. }
  81033. for (var _iterator = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
  81034. var _ref;
  81035. if (_isArray) {
  81036. if (_i >= _iterator.length) break;
  81037. _ref = _iterator[_i++];
  81038. } else {
  81039. _i = _iterator.next();
  81040. if (_i.done) break;
  81041. _ref = _i.value;
  81042. }
  81043. var dependencyType = _ref;
  81044. var dependencies = info[dependencyType];
  81045. if (!dependencies) {
  81046. continue;
  81047. }
  81048. for (var _iterator2 = (0, (_keys || _load_keys()).default)(dependencies), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
  81049. var _ref2;
  81050. if (_isArray2) {
  81051. if (_i2 >= _iterator2.length) break;
  81052. _ref2 = _iterator2[_i2++];
  81053. } else {
  81054. _i2 = _iterator2.next();
  81055. if (_i2.done) break;
  81056. _ref2 = _i2.value;
  81057. }
  81058. var name = _ref2;
  81059. var value = dependencies[name];
  81060. if (path.isAbsolute(value)) {
  81061. value = (_fileResolver || _load_fileResolver()).FILE_PROTOCOL_PREFIX + value;
  81062. }
  81063. var prefix = void 0;
  81064. if (value.startsWith((_fileResolver || _load_fileResolver()).FILE_PROTOCOL_PREFIX)) {
  81065. prefix = (_fileResolver || _load_fileResolver()).FILE_PROTOCOL_PREFIX;
  81066. } else if (value.startsWith((_linkResolver || _load_linkResolver()).LINK_PROTOCOL_PREFIX)) {
  81067. prefix = (_linkResolver || _load_linkResolver()).LINK_PROTOCOL_PREFIX;
  81068. } else {
  81069. continue;
  81070. }
  81071. (0, (_invariant || _load_invariant()).default)(prefix, 'prefix is definitely defined here');
  81072. var unprefixed = value.substr(prefix.length);
  81073. var hasPathPrefix = /^\.(\/|$)/.test(unprefixed);
  81074. var absoluteTarget = path.resolve(lockfileFolder, moduleLoc, unprefixed);
  81075. var relativeTarget = path.relative(lockfileFolder, absoluteTarget) || '.';
  81076. if (absoluteTarget === lockfileFolder) {
  81077. relativeTarget = '.';
  81078. } else if (hasPathPrefix) {
  81079. // TODO: This logic should be removed during the next major bump
  81080. // If the original value was using the "./" prefix, then we output a similar path.
  81081. // We need to do this because otherwise it would cause problems with already existing
  81082. // lockfile, which would see some of their entries being unrecognized.
  81083. relativeTarget = relativeTarget.replace(/^(?!\.{0,2}\/)/, `./`);
  81084. }
  81085. dependencies[name] = prefix + relativeTarget.replace(/\\/g, '/');
  81086. }
  81087. }
  81088. };
  81089. var _constants;
  81090. function _load_constants() {
  81091. return _constants = __webpack_require__(13);
  81092. }
  81093. var _fileResolver;
  81094. function _load_fileResolver() {
  81095. return _fileResolver = __webpack_require__(202);
  81096. }
  81097. var _linkResolver;
  81098. function _load_linkResolver() {
  81099. return _linkResolver = __webpack_require__(305);
  81100. }
  81101. var _invariant;
  81102. function _load_invariant() {
  81103. return _invariant = _interopRequireDefault(__webpack_require__(15));
  81104. }
  81105. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  81106. var path = __webpack_require__(1);
  81107. /***/ }),
  81108. /* 544 */
  81109. /***/ (function(module, exports, __webpack_require__) {
  81110. "use strict";
  81111. Object.defineProperty(exports, "__esModule", {
  81112. value: true
  81113. });
  81114. exports.default = {
  81115. autohr: 'author',
  81116. autor: 'author',
  81117. contributers: 'contributors',
  81118. depdenencies: 'dependencies',
  81119. dependancies: 'dependencies',
  81120. dependecies: 'dependencies',
  81121. depends: 'dependencies',
  81122. 'dev-dependencies': 'devDependencies',
  81123. devDependences: 'devDependencies',
  81124. devDepenencies: 'devDependencies',
  81125. devEependencies: 'devDependencies',
  81126. devdependencies: 'devDependencies',
  81127. hampage: 'homepage',
  81128. hompage: 'homepage',
  81129. prefereGlobal: 'preferGlobal',
  81130. publicationConfig: 'publishConfig',
  81131. repo: 'repository',
  81132. repostitory: 'repository',
  81133. script: 'scripts'
  81134. };
  81135. /***/ }),
  81136. /* 545 */
  81137. /***/ (function(module, exports, __webpack_require__) {
  81138. "use strict";
  81139. Object.defineProperty(exports, "__esModule", {
  81140. value: true
  81141. });
  81142. exports.default = parsePackageName;
  81143. var PKG_INPUT = /(^\S?[^\s@]+)(?:@(\S+))?$/;
  81144. function parsePackageName(input) {
  81145. var _PKG_INPUT$exec = PKG_INPUT.exec(input),
  81146. name = _PKG_INPUT$exec[1],
  81147. version = _PKG_INPUT$exec[2];
  81148. return { name, version };
  81149. }
  81150. /***/ }),
  81151. /* 546 */
  81152. /***/ (function(module, exports, __webpack_require__) {
  81153. "use strict";
  81154. Object.defineProperty(exports, "__esModule", {
  81155. value: true
  81156. });
  81157. var _from;
  81158. function _load_from() {
  81159. return _from = _interopRequireDefault(__webpack_require__(53));
  81160. }
  81161. var _asyncToGenerator2;
  81162. function _load_asyncToGenerator() {
  81163. return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
  81164. }
  81165. var makePortableProxyScriptUnix = function () {
  81166. var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (source, destination, options) {
  81167. var environment = options.extraEnvironment ? (0, (_from || _load_from()).default)(options.extraEnvironment.entries()).map(function (_ref2) {
  81168. var key = _ref2[0],
  81169. value = _ref2[1];
  81170. return `${key}="${value}"`;
  81171. }).join(' ') + ' ' : '';
  81172. var prependedArguments = options.prependArguments ? ' ' + options.prependArguments.map(function (arg) {
  81173. return `"${arg}"`;
  81174. }).join(' ') : '';
  81175. var appendedArguments = options.appendArguments ? ' ' + options.appendArguments.map(function (arg) {
  81176. return `"${arg}"`;
  81177. }).join(' ') : '';
  81178. var filePath = `${destination}/${options.proxyBasename || path.basename(source)}`;
  81179. // Unless impossible we want to preserve any symlinks used to call us when forwarding the call to the binary (so we
  81180. // cannot use realpath or transform relative paths into absolute ones), but we also need to tell the sh interpreter
  81181. // that the symlink should be resolved relative to the script directory (hence dirname "$0" at runtime).
  81182. var sourcePath = path.isAbsolute(source) ? source : `$(dirname "$0")/../${source}`;
  81183. yield (_fs || _load_fs()).mkdirp(destination);
  81184. if (process.platform === 'win32') {
  81185. yield (_fs || _load_fs()).writeFile(filePath + '.cmd', `@${environment}"${sourcePath}" ${prependedArguments} ${appendedArguments} %*\r\n`);
  81186. } else {
  81187. yield (_fs || _load_fs()).writeFile(filePath, `#!/bin/sh\n\n${environment}exec "${sourcePath}"${prependedArguments} "$@"${appendedArguments}\n`);
  81188. yield (_fs || _load_fs()).chmod(filePath, 0o755);
  81189. }
  81190. });
  81191. return function makePortableProxyScriptUnix(_x, _x2, _x3) {
  81192. return _ref.apply(this, arguments);
  81193. };
  81194. }();
  81195. exports.makePortableProxyScript = makePortableProxyScript;
  81196. var _fs;
  81197. function _load_fs() {
  81198. return _fs = _interopRequireWildcard(__webpack_require__(8));
  81199. }
  81200. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  81201. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  81202. var path = __webpack_require__(1);
  81203. function makePortableProxyScript(source, destination) {
  81204. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  81205. return makePortableProxyScriptUnix(source, destination, options);
  81206. }
  81207. /***/ }),
  81208. /* 547 */
  81209. /***/ (function(module, exports, __webpack_require__) {
  81210. "use strict";
  81211. Object.defineProperty(exports, "__esModule", {
  81212. value: true
  81213. });
  81214. var _assign;
  81215. function _load_assign() {
  81216. return _assign = _interopRequireDefault(__webpack_require__(23));
  81217. }
  81218. exports.findRc = findRc;
  81219. var _fs;
  81220. function _load_fs() {
  81221. return _fs = __webpack_require__(12);
  81222. }
  81223. var _path;
  81224. function _load_path() {
  81225. return _path = _interopRequireWildcard(__webpack_require__(1));
  81226. }
  81227. var _constants;
  81228. function _load_constants() {
  81229. return _constants = __webpack_require__(13);
  81230. }
  81231. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  81232. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  81233. var etc = '/etc';
  81234. var isWin = process.platform === 'win32';
  81235. var home = isWin ? process.env.USERPROFILE : process.env.HOME;
  81236. function getRcPaths(name, cwd) {
  81237. var configPaths = [];
  81238. function pushConfigPath() {
  81239. for (var _len = arguments.length, segments = Array(_len), _key = 0; _key < _len; _key++) {
  81240. segments[_key] = arguments[_key];
  81241. }
  81242. configPaths.push((_path || _load_path()).join.apply(_path || _load_path(), segments));
  81243. if (segments[segments.length - 1] === `.${name}rc`) {
  81244. configPaths.push((_path || _load_path()).join.apply(_path || _load_path(), segments.slice(0, -1).concat([`.${name}rc.yml`])));
  81245. }
  81246. }
  81247. function unshiftConfigPath() {
  81248. for (var _len2 = arguments.length, segments = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  81249. segments[_key2] = arguments[_key2];
  81250. }
  81251. if (segments[segments.length - 1] === `.${name}rc`) {
  81252. configPaths.unshift((_path || _load_path()).join.apply(_path || _load_path(), segments.slice(0, -1).concat([`.${name}rc.yml`])));
  81253. }
  81254. configPaths.unshift((_path || _load_path()).join.apply(_path || _load_path(), segments));
  81255. }
  81256. if (!isWin) {
  81257. pushConfigPath(etc, name, 'config');
  81258. pushConfigPath(etc, `${name}rc`);
  81259. }
  81260. if (home) {
  81261. pushConfigPath((_constants || _load_constants()).CONFIG_DIRECTORY);
  81262. pushConfigPath(home, '.config', name, 'config');
  81263. pushConfigPath(home, '.config', name);
  81264. pushConfigPath(home, `.${name}`, 'config');
  81265. pushConfigPath(home, `.${name}rc`);
  81266. }
  81267. // add .yarnrc locations relative to the cwd
  81268. while (true) {
  81269. unshiftConfigPath(cwd, `.${name}rc`);
  81270. var upperCwd = (_path || _load_path()).dirname(cwd);
  81271. if (upperCwd === cwd) {
  81272. // we've reached the root
  81273. break;
  81274. } else {
  81275. // continue since there's still more directories to search
  81276. cwd = upperCwd;
  81277. }
  81278. }
  81279. var envVariable = `${name}_config`.toUpperCase();
  81280. if (process.env[envVariable]) {
  81281. pushConfigPath(process.env[envVariable]);
  81282. }
  81283. return configPaths;
  81284. }
  81285. function parseRcPaths(paths, parser) {
  81286. return (_assign || _load_assign()).default.apply(Object, [{}].concat(paths.map(function (path) {
  81287. try {
  81288. return parser((0, (_fs || _load_fs()).readFileSync)(path).toString(), path);
  81289. } catch (error) {
  81290. if (error.code === 'ENOENT' || error.code === 'EISDIR') {
  81291. return {};
  81292. } else {
  81293. throw error;
  81294. }
  81295. }
  81296. })));
  81297. }
  81298. function findRc(name, cwd, parser) {
  81299. return parseRcPaths(getRcPaths(name, cwd), parser);
  81300. }
  81301. /***/ }),
  81302. /* 548 */
  81303. /***/ (function(module, exports, __webpack_require__) {
  81304. "use strict";
  81305. Object.defineProperty(exports, "__esModule", {
  81306. value: true
  81307. });
  81308. exports.isFakeRoot = isFakeRoot;
  81309. exports.isRootUser = isRootUser;
  81310. function getUid() {
  81311. if (process.platform !== 'win32' && process.getuid) {
  81312. return process.getuid();
  81313. }
  81314. return null;
  81315. }
  81316. exports.default = isRootUser(getUid()) && !isFakeRoot();
  81317. function isFakeRoot() {
  81318. return Boolean(process.env.FAKEROOTKEY);
  81319. }
  81320. function isRootUser(uid) {
  81321. return uid === 0;
  81322. }
  81323. /***/ }),
  81324. /* 549 */
  81325. /***/ (function(module, exports, __webpack_require__) {
  81326. "use strict";
  81327. Object.defineProperty(exports, "__esModule", {
  81328. value: true
  81329. });
  81330. exports.getDataDir = getDataDir;
  81331. exports.getCacheDir = getCacheDir;
  81332. exports.getConfigDir = getConfigDir;
  81333. var path = __webpack_require__(1);
  81334. var userHome = __webpack_require__(101).default;
  81335. var FALLBACK_CONFIG_DIR = path.join(userHome, '.config', 'yarn');
  81336. var FALLBACK_CACHE_DIR = path.join(userHome, '.cache', 'yarn');
  81337. function getDataDir() {
  81338. if (process.platform === 'win32') {
  81339. var WIN32_APPDATA_DIR = getLocalAppDataDir();
  81340. return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path.join(WIN32_APPDATA_DIR, 'Data');
  81341. } else if (process.env.XDG_DATA_HOME) {
  81342. return path.join(process.env.XDG_DATA_HOME, 'yarn');
  81343. } else {
  81344. // This could arguably be ~/Library/Application Support/Yarn on Macs,
  81345. // but that feels unintuitive for a cli tool
  81346. // Instead, use our prior fallback. Some day this could be
  81347. // path.join(userHome, '.local', 'share', 'yarn')
  81348. // or return path.join(WIN32_APPDATA_DIR, 'Data') on win32
  81349. return FALLBACK_CONFIG_DIR;
  81350. }
  81351. }
  81352. function getCacheDir() {
  81353. if (process.platform === 'win32') {
  81354. // process.env.TEMP also exists, but most apps put caches here
  81355. return path.join(getLocalAppDataDir() || path.join(userHome, 'AppData', 'Local', 'Yarn'), 'Cache');
  81356. } else if (process.env.XDG_CACHE_HOME) {
  81357. return path.join(process.env.XDG_CACHE_HOME, 'yarn');
  81358. } else if (process.platform === 'darwin') {
  81359. return path.join(userHome, 'Library', 'Caches', 'Yarn');
  81360. } else {
  81361. return FALLBACK_CACHE_DIR;
  81362. }
  81363. }
  81364. function getConfigDir() {
  81365. if (process.platform === 'win32') {
  81366. // Use our prior fallback. Some day this could be
  81367. // return path.join(WIN32_APPDATA_DIR, 'Config')
  81368. var WIN32_APPDATA_DIR = getLocalAppDataDir();
  81369. return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path.join(WIN32_APPDATA_DIR, 'Config');
  81370. } else if (process.env.XDG_CONFIG_HOME) {
  81371. return path.join(process.env.XDG_CONFIG_HOME, 'yarn');
  81372. } else {
  81373. return FALLBACK_CONFIG_DIR;
  81374. }
  81375. }
  81376. function getLocalAppDataDir() {
  81377. return process.env.LOCALAPPDATA ? path.join(process.env.LOCALAPPDATA, 'Yarn') : null;
  81378. }
  81379. /***/ }),
  81380. /* 550 */
  81381. /***/ (function(module, exports, __webpack_require__) {
  81382. module.exports = { "default": __webpack_require__(596), __esModule: true };
  81383. /***/ }),
  81384. /* 551 */
  81385. /***/ (function(module, exports, __webpack_require__) {
  81386. module.exports = { "default": __webpack_require__(599), __esModule: true };
  81387. /***/ }),
  81388. /* 552 */
  81389. /***/ (function(module, exports, __webpack_require__) {
  81390. module.exports = { "default": __webpack_require__(601), __esModule: true };
  81391. /***/ }),
  81392. /* 553 */
  81393. /***/ (function(module, exports, __webpack_require__) {
  81394. module.exports = { "default": __webpack_require__(603), __esModule: true };
  81395. /***/ }),
  81396. /* 554 */
  81397. /***/ (function(module, exports, __webpack_require__) {
  81398. module.exports = { "default": __webpack_require__(604), __esModule: true };
  81399. /***/ }),
  81400. /* 555 */
  81401. /***/ (function(module, exports, __webpack_require__) {
  81402. "use strict";
  81403. module.exports = balanced;
  81404. function balanced(a, b, str) {
  81405. if (a instanceof RegExp) a = maybeMatch(a, str);
  81406. if (b instanceof RegExp) b = maybeMatch(b, str);
  81407. var r = range(a, b, str);
  81408. return r && {
  81409. start: r[0],
  81410. end: r[1],
  81411. pre: str.slice(0, r[0]),
  81412. body: str.slice(r[0] + a.length, r[1]),
  81413. post: str.slice(r[1] + b.length)
  81414. };
  81415. }
  81416. function maybeMatch(reg, str) {
  81417. var m = str.match(reg);
  81418. return m ? m[0] : null;
  81419. }
  81420. balanced.range = range;
  81421. function range(a, b, str) {
  81422. var begs, beg, left, right, result;
  81423. var ai = str.indexOf(a);
  81424. var bi = str.indexOf(b, ai + 1);
  81425. var i = ai;
  81426. if (ai >= 0 && bi > 0) {
  81427. begs = [];
  81428. left = str.length;
  81429. while (i >= 0 && !result) {
  81430. if (i == ai) {
  81431. begs.push(i);
  81432. ai = str.indexOf(a, i + 1);
  81433. } else if (begs.length == 1) {
  81434. result = [ begs.pop(), bi ];
  81435. } else {
  81436. beg = begs.pop();
  81437. if (beg < left) {
  81438. left = beg;
  81439. right = bi;
  81440. }
  81441. bi = str.indexOf(b, i + 1);
  81442. }
  81443. i = ai < bi && ai >= 0 ? ai : bi;
  81444. }
  81445. if (begs.length) {
  81446. result = [ left, right ];
  81447. }
  81448. }
  81449. return result;
  81450. }
  81451. /***/ }),
  81452. /* 556 */
  81453. /***/ (function(module, exports, __webpack_require__) {
  81454. var DuplexStream = __webpack_require__(863)
  81455. , util = __webpack_require__(9)
  81456. , Buffer = __webpack_require__(60).Buffer
  81457. function BufferList (callback) {
  81458. if (!(this instanceof BufferList))
  81459. return new BufferList(callback)
  81460. this._bufs = []
  81461. this.length = 0
  81462. if (typeof callback == 'function') {
  81463. this._callback = callback
  81464. var piper = function piper (err) {
  81465. if (this._callback) {
  81466. this._callback(err)
  81467. this._callback = null
  81468. }
  81469. }.bind(this)
  81470. this.on('pipe', function onPipe (src) {
  81471. src.on('error', piper)
  81472. })
  81473. this.on('unpipe', function onUnpipe (src) {
  81474. src.removeListener('error', piper)
  81475. })
  81476. } else {
  81477. this.append(callback)
  81478. }
  81479. DuplexStream.call(this)
  81480. }
  81481. util.inherits(BufferList, DuplexStream)
  81482. BufferList.prototype._offset = function _offset (offset) {
  81483. var tot = 0, i = 0, _t
  81484. if (offset === 0) return [ 0, 0 ]
  81485. for (; i < this._bufs.length; i++) {
  81486. _t = tot + this._bufs[i].length
  81487. if (offset < _t || i == this._bufs.length - 1)
  81488. return [ i, offset - tot ]
  81489. tot = _t
  81490. }
  81491. }
  81492. BufferList.prototype.append = function append (buf) {
  81493. var i = 0
  81494. if (Buffer.isBuffer(buf)) {
  81495. this._appendBuffer(buf);
  81496. } else if (Array.isArray(buf)) {
  81497. for (; i < buf.length; i++)
  81498. this.append(buf[i])
  81499. } else if (buf instanceof BufferList) {
  81500. // unwrap argument into individual BufferLists
  81501. for (; i < buf._bufs.length; i++)
  81502. this.append(buf._bufs[i])
  81503. } else if (buf != null) {
  81504. // coerce number arguments to strings, since Buffer(number) does
  81505. // uninitialized memory allocation
  81506. if (typeof buf == 'number')
  81507. buf = buf.toString()
  81508. this._appendBuffer(Buffer.from(buf));
  81509. }
  81510. return this
  81511. }
  81512. BufferList.prototype._appendBuffer = function appendBuffer (buf) {
  81513. this._bufs.push(buf)
  81514. this.length += buf.length
  81515. }
  81516. BufferList.prototype._write = function _write (buf, encoding, callback) {
  81517. this._appendBuffer(buf)
  81518. if (typeof callback == 'function')
  81519. callback()
  81520. }
  81521. BufferList.prototype._read = function _read (size) {
  81522. if (!this.length)
  81523. return this.push(null)
  81524. size = Math.min(size, this.length)
  81525. this.push(this.slice(0, size))
  81526. this.consume(size)
  81527. }
  81528. BufferList.prototype.end = function end (chunk) {
  81529. DuplexStream.prototype.end.call(this, chunk)
  81530. if (this._callback) {
  81531. this._callback(null, this.slice())
  81532. this._callback = null
  81533. }
  81534. }
  81535. BufferList.prototype.get = function get (index) {
  81536. return this.slice(index, index + 1)[0]
  81537. }
  81538. BufferList.prototype.slice = function slice (start, end) {
  81539. if (typeof start == 'number' && start < 0)
  81540. start += this.length
  81541. if (typeof end == 'number' && end < 0)
  81542. end += this.length
  81543. return this.copy(null, 0, start, end)
  81544. }
  81545. BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {
  81546. if (typeof srcStart != 'number' || srcStart < 0)
  81547. srcStart = 0
  81548. if (typeof srcEnd != 'number' || srcEnd > this.length)
  81549. srcEnd = this.length
  81550. if (srcStart >= this.length)
  81551. return dst || Buffer.alloc(0)
  81552. if (srcEnd <= 0)
  81553. return dst || Buffer.alloc(0)
  81554. var copy = !!dst
  81555. , off = this._offset(srcStart)
  81556. , len = srcEnd - srcStart
  81557. , bytes = len
  81558. , bufoff = (copy && dstStart) || 0
  81559. , start = off[1]
  81560. , l
  81561. , i
  81562. // copy/slice everything
  81563. if (srcStart === 0 && srcEnd == this.length) {
  81564. if (!copy) { // slice, but full concat if multiple buffers
  81565. return this._bufs.length === 1
  81566. ? this._bufs[0]
  81567. : Buffer.concat(this._bufs, this.length)
  81568. }
  81569. // copy, need to copy individual buffers
  81570. for (i = 0; i < this._bufs.length; i++) {
  81571. this._bufs[i].copy(dst, bufoff)
  81572. bufoff += this._bufs[i].length
  81573. }
  81574. return dst
  81575. }
  81576. // easy, cheap case where it's a subset of one of the buffers
  81577. if (bytes <= this._bufs[off[0]].length - start) {
  81578. return copy
  81579. ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
  81580. : this._bufs[off[0]].slice(start, start + bytes)
  81581. }
  81582. if (!copy) // a slice, we need something to copy in to
  81583. dst = Buffer.allocUnsafe(len)
  81584. for (i = off[0]; i < this._bufs.length; i++) {
  81585. l = this._bufs[i].length - start
  81586. if (bytes > l) {
  81587. this._bufs[i].copy(dst, bufoff, start)
  81588. } else {
  81589. this._bufs[i].copy(dst, bufoff, start, start + bytes)
  81590. break
  81591. }
  81592. bufoff += l
  81593. bytes -= l
  81594. if (start)
  81595. start = 0
  81596. }
  81597. return dst
  81598. }
  81599. BufferList.prototype.shallowSlice = function shallowSlice (start, end) {
  81600. start = start || 0
  81601. end = end || this.length
  81602. if (start < 0)
  81603. start += this.length
  81604. if (end < 0)
  81605. end += this.length
  81606. var startOffset = this._offset(start)
  81607. , endOffset = this._offset(end)
  81608. , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1)
  81609. if (endOffset[1] == 0)
  81610. buffers.pop()
  81611. else
  81612. buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1])
  81613. if (startOffset[1] != 0)
  81614. buffers[0] = buffers[0].slice(startOffset[1])
  81615. return new BufferList(buffers)
  81616. }
  81617. BufferList.prototype.toString = function toString (encoding, start, end) {
  81618. return this.slice(start, end).toString(encoding)
  81619. }
  81620. BufferList.prototype.consume = function consume (bytes) {
  81621. while (this._bufs.length) {
  81622. if (bytes >= this._bufs[0].length) {
  81623. bytes -= this._bufs[0].length
  81624. this.length -= this._bufs[0].length
  81625. this._bufs.shift()
  81626. } else {
  81627. this._bufs[0] = this._bufs[0].slice(bytes)
  81628. this.length -= bytes
  81629. break
  81630. }
  81631. }
  81632. return this
  81633. }
  81634. BufferList.prototype.duplicate = function duplicate () {
  81635. var i = 0
  81636. , copy = new BufferList()
  81637. for (; i < this._bufs.length; i++)
  81638. copy.append(this._bufs[i])
  81639. return copy
  81640. }
  81641. BufferList.prototype.destroy = function destroy () {
  81642. this._bufs.length = 0
  81643. this.length = 0
  81644. this.push(null)
  81645. }
  81646. ;(function () {
  81647. var methods = {
  81648. 'readDoubleBE' : 8
  81649. , 'readDoubleLE' : 8
  81650. , 'readFloatBE' : 4
  81651. , 'readFloatLE' : 4
  81652. , 'readInt32BE' : 4
  81653. , 'readInt32LE' : 4
  81654. , 'readUInt32BE' : 4
  81655. , 'readUInt32LE' : 4
  81656. , 'readInt16BE' : 2
  81657. , 'readInt16LE' : 2
  81658. , 'readUInt16BE' : 2
  81659. , 'readUInt16LE' : 2
  81660. , 'readInt8' : 1
  81661. , 'readUInt8' : 1
  81662. }
  81663. for (var m in methods) {
  81664. (function (m) {
  81665. BufferList.prototype[m] = function (offset) {
  81666. return this.slice(offset, offset + methods[m])[m](0)
  81667. }
  81668. }(m))
  81669. }
  81670. }())
  81671. module.exports = BufferList
  81672. /***/ }),
  81673. /* 557 */
  81674. /***/ (function(module, exports, __webpack_require__) {
  81675. var concatMap = __webpack_require__(589);
  81676. var balanced = __webpack_require__(555);
  81677. module.exports = expandTop;
  81678. var escSlash = '\0SLASH'+Math.random()+'\0';
  81679. var escOpen = '\0OPEN'+Math.random()+'\0';
  81680. var escClose = '\0CLOSE'+Math.random()+'\0';
  81681. var escComma = '\0COMMA'+Math.random()+'\0';
  81682. var escPeriod = '\0PERIOD'+Math.random()+'\0';
  81683. function numeric(str) {
  81684. return parseInt(str, 10) == str
  81685. ? parseInt(str, 10)
  81686. : str.charCodeAt(0);
  81687. }
  81688. function escapeBraces(str) {
  81689. return str.split('\\\\').join(escSlash)
  81690. .split('\\{').join(escOpen)
  81691. .split('\\}').join(escClose)
  81692. .split('\\,').join(escComma)
  81693. .split('\\.').join(escPeriod);
  81694. }
  81695. function unescapeBraces(str) {
  81696. return str.split(escSlash).join('\\')
  81697. .split(escOpen).join('{')
  81698. .split(escClose).join('}')
  81699. .split(escComma).join(',')
  81700. .split(escPeriod).join('.');
  81701. }
  81702. // Basically just str.split(","), but handling cases
  81703. // where we have nested braced sections, which should be
  81704. // treated as individual members, like {a,{b,c},d}
  81705. function parseCommaParts(str) {
  81706. if (!str)
  81707. return [''];
  81708. var parts = [];
  81709. var m = balanced('{', '}', str);
  81710. if (!m)
  81711. return str.split(',');
  81712. var pre = m.pre;
  81713. var body = m.body;
  81714. var post = m.post;
  81715. var p = pre.split(',');
  81716. p[p.length-1] += '{' + body + '}';
  81717. var postParts = parseCommaParts(post);
  81718. if (post.length) {
  81719. p[p.length-1] += postParts.shift();
  81720. p.push.apply(p, postParts);
  81721. }
  81722. parts.push.apply(parts, p);
  81723. return parts;
  81724. }
  81725. function expandTop(str) {
  81726. if (!str)
  81727. return [];
  81728. // I don't know why Bash 4.3 does this, but it does.
  81729. // Anything starting with {} will have the first two bytes preserved
  81730. // but *only* at the top level, so {},a}b will not expand to anything,
  81731. // but a{},b}c will be expanded to [a}c,abc].
  81732. // One could argue that this is a bug in Bash, but since the goal of
  81733. // this module is to match Bash's rules, we escape a leading {}
  81734. if (str.substr(0, 2) === '{}') {
  81735. str = '\\{\\}' + str.substr(2);
  81736. }
  81737. return expand(escapeBraces(str), true).map(unescapeBraces);
  81738. }
  81739. function identity(e) {
  81740. return e;
  81741. }
  81742. function embrace(str) {
  81743. return '{' + str + '}';
  81744. }
  81745. function isPadded(el) {
  81746. return /^-?0\d/.test(el);
  81747. }
  81748. function lte(i, y) {
  81749. return i <= y;
  81750. }
  81751. function gte(i, y) {
  81752. return i >= y;
  81753. }
  81754. function expand(str, isTop) {
  81755. var expansions = [];
  81756. var m = balanced('{', '}', str);
  81757. if (!m || /\$$/.test(m.pre)) return [str];
  81758. var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  81759. var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  81760. var isSequence = isNumericSequence || isAlphaSequence;
  81761. var isOptions = m.body.indexOf(',') >= 0;
  81762. if (!isSequence && !isOptions) {
  81763. // {a},b}
  81764. if (m.post.match(/,.*\}/)) {
  81765. str = m.pre + '{' + m.body + escClose + m.post;
  81766. return expand(str);
  81767. }
  81768. return [str];
  81769. }
  81770. var n;
  81771. if (isSequence) {
  81772. n = m.body.split(/\.\./);
  81773. } else {
  81774. n = parseCommaParts(m.body);
  81775. if (n.length === 1) {
  81776. // x{{a,b}}y ==> x{a}y x{b}y
  81777. n = expand(n[0], false).map(embrace);
  81778. if (n.length === 1) {
  81779. var post = m.post.length
  81780. ? expand(m.post, false)
  81781. : [''];
  81782. return post.map(function(p) {
  81783. return m.pre + n[0] + p;
  81784. });
  81785. }
  81786. }
  81787. }
  81788. // at this point, n is the parts, and we know it's not a comma set
  81789. // with a single entry.
  81790. // no need to expand pre, since it is guaranteed to be free of brace-sets
  81791. var pre = m.pre;
  81792. var post = m.post.length
  81793. ? expand(m.post, false)
  81794. : [''];
  81795. var N;
  81796. if (isSequence) {
  81797. var x = numeric(n[0]);
  81798. var y = numeric(n[1]);
  81799. var width = Math.max(n[0].length, n[1].length)
  81800. var incr = n.length == 3
  81801. ? Math.abs(numeric(n[2]))
  81802. : 1;
  81803. var test = lte;
  81804. var reverse = y < x;
  81805. if (reverse) {
  81806. incr *= -1;
  81807. test = gte;
  81808. }
  81809. var pad = n.some(isPadded);
  81810. N = [];
  81811. for (var i = x; test(i, y); i += incr) {
  81812. var c;
  81813. if (isAlphaSequence) {
  81814. c = String.fromCharCode(i);
  81815. if (c === '\\')
  81816. c = '';
  81817. } else {
  81818. c = String(i);
  81819. if (pad) {
  81820. var need = width - c.length;
  81821. if (need > 0) {
  81822. var z = new Array(need + 1).join('0');
  81823. if (i < 0)
  81824. c = '-' + z + c.slice(1);
  81825. else
  81826. c = z + c;
  81827. }
  81828. }
  81829. }
  81830. N.push(c);
  81831. }
  81832. } else {
  81833. N = concatMap(n, function(el) { return expand(el, false) });
  81834. }
  81835. for (var j = 0; j < N.length; j++) {
  81836. for (var k = 0; k < post.length; k++) {
  81837. var expansion = pre + N[j] + post[k];
  81838. if (!isTop || isSequence || expansion)
  81839. expansions.push(expansion);
  81840. }
  81841. }
  81842. return expansions;
  81843. }
  81844. /***/ }),
  81845. /* 558 */
  81846. /***/ (function(module, exports) {
  81847. function allocUnsafe (size) {
  81848. if (typeof size !== 'number') {
  81849. throw new TypeError('"size" argument must be a number')
  81850. }
  81851. if (size < 0) {
  81852. throw new RangeError('"size" argument must not be negative')
  81853. }
  81854. if (Buffer.allocUnsafe) {
  81855. return Buffer.allocUnsafe(size)
  81856. } else {
  81857. return new Buffer(size)
  81858. }
  81859. }
  81860. module.exports = allocUnsafe
  81861. /***/ }),
  81862. /* 559 */
  81863. /***/ (function(module, exports) {
  81864. /* Node.js 6.4.0 and up has full support */
  81865. var hasFullSupport = (function () {
  81866. try {
  81867. if (!Buffer.isEncoding('latin1')) {
  81868. return false
  81869. }
  81870. var buf = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4)
  81871. buf.fill('ab', 'ucs2')
  81872. return (buf.toString('hex') === '61006200')
  81873. } catch (_) {
  81874. return false
  81875. }
  81876. }())
  81877. function isSingleByte (val) {
  81878. return (val.length === 1 && val.charCodeAt(0) < 256)
  81879. }
  81880. function fillWithNumber (buffer, val, start, end) {
  81881. if (start < 0 || end > buffer.length) {
  81882. throw new RangeError('Out of range index')
  81883. }
  81884. start = start >>> 0
  81885. end = end === undefined ? buffer.length : end >>> 0
  81886. if (end > start) {
  81887. buffer.fill(val, start, end)
  81888. }
  81889. return buffer
  81890. }
  81891. function fillWithBuffer (buffer, val, start, end) {
  81892. if (start < 0 || end > buffer.length) {
  81893. throw new RangeError('Out of range index')
  81894. }
  81895. if (end <= start) {
  81896. return buffer
  81897. }
  81898. start = start >>> 0
  81899. end = end === undefined ? buffer.length : end >>> 0
  81900. var pos = start
  81901. var len = val.length
  81902. while (pos <= (end - len)) {
  81903. val.copy(buffer, pos)
  81904. pos += len
  81905. }
  81906. if (pos !== end) {
  81907. val.copy(buffer, pos, 0, end - pos)
  81908. }
  81909. return buffer
  81910. }
  81911. function fill (buffer, val, start, end, encoding) {
  81912. if (hasFullSupport) {
  81913. return buffer.fill(val, start, end, encoding)
  81914. }
  81915. if (typeof val === 'number') {
  81916. return fillWithNumber(buffer, val, start, end)
  81917. }
  81918. if (typeof val === 'string') {
  81919. if (typeof start === 'string') {
  81920. encoding = start
  81921. start = 0
  81922. end = buffer.length
  81923. } else if (typeof end === 'string') {
  81924. encoding = end
  81925. end = buffer.length
  81926. }
  81927. if (encoding !== undefined && typeof encoding !== 'string') {
  81928. throw new TypeError('encoding must be a string')
  81929. }
  81930. if (encoding === 'latin1') {
  81931. encoding = 'binary'
  81932. }
  81933. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  81934. throw new TypeError('Unknown encoding: ' + encoding)
  81935. }
  81936. if (val === '') {
  81937. return fillWithNumber(buffer, 0, start, end)
  81938. }
  81939. if (isSingleByte(val)) {
  81940. return fillWithNumber(buffer, val.charCodeAt(0), start, end)
  81941. }
  81942. val = new Buffer(val, encoding)
  81943. }
  81944. if (Buffer.isBuffer(val)) {
  81945. return fillWithBuffer(buffer, val, start, end)
  81946. }
  81947. // Other values (e.g. undefined, boolean, object) results in zero-fill
  81948. return fillWithNumber(buffer, 0, start, end)
  81949. }
  81950. module.exports = fill
  81951. /***/ }),
  81952. /* 560 */
  81953. /***/ (function(module, exports) {
  81954. var toString = Object.prototype.toString
  81955. var isModern = (
  81956. typeof Buffer.alloc === 'function' &&
  81957. typeof Buffer.allocUnsafe === 'function' &&
  81958. typeof Buffer.from === 'function'
  81959. )
  81960. function isArrayBuffer (input) {
  81961. return toString.call(input).slice(8, -1) === 'ArrayBuffer'
  81962. }
  81963. function fromArrayBuffer (obj, byteOffset, length) {
  81964. byteOffset >>>= 0
  81965. var maxLength = obj.byteLength - byteOffset
  81966. if (maxLength < 0) {
  81967. throw new RangeError("'offset' is out of bounds")
  81968. }
  81969. if (length === undefined) {
  81970. length = maxLength
  81971. } else {
  81972. length >>>= 0
  81973. if (length > maxLength) {
  81974. throw new RangeError("'length' is out of bounds")
  81975. }
  81976. }
  81977. return isModern
  81978. ? Buffer.from(obj.slice(byteOffset, byteOffset + length))
  81979. : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))
  81980. }
  81981. function fromString (string, encoding) {
  81982. if (typeof encoding !== 'string' || encoding === '') {
  81983. encoding = 'utf8'
  81984. }
  81985. if (!Buffer.isEncoding(encoding)) {
  81986. throw new TypeError('"encoding" must be a valid string encoding')
  81987. }
  81988. return isModern
  81989. ? Buffer.from(string, encoding)
  81990. : new Buffer(string, encoding)
  81991. }
  81992. function bufferFrom (value, encodingOrOffset, length) {
  81993. if (typeof value === 'number') {
  81994. throw new TypeError('"value" argument must not be a number')
  81995. }
  81996. if (isArrayBuffer(value)) {
  81997. return fromArrayBuffer(value, encodingOrOffset, length)
  81998. }
  81999. if (typeof value === 'string') {
  82000. return fromString(value, encodingOrOffset)
  82001. }
  82002. return isModern
  82003. ? Buffer.from(value)
  82004. : new Buffer(value)
  82005. }
  82006. module.exports = bufferFrom
  82007. /***/ }),
  82008. /* 561 */
  82009. /***/ (function(module, exports, __webpack_require__) {
  82010. "use strict";
  82011. /*!
  82012. * bytes
  82013. * Copyright(c) 2012-2014 TJ Holowaychuk
  82014. * Copyright(c) 2015 Jed Watson
  82015. * MIT Licensed
  82016. */
  82017. /**
  82018. * Module exports.
  82019. * @public
  82020. */
  82021. module.exports = bytes;
  82022. module.exports.format = format;
  82023. module.exports.parse = parse;
  82024. /**
  82025. * Module variables.
  82026. * @private
  82027. */
  82028. var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
  82029. var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
  82030. var map = {
  82031. b: 1,
  82032. kb: 1 << 10,
  82033. mb: 1 << 20,
  82034. gb: 1 << 30,
  82035. tb: ((1 << 30) * 1024)
  82036. };
  82037. var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb)$/i;
  82038. /**
  82039. * Convert the given value in bytes into a string or parse to string to an integer in bytes.
  82040. *
  82041. * @param {string|number} value
  82042. * @param {{
  82043. * case: [string],
  82044. * decimalPlaces: [number]
  82045. * fixedDecimals: [boolean]
  82046. * thousandsSeparator: [string]
  82047. * unitSeparator: [string]
  82048. * }} [options] bytes options.
  82049. *
  82050. * @returns {string|number|null}
  82051. */
  82052. function bytes(value, options) {
  82053. if (typeof value === 'string') {
  82054. return parse(value);
  82055. }
  82056. if (typeof value === 'number') {
  82057. return format(value, options);
  82058. }
  82059. return null;
  82060. }
  82061. /**
  82062. * Format the given value in bytes into a string.
  82063. *
  82064. * If the value is negative, it is kept as such. If it is a float,
  82065. * it is rounded.
  82066. *
  82067. * @param {number} value
  82068. * @param {object} [options]
  82069. * @param {number} [options.decimalPlaces=2]
  82070. * @param {number} [options.fixedDecimals=false]
  82071. * @param {string} [options.thousandsSeparator=]
  82072. * @param {string} [options.unit=]
  82073. * @param {string} [options.unitSeparator=]
  82074. *
  82075. * @returns {string|null}
  82076. * @public
  82077. */
  82078. function format(value, options) {
  82079. if (!Number.isFinite(value)) {
  82080. return null;
  82081. }
  82082. var mag = Math.abs(value);
  82083. var thousandsSeparator = (options && options.thousandsSeparator) || '';
  82084. var unitSeparator = (options && options.unitSeparator) || '';
  82085. var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2;
  82086. var fixedDecimals = Boolean(options && options.fixedDecimals);
  82087. var unit = (options && options.unit) || '';
  82088. if (!unit || !map[unit.toLowerCase()]) {
  82089. if (mag >= map.tb) {
  82090. unit = 'TB';
  82091. } else if (mag >= map.gb) {
  82092. unit = 'GB';
  82093. } else if (mag >= map.mb) {
  82094. unit = 'MB';
  82095. } else if (mag >= map.kb) {
  82096. unit = 'KB';
  82097. } else {
  82098. unit = 'B';
  82099. }
  82100. }
  82101. var val = value / map[unit.toLowerCase()];
  82102. var str = val.toFixed(decimalPlaces);
  82103. if (!fixedDecimals) {
  82104. str = str.replace(formatDecimalsRegExp, '$1');
  82105. }
  82106. if (thousandsSeparator) {
  82107. str = str.replace(formatThousandsRegExp, thousandsSeparator);
  82108. }
  82109. return str + unitSeparator + unit;
  82110. }
  82111. /**
  82112. * Parse the string value into an integer in bytes.
  82113. *
  82114. * If no unit is given, it is assumed the value is in bytes.
  82115. *
  82116. * @param {number|string} val
  82117. *
  82118. * @returns {number|null}
  82119. * @public
  82120. */
  82121. function parse(val) {
  82122. if (typeof val === 'number' && !isNaN(val)) {
  82123. return val;
  82124. }
  82125. if (typeof val !== 'string') {
  82126. return null;
  82127. }
  82128. // Test if the string passed is valid
  82129. var results = parseRegExp.exec(val);
  82130. var floatValue;
  82131. var unit = 'b';
  82132. if (!results) {
  82133. // Nothing could be extracted from the given string
  82134. floatValue = parseInt(val, 10);
  82135. unit = 'b'
  82136. } else {
  82137. // Retrieve the value and the unit
  82138. floatValue = parseFloat(results[1]);
  82139. unit = results[4].toLowerCase();
  82140. }
  82141. return Math.floor(map[unit] * floatValue);
  82142. }
  82143. /***/ }),
  82144. /* 562 */
  82145. /***/ (function(module, exports, __webpack_require__) {
  82146. "use strict";
  82147. function preserveCamelCase(str) {
  82148. let isLastCharLower = false;
  82149. let isLastCharUpper = false;
  82150. let isLastLastCharUpper = false;
  82151. for (let i = 0; i < str.length; i++) {
  82152. const c = str[i];
  82153. if (isLastCharLower && /[a-zA-Z]/.test(c) && c.toUpperCase() === c) {
  82154. str = str.substr(0, i) + '-' + str.substr(i);
  82155. isLastCharLower = false;
  82156. isLastLastCharUpper = isLastCharUpper;
  82157. isLastCharUpper = true;
  82158. i++;
  82159. } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(c) && c.toLowerCase() === c) {
  82160. str = str.substr(0, i - 1) + '-' + str.substr(i - 1);
  82161. isLastLastCharUpper = isLastCharUpper;
  82162. isLastCharUpper = false;
  82163. isLastCharLower = true;
  82164. } else {
  82165. isLastCharLower = c.toLowerCase() === c;
  82166. isLastLastCharUpper = isLastCharUpper;
  82167. isLastCharUpper = c.toUpperCase() === c;
  82168. }
  82169. }
  82170. return str;
  82171. }
  82172. module.exports = function (str) {
  82173. if (arguments.length > 1) {
  82174. str = Array.from(arguments)
  82175. .map(x => x.trim())
  82176. .filter(x => x.length)
  82177. .join('-');
  82178. } else {
  82179. str = str.trim();
  82180. }
  82181. if (str.length === 0) {
  82182. return '';
  82183. }
  82184. if (str.length === 1) {
  82185. return str.toLowerCase();
  82186. }
  82187. if (/^[a-z0-9]+$/.test(str)) {
  82188. return str;
  82189. }
  82190. const hasUpperCase = str !== str.toLowerCase();
  82191. if (hasUpperCase) {
  82192. str = preserveCamelCase(str);
  82193. }
  82194. return str
  82195. .replace(/^[_.\- ]+/, '')
  82196. .toLowerCase()
  82197. .replace(/[_.\- ]+(\w|$)/g, (m, p1) => p1.toUpperCase());
  82198. };
  82199. /***/ }),
  82200. /* 563 */
  82201. /***/ (function(module, exports, __webpack_require__) {
  82202. "use strict";
  82203. module.exports = (flag, argv) => {
  82204. argv = argv || process.argv;
  82205. const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
  82206. const pos = argv.indexOf(prefix + flag);
  82207. const terminatorPos = argv.indexOf('--');
  82208. return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
  82209. };
  82210. /***/ }),
  82211. /* 564 */
  82212. /***/ (function(module, exports, __webpack_require__) {
  82213. "use strict";
  82214. const os = __webpack_require__(66);
  82215. const hasFlag = __webpack_require__(563);
  82216. const env = process.env;
  82217. let forceColor;
  82218. if (hasFlag('no-color') ||
  82219. hasFlag('no-colors') ||
  82220. hasFlag('color=false')) {
  82221. forceColor = false;
  82222. } else if (hasFlag('color') ||
  82223. hasFlag('colors') ||
  82224. hasFlag('color=true') ||
  82225. hasFlag('color=always')) {
  82226. forceColor = true;
  82227. }
  82228. if ('FORCE_COLOR' in env) {
  82229. forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
  82230. }
  82231. function translateLevel(level) {
  82232. if (level === 0) {
  82233. return false;
  82234. }
  82235. return {
  82236. level,
  82237. hasBasic: true,
  82238. has256: level >= 2,
  82239. has16m: level >= 3
  82240. };
  82241. }
  82242. function supportsColor(stream) {
  82243. if (forceColor === false) {
  82244. return 0;
  82245. }
  82246. if (hasFlag('color=16m') ||
  82247. hasFlag('color=full') ||
  82248. hasFlag('color=truecolor')) {
  82249. return 3;
  82250. }
  82251. if (hasFlag('color=256')) {
  82252. return 2;
  82253. }
  82254. if (stream && !stream.isTTY && forceColor !== true) {
  82255. return 0;
  82256. }
  82257. const min = forceColor ? 1 : 0;
  82258. if (process.platform === 'win32') {
  82259. // Node.js 7.5.0 is the first version of Node.js to include a patch to
  82260. // libuv that enables 256 color output on Windows. Anything earlier and it
  82261. // won't work. However, here we target Node.js 8 at minimum as it is an LTS
  82262. // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
  82263. // release that supports 256 colors. Windows 10 build 14931 is the first release
  82264. // that supports 16m/TrueColor.
  82265. const osRelease = os.release().split('.');
  82266. if (
  82267. Number(process.versions.node.split('.')[0]) >= 8 &&
  82268. Number(osRelease[0]) >= 10 &&
  82269. Number(osRelease[2]) >= 10586
  82270. ) {
  82271. return Number(osRelease[2]) >= 14931 ? 3 : 2;
  82272. }
  82273. return 1;
  82274. }
  82275. if ('CI' in env) {
  82276. if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
  82277. return 1;
  82278. }
  82279. return min;
  82280. }
  82281. if ('TEAMCITY_VERSION' in env) {
  82282. return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
  82283. }
  82284. if (env.COLORTERM === 'truecolor') {
  82285. return 3;
  82286. }
  82287. if ('TERM_PROGRAM' in env) {
  82288. const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
  82289. switch (env.TERM_PROGRAM) {
  82290. case 'iTerm.app':
  82291. return version >= 3 ? 3 : 2;
  82292. case 'Apple_Terminal':
  82293. return 2;
  82294. // No default
  82295. }
  82296. }
  82297. if (/-256(color)?$/i.test(env.TERM)) {
  82298. return 2;
  82299. }
  82300. if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
  82301. return 1;
  82302. }
  82303. if ('COLORTERM' in env) {
  82304. return 1;
  82305. }
  82306. if (env.TERM === 'dumb') {
  82307. return min;
  82308. }
  82309. return min;
  82310. }
  82311. function getSupportLevel(stream) {
  82312. const level = supportsColor(stream);
  82313. return translateLevel(level);
  82314. }
  82315. module.exports = {
  82316. supportsColor: getSupportLevel,
  82317. stdout: getSupportLevel(process.stdout),
  82318. stderr: getSupportLevel(process.stderr)
  82319. };
  82320. /***/ }),
  82321. /* 565 */
  82322. /***/ (function(module, exports, __webpack_require__) {
  82323. "use strict";
  82324. const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
  82325. const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
  82326. const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
  82327. const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
  82328. const ESCAPES = new Map([
  82329. ['n', '\n'],
  82330. ['r', '\r'],
  82331. ['t', '\t'],
  82332. ['b', '\b'],
  82333. ['f', '\f'],
  82334. ['v', '\v'],
  82335. ['0', '\0'],
  82336. ['\\', '\\'],
  82337. ['e', '\u001B'],
  82338. ['a', '\u0007']
  82339. ]);
  82340. function unescape(c) {
  82341. if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
  82342. return String.fromCharCode(parseInt(c.slice(1), 16));
  82343. }
  82344. return ESCAPES.get(c) || c;
  82345. }
  82346. function parseArguments(name, args) {
  82347. const results = [];
  82348. const chunks = args.trim().split(/\s*,\s*/g);
  82349. let matches;
  82350. for (const chunk of chunks) {
  82351. if (!isNaN(chunk)) {
  82352. results.push(Number(chunk));
  82353. } else if ((matches = chunk.match(STRING_REGEX))) {
  82354. results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
  82355. } else {
  82356. throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
  82357. }
  82358. }
  82359. return results;
  82360. }
  82361. function parseStyle(style) {
  82362. STYLE_REGEX.lastIndex = 0;
  82363. const results = [];
  82364. let matches;
  82365. while ((matches = STYLE_REGEX.exec(style)) !== null) {
  82366. const name = matches[1];
  82367. if (matches[2]) {
  82368. const args = parseArguments(name, matches[2]);
  82369. results.push([name].concat(args));
  82370. } else {
  82371. results.push([name]);
  82372. }
  82373. }
  82374. return results;
  82375. }
  82376. function buildStyle(chalk, styles) {
  82377. const enabled = {};
  82378. for (const layer of styles) {
  82379. for (const style of layer.styles) {
  82380. enabled[style[0]] = layer.inverse ? null : style.slice(1);
  82381. }
  82382. }
  82383. let current = chalk;
  82384. for (const styleName of Object.keys(enabled)) {
  82385. if (Array.isArray(enabled[styleName])) {
  82386. if (!(styleName in current)) {
  82387. throw new Error(`Unknown Chalk style: ${styleName}`);
  82388. }
  82389. if (enabled[styleName].length > 0) {
  82390. current = current[styleName].apply(current, enabled[styleName]);
  82391. } else {
  82392. current = current[styleName];
  82393. }
  82394. }
  82395. }
  82396. return current;
  82397. }
  82398. module.exports = (chalk, tmp) => {
  82399. const styles = [];
  82400. const chunks = [];
  82401. let chunk = [];
  82402. // eslint-disable-next-line max-params
  82403. tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
  82404. if (escapeChar) {
  82405. chunk.push(unescape(escapeChar));
  82406. } else if (style) {
  82407. const str = chunk.join('');
  82408. chunk = [];
  82409. chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
  82410. styles.push({inverse, styles: parseStyle(style)});
  82411. } else if (close) {
  82412. if (styles.length === 0) {
  82413. throw new Error('Found extraneous } in Chalk template literal');
  82414. }
  82415. chunks.push(buildStyle(chalk, styles)(chunk.join('')));
  82416. chunk = [];
  82417. styles.pop();
  82418. } else {
  82419. chunk.push(chr);
  82420. }
  82421. });
  82422. chunks.push(chunk.join(''));
  82423. if (styles.length > 0) {
  82424. const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
  82425. throw new Error(errMsg);
  82426. }
  82427. return chunks.join('');
  82428. };
  82429. /***/ }),
  82430. /* 566 */
  82431. /***/ (function(module, exports, __webpack_require__) {
  82432. module.exports = chownr
  82433. chownr.sync = chownrSync
  82434. var fs = __webpack_require__(12)
  82435. , path = __webpack_require__(1)
  82436. function chownr (p, uid, gid, cb) {
  82437. fs.readdir(p, function (er, children) {
  82438. // any error other than ENOTDIR means it's not readable, or
  82439. // doesn't exist. give up.
  82440. if (er && er.code !== "ENOTDIR") return cb(er)
  82441. if (er || !children.length) return fs.chown(p, uid, gid, cb)
  82442. var len = children.length
  82443. , errState = null
  82444. children.forEach(function (child) {
  82445. var pathChild = path.resolve(p, child);
  82446. fs.lstat(pathChild, function(er, stats) {
  82447. if (er)
  82448. return cb(er)
  82449. if (!stats.isSymbolicLink())
  82450. chownr(pathChild, uid, gid, then)
  82451. else
  82452. then()
  82453. })
  82454. })
  82455. function then (er) {
  82456. if (errState) return
  82457. if (er) return cb(errState = er)
  82458. if (-- len === 0) return fs.chown(p, uid, gid, cb)
  82459. }
  82460. })
  82461. }
  82462. function chownrSync (p, uid, gid) {
  82463. var children
  82464. try {
  82465. children = fs.readdirSync(p)
  82466. } catch (er) {
  82467. if (er && er.code === "ENOTDIR") return fs.chownSync(p, uid, gid)
  82468. throw er
  82469. }
  82470. if (!children.length) return fs.chownSync(p, uid, gid)
  82471. children.forEach(function (child) {
  82472. var pathChild = path.resolve(p, child)
  82473. var stats = fs.lstatSync(pathChild)
  82474. if (!stats.isSymbolicLink())
  82475. chownrSync(pathChild, uid, gid)
  82476. })
  82477. return fs.chownSync(p, uid, gid)
  82478. }
  82479. /***/ }),
  82480. /* 567 */
  82481. /***/ (function(module, exports, __webpack_require__) {
  82482. "use strict";
  82483. var env = process.env
  82484. var vendors = [
  82485. // Constant, Name, Envs
  82486. ['TRAVIS', 'Travis CI', 'TRAVIS'],
  82487. ['CIRCLE', 'CircleCI', 'CIRCLECI'],
  82488. ['GITLAB', 'GitLab CI', 'GITLAB_CI'],
  82489. ['APPVEYOR', 'AppVeyor', 'APPVEYOR'],
  82490. ['CODESHIP', 'Codeship', {CI_NAME: 'codeship'}],
  82491. ['DRONE', 'Drone', 'DRONE'],
  82492. ['MAGNUM', 'Magnum CI', 'MAGNUM'],
  82493. ['SEMAPHORE', 'Semaphore', 'SEMAPHORE'],
  82494. ['JENKINS', 'Jenkins', 'JENKINS_URL', 'BUILD_ID'],
  82495. ['BAMBOO', 'Bamboo', 'bamboo_planKey'],
  82496. ['TFS', 'Team Foundation Server', 'TF_BUILD'],
  82497. ['TEAMCITY', 'TeamCity', 'TEAMCITY_VERSION'],
  82498. ['BUILDKITE', 'Buildkite', 'BUILDKITE'],
  82499. ['HUDSON', 'Hudson', 'HUDSON_URL'],
  82500. ['TASKCLUSTER', 'TaskCluster', 'TASK_ID', 'RUN_ID'],
  82501. ['GOCD', 'GoCD', 'GO_PIPELINE_LABEL'],
  82502. ['BITBUCKET', 'Bitbucket Pipelines', 'BITBUCKET_COMMIT'],
  82503. ['CODEBUILD', 'AWS CodeBuild', 'CODEBUILD_BUILD_ARN']
  82504. ]
  82505. exports.name = null
  82506. vendors.forEach(function (vendor) {
  82507. var constant = vendor.shift()
  82508. var name = vendor.shift()
  82509. var isCI = vendor.every(function (obj) {
  82510. if (typeof obj === 'string') return !!env[obj]
  82511. return Object.keys(obj).every(function (k) {
  82512. return env[k] === obj[k]
  82513. })
  82514. })
  82515. exports[constant] = isCI
  82516. if (isCI) exports.name = name
  82517. })
  82518. exports.isCI = !!(
  82519. env.CI || // Travis CI, CircleCI, Gitlab CI, Appveyor, CodeShip
  82520. env.CONTINUOUS_INTEGRATION || // Travis CI
  82521. env.BUILD_NUMBER || // Jenkins, TeamCity
  82522. exports.name ||
  82523. false
  82524. )
  82525. /***/ }),
  82526. /* 568 */
  82527. /***/ (function(module, exports, __webpack_require__) {
  82528. module.exports = __webpack_require__(571);
  82529. /***/ }),
  82530. /* 569 */
  82531. /***/ (function(module, exports, __webpack_require__) {
  82532. var kindOf = __webpack_require__(169);
  82533. var utils = __webpack_require__(320);
  82534. /**
  82535. * A representation of a cell within the table.
  82536. * Implementations must have `init` and `draw` methods,
  82537. * as well as `colSpan`, `rowSpan`, `desiredHeight` and `desiredWidth` properties.
  82538. * @param options
  82539. * @constructor
  82540. */
  82541. function Cell(options){
  82542. this.setOptions(options);
  82543. }
  82544. Cell.prototype.setOptions = function(options){
  82545. if(['boolean', 'number', 'string'].indexOf(kindOf(options)) !== -1){
  82546. options = {content:''+options};
  82547. }
  82548. options = options || {};
  82549. this.options = options;
  82550. var content = options.content;
  82551. if (['boolean', 'number', 'string'].indexOf(kindOf(content)) !== -1) {
  82552. this.content = String(content);
  82553. } else if (!content) {
  82554. this.content = '';
  82555. } else {
  82556. throw new Error('Content needs to be a primitive, got: ' + (typeof content));
  82557. }
  82558. this.colSpan = options.colSpan || 1;
  82559. this.rowSpan = options.rowSpan || 1;
  82560. };
  82561. Cell.prototype.mergeTableOptions = function(tableOptions,cells){
  82562. this.cells = cells;
  82563. var optionsChars = this.options.chars || {};
  82564. var tableChars = tableOptions.chars;
  82565. var chars = this.chars = {};
  82566. CHAR_NAMES.forEach(function(name){
  82567. setOption(optionsChars,tableChars,name,chars);
  82568. });
  82569. this.truncate = this.options.truncate || tableOptions.truncate;
  82570. var style = this.options.style = this.options.style || {};
  82571. var tableStyle = tableOptions.style;
  82572. setOption(style, tableStyle, 'padding-left', this);
  82573. setOption(style, tableStyle, 'padding-right', this);
  82574. this.head = style.head || tableStyle.head;
  82575. this.border = style.border || tableStyle.border;
  82576. var fixedWidth = tableOptions.colWidths[this.x];
  82577. if(tableOptions.wordWrap && fixedWidth){
  82578. fixedWidth -= this.paddingLeft + this.paddingRight;
  82579. if(this.colSpan){
  82580. var i = 1;
  82581. while(i<this.colSpan){
  82582. fixedWidth += tableOptions.colWidths[this.x + i];
  82583. i++;
  82584. }
  82585. }
  82586. this.lines = utils.colorizeLines(utils.wordWrap(fixedWidth,this.content));
  82587. }
  82588. else {
  82589. this.lines = utils.colorizeLines(this.content.split('\n'));
  82590. }
  82591. this.desiredWidth = utils.strlen(this.content) + this.paddingLeft + this.paddingRight;
  82592. this.desiredHeight = this.lines.length;
  82593. };
  82594. /**
  82595. * Each cell will have it's `x` and `y` values set by the `layout-manager` prior to
  82596. * `init` being called;
  82597. * @type {Number}
  82598. */
  82599. Cell.prototype.x = null;
  82600. Cell.prototype.y = null;
  82601. /**
  82602. * Initializes the Cells data structure.
  82603. *
  82604. * @param tableOptions - A fully populated set of tableOptions.
  82605. * In addition to the standard default values, tableOptions must have fully populated the
  82606. * `colWidths` and `rowWidths` arrays. Those arrays must have lengths equal to the number
  82607. * of columns or rows (respectively) in this table, and each array item must be a Number.
  82608. *
  82609. */
  82610. Cell.prototype.init = function(tableOptions){
  82611. var x = this.x;
  82612. var y = this.y;
  82613. this.widths = tableOptions.colWidths.slice(x, x + this.colSpan);
  82614. this.heights = tableOptions.rowHeights.slice(y, y + this.rowSpan);
  82615. this.width = this.widths.reduce(sumPlusOne, -1);
  82616. this.height = this.heights.reduce(sumPlusOne, -1);
  82617. this.hAlign = this.options.hAlign || tableOptions.colAligns[x];
  82618. this.vAlign = this.options.vAlign || tableOptions.rowAligns[y];
  82619. this.drawRight = x + this.colSpan == tableOptions.colWidths.length;
  82620. };
  82621. /**
  82622. * Draws the given line of the cell.
  82623. * This default implementation defers to methods `drawTop`, `drawBottom`, `drawLine` and `drawEmpty`.
  82624. * @param lineNum - can be `top`, `bottom` or a numerical line number.
  82625. * @param spanningCell - will be a number if being called from a RowSpanCell, and will represent how
  82626. * many rows below it's being called from. Otherwise it's undefined.
  82627. * @returns {String} The representation of this line.
  82628. */
  82629. Cell.prototype.draw = function(lineNum,spanningCell){
  82630. if(lineNum == 'top') return this.drawTop(this.drawRight);
  82631. if(lineNum == 'bottom') return this.drawBottom(this.drawRight);
  82632. var padLen = Math.max(this.height - this.lines.length, 0);
  82633. var padTop;
  82634. switch (this.vAlign){
  82635. case 'center':
  82636. padTop = Math.ceil(padLen / 2);
  82637. break;
  82638. case 'bottom':
  82639. padTop = padLen;
  82640. break;
  82641. default :
  82642. padTop = 0;
  82643. }
  82644. if( (lineNum < padTop) || (lineNum >= (padTop + this.lines.length))){
  82645. return this.drawEmpty(this.drawRight,spanningCell);
  82646. }
  82647. var forceTruncation = (this.lines.length > this.height) && (lineNum + 1 >= this.height);
  82648. return this.drawLine(lineNum - padTop, this.drawRight, forceTruncation,spanningCell);
  82649. };
  82650. /**
  82651. * Renders the top line of the cell.
  82652. * @param drawRight - true if this method should render the right edge of the cell.
  82653. * @returns {String}
  82654. */
  82655. Cell.prototype.drawTop = function(drawRight){
  82656. var content = [];
  82657. if(this.cells){ //TODO: cells should always exist - some tests don't fill it in though
  82658. this.widths.forEach(function(width,index){
  82659. content.push(this._topLeftChar(index));
  82660. content.push(
  82661. utils.repeat(this.chars[this.y == 0 ? 'top' : 'mid'],width)
  82662. );
  82663. },this);
  82664. }
  82665. else {
  82666. content.push(this._topLeftChar(0));
  82667. content.push(utils.repeat(this.chars[this.y == 0 ? 'top' : 'mid'],this.width));
  82668. }
  82669. if(drawRight){
  82670. content.push(this.chars[this.y == 0 ? 'topRight' : 'rightMid']);
  82671. }
  82672. return this.wrapWithStyleColors('border',content.join(''));
  82673. };
  82674. Cell.prototype._topLeftChar = function(offset){
  82675. var x = this.x+offset;
  82676. var leftChar;
  82677. if(this.y == 0){
  82678. leftChar = x == 0 ? 'topLeft' : (offset == 0 ? 'topMid' : 'top');
  82679. } else {
  82680. if(x == 0){
  82681. leftChar = 'leftMid';
  82682. }
  82683. else {
  82684. leftChar = offset == 0 ? 'midMid' : 'bottomMid';
  82685. if(this.cells){ //TODO: cells should always exist - some tests don't fill it in though
  82686. var spanAbove = this.cells[this.y-1][x] instanceof Cell.ColSpanCell;
  82687. if(spanAbove){
  82688. leftChar = offset == 0 ? 'topMid' : 'mid';
  82689. }
  82690. if(offset == 0){
  82691. var i = 1;
  82692. while(this.cells[this.y][x-i] instanceof Cell.ColSpanCell){
  82693. i++;
  82694. }
  82695. if(this.cells[this.y][x-i] instanceof Cell.RowSpanCell){
  82696. leftChar = 'leftMid';
  82697. }
  82698. }
  82699. }
  82700. }
  82701. }
  82702. return this.chars[leftChar];
  82703. };
  82704. Cell.prototype.wrapWithStyleColors = function(styleProperty,content){
  82705. if(this[styleProperty] && this[styleProperty].length){
  82706. try {
  82707. var colors = __webpack_require__(587);
  82708. for(var i = this[styleProperty].length - 1; i >= 0; i--){
  82709. colors = colors[this[styleProperty][i]];
  82710. }
  82711. return colors(content);
  82712. } catch (e) {
  82713. return content;
  82714. }
  82715. }
  82716. else {
  82717. return content;
  82718. }
  82719. };
  82720. /**
  82721. * Renders a line of text.
  82722. * @param lineNum - Which line of text to render. This is not necessarily the line within the cell.
  82723. * There may be top-padding above the first line of text.
  82724. * @param drawRight - true if this method should render the right edge of the cell.
  82725. * @param forceTruncationSymbol - `true` if the rendered text should end with the truncation symbol even
  82726. * if the text fits. This is used when the cell is vertically truncated. If `false` the text should
  82727. * only include the truncation symbol if the text will not fit horizontally within the cell width.
  82728. * @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.
  82729. * @returns {String}
  82730. */
  82731. Cell.prototype.drawLine = function(lineNum,drawRight,forceTruncationSymbol,spanningCell){
  82732. var left = this.chars[this.x == 0 ? 'left' : 'middle'];
  82733. if(this.x && spanningCell && this.cells){
  82734. var cellLeft = this.cells[this.y+spanningCell][this.x-1];
  82735. while(cellLeft instanceof ColSpanCell){
  82736. cellLeft = this.cells[cellLeft.y][cellLeft.x-1];
  82737. }
  82738. if(!(cellLeft instanceof RowSpanCell)){
  82739. left = this.chars['rightMid'];
  82740. }
  82741. }
  82742. var leftPadding = utils.repeat(' ', this.paddingLeft);
  82743. var right = (drawRight ? this.chars['right'] : '');
  82744. var rightPadding = utils.repeat(' ', this.paddingRight);
  82745. var line = this.lines[lineNum];
  82746. var len = this.width - (this.paddingLeft + this.paddingRight);
  82747. if(forceTruncationSymbol) line += this.truncate || '…';
  82748. var content = utils.truncate(line,len,this.truncate);
  82749. content = utils.pad(content, len, ' ', this.hAlign);
  82750. content = leftPadding + content + rightPadding;
  82751. return this.stylizeLine(left,content,right);
  82752. };
  82753. Cell.prototype.stylizeLine = function(left,content,right){
  82754. left = this.wrapWithStyleColors('border',left);
  82755. right = this.wrapWithStyleColors('border',right);
  82756. if(this.y === 0){
  82757. content = this.wrapWithStyleColors('head',content);
  82758. }
  82759. return left + content + right;
  82760. };
  82761. /**
  82762. * Renders the bottom line of the cell.
  82763. * @param drawRight - true if this method should render the right edge of the cell.
  82764. * @returns {String}
  82765. */
  82766. Cell.prototype.drawBottom = function(drawRight){
  82767. var left = this.chars[this.x == 0 ? 'bottomLeft' : 'bottomMid'];
  82768. var content = utils.repeat(this.chars.bottom,this.width);
  82769. var right = drawRight ? this.chars['bottomRight'] : '';
  82770. return this.wrapWithStyleColors('border',left + content + right);
  82771. };
  82772. /**
  82773. * Renders a blank line of text within the cell. Used for top and/or bottom padding.
  82774. * @param drawRight - true if this method should render the right edge of the cell.
  82775. * @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.
  82776. * @returns {String}
  82777. */
  82778. Cell.prototype.drawEmpty = function(drawRight,spanningCell){
  82779. var left = this.chars[this.x == 0 ? 'left' : 'middle'];
  82780. if(this.x && spanningCell && this.cells){
  82781. var cellLeft = this.cells[this.y+spanningCell][this.x-1];
  82782. while(cellLeft instanceof ColSpanCell){
  82783. cellLeft = this.cells[cellLeft.y][cellLeft.x-1];
  82784. }
  82785. if(!(cellLeft instanceof RowSpanCell)){
  82786. left = this.chars['rightMid'];
  82787. }
  82788. }
  82789. var right = (drawRight ? this.chars['right'] : '');
  82790. var content = utils.repeat(' ',this.width);
  82791. return this.stylizeLine(left , content , right);
  82792. };
  82793. /**
  82794. * A Cell that doesn't do anything. It just draws empty lines.
  82795. * Used as a placeholder in column spanning.
  82796. * @constructor
  82797. */
  82798. function ColSpanCell(){}
  82799. ColSpanCell.prototype.draw = function(){
  82800. return '';
  82801. };
  82802. ColSpanCell.prototype.init = function(tableOptions){};
  82803. /**
  82804. * A placeholder Cell for a Cell that spans multiple rows.
  82805. * It delegates rendering to the original cell, but adds the appropriate offset.
  82806. * @param originalCell
  82807. * @constructor
  82808. */
  82809. function RowSpanCell(originalCell){
  82810. this.originalCell = originalCell;
  82811. }
  82812. RowSpanCell.prototype.init = function(tableOptions){
  82813. var y = this.y;
  82814. var originalY = this.originalCell.y;
  82815. this.cellOffset = y - originalY;
  82816. this.offset = findDimension(tableOptions.rowHeights,originalY,this.cellOffset);
  82817. };
  82818. RowSpanCell.prototype.draw = function(lineNum){
  82819. if(lineNum == 'top'){
  82820. return this.originalCell.draw(this.offset,this.cellOffset);
  82821. }
  82822. if(lineNum == 'bottom'){
  82823. return this.originalCell.draw('bottom');
  82824. }
  82825. return this.originalCell.draw(this.offset + 1 + lineNum);
  82826. };
  82827. ColSpanCell.prototype.mergeTableOptions =
  82828. RowSpanCell.prototype.mergeTableOptions = function(){};
  82829. // HELPER FUNCTIONS
  82830. function setOption(objA,objB,nameB,targetObj){
  82831. var nameA = nameB.split('-');
  82832. if(nameA.length > 1) {
  82833. nameA[1] = nameA[1].charAt(0).toUpperCase() + nameA[1].substr(1);
  82834. nameA = nameA.join('');
  82835. targetObj[nameA] = objA[nameA] || objA[nameB] || objB[nameA] || objB[nameB];
  82836. }
  82837. else {
  82838. targetObj[nameB] = objA[nameB] || objB[nameB];
  82839. }
  82840. }
  82841. function findDimension(dimensionTable, startingIndex, span){
  82842. var ret = dimensionTable[startingIndex];
  82843. for(var i = 1; i < span; i++){
  82844. ret += 1 + dimensionTable[startingIndex + i];
  82845. }
  82846. return ret;
  82847. }
  82848. function sumPlusOne(a,b){
  82849. return a+b+1;
  82850. }
  82851. var CHAR_NAMES = [ 'top'
  82852. , 'top-mid'
  82853. , 'top-left'
  82854. , 'top-right'
  82855. , 'bottom'
  82856. , 'bottom-mid'
  82857. , 'bottom-left'
  82858. , 'bottom-right'
  82859. , 'left'
  82860. , 'left-mid'
  82861. , 'mid'
  82862. , 'mid-mid'
  82863. , 'right'
  82864. , 'right-mid'
  82865. , 'middle'
  82866. ];
  82867. module.exports = Cell;
  82868. module.exports.ColSpanCell = ColSpanCell;
  82869. module.exports.RowSpanCell = RowSpanCell;
  82870. /***/ }),
  82871. /* 570 */
  82872. /***/ (function(module, exports, __webpack_require__) {
  82873. var kindOf = __webpack_require__(169);
  82874. var objectAssign = __webpack_require__(243);
  82875. var Cell = __webpack_require__(569);
  82876. var RowSpanCell = Cell.RowSpanCell;
  82877. var ColSpanCell = Cell.ColSpanCell;
  82878. (function(){
  82879. function layoutTable(table){
  82880. table.forEach(function(row,rowIndex){
  82881. row.forEach(function(cell,columnIndex){
  82882. cell.y = rowIndex;
  82883. cell.x = columnIndex;
  82884. for(var y = rowIndex; y >= 0; y--){
  82885. var row2 = table[y];
  82886. var xMax = (y === rowIndex) ? columnIndex : row2.length;
  82887. for(var x = 0; x < xMax; x++){
  82888. var cell2 = row2[x];
  82889. while(cellsConflict(cell,cell2)){
  82890. cell.x++;
  82891. }
  82892. }
  82893. }
  82894. });
  82895. });
  82896. }
  82897. function maxWidth(table) {
  82898. var mw = 0;
  82899. table.forEach(function (row) {
  82900. row.forEach(function (cell) {
  82901. mw = Math.max(mw,cell.x + (cell.colSpan || 1));
  82902. });
  82903. });
  82904. return mw;
  82905. }
  82906. function maxHeight(table){
  82907. return table.length;
  82908. }
  82909. function cellsConflict(cell1,cell2){
  82910. var yMin1 = cell1.y;
  82911. var yMax1 = cell1.y - 1 + (cell1.rowSpan || 1);
  82912. var yMin2 = cell2.y;
  82913. var yMax2 = cell2.y - 1 + (cell2.rowSpan || 1);
  82914. var yConflict = !(yMin1 > yMax2 || yMin2 > yMax1);
  82915. var xMin1= cell1.x;
  82916. var xMax1 = cell1.x - 1 + (cell1.colSpan || 1);
  82917. var xMin2= cell2.x;
  82918. var xMax2 = cell2.x - 1 + (cell2.colSpan || 1);
  82919. var xConflict = !(xMin1 > xMax2 || xMin2 > xMax1);
  82920. return yConflict && xConflict;
  82921. }
  82922. function conflictExists(rows,x,y){
  82923. var i_max = Math.min(rows.length-1,y);
  82924. var cell = {x:x,y:y};
  82925. for(var i = 0; i <= i_max; i++){
  82926. var row = rows[i];
  82927. for(var j = 0; j < row.length; j++){
  82928. if(cellsConflict(cell,row[j])){
  82929. return true;
  82930. }
  82931. }
  82932. }
  82933. return false;
  82934. }
  82935. function allBlank(rows,y,xMin,xMax){
  82936. for(var x = xMin; x < xMax; x++){
  82937. if(conflictExists(rows,x,y)){
  82938. return false;
  82939. }
  82940. }
  82941. return true;
  82942. }
  82943. function addRowSpanCells(table){
  82944. table.forEach(function(row,rowIndex){
  82945. row.forEach(function(cell){
  82946. for(var i = 1; i < cell.rowSpan; i++){
  82947. var rowSpanCell = new RowSpanCell(cell);
  82948. rowSpanCell.x = cell.x;
  82949. rowSpanCell.y = cell.y + i;
  82950. rowSpanCell.colSpan = cell.colSpan;
  82951. insertCell(rowSpanCell,table[rowIndex+i]);
  82952. }
  82953. });
  82954. });
  82955. }
  82956. function addColSpanCells(cellRows){
  82957. for(var rowIndex = cellRows.length-1; rowIndex >= 0; rowIndex--) {
  82958. var cellColumns = cellRows[rowIndex];
  82959. for (var columnIndex = 0; columnIndex < cellColumns.length; columnIndex++) {
  82960. var cell = cellColumns[columnIndex];
  82961. for (var k = 1; k < cell.colSpan; k++) {
  82962. var colSpanCell = new ColSpanCell();
  82963. colSpanCell.x = cell.x + k;
  82964. colSpanCell.y = cell.y;
  82965. cellColumns.splice(columnIndex + 1, 0, colSpanCell);
  82966. }
  82967. }
  82968. }
  82969. }
  82970. function insertCell(cell,row){
  82971. var x = 0;
  82972. while(x < row.length && (row[x].x < cell.x)) {
  82973. x++;
  82974. }
  82975. row.splice(x,0,cell);
  82976. }
  82977. function fillInTable(table){
  82978. var h_max = maxHeight(table);
  82979. var w_max = maxWidth(table);
  82980. for(var y = 0; y < h_max; y++){
  82981. for(var x = 0; x < w_max; x++){
  82982. if(!conflictExists(table,x,y)){
  82983. var opts = {x:x,y:y,colSpan:1,rowSpan:1};
  82984. x++;
  82985. while(x < w_max && !conflictExists(table,x,y)){
  82986. opts.colSpan++;
  82987. x++;
  82988. }
  82989. var y2 = y + 1;
  82990. while(y2 < h_max && allBlank(table,y2,opts.x,opts.x+opts.colSpan)){
  82991. opts.rowSpan++;
  82992. y2++;
  82993. }
  82994. var cell = new Cell(opts);
  82995. cell.x = opts.x;
  82996. cell.y = opts.y;
  82997. insertCell(cell,table[y]);
  82998. }
  82999. }
  83000. }
  83001. }
  83002. function generateCells(rows){
  83003. return rows.map(function(row){
  83004. if(kindOf(row) !== 'array'){
  83005. var key = Object.keys(row)[0];
  83006. row = row[key];
  83007. if(kindOf(row) === 'array'){
  83008. row = row.slice();
  83009. row.unshift(key);
  83010. }
  83011. else {
  83012. row = [key,row];
  83013. }
  83014. }
  83015. return row.map(function(cell){
  83016. return new Cell(cell);
  83017. });
  83018. });
  83019. }
  83020. function makeTableLayout(rows){
  83021. var cellRows = generateCells(rows);
  83022. layoutTable(cellRows);
  83023. fillInTable(cellRows);
  83024. addRowSpanCells(cellRows);
  83025. addColSpanCells(cellRows);
  83026. return cellRows;
  83027. }
  83028. module.exports = {
  83029. makeTableLayout: makeTableLayout,
  83030. layoutTable: layoutTable,
  83031. addRowSpanCells: addRowSpanCells,
  83032. maxWidth:maxWidth,
  83033. fillInTable:fillInTable,
  83034. computeWidths:makeComputeWidths('colSpan','desiredWidth','x',1),
  83035. computeHeights:makeComputeWidths('rowSpan','desiredHeight','y',1)
  83036. };
  83037. })();
  83038. function makeComputeWidths(colSpan,desiredWidth,x,forcedMin){
  83039. return function(vals,table){
  83040. var result = [];
  83041. var spanners = [];
  83042. table.forEach(function(row){
  83043. row.forEach(function(cell){
  83044. if((cell[colSpan] || 1) > 1){
  83045. spanners.push(cell);
  83046. }
  83047. else {
  83048. result[cell[x]] = Math.max(result[cell[x]] || 0, cell[desiredWidth] || 0, forcedMin);
  83049. }
  83050. });
  83051. });
  83052. vals.forEach(function(val,index){
  83053. if(kindOf(val) === 'number'){
  83054. result[index] = val;
  83055. }
  83056. });
  83057. //spanners.forEach(function(cell){
  83058. for(var k = spanners.length - 1; k >=0; k--){
  83059. var cell = spanners[k];
  83060. var span = cell[colSpan];
  83061. var col = cell[x];
  83062. var existingWidth = result[col];
  83063. var editableCols = kindOf(vals[col]) === 'number' ? 0 : 1;
  83064. for(var i = 1; i < span; i ++){
  83065. existingWidth += 1 + result[col + i];
  83066. if(kindOf(vals[col + i]) !== 'number'){
  83067. editableCols++;
  83068. }
  83069. }
  83070. if(cell[desiredWidth] > existingWidth){
  83071. i = 0;
  83072. while(editableCols > 0 && cell[desiredWidth] > existingWidth){
  83073. if(kindOf(vals[col+i]) !== 'number'){
  83074. var dif = Math.round( (cell[desiredWidth] - existingWidth) / editableCols );
  83075. existingWidth += dif;
  83076. result[col + i] += dif;
  83077. editableCols--;
  83078. }
  83079. i++;
  83080. }
  83081. }
  83082. }
  83083. objectAssign(vals,result);
  83084. for(var j = 0; j < vals.length; j++){
  83085. vals[j] = Math.max(forcedMin, vals[j] || 0);
  83086. }
  83087. };
  83088. }
  83089. /***/ }),
  83090. /* 571 */
  83091. /***/ (function(module, exports, __webpack_require__) {
  83092. var utils = __webpack_require__(320);
  83093. var tableLayout = __webpack_require__(570);
  83094. function Table(options){
  83095. this.options = utils.mergeOptions(options);
  83096. }
  83097. Table.prototype.__proto__ = Array.prototype;
  83098. Table.prototype.toString = function(){
  83099. var array = this;
  83100. var headersPresent = this.options.head && this.options.head.length;
  83101. if(headersPresent){
  83102. array = [this.options.head];
  83103. if(this.length){
  83104. array.push.apply(array,this);
  83105. }
  83106. }
  83107. else {
  83108. this.options.style.head=[];
  83109. }
  83110. var cells = tableLayout.makeTableLayout(array);
  83111. cells.forEach(function(row){
  83112. row.forEach(function(cell){
  83113. cell.mergeTableOptions(this.options,cells);
  83114. },this);
  83115. },this);
  83116. tableLayout.computeWidths(this.options.colWidths,cells);
  83117. tableLayout.computeHeights(this.options.rowHeights,cells);
  83118. cells.forEach(function(row,rowIndex){
  83119. row.forEach(function(cell,cellIndex){
  83120. cell.init(this.options);
  83121. },this);
  83122. },this);
  83123. var result = [];
  83124. for(var rowIndex = 0; rowIndex < cells.length; rowIndex++){
  83125. var row = cells[rowIndex];
  83126. var heightOfRow = this.options.rowHeights[rowIndex];
  83127. if(rowIndex === 0 || !this.options.style.compact || (rowIndex == 1 && headersPresent)){
  83128. doDraw(row,'top',result);
  83129. }
  83130. for(var lineNum = 0; lineNum < heightOfRow; lineNum++){
  83131. doDraw(row,lineNum,result);
  83132. }
  83133. if(rowIndex + 1 == cells.length){
  83134. doDraw(row,'bottom',result);
  83135. }
  83136. }
  83137. return result.join('\n');
  83138. };
  83139. function doDraw(row,lineNum,result){
  83140. var line = [];
  83141. row.forEach(function(cell){
  83142. line.push(cell.draw(lineNum));
  83143. });
  83144. var str = line.join('');
  83145. if(str.length) result.push(str);
  83146. }
  83147. Table.prototype.__defineGetter__('width', function (){
  83148. var str = this.toString().split("\n");
  83149. return str[0].length;
  83150. });
  83151. module.exports = Table;
  83152. /***/ }),
  83153. /* 572 */
  83154. /***/ (function(module, exports, __webpack_require__) {
  83155. "use strict";
  83156. exports = module.exports = cliWidth;
  83157. function normalizeOpts(options) {
  83158. var defaultOpts = {
  83159. defaultWidth: 0,
  83160. output: process.stdout,
  83161. tty: __webpack_require__(149)
  83162. };
  83163. if (!options) {
  83164. return defaultOpts;
  83165. } else {
  83166. Object.keys(defaultOpts).forEach(function (key) {
  83167. if (!options[key]) {
  83168. options[key] = defaultOpts[key];
  83169. }
  83170. });
  83171. return options;
  83172. }
  83173. }
  83174. function cliWidth(options) {
  83175. var opts = normalizeOpts(options);
  83176. if (opts.output.getWindowSize) {
  83177. return opts.output.getWindowSize()[0] || opts.defaultWidth;
  83178. } else {
  83179. if (opts.tty.getWindowSize) {
  83180. return opts.tty.getWindowSize()[1] || opts.defaultWidth;
  83181. } else {
  83182. if (opts.output.columns) {
  83183. return opts.output.columns;
  83184. } else {
  83185. if (process.env.CLI_WIDTH) {
  83186. var width = parseInt(process.env.CLI_WIDTH, 10);
  83187. if (!isNaN(width) && width !== 0) {
  83188. return width;
  83189. }
  83190. }
  83191. }
  83192. return opts.defaultWidth;
  83193. }
  83194. }
  83195. };
  83196. /***/ }),
  83197. /* 573 */
  83198. /***/ (function(module, exports, __webpack_require__) {
  83199. "use strict";
  83200. /* eslint-disable babel/new-cap, xo/throw-new-error */
  83201. module.exports = function (str, pos) {
  83202. if (str === null || str === undefined) {
  83203. throw TypeError();
  83204. }
  83205. str = String(str);
  83206. var size = str.length;
  83207. var i = pos ? Number(pos) : 0;
  83208. if (Number.isNaN(i)) {
  83209. i = 0;
  83210. }
  83211. if (i < 0 || i >= size) {
  83212. return undefined;
  83213. }
  83214. var first = str.charCodeAt(i);
  83215. if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) {
  83216. var second = str.charCodeAt(i + 1);
  83217. if (second >= 0xDC00 && second <= 0xDFFF) {
  83218. return ((first - 0xD800) * 0x400) + second - 0xDC00 + 0x10000;
  83219. }
  83220. }
  83221. return first;
  83222. };
  83223. /***/ }),
  83224. /* 574 */
  83225. /***/ (function(module, exports, __webpack_require__) {
  83226. var conversions = __webpack_require__(322);
  83227. var route = __webpack_require__(575);
  83228. var convert = {};
  83229. var models = Object.keys(conversions);
  83230. function wrapRaw(fn) {
  83231. var wrappedFn = function (args) {
  83232. if (args === undefined || args === null) {
  83233. return args;
  83234. }
  83235. if (arguments.length > 1) {
  83236. args = Array.prototype.slice.call(arguments);
  83237. }
  83238. return fn(args);
  83239. };
  83240. // preserve .conversion property if there is one
  83241. if ('conversion' in fn) {
  83242. wrappedFn.conversion = fn.conversion;
  83243. }
  83244. return wrappedFn;
  83245. }
  83246. function wrapRounded(fn) {
  83247. var wrappedFn = function (args) {
  83248. if (args === undefined || args === null) {
  83249. return args;
  83250. }
  83251. if (arguments.length > 1) {
  83252. args = Array.prototype.slice.call(arguments);
  83253. }
  83254. var result = fn(args);
  83255. // we're assuming the result is an array here.
  83256. // see notice in conversions.js; don't use box types
  83257. // in conversion functions.
  83258. if (typeof result === 'object') {
  83259. for (var len = result.length, i = 0; i < len; i++) {
  83260. result[i] = Math.round(result[i]);
  83261. }
  83262. }
  83263. return result;
  83264. };
  83265. // preserve .conversion property if there is one
  83266. if ('conversion' in fn) {
  83267. wrappedFn.conversion = fn.conversion;
  83268. }
  83269. return wrappedFn;
  83270. }
  83271. models.forEach(function (fromModel) {
  83272. convert[fromModel] = {};
  83273. Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
  83274. Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
  83275. var routes = route(fromModel);
  83276. var routeModels = Object.keys(routes);
  83277. routeModels.forEach(function (toModel) {
  83278. var fn = routes[toModel];
  83279. convert[fromModel][toModel] = wrapRounded(fn);
  83280. convert[fromModel][toModel].raw = wrapRaw(fn);
  83281. });
  83282. });
  83283. module.exports = convert;
  83284. /***/ }),
  83285. /* 575 */
  83286. /***/ (function(module, exports, __webpack_require__) {
  83287. var conversions = __webpack_require__(322);
  83288. /*
  83289. this function routes a model to all other models.
  83290. all functions that are routed have a property `.conversion` attached
  83291. to the returned synthetic function. This property is an array
  83292. of strings, each with the steps in between the 'from' and 'to'
  83293. color models (inclusive).
  83294. conversions that are not possible simply are not included.
  83295. */
  83296. function buildGraph() {
  83297. var graph = {};
  83298. // https://jsperf.com/object-keys-vs-for-in-with-closure/3
  83299. var models = Object.keys(conversions);
  83300. for (var len = models.length, i = 0; i < len; i++) {
  83301. graph[models[i]] = {
  83302. // http://jsperf.com/1-vs-infinity
  83303. // micro-opt, but this is simple.
  83304. distance: -1,
  83305. parent: null
  83306. };
  83307. }
  83308. return graph;
  83309. }
  83310. // https://en.wikipedia.org/wiki/Breadth-first_search
  83311. function deriveBFS(fromModel) {
  83312. var graph = buildGraph();
  83313. var queue = [fromModel]; // unshift -> queue -> pop
  83314. graph[fromModel].distance = 0;
  83315. while (queue.length) {
  83316. var current = queue.pop();
  83317. var adjacents = Object.keys(conversions[current]);
  83318. for (var len = adjacents.length, i = 0; i < len; i++) {
  83319. var adjacent = adjacents[i];
  83320. var node = graph[adjacent];
  83321. if (node.distance === -1) {
  83322. node.distance = graph[current].distance + 1;
  83323. node.parent = current;
  83324. queue.unshift(adjacent);
  83325. }
  83326. }
  83327. }
  83328. return graph;
  83329. }
  83330. function link(from, to) {
  83331. return function (args) {
  83332. return to(from(args));
  83333. };
  83334. }
  83335. function wrapConversion(toModel, graph) {
  83336. var path = [graph[toModel].parent, toModel];
  83337. var fn = conversions[graph[toModel].parent][toModel];
  83338. var cur = graph[toModel].parent;
  83339. while (graph[cur].parent) {
  83340. path.unshift(graph[cur].parent);
  83341. fn = link(conversions[graph[cur].parent][cur], fn);
  83342. cur = graph[cur].parent;
  83343. }
  83344. fn.conversion = path;
  83345. return fn;
  83346. }
  83347. module.exports = function (fromModel) {
  83348. var graph = deriveBFS(fromModel);
  83349. var conversion = {};
  83350. var models = Object.keys(graph);
  83351. for (var len = models.length, i = 0; i < len; i++) {
  83352. var toModel = models[i];
  83353. var node = graph[toModel];
  83354. if (node.parent === null) {
  83355. // no possible conversion, or this node is the source model.
  83356. continue;
  83357. }
  83358. conversion[toModel] = wrapConversion(toModel, graph);
  83359. }
  83360. return conversion;
  83361. };
  83362. /***/ }),
  83363. /* 576 */
  83364. /***/ (function(module, exports) {
  83365. module.exports = {
  83366. "aliceblue": [240, 248, 255],
  83367. "antiquewhite": [250, 235, 215],
  83368. "aqua": [0, 255, 255],
  83369. "aquamarine": [127, 255, 212],
  83370. "azure": [240, 255, 255],
  83371. "beige": [245, 245, 220],
  83372. "bisque": [255, 228, 196],
  83373. "black": [0, 0, 0],
  83374. "blanchedalmond": [255, 235, 205],
  83375. "blue": [0, 0, 255],
  83376. "blueviolet": [138, 43, 226],
  83377. "brown": [165, 42, 42],
  83378. "burlywood": [222, 184, 135],
  83379. "cadetblue": [95, 158, 160],
  83380. "chartreuse": [127, 255, 0],
  83381. "chocolate": [210, 105, 30],
  83382. "coral": [255, 127, 80],
  83383. "cornflowerblue": [100, 149, 237],
  83384. "cornsilk": [255, 248, 220],
  83385. "crimson": [220, 20, 60],
  83386. "cyan": [0, 255, 255],
  83387. "darkblue": [0, 0, 139],
  83388. "darkcyan": [0, 139, 139],
  83389. "darkgoldenrod": [184, 134, 11],
  83390. "darkgray": [169, 169, 169],
  83391. "darkgreen": [0, 100, 0],
  83392. "darkgrey": [169, 169, 169],
  83393. "darkkhaki": [189, 183, 107],
  83394. "darkmagenta": [139, 0, 139],
  83395. "darkolivegreen": [85, 107, 47],
  83396. "darkorange": [255, 140, 0],
  83397. "darkorchid": [153, 50, 204],
  83398. "darkred": [139, 0, 0],
  83399. "darksalmon": [233, 150, 122],
  83400. "darkseagreen": [143, 188, 143],
  83401. "darkslateblue": [72, 61, 139],
  83402. "darkslategray": [47, 79, 79],
  83403. "darkslategrey": [47, 79, 79],
  83404. "darkturquoise": [0, 206, 209],
  83405. "darkviolet": [148, 0, 211],
  83406. "deeppink": [255, 20, 147],
  83407. "deepskyblue": [0, 191, 255],
  83408. "dimgray": [105, 105, 105],
  83409. "dimgrey": [105, 105, 105],
  83410. "dodgerblue": [30, 144, 255],
  83411. "firebrick": [178, 34, 34],
  83412. "floralwhite": [255, 250, 240],
  83413. "forestgreen": [34, 139, 34],
  83414. "fuchsia": [255, 0, 255],
  83415. "gainsboro": [220, 220, 220],
  83416. "ghostwhite": [248, 248, 255],
  83417. "gold": [255, 215, 0],
  83418. "goldenrod": [218, 165, 32],
  83419. "gray": [128, 128, 128],
  83420. "green": [0, 128, 0],
  83421. "greenyellow": [173, 255, 47],
  83422. "grey": [128, 128, 128],
  83423. "honeydew": [240, 255, 240],
  83424. "hotpink": [255, 105, 180],
  83425. "indianred": [205, 92, 92],
  83426. "indigo": [75, 0, 130],
  83427. "ivory": [255, 255, 240],
  83428. "khaki": [240, 230, 140],
  83429. "lavender": [230, 230, 250],
  83430. "lavenderblush": [255, 240, 245],
  83431. "lawngreen": [124, 252, 0],
  83432. "lemonchiffon": [255, 250, 205],
  83433. "lightblue": [173, 216, 230],
  83434. "lightcoral": [240, 128, 128],
  83435. "lightcyan": [224, 255, 255],
  83436. "lightgoldenrodyellow": [250, 250, 210],
  83437. "lightgray": [211, 211, 211],
  83438. "lightgreen": [144, 238, 144],
  83439. "lightgrey": [211, 211, 211],
  83440. "lightpink": [255, 182, 193],
  83441. "lightsalmon": [255, 160, 122],
  83442. "lightseagreen": [32, 178, 170],
  83443. "lightskyblue": [135, 206, 250],
  83444. "lightslategray": [119, 136, 153],
  83445. "lightslategrey": [119, 136, 153],
  83446. "lightsteelblue": [176, 196, 222],
  83447. "lightyellow": [255, 255, 224],
  83448. "lime": [0, 255, 0],
  83449. "limegreen": [50, 205, 50],
  83450. "linen": [250, 240, 230],
  83451. "magenta": [255, 0, 255],
  83452. "maroon": [128, 0, 0],
  83453. "mediumaquamarine": [102, 205, 170],
  83454. "mediumblue": [0, 0, 205],
  83455. "mediumorchid": [186, 85, 211],
  83456. "mediumpurple": [147, 112, 219],
  83457. "mediumseagreen": [60, 179, 113],
  83458. "mediumslateblue": [123, 104, 238],
  83459. "mediumspringgreen": [0, 250, 154],
  83460. "mediumturquoise": [72, 209, 204],
  83461. "mediumvioletred": [199, 21, 133],
  83462. "midnightblue": [25, 25, 112],
  83463. "mintcream": [245, 255, 250],
  83464. "mistyrose": [255, 228, 225],
  83465. "moccasin": [255, 228, 181],
  83466. "navajowhite": [255, 222, 173],
  83467. "navy": [0, 0, 128],
  83468. "oldlace": [253, 245, 230],
  83469. "olive": [128, 128, 0],
  83470. "olivedrab": [107, 142, 35],
  83471. "orange": [255, 165, 0],
  83472. "orangered": [255, 69, 0],
  83473. "orchid": [218, 112, 214],
  83474. "palegoldenrod": [238, 232, 170],
  83475. "palegreen": [152, 251, 152],
  83476. "paleturquoise": [175, 238, 238],
  83477. "palevioletred": [219, 112, 147],
  83478. "papayawhip": [255, 239, 213],
  83479. "peachpuff": [255, 218, 185],
  83480. "peru": [205, 133, 63],
  83481. "pink": [255, 192, 203],
  83482. "plum": [221, 160, 221],
  83483. "powderblue": [176, 224, 230],
  83484. "purple": [128, 0, 128],
  83485. "rebeccapurple": [102, 51, 153],
  83486. "red": [255, 0, 0],
  83487. "rosybrown": [188, 143, 143],
  83488. "royalblue": [65, 105, 225],
  83489. "saddlebrown": [139, 69, 19],
  83490. "salmon": [250, 128, 114],
  83491. "sandybrown": [244, 164, 96],
  83492. "seagreen": [46, 139, 87],
  83493. "seashell": [255, 245, 238],
  83494. "sienna": [160, 82, 45],
  83495. "silver": [192, 192, 192],
  83496. "skyblue": [135, 206, 235],
  83497. "slateblue": [106, 90, 205],
  83498. "slategray": [112, 128, 144],
  83499. "slategrey": [112, 128, 144],
  83500. "snow": [255, 250, 250],
  83501. "springgreen": [0, 255, 127],
  83502. "steelblue": [70, 130, 180],
  83503. "tan": [210, 180, 140],
  83504. "teal": [0, 128, 128],
  83505. "thistle": [216, 191, 216],
  83506. "tomato": [255, 99, 71],
  83507. "turquoise": [64, 224, 208],
  83508. "violet": [238, 130, 238],
  83509. "wheat": [245, 222, 179],
  83510. "white": [255, 255, 255],
  83511. "whitesmoke": [245, 245, 245],
  83512. "yellow": [255, 255, 0],
  83513. "yellowgreen": [154, 205, 50]
  83514. };
  83515. /***/ }),
  83516. /* 577 */
  83517. /***/ (function(module, exports, __webpack_require__) {
  83518. /*
  83519. The MIT License (MIT)
  83520. Original Library
  83521. - Copyright (c) Marak Squires
  83522. Additional functionality
  83523. - Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
  83524. Permission is hereby granted, free of charge, to any person obtaining a copy
  83525. of this software and associated documentation files (the "Software"), to deal
  83526. in the Software without restriction, including without limitation the rights
  83527. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  83528. copies of the Software, and to permit persons to whom the Software is
  83529. furnished to do so, subject to the following conditions:
  83530. The above copyright notice and this permission notice shall be included in
  83531. all copies or substantial portions of the Software.
  83532. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  83533. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  83534. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  83535. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  83536. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  83537. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  83538. THE SOFTWARE.
  83539. */
  83540. var colors = {};
  83541. module['exports'] = colors;
  83542. colors.themes = {};
  83543. var util = __webpack_require__(9);
  83544. var ansiStyles = colors.styles = __webpack_require__(584);
  83545. var defineProps = Object.defineProperties;
  83546. var newLineRegex = new RegExp(/[\r\n]+/g);
  83547. colors.supportsColor = __webpack_require__(586).supportsColor;
  83548. if (typeof colors.enabled === 'undefined') {
  83549. colors.enabled = colors.supportsColor() !== false;
  83550. }
  83551. colors.enable = function() {
  83552. colors.enabled = true;
  83553. };
  83554. colors.disable = function() {
  83555. colors.enabled = false;
  83556. };
  83557. colors.stripColors = colors.strip = function(str) {
  83558. return ('' + str).replace(/\x1B\[\d+m/g, '');
  83559. };
  83560. // eslint-disable-next-line no-unused-vars
  83561. var stylize = colors.stylize = function stylize(str, style) {
  83562. if (!colors.enabled) {
  83563. return str+'';
  83564. }
  83565. return ansiStyles[style].open + str + ansiStyles[style].close;
  83566. };
  83567. var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
  83568. var escapeStringRegexp = function(str) {
  83569. if (typeof str !== 'string') {
  83570. throw new TypeError('Expected a string');
  83571. }
  83572. return str.replace(matchOperatorsRe, '\\$&');
  83573. };
  83574. function build(_styles) {
  83575. var builder = function builder() {
  83576. return applyStyle.apply(builder, arguments);
  83577. };
  83578. builder._styles = _styles;
  83579. // __proto__ is used because we must return a function, but there is
  83580. // no way to create a function with a different prototype.
  83581. builder.__proto__ = proto;
  83582. return builder;
  83583. }
  83584. var styles = (function() {
  83585. var ret = {};
  83586. ansiStyles.grey = ansiStyles.gray;
  83587. Object.keys(ansiStyles).forEach(function(key) {
  83588. ansiStyles[key].closeRe =
  83589. new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
  83590. ret[key] = {
  83591. get: function() {
  83592. return build(this._styles.concat(key));
  83593. },
  83594. };
  83595. });
  83596. return ret;
  83597. })();
  83598. var proto = defineProps(function colors() {}, styles);
  83599. function applyStyle() {
  83600. var args = Array.prototype.slice.call(arguments);
  83601. var str = args.map(function(arg) {
  83602. if (arg != undefined && arg.constructor === String) {
  83603. return arg;
  83604. } else {
  83605. return util.inspect(arg);
  83606. }
  83607. }).join(' ');
  83608. if (!colors.enabled || !str) {
  83609. return str;
  83610. }
  83611. var newLinesPresent = str.indexOf('\n') != -1;
  83612. var nestedStyles = this._styles;
  83613. var i = nestedStyles.length;
  83614. while (i--) {
  83615. var code = ansiStyles[nestedStyles[i]];
  83616. str = code.open + str.replace(code.closeRe, code.open) + code.close;
  83617. if (newLinesPresent) {
  83618. str = str.replace(newLineRegex, function(match) {
  83619. return code.close + match + code.open;
  83620. });
  83621. }
  83622. }
  83623. return str;
  83624. }
  83625. colors.setTheme = function(theme) {
  83626. if (typeof theme === 'string') {
  83627. console.log('colors.setTheme now only accepts an object, not a string. ' +
  83628. 'If you are trying to set a theme from a file, it is now your (the ' +
  83629. 'caller\'s) responsibility to require the file. The old syntax ' +
  83630. 'looked like colors.setTheme(__dirname + ' +
  83631. '\'/../themes/generic-logging.js\'); The new syntax looks like '+
  83632. 'colors.setTheme(require(__dirname + ' +
  83633. '\'/../themes/generic-logging.js\'));');
  83634. return;
  83635. }
  83636. for (var style in theme) {
  83637. (function(style) {
  83638. colors[style] = function(str) {
  83639. if (typeof theme[style] === 'object') {
  83640. var out = str;
  83641. for (var i in theme[style]) {
  83642. out = colors[theme[style][i]](out);
  83643. }
  83644. return out;
  83645. }
  83646. return colors[theme[style]](str);
  83647. };
  83648. })(style);
  83649. }
  83650. };
  83651. function init() {
  83652. var ret = {};
  83653. Object.keys(styles).forEach(function(name) {
  83654. ret[name] = {
  83655. get: function() {
  83656. return build([name]);
  83657. },
  83658. };
  83659. });
  83660. return ret;
  83661. }
  83662. var sequencer = function sequencer(map, str) {
  83663. var exploded = str.split('');
  83664. exploded = exploded.map(map);
  83665. return exploded.join('');
  83666. };
  83667. // custom formatter methods
  83668. colors.trap = __webpack_require__(578);
  83669. colors.zalgo = __webpack_require__(579);
  83670. // maps
  83671. colors.maps = {};
  83672. colors.maps.america = __webpack_require__(580)(colors);
  83673. colors.maps.zebra = __webpack_require__(583)(colors);
  83674. colors.maps.rainbow = __webpack_require__(581)(colors);
  83675. colors.maps.random = __webpack_require__(582)(colors);
  83676. for (var map in colors.maps) {
  83677. (function(map) {
  83678. colors[map] = function(str) {
  83679. return sequencer(colors.maps[map], str);
  83680. };
  83681. })(map);
  83682. }
  83683. defineProps(colors, init());
  83684. /***/ }),
  83685. /* 578 */
  83686. /***/ (function(module, exports) {
  83687. module['exports'] = function runTheTrap(text, options) {
  83688. var result = '';
  83689. text = text || 'Run the trap, drop the bass';
  83690. text = text.split('');
  83691. var trap = {
  83692. a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'],
  83693. b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'],
  83694. c: ['\u00a9', '\u023b', '\u03fe'],
  83695. d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'],
  83696. e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc',
  83697. '\u0a6c'],
  83698. f: ['\u04fa'],
  83699. g: ['\u0262'],
  83700. h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'],
  83701. i: ['\u0f0f'],
  83702. j: ['\u0134'],
  83703. k: ['\u0138', '\u04a0', '\u04c3', '\u051e'],
  83704. l: ['\u0139'],
  83705. m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'],
  83706. n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'],
  83707. o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd',
  83708. '\u06dd', '\u0e4f'],
  83709. p: ['\u01f7', '\u048e'],
  83710. q: ['\u09cd'],
  83711. r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'],
  83712. s: ['\u00a7', '\u03de', '\u03df', '\u03e8'],
  83713. t: ['\u0141', '\u0166', '\u0373'],
  83714. u: ['\u01b1', '\u054d'],
  83715. v: ['\u05d8'],
  83716. w: ['\u0428', '\u0460', '\u047c', '\u0d70'],
  83717. x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'],
  83718. y: ['\u00a5', '\u04b0', '\u04cb'],
  83719. z: ['\u01b5', '\u0240'],
  83720. };
  83721. text.forEach(function(c) {
  83722. c = c.toLowerCase();
  83723. var chars = trap[c] || [' '];
  83724. var rand = Math.floor(Math.random() * chars.length);
  83725. if (typeof trap[c] !== 'undefined') {
  83726. result += trap[c][rand];
  83727. } else {
  83728. result += c;
  83729. }
  83730. });
  83731. return result;
  83732. };
  83733. /***/ }),
  83734. /* 579 */
  83735. /***/ (function(module, exports) {
  83736. // please no
  83737. module['exports'] = function zalgo(text, options) {
  83738. text = text || ' he is here ';
  83739. var soul = {
  83740. 'up': [
  83741. '̍', '̎', '̄', '̅',
  83742. '̿', '̑', '̆', '̐',
  83743. '͒', '͗', '͑', '̇',
  83744. '̈', '̊', '͂', '̓',
  83745. '̈', '͊', '͋', '͌',
  83746. '̃', '̂', '̌', '͐',
  83747. '̀', '́', '̋', '̏',
  83748. '̒', '̓', '̔', '̽',
  83749. '̉', 'ͣ', 'ͤ', 'ͥ',
  83750. 'ͦ', 'ͧ', 'ͨ', 'ͩ',
  83751. 'ͪ', 'ͫ', 'ͬ', 'ͭ',
  83752. 'ͮ', 'ͯ', '̾', '͛',
  83753. '͆', '̚',
  83754. ],
  83755. 'down': [
  83756. '̖', '̗', '̘', '̙',
  83757. '̜', '̝', '̞', '̟',
  83758. '̠', '̤', '̥', '̦',
  83759. '̩', '̪', '̫', '̬',
  83760. '̭', '̮', '̯', '̰',
  83761. '̱', '̲', '̳', '̹',
  83762. '̺', '̻', '̼', 'ͅ',
  83763. '͇', '͈', '͉', '͍',
  83764. '͎', '͓', '͔', '͕',
  83765. '͖', '͙', '͚', '̣',
  83766. ],
  83767. 'mid': [
  83768. '̕', '̛', '̀', '́',
  83769. '͘', '̡', '̢', '̧',
  83770. '̨', '̴', '̵', '̶',
  83771. '͜', '͝', '͞',
  83772. '͟', '͠', '͢', '̸',
  83773. '̷', '͡', ' ҉',
  83774. ],
  83775. };
  83776. var all = [].concat(soul.up, soul.down, soul.mid);
  83777. function randomNumber(range) {
  83778. var r = Math.floor(Math.random() * range);
  83779. return r;
  83780. }
  83781. function isChar(character) {
  83782. var bool = false;
  83783. all.filter(function(i) {
  83784. bool = (i === character);
  83785. });
  83786. return bool;
  83787. }
  83788. function heComes(text, options) {
  83789. var result = '';
  83790. var counts;
  83791. var l;
  83792. options = options || {};
  83793. options['up'] =
  83794. typeof options['up'] !== 'undefined' ? options['up'] : true;
  83795. options['mid'] =
  83796. typeof options['mid'] !== 'undefined' ? options['mid'] : true;
  83797. options['down'] =
  83798. typeof options['down'] !== 'undefined' ? options['down'] : true;
  83799. options['size'] =
  83800. typeof options['size'] !== 'undefined' ? options['size'] : 'maxi';
  83801. text = text.split('');
  83802. for (l in text) {
  83803. if (isChar(l)) {
  83804. continue;
  83805. }
  83806. result = result + text[l];
  83807. counts = {'up': 0, 'down': 0, 'mid': 0};
  83808. switch (options.size) {
  83809. case 'mini':
  83810. counts.up = randomNumber(8);
  83811. counts.mid = randomNumber(2);
  83812. counts.down = randomNumber(8);
  83813. break;
  83814. case 'maxi':
  83815. counts.up = randomNumber(16) + 3;
  83816. counts.mid = randomNumber(4) + 1;
  83817. counts.down = randomNumber(64) + 3;
  83818. break;
  83819. default:
  83820. counts.up = randomNumber(8) + 1;
  83821. counts.mid = randomNumber(6) / 2;
  83822. counts.down = randomNumber(8) + 1;
  83823. break;
  83824. }
  83825. var arr = ['up', 'mid', 'down'];
  83826. for (var d in arr) {
  83827. var index = arr[d];
  83828. for (var i = 0; i <= counts[index]; i++) {
  83829. if (options[index]) {
  83830. result = result + soul[index][randomNumber(soul[index].length)];
  83831. }
  83832. }
  83833. }
  83834. }
  83835. return result;
  83836. }
  83837. // don't summon him
  83838. return heComes(text, options);
  83839. };
  83840. /***/ }),
  83841. /* 580 */
  83842. /***/ (function(module, exports) {
  83843. module['exports'] = function(colors) {
  83844. return function(letter, i, exploded) {
  83845. if (letter === ' ') return letter;
  83846. switch (i%3) {
  83847. case 0: return colors.red(letter);
  83848. case 1: return colors.white(letter);
  83849. case 2: return colors.blue(letter);
  83850. }
  83851. };
  83852. };
  83853. /***/ }),
  83854. /* 581 */
  83855. /***/ (function(module, exports) {
  83856. module['exports'] = function(colors) {
  83857. // RoY G BiV
  83858. var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];
  83859. return function(letter, i, exploded) {
  83860. if (letter === ' ') {
  83861. return letter;
  83862. } else {
  83863. return colors[rainbowColors[i++ % rainbowColors.length]](letter);
  83864. }
  83865. };
  83866. };
  83867. /***/ }),
  83868. /* 582 */
  83869. /***/ (function(module, exports) {
  83870. module['exports'] = function(colors) {
  83871. var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green',
  83872. 'blue', 'white', 'cyan', 'magenta'];
  83873. return function(letter, i, exploded) {
  83874. return letter === ' ' ? letter :
  83875. colors[
  83876. available[Math.round(Math.random() * (available.length - 2))]
  83877. ](letter);
  83878. };
  83879. };
  83880. /***/ }),
  83881. /* 583 */
  83882. /***/ (function(module, exports) {
  83883. module['exports'] = function(colors) {
  83884. return function(letter, i, exploded) {
  83885. return i % 2 === 0 ? letter : colors.inverse(letter);
  83886. };
  83887. };
  83888. /***/ }),
  83889. /* 584 */
  83890. /***/ (function(module, exports) {
  83891. /*
  83892. The MIT License (MIT)
  83893. Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
  83894. Permission is hereby granted, free of charge, to any person obtaining a copy
  83895. of this software and associated documentation files (the "Software"), to deal
  83896. in the Software without restriction, including without limitation the rights
  83897. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  83898. copies of the Software, and to permit persons to whom the Software is
  83899. furnished to do so, subject to the following conditions:
  83900. The above copyright notice and this permission notice shall be included in
  83901. all copies or substantial portions of the Software.
  83902. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  83903. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  83904. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  83905. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  83906. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  83907. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  83908. THE SOFTWARE.
  83909. */
  83910. var styles = {};
  83911. module['exports'] = styles;
  83912. var codes = {
  83913. reset: [0, 0],
  83914. bold: [1, 22],
  83915. dim: [2, 22],
  83916. italic: [3, 23],
  83917. underline: [4, 24],
  83918. inverse: [7, 27],
  83919. hidden: [8, 28],
  83920. strikethrough: [9, 29],
  83921. black: [30, 39],
  83922. red: [31, 39],
  83923. green: [32, 39],
  83924. yellow: [33, 39],
  83925. blue: [34, 39],
  83926. magenta: [35, 39],
  83927. cyan: [36, 39],
  83928. white: [37, 39],
  83929. gray: [90, 39],
  83930. grey: [90, 39],
  83931. bgBlack: [40, 49],
  83932. bgRed: [41, 49],
  83933. bgGreen: [42, 49],
  83934. bgYellow: [43, 49],
  83935. bgBlue: [44, 49],
  83936. bgMagenta: [45, 49],
  83937. bgCyan: [46, 49],
  83938. bgWhite: [47, 49],
  83939. // legacy styles for colors pre v1.0.0
  83940. blackBG: [40, 49],
  83941. redBG: [41, 49],
  83942. greenBG: [42, 49],
  83943. yellowBG: [43, 49],
  83944. blueBG: [44, 49],
  83945. magentaBG: [45, 49],
  83946. cyanBG: [46, 49],
  83947. whiteBG: [47, 49],
  83948. };
  83949. Object.keys(codes).forEach(function(key) {
  83950. var val = codes[key];
  83951. var style = styles[key] = [];
  83952. style.open = '\u001b[' + val[0] + 'm';
  83953. style.close = '\u001b[' + val[1] + 'm';
  83954. });
  83955. /***/ }),
  83956. /* 585 */
  83957. /***/ (function(module, exports, __webpack_require__) {
  83958. "use strict";
  83959. /*
  83960. MIT License
  83961. Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
  83962. Permission is hereby granted, free of charge, to any person obtaining a copy of
  83963. this software and associated documentation files (the "Software"), to deal in
  83964. the Software without restriction, including without limitation the rights to
  83965. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  83966. of the Software, and to permit persons to whom the Software is furnished to do
  83967. so, subject to the following conditions:
  83968. The above copyright notice and this permission notice shall be included in all
  83969. copies or substantial portions of the Software.
  83970. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  83971. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  83972. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  83973. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  83974. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  83975. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  83976. SOFTWARE.
  83977. */
  83978. module.exports = function(flag, argv) {
  83979. argv = argv || process.argv;
  83980. var terminatorPos = argv.indexOf('--');
  83981. var prefix = /^-{1,2}/.test(flag) ? '' : '--';
  83982. var pos = argv.indexOf(prefix + flag);
  83983. return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
  83984. };
  83985. /***/ }),
  83986. /* 586 */
  83987. /***/ (function(module, exports, __webpack_require__) {
  83988. "use strict";
  83989. /*
  83990. The MIT License (MIT)
  83991. Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
  83992. Permission is hereby granted, free of charge, to any person obtaining a copy
  83993. of this software and associated documentation files (the "Software"), to deal
  83994. in the Software without restriction, including without limitation the rights
  83995. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  83996. copies of the Software, and to permit persons to whom the Software is
  83997. furnished to do so, subject to the following conditions:
  83998. The above copyright notice and this permission notice shall be included in
  83999. all copies or substantial portions of the Software.
  84000. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  84001. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  84002. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  84003. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  84004. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  84005. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  84006. THE SOFTWARE.
  84007. */
  84008. var os = __webpack_require__(66);
  84009. var hasFlag = __webpack_require__(585);
  84010. var env = process.env;
  84011. var forceColor = void 0;
  84012. if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
  84013. forceColor = false;
  84014. } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true')
  84015. || hasFlag('color=always')) {
  84016. forceColor = true;
  84017. }
  84018. if ('FORCE_COLOR' in env) {
  84019. forceColor = env.FORCE_COLOR.length === 0
  84020. || parseInt(env.FORCE_COLOR, 10) !== 0;
  84021. }
  84022. function translateLevel(level) {
  84023. if (level === 0) {
  84024. return false;
  84025. }
  84026. return {
  84027. level: level,
  84028. hasBasic: true,
  84029. has256: level >= 2,
  84030. has16m: level >= 3,
  84031. };
  84032. }
  84033. function supportsColor(stream) {
  84034. if (forceColor === false) {
  84035. return 0;
  84036. }
  84037. if (hasFlag('color=16m') || hasFlag('color=full')
  84038. || hasFlag('color=truecolor')) {
  84039. return 3;
  84040. }
  84041. if (hasFlag('color=256')) {
  84042. return 2;
  84043. }
  84044. if (stream && !stream.isTTY && forceColor !== true) {
  84045. return 0;
  84046. }
  84047. var min = forceColor ? 1 : 0;
  84048. if (process.platform === 'win32') {
  84049. // Node.js 7.5.0 is the first version of Node.js to include a patch to
  84050. // libuv that enables 256 color output on Windows. Anything earlier and it
  84051. // won't work. However, here we target Node.js 8 at minimum as it is an LTS
  84052. // release, and Node.js 7 is not. Windows 10 build 10586 is the first
  84053. // Windows release that supports 256 colors. Windows 10 build 14931 is the
  84054. // first release that supports 16m/TrueColor.
  84055. var osRelease = os.release().split('.');
  84056. if (Number(process.versions.node.split('.')[0]) >= 8
  84057. && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
  84058. return Number(osRelease[2]) >= 14931 ? 3 : 2;
  84059. }
  84060. return 1;
  84061. }
  84062. if ('CI' in env) {
  84063. if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) {
  84064. return sign in env;
  84065. }) || env.CI_NAME === 'codeship') {
  84066. return 1;
  84067. }
  84068. return min;
  84069. }
  84070. if ('TEAMCITY_VERSION' in env) {
  84071. return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0
  84072. );
  84073. }
  84074. if ('TERM_PROGRAM' in env) {
  84075. var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
  84076. switch (env.TERM_PROGRAM) {
  84077. case 'iTerm.app':
  84078. return version >= 3 ? 3 : 2;
  84079. case 'Hyper':
  84080. return 3;
  84081. case 'Apple_Terminal':
  84082. return 2;
  84083. // No default
  84084. }
  84085. }
  84086. if (/-256(color)?$/i.test(env.TERM)) {
  84087. return 2;
  84088. }
  84089. if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
  84090. return 1;
  84091. }
  84092. if ('COLORTERM' in env) {
  84093. return 1;
  84094. }
  84095. if (env.TERM === 'dumb') {
  84096. return min;
  84097. }
  84098. return min;
  84099. }
  84100. function getSupportLevel(stream) {
  84101. var level = supportsColor(stream);
  84102. return translateLevel(level);
  84103. }
  84104. module.exports = {
  84105. supportsColor: getSupportLevel,
  84106. stdout: getSupportLevel(process.stdout),
  84107. stderr: getSupportLevel(process.stderr),
  84108. };
  84109. /***/ }),
  84110. /* 587 */
  84111. /***/ (function(module, exports, __webpack_require__) {
  84112. //
  84113. // Remark: Requiring this file will use the "safe" colors API,
  84114. // which will not touch String.prototype.
  84115. //
  84116. // var colors = require('colors/safe');
  84117. // colors.red("foo")
  84118. //
  84119. //
  84120. var colors = __webpack_require__(577);
  84121. module['exports'] = colors;
  84122. /***/ }),
  84123. /* 588 */
  84124. /***/ (function(module, exports) {
  84125. module.exports = defer;
  84126. /**
  84127. * Runs provided function on next iteration of the event loop
  84128. *
  84129. * @param {function} fn - function to run
  84130. */
  84131. function defer(fn)
  84132. {
  84133. var nextTick = typeof setImmediate == 'function'
  84134. ? setImmediate
  84135. : (
  84136. typeof process == 'object' && typeof process.nextTick == 'function'
  84137. ? process.nextTick
  84138. : null
  84139. );
  84140. if (nextTick)
  84141. {
  84142. nextTick(fn);
  84143. }
  84144. else
  84145. {
  84146. setTimeout(fn, 0);
  84147. }
  84148. }
  84149. /***/ }),
  84150. /* 589 */
  84151. /***/ (function(module, exports) {
  84152. module.exports = function (xs, fn) {
  84153. var res = [];
  84154. for (var i = 0; i < xs.length; i++) {
  84155. var x = fn(xs[i], i);
  84156. if (isArray(x)) res.push.apply(res, x);
  84157. else res.push(x);
  84158. }
  84159. return res;
  84160. };
  84161. var isArray = Array.isArray || function (xs) {
  84162. return Object.prototype.toString.call(xs) === '[object Array]';
  84163. };
  84164. /***/ }),
  84165. /* 590 */
  84166. /***/ (function(module, exports, __webpack_require__) {
  84167. __webpack_require__(104);
  84168. __webpack_require__(625);
  84169. module.exports = __webpack_require__(26).Array.from;
  84170. /***/ }),
  84171. /* 591 */
  84172. /***/ (function(module, exports, __webpack_require__) {
  84173. __webpack_require__(129);
  84174. __webpack_require__(104);
  84175. module.exports = __webpack_require__(624);
  84176. /***/ }),
  84177. /* 592 */
  84178. /***/ (function(module, exports, __webpack_require__) {
  84179. var core = __webpack_require__(26);
  84180. var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
  84181. module.exports = function stringify(it) { // eslint-disable-line no-unused-vars
  84182. return $JSON.stringify.apply($JSON, arguments);
  84183. };
  84184. /***/ }),
  84185. /* 593 */
  84186. /***/ (function(module, exports, __webpack_require__) {
  84187. __webpack_require__(163);
  84188. __webpack_require__(104);
  84189. __webpack_require__(129);
  84190. __webpack_require__(627);
  84191. __webpack_require__(639);
  84192. __webpack_require__(638);
  84193. __webpack_require__(637);
  84194. module.exports = __webpack_require__(26).Map;
  84195. /***/ }),
  84196. /* 594 */
  84197. /***/ (function(module, exports, __webpack_require__) {
  84198. __webpack_require__(628);
  84199. module.exports = __webpack_require__(26).Object.assign;
  84200. /***/ }),
  84201. /* 595 */
  84202. /***/ (function(module, exports, __webpack_require__) {
  84203. __webpack_require__(629);
  84204. var $Object = __webpack_require__(26).Object;
  84205. module.exports = function create(P, D) {
  84206. return $Object.create(P, D);
  84207. };
  84208. /***/ }),
  84209. /* 596 */
  84210. /***/ (function(module, exports, __webpack_require__) {
  84211. __webpack_require__(630);
  84212. module.exports = __webpack_require__(26).Object.getPrototypeOf;
  84213. /***/ }),
  84214. /* 597 */
  84215. /***/ (function(module, exports, __webpack_require__) {
  84216. __webpack_require__(631);
  84217. module.exports = __webpack_require__(26).Object.keys;
  84218. /***/ }),
  84219. /* 598 */
  84220. /***/ (function(module, exports, __webpack_require__) {
  84221. __webpack_require__(632);
  84222. module.exports = __webpack_require__(26).Object.setPrototypeOf;
  84223. /***/ }),
  84224. /* 599 */
  84225. /***/ (function(module, exports, __webpack_require__) {
  84226. __webpack_require__(640);
  84227. module.exports = __webpack_require__(26).Object.values;
  84228. /***/ }),
  84229. /* 600 */
  84230. /***/ (function(module, exports, __webpack_require__) {
  84231. __webpack_require__(163);
  84232. __webpack_require__(104);
  84233. __webpack_require__(129);
  84234. __webpack_require__(633);
  84235. __webpack_require__(641);
  84236. __webpack_require__(642);
  84237. module.exports = __webpack_require__(26).Promise;
  84238. /***/ }),
  84239. /* 601 */
  84240. /***/ (function(module, exports, __webpack_require__) {
  84241. __webpack_require__(634);
  84242. module.exports = __webpack_require__(26).Reflect.construct;
  84243. /***/ }),
  84244. /* 602 */
  84245. /***/ (function(module, exports, __webpack_require__) {
  84246. __webpack_require__(163);
  84247. __webpack_require__(104);
  84248. __webpack_require__(129);
  84249. __webpack_require__(635);
  84250. __webpack_require__(645);
  84251. __webpack_require__(644);
  84252. __webpack_require__(643);
  84253. module.exports = __webpack_require__(26).Set;
  84254. /***/ }),
  84255. /* 603 */
  84256. /***/ (function(module, exports, __webpack_require__) {
  84257. __webpack_require__(636);
  84258. __webpack_require__(163);
  84259. __webpack_require__(646);
  84260. __webpack_require__(647);
  84261. module.exports = __webpack_require__(26).Symbol;
  84262. /***/ }),
  84263. /* 604 */
  84264. /***/ (function(module, exports, __webpack_require__) {
  84265. __webpack_require__(104);
  84266. __webpack_require__(129);
  84267. module.exports = __webpack_require__(230).f('iterator');
  84268. /***/ }),
  84269. /* 605 */
  84270. /***/ (function(module, exports) {
  84271. module.exports = function () { /* empty */ };
  84272. /***/ }),
  84273. /* 606 */
  84274. /***/ (function(module, exports, __webpack_require__) {
  84275. var forOf = __webpack_require__(122);
  84276. module.exports = function (iter, ITERATOR) {
  84277. var result = [];
  84278. forOf(iter, false, result.push, result, ITERATOR);
  84279. return result;
  84280. };
  84281. /***/ }),
  84282. /* 607 */
  84283. /***/ (function(module, exports, __webpack_require__) {
  84284. // false -> Array#indexOf
  84285. // true -> Array#includes
  84286. var toIObject = __webpack_require__(90);
  84287. var toLength = __webpack_require__(161);
  84288. var toAbsoluteIndex = __webpack_require__(622);
  84289. module.exports = function (IS_INCLUDES) {
  84290. return function ($this, el, fromIndex) {
  84291. var O = toIObject($this);
  84292. var length = toLength(O.length);
  84293. var index = toAbsoluteIndex(fromIndex, length);
  84294. var value;
  84295. // Array#includes uses SameValueZero equality algorithm
  84296. // eslint-disable-next-line no-self-compare
  84297. if (IS_INCLUDES && el != el) while (length > index) {
  84298. value = O[index++];
  84299. // eslint-disable-next-line no-self-compare
  84300. if (value != value) return true;
  84301. // Array#indexOf ignores holes, Array#includes - not
  84302. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  84303. if (O[index] === el) return IS_INCLUDES || index || 0;
  84304. } return !IS_INCLUDES && -1;
  84305. };
  84306. };
  84307. /***/ }),
  84308. /* 608 */
  84309. /***/ (function(module, exports, __webpack_require__) {
  84310. // 0 -> Array#forEach
  84311. // 1 -> Array#map
  84312. // 2 -> Array#filter
  84313. // 3 -> Array#some
  84314. // 4 -> Array#every
  84315. // 5 -> Array#find
  84316. // 6 -> Array#findIndex
  84317. var ctx = __webpack_require__(68);
  84318. var IObject = __webpack_require__(218);
  84319. var toObject = __webpack_require__(103);
  84320. var toLength = __webpack_require__(161);
  84321. var asc = __webpack_require__(610);
  84322. module.exports = function (TYPE, $create) {
  84323. var IS_MAP = TYPE == 1;
  84324. var IS_FILTER = TYPE == 2;
  84325. var IS_SOME = TYPE == 3;
  84326. var IS_EVERY = TYPE == 4;
  84327. var IS_FIND_INDEX = TYPE == 6;
  84328. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  84329. var create = $create || asc;
  84330. return function ($this, callbackfn, that) {
  84331. var O = toObject($this);
  84332. var self = IObject(O);
  84333. var f = ctx(callbackfn, that, 3);
  84334. var length = toLength(self.length);
  84335. var index = 0;
  84336. var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  84337. var val, res;
  84338. for (;length > index; index++) if (NO_HOLES || index in self) {
  84339. val = self[index];
  84340. res = f(val, index, O);
  84341. if (TYPE) {
  84342. if (IS_MAP) result[index] = res; // map
  84343. else if (res) switch (TYPE) {
  84344. case 3: return true; // some
  84345. case 5: return val; // find
  84346. case 6: return index; // findIndex
  84347. case 2: result.push(val); // filter
  84348. } else if (IS_EVERY) return false; // every
  84349. }
  84350. }
  84351. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
  84352. };
  84353. };
  84354. /***/ }),
  84355. /* 609 */
  84356. /***/ (function(module, exports, __webpack_require__) {
  84357. var isObject = __webpack_require__(49);
  84358. var isArray = __webpack_require__(331);
  84359. var SPECIES = __webpack_require__(44)('species');
  84360. module.exports = function (original) {
  84361. var C;
  84362. if (isArray(original)) {
  84363. C = original.constructor;
  84364. // cross-realm fallback
  84365. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  84366. if (isObject(C)) {
  84367. C = C[SPECIES];
  84368. if (C === null) C = undefined;
  84369. }
  84370. } return C === undefined ? Array : C;
  84371. };
  84372. /***/ }),
  84373. /* 610 */
  84374. /***/ (function(module, exports, __webpack_require__) {
  84375. // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
  84376. var speciesConstructor = __webpack_require__(609);
  84377. module.exports = function (original, length) {
  84378. return new (speciesConstructor(original))(length);
  84379. };
  84380. /***/ }),
  84381. /* 611 */
  84382. /***/ (function(module, exports, __webpack_require__) {
  84383. "use strict";
  84384. var aFunction = __webpack_require__(88);
  84385. var isObject = __webpack_require__(49);
  84386. var invoke = __webpack_require__(329);
  84387. var arraySlice = [].slice;
  84388. var factories = {};
  84389. var construct = function (F, len, args) {
  84390. if (!(len in factories)) {
  84391. for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
  84392. // eslint-disable-next-line no-new-func
  84393. factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
  84394. } return factories[len](F, args);
  84395. };
  84396. module.exports = Function.bind || function bind(that /* , ...args */) {
  84397. var fn = aFunction(this);
  84398. var partArgs = arraySlice.call(arguments, 1);
  84399. var bound = function (/* args... */) {
  84400. var args = partArgs.concat(arraySlice.call(arguments));
  84401. return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
  84402. };
  84403. if (isObject(fn.prototype)) bound.prototype = fn.prototype;
  84404. return bound;
  84405. };
  84406. /***/ }),
  84407. /* 612 */
  84408. /***/ (function(module, exports, __webpack_require__) {
  84409. "use strict";
  84410. var $defineProperty = __webpack_require__(63);
  84411. var createDesc = __webpack_require__(127);
  84412. module.exports = function (object, index, value) {
  84413. if (index in object) $defineProperty.f(object, index, createDesc(0, value));
  84414. else object[index] = value;
  84415. };
  84416. /***/ }),
  84417. /* 613 */
  84418. /***/ (function(module, exports, __webpack_require__) {
  84419. // all enumerable object keys, includes symbols
  84420. var getKeys = __webpack_require__(102);
  84421. var gOPS = __webpack_require__(222);
  84422. var pIE = __webpack_require__(126);
  84423. module.exports = function (it) {
  84424. var result = getKeys(it);
  84425. var getSymbols = gOPS.f;
  84426. if (getSymbols) {
  84427. var symbols = getSymbols(it);
  84428. var isEnum = pIE.f;
  84429. var i = 0;
  84430. var key;
  84431. while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
  84432. } return result;
  84433. };
  84434. /***/ }),
  84435. /* 614 */
  84436. /***/ (function(module, exports, __webpack_require__) {
  84437. "use strict";
  84438. var create = __webpack_require__(125);
  84439. var descriptor = __webpack_require__(127);
  84440. var setToStringTag = __webpack_require__(128);
  84441. var IteratorPrototype = {};
  84442. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  84443. __webpack_require__(77)(IteratorPrototype, __webpack_require__(44)('iterator'), function () { return this; });
  84444. module.exports = function (Constructor, NAME, next) {
  84445. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  84446. setToStringTag(Constructor, NAME + ' Iterator');
  84447. };
  84448. /***/ }),
  84449. /* 615 */
  84450. /***/ (function(module, exports, __webpack_require__) {
  84451. var global = __webpack_require__(38);
  84452. var macrotask = __webpack_require__(347).set;
  84453. var Observer = global.MutationObserver || global.WebKitMutationObserver;
  84454. var process = global.process;
  84455. var Promise = global.Promise;
  84456. var isNode = __webpack_require__(121)(process) == 'process';
  84457. module.exports = function () {
  84458. var head, last, notify;
  84459. var flush = function () {
  84460. var parent, fn;
  84461. if (isNode && (parent = process.domain)) parent.exit();
  84462. while (head) {
  84463. fn = head.fn;
  84464. head = head.next;
  84465. try {
  84466. fn();
  84467. } catch (e) {
  84468. if (head) notify();
  84469. else last = undefined;
  84470. throw e;
  84471. }
  84472. } last = undefined;
  84473. if (parent) parent.enter();
  84474. };
  84475. // Node.js
  84476. if (isNode) {
  84477. notify = function () {
  84478. process.nextTick(flush);
  84479. };
  84480. // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
  84481. } else if (Observer && !(global.navigator && global.navigator.standalone)) {
  84482. var toggle = true;
  84483. var node = document.createTextNode('');
  84484. new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
  84485. notify = function () {
  84486. node.data = toggle = !toggle;
  84487. };
  84488. // environments with maybe non-completely correct, but existent Promise
  84489. } else if (Promise && Promise.resolve) {
  84490. // Promise.resolve without an argument throws an error in LG WebOS 2
  84491. var promise = Promise.resolve(undefined);
  84492. notify = function () {
  84493. promise.then(flush);
  84494. };
  84495. // for other environments - macrotask based on:
  84496. // - setImmediate
  84497. // - MessageChannel
  84498. // - window.postMessag
  84499. // - onreadystatechange
  84500. // - setTimeout
  84501. } else {
  84502. notify = function () {
  84503. // strange IE + webpack dev server bug - use .call(global)
  84504. macrotask.call(global, flush);
  84505. };
  84506. }
  84507. return function (fn) {
  84508. var task = { fn: fn, next: undefined };
  84509. if (last) last.next = task;
  84510. if (!head) {
  84511. head = task;
  84512. notify();
  84513. } last = task;
  84514. };
  84515. };
  84516. /***/ }),
  84517. /* 616 */
  84518. /***/ (function(module, exports, __webpack_require__) {
  84519. "use strict";
  84520. // 19.1.2.1 Object.assign(target, source, ...)
  84521. var getKeys = __webpack_require__(102);
  84522. var gOPS = __webpack_require__(222);
  84523. var pIE = __webpack_require__(126);
  84524. var toObject = __webpack_require__(103);
  84525. var IObject = __webpack_require__(218);
  84526. var $assign = Object.assign;
  84527. // should work with symbols and should have deterministic property order (V8 bug)
  84528. module.exports = !$assign || __webpack_require__(76)(function () {
  84529. var A = {};
  84530. var B = {};
  84531. // eslint-disable-next-line no-undef
  84532. var S = Symbol();
  84533. var K = 'abcdefghijklmnopqrst';
  84534. A[S] = 7;
  84535. K.split('').forEach(function (k) { B[k] = k; });
  84536. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  84537. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  84538. var T = toObject(target);
  84539. var aLen = arguments.length;
  84540. var index = 1;
  84541. var getSymbols = gOPS.f;
  84542. var isEnum = pIE.f;
  84543. while (aLen > index) {
  84544. var S = IObject(arguments[index++]);
  84545. var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
  84546. var length = keys.length;
  84547. var j = 0;
  84548. var key;
  84549. while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
  84550. } return T;
  84551. } : $assign;
  84552. /***/ }),
  84553. /* 617 */
  84554. /***/ (function(module, exports, __webpack_require__) {
  84555. var dP = __webpack_require__(63);
  84556. var anObject = __webpack_require__(58);
  84557. var getKeys = __webpack_require__(102);
  84558. module.exports = __webpack_require__(69) ? Object.defineProperties : function defineProperties(O, Properties) {
  84559. anObject(O);
  84560. var keys = getKeys(Properties);
  84561. var length = keys.length;
  84562. var i = 0;
  84563. var P;
  84564. while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  84565. return O;
  84566. };
  84567. /***/ }),
  84568. /* 618 */
  84569. /***/ (function(module, exports, __webpack_require__) {
  84570. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  84571. var toIObject = __webpack_require__(90);
  84572. var gOPN = __webpack_require__(336).f;
  84573. var toString = {}.toString;
  84574. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  84575. ? Object.getOwnPropertyNames(window) : [];
  84576. var getWindowNames = function (it) {
  84577. try {
  84578. return gOPN(it);
  84579. } catch (e) {
  84580. return windowNames.slice();
  84581. }
  84582. };
  84583. module.exports.f = function getOwnPropertyNames(it) {
  84584. return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
  84585. };
  84586. /***/ }),
  84587. /* 619 */
  84588. /***/ (function(module, exports, __webpack_require__) {
  84589. var getKeys = __webpack_require__(102);
  84590. var toIObject = __webpack_require__(90);
  84591. var isEnum = __webpack_require__(126).f;
  84592. module.exports = function (isEntries) {
  84593. return function (it) {
  84594. var O = toIObject(it);
  84595. var keys = getKeys(O);
  84596. var length = keys.length;
  84597. var i = 0;
  84598. var result = [];
  84599. var key;
  84600. while (length > i) if (isEnum.call(O, key = keys[i++])) {
  84601. result.push(isEntries ? [key, O[key]] : O[key]);
  84602. } return result;
  84603. };
  84604. };
  84605. /***/ }),
  84606. /* 620 */
  84607. /***/ (function(module, exports, __webpack_require__) {
  84608. // Works with __proto__ only. Old v8 can't work with null proto objects.
  84609. /* eslint-disable no-proto */
  84610. var isObject = __webpack_require__(49);
  84611. var anObject = __webpack_require__(58);
  84612. var check = function (O, proto) {
  84613. anObject(O);
  84614. if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
  84615. };
  84616. module.exports = {
  84617. set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
  84618. function (test, buggy, set) {
  84619. try {
  84620. set = __webpack_require__(68)(Function.call, __webpack_require__(335).f(Object.prototype, '__proto__').set, 2);
  84621. set(test, []);
  84622. buggy = !(test instanceof Array);
  84623. } catch (e) { buggy = true; }
  84624. return function setPrototypeOf(O, proto) {
  84625. check(O, proto);
  84626. if (buggy) O.__proto__ = proto;
  84627. else set(O, proto);
  84628. return O;
  84629. };
  84630. }({}, false) : undefined),
  84631. check: check
  84632. };
  84633. /***/ }),
  84634. /* 621 */
  84635. /***/ (function(module, exports, __webpack_require__) {
  84636. var toInteger = __webpack_require__(226);
  84637. var defined = __webpack_require__(215);
  84638. // true -> String#at
  84639. // false -> String#codePointAt
  84640. module.exports = function (TO_STRING) {
  84641. return function (that, pos) {
  84642. var s = String(defined(that));
  84643. var i = toInteger(pos);
  84644. var l = s.length;
  84645. var a, b;
  84646. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  84647. a = s.charCodeAt(i);
  84648. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  84649. ? TO_STRING ? s.charAt(i) : a
  84650. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  84651. };
  84652. };
  84653. /***/ }),
  84654. /* 622 */
  84655. /***/ (function(module, exports, __webpack_require__) {
  84656. var toInteger = __webpack_require__(226);
  84657. var max = Math.max;
  84658. var min = Math.min;
  84659. module.exports = function (index, length) {
  84660. index = toInteger(index);
  84661. return index < 0 ? max(index + length, 0) : min(index, length);
  84662. };
  84663. /***/ }),
  84664. /* 623 */
  84665. /***/ (function(module, exports, __webpack_require__) {
  84666. var global = __webpack_require__(38);
  84667. var navigator = global.navigator;
  84668. module.exports = navigator && navigator.userAgent || '';
  84669. /***/ }),
  84670. /* 624 */
  84671. /***/ (function(module, exports, __webpack_require__) {
  84672. var anObject = __webpack_require__(58);
  84673. var get = __webpack_require__(231);
  84674. module.exports = __webpack_require__(26).getIterator = function (it) {
  84675. var iterFn = get(it);
  84676. if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
  84677. return anObject(iterFn.call(it));
  84678. };
  84679. /***/ }),
  84680. /* 625 */
  84681. /***/ (function(module, exports, __webpack_require__) {
  84682. "use strict";
  84683. var ctx = __webpack_require__(68);
  84684. var $export = __webpack_require__(34);
  84685. var toObject = __webpack_require__(103);
  84686. var call = __webpack_require__(332);
  84687. var isArrayIter = __webpack_require__(330);
  84688. var toLength = __webpack_require__(161);
  84689. var createProperty = __webpack_require__(612);
  84690. var getIterFn = __webpack_require__(231);
  84691. $export($export.S + $export.F * !__webpack_require__(333)(function (iter) { Array.from(iter); }), 'Array', {
  84692. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  84693. from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  84694. var O = toObject(arrayLike);
  84695. var C = typeof this == 'function' ? this : Array;
  84696. var aLen = arguments.length;
  84697. var mapfn = aLen > 1 ? arguments[1] : undefined;
  84698. var mapping = mapfn !== undefined;
  84699. var index = 0;
  84700. var iterFn = getIterFn(O);
  84701. var length, result, step, iterator;
  84702. if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
  84703. // if object isn't iterable or it's array with default iterator - use simple case
  84704. if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
  84705. for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
  84706. createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
  84707. }
  84708. } else {
  84709. length = toLength(O.length);
  84710. for (result = new C(length); length > index; index++) {
  84711. createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
  84712. }
  84713. }
  84714. result.length = index;
  84715. return result;
  84716. }
  84717. });
  84718. /***/ }),
  84719. /* 626 */
  84720. /***/ (function(module, exports, __webpack_require__) {
  84721. "use strict";
  84722. var addToUnscopables = __webpack_require__(605);
  84723. var step = __webpack_require__(334);
  84724. var Iterators = __webpack_require__(123);
  84725. var toIObject = __webpack_require__(90);
  84726. // 22.1.3.4 Array.prototype.entries()
  84727. // 22.1.3.13 Array.prototype.keys()
  84728. // 22.1.3.29 Array.prototype.values()
  84729. // 22.1.3.30 Array.prototype[@@iterator]()
  84730. module.exports = __webpack_require__(219)(Array, 'Array', function (iterated, kind) {
  84731. this._t = toIObject(iterated); // target
  84732. this._i = 0; // next index
  84733. this._k = kind; // kind
  84734. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  84735. }, function () {
  84736. var O = this._t;
  84737. var kind = this._k;
  84738. var index = this._i++;
  84739. if (!O || index >= O.length) {
  84740. this._t = undefined;
  84741. return step(1);
  84742. }
  84743. if (kind == 'keys') return step(0, index);
  84744. if (kind == 'values') return step(0, O[index]);
  84745. return step(0, [index, O[index]]);
  84746. }, 'values');
  84747. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  84748. Iterators.Arguments = Iterators.Array;
  84749. addToUnscopables('keys');
  84750. addToUnscopables('values');
  84751. addToUnscopables('entries');
  84752. /***/ }),
  84753. /* 627 */
  84754. /***/ (function(module, exports, __webpack_require__) {
  84755. "use strict";
  84756. var strong = __webpack_require__(324);
  84757. var validate = __webpack_require__(228);
  84758. var MAP = 'Map';
  84759. // 23.1 Map Objects
  84760. module.exports = __webpack_require__(326)(MAP, function (get) {
  84761. return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  84762. }, {
  84763. // 23.1.3.6 Map.prototype.get(key)
  84764. get: function get(key) {
  84765. var entry = strong.getEntry(validate(this, MAP), key);
  84766. return entry && entry.v;
  84767. },
  84768. // 23.1.3.9 Map.prototype.set(key, value)
  84769. set: function set(key, value) {
  84770. return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
  84771. }
  84772. }, strong, true);
  84773. /***/ }),
  84774. /* 628 */
  84775. /***/ (function(module, exports, __webpack_require__) {
  84776. // 19.1.3.1 Object.assign(target, source)
  84777. var $export = __webpack_require__(34);
  84778. $export($export.S + $export.F, 'Object', { assign: __webpack_require__(616) });
  84779. /***/ }),
  84780. /* 629 */
  84781. /***/ (function(module, exports, __webpack_require__) {
  84782. var $export = __webpack_require__(34);
  84783. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  84784. $export($export.S, 'Object', { create: __webpack_require__(125) });
  84785. /***/ }),
  84786. /* 630 */
  84787. /***/ (function(module, exports, __webpack_require__) {
  84788. // 19.1.2.9 Object.getPrototypeOf(O)
  84789. var toObject = __webpack_require__(103);
  84790. var $getPrototypeOf = __webpack_require__(337);
  84791. __webpack_require__(339)('getPrototypeOf', function () {
  84792. return function getPrototypeOf(it) {
  84793. return $getPrototypeOf(toObject(it));
  84794. };
  84795. });
  84796. /***/ }),
  84797. /* 631 */
  84798. /***/ (function(module, exports, __webpack_require__) {
  84799. // 19.1.2.14 Object.keys(O)
  84800. var toObject = __webpack_require__(103);
  84801. var $keys = __webpack_require__(102);
  84802. __webpack_require__(339)('keys', function () {
  84803. return function keys(it) {
  84804. return $keys(toObject(it));
  84805. };
  84806. });
  84807. /***/ }),
  84808. /* 632 */
  84809. /***/ (function(module, exports, __webpack_require__) {
  84810. // 19.1.3.19 Object.setPrototypeOf(O, proto)
  84811. var $export = __webpack_require__(34);
  84812. $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(620).set });
  84813. /***/ }),
  84814. /* 633 */
  84815. /***/ (function(module, exports, __webpack_require__) {
  84816. "use strict";
  84817. var LIBRARY = __webpack_require__(124);
  84818. var global = __webpack_require__(38);
  84819. var ctx = __webpack_require__(68);
  84820. var classof = __webpack_require__(214);
  84821. var $export = __webpack_require__(34);
  84822. var isObject = __webpack_require__(49);
  84823. var aFunction = __webpack_require__(88);
  84824. var anInstance = __webpack_require__(213);
  84825. var forOf = __webpack_require__(122);
  84826. var speciesConstructor = __webpack_require__(346);
  84827. var task = __webpack_require__(347).set;
  84828. var microtask = __webpack_require__(615)();
  84829. var newPromiseCapabilityModule = __webpack_require__(221);
  84830. var perform = __webpack_require__(340);
  84831. var userAgent = __webpack_require__(623);
  84832. var promiseResolve = __webpack_require__(341);
  84833. var PROMISE = 'Promise';
  84834. var TypeError = global.TypeError;
  84835. var process = global.process;
  84836. var versions = process && process.versions;
  84837. var v8 = versions && versions.v8 || '';
  84838. var $Promise = global[PROMISE];
  84839. var isNode = classof(process) == 'process';
  84840. var empty = function () { /* empty */ };
  84841. var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
  84842. var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
  84843. var USE_NATIVE = !!function () {
  84844. try {
  84845. // correct subclassing with @@species support
  84846. var promise = $Promise.resolve(1);
  84847. var FakePromise = (promise.constructor = {})[__webpack_require__(44)('species')] = function (exec) {
  84848. exec(empty, empty);
  84849. };
  84850. // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  84851. return (isNode || typeof PromiseRejectionEvent == 'function')
  84852. && promise.then(empty) instanceof FakePromise
  84853. // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  84854. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  84855. // we can't detect it synchronously, so just check versions
  84856. && v8.indexOf('6.6') !== 0
  84857. && userAgent.indexOf('Chrome/66') === -1;
  84858. } catch (e) { /* empty */ }
  84859. }();
  84860. // helpers
  84861. var isThenable = function (it) {
  84862. var then;
  84863. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  84864. };
  84865. var notify = function (promise, isReject) {
  84866. if (promise._n) return;
  84867. promise._n = true;
  84868. var chain = promise._c;
  84869. microtask(function () {
  84870. var value = promise._v;
  84871. var ok = promise._s == 1;
  84872. var i = 0;
  84873. var run = function (reaction) {
  84874. var handler = ok ? reaction.ok : reaction.fail;
  84875. var resolve = reaction.resolve;
  84876. var reject = reaction.reject;
  84877. var domain = reaction.domain;
  84878. var result, then, exited;
  84879. try {
  84880. if (handler) {
  84881. if (!ok) {
  84882. if (promise._h == 2) onHandleUnhandled(promise);
  84883. promise._h = 1;
  84884. }
  84885. if (handler === true) result = value;
  84886. else {
  84887. if (domain) domain.enter();
  84888. result = handler(value); // may throw
  84889. if (domain) {
  84890. domain.exit();
  84891. exited = true;
  84892. }
  84893. }
  84894. if (result === reaction.promise) {
  84895. reject(TypeError('Promise-chain cycle'));
  84896. } else if (then = isThenable(result)) {
  84897. then.call(result, resolve, reject);
  84898. } else resolve(result);
  84899. } else reject(value);
  84900. } catch (e) {
  84901. if (domain && !exited) domain.exit();
  84902. reject(e);
  84903. }
  84904. };
  84905. while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
  84906. promise._c = [];
  84907. promise._n = false;
  84908. if (isReject && !promise._h) onUnhandled(promise);
  84909. });
  84910. };
  84911. var onUnhandled = function (promise) {
  84912. task.call(global, function () {
  84913. var value = promise._v;
  84914. var unhandled = isUnhandled(promise);
  84915. var result, handler, console;
  84916. if (unhandled) {
  84917. result = perform(function () {
  84918. if (isNode) {
  84919. process.emit('unhandledRejection', value, promise);
  84920. } else if (handler = global.onunhandledrejection) {
  84921. handler({ promise: promise, reason: value });
  84922. } else if ((console = global.console) && console.error) {
  84923. console.error('Unhandled promise rejection', value);
  84924. }
  84925. });
  84926. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  84927. promise._h = isNode || isUnhandled(promise) ? 2 : 1;
  84928. } promise._a = undefined;
  84929. if (unhandled && result.e) throw result.v;
  84930. });
  84931. };
  84932. var isUnhandled = function (promise) {
  84933. return promise._h !== 1 && (promise._a || promise._c).length === 0;
  84934. };
  84935. var onHandleUnhandled = function (promise) {
  84936. task.call(global, function () {
  84937. var handler;
  84938. if (isNode) {
  84939. process.emit('rejectionHandled', promise);
  84940. } else if (handler = global.onrejectionhandled) {
  84941. handler({ promise: promise, reason: promise._v });
  84942. }
  84943. });
  84944. };
  84945. var $reject = function (value) {
  84946. var promise = this;
  84947. if (promise._d) return;
  84948. promise._d = true;
  84949. promise = promise._w || promise; // unwrap
  84950. promise._v = value;
  84951. promise._s = 2;
  84952. if (!promise._a) promise._a = promise._c.slice();
  84953. notify(promise, true);
  84954. };
  84955. var $resolve = function (value) {
  84956. var promise = this;
  84957. var then;
  84958. if (promise._d) return;
  84959. promise._d = true;
  84960. promise = promise._w || promise; // unwrap
  84961. try {
  84962. if (promise === value) throw TypeError("Promise can't be resolved itself");
  84963. if (then = isThenable(value)) {
  84964. microtask(function () {
  84965. var wrapper = { _w: promise, _d: false }; // wrap
  84966. try {
  84967. then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
  84968. } catch (e) {
  84969. $reject.call(wrapper, e);
  84970. }
  84971. });
  84972. } else {
  84973. promise._v = value;
  84974. promise._s = 1;
  84975. notify(promise, false);
  84976. }
  84977. } catch (e) {
  84978. $reject.call({ _w: promise, _d: false }, e); // wrap
  84979. }
  84980. };
  84981. // constructor polyfill
  84982. if (!USE_NATIVE) {
  84983. // 25.4.3.1 Promise(executor)
  84984. $Promise = function Promise(executor) {
  84985. anInstance(this, $Promise, PROMISE, '_h');
  84986. aFunction(executor);
  84987. Internal.call(this);
  84988. try {
  84989. executor(ctx($resolve, this, 1), ctx($reject, this, 1));
  84990. } catch (err) {
  84991. $reject.call(this, err);
  84992. }
  84993. };
  84994. // eslint-disable-next-line no-unused-vars
  84995. Internal = function Promise(executor) {
  84996. this._c = []; // <- awaiting reactions
  84997. this._a = undefined; // <- checked in isUnhandled reactions
  84998. this._s = 0; // <- state
  84999. this._d = false; // <- done
  85000. this._v = undefined; // <- value
  85001. this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
  85002. this._n = false; // <- notify
  85003. };
  85004. Internal.prototype = __webpack_require__(223)($Promise.prototype, {
  85005. // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
  85006. then: function then(onFulfilled, onRejected) {
  85007. var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
  85008. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  85009. reaction.fail = typeof onRejected == 'function' && onRejected;
  85010. reaction.domain = isNode ? process.domain : undefined;
  85011. this._c.push(reaction);
  85012. if (this._a) this._a.push(reaction);
  85013. if (this._s) notify(this, false);
  85014. return reaction.promise;
  85015. },
  85016. // 25.4.5.1 Promise.prototype.catch(onRejected)
  85017. 'catch': function (onRejected) {
  85018. return this.then(undefined, onRejected);
  85019. }
  85020. });
  85021. OwnPromiseCapability = function () {
  85022. var promise = new Internal();
  85023. this.promise = promise;
  85024. this.resolve = ctx($resolve, promise, 1);
  85025. this.reject = ctx($reject, promise, 1);
  85026. };
  85027. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  85028. return C === $Promise || C === Wrapper
  85029. ? new OwnPromiseCapability(C)
  85030. : newGenericPromiseCapability(C);
  85031. };
  85032. }
  85033. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
  85034. __webpack_require__(128)($Promise, PROMISE);
  85035. __webpack_require__(345)(PROMISE);
  85036. Wrapper = __webpack_require__(26)[PROMISE];
  85037. // statics
  85038. $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  85039. // 25.4.4.5 Promise.reject(r)
  85040. reject: function reject(r) {
  85041. var capability = newPromiseCapability(this);
  85042. var $$reject = capability.reject;
  85043. $$reject(r);
  85044. return capability.promise;
  85045. }
  85046. });
  85047. $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  85048. // 25.4.4.6 Promise.resolve(x)
  85049. resolve: function resolve(x) {
  85050. return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
  85051. }
  85052. });
  85053. $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(333)(function (iter) {
  85054. $Promise.all(iter)['catch'](empty);
  85055. })), PROMISE, {
  85056. // 25.4.4.1 Promise.all(iterable)
  85057. all: function all(iterable) {
  85058. var C = this;
  85059. var capability = newPromiseCapability(C);
  85060. var resolve = capability.resolve;
  85061. var reject = capability.reject;
  85062. var result = perform(function () {
  85063. var values = [];
  85064. var index = 0;
  85065. var remaining = 1;
  85066. forOf(iterable, false, function (promise) {
  85067. var $index = index++;
  85068. var alreadyCalled = false;
  85069. values.push(undefined);
  85070. remaining++;
  85071. C.resolve(promise).then(function (value) {
  85072. if (alreadyCalled) return;
  85073. alreadyCalled = true;
  85074. values[$index] = value;
  85075. --remaining || resolve(values);
  85076. }, reject);
  85077. });
  85078. --remaining || resolve(values);
  85079. });
  85080. if (result.e) reject(result.v);
  85081. return capability.promise;
  85082. },
  85083. // 25.4.4.4 Promise.race(iterable)
  85084. race: function race(iterable) {
  85085. var C = this;
  85086. var capability = newPromiseCapability(C);
  85087. var reject = capability.reject;
  85088. var result = perform(function () {
  85089. forOf(iterable, false, function (promise) {
  85090. C.resolve(promise).then(capability.resolve, reject);
  85091. });
  85092. });
  85093. if (result.e) reject(result.v);
  85094. return capability.promise;
  85095. }
  85096. });
  85097. /***/ }),
  85098. /* 634 */
  85099. /***/ (function(module, exports, __webpack_require__) {
  85100. // 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
  85101. var $export = __webpack_require__(34);
  85102. var create = __webpack_require__(125);
  85103. var aFunction = __webpack_require__(88);
  85104. var anObject = __webpack_require__(58);
  85105. var isObject = __webpack_require__(49);
  85106. var fails = __webpack_require__(76);
  85107. var bind = __webpack_require__(611);
  85108. var rConstruct = (__webpack_require__(38).Reflect || {}).construct;
  85109. // MS Edge supports only 2 arguments and argumentsList argument is optional
  85110. // FF Nightly sets third argument as `new.target`, but does not create `this` from it
  85111. var NEW_TARGET_BUG = fails(function () {
  85112. function F() { /* empty */ }
  85113. return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
  85114. });
  85115. var ARGS_BUG = !fails(function () {
  85116. rConstruct(function () { /* empty */ });
  85117. });
  85118. $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
  85119. construct: function construct(Target, args /* , newTarget */) {
  85120. aFunction(Target);
  85121. anObject(args);
  85122. var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
  85123. if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
  85124. if (Target == newTarget) {
  85125. // w/o altered newTarget, optimization for 0-4 arguments
  85126. switch (args.length) {
  85127. case 0: return new Target();
  85128. case 1: return new Target(args[0]);
  85129. case 2: return new Target(args[0], args[1]);
  85130. case 3: return new Target(args[0], args[1], args[2]);
  85131. case 4: return new Target(args[0], args[1], args[2], args[3]);
  85132. }
  85133. // w/o altered newTarget, lot of arguments case
  85134. var $args = [null];
  85135. $args.push.apply($args, args);
  85136. return new (bind.apply(Target, $args))();
  85137. }
  85138. // with altered newTarget, not support built-in constructors
  85139. var proto = newTarget.prototype;
  85140. var instance = create(isObject(proto) ? proto : Object.prototype);
  85141. var result = Function.apply.call(Target, instance, args);
  85142. return isObject(result) ? result : instance;
  85143. }
  85144. });
  85145. /***/ }),
  85146. /* 635 */
  85147. /***/ (function(module, exports, __webpack_require__) {
  85148. "use strict";
  85149. var strong = __webpack_require__(324);
  85150. var validate = __webpack_require__(228);
  85151. var SET = 'Set';
  85152. // 23.2 Set Objects
  85153. module.exports = __webpack_require__(326)(SET, function (get) {
  85154. return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  85155. }, {
  85156. // 23.2.3.1 Set.prototype.add(value)
  85157. add: function add(value) {
  85158. return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
  85159. }
  85160. }, strong);
  85161. /***/ }),
  85162. /* 636 */
  85163. /***/ (function(module, exports, __webpack_require__) {
  85164. "use strict";
  85165. // ECMAScript 6 symbols shim
  85166. var global = __webpack_require__(38);
  85167. var has = __webpack_require__(89);
  85168. var DESCRIPTORS = __webpack_require__(69);
  85169. var $export = __webpack_require__(34);
  85170. var redefine = __webpack_require__(342);
  85171. var META = __webpack_require__(220).KEY;
  85172. var $fails = __webpack_require__(76);
  85173. var shared = __webpack_require__(225);
  85174. var setToStringTag = __webpack_require__(128);
  85175. var uid = __webpack_require__(162);
  85176. var wks = __webpack_require__(44);
  85177. var wksExt = __webpack_require__(230);
  85178. var wksDefine = __webpack_require__(229);
  85179. var enumKeys = __webpack_require__(613);
  85180. var isArray = __webpack_require__(331);
  85181. var anObject = __webpack_require__(58);
  85182. var isObject = __webpack_require__(49);
  85183. var toIObject = __webpack_require__(90);
  85184. var toPrimitive = __webpack_require__(227);
  85185. var createDesc = __webpack_require__(127);
  85186. var _create = __webpack_require__(125);
  85187. var gOPNExt = __webpack_require__(618);
  85188. var $GOPD = __webpack_require__(335);
  85189. var $DP = __webpack_require__(63);
  85190. var $keys = __webpack_require__(102);
  85191. var gOPD = $GOPD.f;
  85192. var dP = $DP.f;
  85193. var gOPN = gOPNExt.f;
  85194. var $Symbol = global.Symbol;
  85195. var $JSON = global.JSON;
  85196. var _stringify = $JSON && $JSON.stringify;
  85197. var PROTOTYPE = 'prototype';
  85198. var HIDDEN = wks('_hidden');
  85199. var TO_PRIMITIVE = wks('toPrimitive');
  85200. var isEnum = {}.propertyIsEnumerable;
  85201. var SymbolRegistry = shared('symbol-registry');
  85202. var AllSymbols = shared('symbols');
  85203. var OPSymbols = shared('op-symbols');
  85204. var ObjectProto = Object[PROTOTYPE];
  85205. var USE_NATIVE = typeof $Symbol == 'function';
  85206. var QObject = global.QObject;
  85207. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  85208. var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  85209. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  85210. var setSymbolDesc = DESCRIPTORS && $fails(function () {
  85211. return _create(dP({}, 'a', {
  85212. get: function () { return dP(this, 'a', { value: 7 }).a; }
  85213. })).a != 7;
  85214. }) ? function (it, key, D) {
  85215. var protoDesc = gOPD(ObjectProto, key);
  85216. if (protoDesc) delete ObjectProto[key];
  85217. dP(it, key, D);
  85218. if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
  85219. } : dP;
  85220. var wrap = function (tag) {
  85221. var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  85222. sym._k = tag;
  85223. return sym;
  85224. };
  85225. var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
  85226. return typeof it == 'symbol';
  85227. } : function (it) {
  85228. return it instanceof $Symbol;
  85229. };
  85230. var $defineProperty = function defineProperty(it, key, D) {
  85231. if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
  85232. anObject(it);
  85233. key = toPrimitive(key, true);
  85234. anObject(D);
  85235. if (has(AllSymbols, key)) {
  85236. if (!D.enumerable) {
  85237. if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
  85238. it[HIDDEN][key] = true;
  85239. } else {
  85240. if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
  85241. D = _create(D, { enumerable: createDesc(0, false) });
  85242. } return setSymbolDesc(it, key, D);
  85243. } return dP(it, key, D);
  85244. };
  85245. var $defineProperties = function defineProperties(it, P) {
  85246. anObject(it);
  85247. var keys = enumKeys(P = toIObject(P));
  85248. var i = 0;
  85249. var l = keys.length;
  85250. var key;
  85251. while (l > i) $defineProperty(it, key = keys[i++], P[key]);
  85252. return it;
  85253. };
  85254. var $create = function create(it, P) {
  85255. return P === undefined ? _create(it) : $defineProperties(_create(it), P);
  85256. };
  85257. var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  85258. var E = isEnum.call(this, key = toPrimitive(key, true));
  85259. if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
  85260. return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  85261. };
  85262. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  85263. it = toIObject(it);
  85264. key = toPrimitive(key, true);
  85265. if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
  85266. var D = gOPD(it, key);
  85267. if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  85268. return D;
  85269. };
  85270. var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  85271. var names = gOPN(toIObject(it));
  85272. var result = [];
  85273. var i = 0;
  85274. var key;
  85275. while (names.length > i) {
  85276. if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
  85277. } return result;
  85278. };
  85279. var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  85280. var IS_OP = it === ObjectProto;
  85281. var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
  85282. var result = [];
  85283. var i = 0;
  85284. var key;
  85285. while (names.length > i) {
  85286. if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
  85287. } return result;
  85288. };
  85289. // 19.4.1.1 Symbol([description])
  85290. if (!USE_NATIVE) {
  85291. $Symbol = function Symbol() {
  85292. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
  85293. var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
  85294. var $set = function (value) {
  85295. if (this === ObjectProto) $set.call(OPSymbols, value);
  85296. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  85297. setSymbolDesc(this, tag, createDesc(1, value));
  85298. };
  85299. if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
  85300. return wrap(tag);
  85301. };
  85302. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  85303. return this._k;
  85304. });
  85305. $GOPD.f = $getOwnPropertyDescriptor;
  85306. $DP.f = $defineProperty;
  85307. __webpack_require__(336).f = gOPNExt.f = $getOwnPropertyNames;
  85308. __webpack_require__(126).f = $propertyIsEnumerable;
  85309. __webpack_require__(222).f = $getOwnPropertySymbols;
  85310. if (DESCRIPTORS && !__webpack_require__(124)) {
  85311. redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  85312. }
  85313. wksExt.f = function (name) {
  85314. return wrap(wks(name));
  85315. };
  85316. }
  85317. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
  85318. for (var es6Symbols = (
  85319. // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  85320. 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
  85321. ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
  85322. for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
  85323. $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  85324. // 19.4.2.1 Symbol.for(key)
  85325. 'for': function (key) {
  85326. return has(SymbolRegistry, key += '')
  85327. ? SymbolRegistry[key]
  85328. : SymbolRegistry[key] = $Symbol(key);
  85329. },
  85330. // 19.4.2.5 Symbol.keyFor(sym)
  85331. keyFor: function keyFor(sym) {
  85332. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
  85333. for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
  85334. },
  85335. useSetter: function () { setter = true; },
  85336. useSimple: function () { setter = false; }
  85337. });
  85338. $export($export.S + $export.F * !USE_NATIVE, 'Object', {
  85339. // 19.1.2.2 Object.create(O [, Properties])
  85340. create: $create,
  85341. // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  85342. defineProperty: $defineProperty,
  85343. // 19.1.2.3 Object.defineProperties(O, Properties)
  85344. defineProperties: $defineProperties,
  85345. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  85346. getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  85347. // 19.1.2.7 Object.getOwnPropertyNames(O)
  85348. getOwnPropertyNames: $getOwnPropertyNames,
  85349. // 19.1.2.8 Object.getOwnPropertySymbols(O)
  85350. getOwnPropertySymbols: $getOwnPropertySymbols
  85351. });
  85352. // 24.3.2 JSON.stringify(value [, replacer [, space]])
  85353. $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
  85354. var S = $Symbol();
  85355. // MS Edge converts symbol values to JSON as {}
  85356. // WebKit converts symbol values to JSON as null
  85357. // V8 throws on boxed symbols
  85358. return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
  85359. })), 'JSON', {
  85360. stringify: function stringify(it) {
  85361. var args = [it];
  85362. var i = 1;
  85363. var replacer, $replacer;
  85364. while (arguments.length > i) args.push(arguments[i++]);
  85365. $replacer = replacer = args[1];
  85366. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  85367. if (!isArray(replacer)) replacer = function (key, value) {
  85368. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  85369. if (!isSymbol(value)) return value;
  85370. };
  85371. args[1] = replacer;
  85372. return _stringify.apply($JSON, args);
  85373. }
  85374. });
  85375. // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
  85376. $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(77)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  85377. // 19.4.3.5 Symbol.prototype[@@toStringTag]
  85378. setToStringTag($Symbol, 'Symbol');
  85379. // 20.2.1.9 Math[@@toStringTag]
  85380. setToStringTag(Math, 'Math', true);
  85381. // 24.3.3 JSON[@@toStringTag]
  85382. setToStringTag(global.JSON, 'JSON', true);
  85383. /***/ }),
  85384. /* 637 */
  85385. /***/ (function(module, exports, __webpack_require__) {
  85386. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
  85387. __webpack_require__(343)('Map');
  85388. /***/ }),
  85389. /* 638 */
  85390. /***/ (function(module, exports, __webpack_require__) {
  85391. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
  85392. __webpack_require__(344)('Map');
  85393. /***/ }),
  85394. /* 639 */
  85395. /***/ (function(module, exports, __webpack_require__) {
  85396. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  85397. var $export = __webpack_require__(34);
  85398. $export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(325)('Map') });
  85399. /***/ }),
  85400. /* 640 */
  85401. /***/ (function(module, exports, __webpack_require__) {
  85402. // https://github.com/tc39/proposal-object-values-entries
  85403. var $export = __webpack_require__(34);
  85404. var $values = __webpack_require__(619)(false);
  85405. $export($export.S, 'Object', {
  85406. values: function values(it) {
  85407. return $values(it);
  85408. }
  85409. });
  85410. /***/ }),
  85411. /* 641 */
  85412. /***/ (function(module, exports, __webpack_require__) {
  85413. "use strict";
  85414. // https://github.com/tc39/proposal-promise-finally
  85415. var $export = __webpack_require__(34);
  85416. var core = __webpack_require__(26);
  85417. var global = __webpack_require__(38);
  85418. var speciesConstructor = __webpack_require__(346);
  85419. var promiseResolve = __webpack_require__(341);
  85420. $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
  85421. var C = speciesConstructor(this, core.Promise || global.Promise);
  85422. var isFunction = typeof onFinally == 'function';
  85423. return this.then(
  85424. isFunction ? function (x) {
  85425. return promiseResolve(C, onFinally()).then(function () { return x; });
  85426. } : onFinally,
  85427. isFunction ? function (e) {
  85428. return promiseResolve(C, onFinally()).then(function () { throw e; });
  85429. } : onFinally
  85430. );
  85431. } });
  85432. /***/ }),
  85433. /* 642 */
  85434. /***/ (function(module, exports, __webpack_require__) {
  85435. "use strict";
  85436. // https://github.com/tc39/proposal-promise-try
  85437. var $export = __webpack_require__(34);
  85438. var newPromiseCapability = __webpack_require__(221);
  85439. var perform = __webpack_require__(340);
  85440. $export($export.S, 'Promise', { 'try': function (callbackfn) {
  85441. var promiseCapability = newPromiseCapability.f(this);
  85442. var result = perform(callbackfn);
  85443. (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
  85444. return promiseCapability.promise;
  85445. } });
  85446. /***/ }),
  85447. /* 643 */
  85448. /***/ (function(module, exports, __webpack_require__) {
  85449. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
  85450. __webpack_require__(343)('Set');
  85451. /***/ }),
  85452. /* 644 */
  85453. /***/ (function(module, exports, __webpack_require__) {
  85454. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
  85455. __webpack_require__(344)('Set');
  85456. /***/ }),
  85457. /* 645 */
  85458. /***/ (function(module, exports, __webpack_require__) {
  85459. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  85460. var $export = __webpack_require__(34);
  85461. $export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(325)('Set') });
  85462. /***/ }),
  85463. /* 646 */
  85464. /***/ (function(module, exports, __webpack_require__) {
  85465. __webpack_require__(229)('asyncIterator');
  85466. /***/ }),
  85467. /* 647 */
  85468. /***/ (function(module, exports, __webpack_require__) {
  85469. __webpack_require__(229)('observable');
  85470. /***/ }),
  85471. /* 648 */
  85472. /***/ (function(module, exports, __webpack_require__) {
  85473. "use strict";
  85474. var arrayFindIndex = __webpack_require__(452);
  85475. module.exports = function () {
  85476. var unhandledRejections = [];
  85477. function onUnhandledRejection(reason, promise) {
  85478. unhandledRejections.push({reason: reason, promise: promise});
  85479. }
  85480. function onRejectionHandled(promise) {
  85481. var index = arrayFindIndex(unhandledRejections, function (x) {
  85482. return x.promise === promise;
  85483. });
  85484. unhandledRejections.splice(index, 1);
  85485. }
  85486. function currentlyUnhandled() {
  85487. return unhandledRejections.map(function (entry) {
  85488. return {
  85489. reason: entry.reason,
  85490. promise: entry.promise
  85491. };
  85492. });
  85493. }
  85494. return {
  85495. onUnhandledRejection: onUnhandledRejection,
  85496. onRejectionHandled: onRejectionHandled,
  85497. currentlyUnhandled: currentlyUnhandled
  85498. };
  85499. };
  85500. /***/ }),
  85501. /* 649 */
  85502. /***/ (function(module, exports, __webpack_require__) {
  85503. "use strict";
  85504. var core = __webpack_require__(648);
  85505. module.exports = function (p) {
  85506. p = p || process;
  85507. var c = core();
  85508. p.on('unhandledRejection', c.onUnhandledRejection);
  85509. p.on('rejectionHandled', c.onRejectionHandled);
  85510. return c.currentlyUnhandled;
  85511. };
  85512. /***/ }),
  85513. /* 650 */
  85514. /***/ (function(module, exports, __webpack_require__) {
  85515. /**
  85516. * This is the web browser implementation of `debug()`.
  85517. *
  85518. * Expose `debug()` as the module.
  85519. */
  85520. exports = module.exports = __webpack_require__(348);
  85521. exports.log = log;
  85522. exports.formatArgs = formatArgs;
  85523. exports.save = save;
  85524. exports.load = load;
  85525. exports.useColors = useColors;
  85526. exports.storage = 'undefined' != typeof chrome
  85527. && 'undefined' != typeof chrome.storage
  85528. ? chrome.storage.local
  85529. : localstorage();
  85530. /**
  85531. * Colors.
  85532. */
  85533. exports.colors = [
  85534. '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
  85535. '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
  85536. '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
  85537. '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
  85538. '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
  85539. '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
  85540. '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
  85541. '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
  85542. '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
  85543. '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
  85544. '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
  85545. ];
  85546. /**
  85547. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  85548. * and the Firebug extension (any Firefox version) are known
  85549. * to support "%c" CSS customizations.
  85550. *
  85551. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  85552. */
  85553. function useColors() {
  85554. // NB: In an Electron preload script, document will be defined but not fully
  85555. // initialized. Since we know we're in Chrome, we'll just detect this case
  85556. // explicitly
  85557. if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
  85558. return true;
  85559. }
  85560. // Internet Explorer and Edge do not support colors.
  85561. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  85562. return false;
  85563. }
  85564. // is webkit? http://stackoverflow.com/a/16459606/376773
  85565. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  85566. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  85567. // is firebug? http://stackoverflow.com/a/398120/376773
  85568. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  85569. // is firefox >= v31?
  85570. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  85571. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  85572. // double check webkit in userAgent just in case we are in a worker
  85573. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  85574. }
  85575. /**
  85576. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  85577. */
  85578. exports.formatters.j = function(v) {
  85579. try {
  85580. return JSON.stringify(v);
  85581. } catch (err) {
  85582. return '[UnexpectedJSONParseError]: ' + err.message;
  85583. }
  85584. };
  85585. /**
  85586. * Colorize log arguments if enabled.
  85587. *
  85588. * @api public
  85589. */
  85590. function formatArgs(args) {
  85591. var useColors = this.useColors;
  85592. args[0] = (useColors ? '%c' : '')
  85593. + this.namespace
  85594. + (useColors ? ' %c' : ' ')
  85595. + args[0]
  85596. + (useColors ? '%c ' : ' ')
  85597. + '+' + exports.humanize(this.diff);
  85598. if (!useColors) return;
  85599. var c = 'color: ' + this.color;
  85600. args.splice(1, 0, c, 'color: inherit')
  85601. // the final "%c" is somewhat tricky, because there could be other
  85602. // arguments passed either before or after the %c, so we need to
  85603. // figure out the correct index to insert the CSS into
  85604. var index = 0;
  85605. var lastC = 0;
  85606. args[0].replace(/%[a-zA-Z%]/g, function(match) {
  85607. if ('%%' === match) return;
  85608. index++;
  85609. if ('%c' === match) {
  85610. // we only are interested in the *last* %c
  85611. // (the user may have provided their own)
  85612. lastC = index;
  85613. }
  85614. });
  85615. args.splice(lastC, 0, c);
  85616. }
  85617. /**
  85618. * Invokes `console.log()` when available.
  85619. * No-op when `console.log` is not a "function".
  85620. *
  85621. * @api public
  85622. */
  85623. function log() {
  85624. // this hackery is required for IE8/9, where
  85625. // the `console.log` function doesn't have 'apply'
  85626. return 'object' === typeof console
  85627. && console.log
  85628. && Function.prototype.apply.call(console.log, console, arguments);
  85629. }
  85630. /**
  85631. * Save `namespaces`.
  85632. *
  85633. * @param {String} namespaces
  85634. * @api private
  85635. */
  85636. function save(namespaces) {
  85637. try {
  85638. if (null == namespaces) {
  85639. exports.storage.removeItem('debug');
  85640. } else {
  85641. exports.storage.debug = namespaces;
  85642. }
  85643. } catch(e) {}
  85644. }
  85645. /**
  85646. * Load `namespaces`.
  85647. *
  85648. * @return {String} returns the previously persisted debug modes
  85649. * @api private
  85650. */
  85651. function load() {
  85652. var r;
  85653. try {
  85654. r = exports.storage.debug;
  85655. } catch(e) {}
  85656. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  85657. if (!r && typeof process !== 'undefined' && 'env' in process) {
  85658. r = process.env.DEBUG;
  85659. }
  85660. return r;
  85661. }
  85662. /**
  85663. * Enable namespaces listed in `localStorage.debug` initially.
  85664. */
  85665. exports.enable(load());
  85666. /**
  85667. * Localstorage attempts to return the localstorage.
  85668. *
  85669. * This is necessary because safari throws
  85670. * when a user disables cookies/localstorage
  85671. * and you attempt to access it.
  85672. *
  85673. * @return {LocalStorage}
  85674. * @api private
  85675. */
  85676. function localstorage() {
  85677. try {
  85678. return window.localStorage;
  85679. } catch (e) {}
  85680. }
  85681. /***/ }),
  85682. /* 651 */
  85683. /***/ (function(module, exports, __webpack_require__) {
  85684. /**
  85685. * Detect Electron renderer process, which is node, but we should
  85686. * treat as a browser.
  85687. */
  85688. if (typeof process === 'undefined' || process.type === 'renderer') {
  85689. module.exports = __webpack_require__(650);
  85690. } else {
  85691. module.exports = __webpack_require__(652);
  85692. }
  85693. /***/ }),
  85694. /* 652 */
  85695. /***/ (function(module, exports, __webpack_require__) {
  85696. /**
  85697. * Module dependencies.
  85698. */
  85699. var tty = __webpack_require__(149);
  85700. var util = __webpack_require__(9);
  85701. /**
  85702. * This is the Node.js implementation of `debug()`.
  85703. *
  85704. * Expose `debug()` as the module.
  85705. */
  85706. exports = module.exports = __webpack_require__(348);
  85707. exports.init = init;
  85708. exports.log = log;
  85709. exports.formatArgs = formatArgs;
  85710. exports.save = save;
  85711. exports.load = load;
  85712. exports.useColors = useColors;
  85713. /**
  85714. * Colors.
  85715. */
  85716. exports.colors = [ 6, 2, 3, 4, 5, 1 ];
  85717. try {
  85718. var supportsColor = __webpack_require__(1021);
  85719. if (supportsColor && supportsColor.level >= 2) {
  85720. exports.colors = [
  85721. 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68,
  85722. 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134,
  85723. 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
  85724. 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204,
  85725. 205, 206, 207, 208, 209, 214, 215, 220, 221
  85726. ];
  85727. }
  85728. } catch (err) {
  85729. // swallow - we only care if `supports-color` is available; it doesn't have to be.
  85730. }
  85731. /**
  85732. * Build up the default `inspectOpts` object from the environment variables.
  85733. *
  85734. * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
  85735. */
  85736. exports.inspectOpts = Object.keys(process.env).filter(function (key) {
  85737. return /^debug_/i.test(key);
  85738. }).reduce(function (obj, key) {
  85739. // camel-case
  85740. var prop = key
  85741. .substring(6)
  85742. .toLowerCase()
  85743. .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
  85744. // coerce string value into JS value
  85745. var val = process.env[key];
  85746. if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
  85747. else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
  85748. else if (val === 'null') val = null;
  85749. else val = Number(val);
  85750. obj[prop] = val;
  85751. return obj;
  85752. }, {});
  85753. /**
  85754. * Is stdout a TTY? Colored output is enabled when `true`.
  85755. */
  85756. function useColors() {
  85757. return 'colors' in exports.inspectOpts
  85758. ? Boolean(exports.inspectOpts.colors)
  85759. : tty.isatty(process.stderr.fd);
  85760. }
  85761. /**
  85762. * Map %o to `util.inspect()`, all on a single line.
  85763. */
  85764. exports.formatters.o = function(v) {
  85765. this.inspectOpts.colors = this.useColors;
  85766. return util.inspect(v, this.inspectOpts)
  85767. .split('\n').map(function(str) {
  85768. return str.trim()
  85769. }).join(' ');
  85770. };
  85771. /**
  85772. * Map %o to `util.inspect()`, allowing multiple lines if needed.
  85773. */
  85774. exports.formatters.O = function(v) {
  85775. this.inspectOpts.colors = this.useColors;
  85776. return util.inspect(v, this.inspectOpts);
  85777. };
  85778. /**
  85779. * Adds ANSI color escape codes if enabled.
  85780. *
  85781. * @api public
  85782. */
  85783. function formatArgs(args) {
  85784. var name = this.namespace;
  85785. var useColors = this.useColors;
  85786. if (useColors) {
  85787. var c = this.color;
  85788. var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c);
  85789. var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m';
  85790. args[0] = prefix + args[0].split('\n').join('\n' + prefix);
  85791. args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
  85792. } else {
  85793. args[0] = getDate() + name + ' ' + args[0];
  85794. }
  85795. }
  85796. function getDate() {
  85797. if (exports.inspectOpts.hideDate) {
  85798. return '';
  85799. } else {
  85800. return new Date().toISOString() + ' ';
  85801. }
  85802. }
  85803. /**
  85804. * Invokes `util.format()` with the specified arguments and writes to stderr.
  85805. */
  85806. function log() {
  85807. return process.stderr.write(util.format.apply(util, arguments) + '\n');
  85808. }
  85809. /**
  85810. * Save `namespaces`.
  85811. *
  85812. * @param {String} namespaces
  85813. * @api private
  85814. */
  85815. function save(namespaces) {
  85816. if (null == namespaces) {
  85817. // If you set a process.env field to null or undefined, it gets cast to the
  85818. // string 'null' or 'undefined'. Just delete instead.
  85819. delete process.env.DEBUG;
  85820. } else {
  85821. process.env.DEBUG = namespaces;
  85822. }
  85823. }
  85824. /**
  85825. * Load `namespaces`.
  85826. *
  85827. * @return {String} returns the previously persisted debug modes
  85828. * @api private
  85829. */
  85830. function load() {
  85831. return process.env.DEBUG;
  85832. }
  85833. /**
  85834. * Init logic for `debug` instances.
  85835. *
  85836. * Create a new `inspectOpts` object in case `useColors` is set
  85837. * differently for a particular `debug` instance.
  85838. */
  85839. function init (debug) {
  85840. debug.inspectOpts = {};
  85841. var keys = Object.keys(exports.inspectOpts);
  85842. for (var i = 0; i < keys.length; i++) {
  85843. debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
  85844. }
  85845. }
  85846. /**
  85847. * Enable namespaces listed in `process.env.DEBUG` initially.
  85848. */
  85849. exports.enable(load());
  85850. /***/ }),
  85851. /* 653 */
  85852. /***/ (function(module, exports, __webpack_require__) {
  85853. "use strict";
  85854. var token = '%[a-f0-9]{2}';
  85855. var singleMatcher = new RegExp(token, 'gi');
  85856. var multiMatcher = new RegExp('(' + token + ')+', 'gi');
  85857. function decodeComponents(components, split) {
  85858. try {
  85859. // Try to decode the entire string first
  85860. return decodeURIComponent(components.join(''));
  85861. } catch (err) {
  85862. // Do nothing
  85863. }
  85864. if (components.length === 1) {
  85865. return components;
  85866. }
  85867. split = split || 1;
  85868. // Split the array in 2 parts
  85869. var left = components.slice(0, split);
  85870. var right = components.slice(split);
  85871. return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
  85872. }
  85873. function decode(input) {
  85874. try {
  85875. return decodeURIComponent(input);
  85876. } catch (err) {
  85877. var tokens = input.match(singleMatcher);
  85878. for (var i = 1; i < tokens.length; i++) {
  85879. input = decodeComponents(tokens, i).join('');
  85880. tokens = input.match(singleMatcher);
  85881. }
  85882. return input;
  85883. }
  85884. }
  85885. function customDecodeURIComponent(input) {
  85886. // Keep track of all the replacements and prefill the map with the `BOM`
  85887. var replaceMap = {
  85888. '%FE%FF': '\uFFFD\uFFFD',
  85889. '%FF%FE': '\uFFFD\uFFFD'
  85890. };
  85891. var match = multiMatcher.exec(input);
  85892. while (match) {
  85893. try {
  85894. // Decode as big chunks as possible
  85895. replaceMap[match[0]] = decodeURIComponent(match[0]);
  85896. } catch (err) {
  85897. var result = decode(match[0]);
  85898. if (result !== match[0]) {
  85899. replaceMap[match[0]] = result;
  85900. }
  85901. }
  85902. match = multiMatcher.exec(input);
  85903. }
  85904. // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
  85905. replaceMap['%C2'] = '\uFFFD';
  85906. var entries = Object.keys(replaceMap);
  85907. for (var i = 0; i < entries.length; i++) {
  85908. // Replace all decoded components
  85909. var key = entries[i];
  85910. input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
  85911. }
  85912. return input;
  85913. }
  85914. module.exports = function (encodedURI) {
  85915. if (typeof encodedURI !== 'string') {
  85916. throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
  85917. }
  85918. try {
  85919. encodedURI = encodedURI.replace(/\+/g, ' ');
  85920. // Try the built in decoder first
  85921. return decodeURIComponent(encodedURI);
  85922. } catch (err) {
  85923. // Fallback to a more advanced decoder
  85924. return customDecodeURIComponent(encodedURI);
  85925. }
  85926. };
  85927. /***/ }),
  85928. /* 654 */
  85929. /***/ (function(module, exports, __webpack_require__) {
  85930. var pSlice = Array.prototype.slice;
  85931. var objectKeys = __webpack_require__(656);
  85932. var isArguments = __webpack_require__(655);
  85933. var deepEqual = module.exports = function (actual, expected, opts) {
  85934. if (!opts) opts = {};
  85935. // 7.1. All identical values are equivalent, as determined by ===.
  85936. if (actual === expected) {
  85937. return true;
  85938. } else if (actual instanceof Date && expected instanceof Date) {
  85939. return actual.getTime() === expected.getTime();
  85940. // 7.3. Other pairs that do not both pass typeof value == 'object',
  85941. // equivalence is determined by ==.
  85942. } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {
  85943. return opts.strict ? actual === expected : actual == expected;
  85944. // 7.4. For all other Object pairs, including Array objects, equivalence is
  85945. // determined by having the same number of owned properties (as verified
  85946. // with Object.prototype.hasOwnProperty.call), the same set of keys
  85947. // (although not necessarily the same order), equivalent values for every
  85948. // corresponding key, and an identical 'prototype' property. Note: this
  85949. // accounts for both named and indexed properties on Arrays.
  85950. } else {
  85951. return objEquiv(actual, expected, opts);
  85952. }
  85953. }
  85954. function isUndefinedOrNull(value) {
  85955. return value === null || value === undefined;
  85956. }
  85957. function isBuffer (x) {
  85958. if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;
  85959. if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
  85960. return false;
  85961. }
  85962. if (x.length > 0 && typeof x[0] !== 'number') return false;
  85963. return true;
  85964. }
  85965. function objEquiv(a, b, opts) {
  85966. var i, key;
  85967. if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
  85968. return false;
  85969. // an identical 'prototype' property.
  85970. if (a.prototype !== b.prototype) return false;
  85971. //~~~I've managed to break Object.keys through screwy arguments passing.
  85972. // Converting to array solves the problem.
  85973. if (isArguments(a)) {
  85974. if (!isArguments(b)) {
  85975. return false;
  85976. }
  85977. a = pSlice.call(a);
  85978. b = pSlice.call(b);
  85979. return deepEqual(a, b, opts);
  85980. }
  85981. if (isBuffer(a)) {
  85982. if (!isBuffer(b)) {
  85983. return false;
  85984. }
  85985. if (a.length !== b.length) return false;
  85986. for (i = 0; i < a.length; i++) {
  85987. if (a[i] !== b[i]) return false;
  85988. }
  85989. return true;
  85990. }
  85991. try {
  85992. var ka = objectKeys(a),
  85993. kb = objectKeys(b);
  85994. } catch (e) {//happens when one is a string literal and the other isn't
  85995. return false;
  85996. }
  85997. // having the same number of owned properties (keys incorporates
  85998. // hasOwnProperty)
  85999. if (ka.length != kb.length)
  86000. return false;
  86001. //the same set of keys (although not necessarily the same order),
  86002. ka.sort();
  86003. kb.sort();
  86004. //~~~cheap key test
  86005. for (i = ka.length - 1; i >= 0; i--) {
  86006. if (ka[i] != kb[i])
  86007. return false;
  86008. }
  86009. //equivalent values for every corresponding key, and
  86010. //~~~possibly expensive deep test
  86011. for (i = ka.length - 1; i >= 0; i--) {
  86012. key = ka[i];
  86013. if (!deepEqual(a[key], b[key], opts)) return false;
  86014. }
  86015. return typeof a === typeof b;
  86016. }
  86017. /***/ }),
  86018. /* 655 */
  86019. /***/ (function(module, exports) {
  86020. var supportsArgumentsClass = (function(){
  86021. return Object.prototype.toString.call(arguments)
  86022. })() == '[object Arguments]';
  86023. exports = module.exports = supportsArgumentsClass ? supported : unsupported;
  86024. exports.supported = supported;
  86025. function supported(object) {
  86026. return Object.prototype.toString.call(object) == '[object Arguments]';
  86027. };
  86028. exports.unsupported = unsupported;
  86029. function unsupported(object){
  86030. return object &&
  86031. typeof object == 'object' &&
  86032. typeof object.length == 'number' &&
  86033. Object.prototype.hasOwnProperty.call(object, 'callee') &&
  86034. !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||
  86035. false;
  86036. };
  86037. /***/ }),
  86038. /* 656 */
  86039. /***/ (function(module, exports) {
  86040. exports = module.exports = typeof Object.keys === 'function'
  86041. ? Object.keys : shim;
  86042. exports.shim = shim;
  86043. function shim (obj) {
  86044. var keys = [];
  86045. for (var key in obj) keys.push(key);
  86046. return keys;
  86047. }
  86048. /***/ }),
  86049. /* 657 */
  86050. /***/ (function(module, exports, __webpack_require__) {
  86051. var Stream = __webpack_require__(36).Stream;
  86052. var util = __webpack_require__(9);
  86053. module.exports = DelayedStream;
  86054. function DelayedStream() {
  86055. this.source = null;
  86056. this.dataSize = 0;
  86057. this.maxDataSize = 1024 * 1024;
  86058. this.pauseStream = true;
  86059. this._maxDataSizeExceeded = false;
  86060. this._released = false;
  86061. this._bufferedEvents = [];
  86062. }
  86063. util.inherits(DelayedStream, Stream);
  86064. DelayedStream.create = function(source, options) {
  86065. var delayedStream = new this();
  86066. options = options || {};
  86067. for (var option in options) {
  86068. delayedStream[option] = options[option];
  86069. }
  86070. delayedStream.source = source;
  86071. var realEmit = source.emit;
  86072. source.emit = function() {
  86073. delayedStream._handleEmit(arguments);
  86074. return realEmit.apply(source, arguments);
  86075. };
  86076. source.on('error', function() {});
  86077. if (delayedStream.pauseStream) {
  86078. source.pause();
  86079. }
  86080. return delayedStream;
  86081. };
  86082. Object.defineProperty(DelayedStream.prototype, 'readable', {
  86083. configurable: true,
  86084. enumerable: true,
  86085. get: function() {
  86086. return this.source.readable;
  86087. }
  86088. });
  86089. DelayedStream.prototype.setEncoding = function() {
  86090. return this.source.setEncoding.apply(this.source, arguments);
  86091. };
  86092. DelayedStream.prototype.resume = function() {
  86093. if (!this._released) {
  86094. this.release();
  86095. }
  86096. this.source.resume();
  86097. };
  86098. DelayedStream.prototype.pause = function() {
  86099. this.source.pause();
  86100. };
  86101. DelayedStream.prototype.release = function() {
  86102. this._released = true;
  86103. this._bufferedEvents.forEach(function(args) {
  86104. this.emit.apply(this, args);
  86105. }.bind(this));
  86106. this._bufferedEvents = [];
  86107. };
  86108. DelayedStream.prototype.pipe = function() {
  86109. var r = Stream.prototype.pipe.apply(this, arguments);
  86110. this.resume();
  86111. return r;
  86112. };
  86113. DelayedStream.prototype._handleEmit = function(args) {
  86114. if (this._released) {
  86115. this.emit.apply(this, args);
  86116. return;
  86117. }
  86118. if (args[0] === 'data') {
  86119. this.dataSize += args[1].length;
  86120. this._checkIfMaxDataSizeExceeded();
  86121. }
  86122. this._bufferedEvents.push(args);
  86123. };
  86124. DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
  86125. if (this._maxDataSizeExceeded) {
  86126. return;
  86127. }
  86128. if (this.dataSize <= this.maxDataSize) {
  86129. return;
  86130. }
  86131. this._maxDataSizeExceeded = true;
  86132. var message =
  86133. 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
  86134. this.emit('error', new Error(message));
  86135. };
  86136. /***/ }),
  86137. /* 658 */
  86138. /***/ (function(module, exports, __webpack_require__) {
  86139. "use strict";
  86140. // detect either spaces or tabs but not both to properly handle tabs
  86141. // for indentation and spaces for alignment
  86142. const INDENT_RE = /^(?:( )+|\t+)/;
  86143. function getMostUsed(indents) {
  86144. let result = 0;
  86145. let maxUsed = 0;
  86146. let maxWeight = 0;
  86147. for (const entry of indents) {
  86148. // TODO: use destructuring when targeting Node.js 6
  86149. const key = entry[0];
  86150. const val = entry[1];
  86151. const u = val[0];
  86152. const w = val[1];
  86153. if (u > maxUsed || (u === maxUsed && w > maxWeight)) {
  86154. maxUsed = u;
  86155. maxWeight = w;
  86156. result = Number(key);
  86157. }
  86158. }
  86159. return result;
  86160. }
  86161. module.exports = str => {
  86162. if (typeof str !== 'string') {
  86163. throw new TypeError('Expected a string');
  86164. }
  86165. // used to see if tabs or spaces are the most used
  86166. let tabs = 0;
  86167. let spaces = 0;
  86168. // remember the size of previous line's indentation
  86169. let prev = 0;
  86170. // remember how many indents/unindents as occurred for a given size
  86171. // and how much lines follow a given indentation
  86172. //
  86173. // indents = {
  86174. // 3: [1, 0],
  86175. // 4: [1, 5],
  86176. // 5: [1, 0],
  86177. // 12: [1, 0],
  86178. // }
  86179. const indents = new Map();
  86180. // pointer to the array of last used indent
  86181. let current;
  86182. // whether the last action was an indent (opposed to an unindent)
  86183. let isIndent;
  86184. for (const line of str.split(/\n/g)) {
  86185. if (!line) {
  86186. // ignore empty lines
  86187. continue;
  86188. }
  86189. let indent;
  86190. const matches = line.match(INDENT_RE);
  86191. if (matches) {
  86192. indent = matches[0].length;
  86193. if (matches[1]) {
  86194. spaces++;
  86195. } else {
  86196. tabs++;
  86197. }
  86198. } else {
  86199. indent = 0;
  86200. }
  86201. const diff = indent - prev;
  86202. prev = indent;
  86203. if (diff) {
  86204. // an indent or unindent has been detected
  86205. isIndent = diff > 0;
  86206. current = indents.get(isIndent ? diff : -diff);
  86207. if (current) {
  86208. current[0]++;
  86209. } else {
  86210. current = [1, 0];
  86211. indents.set(diff, current);
  86212. }
  86213. } else if (current) {
  86214. // if the last action was an indent, increment the weight
  86215. current[1] += Number(isIndent);
  86216. }
  86217. }
  86218. const amount = getMostUsed(indents);
  86219. let type;
  86220. let indent;
  86221. if (!amount) {
  86222. type = null;
  86223. indent = '';
  86224. } else if (spaces >= tabs) {
  86225. type = 'space';
  86226. indent = ' '.repeat(amount);
  86227. } else {
  86228. type = 'tab';
  86229. indent = '\t'.repeat(amount);
  86230. }
  86231. return {
  86232. amount,
  86233. type,
  86234. indent
  86235. };
  86236. };
  86237. /***/ }),
  86238. /* 659 */
  86239. /***/ (function(module, exports, __webpack_require__) {
  86240. /*
  86241. * Copyright (c) 2013, Yahoo! Inc. All rights reserved.
  86242. * Copyrights licensed under the New BSD License.
  86243. * See the accompanying LICENSE file for terms.
  86244. */
  86245. var CacheObject = function (conf) {
  86246. conf = conf || {};
  86247. conf.ttl = parseInt(conf.ttl, 10) || 300; //0 is not permissible
  86248. conf.cachesize = parseInt(conf.cachesize, 10) || 1000; //0 is not permissible
  86249. this.ttl = conf.ttl * 1000;
  86250. this.max = conf.cachesize;
  86251. this.count = 0;
  86252. this.data = {};
  86253. var next = __webpack_require__(453);
  86254. this.set = function (key, value, callback) {
  86255. var self = this;
  86256. next(function () {
  86257. if (self.data[key]) {
  86258. if (self.data[key].newer) {
  86259. if (self.data[key].older) {
  86260. self.data[key].newer.older = self.data[key].older;
  86261. self.data[key].older.newer = self.data[key].newer;
  86262. } else {
  86263. self.tail = self.data[key].newer;
  86264. delete self.tail.older;
  86265. }
  86266. self.data[key].older = self.head;
  86267. self.head.newer = self.data[key];
  86268. delete self.data[key].newer;
  86269. self.head = self.data[key];
  86270. }
  86271. self.head.val = value;
  86272. self.head.hit = 0;
  86273. self.head.ts = Date.now();
  86274. } else {
  86275. // key is not exist
  86276. self.data[key] = {
  86277. "key" : key,
  86278. "val" : value,
  86279. "hit" : 0,
  86280. "ts" : Date.now()
  86281. };
  86282. if (!self.head) {
  86283. // cache is empty
  86284. self.head = self.data[key];
  86285. self.tail = self.data[key];
  86286. } else {
  86287. // insert the new entry to the front
  86288. self.head.newer = self.data[key];
  86289. self.data[key].older = self.head;
  86290. self.head = self.data[key];
  86291. }
  86292. if (self.count >= self.max) {
  86293. // remove the tail
  86294. var temp = self.tail;
  86295. self.tail = self.tail.newer;
  86296. delete self.tail.next;
  86297. delete self.data[temp.key];
  86298. } else {
  86299. self.count = self.count + 1;
  86300. }
  86301. }
  86302. /* jshint -W030 */
  86303. callback && callback(null, value);
  86304. });
  86305. };
  86306. this.get = function (key, callback) {
  86307. var self = this;
  86308. if (!callback) {
  86309. throw('cache.get callback is required.');
  86310. }
  86311. next(function () {
  86312. if (!self.data[key]) {
  86313. return callback(null, undefined);
  86314. }
  86315. var value;
  86316. if (conf.ttl !== 0 && (Date.now() - self.data[key].ts) >= self.ttl) {
  86317. if (self.data[key].newer) {
  86318. if (self.data[key].older) {
  86319. // in the middle of the list
  86320. self.data[key].newer.older = self.data[key].older;
  86321. self.data[key].older.newer = self.data[key].newer;
  86322. } else {
  86323. // tail
  86324. self.tail = self.data[key].newer;
  86325. delete self.tail.older;
  86326. }
  86327. } else {
  86328. // the first item
  86329. if (self.data[key].older) {
  86330. self.head = self.data[key].older;
  86331. delete self.head.newer;
  86332. } else {
  86333. // 1 items
  86334. delete self.head;
  86335. delete self.tail;
  86336. }
  86337. }
  86338. delete self.data[key];
  86339. self.count = self.count - 1;
  86340. } else {
  86341. self.data[key].hit = self.data[key].hit + 1;
  86342. value = self.data[key].val;
  86343. }
  86344. callback(null, value);
  86345. });
  86346. };
  86347. };
  86348. module.exports = CacheObject;
  86349. /***/ }),
  86350. /* 660 */
  86351. /***/ (function(module, exports, __webpack_require__) {
  86352. /*
  86353. * Copyright (c) 2013, Yahoo! Inc. All rights reserved.
  86354. * Copyrights licensed under the New BSD License.
  86355. * See the accompanying LICENSE file for terms.
  86356. */
  86357. var CacheObject = __webpack_require__(659),
  86358. deepCopy = __webpack_require__(820),
  86359. dns = __webpack_require__(1037);
  86360. // original function storage
  86361. var EnhanceDns = function (conf) {
  86362. conf = conf || {};
  86363. conf.ttl = parseInt(conf.ttl, 10) || 300; //0 is not allowed ie it ttl is set to 0, it will take the default
  86364. conf.cachesize = parseInt(conf.cachesize, 10); //0 is allowed but it will disable the caching
  86365. if (isNaN(conf.cachesize)) {
  86366. conf.cachesize = 1000; //set default cache size to 1000 records max
  86367. }
  86368. if (!conf.enable || conf.cachesize <= 0 || dns.internalCache) {
  86369. //cache already exists, means this code has already execute ie method are already overwritten
  86370. return dns;
  86371. }
  86372. // original function storage
  86373. var backup_object = {
  86374. lookup : dns.lookup,
  86375. resolve : dns.resolve,
  86376. resolve4 : dns.resolve4,
  86377. resolve6 : dns.resolve6,
  86378. resolveMx : dns.resolveMx,
  86379. resolveTxt : dns.resolveTxt,
  86380. resolveSrv : dns.resolveSrv,
  86381. resolveNs : dns.resolveNs,
  86382. resolveCname : dns.resolveCname,
  86383. reverse : dns.reverse
  86384. },
  86385. // cache storage instance
  86386. cache = conf.cache ? /*istanbul ignore next*/ new conf.cache(conf) : new CacheObject(conf);
  86387. // insert cache object to the instance
  86388. dns.internalCache = cache;
  86389. // override dns.lookup method
  86390. dns.lookup = function (domain, options, callback) {
  86391. var family = 0;
  86392. var hints = 0;
  86393. var all = false;
  86394. if (arguments.length === 2) {
  86395. callback = options;
  86396. options = family;
  86397. } else if (typeof options === 'object') {
  86398. if (options.family) {
  86399. family = +options.family;
  86400. if (family !== 4 && family !== 6) {
  86401. callback(new Error('invalid argument: `family` must be 4 or 6'));
  86402. return;
  86403. }
  86404. }
  86405. /*istanbul ignore next - "hints" require node 0.12+*/
  86406. if (options.hints) {
  86407. hints = +options.hints;
  86408. }
  86409. all = (options.all === true);
  86410. } else if (options) {
  86411. family = +options;
  86412. if (family !== 4 && family !== 6) {
  86413. callback(new Error('invalid argument: `family` must be 4 or 6'));
  86414. return;
  86415. }
  86416. }
  86417. cache.get('lookup_' + domain + '_' + family + '_' + hints + '_' + all, function (error, record) {
  86418. if (record) {
  86419. /*istanbul ignore next - "all" option require node 4+*/
  86420. if (Array.isArray(record)) {
  86421. return callback(error, record);
  86422. }
  86423. return callback(error, record.address, record.family);
  86424. }
  86425. try{
  86426. backup_object.lookup(domain, options, function (err, address, family_r) {
  86427. if (err) {
  86428. return callback(err);
  86429. }
  86430. var value;
  86431. /*istanbul ignore next - "all" option require node 4+*/
  86432. if (Array.isArray(address)) {
  86433. value = address;
  86434. } else {
  86435. value = {
  86436. 'address' : address,
  86437. 'family' : family_r
  86438. };
  86439. }
  86440. cache.set('lookup_' + domain + '_' + family + '_' + hints + '_' + all, value, function () {
  86441. callback(err, address, family_r);
  86442. });
  86443. });
  86444. } catch (err) {
  86445. /*istanbul ignore next - doesn't throw in node 0.10*/
  86446. callback(err);
  86447. }
  86448. });
  86449. };
  86450. // override dns.resolve method
  86451. dns.resolve = function (domain, type, callback) {
  86452. var type_new, callback_new;
  86453. if (typeof type === 'string') {
  86454. type_new = type;
  86455. callback_new = callback;
  86456. } else {
  86457. type_new = "A";
  86458. callback_new = type;
  86459. }
  86460. cache.get('resolve_' + domain + '_' + type_new, function (error, record) {
  86461. if (record) {
  86462. return callback_new(error, deepCopy(record), true);
  86463. }
  86464. try {
  86465. backup_object.resolve(domain, type_new, function (err, addresses) {
  86466. if (err) {
  86467. return callback_new(err);
  86468. }
  86469. cache.set('resolve_' + domain + '_' + type_new, addresses, function () {
  86470. callback_new(err, deepCopy(addresses), false);
  86471. });
  86472. });
  86473. } catch (err) {
  86474. /*istanbul ignore next - doesn't throw in node 0.10*/
  86475. callback_new(err);
  86476. }
  86477. });
  86478. };
  86479. // override dns.resolve4 method
  86480. dns.resolve4 = function (domain, callback) {
  86481. cache.get('resolve4_' + domain, function (error, record) {
  86482. if (record) {
  86483. return callback(error, deepCopy(record));
  86484. }
  86485. try {
  86486. backup_object.resolve4(domain, function (err, addresses) {
  86487. if (err) {
  86488. return callback(err);
  86489. }
  86490. cache.set('resolve4_' + domain, addresses, function () {
  86491. callback(err, deepCopy(addresses));
  86492. });
  86493. });
  86494. } catch (err) {
  86495. /*istanbul ignore next - doesn't throw in node 0.10*/
  86496. callback(err);
  86497. }
  86498. });
  86499. };
  86500. // override dns.resolve6 method
  86501. dns.resolve6 = function (domain, callback) {
  86502. cache.get('resolve6_' + domain, function (error, record) {
  86503. if (record) {
  86504. return callback(error, deepCopy(record));
  86505. }
  86506. try {
  86507. backup_object.resolve6(domain, function (err, addresses) {
  86508. if (err) {
  86509. return callback(err);
  86510. }
  86511. cache.set('resolve6_' + domain, addresses, function () {
  86512. callback(err, deepCopy(addresses));
  86513. });
  86514. });
  86515. } catch (err) {
  86516. /*istanbul ignore next - doesn't throw in node 0.10*/
  86517. callback(err);
  86518. }
  86519. });
  86520. };
  86521. // override dns.resolveMx method
  86522. dns.resolveMx = function (domain, callback) {
  86523. cache.get('resolveMx_' + domain, function (error, record) {
  86524. if (record) {
  86525. return callback(error, deepCopy(record));
  86526. }
  86527. try {
  86528. backup_object.resolveMx(domain, function (err, addresses) {
  86529. if (err) {
  86530. return callback(err);
  86531. }
  86532. cache.set('resolveMx_' + domain, addresses, function () {
  86533. callback(err, deepCopy(addresses));
  86534. });
  86535. });
  86536. } catch (err) {
  86537. /*istanbul ignore next - doesn't throw in node 0.10*/
  86538. callback(err);
  86539. }
  86540. });
  86541. };
  86542. // override dns.resolveTxt method
  86543. dns.resolveTxt = function (domain, callback) {
  86544. cache.get('resolveTxt_' + domain, function (error, record) {
  86545. if (record) {
  86546. return callback(error, deepCopy(record));
  86547. }
  86548. try {
  86549. backup_object.resolveTxt(domain, function (err, addresses) {
  86550. if (err) {
  86551. return callback(err);
  86552. }
  86553. cache.set('resolveTxt_' + domain, addresses, function () {
  86554. callback(err, deepCopy(addresses));
  86555. });
  86556. });
  86557. } catch (err) {
  86558. /*istanbul ignore next - doesn't throw in node 0.10*/
  86559. callback(err);
  86560. }
  86561. });
  86562. };
  86563. // override dns.resolveSrv method
  86564. dns.resolveSrv = function (domain, callback) {
  86565. cache.get('resolveSrv_' + domain, function (error, record) {
  86566. if (record) {
  86567. return callback(error, deepCopy(record));
  86568. }
  86569. try {
  86570. backup_object.resolveSrv(domain, function (err, addresses) {
  86571. if (err) {
  86572. return callback(err);
  86573. }
  86574. cache.set('resolveSrv_' + domain, addresses, function () {
  86575. callback(err, deepCopy(addresses));
  86576. });
  86577. });
  86578. } catch (err) {
  86579. /*istanbul ignore next - doesn't throw in node 0.10*/
  86580. callback(err);
  86581. }
  86582. });
  86583. };
  86584. // override dns.resolveNs method
  86585. dns.resolveNs = function (domain, callback) {
  86586. cache.get('resolveNs_' + domain, function (error, record) {
  86587. if (record) {
  86588. return callback(error, deepCopy(record));
  86589. }
  86590. try {
  86591. backup_object.resolveNs(domain, function (err, addresses) {
  86592. if (err) {
  86593. return callback(err);
  86594. }
  86595. cache.set('resolveNs_' + domain, addresses, function () {
  86596. callback(err, deepCopy(addresses));
  86597. });
  86598. });
  86599. } catch (err) {
  86600. /*istanbul ignore next - doesn't throw in node 0.10*/
  86601. callback(err);
  86602. }
  86603. });
  86604. };
  86605. // override dns.resolveCname method
  86606. dns.resolveCname = function (domain, callback) {
  86607. cache.get('resolveCname_' + domain, function (error, record) {
  86608. if (record) {
  86609. return callback(error, deepCopy(record));
  86610. }
  86611. try {
  86612. backup_object.resolveCname(domain, function (err, addresses) {
  86613. if (err) {
  86614. return callback(err);
  86615. }
  86616. cache.set('resolveCname_' + domain, addresses, function () {
  86617. callback(err, deepCopy(addresses));
  86618. });
  86619. });
  86620. } catch (err) {
  86621. /*istanbul ignore next - doesn't throw in node 0.10*/
  86622. callback(err);
  86623. }
  86624. });
  86625. };
  86626. // override dns.reverse method
  86627. dns.reverse = function (ip, callback) {
  86628. cache.get('reverse_' + ip, function (error, record) {
  86629. if (record) {
  86630. return callback(error, deepCopy(record));
  86631. }
  86632. try {
  86633. backup_object.reverse(ip, function (err, addresses) {
  86634. if (err) {
  86635. return callback(err);
  86636. }
  86637. cache.set('reverse_' + ip, addresses, function () {
  86638. callback(err, deepCopy(addresses));
  86639. });
  86640. });
  86641. } catch (err) {
  86642. /*istanbul ignore next - doesn't throw in node 0.10*/
  86643. callback(err);
  86644. }
  86645. });
  86646. };
  86647. return dns;
  86648. };
  86649. module.exports = function(conf) {
  86650. return new EnhanceDns(conf);
  86651. };
  86652. /***/ }),
  86653. /* 661 */
  86654. /***/ (function(module, exports, __webpack_require__) {
  86655. // Named EC curves
  86656. // Requires ec.js, jsbn.js, and jsbn2.js
  86657. var BigInteger = __webpack_require__(79).BigInteger
  86658. var ECCurveFp = __webpack_require__(130).ECCurveFp
  86659. // ----------------
  86660. // X9ECParameters
  86661. // constructor
  86662. function X9ECParameters(curve,g,n,h) {
  86663. this.curve = curve;
  86664. this.g = g;
  86665. this.n = n;
  86666. this.h = h;
  86667. }
  86668. function x9getCurve() {
  86669. return this.curve;
  86670. }
  86671. function x9getG() {
  86672. return this.g;
  86673. }
  86674. function x9getN() {
  86675. return this.n;
  86676. }
  86677. function x9getH() {
  86678. return this.h;
  86679. }
  86680. X9ECParameters.prototype.getCurve = x9getCurve;
  86681. X9ECParameters.prototype.getG = x9getG;
  86682. X9ECParameters.prototype.getN = x9getN;
  86683. X9ECParameters.prototype.getH = x9getH;
  86684. // ----------------
  86685. // SECNamedCurves
  86686. function fromHex(s) { return new BigInteger(s, 16); }
  86687. function secp128r1() {
  86688. // p = 2^128 - 2^97 - 1
  86689. var p = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF");
  86690. var a = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC");
  86691. var b = fromHex("E87579C11079F43DD824993C2CEE5ED3");
  86692. //byte[] S = Hex.decode("000E0D4D696E6768756151750CC03A4473D03679");
  86693. var n = fromHex("FFFFFFFE0000000075A30D1B9038A115");
  86694. var h = BigInteger.ONE;
  86695. var curve = new ECCurveFp(p, a, b);
  86696. var G = curve.decodePointHex("04"
  86697. + "161FF7528B899B2D0C28607CA52C5B86"
  86698. + "CF5AC8395BAFEB13C02DA292DDED7A83");
  86699. return new X9ECParameters(curve, G, n, h);
  86700. }
  86701. function secp160k1() {
  86702. // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1
  86703. var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73");
  86704. var a = BigInteger.ZERO;
  86705. var b = fromHex("7");
  86706. //byte[] S = null;
  86707. var n = fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3");
  86708. var h = BigInteger.ONE;
  86709. var curve = new ECCurveFp(p, a, b);
  86710. var G = curve.decodePointHex("04"
  86711. + "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB"
  86712. + "938CF935318FDCED6BC28286531733C3F03C4FEE");
  86713. return new X9ECParameters(curve, G, n, h);
  86714. }
  86715. function secp160r1() {
  86716. // p = 2^160 - 2^31 - 1
  86717. var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF");
  86718. var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC");
  86719. var b = fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45");
  86720. //byte[] S = Hex.decode("1053CDE42C14D696E67687561517533BF3F83345");
  86721. var n = fromHex("0100000000000000000001F4C8F927AED3CA752257");
  86722. var h = BigInteger.ONE;
  86723. var curve = new ECCurveFp(p, a, b);
  86724. var G = curve.decodePointHex("04"
  86725. + "4A96B5688EF573284664698968C38BB913CBFC82"
  86726. + "23A628553168947D59DCC912042351377AC5FB32");
  86727. return new X9ECParameters(curve, G, n, h);
  86728. }
  86729. function secp192k1() {
  86730. // p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1
  86731. var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37");
  86732. var a = BigInteger.ZERO;
  86733. var b = fromHex("3");
  86734. //byte[] S = null;
  86735. var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D");
  86736. var h = BigInteger.ONE;
  86737. var curve = new ECCurveFp(p, a, b);
  86738. var G = curve.decodePointHex("04"
  86739. + "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D"
  86740. + "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");
  86741. return new X9ECParameters(curve, G, n, h);
  86742. }
  86743. function secp192r1() {
  86744. // p = 2^192 - 2^64 - 1
  86745. var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF");
  86746. var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC");
  86747. var b = fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1");
  86748. //byte[] S = Hex.decode("3045AE6FC8422F64ED579528D38120EAE12196D5");
  86749. var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831");
  86750. var h = BigInteger.ONE;
  86751. var curve = new ECCurveFp(p, a, b);
  86752. var G = curve.decodePointHex("04"
  86753. + "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012"
  86754. + "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811");
  86755. return new X9ECParameters(curve, G, n, h);
  86756. }
  86757. function secp224r1() {
  86758. // p = 2^224 - 2^96 + 1
  86759. var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001");
  86760. var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE");
  86761. var b = fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4");
  86762. //byte[] S = Hex.decode("BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5");
  86763. var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D");
  86764. var h = BigInteger.ONE;
  86765. var curve = new ECCurveFp(p, a, b);
  86766. var G = curve.decodePointHex("04"
  86767. + "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21"
  86768. + "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");
  86769. return new X9ECParameters(curve, G, n, h);
  86770. }
  86771. function secp256r1() {
  86772. // p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1
  86773. var p = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF");
  86774. var a = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC");
  86775. var b = fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B");
  86776. //byte[] S = Hex.decode("C49D360886E704936A6678E1139D26B7819F7E90");
  86777. var n = fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551");
  86778. var h = BigInteger.ONE;
  86779. var curve = new ECCurveFp(p, a, b);
  86780. var G = curve.decodePointHex("04"
  86781. + "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296"
  86782. + "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");
  86783. return new X9ECParameters(curve, G, n, h);
  86784. }
  86785. // TODO: make this into a proper hashtable
  86786. function getSECCurveByName(name) {
  86787. if(name == "secp128r1") return secp128r1();
  86788. if(name == "secp160k1") return secp160k1();
  86789. if(name == "secp160r1") return secp160r1();
  86790. if(name == "secp192k1") return secp192k1();
  86791. if(name == "secp192r1") return secp192r1();
  86792. if(name == "secp224r1") return secp224r1();
  86793. if(name == "secp256r1") return secp256r1();
  86794. return null;
  86795. }
  86796. module.exports = {
  86797. "secp128r1":secp128r1,
  86798. "secp160k1":secp160k1,
  86799. "secp160r1":secp160r1,
  86800. "secp192k1":secp192k1,
  86801. "secp192r1":secp192r1,
  86802. "secp224r1":secp224r1,
  86803. "secp256r1":secp256r1
  86804. }
  86805. /***/ }),
  86806. /* 662 */
  86807. /***/ (function(module, exports, __webpack_require__) {
  86808. (function webpackUniversalModuleDefinition(root, factory) {
  86809. /* istanbul ignore next */
  86810. if(true)
  86811. module.exports = factory();
  86812. else if(typeof define === 'function' && define.amd)
  86813. define([], factory);
  86814. /* istanbul ignore next */
  86815. else if(typeof exports === 'object')
  86816. exports["esprima"] = factory();
  86817. else
  86818. root["esprima"] = factory();
  86819. })(this, function() {
  86820. return /******/ (function(modules) { // webpackBootstrap
  86821. /******/ // The module cache
  86822. /******/ var installedModules = {};
  86823. /******/ // The require function
  86824. /******/ function __webpack_require__(moduleId) {
  86825. /******/ // Check if module is in cache
  86826. /* istanbul ignore if */
  86827. /******/ if(installedModules[moduleId])
  86828. /******/ return installedModules[moduleId].exports;
  86829. /******/ // Create a new module (and put it into the cache)
  86830. /******/ var module = installedModules[moduleId] = {
  86831. /******/ exports: {},
  86832. /******/ id: moduleId,
  86833. /******/ loaded: false
  86834. /******/ };
  86835. /******/ // Execute the module function
  86836. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  86837. /******/ // Flag the module as loaded
  86838. /******/ module.loaded = true;
  86839. /******/ // Return the exports of the module
  86840. /******/ return module.exports;
  86841. /******/ }
  86842. /******/ // expose the modules object (__webpack_modules__)
  86843. /******/ __webpack_require__.m = modules;
  86844. /******/ // expose the module cache
  86845. /******/ __webpack_require__.c = installedModules;
  86846. /******/ // __webpack_public_path__
  86847. /******/ __webpack_require__.p = "";
  86848. /******/ // Load entry module and return exports
  86849. /******/ return __webpack_require__(0);
  86850. /******/ })
  86851. /************************************************************************/
  86852. /******/ ([
  86853. /* 0 */
  86854. /***/ function(module, exports, __webpack_require__) {
  86855. "use strict";
  86856. /*
  86857. Copyright JS Foundation and other contributors, https://js.foundation/
  86858. Redistribution and use in source and binary forms, with or without
  86859. modification, are permitted provided that the following conditions are met:
  86860. * Redistributions of source code must retain the above copyright
  86861. notice, this list of conditions and the following disclaimer.
  86862. * Redistributions in binary form must reproduce the above copyright
  86863. notice, this list of conditions and the following disclaimer in the
  86864. documentation and/or other materials provided with the distribution.
  86865. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  86866. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  86867. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  86868. ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  86869. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  86870. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  86871. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  86872. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  86873. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  86874. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  86875. */
  86876. Object.defineProperty(exports, "__esModule", { value: true });
  86877. var comment_handler_1 = __webpack_require__(1);
  86878. var jsx_parser_1 = __webpack_require__(3);
  86879. var parser_1 = __webpack_require__(8);
  86880. var tokenizer_1 = __webpack_require__(15);
  86881. function parse(code, options, delegate) {
  86882. var commentHandler = null;
  86883. var proxyDelegate = function (node, metadata) {
  86884. if (delegate) {
  86885. delegate(node, metadata);
  86886. }
  86887. if (commentHandler) {
  86888. commentHandler.visit(node, metadata);
  86889. }
  86890. };
  86891. var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null;
  86892. var collectComment = false;
  86893. if (options) {
  86894. collectComment = (typeof options.comment === 'boolean' && options.comment);
  86895. var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment);
  86896. if (collectComment || attachComment) {
  86897. commentHandler = new comment_handler_1.CommentHandler();
  86898. commentHandler.attach = attachComment;
  86899. options.comment = true;
  86900. parserDelegate = proxyDelegate;
  86901. }
  86902. }
  86903. var isModule = false;
  86904. if (options && typeof options.sourceType === 'string') {
  86905. isModule = (options.sourceType === 'module');
  86906. }
  86907. var parser;
  86908. if (options && typeof options.jsx === 'boolean' && options.jsx) {
  86909. parser = new jsx_parser_1.JSXParser(code, options, parserDelegate);
  86910. }
  86911. else {
  86912. parser = new parser_1.Parser(code, options, parserDelegate);
  86913. }
  86914. var program = isModule ? parser.parseModule() : parser.parseScript();
  86915. var ast = program;
  86916. if (collectComment && commentHandler) {
  86917. ast.comments = commentHandler.comments;
  86918. }
  86919. if (parser.config.tokens) {
  86920. ast.tokens = parser.tokens;
  86921. }
  86922. if (parser.config.tolerant) {
  86923. ast.errors = parser.errorHandler.errors;
  86924. }
  86925. return ast;
  86926. }
  86927. exports.parse = parse;
  86928. function parseModule(code, options, delegate) {
  86929. var parsingOptions = options || {};
  86930. parsingOptions.sourceType = 'module';
  86931. return parse(code, parsingOptions, delegate);
  86932. }
  86933. exports.parseModule = parseModule;
  86934. function parseScript(code, options, delegate) {
  86935. var parsingOptions = options || {};
  86936. parsingOptions.sourceType = 'script';
  86937. return parse(code, parsingOptions, delegate);
  86938. }
  86939. exports.parseScript = parseScript;
  86940. function tokenize(code, options, delegate) {
  86941. var tokenizer = new tokenizer_1.Tokenizer(code, options);
  86942. var tokens;
  86943. tokens = [];
  86944. try {
  86945. while (true) {
  86946. var token = tokenizer.getNextToken();
  86947. if (!token) {
  86948. break;
  86949. }
  86950. if (delegate) {
  86951. token = delegate(token);
  86952. }
  86953. tokens.push(token);
  86954. }
  86955. }
  86956. catch (e) {
  86957. tokenizer.errorHandler.tolerate(e);
  86958. }
  86959. if (tokenizer.errorHandler.tolerant) {
  86960. tokens.errors = tokenizer.errors();
  86961. }
  86962. return tokens;
  86963. }
  86964. exports.tokenize = tokenize;
  86965. var syntax_1 = __webpack_require__(2);
  86966. exports.Syntax = syntax_1.Syntax;
  86967. // Sync with *.json manifests.
  86968. exports.version = '4.0.1';
  86969. /***/ },
  86970. /* 1 */
  86971. /***/ function(module, exports, __webpack_require__) {
  86972. "use strict";
  86973. Object.defineProperty(exports, "__esModule", { value: true });
  86974. var syntax_1 = __webpack_require__(2);
  86975. var CommentHandler = (function () {
  86976. function CommentHandler() {
  86977. this.attach = false;
  86978. this.comments = [];
  86979. this.stack = [];
  86980. this.leading = [];
  86981. this.trailing = [];
  86982. }
  86983. CommentHandler.prototype.insertInnerComments = function (node, metadata) {
  86984. // innnerComments for properties empty block
  86985. // `function a() {/** comments **\/}`
  86986. if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) {
  86987. var innerComments = [];
  86988. for (var i = this.leading.length - 1; i >= 0; --i) {
  86989. var entry = this.leading[i];
  86990. if (metadata.end.offset >= entry.start) {
  86991. innerComments.unshift(entry.comment);
  86992. this.leading.splice(i, 1);
  86993. this.trailing.splice(i, 1);
  86994. }
  86995. }
  86996. if (innerComments.length) {
  86997. node.innerComments = innerComments;
  86998. }
  86999. }
  87000. };
  87001. CommentHandler.prototype.findTrailingComments = function (metadata) {
  87002. var trailingComments = [];
  87003. if (this.trailing.length > 0) {
  87004. for (var i = this.trailing.length - 1; i >= 0; --i) {
  87005. var entry_1 = this.trailing[i];
  87006. if (entry_1.start >= metadata.end.offset) {
  87007. trailingComments.unshift(entry_1.comment);
  87008. }
  87009. }
  87010. this.trailing.length = 0;
  87011. return trailingComments;
  87012. }
  87013. var entry = this.stack[this.stack.length - 1];
  87014. if (entry && entry.node.trailingComments) {
  87015. var firstComment = entry.node.trailingComments[0];
  87016. if (firstComment && firstComment.range[0] >= metadata.end.offset) {
  87017. trailingComments = entry.node.trailingComments;
  87018. delete entry.node.trailingComments;
  87019. }
  87020. }
  87021. return trailingComments;
  87022. };
  87023. CommentHandler.prototype.findLeadingComments = function (metadata) {
  87024. var leadingComments = [];
  87025. var target;
  87026. while (this.stack.length > 0) {
  87027. var entry = this.stack[this.stack.length - 1];
  87028. if (entry && entry.start >= metadata.start.offset) {
  87029. target = entry.node;
  87030. this.stack.pop();
  87031. }
  87032. else {
  87033. break;
  87034. }
  87035. }
  87036. if (target) {
  87037. var count = target.leadingComments ? target.leadingComments.length : 0;
  87038. for (var i = count - 1; i >= 0; --i) {
  87039. var comment = target.leadingComments[i];
  87040. if (comment.range[1] <= metadata.start.offset) {
  87041. leadingComments.unshift(comment);
  87042. target.leadingComments.splice(i, 1);
  87043. }
  87044. }
  87045. if (target.leadingComments && target.leadingComments.length === 0) {
  87046. delete target.leadingComments;
  87047. }
  87048. return leadingComments;
  87049. }
  87050. for (var i = this.leading.length - 1; i >= 0; --i) {
  87051. var entry = this.leading[i];
  87052. if (entry.start <= metadata.start.offset) {
  87053. leadingComments.unshift(entry.comment);
  87054. this.leading.splice(i, 1);
  87055. }
  87056. }
  87057. return leadingComments;
  87058. };
  87059. CommentHandler.prototype.visitNode = function (node, metadata) {
  87060. if (node.type === syntax_1.Syntax.Program && node.body.length > 0) {
  87061. return;
  87062. }
  87063. this.insertInnerComments(node, metadata);
  87064. var trailingComments = this.findTrailingComments(metadata);
  87065. var leadingComments = this.findLeadingComments(metadata);
  87066. if (leadingComments.length > 0) {
  87067. node.leadingComments = leadingComments;
  87068. }
  87069. if (trailingComments.length > 0) {
  87070. node.trailingComments = trailingComments;
  87071. }
  87072. this.stack.push({
  87073. node: node,
  87074. start: metadata.start.offset
  87075. });
  87076. };
  87077. CommentHandler.prototype.visitComment = function (node, metadata) {
  87078. var type = (node.type[0] === 'L') ? 'Line' : 'Block';
  87079. var comment = {
  87080. type: type,
  87081. value: node.value
  87082. };
  87083. if (node.range) {
  87084. comment.range = node.range;
  87085. }
  87086. if (node.loc) {
  87087. comment.loc = node.loc;
  87088. }
  87089. this.comments.push(comment);
  87090. if (this.attach) {
  87091. var entry = {
  87092. comment: {
  87093. type: type,
  87094. value: node.value,
  87095. range: [metadata.start.offset, metadata.end.offset]
  87096. },
  87097. start: metadata.start.offset
  87098. };
  87099. if (node.loc) {
  87100. entry.comment.loc = node.loc;
  87101. }
  87102. node.type = type;
  87103. this.leading.push(entry);
  87104. this.trailing.push(entry);
  87105. }
  87106. };
  87107. CommentHandler.prototype.visit = function (node, metadata) {
  87108. if (node.type === 'LineComment') {
  87109. this.visitComment(node, metadata);
  87110. }
  87111. else if (node.type === 'BlockComment') {
  87112. this.visitComment(node, metadata);
  87113. }
  87114. else if (this.attach) {
  87115. this.visitNode(node, metadata);
  87116. }
  87117. };
  87118. return CommentHandler;
  87119. }());
  87120. exports.CommentHandler = CommentHandler;
  87121. /***/ },
  87122. /* 2 */
  87123. /***/ function(module, exports) {
  87124. "use strict";
  87125. Object.defineProperty(exports, "__esModule", { value: true });
  87126. exports.Syntax = {
  87127. AssignmentExpression: 'AssignmentExpression',
  87128. AssignmentPattern: 'AssignmentPattern',
  87129. ArrayExpression: 'ArrayExpression',
  87130. ArrayPattern: 'ArrayPattern',
  87131. ArrowFunctionExpression: 'ArrowFunctionExpression',
  87132. AwaitExpression: 'AwaitExpression',
  87133. BlockStatement: 'BlockStatement',
  87134. BinaryExpression: 'BinaryExpression',
  87135. BreakStatement: 'BreakStatement',
  87136. CallExpression: 'CallExpression',
  87137. CatchClause: 'CatchClause',
  87138. ClassBody: 'ClassBody',
  87139. ClassDeclaration: 'ClassDeclaration',
  87140. ClassExpression: 'ClassExpression',
  87141. ConditionalExpression: 'ConditionalExpression',
  87142. ContinueStatement: 'ContinueStatement',
  87143. DoWhileStatement: 'DoWhileStatement',
  87144. DebuggerStatement: 'DebuggerStatement',
  87145. EmptyStatement: 'EmptyStatement',
  87146. ExportAllDeclaration: 'ExportAllDeclaration',
  87147. ExportDefaultDeclaration: 'ExportDefaultDeclaration',
  87148. ExportNamedDeclaration: 'ExportNamedDeclaration',
  87149. ExportSpecifier: 'ExportSpecifier',
  87150. ExpressionStatement: 'ExpressionStatement',
  87151. ForStatement: 'ForStatement',
  87152. ForOfStatement: 'ForOfStatement',
  87153. ForInStatement: 'ForInStatement',
  87154. FunctionDeclaration: 'FunctionDeclaration',
  87155. FunctionExpression: 'FunctionExpression',
  87156. Identifier: 'Identifier',
  87157. IfStatement: 'IfStatement',
  87158. ImportDeclaration: 'ImportDeclaration',
  87159. ImportDefaultSpecifier: 'ImportDefaultSpecifier',
  87160. ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
  87161. ImportSpecifier: 'ImportSpecifier',
  87162. Literal: 'Literal',
  87163. LabeledStatement: 'LabeledStatement',
  87164. LogicalExpression: 'LogicalExpression',
  87165. MemberExpression: 'MemberExpression',
  87166. MetaProperty: 'MetaProperty',
  87167. MethodDefinition: 'MethodDefinition',
  87168. NewExpression: 'NewExpression',
  87169. ObjectExpression: 'ObjectExpression',
  87170. ObjectPattern: 'ObjectPattern',
  87171. Program: 'Program',
  87172. Property: 'Property',
  87173. RestElement: 'RestElement',
  87174. ReturnStatement: 'ReturnStatement',
  87175. SequenceExpression: 'SequenceExpression',
  87176. SpreadElement: 'SpreadElement',
  87177. Super: 'Super',
  87178. SwitchCase: 'SwitchCase',
  87179. SwitchStatement: 'SwitchStatement',
  87180. TaggedTemplateExpression: 'TaggedTemplateExpression',
  87181. TemplateElement: 'TemplateElement',
  87182. TemplateLiteral: 'TemplateLiteral',
  87183. ThisExpression: 'ThisExpression',
  87184. ThrowStatement: 'ThrowStatement',
  87185. TryStatement: 'TryStatement',
  87186. UnaryExpression: 'UnaryExpression',
  87187. UpdateExpression: 'UpdateExpression',
  87188. VariableDeclaration: 'VariableDeclaration',
  87189. VariableDeclarator: 'VariableDeclarator',
  87190. WhileStatement: 'WhileStatement',
  87191. WithStatement: 'WithStatement',
  87192. YieldExpression: 'YieldExpression'
  87193. };
  87194. /***/ },
  87195. /* 3 */
  87196. /***/ function(module, exports, __webpack_require__) {
  87197. "use strict";
  87198. /* istanbul ignore next */
  87199. var __extends = (this && this.__extends) || (function () {
  87200. var extendStatics = Object.setPrototypeOf ||
  87201. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  87202. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  87203. return function (d, b) {
  87204. extendStatics(d, b);
  87205. function __() { this.constructor = d; }
  87206. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  87207. };
  87208. })();
  87209. Object.defineProperty(exports, "__esModule", { value: true });
  87210. var character_1 = __webpack_require__(4);
  87211. var JSXNode = __webpack_require__(5);
  87212. var jsx_syntax_1 = __webpack_require__(6);
  87213. var Node = __webpack_require__(7);
  87214. var parser_1 = __webpack_require__(8);
  87215. var token_1 = __webpack_require__(13);
  87216. var xhtml_entities_1 = __webpack_require__(14);
  87217. token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier';
  87218. token_1.TokenName[101 /* Text */] = 'JSXText';
  87219. // Fully qualified element name, e.g. <svg:path> returns "svg:path"
  87220. function getQualifiedElementName(elementName) {
  87221. var qualifiedName;
  87222. switch (elementName.type) {
  87223. case jsx_syntax_1.JSXSyntax.JSXIdentifier:
  87224. var id = elementName;
  87225. qualifiedName = id.name;
  87226. break;
  87227. case jsx_syntax_1.JSXSyntax.JSXNamespacedName:
  87228. var ns = elementName;
  87229. qualifiedName = getQualifiedElementName(ns.namespace) + ':' +
  87230. getQualifiedElementName(ns.name);
  87231. break;
  87232. case jsx_syntax_1.JSXSyntax.JSXMemberExpression:
  87233. var expr = elementName;
  87234. qualifiedName = getQualifiedElementName(expr.object) + '.' +
  87235. getQualifiedElementName(expr.property);
  87236. break;
  87237. /* istanbul ignore next */
  87238. default:
  87239. break;
  87240. }
  87241. return qualifiedName;
  87242. }
  87243. var JSXParser = (function (_super) {
  87244. __extends(JSXParser, _super);
  87245. function JSXParser(code, options, delegate) {
  87246. return _super.call(this, code, options, delegate) || this;
  87247. }
  87248. JSXParser.prototype.parsePrimaryExpression = function () {
  87249. return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this);
  87250. };
  87251. JSXParser.prototype.startJSX = function () {
  87252. // Unwind the scanner before the lookahead token.
  87253. this.scanner.index = this.startMarker.index;
  87254. this.scanner.lineNumber = this.startMarker.line;
  87255. this.scanner.lineStart = this.startMarker.index - this.startMarker.column;
  87256. };
  87257. JSXParser.prototype.finishJSX = function () {
  87258. // Prime the next lookahead.
  87259. this.nextToken();
  87260. };
  87261. JSXParser.prototype.reenterJSX = function () {
  87262. this.startJSX();
  87263. this.expectJSX('}');
  87264. // Pop the closing '}' added from the lookahead.
  87265. if (this.config.tokens) {
  87266. this.tokens.pop();
  87267. }
  87268. };
  87269. JSXParser.prototype.createJSXNode = function () {
  87270. this.collectComments();
  87271. return {
  87272. index: this.scanner.index,
  87273. line: this.scanner.lineNumber,
  87274. column: this.scanner.index - this.scanner.lineStart
  87275. };
  87276. };
  87277. JSXParser.prototype.createJSXChildNode = function () {
  87278. return {
  87279. index: this.scanner.index,
  87280. line: this.scanner.lineNumber,
  87281. column: this.scanner.index - this.scanner.lineStart
  87282. };
  87283. };
  87284. JSXParser.prototype.scanXHTMLEntity = function (quote) {
  87285. var result = '&';
  87286. var valid = true;
  87287. var terminated = false;
  87288. var numeric = false;
  87289. var hex = false;
  87290. while (!this.scanner.eof() && valid && !terminated) {
  87291. var ch = this.scanner.source[this.scanner.index];
  87292. if (ch === quote) {
  87293. break;
  87294. }
  87295. terminated = (ch === ';');
  87296. result += ch;
  87297. ++this.scanner.index;
  87298. if (!terminated) {
  87299. switch (result.length) {
  87300. case 2:
  87301. // e.g. '&#123;'
  87302. numeric = (ch === '#');
  87303. break;
  87304. case 3:
  87305. if (numeric) {
  87306. // e.g. '&#x41;'
  87307. hex = (ch === 'x');
  87308. valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0));
  87309. numeric = numeric && !hex;
  87310. }
  87311. break;
  87312. default:
  87313. valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0)));
  87314. valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0)));
  87315. break;
  87316. }
  87317. }
  87318. }
  87319. if (valid && terminated && result.length > 2) {
  87320. // e.g. '&#x41;' becomes just '#x41'
  87321. var str = result.substr(1, result.length - 2);
  87322. if (numeric && str.length > 1) {
  87323. result = String.fromCharCode(parseInt(str.substr(1), 10));
  87324. }
  87325. else if (hex && str.length > 2) {
  87326. result = String.fromCharCode(parseInt('0' + str.substr(1), 16));
  87327. }
  87328. else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) {
  87329. result = xhtml_entities_1.XHTMLEntities[str];
  87330. }
  87331. }
  87332. return result;
  87333. };
  87334. // Scan the next JSX token. This replaces Scanner#lex when in JSX mode.
  87335. JSXParser.prototype.lexJSX = function () {
  87336. var cp = this.scanner.source.charCodeAt(this.scanner.index);
  87337. // < > / : = { }
  87338. if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) {
  87339. var value = this.scanner.source[this.scanner.index++];
  87340. return {
  87341. type: 7 /* Punctuator */,
  87342. value: value,
  87343. lineNumber: this.scanner.lineNumber,
  87344. lineStart: this.scanner.lineStart,
  87345. start: this.scanner.index - 1,
  87346. end: this.scanner.index
  87347. };
  87348. }
  87349. // " '
  87350. if (cp === 34 || cp === 39) {
  87351. var start = this.scanner.index;
  87352. var quote = this.scanner.source[this.scanner.index++];
  87353. var str = '';
  87354. while (!this.scanner.eof()) {
  87355. var ch = this.scanner.source[this.scanner.index++];
  87356. if (ch === quote) {
  87357. break;
  87358. }
  87359. else if (ch === '&') {
  87360. str += this.scanXHTMLEntity(quote);
  87361. }
  87362. else {
  87363. str += ch;
  87364. }
  87365. }
  87366. return {
  87367. type: 8 /* StringLiteral */,
  87368. value: str,
  87369. lineNumber: this.scanner.lineNumber,
  87370. lineStart: this.scanner.lineStart,
  87371. start: start,
  87372. end: this.scanner.index
  87373. };
  87374. }
  87375. // ... or .
  87376. if (cp === 46) {
  87377. var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1);
  87378. var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2);
  87379. var value = (n1 === 46 && n2 === 46) ? '...' : '.';
  87380. var start = this.scanner.index;
  87381. this.scanner.index += value.length;
  87382. return {
  87383. type: 7 /* Punctuator */,
  87384. value: value,
  87385. lineNumber: this.scanner.lineNumber,
  87386. lineStart: this.scanner.lineStart,
  87387. start: start,
  87388. end: this.scanner.index
  87389. };
  87390. }
  87391. // `
  87392. if (cp === 96) {
  87393. // Only placeholder, since it will be rescanned as a real assignment expression.
  87394. return {
  87395. type: 10 /* Template */,
  87396. value: '',
  87397. lineNumber: this.scanner.lineNumber,
  87398. lineStart: this.scanner.lineStart,
  87399. start: this.scanner.index,
  87400. end: this.scanner.index
  87401. };
  87402. }
  87403. // Identifer can not contain backslash (char code 92).
  87404. if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) {
  87405. var start = this.scanner.index;
  87406. ++this.scanner.index;
  87407. while (!this.scanner.eof()) {
  87408. var ch = this.scanner.source.charCodeAt(this.scanner.index);
  87409. if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) {
  87410. ++this.scanner.index;
  87411. }
  87412. else if (ch === 45) {
  87413. // Hyphen (char code 45) can be part of an identifier.
  87414. ++this.scanner.index;
  87415. }
  87416. else {
  87417. break;
  87418. }
  87419. }
  87420. var id = this.scanner.source.slice(start, this.scanner.index);
  87421. return {
  87422. type: 100 /* Identifier */,
  87423. value: id,
  87424. lineNumber: this.scanner.lineNumber,
  87425. lineStart: this.scanner.lineStart,
  87426. start: start,
  87427. end: this.scanner.index
  87428. };
  87429. }
  87430. return this.scanner.lex();
  87431. };
  87432. JSXParser.prototype.nextJSXToken = function () {
  87433. this.collectComments();
  87434. this.startMarker.index = this.scanner.index;
  87435. this.startMarker.line = this.scanner.lineNumber;
  87436. this.startMarker.column = this.scanner.index - this.scanner.lineStart;
  87437. var token = this.lexJSX();
  87438. this.lastMarker.index = this.scanner.index;
  87439. this.lastMarker.line = this.scanner.lineNumber;
  87440. this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
  87441. if (this.config.tokens) {
  87442. this.tokens.push(this.convertToken(token));
  87443. }
  87444. return token;
  87445. };
  87446. JSXParser.prototype.nextJSXText = function () {
  87447. this.startMarker.index = this.scanner.index;
  87448. this.startMarker.line = this.scanner.lineNumber;
  87449. this.startMarker.column = this.scanner.index - this.scanner.lineStart;
  87450. var start = this.scanner.index;
  87451. var text = '';
  87452. while (!this.scanner.eof()) {
  87453. var ch = this.scanner.source[this.scanner.index];
  87454. if (ch === '{' || ch === '<') {
  87455. break;
  87456. }
  87457. ++this.scanner.index;
  87458. text += ch;
  87459. if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  87460. ++this.scanner.lineNumber;
  87461. if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') {
  87462. ++this.scanner.index;
  87463. }
  87464. this.scanner.lineStart = this.scanner.index;
  87465. }
  87466. }
  87467. this.lastMarker.index = this.scanner.index;
  87468. this.lastMarker.line = this.scanner.lineNumber;
  87469. this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
  87470. var token = {
  87471. type: 101 /* Text */,
  87472. value: text,
  87473. lineNumber: this.scanner.lineNumber,
  87474. lineStart: this.scanner.lineStart,
  87475. start: start,
  87476. end: this.scanner.index
  87477. };
  87478. if ((text.length > 0) && this.config.tokens) {
  87479. this.tokens.push(this.convertToken(token));
  87480. }
  87481. return token;
  87482. };
  87483. JSXParser.prototype.peekJSXToken = function () {
  87484. var state = this.scanner.saveState();
  87485. this.scanner.scanComments();
  87486. var next = this.lexJSX();
  87487. this.scanner.restoreState(state);
  87488. return next;
  87489. };
  87490. // Expect the next JSX token to match the specified punctuator.
  87491. // If not, an exception will be thrown.
  87492. JSXParser.prototype.expectJSX = function (value) {
  87493. var token = this.nextJSXToken();
  87494. if (token.type !== 7 /* Punctuator */ || token.value !== value) {
  87495. this.throwUnexpectedToken(token);
  87496. }
  87497. };
  87498. // Return true if the next JSX token matches the specified punctuator.
  87499. JSXParser.prototype.matchJSX = function (value) {
  87500. var next = this.peekJSXToken();
  87501. return next.type === 7 /* Punctuator */ && next.value === value;
  87502. };
  87503. JSXParser.prototype.parseJSXIdentifier = function () {
  87504. var node = this.createJSXNode();
  87505. var token = this.nextJSXToken();
  87506. if (token.type !== 100 /* Identifier */) {
  87507. this.throwUnexpectedToken(token);
  87508. }
  87509. return this.finalize(node, new JSXNode.JSXIdentifier(token.value));
  87510. };
  87511. JSXParser.prototype.parseJSXElementName = function () {
  87512. var node = this.createJSXNode();
  87513. var elementName = this.parseJSXIdentifier();
  87514. if (this.matchJSX(':')) {
  87515. var namespace = elementName;
  87516. this.expectJSX(':');
  87517. var name_1 = this.parseJSXIdentifier();
  87518. elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1));
  87519. }
  87520. else if (this.matchJSX('.')) {
  87521. while (this.matchJSX('.')) {
  87522. var object = elementName;
  87523. this.expectJSX('.');
  87524. var property = this.parseJSXIdentifier();
  87525. elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property));
  87526. }
  87527. }
  87528. return elementName;
  87529. };
  87530. JSXParser.prototype.parseJSXAttributeName = function () {
  87531. var node = this.createJSXNode();
  87532. var attributeName;
  87533. var identifier = this.parseJSXIdentifier();
  87534. if (this.matchJSX(':')) {
  87535. var namespace = identifier;
  87536. this.expectJSX(':');
  87537. var name_2 = this.parseJSXIdentifier();
  87538. attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2));
  87539. }
  87540. else {
  87541. attributeName = identifier;
  87542. }
  87543. return attributeName;
  87544. };
  87545. JSXParser.prototype.parseJSXStringLiteralAttribute = function () {
  87546. var node = this.createJSXNode();
  87547. var token = this.nextJSXToken();
  87548. if (token.type !== 8 /* StringLiteral */) {
  87549. this.throwUnexpectedToken(token);
  87550. }
  87551. var raw = this.getTokenRaw(token);
  87552. return this.finalize(node, new Node.Literal(token.value, raw));
  87553. };
  87554. JSXParser.prototype.parseJSXExpressionAttribute = function () {
  87555. var node = this.createJSXNode();
  87556. this.expectJSX('{');
  87557. this.finishJSX();
  87558. if (this.match('}')) {
  87559. this.tolerateError('JSX attributes must only be assigned a non-empty expression');
  87560. }
  87561. var expression = this.parseAssignmentExpression();
  87562. this.reenterJSX();
  87563. return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
  87564. };
  87565. JSXParser.prototype.parseJSXAttributeValue = function () {
  87566. return this.matchJSX('{') ? this.parseJSXExpressionAttribute() :
  87567. this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute();
  87568. };
  87569. JSXParser.prototype.parseJSXNameValueAttribute = function () {
  87570. var node = this.createJSXNode();
  87571. var name = this.parseJSXAttributeName();
  87572. var value = null;
  87573. if (this.matchJSX('=')) {
  87574. this.expectJSX('=');
  87575. value = this.parseJSXAttributeValue();
  87576. }
  87577. return this.finalize(node, new JSXNode.JSXAttribute(name, value));
  87578. };
  87579. JSXParser.prototype.parseJSXSpreadAttribute = function () {
  87580. var node = this.createJSXNode();
  87581. this.expectJSX('{');
  87582. this.expectJSX('...');
  87583. this.finishJSX();
  87584. var argument = this.parseAssignmentExpression();
  87585. this.reenterJSX();
  87586. return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument));
  87587. };
  87588. JSXParser.prototype.parseJSXAttributes = function () {
  87589. var attributes = [];
  87590. while (!this.matchJSX('/') && !this.matchJSX('>')) {
  87591. var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() :
  87592. this.parseJSXNameValueAttribute();
  87593. attributes.push(attribute);
  87594. }
  87595. return attributes;
  87596. };
  87597. JSXParser.prototype.parseJSXOpeningElement = function () {
  87598. var node = this.createJSXNode();
  87599. this.expectJSX('<');
  87600. var name = this.parseJSXElementName();
  87601. var attributes = this.parseJSXAttributes();
  87602. var selfClosing = this.matchJSX('/');
  87603. if (selfClosing) {
  87604. this.expectJSX('/');
  87605. }
  87606. this.expectJSX('>');
  87607. return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
  87608. };
  87609. JSXParser.prototype.parseJSXBoundaryElement = function () {
  87610. var node = this.createJSXNode();
  87611. this.expectJSX('<');
  87612. if (this.matchJSX('/')) {
  87613. this.expectJSX('/');
  87614. var name_3 = this.parseJSXElementName();
  87615. this.expectJSX('>');
  87616. return this.finalize(node, new JSXNode.JSXClosingElement(name_3));
  87617. }
  87618. var name = this.parseJSXElementName();
  87619. var attributes = this.parseJSXAttributes();
  87620. var selfClosing = this.matchJSX('/');
  87621. if (selfClosing) {
  87622. this.expectJSX('/');
  87623. }
  87624. this.expectJSX('>');
  87625. return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
  87626. };
  87627. JSXParser.prototype.parseJSXEmptyExpression = function () {
  87628. var node = this.createJSXChildNode();
  87629. this.collectComments();
  87630. this.lastMarker.index = this.scanner.index;
  87631. this.lastMarker.line = this.scanner.lineNumber;
  87632. this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
  87633. return this.finalize(node, new JSXNode.JSXEmptyExpression());
  87634. };
  87635. JSXParser.prototype.parseJSXExpressionContainer = function () {
  87636. var node = this.createJSXNode();
  87637. this.expectJSX('{');
  87638. var expression;
  87639. if (this.matchJSX('}')) {
  87640. expression = this.parseJSXEmptyExpression();
  87641. this.expectJSX('}');
  87642. }
  87643. else {
  87644. this.finishJSX();
  87645. expression = this.parseAssignmentExpression();
  87646. this.reenterJSX();
  87647. }
  87648. return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
  87649. };
  87650. JSXParser.prototype.parseJSXChildren = function () {
  87651. var children = [];
  87652. while (!this.scanner.eof()) {
  87653. var node = this.createJSXChildNode();
  87654. var token = this.nextJSXText();
  87655. if (token.start < token.end) {
  87656. var raw = this.getTokenRaw(token);
  87657. var child = this.finalize(node, new JSXNode.JSXText(token.value, raw));
  87658. children.push(child);
  87659. }
  87660. if (this.scanner.source[this.scanner.index] === '{') {
  87661. var container = this.parseJSXExpressionContainer();
  87662. children.push(container);
  87663. }
  87664. else {
  87665. break;
  87666. }
  87667. }
  87668. return children;
  87669. };
  87670. JSXParser.prototype.parseComplexJSXElement = function (el) {
  87671. var stack = [];
  87672. while (!this.scanner.eof()) {
  87673. el.children = el.children.concat(this.parseJSXChildren());
  87674. var node = this.createJSXChildNode();
  87675. var element = this.parseJSXBoundaryElement();
  87676. if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) {
  87677. var opening = element;
  87678. if (opening.selfClosing) {
  87679. var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null));
  87680. el.children.push(child);
  87681. }
  87682. else {
  87683. stack.push(el);
  87684. el = { node: node, opening: opening, closing: null, children: [] };
  87685. }
  87686. }
  87687. if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) {
  87688. el.closing = element;
  87689. var open_1 = getQualifiedElementName(el.opening.name);
  87690. var close_1 = getQualifiedElementName(el.closing.name);
  87691. if (open_1 !== close_1) {
  87692. this.tolerateError('Expected corresponding JSX closing tag for %0', open_1);
  87693. }
  87694. if (stack.length > 0) {
  87695. var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing));
  87696. el = stack[stack.length - 1];
  87697. el.children.push(child);
  87698. stack.pop();
  87699. }
  87700. else {
  87701. break;
  87702. }
  87703. }
  87704. }
  87705. return el;
  87706. };
  87707. JSXParser.prototype.parseJSXElement = function () {
  87708. var node = this.createJSXNode();
  87709. var opening = this.parseJSXOpeningElement();
  87710. var children = [];
  87711. var closing = null;
  87712. if (!opening.selfClosing) {
  87713. var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children });
  87714. children = el.children;
  87715. closing = el.closing;
  87716. }
  87717. return this.finalize(node, new JSXNode.JSXElement(opening, children, closing));
  87718. };
  87719. JSXParser.prototype.parseJSXRoot = function () {
  87720. // Pop the opening '<' added from the lookahead.
  87721. if (this.config.tokens) {
  87722. this.tokens.pop();
  87723. }
  87724. this.startJSX();
  87725. var element = this.parseJSXElement();
  87726. this.finishJSX();
  87727. return element;
  87728. };
  87729. JSXParser.prototype.isStartOfExpression = function () {
  87730. return _super.prototype.isStartOfExpression.call(this) || this.match('<');
  87731. };
  87732. return JSXParser;
  87733. }(parser_1.Parser));
  87734. exports.JSXParser = JSXParser;
  87735. /***/ },
  87736. /* 4 */
  87737. /***/ function(module, exports) {
  87738. "use strict";
  87739. Object.defineProperty(exports, "__esModule", { value: true });
  87740. // See also tools/generate-unicode-regex.js.
  87741. var Regex = {
  87742. // Unicode v8.0.0 NonAsciiIdentifierStart:
  87743. NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
  87744. // Unicode v8.0.0 NonAsciiIdentifierPart:
  87745. NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
  87746. };
  87747. exports.Character = {
  87748. /* tslint:disable:no-bitwise */
  87749. fromCodePoint: function (cp) {
  87750. return (cp < 0x10000) ? String.fromCharCode(cp) :
  87751. String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +
  87752. String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
  87753. },
  87754. // https://tc39.github.io/ecma262/#sec-white-space
  87755. isWhiteSpace: function (cp) {
  87756. return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) ||
  87757. (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0);
  87758. },
  87759. // https://tc39.github.io/ecma262/#sec-line-terminators
  87760. isLineTerminator: function (cp) {
  87761. return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029);
  87762. },
  87763. // https://tc39.github.io/ecma262/#sec-names-and-keywords
  87764. isIdentifierStart: function (cp) {
  87765. return (cp === 0x24) || (cp === 0x5F) ||
  87766. (cp >= 0x41 && cp <= 0x5A) ||
  87767. (cp >= 0x61 && cp <= 0x7A) ||
  87768. (cp === 0x5C) ||
  87769. ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp)));
  87770. },
  87771. isIdentifierPart: function (cp) {
  87772. return (cp === 0x24) || (cp === 0x5F) ||
  87773. (cp >= 0x41 && cp <= 0x5A) ||
  87774. (cp >= 0x61 && cp <= 0x7A) ||
  87775. (cp >= 0x30 && cp <= 0x39) ||
  87776. (cp === 0x5C) ||
  87777. ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp)));
  87778. },
  87779. // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
  87780. isDecimalDigit: function (cp) {
  87781. return (cp >= 0x30 && cp <= 0x39); // 0..9
  87782. },
  87783. isHexDigit: function (cp) {
  87784. return (cp >= 0x30 && cp <= 0x39) ||
  87785. (cp >= 0x41 && cp <= 0x46) ||
  87786. (cp >= 0x61 && cp <= 0x66); // a..f
  87787. },
  87788. isOctalDigit: function (cp) {
  87789. return (cp >= 0x30 && cp <= 0x37); // 0..7
  87790. }
  87791. };
  87792. /***/ },
  87793. /* 5 */
  87794. /***/ function(module, exports, __webpack_require__) {
  87795. "use strict";
  87796. Object.defineProperty(exports, "__esModule", { value: true });
  87797. var jsx_syntax_1 = __webpack_require__(6);
  87798. /* tslint:disable:max-classes-per-file */
  87799. var JSXClosingElement = (function () {
  87800. function JSXClosingElement(name) {
  87801. this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
  87802. this.name = name;
  87803. }
  87804. return JSXClosingElement;
  87805. }());
  87806. exports.JSXClosingElement = JSXClosingElement;
  87807. var JSXElement = (function () {
  87808. function JSXElement(openingElement, children, closingElement) {
  87809. this.type = jsx_syntax_1.JSXSyntax.JSXElement;
  87810. this.openingElement = openingElement;
  87811. this.children = children;
  87812. this.closingElement = closingElement;
  87813. }
  87814. return JSXElement;
  87815. }());
  87816. exports.JSXElement = JSXElement;
  87817. var JSXEmptyExpression = (function () {
  87818. function JSXEmptyExpression() {
  87819. this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression;
  87820. }
  87821. return JSXEmptyExpression;
  87822. }());
  87823. exports.JSXEmptyExpression = JSXEmptyExpression;
  87824. var JSXExpressionContainer = (function () {
  87825. function JSXExpressionContainer(expression) {
  87826. this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer;
  87827. this.expression = expression;
  87828. }
  87829. return JSXExpressionContainer;
  87830. }());
  87831. exports.JSXExpressionContainer = JSXExpressionContainer;
  87832. var JSXIdentifier = (function () {
  87833. function JSXIdentifier(name) {
  87834. this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
  87835. this.name = name;
  87836. }
  87837. return JSXIdentifier;
  87838. }());
  87839. exports.JSXIdentifier = JSXIdentifier;
  87840. var JSXMemberExpression = (function () {
  87841. function JSXMemberExpression(object, property) {
  87842. this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression;
  87843. this.object = object;
  87844. this.property = property;
  87845. }
  87846. return JSXMemberExpression;
  87847. }());
  87848. exports.JSXMemberExpression = JSXMemberExpression;
  87849. var JSXAttribute = (function () {
  87850. function JSXAttribute(name, value) {
  87851. this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
  87852. this.name = name;
  87853. this.value = value;
  87854. }
  87855. return JSXAttribute;
  87856. }());
  87857. exports.JSXAttribute = JSXAttribute;
  87858. var JSXNamespacedName = (function () {
  87859. function JSXNamespacedName(namespace, name) {
  87860. this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
  87861. this.namespace = namespace;
  87862. this.name = name;
  87863. }
  87864. return JSXNamespacedName;
  87865. }());
  87866. exports.JSXNamespacedName = JSXNamespacedName;
  87867. var JSXOpeningElement = (function () {
  87868. function JSXOpeningElement(name, selfClosing, attributes) {
  87869. this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
  87870. this.name = name;
  87871. this.selfClosing = selfClosing;
  87872. this.attributes = attributes;
  87873. }
  87874. return JSXOpeningElement;
  87875. }());
  87876. exports.JSXOpeningElement = JSXOpeningElement;
  87877. var JSXSpreadAttribute = (function () {
  87878. function JSXSpreadAttribute(argument) {
  87879. this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute;
  87880. this.argument = argument;
  87881. }
  87882. return JSXSpreadAttribute;
  87883. }());
  87884. exports.JSXSpreadAttribute = JSXSpreadAttribute;
  87885. var JSXText = (function () {
  87886. function JSXText(value, raw) {
  87887. this.type = jsx_syntax_1.JSXSyntax.JSXText;
  87888. this.value = value;
  87889. this.raw = raw;
  87890. }
  87891. return JSXText;
  87892. }());
  87893. exports.JSXText = JSXText;
  87894. /***/ },
  87895. /* 6 */
  87896. /***/ function(module, exports) {
  87897. "use strict";
  87898. Object.defineProperty(exports, "__esModule", { value: true });
  87899. exports.JSXSyntax = {
  87900. JSXAttribute: 'JSXAttribute',
  87901. JSXClosingElement: 'JSXClosingElement',
  87902. JSXElement: 'JSXElement',
  87903. JSXEmptyExpression: 'JSXEmptyExpression',
  87904. JSXExpressionContainer: 'JSXExpressionContainer',
  87905. JSXIdentifier: 'JSXIdentifier',
  87906. JSXMemberExpression: 'JSXMemberExpression',
  87907. JSXNamespacedName: 'JSXNamespacedName',
  87908. JSXOpeningElement: 'JSXOpeningElement',
  87909. JSXSpreadAttribute: 'JSXSpreadAttribute',
  87910. JSXText: 'JSXText'
  87911. };
  87912. /***/ },
  87913. /* 7 */
  87914. /***/ function(module, exports, __webpack_require__) {
  87915. "use strict";
  87916. Object.defineProperty(exports, "__esModule", { value: true });
  87917. var syntax_1 = __webpack_require__(2);
  87918. /* tslint:disable:max-classes-per-file */
  87919. var ArrayExpression = (function () {
  87920. function ArrayExpression(elements) {
  87921. this.type = syntax_1.Syntax.ArrayExpression;
  87922. this.elements = elements;
  87923. }
  87924. return ArrayExpression;
  87925. }());
  87926. exports.ArrayExpression = ArrayExpression;
  87927. var ArrayPattern = (function () {
  87928. function ArrayPattern(elements) {
  87929. this.type = syntax_1.Syntax.ArrayPattern;
  87930. this.elements = elements;
  87931. }
  87932. return ArrayPattern;
  87933. }());
  87934. exports.ArrayPattern = ArrayPattern;
  87935. var ArrowFunctionExpression = (function () {
  87936. function ArrowFunctionExpression(params, body, expression) {
  87937. this.type = syntax_1.Syntax.ArrowFunctionExpression;
  87938. this.id = null;
  87939. this.params = params;
  87940. this.body = body;
  87941. this.generator = false;
  87942. this.expression = expression;
  87943. this.async = false;
  87944. }
  87945. return ArrowFunctionExpression;
  87946. }());
  87947. exports.ArrowFunctionExpression = ArrowFunctionExpression;
  87948. var AssignmentExpression = (function () {
  87949. function AssignmentExpression(operator, left, right) {
  87950. this.type = syntax_1.Syntax.AssignmentExpression;
  87951. this.operator = operator;
  87952. this.left = left;
  87953. this.right = right;
  87954. }
  87955. return AssignmentExpression;
  87956. }());
  87957. exports.AssignmentExpression = AssignmentExpression;
  87958. var AssignmentPattern = (function () {
  87959. function AssignmentPattern(left, right) {
  87960. this.type = syntax_1.Syntax.AssignmentPattern;
  87961. this.left = left;
  87962. this.right = right;
  87963. }
  87964. return AssignmentPattern;
  87965. }());
  87966. exports.AssignmentPattern = AssignmentPattern;
  87967. var AsyncArrowFunctionExpression = (function () {
  87968. function AsyncArrowFunctionExpression(params, body, expression) {
  87969. this.type = syntax_1.Syntax.ArrowFunctionExpression;
  87970. this.id = null;
  87971. this.params = params;
  87972. this.body = body;
  87973. this.generator = false;
  87974. this.expression = expression;
  87975. this.async = true;
  87976. }
  87977. return AsyncArrowFunctionExpression;
  87978. }());
  87979. exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression;
  87980. var AsyncFunctionDeclaration = (function () {
  87981. function AsyncFunctionDeclaration(id, params, body) {
  87982. this.type = syntax_1.Syntax.FunctionDeclaration;
  87983. this.id = id;
  87984. this.params = params;
  87985. this.body = body;
  87986. this.generator = false;
  87987. this.expression = false;
  87988. this.async = true;
  87989. }
  87990. return AsyncFunctionDeclaration;
  87991. }());
  87992. exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration;
  87993. var AsyncFunctionExpression = (function () {
  87994. function AsyncFunctionExpression(id, params, body) {
  87995. this.type = syntax_1.Syntax.FunctionExpression;
  87996. this.id = id;
  87997. this.params = params;
  87998. this.body = body;
  87999. this.generator = false;
  88000. this.expression = false;
  88001. this.async = true;
  88002. }
  88003. return AsyncFunctionExpression;
  88004. }());
  88005. exports.AsyncFunctionExpression = AsyncFunctionExpression;
  88006. var AwaitExpression = (function () {
  88007. function AwaitExpression(argument) {
  88008. this.type = syntax_1.Syntax.AwaitExpression;
  88009. this.argument = argument;
  88010. }
  88011. return AwaitExpression;
  88012. }());
  88013. exports.AwaitExpression = AwaitExpression;
  88014. var BinaryExpression = (function () {
  88015. function BinaryExpression(operator, left, right) {
  88016. var logical = (operator === '||' || operator === '&&');
  88017. this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression;
  88018. this.operator = operator;
  88019. this.left = left;
  88020. this.right = right;
  88021. }
  88022. return BinaryExpression;
  88023. }());
  88024. exports.BinaryExpression = BinaryExpression;
  88025. var BlockStatement = (function () {
  88026. function BlockStatement(body) {
  88027. this.type = syntax_1.Syntax.BlockStatement;
  88028. this.body = body;
  88029. }
  88030. return BlockStatement;
  88031. }());
  88032. exports.BlockStatement = BlockStatement;
  88033. var BreakStatement = (function () {
  88034. function BreakStatement(label) {
  88035. this.type = syntax_1.Syntax.BreakStatement;
  88036. this.label = label;
  88037. }
  88038. return BreakStatement;
  88039. }());
  88040. exports.BreakStatement = BreakStatement;
  88041. var CallExpression = (function () {
  88042. function CallExpression(callee, args) {
  88043. this.type = syntax_1.Syntax.CallExpression;
  88044. this.callee = callee;
  88045. this.arguments = args;
  88046. }
  88047. return CallExpression;
  88048. }());
  88049. exports.CallExpression = CallExpression;
  88050. var CatchClause = (function () {
  88051. function CatchClause(param, body) {
  88052. this.type = syntax_1.Syntax.CatchClause;
  88053. this.param = param;
  88054. this.body = body;
  88055. }
  88056. return CatchClause;
  88057. }());
  88058. exports.CatchClause = CatchClause;
  88059. var ClassBody = (function () {
  88060. function ClassBody(body) {
  88061. this.type = syntax_1.Syntax.ClassBody;
  88062. this.body = body;
  88063. }
  88064. return ClassBody;
  88065. }());
  88066. exports.ClassBody = ClassBody;
  88067. var ClassDeclaration = (function () {
  88068. function ClassDeclaration(id, superClass, body) {
  88069. this.type = syntax_1.Syntax.ClassDeclaration;
  88070. this.id = id;
  88071. this.superClass = superClass;
  88072. this.body = body;
  88073. }
  88074. return ClassDeclaration;
  88075. }());
  88076. exports.ClassDeclaration = ClassDeclaration;
  88077. var ClassExpression = (function () {
  88078. function ClassExpression(id, superClass, body) {
  88079. this.type = syntax_1.Syntax.ClassExpression;
  88080. this.id = id;
  88081. this.superClass = superClass;
  88082. this.body = body;
  88083. }
  88084. return ClassExpression;
  88085. }());
  88086. exports.ClassExpression = ClassExpression;
  88087. var ComputedMemberExpression = (function () {
  88088. function ComputedMemberExpression(object, property) {
  88089. this.type = syntax_1.Syntax.MemberExpression;
  88090. this.computed = true;
  88091. this.object = object;
  88092. this.property = property;
  88093. }
  88094. return ComputedMemberExpression;
  88095. }());
  88096. exports.ComputedMemberExpression = ComputedMemberExpression;
  88097. var ConditionalExpression = (function () {
  88098. function ConditionalExpression(test, consequent, alternate) {
  88099. this.type = syntax_1.Syntax.ConditionalExpression;
  88100. this.test = test;
  88101. this.consequent = consequent;
  88102. this.alternate = alternate;
  88103. }
  88104. return ConditionalExpression;
  88105. }());
  88106. exports.ConditionalExpression = ConditionalExpression;
  88107. var ContinueStatement = (function () {
  88108. function ContinueStatement(label) {
  88109. this.type = syntax_1.Syntax.ContinueStatement;
  88110. this.label = label;
  88111. }
  88112. return ContinueStatement;
  88113. }());
  88114. exports.ContinueStatement = ContinueStatement;
  88115. var DebuggerStatement = (function () {
  88116. function DebuggerStatement() {
  88117. this.type = syntax_1.Syntax.DebuggerStatement;
  88118. }
  88119. return DebuggerStatement;
  88120. }());
  88121. exports.DebuggerStatement = DebuggerStatement;
  88122. var Directive = (function () {
  88123. function Directive(expression, directive) {
  88124. this.type = syntax_1.Syntax.ExpressionStatement;
  88125. this.expression = expression;
  88126. this.directive = directive;
  88127. }
  88128. return Directive;
  88129. }());
  88130. exports.Directive = Directive;
  88131. var DoWhileStatement = (function () {
  88132. function DoWhileStatement(body, test) {
  88133. this.type = syntax_1.Syntax.DoWhileStatement;
  88134. this.body = body;
  88135. this.test = test;
  88136. }
  88137. return DoWhileStatement;
  88138. }());
  88139. exports.DoWhileStatement = DoWhileStatement;
  88140. var EmptyStatement = (function () {
  88141. function EmptyStatement() {
  88142. this.type = syntax_1.Syntax.EmptyStatement;
  88143. }
  88144. return EmptyStatement;
  88145. }());
  88146. exports.EmptyStatement = EmptyStatement;
  88147. var ExportAllDeclaration = (function () {
  88148. function ExportAllDeclaration(source) {
  88149. this.type = syntax_1.Syntax.ExportAllDeclaration;
  88150. this.source = source;
  88151. }
  88152. return ExportAllDeclaration;
  88153. }());
  88154. exports.ExportAllDeclaration = ExportAllDeclaration;
  88155. var ExportDefaultDeclaration = (function () {
  88156. function ExportDefaultDeclaration(declaration) {
  88157. this.type = syntax_1.Syntax.ExportDefaultDeclaration;
  88158. this.declaration = declaration;
  88159. }
  88160. return ExportDefaultDeclaration;
  88161. }());
  88162. exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
  88163. var ExportNamedDeclaration = (function () {
  88164. function ExportNamedDeclaration(declaration, specifiers, source) {
  88165. this.type = syntax_1.Syntax.ExportNamedDeclaration;
  88166. this.declaration = declaration;
  88167. this.specifiers = specifiers;
  88168. this.source = source;
  88169. }
  88170. return ExportNamedDeclaration;
  88171. }());
  88172. exports.ExportNamedDeclaration = ExportNamedDeclaration;
  88173. var ExportSpecifier = (function () {
  88174. function ExportSpecifier(local, exported) {
  88175. this.type = syntax_1.Syntax.ExportSpecifier;
  88176. this.exported = exported;
  88177. this.local = local;
  88178. }
  88179. return ExportSpecifier;
  88180. }());
  88181. exports.ExportSpecifier = ExportSpecifier;
  88182. var ExpressionStatement = (function () {
  88183. function ExpressionStatement(expression) {
  88184. this.type = syntax_1.Syntax.ExpressionStatement;
  88185. this.expression = expression;
  88186. }
  88187. return ExpressionStatement;
  88188. }());
  88189. exports.ExpressionStatement = ExpressionStatement;
  88190. var ForInStatement = (function () {
  88191. function ForInStatement(left, right, body) {
  88192. this.type = syntax_1.Syntax.ForInStatement;
  88193. this.left = left;
  88194. this.right = right;
  88195. this.body = body;
  88196. this.each = false;
  88197. }
  88198. return ForInStatement;
  88199. }());
  88200. exports.ForInStatement = ForInStatement;
  88201. var ForOfStatement = (function () {
  88202. function ForOfStatement(left, right, body) {
  88203. this.type = syntax_1.Syntax.ForOfStatement;
  88204. this.left = left;
  88205. this.right = right;
  88206. this.body = body;
  88207. }
  88208. return ForOfStatement;
  88209. }());
  88210. exports.ForOfStatement = ForOfStatement;
  88211. var ForStatement = (function () {
  88212. function ForStatement(init, test, update, body) {
  88213. this.type = syntax_1.Syntax.ForStatement;
  88214. this.init = init;
  88215. this.test = test;
  88216. this.update = update;
  88217. this.body = body;
  88218. }
  88219. return ForStatement;
  88220. }());
  88221. exports.ForStatement = ForStatement;
  88222. var FunctionDeclaration = (function () {
  88223. function FunctionDeclaration(id, params, body, generator) {
  88224. this.type = syntax_1.Syntax.FunctionDeclaration;
  88225. this.id = id;
  88226. this.params = params;
  88227. this.body = body;
  88228. this.generator = generator;
  88229. this.expression = false;
  88230. this.async = false;
  88231. }
  88232. return FunctionDeclaration;
  88233. }());
  88234. exports.FunctionDeclaration = FunctionDeclaration;
  88235. var FunctionExpression = (function () {
  88236. function FunctionExpression(id, params, body, generator) {
  88237. this.type = syntax_1.Syntax.FunctionExpression;
  88238. this.id = id;
  88239. this.params = params;
  88240. this.body = body;
  88241. this.generator = generator;
  88242. this.expression = false;
  88243. this.async = false;
  88244. }
  88245. return FunctionExpression;
  88246. }());
  88247. exports.FunctionExpression = FunctionExpression;
  88248. var Identifier = (function () {
  88249. function Identifier(name) {
  88250. this.type = syntax_1.Syntax.Identifier;
  88251. this.name = name;
  88252. }
  88253. return Identifier;
  88254. }());
  88255. exports.Identifier = Identifier;
  88256. var IfStatement = (function () {
  88257. function IfStatement(test, consequent, alternate) {
  88258. this.type = syntax_1.Syntax.IfStatement;
  88259. this.test = test;
  88260. this.consequent = consequent;
  88261. this.alternate = alternate;
  88262. }
  88263. return IfStatement;
  88264. }());
  88265. exports.IfStatement = IfStatement;
  88266. var ImportDeclaration = (function () {
  88267. function ImportDeclaration(specifiers, source) {
  88268. this.type = syntax_1.Syntax.ImportDeclaration;
  88269. this.specifiers = specifiers;
  88270. this.source = source;
  88271. }
  88272. return ImportDeclaration;
  88273. }());
  88274. exports.ImportDeclaration = ImportDeclaration;
  88275. var ImportDefaultSpecifier = (function () {
  88276. function ImportDefaultSpecifier(local) {
  88277. this.type = syntax_1.Syntax.ImportDefaultSpecifier;
  88278. this.local = local;
  88279. }
  88280. return ImportDefaultSpecifier;
  88281. }());
  88282. exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
  88283. var ImportNamespaceSpecifier = (function () {
  88284. function ImportNamespaceSpecifier(local) {
  88285. this.type = syntax_1.Syntax.ImportNamespaceSpecifier;
  88286. this.local = local;
  88287. }
  88288. return ImportNamespaceSpecifier;
  88289. }());
  88290. exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
  88291. var ImportSpecifier = (function () {
  88292. function ImportSpecifier(local, imported) {
  88293. this.type = syntax_1.Syntax.ImportSpecifier;
  88294. this.local = local;
  88295. this.imported = imported;
  88296. }
  88297. return ImportSpecifier;
  88298. }());
  88299. exports.ImportSpecifier = ImportSpecifier;
  88300. var LabeledStatement = (function () {
  88301. function LabeledStatement(label, body) {
  88302. this.type = syntax_1.Syntax.LabeledStatement;
  88303. this.label = label;
  88304. this.body = body;
  88305. }
  88306. return LabeledStatement;
  88307. }());
  88308. exports.LabeledStatement = LabeledStatement;
  88309. var Literal = (function () {
  88310. function Literal(value, raw) {
  88311. this.type = syntax_1.Syntax.Literal;
  88312. this.value = value;
  88313. this.raw = raw;
  88314. }
  88315. return Literal;
  88316. }());
  88317. exports.Literal = Literal;
  88318. var MetaProperty = (function () {
  88319. function MetaProperty(meta, property) {
  88320. this.type = syntax_1.Syntax.MetaProperty;
  88321. this.meta = meta;
  88322. this.property = property;
  88323. }
  88324. return MetaProperty;
  88325. }());
  88326. exports.MetaProperty = MetaProperty;
  88327. var MethodDefinition = (function () {
  88328. function MethodDefinition(key, computed, value, kind, isStatic) {
  88329. this.type = syntax_1.Syntax.MethodDefinition;
  88330. this.key = key;
  88331. this.computed = computed;
  88332. this.value = value;
  88333. this.kind = kind;
  88334. this.static = isStatic;
  88335. }
  88336. return MethodDefinition;
  88337. }());
  88338. exports.MethodDefinition = MethodDefinition;
  88339. var Module = (function () {
  88340. function Module(body) {
  88341. this.type = syntax_1.Syntax.Program;
  88342. this.body = body;
  88343. this.sourceType = 'module';
  88344. }
  88345. return Module;
  88346. }());
  88347. exports.Module = Module;
  88348. var NewExpression = (function () {
  88349. function NewExpression(callee, args) {
  88350. this.type = syntax_1.Syntax.NewExpression;
  88351. this.callee = callee;
  88352. this.arguments = args;
  88353. }
  88354. return NewExpression;
  88355. }());
  88356. exports.NewExpression = NewExpression;
  88357. var ObjectExpression = (function () {
  88358. function ObjectExpression(properties) {
  88359. this.type = syntax_1.Syntax.ObjectExpression;
  88360. this.properties = properties;
  88361. }
  88362. return ObjectExpression;
  88363. }());
  88364. exports.ObjectExpression = ObjectExpression;
  88365. var ObjectPattern = (function () {
  88366. function ObjectPattern(properties) {
  88367. this.type = syntax_1.Syntax.ObjectPattern;
  88368. this.properties = properties;
  88369. }
  88370. return ObjectPattern;
  88371. }());
  88372. exports.ObjectPattern = ObjectPattern;
  88373. var Property = (function () {
  88374. function Property(kind, key, computed, value, method, shorthand) {
  88375. this.type = syntax_1.Syntax.Property;
  88376. this.key = key;
  88377. this.computed = computed;
  88378. this.value = value;
  88379. this.kind = kind;
  88380. this.method = method;
  88381. this.shorthand = shorthand;
  88382. }
  88383. return Property;
  88384. }());
  88385. exports.Property = Property;
  88386. var RegexLiteral = (function () {
  88387. function RegexLiteral(value, raw, pattern, flags) {
  88388. this.type = syntax_1.Syntax.Literal;
  88389. this.value = value;
  88390. this.raw = raw;
  88391. this.regex = { pattern: pattern, flags: flags };
  88392. }
  88393. return RegexLiteral;
  88394. }());
  88395. exports.RegexLiteral = RegexLiteral;
  88396. var RestElement = (function () {
  88397. function RestElement(argument) {
  88398. this.type = syntax_1.Syntax.RestElement;
  88399. this.argument = argument;
  88400. }
  88401. return RestElement;
  88402. }());
  88403. exports.RestElement = RestElement;
  88404. var ReturnStatement = (function () {
  88405. function ReturnStatement(argument) {
  88406. this.type = syntax_1.Syntax.ReturnStatement;
  88407. this.argument = argument;
  88408. }
  88409. return ReturnStatement;
  88410. }());
  88411. exports.ReturnStatement = ReturnStatement;
  88412. var Script = (function () {
  88413. function Script(body) {
  88414. this.type = syntax_1.Syntax.Program;
  88415. this.body = body;
  88416. this.sourceType = 'script';
  88417. }
  88418. return Script;
  88419. }());
  88420. exports.Script = Script;
  88421. var SequenceExpression = (function () {
  88422. function SequenceExpression(expressions) {
  88423. this.type = syntax_1.Syntax.SequenceExpression;
  88424. this.expressions = expressions;
  88425. }
  88426. return SequenceExpression;
  88427. }());
  88428. exports.SequenceExpression = SequenceExpression;
  88429. var SpreadElement = (function () {
  88430. function SpreadElement(argument) {
  88431. this.type = syntax_1.Syntax.SpreadElement;
  88432. this.argument = argument;
  88433. }
  88434. return SpreadElement;
  88435. }());
  88436. exports.SpreadElement = SpreadElement;
  88437. var StaticMemberExpression = (function () {
  88438. function StaticMemberExpression(object, property) {
  88439. this.type = syntax_1.Syntax.MemberExpression;
  88440. this.computed = false;
  88441. this.object = object;
  88442. this.property = property;
  88443. }
  88444. return StaticMemberExpression;
  88445. }());
  88446. exports.StaticMemberExpression = StaticMemberExpression;
  88447. var Super = (function () {
  88448. function Super() {
  88449. this.type = syntax_1.Syntax.Super;
  88450. }
  88451. return Super;
  88452. }());
  88453. exports.Super = Super;
  88454. var SwitchCase = (function () {
  88455. function SwitchCase(test, consequent) {
  88456. this.type = syntax_1.Syntax.SwitchCase;
  88457. this.test = test;
  88458. this.consequent = consequent;
  88459. }
  88460. return SwitchCase;
  88461. }());
  88462. exports.SwitchCase = SwitchCase;
  88463. var SwitchStatement = (function () {
  88464. function SwitchStatement(discriminant, cases) {
  88465. this.type = syntax_1.Syntax.SwitchStatement;
  88466. this.discriminant = discriminant;
  88467. this.cases = cases;
  88468. }
  88469. return SwitchStatement;
  88470. }());
  88471. exports.SwitchStatement = SwitchStatement;
  88472. var TaggedTemplateExpression = (function () {
  88473. function TaggedTemplateExpression(tag, quasi) {
  88474. this.type = syntax_1.Syntax.TaggedTemplateExpression;
  88475. this.tag = tag;
  88476. this.quasi = quasi;
  88477. }
  88478. return TaggedTemplateExpression;
  88479. }());
  88480. exports.TaggedTemplateExpression = TaggedTemplateExpression;
  88481. var TemplateElement = (function () {
  88482. function TemplateElement(value, tail) {
  88483. this.type = syntax_1.Syntax.TemplateElement;
  88484. this.value = value;
  88485. this.tail = tail;
  88486. }
  88487. return TemplateElement;
  88488. }());
  88489. exports.TemplateElement = TemplateElement;
  88490. var TemplateLiteral = (function () {
  88491. function TemplateLiteral(quasis, expressions) {
  88492. this.type = syntax_1.Syntax.TemplateLiteral;
  88493. this.quasis = quasis;
  88494. this.expressions = expressions;
  88495. }
  88496. return TemplateLiteral;
  88497. }());
  88498. exports.TemplateLiteral = TemplateLiteral;
  88499. var ThisExpression = (function () {
  88500. function ThisExpression() {
  88501. this.type = syntax_1.Syntax.ThisExpression;
  88502. }
  88503. return ThisExpression;
  88504. }());
  88505. exports.ThisExpression = ThisExpression;
  88506. var ThrowStatement = (function () {
  88507. function ThrowStatement(argument) {
  88508. this.type = syntax_1.Syntax.ThrowStatement;
  88509. this.argument = argument;
  88510. }
  88511. return ThrowStatement;
  88512. }());
  88513. exports.ThrowStatement = ThrowStatement;
  88514. var TryStatement = (function () {
  88515. function TryStatement(block, handler, finalizer) {
  88516. this.type = syntax_1.Syntax.TryStatement;
  88517. this.block = block;
  88518. this.handler = handler;
  88519. this.finalizer = finalizer;
  88520. }
  88521. return TryStatement;
  88522. }());
  88523. exports.TryStatement = TryStatement;
  88524. var UnaryExpression = (function () {
  88525. function UnaryExpression(operator, argument) {
  88526. this.type = syntax_1.Syntax.UnaryExpression;
  88527. this.operator = operator;
  88528. this.argument = argument;
  88529. this.prefix = true;
  88530. }
  88531. return UnaryExpression;
  88532. }());
  88533. exports.UnaryExpression = UnaryExpression;
  88534. var UpdateExpression = (function () {
  88535. function UpdateExpression(operator, argument, prefix) {
  88536. this.type = syntax_1.Syntax.UpdateExpression;
  88537. this.operator = operator;
  88538. this.argument = argument;
  88539. this.prefix = prefix;
  88540. }
  88541. return UpdateExpression;
  88542. }());
  88543. exports.UpdateExpression = UpdateExpression;
  88544. var VariableDeclaration = (function () {
  88545. function VariableDeclaration(declarations, kind) {
  88546. this.type = syntax_1.Syntax.VariableDeclaration;
  88547. this.declarations = declarations;
  88548. this.kind = kind;
  88549. }
  88550. return VariableDeclaration;
  88551. }());
  88552. exports.VariableDeclaration = VariableDeclaration;
  88553. var VariableDeclarator = (function () {
  88554. function VariableDeclarator(id, init) {
  88555. this.type = syntax_1.Syntax.VariableDeclarator;
  88556. this.id = id;
  88557. this.init = init;
  88558. }
  88559. return VariableDeclarator;
  88560. }());
  88561. exports.VariableDeclarator = VariableDeclarator;
  88562. var WhileStatement = (function () {
  88563. function WhileStatement(test, body) {
  88564. this.type = syntax_1.Syntax.WhileStatement;
  88565. this.test = test;
  88566. this.body = body;
  88567. }
  88568. return WhileStatement;
  88569. }());
  88570. exports.WhileStatement = WhileStatement;
  88571. var WithStatement = (function () {
  88572. function WithStatement(object, body) {
  88573. this.type = syntax_1.Syntax.WithStatement;
  88574. this.object = object;
  88575. this.body = body;
  88576. }
  88577. return WithStatement;
  88578. }());
  88579. exports.WithStatement = WithStatement;
  88580. var YieldExpression = (function () {
  88581. function YieldExpression(argument, delegate) {
  88582. this.type = syntax_1.Syntax.YieldExpression;
  88583. this.argument = argument;
  88584. this.delegate = delegate;
  88585. }
  88586. return YieldExpression;
  88587. }());
  88588. exports.YieldExpression = YieldExpression;
  88589. /***/ },
  88590. /* 8 */
  88591. /***/ function(module, exports, __webpack_require__) {
  88592. "use strict";
  88593. Object.defineProperty(exports, "__esModule", { value: true });
  88594. var assert_1 = __webpack_require__(9);
  88595. var error_handler_1 = __webpack_require__(10);
  88596. var messages_1 = __webpack_require__(11);
  88597. var Node = __webpack_require__(7);
  88598. var scanner_1 = __webpack_require__(12);
  88599. var syntax_1 = __webpack_require__(2);
  88600. var token_1 = __webpack_require__(13);
  88601. var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder';
  88602. var Parser = (function () {
  88603. function Parser(code, options, delegate) {
  88604. if (options === void 0) { options = {}; }
  88605. this.config = {
  88606. range: (typeof options.range === 'boolean') && options.range,
  88607. loc: (typeof options.loc === 'boolean') && options.loc,
  88608. source: null,
  88609. tokens: (typeof options.tokens === 'boolean') && options.tokens,
  88610. comment: (typeof options.comment === 'boolean') && options.comment,
  88611. tolerant: (typeof options.tolerant === 'boolean') && options.tolerant
  88612. };
  88613. if (this.config.loc && options.source && options.source !== null) {
  88614. this.config.source = String(options.source);
  88615. }
  88616. this.delegate = delegate;
  88617. this.errorHandler = new error_handler_1.ErrorHandler();
  88618. this.errorHandler.tolerant = this.config.tolerant;
  88619. this.scanner = new scanner_1.Scanner(code, this.errorHandler);
  88620. this.scanner.trackComment = this.config.comment;
  88621. this.operatorPrecedence = {
  88622. ')': 0,
  88623. ';': 0,
  88624. ',': 0,
  88625. '=': 0,
  88626. ']': 0,
  88627. '||': 1,
  88628. '&&': 2,
  88629. '|': 3,
  88630. '^': 4,
  88631. '&': 5,
  88632. '==': 6,
  88633. '!=': 6,
  88634. '===': 6,
  88635. '!==': 6,
  88636. '<': 7,
  88637. '>': 7,
  88638. '<=': 7,
  88639. '>=': 7,
  88640. '<<': 8,
  88641. '>>': 8,
  88642. '>>>': 8,
  88643. '+': 9,
  88644. '-': 9,
  88645. '*': 11,
  88646. '/': 11,
  88647. '%': 11
  88648. };
  88649. this.lookahead = {
  88650. type: 2 /* EOF */,
  88651. value: '',
  88652. lineNumber: this.scanner.lineNumber,
  88653. lineStart: 0,
  88654. start: 0,
  88655. end: 0
  88656. };
  88657. this.hasLineTerminator = false;
  88658. this.context = {
  88659. isModule: false,
  88660. await: false,
  88661. allowIn: true,
  88662. allowStrictDirective: true,
  88663. allowYield: true,
  88664. firstCoverInitializedNameError: null,
  88665. isAssignmentTarget: false,
  88666. isBindingElement: false,
  88667. inFunctionBody: false,
  88668. inIteration: false,
  88669. inSwitch: false,
  88670. labelSet: {},
  88671. strict: false
  88672. };
  88673. this.tokens = [];
  88674. this.startMarker = {
  88675. index: 0,
  88676. line: this.scanner.lineNumber,
  88677. column: 0
  88678. };
  88679. this.lastMarker = {
  88680. index: 0,
  88681. line: this.scanner.lineNumber,
  88682. column: 0
  88683. };
  88684. this.nextToken();
  88685. this.lastMarker = {
  88686. index: this.scanner.index,
  88687. line: this.scanner.lineNumber,
  88688. column: this.scanner.index - this.scanner.lineStart
  88689. };
  88690. }
  88691. Parser.prototype.throwError = function (messageFormat) {
  88692. var values = [];
  88693. for (var _i = 1; _i < arguments.length; _i++) {
  88694. values[_i - 1] = arguments[_i];
  88695. }
  88696. var args = Array.prototype.slice.call(arguments, 1);
  88697. var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
  88698. assert_1.assert(idx < args.length, 'Message reference must be in range');
  88699. return args[idx];
  88700. });
  88701. var index = this.lastMarker.index;
  88702. var line = this.lastMarker.line;
  88703. var column = this.lastMarker.column + 1;
  88704. throw this.errorHandler.createError(index, line, column, msg);
  88705. };
  88706. Parser.prototype.tolerateError = function (messageFormat) {
  88707. var values = [];
  88708. for (var _i = 1; _i < arguments.length; _i++) {
  88709. values[_i - 1] = arguments[_i];
  88710. }
  88711. var args = Array.prototype.slice.call(arguments, 1);
  88712. var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
  88713. assert_1.assert(idx < args.length, 'Message reference must be in range');
  88714. return args[idx];
  88715. });
  88716. var index = this.lastMarker.index;
  88717. var line = this.scanner.lineNumber;
  88718. var column = this.lastMarker.column + 1;
  88719. this.errorHandler.tolerateError(index, line, column, msg);
  88720. };
  88721. // Throw an exception because of the token.
  88722. Parser.prototype.unexpectedTokenError = function (token, message) {
  88723. var msg = message || messages_1.Messages.UnexpectedToken;
  88724. var value;
  88725. if (token) {
  88726. if (!message) {
  88727. msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS :
  88728. (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier :
  88729. (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber :
  88730. (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString :
  88731. (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate :
  88732. messages_1.Messages.UnexpectedToken;
  88733. if (token.type === 4 /* Keyword */) {
  88734. if (this.scanner.isFutureReservedWord(token.value)) {
  88735. msg = messages_1.Messages.UnexpectedReserved;
  88736. }
  88737. else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) {
  88738. msg = messages_1.Messages.StrictReservedWord;
  88739. }
  88740. }
  88741. }
  88742. value = token.value;
  88743. }
  88744. else {
  88745. value = 'ILLEGAL';
  88746. }
  88747. msg = msg.replace('%0', value);
  88748. if (token && typeof token.lineNumber === 'number') {
  88749. var index = token.start;
  88750. var line = token.lineNumber;
  88751. var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column;
  88752. var column = token.start - lastMarkerLineStart + 1;
  88753. return this.errorHandler.createError(index, line, column, msg);
  88754. }
  88755. else {
  88756. var index = this.lastMarker.index;
  88757. var line = this.lastMarker.line;
  88758. var column = this.lastMarker.column + 1;
  88759. return this.errorHandler.createError(index, line, column, msg);
  88760. }
  88761. };
  88762. Parser.prototype.throwUnexpectedToken = function (token, message) {
  88763. throw this.unexpectedTokenError(token, message);
  88764. };
  88765. Parser.prototype.tolerateUnexpectedToken = function (token, message) {
  88766. this.errorHandler.tolerate(this.unexpectedTokenError(token, message));
  88767. };
  88768. Parser.prototype.collectComments = function () {
  88769. if (!this.config.comment) {
  88770. this.scanner.scanComments();
  88771. }
  88772. else {
  88773. var comments = this.scanner.scanComments();
  88774. if (comments.length > 0 && this.delegate) {
  88775. for (var i = 0; i < comments.length; ++i) {
  88776. var e = comments[i];
  88777. var node = void 0;
  88778. node = {
  88779. type: e.multiLine ? 'BlockComment' : 'LineComment',
  88780. value: this.scanner.source.slice(e.slice[0], e.slice[1])
  88781. };
  88782. if (this.config.range) {
  88783. node.range = e.range;
  88784. }
  88785. if (this.config.loc) {
  88786. node.loc = e.loc;
  88787. }
  88788. var metadata = {
  88789. start: {
  88790. line: e.loc.start.line,
  88791. column: e.loc.start.column,
  88792. offset: e.range[0]
  88793. },
  88794. end: {
  88795. line: e.loc.end.line,
  88796. column: e.loc.end.column,
  88797. offset: e.range[1]
  88798. }
  88799. };
  88800. this.delegate(node, metadata);
  88801. }
  88802. }
  88803. }
  88804. };
  88805. // From internal representation to an external structure
  88806. Parser.prototype.getTokenRaw = function (token) {
  88807. return this.scanner.source.slice(token.start, token.end);
  88808. };
  88809. Parser.prototype.convertToken = function (token) {
  88810. var t = {
  88811. type: token_1.TokenName[token.type],
  88812. value: this.getTokenRaw(token)
  88813. };
  88814. if (this.config.range) {
  88815. t.range = [token.start, token.end];
  88816. }
  88817. if (this.config.loc) {
  88818. t.loc = {
  88819. start: {
  88820. line: this.startMarker.line,
  88821. column: this.startMarker.column
  88822. },
  88823. end: {
  88824. line: this.scanner.lineNumber,
  88825. column: this.scanner.index - this.scanner.lineStart
  88826. }
  88827. };
  88828. }
  88829. if (token.type === 9 /* RegularExpression */) {
  88830. var pattern = token.pattern;
  88831. var flags = token.flags;
  88832. t.regex = { pattern: pattern, flags: flags };
  88833. }
  88834. return t;
  88835. };
  88836. Parser.prototype.nextToken = function () {
  88837. var token = this.lookahead;
  88838. this.lastMarker.index = this.scanner.index;
  88839. this.lastMarker.line = this.scanner.lineNumber;
  88840. this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
  88841. this.collectComments();
  88842. if (this.scanner.index !== this.startMarker.index) {
  88843. this.startMarker.index = this.scanner.index;
  88844. this.startMarker.line = this.scanner.lineNumber;
  88845. this.startMarker.column = this.scanner.index - this.scanner.lineStart;
  88846. }
  88847. var next = this.scanner.lex();
  88848. this.hasLineTerminator = (token.lineNumber !== next.lineNumber);
  88849. if (next && this.context.strict && next.type === 3 /* Identifier */) {
  88850. if (this.scanner.isStrictModeReservedWord(next.value)) {
  88851. next.type = 4 /* Keyword */;
  88852. }
  88853. }
  88854. this.lookahead = next;
  88855. if (this.config.tokens && next.type !== 2 /* EOF */) {
  88856. this.tokens.push(this.convertToken(next));
  88857. }
  88858. return token;
  88859. };
  88860. Parser.prototype.nextRegexToken = function () {
  88861. this.collectComments();
  88862. var token = this.scanner.scanRegExp();
  88863. if (this.config.tokens) {
  88864. // Pop the previous token, '/' or '/='
  88865. // This is added from the lookahead token.
  88866. this.tokens.pop();
  88867. this.tokens.push(this.convertToken(token));
  88868. }
  88869. // Prime the next lookahead.
  88870. this.lookahead = token;
  88871. this.nextToken();
  88872. return token;
  88873. };
  88874. Parser.prototype.createNode = function () {
  88875. return {
  88876. index: this.startMarker.index,
  88877. line: this.startMarker.line,
  88878. column: this.startMarker.column
  88879. };
  88880. };
  88881. Parser.prototype.startNode = function (token, lastLineStart) {
  88882. if (lastLineStart === void 0) { lastLineStart = 0; }
  88883. var column = token.start - token.lineStart;
  88884. var line = token.lineNumber;
  88885. if (column < 0) {
  88886. column += lastLineStart;
  88887. line--;
  88888. }
  88889. return {
  88890. index: token.start,
  88891. line: line,
  88892. column: column
  88893. };
  88894. };
  88895. Parser.prototype.finalize = function (marker, node) {
  88896. if (this.config.range) {
  88897. node.range = [marker.index, this.lastMarker.index];
  88898. }
  88899. if (this.config.loc) {
  88900. node.loc = {
  88901. start: {
  88902. line: marker.line,
  88903. column: marker.column,
  88904. },
  88905. end: {
  88906. line: this.lastMarker.line,
  88907. column: this.lastMarker.column
  88908. }
  88909. };
  88910. if (this.config.source) {
  88911. node.loc.source = this.config.source;
  88912. }
  88913. }
  88914. if (this.delegate) {
  88915. var metadata = {
  88916. start: {
  88917. line: marker.line,
  88918. column: marker.column,
  88919. offset: marker.index
  88920. },
  88921. end: {
  88922. line: this.lastMarker.line,
  88923. column: this.lastMarker.column,
  88924. offset: this.lastMarker.index
  88925. }
  88926. };
  88927. this.delegate(node, metadata);
  88928. }
  88929. return node;
  88930. };
  88931. // Expect the next token to match the specified punctuator.
  88932. // If not, an exception will be thrown.
  88933. Parser.prototype.expect = function (value) {
  88934. var token = this.nextToken();
  88935. if (token.type !== 7 /* Punctuator */ || token.value !== value) {
  88936. this.throwUnexpectedToken(token);
  88937. }
  88938. };
  88939. // Quietly expect a comma when in tolerant mode, otherwise delegates to expect().
  88940. Parser.prototype.expectCommaSeparator = function () {
  88941. if (this.config.tolerant) {
  88942. var token = this.lookahead;
  88943. if (token.type === 7 /* Punctuator */ && token.value === ',') {
  88944. this.nextToken();
  88945. }
  88946. else if (token.type === 7 /* Punctuator */ && token.value === ';') {
  88947. this.nextToken();
  88948. this.tolerateUnexpectedToken(token);
  88949. }
  88950. else {
  88951. this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken);
  88952. }
  88953. }
  88954. else {
  88955. this.expect(',');
  88956. }
  88957. };
  88958. // Expect the next token to match the specified keyword.
  88959. // If not, an exception will be thrown.
  88960. Parser.prototype.expectKeyword = function (keyword) {
  88961. var token = this.nextToken();
  88962. if (token.type !== 4 /* Keyword */ || token.value !== keyword) {
  88963. this.throwUnexpectedToken(token);
  88964. }
  88965. };
  88966. // Return true if the next token matches the specified punctuator.
  88967. Parser.prototype.match = function (value) {
  88968. return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value;
  88969. };
  88970. // Return true if the next token matches the specified keyword
  88971. Parser.prototype.matchKeyword = function (keyword) {
  88972. return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword;
  88973. };
  88974. // Return true if the next token matches the specified contextual keyword
  88975. // (where an identifier is sometimes a keyword depending on the context)
  88976. Parser.prototype.matchContextualKeyword = function (keyword) {
  88977. return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword;
  88978. };
  88979. // Return true if the next token is an assignment operator
  88980. Parser.prototype.matchAssign = function () {
  88981. if (this.lookahead.type !== 7 /* Punctuator */) {
  88982. return false;
  88983. }
  88984. var op = this.lookahead.value;
  88985. return op === '=' ||
  88986. op === '*=' ||
  88987. op === '**=' ||
  88988. op === '/=' ||
  88989. op === '%=' ||
  88990. op === '+=' ||
  88991. op === '-=' ||
  88992. op === '<<=' ||
  88993. op === '>>=' ||
  88994. op === '>>>=' ||
  88995. op === '&=' ||
  88996. op === '^=' ||
  88997. op === '|=';
  88998. };
  88999. // Cover grammar support.
  89000. //
  89001. // When an assignment expression position starts with an left parenthesis, the determination of the type
  89002. // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead)
  89003. // or the first comma. This situation also defers the determination of all the expressions nested in the pair.
  89004. //
  89005. // There are three productions that can be parsed in a parentheses pair that needs to be determined
  89006. // after the outermost pair is closed. They are:
  89007. //
  89008. // 1. AssignmentExpression
  89009. // 2. BindingElements
  89010. // 3. AssignmentTargets
  89011. //
  89012. // In order to avoid exponential backtracking, we use two flags to denote if the production can be
  89013. // binding element or assignment target.
  89014. //
  89015. // The three productions have the relationship:
  89016. //
  89017. // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression
  89018. //
  89019. // with a single exception that CoverInitializedName when used directly in an Expression, generates
  89020. // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the
  89021. // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair.
  89022. //
  89023. // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not
  89024. // effect the current flags. This means the production the parser parses is only used as an expression. Therefore
  89025. // the CoverInitializedName check is conducted.
  89026. //
  89027. // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates
  89028. // the flags outside of the parser. This means the production the parser parses is used as a part of a potential
  89029. // pattern. The CoverInitializedName check is deferred.
  89030. Parser.prototype.isolateCoverGrammar = function (parseFunction) {
  89031. var previousIsBindingElement = this.context.isBindingElement;
  89032. var previousIsAssignmentTarget = this.context.isAssignmentTarget;
  89033. var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
  89034. this.context.isBindingElement = true;
  89035. this.context.isAssignmentTarget = true;
  89036. this.context.firstCoverInitializedNameError = null;
  89037. var result = parseFunction.call(this);
  89038. if (this.context.firstCoverInitializedNameError !== null) {
  89039. this.throwUnexpectedToken(this.context.firstCoverInitializedNameError);
  89040. }
  89041. this.context.isBindingElement = previousIsBindingElement;
  89042. this.context.isAssignmentTarget = previousIsAssignmentTarget;
  89043. this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError;
  89044. return result;
  89045. };
  89046. Parser.prototype.inheritCoverGrammar = function (parseFunction) {
  89047. var previousIsBindingElement = this.context.isBindingElement;
  89048. var previousIsAssignmentTarget = this.context.isAssignmentTarget;
  89049. var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
  89050. this.context.isBindingElement = true;
  89051. this.context.isAssignmentTarget = true;
  89052. this.context.firstCoverInitializedNameError = null;
  89053. var result = parseFunction.call(this);
  89054. this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement;
  89055. this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget;
  89056. this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError;
  89057. return result;
  89058. };
  89059. Parser.prototype.consumeSemicolon = function () {
  89060. if (this.match(';')) {
  89061. this.nextToken();
  89062. }
  89063. else if (!this.hasLineTerminator) {
  89064. if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) {
  89065. this.throwUnexpectedToken(this.lookahead);
  89066. }
  89067. this.lastMarker.index = this.startMarker.index;
  89068. this.lastMarker.line = this.startMarker.line;
  89069. this.lastMarker.column = this.startMarker.column;
  89070. }
  89071. };
  89072. // https://tc39.github.io/ecma262/#sec-primary-expression
  89073. Parser.prototype.parsePrimaryExpression = function () {
  89074. var node = this.createNode();
  89075. var expr;
  89076. var token, raw;
  89077. switch (this.lookahead.type) {
  89078. case 3 /* Identifier */:
  89079. if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') {
  89080. this.tolerateUnexpectedToken(this.lookahead);
  89081. }
  89082. expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value));
  89083. break;
  89084. case 6 /* NumericLiteral */:
  89085. case 8 /* StringLiteral */:
  89086. if (this.context.strict && this.lookahead.octal) {
  89087. this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral);
  89088. }
  89089. this.context.isAssignmentTarget = false;
  89090. this.context.isBindingElement = false;
  89091. token = this.nextToken();
  89092. raw = this.getTokenRaw(token);
  89093. expr = this.finalize(node, new Node.Literal(token.value, raw));
  89094. break;
  89095. case 1 /* BooleanLiteral */:
  89096. this.context.isAssignmentTarget = false;
  89097. this.context.isBindingElement = false;
  89098. token = this.nextToken();
  89099. raw = this.getTokenRaw(token);
  89100. expr = this.finalize(node, new Node.Literal(token.value === 'true', raw));
  89101. break;
  89102. case 5 /* NullLiteral */:
  89103. this.context.isAssignmentTarget = false;
  89104. this.context.isBindingElement = false;
  89105. token = this.nextToken();
  89106. raw = this.getTokenRaw(token);
  89107. expr = this.finalize(node, new Node.Literal(null, raw));
  89108. break;
  89109. case 10 /* Template */:
  89110. expr = this.parseTemplateLiteral();
  89111. break;
  89112. case 7 /* Punctuator */:
  89113. switch (this.lookahead.value) {
  89114. case '(':
  89115. this.context.isBindingElement = false;
  89116. expr = this.inheritCoverGrammar(this.parseGroupExpression);
  89117. break;
  89118. case '[':
  89119. expr = this.inheritCoverGrammar(this.parseArrayInitializer);
  89120. break;
  89121. case '{':
  89122. expr = this.inheritCoverGrammar(this.parseObjectInitializer);
  89123. break;
  89124. case '/':
  89125. case '/=':
  89126. this.context.isAssignmentTarget = false;
  89127. this.context.isBindingElement = false;
  89128. this.scanner.index = this.startMarker.index;
  89129. token = this.nextRegexToken();
  89130. raw = this.getTokenRaw(token);
  89131. expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags));
  89132. break;
  89133. default:
  89134. expr = this.throwUnexpectedToken(this.nextToken());
  89135. }
  89136. break;
  89137. case 4 /* Keyword */:
  89138. if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) {
  89139. expr = this.parseIdentifierName();
  89140. }
  89141. else if (!this.context.strict && this.matchKeyword('let')) {
  89142. expr = this.finalize(node, new Node.Identifier(this.nextToken().value));
  89143. }
  89144. else {
  89145. this.context.isAssignmentTarget = false;
  89146. this.context.isBindingElement = false;
  89147. if (this.matchKeyword('function')) {
  89148. expr = this.parseFunctionExpression();
  89149. }
  89150. else if (this.matchKeyword('this')) {
  89151. this.nextToken();
  89152. expr = this.finalize(node, new Node.ThisExpression());
  89153. }
  89154. else if (this.matchKeyword('class')) {
  89155. expr = this.parseClassExpression();
  89156. }
  89157. else {
  89158. expr = this.throwUnexpectedToken(this.nextToken());
  89159. }
  89160. }
  89161. break;
  89162. default:
  89163. expr = this.throwUnexpectedToken(this.nextToken());
  89164. }
  89165. return expr;
  89166. };
  89167. // https://tc39.github.io/ecma262/#sec-array-initializer
  89168. Parser.prototype.parseSpreadElement = function () {
  89169. var node = this.createNode();
  89170. this.expect('...');
  89171. var arg = this.inheritCoverGrammar(this.parseAssignmentExpression);
  89172. return this.finalize(node, new Node.SpreadElement(arg));
  89173. };
  89174. Parser.prototype.parseArrayInitializer = function () {
  89175. var node = this.createNode();
  89176. var elements = [];
  89177. this.expect('[');
  89178. while (!this.match(']')) {
  89179. if (this.match(',')) {
  89180. this.nextToken();
  89181. elements.push(null);
  89182. }
  89183. else if (this.match('...')) {
  89184. var element = this.parseSpreadElement();
  89185. if (!this.match(']')) {
  89186. this.context.isAssignmentTarget = false;
  89187. this.context.isBindingElement = false;
  89188. this.expect(',');
  89189. }
  89190. elements.push(element);
  89191. }
  89192. else {
  89193. elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
  89194. if (!this.match(']')) {
  89195. this.expect(',');
  89196. }
  89197. }
  89198. }
  89199. this.expect(']');
  89200. return this.finalize(node, new Node.ArrayExpression(elements));
  89201. };
  89202. // https://tc39.github.io/ecma262/#sec-object-initializer
  89203. Parser.prototype.parsePropertyMethod = function (params) {
  89204. this.context.isAssignmentTarget = false;
  89205. this.context.isBindingElement = false;
  89206. var previousStrict = this.context.strict;
  89207. var previousAllowStrictDirective = this.context.allowStrictDirective;
  89208. this.context.allowStrictDirective = params.simple;
  89209. var body = this.isolateCoverGrammar(this.parseFunctionSourceElements);
  89210. if (this.context.strict && params.firstRestricted) {
  89211. this.tolerateUnexpectedToken(params.firstRestricted, params.message);
  89212. }
  89213. if (this.context.strict && params.stricted) {
  89214. this.tolerateUnexpectedToken(params.stricted, params.message);
  89215. }
  89216. this.context.strict = previousStrict;
  89217. this.context.allowStrictDirective = previousAllowStrictDirective;
  89218. return body;
  89219. };
  89220. Parser.prototype.parsePropertyMethodFunction = function () {
  89221. var isGenerator = false;
  89222. var node = this.createNode();
  89223. var previousAllowYield = this.context.allowYield;
  89224. this.context.allowYield = true;
  89225. var params = this.parseFormalParameters();
  89226. var method = this.parsePropertyMethod(params);
  89227. this.context.allowYield = previousAllowYield;
  89228. return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
  89229. };
  89230. Parser.prototype.parsePropertyMethodAsyncFunction = function () {
  89231. var node = this.createNode();
  89232. var previousAllowYield = this.context.allowYield;
  89233. var previousAwait = this.context.await;
  89234. this.context.allowYield = false;
  89235. this.context.await = true;
  89236. var params = this.parseFormalParameters();
  89237. var method = this.parsePropertyMethod(params);
  89238. this.context.allowYield = previousAllowYield;
  89239. this.context.await = previousAwait;
  89240. return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method));
  89241. };
  89242. Parser.prototype.parseObjectPropertyKey = function () {
  89243. var node = this.createNode();
  89244. var token = this.nextToken();
  89245. var key;
  89246. switch (token.type) {
  89247. case 8 /* StringLiteral */:
  89248. case 6 /* NumericLiteral */:
  89249. if (this.context.strict && token.octal) {
  89250. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral);
  89251. }
  89252. var raw = this.getTokenRaw(token);
  89253. key = this.finalize(node, new Node.Literal(token.value, raw));
  89254. break;
  89255. case 3 /* Identifier */:
  89256. case 1 /* BooleanLiteral */:
  89257. case 5 /* NullLiteral */:
  89258. case 4 /* Keyword */:
  89259. key = this.finalize(node, new Node.Identifier(token.value));
  89260. break;
  89261. case 7 /* Punctuator */:
  89262. if (token.value === '[') {
  89263. key = this.isolateCoverGrammar(this.parseAssignmentExpression);
  89264. this.expect(']');
  89265. }
  89266. else {
  89267. key = this.throwUnexpectedToken(token);
  89268. }
  89269. break;
  89270. default:
  89271. key = this.throwUnexpectedToken(token);
  89272. }
  89273. return key;
  89274. };
  89275. Parser.prototype.isPropertyKey = function (key, value) {
  89276. return (key.type === syntax_1.Syntax.Identifier && key.name === value) ||
  89277. (key.type === syntax_1.Syntax.Literal && key.value === value);
  89278. };
  89279. Parser.prototype.parseObjectProperty = function (hasProto) {
  89280. var node = this.createNode();
  89281. var token = this.lookahead;
  89282. var kind;
  89283. var key = null;
  89284. var value = null;
  89285. var computed = false;
  89286. var method = false;
  89287. var shorthand = false;
  89288. var isAsync = false;
  89289. if (token.type === 3 /* Identifier */) {
  89290. var id = token.value;
  89291. this.nextToken();
  89292. computed = this.match('[');
  89293. isAsync = !this.hasLineTerminator && (id === 'async') &&
  89294. !this.match(':') && !this.match('(') && !this.match('*') && !this.match(',');
  89295. key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id));
  89296. }
  89297. else if (this.match('*')) {
  89298. this.nextToken();
  89299. }
  89300. else {
  89301. computed = this.match('[');
  89302. key = this.parseObjectPropertyKey();
  89303. }
  89304. var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
  89305. if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) {
  89306. kind = 'get';
  89307. computed = this.match('[');
  89308. key = this.parseObjectPropertyKey();
  89309. this.context.allowYield = false;
  89310. value = this.parseGetterMethod();
  89311. }
  89312. else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) {
  89313. kind = 'set';
  89314. computed = this.match('[');
  89315. key = this.parseObjectPropertyKey();
  89316. value = this.parseSetterMethod();
  89317. }
  89318. else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) {
  89319. kind = 'init';
  89320. computed = this.match('[');
  89321. key = this.parseObjectPropertyKey();
  89322. value = this.parseGeneratorMethod();
  89323. method = true;
  89324. }
  89325. else {
  89326. if (!key) {
  89327. this.throwUnexpectedToken(this.lookahead);
  89328. }
  89329. kind = 'init';
  89330. if (this.match(':') && !isAsync) {
  89331. if (!computed && this.isPropertyKey(key, '__proto__')) {
  89332. if (hasProto.value) {
  89333. this.tolerateError(messages_1.Messages.DuplicateProtoProperty);
  89334. }
  89335. hasProto.value = true;
  89336. }
  89337. this.nextToken();
  89338. value = this.inheritCoverGrammar(this.parseAssignmentExpression);
  89339. }
  89340. else if (this.match('(')) {
  89341. value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
  89342. method = true;
  89343. }
  89344. else if (token.type === 3 /* Identifier */) {
  89345. var id = this.finalize(node, new Node.Identifier(token.value));
  89346. if (this.match('=')) {
  89347. this.context.firstCoverInitializedNameError = this.lookahead;
  89348. this.nextToken();
  89349. shorthand = true;
  89350. var init = this.isolateCoverGrammar(this.parseAssignmentExpression);
  89351. value = this.finalize(node, new Node.AssignmentPattern(id, init));
  89352. }
  89353. else {
  89354. shorthand = true;
  89355. value = id;
  89356. }
  89357. }
  89358. else {
  89359. this.throwUnexpectedToken(this.nextToken());
  89360. }
  89361. }
  89362. return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand));
  89363. };
  89364. Parser.prototype.parseObjectInitializer = function () {
  89365. var node = this.createNode();
  89366. this.expect('{');
  89367. var properties = [];
  89368. var hasProto = { value: false };
  89369. while (!this.match('}')) {
  89370. properties.push(this.parseObjectProperty(hasProto));
  89371. if (!this.match('}')) {
  89372. this.expectCommaSeparator();
  89373. }
  89374. }
  89375. this.expect('}');
  89376. return this.finalize(node, new Node.ObjectExpression(properties));
  89377. };
  89378. // https://tc39.github.io/ecma262/#sec-template-literals
  89379. Parser.prototype.parseTemplateHead = function () {
  89380. assert_1.assert(this.lookahead.head, 'Template literal must start with a template head');
  89381. var node = this.createNode();
  89382. var token = this.nextToken();
  89383. var raw = token.value;
  89384. var cooked = token.cooked;
  89385. return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
  89386. };
  89387. Parser.prototype.parseTemplateElement = function () {
  89388. if (this.lookahead.type !== 10 /* Template */) {
  89389. this.throwUnexpectedToken();
  89390. }
  89391. var node = this.createNode();
  89392. var token = this.nextToken();
  89393. var raw = token.value;
  89394. var cooked = token.cooked;
  89395. return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
  89396. };
  89397. Parser.prototype.parseTemplateLiteral = function () {
  89398. var node = this.createNode();
  89399. var expressions = [];
  89400. var quasis = [];
  89401. var quasi = this.parseTemplateHead();
  89402. quasis.push(quasi);
  89403. while (!quasi.tail) {
  89404. expressions.push(this.parseExpression());
  89405. quasi = this.parseTemplateElement();
  89406. quasis.push(quasi);
  89407. }
  89408. return this.finalize(node, new Node.TemplateLiteral(quasis, expressions));
  89409. };
  89410. // https://tc39.github.io/ecma262/#sec-grouping-operator
  89411. Parser.prototype.reinterpretExpressionAsPattern = function (expr) {
  89412. switch (expr.type) {
  89413. case syntax_1.Syntax.Identifier:
  89414. case syntax_1.Syntax.MemberExpression:
  89415. case syntax_1.Syntax.RestElement:
  89416. case syntax_1.Syntax.AssignmentPattern:
  89417. break;
  89418. case syntax_1.Syntax.SpreadElement:
  89419. expr.type = syntax_1.Syntax.RestElement;
  89420. this.reinterpretExpressionAsPattern(expr.argument);
  89421. break;
  89422. case syntax_1.Syntax.ArrayExpression:
  89423. expr.type = syntax_1.Syntax.ArrayPattern;
  89424. for (var i = 0; i < expr.elements.length; i++) {
  89425. if (expr.elements[i] !== null) {
  89426. this.reinterpretExpressionAsPattern(expr.elements[i]);
  89427. }
  89428. }
  89429. break;
  89430. case syntax_1.Syntax.ObjectExpression:
  89431. expr.type = syntax_1.Syntax.ObjectPattern;
  89432. for (var i = 0; i < expr.properties.length; i++) {
  89433. this.reinterpretExpressionAsPattern(expr.properties[i].value);
  89434. }
  89435. break;
  89436. case syntax_1.Syntax.AssignmentExpression:
  89437. expr.type = syntax_1.Syntax.AssignmentPattern;
  89438. delete expr.operator;
  89439. this.reinterpretExpressionAsPattern(expr.left);
  89440. break;
  89441. default:
  89442. // Allow other node type for tolerant parsing.
  89443. break;
  89444. }
  89445. };
  89446. Parser.prototype.parseGroupExpression = function () {
  89447. var expr;
  89448. this.expect('(');
  89449. if (this.match(')')) {
  89450. this.nextToken();
  89451. if (!this.match('=>')) {
  89452. this.expect('=>');
  89453. }
  89454. expr = {
  89455. type: ArrowParameterPlaceHolder,
  89456. params: [],
  89457. async: false
  89458. };
  89459. }
  89460. else {
  89461. var startToken = this.lookahead;
  89462. var params = [];
  89463. if (this.match('...')) {
  89464. expr = this.parseRestElement(params);
  89465. this.expect(')');
  89466. if (!this.match('=>')) {
  89467. this.expect('=>');
  89468. }
  89469. expr = {
  89470. type: ArrowParameterPlaceHolder,
  89471. params: [expr],
  89472. async: false
  89473. };
  89474. }
  89475. else {
  89476. var arrow = false;
  89477. this.context.isBindingElement = true;
  89478. expr = this.inheritCoverGrammar(this.parseAssignmentExpression);
  89479. if (this.match(',')) {
  89480. var expressions = [];
  89481. this.context.isAssignmentTarget = false;
  89482. expressions.push(expr);
  89483. while (this.lookahead.type !== 2 /* EOF */) {
  89484. if (!this.match(',')) {
  89485. break;
  89486. }
  89487. this.nextToken();
  89488. if (this.match(')')) {
  89489. this.nextToken();
  89490. for (var i = 0; i < expressions.length; i++) {
  89491. this.reinterpretExpressionAsPattern(expressions[i]);
  89492. }
  89493. arrow = true;
  89494. expr = {
  89495. type: ArrowParameterPlaceHolder,
  89496. params: expressions,
  89497. async: false
  89498. };
  89499. }
  89500. else if (this.match('...')) {
  89501. if (!this.context.isBindingElement) {
  89502. this.throwUnexpectedToken(this.lookahead);
  89503. }
  89504. expressions.push(this.parseRestElement(params));
  89505. this.expect(')');
  89506. if (!this.match('=>')) {
  89507. this.expect('=>');
  89508. }
  89509. this.context.isBindingElement = false;
  89510. for (var i = 0; i < expressions.length; i++) {
  89511. this.reinterpretExpressionAsPattern(expressions[i]);
  89512. }
  89513. arrow = true;
  89514. expr = {
  89515. type: ArrowParameterPlaceHolder,
  89516. params: expressions,
  89517. async: false
  89518. };
  89519. }
  89520. else {
  89521. expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
  89522. }
  89523. if (arrow) {
  89524. break;
  89525. }
  89526. }
  89527. if (!arrow) {
  89528. expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
  89529. }
  89530. }
  89531. if (!arrow) {
  89532. this.expect(')');
  89533. if (this.match('=>')) {
  89534. if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') {
  89535. arrow = true;
  89536. expr = {
  89537. type: ArrowParameterPlaceHolder,
  89538. params: [expr],
  89539. async: false
  89540. };
  89541. }
  89542. if (!arrow) {
  89543. if (!this.context.isBindingElement) {
  89544. this.throwUnexpectedToken(this.lookahead);
  89545. }
  89546. if (expr.type === syntax_1.Syntax.SequenceExpression) {
  89547. for (var i = 0; i < expr.expressions.length; i++) {
  89548. this.reinterpretExpressionAsPattern(expr.expressions[i]);
  89549. }
  89550. }
  89551. else {
  89552. this.reinterpretExpressionAsPattern(expr);
  89553. }
  89554. var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]);
  89555. expr = {
  89556. type: ArrowParameterPlaceHolder,
  89557. params: parameters,
  89558. async: false
  89559. };
  89560. }
  89561. }
  89562. this.context.isBindingElement = false;
  89563. }
  89564. }
  89565. }
  89566. return expr;
  89567. };
  89568. // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions
  89569. Parser.prototype.parseArguments = function () {
  89570. this.expect('(');
  89571. var args = [];
  89572. if (!this.match(')')) {
  89573. while (true) {
  89574. var expr = this.match('...') ? this.parseSpreadElement() :
  89575. this.isolateCoverGrammar(this.parseAssignmentExpression);
  89576. args.push(expr);
  89577. if (this.match(')')) {
  89578. break;
  89579. }
  89580. this.expectCommaSeparator();
  89581. if (this.match(')')) {
  89582. break;
  89583. }
  89584. }
  89585. }
  89586. this.expect(')');
  89587. return args;
  89588. };
  89589. Parser.prototype.isIdentifierName = function (token) {
  89590. return token.type === 3 /* Identifier */ ||
  89591. token.type === 4 /* Keyword */ ||
  89592. token.type === 1 /* BooleanLiteral */ ||
  89593. token.type === 5 /* NullLiteral */;
  89594. };
  89595. Parser.prototype.parseIdentifierName = function () {
  89596. var node = this.createNode();
  89597. var token = this.nextToken();
  89598. if (!this.isIdentifierName(token)) {
  89599. this.throwUnexpectedToken(token);
  89600. }
  89601. return this.finalize(node, new Node.Identifier(token.value));
  89602. };
  89603. Parser.prototype.parseNewExpression = function () {
  89604. var node = this.createNode();
  89605. var id = this.parseIdentifierName();
  89606. assert_1.assert(id.name === 'new', 'New expression must start with `new`');
  89607. var expr;
  89608. if (this.match('.')) {
  89609. this.nextToken();
  89610. if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') {
  89611. var property = this.parseIdentifierName();
  89612. expr = new Node.MetaProperty(id, property);
  89613. }
  89614. else {
  89615. this.throwUnexpectedToken(this.lookahead);
  89616. }
  89617. }
  89618. else {
  89619. var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression);
  89620. var args = this.match('(') ? this.parseArguments() : [];
  89621. expr = new Node.NewExpression(callee, args);
  89622. this.context.isAssignmentTarget = false;
  89623. this.context.isBindingElement = false;
  89624. }
  89625. return this.finalize(node, expr);
  89626. };
  89627. Parser.prototype.parseAsyncArgument = function () {
  89628. var arg = this.parseAssignmentExpression();
  89629. this.context.firstCoverInitializedNameError = null;
  89630. return arg;
  89631. };
  89632. Parser.prototype.parseAsyncArguments = function () {
  89633. this.expect('(');
  89634. var args = [];
  89635. if (!this.match(')')) {
  89636. while (true) {
  89637. var expr = this.match('...') ? this.parseSpreadElement() :
  89638. this.isolateCoverGrammar(this.parseAsyncArgument);
  89639. args.push(expr);
  89640. if (this.match(')')) {
  89641. break;
  89642. }
  89643. this.expectCommaSeparator();
  89644. if (this.match(')')) {
  89645. break;
  89646. }
  89647. }
  89648. }
  89649. this.expect(')');
  89650. return args;
  89651. };
  89652. Parser.prototype.parseLeftHandSideExpressionAllowCall = function () {
  89653. var startToken = this.lookahead;
  89654. var maybeAsync = this.matchContextualKeyword('async');
  89655. var previousAllowIn = this.context.allowIn;
  89656. this.context.allowIn = true;
  89657. var expr;
  89658. if (this.matchKeyword('super') && this.context.inFunctionBody) {
  89659. expr = this.createNode();
  89660. this.nextToken();
  89661. expr = this.finalize(expr, new Node.Super());
  89662. if (!this.match('(') && !this.match('.') && !this.match('[')) {
  89663. this.throwUnexpectedToken(this.lookahead);
  89664. }
  89665. }
  89666. else {
  89667. expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression);
  89668. }
  89669. while (true) {
  89670. if (this.match('.')) {
  89671. this.context.isBindingElement = false;
  89672. this.context.isAssignmentTarget = true;
  89673. this.expect('.');
  89674. var property = this.parseIdentifierName();
  89675. expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property));
  89676. }
  89677. else if (this.match('(')) {
  89678. var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber);
  89679. this.context.isBindingElement = false;
  89680. this.context.isAssignmentTarget = false;
  89681. var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments();
  89682. expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args));
  89683. if (asyncArrow && this.match('=>')) {
  89684. for (var i = 0; i < args.length; ++i) {
  89685. this.reinterpretExpressionAsPattern(args[i]);
  89686. }
  89687. expr = {
  89688. type: ArrowParameterPlaceHolder,
  89689. params: args,
  89690. async: true
  89691. };
  89692. }
  89693. }
  89694. else if (this.match('[')) {
  89695. this.context.isBindingElement = false;
  89696. this.context.isAssignmentTarget = true;
  89697. this.expect('[');
  89698. var property = this.isolateCoverGrammar(this.parseExpression);
  89699. this.expect(']');
  89700. expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property));
  89701. }
  89702. else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) {
  89703. var quasi = this.parseTemplateLiteral();
  89704. expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi));
  89705. }
  89706. else {
  89707. break;
  89708. }
  89709. }
  89710. this.context.allowIn = previousAllowIn;
  89711. return expr;
  89712. };
  89713. Parser.prototype.parseSuper = function () {
  89714. var node = this.createNode();
  89715. this.expectKeyword('super');
  89716. if (!this.match('[') && !this.match('.')) {
  89717. this.throwUnexpectedToken(this.lookahead);
  89718. }
  89719. return this.finalize(node, new Node.Super());
  89720. };
  89721. Parser.prototype.parseLeftHandSideExpression = function () {
  89722. assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.');
  89723. var node = this.startNode(this.lookahead);
  89724. var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() :
  89725. this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression);
  89726. while (true) {
  89727. if (this.match('[')) {
  89728. this.context.isBindingElement = false;
  89729. this.context.isAssignmentTarget = true;
  89730. this.expect('[');
  89731. var property = this.isolateCoverGrammar(this.parseExpression);
  89732. this.expect(']');
  89733. expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property));
  89734. }
  89735. else if (this.match('.')) {
  89736. this.context.isBindingElement = false;
  89737. this.context.isAssignmentTarget = true;
  89738. this.expect('.');
  89739. var property = this.parseIdentifierName();
  89740. expr = this.finalize(node, new Node.StaticMemberExpression(expr, property));
  89741. }
  89742. else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) {
  89743. var quasi = this.parseTemplateLiteral();
  89744. expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi));
  89745. }
  89746. else {
  89747. break;
  89748. }
  89749. }
  89750. return expr;
  89751. };
  89752. // https://tc39.github.io/ecma262/#sec-update-expressions
  89753. Parser.prototype.parseUpdateExpression = function () {
  89754. var expr;
  89755. var startToken = this.lookahead;
  89756. if (this.match('++') || this.match('--')) {
  89757. var node = this.startNode(startToken);
  89758. var token = this.nextToken();
  89759. expr = this.inheritCoverGrammar(this.parseUnaryExpression);
  89760. if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
  89761. this.tolerateError(messages_1.Messages.StrictLHSPrefix);
  89762. }
  89763. if (!this.context.isAssignmentTarget) {
  89764. this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
  89765. }
  89766. var prefix = true;
  89767. expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix));
  89768. this.context.isAssignmentTarget = false;
  89769. this.context.isBindingElement = false;
  89770. }
  89771. else {
  89772. expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
  89773. if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) {
  89774. if (this.match('++') || this.match('--')) {
  89775. if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
  89776. this.tolerateError(messages_1.Messages.StrictLHSPostfix);
  89777. }
  89778. if (!this.context.isAssignmentTarget) {
  89779. this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
  89780. }
  89781. this.context.isAssignmentTarget = false;
  89782. this.context.isBindingElement = false;
  89783. var operator = this.nextToken().value;
  89784. var prefix = false;
  89785. expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix));
  89786. }
  89787. }
  89788. }
  89789. return expr;
  89790. };
  89791. // https://tc39.github.io/ecma262/#sec-unary-operators
  89792. Parser.prototype.parseAwaitExpression = function () {
  89793. var node = this.createNode();
  89794. this.nextToken();
  89795. var argument = this.parseUnaryExpression();
  89796. return this.finalize(node, new Node.AwaitExpression(argument));
  89797. };
  89798. Parser.prototype.parseUnaryExpression = function () {
  89799. var expr;
  89800. if (this.match('+') || this.match('-') || this.match('~') || this.match('!') ||
  89801. this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) {
  89802. var node = this.startNode(this.lookahead);
  89803. var token = this.nextToken();
  89804. expr = this.inheritCoverGrammar(this.parseUnaryExpression);
  89805. expr = this.finalize(node, new Node.UnaryExpression(token.value, expr));
  89806. if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) {
  89807. this.tolerateError(messages_1.Messages.StrictDelete);
  89808. }
  89809. this.context.isAssignmentTarget = false;
  89810. this.context.isBindingElement = false;
  89811. }
  89812. else if (this.context.await && this.matchContextualKeyword('await')) {
  89813. expr = this.parseAwaitExpression();
  89814. }
  89815. else {
  89816. expr = this.parseUpdateExpression();
  89817. }
  89818. return expr;
  89819. };
  89820. Parser.prototype.parseExponentiationExpression = function () {
  89821. var startToken = this.lookahead;
  89822. var expr = this.inheritCoverGrammar(this.parseUnaryExpression);
  89823. if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) {
  89824. this.nextToken();
  89825. this.context.isAssignmentTarget = false;
  89826. this.context.isBindingElement = false;
  89827. var left = expr;
  89828. var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
  89829. expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right));
  89830. }
  89831. return expr;
  89832. };
  89833. // https://tc39.github.io/ecma262/#sec-exp-operator
  89834. // https://tc39.github.io/ecma262/#sec-multiplicative-operators
  89835. // https://tc39.github.io/ecma262/#sec-additive-operators
  89836. // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators
  89837. // https://tc39.github.io/ecma262/#sec-relational-operators
  89838. // https://tc39.github.io/ecma262/#sec-equality-operators
  89839. // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators
  89840. // https://tc39.github.io/ecma262/#sec-binary-logical-operators
  89841. Parser.prototype.binaryPrecedence = function (token) {
  89842. var op = token.value;
  89843. var precedence;
  89844. if (token.type === 7 /* Punctuator */) {
  89845. precedence = this.operatorPrecedence[op] || 0;
  89846. }
  89847. else if (token.type === 4 /* Keyword */) {
  89848. precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0;
  89849. }
  89850. else {
  89851. precedence = 0;
  89852. }
  89853. return precedence;
  89854. };
  89855. Parser.prototype.parseBinaryExpression = function () {
  89856. var startToken = this.lookahead;
  89857. var expr = this.inheritCoverGrammar(this.parseExponentiationExpression);
  89858. var token = this.lookahead;
  89859. var prec = this.binaryPrecedence(token);
  89860. if (prec > 0) {
  89861. this.nextToken();
  89862. this.context.isAssignmentTarget = false;
  89863. this.context.isBindingElement = false;
  89864. var markers = [startToken, this.lookahead];
  89865. var left = expr;
  89866. var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
  89867. var stack = [left, token.value, right];
  89868. var precedences = [prec];
  89869. while (true) {
  89870. prec = this.binaryPrecedence(this.lookahead);
  89871. if (prec <= 0) {
  89872. break;
  89873. }
  89874. // Reduce: make a binary expression from the three topmost entries.
  89875. while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) {
  89876. right = stack.pop();
  89877. var operator = stack.pop();
  89878. precedences.pop();
  89879. left = stack.pop();
  89880. markers.pop();
  89881. var node = this.startNode(markers[markers.length - 1]);
  89882. stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right)));
  89883. }
  89884. // Shift.
  89885. stack.push(this.nextToken().value);
  89886. precedences.push(prec);
  89887. markers.push(this.lookahead);
  89888. stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression));
  89889. }
  89890. // Final reduce to clean-up the stack.
  89891. var i = stack.length - 1;
  89892. expr = stack[i];
  89893. var lastMarker = markers.pop();
  89894. while (i > 1) {
  89895. var marker = markers.pop();
  89896. var lastLineStart = lastMarker && lastMarker.lineStart;
  89897. var node = this.startNode(marker, lastLineStart);
  89898. var operator = stack[i - 1];
  89899. expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr));
  89900. i -= 2;
  89901. lastMarker = marker;
  89902. }
  89903. }
  89904. return expr;
  89905. };
  89906. // https://tc39.github.io/ecma262/#sec-conditional-operator
  89907. Parser.prototype.parseConditionalExpression = function () {
  89908. var startToken = this.lookahead;
  89909. var expr = this.inheritCoverGrammar(this.parseBinaryExpression);
  89910. if (this.match('?')) {
  89911. this.nextToken();
  89912. var previousAllowIn = this.context.allowIn;
  89913. this.context.allowIn = true;
  89914. var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression);
  89915. this.context.allowIn = previousAllowIn;
  89916. this.expect(':');
  89917. var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression);
  89918. expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate));
  89919. this.context.isAssignmentTarget = false;
  89920. this.context.isBindingElement = false;
  89921. }
  89922. return expr;
  89923. };
  89924. // https://tc39.github.io/ecma262/#sec-assignment-operators
  89925. Parser.prototype.checkPatternParam = function (options, param) {
  89926. switch (param.type) {
  89927. case syntax_1.Syntax.Identifier:
  89928. this.validateParam(options, param, param.name);
  89929. break;
  89930. case syntax_1.Syntax.RestElement:
  89931. this.checkPatternParam(options, param.argument);
  89932. break;
  89933. case syntax_1.Syntax.AssignmentPattern:
  89934. this.checkPatternParam(options, param.left);
  89935. break;
  89936. case syntax_1.Syntax.ArrayPattern:
  89937. for (var i = 0; i < param.elements.length; i++) {
  89938. if (param.elements[i] !== null) {
  89939. this.checkPatternParam(options, param.elements[i]);
  89940. }
  89941. }
  89942. break;
  89943. case syntax_1.Syntax.ObjectPattern:
  89944. for (var i = 0; i < param.properties.length; i++) {
  89945. this.checkPatternParam(options, param.properties[i].value);
  89946. }
  89947. break;
  89948. default:
  89949. break;
  89950. }
  89951. options.simple = options.simple && (param instanceof Node.Identifier);
  89952. };
  89953. Parser.prototype.reinterpretAsCoverFormalsList = function (expr) {
  89954. var params = [expr];
  89955. var options;
  89956. var asyncArrow = false;
  89957. switch (expr.type) {
  89958. case syntax_1.Syntax.Identifier:
  89959. break;
  89960. case ArrowParameterPlaceHolder:
  89961. params = expr.params;
  89962. asyncArrow = expr.async;
  89963. break;
  89964. default:
  89965. return null;
  89966. }
  89967. options = {
  89968. simple: true,
  89969. paramSet: {}
  89970. };
  89971. for (var i = 0; i < params.length; ++i) {
  89972. var param = params[i];
  89973. if (param.type === syntax_1.Syntax.AssignmentPattern) {
  89974. if (param.right.type === syntax_1.Syntax.YieldExpression) {
  89975. if (param.right.argument) {
  89976. this.throwUnexpectedToken(this.lookahead);
  89977. }
  89978. param.right.type = syntax_1.Syntax.Identifier;
  89979. param.right.name = 'yield';
  89980. delete param.right.argument;
  89981. delete param.right.delegate;
  89982. }
  89983. }
  89984. else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') {
  89985. this.throwUnexpectedToken(this.lookahead);
  89986. }
  89987. this.checkPatternParam(options, param);
  89988. params[i] = param;
  89989. }
  89990. if (this.context.strict || !this.context.allowYield) {
  89991. for (var i = 0; i < params.length; ++i) {
  89992. var param = params[i];
  89993. if (param.type === syntax_1.Syntax.YieldExpression) {
  89994. this.throwUnexpectedToken(this.lookahead);
  89995. }
  89996. }
  89997. }
  89998. if (options.message === messages_1.Messages.StrictParamDupe) {
  89999. var token = this.context.strict ? options.stricted : options.firstRestricted;
  90000. this.throwUnexpectedToken(token, options.message);
  90001. }
  90002. return {
  90003. simple: options.simple,
  90004. params: params,
  90005. stricted: options.stricted,
  90006. firstRestricted: options.firstRestricted,
  90007. message: options.message
  90008. };
  90009. };
  90010. Parser.prototype.parseAssignmentExpression = function () {
  90011. var expr;
  90012. if (!this.context.allowYield && this.matchKeyword('yield')) {
  90013. expr = this.parseYieldExpression();
  90014. }
  90015. else {
  90016. var startToken = this.lookahead;
  90017. var token = startToken;
  90018. expr = this.parseConditionalExpression();
  90019. if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') {
  90020. if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) {
  90021. var arg = this.parsePrimaryExpression();
  90022. this.reinterpretExpressionAsPattern(arg);
  90023. expr = {
  90024. type: ArrowParameterPlaceHolder,
  90025. params: [arg],
  90026. async: true
  90027. };
  90028. }
  90029. }
  90030. if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) {
  90031. // https://tc39.github.io/ecma262/#sec-arrow-function-definitions
  90032. this.context.isAssignmentTarget = false;
  90033. this.context.isBindingElement = false;
  90034. var isAsync = expr.async;
  90035. var list = this.reinterpretAsCoverFormalsList(expr);
  90036. if (list) {
  90037. if (this.hasLineTerminator) {
  90038. this.tolerateUnexpectedToken(this.lookahead);
  90039. }
  90040. this.context.firstCoverInitializedNameError = null;
  90041. var previousStrict = this.context.strict;
  90042. var previousAllowStrictDirective = this.context.allowStrictDirective;
  90043. this.context.allowStrictDirective = list.simple;
  90044. var previousAllowYield = this.context.allowYield;
  90045. var previousAwait = this.context.await;
  90046. this.context.allowYield = true;
  90047. this.context.await = isAsync;
  90048. var node = this.startNode(startToken);
  90049. this.expect('=>');
  90050. var body = void 0;
  90051. if (this.match('{')) {
  90052. var previousAllowIn = this.context.allowIn;
  90053. this.context.allowIn = true;
  90054. body = this.parseFunctionSourceElements();
  90055. this.context.allowIn = previousAllowIn;
  90056. }
  90057. else {
  90058. body = this.isolateCoverGrammar(this.parseAssignmentExpression);
  90059. }
  90060. var expression = body.type !== syntax_1.Syntax.BlockStatement;
  90061. if (this.context.strict && list.firstRestricted) {
  90062. this.throwUnexpectedToken(list.firstRestricted, list.message);
  90063. }
  90064. if (this.context.strict && list.stricted) {
  90065. this.tolerateUnexpectedToken(list.stricted, list.message);
  90066. }
  90067. expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) :
  90068. this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression));
  90069. this.context.strict = previousStrict;
  90070. this.context.allowStrictDirective = previousAllowStrictDirective;
  90071. this.context.allowYield = previousAllowYield;
  90072. this.context.await = previousAwait;
  90073. }
  90074. }
  90075. else {
  90076. if (this.matchAssign()) {
  90077. if (!this.context.isAssignmentTarget) {
  90078. this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
  90079. }
  90080. if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) {
  90081. var id = expr;
  90082. if (this.scanner.isRestrictedWord(id.name)) {
  90083. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment);
  90084. }
  90085. if (this.scanner.isStrictModeReservedWord(id.name)) {
  90086. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
  90087. }
  90088. }
  90089. if (!this.match('=')) {
  90090. this.context.isAssignmentTarget = false;
  90091. this.context.isBindingElement = false;
  90092. }
  90093. else {
  90094. this.reinterpretExpressionAsPattern(expr);
  90095. }
  90096. token = this.nextToken();
  90097. var operator = token.value;
  90098. var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
  90099. expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right));
  90100. this.context.firstCoverInitializedNameError = null;
  90101. }
  90102. }
  90103. }
  90104. return expr;
  90105. };
  90106. // https://tc39.github.io/ecma262/#sec-comma-operator
  90107. Parser.prototype.parseExpression = function () {
  90108. var startToken = this.lookahead;
  90109. var expr = this.isolateCoverGrammar(this.parseAssignmentExpression);
  90110. if (this.match(',')) {
  90111. var expressions = [];
  90112. expressions.push(expr);
  90113. while (this.lookahead.type !== 2 /* EOF */) {
  90114. if (!this.match(',')) {
  90115. break;
  90116. }
  90117. this.nextToken();
  90118. expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
  90119. }
  90120. expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
  90121. }
  90122. return expr;
  90123. };
  90124. // https://tc39.github.io/ecma262/#sec-block
  90125. Parser.prototype.parseStatementListItem = function () {
  90126. var statement;
  90127. this.context.isAssignmentTarget = true;
  90128. this.context.isBindingElement = true;
  90129. if (this.lookahead.type === 4 /* Keyword */) {
  90130. switch (this.lookahead.value) {
  90131. case 'export':
  90132. if (!this.context.isModule) {
  90133. this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration);
  90134. }
  90135. statement = this.parseExportDeclaration();
  90136. break;
  90137. case 'import':
  90138. if (!this.context.isModule) {
  90139. this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration);
  90140. }
  90141. statement = this.parseImportDeclaration();
  90142. break;
  90143. case 'const':
  90144. statement = this.parseLexicalDeclaration({ inFor: false });
  90145. break;
  90146. case 'function':
  90147. statement = this.parseFunctionDeclaration();
  90148. break;
  90149. case 'class':
  90150. statement = this.parseClassDeclaration();
  90151. break;
  90152. case 'let':
  90153. statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement();
  90154. break;
  90155. default:
  90156. statement = this.parseStatement();
  90157. break;
  90158. }
  90159. }
  90160. else {
  90161. statement = this.parseStatement();
  90162. }
  90163. return statement;
  90164. };
  90165. Parser.prototype.parseBlock = function () {
  90166. var node = this.createNode();
  90167. this.expect('{');
  90168. var block = [];
  90169. while (true) {
  90170. if (this.match('}')) {
  90171. break;
  90172. }
  90173. block.push(this.parseStatementListItem());
  90174. }
  90175. this.expect('}');
  90176. return this.finalize(node, new Node.BlockStatement(block));
  90177. };
  90178. // https://tc39.github.io/ecma262/#sec-let-and-const-declarations
  90179. Parser.prototype.parseLexicalBinding = function (kind, options) {
  90180. var node = this.createNode();
  90181. var params = [];
  90182. var id = this.parsePattern(params, kind);
  90183. if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
  90184. if (this.scanner.isRestrictedWord(id.name)) {
  90185. this.tolerateError(messages_1.Messages.StrictVarName);
  90186. }
  90187. }
  90188. var init = null;
  90189. if (kind === 'const') {
  90190. if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) {
  90191. if (this.match('=')) {
  90192. this.nextToken();
  90193. init = this.isolateCoverGrammar(this.parseAssignmentExpression);
  90194. }
  90195. else {
  90196. this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const');
  90197. }
  90198. }
  90199. }
  90200. else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) {
  90201. this.expect('=');
  90202. init = this.isolateCoverGrammar(this.parseAssignmentExpression);
  90203. }
  90204. return this.finalize(node, new Node.VariableDeclarator(id, init));
  90205. };
  90206. Parser.prototype.parseBindingList = function (kind, options) {
  90207. var list = [this.parseLexicalBinding(kind, options)];
  90208. while (this.match(',')) {
  90209. this.nextToken();
  90210. list.push(this.parseLexicalBinding(kind, options));
  90211. }
  90212. return list;
  90213. };
  90214. Parser.prototype.isLexicalDeclaration = function () {
  90215. var state = this.scanner.saveState();
  90216. this.scanner.scanComments();
  90217. var next = this.scanner.lex();
  90218. this.scanner.restoreState(state);
  90219. return (next.type === 3 /* Identifier */) ||
  90220. (next.type === 7 /* Punctuator */ && next.value === '[') ||
  90221. (next.type === 7 /* Punctuator */ && next.value === '{') ||
  90222. (next.type === 4 /* Keyword */ && next.value === 'let') ||
  90223. (next.type === 4 /* Keyword */ && next.value === 'yield');
  90224. };
  90225. Parser.prototype.parseLexicalDeclaration = function (options) {
  90226. var node = this.createNode();
  90227. var kind = this.nextToken().value;
  90228. assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const');
  90229. var declarations = this.parseBindingList(kind, options);
  90230. this.consumeSemicolon();
  90231. return this.finalize(node, new Node.VariableDeclaration(declarations, kind));
  90232. };
  90233. // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns
  90234. Parser.prototype.parseBindingRestElement = function (params, kind) {
  90235. var node = this.createNode();
  90236. this.expect('...');
  90237. var arg = this.parsePattern(params, kind);
  90238. return this.finalize(node, new Node.RestElement(arg));
  90239. };
  90240. Parser.prototype.parseArrayPattern = function (params, kind) {
  90241. var node = this.createNode();
  90242. this.expect('[');
  90243. var elements = [];
  90244. while (!this.match(']')) {
  90245. if (this.match(',')) {
  90246. this.nextToken();
  90247. elements.push(null);
  90248. }
  90249. else {
  90250. if (this.match('...')) {
  90251. elements.push(this.parseBindingRestElement(params, kind));
  90252. break;
  90253. }
  90254. else {
  90255. elements.push(this.parsePatternWithDefault(params, kind));
  90256. }
  90257. if (!this.match(']')) {
  90258. this.expect(',');
  90259. }
  90260. }
  90261. }
  90262. this.expect(']');
  90263. return this.finalize(node, new Node.ArrayPattern(elements));
  90264. };
  90265. Parser.prototype.parsePropertyPattern = function (params, kind) {
  90266. var node = this.createNode();
  90267. var computed = false;
  90268. var shorthand = false;
  90269. var method = false;
  90270. var key;
  90271. var value;
  90272. if (this.lookahead.type === 3 /* Identifier */) {
  90273. var keyToken = this.lookahead;
  90274. key = this.parseVariableIdentifier();
  90275. var init = this.finalize(node, new Node.Identifier(keyToken.value));
  90276. if (this.match('=')) {
  90277. params.push(keyToken);
  90278. shorthand = true;
  90279. this.nextToken();
  90280. var expr = this.parseAssignmentExpression();
  90281. value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr));
  90282. }
  90283. else if (!this.match(':')) {
  90284. params.push(keyToken);
  90285. shorthand = true;
  90286. value = init;
  90287. }
  90288. else {
  90289. this.expect(':');
  90290. value = this.parsePatternWithDefault(params, kind);
  90291. }
  90292. }
  90293. else {
  90294. computed = this.match('[');
  90295. key = this.parseObjectPropertyKey();
  90296. this.expect(':');
  90297. value = this.parsePatternWithDefault(params, kind);
  90298. }
  90299. return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand));
  90300. };
  90301. Parser.prototype.parseObjectPattern = function (params, kind) {
  90302. var node = this.createNode();
  90303. var properties = [];
  90304. this.expect('{');
  90305. while (!this.match('}')) {
  90306. properties.push(this.parsePropertyPattern(params, kind));
  90307. if (!this.match('}')) {
  90308. this.expect(',');
  90309. }
  90310. }
  90311. this.expect('}');
  90312. return this.finalize(node, new Node.ObjectPattern(properties));
  90313. };
  90314. Parser.prototype.parsePattern = function (params, kind) {
  90315. var pattern;
  90316. if (this.match('[')) {
  90317. pattern = this.parseArrayPattern(params, kind);
  90318. }
  90319. else if (this.match('{')) {
  90320. pattern = this.parseObjectPattern(params, kind);
  90321. }
  90322. else {
  90323. if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) {
  90324. this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding);
  90325. }
  90326. params.push(this.lookahead);
  90327. pattern = this.parseVariableIdentifier(kind);
  90328. }
  90329. return pattern;
  90330. };
  90331. Parser.prototype.parsePatternWithDefault = function (params, kind) {
  90332. var startToken = this.lookahead;
  90333. var pattern = this.parsePattern(params, kind);
  90334. if (this.match('=')) {
  90335. this.nextToken();
  90336. var previousAllowYield = this.context.allowYield;
  90337. this.context.allowYield = true;
  90338. var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
  90339. this.context.allowYield = previousAllowYield;
  90340. pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right));
  90341. }
  90342. return pattern;
  90343. };
  90344. // https://tc39.github.io/ecma262/#sec-variable-statement
  90345. Parser.prototype.parseVariableIdentifier = function (kind) {
  90346. var node = this.createNode();
  90347. var token = this.nextToken();
  90348. if (token.type === 4 /* Keyword */ && token.value === 'yield') {
  90349. if (this.context.strict) {
  90350. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
  90351. }
  90352. else if (!this.context.allowYield) {
  90353. this.throwUnexpectedToken(token);
  90354. }
  90355. }
  90356. else if (token.type !== 3 /* Identifier */) {
  90357. if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) {
  90358. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
  90359. }
  90360. else {
  90361. if (this.context.strict || token.value !== 'let' || kind !== 'var') {
  90362. this.throwUnexpectedToken(token);
  90363. }
  90364. }
  90365. }
  90366. else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') {
  90367. this.tolerateUnexpectedToken(token);
  90368. }
  90369. return this.finalize(node, new Node.Identifier(token.value));
  90370. };
  90371. Parser.prototype.parseVariableDeclaration = function (options) {
  90372. var node = this.createNode();
  90373. var params = [];
  90374. var id = this.parsePattern(params, 'var');
  90375. if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
  90376. if (this.scanner.isRestrictedWord(id.name)) {
  90377. this.tolerateError(messages_1.Messages.StrictVarName);
  90378. }
  90379. }
  90380. var init = null;
  90381. if (this.match('=')) {
  90382. this.nextToken();
  90383. init = this.isolateCoverGrammar(this.parseAssignmentExpression);
  90384. }
  90385. else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
  90386. this.expect('=');
  90387. }
  90388. return this.finalize(node, new Node.VariableDeclarator(id, init));
  90389. };
  90390. Parser.prototype.parseVariableDeclarationList = function (options) {
  90391. var opt = { inFor: options.inFor };
  90392. var list = [];
  90393. list.push(this.parseVariableDeclaration(opt));
  90394. while (this.match(',')) {
  90395. this.nextToken();
  90396. list.push(this.parseVariableDeclaration(opt));
  90397. }
  90398. return list;
  90399. };
  90400. Parser.prototype.parseVariableStatement = function () {
  90401. var node = this.createNode();
  90402. this.expectKeyword('var');
  90403. var declarations = this.parseVariableDeclarationList({ inFor: false });
  90404. this.consumeSemicolon();
  90405. return this.finalize(node, new Node.VariableDeclaration(declarations, 'var'));
  90406. };
  90407. // https://tc39.github.io/ecma262/#sec-empty-statement
  90408. Parser.prototype.parseEmptyStatement = function () {
  90409. var node = this.createNode();
  90410. this.expect(';');
  90411. return this.finalize(node, new Node.EmptyStatement());
  90412. };
  90413. // https://tc39.github.io/ecma262/#sec-expression-statement
  90414. Parser.prototype.parseExpressionStatement = function () {
  90415. var node = this.createNode();
  90416. var expr = this.parseExpression();
  90417. this.consumeSemicolon();
  90418. return this.finalize(node, new Node.ExpressionStatement(expr));
  90419. };
  90420. // https://tc39.github.io/ecma262/#sec-if-statement
  90421. Parser.prototype.parseIfClause = function () {
  90422. if (this.context.strict && this.matchKeyword('function')) {
  90423. this.tolerateError(messages_1.Messages.StrictFunction);
  90424. }
  90425. return this.parseStatement();
  90426. };
  90427. Parser.prototype.parseIfStatement = function () {
  90428. var node = this.createNode();
  90429. var consequent;
  90430. var alternate = null;
  90431. this.expectKeyword('if');
  90432. this.expect('(');
  90433. var test = this.parseExpression();
  90434. if (!this.match(')') && this.config.tolerant) {
  90435. this.tolerateUnexpectedToken(this.nextToken());
  90436. consequent = this.finalize(this.createNode(), new Node.EmptyStatement());
  90437. }
  90438. else {
  90439. this.expect(')');
  90440. consequent = this.parseIfClause();
  90441. if (this.matchKeyword('else')) {
  90442. this.nextToken();
  90443. alternate = this.parseIfClause();
  90444. }
  90445. }
  90446. return this.finalize(node, new Node.IfStatement(test, consequent, alternate));
  90447. };
  90448. // https://tc39.github.io/ecma262/#sec-do-while-statement
  90449. Parser.prototype.parseDoWhileStatement = function () {
  90450. var node = this.createNode();
  90451. this.expectKeyword('do');
  90452. var previousInIteration = this.context.inIteration;
  90453. this.context.inIteration = true;
  90454. var body = this.parseStatement();
  90455. this.context.inIteration = previousInIteration;
  90456. this.expectKeyword('while');
  90457. this.expect('(');
  90458. var test = this.parseExpression();
  90459. if (!this.match(')') && this.config.tolerant) {
  90460. this.tolerateUnexpectedToken(this.nextToken());
  90461. }
  90462. else {
  90463. this.expect(')');
  90464. if (this.match(';')) {
  90465. this.nextToken();
  90466. }
  90467. }
  90468. return this.finalize(node, new Node.DoWhileStatement(body, test));
  90469. };
  90470. // https://tc39.github.io/ecma262/#sec-while-statement
  90471. Parser.prototype.parseWhileStatement = function () {
  90472. var node = this.createNode();
  90473. var body;
  90474. this.expectKeyword('while');
  90475. this.expect('(');
  90476. var test = this.parseExpression();
  90477. if (!this.match(')') && this.config.tolerant) {
  90478. this.tolerateUnexpectedToken(this.nextToken());
  90479. body = this.finalize(this.createNode(), new Node.EmptyStatement());
  90480. }
  90481. else {
  90482. this.expect(')');
  90483. var previousInIteration = this.context.inIteration;
  90484. this.context.inIteration = true;
  90485. body = this.parseStatement();
  90486. this.context.inIteration = previousInIteration;
  90487. }
  90488. return this.finalize(node, new Node.WhileStatement(test, body));
  90489. };
  90490. // https://tc39.github.io/ecma262/#sec-for-statement
  90491. // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements
  90492. Parser.prototype.parseForStatement = function () {
  90493. var init = null;
  90494. var test = null;
  90495. var update = null;
  90496. var forIn = true;
  90497. var left, right;
  90498. var node = this.createNode();
  90499. this.expectKeyword('for');
  90500. this.expect('(');
  90501. if (this.match(';')) {
  90502. this.nextToken();
  90503. }
  90504. else {
  90505. if (this.matchKeyword('var')) {
  90506. init = this.createNode();
  90507. this.nextToken();
  90508. var previousAllowIn = this.context.allowIn;
  90509. this.context.allowIn = false;
  90510. var declarations = this.parseVariableDeclarationList({ inFor: true });
  90511. this.context.allowIn = previousAllowIn;
  90512. if (declarations.length === 1 && this.matchKeyword('in')) {
  90513. var decl = declarations[0];
  90514. if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
  90515. this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in');
  90516. }
  90517. init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
  90518. this.nextToken();
  90519. left = init;
  90520. right = this.parseExpression();
  90521. init = null;
  90522. }
  90523. else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
  90524. init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
  90525. this.nextToken();
  90526. left = init;
  90527. right = this.parseAssignmentExpression();
  90528. init = null;
  90529. forIn = false;
  90530. }
  90531. else {
  90532. init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
  90533. this.expect(';');
  90534. }
  90535. }
  90536. else if (this.matchKeyword('const') || this.matchKeyword('let')) {
  90537. init = this.createNode();
  90538. var kind = this.nextToken().value;
  90539. if (!this.context.strict && this.lookahead.value === 'in') {
  90540. init = this.finalize(init, new Node.Identifier(kind));
  90541. this.nextToken();
  90542. left = init;
  90543. right = this.parseExpression();
  90544. init = null;
  90545. }
  90546. else {
  90547. var previousAllowIn = this.context.allowIn;
  90548. this.context.allowIn = false;
  90549. var declarations = this.parseBindingList(kind, { inFor: true });
  90550. this.context.allowIn = previousAllowIn;
  90551. if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) {
  90552. init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
  90553. this.nextToken();
  90554. left = init;
  90555. right = this.parseExpression();
  90556. init = null;
  90557. }
  90558. else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
  90559. init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
  90560. this.nextToken();
  90561. left = init;
  90562. right = this.parseAssignmentExpression();
  90563. init = null;
  90564. forIn = false;
  90565. }
  90566. else {
  90567. this.consumeSemicolon();
  90568. init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
  90569. }
  90570. }
  90571. }
  90572. else {
  90573. var initStartToken = this.lookahead;
  90574. var previousAllowIn = this.context.allowIn;
  90575. this.context.allowIn = false;
  90576. init = this.inheritCoverGrammar(this.parseAssignmentExpression);
  90577. this.context.allowIn = previousAllowIn;
  90578. if (this.matchKeyword('in')) {
  90579. if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
  90580. this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
  90581. }
  90582. this.nextToken();
  90583. this.reinterpretExpressionAsPattern(init);
  90584. left = init;
  90585. right = this.parseExpression();
  90586. init = null;
  90587. }
  90588. else if (this.matchContextualKeyword('of')) {
  90589. if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
  90590. this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
  90591. }
  90592. this.nextToken();
  90593. this.reinterpretExpressionAsPattern(init);
  90594. left = init;
  90595. right = this.parseAssignmentExpression();
  90596. init = null;
  90597. forIn = false;
  90598. }
  90599. else {
  90600. if (this.match(',')) {
  90601. var initSeq = [init];
  90602. while (this.match(',')) {
  90603. this.nextToken();
  90604. initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
  90605. }
  90606. init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
  90607. }
  90608. this.expect(';');
  90609. }
  90610. }
  90611. }
  90612. if (typeof left === 'undefined') {
  90613. if (!this.match(';')) {
  90614. test = this.parseExpression();
  90615. }
  90616. this.expect(';');
  90617. if (!this.match(')')) {
  90618. update = this.parseExpression();
  90619. }
  90620. }
  90621. var body;
  90622. if (!this.match(')') && this.config.tolerant) {
  90623. this.tolerateUnexpectedToken(this.nextToken());
  90624. body = this.finalize(this.createNode(), new Node.EmptyStatement());
  90625. }
  90626. else {
  90627. this.expect(')');
  90628. var previousInIteration = this.context.inIteration;
  90629. this.context.inIteration = true;
  90630. body = this.isolateCoverGrammar(this.parseStatement);
  90631. this.context.inIteration = previousInIteration;
  90632. }
  90633. return (typeof left === 'undefined') ?
  90634. this.finalize(node, new Node.ForStatement(init, test, update, body)) :
  90635. forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) :
  90636. this.finalize(node, new Node.ForOfStatement(left, right, body));
  90637. };
  90638. // https://tc39.github.io/ecma262/#sec-continue-statement
  90639. Parser.prototype.parseContinueStatement = function () {
  90640. var node = this.createNode();
  90641. this.expectKeyword('continue');
  90642. var label = null;
  90643. if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
  90644. var id = this.parseVariableIdentifier();
  90645. label = id;
  90646. var key = '$' + id.name;
  90647. if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
  90648. this.throwError(messages_1.Messages.UnknownLabel, id.name);
  90649. }
  90650. }
  90651. this.consumeSemicolon();
  90652. if (label === null && !this.context.inIteration) {
  90653. this.throwError(messages_1.Messages.IllegalContinue);
  90654. }
  90655. return this.finalize(node, new Node.ContinueStatement(label));
  90656. };
  90657. // https://tc39.github.io/ecma262/#sec-break-statement
  90658. Parser.prototype.parseBreakStatement = function () {
  90659. var node = this.createNode();
  90660. this.expectKeyword('break');
  90661. var label = null;
  90662. if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
  90663. var id = this.parseVariableIdentifier();
  90664. var key = '$' + id.name;
  90665. if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
  90666. this.throwError(messages_1.Messages.UnknownLabel, id.name);
  90667. }
  90668. label = id;
  90669. }
  90670. this.consumeSemicolon();
  90671. if (label === null && !this.context.inIteration && !this.context.inSwitch) {
  90672. this.throwError(messages_1.Messages.IllegalBreak);
  90673. }
  90674. return this.finalize(node, new Node.BreakStatement(label));
  90675. };
  90676. // https://tc39.github.io/ecma262/#sec-return-statement
  90677. Parser.prototype.parseReturnStatement = function () {
  90678. if (!this.context.inFunctionBody) {
  90679. this.tolerateError(messages_1.Messages.IllegalReturn);
  90680. }
  90681. var node = this.createNode();
  90682. this.expectKeyword('return');
  90683. var hasArgument = (!this.match(';') && !this.match('}') &&
  90684. !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */) ||
  90685. this.lookahead.type === 8 /* StringLiteral */ ||
  90686. this.lookahead.type === 10 /* Template */;
  90687. var argument = hasArgument ? this.parseExpression() : null;
  90688. this.consumeSemicolon();
  90689. return this.finalize(node, new Node.ReturnStatement(argument));
  90690. };
  90691. // https://tc39.github.io/ecma262/#sec-with-statement
  90692. Parser.prototype.parseWithStatement = function () {
  90693. if (this.context.strict) {
  90694. this.tolerateError(messages_1.Messages.StrictModeWith);
  90695. }
  90696. var node = this.createNode();
  90697. var body;
  90698. this.expectKeyword('with');
  90699. this.expect('(');
  90700. var object = this.parseExpression();
  90701. if (!this.match(')') && this.config.tolerant) {
  90702. this.tolerateUnexpectedToken(this.nextToken());
  90703. body = this.finalize(this.createNode(), new Node.EmptyStatement());
  90704. }
  90705. else {
  90706. this.expect(')');
  90707. body = this.parseStatement();
  90708. }
  90709. return this.finalize(node, new Node.WithStatement(object, body));
  90710. };
  90711. // https://tc39.github.io/ecma262/#sec-switch-statement
  90712. Parser.prototype.parseSwitchCase = function () {
  90713. var node = this.createNode();
  90714. var test;
  90715. if (this.matchKeyword('default')) {
  90716. this.nextToken();
  90717. test = null;
  90718. }
  90719. else {
  90720. this.expectKeyword('case');
  90721. test = this.parseExpression();
  90722. }
  90723. this.expect(':');
  90724. var consequent = [];
  90725. while (true) {
  90726. if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) {
  90727. break;
  90728. }
  90729. consequent.push(this.parseStatementListItem());
  90730. }
  90731. return this.finalize(node, new Node.SwitchCase(test, consequent));
  90732. };
  90733. Parser.prototype.parseSwitchStatement = function () {
  90734. var node = this.createNode();
  90735. this.expectKeyword('switch');
  90736. this.expect('(');
  90737. var discriminant = this.parseExpression();
  90738. this.expect(')');
  90739. var previousInSwitch = this.context.inSwitch;
  90740. this.context.inSwitch = true;
  90741. var cases = [];
  90742. var defaultFound = false;
  90743. this.expect('{');
  90744. while (true) {
  90745. if (this.match('}')) {
  90746. break;
  90747. }
  90748. var clause = this.parseSwitchCase();
  90749. if (clause.test === null) {
  90750. if (defaultFound) {
  90751. this.throwError(messages_1.Messages.MultipleDefaultsInSwitch);
  90752. }
  90753. defaultFound = true;
  90754. }
  90755. cases.push(clause);
  90756. }
  90757. this.expect('}');
  90758. this.context.inSwitch = previousInSwitch;
  90759. return this.finalize(node, new Node.SwitchStatement(discriminant, cases));
  90760. };
  90761. // https://tc39.github.io/ecma262/#sec-labelled-statements
  90762. Parser.prototype.parseLabelledStatement = function () {
  90763. var node = this.createNode();
  90764. var expr = this.parseExpression();
  90765. var statement;
  90766. if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) {
  90767. this.nextToken();
  90768. var id = expr;
  90769. var key = '$' + id.name;
  90770. if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
  90771. this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name);
  90772. }
  90773. this.context.labelSet[key] = true;
  90774. var body = void 0;
  90775. if (this.matchKeyword('class')) {
  90776. this.tolerateUnexpectedToken(this.lookahead);
  90777. body = this.parseClassDeclaration();
  90778. }
  90779. else if (this.matchKeyword('function')) {
  90780. var token = this.lookahead;
  90781. var declaration = this.parseFunctionDeclaration();
  90782. if (this.context.strict) {
  90783. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction);
  90784. }
  90785. else if (declaration.generator) {
  90786. this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext);
  90787. }
  90788. body = declaration;
  90789. }
  90790. else {
  90791. body = this.parseStatement();
  90792. }
  90793. delete this.context.labelSet[key];
  90794. statement = new Node.LabeledStatement(id, body);
  90795. }
  90796. else {
  90797. this.consumeSemicolon();
  90798. statement = new Node.ExpressionStatement(expr);
  90799. }
  90800. return this.finalize(node, statement);
  90801. };
  90802. // https://tc39.github.io/ecma262/#sec-throw-statement
  90803. Parser.prototype.parseThrowStatement = function () {
  90804. var node = this.createNode();
  90805. this.expectKeyword('throw');
  90806. if (this.hasLineTerminator) {
  90807. this.throwError(messages_1.Messages.NewlineAfterThrow);
  90808. }
  90809. var argument = this.parseExpression();
  90810. this.consumeSemicolon();
  90811. return this.finalize(node, new Node.ThrowStatement(argument));
  90812. };
  90813. // https://tc39.github.io/ecma262/#sec-try-statement
  90814. Parser.prototype.parseCatchClause = function () {
  90815. var node = this.createNode();
  90816. this.expectKeyword('catch');
  90817. this.expect('(');
  90818. if (this.match(')')) {
  90819. this.throwUnexpectedToken(this.lookahead);
  90820. }
  90821. var params = [];
  90822. var param = this.parsePattern(params);
  90823. var paramMap = {};
  90824. for (var i = 0; i < params.length; i++) {
  90825. var key = '$' + params[i].value;
  90826. if (Object.prototype.hasOwnProperty.call(paramMap, key)) {
  90827. this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value);
  90828. }
  90829. paramMap[key] = true;
  90830. }
  90831. if (this.context.strict && param.type === syntax_1.Syntax.Identifier) {
  90832. if (this.scanner.isRestrictedWord(param.name)) {
  90833. this.tolerateError(messages_1.Messages.StrictCatchVariable);
  90834. }
  90835. }
  90836. this.expect(')');
  90837. var body = this.parseBlock();
  90838. return this.finalize(node, new Node.CatchClause(param, body));
  90839. };
  90840. Parser.prototype.parseFinallyClause = function () {
  90841. this.expectKeyword('finally');
  90842. return this.parseBlock();
  90843. };
  90844. Parser.prototype.parseTryStatement = function () {
  90845. var node = this.createNode();
  90846. this.expectKeyword('try');
  90847. var block = this.parseBlock();
  90848. var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null;
  90849. var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null;
  90850. if (!handler && !finalizer) {
  90851. this.throwError(messages_1.Messages.NoCatchOrFinally);
  90852. }
  90853. return this.finalize(node, new Node.TryStatement(block, handler, finalizer));
  90854. };
  90855. // https://tc39.github.io/ecma262/#sec-debugger-statement
  90856. Parser.prototype.parseDebuggerStatement = function () {
  90857. var node = this.createNode();
  90858. this.expectKeyword('debugger');
  90859. this.consumeSemicolon();
  90860. return this.finalize(node, new Node.DebuggerStatement());
  90861. };
  90862. // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations
  90863. Parser.prototype.parseStatement = function () {
  90864. var statement;
  90865. switch (this.lookahead.type) {
  90866. case 1 /* BooleanLiteral */:
  90867. case 5 /* NullLiteral */:
  90868. case 6 /* NumericLiteral */:
  90869. case 8 /* StringLiteral */:
  90870. case 10 /* Template */:
  90871. case 9 /* RegularExpression */:
  90872. statement = this.parseExpressionStatement();
  90873. break;
  90874. case 7 /* Punctuator */:
  90875. var value = this.lookahead.value;
  90876. if (value === '{') {
  90877. statement = this.parseBlock();
  90878. }
  90879. else if (value === '(') {
  90880. statement = this.parseExpressionStatement();
  90881. }
  90882. else if (value === ';') {
  90883. statement = this.parseEmptyStatement();
  90884. }
  90885. else {
  90886. statement = this.parseExpressionStatement();
  90887. }
  90888. break;
  90889. case 3 /* Identifier */:
  90890. statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement();
  90891. break;
  90892. case 4 /* Keyword */:
  90893. switch (this.lookahead.value) {
  90894. case 'break':
  90895. statement = this.parseBreakStatement();
  90896. break;
  90897. case 'continue':
  90898. statement = this.parseContinueStatement();
  90899. break;
  90900. case 'debugger':
  90901. statement = this.parseDebuggerStatement();
  90902. break;
  90903. case 'do':
  90904. statement = this.parseDoWhileStatement();
  90905. break;
  90906. case 'for':
  90907. statement = this.parseForStatement();
  90908. break;
  90909. case 'function':
  90910. statement = this.parseFunctionDeclaration();
  90911. break;
  90912. case 'if':
  90913. statement = this.parseIfStatement();
  90914. break;
  90915. case 'return':
  90916. statement = this.parseReturnStatement();
  90917. break;
  90918. case 'switch':
  90919. statement = this.parseSwitchStatement();
  90920. break;
  90921. case 'throw':
  90922. statement = this.parseThrowStatement();
  90923. break;
  90924. case 'try':
  90925. statement = this.parseTryStatement();
  90926. break;
  90927. case 'var':
  90928. statement = this.parseVariableStatement();
  90929. break;
  90930. case 'while':
  90931. statement = this.parseWhileStatement();
  90932. break;
  90933. case 'with':
  90934. statement = this.parseWithStatement();
  90935. break;
  90936. default:
  90937. statement = this.parseExpressionStatement();
  90938. break;
  90939. }
  90940. break;
  90941. default:
  90942. statement = this.throwUnexpectedToken(this.lookahead);
  90943. }
  90944. return statement;
  90945. };
  90946. // https://tc39.github.io/ecma262/#sec-function-definitions
  90947. Parser.prototype.parseFunctionSourceElements = function () {
  90948. var node = this.createNode();
  90949. this.expect('{');
  90950. var body = this.parseDirectivePrologues();
  90951. var previousLabelSet = this.context.labelSet;
  90952. var previousInIteration = this.context.inIteration;
  90953. var previousInSwitch = this.context.inSwitch;
  90954. var previousInFunctionBody = this.context.inFunctionBody;
  90955. this.context.labelSet = {};
  90956. this.context.inIteration = false;
  90957. this.context.inSwitch = false;
  90958. this.context.inFunctionBody = true;
  90959. while (this.lookahead.type !== 2 /* EOF */) {
  90960. if (this.match('}')) {
  90961. break;
  90962. }
  90963. body.push(this.parseStatementListItem());
  90964. }
  90965. this.expect('}');
  90966. this.context.labelSet = previousLabelSet;
  90967. this.context.inIteration = previousInIteration;
  90968. this.context.inSwitch = previousInSwitch;
  90969. this.context.inFunctionBody = previousInFunctionBody;
  90970. return this.finalize(node, new Node.BlockStatement(body));
  90971. };
  90972. Parser.prototype.validateParam = function (options, param, name) {
  90973. var key = '$' + name;
  90974. if (this.context.strict) {
  90975. if (this.scanner.isRestrictedWord(name)) {
  90976. options.stricted = param;
  90977. options.message = messages_1.Messages.StrictParamName;
  90978. }
  90979. if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
  90980. options.stricted = param;
  90981. options.message = messages_1.Messages.StrictParamDupe;
  90982. }
  90983. }
  90984. else if (!options.firstRestricted) {
  90985. if (this.scanner.isRestrictedWord(name)) {
  90986. options.firstRestricted = param;
  90987. options.message = messages_1.Messages.StrictParamName;
  90988. }
  90989. else if (this.scanner.isStrictModeReservedWord(name)) {
  90990. options.firstRestricted = param;
  90991. options.message = messages_1.Messages.StrictReservedWord;
  90992. }
  90993. else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
  90994. options.stricted = param;
  90995. options.message = messages_1.Messages.StrictParamDupe;
  90996. }
  90997. }
  90998. /* istanbul ignore next */
  90999. if (typeof Object.defineProperty === 'function') {
  91000. Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true });
  91001. }
  91002. else {
  91003. options.paramSet[key] = true;
  91004. }
  91005. };
  91006. Parser.prototype.parseRestElement = function (params) {
  91007. var node = this.createNode();
  91008. this.expect('...');
  91009. var arg = this.parsePattern(params);
  91010. if (this.match('=')) {
  91011. this.throwError(messages_1.Messages.DefaultRestParameter);
  91012. }
  91013. if (!this.match(')')) {
  91014. this.throwError(messages_1.Messages.ParameterAfterRestParameter);
  91015. }
  91016. return this.finalize(node, new Node.RestElement(arg));
  91017. };
  91018. Parser.prototype.parseFormalParameter = function (options) {
  91019. var params = [];
  91020. var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params);
  91021. for (var i = 0; i < params.length; i++) {
  91022. this.validateParam(options, params[i], params[i].value);
  91023. }
  91024. options.simple = options.simple && (param instanceof Node.Identifier);
  91025. options.params.push(param);
  91026. };
  91027. Parser.prototype.parseFormalParameters = function (firstRestricted) {
  91028. var options;
  91029. options = {
  91030. simple: true,
  91031. params: [],
  91032. firstRestricted: firstRestricted
  91033. };
  91034. this.expect('(');
  91035. if (!this.match(')')) {
  91036. options.paramSet = {};
  91037. while (this.lookahead.type !== 2 /* EOF */) {
  91038. this.parseFormalParameter(options);
  91039. if (this.match(')')) {
  91040. break;
  91041. }
  91042. this.expect(',');
  91043. if (this.match(')')) {
  91044. break;
  91045. }
  91046. }
  91047. }
  91048. this.expect(')');
  91049. return {
  91050. simple: options.simple,
  91051. params: options.params,
  91052. stricted: options.stricted,
  91053. firstRestricted: options.firstRestricted,
  91054. message: options.message
  91055. };
  91056. };
  91057. Parser.prototype.matchAsyncFunction = function () {
  91058. var match = this.matchContextualKeyword('async');
  91059. if (match) {
  91060. var state = this.scanner.saveState();
  91061. this.scanner.scanComments();
  91062. var next = this.scanner.lex();
  91063. this.scanner.restoreState(state);
  91064. match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function');
  91065. }
  91066. return match;
  91067. };
  91068. Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) {
  91069. var node = this.createNode();
  91070. var isAsync = this.matchContextualKeyword('async');
  91071. if (isAsync) {
  91072. this.nextToken();
  91073. }
  91074. this.expectKeyword('function');
  91075. var isGenerator = isAsync ? false : this.match('*');
  91076. if (isGenerator) {
  91077. this.nextToken();
  91078. }
  91079. var message;
  91080. var id = null;
  91081. var firstRestricted = null;
  91082. if (!identifierIsOptional || !this.match('(')) {
  91083. var token = this.lookahead;
  91084. id = this.parseVariableIdentifier();
  91085. if (this.context.strict) {
  91086. if (this.scanner.isRestrictedWord(token.value)) {
  91087. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
  91088. }
  91089. }
  91090. else {
  91091. if (this.scanner.isRestrictedWord(token.value)) {
  91092. firstRestricted = token;
  91093. message = messages_1.Messages.StrictFunctionName;
  91094. }
  91095. else if (this.scanner.isStrictModeReservedWord(token.value)) {
  91096. firstRestricted = token;
  91097. message = messages_1.Messages.StrictReservedWord;
  91098. }
  91099. }
  91100. }
  91101. var previousAllowAwait = this.context.await;
  91102. var previousAllowYield = this.context.allowYield;
  91103. this.context.await = isAsync;
  91104. this.context.allowYield = !isGenerator;
  91105. var formalParameters = this.parseFormalParameters(firstRestricted);
  91106. var params = formalParameters.params;
  91107. var stricted = formalParameters.stricted;
  91108. firstRestricted = formalParameters.firstRestricted;
  91109. if (formalParameters.message) {
  91110. message = formalParameters.message;
  91111. }
  91112. var previousStrict = this.context.strict;
  91113. var previousAllowStrictDirective = this.context.allowStrictDirective;
  91114. this.context.allowStrictDirective = formalParameters.simple;
  91115. var body = this.parseFunctionSourceElements();
  91116. if (this.context.strict && firstRestricted) {
  91117. this.throwUnexpectedToken(firstRestricted, message);
  91118. }
  91119. if (this.context.strict && stricted) {
  91120. this.tolerateUnexpectedToken(stricted, message);
  91121. }
  91122. this.context.strict = previousStrict;
  91123. this.context.allowStrictDirective = previousAllowStrictDirective;
  91124. this.context.await = previousAllowAwait;
  91125. this.context.allowYield = previousAllowYield;
  91126. return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) :
  91127. this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator));
  91128. };
  91129. Parser.prototype.parseFunctionExpression = function () {
  91130. var node = this.createNode();
  91131. var isAsync = this.matchContextualKeyword('async');
  91132. if (isAsync) {
  91133. this.nextToken();
  91134. }
  91135. this.expectKeyword('function');
  91136. var isGenerator = isAsync ? false : this.match('*');
  91137. if (isGenerator) {
  91138. this.nextToken();
  91139. }
  91140. var message;
  91141. var id = null;
  91142. var firstRestricted;
  91143. var previousAllowAwait = this.context.await;
  91144. var previousAllowYield = this.context.allowYield;
  91145. this.context.await = isAsync;
  91146. this.context.allowYield = !isGenerator;
  91147. if (!this.match('(')) {
  91148. var token = this.lookahead;
  91149. id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier();
  91150. if (this.context.strict) {
  91151. if (this.scanner.isRestrictedWord(token.value)) {
  91152. this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
  91153. }
  91154. }
  91155. else {
  91156. if (this.scanner.isRestrictedWord(token.value)) {
  91157. firstRestricted = token;
  91158. message = messages_1.Messages.StrictFunctionName;
  91159. }
  91160. else if (this.scanner.isStrictModeReservedWord(token.value)) {
  91161. firstRestricted = token;
  91162. message = messages_1.Messages.StrictReservedWord;
  91163. }
  91164. }
  91165. }
  91166. var formalParameters = this.parseFormalParameters(firstRestricted);
  91167. var params = formalParameters.params;
  91168. var stricted = formalParameters.stricted;
  91169. firstRestricted = formalParameters.firstRestricted;
  91170. if (formalParameters.message) {
  91171. message = formalParameters.message;
  91172. }
  91173. var previousStrict = this.context.strict;
  91174. var previousAllowStrictDirective = this.context.allowStrictDirective;
  91175. this.context.allowStrictDirective = formalParameters.simple;
  91176. var body = this.parseFunctionSourceElements();
  91177. if (this.context.strict && firstRestricted) {
  91178. this.throwUnexpectedToken(firstRestricted, message);
  91179. }
  91180. if (this.context.strict && stricted) {
  91181. this.tolerateUnexpectedToken(stricted, message);
  91182. }
  91183. this.context.strict = previousStrict;
  91184. this.context.allowStrictDirective = previousAllowStrictDirective;
  91185. this.context.await = previousAllowAwait;
  91186. this.context.allowYield = previousAllowYield;
  91187. return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) :
  91188. this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator));
  91189. };
  91190. // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive
  91191. Parser.prototype.parseDirective = function () {
  91192. var token = this.lookahead;
  91193. var node = this.createNode();
  91194. var expr = this.parseExpression();
  91195. var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null;
  91196. this.consumeSemicolon();
  91197. return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr));
  91198. };
  91199. Parser.prototype.parseDirectivePrologues = function () {
  91200. var firstRestricted = null;
  91201. var body = [];
  91202. while (true) {
  91203. var token = this.lookahead;
  91204. if (token.type !== 8 /* StringLiteral */) {
  91205. break;
  91206. }
  91207. var statement = this.parseDirective();
  91208. body.push(statement);
  91209. var directive = statement.directive;
  91210. if (typeof directive !== 'string') {
  91211. break;
  91212. }
  91213. if (directive === 'use strict') {
  91214. this.context.strict = true;
  91215. if (firstRestricted) {
  91216. this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral);
  91217. }
  91218. if (!this.context.allowStrictDirective) {
  91219. this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective);
  91220. }
  91221. }
  91222. else {
  91223. if (!firstRestricted && token.octal) {
  91224. firstRestricted = token;
  91225. }
  91226. }
  91227. }
  91228. return body;
  91229. };
  91230. // https://tc39.github.io/ecma262/#sec-method-definitions
  91231. Parser.prototype.qualifiedPropertyName = function (token) {
  91232. switch (token.type) {
  91233. case 3 /* Identifier */:
  91234. case 8 /* StringLiteral */:
  91235. case 1 /* BooleanLiteral */:
  91236. case 5 /* NullLiteral */:
  91237. case 6 /* NumericLiteral */:
  91238. case 4 /* Keyword */:
  91239. return true;
  91240. case 7 /* Punctuator */:
  91241. return token.value === '[';
  91242. default:
  91243. break;
  91244. }
  91245. return false;
  91246. };
  91247. Parser.prototype.parseGetterMethod = function () {
  91248. var node = this.createNode();
  91249. var isGenerator = false;
  91250. var previousAllowYield = this.context.allowYield;
  91251. this.context.allowYield = !isGenerator;
  91252. var formalParameters = this.parseFormalParameters();
  91253. if (formalParameters.params.length > 0) {
  91254. this.tolerateError(messages_1.Messages.BadGetterArity);
  91255. }
  91256. var method = this.parsePropertyMethod(formalParameters);
  91257. this.context.allowYield = previousAllowYield;
  91258. return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
  91259. };
  91260. Parser.prototype.parseSetterMethod = function () {
  91261. var node = this.createNode();
  91262. var isGenerator = false;
  91263. var previousAllowYield = this.context.allowYield;
  91264. this.context.allowYield = !isGenerator;
  91265. var formalParameters = this.parseFormalParameters();
  91266. if (formalParameters.params.length !== 1) {
  91267. this.tolerateError(messages_1.Messages.BadSetterArity);
  91268. }
  91269. else if (formalParameters.params[0] instanceof Node.RestElement) {
  91270. this.tolerateError(messages_1.Messages.BadSetterRestParameter);
  91271. }
  91272. var method = this.parsePropertyMethod(formalParameters);
  91273. this.context.allowYield = previousAllowYield;
  91274. return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
  91275. };
  91276. Parser.prototype.parseGeneratorMethod = function () {
  91277. var node = this.createNode();
  91278. var isGenerator = true;
  91279. var previousAllowYield = this.context.allowYield;
  91280. this.context.allowYield = true;
  91281. var params = this.parseFormalParameters();
  91282. this.context.allowYield = false;
  91283. var method = this.parsePropertyMethod(params);
  91284. this.context.allowYield = previousAllowYield;
  91285. return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
  91286. };
  91287. // https://tc39.github.io/ecma262/#sec-generator-function-definitions
  91288. Parser.prototype.isStartOfExpression = function () {
  91289. var start = true;
  91290. var value = this.lookahead.value;
  91291. switch (this.lookahead.type) {
  91292. case 7 /* Punctuator */:
  91293. start = (value === '[') || (value === '(') || (value === '{') ||
  91294. (value === '+') || (value === '-') ||
  91295. (value === '!') || (value === '~') ||
  91296. (value === '++') || (value === '--') ||
  91297. (value === '/') || (value === '/='); // regular expression literal
  91298. break;
  91299. case 4 /* Keyword */:
  91300. start = (value === 'class') || (value === 'delete') ||
  91301. (value === 'function') || (value === 'let') || (value === 'new') ||
  91302. (value === 'super') || (value === 'this') || (value === 'typeof') ||
  91303. (value === 'void') || (value === 'yield');
  91304. break;
  91305. default:
  91306. break;
  91307. }
  91308. return start;
  91309. };
  91310. Parser.prototype.parseYieldExpression = function () {
  91311. var node = this.createNode();
  91312. this.expectKeyword('yield');
  91313. var argument = null;
  91314. var delegate = false;
  91315. if (!this.hasLineTerminator) {
  91316. var previousAllowYield = this.context.allowYield;
  91317. this.context.allowYield = false;
  91318. delegate = this.match('*');
  91319. if (delegate) {
  91320. this.nextToken();
  91321. argument = this.parseAssignmentExpression();
  91322. }
  91323. else if (this.isStartOfExpression()) {
  91324. argument = this.parseAssignmentExpression();
  91325. }
  91326. this.context.allowYield = previousAllowYield;
  91327. }
  91328. return this.finalize(node, new Node.YieldExpression(argument, delegate));
  91329. };
  91330. // https://tc39.github.io/ecma262/#sec-class-definitions
  91331. Parser.prototype.parseClassElement = function (hasConstructor) {
  91332. var token = this.lookahead;
  91333. var node = this.createNode();
  91334. var kind = '';
  91335. var key = null;
  91336. var value = null;
  91337. var computed = false;
  91338. var method = false;
  91339. var isStatic = false;
  91340. var isAsync = false;
  91341. if (this.match('*')) {
  91342. this.nextToken();
  91343. }
  91344. else {
  91345. computed = this.match('[');
  91346. key = this.parseObjectPropertyKey();
  91347. var id = key;
  91348. if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) {
  91349. token = this.lookahead;
  91350. isStatic = true;
  91351. computed = this.match('[');
  91352. if (this.match('*')) {
  91353. this.nextToken();
  91354. }
  91355. else {
  91356. key = this.parseObjectPropertyKey();
  91357. }
  91358. }
  91359. if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) {
  91360. var punctuator = this.lookahead.value;
  91361. if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') {
  91362. isAsync = true;
  91363. token = this.lookahead;
  91364. key = this.parseObjectPropertyKey();
  91365. if (token.type === 3 /* Identifier */ && token.value === 'constructor') {
  91366. this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync);
  91367. }
  91368. }
  91369. }
  91370. }
  91371. var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
  91372. if (token.type === 3 /* Identifier */) {
  91373. if (token.value === 'get' && lookaheadPropertyKey) {
  91374. kind = 'get';
  91375. computed = this.match('[');
  91376. key = this.parseObjectPropertyKey();
  91377. this.context.allowYield = false;
  91378. value = this.parseGetterMethod();
  91379. }
  91380. else if (token.value === 'set' && lookaheadPropertyKey) {
  91381. kind = 'set';
  91382. computed = this.match('[');
  91383. key = this.parseObjectPropertyKey();
  91384. value = this.parseSetterMethod();
  91385. }
  91386. }
  91387. else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) {
  91388. kind = 'init';
  91389. computed = this.match('[');
  91390. key = this.parseObjectPropertyKey();
  91391. value = this.parseGeneratorMethod();
  91392. method = true;
  91393. }
  91394. if (!kind && key && this.match('(')) {
  91395. kind = 'init';
  91396. value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
  91397. method = true;
  91398. }
  91399. if (!kind) {
  91400. this.throwUnexpectedToken(this.lookahead);
  91401. }
  91402. if (kind === 'init') {
  91403. kind = 'method';
  91404. }
  91405. if (!computed) {
  91406. if (isStatic && this.isPropertyKey(key, 'prototype')) {
  91407. this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype);
  91408. }
  91409. if (!isStatic && this.isPropertyKey(key, 'constructor')) {
  91410. if (kind !== 'method' || !method || (value && value.generator)) {
  91411. this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod);
  91412. }
  91413. if (hasConstructor.value) {
  91414. this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor);
  91415. }
  91416. else {
  91417. hasConstructor.value = true;
  91418. }
  91419. kind = 'constructor';
  91420. }
  91421. }
  91422. return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic));
  91423. };
  91424. Parser.prototype.parseClassElementList = function () {
  91425. var body = [];
  91426. var hasConstructor = { value: false };
  91427. this.expect('{');
  91428. while (!this.match('}')) {
  91429. if (this.match(';')) {
  91430. this.nextToken();
  91431. }
  91432. else {
  91433. body.push(this.parseClassElement(hasConstructor));
  91434. }
  91435. }
  91436. this.expect('}');
  91437. return body;
  91438. };
  91439. Parser.prototype.parseClassBody = function () {
  91440. var node = this.createNode();
  91441. var elementList = this.parseClassElementList();
  91442. return this.finalize(node, new Node.ClassBody(elementList));
  91443. };
  91444. Parser.prototype.parseClassDeclaration = function (identifierIsOptional) {
  91445. var node = this.createNode();
  91446. var previousStrict = this.context.strict;
  91447. this.context.strict = true;
  91448. this.expectKeyword('class');
  91449. var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier();
  91450. var superClass = null;
  91451. if (this.matchKeyword('extends')) {
  91452. this.nextToken();
  91453. superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
  91454. }
  91455. var classBody = this.parseClassBody();
  91456. this.context.strict = previousStrict;
  91457. return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody));
  91458. };
  91459. Parser.prototype.parseClassExpression = function () {
  91460. var node = this.createNode();
  91461. var previousStrict = this.context.strict;
  91462. this.context.strict = true;
  91463. this.expectKeyword('class');
  91464. var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null;
  91465. var superClass = null;
  91466. if (this.matchKeyword('extends')) {
  91467. this.nextToken();
  91468. superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
  91469. }
  91470. var classBody = this.parseClassBody();
  91471. this.context.strict = previousStrict;
  91472. return this.finalize(node, new Node.ClassExpression(id, superClass, classBody));
  91473. };
  91474. // https://tc39.github.io/ecma262/#sec-scripts
  91475. // https://tc39.github.io/ecma262/#sec-modules
  91476. Parser.prototype.parseModule = function () {
  91477. this.context.strict = true;
  91478. this.context.isModule = true;
  91479. this.scanner.isModule = true;
  91480. var node = this.createNode();
  91481. var body = this.parseDirectivePrologues();
  91482. while (this.lookahead.type !== 2 /* EOF */) {
  91483. body.push(this.parseStatementListItem());
  91484. }
  91485. return this.finalize(node, new Node.Module(body));
  91486. };
  91487. Parser.prototype.parseScript = function () {
  91488. var node = this.createNode();
  91489. var body = this.parseDirectivePrologues();
  91490. while (this.lookahead.type !== 2 /* EOF */) {
  91491. body.push(this.parseStatementListItem());
  91492. }
  91493. return this.finalize(node, new Node.Script(body));
  91494. };
  91495. // https://tc39.github.io/ecma262/#sec-imports
  91496. Parser.prototype.parseModuleSpecifier = function () {
  91497. var node = this.createNode();
  91498. if (this.lookahead.type !== 8 /* StringLiteral */) {
  91499. this.throwError(messages_1.Messages.InvalidModuleSpecifier);
  91500. }
  91501. var token = this.nextToken();
  91502. var raw = this.getTokenRaw(token);
  91503. return this.finalize(node, new Node.Literal(token.value, raw));
  91504. };
  91505. // import {<foo as bar>} ...;
  91506. Parser.prototype.parseImportSpecifier = function () {
  91507. var node = this.createNode();
  91508. var imported;
  91509. var local;
  91510. if (this.lookahead.type === 3 /* Identifier */) {
  91511. imported = this.parseVariableIdentifier();
  91512. local = imported;
  91513. if (this.matchContextualKeyword('as')) {
  91514. this.nextToken();
  91515. local = this.parseVariableIdentifier();
  91516. }
  91517. }
  91518. else {
  91519. imported = this.parseIdentifierName();
  91520. local = imported;
  91521. if (this.matchContextualKeyword('as')) {
  91522. this.nextToken();
  91523. local = this.parseVariableIdentifier();
  91524. }
  91525. else {
  91526. this.throwUnexpectedToken(this.nextToken());
  91527. }
  91528. }
  91529. return this.finalize(node, new Node.ImportSpecifier(local, imported));
  91530. };
  91531. // {foo, bar as bas}
  91532. Parser.prototype.parseNamedImports = function () {
  91533. this.expect('{');
  91534. var specifiers = [];
  91535. while (!this.match('}')) {
  91536. specifiers.push(this.parseImportSpecifier());
  91537. if (!this.match('}')) {
  91538. this.expect(',');
  91539. }
  91540. }
  91541. this.expect('}');
  91542. return specifiers;
  91543. };
  91544. // import <foo> ...;
  91545. Parser.prototype.parseImportDefaultSpecifier = function () {
  91546. var node = this.createNode();
  91547. var local = this.parseIdentifierName();
  91548. return this.finalize(node, new Node.ImportDefaultSpecifier(local));
  91549. };
  91550. // import <* as foo> ...;
  91551. Parser.prototype.parseImportNamespaceSpecifier = function () {
  91552. var node = this.createNode();
  91553. this.expect('*');
  91554. if (!this.matchContextualKeyword('as')) {
  91555. this.throwError(messages_1.Messages.NoAsAfterImportNamespace);
  91556. }
  91557. this.nextToken();
  91558. var local = this.parseIdentifierName();
  91559. return this.finalize(node, new Node.ImportNamespaceSpecifier(local));
  91560. };
  91561. Parser.prototype.parseImportDeclaration = function () {
  91562. if (this.context.inFunctionBody) {
  91563. this.throwError(messages_1.Messages.IllegalImportDeclaration);
  91564. }
  91565. var node = this.createNode();
  91566. this.expectKeyword('import');
  91567. var src;
  91568. var specifiers = [];
  91569. if (this.lookahead.type === 8 /* StringLiteral */) {
  91570. // import 'foo';
  91571. src = this.parseModuleSpecifier();
  91572. }
  91573. else {
  91574. if (this.match('{')) {
  91575. // import {bar}
  91576. specifiers = specifiers.concat(this.parseNamedImports());
  91577. }
  91578. else if (this.match('*')) {
  91579. // import * as foo
  91580. specifiers.push(this.parseImportNamespaceSpecifier());
  91581. }
  91582. else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) {
  91583. // import foo
  91584. specifiers.push(this.parseImportDefaultSpecifier());
  91585. if (this.match(',')) {
  91586. this.nextToken();
  91587. if (this.match('*')) {
  91588. // import foo, * as foo
  91589. specifiers.push(this.parseImportNamespaceSpecifier());
  91590. }
  91591. else if (this.match('{')) {
  91592. // import foo, {bar}
  91593. specifiers = specifiers.concat(this.parseNamedImports());
  91594. }
  91595. else {
  91596. this.throwUnexpectedToken(this.lookahead);
  91597. }
  91598. }
  91599. }
  91600. else {
  91601. this.throwUnexpectedToken(this.nextToken());
  91602. }
  91603. if (!this.matchContextualKeyword('from')) {
  91604. var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
  91605. this.throwError(message, this.lookahead.value);
  91606. }
  91607. this.nextToken();
  91608. src = this.parseModuleSpecifier();
  91609. }
  91610. this.consumeSemicolon();
  91611. return this.finalize(node, new Node.ImportDeclaration(specifiers, src));
  91612. };
  91613. // https://tc39.github.io/ecma262/#sec-exports
  91614. Parser.prototype.parseExportSpecifier = function () {
  91615. var node = this.createNode();
  91616. var local = this.parseIdentifierName();
  91617. var exported = local;
  91618. if (this.matchContextualKeyword('as')) {
  91619. this.nextToken();
  91620. exported = this.parseIdentifierName();
  91621. }
  91622. return this.finalize(node, new Node.ExportSpecifier(local, exported));
  91623. };
  91624. Parser.prototype.parseExportDeclaration = function () {
  91625. if (this.context.inFunctionBody) {
  91626. this.throwError(messages_1.Messages.IllegalExportDeclaration);
  91627. }
  91628. var node = this.createNode();
  91629. this.expectKeyword('export');
  91630. var exportDeclaration;
  91631. if (this.matchKeyword('default')) {
  91632. // export default ...
  91633. this.nextToken();
  91634. if (this.matchKeyword('function')) {
  91635. // export default function foo () {}
  91636. // export default function () {}
  91637. var declaration = this.parseFunctionDeclaration(true);
  91638. exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
  91639. }
  91640. else if (this.matchKeyword('class')) {
  91641. // export default class foo {}
  91642. var declaration = this.parseClassDeclaration(true);
  91643. exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
  91644. }
  91645. else if (this.matchContextualKeyword('async')) {
  91646. // export default async function f () {}
  91647. // export default async function () {}
  91648. // export default async x => x
  91649. var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression();
  91650. exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
  91651. }
  91652. else {
  91653. if (this.matchContextualKeyword('from')) {
  91654. this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value);
  91655. }
  91656. // export default {};
  91657. // export default [];
  91658. // export default (1 + 2);
  91659. var declaration = this.match('{') ? this.parseObjectInitializer() :
  91660. this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression();
  91661. this.consumeSemicolon();
  91662. exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
  91663. }
  91664. }
  91665. else if (this.match('*')) {
  91666. // export * from 'foo';
  91667. this.nextToken();
  91668. if (!this.matchContextualKeyword('from')) {
  91669. var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
  91670. this.throwError(message, this.lookahead.value);
  91671. }
  91672. this.nextToken();
  91673. var src = this.parseModuleSpecifier();
  91674. this.consumeSemicolon();
  91675. exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src));
  91676. }
  91677. else if (this.lookahead.type === 4 /* Keyword */) {
  91678. // export var f = 1;
  91679. var declaration = void 0;
  91680. switch (this.lookahead.value) {
  91681. case 'let':
  91682. case 'const':
  91683. declaration = this.parseLexicalDeclaration({ inFor: false });
  91684. break;
  91685. case 'var':
  91686. case 'class':
  91687. case 'function':
  91688. declaration = this.parseStatementListItem();
  91689. break;
  91690. default:
  91691. this.throwUnexpectedToken(this.lookahead);
  91692. }
  91693. exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
  91694. }
  91695. else if (this.matchAsyncFunction()) {
  91696. var declaration = this.parseFunctionDeclaration();
  91697. exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
  91698. }
  91699. else {
  91700. var specifiers = [];
  91701. var source = null;
  91702. var isExportFromIdentifier = false;
  91703. this.expect('{');
  91704. while (!this.match('}')) {
  91705. isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default');
  91706. specifiers.push(this.parseExportSpecifier());
  91707. if (!this.match('}')) {
  91708. this.expect(',');
  91709. }
  91710. }
  91711. this.expect('}');
  91712. if (this.matchContextualKeyword('from')) {
  91713. // export {default} from 'foo';
  91714. // export {foo} from 'foo';
  91715. this.nextToken();
  91716. source = this.parseModuleSpecifier();
  91717. this.consumeSemicolon();
  91718. }
  91719. else if (isExportFromIdentifier) {
  91720. // export {default}; // missing fromClause
  91721. var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
  91722. this.throwError(message, this.lookahead.value);
  91723. }
  91724. else {
  91725. // export {foo};
  91726. this.consumeSemicolon();
  91727. }
  91728. exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source));
  91729. }
  91730. return exportDeclaration;
  91731. };
  91732. return Parser;
  91733. }());
  91734. exports.Parser = Parser;
  91735. /***/ },
  91736. /* 9 */
  91737. /***/ function(module, exports) {
  91738. "use strict";
  91739. // Ensure the condition is true, otherwise throw an error.
  91740. // This is only to have a better contract semantic, i.e. another safety net
  91741. // to catch a logic error. The condition shall be fulfilled in normal case.
  91742. // Do NOT use this to enforce a certain condition on any user input.
  91743. Object.defineProperty(exports, "__esModule", { value: true });
  91744. function assert(condition, message) {
  91745. /* istanbul ignore if */
  91746. if (!condition) {
  91747. throw new Error('ASSERT: ' + message);
  91748. }
  91749. }
  91750. exports.assert = assert;
  91751. /***/ },
  91752. /* 10 */
  91753. /***/ function(module, exports) {
  91754. "use strict";
  91755. /* tslint:disable:max-classes-per-file */
  91756. Object.defineProperty(exports, "__esModule", { value: true });
  91757. var ErrorHandler = (function () {
  91758. function ErrorHandler() {
  91759. this.errors = [];
  91760. this.tolerant = false;
  91761. }
  91762. ErrorHandler.prototype.recordError = function (error) {
  91763. this.errors.push(error);
  91764. };
  91765. ErrorHandler.prototype.tolerate = function (error) {
  91766. if (this.tolerant) {
  91767. this.recordError(error);
  91768. }
  91769. else {
  91770. throw error;
  91771. }
  91772. };
  91773. ErrorHandler.prototype.constructError = function (msg, column) {
  91774. var error = new Error(msg);
  91775. try {
  91776. throw error;
  91777. }
  91778. catch (base) {
  91779. /* istanbul ignore else */
  91780. if (Object.create && Object.defineProperty) {
  91781. error = Object.create(base);
  91782. Object.defineProperty(error, 'column', { value: column });
  91783. }
  91784. }
  91785. /* istanbul ignore next */
  91786. return error;
  91787. };
  91788. ErrorHandler.prototype.createError = function (index, line, col, description) {
  91789. var msg = 'Line ' + line + ': ' + description;
  91790. var error = this.constructError(msg, col);
  91791. error.index = index;
  91792. error.lineNumber = line;
  91793. error.description = description;
  91794. return error;
  91795. };
  91796. ErrorHandler.prototype.throwError = function (index, line, col, description) {
  91797. throw this.createError(index, line, col, description);
  91798. };
  91799. ErrorHandler.prototype.tolerateError = function (index, line, col, description) {
  91800. var error = this.createError(index, line, col, description);
  91801. if (this.tolerant) {
  91802. this.recordError(error);
  91803. }
  91804. else {
  91805. throw error;
  91806. }
  91807. };
  91808. return ErrorHandler;
  91809. }());
  91810. exports.ErrorHandler = ErrorHandler;
  91811. /***/ },
  91812. /* 11 */
  91813. /***/ function(module, exports) {
  91814. "use strict";
  91815. Object.defineProperty(exports, "__esModule", { value: true });
  91816. // Error messages should be identical to V8.
  91817. exports.Messages = {
  91818. BadGetterArity: 'Getter must not have any formal parameters',
  91819. BadSetterArity: 'Setter must have exactly one formal parameter',
  91820. BadSetterRestParameter: 'Setter function argument must not be a rest parameter',
  91821. ConstructorIsAsync: 'Class constructor may not be an async method',
  91822. ConstructorSpecialMethod: 'Class constructor may not be an accessor',
  91823. DeclarationMissingInitializer: 'Missing initializer in %0 declaration',
  91824. DefaultRestParameter: 'Unexpected token =',
  91825. DuplicateBinding: 'Duplicate binding %0',
  91826. DuplicateConstructor: 'A class may only have one constructor',
  91827. DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals',
  91828. ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer',
  91829. GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts',
  91830. IllegalBreak: 'Illegal break statement',
  91831. IllegalContinue: 'Illegal continue statement',
  91832. IllegalExportDeclaration: 'Unexpected token',
  91833. IllegalImportDeclaration: 'Unexpected token',
  91834. IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list',
  91835. IllegalReturn: 'Illegal return statement',
  91836. InvalidEscapedReservedWord: 'Keyword must not contain escaped characters',
  91837. InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence',
  91838. InvalidLHSInAssignment: 'Invalid left-hand side in assignment',
  91839. InvalidLHSInForIn: 'Invalid left-hand side in for-in',
  91840. InvalidLHSInForLoop: 'Invalid left-hand side in for-loop',
  91841. InvalidModuleSpecifier: 'Unexpected token',
  91842. InvalidRegExp: 'Invalid regular expression',
  91843. LetInLexicalBinding: 'let is disallowed as a lexically bound name',
  91844. MissingFromClause: 'Unexpected token',
  91845. MultipleDefaultsInSwitch: 'More than one default clause in switch statement',
  91846. NewlineAfterThrow: 'Illegal newline after throw',
  91847. NoAsAfterImportNamespace: 'Unexpected token',
  91848. NoCatchOrFinally: 'Missing catch or finally after try',
  91849. ParameterAfterRestParameter: 'Rest parameter must be last formal parameter',
  91850. Redeclaration: '%0 \'%1\' has already been declared',
  91851. StaticPrototype: 'Classes may not have static property named prototype',
  91852. StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
  91853. StrictDelete: 'Delete of an unqualified identifier in strict mode.',
  91854. StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block',
  91855. StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
  91856. StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
  91857. StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
  91858. StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
  91859. StrictModeWith: 'Strict mode code may not include a with statement',
  91860. StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
  91861. StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
  91862. StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
  91863. StrictReservedWord: 'Use of future reserved word in strict mode',
  91864. StrictVarName: 'Variable name may not be eval or arguments in strict mode',
  91865. TemplateOctalLiteral: 'Octal literals are not allowed in template strings.',
  91866. UnexpectedEOS: 'Unexpected end of input',
  91867. UnexpectedIdentifier: 'Unexpected identifier',
  91868. UnexpectedNumber: 'Unexpected number',
  91869. UnexpectedReserved: 'Unexpected reserved word',
  91870. UnexpectedString: 'Unexpected string',
  91871. UnexpectedTemplate: 'Unexpected quasi %0',
  91872. UnexpectedToken: 'Unexpected token %0',
  91873. UnexpectedTokenIllegal: 'Unexpected token ILLEGAL',
  91874. UnknownLabel: 'Undefined label \'%0\'',
  91875. UnterminatedRegExp: 'Invalid regular expression: missing /'
  91876. };
  91877. /***/ },
  91878. /* 12 */
  91879. /***/ function(module, exports, __webpack_require__) {
  91880. "use strict";
  91881. Object.defineProperty(exports, "__esModule", { value: true });
  91882. var assert_1 = __webpack_require__(9);
  91883. var character_1 = __webpack_require__(4);
  91884. var messages_1 = __webpack_require__(11);
  91885. function hexValue(ch) {
  91886. return '0123456789abcdef'.indexOf(ch.toLowerCase());
  91887. }
  91888. function octalValue(ch) {
  91889. return '01234567'.indexOf(ch);
  91890. }
  91891. var Scanner = (function () {
  91892. function Scanner(code, handler) {
  91893. this.source = code;
  91894. this.errorHandler = handler;
  91895. this.trackComment = false;
  91896. this.isModule = false;
  91897. this.length = code.length;
  91898. this.index = 0;
  91899. this.lineNumber = (code.length > 0) ? 1 : 0;
  91900. this.lineStart = 0;
  91901. this.curlyStack = [];
  91902. }
  91903. Scanner.prototype.saveState = function () {
  91904. return {
  91905. index: this.index,
  91906. lineNumber: this.lineNumber,
  91907. lineStart: this.lineStart
  91908. };
  91909. };
  91910. Scanner.prototype.restoreState = function (state) {
  91911. this.index = state.index;
  91912. this.lineNumber = state.lineNumber;
  91913. this.lineStart = state.lineStart;
  91914. };
  91915. Scanner.prototype.eof = function () {
  91916. return this.index >= this.length;
  91917. };
  91918. Scanner.prototype.throwUnexpectedToken = function (message) {
  91919. if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; }
  91920. return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
  91921. };
  91922. Scanner.prototype.tolerateUnexpectedToken = function (message) {
  91923. if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; }
  91924. this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
  91925. };
  91926. // https://tc39.github.io/ecma262/#sec-comments
  91927. Scanner.prototype.skipSingleLineComment = function (offset) {
  91928. var comments = [];
  91929. var start, loc;
  91930. if (this.trackComment) {
  91931. comments = [];
  91932. start = this.index - offset;
  91933. loc = {
  91934. start: {
  91935. line: this.lineNumber,
  91936. column: this.index - this.lineStart - offset
  91937. },
  91938. end: {}
  91939. };
  91940. }
  91941. while (!this.eof()) {
  91942. var ch = this.source.charCodeAt(this.index);
  91943. ++this.index;
  91944. if (character_1.Character.isLineTerminator(ch)) {
  91945. if (this.trackComment) {
  91946. loc.end = {
  91947. line: this.lineNumber,
  91948. column: this.index - this.lineStart - 1
  91949. };
  91950. var entry = {
  91951. multiLine: false,
  91952. slice: [start + offset, this.index - 1],
  91953. range: [start, this.index - 1],
  91954. loc: loc
  91955. };
  91956. comments.push(entry);
  91957. }
  91958. if (ch === 13 && this.source.charCodeAt(this.index) === 10) {
  91959. ++this.index;
  91960. }
  91961. ++this.lineNumber;
  91962. this.lineStart = this.index;
  91963. return comments;
  91964. }
  91965. }
  91966. if (this.trackComment) {
  91967. loc.end = {
  91968. line: this.lineNumber,
  91969. column: this.index - this.lineStart
  91970. };
  91971. var entry = {
  91972. multiLine: false,
  91973. slice: [start + offset, this.index],
  91974. range: [start, this.index],
  91975. loc: loc
  91976. };
  91977. comments.push(entry);
  91978. }
  91979. return comments;
  91980. };
  91981. Scanner.prototype.skipMultiLineComment = function () {
  91982. var comments = [];
  91983. var start, loc;
  91984. if (this.trackComment) {
  91985. comments = [];
  91986. start = this.index - 2;
  91987. loc = {
  91988. start: {
  91989. line: this.lineNumber,
  91990. column: this.index - this.lineStart - 2
  91991. },
  91992. end: {}
  91993. };
  91994. }
  91995. while (!this.eof()) {
  91996. var ch = this.source.charCodeAt(this.index);
  91997. if (character_1.Character.isLineTerminator(ch)) {
  91998. if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) {
  91999. ++this.index;
  92000. }
  92001. ++this.lineNumber;
  92002. ++this.index;
  92003. this.lineStart = this.index;
  92004. }
  92005. else if (ch === 0x2A) {
  92006. // Block comment ends with '*/'.
  92007. if (this.source.charCodeAt(this.index + 1) === 0x2F) {
  92008. this.index += 2;
  92009. if (this.trackComment) {
  92010. loc.end = {
  92011. line: this.lineNumber,
  92012. column: this.index - this.lineStart
  92013. };
  92014. var entry = {
  92015. multiLine: true,
  92016. slice: [start + 2, this.index - 2],
  92017. range: [start, this.index],
  92018. loc: loc
  92019. };
  92020. comments.push(entry);
  92021. }
  92022. return comments;
  92023. }
  92024. ++this.index;
  92025. }
  92026. else {
  92027. ++this.index;
  92028. }
  92029. }
  92030. // Ran off the end of the file - the whole thing is a comment
  92031. if (this.trackComment) {
  92032. loc.end = {
  92033. line: this.lineNumber,
  92034. column: this.index - this.lineStart
  92035. };
  92036. var entry = {
  92037. multiLine: true,
  92038. slice: [start + 2, this.index],
  92039. range: [start, this.index],
  92040. loc: loc
  92041. };
  92042. comments.push(entry);
  92043. }
  92044. this.tolerateUnexpectedToken();
  92045. return comments;
  92046. };
  92047. Scanner.prototype.scanComments = function () {
  92048. var comments;
  92049. if (this.trackComment) {
  92050. comments = [];
  92051. }
  92052. var start = (this.index === 0);
  92053. while (!this.eof()) {
  92054. var ch = this.source.charCodeAt(this.index);
  92055. if (character_1.Character.isWhiteSpace(ch)) {
  92056. ++this.index;
  92057. }
  92058. else if (character_1.Character.isLineTerminator(ch)) {
  92059. ++this.index;
  92060. if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) {
  92061. ++this.index;
  92062. }
  92063. ++this.lineNumber;
  92064. this.lineStart = this.index;
  92065. start = true;
  92066. }
  92067. else if (ch === 0x2F) {
  92068. ch = this.source.charCodeAt(this.index + 1);
  92069. if (ch === 0x2F) {
  92070. this.index += 2;
  92071. var comment = this.skipSingleLineComment(2);
  92072. if (this.trackComment) {
  92073. comments = comments.concat(comment);
  92074. }
  92075. start = true;
  92076. }
  92077. else if (ch === 0x2A) {
  92078. this.index += 2;
  92079. var comment = this.skipMultiLineComment();
  92080. if (this.trackComment) {
  92081. comments = comments.concat(comment);
  92082. }
  92083. }
  92084. else {
  92085. break;
  92086. }
  92087. }
  92088. else if (start && ch === 0x2D) {
  92089. // U+003E is '>'
  92090. if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) {
  92091. // '-->' is a single-line comment
  92092. this.index += 3;
  92093. var comment = this.skipSingleLineComment(3);
  92094. if (this.trackComment) {
  92095. comments = comments.concat(comment);
  92096. }
  92097. }
  92098. else {
  92099. break;
  92100. }
  92101. }
  92102. else if (ch === 0x3C && !this.isModule) {
  92103. if (this.source.slice(this.index + 1, this.index + 4) === '!--') {
  92104. this.index += 4; // `<!--`
  92105. var comment = this.skipSingleLineComment(4);
  92106. if (this.trackComment) {
  92107. comments = comments.concat(comment);
  92108. }
  92109. }
  92110. else {
  92111. break;
  92112. }
  92113. }
  92114. else {
  92115. break;
  92116. }
  92117. }
  92118. return comments;
  92119. };
  92120. // https://tc39.github.io/ecma262/#sec-future-reserved-words
  92121. Scanner.prototype.isFutureReservedWord = function (id) {
  92122. switch (id) {
  92123. case 'enum':
  92124. case 'export':
  92125. case 'import':
  92126. case 'super':
  92127. return true;
  92128. default:
  92129. return false;
  92130. }
  92131. };
  92132. Scanner.prototype.isStrictModeReservedWord = function (id) {
  92133. switch (id) {
  92134. case 'implements':
  92135. case 'interface':
  92136. case 'package':
  92137. case 'private':
  92138. case 'protected':
  92139. case 'public':
  92140. case 'static':
  92141. case 'yield':
  92142. case 'let':
  92143. return true;
  92144. default:
  92145. return false;
  92146. }
  92147. };
  92148. Scanner.prototype.isRestrictedWord = function (id) {
  92149. return id === 'eval' || id === 'arguments';
  92150. };
  92151. // https://tc39.github.io/ecma262/#sec-keywords
  92152. Scanner.prototype.isKeyword = function (id) {
  92153. switch (id.length) {
  92154. case 2:
  92155. return (id === 'if') || (id === 'in') || (id === 'do');
  92156. case 3:
  92157. return (id === 'var') || (id === 'for') || (id === 'new') ||
  92158. (id === 'try') || (id === 'let');
  92159. case 4:
  92160. return (id === 'this') || (id === 'else') || (id === 'case') ||
  92161. (id === 'void') || (id === 'with') || (id === 'enum');
  92162. case 5:
  92163. return (id === 'while') || (id === 'break') || (id === 'catch') ||
  92164. (id === 'throw') || (id === 'const') || (id === 'yield') ||
  92165. (id === 'class') || (id === 'super');
  92166. case 6:
  92167. return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
  92168. (id === 'switch') || (id === 'export') || (id === 'import');
  92169. case 7:
  92170. return (id === 'default') || (id === 'finally') || (id === 'extends');
  92171. case 8:
  92172. return (id === 'function') || (id === 'continue') || (id === 'debugger');
  92173. case 10:
  92174. return (id === 'instanceof');
  92175. default:
  92176. return false;
  92177. }
  92178. };
  92179. Scanner.prototype.codePointAt = function (i) {
  92180. var cp = this.source.charCodeAt(i);
  92181. if (cp >= 0xD800 && cp <= 0xDBFF) {
  92182. var second = this.source.charCodeAt(i + 1);
  92183. if (second >= 0xDC00 && second <= 0xDFFF) {
  92184. var first = cp;
  92185. cp = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
  92186. }
  92187. }
  92188. return cp;
  92189. };
  92190. Scanner.prototype.scanHexEscape = function (prefix) {
  92191. var len = (prefix === 'u') ? 4 : 2;
  92192. var code = 0;
  92193. for (var i = 0; i < len; ++i) {
  92194. if (!this.eof() && character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
  92195. code = code * 16 + hexValue(this.source[this.index++]);
  92196. }
  92197. else {
  92198. return null;
  92199. }
  92200. }
  92201. return String.fromCharCode(code);
  92202. };
  92203. Scanner.prototype.scanUnicodeCodePointEscape = function () {
  92204. var ch = this.source[this.index];
  92205. var code = 0;
  92206. // At least, one hex digit is required.
  92207. if (ch === '}') {
  92208. this.throwUnexpectedToken();
  92209. }
  92210. while (!this.eof()) {
  92211. ch = this.source[this.index++];
  92212. if (!character_1.Character.isHexDigit(ch.charCodeAt(0))) {
  92213. break;
  92214. }
  92215. code = code * 16 + hexValue(ch);
  92216. }
  92217. if (code > 0x10FFFF || ch !== '}') {
  92218. this.throwUnexpectedToken();
  92219. }
  92220. return character_1.Character.fromCodePoint(code);
  92221. };
  92222. Scanner.prototype.getIdentifier = function () {
  92223. var start = this.index++;
  92224. while (!this.eof()) {
  92225. var ch = this.source.charCodeAt(this.index);
  92226. if (ch === 0x5C) {
  92227. // Blackslash (U+005C) marks Unicode escape sequence.
  92228. this.index = start;
  92229. return this.getComplexIdentifier();
  92230. }
  92231. else if (ch >= 0xD800 && ch < 0xDFFF) {
  92232. // Need to handle surrogate pairs.
  92233. this.index = start;
  92234. return this.getComplexIdentifier();
  92235. }
  92236. if (character_1.Character.isIdentifierPart(ch)) {
  92237. ++this.index;
  92238. }
  92239. else {
  92240. break;
  92241. }
  92242. }
  92243. return this.source.slice(start, this.index);
  92244. };
  92245. Scanner.prototype.getComplexIdentifier = function () {
  92246. var cp = this.codePointAt(this.index);
  92247. var id = character_1.Character.fromCodePoint(cp);
  92248. this.index += id.length;
  92249. // '\u' (U+005C, U+0075) denotes an escaped character.
  92250. var ch;
  92251. if (cp === 0x5C) {
  92252. if (this.source.charCodeAt(this.index) !== 0x75) {
  92253. this.throwUnexpectedToken();
  92254. }
  92255. ++this.index;
  92256. if (this.source[this.index] === '{') {
  92257. ++this.index;
  92258. ch = this.scanUnicodeCodePointEscape();
  92259. }
  92260. else {
  92261. ch = this.scanHexEscape('u');
  92262. if (ch === null || ch === '\\' || !character_1.Character.isIdentifierStart(ch.charCodeAt(0))) {
  92263. this.throwUnexpectedToken();
  92264. }
  92265. }
  92266. id = ch;
  92267. }
  92268. while (!this.eof()) {
  92269. cp = this.codePointAt(this.index);
  92270. if (!character_1.Character.isIdentifierPart(cp)) {
  92271. break;
  92272. }
  92273. ch = character_1.Character.fromCodePoint(cp);
  92274. id += ch;
  92275. this.index += ch.length;
  92276. // '\u' (U+005C, U+0075) denotes an escaped character.
  92277. if (cp === 0x5C) {
  92278. id = id.substr(0, id.length - 1);
  92279. if (this.source.charCodeAt(this.index) !== 0x75) {
  92280. this.throwUnexpectedToken();
  92281. }
  92282. ++this.index;
  92283. if (this.source[this.index] === '{') {
  92284. ++this.index;
  92285. ch = this.scanUnicodeCodePointEscape();
  92286. }
  92287. else {
  92288. ch = this.scanHexEscape('u');
  92289. if (ch === null || ch === '\\' || !character_1.Character.isIdentifierPart(ch.charCodeAt(0))) {
  92290. this.throwUnexpectedToken();
  92291. }
  92292. }
  92293. id += ch;
  92294. }
  92295. }
  92296. return id;
  92297. };
  92298. Scanner.prototype.octalToDecimal = function (ch) {
  92299. // \0 is not octal escape sequence
  92300. var octal = (ch !== '0');
  92301. var code = octalValue(ch);
  92302. if (!this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
  92303. octal = true;
  92304. code = code * 8 + octalValue(this.source[this.index++]);
  92305. // 3 digits are only allowed when string starts
  92306. // with 0, 1, 2, 3
  92307. if ('0123'.indexOf(ch) >= 0 && !this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
  92308. code = code * 8 + octalValue(this.source[this.index++]);
  92309. }
  92310. }
  92311. return {
  92312. code: code,
  92313. octal: octal
  92314. };
  92315. };
  92316. // https://tc39.github.io/ecma262/#sec-names-and-keywords
  92317. Scanner.prototype.scanIdentifier = function () {
  92318. var type;
  92319. var start = this.index;
  92320. // Backslash (U+005C) starts an escaped character.
  92321. var id = (this.source.charCodeAt(start) === 0x5C) ? this.getComplexIdentifier() : this.getIdentifier();
  92322. // There is no keyword or literal with only one character.
  92323. // Thus, it must be an identifier.
  92324. if (id.length === 1) {
  92325. type = 3 /* Identifier */;
  92326. }
  92327. else if (this.isKeyword(id)) {
  92328. type = 4 /* Keyword */;
  92329. }
  92330. else if (id === 'null') {
  92331. type = 5 /* NullLiteral */;
  92332. }
  92333. else if (id === 'true' || id === 'false') {
  92334. type = 1 /* BooleanLiteral */;
  92335. }
  92336. else {
  92337. type = 3 /* Identifier */;
  92338. }
  92339. if (type !== 3 /* Identifier */ && (start + id.length !== this.index)) {
  92340. var restore = this.index;
  92341. this.index = start;
  92342. this.tolerateUnexpectedToken(messages_1.Messages.InvalidEscapedReservedWord);
  92343. this.index = restore;
  92344. }
  92345. return {
  92346. type: type,
  92347. value: id,
  92348. lineNumber: this.lineNumber,
  92349. lineStart: this.lineStart,
  92350. start: start,
  92351. end: this.index
  92352. };
  92353. };
  92354. // https://tc39.github.io/ecma262/#sec-punctuators
  92355. Scanner.prototype.scanPunctuator = function () {
  92356. var start = this.index;
  92357. // Check for most common single-character punctuators.
  92358. var str = this.source[this.index];
  92359. switch (str) {
  92360. case '(':
  92361. case '{':
  92362. if (str === '{') {
  92363. this.curlyStack.push('{');
  92364. }
  92365. ++this.index;
  92366. break;
  92367. case '.':
  92368. ++this.index;
  92369. if (this.source[this.index] === '.' && this.source[this.index + 1] === '.') {
  92370. // Spread operator: ...
  92371. this.index += 2;
  92372. str = '...';
  92373. }
  92374. break;
  92375. case '}':
  92376. ++this.index;
  92377. this.curlyStack.pop();
  92378. break;
  92379. case ')':
  92380. case ';':
  92381. case ',':
  92382. case '[':
  92383. case ']':
  92384. case ':':
  92385. case '?':
  92386. case '~':
  92387. ++this.index;
  92388. break;
  92389. default:
  92390. // 4-character punctuator.
  92391. str = this.source.substr(this.index, 4);
  92392. if (str === '>>>=') {
  92393. this.index += 4;
  92394. }
  92395. else {
  92396. // 3-character punctuators.
  92397. str = str.substr(0, 3);
  92398. if (str === '===' || str === '!==' || str === '>>>' ||
  92399. str === '<<=' || str === '>>=' || str === '**=') {
  92400. this.index += 3;
  92401. }
  92402. else {
  92403. // 2-character punctuators.
  92404. str = str.substr(0, 2);
  92405. if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
  92406. str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
  92407. str === '++' || str === '--' || str === '<<' || str === '>>' ||
  92408. str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
  92409. str === '<=' || str === '>=' || str === '=>' || str === '**') {
  92410. this.index += 2;
  92411. }
  92412. else {
  92413. // 1-character punctuators.
  92414. str = this.source[this.index];
  92415. if ('<>=!+-*%&|^/'.indexOf(str) >= 0) {
  92416. ++this.index;
  92417. }
  92418. }
  92419. }
  92420. }
  92421. }
  92422. if (this.index === start) {
  92423. this.throwUnexpectedToken();
  92424. }
  92425. return {
  92426. type: 7 /* Punctuator */,
  92427. value: str,
  92428. lineNumber: this.lineNumber,
  92429. lineStart: this.lineStart,
  92430. start: start,
  92431. end: this.index
  92432. };
  92433. };
  92434. // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
  92435. Scanner.prototype.scanHexLiteral = function (start) {
  92436. var num = '';
  92437. while (!this.eof()) {
  92438. if (!character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
  92439. break;
  92440. }
  92441. num += this.source[this.index++];
  92442. }
  92443. if (num.length === 0) {
  92444. this.throwUnexpectedToken();
  92445. }
  92446. if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
  92447. this.throwUnexpectedToken();
  92448. }
  92449. return {
  92450. type: 6 /* NumericLiteral */,
  92451. value: parseInt('0x' + num, 16),
  92452. lineNumber: this.lineNumber,
  92453. lineStart: this.lineStart,
  92454. start: start,
  92455. end: this.index
  92456. };
  92457. };
  92458. Scanner.prototype.scanBinaryLiteral = function (start) {
  92459. var num = '';
  92460. var ch;
  92461. while (!this.eof()) {
  92462. ch = this.source[this.index];
  92463. if (ch !== '0' && ch !== '1') {
  92464. break;
  92465. }
  92466. num += this.source[this.index++];
  92467. }
  92468. if (num.length === 0) {
  92469. // only 0b or 0B
  92470. this.throwUnexpectedToken();
  92471. }
  92472. if (!this.eof()) {
  92473. ch = this.source.charCodeAt(this.index);
  92474. /* istanbul ignore else */
  92475. if (character_1.Character.isIdentifierStart(ch) || character_1.Character.isDecimalDigit(ch)) {
  92476. this.throwUnexpectedToken();
  92477. }
  92478. }
  92479. return {
  92480. type: 6 /* NumericLiteral */,
  92481. value: parseInt(num, 2),
  92482. lineNumber: this.lineNumber,
  92483. lineStart: this.lineStart,
  92484. start: start,
  92485. end: this.index
  92486. };
  92487. };
  92488. Scanner.prototype.scanOctalLiteral = function (prefix, start) {
  92489. var num = '';
  92490. var octal = false;
  92491. if (character_1.Character.isOctalDigit(prefix.charCodeAt(0))) {
  92492. octal = true;
  92493. num = '0' + this.source[this.index++];
  92494. }
  92495. else {
  92496. ++this.index;
  92497. }
  92498. while (!this.eof()) {
  92499. if (!character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
  92500. break;
  92501. }
  92502. num += this.source[this.index++];
  92503. }
  92504. if (!octal && num.length === 0) {
  92505. // only 0o or 0O
  92506. this.throwUnexpectedToken();
  92507. }
  92508. if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index)) || character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  92509. this.throwUnexpectedToken();
  92510. }
  92511. return {
  92512. type: 6 /* NumericLiteral */,
  92513. value: parseInt(num, 8),
  92514. octal: octal,
  92515. lineNumber: this.lineNumber,
  92516. lineStart: this.lineStart,
  92517. start: start,
  92518. end: this.index
  92519. };
  92520. };
  92521. Scanner.prototype.isImplicitOctalLiteral = function () {
  92522. // Implicit octal, unless there is a non-octal digit.
  92523. // (Annex B.1.1 on Numeric Literals)
  92524. for (var i = this.index + 1; i < this.length; ++i) {
  92525. var ch = this.source[i];
  92526. if (ch === '8' || ch === '9') {
  92527. return false;
  92528. }
  92529. if (!character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
  92530. return true;
  92531. }
  92532. }
  92533. return true;
  92534. };
  92535. Scanner.prototype.scanNumericLiteral = function () {
  92536. var start = this.index;
  92537. var ch = this.source[start];
  92538. assert_1.assert(character_1.Character.isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), 'Numeric literal must start with a decimal digit or a decimal point');
  92539. var num = '';
  92540. if (ch !== '.') {
  92541. num = this.source[this.index++];
  92542. ch = this.source[this.index];
  92543. // Hex number starts with '0x'.
  92544. // Octal number starts with '0'.
  92545. // Octal number in ES6 starts with '0o'.
  92546. // Binary number in ES6 starts with '0b'.
  92547. if (num === '0') {
  92548. if (ch === 'x' || ch === 'X') {
  92549. ++this.index;
  92550. return this.scanHexLiteral(start);
  92551. }
  92552. if (ch === 'b' || ch === 'B') {
  92553. ++this.index;
  92554. return this.scanBinaryLiteral(start);
  92555. }
  92556. if (ch === 'o' || ch === 'O') {
  92557. return this.scanOctalLiteral(ch, start);
  92558. }
  92559. if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
  92560. if (this.isImplicitOctalLiteral()) {
  92561. return this.scanOctalLiteral(ch, start);
  92562. }
  92563. }
  92564. }
  92565. while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  92566. num += this.source[this.index++];
  92567. }
  92568. ch = this.source[this.index];
  92569. }
  92570. if (ch === '.') {
  92571. num += this.source[this.index++];
  92572. while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  92573. num += this.source[this.index++];
  92574. }
  92575. ch = this.source[this.index];
  92576. }
  92577. if (ch === 'e' || ch === 'E') {
  92578. num += this.source[this.index++];
  92579. ch = this.source[this.index];
  92580. if (ch === '+' || ch === '-') {
  92581. num += this.source[this.index++];
  92582. }
  92583. if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  92584. while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  92585. num += this.source[this.index++];
  92586. }
  92587. }
  92588. else {
  92589. this.throwUnexpectedToken();
  92590. }
  92591. }
  92592. if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
  92593. this.throwUnexpectedToken();
  92594. }
  92595. return {
  92596. type: 6 /* NumericLiteral */,
  92597. value: parseFloat(num),
  92598. lineNumber: this.lineNumber,
  92599. lineStart: this.lineStart,
  92600. start: start,
  92601. end: this.index
  92602. };
  92603. };
  92604. // https://tc39.github.io/ecma262/#sec-literals-string-literals
  92605. Scanner.prototype.scanStringLiteral = function () {
  92606. var start = this.index;
  92607. var quote = this.source[start];
  92608. assert_1.assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote');
  92609. ++this.index;
  92610. var octal = false;
  92611. var str = '';
  92612. while (!this.eof()) {
  92613. var ch = this.source[this.index++];
  92614. if (ch === quote) {
  92615. quote = '';
  92616. break;
  92617. }
  92618. else if (ch === '\\') {
  92619. ch = this.source[this.index++];
  92620. if (!ch || !character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  92621. switch (ch) {
  92622. case 'u':
  92623. if (this.source[this.index] === '{') {
  92624. ++this.index;
  92625. str += this.scanUnicodeCodePointEscape();
  92626. }
  92627. else {
  92628. var unescaped_1 = this.scanHexEscape(ch);
  92629. if (unescaped_1 === null) {
  92630. this.throwUnexpectedToken();
  92631. }
  92632. str += unescaped_1;
  92633. }
  92634. break;
  92635. case 'x':
  92636. var unescaped = this.scanHexEscape(ch);
  92637. if (unescaped === null) {
  92638. this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
  92639. }
  92640. str += unescaped;
  92641. break;
  92642. case 'n':
  92643. str += '\n';
  92644. break;
  92645. case 'r':
  92646. str += '\r';
  92647. break;
  92648. case 't':
  92649. str += '\t';
  92650. break;
  92651. case 'b':
  92652. str += '\b';
  92653. break;
  92654. case 'f':
  92655. str += '\f';
  92656. break;
  92657. case 'v':
  92658. str += '\x0B';
  92659. break;
  92660. case '8':
  92661. case '9':
  92662. str += ch;
  92663. this.tolerateUnexpectedToken();
  92664. break;
  92665. default:
  92666. if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
  92667. var octToDec = this.octalToDecimal(ch);
  92668. octal = octToDec.octal || octal;
  92669. str += String.fromCharCode(octToDec.code);
  92670. }
  92671. else {
  92672. str += ch;
  92673. }
  92674. break;
  92675. }
  92676. }
  92677. else {
  92678. ++this.lineNumber;
  92679. if (ch === '\r' && this.source[this.index] === '\n') {
  92680. ++this.index;
  92681. }
  92682. this.lineStart = this.index;
  92683. }
  92684. }
  92685. else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  92686. break;
  92687. }
  92688. else {
  92689. str += ch;
  92690. }
  92691. }
  92692. if (quote !== '') {
  92693. this.index = start;
  92694. this.throwUnexpectedToken();
  92695. }
  92696. return {
  92697. type: 8 /* StringLiteral */,
  92698. value: str,
  92699. octal: octal,
  92700. lineNumber: this.lineNumber,
  92701. lineStart: this.lineStart,
  92702. start: start,
  92703. end: this.index
  92704. };
  92705. };
  92706. // https://tc39.github.io/ecma262/#sec-template-literal-lexical-components
  92707. Scanner.prototype.scanTemplate = function () {
  92708. var cooked = '';
  92709. var terminated = false;
  92710. var start = this.index;
  92711. var head = (this.source[start] === '`');
  92712. var tail = false;
  92713. var rawOffset = 2;
  92714. ++this.index;
  92715. while (!this.eof()) {
  92716. var ch = this.source[this.index++];
  92717. if (ch === '`') {
  92718. rawOffset = 1;
  92719. tail = true;
  92720. terminated = true;
  92721. break;
  92722. }
  92723. else if (ch === '$') {
  92724. if (this.source[this.index] === '{') {
  92725. this.curlyStack.push('${');
  92726. ++this.index;
  92727. terminated = true;
  92728. break;
  92729. }
  92730. cooked += ch;
  92731. }
  92732. else if (ch === '\\') {
  92733. ch = this.source[this.index++];
  92734. if (!character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  92735. switch (ch) {
  92736. case 'n':
  92737. cooked += '\n';
  92738. break;
  92739. case 'r':
  92740. cooked += '\r';
  92741. break;
  92742. case 't':
  92743. cooked += '\t';
  92744. break;
  92745. case 'u':
  92746. if (this.source[this.index] === '{') {
  92747. ++this.index;
  92748. cooked += this.scanUnicodeCodePointEscape();
  92749. }
  92750. else {
  92751. var restore = this.index;
  92752. var unescaped_2 = this.scanHexEscape(ch);
  92753. if (unescaped_2 !== null) {
  92754. cooked += unescaped_2;
  92755. }
  92756. else {
  92757. this.index = restore;
  92758. cooked += ch;
  92759. }
  92760. }
  92761. break;
  92762. case 'x':
  92763. var unescaped = this.scanHexEscape(ch);
  92764. if (unescaped === null) {
  92765. this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
  92766. }
  92767. cooked += unescaped;
  92768. break;
  92769. case 'b':
  92770. cooked += '\b';
  92771. break;
  92772. case 'f':
  92773. cooked += '\f';
  92774. break;
  92775. case 'v':
  92776. cooked += '\v';
  92777. break;
  92778. default:
  92779. if (ch === '0') {
  92780. if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
  92781. // Illegal: \01 \02 and so on
  92782. this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
  92783. }
  92784. cooked += '\0';
  92785. }
  92786. else if (character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
  92787. // Illegal: \1 \2
  92788. this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
  92789. }
  92790. else {
  92791. cooked += ch;
  92792. }
  92793. break;
  92794. }
  92795. }
  92796. else {
  92797. ++this.lineNumber;
  92798. if (ch === '\r' && this.source[this.index] === '\n') {
  92799. ++this.index;
  92800. }
  92801. this.lineStart = this.index;
  92802. }
  92803. }
  92804. else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  92805. ++this.lineNumber;
  92806. if (ch === '\r' && this.source[this.index] === '\n') {
  92807. ++this.index;
  92808. }
  92809. this.lineStart = this.index;
  92810. cooked += '\n';
  92811. }
  92812. else {
  92813. cooked += ch;
  92814. }
  92815. }
  92816. if (!terminated) {
  92817. this.throwUnexpectedToken();
  92818. }
  92819. if (!head) {
  92820. this.curlyStack.pop();
  92821. }
  92822. return {
  92823. type: 10 /* Template */,
  92824. value: this.source.slice(start + 1, this.index - rawOffset),
  92825. cooked: cooked,
  92826. head: head,
  92827. tail: tail,
  92828. lineNumber: this.lineNumber,
  92829. lineStart: this.lineStart,
  92830. start: start,
  92831. end: this.index
  92832. };
  92833. };
  92834. // https://tc39.github.io/ecma262/#sec-literals-regular-expression-literals
  92835. Scanner.prototype.testRegExp = function (pattern, flags) {
  92836. // The BMP character to use as a replacement for astral symbols when
  92837. // translating an ES6 "u"-flagged pattern to an ES5-compatible
  92838. // approximation.
  92839. // Note: replacing with '\uFFFF' enables false positives in unlikely
  92840. // scenarios. For example, `[\u{1044f}-\u{10440}]` is an invalid
  92841. // pattern that would not be detected by this substitution.
  92842. var astralSubstitute = '\uFFFF';
  92843. var tmp = pattern;
  92844. var self = this;
  92845. if (flags.indexOf('u') >= 0) {
  92846. tmp = tmp
  92847. .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {
  92848. var codePoint = parseInt($1 || $2, 16);
  92849. if (codePoint > 0x10FFFF) {
  92850. self.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
  92851. }
  92852. if (codePoint <= 0xFFFF) {
  92853. return String.fromCharCode(codePoint);
  92854. }
  92855. return astralSubstitute;
  92856. })
  92857. .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, astralSubstitute);
  92858. }
  92859. // First, detect invalid regular expressions.
  92860. try {
  92861. RegExp(tmp);
  92862. }
  92863. catch (e) {
  92864. this.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
  92865. }
  92866. // Return a regular expression object for this pattern-flag pair, or
  92867. // `null` in case the current environment doesn't support the flags it
  92868. // uses.
  92869. try {
  92870. return new RegExp(pattern, flags);
  92871. }
  92872. catch (exception) {
  92873. /* istanbul ignore next */
  92874. return null;
  92875. }
  92876. };
  92877. Scanner.prototype.scanRegExpBody = function () {
  92878. var ch = this.source[this.index];
  92879. assert_1.assert(ch === '/', 'Regular expression literal must start with a slash');
  92880. var str = this.source[this.index++];
  92881. var classMarker = false;
  92882. var terminated = false;
  92883. while (!this.eof()) {
  92884. ch = this.source[this.index++];
  92885. str += ch;
  92886. if (ch === '\\') {
  92887. ch = this.source[this.index++];
  92888. // https://tc39.github.io/ecma262/#sec-literals-regular-expression-literals
  92889. if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  92890. this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
  92891. }
  92892. str += ch;
  92893. }
  92894. else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
  92895. this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
  92896. }
  92897. else if (classMarker) {
  92898. if (ch === ']') {
  92899. classMarker = false;
  92900. }
  92901. }
  92902. else {
  92903. if (ch === '/') {
  92904. terminated = true;
  92905. break;
  92906. }
  92907. else if (ch === '[') {
  92908. classMarker = true;
  92909. }
  92910. }
  92911. }
  92912. if (!terminated) {
  92913. this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
  92914. }
  92915. // Exclude leading and trailing slash.
  92916. return str.substr(1, str.length - 2);
  92917. };
  92918. Scanner.prototype.scanRegExpFlags = function () {
  92919. var str = '';
  92920. var flags = '';
  92921. while (!this.eof()) {
  92922. var ch = this.source[this.index];
  92923. if (!character_1.Character.isIdentifierPart(ch.charCodeAt(0))) {
  92924. break;
  92925. }
  92926. ++this.index;
  92927. if (ch === '\\' && !this.eof()) {
  92928. ch = this.source[this.index];
  92929. if (ch === 'u') {
  92930. ++this.index;
  92931. var restore = this.index;
  92932. var char = this.scanHexEscape('u');
  92933. if (char !== null) {
  92934. flags += char;
  92935. for (str += '\\u'; restore < this.index; ++restore) {
  92936. str += this.source[restore];
  92937. }
  92938. }
  92939. else {
  92940. this.index = restore;
  92941. flags += 'u';
  92942. str += '\\u';
  92943. }
  92944. this.tolerateUnexpectedToken();
  92945. }
  92946. else {
  92947. str += '\\';
  92948. this.tolerateUnexpectedToken();
  92949. }
  92950. }
  92951. else {
  92952. flags += ch;
  92953. str += ch;
  92954. }
  92955. }
  92956. return flags;
  92957. };
  92958. Scanner.prototype.scanRegExp = function () {
  92959. var start = this.index;
  92960. var pattern = this.scanRegExpBody();
  92961. var flags = this.scanRegExpFlags();
  92962. var value = this.testRegExp(pattern, flags);
  92963. return {
  92964. type: 9 /* RegularExpression */,
  92965. value: '',
  92966. pattern: pattern,
  92967. flags: flags,
  92968. regex: value,
  92969. lineNumber: this.lineNumber,
  92970. lineStart: this.lineStart,
  92971. start: start,
  92972. end: this.index
  92973. };
  92974. };
  92975. Scanner.prototype.lex = function () {
  92976. if (this.eof()) {
  92977. return {
  92978. type: 2 /* EOF */,
  92979. value: '',
  92980. lineNumber: this.lineNumber,
  92981. lineStart: this.lineStart,
  92982. start: this.index,
  92983. end: this.index
  92984. };
  92985. }
  92986. var cp = this.source.charCodeAt(this.index);
  92987. if (character_1.Character.isIdentifierStart(cp)) {
  92988. return this.scanIdentifier();
  92989. }
  92990. // Very common: ( and ) and ;
  92991. if (cp === 0x28 || cp === 0x29 || cp === 0x3B) {
  92992. return this.scanPunctuator();
  92993. }
  92994. // String literal starts with single quote (U+0027) or double quote (U+0022).
  92995. if (cp === 0x27 || cp === 0x22) {
  92996. return this.scanStringLiteral();
  92997. }
  92998. // Dot (.) U+002E can also start a floating-point number, hence the need
  92999. // to check the next character.
  93000. if (cp === 0x2E) {
  93001. if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index + 1))) {
  93002. return this.scanNumericLiteral();
  93003. }
  93004. return this.scanPunctuator();
  93005. }
  93006. if (character_1.Character.isDecimalDigit(cp)) {
  93007. return this.scanNumericLiteral();
  93008. }
  93009. // Template literals start with ` (U+0060) for template head
  93010. // or } (U+007D) for template middle or template tail.
  93011. if (cp === 0x60 || (cp === 0x7D && this.curlyStack[this.curlyStack.length - 1] === '${')) {
  93012. return this.scanTemplate();
  93013. }
  93014. // Possible identifier start in a surrogate pair.
  93015. if (cp >= 0xD800 && cp < 0xDFFF) {
  93016. if (character_1.Character.isIdentifierStart(this.codePointAt(this.index))) {
  93017. return this.scanIdentifier();
  93018. }
  93019. }
  93020. return this.scanPunctuator();
  93021. };
  93022. return Scanner;
  93023. }());
  93024. exports.Scanner = Scanner;
  93025. /***/ },
  93026. /* 13 */
  93027. /***/ function(module, exports) {
  93028. "use strict";
  93029. Object.defineProperty(exports, "__esModule", { value: true });
  93030. exports.TokenName = {};
  93031. exports.TokenName[1 /* BooleanLiteral */] = 'Boolean';
  93032. exports.TokenName[2 /* EOF */] = '<end>';
  93033. exports.TokenName[3 /* Identifier */] = 'Identifier';
  93034. exports.TokenName[4 /* Keyword */] = 'Keyword';
  93035. exports.TokenName[5 /* NullLiteral */] = 'Null';
  93036. exports.TokenName[6 /* NumericLiteral */] = 'Numeric';
  93037. exports.TokenName[7 /* Punctuator */] = 'Punctuator';
  93038. exports.TokenName[8 /* StringLiteral */] = 'String';
  93039. exports.TokenName[9 /* RegularExpression */] = 'RegularExpression';
  93040. exports.TokenName[10 /* Template */] = 'Template';
  93041. /***/ },
  93042. /* 14 */
  93043. /***/ function(module, exports) {
  93044. "use strict";
  93045. // Generated by generate-xhtml-entities.js. DO NOT MODIFY!
  93046. Object.defineProperty(exports, "__esModule", { value: true });
  93047. exports.XHTMLEntities = {
  93048. quot: '\u0022',
  93049. amp: '\u0026',
  93050. apos: '\u0027',
  93051. gt: '\u003E',
  93052. nbsp: '\u00A0',
  93053. iexcl: '\u00A1',
  93054. cent: '\u00A2',
  93055. pound: '\u00A3',
  93056. curren: '\u00A4',
  93057. yen: '\u00A5',
  93058. brvbar: '\u00A6',
  93059. sect: '\u00A7',
  93060. uml: '\u00A8',
  93061. copy: '\u00A9',
  93062. ordf: '\u00AA',
  93063. laquo: '\u00AB',
  93064. not: '\u00AC',
  93065. shy: '\u00AD',
  93066. reg: '\u00AE',
  93067. macr: '\u00AF',
  93068. deg: '\u00B0',
  93069. plusmn: '\u00B1',
  93070. sup2: '\u00B2',
  93071. sup3: '\u00B3',
  93072. acute: '\u00B4',
  93073. micro: '\u00B5',
  93074. para: '\u00B6',
  93075. middot: '\u00B7',
  93076. cedil: '\u00B8',
  93077. sup1: '\u00B9',
  93078. ordm: '\u00BA',
  93079. raquo: '\u00BB',
  93080. frac14: '\u00BC',
  93081. frac12: '\u00BD',
  93082. frac34: '\u00BE',
  93083. iquest: '\u00BF',
  93084. Agrave: '\u00C0',
  93085. Aacute: '\u00C1',
  93086. Acirc: '\u00C2',
  93087. Atilde: '\u00C3',
  93088. Auml: '\u00C4',
  93089. Aring: '\u00C5',
  93090. AElig: '\u00C6',
  93091. Ccedil: '\u00C7',
  93092. Egrave: '\u00C8',
  93093. Eacute: '\u00C9',
  93094. Ecirc: '\u00CA',
  93095. Euml: '\u00CB',
  93096. Igrave: '\u00CC',
  93097. Iacute: '\u00CD',
  93098. Icirc: '\u00CE',
  93099. Iuml: '\u00CF',
  93100. ETH: '\u00D0',
  93101. Ntilde: '\u00D1',
  93102. Ograve: '\u00D2',
  93103. Oacute: '\u00D3',
  93104. Ocirc: '\u00D4',
  93105. Otilde: '\u00D5',
  93106. Ouml: '\u00D6',
  93107. times: '\u00D7',
  93108. Oslash: '\u00D8',
  93109. Ugrave: '\u00D9',
  93110. Uacute: '\u00DA',
  93111. Ucirc: '\u00DB',
  93112. Uuml: '\u00DC',
  93113. Yacute: '\u00DD',
  93114. THORN: '\u00DE',
  93115. szlig: '\u00DF',
  93116. agrave: '\u00E0',
  93117. aacute: '\u00E1',
  93118. acirc: '\u00E2',
  93119. atilde: '\u00E3',
  93120. auml: '\u00E4',
  93121. aring: '\u00E5',
  93122. aelig: '\u00E6',
  93123. ccedil: '\u00E7',
  93124. egrave: '\u00E8',
  93125. eacute: '\u00E9',
  93126. ecirc: '\u00EA',
  93127. euml: '\u00EB',
  93128. igrave: '\u00EC',
  93129. iacute: '\u00ED',
  93130. icirc: '\u00EE',
  93131. iuml: '\u00EF',
  93132. eth: '\u00F0',
  93133. ntilde: '\u00F1',
  93134. ograve: '\u00F2',
  93135. oacute: '\u00F3',
  93136. ocirc: '\u00F4',
  93137. otilde: '\u00F5',
  93138. ouml: '\u00F6',
  93139. divide: '\u00F7',
  93140. oslash: '\u00F8',
  93141. ugrave: '\u00F9',
  93142. uacute: '\u00FA',
  93143. ucirc: '\u00FB',
  93144. uuml: '\u00FC',
  93145. yacute: '\u00FD',
  93146. thorn: '\u00FE',
  93147. yuml: '\u00FF',
  93148. OElig: '\u0152',
  93149. oelig: '\u0153',
  93150. Scaron: '\u0160',
  93151. scaron: '\u0161',
  93152. Yuml: '\u0178',
  93153. fnof: '\u0192',
  93154. circ: '\u02C6',
  93155. tilde: '\u02DC',
  93156. Alpha: '\u0391',
  93157. Beta: '\u0392',
  93158. Gamma: '\u0393',
  93159. Delta: '\u0394',
  93160. Epsilon: '\u0395',
  93161. Zeta: '\u0396',
  93162. Eta: '\u0397',
  93163. Theta: '\u0398',
  93164. Iota: '\u0399',
  93165. Kappa: '\u039A',
  93166. Lambda: '\u039B',
  93167. Mu: '\u039C',
  93168. Nu: '\u039D',
  93169. Xi: '\u039E',
  93170. Omicron: '\u039F',
  93171. Pi: '\u03A0',
  93172. Rho: '\u03A1',
  93173. Sigma: '\u03A3',
  93174. Tau: '\u03A4',
  93175. Upsilon: '\u03A5',
  93176. Phi: '\u03A6',
  93177. Chi: '\u03A7',
  93178. Psi: '\u03A8',
  93179. Omega: '\u03A9',
  93180. alpha: '\u03B1',
  93181. beta: '\u03B2',
  93182. gamma: '\u03B3',
  93183. delta: '\u03B4',
  93184. epsilon: '\u03B5',
  93185. zeta: '\u03B6',
  93186. eta: '\u03B7',
  93187. theta: '\u03B8',
  93188. iota: '\u03B9',
  93189. kappa: '\u03BA',
  93190. lambda: '\u03BB',
  93191. mu: '\u03BC',
  93192. nu: '\u03BD',
  93193. xi: '\u03BE',
  93194. omicron: '\u03BF',
  93195. pi: '\u03C0',
  93196. rho: '\u03C1',
  93197. sigmaf: '\u03C2',
  93198. sigma: '\u03C3',
  93199. tau: '\u03C4',
  93200. upsilon: '\u03C5',
  93201. phi: '\u03C6',
  93202. chi: '\u03C7',
  93203. psi: '\u03C8',
  93204. omega: '\u03C9',
  93205. thetasym: '\u03D1',
  93206. upsih: '\u03D2',
  93207. piv: '\u03D6',
  93208. ensp: '\u2002',
  93209. emsp: '\u2003',
  93210. thinsp: '\u2009',
  93211. zwnj: '\u200C',
  93212. zwj: '\u200D',
  93213. lrm: '\u200E',
  93214. rlm: '\u200F',
  93215. ndash: '\u2013',
  93216. mdash: '\u2014',
  93217. lsquo: '\u2018',
  93218. rsquo: '\u2019',
  93219. sbquo: '\u201A',
  93220. ldquo: '\u201C',
  93221. rdquo: '\u201D',
  93222. bdquo: '\u201E',
  93223. dagger: '\u2020',
  93224. Dagger: '\u2021',
  93225. bull: '\u2022',
  93226. hellip: '\u2026',
  93227. permil: '\u2030',
  93228. prime: '\u2032',
  93229. Prime: '\u2033',
  93230. lsaquo: '\u2039',
  93231. rsaquo: '\u203A',
  93232. oline: '\u203E',
  93233. frasl: '\u2044',
  93234. euro: '\u20AC',
  93235. image: '\u2111',
  93236. weierp: '\u2118',
  93237. real: '\u211C',
  93238. trade: '\u2122',
  93239. alefsym: '\u2135',
  93240. larr: '\u2190',
  93241. uarr: '\u2191',
  93242. rarr: '\u2192',
  93243. darr: '\u2193',
  93244. harr: '\u2194',
  93245. crarr: '\u21B5',
  93246. lArr: '\u21D0',
  93247. uArr: '\u21D1',
  93248. rArr: '\u21D2',
  93249. dArr: '\u21D3',
  93250. hArr: '\u21D4',
  93251. forall: '\u2200',
  93252. part: '\u2202',
  93253. exist: '\u2203',
  93254. empty: '\u2205',
  93255. nabla: '\u2207',
  93256. isin: '\u2208',
  93257. notin: '\u2209',
  93258. ni: '\u220B',
  93259. prod: '\u220F',
  93260. sum: '\u2211',
  93261. minus: '\u2212',
  93262. lowast: '\u2217',
  93263. radic: '\u221A',
  93264. prop: '\u221D',
  93265. infin: '\u221E',
  93266. ang: '\u2220',
  93267. and: '\u2227',
  93268. or: '\u2228',
  93269. cap: '\u2229',
  93270. cup: '\u222A',
  93271. int: '\u222B',
  93272. there4: '\u2234',
  93273. sim: '\u223C',
  93274. cong: '\u2245',
  93275. asymp: '\u2248',
  93276. ne: '\u2260',
  93277. equiv: '\u2261',
  93278. le: '\u2264',
  93279. ge: '\u2265',
  93280. sub: '\u2282',
  93281. sup: '\u2283',
  93282. nsub: '\u2284',
  93283. sube: '\u2286',
  93284. supe: '\u2287',
  93285. oplus: '\u2295',
  93286. otimes: '\u2297',
  93287. perp: '\u22A5',
  93288. sdot: '\u22C5',
  93289. lceil: '\u2308',
  93290. rceil: '\u2309',
  93291. lfloor: '\u230A',
  93292. rfloor: '\u230B',
  93293. loz: '\u25CA',
  93294. spades: '\u2660',
  93295. clubs: '\u2663',
  93296. hearts: '\u2665',
  93297. diams: '\u2666',
  93298. lang: '\u27E8',
  93299. rang: '\u27E9'
  93300. };
  93301. /***/ },
  93302. /* 15 */
  93303. /***/ function(module, exports, __webpack_require__) {
  93304. "use strict";
  93305. Object.defineProperty(exports, "__esModule", { value: true });
  93306. var error_handler_1 = __webpack_require__(10);
  93307. var scanner_1 = __webpack_require__(12);
  93308. var token_1 = __webpack_require__(13);
  93309. var Reader = (function () {
  93310. function Reader() {
  93311. this.values = [];
  93312. this.curly = this.paren = -1;
  93313. }
  93314. // A function following one of those tokens is an expression.
  93315. Reader.prototype.beforeFunctionExpression = function (t) {
  93316. return ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',
  93317. 'return', 'case', 'delete', 'throw', 'void',
  93318. // assignment operators
  93319. '=', '+=', '-=', '*=', '**=', '/=', '%=', '<<=', '>>=', '>>>=',
  93320. '&=', '|=', '^=', ',',
  93321. // binary/unary operators
  93322. '+', '-', '*', '**', '/', '%', '++', '--', '<<', '>>', '>>>', '&',
  93323. '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',
  93324. '<=', '<', '>', '!=', '!=='].indexOf(t) >= 0;
  93325. };
  93326. // Determine if forward slash (/) is an operator or part of a regular expression
  93327. // https://github.com/mozilla/sweet.js/wiki/design
  93328. Reader.prototype.isRegexStart = function () {
  93329. var previous = this.values[this.values.length - 1];
  93330. var regex = (previous !== null);
  93331. switch (previous) {
  93332. case 'this':
  93333. case ']':
  93334. regex = false;
  93335. break;
  93336. case ')':
  93337. var keyword = this.values[this.paren - 1];
  93338. regex = (keyword === 'if' || keyword === 'while' || keyword === 'for' || keyword === 'with');
  93339. break;
  93340. case '}':
  93341. // Dividing a function by anything makes little sense,
  93342. // but we have to check for that.
  93343. regex = false;
  93344. if (this.values[this.curly - 3] === 'function') {
  93345. // Anonymous function, e.g. function(){} /42
  93346. var check = this.values[this.curly - 4];
  93347. regex = check ? !this.beforeFunctionExpression(check) : false;
  93348. }
  93349. else if (this.values[this.curly - 4] === 'function') {
  93350. // Named function, e.g. function f(){} /42/
  93351. var check = this.values[this.curly - 5];
  93352. regex = check ? !this.beforeFunctionExpression(check) : true;
  93353. }
  93354. break;
  93355. default:
  93356. break;
  93357. }
  93358. return regex;
  93359. };
  93360. Reader.prototype.push = function (token) {
  93361. if (token.type === 7 /* Punctuator */ || token.type === 4 /* Keyword */) {
  93362. if (token.value === '{') {
  93363. this.curly = this.values.length;
  93364. }
  93365. else if (token.value === '(') {
  93366. this.paren = this.values.length;
  93367. }
  93368. this.values.push(token.value);
  93369. }
  93370. else {
  93371. this.values.push(null);
  93372. }
  93373. };
  93374. return Reader;
  93375. }());
  93376. var Tokenizer = (function () {
  93377. function Tokenizer(code, config) {
  93378. this.errorHandler = new error_handler_1.ErrorHandler();
  93379. this.errorHandler.tolerant = config ? (typeof config.tolerant === 'boolean' && config.tolerant) : false;
  93380. this.scanner = new scanner_1.Scanner(code, this.errorHandler);
  93381. this.scanner.trackComment = config ? (typeof config.comment === 'boolean' && config.comment) : false;
  93382. this.trackRange = config ? (typeof config.range === 'boolean' && config.range) : false;
  93383. this.trackLoc = config ? (typeof config.loc === 'boolean' && config.loc) : false;
  93384. this.buffer = [];
  93385. this.reader = new Reader();
  93386. }
  93387. Tokenizer.prototype.errors = function () {
  93388. return this.errorHandler.errors;
  93389. };
  93390. Tokenizer.prototype.getNextToken = function () {
  93391. if (this.buffer.length === 0) {
  93392. var comments = this.scanner.scanComments();
  93393. if (this.scanner.trackComment) {
  93394. for (var i = 0; i < comments.length; ++i) {
  93395. var e = comments[i];
  93396. var value = this.scanner.source.slice(e.slice[0], e.slice[1]);
  93397. var comment = {
  93398. type: e.multiLine ? 'BlockComment' : 'LineComment',
  93399. value: value
  93400. };
  93401. if (this.trackRange) {
  93402. comment.range = e.range;
  93403. }
  93404. if (this.trackLoc) {
  93405. comment.loc = e.loc;
  93406. }
  93407. this.buffer.push(comment);
  93408. }
  93409. }
  93410. if (!this.scanner.eof()) {
  93411. var loc = void 0;
  93412. if (this.trackLoc) {
  93413. loc = {
  93414. start: {
  93415. line: this.scanner.lineNumber,
  93416. column: this.scanner.index - this.scanner.lineStart
  93417. },
  93418. end: {}
  93419. };
  93420. }
  93421. var startRegex = (this.scanner.source[this.scanner.index] === '/') && this.reader.isRegexStart();
  93422. var token = startRegex ? this.scanner.scanRegExp() : this.scanner.lex();
  93423. this.reader.push(token);
  93424. var entry = {
  93425. type: token_1.TokenName[token.type],
  93426. value: this.scanner.source.slice(token.start, token.end)
  93427. };
  93428. if (this.trackRange) {
  93429. entry.range = [token.start, token.end];
  93430. }
  93431. if (this.trackLoc) {
  93432. loc.end = {
  93433. line: this.scanner.lineNumber,
  93434. column: this.scanner.index - this.scanner.lineStart
  93435. };
  93436. entry.loc = loc;
  93437. }
  93438. if (token.type === 9 /* RegularExpression */) {
  93439. var pattern = token.pattern;
  93440. var flags = token.flags;
  93441. entry.regex = { pattern: pattern, flags: flags };
  93442. }
  93443. this.buffer.push(entry);
  93444. }
  93445. }
  93446. return this.buffer.shift();
  93447. };
  93448. return Tokenizer;
  93449. }());
  93450. exports.Tokenizer = Tokenizer;
  93451. /***/ }
  93452. /******/ ])
  93453. });
  93454. ;
  93455. /***/ }),
  93456. /* 663 */
  93457. /***/ (function(module, exports, __webpack_require__) {
  93458. "use strict";
  93459. /*!
  93460. * expand-brackets <https://github.com/jonschlinkert/expand-brackets>
  93461. *
  93462. * Copyright (c) 2015 Jon Schlinkert.
  93463. * Licensed under the MIT license.
  93464. */
  93465. var isPosixBracket = __webpack_require__(788);
  93466. /**
  93467. * POSIX character classes
  93468. */
  93469. var POSIX = {
  93470. alnum: 'a-zA-Z0-9',
  93471. alpha: 'a-zA-Z',
  93472. blank: ' \\t',
  93473. cntrl: '\\x00-\\x1F\\x7F',
  93474. digit: '0-9',
  93475. graph: '\\x21-\\x7E',
  93476. lower: 'a-z',
  93477. print: '\\x20-\\x7E',
  93478. punct: '-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
  93479. space: ' \\t\\r\\n\\v\\f',
  93480. upper: 'A-Z',
  93481. word: 'A-Za-z0-9_',
  93482. xdigit: 'A-Fa-f0-9',
  93483. };
  93484. /**
  93485. * Expose `brackets`
  93486. */
  93487. module.exports = brackets;
  93488. function brackets(str) {
  93489. if (!isPosixBracket(str)) {
  93490. return str;
  93491. }
  93492. var negated = false;
  93493. if (str.indexOf('[^') !== -1) {
  93494. negated = true;
  93495. str = str.split('[^').join('[');
  93496. }
  93497. if (str.indexOf('[!') !== -1) {
  93498. negated = true;
  93499. str = str.split('[!').join('[');
  93500. }
  93501. var a = str.split('[');
  93502. var b = str.split(']');
  93503. var imbalanced = a.length !== b.length;
  93504. var parts = str.split(/(?::\]\[:|\[?\[:|:\]\]?)/);
  93505. var len = parts.length, i = 0;
  93506. var end = '', beg = '';
  93507. var res = [];
  93508. // start at the end (innermost) first
  93509. while (len--) {
  93510. var inner = parts[i++];
  93511. if (inner === '^[!' || inner === '[!') {
  93512. inner = '';
  93513. negated = true;
  93514. }
  93515. var prefix = negated ? '^' : '';
  93516. var ch = POSIX[inner];
  93517. if (ch) {
  93518. res.push('[' + prefix + ch + ']');
  93519. } else if (inner) {
  93520. if (/^\[?\w-\w\]?$/.test(inner)) {
  93521. if (i === parts.length) {
  93522. res.push('[' + prefix + inner);
  93523. } else if (i === 1) {
  93524. res.push(prefix + inner + ']');
  93525. } else {
  93526. res.push(prefix + inner);
  93527. }
  93528. } else {
  93529. if (i === 1) {
  93530. beg += inner;
  93531. } else if (i === parts.length) {
  93532. end += inner;
  93533. } else {
  93534. res.push('[' + prefix + inner + ']');
  93535. }
  93536. }
  93537. }
  93538. }
  93539. var result = res.join('|');
  93540. var rlen = res.length || 1;
  93541. if (rlen > 1) {
  93542. result = '(?:' + result + ')';
  93543. rlen = 1;
  93544. }
  93545. if (beg) {
  93546. rlen++;
  93547. if (beg.charAt(0) === '[') {
  93548. if (imbalanced) {
  93549. beg = '\\[' + beg.slice(1);
  93550. } else {
  93551. beg += ']';
  93552. }
  93553. }
  93554. result = beg + result;
  93555. }
  93556. if (end) {
  93557. rlen++;
  93558. if (end.slice(-1) === ']') {
  93559. if (imbalanced) {
  93560. end = end.slice(0, end.length - 1) + '\\]';
  93561. } else {
  93562. end = '[' + end;
  93563. }
  93564. }
  93565. result += end;
  93566. }
  93567. if (rlen > 1) {
  93568. result = result.split('][').join(']|[');
  93569. if (result.indexOf('|') !== -1 && !/\(\?/.test(result)) {
  93570. result = '(?:' + result + ')';
  93571. }
  93572. }
  93573. result = result.replace(/\[+=|=\]+/g, '\\b');
  93574. return result;
  93575. }
  93576. brackets.makeRe = function(pattern) {
  93577. try {
  93578. return new RegExp(brackets(pattern));
  93579. } catch (err) {}
  93580. };
  93581. brackets.isMatch = function(str, pattern) {
  93582. try {
  93583. return brackets.makeRe(pattern).test(str);
  93584. } catch (err) {
  93585. return false;
  93586. }
  93587. };
  93588. brackets.match = function(arr, pattern) {
  93589. var len = arr.length, i = 0;
  93590. var res = arr.slice();
  93591. var re = brackets.makeRe(pattern);
  93592. while (i < len) {
  93593. var ele = arr[i++];
  93594. if (!re.test(ele)) {
  93595. continue;
  93596. }
  93597. res.splice(i, 1);
  93598. }
  93599. return res;
  93600. };
  93601. /***/ }),
  93602. /* 664 */
  93603. /***/ (function(module, exports, __webpack_require__) {
  93604. "use strict";
  93605. /*!
  93606. * expand-range <https://github.com/jonschlinkert/expand-range>
  93607. *
  93608. * Copyright (c) 2014-2015, Jon Schlinkert.
  93609. * Licensed under the MIT license.
  93610. */
  93611. var fill = __webpack_require__(665);
  93612. module.exports = function expandRange(str, options, fn) {
  93613. if (typeof str !== 'string') {
  93614. throw new TypeError('expand-range expects a string.');
  93615. }
  93616. if (typeof options === 'function') {
  93617. fn = options;
  93618. options = {};
  93619. }
  93620. if (typeof options === 'boolean') {
  93621. options = {};
  93622. options.makeRe = true;
  93623. }
  93624. // create arguments to pass to fill-range
  93625. var opts = options || {};
  93626. var args = str.split('..');
  93627. var len = args.length;
  93628. if (len > 3) { return str; }
  93629. // if only one argument, it can't expand so return it
  93630. if (len === 1) { return args; }
  93631. // if `true`, tell fill-range to regexify the string
  93632. if (typeof fn === 'boolean' && fn === true) {
  93633. opts.makeRe = true;
  93634. }
  93635. args.push(opts);
  93636. return fill.apply(null, args.concat(fn));
  93637. };
  93638. /***/ }),
  93639. /* 665 */
  93640. /***/ (function(module, exports, __webpack_require__) {
  93641. "use strict";
  93642. /*!
  93643. * fill-range <https://github.com/jonschlinkert/fill-range>
  93644. *
  93645. * Copyright (c) 2014-2018, Jon Schlinkert.
  93646. * Released under the MIT License.
  93647. */
  93648. var isObject = __webpack_require__(667);
  93649. var isNumber = __webpack_require__(666);
  93650. var randomize = __webpack_require__(859);
  93651. var repeatStr = __webpack_require__(869);
  93652. var repeat = __webpack_require__(381);
  93653. /**
  93654. * Expose `fillRange`
  93655. */
  93656. module.exports = fillRange;
  93657. /**
  93658. * Return a range of numbers or letters.
  93659. *
  93660. * @param {String} `a` Start of the range
  93661. * @param {String} `b` End of the range
  93662. * @param {String} `step` Increment or decrement to use.
  93663. * @param {Function} `fn` Custom function to modify each element in the range.
  93664. * @return {Array}
  93665. */
  93666. function fillRange(a, b, step, options, fn) {
  93667. if (a == null || b == null) {
  93668. throw new Error('fill-range expects the first and second args to be strings.');
  93669. }
  93670. if (typeof step === 'function') {
  93671. fn = step; options = {}; step = null;
  93672. }
  93673. if (typeof options === 'function') {
  93674. fn = options; options = {};
  93675. }
  93676. if (isObject(step)) {
  93677. options = step; step = '';
  93678. }
  93679. var expand, regex = false, sep = '';
  93680. var opts = options || {};
  93681. if (typeof opts.silent === 'undefined') {
  93682. opts.silent = true;
  93683. }
  93684. step = step || opts.step;
  93685. // store a ref to unmodified arg
  93686. var origA = a, origB = b;
  93687. b = (b.toString() === '-0') ? 0 : b;
  93688. if (opts.optimize || opts.makeRe) {
  93689. step = step ? (step += '~') : step;
  93690. expand = true;
  93691. regex = true;
  93692. sep = '~';
  93693. }
  93694. // handle special step characters
  93695. if (typeof step === 'string') {
  93696. var match = stepRe().exec(step);
  93697. if (match) {
  93698. var i = match.index;
  93699. var m = match[0];
  93700. // repeat string
  93701. if (m === '+') {
  93702. return repeat(a, b);
  93703. // randomize a, `b` times
  93704. } else if (m === '?') {
  93705. return [randomize(a, b)];
  93706. // expand right, no regex reduction
  93707. } else if (m === '>') {
  93708. step = step.substr(0, i) + step.substr(i + 1);
  93709. expand = true;
  93710. // expand to an array, or if valid create a reduced
  93711. // string for a regex logic `or`
  93712. } else if (m === '|') {
  93713. step = step.substr(0, i) + step.substr(i + 1);
  93714. expand = true;
  93715. regex = true;
  93716. sep = m;
  93717. // expand to an array, or if valid create a reduced
  93718. // string for a regex range
  93719. } else if (m === '~') {
  93720. step = step.substr(0, i) + step.substr(i + 1);
  93721. expand = true;
  93722. regex = true;
  93723. sep = m;
  93724. }
  93725. } else if (!isNumber(step)) {
  93726. if (!opts.silent) {
  93727. throw new TypeError('fill-range: invalid step.');
  93728. }
  93729. return null;
  93730. }
  93731. }
  93732. if (/[.&*()[\]^%$#@!]/.test(a) || /[.&*()[\]^%$#@!]/.test(b)) {
  93733. if (!opts.silent) {
  93734. throw new RangeError('fill-range: invalid range arguments.');
  93735. }
  93736. return null;
  93737. }
  93738. // has neither a letter nor number, or has both letters and numbers
  93739. // this needs to be after the step logic
  93740. if (!noAlphaNum(a) || !noAlphaNum(b) || hasBoth(a) || hasBoth(b)) {
  93741. if (!opts.silent) {
  93742. throw new RangeError('fill-range: invalid range arguments.');
  93743. }
  93744. return null;
  93745. }
  93746. // validate arguments
  93747. var isNumA = isNumber(zeros(a));
  93748. var isNumB = isNumber(zeros(b));
  93749. if ((!isNumA && isNumB) || (isNumA && !isNumB)) {
  93750. if (!opts.silent) {
  93751. throw new TypeError('fill-range: first range argument is incompatible with second.');
  93752. }
  93753. return null;
  93754. }
  93755. // by this point both are the same, so we
  93756. // can use A to check going forward.
  93757. var isNum = isNumA;
  93758. var num = formatStep(step);
  93759. // is the range alphabetical? or numeric?
  93760. if (isNum) {
  93761. // if numeric, coerce to an integer
  93762. a = +a; b = +b;
  93763. } else {
  93764. // otherwise, get the charCode to expand alpha ranges
  93765. a = a.charCodeAt(0);
  93766. b = b.charCodeAt(0);
  93767. }
  93768. // is the pattern descending?
  93769. var isDescending = a > b;
  93770. // don't create a character class if the args are < 0
  93771. if (a < 0 || b < 0) {
  93772. expand = false;
  93773. regex = false;
  93774. }
  93775. // detect padding
  93776. var padding = isPadded(origA, origB);
  93777. var res, pad, arr = [];
  93778. var ii = 0;
  93779. // character classes, ranges and logical `or`
  93780. if (regex) {
  93781. if (shouldExpand(a, b, num, isNum, padding, opts)) {
  93782. // make sure the correct separator is used
  93783. if (sep === '|' || sep === '~') {
  93784. sep = detectSeparator(a, b, num, isNum, isDescending);
  93785. }
  93786. return wrap([origA, origB], sep, opts);
  93787. }
  93788. }
  93789. while (isDescending ? (a >= b) : (a <= b)) {
  93790. if (padding && isNum) {
  93791. pad = padding(a);
  93792. }
  93793. // custom function
  93794. if (typeof fn === 'function') {
  93795. res = fn(a, isNum, pad, ii++);
  93796. // letters
  93797. } else if (!isNum) {
  93798. if (regex && isInvalidChar(a)) {
  93799. res = null;
  93800. } else {
  93801. res = String.fromCharCode(a);
  93802. }
  93803. // numbers
  93804. } else {
  93805. res = formatPadding(a, pad);
  93806. }
  93807. // add result to the array, filtering any nulled values
  93808. if (res !== null) arr.push(res);
  93809. // increment or decrement
  93810. if (isDescending) {
  93811. a -= num;
  93812. } else {
  93813. a += num;
  93814. }
  93815. }
  93816. // now that the array is expanded, we need to handle regex
  93817. // character classes, ranges or logical `or` that wasn't
  93818. // already handled before the loop
  93819. if ((regex || expand) && !opts.noexpand) {
  93820. // make sure the correct separator is used
  93821. if (sep === '|' || sep === '~') {
  93822. sep = detectSeparator(a, b, num, isNum, isDescending);
  93823. }
  93824. if (arr.length === 1 || a < 0 || b < 0) { return arr; }
  93825. return wrap(arr, sep, opts);
  93826. }
  93827. return arr;
  93828. }
  93829. /**
  93830. * Wrap the string with the correct regex
  93831. * syntax.
  93832. */
  93833. function wrap(arr, sep, opts) {
  93834. if (sep === '~') { sep = '-'; }
  93835. var str = arr.join(sep);
  93836. var pre = opts && opts.regexPrefix;
  93837. // regex logical `or`
  93838. if (sep === '|') {
  93839. str = pre ? pre + str : str;
  93840. str = '(' + str + ')';
  93841. }
  93842. // regex character class
  93843. if (sep === '-') {
  93844. str = (pre && pre === '^')
  93845. ? pre + str
  93846. : str;
  93847. str = '[' + str + ']';
  93848. }
  93849. return [str];
  93850. }
  93851. /**
  93852. * Check for invalid characters
  93853. */
  93854. function isCharClass(a, b, step, isNum, isDescending) {
  93855. if (isDescending) { return false; }
  93856. if (isNum) { return a <= 9 && b <= 9; }
  93857. if (a < b) { return step === 1; }
  93858. return false;
  93859. }
  93860. /**
  93861. * Detect the correct separator to use
  93862. */
  93863. function shouldExpand(a, b, num, isNum, padding, opts) {
  93864. if (isNum && (a > 9 || b > 9)) { return false; }
  93865. return !padding && num === 1 && a < b;
  93866. }
  93867. /**
  93868. * Detect the correct separator to use
  93869. */
  93870. function detectSeparator(a, b, step, isNum, isDescending) {
  93871. var isChar = isCharClass(a, b, step, isNum, isDescending);
  93872. if (!isChar) {
  93873. return '|';
  93874. }
  93875. return '~';
  93876. }
  93877. /**
  93878. * Correctly format the step based on type
  93879. */
  93880. function formatStep(step) {
  93881. return Math.abs(step >> 0) || 1;
  93882. }
  93883. /**
  93884. * Format padding, taking leading `-` into account
  93885. */
  93886. function formatPadding(ch, pad) {
  93887. var res = pad ? pad + ch : ch;
  93888. if (pad && ch.toString().charAt(0) === '-') {
  93889. res = '-' + pad + ch.toString().substr(1);
  93890. }
  93891. return res.toString();
  93892. }
  93893. /**
  93894. * Check for invalid characters
  93895. */
  93896. function isInvalidChar(str) {
  93897. var ch = toStr(str);
  93898. return ch === '\\'
  93899. || ch === '['
  93900. || ch === ']'
  93901. || ch === '^'
  93902. || ch === '('
  93903. || ch === ')'
  93904. || ch === '`';
  93905. }
  93906. /**
  93907. * Convert to a string from a charCode
  93908. */
  93909. function toStr(ch) {
  93910. return String.fromCharCode(ch);
  93911. }
  93912. /**
  93913. * Step regex
  93914. */
  93915. function stepRe() {
  93916. return /\?|>|\||\+|\~/g;
  93917. }
  93918. /**
  93919. * Return true if `val` has either a letter
  93920. * or a number
  93921. */
  93922. function noAlphaNum(val) {
  93923. return /[a-z0-9]/i.test(val);
  93924. }
  93925. /**
  93926. * Return true if `val` has both a letter and
  93927. * a number (invalid)
  93928. */
  93929. function hasBoth(val) {
  93930. return /[a-z][0-9]|[0-9][a-z]/i.test(val);
  93931. }
  93932. /**
  93933. * Normalize zeros for checks
  93934. */
  93935. function zeros(val) {
  93936. if (/^-*0+$/.test(val.toString())) {
  93937. return '0';
  93938. }
  93939. return val;
  93940. }
  93941. /**
  93942. * Return true if `val` has leading zeros,
  93943. * or a similar valid pattern.
  93944. */
  93945. function hasZeros(val) {
  93946. return /[^.]\.|^-*0+[0-9]/.test(val);
  93947. }
  93948. /**
  93949. * If the string is padded, returns a curried function with
  93950. * the a cached padding string, or `false` if no padding.
  93951. *
  93952. * @param {*} `origA` String or number.
  93953. * @return {String|Boolean}
  93954. */
  93955. function isPadded(origA, origB) {
  93956. if (hasZeros(origA) || hasZeros(origB)) {
  93957. var alen = length(origA);
  93958. var blen = length(origB);
  93959. var len = alen >= blen
  93960. ? alen
  93961. : blen;
  93962. return function (a) {
  93963. return repeatStr('0', len - length(a));
  93964. };
  93965. }
  93966. return false;
  93967. }
  93968. /**
  93969. * Get the string length of `val`
  93970. */
  93971. function length(val) {
  93972. return val.toString().length;
  93973. }
  93974. /***/ }),
  93975. /* 666 */
  93976. /***/ (function(module, exports, __webpack_require__) {
  93977. "use strict";
  93978. /*!
  93979. * is-number <https://github.com/jonschlinkert/is-number>
  93980. *
  93981. * Copyright (c) 2014-2015, Jon Schlinkert.
  93982. * Licensed under the MIT License.
  93983. */
  93984. var typeOf = __webpack_require__(169);
  93985. module.exports = function isNumber(num) {
  93986. var type = typeOf(num);
  93987. if (type !== 'number' && type !== 'string') {
  93988. return false;
  93989. }
  93990. var n = +num;
  93991. return (n - n + 1) >= 0 && num !== '';
  93992. };
  93993. /***/ }),
  93994. /* 667 */
  93995. /***/ (function(module, exports, __webpack_require__) {
  93996. "use strict";
  93997. /*!
  93998. * isobject <https://github.com/jonschlinkert/isobject>
  93999. *
  94000. * Copyright (c) 2014-2015, Jon Schlinkert.
  94001. * Licensed under the MIT License.
  94002. */
  94003. var isArray = __webpack_require__(366);
  94004. module.exports = function isObject(val) {
  94005. return val != null && typeof val === 'object' && isArray(val) === false;
  94006. };
  94007. /***/ }),
  94008. /* 668 */
  94009. /***/ (function(module, exports, __webpack_require__) {
  94010. "use strict";
  94011. /*!
  94012. * extglob <https://github.com/jonschlinkert/extglob>
  94013. *
  94014. * Copyright (c) 2015, Jon Schlinkert.
  94015. * Licensed under the MIT License.
  94016. */
  94017. /**
  94018. * Module dependencies
  94019. */
  94020. var isExtglob = __webpack_require__(166);
  94021. var re, cache = {};
  94022. /**
  94023. * Expose `extglob`
  94024. */
  94025. module.exports = extglob;
  94026. /**
  94027. * Convert the given extglob `string` to a regex-compatible
  94028. * string.
  94029. *
  94030. * ```js
  94031. * var extglob = require('extglob');
  94032. * extglob('!(a?(b))');
  94033. * //=> '(?!a(?:b)?)[^/]*?'
  94034. * ```
  94035. *
  94036. * @param {String} `str` The string to convert.
  94037. * @param {Object} `options`
  94038. * @option {Boolean} [options] `esc` If `false` special characters will not be escaped. Defaults to `true`.
  94039. * @option {Boolean} [options] `regex` If `true` a regular expression is returned instead of a string.
  94040. * @return {String}
  94041. * @api public
  94042. */
  94043. function extglob(str, opts) {
  94044. opts = opts || {};
  94045. var o = {}, i = 0;
  94046. // fix common character reversals
  94047. // '*!(.js)' => '*.!(js)'
  94048. str = str.replace(/!\(([^\w*()])/g, '$1!(');
  94049. // support file extension negation
  94050. str = str.replace(/([*\/])\.!\([*]\)/g, function (m, ch) {
  94051. if (ch === '/') {
  94052. return escape('\\/[^.]+');
  94053. }
  94054. return escape('[^.]+');
  94055. });
  94056. // create a unique key for caching by
  94057. // combining the string and options
  94058. var key = str
  94059. + String(!!opts.regex)
  94060. + String(!!opts.contains)
  94061. + String(!!opts.escape);
  94062. if (cache.hasOwnProperty(key)) {
  94063. return cache[key];
  94064. }
  94065. if (!(re instanceof RegExp)) {
  94066. re = regex();
  94067. }
  94068. opts.negate = false;
  94069. var m;
  94070. while (m = re.exec(str)) {
  94071. var prefix = m[1];
  94072. var inner = m[3];
  94073. if (prefix === '!') {
  94074. opts.negate = true;
  94075. }
  94076. var id = '__EXTGLOB_' + (i++) + '__';
  94077. // use the prefix of the _last_ (outtermost) pattern
  94078. o[id] = wrap(inner, prefix, opts.escape);
  94079. str = str.split(m[0]).join(id);
  94080. }
  94081. var keys = Object.keys(o);
  94082. var len = keys.length;
  94083. // we have to loop again to allow us to convert
  94084. // patterns in reverse order (starting with the
  94085. // innermost/last pattern first)
  94086. while (len--) {
  94087. var prop = keys[len];
  94088. str = str.split(prop).join(o[prop]);
  94089. }
  94090. var result = opts.regex
  94091. ? toRegex(str, opts.contains, opts.negate)
  94092. : str;
  94093. result = result.split('.').join('\\.');
  94094. // cache the result and return it
  94095. return (cache[key] = result);
  94096. }
  94097. /**
  94098. * Convert `string` to a regex string.
  94099. *
  94100. * @param {String} `str`
  94101. * @param {String} `prefix` Character that determines how to wrap the string.
  94102. * @param {Boolean} `esc` If `false` special characters will not be escaped. Defaults to `true`.
  94103. * @return {String}
  94104. */
  94105. function wrap(inner, prefix, esc) {
  94106. if (esc) inner = escape(inner);
  94107. switch (prefix) {
  94108. case '!':
  94109. return '(?!' + inner + ')[^/]' + (esc ? '%%%~' : '*?');
  94110. case '@':
  94111. return '(?:' + inner + ')';
  94112. case '+':
  94113. return '(?:' + inner + ')+';
  94114. case '*':
  94115. return '(?:' + inner + ')' + (esc ? '%%' : '*')
  94116. case '?':
  94117. return '(?:' + inner + '|)';
  94118. default:
  94119. return inner;
  94120. }
  94121. }
  94122. function escape(str) {
  94123. str = str.split('*').join('[^/]%%%~');
  94124. str = str.split('.').join('\\.');
  94125. return str;
  94126. }
  94127. /**
  94128. * extglob regex.
  94129. */
  94130. function regex() {
  94131. return /(\\?[@?!+*$]\\?)(\(([^()]*?)\))/;
  94132. }
  94133. /**
  94134. * Negation regex
  94135. */
  94136. function negate(str) {
  94137. return '(?!^' + str + ').*$';
  94138. }
  94139. /**
  94140. * Create the regex to do the matching. If
  94141. * the leading character in the `pattern` is `!`
  94142. * a negation regex is returned.
  94143. *
  94144. * @param {String} `pattern`
  94145. * @param {Boolean} `contains` Allow loose matching.
  94146. * @param {Boolean} `isNegated` True if the pattern is a negation pattern.
  94147. */
  94148. function toRegex(pattern, contains, isNegated) {
  94149. var prefix = contains ? '^' : '';
  94150. var after = contains ? '$' : '';
  94151. pattern = ('(?:' + pattern + ')' + after);
  94152. if (isNegated) {
  94153. pattern = prefix + negate(pattern);
  94154. }
  94155. return new RegExp(prefix + pattern);
  94156. }
  94157. /***/ }),
  94158. /* 669 */
  94159. /***/ (function(module, exports, __webpack_require__) {
  94160. /*
  94161. * extsprintf.js: extended POSIX-style sprintf
  94162. */
  94163. var mod_assert = __webpack_require__(50);
  94164. var mod_util = __webpack_require__(9);
  94165. /*
  94166. * Public interface
  94167. */
  94168. exports.sprintf = jsSprintf;
  94169. exports.printf = jsPrintf;
  94170. exports.fprintf = jsFprintf;
  94171. /*
  94172. * Stripped down version of s[n]printf(3c). We make a best effort to throw an
  94173. * exception when given a format string we don't understand, rather than
  94174. * ignoring it, so that we won't break existing programs if/when we go implement
  94175. * the rest of this.
  94176. *
  94177. * This implementation currently supports specifying
  94178. * - field alignment ('-' flag),
  94179. * - zero-pad ('0' flag)
  94180. * - always show numeric sign ('+' flag),
  94181. * - field width
  94182. * - conversions for strings, decimal integers, and floats (numbers).
  94183. * - argument size specifiers. These are all accepted but ignored, since
  94184. * Javascript has no notion of the physical size of an argument.
  94185. *
  94186. * Everything else is currently unsupported, most notably precision, unsigned
  94187. * numbers, non-decimal numbers, and characters.
  94188. */
  94189. function jsSprintf(fmt)
  94190. {
  94191. var regex = [
  94192. '([^%]*)', /* normal text */
  94193. '%', /* start of format */
  94194. '([\'\\-+ #0]*?)', /* flags (optional) */
  94195. '([1-9]\\d*)?', /* width (optional) */
  94196. '(\\.([1-9]\\d*))?', /* precision (optional) */
  94197. '[lhjztL]*?', /* length mods (ignored) */
  94198. '([diouxXfFeEgGaAcCsSp%jr])' /* conversion */
  94199. ].join('');
  94200. var re = new RegExp(regex);
  94201. var args = Array.prototype.slice.call(arguments, 1);
  94202. var flags, width, precision, conversion;
  94203. var left, pad, sign, arg, match;
  94204. var ret = '';
  94205. var argn = 1;
  94206. mod_assert.equal('string', typeof (fmt));
  94207. while ((match = re.exec(fmt)) !== null) {
  94208. ret += match[1];
  94209. fmt = fmt.substring(match[0].length);
  94210. flags = match[2] || '';
  94211. width = match[3] || 0;
  94212. precision = match[4] || '';
  94213. conversion = match[6];
  94214. left = false;
  94215. sign = false;
  94216. pad = ' ';
  94217. if (conversion == '%') {
  94218. ret += '%';
  94219. continue;
  94220. }
  94221. if (args.length === 0)
  94222. throw (new Error('too few args to sprintf'));
  94223. arg = args.shift();
  94224. argn++;
  94225. if (flags.match(/[\' #]/))
  94226. throw (new Error(
  94227. 'unsupported flags: ' + flags));
  94228. if (precision.length > 0)
  94229. throw (new Error(
  94230. 'non-zero precision not supported'));
  94231. if (flags.match(/-/))
  94232. left = true;
  94233. if (flags.match(/0/))
  94234. pad = '0';
  94235. if (flags.match(/\+/))
  94236. sign = true;
  94237. switch (conversion) {
  94238. case 's':
  94239. if (arg === undefined || arg === null)
  94240. throw (new Error('argument ' + argn +
  94241. ': attempted to print undefined or null ' +
  94242. 'as a string'));
  94243. ret += doPad(pad, width, left, arg.toString());
  94244. break;
  94245. case 'd':
  94246. arg = Math.floor(arg);
  94247. /*jsl:fallthru*/
  94248. case 'f':
  94249. sign = sign && arg > 0 ? '+' : '';
  94250. ret += sign + doPad(pad, width, left,
  94251. arg.toString());
  94252. break;
  94253. case 'x':
  94254. ret += doPad(pad, width, left, arg.toString(16));
  94255. break;
  94256. case 'j': /* non-standard */
  94257. if (width === 0)
  94258. width = 10;
  94259. ret += mod_util.inspect(arg, false, width);
  94260. break;
  94261. case 'r': /* non-standard */
  94262. ret += dumpException(arg);
  94263. break;
  94264. default:
  94265. throw (new Error('unsupported conversion: ' +
  94266. conversion));
  94267. }
  94268. }
  94269. ret += fmt;
  94270. return (ret);
  94271. }
  94272. function jsPrintf() {
  94273. var args = Array.prototype.slice.call(arguments);
  94274. args.unshift(process.stdout);
  94275. jsFprintf.apply(null, args);
  94276. }
  94277. function jsFprintf(stream) {
  94278. var args = Array.prototype.slice.call(arguments, 1);
  94279. return (stream.write(jsSprintf.apply(this, args)));
  94280. }
  94281. function doPad(chr, width, left, str)
  94282. {
  94283. var ret = str;
  94284. while (ret.length < width) {
  94285. if (left)
  94286. ret += chr;
  94287. else
  94288. ret = chr + ret;
  94289. }
  94290. return (ret);
  94291. }
  94292. /*
  94293. * This function dumps long stack traces for exceptions having a cause() method.
  94294. * See node-verror for an example.
  94295. */
  94296. function dumpException(ex)
  94297. {
  94298. var ret;
  94299. if (!(ex instanceof Error))
  94300. throw (new Error(jsSprintf('invalid type for %%r: %j', ex)));
  94301. /* Note that V8 prepends "ex.stack" with ex.toString(). */
  94302. ret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;
  94303. if (ex.cause && typeof (ex.cause) === 'function') {
  94304. var cex = ex.cause();
  94305. if (cex) {
  94306. ret += '\nCaused by: ' + dumpException(cex);
  94307. }
  94308. }
  94309. return (ret);
  94310. }
  94311. /***/ }),
  94312. /* 670 */
  94313. /***/ (function(module, exports) {
  94314. /*!
  94315. * filename-regex <https://github.com/regexps/filename-regex>
  94316. *
  94317. * Copyright (c) 2014-2015, Jon Schlinkert
  94318. * Licensed under the MIT license.
  94319. */
  94320. module.exports = function filenameRegex() {
  94321. return /([^\\\/]+)$/;
  94322. };
  94323. /***/ }),
  94324. /* 671 */
  94325. /***/ (function(module, exports, __webpack_require__) {
  94326. "use strict";
  94327. /*!
  94328. * for-in <https://github.com/jonschlinkert/for-in>
  94329. *
  94330. * Copyright (c) 2014-2017, Jon Schlinkert.
  94331. * Released under the MIT License.
  94332. */
  94333. module.exports = function forIn(obj, fn, thisArg) {
  94334. for (var key in obj) {
  94335. if (fn.call(thisArg, obj[key], key, obj) === false) {
  94336. break;
  94337. }
  94338. }
  94339. };
  94340. /***/ }),
  94341. /* 672 */
  94342. /***/ (function(module, exports, __webpack_require__) {
  94343. module.exports = ForeverAgent
  94344. ForeverAgent.SSL = ForeverAgentSSL
  94345. var util = __webpack_require__(9)
  94346. , Agent = __webpack_require__(83).Agent
  94347. , net = __webpack_require__(151)
  94348. , tls = __webpack_require__(440)
  94349. , AgentSSL = __webpack_require__(185).Agent
  94350. function getConnectionName(host, port) {
  94351. var name = ''
  94352. if (typeof host === 'string') {
  94353. name = host + ':' + port
  94354. } else {
  94355. // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name.
  94356. name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':')
  94357. }
  94358. return name
  94359. }
  94360. function ForeverAgent(options) {
  94361. var self = this
  94362. self.options = options || {}
  94363. self.requests = {}
  94364. self.sockets = {}
  94365. self.freeSockets = {}
  94366. self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets
  94367. self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets
  94368. self.on('free', function(socket, host, port) {
  94369. var name = getConnectionName(host, port)
  94370. if (self.requests[name] && self.requests[name].length) {
  94371. self.requests[name].shift().onSocket(socket)
  94372. } else if (self.sockets[name].length < self.minSockets) {
  94373. if (!self.freeSockets[name]) self.freeSockets[name] = []
  94374. self.freeSockets[name].push(socket)
  94375. // if an error happens while we don't use the socket anyway, meh, throw the socket away
  94376. var onIdleError = function() {
  94377. socket.destroy()
  94378. }
  94379. socket._onIdleError = onIdleError
  94380. socket.on('error', onIdleError)
  94381. } else {
  94382. // If there are no pending requests just destroy the
  94383. // socket and it will get removed from the pool. This
  94384. // gets us out of timeout issues and allows us to
  94385. // default to Connection:keep-alive.
  94386. socket.destroy()
  94387. }
  94388. })
  94389. }
  94390. util.inherits(ForeverAgent, Agent)
  94391. ForeverAgent.defaultMinSockets = 5
  94392. ForeverAgent.prototype.createConnection = net.createConnection
  94393. ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest
  94394. ForeverAgent.prototype.addRequest = function(req, host, port) {
  94395. var name = getConnectionName(host, port)
  94396. if (typeof host !== 'string') {
  94397. var options = host
  94398. port = options.port
  94399. host = options.host
  94400. }
  94401. if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {
  94402. var idleSocket = this.freeSockets[name].pop()
  94403. idleSocket.removeListener('error', idleSocket._onIdleError)
  94404. delete idleSocket._onIdleError
  94405. req._reusedSocket = true
  94406. req.onSocket(idleSocket)
  94407. } else {
  94408. this.addRequestNoreuse(req, host, port)
  94409. }
  94410. }
  94411. ForeverAgent.prototype.removeSocket = function(s, name, host, port) {
  94412. if (this.sockets[name]) {
  94413. var index = this.sockets[name].indexOf(s)
  94414. if (index !== -1) {
  94415. this.sockets[name].splice(index, 1)
  94416. }
  94417. } else if (this.sockets[name] && this.sockets[name].length === 0) {
  94418. // don't leak
  94419. delete this.sockets[name]
  94420. delete this.requests[name]
  94421. }
  94422. if (this.freeSockets[name]) {
  94423. var index = this.freeSockets[name].indexOf(s)
  94424. if (index !== -1) {
  94425. this.freeSockets[name].splice(index, 1)
  94426. if (this.freeSockets[name].length === 0) {
  94427. delete this.freeSockets[name]
  94428. }
  94429. }
  94430. }
  94431. if (this.requests[name] && this.requests[name].length) {
  94432. // If we have pending requests and a socket gets closed a new one
  94433. // needs to be created to take over in the pool for the one that closed.
  94434. this.createSocket(name, host, port).emit('free')
  94435. }
  94436. }
  94437. function ForeverAgentSSL (options) {
  94438. ForeverAgent.call(this, options)
  94439. }
  94440. util.inherits(ForeverAgentSSL, ForeverAgent)
  94441. ForeverAgentSSL.prototype.createConnection = createConnectionSSL
  94442. ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest
  94443. function createConnectionSSL (port, host, options) {
  94444. if (typeof port === 'object') {
  94445. options = port;
  94446. } else if (typeof host === 'object') {
  94447. options = host;
  94448. } else if (typeof options === 'object') {
  94449. options = options;
  94450. } else {
  94451. options = {};
  94452. }
  94453. if (typeof port === 'number') {
  94454. options.port = port;
  94455. }
  94456. if (typeof host === 'string') {
  94457. options.host = host;
  94458. }
  94459. return tls.connect(options);
  94460. }
  94461. /***/ }),
  94462. /* 673 */
  94463. /***/ (function(module, exports, __webpack_require__) {
  94464. var CombinedStream = __webpack_require__(323);
  94465. var util = __webpack_require__(9);
  94466. var path = __webpack_require__(1);
  94467. var http = __webpack_require__(83);
  94468. var https = __webpack_require__(185);
  94469. var parseUrl = __webpack_require__(29).parse;
  94470. var fs = __webpack_require__(12);
  94471. var mime = __webpack_require__(370);
  94472. var asynckit = __webpack_require__(458);
  94473. var populate = __webpack_require__(674);
  94474. // Public API
  94475. module.exports = FormData;
  94476. // make it a Stream
  94477. util.inherits(FormData, CombinedStream);
  94478. /**
  94479. * Create readable "multipart/form-data" streams.
  94480. * Can be used to submit forms
  94481. * and file uploads to other web applications.
  94482. *
  94483. * @constructor
  94484. * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream
  94485. */
  94486. function FormData(options) {
  94487. if (!(this instanceof FormData)) {
  94488. return new FormData();
  94489. }
  94490. this._overheadLength = 0;
  94491. this._valueLength = 0;
  94492. this._valuesToMeasure = [];
  94493. CombinedStream.call(this);
  94494. options = options || {};
  94495. for (var option in options) {
  94496. this[option] = options[option];
  94497. }
  94498. }
  94499. FormData.LINE_BREAK = '\r\n';
  94500. FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
  94501. FormData.prototype.append = function(field, value, options) {
  94502. options = options || {};
  94503. // allow filename as single option
  94504. if (typeof options == 'string') {
  94505. options = {filename: options};
  94506. }
  94507. var append = CombinedStream.prototype.append.bind(this);
  94508. // all that streamy business can't handle numbers
  94509. if (typeof value == 'number') {
  94510. value = '' + value;
  94511. }
  94512. // https://github.com/felixge/node-form-data/issues/38
  94513. if (util.isArray(value)) {
  94514. // Please convert your array into string
  94515. // the way web server expects it
  94516. this._error(new Error('Arrays are not supported.'));
  94517. return;
  94518. }
  94519. var header = this._multiPartHeader(field, value, options);
  94520. var footer = this._multiPartFooter();
  94521. append(header);
  94522. append(value);
  94523. append(footer);
  94524. // pass along options.knownLength
  94525. this._trackLength(header, value, options);
  94526. };
  94527. FormData.prototype._trackLength = function(header, value, options) {
  94528. var valueLength = 0;
  94529. // used w/ getLengthSync(), when length is known.
  94530. // e.g. for streaming directly from a remote server,
  94531. // w/ a known file a size, and not wanting to wait for
  94532. // incoming file to finish to get its size.
  94533. if (options.knownLength != null) {
  94534. valueLength += +options.knownLength;
  94535. } else if (Buffer.isBuffer(value)) {
  94536. valueLength = value.length;
  94537. } else if (typeof value === 'string') {
  94538. valueLength = Buffer.byteLength(value);
  94539. }
  94540. this._valueLength += valueLength;
  94541. // @check why add CRLF? does this account for custom/multiple CRLFs?
  94542. this._overheadLength +=
  94543. Buffer.byteLength(header) +
  94544. FormData.LINE_BREAK.length;
  94545. // empty or either doesn't have path or not an http response
  94546. if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {
  94547. return;
  94548. }
  94549. // no need to bother with the length
  94550. if (!options.knownLength) {
  94551. this._valuesToMeasure.push(value);
  94552. }
  94553. };
  94554. FormData.prototype._lengthRetriever = function(value, callback) {
  94555. if (value.hasOwnProperty('fd')) {
  94556. // take read range into a account
  94557. // `end` = Infinity –> read file till the end
  94558. //
  94559. // TODO: Looks like there is bug in Node fs.createReadStream
  94560. // it doesn't respect `end` options without `start` options
  94561. // Fix it when node fixes it.
  94562. // https://github.com/joyent/node/issues/7819
  94563. if (value.end != undefined && value.end != Infinity && value.start != undefined) {
  94564. // when end specified
  94565. // no need to calculate range
  94566. // inclusive, starts with 0
  94567. callback(null, value.end + 1 - (value.start ? value.start : 0));
  94568. // not that fast snoopy
  94569. } else {
  94570. // still need to fetch file size from fs
  94571. fs.stat(value.path, function(err, stat) {
  94572. var fileSize;
  94573. if (err) {
  94574. callback(err);
  94575. return;
  94576. }
  94577. // update final size based on the range options
  94578. fileSize = stat.size - (value.start ? value.start : 0);
  94579. callback(null, fileSize);
  94580. });
  94581. }
  94582. // or http response
  94583. } else if (value.hasOwnProperty('httpVersion')) {
  94584. callback(null, +value.headers['content-length']);
  94585. // or request stream http://github.com/mikeal/request
  94586. } else if (value.hasOwnProperty('httpModule')) {
  94587. // wait till response come back
  94588. value.on('response', function(response) {
  94589. value.pause();
  94590. callback(null, +response.headers['content-length']);
  94591. });
  94592. value.resume();
  94593. // something else
  94594. } else {
  94595. callback('Unknown stream');
  94596. }
  94597. };
  94598. FormData.prototype._multiPartHeader = function(field, value, options) {
  94599. // custom header specified (as string)?
  94600. // it becomes responsible for boundary
  94601. // (e.g. to handle extra CRLFs on .NET servers)
  94602. if (typeof options.header == 'string') {
  94603. return options.header;
  94604. }
  94605. var contentDisposition = this._getContentDisposition(value, options);
  94606. var contentType = this._getContentType(value, options);
  94607. var contents = '';
  94608. var headers = {
  94609. // add custom disposition as third element or keep it two elements if not
  94610. 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
  94611. // if no content type. allow it to be empty array
  94612. 'Content-Type': [].concat(contentType || [])
  94613. };
  94614. // allow custom headers.
  94615. if (typeof options.header == 'object') {
  94616. populate(headers, options.header);
  94617. }
  94618. var header;
  94619. for (var prop in headers) {
  94620. if (!headers.hasOwnProperty(prop)) continue;
  94621. header = headers[prop];
  94622. // skip nullish headers.
  94623. if (header == null) {
  94624. continue;
  94625. }
  94626. // convert all headers to arrays.
  94627. if (!Array.isArray(header)) {
  94628. header = [header];
  94629. }
  94630. // add non-empty headers.
  94631. if (header.length) {
  94632. contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
  94633. }
  94634. }
  94635. return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
  94636. };
  94637. FormData.prototype._getContentDisposition = function(value, options) {
  94638. var filename
  94639. , contentDisposition
  94640. ;
  94641. if (typeof options.filepath === 'string') {
  94642. // custom filepath for relative paths
  94643. filename = path.normalize(options.filepath).replace(/\\/g, '/');
  94644. } else if (options.filename || value.name || value.path) {
  94645. // custom filename take precedence
  94646. // formidable and the browser add a name property
  94647. // fs- and request- streams have path property
  94648. filename = path.basename(options.filename || value.name || value.path);
  94649. } else if (value.readable && value.hasOwnProperty('httpVersion')) {
  94650. // or try http response
  94651. filename = path.basename(value.client._httpMessage.path);
  94652. }
  94653. if (filename) {
  94654. contentDisposition = 'filename="' + filename + '"';
  94655. }
  94656. return contentDisposition;
  94657. };
  94658. FormData.prototype._getContentType = function(value, options) {
  94659. // use custom content-type above all
  94660. var contentType = options.contentType;
  94661. // or try `name` from formidable, browser
  94662. if (!contentType && value.name) {
  94663. contentType = mime.lookup(value.name);
  94664. }
  94665. // or try `path` from fs-, request- streams
  94666. if (!contentType && value.path) {
  94667. contentType = mime.lookup(value.path);
  94668. }
  94669. // or if it's http-reponse
  94670. if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {
  94671. contentType = value.headers['content-type'];
  94672. }
  94673. // or guess it from the filepath or filename
  94674. if (!contentType && (options.filepath || options.filename)) {
  94675. contentType = mime.lookup(options.filepath || options.filename);
  94676. }
  94677. // fallback to the default content type if `value` is not simple value
  94678. if (!contentType && typeof value == 'object') {
  94679. contentType = FormData.DEFAULT_CONTENT_TYPE;
  94680. }
  94681. return contentType;
  94682. };
  94683. FormData.prototype._multiPartFooter = function() {
  94684. return function(next) {
  94685. var footer = FormData.LINE_BREAK;
  94686. var lastPart = (this._streams.length === 0);
  94687. if (lastPart) {
  94688. footer += this._lastBoundary();
  94689. }
  94690. next(footer);
  94691. }.bind(this);
  94692. };
  94693. FormData.prototype._lastBoundary = function() {
  94694. return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
  94695. };
  94696. FormData.prototype.getHeaders = function(userHeaders) {
  94697. var header;
  94698. var formHeaders = {
  94699. 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
  94700. };
  94701. for (header in userHeaders) {
  94702. if (userHeaders.hasOwnProperty(header)) {
  94703. formHeaders[header.toLowerCase()] = userHeaders[header];
  94704. }
  94705. }
  94706. return formHeaders;
  94707. };
  94708. FormData.prototype.getBoundary = function() {
  94709. if (!this._boundary) {
  94710. this._generateBoundary();
  94711. }
  94712. return this._boundary;
  94713. };
  94714. FormData.prototype._generateBoundary = function() {
  94715. // This generates a 50 character boundary similar to those used by Firefox.
  94716. // They are optimized for boyer-moore parsing.
  94717. var boundary = '--------------------------';
  94718. for (var i = 0; i < 24; i++) {
  94719. boundary += Math.floor(Math.random() * 10).toString(16);
  94720. }
  94721. this._boundary = boundary;
  94722. };
  94723. // Note: getLengthSync DOESN'T calculate streams length
  94724. // As workaround one can calculate file size manually
  94725. // and add it as knownLength option
  94726. FormData.prototype.getLengthSync = function() {
  94727. var knownLength = this._overheadLength + this._valueLength;
  94728. // Don't get confused, there are 3 "internal" streams for each keyval pair
  94729. // so it basically checks if there is any value added to the form
  94730. if (this._streams.length) {
  94731. knownLength += this._lastBoundary().length;
  94732. }
  94733. // https://github.com/form-data/form-data/issues/40
  94734. if (!this.hasKnownLength()) {
  94735. // Some async length retrievers are present
  94736. // therefore synchronous length calculation is false.
  94737. // Please use getLength(callback) to get proper length
  94738. this._error(new Error('Cannot calculate proper length in synchronous way.'));
  94739. }
  94740. return knownLength;
  94741. };
  94742. // Public API to check if length of added values is known
  94743. // https://github.com/form-data/form-data/issues/196
  94744. // https://github.com/form-data/form-data/issues/262
  94745. FormData.prototype.hasKnownLength = function() {
  94746. var hasKnownLength = true;
  94747. if (this._valuesToMeasure.length) {
  94748. hasKnownLength = false;
  94749. }
  94750. return hasKnownLength;
  94751. };
  94752. FormData.prototype.getLength = function(cb) {
  94753. var knownLength = this._overheadLength + this._valueLength;
  94754. if (this._streams.length) {
  94755. knownLength += this._lastBoundary().length;
  94756. }
  94757. if (!this._valuesToMeasure.length) {
  94758. process.nextTick(cb.bind(this, null, knownLength));
  94759. return;
  94760. }
  94761. asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
  94762. if (err) {
  94763. cb(err);
  94764. return;
  94765. }
  94766. values.forEach(function(length) {
  94767. knownLength += length;
  94768. });
  94769. cb(null, knownLength);
  94770. });
  94771. };
  94772. FormData.prototype.submit = function(params, cb) {
  94773. var request
  94774. , options
  94775. , defaults = {method: 'post'}
  94776. ;
  94777. // parse provided url if it's string
  94778. // or treat it as options object
  94779. if (typeof params == 'string') {
  94780. params = parseUrl(params);
  94781. options = populate({
  94782. port: params.port,
  94783. path: params.pathname,
  94784. host: params.hostname,
  94785. protocol: params.protocol
  94786. }, defaults);
  94787. // use custom params
  94788. } else {
  94789. options = populate(params, defaults);
  94790. // if no port provided use default one
  94791. if (!options.port) {
  94792. options.port = options.protocol == 'https:' ? 443 : 80;
  94793. }
  94794. }
  94795. // put that good code in getHeaders to some use
  94796. options.headers = this.getHeaders(params.headers);
  94797. // https if specified, fallback to http in any other case
  94798. if (options.protocol == 'https:') {
  94799. request = https.request(options);
  94800. } else {
  94801. request = http.request(options);
  94802. }
  94803. // get content length and fire away
  94804. this.getLength(function(err, length) {
  94805. if (err) {
  94806. this._error(err);
  94807. return;
  94808. }
  94809. // add content length
  94810. request.setHeader('Content-Length', length);
  94811. this.pipe(request);
  94812. if (cb) {
  94813. request.on('error', cb);
  94814. request.on('response', cb.bind(this, null));
  94815. }
  94816. }.bind(this));
  94817. return request;
  94818. };
  94819. FormData.prototype._error = function(err) {
  94820. if (!this.error) {
  94821. this.error = err;
  94822. this.pause();
  94823. this.emit('error', err);
  94824. }
  94825. };
  94826. FormData.prototype.toString = function () {
  94827. return '[object FormData]';
  94828. };
  94829. /***/ }),
  94830. /* 674 */
  94831. /***/ (function(module, exports) {
  94832. // populates missing values
  94833. module.exports = function(dst, src) {
  94834. Object.keys(src).forEach(function(prop)
  94835. {
  94836. dst[prop] = dst[prop] || src[prop];
  94837. });
  94838. return dst;
  94839. };
  94840. /***/ }),
  94841. /* 675 */
  94842. /***/ (function(module, exports, __webpack_require__) {
  94843. module.exports = __webpack_require__(12).constants || __webpack_require__(439)
  94844. /***/ }),
  94845. /* 676 */
  94846. /***/ (function(module, exports, __webpack_require__) {
  94847. // Copyright Joyent, Inc. and other Node contributors.
  94848. //
  94849. // Permission is hereby granted, free of charge, to any person obtaining a
  94850. // copy of this software and associated documentation files (the
  94851. // "Software"), to deal in the Software without restriction, including
  94852. // without limitation the rights to use, copy, modify, merge, publish,
  94853. // distribute, sublicense, and/or sell copies of the Software, and to permit
  94854. // persons to whom the Software is furnished to do so, subject to the
  94855. // following conditions:
  94856. //
  94857. // The above copyright notice and this permission notice shall be included
  94858. // in all copies or substantial portions of the Software.
  94859. //
  94860. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  94861. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  94862. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  94863. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  94864. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  94865. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  94866. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  94867. var pathModule = __webpack_require__(1);
  94868. var isWindows = process.platform === 'win32';
  94869. var fs = __webpack_require__(12);
  94870. // JavaScript implementation of realpath, ported from node pre-v6
  94871. var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
  94872. function rethrow() {
  94873. // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
  94874. // is fairly slow to generate.
  94875. var callback;
  94876. if (DEBUG) {
  94877. var backtrace = new Error;
  94878. callback = debugCallback;
  94879. } else
  94880. callback = missingCallback;
  94881. return callback;
  94882. function debugCallback(err) {
  94883. if (err) {
  94884. backtrace.message = err.message;
  94885. err = backtrace;
  94886. missingCallback(err);
  94887. }
  94888. }
  94889. function missingCallback(err) {
  94890. if (err) {
  94891. if (process.throwDeprecation)
  94892. throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
  94893. else if (!process.noDeprecation) {
  94894. var msg = 'fs: missing callback ' + (err.stack || err.message);
  94895. if (process.traceDeprecation)
  94896. console.trace(msg);
  94897. else
  94898. console.error(msg);
  94899. }
  94900. }
  94901. }
  94902. }
  94903. function maybeCallback(cb) {
  94904. return typeof cb === 'function' ? cb : rethrow();
  94905. }
  94906. var normalize = pathModule.normalize;
  94907. // Regexp that finds the next partion of a (partial) path
  94908. // result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
  94909. if (isWindows) {
  94910. var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
  94911. } else {
  94912. var nextPartRe = /(.*?)(?:[\/]+|$)/g;
  94913. }
  94914. // Regex to find the device root, including trailing slash. E.g. 'c:\\'.
  94915. if (isWindows) {
  94916. var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
  94917. } else {
  94918. var splitRootRe = /^[\/]*/;
  94919. }
  94920. exports.realpathSync = function realpathSync(p, cache) {
  94921. // make p is absolute
  94922. p = pathModule.resolve(p);
  94923. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  94924. return cache[p];
  94925. }
  94926. var original = p,
  94927. seenLinks = {},
  94928. knownHard = {};
  94929. // current character position in p
  94930. var pos;
  94931. // the partial path so far, including a trailing slash if any
  94932. var current;
  94933. // the partial path without a trailing slash (except when pointing at a root)
  94934. var base;
  94935. // the partial path scanned in the previous round, with slash
  94936. var previous;
  94937. start();
  94938. function start() {
  94939. // Skip over roots
  94940. var m = splitRootRe.exec(p);
  94941. pos = m[0].length;
  94942. current = m[0];
  94943. base = m[0];
  94944. previous = '';
  94945. // On windows, check that the root exists. On unix there is no need.
  94946. if (isWindows && !knownHard[base]) {
  94947. fs.lstatSync(base);
  94948. knownHard[base] = true;
  94949. }
  94950. }
  94951. // walk down the path, swapping out linked pathparts for their real
  94952. // values
  94953. // NB: p.length changes.
  94954. while (pos < p.length) {
  94955. // find the next part
  94956. nextPartRe.lastIndex = pos;
  94957. var result = nextPartRe.exec(p);
  94958. previous = current;
  94959. current += result[0];
  94960. base = previous + result[1];
  94961. pos = nextPartRe.lastIndex;
  94962. // continue if not a symlink
  94963. if (knownHard[base] || (cache && cache[base] === base)) {
  94964. continue;
  94965. }
  94966. var resolvedLink;
  94967. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  94968. // some known symbolic link. no need to stat again.
  94969. resolvedLink = cache[base];
  94970. } else {
  94971. var stat = fs.lstatSync(base);
  94972. if (!stat.isSymbolicLink()) {
  94973. knownHard[base] = true;
  94974. if (cache) cache[base] = base;
  94975. continue;
  94976. }
  94977. // read the link if it wasn't read before
  94978. // dev/ino always return 0 on windows, so skip the check.
  94979. var linkTarget = null;
  94980. if (!isWindows) {
  94981. var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
  94982. if (seenLinks.hasOwnProperty(id)) {
  94983. linkTarget = seenLinks[id];
  94984. }
  94985. }
  94986. if (linkTarget === null) {
  94987. fs.statSync(base);
  94988. linkTarget = fs.readlinkSync(base);
  94989. }
  94990. resolvedLink = pathModule.resolve(previous, linkTarget);
  94991. // track this, if given a cache.
  94992. if (cache) cache[base] = resolvedLink;
  94993. if (!isWindows) seenLinks[id] = linkTarget;
  94994. }
  94995. // resolve the link, then start over
  94996. p = pathModule.resolve(resolvedLink, p.slice(pos));
  94997. start();
  94998. }
  94999. if (cache) cache[original] = p;
  95000. return p;
  95001. };
  95002. exports.realpath = function realpath(p, cache, cb) {
  95003. if (typeof cb !== 'function') {
  95004. cb = maybeCallback(cache);
  95005. cache = null;
  95006. }
  95007. // make p is absolute
  95008. p = pathModule.resolve(p);
  95009. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  95010. return process.nextTick(cb.bind(null, null, cache[p]));
  95011. }
  95012. var original = p,
  95013. seenLinks = {},
  95014. knownHard = {};
  95015. // current character position in p
  95016. var pos;
  95017. // the partial path so far, including a trailing slash if any
  95018. var current;
  95019. // the partial path without a trailing slash (except when pointing at a root)
  95020. var base;
  95021. // the partial path scanned in the previous round, with slash
  95022. var previous;
  95023. start();
  95024. function start() {
  95025. // Skip over roots
  95026. var m = splitRootRe.exec(p);
  95027. pos = m[0].length;
  95028. current = m[0];
  95029. base = m[0];
  95030. previous = '';
  95031. // On windows, check that the root exists. On unix there is no need.
  95032. if (isWindows && !knownHard[base]) {
  95033. fs.lstat(base, function(err) {
  95034. if (err) return cb(err);
  95035. knownHard[base] = true;
  95036. LOOP();
  95037. });
  95038. } else {
  95039. process.nextTick(LOOP);
  95040. }
  95041. }
  95042. // walk down the path, swapping out linked pathparts for their real
  95043. // values
  95044. function LOOP() {
  95045. // stop if scanned past end of path
  95046. if (pos >= p.length) {
  95047. if (cache) cache[original] = p;
  95048. return cb(null, p);
  95049. }
  95050. // find the next part
  95051. nextPartRe.lastIndex = pos;
  95052. var result = nextPartRe.exec(p);
  95053. previous = current;
  95054. current += result[0];
  95055. base = previous + result[1];
  95056. pos = nextPartRe.lastIndex;
  95057. // continue if not a symlink
  95058. if (knownHard[base] || (cache && cache[base] === base)) {
  95059. return process.nextTick(LOOP);
  95060. }
  95061. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  95062. // known symbolic link. no need to stat again.
  95063. return gotResolvedLink(cache[base]);
  95064. }
  95065. return fs.lstat(base, gotStat);
  95066. }
  95067. function gotStat(err, stat) {
  95068. if (err) return cb(err);
  95069. // if not a symlink, skip to the next path part
  95070. if (!stat.isSymbolicLink()) {
  95071. knownHard[base] = true;
  95072. if (cache) cache[base] = base;
  95073. return process.nextTick(LOOP);
  95074. }
  95075. // stat & read the link if not read before
  95076. // call gotTarget as soon as the link target is known
  95077. // dev/ino always return 0 on windows, so skip the check.
  95078. if (!isWindows) {
  95079. var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
  95080. if (seenLinks.hasOwnProperty(id)) {
  95081. return gotTarget(null, seenLinks[id], base);
  95082. }
  95083. }
  95084. fs.stat(base, function(err) {
  95085. if (err) return cb(err);
  95086. fs.readlink(base, function(err, target) {
  95087. if (!isWindows) seenLinks[id] = target;
  95088. gotTarget(err, target);
  95089. });
  95090. });
  95091. }
  95092. function gotTarget(err, target, base) {
  95093. if (err) return cb(err);
  95094. var resolvedLink = pathModule.resolve(previous, target);
  95095. if (cache) cache[base] = resolvedLink;
  95096. gotResolvedLink(resolvedLink);
  95097. }
  95098. function gotResolvedLink(resolvedLink) {
  95099. // resolve the link, then start over
  95100. p = pathModule.resolve(resolvedLink, p.slice(pos));
  95101. start();
  95102. }
  95103. };
  95104. /***/ }),
  95105. /* 677 */
  95106. /***/ (function(module, exports, __webpack_require__) {
  95107. "use strict";
  95108. /*!
  95109. * glob-base <https://github.com/jonschlinkert/glob-base>
  95110. *
  95111. * Copyright (c) 2015, Jon Schlinkert.
  95112. * Licensed under the MIT License.
  95113. */
  95114. var path = __webpack_require__(1);
  95115. var parent = __webpack_require__(678);
  95116. var isGlob = __webpack_require__(167);
  95117. module.exports = function globBase(pattern) {
  95118. if (typeof pattern !== 'string') {
  95119. throw new TypeError('glob-base expects a string.');
  95120. }
  95121. var res = {};
  95122. res.base = parent(pattern);
  95123. res.isGlob = isGlob(pattern);
  95124. if (res.base !== '.') {
  95125. res.glob = pattern.substr(res.base.length);
  95126. if (res.glob.charAt(0) === '/') {
  95127. res.glob = res.glob.substr(1);
  95128. }
  95129. } else {
  95130. res.glob = pattern;
  95131. }
  95132. if (!res.isGlob) {
  95133. res.base = dirname(pattern);
  95134. res.glob = res.base !== '.'
  95135. ? pattern.substr(res.base.length)
  95136. : pattern;
  95137. }
  95138. if (res.glob.substr(0, 2) === './') {
  95139. res.glob = res.glob.substr(2);
  95140. }
  95141. if (res.glob.charAt(0) === '/') {
  95142. res.glob = res.glob.substr(1);
  95143. }
  95144. return res;
  95145. };
  95146. function dirname(glob) {
  95147. if (glob.slice(-1) === '/') return glob;
  95148. return path.dirname(glob);
  95149. }
  95150. /***/ }),
  95151. /* 678 */
  95152. /***/ (function(module, exports, __webpack_require__) {
  95153. "use strict";
  95154. var path = __webpack_require__(1);
  95155. var isglob = __webpack_require__(167);
  95156. module.exports = function globParent(str) {
  95157. str += 'a'; // preserves full path in case of trailing path separator
  95158. do {str = path.dirname(str)} while (isglob(str));
  95159. return str;
  95160. };
  95161. /***/ }),
  95162. /* 679 */
  95163. /***/ (function(module, exports, __webpack_require__) {
  95164. module.exports = globSync
  95165. globSync.GlobSync = GlobSync
  95166. var fs = __webpack_require__(12)
  95167. var rp = __webpack_require__(353)
  95168. var minimatch = __webpack_require__(170)
  95169. var Minimatch = minimatch.Minimatch
  95170. var Glob = __webpack_require__(234).Glob
  95171. var util = __webpack_require__(9)
  95172. var path = __webpack_require__(1)
  95173. var assert = __webpack_require__(50)
  95174. var isAbsolute = __webpack_require__(245)
  95175. var common = __webpack_require__(354)
  95176. var alphasort = common.alphasort
  95177. var alphasorti = common.alphasorti
  95178. var setopts = common.setopts
  95179. var ownProp = common.ownProp
  95180. var childrenIgnored = common.childrenIgnored
  95181. var isIgnored = common.isIgnored
  95182. function globSync (pattern, options) {
  95183. if (typeof options === 'function' || arguments.length === 3)
  95184. throw new TypeError('callback provided to sync glob\n'+
  95185. 'See: https://github.com/isaacs/node-glob/issues/167')
  95186. return new GlobSync(pattern, options).found
  95187. }
  95188. function GlobSync (pattern, options) {
  95189. if (!pattern)
  95190. throw new Error('must provide pattern')
  95191. if (typeof options === 'function' || arguments.length === 3)
  95192. throw new TypeError('callback provided to sync glob\n'+
  95193. 'See: https://github.com/isaacs/node-glob/issues/167')
  95194. if (!(this instanceof GlobSync))
  95195. return new GlobSync(pattern, options)
  95196. setopts(this, pattern, options)
  95197. if (this.noprocess)
  95198. return this
  95199. var n = this.minimatch.set.length
  95200. this.matches = new Array(n)
  95201. for (var i = 0; i < n; i ++) {
  95202. this._process(this.minimatch.set[i], i, false)
  95203. }
  95204. this._finish()
  95205. }
  95206. GlobSync.prototype._finish = function () {
  95207. assert(this instanceof GlobSync)
  95208. if (this.realpath) {
  95209. var self = this
  95210. this.matches.forEach(function (matchset, index) {
  95211. var set = self.matches[index] = Object.create(null)
  95212. for (var p in matchset) {
  95213. try {
  95214. p = self._makeAbs(p)
  95215. var real = rp.realpathSync(p, self.realpathCache)
  95216. set[real] = true
  95217. } catch (er) {
  95218. if (er.syscall === 'stat')
  95219. set[self._makeAbs(p)] = true
  95220. else
  95221. throw er
  95222. }
  95223. }
  95224. })
  95225. }
  95226. common.finish(this)
  95227. }
  95228. GlobSync.prototype._process = function (pattern, index, inGlobStar) {
  95229. assert(this instanceof GlobSync)
  95230. // Get the first [n] parts of pattern that are all strings.
  95231. var n = 0
  95232. while (typeof pattern[n] === 'string') {
  95233. n ++
  95234. }
  95235. // now n is the index of the first one that is *not* a string.
  95236. // See if there's anything else
  95237. var prefix
  95238. switch (n) {
  95239. // if not, then this is rather simple
  95240. case pattern.length:
  95241. this._processSimple(pattern.join('/'), index)
  95242. return
  95243. case 0:
  95244. // pattern *starts* with some non-trivial item.
  95245. // going to readdir(cwd), but not include the prefix in matches.
  95246. prefix = null
  95247. break
  95248. default:
  95249. // pattern has some string bits in the front.
  95250. // whatever it starts with, whether that's 'absolute' like /foo/bar,
  95251. // or 'relative' like '../baz'
  95252. prefix = pattern.slice(0, n).join('/')
  95253. break
  95254. }
  95255. var remain = pattern.slice(n)
  95256. // get the list of entries.
  95257. var read
  95258. if (prefix === null)
  95259. read = '.'
  95260. else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
  95261. if (!prefix || !isAbsolute(prefix))
  95262. prefix = '/' + prefix
  95263. read = prefix
  95264. } else
  95265. read = prefix
  95266. var abs = this._makeAbs(read)
  95267. //if ignored, skip processing
  95268. if (childrenIgnored(this, read))
  95269. return
  95270. var isGlobStar = remain[0] === minimatch.GLOBSTAR
  95271. if (isGlobStar)
  95272. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
  95273. else
  95274. this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
  95275. }
  95276. GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
  95277. var entries = this._readdir(abs, inGlobStar)
  95278. // if the abs isn't a dir, then nothing can match!
  95279. if (!entries)
  95280. return
  95281. // It will only match dot entries if it starts with a dot, or if
  95282. // dot is set. Stuff like @(.foo|.bar) isn't allowed.
  95283. var pn = remain[0]
  95284. var negate = !!this.minimatch.negate
  95285. var rawGlob = pn._glob
  95286. var dotOk = this.dot || rawGlob.charAt(0) === '.'
  95287. var matchedEntries = []
  95288. for (var i = 0; i < entries.length; i++) {
  95289. var e = entries[i]
  95290. if (e.charAt(0) !== '.' || dotOk) {
  95291. var m
  95292. if (negate && !prefix) {
  95293. m = !e.match(pn)
  95294. } else {
  95295. m = e.match(pn)
  95296. }
  95297. if (m)
  95298. matchedEntries.push(e)
  95299. }
  95300. }
  95301. var len = matchedEntries.length
  95302. // If there are no matched entries, then nothing matches.
  95303. if (len === 0)
  95304. return
  95305. // if this is the last remaining pattern bit, then no need for
  95306. // an additional stat *unless* the user has specified mark or
  95307. // stat explicitly. We know they exist, since readdir returned
  95308. // them.
  95309. if (remain.length === 1 && !this.mark && !this.stat) {
  95310. if (!this.matches[index])
  95311. this.matches[index] = Object.create(null)
  95312. for (var i = 0; i < len; i ++) {
  95313. var e = matchedEntries[i]
  95314. if (prefix) {
  95315. if (prefix.slice(-1) !== '/')
  95316. e = prefix + '/' + e
  95317. else
  95318. e = prefix + e
  95319. }
  95320. if (e.charAt(0) === '/' && !this.nomount) {
  95321. e = path.join(this.root, e)
  95322. }
  95323. this._emitMatch(index, e)
  95324. }
  95325. // This was the last one, and no stats were needed
  95326. return
  95327. }
  95328. // now test all matched entries as stand-ins for that part
  95329. // of the pattern.
  95330. remain.shift()
  95331. for (var i = 0; i < len; i ++) {
  95332. var e = matchedEntries[i]
  95333. var newPattern
  95334. if (prefix)
  95335. newPattern = [prefix, e]
  95336. else
  95337. newPattern = [e]
  95338. this._process(newPattern.concat(remain), index, inGlobStar)
  95339. }
  95340. }
  95341. GlobSync.prototype._emitMatch = function (index, e) {
  95342. if (isIgnored(this, e))
  95343. return
  95344. var abs = this._makeAbs(e)
  95345. if (this.mark)
  95346. e = this._mark(e)
  95347. if (this.absolute) {
  95348. e = abs
  95349. }
  95350. if (this.matches[index][e])
  95351. return
  95352. if (this.nodir) {
  95353. var c = this.cache[abs]
  95354. if (c === 'DIR' || Array.isArray(c))
  95355. return
  95356. }
  95357. this.matches[index][e] = true
  95358. if (this.stat)
  95359. this._stat(e)
  95360. }
  95361. GlobSync.prototype._readdirInGlobStar = function (abs) {
  95362. // follow all symlinked directories forever
  95363. // just proceed as if this is a non-globstar situation
  95364. if (this.follow)
  95365. return this._readdir(abs, false)
  95366. var entries
  95367. var lstat
  95368. var stat
  95369. try {
  95370. lstat = fs.lstatSync(abs)
  95371. } catch (er) {
  95372. if (er.code === 'ENOENT') {
  95373. // lstat failed, doesn't exist
  95374. return null
  95375. }
  95376. }
  95377. var isSym = lstat && lstat.isSymbolicLink()
  95378. this.symlinks[abs] = isSym
  95379. // If it's not a symlink or a dir, then it's definitely a regular file.
  95380. // don't bother doing a readdir in that case.
  95381. if (!isSym && lstat && !lstat.isDirectory())
  95382. this.cache[abs] = 'FILE'
  95383. else
  95384. entries = this._readdir(abs, false)
  95385. return entries
  95386. }
  95387. GlobSync.prototype._readdir = function (abs, inGlobStar) {
  95388. var entries
  95389. if (inGlobStar && !ownProp(this.symlinks, abs))
  95390. return this._readdirInGlobStar(abs)
  95391. if (ownProp(this.cache, abs)) {
  95392. var c = this.cache[abs]
  95393. if (!c || c === 'FILE')
  95394. return null
  95395. if (Array.isArray(c))
  95396. return c
  95397. }
  95398. try {
  95399. return this._readdirEntries(abs, fs.readdirSync(abs))
  95400. } catch (er) {
  95401. this._readdirError(abs, er)
  95402. return null
  95403. }
  95404. }
  95405. GlobSync.prototype._readdirEntries = function (abs, entries) {
  95406. // if we haven't asked to stat everything, then just
  95407. // assume that everything in there exists, so we can avoid
  95408. // having to stat it a second time.
  95409. if (!this.mark && !this.stat) {
  95410. for (var i = 0; i < entries.length; i ++) {
  95411. var e = entries[i]
  95412. if (abs === '/')
  95413. e = abs + e
  95414. else
  95415. e = abs + '/' + e
  95416. this.cache[e] = true
  95417. }
  95418. }
  95419. this.cache[abs] = entries
  95420. // mark and cache dir-ness
  95421. return entries
  95422. }
  95423. GlobSync.prototype._readdirError = function (f, er) {
  95424. // handle errors, and cache the information
  95425. switch (er.code) {
  95426. case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
  95427. case 'ENOTDIR': // totally normal. means it *does* exist.
  95428. var abs = this._makeAbs(f)
  95429. this.cache[abs] = 'FILE'
  95430. if (abs === this.cwdAbs) {
  95431. var error = new Error(er.code + ' invalid cwd ' + this.cwd)
  95432. error.path = this.cwd
  95433. error.code = er.code
  95434. throw error
  95435. }
  95436. break
  95437. case 'ENOENT': // not terribly unusual
  95438. case 'ELOOP':
  95439. case 'ENAMETOOLONG':
  95440. case 'UNKNOWN':
  95441. this.cache[this._makeAbs(f)] = false
  95442. break
  95443. default: // some unusual error. Treat as failure.
  95444. this.cache[this._makeAbs(f)] = false
  95445. if (this.strict)
  95446. throw er
  95447. if (!this.silent)
  95448. console.error('glob error', er)
  95449. break
  95450. }
  95451. }
  95452. GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
  95453. var entries = this._readdir(abs, inGlobStar)
  95454. // no entries means not a dir, so it can never have matches
  95455. // foo.txt/** doesn't match foo.txt
  95456. if (!entries)
  95457. return
  95458. // test without the globstar, and with every child both below
  95459. // and replacing the globstar.
  95460. var remainWithoutGlobStar = remain.slice(1)
  95461. var gspref = prefix ? [ prefix ] : []
  95462. var noGlobStar = gspref.concat(remainWithoutGlobStar)
  95463. // the noGlobStar pattern exits the inGlobStar state
  95464. this._process(noGlobStar, index, false)
  95465. var len = entries.length
  95466. var isSym = this.symlinks[abs]
  95467. // If it's a symlink, and we're in a globstar, then stop
  95468. if (isSym && inGlobStar)
  95469. return
  95470. for (var i = 0; i < len; i++) {
  95471. var e = entries[i]
  95472. if (e.charAt(0) === '.' && !this.dot)
  95473. continue
  95474. // these two cases enter the inGlobStar state
  95475. var instead = gspref.concat(entries[i], remainWithoutGlobStar)
  95476. this._process(instead, index, true)
  95477. var below = gspref.concat(entries[i], remain)
  95478. this._process(below, index, true)
  95479. }
  95480. }
  95481. GlobSync.prototype._processSimple = function (prefix, index) {
  95482. // XXX review this. Shouldn't it be doing the mounting etc
  95483. // before doing stat? kinda weird?
  95484. var exists = this._stat(prefix)
  95485. if (!this.matches[index])
  95486. this.matches[index] = Object.create(null)
  95487. // If it doesn't exist, then just mark the lack of results
  95488. if (!exists)
  95489. return
  95490. if (prefix && isAbsolute(prefix) && !this.nomount) {
  95491. var trail = /[\/\\]$/.test(prefix)
  95492. if (prefix.charAt(0) === '/') {
  95493. prefix = path.join(this.root, prefix)
  95494. } else {
  95495. prefix = path.resolve(this.root, prefix)
  95496. if (trail)
  95497. prefix += '/'
  95498. }
  95499. }
  95500. if (process.platform === 'win32')
  95501. prefix = prefix.replace(/\\/g, '/')
  95502. // Mark this as a match
  95503. this._emitMatch(index, prefix)
  95504. }
  95505. // Returns either 'DIR', 'FILE', or false
  95506. GlobSync.prototype._stat = function (f) {
  95507. var abs = this._makeAbs(f)
  95508. var needDir = f.slice(-1) === '/'
  95509. if (f.length > this.maxLength)
  95510. return false
  95511. if (!this.stat && ownProp(this.cache, abs)) {
  95512. var c = this.cache[abs]
  95513. if (Array.isArray(c))
  95514. c = 'DIR'
  95515. // It exists, but maybe not how we need it
  95516. if (!needDir || c === 'DIR')
  95517. return c
  95518. if (needDir && c === 'FILE')
  95519. return false
  95520. // otherwise we have to stat, because maybe c=true
  95521. // if we know it exists, but not what it is.
  95522. }
  95523. var exists
  95524. var stat = this.statCache[abs]
  95525. if (!stat) {
  95526. var lstat
  95527. try {
  95528. lstat = fs.lstatSync(abs)
  95529. } catch (er) {
  95530. if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
  95531. this.statCache[abs] = false
  95532. return false
  95533. }
  95534. }
  95535. if (lstat && lstat.isSymbolicLink()) {
  95536. try {
  95537. stat = fs.statSync(abs)
  95538. } catch (er) {
  95539. stat = lstat
  95540. }
  95541. } else {
  95542. stat = lstat
  95543. }
  95544. }
  95545. this.statCache[abs] = stat
  95546. var c = true
  95547. if (stat)
  95548. c = stat.isDirectory() ? 'DIR' : 'FILE'
  95549. this.cache[abs] = this.cache[abs] || c
  95550. if (needDir && c === 'FILE')
  95551. return false
  95552. return c
  95553. }
  95554. GlobSync.prototype._mark = function (p) {
  95555. return common.mark(this, p)
  95556. }
  95557. GlobSync.prototype._makeAbs = function (f) {
  95558. return common.makeAbs(this, f)
  95559. }
  95560. /***/ }),
  95561. /* 680 */
  95562. /***/ (function(module, exports, __webpack_require__) {
  95563. var Stream = __webpack_require__(36).Stream
  95564. module.exports = legacy
  95565. function legacy (fs) {
  95566. return {
  95567. ReadStream: ReadStream,
  95568. WriteStream: WriteStream
  95569. }
  95570. function ReadStream (path, options) {
  95571. if (!(this instanceof ReadStream)) return new ReadStream(path, options);
  95572. Stream.call(this);
  95573. var self = this;
  95574. this.path = path;
  95575. this.fd = null;
  95576. this.readable = true;
  95577. this.paused = false;
  95578. this.flags = 'r';
  95579. this.mode = 438; /*=0666*/
  95580. this.bufferSize = 64 * 1024;
  95581. options = options || {};
  95582. // Mixin options into this
  95583. var keys = Object.keys(options);
  95584. for (var index = 0, length = keys.length; index < length; index++) {
  95585. var key = keys[index];
  95586. this[key] = options[key];
  95587. }
  95588. if (this.encoding) this.setEncoding(this.encoding);
  95589. if (this.start !== undefined) {
  95590. if ('number' !== typeof this.start) {
  95591. throw TypeError('start must be a Number');
  95592. }
  95593. if (this.end === undefined) {
  95594. this.end = Infinity;
  95595. } else if ('number' !== typeof this.end) {
  95596. throw TypeError('end must be a Number');
  95597. }
  95598. if (this.start > this.end) {
  95599. throw new Error('start must be <= end');
  95600. }
  95601. this.pos = this.start;
  95602. }
  95603. if (this.fd !== null) {
  95604. process.nextTick(function() {
  95605. self._read();
  95606. });
  95607. return;
  95608. }
  95609. fs.open(this.path, this.flags, this.mode, function (err, fd) {
  95610. if (err) {
  95611. self.emit('error', err);
  95612. self.readable = false;
  95613. return;
  95614. }
  95615. self.fd = fd;
  95616. self.emit('open', fd);
  95617. self._read();
  95618. })
  95619. }
  95620. function WriteStream (path, options) {
  95621. if (!(this instanceof WriteStream)) return new WriteStream(path, options);
  95622. Stream.call(this);
  95623. this.path = path;
  95624. this.fd = null;
  95625. this.writable = true;
  95626. this.flags = 'w';
  95627. this.encoding = 'binary';
  95628. this.mode = 438; /*=0666*/
  95629. this.bytesWritten = 0;
  95630. options = options || {};
  95631. // Mixin options into this
  95632. var keys = Object.keys(options);
  95633. for (var index = 0, length = keys.length; index < length; index++) {
  95634. var key = keys[index];
  95635. this[key] = options[key];
  95636. }
  95637. if (this.start !== undefined) {
  95638. if ('number' !== typeof this.start) {
  95639. throw TypeError('start must be a Number');
  95640. }
  95641. if (this.start < 0) {
  95642. throw new Error('start must be >= zero');
  95643. }
  95644. this.pos = this.start;
  95645. }
  95646. this.busy = false;
  95647. this._queue = [];
  95648. if (this.fd === null) {
  95649. this._open = fs.open;
  95650. this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
  95651. this.flush();
  95652. }
  95653. }
  95654. }
  95655. /***/ }),
  95656. /* 681 */
  95657. /***/ (function(module, exports, __webpack_require__) {
  95658. var fs = __webpack_require__(355)
  95659. var constants = __webpack_require__(439)
  95660. var origCwd = process.cwd
  95661. var cwd = null
  95662. var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform
  95663. process.cwd = function() {
  95664. if (!cwd)
  95665. cwd = origCwd.call(process)
  95666. return cwd
  95667. }
  95668. try {
  95669. process.cwd()
  95670. } catch (er) {}
  95671. var chdir = process.chdir
  95672. process.chdir = function(d) {
  95673. cwd = null
  95674. chdir.call(process, d)
  95675. }
  95676. module.exports = patch
  95677. function patch (fs) {
  95678. // (re-)implement some things that are known busted or missing.
  95679. // lchmod, broken prior to 0.6.2
  95680. // back-port the fix here.
  95681. if (constants.hasOwnProperty('O_SYMLINK') &&
  95682. process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
  95683. patchLchmod(fs)
  95684. }
  95685. // lutimes implementation, or no-op
  95686. if (!fs.lutimes) {
  95687. patchLutimes(fs)
  95688. }
  95689. // https://github.com/isaacs/node-graceful-fs/issues/4
  95690. // Chown should not fail on einval or eperm if non-root.
  95691. // It should not fail on enosys ever, as this just indicates
  95692. // that a fs doesn't support the intended operation.
  95693. fs.chown = chownFix(fs.chown)
  95694. fs.fchown = chownFix(fs.fchown)
  95695. fs.lchown = chownFix(fs.lchown)
  95696. fs.chmod = chmodFix(fs.chmod)
  95697. fs.fchmod = chmodFix(fs.fchmod)
  95698. fs.lchmod = chmodFix(fs.lchmod)
  95699. fs.chownSync = chownFixSync(fs.chownSync)
  95700. fs.fchownSync = chownFixSync(fs.fchownSync)
  95701. fs.lchownSync = chownFixSync(fs.lchownSync)
  95702. fs.chmodSync = chmodFixSync(fs.chmodSync)
  95703. fs.fchmodSync = chmodFixSync(fs.fchmodSync)
  95704. fs.lchmodSync = chmodFixSync(fs.lchmodSync)
  95705. fs.stat = statFix(fs.stat)
  95706. fs.fstat = statFix(fs.fstat)
  95707. fs.lstat = statFix(fs.lstat)
  95708. fs.statSync = statFixSync(fs.statSync)
  95709. fs.fstatSync = statFixSync(fs.fstatSync)
  95710. fs.lstatSync = statFixSync(fs.lstatSync)
  95711. // if lchmod/lchown do not exist, then make them no-ops
  95712. if (!fs.lchmod) {
  95713. fs.lchmod = function (path, mode, cb) {
  95714. if (cb) process.nextTick(cb)
  95715. }
  95716. fs.lchmodSync = function () {}
  95717. }
  95718. if (!fs.lchown) {
  95719. fs.lchown = function (path, uid, gid, cb) {
  95720. if (cb) process.nextTick(cb)
  95721. }
  95722. fs.lchownSync = function () {}
  95723. }
  95724. // on Windows, A/V software can lock the directory, causing this
  95725. // to fail with an EACCES or EPERM if the directory contains newly
  95726. // created files. Try again on failure, for up to 60 seconds.
  95727. // Set the timeout this long because some Windows Anti-Virus, such as Parity
  95728. // bit9, may lock files for up to a minute, causing npm package install
  95729. // failures. Also, take care to yield the scheduler. Windows scheduling gives
  95730. // CPU to a busy looping process, which can cause the program causing the lock
  95731. // contention to be starved of CPU by node, so the contention doesn't resolve.
  95732. if (platform === "win32") {
  95733. fs.rename = (function (fs$rename) { return function (from, to, cb) {
  95734. var start = Date.now()
  95735. var backoff = 0;
  95736. fs$rename(from, to, function CB (er) {
  95737. if (er
  95738. && (er.code === "EACCES" || er.code === "EPERM")
  95739. && Date.now() - start < 60000) {
  95740. setTimeout(function() {
  95741. fs.stat(to, function (stater, st) {
  95742. if (stater && stater.code === "ENOENT")
  95743. fs$rename(from, to, CB);
  95744. else
  95745. cb(er)
  95746. })
  95747. }, backoff)
  95748. if (backoff < 100)
  95749. backoff += 10;
  95750. return;
  95751. }
  95752. if (cb) cb(er)
  95753. })
  95754. }})(fs.rename)
  95755. }
  95756. // if read() returns EAGAIN, then just try it again.
  95757. fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) {
  95758. var callback
  95759. if (callback_ && typeof callback_ === 'function') {
  95760. var eagCounter = 0
  95761. callback = function (er, _, __) {
  95762. if (er && er.code === 'EAGAIN' && eagCounter < 10) {
  95763. eagCounter ++
  95764. return fs$read.call(fs, fd, buffer, offset, length, position, callback)
  95765. }
  95766. callback_.apply(this, arguments)
  95767. }
  95768. }
  95769. return fs$read.call(fs, fd, buffer, offset, length, position, callback)
  95770. }})(fs.read)
  95771. fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
  95772. var eagCounter = 0
  95773. while (true) {
  95774. try {
  95775. return fs$readSync.call(fs, fd, buffer, offset, length, position)
  95776. } catch (er) {
  95777. if (er.code === 'EAGAIN' && eagCounter < 10) {
  95778. eagCounter ++
  95779. continue
  95780. }
  95781. throw er
  95782. }
  95783. }
  95784. }})(fs.readSync)
  95785. }
  95786. function patchLchmod (fs) {
  95787. fs.lchmod = function (path, mode, callback) {
  95788. fs.open( path
  95789. , constants.O_WRONLY | constants.O_SYMLINK
  95790. , mode
  95791. , function (err, fd) {
  95792. if (err) {
  95793. if (callback) callback(err)
  95794. return
  95795. }
  95796. // prefer to return the chmod error, if one occurs,
  95797. // but still try to close, and report closing errors if they occur.
  95798. fs.fchmod(fd, mode, function (err) {
  95799. fs.close(fd, function(err2) {
  95800. if (callback) callback(err || err2)
  95801. })
  95802. })
  95803. })
  95804. }
  95805. fs.lchmodSync = function (path, mode) {
  95806. var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
  95807. // prefer to return the chmod error, if one occurs,
  95808. // but still try to close, and report closing errors if they occur.
  95809. var threw = true
  95810. var ret
  95811. try {
  95812. ret = fs.fchmodSync(fd, mode)
  95813. threw = false
  95814. } finally {
  95815. if (threw) {
  95816. try {
  95817. fs.closeSync(fd)
  95818. } catch (er) {}
  95819. } else {
  95820. fs.closeSync(fd)
  95821. }
  95822. }
  95823. return ret
  95824. }
  95825. }
  95826. function patchLutimes (fs) {
  95827. if (constants.hasOwnProperty("O_SYMLINK")) {
  95828. fs.lutimes = function (path, at, mt, cb) {
  95829. fs.open(path, constants.O_SYMLINK, function (er, fd) {
  95830. if (er) {
  95831. if (cb) cb(er)
  95832. return
  95833. }
  95834. fs.futimes(fd, at, mt, function (er) {
  95835. fs.close(fd, function (er2) {
  95836. if (cb) cb(er || er2)
  95837. })
  95838. })
  95839. })
  95840. }
  95841. fs.lutimesSync = function (path, at, mt) {
  95842. var fd = fs.openSync(path, constants.O_SYMLINK)
  95843. var ret
  95844. var threw = true
  95845. try {
  95846. ret = fs.futimesSync(fd, at, mt)
  95847. threw = false
  95848. } finally {
  95849. if (threw) {
  95850. try {
  95851. fs.closeSync(fd)
  95852. } catch (er) {}
  95853. } else {
  95854. fs.closeSync(fd)
  95855. }
  95856. }
  95857. return ret
  95858. }
  95859. } else {
  95860. fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
  95861. fs.lutimesSync = function () {}
  95862. }
  95863. }
  95864. function chmodFix (orig) {
  95865. if (!orig) return orig
  95866. return function (target, mode, cb) {
  95867. return orig.call(fs, target, mode, function (er) {
  95868. if (chownErOk(er)) er = null
  95869. if (cb) cb.apply(this, arguments)
  95870. })
  95871. }
  95872. }
  95873. function chmodFixSync (orig) {
  95874. if (!orig) return orig
  95875. return function (target, mode) {
  95876. try {
  95877. return orig.call(fs, target, mode)
  95878. } catch (er) {
  95879. if (!chownErOk(er)) throw er
  95880. }
  95881. }
  95882. }
  95883. function chownFix (orig) {
  95884. if (!orig) return orig
  95885. return function (target, uid, gid, cb) {
  95886. return orig.call(fs, target, uid, gid, function (er) {
  95887. if (chownErOk(er)) er = null
  95888. if (cb) cb.apply(this, arguments)
  95889. })
  95890. }
  95891. }
  95892. function chownFixSync (orig) {
  95893. if (!orig) return orig
  95894. return function (target, uid, gid) {
  95895. try {
  95896. return orig.call(fs, target, uid, gid)
  95897. } catch (er) {
  95898. if (!chownErOk(er)) throw er
  95899. }
  95900. }
  95901. }
  95902. function statFix (orig) {
  95903. if (!orig) return orig
  95904. // Older versions of Node erroneously returned signed integers for
  95905. // uid + gid.
  95906. return function (target, cb) {
  95907. return orig.call(fs, target, function (er, stats) {
  95908. if (!stats) return cb.apply(this, arguments)
  95909. if (stats.uid < 0) stats.uid += 0x100000000
  95910. if (stats.gid < 0) stats.gid += 0x100000000
  95911. if (cb) cb.apply(this, arguments)
  95912. })
  95913. }
  95914. }
  95915. function statFixSync (orig) {
  95916. if (!orig) return orig
  95917. // Older versions of Node erroneously returned signed integers for
  95918. // uid + gid.
  95919. return function (target) {
  95920. var stats = orig.call(fs, target)
  95921. if (stats.uid < 0) stats.uid += 0x100000000
  95922. if (stats.gid < 0) stats.gid += 0x100000000
  95923. return stats;
  95924. }
  95925. }
  95926. // ENOSYS means that the fs doesn't support the op. Just ignore
  95927. // that, because it doesn't matter.
  95928. //
  95929. // if there's no getuid, or if getuid() is something other
  95930. // than 0, and the error is EINVAL or EPERM, then just ignore
  95931. // it.
  95932. //
  95933. // This specific case is a silent failure in cp, install, tar,
  95934. // and most other unix tools that manage permissions.
  95935. //
  95936. // When running as root, or if other types of errors are
  95937. // encountered, then it's strict.
  95938. function chownErOk (er) {
  95939. if (!er)
  95940. return true
  95941. if (er.code === "ENOSYS")
  95942. return true
  95943. var nonroot = !process.getuid || process.getuid() !== 0
  95944. if (nonroot) {
  95945. if (er.code === "EINVAL" || er.code === "EPERM")
  95946. return true
  95947. }
  95948. return false
  95949. }
  95950. /***/ }),
  95951. /* 682 */
  95952. /***/ (function(module, exports, __webpack_require__) {
  95953. var zlib = __webpack_require__(188)
  95954. var peek = __webpack_require__(847)
  95955. var through = __webpack_require__(432)
  95956. var pumpify = __webpack_require__(854)
  95957. var isGzip = __webpack_require__(786)
  95958. var isDeflate = __webpack_require__(781)
  95959. var isCompressed = function (data) {
  95960. if (isGzip(data)) return 1
  95961. if (isDeflate(data)) return 2
  95962. return 0
  95963. }
  95964. var gunzip = function (maxRecursion) {
  95965. if (!(maxRecursion >= 0)) maxRecursion = 3
  95966. return peek({newline: false, maxBuffer: 10}, function (data, swap) {
  95967. if (maxRecursion < 0) return swap(new Error('Maximum recursion reached'))
  95968. switch (isCompressed(data)) {
  95969. case 1:
  95970. swap(null, pumpify(zlib.createGunzip(), gunzip(maxRecursion - 1)))
  95971. break
  95972. case 2:
  95973. swap(null, pumpify(zlib.createInflate(), gunzip(maxRecursion - 1)))
  95974. break
  95975. default:
  95976. swap(null, through())
  95977. }
  95978. })
  95979. }
  95980. module.exports = gunzip
  95981. /***/ }),
  95982. /* 683 */
  95983. /***/ (function(module, exports) {
  95984. module.exports = {"$id":"afterRequest.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["lastAccess","eTag","hitCount"],"properties":{"expires":{"type":"string","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},"lastAccess":{"type":"string","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},"eTag":{"type":"string"},"hitCount":{"type":"integer"},"comment":{"type":"string"}}}
  95985. /***/ }),
  95986. /* 684 */
  95987. /***/ (function(module, exports) {
  95988. module.exports = {"$id":"beforeRequest.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["lastAccess","eTag","hitCount"],"properties":{"expires":{"type":"string","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},"lastAccess":{"type":"string","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},"eTag":{"type":"string"},"hitCount":{"type":"integer"},"comment":{"type":"string"}}}
  95989. /***/ }),
  95990. /* 685 */
  95991. /***/ (function(module, exports) {
  95992. module.exports = {"$id":"browser.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","version"],"properties":{"name":{"type":"string"},"version":{"type":"string"},"comment":{"type":"string"}}}
  95993. /***/ }),
  95994. /* 686 */
  95995. /***/ (function(module, exports) {
  95996. module.exports = {"$id":"cache.json#","$schema":"http://json-schema.org/draft-06/schema#","properties":{"beforeRequest":{"oneOf":[{"type":"null"},{"$ref":"beforeRequest.json#"}]},"afterRequest":{"oneOf":[{"type":"null"},{"$ref":"afterRequest.json#"}]},"comment":{"type":"string"}}}
  95997. /***/ }),
  95998. /* 687 */
  95999. /***/ (function(module, exports) {
  96000. module.exports = {"$id":"content.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["size","mimeType"],"properties":{"size":{"type":"integer"},"compression":{"type":"integer"},"mimeType":{"type":"string"},"text":{"type":"string"},"encoding":{"type":"string"},"comment":{"type":"string"}}}
  96001. /***/ }),
  96002. /* 688 */
  96003. /***/ (function(module, exports) {
  96004. module.exports = {"$id":"cookie.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"path":{"type":"string"},"domain":{"type":"string"},"expires":{"type":["string","null"],"format":"date-time"},"httpOnly":{"type":"boolean"},"secure":{"type":"boolean"},"comment":{"type":"string"}}}
  96005. /***/ }),
  96006. /* 689 */
  96007. /***/ (function(module, exports) {
  96008. module.exports = {"$id":"creator.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","version"],"properties":{"name":{"type":"string"},"version":{"type":"string"},"comment":{"type":"string"}}}
  96009. /***/ }),
  96010. /* 690 */
  96011. /***/ (function(module, exports) {
  96012. module.exports = {"$id":"entry.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["startedDateTime","time","request","response","cache","timings"],"properties":{"pageref":{"type":"string"},"startedDateTime":{"type":"string","format":"date-time","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"},"time":{"type":"number","min":0},"request":{"$ref":"request.json#"},"response":{"$ref":"response.json#"},"cache":{"$ref":"cache.json#"},"timings":{"$ref":"timings.json#"},"serverIPAddress":{"type":"string","oneOf":[{"format":"ipv4"},{"format":"ipv6"}]},"connection":{"type":"string"},"comment":{"type":"string"}}}
  96013. /***/ }),
  96014. /* 691 */
  96015. /***/ (function(module, exports) {
  96016. module.exports = {"$id":"har.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["log"],"properties":{"log":{"$ref":"log.json#"}}}
  96017. /***/ }),
  96018. /* 692 */
  96019. /***/ (function(module, exports) {
  96020. module.exports = {"$id":"header.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"comment":{"type":"string"}}}
  96021. /***/ }),
  96022. /* 693 */
  96023. /***/ (function(module, exports, __webpack_require__) {
  96024. "use strict";
  96025. module.exports = {
  96026. afterRequest: __webpack_require__(683),
  96027. beforeRequest: __webpack_require__(684),
  96028. browser: __webpack_require__(685),
  96029. cache: __webpack_require__(686),
  96030. content: __webpack_require__(687),
  96031. cookie: __webpack_require__(688),
  96032. creator: __webpack_require__(689),
  96033. entry: __webpack_require__(690),
  96034. har: __webpack_require__(691),
  96035. header: __webpack_require__(692),
  96036. log: __webpack_require__(694),
  96037. page: __webpack_require__(695),
  96038. pageTimings: __webpack_require__(696),
  96039. postData: __webpack_require__(697),
  96040. query: __webpack_require__(698),
  96041. request: __webpack_require__(699),
  96042. response: __webpack_require__(700),
  96043. timings: __webpack_require__(701)
  96044. }
  96045. /***/ }),
  96046. /* 694 */
  96047. /***/ (function(module, exports) {
  96048. module.exports = {"$id":"log.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["version","creator","entries"],"properties":{"version":{"type":"string"},"creator":{"$ref":"creator.json#"},"browser":{"$ref":"browser.json#"},"pages":{"type":"array","items":{"$ref":"page.json#"}},"entries":{"type":"array","items":{"$ref":"entry.json#"}},"comment":{"type":"string"}}}
  96049. /***/ }),
  96050. /* 695 */
  96051. /***/ (function(module, exports) {
  96052. module.exports = {"$id":"page.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["startedDateTime","id","title","pageTimings"],"properties":{"startedDateTime":{"type":"string","format":"date-time","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"},"id":{"type":"string","unique":true},"title":{"type":"string"},"pageTimings":{"$ref":"pageTimings.json#"},"comment":{"type":"string"}}}
  96053. /***/ }),
  96054. /* 696 */
  96055. /***/ (function(module, exports) {
  96056. module.exports = {"$id":"pageTimings.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","properties":{"onContentLoad":{"type":"number","min":-1},"onLoad":{"type":"number","min":-1},"comment":{"type":"string"}}}
  96057. /***/ }),
  96058. /* 697 */
  96059. /***/ (function(module, exports) {
  96060. module.exports = {"$id":"postData.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["mimeType"],"properties":{"mimeType":{"type":"string"},"text":{"type":"string"},"params":{"type":"array","required":["name"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"fileName":{"type":"string"},"contentType":{"type":"string"},"comment":{"type":"string"}}},"comment":{"type":"string"}}}
  96061. /***/ }),
  96062. /* 698 */
  96063. /***/ (function(module, exports) {
  96064. module.exports = {"$id":"query.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"comment":{"type":"string"}}}
  96065. /***/ }),
  96066. /* 699 */
  96067. /***/ (function(module, exports) {
  96068. module.exports = {"$id":"request.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["method","url","httpVersion","cookies","headers","queryString","headersSize","bodySize"],"properties":{"method":{"type":"string"},"url":{"type":"string","format":"uri"},"httpVersion":{"type":"string"},"cookies":{"type":"array","items":{"$ref":"cookie.json#"}},"headers":{"type":"array","items":{"$ref":"header.json#"}},"queryString":{"type":"array","items":{"$ref":"query.json#"}},"postData":{"$ref":"postData.json#"},"headersSize":{"type":"integer"},"bodySize":{"type":"integer"},"comment":{"type":"string"}}}
  96069. /***/ }),
  96070. /* 700 */
  96071. /***/ (function(module, exports) {
  96072. module.exports = {"$id":"response.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["status","statusText","httpVersion","cookies","headers","content","redirectURL","headersSize","bodySize"],"properties":{"status":{"type":"integer"},"statusText":{"type":"string"},"httpVersion":{"type":"string"},"cookies":{"type":"array","items":{"$ref":"cookie.json#"}},"headers":{"type":"array","items":{"$ref":"header.json#"}},"content":{"$ref":"content.json#"},"redirectURL":{"type":"string"},"headersSize":{"type":"integer"},"bodySize":{"type":"integer"},"comment":{"type":"string"}}}
  96073. /***/ }),
  96074. /* 701 */
  96075. /***/ (function(module, exports) {
  96076. module.exports = {"$id":"timings.json#","$schema":"http://json-schema.org/draft-06/schema#","required":["send","wait","receive"],"properties":{"dns":{"type":"number","min":-1},"connect":{"type":"number","min":-1},"blocked":{"type":"number","min":-1},"send":{"type":"number","min":-1},"wait":{"type":"number","min":-1},"receive":{"type":"number","min":-1},"ssl":{"type":"number","min":-1},"comment":{"type":"string"}}}
  96077. /***/ }),
  96078. /* 702 */
  96079. /***/ (function(module, exports) {
  96080. function HARError (errors) {
  96081. var message = 'validation failed'
  96082. this.name = 'HARError'
  96083. this.message = message
  96084. this.errors = errors
  96085. if (typeof Error.captureStackTrace === 'function') {
  96086. Error.captureStackTrace(this, this.constructor)
  96087. } else {
  96088. this.stack = (new Error(message)).stack
  96089. }
  96090. }
  96091. HARError.prototype = Error.prototype
  96092. module.exports = HARError
  96093. /***/ }),
  96094. /* 703 */
  96095. /***/ (function(module, exports, __webpack_require__) {
  96096. var Ajv = __webpack_require__(705)
  96097. var HARError = __webpack_require__(702)
  96098. var schemas = __webpack_require__(693)
  96099. var ajv
  96100. function validate (name, data) {
  96101. data = data || {}
  96102. // validator config
  96103. ajv = ajv || new Ajv({
  96104. allErrors: true,
  96105. schemas: schemas
  96106. })
  96107. var validate = ajv.getSchema(name + '.json')
  96108. return new Promise(function (resolve, reject) {
  96109. var valid = validate(data)
  96110. !valid ? reject(new HARError(validate.errors)) : resolve(data)
  96111. })
  96112. }
  96113. exports.afterRequest = function (data) {
  96114. return validate('afterRequest', data)
  96115. }
  96116. exports.beforeRequest = function (data) {
  96117. return validate('beforeRequest', data)
  96118. }
  96119. exports.browser = function (data) {
  96120. return validate('browser', data)
  96121. }
  96122. exports.cache = function (data) {
  96123. return validate('cache', data)
  96124. }
  96125. exports.content = function (data) {
  96126. return validate('content', data)
  96127. }
  96128. exports.cookie = function (data) {
  96129. return validate('cookie', data)
  96130. }
  96131. exports.creator = function (data) {
  96132. return validate('creator', data)
  96133. }
  96134. exports.entry = function (data) {
  96135. return validate('entry', data)
  96136. }
  96137. exports.har = function (data) {
  96138. return validate('har', data)
  96139. }
  96140. exports.header = function (data) {
  96141. return validate('header', data)
  96142. }
  96143. exports.log = function (data) {
  96144. return validate('log', data)
  96145. }
  96146. exports.page = function (data) {
  96147. return validate('page', data)
  96148. }
  96149. exports.pageTimings = function (data) {
  96150. return validate('pageTimings', data)
  96151. }
  96152. exports.postData = function (data) {
  96153. return validate('postData', data)
  96154. }
  96155. exports.query = function (data) {
  96156. return validate('query', data)
  96157. }
  96158. exports.request = function (data) {
  96159. return validate('request', data)
  96160. }
  96161. exports.response = function (data) {
  96162. return validate('response', data)
  96163. }
  96164. exports.timings = function (data) {
  96165. return validate('timings', data)
  96166. }
  96167. /***/ }),
  96168. /* 704 */
  96169. /***/ (function(module, exports, __webpack_require__) {
  96170. "use strict";
  96171. var KEYWORDS = [
  96172. 'multipleOf',
  96173. 'maximum',
  96174. 'exclusiveMaximum',
  96175. 'minimum',
  96176. 'exclusiveMinimum',
  96177. 'maxLength',
  96178. 'minLength',
  96179. 'pattern',
  96180. 'additionalItems',
  96181. 'maxItems',
  96182. 'minItems',
  96183. 'uniqueItems',
  96184. 'maxProperties',
  96185. 'minProperties',
  96186. 'required',
  96187. 'additionalProperties',
  96188. 'enum',
  96189. 'format',
  96190. 'const'
  96191. ];
  96192. module.exports = function (metaSchema, keywordsJsonPointers) {
  96193. for (var i=0; i<keywordsJsonPointers.length; i++) {
  96194. metaSchema = JSON.parse(JSON.stringify(metaSchema));
  96195. var segments = keywordsJsonPointers[i].split('/');
  96196. var keywords = metaSchema;
  96197. var j;
  96198. for (j=1; j<segments.length; j++)
  96199. keywords = keywords[segments[j]];
  96200. for (j=0; j<KEYWORDS.length; j++) {
  96201. var key = KEYWORDS[j];
  96202. var schema = keywords[key];
  96203. if (schema) {
  96204. keywords[key] = {
  96205. anyOf: [
  96206. schema,
  96207. { $ref: 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#' }
  96208. ]
  96209. };
  96210. }
  96211. }
  96212. }
  96213. return metaSchema;
  96214. };
  96215. /***/ }),
  96216. /* 705 */
  96217. /***/ (function(module, exports, __webpack_require__) {
  96218. "use strict";
  96219. var compileSchema = __webpack_require__(710)
  96220. , resolve = __webpack_require__(236)
  96221. , Cache = __webpack_require__(706)
  96222. , SchemaObject = __webpack_require__(357)
  96223. , stableStringify = __webpack_require__(352)
  96224. , formats = __webpack_require__(709)
  96225. , rules = __webpack_require__(711)
  96226. , $dataMetaSchema = __webpack_require__(704)
  96227. , patternGroups = __webpack_require__(732)
  96228. , util = __webpack_require__(106)
  96229. , co = __webpack_require__(321);
  96230. module.exports = Ajv;
  96231. Ajv.prototype.validate = validate;
  96232. Ajv.prototype.compile = compile;
  96233. Ajv.prototype.addSchema = addSchema;
  96234. Ajv.prototype.addMetaSchema = addMetaSchema;
  96235. Ajv.prototype.validateSchema = validateSchema;
  96236. Ajv.prototype.getSchema = getSchema;
  96237. Ajv.prototype.removeSchema = removeSchema;
  96238. Ajv.prototype.addFormat = addFormat;
  96239. Ajv.prototype.errorsText = errorsText;
  96240. Ajv.prototype._addSchema = _addSchema;
  96241. Ajv.prototype._compile = _compile;
  96242. Ajv.prototype.compileAsync = __webpack_require__(708);
  96243. var customKeyword = __webpack_require__(731);
  96244. Ajv.prototype.addKeyword = customKeyword.add;
  96245. Ajv.prototype.getKeyword = customKeyword.get;
  96246. Ajv.prototype.removeKeyword = customKeyword.remove;
  96247. var errorClasses = __webpack_require__(235);
  96248. Ajv.ValidationError = errorClasses.Validation;
  96249. Ajv.MissingRefError = errorClasses.MissingRef;
  96250. Ajv.$dataMetaSchema = $dataMetaSchema;
  96251. var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema';
  96252. var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ];
  96253. var META_SUPPORT_DATA = ['/properties'];
  96254. /**
  96255. * Creates validator instance.
  96256. * Usage: `Ajv(opts)`
  96257. * @param {Object} opts optional options
  96258. * @return {Object} ajv instance
  96259. */
  96260. function Ajv(opts) {
  96261. if (!(this instanceof Ajv)) return new Ajv(opts);
  96262. opts = this._opts = util.copy(opts) || {};
  96263. setLogger(this);
  96264. this._schemas = {};
  96265. this._refs = {};
  96266. this._fragments = {};
  96267. this._formats = formats(opts.format);
  96268. var schemaUriFormat = this._schemaUriFormat = this._formats['uri-reference'];
  96269. this._schemaUriFormatFunc = function (str) { return schemaUriFormat.test(str); };
  96270. this._cache = opts.cache || new Cache;
  96271. this._loadingSchemas = {};
  96272. this._compilations = [];
  96273. this.RULES = rules();
  96274. this._getId = chooseGetId(opts);
  96275. opts.loopRequired = opts.loopRequired || Infinity;
  96276. if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;
  96277. if (opts.serialize === undefined) opts.serialize = stableStringify;
  96278. this._metaOpts = getMetaSchemaOptions(this);
  96279. if (opts.formats) addInitialFormats(this);
  96280. addDraft6MetaSchema(this);
  96281. if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);
  96282. addInitialSchemas(this);
  96283. if (opts.patternGroups) patternGroups(this);
  96284. }
  96285. /**
  96286. * Validate data using schema
  96287. * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize.
  96288. * @this Ajv
  96289. * @param {String|Object} schemaKeyRef key, ref or schema object
  96290. * @param {Any} data to be validated
  96291. * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
  96292. */
  96293. function validate(schemaKeyRef, data) {
  96294. var v;
  96295. if (typeof schemaKeyRef == 'string') {
  96296. v = this.getSchema(schemaKeyRef);
  96297. if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"');
  96298. } else {
  96299. var schemaObj = this._addSchema(schemaKeyRef);
  96300. v = schemaObj.validate || this._compile(schemaObj);
  96301. }
  96302. var valid = v(data);
  96303. if (v.$async === true)
  96304. return this._opts.async == '*' ? co(valid) : valid;
  96305. this.errors = v.errors;
  96306. return valid;
  96307. }
  96308. /**
  96309. * Create validating function for passed schema.
  96310. * @this Ajv
  96311. * @param {Object} schema schema object
  96312. * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.
  96313. * @return {Function} validating function
  96314. */
  96315. function compile(schema, _meta) {
  96316. var schemaObj = this._addSchema(schema, undefined, _meta);
  96317. return schemaObj.validate || this._compile(schemaObj);
  96318. }
  96319. /**
  96320. * Adds schema to the instance.
  96321. * @this Ajv
  96322. * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.
  96323. * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
  96324. * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead.
  96325. * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
  96326. * @return {Ajv} this for method chaining
  96327. */
  96328. function addSchema(schema, key, _skipValidation, _meta) {
  96329. if (Array.isArray(schema)){
  96330. for (var i=0; i<schema.length; i++) this.addSchema(schema[i], undefined, _skipValidation, _meta);
  96331. return this;
  96332. }
  96333. var id = this._getId(schema);
  96334. if (id !== undefined && typeof id != 'string')
  96335. throw new Error('schema id must be string');
  96336. key = resolve.normalizeId(key || id);
  96337. checkUnique(this, key);
  96338. this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);
  96339. return this;
  96340. }
  96341. /**
  96342. * Add schema that will be used to validate other schemas
  96343. * options in META_IGNORE_OPTIONS are alway set to false
  96344. * @this Ajv
  96345. * @param {Object} schema schema object
  96346. * @param {String} key optional schema key
  96347. * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema
  96348. * @return {Ajv} this for method chaining
  96349. */
  96350. function addMetaSchema(schema, key, skipValidation) {
  96351. this.addSchema(schema, key, skipValidation, true);
  96352. return this;
  96353. }
  96354. /**
  96355. * Validate schema
  96356. * @this Ajv
  96357. * @param {Object} schema schema to validate
  96358. * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid
  96359. * @return {Boolean} true if schema is valid
  96360. */
  96361. function validateSchema(schema, throwOrLogError) {
  96362. var $schema = schema.$schema;
  96363. if ($schema !== undefined && typeof $schema != 'string')
  96364. throw new Error('$schema must be a string');
  96365. $schema = $schema || this._opts.defaultMeta || defaultMeta(this);
  96366. if (!$schema) {
  96367. this.logger.warn('meta-schema not available');
  96368. this.errors = null;
  96369. return true;
  96370. }
  96371. var currentUriFormat = this._formats.uri;
  96372. this._formats.uri = typeof currentUriFormat == 'function'
  96373. ? this._schemaUriFormatFunc
  96374. : this._schemaUriFormat;
  96375. var valid;
  96376. try { valid = this.validate($schema, schema); }
  96377. finally { this._formats.uri = currentUriFormat; }
  96378. if (!valid && throwOrLogError) {
  96379. var message = 'schema is invalid: ' + this.errorsText();
  96380. if (this._opts.validateSchema == 'log') this.logger.error(message);
  96381. else throw new Error(message);
  96382. }
  96383. return valid;
  96384. }
  96385. function defaultMeta(self) {
  96386. var meta = self._opts.meta;
  96387. self._opts.defaultMeta = typeof meta == 'object'
  96388. ? self._getId(meta) || meta
  96389. : self.getSchema(META_SCHEMA_ID)
  96390. ? META_SCHEMA_ID
  96391. : undefined;
  96392. return self._opts.defaultMeta;
  96393. }
  96394. /**
  96395. * Get compiled schema from the instance by `key` or `ref`.
  96396. * @this Ajv
  96397. * @param {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).
  96398. * @return {Function} schema validating function (with property `schema`).
  96399. */
  96400. function getSchema(keyRef) {
  96401. var schemaObj = _getSchemaObj(this, keyRef);
  96402. switch (typeof schemaObj) {
  96403. case 'object': return schemaObj.validate || this._compile(schemaObj);
  96404. case 'string': return this.getSchema(schemaObj);
  96405. case 'undefined': return _getSchemaFragment(this, keyRef);
  96406. }
  96407. }
  96408. function _getSchemaFragment(self, ref) {
  96409. var res = resolve.schema.call(self, { schema: {} }, ref);
  96410. if (res) {
  96411. var schema = res.schema
  96412. , root = res.root
  96413. , baseId = res.baseId;
  96414. var v = compileSchema.call(self, schema, root, undefined, baseId);
  96415. self._fragments[ref] = new SchemaObject({
  96416. ref: ref,
  96417. fragment: true,
  96418. schema: schema,
  96419. root: root,
  96420. baseId: baseId,
  96421. validate: v
  96422. });
  96423. return v;
  96424. }
  96425. }
  96426. function _getSchemaObj(self, keyRef) {
  96427. keyRef = resolve.normalizeId(keyRef);
  96428. return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
  96429. }
  96430. /**
  96431. * Remove cached schema(s).
  96432. * If no parameter is passed all schemas but meta-schemas are removed.
  96433. * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
  96434. * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
  96435. * @this Ajv
  96436. * @param {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object
  96437. * @return {Ajv} this for method chaining
  96438. */
  96439. function removeSchema(schemaKeyRef) {
  96440. if (schemaKeyRef instanceof RegExp) {
  96441. _removeAllSchemas(this, this._schemas, schemaKeyRef);
  96442. _removeAllSchemas(this, this._refs, schemaKeyRef);
  96443. return this;
  96444. }
  96445. switch (typeof schemaKeyRef) {
  96446. case 'undefined':
  96447. _removeAllSchemas(this, this._schemas);
  96448. _removeAllSchemas(this, this._refs);
  96449. this._cache.clear();
  96450. return this;
  96451. case 'string':
  96452. var schemaObj = _getSchemaObj(this, schemaKeyRef);
  96453. if (schemaObj) this._cache.del(schemaObj.cacheKey);
  96454. delete this._schemas[schemaKeyRef];
  96455. delete this._refs[schemaKeyRef];
  96456. return this;
  96457. case 'object':
  96458. var serialize = this._opts.serialize;
  96459. var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef;
  96460. this._cache.del(cacheKey);
  96461. var id = this._getId(schemaKeyRef);
  96462. if (id) {
  96463. id = resolve.normalizeId(id);
  96464. delete this._schemas[id];
  96465. delete this._refs[id];
  96466. }
  96467. }
  96468. return this;
  96469. }
  96470. function _removeAllSchemas(self, schemas, regex) {
  96471. for (var keyRef in schemas) {
  96472. var schemaObj = schemas[keyRef];
  96473. if (!schemaObj.meta && (!regex || regex.test(keyRef))) {
  96474. self._cache.del(schemaObj.cacheKey);
  96475. delete schemas[keyRef];
  96476. }
  96477. }
  96478. }
  96479. /* @this Ajv */
  96480. function _addSchema(schema, skipValidation, meta, shouldAddSchema) {
  96481. if (typeof schema != 'object' && typeof schema != 'boolean')
  96482. throw new Error('schema should be object or boolean');
  96483. var serialize = this._opts.serialize;
  96484. var cacheKey = serialize ? serialize(schema) : schema;
  96485. var cached = this._cache.get(cacheKey);
  96486. if (cached) return cached;
  96487. shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;
  96488. var id = resolve.normalizeId(this._getId(schema));
  96489. if (id && shouldAddSchema) checkUnique(this, id);
  96490. var willValidate = this._opts.validateSchema !== false && !skipValidation;
  96491. var recursiveMeta;
  96492. if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema)))
  96493. this.validateSchema(schema, true);
  96494. var localRefs = resolve.ids.call(this, schema);
  96495. var schemaObj = new SchemaObject({
  96496. id: id,
  96497. schema: schema,
  96498. localRefs: localRefs,
  96499. cacheKey: cacheKey,
  96500. meta: meta
  96501. });
  96502. if (id[0] != '#' && shouldAddSchema) this._refs[id] = schemaObj;
  96503. this._cache.put(cacheKey, schemaObj);
  96504. if (willValidate && recursiveMeta) this.validateSchema(schema, true);
  96505. return schemaObj;
  96506. }
  96507. /* @this Ajv */
  96508. function _compile(schemaObj, root) {
  96509. if (schemaObj.compiling) {
  96510. schemaObj.validate = callValidate;
  96511. callValidate.schema = schemaObj.schema;
  96512. callValidate.errors = null;
  96513. callValidate.root = root ? root : callValidate;
  96514. if (schemaObj.schema.$async === true)
  96515. callValidate.$async = true;
  96516. return callValidate;
  96517. }
  96518. schemaObj.compiling = true;
  96519. var currentOpts;
  96520. if (schemaObj.meta) {
  96521. currentOpts = this._opts;
  96522. this._opts = this._metaOpts;
  96523. }
  96524. var v;
  96525. try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); }
  96526. finally {
  96527. schemaObj.compiling = false;
  96528. if (schemaObj.meta) this._opts = currentOpts;
  96529. }
  96530. schemaObj.validate = v;
  96531. schemaObj.refs = v.refs;
  96532. schemaObj.refVal = v.refVal;
  96533. schemaObj.root = v.root;
  96534. return v;
  96535. function callValidate() {
  96536. var _validate = schemaObj.validate;
  96537. var result = _validate.apply(null, arguments);
  96538. callValidate.errors = _validate.errors;
  96539. return result;
  96540. }
  96541. }
  96542. function chooseGetId(opts) {
  96543. switch (opts.schemaId) {
  96544. case '$id': return _get$Id;
  96545. case 'id': return _getId;
  96546. default: return _get$IdOrId;
  96547. }
  96548. }
  96549. /* @this Ajv */
  96550. function _getId(schema) {
  96551. if (schema.$id) this.logger.warn('schema $id ignored', schema.$id);
  96552. return schema.id;
  96553. }
  96554. /* @this Ajv */
  96555. function _get$Id(schema) {
  96556. if (schema.id) this.logger.warn('schema id ignored', schema.id);
  96557. return schema.$id;
  96558. }
  96559. function _get$IdOrId(schema) {
  96560. if (schema.$id && schema.id && schema.$id != schema.id)
  96561. throw new Error('schema $id is different from id');
  96562. return schema.$id || schema.id;
  96563. }
  96564. /**
  96565. * Convert array of error message objects to string
  96566. * @this Ajv
  96567. * @param {Array<Object>} errors optional array of validation errors, if not passed errors from the instance are used.
  96568. * @param {Object} options optional options with properties `separator` and `dataVar`.
  96569. * @return {String} human readable string with all errors descriptions
  96570. */
  96571. function errorsText(errors, options) {
  96572. errors = errors || this.errors;
  96573. if (!errors) return 'No errors';
  96574. options = options || {};
  96575. var separator = options.separator === undefined ? ', ' : options.separator;
  96576. var dataVar = options.dataVar === undefined ? 'data' : options.dataVar;
  96577. var text = '';
  96578. for (var i=0; i<errors.length; i++) {
  96579. var e = errors[i];
  96580. if (e) text += dataVar + e.dataPath + ' ' + e.message + separator;
  96581. }
  96582. return text.slice(0, -separator.length);
  96583. }
  96584. /**
  96585. * Add custom format
  96586. * @this Ajv
  96587. * @param {String} name format name
  96588. * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)
  96589. * @return {Ajv} this for method chaining
  96590. */
  96591. function addFormat(name, format) {
  96592. if (typeof format == 'string') format = new RegExp(format);
  96593. this._formats[name] = format;
  96594. return this;
  96595. }
  96596. function addDraft6MetaSchema(self) {
  96597. var $dataSchema;
  96598. if (self._opts.$data) {
  96599. $dataSchema = __webpack_require__(733);
  96600. self.addMetaSchema($dataSchema, $dataSchema.$id, true);
  96601. }
  96602. if (self._opts.meta === false) return;
  96603. var metaSchema = __webpack_require__(734);
  96604. if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA);
  96605. self.addMetaSchema(metaSchema, META_SCHEMA_ID, true);
  96606. self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID;
  96607. }
  96608. function addInitialSchemas(self) {
  96609. var optsSchemas = self._opts.schemas;
  96610. if (!optsSchemas) return;
  96611. if (Array.isArray(optsSchemas)) self.addSchema(optsSchemas);
  96612. else for (var key in optsSchemas) self.addSchema(optsSchemas[key], key);
  96613. }
  96614. function addInitialFormats(self) {
  96615. for (var name in self._opts.formats) {
  96616. var format = self._opts.formats[name];
  96617. self.addFormat(name, format);
  96618. }
  96619. }
  96620. function checkUnique(self, id) {
  96621. if (self._schemas[id] || self._refs[id])
  96622. throw new Error('schema with key or id "' + id + '" already exists');
  96623. }
  96624. function getMetaSchemaOptions(self) {
  96625. var metaOpts = util.copy(self._opts);
  96626. for (var i=0; i<META_IGNORE_OPTIONS.length; i++)
  96627. delete metaOpts[META_IGNORE_OPTIONS[i]];
  96628. return metaOpts;
  96629. }
  96630. function setLogger(self) {
  96631. var logger = self._opts.logger;
  96632. if (logger === false) {
  96633. self.logger = {log: noop, warn: noop, error: noop};
  96634. } else {
  96635. if (logger === undefined) logger = console;
  96636. if (!(typeof logger == 'object' && logger.log && logger.warn && logger.error))
  96637. throw new Error('logger must implement log, warn and error methods');
  96638. self.logger = logger;
  96639. }
  96640. }
  96641. function noop() {}
  96642. /***/ }),
  96643. /* 706 */
  96644. /***/ (function(module, exports, __webpack_require__) {
  96645. "use strict";
  96646. var Cache = module.exports = function Cache() {
  96647. this._cache = {};
  96648. };
  96649. Cache.prototype.put = function Cache_put(key, value) {
  96650. this._cache[key] = value;
  96651. };
  96652. Cache.prototype.get = function Cache_get(key) {
  96653. return this._cache[key];
  96654. };
  96655. Cache.prototype.del = function Cache_del(key) {
  96656. delete this._cache[key];
  96657. };
  96658. Cache.prototype.clear = function Cache_clear() {
  96659. this._cache = {};
  96660. };
  96661. /***/ }),
  96662. /* 707 */
  96663. /***/ (function(module, exports, __webpack_require__) {
  96664. "use strict";
  96665. //all requires must be explicit because browserify won't work with dynamic requires
  96666. module.exports = {
  96667. '$ref': __webpack_require__(728),
  96668. allOf: __webpack_require__(713),
  96669. anyOf: __webpack_require__(714),
  96670. const: __webpack_require__(715),
  96671. contains: __webpack_require__(716),
  96672. dependencies: __webpack_require__(718),
  96673. 'enum': __webpack_require__(719),
  96674. format: __webpack_require__(720),
  96675. items: __webpack_require__(721),
  96676. maximum: __webpack_require__(358),
  96677. minimum: __webpack_require__(358),
  96678. maxItems: __webpack_require__(359),
  96679. minItems: __webpack_require__(359),
  96680. maxLength: __webpack_require__(360),
  96681. minLength: __webpack_require__(360),
  96682. maxProperties: __webpack_require__(361),
  96683. minProperties: __webpack_require__(361),
  96684. multipleOf: __webpack_require__(722),
  96685. not: __webpack_require__(723),
  96686. oneOf: __webpack_require__(724),
  96687. pattern: __webpack_require__(725),
  96688. properties: __webpack_require__(726),
  96689. propertyNames: __webpack_require__(727),
  96690. required: __webpack_require__(729),
  96691. uniqueItems: __webpack_require__(730),
  96692. validate: __webpack_require__(362)
  96693. };
  96694. /***/ }),
  96695. /* 708 */
  96696. /***/ (function(module, exports, __webpack_require__) {
  96697. "use strict";
  96698. var MissingRefError = __webpack_require__(235).MissingRef;
  96699. module.exports = compileAsync;
  96700. /**
  96701. * Creates validating function for passed schema with asynchronous loading of missing schemas.
  96702. * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.
  96703. * @this Ajv
  96704. * @param {Object} schema schema object
  96705. * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped
  96706. * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function.
  96707. * @return {Promise} promise that resolves with a validating function.
  96708. */
  96709. function compileAsync(schema, meta, callback) {
  96710. /* eslint no-shadow: 0 */
  96711. /* global Promise */
  96712. /* jshint validthis: true */
  96713. var self = this;
  96714. if (typeof this._opts.loadSchema != 'function')
  96715. throw new Error('options.loadSchema should be a function');
  96716. if (typeof meta == 'function') {
  96717. callback = meta;
  96718. meta = undefined;
  96719. }
  96720. var p = loadMetaSchemaOf(schema).then(function () {
  96721. var schemaObj = self._addSchema(schema, undefined, meta);
  96722. return schemaObj.validate || _compileAsync(schemaObj);
  96723. });
  96724. if (callback) {
  96725. p.then(
  96726. function(v) { callback(null, v); },
  96727. callback
  96728. );
  96729. }
  96730. return p;
  96731. function loadMetaSchemaOf(sch) {
  96732. var $schema = sch.$schema;
  96733. return $schema && !self.getSchema($schema)
  96734. ? compileAsync.call(self, { $ref: $schema }, true)
  96735. : Promise.resolve();
  96736. }
  96737. function _compileAsync(schemaObj) {
  96738. try { return self._compile(schemaObj); }
  96739. catch(e) {
  96740. if (e instanceof MissingRefError) return loadMissingSchema(e);
  96741. throw e;
  96742. }
  96743. function loadMissingSchema(e) {
  96744. var ref = e.missingSchema;
  96745. if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved');
  96746. var schemaPromise = self._loadingSchemas[ref];
  96747. if (!schemaPromise) {
  96748. schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref);
  96749. schemaPromise.then(removePromise, removePromise);
  96750. }
  96751. return schemaPromise.then(function (sch) {
  96752. if (!added(ref)) {
  96753. return loadMetaSchemaOf(sch).then(function () {
  96754. if (!added(ref)) self.addSchema(sch, ref, undefined, meta);
  96755. });
  96756. }
  96757. }).then(function() {
  96758. return _compileAsync(schemaObj);
  96759. });
  96760. function removePromise() {
  96761. delete self._loadingSchemas[ref];
  96762. }
  96763. function added(ref) {
  96764. return self._refs[ref] || self._schemas[ref];
  96765. }
  96766. }
  96767. }
  96768. }
  96769. /***/ }),
  96770. /* 709 */
  96771. /***/ (function(module, exports, __webpack_require__) {
  96772. "use strict";
  96773. var util = __webpack_require__(106);
  96774. var DATE = /^\d\d\d\d-(\d\d)-(\d\d)$/;
  96775. var DAYS = [0,31,29,31,30,31,30,31,31,30,31,30,31];
  96776. var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i;
  96777. var HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i;
  96778. var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
  96779. var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
  96780. // uri-template: https://tools.ietf.org/html/rfc6570
  96781. var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;
  96782. // For the source: https://gist.github.com/dperini/729294
  96783. // For test cases: https://mathiasbynens.be/demo/url-regex
  96784. // @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.
  96785. // var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;
  96786. var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;
  96787. var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
  96788. var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$|^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
  96789. var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
  96790. module.exports = formats;
  96791. function formats(mode) {
  96792. mode = mode == 'full' ? 'full' : 'fast';
  96793. return util.copy(formats[mode]);
  96794. }
  96795. formats.fast = {
  96796. // date: http://tools.ietf.org/html/rfc3339#section-5.6
  96797. date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/,
  96798. // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
  96799. time: /^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,
  96800. 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,
  96801. // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
  96802. uri: /^(?:[a-z][a-z0-9+-.]*)(?::|\/)\/?[^\s]*$/i,
  96803. 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i,
  96804. 'uri-template': URITEMPLATE,
  96805. url: URL,
  96806. // email (sources from jsen validator):
  96807. // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
  96808. // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')
  96809. email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,
  96810. hostname: HOSTNAME,
  96811. // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
  96812. ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
  96813. // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses
  96814. ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
  96815. regex: regex,
  96816. // uuid: http://tools.ietf.org/html/rfc4122
  96817. uuid: UUID,
  96818. // JSON-pointer: https://tools.ietf.org/html/rfc6901
  96819. // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
  96820. 'json-pointer': JSON_POINTER,
  96821. // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
  96822. 'relative-json-pointer': RELATIVE_JSON_POINTER
  96823. };
  96824. formats.full = {
  96825. date: date,
  96826. time: time,
  96827. 'date-time': date_time,
  96828. uri: uri,
  96829. 'uri-reference': URIREF,
  96830. 'uri-template': URITEMPLATE,
  96831. url: URL,
  96832. email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
  96833. hostname: hostname,
  96834. ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
  96835. ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
  96836. regex: regex,
  96837. uuid: UUID,
  96838. 'json-pointer': JSON_POINTER,
  96839. 'relative-json-pointer': RELATIVE_JSON_POINTER
  96840. };
  96841. function date(str) {
  96842. // full-date from http://tools.ietf.org/html/rfc3339#section-5.6
  96843. var matches = str.match(DATE);
  96844. if (!matches) return false;
  96845. var month = +matches[1];
  96846. var day = +matches[2];
  96847. return month >= 1 && month <= 12 && day >= 1 && day <= DAYS[month];
  96848. }
  96849. function time(str, full) {
  96850. var matches = str.match(TIME);
  96851. if (!matches) return false;
  96852. var hour = matches[1];
  96853. var minute = matches[2];
  96854. var second = matches[3];
  96855. var timeZone = matches[5];
  96856. return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone);
  96857. }
  96858. var DATE_TIME_SEPARATOR = /t|\s/i;
  96859. function date_time(str) {
  96860. // http://tools.ietf.org/html/rfc3339#section-5.6
  96861. var dateTime = str.split(DATE_TIME_SEPARATOR);
  96862. return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true);
  96863. }
  96864. function hostname(str) {
  96865. // https://tools.ietf.org/html/rfc1034#section-3.5
  96866. // https://tools.ietf.org/html/rfc1123#section-2
  96867. return str.length <= 255 && HOSTNAME.test(str);
  96868. }
  96869. var NOT_URI_FRAGMENT = /\/|:/;
  96870. function uri(str) {
  96871. // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
  96872. return NOT_URI_FRAGMENT.test(str) && URI.test(str);
  96873. }
  96874. var Z_ANCHOR = /[^\\]\\Z/;
  96875. function regex(str) {
  96876. if (Z_ANCHOR.test(str)) return false;
  96877. try {
  96878. new RegExp(str);
  96879. return true;
  96880. } catch(e) {
  96881. return false;
  96882. }
  96883. }
  96884. /***/ }),
  96885. /* 710 */
  96886. /***/ (function(module, exports, __webpack_require__) {
  96887. "use strict";
  96888. var resolve = __webpack_require__(236)
  96889. , util = __webpack_require__(106)
  96890. , errorClasses = __webpack_require__(235)
  96891. , stableStringify = __webpack_require__(352);
  96892. var validateGenerator = __webpack_require__(362);
  96893. /**
  96894. * Functions below are used inside compiled validations function
  96895. */
  96896. var co = __webpack_require__(321);
  96897. var ucs2length = util.ucs2length;
  96898. var equal = __webpack_require__(237);
  96899. // this error is thrown by async schemas to return validation errors via exception
  96900. var ValidationError = errorClasses.Validation;
  96901. module.exports = compile;
  96902. /**
  96903. * Compiles schema to validation function
  96904. * @this Ajv
  96905. * @param {Object} schema schema object
  96906. * @param {Object} root object with information about the root schema for this schema
  96907. * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution
  96908. * @param {String} baseId base ID for IDs in the schema
  96909. * @return {Function} validation function
  96910. */
  96911. function compile(schema, root, localRefs, baseId) {
  96912. /* jshint validthis: true, evil: true */
  96913. /* eslint no-shadow: 0 */
  96914. var self = this
  96915. , opts = this._opts
  96916. , refVal = [ undefined ]
  96917. , refs = {}
  96918. , patterns = []
  96919. , patternsHash = {}
  96920. , defaults = []
  96921. , defaultsHash = {}
  96922. , customRules = [];
  96923. root = root || { schema: schema, refVal: refVal, refs: refs };
  96924. var c = checkCompiling.call(this, schema, root, baseId);
  96925. var compilation = this._compilations[c.index];
  96926. if (c.compiling) return (compilation.callValidate = callValidate);
  96927. var formats = this._formats;
  96928. var RULES = this.RULES;
  96929. try {
  96930. var v = localCompile(schema, root, localRefs, baseId);
  96931. compilation.validate = v;
  96932. var cv = compilation.callValidate;
  96933. if (cv) {
  96934. cv.schema = v.schema;
  96935. cv.errors = null;
  96936. cv.refs = v.refs;
  96937. cv.refVal = v.refVal;
  96938. cv.root = v.root;
  96939. cv.$async = v.$async;
  96940. if (opts.sourceCode) cv.source = v.source;
  96941. }
  96942. return v;
  96943. } finally {
  96944. endCompiling.call(this, schema, root, baseId);
  96945. }
  96946. function callValidate() {
  96947. var validate = compilation.validate;
  96948. var result = validate.apply(null, arguments);
  96949. callValidate.errors = validate.errors;
  96950. return result;
  96951. }
  96952. function localCompile(_schema, _root, localRefs, baseId) {
  96953. var isRoot = !_root || (_root && _root.schema == _schema);
  96954. if (_root.schema != root.schema)
  96955. return compile.call(self, _schema, _root, localRefs, baseId);
  96956. var $async = _schema.$async === true;
  96957. var sourceCode = validateGenerator({
  96958. isTop: true,
  96959. schema: _schema,
  96960. isRoot: isRoot,
  96961. baseId: baseId,
  96962. root: _root,
  96963. schemaPath: '',
  96964. errSchemaPath: '#',
  96965. errorPath: '""',
  96966. MissingRefError: errorClasses.MissingRef,
  96967. RULES: RULES,
  96968. validate: validateGenerator,
  96969. util: util,
  96970. resolve: resolve,
  96971. resolveRef: resolveRef,
  96972. usePattern: usePattern,
  96973. useDefault: useDefault,
  96974. useCustomRule: useCustomRule,
  96975. opts: opts,
  96976. formats: formats,
  96977. logger: self.logger,
  96978. self: self
  96979. });
  96980. sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)
  96981. + vars(defaults, defaultCode) + vars(customRules, customRuleCode)
  96982. + sourceCode;
  96983. if (opts.processCode) sourceCode = opts.processCode(sourceCode);
  96984. // console.log('\n\n\n *** \n', JSON.stringify(sourceCode));
  96985. var validate;
  96986. try {
  96987. var makeValidate = new Function(
  96988. 'self',
  96989. 'RULES',
  96990. 'formats',
  96991. 'root',
  96992. 'refVal',
  96993. 'defaults',
  96994. 'customRules',
  96995. 'co',
  96996. 'equal',
  96997. 'ucs2length',
  96998. 'ValidationError',
  96999. sourceCode
  97000. );
  97001. validate = makeValidate(
  97002. self,
  97003. RULES,
  97004. formats,
  97005. root,
  97006. refVal,
  97007. defaults,
  97008. customRules,
  97009. co,
  97010. equal,
  97011. ucs2length,
  97012. ValidationError
  97013. );
  97014. refVal[0] = validate;
  97015. } catch(e) {
  97016. self.logger.error('Error compiling schema, function code:', sourceCode);
  97017. throw e;
  97018. }
  97019. validate.schema = _schema;
  97020. validate.errors = null;
  97021. validate.refs = refs;
  97022. validate.refVal = refVal;
  97023. validate.root = isRoot ? validate : _root;
  97024. if ($async) validate.$async = true;
  97025. if (opts.sourceCode === true) {
  97026. validate.source = {
  97027. code: sourceCode,
  97028. patterns: patterns,
  97029. defaults: defaults
  97030. };
  97031. }
  97032. return validate;
  97033. }
  97034. function resolveRef(baseId, ref, isRoot) {
  97035. ref = resolve.url(baseId, ref);
  97036. var refIndex = refs[ref];
  97037. var _refVal, refCode;
  97038. if (refIndex !== undefined) {
  97039. _refVal = refVal[refIndex];
  97040. refCode = 'refVal[' + refIndex + ']';
  97041. return resolvedRef(_refVal, refCode);
  97042. }
  97043. if (!isRoot && root.refs) {
  97044. var rootRefId = root.refs[ref];
  97045. if (rootRefId !== undefined) {
  97046. _refVal = root.refVal[rootRefId];
  97047. refCode = addLocalRef(ref, _refVal);
  97048. return resolvedRef(_refVal, refCode);
  97049. }
  97050. }
  97051. refCode = addLocalRef(ref);
  97052. var v = resolve.call(self, localCompile, root, ref);
  97053. if (v === undefined) {
  97054. var localSchema = localRefs && localRefs[ref];
  97055. if (localSchema) {
  97056. v = resolve.inlineRef(localSchema, opts.inlineRefs)
  97057. ? localSchema
  97058. : compile.call(self, localSchema, root, localRefs, baseId);
  97059. }
  97060. }
  97061. if (v === undefined) {
  97062. removeLocalRef(ref);
  97063. } else {
  97064. replaceLocalRef(ref, v);
  97065. return resolvedRef(v, refCode);
  97066. }
  97067. }
  97068. function addLocalRef(ref, v) {
  97069. var refId = refVal.length;
  97070. refVal[refId] = v;
  97071. refs[ref] = refId;
  97072. return 'refVal' + refId;
  97073. }
  97074. function removeLocalRef(ref) {
  97075. delete refs[ref];
  97076. }
  97077. function replaceLocalRef(ref, v) {
  97078. var refId = refs[ref];
  97079. refVal[refId] = v;
  97080. }
  97081. function resolvedRef(refVal, code) {
  97082. return typeof refVal == 'object' || typeof refVal == 'boolean'
  97083. ? { code: code, schema: refVal, inline: true }
  97084. : { code: code, $async: refVal && refVal.$async };
  97085. }
  97086. function usePattern(regexStr) {
  97087. var index = patternsHash[regexStr];
  97088. if (index === undefined) {
  97089. index = patternsHash[regexStr] = patterns.length;
  97090. patterns[index] = regexStr;
  97091. }
  97092. return 'pattern' + index;
  97093. }
  97094. function useDefault(value) {
  97095. switch (typeof value) {
  97096. case 'boolean':
  97097. case 'number':
  97098. return '' + value;
  97099. case 'string':
  97100. return util.toQuotedString(value);
  97101. case 'object':
  97102. if (value === null) return 'null';
  97103. var valueStr = stableStringify(value);
  97104. var index = defaultsHash[valueStr];
  97105. if (index === undefined) {
  97106. index = defaultsHash[valueStr] = defaults.length;
  97107. defaults[index] = value;
  97108. }
  97109. return 'default' + index;
  97110. }
  97111. }
  97112. function useCustomRule(rule, schema, parentSchema, it) {
  97113. var validateSchema = rule.definition.validateSchema;
  97114. if (validateSchema && self._opts.validateSchema !== false) {
  97115. var valid = validateSchema(schema);
  97116. if (!valid) {
  97117. var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors);
  97118. if (self._opts.validateSchema == 'log') self.logger.error(message);
  97119. else throw new Error(message);
  97120. }
  97121. }
  97122. var compile = rule.definition.compile
  97123. , inline = rule.definition.inline
  97124. , macro = rule.definition.macro;
  97125. var validate;
  97126. if (compile) {
  97127. validate = compile.call(self, schema, parentSchema, it);
  97128. } else if (macro) {
  97129. validate = macro.call(self, schema, parentSchema, it);
  97130. if (opts.validateSchema !== false) self.validateSchema(validate, true);
  97131. } else if (inline) {
  97132. validate = inline.call(self, it, rule.keyword, schema, parentSchema);
  97133. } else {
  97134. validate = rule.definition.validate;
  97135. if (!validate) return;
  97136. }
  97137. if (validate === undefined)
  97138. throw new Error('custom keyword "' + rule.keyword + '"failed to compile');
  97139. var index = customRules.length;
  97140. customRules[index] = validate;
  97141. return {
  97142. code: 'customRule' + index,
  97143. validate: validate
  97144. };
  97145. }
  97146. }
  97147. /**
  97148. * Checks if the schema is currently compiled
  97149. * @this Ajv
  97150. * @param {Object} schema schema to compile
  97151. * @param {Object} root root object
  97152. * @param {String} baseId base schema ID
  97153. * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean)
  97154. */
  97155. function checkCompiling(schema, root, baseId) {
  97156. /* jshint validthis: true */
  97157. var index = compIndex.call(this, schema, root, baseId);
  97158. if (index >= 0) return { index: index, compiling: true };
  97159. index = this._compilations.length;
  97160. this._compilations[index] = {
  97161. schema: schema,
  97162. root: root,
  97163. baseId: baseId
  97164. };
  97165. return { index: index, compiling: false };
  97166. }
  97167. /**
  97168. * Removes the schema from the currently compiled list
  97169. * @this Ajv
  97170. * @param {Object} schema schema to compile
  97171. * @param {Object} root root object
  97172. * @param {String} baseId base schema ID
  97173. */
  97174. function endCompiling(schema, root, baseId) {
  97175. /* jshint validthis: true */
  97176. var i = compIndex.call(this, schema, root, baseId);
  97177. if (i >= 0) this._compilations.splice(i, 1);
  97178. }
  97179. /**
  97180. * Index of schema compilation in the currently compiled list
  97181. * @this Ajv
  97182. * @param {Object} schema schema to compile
  97183. * @param {Object} root root object
  97184. * @param {String} baseId base schema ID
  97185. * @return {Integer} compilation index
  97186. */
  97187. function compIndex(schema, root, baseId) {
  97188. /* jshint validthis: true */
  97189. for (var i=0; i<this._compilations.length; i++) {
  97190. var c = this._compilations[i];
  97191. if (c.schema == schema && c.root == root && c.baseId == baseId) return i;
  97192. }
  97193. return -1;
  97194. }
  97195. function patternCode(i, patterns) {
  97196. return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');';
  97197. }
  97198. function defaultCode(i) {
  97199. return 'var default' + i + ' = defaults[' + i + '];';
  97200. }
  97201. function refValCode(i, refVal) {
  97202. return refVal[i] === undefined ? '' : 'var refVal' + i + ' = refVal[' + i + '];';
  97203. }
  97204. function customRuleCode(i) {
  97205. return 'var customRule' + i + ' = customRules[' + i + '];';
  97206. }
  97207. function vars(arr, statement) {
  97208. if (!arr.length) return '';
  97209. var code = '';
  97210. for (var i=0; i<arr.length; i++)
  97211. code += statement(i, arr);
  97212. return code;
  97213. }
  97214. /***/ }),
  97215. /* 711 */
  97216. /***/ (function(module, exports, __webpack_require__) {
  97217. "use strict";
  97218. var ruleModules = __webpack_require__(707)
  97219. , toHash = __webpack_require__(106).toHash;
  97220. module.exports = function rules() {
  97221. var RULES = [
  97222. { type: 'number',
  97223. rules: [ { 'maximum': ['exclusiveMaximum'] },
  97224. { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] },
  97225. { type: 'string',
  97226. rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] },
  97227. { type: 'array',
  97228. rules: [ 'maxItems', 'minItems', 'uniqueItems', 'contains', 'items' ] },
  97229. { type: 'object',
  97230. rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames',
  97231. { 'properties': ['additionalProperties', 'patternProperties'] } ] },
  97232. { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf' ] }
  97233. ];
  97234. var ALL = [ 'type' ];
  97235. var KEYWORDS = [
  97236. 'additionalItems', '$schema', '$id', 'id', 'title',
  97237. 'description', 'default', 'definitions'
  97238. ];
  97239. var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];
  97240. RULES.all = toHash(ALL);
  97241. RULES.types = toHash(TYPES);
  97242. RULES.forEach(function (group) {
  97243. group.rules = group.rules.map(function (keyword) {
  97244. var implKeywords;
  97245. if (typeof keyword == 'object') {
  97246. var key = Object.keys(keyword)[0];
  97247. implKeywords = keyword[key];
  97248. keyword = key;
  97249. implKeywords.forEach(function (k) {
  97250. ALL.push(k);
  97251. RULES.all[k] = true;
  97252. });
  97253. }
  97254. ALL.push(keyword);
  97255. var rule = RULES.all[keyword] = {
  97256. keyword: keyword,
  97257. code: ruleModules[keyword],
  97258. implements: implKeywords
  97259. };
  97260. return rule;
  97261. });
  97262. if (group.type) RULES.types[group.type] = group;
  97263. });
  97264. RULES.keywords = toHash(ALL.concat(KEYWORDS));
  97265. RULES.custom = {};
  97266. return RULES;
  97267. };
  97268. /***/ }),
  97269. /* 712 */
  97270. /***/ (function(module, exports, __webpack_require__) {
  97271. "use strict";
  97272. // https://mathiasbynens.be/notes/javascript-encoding
  97273. // https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
  97274. module.exports = function ucs2length(str) {
  97275. var length = 0
  97276. , len = str.length
  97277. , pos = 0
  97278. , value;
  97279. while (pos < len) {
  97280. length++;
  97281. value = str.charCodeAt(pos++);
  97282. if (value >= 0xD800 && value <= 0xDBFF && pos < len) {
  97283. // high surrogate, and there is a next character
  97284. value = str.charCodeAt(pos);
  97285. if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate
  97286. }
  97287. }
  97288. return length;
  97289. };
  97290. /***/ }),
  97291. /* 713 */
  97292. /***/ (function(module, exports, __webpack_require__) {
  97293. "use strict";
  97294. module.exports = function generate_allOf(it, $keyword, $ruleType) {
  97295. var out = ' ';
  97296. var $schema = it.schema[$keyword];
  97297. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  97298. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  97299. var $breakOnError = !it.opts.allErrors;
  97300. var $it = it.util.copy(it);
  97301. var $closingBraces = '';
  97302. $it.level++;
  97303. var $nextValid = 'valid' + $it.level;
  97304. var $currentBaseId = $it.baseId,
  97305. $allSchemasEmpty = true;
  97306. var arr1 = $schema;
  97307. if (arr1) {
  97308. var $sch, $i = -1,
  97309. l1 = arr1.length - 1;
  97310. while ($i < l1) {
  97311. $sch = arr1[$i += 1];
  97312. if (it.util.schemaHasRules($sch, it.RULES.all)) {
  97313. $allSchemasEmpty = false;
  97314. $it.schema = $sch;
  97315. $it.schemaPath = $schemaPath + '[' + $i + ']';
  97316. $it.errSchemaPath = $errSchemaPath + '/' + $i;
  97317. out += ' ' + (it.validate($it)) + ' ';
  97318. $it.baseId = $currentBaseId;
  97319. if ($breakOnError) {
  97320. out += ' if (' + ($nextValid) + ') { ';
  97321. $closingBraces += '}';
  97322. }
  97323. }
  97324. }
  97325. }
  97326. if ($breakOnError) {
  97327. if ($allSchemasEmpty) {
  97328. out += ' if (true) { ';
  97329. } else {
  97330. out += ' ' + ($closingBraces.slice(0, -1)) + ' ';
  97331. }
  97332. }
  97333. out = it.util.cleanUpCode(out);
  97334. return out;
  97335. }
  97336. /***/ }),
  97337. /* 714 */
  97338. /***/ (function(module, exports, __webpack_require__) {
  97339. "use strict";
  97340. module.exports = function generate_anyOf(it, $keyword, $ruleType) {
  97341. var out = ' ';
  97342. var $lvl = it.level;
  97343. var $dataLvl = it.dataLevel;
  97344. var $schema = it.schema[$keyword];
  97345. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  97346. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  97347. var $breakOnError = !it.opts.allErrors;
  97348. var $data = 'data' + ($dataLvl || '');
  97349. var $valid = 'valid' + $lvl;
  97350. var $errs = 'errs__' + $lvl;
  97351. var $it = it.util.copy(it);
  97352. var $closingBraces = '';
  97353. $it.level++;
  97354. var $nextValid = 'valid' + $it.level;
  97355. var $noEmptySchema = $schema.every(function($sch) {
  97356. return it.util.schemaHasRules($sch, it.RULES.all);
  97357. });
  97358. if ($noEmptySchema) {
  97359. var $currentBaseId = $it.baseId;
  97360. out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; ';
  97361. var $wasComposite = it.compositeRule;
  97362. it.compositeRule = $it.compositeRule = true;
  97363. var arr1 = $schema;
  97364. if (arr1) {
  97365. var $sch, $i = -1,
  97366. l1 = arr1.length - 1;
  97367. while ($i < l1) {
  97368. $sch = arr1[$i += 1];
  97369. $it.schema = $sch;
  97370. $it.schemaPath = $schemaPath + '[' + $i + ']';
  97371. $it.errSchemaPath = $errSchemaPath + '/' + $i;
  97372. out += ' ' + (it.validate($it)) + ' ';
  97373. $it.baseId = $currentBaseId;
  97374. out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { ';
  97375. $closingBraces += '}';
  97376. }
  97377. }
  97378. it.compositeRule = $it.compositeRule = $wasComposite;
  97379. out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */
  97380. if (it.createErrors !== false) {
  97381. out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
  97382. if (it.opts.messages !== false) {
  97383. out += ' , message: \'should match some schema in anyOf\' ';
  97384. }
  97385. if (it.opts.verbose) {
  97386. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  97387. }
  97388. out += ' } ';
  97389. } else {
  97390. out += ' {} ';
  97391. }
  97392. out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  97393. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  97394. if (it.async) {
  97395. out += ' throw new ValidationError(vErrors); ';
  97396. } else {
  97397. out += ' validate.errors = vErrors; return false; ';
  97398. }
  97399. }
  97400. out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
  97401. if (it.opts.allErrors) {
  97402. out += ' } ';
  97403. }
  97404. out = it.util.cleanUpCode(out);
  97405. } else {
  97406. if ($breakOnError) {
  97407. out += ' if (true) { ';
  97408. }
  97409. }
  97410. return out;
  97411. }
  97412. /***/ }),
  97413. /* 715 */
  97414. /***/ (function(module, exports, __webpack_require__) {
  97415. "use strict";
  97416. module.exports = function generate_const(it, $keyword, $ruleType) {
  97417. var out = ' ';
  97418. var $lvl = it.level;
  97419. var $dataLvl = it.dataLevel;
  97420. var $schema = it.schema[$keyword];
  97421. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  97422. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  97423. var $breakOnError = !it.opts.allErrors;
  97424. var $data = 'data' + ($dataLvl || '');
  97425. var $valid = 'valid' + $lvl;
  97426. var $isData = it.opts.$data && $schema && $schema.$data,
  97427. $schemaValue;
  97428. if ($isData) {
  97429. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  97430. $schemaValue = 'schema' + $lvl;
  97431. } else {
  97432. $schemaValue = $schema;
  97433. }
  97434. if (!$isData) {
  97435. out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';';
  97436. }
  97437. out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { ';
  97438. var $$outStack = $$outStack || [];
  97439. $$outStack.push(out);
  97440. out = ''; /* istanbul ignore else */
  97441. if (it.createErrors !== false) {
  97442. out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
  97443. if (it.opts.messages !== false) {
  97444. out += ' , message: \'should be equal to constant\' ';
  97445. }
  97446. if (it.opts.verbose) {
  97447. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  97448. }
  97449. out += ' } ';
  97450. } else {
  97451. out += ' {} ';
  97452. }
  97453. var __err = out;
  97454. out = $$outStack.pop();
  97455. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  97456. if (it.async) {
  97457. out += ' throw new ValidationError([' + (__err) + ']); ';
  97458. } else {
  97459. out += ' validate.errors = [' + (__err) + ']; return false; ';
  97460. }
  97461. } else {
  97462. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  97463. }
  97464. out += ' }';
  97465. if ($breakOnError) {
  97466. out += ' else { ';
  97467. }
  97468. return out;
  97469. }
  97470. /***/ }),
  97471. /* 716 */
  97472. /***/ (function(module, exports, __webpack_require__) {
  97473. "use strict";
  97474. module.exports = function generate_contains(it, $keyword, $ruleType) {
  97475. var out = ' ';
  97476. var $lvl = it.level;
  97477. var $dataLvl = it.dataLevel;
  97478. var $schema = it.schema[$keyword];
  97479. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  97480. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  97481. var $breakOnError = !it.opts.allErrors;
  97482. var $data = 'data' + ($dataLvl || '');
  97483. var $valid = 'valid' + $lvl;
  97484. var $errs = 'errs__' + $lvl;
  97485. var $it = it.util.copy(it);
  97486. var $closingBraces = '';
  97487. $it.level++;
  97488. var $nextValid = 'valid' + $it.level;
  97489. var $idx = 'i' + $lvl,
  97490. $dataNxt = $it.dataLevel = it.dataLevel + 1,
  97491. $nextData = 'data' + $dataNxt,
  97492. $currentBaseId = it.baseId,
  97493. $nonEmptySchema = it.util.schemaHasRules($schema, it.RULES.all);
  97494. out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
  97495. if ($nonEmptySchema) {
  97496. var $wasComposite = it.compositeRule;
  97497. it.compositeRule = $it.compositeRule = true;
  97498. $it.schema = $schema;
  97499. $it.schemaPath = $schemaPath;
  97500. $it.errSchemaPath = $errSchemaPath;
  97501. out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
  97502. $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
  97503. var $passData = $data + '[' + $idx + ']';
  97504. $it.dataPathArr[$dataNxt] = $idx;
  97505. var $code = it.validate($it);
  97506. $it.baseId = $currentBaseId;
  97507. if (it.util.varOccurences($code, $nextData) < 2) {
  97508. out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
  97509. } else {
  97510. out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
  97511. }
  97512. out += ' if (' + ($nextValid) + ') break; } ';
  97513. it.compositeRule = $it.compositeRule = $wasComposite;
  97514. out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {';
  97515. } else {
  97516. out += ' if (' + ($data) + '.length == 0) {';
  97517. }
  97518. var $$outStack = $$outStack || [];
  97519. $$outStack.push(out);
  97520. out = ''; /* istanbul ignore else */
  97521. if (it.createErrors !== false) {
  97522. out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
  97523. if (it.opts.messages !== false) {
  97524. out += ' , message: \'should contain a valid item\' ';
  97525. }
  97526. if (it.opts.verbose) {
  97527. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  97528. }
  97529. out += ' } ';
  97530. } else {
  97531. out += ' {} ';
  97532. }
  97533. var __err = out;
  97534. out = $$outStack.pop();
  97535. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  97536. if (it.async) {
  97537. out += ' throw new ValidationError([' + (__err) + ']); ';
  97538. } else {
  97539. out += ' validate.errors = [' + (__err) + ']; return false; ';
  97540. }
  97541. } else {
  97542. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  97543. }
  97544. out += ' } else { ';
  97545. if ($nonEmptySchema) {
  97546. out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
  97547. }
  97548. if (it.opts.allErrors) {
  97549. out += ' } ';
  97550. }
  97551. out = it.util.cleanUpCode(out);
  97552. return out;
  97553. }
  97554. /***/ }),
  97555. /* 717 */
  97556. /***/ (function(module, exports, __webpack_require__) {
  97557. "use strict";
  97558. module.exports = function generate_custom(it, $keyword, $ruleType) {
  97559. var out = ' ';
  97560. var $lvl = it.level;
  97561. var $dataLvl = it.dataLevel;
  97562. var $schema = it.schema[$keyword];
  97563. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  97564. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  97565. var $breakOnError = !it.opts.allErrors;
  97566. var $errorKeyword;
  97567. var $data = 'data' + ($dataLvl || '');
  97568. var $valid = 'valid' + $lvl;
  97569. var $errs = 'errs__' + $lvl;
  97570. var $isData = it.opts.$data && $schema && $schema.$data,
  97571. $schemaValue;
  97572. if ($isData) {
  97573. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  97574. $schemaValue = 'schema' + $lvl;
  97575. } else {
  97576. $schemaValue = $schema;
  97577. }
  97578. var $rule = this,
  97579. $definition = 'definition' + $lvl,
  97580. $rDef = $rule.definition,
  97581. $closingBraces = '';
  97582. var $compile, $inline, $macro, $ruleValidate, $validateCode;
  97583. if ($isData && $rDef.$data) {
  97584. $validateCode = 'keywordValidate' + $lvl;
  97585. var $validateSchema = $rDef.validateSchema;
  97586. out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;';
  97587. } else {
  97588. $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
  97589. if (!$ruleValidate) return;
  97590. $schemaValue = 'validate.schema' + $schemaPath;
  97591. $validateCode = $ruleValidate.code;
  97592. $compile = $rDef.compile;
  97593. $inline = $rDef.inline;
  97594. $macro = $rDef.macro;
  97595. }
  97596. var $ruleErrs = $validateCode + '.errors',
  97597. $i = 'i' + $lvl,
  97598. $ruleErr = 'ruleErr' + $lvl,
  97599. $asyncKeyword = $rDef.async;
  97600. if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema');
  97601. if (!($inline || $macro)) {
  97602. out += '' + ($ruleErrs) + ' = null;';
  97603. }
  97604. out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
  97605. if ($isData && $rDef.$data) {
  97606. $closingBraces += '}';
  97607. out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { ';
  97608. if ($validateSchema) {
  97609. $closingBraces += '}';
  97610. out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { ';
  97611. }
  97612. }
  97613. if ($inline) {
  97614. if ($rDef.statements) {
  97615. out += ' ' + ($ruleValidate.validate) + ' ';
  97616. } else {
  97617. out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; ';
  97618. }
  97619. } else if ($macro) {
  97620. var $it = it.util.copy(it);
  97621. var $closingBraces = '';
  97622. $it.level++;
  97623. var $nextValid = 'valid' + $it.level;
  97624. $it.schema = $ruleValidate.validate;
  97625. $it.schemaPath = '';
  97626. var $wasComposite = it.compositeRule;
  97627. it.compositeRule = $it.compositeRule = true;
  97628. var $code = it.validate($it).replace(/validate\.schema/g, $validateCode);
  97629. it.compositeRule = $it.compositeRule = $wasComposite;
  97630. out += ' ' + ($code);
  97631. } else {
  97632. var $$outStack = $$outStack || [];
  97633. $$outStack.push(out);
  97634. out = '';
  97635. out += ' ' + ($validateCode) + '.call( ';
  97636. if (it.opts.passContext) {
  97637. out += 'this';
  97638. } else {
  97639. out += 'self';
  97640. }
  97641. if ($compile || $rDef.schema === false) {
  97642. out += ' , ' + ($data) + ' ';
  97643. } else {
  97644. out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' ';
  97645. }
  97646. out += ' , (dataPath || \'\')';
  97647. if (it.errorPath != '""') {
  97648. out += ' + ' + (it.errorPath);
  97649. }
  97650. var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
  97651. $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
  97652. out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) ';
  97653. var def_callRuleValidate = out;
  97654. out = $$outStack.pop();
  97655. if ($rDef.errors === false) {
  97656. out += ' ' + ($valid) + ' = ';
  97657. if ($asyncKeyword) {
  97658. out += '' + (it.yieldAwait);
  97659. }
  97660. out += '' + (def_callRuleValidate) + '; ';
  97661. } else {
  97662. if ($asyncKeyword) {
  97663. $ruleErrs = 'customErrors' + $lvl;
  97664. out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } ';
  97665. } else {
  97666. out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; ';
  97667. }
  97668. }
  97669. }
  97670. if ($rDef.modifying) {
  97671. out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];';
  97672. }
  97673. out += '' + ($closingBraces);
  97674. if ($rDef.valid) {
  97675. if ($breakOnError) {
  97676. out += ' if (true) { ';
  97677. }
  97678. } else {
  97679. out += ' if ( ';
  97680. if ($rDef.valid === undefined) {
  97681. out += ' !';
  97682. if ($macro) {
  97683. out += '' + ($nextValid);
  97684. } else {
  97685. out += '' + ($valid);
  97686. }
  97687. } else {
  97688. out += ' ' + (!$rDef.valid) + ' ';
  97689. }
  97690. out += ') { ';
  97691. $errorKeyword = $rule.keyword;
  97692. var $$outStack = $$outStack || [];
  97693. $$outStack.push(out);
  97694. out = '';
  97695. var $$outStack = $$outStack || [];
  97696. $$outStack.push(out);
  97697. out = ''; /* istanbul ignore else */
  97698. if (it.createErrors !== false) {
  97699. out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
  97700. if (it.opts.messages !== false) {
  97701. out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
  97702. }
  97703. if (it.opts.verbose) {
  97704. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  97705. }
  97706. out += ' } ';
  97707. } else {
  97708. out += ' {} ';
  97709. }
  97710. var __err = out;
  97711. out = $$outStack.pop();
  97712. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  97713. if (it.async) {
  97714. out += ' throw new ValidationError([' + (__err) + ']); ';
  97715. } else {
  97716. out += ' validate.errors = [' + (__err) + ']; return false; ';
  97717. }
  97718. } else {
  97719. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  97720. }
  97721. var def_customError = out;
  97722. out = $$outStack.pop();
  97723. if ($inline) {
  97724. if ($rDef.errors) {
  97725. if ($rDef.errors != 'full') {
  97726. out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
  97727. if (it.opts.verbose) {
  97728. out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
  97729. }
  97730. out += ' } ';
  97731. }
  97732. } else {
  97733. if ($rDef.errors === false) {
  97734. out += ' ' + (def_customError) + ' ';
  97735. } else {
  97736. out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else { for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
  97737. if (it.opts.verbose) {
  97738. out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
  97739. }
  97740. out += ' } } ';
  97741. }
  97742. }
  97743. } else if ($macro) {
  97744. out += ' var err = '; /* istanbul ignore else */
  97745. if (it.createErrors !== false) {
  97746. out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
  97747. if (it.opts.messages !== false) {
  97748. out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
  97749. }
  97750. if (it.opts.verbose) {
  97751. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  97752. }
  97753. out += ' } ';
  97754. } else {
  97755. out += ' {} ';
  97756. }
  97757. out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  97758. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  97759. if (it.async) {
  97760. out += ' throw new ValidationError(vErrors); ';
  97761. } else {
  97762. out += ' validate.errors = vErrors; return false; ';
  97763. }
  97764. }
  97765. } else {
  97766. if ($rDef.errors === false) {
  97767. out += ' ' + (def_customError) + ' ';
  97768. } else {
  97769. out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length; for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; ';
  97770. if (it.opts.verbose) {
  97771. out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
  97772. }
  97773. out += ' } } else { ' + (def_customError) + ' } ';
  97774. }
  97775. }
  97776. out += ' } ';
  97777. if ($breakOnError) {
  97778. out += ' else { ';
  97779. }
  97780. }
  97781. return out;
  97782. }
  97783. /***/ }),
  97784. /* 718 */
  97785. /***/ (function(module, exports, __webpack_require__) {
  97786. "use strict";
  97787. module.exports = function generate_dependencies(it, $keyword, $ruleType) {
  97788. var out = ' ';
  97789. var $lvl = it.level;
  97790. var $dataLvl = it.dataLevel;
  97791. var $schema = it.schema[$keyword];
  97792. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  97793. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  97794. var $breakOnError = !it.opts.allErrors;
  97795. var $data = 'data' + ($dataLvl || '');
  97796. var $errs = 'errs__' + $lvl;
  97797. var $it = it.util.copy(it);
  97798. var $closingBraces = '';
  97799. $it.level++;
  97800. var $nextValid = 'valid' + $it.level;
  97801. var $schemaDeps = {},
  97802. $propertyDeps = {},
  97803. $ownProperties = it.opts.ownProperties;
  97804. for ($property in $schema) {
  97805. var $sch = $schema[$property];
  97806. var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;
  97807. $deps[$property] = $sch;
  97808. }
  97809. out += 'var ' + ($errs) + ' = errors;';
  97810. var $currentErrorPath = it.errorPath;
  97811. out += 'var missing' + ($lvl) + ';';
  97812. for (var $property in $propertyDeps) {
  97813. $deps = $propertyDeps[$property];
  97814. if ($deps.length) {
  97815. out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
  97816. if ($ownProperties) {
  97817. out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
  97818. }
  97819. if ($breakOnError) {
  97820. out += ' && ( ';
  97821. var arr1 = $deps;
  97822. if (arr1) {
  97823. var $propertyKey, $i = -1,
  97824. l1 = arr1.length - 1;
  97825. while ($i < l1) {
  97826. $propertyKey = arr1[$i += 1];
  97827. if ($i) {
  97828. out += ' || ';
  97829. }
  97830. var $prop = it.util.getProperty($propertyKey),
  97831. $useData = $data + $prop;
  97832. out += ' ( ( ' + ($useData) + ' === undefined ';
  97833. if ($ownProperties) {
  97834. out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
  97835. }
  97836. out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
  97837. }
  97838. }
  97839. out += ')) { ';
  97840. var $propertyPath = 'missing' + $lvl,
  97841. $missingProperty = '\' + ' + $propertyPath + ' + \'';
  97842. if (it.opts._errorDataPathProperty) {
  97843. it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
  97844. }
  97845. var $$outStack = $$outStack || [];
  97846. $$outStack.push(out);
  97847. out = ''; /* istanbul ignore else */
  97848. if (it.createErrors !== false) {
  97849. out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } ';
  97850. if (it.opts.messages !== false) {
  97851. out += ' , message: \'should have ';
  97852. if ($deps.length == 1) {
  97853. out += 'property ' + (it.util.escapeQuotes($deps[0]));
  97854. } else {
  97855. out += 'properties ' + (it.util.escapeQuotes($deps.join(", ")));
  97856. }
  97857. out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' ';
  97858. }
  97859. if (it.opts.verbose) {
  97860. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  97861. }
  97862. out += ' } ';
  97863. } else {
  97864. out += ' {} ';
  97865. }
  97866. var __err = out;
  97867. out = $$outStack.pop();
  97868. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  97869. if (it.async) {
  97870. out += ' throw new ValidationError([' + (__err) + ']); ';
  97871. } else {
  97872. out += ' validate.errors = [' + (__err) + ']; return false; ';
  97873. }
  97874. } else {
  97875. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  97876. }
  97877. } else {
  97878. out += ' ) { ';
  97879. var arr2 = $deps;
  97880. if (arr2) {
  97881. var $propertyKey, i2 = -1,
  97882. l2 = arr2.length - 1;
  97883. while (i2 < l2) {
  97884. $propertyKey = arr2[i2 += 1];
  97885. var $prop = it.util.getProperty($propertyKey),
  97886. $missingProperty = it.util.escapeQuotes($propertyKey),
  97887. $useData = $data + $prop;
  97888. if (it.opts._errorDataPathProperty) {
  97889. it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
  97890. }
  97891. out += ' if ( ' + ($useData) + ' === undefined ';
  97892. if ($ownProperties) {
  97893. out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
  97894. }
  97895. out += ') { var err = '; /* istanbul ignore else */
  97896. if (it.createErrors !== false) {
  97897. out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } ';
  97898. if (it.opts.messages !== false) {
  97899. out += ' , message: \'should have ';
  97900. if ($deps.length == 1) {
  97901. out += 'property ' + (it.util.escapeQuotes($deps[0]));
  97902. } else {
  97903. out += 'properties ' + (it.util.escapeQuotes($deps.join(", ")));
  97904. }
  97905. out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' ';
  97906. }
  97907. if (it.opts.verbose) {
  97908. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  97909. }
  97910. out += ' } ';
  97911. } else {
  97912. out += ' {} ';
  97913. }
  97914. out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
  97915. }
  97916. }
  97917. }
  97918. out += ' } ';
  97919. if ($breakOnError) {
  97920. $closingBraces += '}';
  97921. out += ' else { ';
  97922. }
  97923. }
  97924. }
  97925. it.errorPath = $currentErrorPath;
  97926. var $currentBaseId = $it.baseId;
  97927. for (var $property in $schemaDeps) {
  97928. var $sch = $schemaDeps[$property];
  97929. if (it.util.schemaHasRules($sch, it.RULES.all)) {
  97930. out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
  97931. if ($ownProperties) {
  97932. out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
  97933. }
  97934. out += ') { ';
  97935. $it.schema = $sch;
  97936. $it.schemaPath = $schemaPath + it.util.getProperty($property);
  97937. $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property);
  97938. out += ' ' + (it.validate($it)) + ' ';
  97939. $it.baseId = $currentBaseId;
  97940. out += ' } ';
  97941. if ($breakOnError) {
  97942. out += ' if (' + ($nextValid) + ') { ';
  97943. $closingBraces += '}';
  97944. }
  97945. }
  97946. }
  97947. if ($breakOnError) {
  97948. out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  97949. }
  97950. out = it.util.cleanUpCode(out);
  97951. return out;
  97952. }
  97953. /***/ }),
  97954. /* 719 */
  97955. /***/ (function(module, exports, __webpack_require__) {
  97956. "use strict";
  97957. module.exports = function generate_enum(it, $keyword, $ruleType) {
  97958. var out = ' ';
  97959. var $lvl = it.level;
  97960. var $dataLvl = it.dataLevel;
  97961. var $schema = it.schema[$keyword];
  97962. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  97963. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  97964. var $breakOnError = !it.opts.allErrors;
  97965. var $data = 'data' + ($dataLvl || '');
  97966. var $valid = 'valid' + $lvl;
  97967. var $isData = it.opts.$data && $schema && $schema.$data,
  97968. $schemaValue;
  97969. if ($isData) {
  97970. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  97971. $schemaValue = 'schema' + $lvl;
  97972. } else {
  97973. $schemaValue = $schema;
  97974. }
  97975. var $i = 'i' + $lvl,
  97976. $vSchema = 'schema' + $lvl;
  97977. if (!$isData) {
  97978. out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';';
  97979. }
  97980. out += 'var ' + ($valid) + ';';
  97981. if ($isData) {
  97982. out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
  97983. }
  97984. out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }';
  97985. if ($isData) {
  97986. out += ' } ';
  97987. }
  97988. out += ' if (!' + ($valid) + ') { ';
  97989. var $$outStack = $$outStack || [];
  97990. $$outStack.push(out);
  97991. out = ''; /* istanbul ignore else */
  97992. if (it.createErrors !== false) {
  97993. out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } ';
  97994. if (it.opts.messages !== false) {
  97995. out += ' , message: \'should be equal to one of the allowed values\' ';
  97996. }
  97997. if (it.opts.verbose) {
  97998. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  97999. }
  98000. out += ' } ';
  98001. } else {
  98002. out += ' {} ';
  98003. }
  98004. var __err = out;
  98005. out = $$outStack.pop();
  98006. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  98007. if (it.async) {
  98008. out += ' throw new ValidationError([' + (__err) + ']); ';
  98009. } else {
  98010. out += ' validate.errors = [' + (__err) + ']; return false; ';
  98011. }
  98012. } else {
  98013. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  98014. }
  98015. out += ' }';
  98016. if ($breakOnError) {
  98017. out += ' else { ';
  98018. }
  98019. return out;
  98020. }
  98021. /***/ }),
  98022. /* 720 */
  98023. /***/ (function(module, exports, __webpack_require__) {
  98024. "use strict";
  98025. module.exports = function generate_format(it, $keyword, $ruleType) {
  98026. var out = ' ';
  98027. var $lvl = it.level;
  98028. var $dataLvl = it.dataLevel;
  98029. var $schema = it.schema[$keyword];
  98030. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  98031. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  98032. var $breakOnError = !it.opts.allErrors;
  98033. var $data = 'data' + ($dataLvl || '');
  98034. if (it.opts.format === false) {
  98035. if ($breakOnError) {
  98036. out += ' if (true) { ';
  98037. }
  98038. return out;
  98039. }
  98040. var $isData = it.opts.$data && $schema && $schema.$data,
  98041. $schemaValue;
  98042. if ($isData) {
  98043. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  98044. $schemaValue = 'schema' + $lvl;
  98045. } else {
  98046. $schemaValue = $schema;
  98047. }
  98048. var $unknownFormats = it.opts.unknownFormats,
  98049. $allowUnknown = Array.isArray($unknownFormats);
  98050. if ($isData) {
  98051. var $format = 'format' + $lvl,
  98052. $isObject = 'isObject' + $lvl,
  98053. $formatType = 'formatType' + $lvl;
  98054. out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { ';
  98055. if (it.async) {
  98056. out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; ';
  98057. }
  98058. out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( ';
  98059. if ($isData) {
  98060. out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
  98061. }
  98062. out += ' (';
  98063. if ($unknownFormats != 'ignore') {
  98064. out += ' (' + ($schemaValue) + ' && !' + ($format) + ' ';
  98065. if ($allowUnknown) {
  98066. out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 ';
  98067. }
  98068. out += ') || ';
  98069. }
  98070. out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? ';
  98071. if (it.async) {
  98072. out += ' (async' + ($lvl) + ' ? ' + (it.yieldAwait) + ' ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) ';
  98073. } else {
  98074. out += ' ' + ($format) + '(' + ($data) + ') ';
  98075. }
  98076. out += ' : ' + ($format) + '.test(' + ($data) + '))))) {';
  98077. } else {
  98078. var $format = it.formats[$schema];
  98079. if (!$format) {
  98080. if ($unknownFormats == 'ignore') {
  98081. it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"');
  98082. if ($breakOnError) {
  98083. out += ' if (true) { ';
  98084. }
  98085. return out;
  98086. } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) {
  98087. if ($breakOnError) {
  98088. out += ' if (true) { ';
  98089. }
  98090. return out;
  98091. } else {
  98092. throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"');
  98093. }
  98094. }
  98095. var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate;
  98096. var $formatType = $isObject && $format.type || 'string';
  98097. if ($isObject) {
  98098. var $async = $format.async === true;
  98099. $format = $format.validate;
  98100. }
  98101. if ($formatType != $ruleType) {
  98102. if ($breakOnError) {
  98103. out += ' if (true) { ';
  98104. }
  98105. return out;
  98106. }
  98107. if ($async) {
  98108. if (!it.async) throw new Error('async format in sync schema');
  98109. var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';
  98110. out += ' if (!(' + (it.yieldAwait) + ' ' + ($formatRef) + '(' + ($data) + '))) { ';
  98111. } else {
  98112. out += ' if (! ';
  98113. var $formatRef = 'formats' + it.util.getProperty($schema);
  98114. if ($isObject) $formatRef += '.validate';
  98115. if (typeof $format == 'function') {
  98116. out += ' ' + ($formatRef) + '(' + ($data) + ') ';
  98117. } else {
  98118. out += ' ' + ($formatRef) + '.test(' + ($data) + ') ';
  98119. }
  98120. out += ') { ';
  98121. }
  98122. }
  98123. var $$outStack = $$outStack || [];
  98124. $$outStack.push(out);
  98125. out = ''; /* istanbul ignore else */
  98126. if (it.createErrors !== false) {
  98127. out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: ';
  98128. if ($isData) {
  98129. out += '' + ($schemaValue);
  98130. } else {
  98131. out += '' + (it.util.toQuotedString($schema));
  98132. }
  98133. out += ' } ';
  98134. if (it.opts.messages !== false) {
  98135. out += ' , message: \'should match format "';
  98136. if ($isData) {
  98137. out += '\' + ' + ($schemaValue) + ' + \'';
  98138. } else {
  98139. out += '' + (it.util.escapeQuotes($schema));
  98140. }
  98141. out += '"\' ';
  98142. }
  98143. if (it.opts.verbose) {
  98144. out += ' , schema: ';
  98145. if ($isData) {
  98146. out += 'validate.schema' + ($schemaPath);
  98147. } else {
  98148. out += '' + (it.util.toQuotedString($schema));
  98149. }
  98150. out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  98151. }
  98152. out += ' } ';
  98153. } else {
  98154. out += ' {} ';
  98155. }
  98156. var __err = out;
  98157. out = $$outStack.pop();
  98158. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  98159. if (it.async) {
  98160. out += ' throw new ValidationError([' + (__err) + ']); ';
  98161. } else {
  98162. out += ' validate.errors = [' + (__err) + ']; return false; ';
  98163. }
  98164. } else {
  98165. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  98166. }
  98167. out += ' } ';
  98168. if ($breakOnError) {
  98169. out += ' else { ';
  98170. }
  98171. return out;
  98172. }
  98173. /***/ }),
  98174. /* 721 */
  98175. /***/ (function(module, exports, __webpack_require__) {
  98176. "use strict";
  98177. module.exports = function generate_items(it, $keyword, $ruleType) {
  98178. var out = ' ';
  98179. var $lvl = it.level;
  98180. var $dataLvl = it.dataLevel;
  98181. var $schema = it.schema[$keyword];
  98182. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  98183. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  98184. var $breakOnError = !it.opts.allErrors;
  98185. var $data = 'data' + ($dataLvl || '');
  98186. var $valid = 'valid' + $lvl;
  98187. var $errs = 'errs__' + $lvl;
  98188. var $it = it.util.copy(it);
  98189. var $closingBraces = '';
  98190. $it.level++;
  98191. var $nextValid = 'valid' + $it.level;
  98192. var $idx = 'i' + $lvl,
  98193. $dataNxt = $it.dataLevel = it.dataLevel + 1,
  98194. $nextData = 'data' + $dataNxt,
  98195. $currentBaseId = it.baseId;
  98196. out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
  98197. if (Array.isArray($schema)) {
  98198. var $additionalItems = it.schema.additionalItems;
  98199. if ($additionalItems === false) {
  98200. out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; ';
  98201. var $currErrSchemaPath = $errSchemaPath;
  98202. $errSchemaPath = it.errSchemaPath + '/additionalItems';
  98203. out += ' if (!' + ($valid) + ') { ';
  98204. var $$outStack = $$outStack || [];
  98205. $$outStack.push(out);
  98206. out = ''; /* istanbul ignore else */
  98207. if (it.createErrors !== false) {
  98208. out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } ';
  98209. if (it.opts.messages !== false) {
  98210. out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' ';
  98211. }
  98212. if (it.opts.verbose) {
  98213. out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  98214. }
  98215. out += ' } ';
  98216. } else {
  98217. out += ' {} ';
  98218. }
  98219. var __err = out;
  98220. out = $$outStack.pop();
  98221. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  98222. if (it.async) {
  98223. out += ' throw new ValidationError([' + (__err) + ']); ';
  98224. } else {
  98225. out += ' validate.errors = [' + (__err) + ']; return false; ';
  98226. }
  98227. } else {
  98228. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  98229. }
  98230. out += ' } ';
  98231. $errSchemaPath = $currErrSchemaPath;
  98232. if ($breakOnError) {
  98233. $closingBraces += '}';
  98234. out += ' else { ';
  98235. }
  98236. }
  98237. var arr1 = $schema;
  98238. if (arr1) {
  98239. var $sch, $i = -1,
  98240. l1 = arr1.length - 1;
  98241. while ($i < l1) {
  98242. $sch = arr1[$i += 1];
  98243. if (it.util.schemaHasRules($sch, it.RULES.all)) {
  98244. out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { ';
  98245. var $passData = $data + '[' + $i + ']';
  98246. $it.schema = $sch;
  98247. $it.schemaPath = $schemaPath + '[' + $i + ']';
  98248. $it.errSchemaPath = $errSchemaPath + '/' + $i;
  98249. $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);
  98250. $it.dataPathArr[$dataNxt] = $i;
  98251. var $code = it.validate($it);
  98252. $it.baseId = $currentBaseId;
  98253. if (it.util.varOccurences($code, $nextData) < 2) {
  98254. out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
  98255. } else {
  98256. out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
  98257. }
  98258. out += ' } ';
  98259. if ($breakOnError) {
  98260. out += ' if (' + ($nextValid) + ') { ';
  98261. $closingBraces += '}';
  98262. }
  98263. }
  98264. }
  98265. }
  98266. if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) {
  98267. $it.schema = $additionalItems;
  98268. $it.schemaPath = it.schemaPath + '.additionalItems';
  98269. $it.errSchemaPath = it.errSchemaPath + '/additionalItems';
  98270. out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
  98271. $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
  98272. var $passData = $data + '[' + $idx + ']';
  98273. $it.dataPathArr[$dataNxt] = $idx;
  98274. var $code = it.validate($it);
  98275. $it.baseId = $currentBaseId;
  98276. if (it.util.varOccurences($code, $nextData) < 2) {
  98277. out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
  98278. } else {
  98279. out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
  98280. }
  98281. if ($breakOnError) {
  98282. out += ' if (!' + ($nextValid) + ') break; ';
  98283. }
  98284. out += ' } } ';
  98285. if ($breakOnError) {
  98286. out += ' if (' + ($nextValid) + ') { ';
  98287. $closingBraces += '}';
  98288. }
  98289. }
  98290. } else if (it.util.schemaHasRules($schema, it.RULES.all)) {
  98291. $it.schema = $schema;
  98292. $it.schemaPath = $schemaPath;
  98293. $it.errSchemaPath = $errSchemaPath;
  98294. out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
  98295. $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
  98296. var $passData = $data + '[' + $idx + ']';
  98297. $it.dataPathArr[$dataNxt] = $idx;
  98298. var $code = it.validate($it);
  98299. $it.baseId = $currentBaseId;
  98300. if (it.util.varOccurences($code, $nextData) < 2) {
  98301. out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
  98302. } else {
  98303. out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
  98304. }
  98305. if ($breakOnError) {
  98306. out += ' if (!' + ($nextValid) + ') break; ';
  98307. }
  98308. out += ' }';
  98309. }
  98310. if ($breakOnError) {
  98311. out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  98312. }
  98313. out = it.util.cleanUpCode(out);
  98314. return out;
  98315. }
  98316. /***/ }),
  98317. /* 722 */
  98318. /***/ (function(module, exports, __webpack_require__) {
  98319. "use strict";
  98320. module.exports = function generate_multipleOf(it, $keyword, $ruleType) {
  98321. var out = ' ';
  98322. var $lvl = it.level;
  98323. var $dataLvl = it.dataLevel;
  98324. var $schema = it.schema[$keyword];
  98325. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  98326. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  98327. var $breakOnError = !it.opts.allErrors;
  98328. var $data = 'data' + ($dataLvl || '');
  98329. var $isData = it.opts.$data && $schema && $schema.$data,
  98330. $schemaValue;
  98331. if ($isData) {
  98332. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  98333. $schemaValue = 'schema' + $lvl;
  98334. } else {
  98335. $schemaValue = $schema;
  98336. }
  98337. out += 'var division' + ($lvl) + ';if (';
  98338. if ($isData) {
  98339. out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || ';
  98340. }
  98341. out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', ';
  98342. if (it.opts.multipleOfPrecision) {
  98343. out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' ';
  98344. } else {
  98345. out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') ';
  98346. }
  98347. out += ' ) ';
  98348. if ($isData) {
  98349. out += ' ) ';
  98350. }
  98351. out += ' ) { ';
  98352. var $$outStack = $$outStack || [];
  98353. $$outStack.push(out);
  98354. out = ''; /* istanbul ignore else */
  98355. if (it.createErrors !== false) {
  98356. out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } ';
  98357. if (it.opts.messages !== false) {
  98358. out += ' , message: \'should be multiple of ';
  98359. if ($isData) {
  98360. out += '\' + ' + ($schemaValue);
  98361. } else {
  98362. out += '' + ($schemaValue) + '\'';
  98363. }
  98364. }
  98365. if (it.opts.verbose) {
  98366. out += ' , schema: ';
  98367. if ($isData) {
  98368. out += 'validate.schema' + ($schemaPath);
  98369. } else {
  98370. out += '' + ($schema);
  98371. }
  98372. out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  98373. }
  98374. out += ' } ';
  98375. } else {
  98376. out += ' {} ';
  98377. }
  98378. var __err = out;
  98379. out = $$outStack.pop();
  98380. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  98381. if (it.async) {
  98382. out += ' throw new ValidationError([' + (__err) + ']); ';
  98383. } else {
  98384. out += ' validate.errors = [' + (__err) + ']; return false; ';
  98385. }
  98386. } else {
  98387. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  98388. }
  98389. out += '} ';
  98390. if ($breakOnError) {
  98391. out += ' else { ';
  98392. }
  98393. return out;
  98394. }
  98395. /***/ }),
  98396. /* 723 */
  98397. /***/ (function(module, exports, __webpack_require__) {
  98398. "use strict";
  98399. module.exports = function generate_not(it, $keyword, $ruleType) {
  98400. var out = ' ';
  98401. var $lvl = it.level;
  98402. var $dataLvl = it.dataLevel;
  98403. var $schema = it.schema[$keyword];
  98404. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  98405. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  98406. var $breakOnError = !it.opts.allErrors;
  98407. var $data = 'data' + ($dataLvl || '');
  98408. var $errs = 'errs__' + $lvl;
  98409. var $it = it.util.copy(it);
  98410. $it.level++;
  98411. var $nextValid = 'valid' + $it.level;
  98412. if (it.util.schemaHasRules($schema, it.RULES.all)) {
  98413. $it.schema = $schema;
  98414. $it.schemaPath = $schemaPath;
  98415. $it.errSchemaPath = $errSchemaPath;
  98416. out += ' var ' + ($errs) + ' = errors; ';
  98417. var $wasComposite = it.compositeRule;
  98418. it.compositeRule = $it.compositeRule = true;
  98419. $it.createErrors = false;
  98420. var $allErrorsOption;
  98421. if ($it.opts.allErrors) {
  98422. $allErrorsOption = $it.opts.allErrors;
  98423. $it.opts.allErrors = false;
  98424. }
  98425. out += ' ' + (it.validate($it)) + ' ';
  98426. $it.createErrors = true;
  98427. if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;
  98428. it.compositeRule = $it.compositeRule = $wasComposite;
  98429. out += ' if (' + ($nextValid) + ') { ';
  98430. var $$outStack = $$outStack || [];
  98431. $$outStack.push(out);
  98432. out = ''; /* istanbul ignore else */
  98433. if (it.createErrors !== false) {
  98434. out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
  98435. if (it.opts.messages !== false) {
  98436. out += ' , message: \'should NOT be valid\' ';
  98437. }
  98438. if (it.opts.verbose) {
  98439. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  98440. }
  98441. out += ' } ';
  98442. } else {
  98443. out += ' {} ';
  98444. }
  98445. var __err = out;
  98446. out = $$outStack.pop();
  98447. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  98448. if (it.async) {
  98449. out += ' throw new ValidationError([' + (__err) + ']); ';
  98450. } else {
  98451. out += ' validate.errors = [' + (__err) + ']; return false; ';
  98452. }
  98453. } else {
  98454. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  98455. }
  98456. out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
  98457. if (it.opts.allErrors) {
  98458. out += ' } ';
  98459. }
  98460. } else {
  98461. out += ' var err = '; /* istanbul ignore else */
  98462. if (it.createErrors !== false) {
  98463. out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
  98464. if (it.opts.messages !== false) {
  98465. out += ' , message: \'should NOT be valid\' ';
  98466. }
  98467. if (it.opts.verbose) {
  98468. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  98469. }
  98470. out += ' } ';
  98471. } else {
  98472. out += ' {} ';
  98473. }
  98474. out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  98475. if ($breakOnError) {
  98476. out += ' if (false) { ';
  98477. }
  98478. }
  98479. return out;
  98480. }
  98481. /***/ }),
  98482. /* 724 */
  98483. /***/ (function(module, exports, __webpack_require__) {
  98484. "use strict";
  98485. module.exports = function generate_oneOf(it, $keyword, $ruleType) {
  98486. var out = ' ';
  98487. var $lvl = it.level;
  98488. var $dataLvl = it.dataLevel;
  98489. var $schema = it.schema[$keyword];
  98490. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  98491. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  98492. var $breakOnError = !it.opts.allErrors;
  98493. var $data = 'data' + ($dataLvl || '');
  98494. var $valid = 'valid' + $lvl;
  98495. var $errs = 'errs__' + $lvl;
  98496. var $it = it.util.copy(it);
  98497. var $closingBraces = '';
  98498. $it.level++;
  98499. var $nextValid = 'valid' + $it.level;
  98500. out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;';
  98501. var $currentBaseId = $it.baseId;
  98502. var $wasComposite = it.compositeRule;
  98503. it.compositeRule = $it.compositeRule = true;
  98504. var arr1 = $schema;
  98505. if (arr1) {
  98506. var $sch, $i = -1,
  98507. l1 = arr1.length - 1;
  98508. while ($i < l1) {
  98509. $sch = arr1[$i += 1];
  98510. if (it.util.schemaHasRules($sch, it.RULES.all)) {
  98511. $it.schema = $sch;
  98512. $it.schemaPath = $schemaPath + '[' + $i + ']';
  98513. $it.errSchemaPath = $errSchemaPath + '/' + $i;
  98514. out += ' ' + (it.validate($it)) + ' ';
  98515. $it.baseId = $currentBaseId;
  98516. } else {
  98517. out += ' var ' + ($nextValid) + ' = true; ';
  98518. }
  98519. if ($i) {
  98520. out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { ';
  98521. $closingBraces += '}';
  98522. }
  98523. out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;';
  98524. }
  98525. }
  98526. it.compositeRule = $it.compositeRule = $wasComposite;
  98527. out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */
  98528. if (it.createErrors !== false) {
  98529. out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
  98530. if (it.opts.messages !== false) {
  98531. out += ' , message: \'should match exactly one schema in oneOf\' ';
  98532. }
  98533. if (it.opts.verbose) {
  98534. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  98535. }
  98536. out += ' } ';
  98537. } else {
  98538. out += ' {} ';
  98539. }
  98540. out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  98541. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  98542. if (it.async) {
  98543. out += ' throw new ValidationError(vErrors); ';
  98544. } else {
  98545. out += ' validate.errors = vErrors; return false; ';
  98546. }
  98547. }
  98548. out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }';
  98549. if (it.opts.allErrors) {
  98550. out += ' } ';
  98551. }
  98552. return out;
  98553. }
  98554. /***/ }),
  98555. /* 725 */
  98556. /***/ (function(module, exports, __webpack_require__) {
  98557. "use strict";
  98558. module.exports = function generate_pattern(it, $keyword, $ruleType) {
  98559. var out = ' ';
  98560. var $lvl = it.level;
  98561. var $dataLvl = it.dataLevel;
  98562. var $schema = it.schema[$keyword];
  98563. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  98564. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  98565. var $breakOnError = !it.opts.allErrors;
  98566. var $data = 'data' + ($dataLvl || '');
  98567. var $isData = it.opts.$data && $schema && $schema.$data,
  98568. $schemaValue;
  98569. if ($isData) {
  98570. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  98571. $schemaValue = 'schema' + $lvl;
  98572. } else {
  98573. $schemaValue = $schema;
  98574. }
  98575. var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema);
  98576. out += 'if ( ';
  98577. if ($isData) {
  98578. out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
  98579. }
  98580. out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { ';
  98581. var $$outStack = $$outStack || [];
  98582. $$outStack.push(out);
  98583. out = ''; /* istanbul ignore else */
  98584. if (it.createErrors !== false) {
  98585. out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: ';
  98586. if ($isData) {
  98587. out += '' + ($schemaValue);
  98588. } else {
  98589. out += '' + (it.util.toQuotedString($schema));
  98590. }
  98591. out += ' } ';
  98592. if (it.opts.messages !== false) {
  98593. out += ' , message: \'should match pattern "';
  98594. if ($isData) {
  98595. out += '\' + ' + ($schemaValue) + ' + \'';
  98596. } else {
  98597. out += '' + (it.util.escapeQuotes($schema));
  98598. }
  98599. out += '"\' ';
  98600. }
  98601. if (it.opts.verbose) {
  98602. out += ' , schema: ';
  98603. if ($isData) {
  98604. out += 'validate.schema' + ($schemaPath);
  98605. } else {
  98606. out += '' + (it.util.toQuotedString($schema));
  98607. }
  98608. out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  98609. }
  98610. out += ' } ';
  98611. } else {
  98612. out += ' {} ';
  98613. }
  98614. var __err = out;
  98615. out = $$outStack.pop();
  98616. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  98617. if (it.async) {
  98618. out += ' throw new ValidationError([' + (__err) + ']); ';
  98619. } else {
  98620. out += ' validate.errors = [' + (__err) + ']; return false; ';
  98621. }
  98622. } else {
  98623. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  98624. }
  98625. out += '} ';
  98626. if ($breakOnError) {
  98627. out += ' else { ';
  98628. }
  98629. return out;
  98630. }
  98631. /***/ }),
  98632. /* 726 */
  98633. /***/ (function(module, exports, __webpack_require__) {
  98634. "use strict";
  98635. module.exports = function generate_properties(it, $keyword, $ruleType) {
  98636. var out = ' ';
  98637. var $lvl = it.level;
  98638. var $dataLvl = it.dataLevel;
  98639. var $schema = it.schema[$keyword];
  98640. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  98641. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  98642. var $breakOnError = !it.opts.allErrors;
  98643. var $data = 'data' + ($dataLvl || '');
  98644. var $valid = 'valid' + $lvl;
  98645. var $errs = 'errs__' + $lvl;
  98646. var $it = it.util.copy(it);
  98647. var $closingBraces = '';
  98648. $it.level++;
  98649. var $nextValid = 'valid' + $it.level;
  98650. var $key = 'key' + $lvl,
  98651. $idx = 'idx' + $lvl,
  98652. $dataNxt = $it.dataLevel = it.dataLevel + 1,
  98653. $nextData = 'data' + $dataNxt,
  98654. $dataProperties = 'dataProperties' + $lvl;
  98655. var $schemaKeys = Object.keys($schema || {}),
  98656. $pProperties = it.schema.patternProperties || {},
  98657. $pPropertyKeys = Object.keys($pProperties),
  98658. $aProperties = it.schema.additionalProperties,
  98659. $someProperties = $schemaKeys.length || $pPropertyKeys.length,
  98660. $noAdditional = $aProperties === false,
  98661. $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length,
  98662. $removeAdditional = it.opts.removeAdditional,
  98663. $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional,
  98664. $ownProperties = it.opts.ownProperties,
  98665. $currentBaseId = it.baseId;
  98666. var $required = it.schema.required;
  98667. if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required);
  98668. if (it.opts.patternGroups) {
  98669. var $pgProperties = it.schema.patternGroups || {},
  98670. $pgPropertyKeys = Object.keys($pgProperties);
  98671. }
  98672. out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';
  98673. if ($ownProperties) {
  98674. out += ' var ' + ($dataProperties) + ' = undefined;';
  98675. }
  98676. if ($checkAdditional) {
  98677. if ($ownProperties) {
  98678. out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
  98679. } else {
  98680. out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
  98681. }
  98682. if ($someProperties) {
  98683. out += ' var isAdditional' + ($lvl) + ' = !(false ';
  98684. if ($schemaKeys.length) {
  98685. if ($schemaKeys.length > 5) {
  98686. out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] ';
  98687. } else {
  98688. var arr1 = $schemaKeys;
  98689. if (arr1) {
  98690. var $propertyKey, i1 = -1,
  98691. l1 = arr1.length - 1;
  98692. while (i1 < l1) {
  98693. $propertyKey = arr1[i1 += 1];
  98694. out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' ';
  98695. }
  98696. }
  98697. }
  98698. }
  98699. if ($pPropertyKeys.length) {
  98700. var arr2 = $pPropertyKeys;
  98701. if (arr2) {
  98702. var $pProperty, $i = -1,
  98703. l2 = arr2.length - 1;
  98704. while ($i < l2) {
  98705. $pProperty = arr2[$i += 1];
  98706. out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') ';
  98707. }
  98708. }
  98709. }
  98710. if (it.opts.patternGroups && $pgPropertyKeys.length) {
  98711. var arr3 = $pgPropertyKeys;
  98712. if (arr3) {
  98713. var $pgProperty, $i = -1,
  98714. l3 = arr3.length - 1;
  98715. while ($i < l3) {
  98716. $pgProperty = arr3[$i += 1];
  98717. out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') ';
  98718. }
  98719. }
  98720. }
  98721. out += ' ); if (isAdditional' + ($lvl) + ') { ';
  98722. }
  98723. if ($removeAdditional == 'all') {
  98724. out += ' delete ' + ($data) + '[' + ($key) + ']; ';
  98725. } else {
  98726. var $currentErrorPath = it.errorPath;
  98727. var $additionalProperty = '\' + ' + $key + ' + \'';
  98728. if (it.opts._errorDataPathProperty) {
  98729. it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
  98730. }
  98731. if ($noAdditional) {
  98732. if ($removeAdditional) {
  98733. out += ' delete ' + ($data) + '[' + ($key) + ']; ';
  98734. } else {
  98735. out += ' ' + ($nextValid) + ' = false; ';
  98736. var $currErrSchemaPath = $errSchemaPath;
  98737. $errSchemaPath = it.errSchemaPath + '/additionalProperties';
  98738. var $$outStack = $$outStack || [];
  98739. $$outStack.push(out);
  98740. out = ''; /* istanbul ignore else */
  98741. if (it.createErrors !== false) {
  98742. out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } ';
  98743. if (it.opts.messages !== false) {
  98744. out += ' , message: \'should NOT have additional properties\' ';
  98745. }
  98746. if (it.opts.verbose) {
  98747. out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  98748. }
  98749. out += ' } ';
  98750. } else {
  98751. out += ' {} ';
  98752. }
  98753. var __err = out;
  98754. out = $$outStack.pop();
  98755. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  98756. if (it.async) {
  98757. out += ' throw new ValidationError([' + (__err) + ']); ';
  98758. } else {
  98759. out += ' validate.errors = [' + (__err) + ']; return false; ';
  98760. }
  98761. } else {
  98762. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  98763. }
  98764. $errSchemaPath = $currErrSchemaPath;
  98765. if ($breakOnError) {
  98766. out += ' break; ';
  98767. }
  98768. }
  98769. } else if ($additionalIsSchema) {
  98770. if ($removeAdditional == 'failing') {
  98771. out += ' var ' + ($errs) + ' = errors; ';
  98772. var $wasComposite = it.compositeRule;
  98773. it.compositeRule = $it.compositeRule = true;
  98774. $it.schema = $aProperties;
  98775. $it.schemaPath = it.schemaPath + '.additionalProperties';
  98776. $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
  98777. $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
  98778. var $passData = $data + '[' + $key + ']';
  98779. $it.dataPathArr[$dataNxt] = $key;
  98780. var $code = it.validate($it);
  98781. $it.baseId = $currentBaseId;
  98782. if (it.util.varOccurences($code, $nextData) < 2) {
  98783. out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
  98784. } else {
  98785. out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
  98786. }
  98787. out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } ';
  98788. it.compositeRule = $it.compositeRule = $wasComposite;
  98789. } else {
  98790. $it.schema = $aProperties;
  98791. $it.schemaPath = it.schemaPath + '.additionalProperties';
  98792. $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
  98793. $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
  98794. var $passData = $data + '[' + $key + ']';
  98795. $it.dataPathArr[$dataNxt] = $key;
  98796. var $code = it.validate($it);
  98797. $it.baseId = $currentBaseId;
  98798. if (it.util.varOccurences($code, $nextData) < 2) {
  98799. out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
  98800. } else {
  98801. out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
  98802. }
  98803. if ($breakOnError) {
  98804. out += ' if (!' + ($nextValid) + ') break; ';
  98805. }
  98806. }
  98807. }
  98808. it.errorPath = $currentErrorPath;
  98809. }
  98810. if ($someProperties) {
  98811. out += ' } ';
  98812. }
  98813. out += ' } ';
  98814. if ($breakOnError) {
  98815. out += ' if (' + ($nextValid) + ') { ';
  98816. $closingBraces += '}';
  98817. }
  98818. }
  98819. var $useDefaults = it.opts.useDefaults && !it.compositeRule;
  98820. if ($schemaKeys.length) {
  98821. var arr4 = $schemaKeys;
  98822. if (arr4) {
  98823. var $propertyKey, i4 = -1,
  98824. l4 = arr4.length - 1;
  98825. while (i4 < l4) {
  98826. $propertyKey = arr4[i4 += 1];
  98827. var $sch = $schema[$propertyKey];
  98828. if (it.util.schemaHasRules($sch, it.RULES.all)) {
  98829. var $prop = it.util.getProperty($propertyKey),
  98830. $passData = $data + $prop,
  98831. $hasDefault = $useDefaults && $sch.default !== undefined;
  98832. $it.schema = $sch;
  98833. $it.schemaPath = $schemaPath + $prop;
  98834. $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);
  98835. $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);
  98836. $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);
  98837. var $code = it.validate($it);
  98838. $it.baseId = $currentBaseId;
  98839. if (it.util.varOccurences($code, $nextData) < 2) {
  98840. $code = it.util.varReplace($code, $nextData, $passData);
  98841. var $useData = $passData;
  98842. } else {
  98843. var $useData = $nextData;
  98844. out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ';
  98845. }
  98846. if ($hasDefault) {
  98847. out += ' ' + ($code) + ' ';
  98848. } else {
  98849. if ($requiredHash && $requiredHash[$propertyKey]) {
  98850. out += ' if ( ' + ($useData) + ' === undefined ';
  98851. if ($ownProperties) {
  98852. out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
  98853. }
  98854. out += ') { ' + ($nextValid) + ' = false; ';
  98855. var $currentErrorPath = it.errorPath,
  98856. $currErrSchemaPath = $errSchemaPath,
  98857. $missingProperty = it.util.escapeQuotes($propertyKey);
  98858. if (it.opts._errorDataPathProperty) {
  98859. it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
  98860. }
  98861. $errSchemaPath = it.errSchemaPath + '/required';
  98862. var $$outStack = $$outStack || [];
  98863. $$outStack.push(out);
  98864. out = ''; /* istanbul ignore else */
  98865. if (it.createErrors !== false) {
  98866. out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
  98867. if (it.opts.messages !== false) {
  98868. out += ' , message: \'';
  98869. if (it.opts._errorDataPathProperty) {
  98870. out += 'is a required property';
  98871. } else {
  98872. out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
  98873. }
  98874. out += '\' ';
  98875. }
  98876. if (it.opts.verbose) {
  98877. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  98878. }
  98879. out += ' } ';
  98880. } else {
  98881. out += ' {} ';
  98882. }
  98883. var __err = out;
  98884. out = $$outStack.pop();
  98885. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  98886. if (it.async) {
  98887. out += ' throw new ValidationError([' + (__err) + ']); ';
  98888. } else {
  98889. out += ' validate.errors = [' + (__err) + ']; return false; ';
  98890. }
  98891. } else {
  98892. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  98893. }
  98894. $errSchemaPath = $currErrSchemaPath;
  98895. it.errorPath = $currentErrorPath;
  98896. out += ' } else { ';
  98897. } else {
  98898. if ($breakOnError) {
  98899. out += ' if ( ' + ($useData) + ' === undefined ';
  98900. if ($ownProperties) {
  98901. out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
  98902. }
  98903. out += ') { ' + ($nextValid) + ' = true; } else { ';
  98904. } else {
  98905. out += ' if (' + ($useData) + ' !== undefined ';
  98906. if ($ownProperties) {
  98907. out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
  98908. }
  98909. out += ' ) { ';
  98910. }
  98911. }
  98912. out += ' ' + ($code) + ' } ';
  98913. }
  98914. }
  98915. if ($breakOnError) {
  98916. out += ' if (' + ($nextValid) + ') { ';
  98917. $closingBraces += '}';
  98918. }
  98919. }
  98920. }
  98921. }
  98922. if ($pPropertyKeys.length) {
  98923. var arr5 = $pPropertyKeys;
  98924. if (arr5) {
  98925. var $pProperty, i5 = -1,
  98926. l5 = arr5.length - 1;
  98927. while (i5 < l5) {
  98928. $pProperty = arr5[i5 += 1];
  98929. var $sch = $pProperties[$pProperty];
  98930. if (it.util.schemaHasRules($sch, it.RULES.all)) {
  98931. $it.schema = $sch;
  98932. $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);
  98933. $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);
  98934. if ($ownProperties) {
  98935. out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
  98936. } else {
  98937. out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
  98938. }
  98939. out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { ';
  98940. $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
  98941. var $passData = $data + '[' + $key + ']';
  98942. $it.dataPathArr[$dataNxt] = $key;
  98943. var $code = it.validate($it);
  98944. $it.baseId = $currentBaseId;
  98945. if (it.util.varOccurences($code, $nextData) < 2) {
  98946. out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
  98947. } else {
  98948. out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
  98949. }
  98950. if ($breakOnError) {
  98951. out += ' if (!' + ($nextValid) + ') break; ';
  98952. }
  98953. out += ' } ';
  98954. if ($breakOnError) {
  98955. out += ' else ' + ($nextValid) + ' = true; ';
  98956. }
  98957. out += ' } ';
  98958. if ($breakOnError) {
  98959. out += ' if (' + ($nextValid) + ') { ';
  98960. $closingBraces += '}';
  98961. }
  98962. }
  98963. }
  98964. }
  98965. }
  98966. if (it.opts.patternGroups && $pgPropertyKeys.length) {
  98967. var arr6 = $pgPropertyKeys;
  98968. if (arr6) {
  98969. var $pgProperty, i6 = -1,
  98970. l6 = arr6.length - 1;
  98971. while (i6 < l6) {
  98972. $pgProperty = arr6[i6 += 1];
  98973. var $pgSchema = $pgProperties[$pgProperty],
  98974. $sch = $pgSchema.schema;
  98975. if (it.util.schemaHasRules($sch, it.RULES.all)) {
  98976. $it.schema = $sch;
  98977. $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema';
  98978. $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema';
  98979. out += ' var pgPropCount' + ($lvl) + ' = 0; ';
  98980. if ($ownProperties) {
  98981. out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
  98982. } else {
  98983. out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
  98984. }
  98985. out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; ';
  98986. $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
  98987. var $passData = $data + '[' + $key + ']';
  98988. $it.dataPathArr[$dataNxt] = $key;
  98989. var $code = it.validate($it);
  98990. $it.baseId = $currentBaseId;
  98991. if (it.util.varOccurences($code, $nextData) < 2) {
  98992. out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
  98993. } else {
  98994. out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
  98995. }
  98996. if ($breakOnError) {
  98997. out += ' if (!' + ($nextValid) + ') break; ';
  98998. }
  98999. out += ' } ';
  99000. if ($breakOnError) {
  99001. out += ' else ' + ($nextValid) + ' = true; ';
  99002. }
  99003. out += ' } ';
  99004. if ($breakOnError) {
  99005. out += ' if (' + ($nextValid) + ') { ';
  99006. $closingBraces += '}';
  99007. }
  99008. var $pgMin = $pgSchema.minimum,
  99009. $pgMax = $pgSchema.maximum;
  99010. if ($pgMin !== undefined || $pgMax !== undefined) {
  99011. out += ' var ' + ($valid) + ' = true; ';
  99012. var $currErrSchemaPath = $errSchemaPath;
  99013. if ($pgMin !== undefined) {
  99014. var $limit = $pgMin,
  99015. $reason = 'minimum',
  99016. $moreOrLess = 'less';
  99017. out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; ';
  99018. $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum';
  99019. out += ' if (!' + ($valid) + ') { ';
  99020. var $$outStack = $$outStack || [];
  99021. $$outStack.push(out);
  99022. out = ''; /* istanbul ignore else */
  99023. if (it.createErrors !== false) {
  99024. out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } ';
  99025. if (it.opts.messages !== false) {
  99026. out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' ';
  99027. }
  99028. if (it.opts.verbose) {
  99029. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  99030. }
  99031. out += ' } ';
  99032. } else {
  99033. out += ' {} ';
  99034. }
  99035. var __err = out;
  99036. out = $$outStack.pop();
  99037. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  99038. if (it.async) {
  99039. out += ' throw new ValidationError([' + (__err) + ']); ';
  99040. } else {
  99041. out += ' validate.errors = [' + (__err) + ']; return false; ';
  99042. }
  99043. } else {
  99044. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  99045. }
  99046. out += ' } ';
  99047. if ($pgMax !== undefined) {
  99048. out += ' else ';
  99049. }
  99050. }
  99051. if ($pgMax !== undefined) {
  99052. var $limit = $pgMax,
  99053. $reason = 'maximum',
  99054. $moreOrLess = 'more';
  99055. out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; ';
  99056. $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum';
  99057. out += ' if (!' + ($valid) + ') { ';
  99058. var $$outStack = $$outStack || [];
  99059. $$outStack.push(out);
  99060. out = ''; /* istanbul ignore else */
  99061. if (it.createErrors !== false) {
  99062. out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } ';
  99063. if (it.opts.messages !== false) {
  99064. out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' ';
  99065. }
  99066. if (it.opts.verbose) {
  99067. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  99068. }
  99069. out += ' } ';
  99070. } else {
  99071. out += ' {} ';
  99072. }
  99073. var __err = out;
  99074. out = $$outStack.pop();
  99075. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  99076. if (it.async) {
  99077. out += ' throw new ValidationError([' + (__err) + ']); ';
  99078. } else {
  99079. out += ' validate.errors = [' + (__err) + ']; return false; ';
  99080. }
  99081. } else {
  99082. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  99083. }
  99084. out += ' } ';
  99085. }
  99086. $errSchemaPath = $currErrSchemaPath;
  99087. if ($breakOnError) {
  99088. out += ' if (' + ($valid) + ') { ';
  99089. $closingBraces += '}';
  99090. }
  99091. }
  99092. }
  99093. }
  99094. }
  99095. }
  99096. if ($breakOnError) {
  99097. out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  99098. }
  99099. out = it.util.cleanUpCode(out);
  99100. return out;
  99101. }
  99102. /***/ }),
  99103. /* 727 */
  99104. /***/ (function(module, exports, __webpack_require__) {
  99105. "use strict";
  99106. module.exports = function generate_propertyNames(it, $keyword, $ruleType) {
  99107. var out = ' ';
  99108. var $lvl = it.level;
  99109. var $dataLvl = it.dataLevel;
  99110. var $schema = it.schema[$keyword];
  99111. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  99112. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  99113. var $breakOnError = !it.opts.allErrors;
  99114. var $data = 'data' + ($dataLvl || '');
  99115. var $errs = 'errs__' + $lvl;
  99116. var $it = it.util.copy(it);
  99117. var $closingBraces = '';
  99118. $it.level++;
  99119. var $nextValid = 'valid' + $it.level;
  99120. if (it.util.schemaHasRules($schema, it.RULES.all)) {
  99121. $it.schema = $schema;
  99122. $it.schemaPath = $schemaPath;
  99123. $it.errSchemaPath = $errSchemaPath;
  99124. var $key = 'key' + $lvl,
  99125. $idx = 'idx' + $lvl,
  99126. $i = 'i' + $lvl,
  99127. $invalidName = '\' + ' + $key + ' + \'',
  99128. $dataNxt = $it.dataLevel = it.dataLevel + 1,
  99129. $nextData = 'data' + $dataNxt,
  99130. $dataProperties = 'dataProperties' + $lvl,
  99131. $ownProperties = it.opts.ownProperties,
  99132. $currentBaseId = it.baseId;
  99133. out += ' var ' + ($errs) + ' = errors; ';
  99134. if ($ownProperties) {
  99135. out += ' var ' + ($dataProperties) + ' = undefined; ';
  99136. }
  99137. if ($ownProperties) {
  99138. out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
  99139. } else {
  99140. out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
  99141. }
  99142. out += ' var startErrs' + ($lvl) + ' = errors; ';
  99143. var $passData = $key;
  99144. var $wasComposite = it.compositeRule;
  99145. it.compositeRule = $it.compositeRule = true;
  99146. var $code = it.validate($it);
  99147. $it.baseId = $currentBaseId;
  99148. if (it.util.varOccurences($code, $nextData) < 2) {
  99149. out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
  99150. } else {
  99151. out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
  99152. }
  99153. it.compositeRule = $it.compositeRule = $wasComposite;
  99154. out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + '<errors; ' + ($i) + '++) { vErrors[' + ($i) + '].propertyName = ' + ($key) + '; } var err = '; /* istanbul ignore else */
  99155. if (it.createErrors !== false) {
  99156. out += ' { keyword: \'' + ('propertyNames') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { propertyName: \'' + ($invalidName) + '\' } ';
  99157. if (it.opts.messages !== false) {
  99158. out += ' , message: \'property name \\\'' + ($invalidName) + '\\\' is invalid\' ';
  99159. }
  99160. if (it.opts.verbose) {
  99161. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  99162. }
  99163. out += ' } ';
  99164. } else {
  99165. out += ' {} ';
  99166. }
  99167. out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  99168. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  99169. if (it.async) {
  99170. out += ' throw new ValidationError(vErrors); ';
  99171. } else {
  99172. out += ' validate.errors = vErrors; return false; ';
  99173. }
  99174. }
  99175. if ($breakOnError) {
  99176. out += ' break; ';
  99177. }
  99178. out += ' } }';
  99179. }
  99180. if ($breakOnError) {
  99181. out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  99182. }
  99183. out = it.util.cleanUpCode(out);
  99184. return out;
  99185. }
  99186. /***/ }),
  99187. /* 728 */
  99188. /***/ (function(module, exports, __webpack_require__) {
  99189. "use strict";
  99190. module.exports = function generate_ref(it, $keyword, $ruleType) {
  99191. var out = ' ';
  99192. var $lvl = it.level;
  99193. var $dataLvl = it.dataLevel;
  99194. var $schema = it.schema[$keyword];
  99195. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  99196. var $breakOnError = !it.opts.allErrors;
  99197. var $data = 'data' + ($dataLvl || '');
  99198. var $valid = 'valid' + $lvl;
  99199. var $async, $refCode;
  99200. if ($schema == '#' || $schema == '#/') {
  99201. if (it.isRoot) {
  99202. $async = it.async;
  99203. $refCode = 'validate';
  99204. } else {
  99205. $async = it.root.schema.$async === true;
  99206. $refCode = 'root.refVal[0]';
  99207. }
  99208. } else {
  99209. var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot);
  99210. if ($refVal === undefined) {
  99211. var $message = it.MissingRefError.message(it.baseId, $schema);
  99212. if (it.opts.missingRefs == 'fail') {
  99213. it.logger.error($message);
  99214. var $$outStack = $$outStack || [];
  99215. $$outStack.push(out);
  99216. out = ''; /* istanbul ignore else */
  99217. if (it.createErrors !== false) {
  99218. out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } ';
  99219. if (it.opts.messages !== false) {
  99220. out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' ';
  99221. }
  99222. if (it.opts.verbose) {
  99223. out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  99224. }
  99225. out += ' } ';
  99226. } else {
  99227. out += ' {} ';
  99228. }
  99229. var __err = out;
  99230. out = $$outStack.pop();
  99231. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  99232. if (it.async) {
  99233. out += ' throw new ValidationError([' + (__err) + ']); ';
  99234. } else {
  99235. out += ' validate.errors = [' + (__err) + ']; return false; ';
  99236. }
  99237. } else {
  99238. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  99239. }
  99240. if ($breakOnError) {
  99241. out += ' if (false) { ';
  99242. }
  99243. } else if (it.opts.missingRefs == 'ignore') {
  99244. it.logger.warn($message);
  99245. if ($breakOnError) {
  99246. out += ' if (true) { ';
  99247. }
  99248. } else {
  99249. throw new it.MissingRefError(it.baseId, $schema, $message);
  99250. }
  99251. } else if ($refVal.inline) {
  99252. var $it = it.util.copy(it);
  99253. $it.level++;
  99254. var $nextValid = 'valid' + $it.level;
  99255. $it.schema = $refVal.schema;
  99256. $it.schemaPath = '';
  99257. $it.errSchemaPath = $schema;
  99258. var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code);
  99259. out += ' ' + ($code) + ' ';
  99260. if ($breakOnError) {
  99261. out += ' if (' + ($nextValid) + ') { ';
  99262. }
  99263. } else {
  99264. $async = $refVal.$async === true;
  99265. $refCode = $refVal.code;
  99266. }
  99267. }
  99268. if ($refCode) {
  99269. var $$outStack = $$outStack || [];
  99270. $$outStack.push(out);
  99271. out = '';
  99272. if (it.opts.passContext) {
  99273. out += ' ' + ($refCode) + '.call(this, ';
  99274. } else {
  99275. out += ' ' + ($refCode) + '( ';
  99276. }
  99277. out += ' ' + ($data) + ', (dataPath || \'\')';
  99278. if (it.errorPath != '""') {
  99279. out += ' + ' + (it.errorPath);
  99280. }
  99281. var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
  99282. $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
  99283. out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) ';
  99284. var __callValidate = out;
  99285. out = $$outStack.pop();
  99286. if ($async) {
  99287. if (!it.async) throw new Error('async schema referenced by sync schema');
  99288. if ($breakOnError) {
  99289. out += ' var ' + ($valid) + '; ';
  99290. }
  99291. out += ' try { ' + (it.yieldAwait) + ' ' + (__callValidate) + '; ';
  99292. if ($breakOnError) {
  99293. out += ' ' + ($valid) + ' = true; ';
  99294. }
  99295. out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ';
  99296. if ($breakOnError) {
  99297. out += ' ' + ($valid) + ' = false; ';
  99298. }
  99299. out += ' } ';
  99300. if ($breakOnError) {
  99301. out += ' if (' + ($valid) + ') { ';
  99302. }
  99303. } else {
  99304. out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } ';
  99305. if ($breakOnError) {
  99306. out += ' else { ';
  99307. }
  99308. }
  99309. }
  99310. return out;
  99311. }
  99312. /***/ }),
  99313. /* 729 */
  99314. /***/ (function(module, exports, __webpack_require__) {
  99315. "use strict";
  99316. module.exports = function generate_required(it, $keyword, $ruleType) {
  99317. var out = ' ';
  99318. var $lvl = it.level;
  99319. var $dataLvl = it.dataLevel;
  99320. var $schema = it.schema[$keyword];
  99321. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  99322. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  99323. var $breakOnError = !it.opts.allErrors;
  99324. var $data = 'data' + ($dataLvl || '');
  99325. var $valid = 'valid' + $lvl;
  99326. var $isData = it.opts.$data && $schema && $schema.$data,
  99327. $schemaValue;
  99328. if ($isData) {
  99329. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  99330. $schemaValue = 'schema' + $lvl;
  99331. } else {
  99332. $schemaValue = $schema;
  99333. }
  99334. var $vSchema = 'schema' + $lvl;
  99335. if (!$isData) {
  99336. if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) {
  99337. var $required = [];
  99338. var arr1 = $schema;
  99339. if (arr1) {
  99340. var $property, i1 = -1,
  99341. l1 = arr1.length - 1;
  99342. while (i1 < l1) {
  99343. $property = arr1[i1 += 1];
  99344. var $propertySch = it.schema.properties[$property];
  99345. if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) {
  99346. $required[$required.length] = $property;
  99347. }
  99348. }
  99349. }
  99350. } else {
  99351. var $required = $schema;
  99352. }
  99353. }
  99354. if ($isData || $required.length) {
  99355. var $currentErrorPath = it.errorPath,
  99356. $loopRequired = $isData || $required.length >= it.opts.loopRequired,
  99357. $ownProperties = it.opts.ownProperties;
  99358. if ($breakOnError) {
  99359. out += ' var missing' + ($lvl) + '; ';
  99360. if ($loopRequired) {
  99361. if (!$isData) {
  99362. out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
  99363. }
  99364. var $i = 'i' + $lvl,
  99365. $propertyPath = 'schema' + $lvl + '[' + $i + ']',
  99366. $missingProperty = '\' + ' + $propertyPath + ' + \'';
  99367. if (it.opts._errorDataPathProperty) {
  99368. it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
  99369. }
  99370. out += ' var ' + ($valid) + ' = true; ';
  99371. if ($isData) {
  99372. out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
  99373. }
  99374. out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';
  99375. if ($ownProperties) {
  99376. out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
  99377. }
  99378. out += '; if (!' + ($valid) + ') break; } ';
  99379. if ($isData) {
  99380. out += ' } ';
  99381. }
  99382. out += ' if (!' + ($valid) + ') { ';
  99383. var $$outStack = $$outStack || [];
  99384. $$outStack.push(out);
  99385. out = ''; /* istanbul ignore else */
  99386. if (it.createErrors !== false) {
  99387. out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
  99388. if (it.opts.messages !== false) {
  99389. out += ' , message: \'';
  99390. if (it.opts._errorDataPathProperty) {
  99391. out += 'is a required property';
  99392. } else {
  99393. out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
  99394. }
  99395. out += '\' ';
  99396. }
  99397. if (it.opts.verbose) {
  99398. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  99399. }
  99400. out += ' } ';
  99401. } else {
  99402. out += ' {} ';
  99403. }
  99404. var __err = out;
  99405. out = $$outStack.pop();
  99406. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  99407. if (it.async) {
  99408. out += ' throw new ValidationError([' + (__err) + ']); ';
  99409. } else {
  99410. out += ' validate.errors = [' + (__err) + ']; return false; ';
  99411. }
  99412. } else {
  99413. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  99414. }
  99415. out += ' } else { ';
  99416. } else {
  99417. out += ' if ( ';
  99418. var arr2 = $required;
  99419. if (arr2) {
  99420. var $propertyKey, $i = -1,
  99421. l2 = arr2.length - 1;
  99422. while ($i < l2) {
  99423. $propertyKey = arr2[$i += 1];
  99424. if ($i) {
  99425. out += ' || ';
  99426. }
  99427. var $prop = it.util.getProperty($propertyKey),
  99428. $useData = $data + $prop;
  99429. out += ' ( ( ' + ($useData) + ' === undefined ';
  99430. if ($ownProperties) {
  99431. out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
  99432. }
  99433. out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
  99434. }
  99435. }
  99436. out += ') { ';
  99437. var $propertyPath = 'missing' + $lvl,
  99438. $missingProperty = '\' + ' + $propertyPath + ' + \'';
  99439. if (it.opts._errorDataPathProperty) {
  99440. it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
  99441. }
  99442. var $$outStack = $$outStack || [];
  99443. $$outStack.push(out);
  99444. out = ''; /* istanbul ignore else */
  99445. if (it.createErrors !== false) {
  99446. out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
  99447. if (it.opts.messages !== false) {
  99448. out += ' , message: \'';
  99449. if (it.opts._errorDataPathProperty) {
  99450. out += 'is a required property';
  99451. } else {
  99452. out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
  99453. }
  99454. out += '\' ';
  99455. }
  99456. if (it.opts.verbose) {
  99457. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  99458. }
  99459. out += ' } ';
  99460. } else {
  99461. out += ' {} ';
  99462. }
  99463. var __err = out;
  99464. out = $$outStack.pop();
  99465. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  99466. if (it.async) {
  99467. out += ' throw new ValidationError([' + (__err) + ']); ';
  99468. } else {
  99469. out += ' validate.errors = [' + (__err) + ']; return false; ';
  99470. }
  99471. } else {
  99472. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  99473. }
  99474. out += ' } else { ';
  99475. }
  99476. } else {
  99477. if ($loopRequired) {
  99478. if (!$isData) {
  99479. out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
  99480. }
  99481. var $i = 'i' + $lvl,
  99482. $propertyPath = 'schema' + $lvl + '[' + $i + ']',
  99483. $missingProperty = '\' + ' + $propertyPath + ' + \'';
  99484. if (it.opts._errorDataPathProperty) {
  99485. it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
  99486. }
  99487. if ($isData) {
  99488. out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */
  99489. if (it.createErrors !== false) {
  99490. out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
  99491. if (it.opts.messages !== false) {
  99492. out += ' , message: \'';
  99493. if (it.opts._errorDataPathProperty) {
  99494. out += 'is a required property';
  99495. } else {
  99496. out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
  99497. }
  99498. out += '\' ';
  99499. }
  99500. if (it.opts.verbose) {
  99501. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  99502. }
  99503. out += ' } ';
  99504. } else {
  99505. out += ' {} ';
  99506. }
  99507. out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';
  99508. }
  99509. out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';
  99510. if ($ownProperties) {
  99511. out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
  99512. }
  99513. out += ') { var err = '; /* istanbul ignore else */
  99514. if (it.createErrors !== false) {
  99515. out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
  99516. if (it.opts.messages !== false) {
  99517. out += ' , message: \'';
  99518. if (it.opts._errorDataPathProperty) {
  99519. out += 'is a required property';
  99520. } else {
  99521. out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
  99522. }
  99523. out += '\' ';
  99524. }
  99525. if (it.opts.verbose) {
  99526. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  99527. }
  99528. out += ' } ';
  99529. } else {
  99530. out += ' {} ';
  99531. }
  99532. out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';
  99533. if ($isData) {
  99534. out += ' } ';
  99535. }
  99536. } else {
  99537. var arr3 = $required;
  99538. if (arr3) {
  99539. var $propertyKey, i3 = -1,
  99540. l3 = arr3.length - 1;
  99541. while (i3 < l3) {
  99542. $propertyKey = arr3[i3 += 1];
  99543. var $prop = it.util.getProperty($propertyKey),
  99544. $missingProperty = it.util.escapeQuotes($propertyKey),
  99545. $useData = $data + $prop;
  99546. if (it.opts._errorDataPathProperty) {
  99547. it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
  99548. }
  99549. out += ' if ( ' + ($useData) + ' === undefined ';
  99550. if ($ownProperties) {
  99551. out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
  99552. }
  99553. out += ') { var err = '; /* istanbul ignore else */
  99554. if (it.createErrors !== false) {
  99555. out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
  99556. if (it.opts.messages !== false) {
  99557. out += ' , message: \'';
  99558. if (it.opts._errorDataPathProperty) {
  99559. out += 'is a required property';
  99560. } else {
  99561. out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
  99562. }
  99563. out += '\' ';
  99564. }
  99565. if (it.opts.verbose) {
  99566. out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  99567. }
  99568. out += ' } ';
  99569. } else {
  99570. out += ' {} ';
  99571. }
  99572. out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
  99573. }
  99574. }
  99575. }
  99576. }
  99577. it.errorPath = $currentErrorPath;
  99578. } else if ($breakOnError) {
  99579. out += ' if (true) {';
  99580. }
  99581. return out;
  99582. }
  99583. /***/ }),
  99584. /* 730 */
  99585. /***/ (function(module, exports, __webpack_require__) {
  99586. "use strict";
  99587. module.exports = function generate_uniqueItems(it, $keyword, $ruleType) {
  99588. var out = ' ';
  99589. var $lvl = it.level;
  99590. var $dataLvl = it.dataLevel;
  99591. var $schema = it.schema[$keyword];
  99592. var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  99593. var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  99594. var $breakOnError = !it.opts.allErrors;
  99595. var $data = 'data' + ($dataLvl || '');
  99596. var $valid = 'valid' + $lvl;
  99597. var $isData = it.opts.$data && $schema && $schema.$data,
  99598. $schemaValue;
  99599. if ($isData) {
  99600. out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
  99601. $schemaValue = 'schema' + $lvl;
  99602. } else {
  99603. $schemaValue = $schema;
  99604. }
  99605. if (($schema || $isData) && it.opts.uniqueItems !== false) {
  99606. if ($isData) {
  99607. out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { ';
  99608. }
  99609. out += ' var ' + ($valid) + ' = true; if (' + ($data) + '.length > 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } ';
  99610. if ($isData) {
  99611. out += ' } ';
  99612. }
  99613. out += ' if (!' + ($valid) + ') { ';
  99614. var $$outStack = $$outStack || [];
  99615. $$outStack.push(out);
  99616. out = ''; /* istanbul ignore else */
  99617. if (it.createErrors !== false) {
  99618. out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } ';
  99619. if (it.opts.messages !== false) {
  99620. out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' ';
  99621. }
  99622. if (it.opts.verbose) {
  99623. out += ' , schema: ';
  99624. if ($isData) {
  99625. out += 'validate.schema' + ($schemaPath);
  99626. } else {
  99627. out += '' + ($schema);
  99628. }
  99629. out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  99630. }
  99631. out += ' } ';
  99632. } else {
  99633. out += ' {} ';
  99634. }
  99635. var __err = out;
  99636. out = $$outStack.pop();
  99637. if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  99638. if (it.async) {
  99639. out += ' throw new ValidationError([' + (__err) + ']); ';
  99640. } else {
  99641. out += ' validate.errors = [' + (__err) + ']; return false; ';
  99642. }
  99643. } else {
  99644. out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  99645. }
  99646. out += ' } ';
  99647. if ($breakOnError) {
  99648. out += ' else { ';
  99649. }
  99650. } else {
  99651. if ($breakOnError) {
  99652. out += ' if (true) { ';
  99653. }
  99654. }
  99655. return out;
  99656. }
  99657. /***/ }),
  99658. /* 731 */
  99659. /***/ (function(module, exports, __webpack_require__) {
  99660. "use strict";
  99661. var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;
  99662. var customRuleCode = __webpack_require__(717);
  99663. module.exports = {
  99664. add: addKeyword,
  99665. get: getKeyword,
  99666. remove: removeKeyword
  99667. };
  99668. /**
  99669. * Define custom keyword
  99670. * @this Ajv
  99671. * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords).
  99672. * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.
  99673. * @return {Ajv} this for method chaining
  99674. */
  99675. function addKeyword(keyword, definition) {
  99676. /* jshint validthis: true */
  99677. /* eslint no-shadow: 0 */
  99678. var RULES = this.RULES;
  99679. if (RULES.keywords[keyword])
  99680. throw new Error('Keyword ' + keyword + ' is already defined');
  99681. if (!IDENTIFIER.test(keyword))
  99682. throw new Error('Keyword ' + keyword + ' is not a valid identifier');
  99683. if (definition) {
  99684. if (definition.macro && definition.valid !== undefined)
  99685. throw new Error('"valid" option cannot be used with macro keywords');
  99686. var dataType = definition.type;
  99687. if (Array.isArray(dataType)) {
  99688. var i, len = dataType.length;
  99689. for (i=0; i<len; i++) checkDataType(dataType[i]);
  99690. for (i=0; i<len; i++) _addRule(keyword, dataType[i], definition);
  99691. } else {
  99692. if (dataType) checkDataType(dataType);
  99693. _addRule(keyword, dataType, definition);
  99694. }
  99695. var $data = definition.$data === true && this._opts.$data;
  99696. if ($data && !definition.validate)
  99697. throw new Error('$data support: "validate" function is not defined');
  99698. var metaSchema = definition.metaSchema;
  99699. if (metaSchema) {
  99700. if ($data) {
  99701. metaSchema = {
  99702. anyOf: [
  99703. metaSchema,
  99704. { '$ref': 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#' }
  99705. ]
  99706. };
  99707. }
  99708. definition.validateSchema = this.compile(metaSchema, true);
  99709. }
  99710. }
  99711. RULES.keywords[keyword] = RULES.all[keyword] = true;
  99712. function _addRule(keyword, dataType, definition) {
  99713. var ruleGroup;
  99714. for (var i=0; i<RULES.length; i++) {
  99715. var rg = RULES[i];
  99716. if (rg.type == dataType) {
  99717. ruleGroup = rg;
  99718. break;
  99719. }
  99720. }
  99721. if (!ruleGroup) {
  99722. ruleGroup = { type: dataType, rules: [] };
  99723. RULES.push(ruleGroup);
  99724. }
  99725. var rule = {
  99726. keyword: keyword,
  99727. definition: definition,
  99728. custom: true,
  99729. code: customRuleCode,
  99730. implements: definition.implements
  99731. };
  99732. ruleGroup.rules.push(rule);
  99733. RULES.custom[keyword] = rule;
  99734. }
  99735. function checkDataType(dataType) {
  99736. if (!RULES.types[dataType]) throw new Error('Unknown type ' + dataType);
  99737. }
  99738. return this;
  99739. }
  99740. /**
  99741. * Get keyword
  99742. * @this Ajv
  99743. * @param {String} keyword pre-defined or custom keyword.
  99744. * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise.
  99745. */
  99746. function getKeyword(keyword) {
  99747. /* jshint validthis: true */
  99748. var rule = this.RULES.custom[keyword];
  99749. return rule ? rule.definition : this.RULES.keywords[keyword] || false;
  99750. }
  99751. /**
  99752. * Remove keyword
  99753. * @this Ajv
  99754. * @param {String} keyword pre-defined or custom keyword.
  99755. * @return {Ajv} this for method chaining
  99756. */
  99757. function removeKeyword(keyword) {
  99758. /* jshint validthis: true */
  99759. var RULES = this.RULES;
  99760. delete RULES.keywords[keyword];
  99761. delete RULES.all[keyword];
  99762. delete RULES.custom[keyword];
  99763. for (var i=0; i<RULES.length; i++) {
  99764. var rules = RULES[i].rules;
  99765. for (var j=0; j<rules.length; j++) {
  99766. if (rules[j].keyword == keyword) {
  99767. rules.splice(j, 1);
  99768. break;
  99769. }
  99770. }
  99771. }
  99772. return this;
  99773. }
  99774. /***/ }),
  99775. /* 732 */
  99776. /***/ (function(module, exports, __webpack_require__) {
  99777. "use strict";
  99778. var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema';
  99779. module.exports = function (ajv) {
  99780. var defaultMeta = ajv._opts.defaultMeta;
  99781. var metaSchemaRef = typeof defaultMeta == 'string'
  99782. ? { $ref: defaultMeta }
  99783. : ajv.getSchema(META_SCHEMA_ID)
  99784. ? { $ref: META_SCHEMA_ID }
  99785. : {};
  99786. ajv.addKeyword('patternGroups', {
  99787. // implemented in properties.jst
  99788. metaSchema: {
  99789. type: 'object',
  99790. additionalProperties: {
  99791. type: 'object',
  99792. required: [ 'schema' ],
  99793. properties: {
  99794. maximum: {
  99795. type: 'integer',
  99796. minimum: 0
  99797. },
  99798. minimum: {
  99799. type: 'integer',
  99800. minimum: 0
  99801. },
  99802. schema: metaSchemaRef
  99803. },
  99804. additionalProperties: false
  99805. }
  99806. }
  99807. });
  99808. ajv.RULES.all.properties.implements.push('patternGroups');
  99809. };
  99810. /***/ }),
  99811. /* 733 */
  99812. /***/ (function(module, exports) {
  99813. module.exports = {"$schema":"http://json-schema.org/draft-06/schema#","$id":"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#","description":"Meta-schema for $data reference (JSON-schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}
  99814. /***/ }),
  99815. /* 734 */
  99816. /***/ (function(module, exports) {
  99817. module.exports = {"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}
  99818. /***/ }),
  99819. /* 735 */
  99820. /***/ (function(module, exports, __webpack_require__) {
  99821. "use strict";
  99822. var traverse = module.exports = function (schema, opts, cb) {
  99823. if (typeof opts == 'function') {
  99824. cb = opts;
  99825. opts = {};
  99826. }
  99827. _traverse(opts, cb, schema, '', schema);
  99828. };
  99829. traverse.keywords = {
  99830. additionalItems: true,
  99831. items: true,
  99832. contains: true,
  99833. additionalProperties: true,
  99834. propertyNames: true,
  99835. not: true
  99836. };
  99837. traverse.arrayKeywords = {
  99838. items: true,
  99839. allOf: true,
  99840. anyOf: true,
  99841. oneOf: true
  99842. };
  99843. traverse.propsKeywords = {
  99844. definitions: true,
  99845. properties: true,
  99846. patternProperties: true,
  99847. dependencies: true
  99848. };
  99849. traverse.skipKeywords = {
  99850. enum: true,
  99851. const: true,
  99852. required: true,
  99853. maximum: true,
  99854. minimum: true,
  99855. exclusiveMaximum: true,
  99856. exclusiveMinimum: true,
  99857. multipleOf: true,
  99858. maxLength: true,
  99859. minLength: true,
  99860. pattern: true,
  99861. format: true,
  99862. maxItems: true,
  99863. minItems: true,
  99864. uniqueItems: true,
  99865. maxProperties: true,
  99866. minProperties: true
  99867. };
  99868. function _traverse(opts, cb, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
  99869. if (schema && typeof schema == 'object' && !Array.isArray(schema)) {
  99870. cb(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
  99871. for (var key in schema) {
  99872. var sch = schema[key];
  99873. if (Array.isArray(sch)) {
  99874. if (key in traverse.arrayKeywords) {
  99875. for (var i=0; i<sch.length; i++)
  99876. _traverse(opts, cb, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
  99877. }
  99878. } else if (key in traverse.propsKeywords) {
  99879. if (sch && typeof sch == 'object') {
  99880. for (var prop in sch)
  99881. _traverse(opts, cb, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
  99882. }
  99883. } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
  99884. _traverse(opts, cb, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
  99885. }
  99886. }
  99887. }
  99888. }
  99889. function escapeJsonPtr(str) {
  99890. return str.replace(/~/g, '~0').replace(/\//g, '~1');
  99891. }
  99892. /***/ }),
  99893. /* 736 */
  99894. /***/ (function(module, exports, __webpack_require__) {
  99895. "use strict";
  99896. module.exports = function (flag, argv) {
  99897. argv = argv || process.argv;
  99898. var terminatorPos = argv.indexOf('--');
  99899. var prefix = /^--/.test(flag) ? '' : '--';
  99900. var pos = argv.indexOf(prefix + flag);
  99901. return pos !== -1 && (terminatorPos !== -1 ? pos < terminatorPos : true);
  99902. };
  99903. /***/ }),
  99904. /* 737 */
  99905. /***/ (function(module, exports) {
  99906. function webpackEmptyContext(req) {
  99907. throw new Error("Cannot find module '" + req + "'.");
  99908. }
  99909. webpackEmptyContext.keys = function() { return []; };
  99910. webpackEmptyContext.resolve = webpackEmptyContext;
  99911. module.exports = webpackEmptyContext;
  99912. webpackEmptyContext.id = 737;
  99913. /***/ }),
  99914. /* 738 */
  99915. /***/ (function(module, exports, __webpack_require__) {
  99916. "use strict";
  99917. var pkg = __webpack_require__(739);
  99918. /* @private
  99919. *
  99920. * constructs a set of all dependencies recursively
  99921. *
  99922. * @method depsFor
  99923. * @param {String} name of package to assemble unique deps for
  99924. * @param {String} dir (optional) path to begin resolving from
  99925. * @return {Array} a unique set of all deps
  99926. */
  99927. module.exports = function depsFor(name, dir) {
  99928. var dependencies = [];
  99929. var visited = Object.create(null);
  99930. (function again(name, dir) {
  99931. var thePackage = pkg(name, dir);
  99932. if (thePackage === null) { return; }
  99933. var key = thePackage.name + thePackage.version + thePackage.baseDir;
  99934. if (visited[key]) { return; }
  99935. visited[key] = true;
  99936. dependencies.push(thePackage);
  99937. return Object.keys(thePackage.dependencies || {}).forEach(function(dep) {
  99938. again(dep, thePackage.baseDir);
  99939. });
  99940. }(name, dir));
  99941. return dependencies;
  99942. };
  99943. /***/ }),
  99944. /* 739 */
  99945. /***/ (function(module, exports, __webpack_require__) {
  99946. "use strict";
  99947. var resolvePkg = __webpack_require__(740);
  99948. /* @private
  99949. *
  99950. * given the name of a descendent module this module locates and returns its
  99951. * package.json. In addition, it provides the baseDir.
  99952. *
  99953. * @method pkg
  99954. * @param {String} name
  99955. * @param {String} dir (optional) root directory to begin resolution
  99956. */
  99957. module.exports = function pkg(name, dir) {
  99958. if (name !== './') { name += '/'; }
  99959. var packagePath = resolvePkg(name, dir);
  99960. if (packagePath === null) { return null; }
  99961. var thePackage = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }());
  99962. thePackage.baseDir = packagePath.slice(0, packagePath.length - 12 /* index of `/package.json` */);
  99963. return thePackage;
  99964. };
  99965. /***/ }),
  99966. /* 740 */
  99967. /***/ (function(module, exports, __webpack_require__) {
  99968. "use strict";
  99969. var resolve = __webpack_require__(886);
  99970. var path = __webpack_require__(1);
  99971. /* @private
  99972. *
  99973. * @method resolvePkg
  99974. * @param {String} name
  99975. * @param {String} dir
  99976. * @return {String}
  99977. */
  99978. module.exports = function resolvePkg(name, dir) {
  99979. if (name === './') {
  99980. return path.resolve(name, 'package.json');
  99981. }
  99982. if (name[name.length - 1] !== '/') {
  99983. name += '/';
  99984. }
  99985. if (name.charAt(0) === '/') {
  99986. return name + 'package.json';
  99987. }
  99988. try {
  99989. return resolve.sync(name + 'package.json', {
  99990. basedir: dir || __dirname,
  99991. preserveSymlinks: false
  99992. });
  99993. } catch(err) {
  99994. if (err.code === 'MODULE_NOT_FOUND') {
  99995. return null;
  99996. }
  99997. throw err;
  99998. }
  99999. };
  100000. /***/ }),
  100001. /* 741 */
  100002. /***/ (function(module, exports, __webpack_require__) {
  100003. // Copyright 2015 Joyent, Inc.
  100004. var parser = __webpack_require__(742);
  100005. var signer = __webpack_require__(743);
  100006. var verify = __webpack_require__(744);
  100007. var utils = __webpack_require__(165);
  100008. ///--- API
  100009. module.exports = {
  100010. parse: parser.parseRequest,
  100011. parseRequest: parser.parseRequest,
  100012. sign: signer.signRequest,
  100013. signRequest: signer.signRequest,
  100014. createSigner: signer.createSigner,
  100015. isSigner: signer.isSigner,
  100016. sshKeyToPEM: utils.sshKeyToPEM,
  100017. sshKeyFingerprint: utils.fingerprint,
  100018. pemToRsaSSHKey: utils.pemToRsaSSHKey,
  100019. verify: verify.verifySignature,
  100020. verifySignature: verify.verifySignature,
  100021. verifyHMAC: verify.verifyHMAC
  100022. };
  100023. /***/ }),
  100024. /* 742 */
  100025. /***/ (function(module, exports, __webpack_require__) {
  100026. // Copyright 2012 Joyent, Inc. All rights reserved.
  100027. var assert = __webpack_require__(22);
  100028. var util = __webpack_require__(9);
  100029. var utils = __webpack_require__(165);
  100030. ///--- Globals
  100031. var HASH_ALGOS = utils.HASH_ALGOS;
  100032. var PK_ALGOS = utils.PK_ALGOS;
  100033. var HttpSignatureError = utils.HttpSignatureError;
  100034. var InvalidAlgorithmError = utils.InvalidAlgorithmError;
  100035. var validateAlgorithm = utils.validateAlgorithm;
  100036. var State = {
  100037. New: 0,
  100038. Params: 1
  100039. };
  100040. var ParamsState = {
  100041. Name: 0,
  100042. Quote: 1,
  100043. Value: 2,
  100044. Comma: 3
  100045. };
  100046. ///--- Specific Errors
  100047. function ExpiredRequestError(message) {
  100048. HttpSignatureError.call(this, message, ExpiredRequestError);
  100049. }
  100050. util.inherits(ExpiredRequestError, HttpSignatureError);
  100051. function InvalidHeaderError(message) {
  100052. HttpSignatureError.call(this, message, InvalidHeaderError);
  100053. }
  100054. util.inherits(InvalidHeaderError, HttpSignatureError);
  100055. function InvalidParamsError(message) {
  100056. HttpSignatureError.call(this, message, InvalidParamsError);
  100057. }
  100058. util.inherits(InvalidParamsError, HttpSignatureError);
  100059. function MissingHeaderError(message) {
  100060. HttpSignatureError.call(this, message, MissingHeaderError);
  100061. }
  100062. util.inherits(MissingHeaderError, HttpSignatureError);
  100063. function StrictParsingError(message) {
  100064. HttpSignatureError.call(this, message, StrictParsingError);
  100065. }
  100066. util.inherits(StrictParsingError, HttpSignatureError);
  100067. ///--- Exported API
  100068. module.exports = {
  100069. /**
  100070. * Parses the 'Authorization' header out of an http.ServerRequest object.
  100071. *
  100072. * Note that this API will fully validate the Authorization header, and throw
  100073. * on any error. It will not however check the signature, or the keyId format
  100074. * as those are specific to your environment. You can use the options object
  100075. * to pass in extra constraints.
  100076. *
  100077. * As a response object you can expect this:
  100078. *
  100079. * {
  100080. * "scheme": "Signature",
  100081. * "params": {
  100082. * "keyId": "foo",
  100083. * "algorithm": "rsa-sha256",
  100084. * "headers": [
  100085. * "date" or "x-date",
  100086. * "digest"
  100087. * ],
  100088. * "signature": "base64"
  100089. * },
  100090. * "signingString": "ready to be passed to crypto.verify()"
  100091. * }
  100092. *
  100093. * @param {Object} request an http.ServerRequest.
  100094. * @param {Object} options an optional options object with:
  100095. * - clockSkew: allowed clock skew in seconds (default 300).
  100096. * - headers: required header names (def: date or x-date)
  100097. * - algorithms: algorithms to support (default: all).
  100098. * - strict: should enforce latest spec parsing
  100099. * (default: false).
  100100. * @return {Object} parsed out object (see above).
  100101. * @throws {TypeError} on invalid input.
  100102. * @throws {InvalidHeaderError} on an invalid Authorization header error.
  100103. * @throws {InvalidParamsError} if the params in the scheme are invalid.
  100104. * @throws {MissingHeaderError} if the params indicate a header not present,
  100105. * either in the request headers from the params,
  100106. * or not in the params from a required header
  100107. * in options.
  100108. * @throws {StrictParsingError} if old attributes are used in strict parsing
  100109. * mode.
  100110. * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.
  100111. */
  100112. parseRequest: function parseRequest(request, options) {
  100113. assert.object(request, 'request');
  100114. assert.object(request.headers, 'request.headers');
  100115. if (options === undefined) {
  100116. options = {};
  100117. }
  100118. if (options.headers === undefined) {
  100119. options.headers = [request.headers['x-date'] ? 'x-date' : 'date'];
  100120. }
  100121. assert.object(options, 'options');
  100122. assert.arrayOfString(options.headers, 'options.headers');
  100123. assert.optionalFinite(options.clockSkew, 'options.clockSkew');
  100124. var authzHeaderName = options.authorizationHeaderName || 'authorization';
  100125. if (!request.headers[authzHeaderName]) {
  100126. throw new MissingHeaderError('no ' + authzHeaderName + ' header ' +
  100127. 'present in the request');
  100128. }
  100129. options.clockSkew = options.clockSkew || 300;
  100130. var i = 0;
  100131. var state = State.New;
  100132. var substate = ParamsState.Name;
  100133. var tmpName = '';
  100134. var tmpValue = '';
  100135. var parsed = {
  100136. scheme: '',
  100137. params: {},
  100138. signingString: ''
  100139. };
  100140. var authz = request.headers[authzHeaderName];
  100141. for (i = 0; i < authz.length; i++) {
  100142. var c = authz.charAt(i);
  100143. switch (Number(state)) {
  100144. case State.New:
  100145. if (c !== ' ') parsed.scheme += c;
  100146. else state = State.Params;
  100147. break;
  100148. case State.Params:
  100149. switch (Number(substate)) {
  100150. case ParamsState.Name:
  100151. var code = c.charCodeAt(0);
  100152. // restricted name of A-Z / a-z
  100153. if ((code >= 0x41 && code <= 0x5a) || // A-Z
  100154. (code >= 0x61 && code <= 0x7a)) { // a-z
  100155. tmpName += c;
  100156. } else if (c === '=') {
  100157. if (tmpName.length === 0)
  100158. throw new InvalidHeaderError('bad param format');
  100159. substate = ParamsState.Quote;
  100160. } else {
  100161. throw new InvalidHeaderError('bad param format');
  100162. }
  100163. break;
  100164. case ParamsState.Quote:
  100165. if (c === '"') {
  100166. tmpValue = '';
  100167. substate = ParamsState.Value;
  100168. } else {
  100169. throw new InvalidHeaderError('bad param format');
  100170. }
  100171. break;
  100172. case ParamsState.Value:
  100173. if (c === '"') {
  100174. parsed.params[tmpName] = tmpValue;
  100175. substate = ParamsState.Comma;
  100176. } else {
  100177. tmpValue += c;
  100178. }
  100179. break;
  100180. case ParamsState.Comma:
  100181. if (c === ',') {
  100182. tmpName = '';
  100183. substate = ParamsState.Name;
  100184. } else {
  100185. throw new InvalidHeaderError('bad param format');
  100186. }
  100187. break;
  100188. default:
  100189. throw new Error('Invalid substate');
  100190. }
  100191. break;
  100192. default:
  100193. throw new Error('Invalid substate');
  100194. }
  100195. }
  100196. if (!parsed.params.headers || parsed.params.headers === '') {
  100197. if (request.headers['x-date']) {
  100198. parsed.params.headers = ['x-date'];
  100199. } else {
  100200. parsed.params.headers = ['date'];
  100201. }
  100202. } else {
  100203. parsed.params.headers = parsed.params.headers.split(' ');
  100204. }
  100205. // Minimally validate the parsed object
  100206. if (!parsed.scheme || parsed.scheme !== 'Signature')
  100207. throw new InvalidHeaderError('scheme was not "Signature"');
  100208. if (!parsed.params.keyId)
  100209. throw new InvalidHeaderError('keyId was not specified');
  100210. if (!parsed.params.algorithm)
  100211. throw new InvalidHeaderError('algorithm was not specified');
  100212. if (!parsed.params.signature)
  100213. throw new InvalidHeaderError('signature was not specified');
  100214. // Check the algorithm against the official list
  100215. parsed.params.algorithm = parsed.params.algorithm.toLowerCase();
  100216. try {
  100217. validateAlgorithm(parsed.params.algorithm);
  100218. } catch (e) {
  100219. if (e instanceof InvalidAlgorithmError)
  100220. throw (new InvalidParamsError(parsed.params.algorithm + ' is not ' +
  100221. 'supported'));
  100222. else
  100223. throw (e);
  100224. }
  100225. // Build the signingString
  100226. for (i = 0; i < parsed.params.headers.length; i++) {
  100227. var h = parsed.params.headers[i].toLowerCase();
  100228. parsed.params.headers[i] = h;
  100229. if (h === 'request-line') {
  100230. if (!options.strict) {
  100231. /*
  100232. * We allow headers from the older spec drafts if strict parsing isn't
  100233. * specified in options.
  100234. */
  100235. parsed.signingString +=
  100236. request.method + ' ' + request.url + ' HTTP/' + request.httpVersion;
  100237. } else {
  100238. /* Strict parsing doesn't allow older draft headers. */
  100239. throw (new StrictParsingError('request-line is not a valid header ' +
  100240. 'with strict parsing enabled.'));
  100241. }
  100242. } else if (h === '(request-target)') {
  100243. parsed.signingString +=
  100244. '(request-target): ' + request.method.toLowerCase() + ' ' +
  100245. request.url;
  100246. } else {
  100247. var value = request.headers[h];
  100248. if (value === undefined)
  100249. throw new MissingHeaderError(h + ' was not in the request');
  100250. parsed.signingString += h + ': ' + value;
  100251. }
  100252. if ((i + 1) < parsed.params.headers.length)
  100253. parsed.signingString += '\n';
  100254. }
  100255. // Check against the constraints
  100256. var date;
  100257. if (request.headers.date || request.headers['x-date']) {
  100258. if (request.headers['x-date']) {
  100259. date = new Date(request.headers['x-date']);
  100260. } else {
  100261. date = new Date(request.headers.date);
  100262. }
  100263. var now = new Date();
  100264. var skew = Math.abs(now.getTime() - date.getTime());
  100265. if (skew > options.clockSkew * 1000) {
  100266. throw new ExpiredRequestError('clock skew of ' +
  100267. (skew / 1000) +
  100268. 's was greater than ' +
  100269. options.clockSkew + 's');
  100270. }
  100271. }
  100272. options.headers.forEach(function (hdr) {
  100273. // Remember that we already checked any headers in the params
  100274. // were in the request, so if this passes we're good.
  100275. if (parsed.params.headers.indexOf(hdr.toLowerCase()) < 0)
  100276. throw new MissingHeaderError(hdr + ' was not a signed header');
  100277. });
  100278. if (options.algorithms) {
  100279. if (options.algorithms.indexOf(parsed.params.algorithm) === -1)
  100280. throw new InvalidParamsError(parsed.params.algorithm +
  100281. ' is not a supported algorithm');
  100282. }
  100283. parsed.algorithm = parsed.params.algorithm.toUpperCase();
  100284. parsed.keyId = parsed.params.keyId;
  100285. return parsed;
  100286. }
  100287. };
  100288. /***/ }),
  100289. /* 743 */
  100290. /***/ (function(module, exports, __webpack_require__) {
  100291. // Copyright 2012 Joyent, Inc. All rights reserved.
  100292. var assert = __webpack_require__(22);
  100293. var crypto = __webpack_require__(21);
  100294. var http = __webpack_require__(83);
  100295. var util = __webpack_require__(9);
  100296. var sshpk = __webpack_require__(269);
  100297. var jsprim = __webpack_require__(817);
  100298. var utils = __webpack_require__(165);
  100299. var sprintf = __webpack_require__(9).format;
  100300. var HASH_ALGOS = utils.HASH_ALGOS;
  100301. var PK_ALGOS = utils.PK_ALGOS;
  100302. var InvalidAlgorithmError = utils.InvalidAlgorithmError;
  100303. var HttpSignatureError = utils.HttpSignatureError;
  100304. var validateAlgorithm = utils.validateAlgorithm;
  100305. ///--- Globals
  100306. var AUTHZ_FMT =
  100307. 'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';
  100308. ///--- Specific Errors
  100309. function MissingHeaderError(message) {
  100310. HttpSignatureError.call(this, message, MissingHeaderError);
  100311. }
  100312. util.inherits(MissingHeaderError, HttpSignatureError);
  100313. function StrictParsingError(message) {
  100314. HttpSignatureError.call(this, message, StrictParsingError);
  100315. }
  100316. util.inherits(StrictParsingError, HttpSignatureError);
  100317. /* See createSigner() */
  100318. function RequestSigner(options) {
  100319. assert.object(options, 'options');
  100320. var alg = [];
  100321. if (options.algorithm !== undefined) {
  100322. assert.string(options.algorithm, 'options.algorithm');
  100323. alg = validateAlgorithm(options.algorithm);
  100324. }
  100325. this.rs_alg = alg;
  100326. /*
  100327. * RequestSigners come in two varieties: ones with an rs_signFunc, and ones
  100328. * with an rs_signer.
  100329. *
  100330. * rs_signFunc-based RequestSigners have to build up their entire signing
  100331. * string within the rs_lines array and give it to rs_signFunc as a single
  100332. * concat'd blob. rs_signer-based RequestSigners can add a line at a time to
  100333. * their signing state by using rs_signer.update(), thus only needing to
  100334. * buffer the hash function state and one line at a time.
  100335. */
  100336. if (options.sign !== undefined) {
  100337. assert.func(options.sign, 'options.sign');
  100338. this.rs_signFunc = options.sign;
  100339. } else if (alg[0] === 'hmac' && options.key !== undefined) {
  100340. assert.string(options.keyId, 'options.keyId');
  100341. this.rs_keyId = options.keyId;
  100342. if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key))
  100343. throw (new TypeError('options.key for HMAC must be a string or Buffer'));
  100344. /*
  100345. * Make an rs_signer for HMACs, not a rs_signFunc -- HMACs digest their
  100346. * data in chunks rather than requiring it all to be given in one go
  100347. * at the end, so they are more similar to signers than signFuncs.
  100348. */
  100349. this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options.key);
  100350. this.rs_signer.sign = function () {
  100351. var digest = this.digest('base64');
  100352. return ({
  100353. hashAlgorithm: alg[1],
  100354. toString: function () { return (digest); }
  100355. });
  100356. };
  100357. } else if (options.key !== undefined) {
  100358. var key = options.key;
  100359. if (typeof (key) === 'string' || Buffer.isBuffer(key))
  100360. key = sshpk.parsePrivateKey(key);
  100361. assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]),
  100362. 'options.key must be a sshpk.PrivateKey');
  100363. this.rs_key = key;
  100364. assert.string(options.keyId, 'options.keyId');
  100365. this.rs_keyId = options.keyId;
  100366. if (!PK_ALGOS[key.type]) {
  100367. throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' +
  100368. 'keys are not supported'));
  100369. }
  100370. if (alg[0] !== undefined && key.type !== alg[0]) {
  100371. throw (new InvalidAlgorithmError('options.key must be a ' +
  100372. alg[0].toUpperCase() + ' key, was given a ' +
  100373. key.type.toUpperCase() + ' key instead'));
  100374. }
  100375. this.rs_signer = key.createSign(alg[1]);
  100376. } else {
  100377. throw (new TypeError('options.sign (func) or options.key is required'));
  100378. }
  100379. this.rs_headers = [];
  100380. this.rs_lines = [];
  100381. }
  100382. /**
  100383. * Adds a header to be signed, with its value, into this signer.
  100384. *
  100385. * @param {String} header
  100386. * @param {String} value
  100387. * @return {String} value written
  100388. */
  100389. RequestSigner.prototype.writeHeader = function (header, value) {
  100390. assert.string(header, 'header');
  100391. header = header.toLowerCase();
  100392. assert.string(value, 'value');
  100393. this.rs_headers.push(header);
  100394. if (this.rs_signFunc) {
  100395. this.rs_lines.push(header + ': ' + value);
  100396. } else {
  100397. var line = header + ': ' + value;
  100398. if (this.rs_headers.length > 0)
  100399. line = '\n' + line;
  100400. this.rs_signer.update(line);
  100401. }
  100402. return (value);
  100403. };
  100404. /**
  100405. * Adds a default Date header, returning its value.
  100406. *
  100407. * @return {String}
  100408. */
  100409. RequestSigner.prototype.writeDateHeader = function () {
  100410. return (this.writeHeader('date', jsprim.rfc1123(new Date())));
  100411. };
  100412. /**
  100413. * Adds the request target line to be signed.
  100414. *
  100415. * @param {String} method, HTTP method (e.g. 'get', 'post', 'put')
  100416. * @param {String} path
  100417. */
  100418. RequestSigner.prototype.writeTarget = function (method, path) {
  100419. assert.string(method, 'method');
  100420. assert.string(path, 'path');
  100421. method = method.toLowerCase();
  100422. this.writeHeader('(request-target)', method + ' ' + path);
  100423. };
  100424. /**
  100425. * Calculate the value for the Authorization header on this request
  100426. * asynchronously.
  100427. *
  100428. * @param {Func} callback (err, authz)
  100429. */
  100430. RequestSigner.prototype.sign = function (cb) {
  100431. assert.func(cb, 'callback');
  100432. if (this.rs_headers.length < 1)
  100433. throw (new Error('At least one header must be signed'));
  100434. var alg, authz;
  100435. if (this.rs_signFunc) {
  100436. var data = this.rs_lines.join('\n');
  100437. var self = this;
  100438. this.rs_signFunc(data, function (err, sig) {
  100439. if (err) {
  100440. cb(err);
  100441. return;
  100442. }
  100443. try {
  100444. assert.object(sig, 'signature');
  100445. assert.string(sig.keyId, 'signature.keyId');
  100446. assert.string(sig.algorithm, 'signature.algorithm');
  100447. assert.string(sig.signature, 'signature.signature');
  100448. alg = validateAlgorithm(sig.algorithm);
  100449. authz = sprintf(AUTHZ_FMT,
  100450. sig.keyId,
  100451. sig.algorithm,
  100452. self.rs_headers.join(' '),
  100453. sig.signature);
  100454. } catch (e) {
  100455. cb(e);
  100456. return;
  100457. }
  100458. cb(null, authz);
  100459. });
  100460. } else {
  100461. try {
  100462. var sigObj = this.rs_signer.sign();
  100463. } catch (e) {
  100464. cb(e);
  100465. return;
  100466. }
  100467. alg = (this.rs_alg[0] || this.rs_key.type) + '-' + sigObj.hashAlgorithm;
  100468. var signature = sigObj.toString();
  100469. authz = sprintf(AUTHZ_FMT,
  100470. this.rs_keyId,
  100471. alg,
  100472. this.rs_headers.join(' '),
  100473. signature);
  100474. cb(null, authz);
  100475. }
  100476. };
  100477. ///--- Exported API
  100478. module.exports = {
  100479. /**
  100480. * Identifies whether a given object is a request signer or not.
  100481. *
  100482. * @param {Object} object, the object to identify
  100483. * @returns {Boolean}
  100484. */
  100485. isSigner: function (obj) {
  100486. if (typeof (obj) === 'object' && obj instanceof RequestSigner)
  100487. return (true);
  100488. return (false);
  100489. },
  100490. /**
  100491. * Creates a request signer, used to asynchronously build a signature
  100492. * for a request (does not have to be an http.ClientRequest).
  100493. *
  100494. * @param {Object} options, either:
  100495. * - {String} keyId
  100496. * - {String|Buffer} key
  100497. * - {String} algorithm (optional, required for HMAC)
  100498. * or:
  100499. * - {Func} sign (data, cb)
  100500. * @return {RequestSigner}
  100501. */
  100502. createSigner: function createSigner(options) {
  100503. return (new RequestSigner(options));
  100504. },
  100505. /**
  100506. * Adds an 'Authorization' header to an http.ClientRequest object.
  100507. *
  100508. * Note that this API will add a Date header if it's not already set. Any
  100509. * other headers in the options.headers array MUST be present, or this
  100510. * will throw.
  100511. *
  100512. * You shouldn't need to check the return type; it's just there if you want
  100513. * to be pedantic.
  100514. *
  100515. * The optional flag indicates whether parsing should use strict enforcement
  100516. * of the version draft-cavage-http-signatures-04 of the spec or beyond.
  100517. * The default is to be loose and support
  100518. * older versions for compatibility.
  100519. *
  100520. * @param {Object} request an instance of http.ClientRequest.
  100521. * @param {Object} options signing parameters object:
  100522. * - {String} keyId required.
  100523. * - {String} key required (either a PEM or HMAC key).
  100524. * - {Array} headers optional; defaults to ['date'].
  100525. * - {String} algorithm optional (unless key is HMAC);
  100526. * default is the same as the sshpk default
  100527. * signing algorithm for the type of key given
  100528. * - {String} httpVersion optional; defaults to '1.1'.
  100529. * - {Boolean} strict optional; defaults to 'false'.
  100530. * @return {Boolean} true if Authorization (and optionally Date) were added.
  100531. * @throws {TypeError} on bad parameter types (input).
  100532. * @throws {InvalidAlgorithmError} if algorithm was bad or incompatible with
  100533. * the given key.
  100534. * @throws {sshpk.KeyParseError} if key was bad.
  100535. * @throws {MissingHeaderError} if a header to be signed was specified but
  100536. * was not present.
  100537. */
  100538. signRequest: function signRequest(request, options) {
  100539. assert.object(request, 'request');
  100540. assert.object(options, 'options');
  100541. assert.optionalString(options.algorithm, 'options.algorithm');
  100542. assert.string(options.keyId, 'options.keyId');
  100543. assert.optionalArrayOfString(options.headers, 'options.headers');
  100544. assert.optionalString(options.httpVersion, 'options.httpVersion');
  100545. if (!request.getHeader('Date'))
  100546. request.setHeader('Date', jsprim.rfc1123(new Date()));
  100547. if (!options.headers)
  100548. options.headers = ['date'];
  100549. if (!options.httpVersion)
  100550. options.httpVersion = '1.1';
  100551. var alg = [];
  100552. if (options.algorithm) {
  100553. options.algorithm = options.algorithm.toLowerCase();
  100554. alg = validateAlgorithm(options.algorithm);
  100555. }
  100556. var i;
  100557. var stringToSign = '';
  100558. for (i = 0; i < options.headers.length; i++) {
  100559. if (typeof (options.headers[i]) !== 'string')
  100560. throw new TypeError('options.headers must be an array of Strings');
  100561. var h = options.headers[i].toLowerCase();
  100562. if (h === 'request-line') {
  100563. if (!options.strict) {
  100564. /**
  100565. * We allow headers from the older spec drafts if strict parsing isn't
  100566. * specified in options.
  100567. */
  100568. stringToSign +=
  100569. request.method + ' ' + request.path + ' HTTP/' +
  100570. options.httpVersion;
  100571. } else {
  100572. /* Strict parsing doesn't allow older draft headers. */
  100573. throw (new StrictParsingError('request-line is not a valid header ' +
  100574. 'with strict parsing enabled.'));
  100575. }
  100576. } else if (h === '(request-target)') {
  100577. stringToSign +=
  100578. '(request-target): ' + request.method.toLowerCase() + ' ' +
  100579. request.path;
  100580. } else {
  100581. var value = request.getHeader(h);
  100582. if (value === undefined || value === '') {
  100583. throw new MissingHeaderError(h + ' was not in the request');
  100584. }
  100585. stringToSign += h + ': ' + value;
  100586. }
  100587. if ((i + 1) < options.headers.length)
  100588. stringToSign += '\n';
  100589. }
  100590. /* This is just for unit tests. */
  100591. if (request.hasOwnProperty('_stringToSign')) {
  100592. request._stringToSign = stringToSign;
  100593. }
  100594. var signature;
  100595. if (alg[0] === 'hmac') {
  100596. if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key))
  100597. throw (new TypeError('options.key must be a string or Buffer'));
  100598. var hmac = crypto.createHmac(alg[1].toUpperCase(), options.key);
  100599. hmac.update(stringToSign);
  100600. signature = hmac.digest('base64');
  100601. } else {
  100602. var key = options.key;
  100603. if (typeof (key) === 'string' || Buffer.isBuffer(key))
  100604. key = sshpk.parsePrivateKey(options.key);
  100605. assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]),
  100606. 'options.key must be a sshpk.PrivateKey');
  100607. if (!PK_ALGOS[key.type]) {
  100608. throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' +
  100609. 'keys are not supported'));
  100610. }
  100611. if (alg[0] !== undefined && key.type !== alg[0]) {
  100612. throw (new InvalidAlgorithmError('options.key must be a ' +
  100613. alg[0].toUpperCase() + ' key, was given a ' +
  100614. key.type.toUpperCase() + ' key instead'));
  100615. }
  100616. var signer = key.createSign(alg[1]);
  100617. signer.update(stringToSign);
  100618. var sigObj = signer.sign();
  100619. if (!HASH_ALGOS[sigObj.hashAlgorithm]) {
  100620. throw (new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase() +
  100621. ' is not a supported hash algorithm'));
  100622. }
  100623. options.algorithm = key.type + '-' + sigObj.hashAlgorithm;
  100624. signature = sigObj.toString();
  100625. assert.notStrictEqual(signature, '', 'empty signature produced');
  100626. }
  100627. var authzHeaderName = options.authorizationHeaderName || 'Authorization';
  100628. request.setHeader(authzHeaderName, sprintf(AUTHZ_FMT,
  100629. options.keyId,
  100630. options.algorithm,
  100631. options.headers.join(' '),
  100632. signature));
  100633. return true;
  100634. }
  100635. };
  100636. /***/ }),
  100637. /* 744 */
  100638. /***/ (function(module, exports, __webpack_require__) {
  100639. // Copyright 2015 Joyent, Inc.
  100640. var assert = __webpack_require__(22);
  100641. var crypto = __webpack_require__(21);
  100642. var sshpk = __webpack_require__(269);
  100643. var utils = __webpack_require__(165);
  100644. var HASH_ALGOS = utils.HASH_ALGOS;
  100645. var PK_ALGOS = utils.PK_ALGOS;
  100646. var InvalidAlgorithmError = utils.InvalidAlgorithmError;
  100647. var HttpSignatureError = utils.HttpSignatureError;
  100648. var validateAlgorithm = utils.validateAlgorithm;
  100649. ///--- Exported API
  100650. module.exports = {
  100651. /**
  100652. * Verify RSA/DSA signature against public key. You are expected to pass in
  100653. * an object that was returned from `parse()`.
  100654. *
  100655. * @param {Object} parsedSignature the object you got from `parse`.
  100656. * @param {String} pubkey RSA/DSA private key PEM.
  100657. * @return {Boolean} true if valid, false otherwise.
  100658. * @throws {TypeError} if you pass in bad arguments.
  100659. * @throws {InvalidAlgorithmError}
  100660. */
  100661. verifySignature: function verifySignature(parsedSignature, pubkey) {
  100662. assert.object(parsedSignature, 'parsedSignature');
  100663. if (typeof (pubkey) === 'string' || Buffer.isBuffer(pubkey))
  100664. pubkey = sshpk.parseKey(pubkey);
  100665. assert.ok(sshpk.Key.isKey(pubkey, [1, 1]), 'pubkey must be a sshpk.Key');
  100666. var alg = validateAlgorithm(parsedSignature.algorithm);
  100667. if (alg[0] === 'hmac' || alg[0] !== pubkey.type)
  100668. return (false);
  100669. var v = pubkey.createVerify(alg[1]);
  100670. v.update(parsedSignature.signingString);
  100671. return (v.verify(parsedSignature.params.signature, 'base64'));
  100672. },
  100673. /**
  100674. * Verify HMAC against shared secret. You are expected to pass in an object
  100675. * that was returned from `parse()`.
  100676. *
  100677. * @param {Object} parsedSignature the object you got from `parse`.
  100678. * @param {String} secret HMAC shared secret.
  100679. * @return {Boolean} true if valid, false otherwise.
  100680. * @throws {TypeError} if you pass in bad arguments.
  100681. * @throws {InvalidAlgorithmError}
  100682. */
  100683. verifyHMAC: function verifyHMAC(parsedSignature, secret) {
  100684. assert.object(parsedSignature, 'parsedHMAC');
  100685. assert.string(secret, 'secret');
  100686. var alg = validateAlgorithm(parsedSignature.algorithm);
  100687. if (alg[0] !== 'hmac')
  100688. return (false);
  100689. var hashAlg = alg[1].toUpperCase();
  100690. var hmac = crypto.createHmac(hashAlg, secret);
  100691. hmac.update(parsedSignature.signingString);
  100692. /*
  100693. * Now double-hash to avoid leaking timing information - there's
  100694. * no easy constant-time compare in JS, so we use this approach
  100695. * instead. See for more info:
  100696. * https://www.isecpartners.com/blog/2011/february/double-hmac-
  100697. * verification.aspx
  100698. */
  100699. var h1 = crypto.createHmac(hashAlg, secret);
  100700. h1.update(hmac.digest());
  100701. h1 = h1.digest();
  100702. var h2 = crypto.createHmac(hashAlg, secret);
  100703. h2.update(new Buffer(parsedSignature.params.signature, 'base64'));
  100704. h2 = h2.digest();
  100705. /* Node 0.8 returns strings from .digest(). */
  100706. if (typeof (h1) === 'string')
  100707. return (h1 === h2);
  100708. /* And node 0.10 lacks the .equals() method on Buffers. */
  100709. if (Buffer.isBuffer(h1) && !h1.equals)
  100710. return (h1.toString('binary') === h2.toString('binary'));
  100711. return (h1.equals(h2));
  100712. }
  100713. };
  100714. /***/ }),
  100715. /* 745 */
  100716. /***/ (function(module, exports, __webpack_require__) {
  100717. var wrappy = __webpack_require__(436)
  100718. var reqs = Object.create(null)
  100719. var once = __webpack_require__(134)
  100720. module.exports = wrappy(inflight)
  100721. function inflight (key, cb) {
  100722. if (reqs[key]) {
  100723. reqs[key].push(cb)
  100724. return null
  100725. } else {
  100726. reqs[key] = [cb]
  100727. return makeres(key)
  100728. }
  100729. }
  100730. function makeres (key) {
  100731. return once(function RES () {
  100732. var cbs = reqs[key]
  100733. var len = cbs.length
  100734. var args = slice(arguments)
  100735. // XXX It's somewhat ambiguous whether a new callback added in this
  100736. // pass should be queued for later execution if something in the
  100737. // list of callbacks throws, or if it should just be discarded.
  100738. // However, it's such an edge case that it hardly matters, and either
  100739. // choice is likely as surprising as the other.
  100740. // As it happens, we do go ahead and schedule it for later execution.
  100741. try {
  100742. for (var i = 0; i < len; i++) {
  100743. cbs[i].apply(null, args)
  100744. }
  100745. } finally {
  100746. if (cbs.length > len) {
  100747. // added more in the interim.
  100748. // de-zalgo, just in case, but don't call again.
  100749. cbs.splice(0, len)
  100750. process.nextTick(function () {
  100751. RES.apply(null, args)
  100752. })
  100753. } else {
  100754. delete reqs[key]
  100755. }
  100756. }
  100757. })
  100758. }
  100759. function slice (args) {
  100760. var length = args.length
  100761. var array = []
  100762. for (var i = 0; i < length; i++) array[i] = args[i]
  100763. return array
  100764. }
  100765. /***/ }),
  100766. /* 746 */
  100767. /***/ (function(module, exports) {
  100768. if (typeof Object.create === 'function') {
  100769. // implementation from standard node.js 'util' module
  100770. module.exports = function inherits(ctor, superCtor) {
  100771. ctor.super_ = superCtor
  100772. ctor.prototype = Object.create(superCtor.prototype, {
  100773. constructor: {
  100774. value: ctor,
  100775. enumerable: false,
  100776. writable: true,
  100777. configurable: true
  100778. }
  100779. });
  100780. };
  100781. } else {
  100782. // old school shim for old browsers
  100783. module.exports = function inherits(ctor, superCtor) {
  100784. ctor.super_ = superCtor
  100785. var TempCtor = function () {}
  100786. TempCtor.prototype = superCtor.prototype
  100787. ctor.prototype = new TempCtor()
  100788. ctor.prototype.constructor = ctor
  100789. }
  100790. }
  100791. /***/ }),
  100792. /* 747 */
  100793. /***/ (function(module, exports) {
  100794. exports.parse = exports.decode = decode
  100795. exports.stringify = exports.encode = encode
  100796. exports.safe = safe
  100797. exports.unsafe = unsafe
  100798. var eol = typeof process !== 'undefined' &&
  100799. process.platform === 'win32' ? '\r\n' : '\n'
  100800. function encode (obj, opt) {
  100801. var children = []
  100802. var out = ''
  100803. if (typeof opt === 'string') {
  100804. opt = {
  100805. section: opt,
  100806. whitespace: false
  100807. }
  100808. } else {
  100809. opt = opt || {}
  100810. opt.whitespace = opt.whitespace === true
  100811. }
  100812. var separator = opt.whitespace ? ' = ' : '='
  100813. Object.keys(obj).forEach(function (k, _, __) {
  100814. var val = obj[k]
  100815. if (val && Array.isArray(val)) {
  100816. val.forEach(function (item) {
  100817. out += safe(k + '[]') + separator + safe(item) + '\n'
  100818. })
  100819. } else if (val && typeof val === 'object') {
  100820. children.push(k)
  100821. } else {
  100822. out += safe(k) + separator + safe(val) + eol
  100823. }
  100824. })
  100825. if (opt.section && out.length) {
  100826. out = '[' + safe(opt.section) + ']' + eol + out
  100827. }
  100828. children.forEach(function (k, _, __) {
  100829. var nk = dotSplit(k).join('\\.')
  100830. var section = (opt.section ? opt.section + '.' : '') + nk
  100831. var child = encode(obj[k], {
  100832. section: section,
  100833. whitespace: opt.whitespace
  100834. })
  100835. if (out.length && child.length) {
  100836. out += eol
  100837. }
  100838. out += child
  100839. })
  100840. return out
  100841. }
  100842. function dotSplit (str) {
  100843. return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002')
  100844. .replace(/\\\./g, '\u0001')
  100845. .split(/\./).map(function (part) {
  100846. return part.replace(/\1/g, '\\.')
  100847. .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001')
  100848. })
  100849. }
  100850. function decode (str) {
  100851. var out = {}
  100852. var p = out
  100853. var section = null
  100854. // section |key = value
  100855. var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i
  100856. var lines = str.split(/[\r\n]+/g)
  100857. lines.forEach(function (line, _, __) {
  100858. if (!line || line.match(/^\s*[;#]/)) return
  100859. var match = line.match(re)
  100860. if (!match) return
  100861. if (match[1] !== undefined) {
  100862. section = unsafe(match[1])
  100863. p = out[section] = out[section] || {}
  100864. return
  100865. }
  100866. var key = unsafe(match[2])
  100867. var value = match[3] ? unsafe(match[4]) : true
  100868. switch (value) {
  100869. case 'true':
  100870. case 'false':
  100871. case 'null': value = JSON.parse(value)
  100872. }
  100873. // Convert keys with '[]' suffix to an array
  100874. if (key.length > 2 && key.slice(-2) === '[]') {
  100875. key = key.substring(0, key.length - 2)
  100876. if (!p[key]) {
  100877. p[key] = []
  100878. } else if (!Array.isArray(p[key])) {
  100879. p[key] = [p[key]]
  100880. }
  100881. }
  100882. // safeguard against resetting a previously defined
  100883. // array by accidentally forgetting the brackets
  100884. if (Array.isArray(p[key])) {
  100885. p[key].push(value)
  100886. } else {
  100887. p[key] = value
  100888. }
  100889. })
  100890. // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}}
  100891. // use a filter to return the keys that have to be deleted.
  100892. Object.keys(out).filter(function (k, _, __) {
  100893. if (!out[k] ||
  100894. typeof out[k] !== 'object' ||
  100895. Array.isArray(out[k])) {
  100896. return false
  100897. }
  100898. // see if the parent section is also an object.
  100899. // if so, add it to that, and mark this one for deletion
  100900. var parts = dotSplit(k)
  100901. var p = out
  100902. var l = parts.pop()
  100903. var nl = l.replace(/\\\./g, '.')
  100904. parts.forEach(function (part, _, __) {
  100905. if (!p[part] || typeof p[part] !== 'object') p[part] = {}
  100906. p = p[part]
  100907. })
  100908. if (p === out && nl === l) {
  100909. return false
  100910. }
  100911. p[nl] = out[k]
  100912. return true
  100913. }).forEach(function (del, _, __) {
  100914. delete out[del]
  100915. })
  100916. return out
  100917. }
  100918. function isQuoted (val) {
  100919. return (val.charAt(0) === '"' && val.slice(-1) === '"') ||
  100920. (val.charAt(0) === "'" && val.slice(-1) === "'")
  100921. }
  100922. function safe (val) {
  100923. return (typeof val !== 'string' ||
  100924. val.match(/[=\r\n]/) ||
  100925. val.match(/^\[/) ||
  100926. (val.length > 1 &&
  100927. isQuoted(val)) ||
  100928. val !== val.trim())
  100929. ? JSON.stringify(val)
  100930. : val.replace(/;/g, '\\;').replace(/#/g, '\\#')
  100931. }
  100932. function unsafe (val, doUnesc) {
  100933. val = (val || '').trim()
  100934. if (isQuoted(val)) {
  100935. // remove the single quotes before calling JSON.parse
  100936. if (val.charAt(0) === "'") {
  100937. val = val.substr(1, val.length - 2)
  100938. }
  100939. try { val = JSON.parse(val) } catch (_) {}
  100940. } else {
  100941. // walk the val to find the first not-escaped ; character
  100942. var esc = false
  100943. var unesc = ''
  100944. for (var i = 0, l = val.length; i < l; i++) {
  100945. var c = val.charAt(i)
  100946. if (esc) {
  100947. if ('\\;#'.indexOf(c) !== -1) {
  100948. unesc += c
  100949. } else {
  100950. unesc += '\\' + c
  100951. }
  100952. esc = false
  100953. } else if (';#'.indexOf(c) !== -1) {
  100954. break
  100955. } else if (c === '\\') {
  100956. esc = true
  100957. } else {
  100958. unesc += c
  100959. }
  100960. }
  100961. if (esc) {
  100962. unesc += '\\'
  100963. }
  100964. return unesc.trim()
  100965. }
  100966. return val
  100967. }
  100968. /***/ }),
  100969. /* 748 */
  100970. /***/ (function(module, exports, __webpack_require__) {
  100971. var util = __webpack_require__(9),
  100972. Match = __webpack_require__ (131);
  100973. /**
  100974. * This is a superclass for the individual detectors for
  100975. * each of the detectable members of the ISO 2022 family
  100976. * of encodings.
  100977. */
  100978. function ISO_2022() {}
  100979. ISO_2022.prototype.match = function(det) {
  100980. /**
  100981. * Matching function shared among the 2022 detectors JP, CN and KR
  100982. * Counts up the number of legal an unrecognized escape sequences in
  100983. * the sample of text, and computes a score based on the total number &
  100984. * the proportion that fit the encoding.
  100985. *
  100986. *
  100987. * @param text the byte buffer containing text to analyse
  100988. * @param textLen the size of the text in the byte.
  100989. * @param escapeSequences the byte escape sequences to test for.
  100990. * @return match quality, in the range of 0-100.
  100991. */
  100992. var i, j;
  100993. var escN;
  100994. var hits = 0;
  100995. var misses = 0;
  100996. var shifts = 0;
  100997. var quality;
  100998. // TODO: refactor me
  100999. var text = det.fInputBytes;
  101000. var textLen = det.fInputLen;
  101001. scanInput:
  101002. for (i = 0; i < textLen; i++) {
  101003. if (text[i] == 0x1b) {
  101004. checkEscapes:
  101005. for (escN = 0; escN < this.escapeSequences.length; escN++) {
  101006. var seq = this.escapeSequences[escN];
  101007. if ((textLen - i) < seq.length)
  101008. continue checkEscapes;
  101009. for (j = 1; j < seq.length; j++)
  101010. if (seq[j] != text[i + j])
  101011. continue checkEscapes;
  101012. hits++;
  101013. i += seq.length - 1;
  101014. continue scanInput;
  101015. }
  101016. misses++;
  101017. }
  101018. // Shift in/out
  101019. if (text[i] == 0x0e || text[i] == 0x0f)
  101020. shifts++;
  101021. }
  101022. if (hits == 0)
  101023. return null;
  101024. //
  101025. // Initial quality is based on relative proportion of recongized vs.
  101026. // unrecognized escape sequences.
  101027. // All good: quality = 100;
  101028. // half or less good: quality = 0;
  101029. // linear inbetween.
  101030. quality = (100 * hits - 100 * misses) / (hits + misses);
  101031. // Back off quality if there were too few escape sequences seen.
  101032. // Include shifts in this computation, so that KR does not get penalized
  101033. // for having only a single Escape sequence, but many shifts.
  101034. if (hits + shifts < 5)
  101035. quality -= (5 - (hits + shifts)) * 10;
  101036. return quality <= 0 ? null : new Match(det, this, quality);
  101037. };
  101038. module.exports.ISO_2022_JP = function() {
  101039. this.name = function() {
  101040. return 'ISO-2022-JP';
  101041. };
  101042. this.escapeSequences = [
  101043. [ 0x1b, 0x24, 0x28, 0x43 ], // KS X 1001:1992
  101044. [ 0x1b, 0x24, 0x28, 0x44 ], // JIS X 212-1990
  101045. [ 0x1b, 0x24, 0x40 ], // JIS C 6226-1978
  101046. [ 0x1b, 0x24, 0x41 ], // GB 2312-80
  101047. [ 0x1b, 0x24, 0x42 ], // JIS X 208-1983
  101048. [ 0x1b, 0x26, 0x40 ], // JIS X 208 1990, 1997
  101049. [ 0x1b, 0x28, 0x42 ], // ASCII
  101050. [ 0x1b, 0x28, 0x48 ], // JIS-Roman
  101051. [ 0x1b, 0x28, 0x49 ], // Half-width katakana
  101052. [ 0x1b, 0x28, 0x4a ], // JIS-Roman
  101053. [ 0x1b, 0x2e, 0x41 ], // ISO 8859-1
  101054. [ 0x1b, 0x2e, 0x46 ] // ISO 8859-7
  101055. ];
  101056. };
  101057. util.inherits(module.exports.ISO_2022_JP, ISO_2022);
  101058. module.exports.ISO_2022_KR = function() {
  101059. this.name = function() {
  101060. return 'ISO-2022-KR';
  101061. };
  101062. this.escapeSequences = [
  101063. [ 0x1b, 0x24, 0x29, 0x43 ]
  101064. ];
  101065. };
  101066. util.inherits(module.exports.ISO_2022_KR, ISO_2022);
  101067. module.exports.ISO_2022_CN = function() {
  101068. this.name = function() {
  101069. return 'ISO-2022-CN';
  101070. };
  101071. this.escapeSequences = [
  101072. [ 0x1b, 0x24, 0x29, 0x41 ], // GB 2312-80
  101073. [ 0x1b, 0x24, 0x29, 0x47 ], // CNS 11643-1992 Plane 1
  101074. [ 0x1b, 0x24, 0x2A, 0x48 ], // CNS 11643-1992 Plane 2
  101075. [ 0x1b, 0x24, 0x29, 0x45 ], // ISO-IR-165
  101076. [ 0x1b, 0x24, 0x2B, 0x49 ], // CNS 11643-1992 Plane 3
  101077. [ 0x1b, 0x24, 0x2B, 0x4A ], // CNS 11643-1992 Plane 4
  101078. [ 0x1b, 0x24, 0x2B, 0x4B ], // CNS 11643-1992 Plane 5
  101079. [ 0x1b, 0x24, 0x2B, 0x4C ], // CNS 11643-1992 Plane 6
  101080. [ 0x1b, 0x24, 0x2B, 0x4D ], // CNS 11643-1992 Plane 7
  101081. [ 0x1b, 0x4e ], // SS2
  101082. [ 0x1b, 0x4f ] // SS3
  101083. ];
  101084. };
  101085. util.inherits(module.exports.ISO_2022_CN, ISO_2022);
  101086. /***/ }),
  101087. /* 749 */
  101088. /***/ (function(module, exports, __webpack_require__) {
  101089. var util = __webpack_require__(9),
  101090. Match = __webpack_require__ (131);
  101091. /**
  101092. * Binary search implementation (recursive)
  101093. */
  101094. function binarySearch(arr, searchValue) {
  101095. function find(arr, searchValue, left, right) {
  101096. if (right < left)
  101097. return -1;
  101098. /*
  101099. int mid = mid = (left + right) / 2;
  101100. There is a bug in the above line;
  101101. Joshua Bloch suggests the following replacement:
  101102. */
  101103. var mid = Math.floor((left + right) >>> 1);
  101104. if (searchValue > arr[mid])
  101105. return find(arr, searchValue, mid + 1, right);
  101106. if (searchValue < arr[mid])
  101107. return find(arr, searchValue, left, mid - 1);
  101108. return mid;
  101109. };
  101110. return find(arr, searchValue, 0, arr.length - 1);
  101111. };
  101112. // 'Character' iterated character class.
  101113. // Recognizers for specific mbcs encodings make their 'characters' available
  101114. // by providing a nextChar() function that fills in an instance of iteratedChar
  101115. // with the next char from the input.
  101116. // The returned characters are not converted to Unicode, but remain as the raw
  101117. // bytes (concatenated into an int) from the codepage data.
  101118. //
  101119. // For Asian charsets, use the raw input rather than the input that has been
  101120. // stripped of markup. Detection only considers multi-byte chars, effectively
  101121. // stripping markup anyway, and double byte chars do occur in markup too.
  101122. //
  101123. function IteratedChar() {
  101124. this.charValue = 0; // 1-4 bytes from the raw input data
  101125. this.index = 0;
  101126. this.nextIndex = 0;
  101127. this.error = false;
  101128. this.done = false;
  101129. this.reset = function() {
  101130. this.charValue = 0;
  101131. this.index = -1;
  101132. this.nextIndex = 0;
  101133. this.error = false;
  101134. this.done = false;
  101135. };
  101136. this.nextByte = function(det) {
  101137. if (this.nextIndex >= det.fRawLength) {
  101138. this.done = true;
  101139. return -1;
  101140. }
  101141. var byteValue = det.fRawInput[this.nextIndex++] & 0x00ff;
  101142. return byteValue;
  101143. };
  101144. };
  101145. /**
  101146. * Asian double or multi-byte - charsets.
  101147. * Match is determined mostly by the input data adhering to the
  101148. * encoding scheme for the charset, and, optionally,
  101149. * frequency-of-occurence of characters.
  101150. */
  101151. function mbcs() {};
  101152. /**
  101153. * Test the match of this charset with the input text data
  101154. * which is obtained via the CharsetDetector object.
  101155. *
  101156. * @param det The CharsetDetector, which contains the input text
  101157. * to be checked for being in this charset.
  101158. * @return Two values packed into one int (Damn java, anyhow)
  101159. * bits 0-7: the match confidence, ranging from 0-100
  101160. * bits 8-15: The match reason, an enum-like value.
  101161. */
  101162. mbcs.prototype.match = function(det) {
  101163. var singleByteCharCount = 0, //TODO Do we really need this?
  101164. doubleByteCharCount = 0,
  101165. commonCharCount = 0,
  101166. badCharCount = 0,
  101167. totalCharCount = 0,
  101168. confidence = 0;
  101169. var iter = new IteratedChar();
  101170. detectBlock: {
  101171. for (iter.reset(); this.nextChar(iter, det);) {
  101172. totalCharCount++;
  101173. if (iter.error) {
  101174. badCharCount++;
  101175. } else {
  101176. var cv = iter.charValue & 0xFFFFFFFF;
  101177. if (cv <= 0xff) {
  101178. singleByteCharCount++;
  101179. } else {
  101180. doubleByteCharCount++;
  101181. if (this.commonChars != null) {
  101182. // NOTE: This assumes that there are no 4-byte common chars.
  101183. if (binarySearch(this.commonChars, cv) >= 0) {
  101184. commonCharCount++;
  101185. }
  101186. }
  101187. }
  101188. }
  101189. if (badCharCount >= 2 && badCharCount * 5 >= doubleByteCharCount) {
  101190. // console.log('its here!')
  101191. // Bail out early if the byte data is not matching the encoding scheme.
  101192. break detectBlock;
  101193. }
  101194. }
  101195. if (doubleByteCharCount <= 10 && badCharCount== 0) {
  101196. // Not many multi-byte chars.
  101197. if (doubleByteCharCount == 0 && totalCharCount < 10) {
  101198. // There weren't any multibyte sequences, and there was a low density of non-ASCII single bytes.
  101199. // We don't have enough data to have any confidence.
  101200. // Statistical analysis of single byte non-ASCII charcters would probably help here.
  101201. confidence = 0;
  101202. }
  101203. else {
  101204. // ASCII or ISO file? It's probably not our encoding,
  101205. // but is not incompatible with our encoding, so don't give it a zero.
  101206. confidence = 10;
  101207. }
  101208. break detectBlock;
  101209. }
  101210. //
  101211. // No match if there are too many characters that don't fit the encoding scheme.
  101212. // (should we have zero tolerance for these?)
  101213. //
  101214. if (doubleByteCharCount < 20 * badCharCount) {
  101215. confidence = 0;
  101216. break detectBlock;
  101217. }
  101218. if (this.commonChars == null) {
  101219. // We have no statistics on frequently occuring characters.
  101220. // Assess confidence purely on having a reasonable number of
  101221. // multi-byte characters (the more the better
  101222. confidence = 30 + doubleByteCharCount - 20 * badCharCount;
  101223. if (confidence > 100) {
  101224. confidence = 100;
  101225. }
  101226. } else {
  101227. //
  101228. // Frequency of occurence statistics exist.
  101229. //
  101230. var maxVal = Math.log(parseFloat(doubleByteCharCount) / 4);
  101231. var scaleFactor = 90.0 / maxVal;
  101232. confidence = Math.floor(Math.log(commonCharCount + 1) * scaleFactor + 10);
  101233. confidence = Math.min(confidence, 100);
  101234. }
  101235. } // end of detectBlock:
  101236. return confidence == 0 ? null : new Match(det, this, confidence);
  101237. };
  101238. /**
  101239. * Get the next character (however many bytes it is) from the input data
  101240. * Subclasses for specific charset encodings must implement this function
  101241. * to get characters according to the rules of their encoding scheme.
  101242. *
  101243. * This function is not a method of class iteratedChar only because
  101244. * that would require a lot of extra derived classes, which is awkward.
  101245. * @param it The iteratedChar 'struct' into which the returned char is placed.
  101246. * @param det The charset detector, which is needed to get at the input byte data
  101247. * being iterated over.
  101248. * @return True if a character was returned, false at end of input.
  101249. */
  101250. mbcs.prototype.nextChar = function(iter, det) {};
  101251. /**
  101252. * Shift-JIS charset recognizer.
  101253. */
  101254. module.exports.sjis = function() {
  101255. this.name = function() {
  101256. return 'Shift-JIS';
  101257. };
  101258. this.language = function() {
  101259. return 'ja';
  101260. };
  101261. // TODO: This set of data comes from the character frequency-
  101262. // of-occurence analysis tool. The data needs to be moved
  101263. // into a resource and loaded from there.
  101264. this.commonChars = [
  101265. 0x8140, 0x8141, 0x8142, 0x8145, 0x815b, 0x8169, 0x816a, 0x8175, 0x8176, 0x82a0,
  101266. 0x82a2, 0x82a4, 0x82a9, 0x82aa, 0x82ab, 0x82ad, 0x82af, 0x82b1, 0x82b3, 0x82b5,
  101267. 0x82b7, 0x82bd, 0x82be, 0x82c1, 0x82c4, 0x82c5, 0x82c6, 0x82c8, 0x82c9, 0x82cc,
  101268. 0x82cd, 0x82dc, 0x82e0, 0x82e7, 0x82e8, 0x82e9, 0x82ea, 0x82f0, 0x82f1, 0x8341,
  101269. 0x8343, 0x834e, 0x834f, 0x8358, 0x835e, 0x8362, 0x8367, 0x8375, 0x8376, 0x8389,
  101270. 0x838a, 0x838b, 0x838d, 0x8393, 0x8e96, 0x93fa, 0x95aa
  101271. ];
  101272. this.nextChar = function(iter, det) {
  101273. iter.index = iter.nextIndex;
  101274. iter.error = false;
  101275. var firstByte;
  101276. firstByte = iter.charValue = iter.nextByte(det);
  101277. if (firstByte < 0)
  101278. return false;
  101279. if (firstByte <= 0x7f || (firstByte > 0xa0 && firstByte <= 0xdf))
  101280. return true;
  101281. var secondByte = iter.nextByte(det);
  101282. if (secondByte < 0)
  101283. return false;
  101284. iter.charValue = (firstByte << 8) | secondByte;
  101285. if (! ((secondByte >= 0x40 && secondByte <= 0x7f) || (secondByte >= 0x80 && secondByte <= 0xff))) {
  101286. // Illegal second byte value.
  101287. iter.error = true;
  101288. }
  101289. return true;
  101290. };
  101291. };
  101292. util.inherits(module.exports.sjis, mbcs);
  101293. /**
  101294. * Big5 charset recognizer.
  101295. */
  101296. module.exports.big5 = function() {
  101297. this.name = function() {
  101298. return 'Big5';
  101299. };
  101300. this.language = function() {
  101301. return 'zh';
  101302. };
  101303. // TODO: This set of data comes from the character frequency-
  101304. // of-occurence analysis tool. The data needs to be moved
  101305. // into a resource and loaded from there.
  101306. this.commonChars = [
  101307. 0xa140, 0xa141, 0xa142, 0xa143, 0xa147, 0xa149, 0xa175, 0xa176, 0xa440, 0xa446,
  101308. 0xa447, 0xa448, 0xa451, 0xa454, 0xa457, 0xa464, 0xa46a, 0xa46c, 0xa477, 0xa4a3,
  101309. 0xa4a4, 0xa4a7, 0xa4c1, 0xa4ce, 0xa4d1, 0xa4df, 0xa4e8, 0xa4fd, 0xa540, 0xa548,
  101310. 0xa558, 0xa569, 0xa5cd, 0xa5e7, 0xa657, 0xa661, 0xa662, 0xa668, 0xa670, 0xa6a8,
  101311. 0xa6b3, 0xa6b9, 0xa6d3, 0xa6db, 0xa6e6, 0xa6f2, 0xa740, 0xa751, 0xa759, 0xa7da,
  101312. 0xa8a3, 0xa8a5, 0xa8ad, 0xa8d1, 0xa8d3, 0xa8e4, 0xa8fc, 0xa9c0, 0xa9d2, 0xa9f3,
  101313. 0xaa6b, 0xaaba, 0xaabe, 0xaacc, 0xaafc, 0xac47, 0xac4f, 0xacb0, 0xacd2, 0xad59,
  101314. 0xaec9, 0xafe0, 0xb0ea, 0xb16f, 0xb2b3, 0xb2c4, 0xb36f, 0xb44c, 0xb44e, 0xb54c,
  101315. 0xb5a5, 0xb5bd, 0xb5d0, 0xb5d8, 0xb671, 0xb7ed, 0xb867, 0xb944, 0xbad8, 0xbb44,
  101316. 0xbba1, 0xbdd1, 0xc2c4, 0xc3b9, 0xc440, 0xc45f
  101317. ];
  101318. this.nextChar = function(iter, det) {
  101319. iter.index = iter.nextIndex;
  101320. iter.error = false;
  101321. var firstByte = iter.charValue = iter.nextByte(det);
  101322. if (firstByte < 0)
  101323. return false;
  101324. // single byte character.
  101325. if (firstByte <= 0x7f || firstByte == 0xff)
  101326. return true;
  101327. var secondByte = iter.nextByte(det);
  101328. if (secondByte < 0)
  101329. return false;
  101330. iter.charValue = (iter.charValue << 8) | secondByte;
  101331. if (secondByte < 0x40 || secondByte == 0x7f || secondByte == 0xff)
  101332. iter.error = true;
  101333. return true;
  101334. };
  101335. };
  101336. util.inherits(module.exports.big5, mbcs);
  101337. /**
  101338. * EUC charset recognizers. One abstract class that provides the common function
  101339. * for getting the next character according to the EUC encoding scheme,
  101340. * and nested derived classes for EUC_KR, EUC_JP, EUC_CN.
  101341. *
  101342. * Get the next character value for EUC based encodings.
  101343. * Character 'value' is simply the raw bytes that make up the character
  101344. * packed into an int.
  101345. */
  101346. function eucNextChar(iter, det) {
  101347. iter.index = iter.nextIndex;
  101348. iter.error = false;
  101349. var firstByte = 0;
  101350. var secondByte = 0;
  101351. var thirdByte = 0;
  101352. //int fourthByte = 0;
  101353. buildChar: {
  101354. firstByte = iter.charValue = iter.nextByte(det);
  101355. if (firstByte < 0) {
  101356. // Ran off the end of the input data
  101357. iter.done = true;
  101358. break buildChar;
  101359. }
  101360. if (firstByte <= 0x8d) {
  101361. // single byte char
  101362. break buildChar;
  101363. }
  101364. secondByte = iter.nextByte(det);
  101365. iter.charValue = (iter.charValue << 8) | secondByte;
  101366. if (firstByte >= 0xA1 && firstByte <= 0xfe) {
  101367. // Two byte Char
  101368. if (secondByte < 0xa1) {
  101369. iter.error = true;
  101370. }
  101371. break buildChar;
  101372. }
  101373. if (firstByte == 0x8e) {
  101374. // Code Set 2.
  101375. // In EUC-JP, total char size is 2 bytes, only one byte of actual char value.
  101376. // In EUC-TW, total char size is 4 bytes, three bytes contribute to char value.
  101377. // We don't know which we've got.
  101378. // Treat it like EUC-JP. If the data really was EUC-TW, the following two
  101379. // bytes will look like a well formed 2 byte char.
  101380. if (secondByte < 0xa1) {
  101381. iter.error = true;
  101382. }
  101383. break buildChar;
  101384. }
  101385. if (firstByte == 0x8f) {
  101386. // Code set 3.
  101387. // Three byte total char size, two bytes of actual char value.
  101388. thirdByte = iter.nextByte(det);
  101389. iter.charValue = (iter.charValue << 8) | thirdByte;
  101390. if (thirdByte < 0xa1) {
  101391. iter.error = true;
  101392. }
  101393. }
  101394. }
  101395. return iter.done == false;
  101396. };
  101397. /**
  101398. * The charset recognize for EUC-JP. A singleton instance of this class
  101399. * is created and kept by the public CharsetDetector class
  101400. */
  101401. module.exports.euc_jp = function() {
  101402. this.name = function() {
  101403. return 'EUC-JP';
  101404. };
  101405. this.language = function() {
  101406. return 'ja';
  101407. };
  101408. // TODO: This set of data comes from the character frequency-
  101409. // of-occurence analysis tool. The data needs to be moved
  101410. // into a resource and loaded from there.
  101411. this.commonChars = [
  101412. 0xa1a1, 0xa1a2, 0xa1a3, 0xa1a6, 0xa1bc, 0xa1ca, 0xa1cb, 0xa1d6, 0xa1d7, 0xa4a2,
  101413. 0xa4a4, 0xa4a6, 0xa4a8, 0xa4aa, 0xa4ab, 0xa4ac, 0xa4ad, 0xa4af, 0xa4b1, 0xa4b3,
  101414. 0xa4b5, 0xa4b7, 0xa4b9, 0xa4bb, 0xa4bd, 0xa4bf, 0xa4c0, 0xa4c1, 0xa4c3, 0xa4c4,
  101415. 0xa4c6, 0xa4c7, 0xa4c8, 0xa4c9, 0xa4ca, 0xa4cb, 0xa4ce, 0xa4cf, 0xa4d0, 0xa4de,
  101416. 0xa4df, 0xa4e1, 0xa4e2, 0xa4e4, 0xa4e8, 0xa4e9, 0xa4ea, 0xa4eb, 0xa4ec, 0xa4ef,
  101417. 0xa4f2, 0xa4f3, 0xa5a2, 0xa5a3, 0xa5a4, 0xa5a6, 0xa5a7, 0xa5aa, 0xa5ad, 0xa5af,
  101418. 0xa5b0, 0xa5b3, 0xa5b5, 0xa5b7, 0xa5b8, 0xa5b9, 0xa5bf, 0xa5c3, 0xa5c6, 0xa5c7,
  101419. 0xa5c8, 0xa5c9, 0xa5cb, 0xa5d0, 0xa5d5, 0xa5d6, 0xa5d7, 0xa5de, 0xa5e0, 0xa5e1,
  101420. 0xa5e5, 0xa5e9, 0xa5ea, 0xa5eb, 0xa5ec, 0xa5ed, 0xa5f3, 0xb8a9, 0xb9d4, 0xbaee,
  101421. 0xbbc8, 0xbef0, 0xbfb7, 0xc4ea, 0xc6fc, 0xc7bd, 0xcab8, 0xcaf3, 0xcbdc, 0xcdd1
  101422. ];
  101423. this.nextChar = eucNextChar;
  101424. };
  101425. util.inherits(module.exports.euc_jp, mbcs);
  101426. /**
  101427. * The charset recognize for EUC-KR. A singleton instance of this class
  101428. * is created and kept by the public CharsetDetector class
  101429. */
  101430. module.exports.euc_kr = function() {
  101431. this.name = function() {
  101432. return 'EUC-KR';
  101433. };
  101434. this.language = function() {
  101435. return 'ko';
  101436. };
  101437. // TODO: This set of data comes from the character frequency-
  101438. // of-occurence analysis tool. The data needs to be moved
  101439. // into a resource and loaded from there.
  101440. this.commonChars = [
  101441. 0xb0a1, 0xb0b3, 0xb0c5, 0xb0cd, 0xb0d4, 0xb0e6, 0xb0ed, 0xb0f8, 0xb0fa, 0xb0fc,
  101442. 0xb1b8, 0xb1b9, 0xb1c7, 0xb1d7, 0xb1e2, 0xb3aa, 0xb3bb, 0xb4c2, 0xb4cf, 0xb4d9,
  101443. 0xb4eb, 0xb5a5, 0xb5b5, 0xb5bf, 0xb5c7, 0xb5e9, 0xb6f3, 0xb7af, 0xb7c2, 0xb7ce,
  101444. 0xb8a6, 0xb8ae, 0xb8b6, 0xb8b8, 0xb8bb, 0xb8e9, 0xb9ab, 0xb9ae, 0xb9cc, 0xb9ce,
  101445. 0xb9fd, 0xbab8, 0xbace, 0xbad0, 0xbaf1, 0xbbe7, 0xbbf3, 0xbbfd, 0xbcad, 0xbcba,
  101446. 0xbcd2, 0xbcf6, 0xbdba, 0xbdc0, 0xbdc3, 0xbdc5, 0xbec6, 0xbec8, 0xbedf, 0xbeee,
  101447. 0xbef8, 0xbefa, 0xbfa1, 0xbfa9, 0xbfc0, 0xbfe4, 0xbfeb, 0xbfec, 0xbff8, 0xc0a7,
  101448. 0xc0af, 0xc0b8, 0xc0ba, 0xc0bb, 0xc0bd, 0xc0c7, 0xc0cc, 0xc0ce, 0xc0cf, 0xc0d6,
  101449. 0xc0da, 0xc0e5, 0xc0fb, 0xc0fc, 0xc1a4, 0xc1a6, 0xc1b6, 0xc1d6, 0xc1df, 0xc1f6,
  101450. 0xc1f8, 0xc4a1, 0xc5cd, 0xc6ae, 0xc7cf, 0xc7d1, 0xc7d2, 0xc7d8, 0xc7e5, 0xc8ad
  101451. ];
  101452. this.nextChar = eucNextChar;
  101453. };
  101454. util.inherits(module.exports.euc_kr, mbcs);
  101455. /**
  101456. * GB-18030 recognizer. Uses simplified Chinese statistics.
  101457. */
  101458. module.exports.gb_18030 = function() {
  101459. this.name = function() {
  101460. return 'GB18030';
  101461. };
  101462. this.language = function() {
  101463. return 'zh';
  101464. };
  101465. /*
  101466. * Get the next character value for EUC based encodings.
  101467. * Character 'value' is simply the raw bytes that make up the character
  101468. * packed into an int.
  101469. */
  101470. this.nextChar = function(iter, det) {
  101471. iter.index = iter.nextIndex;
  101472. iter.error = false;
  101473. var firstByte = 0;
  101474. var secondByte = 0;
  101475. var thirdByte = 0;
  101476. var fourthByte = 0;
  101477. buildChar: {
  101478. firstByte = iter.charValue = iter.nextByte(det);
  101479. if (firstByte < 0) {
  101480. // Ran off the end of the input data
  101481. iter.done = true;
  101482. break buildChar;
  101483. }
  101484. if (firstByte <= 0x80) {
  101485. // single byte char
  101486. break buildChar;
  101487. }
  101488. secondByte = iter.nextByte(det);
  101489. iter.charValue = (iter.charValue << 8) | secondByte;
  101490. if (firstByte >= 0x81 && firstByte <= 0xFE) {
  101491. // Two byte Char
  101492. if ((secondByte >= 0x40 && secondByte <= 0x7E) || (secondByte >=80 && secondByte <= 0xFE)) {
  101493. break buildChar;
  101494. }
  101495. // Four byte char
  101496. if (secondByte >= 0x30 && secondByte <= 0x39) {
  101497. thirdByte = iter.nextByte(det);
  101498. if (thirdByte >= 0x81 && thirdByte <= 0xFE) {
  101499. fourthByte = iter.nextByte(det);
  101500. if (fourthByte >= 0x30 && fourthByte <= 0x39) {
  101501. iter.charValue = (iter.charValue << 16) | (thirdByte << 8) | fourthByte;
  101502. break buildChar;
  101503. }
  101504. }
  101505. }
  101506. iter.error = true;
  101507. break buildChar;
  101508. }
  101509. }
  101510. return iter.done == false;
  101511. };
  101512. // TODO: This set of data comes from the character frequency-
  101513. // of-occurence analysis tool. The data needs to be moved
  101514. // into a resource and loaded from there.
  101515. this.commonChars = [
  101516. 0xa1a1, 0xa1a2, 0xa1a3, 0xa1a4, 0xa1b0, 0xa1b1, 0xa1f1, 0xa1f3, 0xa3a1, 0xa3ac,
  101517. 0xa3ba, 0xb1a8, 0xb1b8, 0xb1be, 0xb2bb, 0xb3c9, 0xb3f6, 0xb4f3, 0xb5bd, 0xb5c4,
  101518. 0xb5e3, 0xb6af, 0xb6d4, 0xb6e0, 0xb7a2, 0xb7a8, 0xb7bd, 0xb7d6, 0xb7dd, 0xb8b4,
  101519. 0xb8df, 0xb8f6, 0xb9ab, 0xb9c9, 0xb9d8, 0xb9fa, 0xb9fd, 0xbacd, 0xbba7, 0xbbd6,
  101520. 0xbbe1, 0xbbfa, 0xbcbc, 0xbcdb, 0xbcfe, 0xbdcc, 0xbecd, 0xbedd, 0xbfb4, 0xbfc6,
  101521. 0xbfc9, 0xc0b4, 0xc0ed, 0xc1cb, 0xc2db, 0xc3c7, 0xc4dc, 0xc4ea, 0xc5cc, 0xc6f7,
  101522. 0xc7f8, 0xc8ab, 0xc8cb, 0xc8d5, 0xc8e7, 0xc9cf, 0xc9fa, 0xcab1, 0xcab5, 0xcac7,
  101523. 0xcad0, 0xcad6, 0xcaf5, 0xcafd, 0xccec, 0xcdf8, 0xceaa, 0xcec4, 0xced2, 0xcee5,
  101524. 0xcfb5, 0xcfc2, 0xcfd6, 0xd0c2, 0xd0c5, 0xd0d0, 0xd0d4, 0xd1a7, 0xd2aa, 0xd2b2,
  101525. 0xd2b5, 0xd2bb, 0xd2d4, 0xd3c3, 0xd3d0, 0xd3fd, 0xd4c2, 0xd4da, 0xd5e2, 0xd6d0
  101526. ];
  101527. };
  101528. util.inherits(module.exports.gb_18030, mbcs);
  101529. /***/ }),
  101530. /* 750 */
  101531. /***/ (function(module, exports, __webpack_require__) {
  101532. var util = __webpack_require__(9),
  101533. Match = __webpack_require__ (131);
  101534. /**
  101535. * This class recognizes single-byte encodings. Because the encoding scheme is so
  101536. * simple, language statistics are used to do the matching.
  101537. */
  101538. function NGramParser(theNgramList, theByteMap) {
  101539. var N_GRAM_MASK = 0xFFFFFF;
  101540. this.byteIndex = 0;
  101541. this.ngram = 0;
  101542. this.ngramList = theNgramList;
  101543. this.byteMap = theByteMap;
  101544. this.ngramCount = 0;
  101545. this.hitCount = 0;
  101546. this.spaceChar;
  101547. /*
  101548. * Binary search for value in table, which must have exactly 64 entries.
  101549. */
  101550. this.search = function(table, value) {
  101551. var index = 0;
  101552. if (table[index + 32] <= value) index += 32;
  101553. if (table[index + 16] <= value) index += 16;
  101554. if (table[index + 8] <= value) index += 8;
  101555. if (table[index + 4] <= value) index += 4;
  101556. if (table[index + 2] <= value) index += 2;
  101557. if (table[index + 1] <= value) index += 1;
  101558. if (table[index] > value) index -= 1;
  101559. if (index < 0 || table[index] != value)
  101560. return -1;
  101561. return index;
  101562. };
  101563. this.lookup = function(thisNgram) {
  101564. this.ngramCount += 1;
  101565. if (this.search(this.ngramList, thisNgram) >= 0) {
  101566. this.hitCount += 1;
  101567. }
  101568. };
  101569. this.addByte = function(b) {
  101570. this.ngram = ((this.ngram << 8) + (b & 0xFF)) & N_GRAM_MASK;
  101571. this.lookup(this.ngram);
  101572. }
  101573. this.nextByte = function(det) {
  101574. if (this.byteIndex >= det.fInputLen)
  101575. return -1;
  101576. return det.fInputBytes[this.byteIndex++] & 0xFF;
  101577. }
  101578. this.parse = function(det, spaceCh) {
  101579. var b, ignoreSpace = false;
  101580. this.spaceChar = spaceCh;
  101581. while ((b = this.nextByte(det)) >= 0) {
  101582. var mb = this.byteMap[b];
  101583. // TODO: 0x20 might not be a space in all character sets...
  101584. if (mb != 0) {
  101585. if (!(mb == this.spaceChar && ignoreSpace)) {
  101586. this.addByte(mb);
  101587. }
  101588. ignoreSpace = (mb == this.spaceChar);
  101589. }
  101590. }
  101591. // TODO: Is this OK? The buffer could have ended in the middle of a word...
  101592. this.addByte(this.spaceChar);
  101593. var rawPercent = this.hitCount / this.ngramCount;
  101594. // TODO - This is a bit of a hack to take care of a case
  101595. // were we were getting a confidence of 135...
  101596. if (rawPercent > 0.33)
  101597. return 98;
  101598. return Math.floor(rawPercent * 300.0);
  101599. };
  101600. };
  101601. function NGramsPlusLang(la, ng) {
  101602. this.fLang = la;
  101603. this.fNGrams = ng;
  101604. };
  101605. function sbcs() {};
  101606. sbcs.prototype.spaceChar = 0x20;
  101607. sbcs.prototype.ngrams = function() {};
  101608. sbcs.prototype.byteMap = function() {};
  101609. sbcs.prototype.match = function(det) {
  101610. var ngrams = this.ngrams();
  101611. var multiple = (Array.isArray(ngrams) && ngrams[0] instanceof NGramsPlusLang);
  101612. if (!multiple) {
  101613. var parser = new NGramParser(ngrams, this.byteMap());
  101614. var confidence = parser.parse(det, this.spaceChar);
  101615. return confidence <= 0 ? null : new Match(det, this, confidence);
  101616. }
  101617. var bestConfidenceSoFar = -1;
  101618. var lang = null;
  101619. for (var i = ngrams.length - 1; i >= 0; i--) {
  101620. var ngl = ngrams[i];
  101621. var parser = new NGramParser(ngl.fNGrams, this.byteMap());
  101622. var confidence = parser.parse(det, this.spaceChar);
  101623. if (confidence > bestConfidenceSoFar) {
  101624. bestConfidenceSoFar = confidence;
  101625. lang = ngl.fLang;
  101626. }
  101627. }
  101628. var name = this.name(det);
  101629. return bestConfidenceSoFar <= 0 ? null : new Match(det, this, bestConfidenceSoFar, name, lang);
  101630. };
  101631. module.exports.ISO_8859_1 = function() {
  101632. this.byteMap = function() {
  101633. return [
  101634. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101635. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101636. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101637. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101638. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
  101639. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101640. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101641. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101642. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  101643. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  101644. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  101645. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  101646. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  101647. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  101648. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  101649. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  101650. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101651. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101652. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101653. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101654. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101655. 0x20, 0x20, 0xAA, 0x20, 0x20, 0x20, 0x20, 0x20,
  101656. 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20,
  101657. 0x20, 0x20, 0xBA, 0x20, 0x20, 0x20, 0x20, 0x20,
  101658. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  101659. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  101660. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
  101661. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xDF,
  101662. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  101663. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  101664. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
  101665. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF
  101666. ];
  101667. };
  101668. this.ngrams = function() {
  101669. return [
  101670. new NGramsPlusLang('da', [
  101671. 0x206166, 0x206174, 0x206465, 0x20656E, 0x206572, 0x20666F, 0x206861, 0x206920,
  101672. 0x206D65, 0x206F67, 0x2070E5, 0x207369, 0x207374, 0x207469, 0x207669, 0x616620,
  101673. 0x616E20, 0x616E64, 0x617220, 0x617420, 0x646520, 0x64656E, 0x646572, 0x646574,
  101674. 0x652073, 0x656420, 0x656465, 0x656E20, 0x656E64, 0x657220, 0x657265, 0x657320,
  101675. 0x657420, 0x666F72, 0x676520, 0x67656E, 0x676572, 0x696765, 0x696C20, 0x696E67,
  101676. 0x6B6520, 0x6B6B65, 0x6C6572, 0x6C6967, 0x6C6C65, 0x6D6564, 0x6E6465, 0x6E6520,
  101677. 0x6E6720, 0x6E6765, 0x6F6720, 0x6F6D20, 0x6F7220, 0x70E520, 0x722064, 0x722065,
  101678. 0x722073, 0x726520, 0x737465, 0x742073, 0x746520, 0x746572, 0x74696C, 0x766572
  101679. ]),
  101680. new NGramsPlusLang('de', [
  101681. 0x20616E, 0x206175, 0x206265, 0x206461, 0x206465, 0x206469, 0x206569, 0x206765,
  101682. 0x206861, 0x20696E, 0x206D69, 0x207363, 0x207365, 0x20756E, 0x207665, 0x20766F,
  101683. 0x207765, 0x207A75, 0x626572, 0x636820, 0x636865, 0x636874, 0x646173, 0x64656E,
  101684. 0x646572, 0x646965, 0x652064, 0x652073, 0x65696E, 0x656974, 0x656E20, 0x657220,
  101685. 0x657320, 0x67656E, 0x68656E, 0x687420, 0x696368, 0x696520, 0x696E20, 0x696E65,
  101686. 0x697420, 0x6C6963, 0x6C6C65, 0x6E2061, 0x6E2064, 0x6E2073, 0x6E6420, 0x6E6465,
  101687. 0x6E6520, 0x6E6720, 0x6E6765, 0x6E7465, 0x722064, 0x726465, 0x726569, 0x736368,
  101688. 0x737465, 0x742064, 0x746520, 0x74656E, 0x746572, 0x756E64, 0x756E67, 0x766572
  101689. ]),
  101690. new NGramsPlusLang('en', [
  101691. 0x206120, 0x20616E, 0x206265, 0x20636F, 0x20666F, 0x206861, 0x206865, 0x20696E,
  101692. 0x206D61, 0x206F66, 0x207072, 0x207265, 0x207361, 0x207374, 0x207468, 0x20746F,
  101693. 0x207768, 0x616964, 0x616C20, 0x616E20, 0x616E64, 0x617320, 0x617420, 0x617465,
  101694. 0x617469, 0x642061, 0x642074, 0x652061, 0x652073, 0x652074, 0x656420, 0x656E74,
  101695. 0x657220, 0x657320, 0x666F72, 0x686174, 0x686520, 0x686572, 0x696420, 0x696E20,
  101696. 0x696E67, 0x696F6E, 0x697320, 0x6E2061, 0x6E2074, 0x6E6420, 0x6E6720, 0x6E7420,
  101697. 0x6F6620, 0x6F6E20, 0x6F7220, 0x726520, 0x727320, 0x732061, 0x732074, 0x736169,
  101698. 0x737420, 0x742074, 0x746572, 0x746861, 0x746865, 0x74696F, 0x746F20, 0x747320
  101699. ]),
  101700. new NGramsPlusLang('es', [
  101701. 0x206120, 0x206361, 0x20636F, 0x206465, 0x20656C, 0x20656E, 0x206573, 0x20696E,
  101702. 0x206C61, 0x206C6F, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207265, 0x207365,
  101703. 0x20756E, 0x207920, 0x612063, 0x612064, 0x612065, 0x61206C, 0x612070, 0x616369,
  101704. 0x61646F, 0x616C20, 0x617220, 0x617320, 0x6369F3, 0x636F6E, 0x646520, 0x64656C,
  101705. 0x646F20, 0x652064, 0x652065, 0x65206C, 0x656C20, 0x656E20, 0x656E74, 0x657320,
  101706. 0x657374, 0x69656E, 0x69F36E, 0x6C6120, 0x6C6F73, 0x6E2065, 0x6E7465, 0x6F2064,
  101707. 0x6F2065, 0x6F6E20, 0x6F7220, 0x6F7320, 0x706172, 0x717565, 0x726120, 0x726573,
  101708. 0x732064, 0x732065, 0x732070, 0x736520, 0x746520, 0x746F20, 0x756520, 0xF36E20
  101709. ]),
  101710. new NGramsPlusLang('fr', [
  101711. 0x206175, 0x20636F, 0x206461, 0x206465, 0x206475, 0x20656E, 0x206574, 0x206C61,
  101712. 0x206C65, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207365, 0x20736F, 0x20756E,
  101713. 0x20E020, 0x616E74, 0x617469, 0x636520, 0x636F6E, 0x646520, 0x646573, 0x647520,
  101714. 0x652061, 0x652063, 0x652064, 0x652065, 0x65206C, 0x652070, 0x652073, 0x656E20,
  101715. 0x656E74, 0x657220, 0x657320, 0x657420, 0x657572, 0x696F6E, 0x697320, 0x697420,
  101716. 0x6C6120, 0x6C6520, 0x6C6573, 0x6D656E, 0x6E2064, 0x6E6520, 0x6E7320, 0x6E7420,
  101717. 0x6F6E20, 0x6F6E74, 0x6F7572, 0x717565, 0x72206C, 0x726520, 0x732061, 0x732064,
  101718. 0x732065, 0x73206C, 0x732070, 0x742064, 0x746520, 0x74696F, 0x756520, 0x757220
  101719. ]),
  101720. new NGramsPlusLang('it', [
  101721. 0x20616C, 0x206368, 0x20636F, 0x206465, 0x206469, 0x206520, 0x20696C, 0x20696E,
  101722. 0x206C61, 0x207065, 0x207072, 0x20756E, 0x612063, 0x612064, 0x612070, 0x612073,
  101723. 0x61746F, 0x636865, 0x636F6E, 0x64656C, 0x646920, 0x652061, 0x652063, 0x652064,
  101724. 0x652069, 0x65206C, 0x652070, 0x652073, 0x656C20, 0x656C6C, 0x656E74, 0x657220,
  101725. 0x686520, 0x692061, 0x692063, 0x692064, 0x692073, 0x696120, 0x696C20, 0x696E20,
  101726. 0x696F6E, 0x6C6120, 0x6C6520, 0x6C6920, 0x6C6C61, 0x6E6520, 0x6E6920, 0x6E6F20,
  101727. 0x6E7465, 0x6F2061, 0x6F2064, 0x6F2069, 0x6F2073, 0x6F6E20, 0x6F6E65, 0x706572,
  101728. 0x726120, 0x726520, 0x736920, 0x746120, 0x746520, 0x746920, 0x746F20, 0x7A696F
  101729. ]),
  101730. new NGramsPlusLang('nl', [
  101731. 0x20616C, 0x206265, 0x206461, 0x206465, 0x206469, 0x206565, 0x20656E, 0x206765,
  101732. 0x206865, 0x20696E, 0x206D61, 0x206D65, 0x206F70, 0x207465, 0x207661, 0x207665,
  101733. 0x20766F, 0x207765, 0x207A69, 0x61616E, 0x616172, 0x616E20, 0x616E64, 0x617220,
  101734. 0x617420, 0x636874, 0x646520, 0x64656E, 0x646572, 0x652062, 0x652076, 0x65656E,
  101735. 0x656572, 0x656E20, 0x657220, 0x657273, 0x657420, 0x67656E, 0x686574, 0x696520,
  101736. 0x696E20, 0x696E67, 0x697320, 0x6E2062, 0x6E2064, 0x6E2065, 0x6E2068, 0x6E206F,
  101737. 0x6E2076, 0x6E6465, 0x6E6720, 0x6F6E64, 0x6F6F72, 0x6F7020, 0x6F7220, 0x736368,
  101738. 0x737465, 0x742064, 0x746520, 0x74656E, 0x746572, 0x76616E, 0x766572, 0x766F6F
  101739. ]),
  101740. new NGramsPlusLang('no', [
  101741. 0x206174, 0x206176, 0x206465, 0x20656E, 0x206572, 0x20666F, 0x206861, 0x206920,
  101742. 0x206D65, 0x206F67, 0x2070E5, 0x207365, 0x20736B, 0x20736F, 0x207374, 0x207469,
  101743. 0x207669, 0x20E520, 0x616E64, 0x617220, 0x617420, 0x646520, 0x64656E, 0x646574,
  101744. 0x652073, 0x656420, 0x656E20, 0x656E65, 0x657220, 0x657265, 0x657420, 0x657474,
  101745. 0x666F72, 0x67656E, 0x696B6B, 0x696C20, 0x696E67, 0x6B6520, 0x6B6B65, 0x6C6520,
  101746. 0x6C6C65, 0x6D6564, 0x6D656E, 0x6E2073, 0x6E6520, 0x6E6720, 0x6E6765, 0x6E6E65,
  101747. 0x6F6720, 0x6F6D20, 0x6F7220, 0x70E520, 0x722073, 0x726520, 0x736F6D, 0x737465,
  101748. 0x742073, 0x746520, 0x74656E, 0x746572, 0x74696C, 0x747420, 0x747465, 0x766572
  101749. ]),
  101750. new NGramsPlusLang('pt', [
  101751. 0x206120, 0x20636F, 0x206461, 0x206465, 0x20646F, 0x206520, 0x206573, 0x206D61,
  101752. 0x206E6F, 0x206F20, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207265, 0x207365,
  101753. 0x20756D, 0x612061, 0x612063, 0x612064, 0x612070, 0x616465, 0x61646F, 0x616C20,
  101754. 0x617220, 0x617261, 0x617320, 0x636F6D, 0x636F6E, 0x646120, 0x646520, 0x646F20,
  101755. 0x646F73, 0x652061, 0x652064, 0x656D20, 0x656E74, 0x657320, 0x657374, 0x696120,
  101756. 0x696361, 0x6D656E, 0x6E7465, 0x6E746F, 0x6F2061, 0x6F2063, 0x6F2064, 0x6F2065,
  101757. 0x6F2070, 0x6F7320, 0x706172, 0x717565, 0x726120, 0x726573, 0x732061, 0x732064,
  101758. 0x732065, 0x732070, 0x737461, 0x746520, 0x746F20, 0x756520, 0xE36F20, 0xE7E36F
  101759. ]),
  101760. new NGramsPlusLang('sv', [
  101761. 0x206174, 0x206176, 0x206465, 0x20656E, 0x2066F6, 0x206861, 0x206920, 0x20696E,
  101762. 0x206B6F, 0x206D65, 0x206F63, 0x2070E5, 0x20736B, 0x20736F, 0x207374, 0x207469,
  101763. 0x207661, 0x207669, 0x20E472, 0x616465, 0x616E20, 0x616E64, 0x617220, 0x617474,
  101764. 0x636820, 0x646520, 0x64656E, 0x646572, 0x646574, 0x656420, 0x656E20, 0x657220,
  101765. 0x657420, 0x66F672, 0x67656E, 0x696C6C, 0x696E67, 0x6B6120, 0x6C6C20, 0x6D6564,
  101766. 0x6E2073, 0x6E6120, 0x6E6465, 0x6E6720, 0x6E6765, 0x6E696E, 0x6F6368, 0x6F6D20,
  101767. 0x6F6E20, 0x70E520, 0x722061, 0x722073, 0x726120, 0x736B61, 0x736F6D, 0x742073,
  101768. 0x746120, 0x746520, 0x746572, 0x74696C, 0x747420, 0x766172, 0xE47220, 0xF67220,
  101769. ])
  101770. ];
  101771. };
  101772. this.name = function(det) {
  101773. return (det && det.fC1Bytes) ? 'windows-1252' : 'ISO-8859-1';
  101774. };
  101775. };
  101776. util.inherits(module.exports.ISO_8859_1, sbcs);
  101777. module.exports.ISO_8859_2 = function() {
  101778. this.byteMap = function() {
  101779. return [
  101780. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101781. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101782. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101783. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101784. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
  101785. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101786. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101787. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101788. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  101789. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  101790. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  101791. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  101792. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  101793. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  101794. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  101795. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  101796. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101797. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101798. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101799. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101800. 0x20, 0xB1, 0x20, 0xB3, 0x20, 0xB5, 0xB6, 0x20,
  101801. 0x20, 0xB9, 0xBA, 0xBB, 0xBC, 0x20, 0xBE, 0xBF,
  101802. 0x20, 0xB1, 0x20, 0xB3, 0x20, 0xB5, 0xB6, 0xB7,
  101803. 0x20, 0xB9, 0xBA, 0xBB, 0xBC, 0x20, 0xBE, 0xBF,
  101804. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  101805. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  101806. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
  101807. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xDF,
  101808. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  101809. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  101810. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
  101811. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0x20
  101812. ];
  101813. }
  101814. this.ngrams = function() {
  101815. return [
  101816. new NGramsPlusLang('cs', [
  101817. 0x206120, 0x206279, 0x20646F, 0x206A65, 0x206E61, 0x206E65, 0x206F20, 0x206F64,
  101818. 0x20706F, 0x207072, 0x2070F8, 0x20726F, 0x207365, 0x20736F, 0x207374, 0x20746F,
  101819. 0x207620, 0x207679, 0x207A61, 0x612070, 0x636520, 0x636820, 0x652070, 0x652073,
  101820. 0x652076, 0x656D20, 0x656EED, 0x686F20, 0x686F64, 0x697374, 0x6A6520, 0x6B7465,
  101821. 0x6C6520, 0x6C6920, 0x6E6120, 0x6EE920, 0x6EEC20, 0x6EED20, 0x6F2070, 0x6F646E,
  101822. 0x6F6A69, 0x6F7374, 0x6F7520, 0x6F7661, 0x706F64, 0x706F6A, 0x70726F, 0x70F865,
  101823. 0x736520, 0x736F75, 0x737461, 0x737469, 0x73746E, 0x746572, 0x746EED, 0x746F20,
  101824. 0x752070, 0xBE6520, 0xE16EED, 0xE9686F, 0xED2070, 0xED2073, 0xED6D20, 0xF86564,
  101825. ]),
  101826. new NGramsPlusLang('hu', [
  101827. 0x206120, 0x20617A, 0x206265, 0x206567, 0x20656C, 0x206665, 0x206861, 0x20686F,
  101828. 0x206973, 0x206B65, 0x206B69, 0x206BF6, 0x206C65, 0x206D61, 0x206D65, 0x206D69,
  101829. 0x206E65, 0x20737A, 0x207465, 0x20E973, 0x612061, 0x61206B, 0x61206D, 0x612073,
  101830. 0x616B20, 0x616E20, 0x617A20, 0x62616E, 0x62656E, 0x656779, 0x656B20, 0x656C20,
  101831. 0x656C65, 0x656D20, 0x656E20, 0x657265, 0x657420, 0x657465, 0x657474, 0x677920,
  101832. 0x686F67, 0x696E74, 0x697320, 0x6B2061, 0x6BF67A, 0x6D6567, 0x6D696E, 0x6E2061,
  101833. 0x6E616B, 0x6E656B, 0x6E656D, 0x6E7420, 0x6F6779, 0x732061, 0x737A65, 0x737A74,
  101834. 0x737AE1, 0x73E967, 0x742061, 0x747420, 0x74E173, 0x7A6572, 0xE16E20, 0xE97320,
  101835. ]),
  101836. new NGramsPlusLang('pl', [
  101837. 0x20637A, 0x20646F, 0x206920, 0x206A65, 0x206B6F, 0x206D61, 0x206D69, 0x206E61,
  101838. 0x206E69, 0x206F64, 0x20706F, 0x207072, 0x207369, 0x207720, 0x207769, 0x207779,
  101839. 0x207A20, 0x207A61, 0x612070, 0x612077, 0x616E69, 0x636820, 0x637A65, 0x637A79,
  101840. 0x646F20, 0x647A69, 0x652070, 0x652073, 0x652077, 0x65207A, 0x65676F, 0x656A20,
  101841. 0x656D20, 0x656E69, 0x676F20, 0x696120, 0x696520, 0x69656A, 0x6B6120, 0x6B6920,
  101842. 0x6B6965, 0x6D6965, 0x6E6120, 0x6E6961, 0x6E6965, 0x6F2070, 0x6F7761, 0x6F7769,
  101843. 0x706F6C, 0x707261, 0x70726F, 0x70727A, 0x727A65, 0x727A79, 0x7369EA, 0x736B69,
  101844. 0x737461, 0x776965, 0x796368, 0x796D20, 0x7A6520, 0x7A6965, 0x7A7920, 0xF37720,
  101845. ]),
  101846. new NGramsPlusLang('ro', [
  101847. 0x206120, 0x206163, 0x206361, 0x206365, 0x20636F, 0x206375, 0x206465, 0x206469,
  101848. 0x206C61, 0x206D61, 0x207065, 0x207072, 0x207365, 0x2073E3, 0x20756E, 0x20BA69,
  101849. 0x20EE6E, 0x612063, 0x612064, 0x617265, 0x617420, 0x617465, 0x617520, 0x636172,
  101850. 0x636F6E, 0x637520, 0x63E320, 0x646520, 0x652061, 0x652063, 0x652064, 0x652070,
  101851. 0x652073, 0x656120, 0x656920, 0x656C65, 0x656E74, 0x657374, 0x692061, 0x692063,
  101852. 0x692064, 0x692070, 0x696520, 0x696920, 0x696E20, 0x6C6120, 0x6C6520, 0x6C6F72,
  101853. 0x6C7569, 0x6E6520, 0x6E7472, 0x6F7220, 0x70656E, 0x726520, 0x726561, 0x727520,
  101854. 0x73E320, 0x746520, 0x747275, 0x74E320, 0x756920, 0x756C20, 0xBA6920, 0xEE6E20,
  101855. ])
  101856. ];
  101857. };
  101858. this.name = function(det) {
  101859. return (det && det.fC1Bytes) ? 'windows-1250' : 'ISO-8859-2';
  101860. };
  101861. };
  101862. util.inherits(module.exports.ISO_8859_2, sbcs);
  101863. module.exports.ISO_8859_5 = function() {
  101864. this.byteMap = function() {
  101865. return [
  101866. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101867. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101868. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101869. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101870. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
  101871. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101872. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101873. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101874. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  101875. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  101876. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  101877. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  101878. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  101879. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  101880. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  101881. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  101882. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101883. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101884. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101885. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101886. 0x20, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
  101887. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0x20, 0xFE, 0xFF,
  101888. 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
  101889. 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
  101890. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  101891. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  101892. 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
  101893. 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
  101894. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  101895. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  101896. 0x20, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
  101897. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0x20, 0xFE, 0xFF
  101898. ];
  101899. };
  101900. this.ngrams = function() {
  101901. return [
  101902. 0x20D220, 0x20D2DE, 0x20D4DE, 0x20D7D0, 0x20D820, 0x20DAD0, 0x20DADE, 0x20DDD0,
  101903. 0x20DDD5, 0x20DED1, 0x20DFDE, 0x20DFE0, 0x20E0D0, 0x20E1DE, 0x20E1E2, 0x20E2DE,
  101904. 0x20E7E2, 0x20EDE2, 0xD0DDD8, 0xD0E2EC, 0xD3DE20, 0xD5DBEC, 0xD5DDD8, 0xD5E1E2,
  101905. 0xD5E220, 0xD820DF, 0xD8D520, 0xD8D820, 0xD8EF20, 0xDBD5DD, 0xDBD820, 0xDBECDD,
  101906. 0xDDD020, 0xDDD520, 0xDDD8D5, 0xDDD8EF, 0xDDDE20, 0xDDDED2, 0xDE20D2, 0xDE20DF,
  101907. 0xDE20E1, 0xDED220, 0xDED2D0, 0xDED3DE, 0xDED920, 0xDEDBEC, 0xDEDC20, 0xDEE1E2,
  101908. 0xDFDEDB, 0xDFE0D5, 0xDFE0D8, 0xDFE0DE, 0xE0D0D2, 0xE0D5D4, 0xE1E2D0, 0xE1E2D2,
  101909. 0xE1E2D8, 0xE1EF20, 0xE2D5DB, 0xE2DE20, 0xE2DEE0, 0xE2EC20, 0xE7E2DE, 0xEBE520
  101910. ];
  101911. };
  101912. this.name = function(det) {
  101913. return 'ISO-8859-5';
  101914. };
  101915. this.language = function() {
  101916. return 'ru';
  101917. };
  101918. };
  101919. util.inherits(module.exports.ISO_8859_5, sbcs);
  101920. module.exports.ISO_8859_6 = function() {
  101921. this.byteMap = function() {
  101922. return [
  101923. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101924. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101925. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101926. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101927. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
  101928. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101929. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101930. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101931. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  101932. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  101933. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  101934. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  101935. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  101936. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  101937. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  101938. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  101939. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101940. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101941. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101942. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101943. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101944. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101945. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101946. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101947. 0x20, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
  101948. 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
  101949. 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
  101950. 0xD8, 0xD9, 0xDA, 0x20, 0x20, 0x20, 0x20, 0x20,
  101951. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  101952. 0xE8, 0xE9, 0xEA, 0x20, 0x20, 0x20, 0x20, 0x20,
  101953. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101954. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20
  101955. ];
  101956. };
  101957. this.ngrams = function() {
  101958. return [
  101959. 0x20C7E4, 0x20C7E6, 0x20C8C7, 0x20D9E4, 0x20E1EA, 0x20E4E4, 0x20E5E6, 0x20E8C7,
  101960. 0xC720C7, 0xC7C120, 0xC7CA20, 0xC7D120, 0xC7E420, 0xC7E4C3, 0xC7E4C7, 0xC7E4C8,
  101961. 0xC7E4CA, 0xC7E4CC, 0xC7E4CD, 0xC7E4CF, 0xC7E4D3, 0xC7E4D9, 0xC7E4E2, 0xC7E4E5,
  101962. 0xC7E4E8, 0xC7E4EA, 0xC7E520, 0xC7E620, 0xC7E6CA, 0xC820C7, 0xC920C7, 0xC920E1,
  101963. 0xC920E4, 0xC920E5, 0xC920E8, 0xCA20C7, 0xCF20C7, 0xCFC920, 0xD120C7, 0xD1C920,
  101964. 0xD320C7, 0xD920C7, 0xD9E4E9, 0xE1EA20, 0xE420C7, 0xE4C920, 0xE4E920, 0xE4EA20,
  101965. 0xE520C7, 0xE5C720, 0xE5C920, 0xE5E620, 0xE620C7, 0xE720C7, 0xE7C720, 0xE8C7E4,
  101966. 0xE8E620, 0xE920C7, 0xEA20C7, 0xEA20E5, 0xEA20E8, 0xEAC920, 0xEAD120, 0xEAE620
  101967. ];
  101968. };
  101969. this.name = function(det) {
  101970. return 'ISO-8859-6';
  101971. };
  101972. this.language = function() {
  101973. return 'ar';
  101974. };
  101975. };
  101976. util.inherits(module.exports.ISO_8859_6, sbcs);
  101977. module.exports.ISO_8859_7 = function() {
  101978. this.byteMap = function() {
  101979. return [
  101980. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101981. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101982. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101983. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101984. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
  101985. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101986. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101987. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101988. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  101989. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  101990. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  101991. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  101992. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  101993. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  101994. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  101995. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  101996. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101997. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101998. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  101999. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102000. 0x20, 0xA1, 0xA2, 0x20, 0x20, 0x20, 0x20, 0x20,
  102001. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102002. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xDC, 0x20,
  102003. 0xDD, 0xDE, 0xDF, 0x20, 0xFC, 0x20, 0xFD, 0xFE,
  102004. 0xC0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  102005. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  102006. 0xF0, 0xF1, 0x20, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
  102007. 0xF8, 0xF9, 0xFA, 0xFB, 0xDC, 0xDD, 0xDE, 0xDF,
  102008. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  102009. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  102010. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
  102011. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0x20
  102012. ];
  102013. };
  102014. this.ngrams = function() {
  102015. return [
  102016. 0x20E1ED, 0x20E1F0, 0x20E3E9, 0x20E4E9, 0x20E5F0, 0x20E720, 0x20EAE1, 0x20ECE5,
  102017. 0x20EDE1, 0x20EF20, 0x20F0E1, 0x20F0EF, 0x20F0F1, 0x20F3F4, 0x20F3F5, 0x20F4E7,
  102018. 0x20F4EF, 0xDFE120, 0xE120E1, 0xE120F4, 0xE1E920, 0xE1ED20, 0xE1F0FC, 0xE1F220,
  102019. 0xE3E9E1, 0xE5E920, 0xE5F220, 0xE720F4, 0xE7ED20, 0xE7F220, 0xE920F4, 0xE9E120,
  102020. 0xE9EADE, 0xE9F220, 0xEAE1E9, 0xEAE1F4, 0xECE520, 0xED20E1, 0xED20E5, 0xED20F0,
  102021. 0xEDE120, 0xEFF220, 0xEFF520, 0xF0EFF5, 0xF0F1EF, 0xF0FC20, 0xF220E1, 0xF220E5,
  102022. 0xF220EA, 0xF220F0, 0xF220F4, 0xF3E520, 0xF3E720, 0xF3F4EF, 0xF4E120, 0xF4E1E9,
  102023. 0xF4E7ED, 0xF4E7F2, 0xF4E9EA, 0xF4EF20, 0xF4EFF5, 0xF4F9ED, 0xF9ED20, 0xFEED20
  102024. ];
  102025. };
  102026. this.name = function(det) {
  102027. return (det && det.fC1Bytes) ? 'windows-1253' : 'ISO-8859-7';
  102028. };
  102029. this.language = function() {
  102030. return 'el';
  102031. };
  102032. };
  102033. util.inherits(module.exports.ISO_8859_7, sbcs);
  102034. module.exports.ISO_8859_8 = function() {
  102035. this.byteMap = function() {
  102036. return [
  102037. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102038. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102039. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102040. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102041. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
  102042. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102043. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102044. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102045. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  102046. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  102047. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  102048. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  102049. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  102050. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  102051. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  102052. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  102053. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102054. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102055. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102056. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102057. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102058. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102059. 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20,
  102060. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102061. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102062. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102063. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102064. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102065. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  102066. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  102067. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
  102068. 0xF8, 0xF9, 0xFA, 0x20, 0x20, 0x20, 0x20, 0x20
  102069. ];
  102070. };
  102071. this.ngrams = function() {
  102072. return [
  102073. new NGramsPlusLang('he', [
  102074. 0x20E0E5, 0x20E0E7, 0x20E0E9, 0x20E0FA, 0x20E1E9, 0x20E1EE, 0x20E4E0, 0x20E4E5,
  102075. 0x20E4E9, 0x20E4EE, 0x20E4F2, 0x20E4F9, 0x20E4FA, 0x20ECE0, 0x20ECE4, 0x20EEE0,
  102076. 0x20F2EC, 0x20F9EC, 0xE0FA20, 0xE420E0, 0xE420E1, 0xE420E4, 0xE420EC, 0xE420EE,
  102077. 0xE420F9, 0xE4E5E0, 0xE5E020, 0xE5ED20, 0xE5EF20, 0xE5F820, 0xE5FA20, 0xE920E4,
  102078. 0xE9E420, 0xE9E5FA, 0xE9E9ED, 0xE9ED20, 0xE9EF20, 0xE9F820, 0xE9FA20, 0xEC20E0,
  102079. 0xEC20E4, 0xECE020, 0xECE420, 0xED20E0, 0xED20E1, 0xED20E4, 0xED20EC, 0xED20EE,
  102080. 0xED20F9, 0xEEE420, 0xEF20E4, 0xF0E420, 0xF0E920, 0xF0E9ED, 0xF2EC20, 0xF820E4,
  102081. 0xF8E9ED, 0xF9EC20, 0xFA20E0, 0xFA20E1, 0xFA20E4, 0xFA20EC, 0xFA20EE, 0xFA20F9,
  102082. ]),
  102083. new NGramsPlusLang('he', [
  102084. 0x20E0E5, 0x20E0EC, 0x20E4E9, 0x20E4EC, 0x20E4EE, 0x20E4F0, 0x20E9F0, 0x20ECF2,
  102085. 0x20ECF9, 0x20EDE5, 0x20EDE9, 0x20EFE5, 0x20EFE9, 0x20F8E5, 0x20F8E9, 0x20FAE0,
  102086. 0x20FAE5, 0x20FAE9, 0xE020E4, 0xE020EC, 0xE020ED, 0xE020FA, 0xE0E420, 0xE0E5E4,
  102087. 0xE0EC20, 0xE0EE20, 0xE120E4, 0xE120ED, 0xE120FA, 0xE420E4, 0xE420E9, 0xE420EC,
  102088. 0xE420ED, 0xE420EF, 0xE420F8, 0xE420FA, 0xE4EC20, 0xE5E020, 0xE5E420, 0xE7E020,
  102089. 0xE9E020, 0xE9E120, 0xE9E420, 0xEC20E4, 0xEC20ED, 0xEC20FA, 0xECF220, 0xECF920,
  102090. 0xEDE9E9, 0xEDE9F0, 0xEDE9F8, 0xEE20E4, 0xEE20ED, 0xEE20FA, 0xEEE120, 0xEEE420,
  102091. 0xF2E420, 0xF920E4, 0xF920ED, 0xF920FA, 0xF9E420, 0xFAE020, 0xFAE420, 0xFAE5E9,
  102092. ])
  102093. ];
  102094. };
  102095. this.name = function(det) {
  102096. return (det && det.fC1Bytes) ? 'windows-1255' : 'ISO-8859-8';
  102097. };
  102098. this.language = function() {
  102099. return 'he';
  102100. };
  102101. };
  102102. util.inherits(module.exports.ISO_8859_8, sbcs);
  102103. module.exports.ISO_8859_9 = function() {
  102104. this.byteMap = function() {
  102105. return [
  102106. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102107. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102108. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102109. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102110. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
  102111. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102112. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102113. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102114. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  102115. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  102116. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  102117. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  102118. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  102119. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  102120. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  102121. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  102122. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102123. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102124. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102125. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102126. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102127. 0x20, 0x20, 0xAA, 0x20, 0x20, 0x20, 0x20, 0x20,
  102128. 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20,
  102129. 0x20, 0x20, 0xBA, 0x20, 0x20, 0x20, 0x20, 0x20,
  102130. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  102131. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  102132. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
  102133. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0x69, 0xFE, 0xDF,
  102134. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  102135. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  102136. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
  102137. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF
  102138. ];
  102139. };
  102140. this.ngrams = function() {
  102141. return [
  102142. 0x206261, 0x206269, 0x206275, 0x206461, 0x206465, 0x206765, 0x206861, 0x20696C,
  102143. 0x206B61, 0x206B6F, 0x206D61, 0x206F6C, 0x207361, 0x207461, 0x207665, 0x207961,
  102144. 0x612062, 0x616B20, 0x616C61, 0x616D61, 0x616E20, 0x616EFD, 0x617220, 0x617261,
  102145. 0x6172FD, 0x6173FD, 0x617961, 0x626972, 0x646120, 0x646520, 0x646920, 0x652062,
  102146. 0x65206B, 0x656469, 0x656E20, 0x657220, 0x657269, 0x657369, 0x696C65, 0x696E20,
  102147. 0x696E69, 0x697220, 0x6C616E, 0x6C6172, 0x6C6520, 0x6C6572, 0x6E2061, 0x6E2062,
  102148. 0x6E206B, 0x6E6461, 0x6E6465, 0x6E6520, 0x6E6920, 0x6E696E, 0x6EFD20, 0x72696E,
  102149. 0x72FD6E, 0x766520, 0x796120, 0x796F72, 0xFD6E20, 0xFD6E64, 0xFD6EFD, 0xFDF0FD
  102150. ];
  102151. };
  102152. this.name = function(det) {
  102153. return (det && det.fC1Bytes) ? 'windows-1254' : 'ISO-8859-9';
  102154. };
  102155. this.language = function() {
  102156. return 'tr';
  102157. };
  102158. };
  102159. util.inherits(module.exports.ISO_8859_9, sbcs);
  102160. module.exports.windows_1251 = function() {
  102161. this.byteMap = function() {
  102162. return [
  102163. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102164. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102165. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102166. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102167. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
  102168. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102169. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102170. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102171. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  102172. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  102173. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  102174. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  102175. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  102176. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  102177. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  102178. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  102179. 0x90, 0x83, 0x20, 0x83, 0x20, 0x20, 0x20, 0x20,
  102180. 0x20, 0x20, 0x9A, 0x20, 0x9C, 0x9D, 0x9E, 0x9F,
  102181. 0x90, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102182. 0x20, 0x20, 0x9A, 0x20, 0x9C, 0x9D, 0x9E, 0x9F,
  102183. 0x20, 0xA2, 0xA2, 0xBC, 0x20, 0xB4, 0x20, 0x20,
  102184. 0xB8, 0x20, 0xBA, 0x20, 0x20, 0x20, 0x20, 0xBF,
  102185. 0x20, 0x20, 0xB3, 0xB3, 0xB4, 0xB5, 0x20, 0x20,
  102186. 0xB8, 0x20, 0xBA, 0x20, 0xBC, 0xBE, 0xBE, 0xBF,
  102187. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  102188. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  102189. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
  102190. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF,
  102191. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  102192. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  102193. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
  102194. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF
  102195. ];
  102196. };
  102197. this.ngrams = function() {
  102198. return [
  102199. 0x20E220, 0x20E2EE, 0x20E4EE, 0x20E7E0, 0x20E820, 0x20EAE0, 0x20EAEE, 0x20EDE0,
  102200. 0x20EDE5, 0x20EEE1, 0x20EFEE, 0x20EFF0, 0x20F0E0, 0x20F1EE, 0x20F1F2, 0x20F2EE,
  102201. 0x20F7F2, 0x20FDF2, 0xE0EDE8, 0xE0F2FC, 0xE3EE20, 0xE5EBFC, 0xE5EDE8, 0xE5F1F2,
  102202. 0xE5F220, 0xE820EF, 0xE8E520, 0xE8E820, 0xE8FF20, 0xEBE5ED, 0xEBE820, 0xEBFCED,
  102203. 0xEDE020, 0xEDE520, 0xEDE8E5, 0xEDE8FF, 0xEDEE20, 0xEDEEE2, 0xEE20E2, 0xEE20EF,
  102204. 0xEE20F1, 0xEEE220, 0xEEE2E0, 0xEEE3EE, 0xEEE920, 0xEEEBFC, 0xEEEC20, 0xEEF1F2,
  102205. 0xEFEEEB, 0xEFF0E5, 0xEFF0E8, 0xEFF0EE, 0xF0E0E2, 0xF0E5E4, 0xF1F2E0, 0xF1F2E2,
  102206. 0xF1F2E8, 0xF1FF20, 0xF2E5EB, 0xF2EE20, 0xF2EEF0, 0xF2FC20, 0xF7F2EE, 0xFBF520
  102207. ];
  102208. };
  102209. this.name = function(det) {
  102210. return 'windows-1251';
  102211. };
  102212. this.language = function() {
  102213. return 'ru';
  102214. };
  102215. };
  102216. util.inherits(module.exports.windows_1251, sbcs);
  102217. module.exports.windows_1256 = function() {
  102218. this.byteMap = function() {
  102219. return [
  102220. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102221. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102222. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102223. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102224. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
  102225. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102226. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102227. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102228. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  102229. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  102230. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  102231. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  102232. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  102233. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  102234. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  102235. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  102236. 0x20, 0x81, 0x20, 0x83, 0x20, 0x20, 0x20, 0x20,
  102237. 0x88, 0x20, 0x8A, 0x20, 0x9C, 0x8D, 0x8E, 0x8F,
  102238. 0x90, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102239. 0x98, 0x20, 0x9A, 0x20, 0x9C, 0x20, 0x20, 0x9F,
  102240. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102241. 0x20, 0x20, 0xAA, 0x20, 0x20, 0x20, 0x20, 0x20,
  102242. 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20,
  102243. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102244. 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
  102245. 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
  102246. 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0x20,
  102247. 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
  102248. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  102249. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  102250. 0x20, 0x20, 0x20, 0x20, 0xF4, 0x20, 0x20, 0x20,
  102251. 0x20, 0xF9, 0x20, 0xFB, 0xFC, 0x20, 0x20, 0xFF
  102252. ];
  102253. };
  102254. this.ngrams = function() {
  102255. return [
  102256. 0x20C7E1, 0x20C7E4, 0x20C8C7, 0x20DAE1, 0x20DDED, 0x20E1E1, 0x20E3E4, 0x20E6C7,
  102257. 0xC720C7, 0xC7C120, 0xC7CA20, 0xC7D120, 0xC7E120, 0xC7E1C3, 0xC7E1C7, 0xC7E1C8,
  102258. 0xC7E1CA, 0xC7E1CC, 0xC7E1CD, 0xC7E1CF, 0xC7E1D3, 0xC7E1DA, 0xC7E1DE, 0xC7E1E3,
  102259. 0xC7E1E6, 0xC7E1ED, 0xC7E320, 0xC7E420, 0xC7E4CA, 0xC820C7, 0xC920C7, 0xC920DD,
  102260. 0xC920E1, 0xC920E3, 0xC920E6, 0xCA20C7, 0xCF20C7, 0xCFC920, 0xD120C7, 0xD1C920,
  102261. 0xD320C7, 0xDA20C7, 0xDAE1EC, 0xDDED20, 0xE120C7, 0xE1C920, 0xE1EC20, 0xE1ED20,
  102262. 0xE320C7, 0xE3C720, 0xE3C920, 0xE3E420, 0xE420C7, 0xE520C7, 0xE5C720, 0xE6C7E1,
  102263. 0xE6E420, 0xEC20C7, 0xED20C7, 0xED20E3, 0xED20E6, 0xEDC920, 0xEDD120, 0xEDE420
  102264. ];
  102265. };
  102266. this.name = function(det) {
  102267. return 'windows-1256';
  102268. };
  102269. this.language = function() {
  102270. return 'ar';
  102271. };
  102272. };
  102273. util.inherits(module.exports.windows_1256, sbcs);
  102274. module.exports.KOI8_R = function() {
  102275. this.byteMap = function() {
  102276. return [
  102277. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102278. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102279. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102280. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102281. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
  102282. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102283. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102284. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102285. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  102286. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  102287. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  102288. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  102289. 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  102290. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  102291. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  102292. 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
  102293. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102294. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102295. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102296. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102297. 0x20, 0x20, 0x20, 0xA3, 0x20, 0x20, 0x20, 0x20,
  102298. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102299. 0x20, 0x20, 0x20, 0xA3, 0x20, 0x20, 0x20, 0x20,
  102300. 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  102301. 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
  102302. 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
  102303. 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
  102304. 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
  102305. 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
  102306. 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
  102307. 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
  102308. 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF
  102309. ];
  102310. };
  102311. this.ngrams = function() {
  102312. return [
  102313. 0x20C4CF, 0x20C920, 0x20CBC1, 0x20CBCF, 0x20CEC1, 0x20CEC5, 0x20CFC2, 0x20D0CF,
  102314. 0x20D0D2, 0x20D2C1, 0x20D3CF, 0x20D3D4, 0x20D4CF, 0x20D720, 0x20D7CF, 0x20DAC1,
  102315. 0x20DCD4, 0x20DED4, 0xC1CEC9, 0xC1D4D8, 0xC5CCD8, 0xC5CEC9, 0xC5D3D4, 0xC5D420,
  102316. 0xC7CF20, 0xC920D0, 0xC9C520, 0xC9C920, 0xC9D120, 0xCCC5CE, 0xCCC920, 0xCCD8CE,
  102317. 0xCEC120, 0xCEC520, 0xCEC9C5, 0xCEC9D1, 0xCECF20, 0xCECFD7, 0xCF20D0, 0xCF20D3,
  102318. 0xCF20D7, 0xCFC7CF, 0xCFCA20, 0xCFCCD8, 0xCFCD20, 0xCFD3D4, 0xCFD720, 0xCFD7C1,
  102319. 0xD0CFCC, 0xD0D2C5, 0xD0D2C9, 0xD0D2CF, 0xD2C1D7, 0xD2C5C4, 0xD3D120, 0xD3D4C1,
  102320. 0xD3D4C9, 0xD3D4D7, 0xD4C5CC, 0xD4CF20, 0xD4CFD2, 0xD4D820, 0xD9C820, 0xDED4CF
  102321. ];
  102322. };
  102323. this.name = function(det) {
  102324. return 'KOI8-R';
  102325. };
  102326. this.language = function() {
  102327. return 'ru';
  102328. };
  102329. };
  102330. util.inherits(module.exports.KOI8_R, sbcs);
  102331. /*
  102332. module.exports.ISO_8859_7 = function() {
  102333. this.byteMap = function() {
  102334. return [
  102335. ];
  102336. };
  102337. this.ngrams = function() {
  102338. return [
  102339. ];
  102340. };
  102341. this.name = function(det) {
  102342. if (typeof det == 'undefined')
  102343. return 'ISO-8859-7';
  102344. return det.fC1Bytes ? 'windows-1253' : 'ISO-8859-7';
  102345. };
  102346. this.language = function() {
  102347. return 'el';
  102348. };
  102349. };
  102350. util.inherits(module.exports.ISO_8859_7, sbcs);
  102351. */
  102352. /***/ }),
  102353. /* 751 */
  102354. /***/ (function(module, exports, __webpack_require__) {
  102355. "use strict";
  102356. var util = __webpack_require__(9),
  102357. Match = __webpack_require__ (131);
  102358. /**
  102359. * This class matches UTF-16 and UTF-32, both big- and little-endian. The
  102360. * BOM will be used if it is present.
  102361. */
  102362. module.exports.UTF_16BE = function() {
  102363. this.name = function() {
  102364. return 'UTF-16BE';
  102365. };
  102366. this.match = function(det) {
  102367. var input = det.fRawInput;
  102368. if (input.length >= 2 && ((input[0] & 0xff) == 0xfe && (input[1] & 0xff) == 0xff)) {
  102369. return new Match(det, this, 100); // confidence = 100
  102370. }
  102371. // TODO: Do some statistics to check for unsigned UTF-16BE
  102372. return null;
  102373. };
  102374. };
  102375. module.exports.UTF_16LE = function() {
  102376. this.name = function() {
  102377. return 'UTF-16LE';
  102378. };
  102379. this.match = function(det) {
  102380. var input = det.fRawInput;
  102381. if (input.length >= 2 && ((input[0] & 0xff) == 0xff && (input[1] & 0xff) == 0xfe)) {
  102382. // LE BOM is present.
  102383. if (input.length >= 4 && input[2] == 0x00 && input[3] == 0x00) {
  102384. // It is probably UTF-32 LE, not UTF-16
  102385. return null;
  102386. }
  102387. return new Match(det, this, 100); // confidence = 100
  102388. }
  102389. // TODO: Do some statistics to check for unsigned UTF-16LE
  102390. return null;
  102391. }
  102392. };
  102393. function UTF_32() {};
  102394. UTF_32.prototype.match = function(det) {
  102395. var input = det.fRawInput,
  102396. limit = (det.fRawLength / 4) * 4,
  102397. numValid = 0,
  102398. numInvalid = 0,
  102399. hasBOM = false,
  102400. confidence = 0;
  102401. if (limit == 0) {
  102402. return null;
  102403. }
  102404. if (this.getChar(input, 0) == 0x0000FEFF) {
  102405. hasBOM = true;
  102406. }
  102407. for (var i = 0; i < limit; i += 4) {
  102408. var ch = this.getChar(input, i);
  102409. if (ch < 0 || ch >= 0x10FFFF || (ch >= 0xD800 && ch <= 0xDFFF)) {
  102410. numInvalid += 1;
  102411. } else {
  102412. numValid += 1;
  102413. }
  102414. }
  102415. // Cook up some sort of confidence score, based on presence of a BOM
  102416. // and the existence of valid and/or invalid multi-byte sequences.
  102417. if (hasBOM && numInvalid == 0) {
  102418. confidence = 100;
  102419. } else if (hasBOM && numValid > numInvalid * 10) {
  102420. confidence = 80;
  102421. } else if (numValid > 3 && numInvalid == 0) {
  102422. confidence = 100;
  102423. } else if (numValid > 0 && numInvalid == 0) {
  102424. confidence = 80;
  102425. } else if (numValid > numInvalid * 10) {
  102426. // Probably corrupt UTF-32BE data. Valid sequences aren't likely by chance.
  102427. confidence = 25;
  102428. }
  102429. // return confidence == 0 ? null : new CharsetMatch(det, this, confidence);
  102430. return confidence == 0 ? null : new Match(det, this, confidence);
  102431. };
  102432. module.exports.UTF_32BE = function() {
  102433. this.name = function() {
  102434. return 'UTF-32BE';
  102435. };
  102436. this.getChar = function(input, index) {
  102437. return (input[index + 0] & 0xff) << 24 | (input[index + 1] & 0xff) << 16 |
  102438. (input[index + 2] & 0xff) << 8 | (input[index + 3] & 0xff);
  102439. };
  102440. };
  102441. util.inherits(module.exports.UTF_32BE, UTF_32);
  102442. module.exports.UTF_32LE = function() {
  102443. this.name = function() {
  102444. return 'UTF-32LE';
  102445. };
  102446. this.getChar = function(input, index) {
  102447. return (input[index + 3] & 0xff) << 24 | (input[index + 2] & 0xff) << 16 |
  102448. (input[index + 1] & 0xff) << 8 | (input[index + 0] & 0xff);
  102449. };
  102450. };
  102451. util.inherits(module.exports.UTF_32LE, UTF_32);
  102452. /***/ }),
  102453. /* 752 */
  102454. /***/ (function(module, exports, __webpack_require__) {
  102455. var Match = __webpack_require__ (131);
  102456. /**
  102457. * Charset recognizer for UTF-8
  102458. */
  102459. module.exports = function() {
  102460. this.name = function() {
  102461. return 'UTF-8';
  102462. };
  102463. this.match = function(det) {
  102464. var hasBOM = false,
  102465. numValid = 0,
  102466. numInvalid = 0,
  102467. input = det.fRawInput,
  102468. trailBytes = 0,
  102469. confidence;
  102470. if (det.fRawLength >= 3 &&
  102471. (input[0] & 0xff) == 0xef && (input[1] & 0xff) == 0xbb && (input[2] & 0xff) == 0xbf) {
  102472. hasBOM = true;
  102473. }
  102474. // Scan for multi-byte sequences
  102475. for (var i = 0; i < det.fRawLength; i++) {
  102476. var b = input[i];
  102477. if ((b & 0x80) == 0)
  102478. continue; // ASCII
  102479. // Hi bit on char found. Figure out how long the sequence should be
  102480. if ((b & 0x0e0) == 0x0c0) {
  102481. trailBytes = 1;
  102482. } else if ((b & 0x0f0) == 0x0e0) {
  102483. trailBytes = 2;
  102484. } else if ((b & 0x0f8) == 0xf0) {
  102485. trailBytes = 3;
  102486. } else {
  102487. numInvalid++;
  102488. if (numInvalid > 5)
  102489. break;
  102490. trailBytes = 0;
  102491. }
  102492. // Verify that we've got the right number of trail bytes in the sequence
  102493. for (;;) {
  102494. i++;
  102495. if (i >= det.fRawLength)
  102496. break;
  102497. if ((input[i] & 0xc0) != 0x080) {
  102498. numInvalid++;
  102499. break;
  102500. }
  102501. if (--trailBytes == 0) {
  102502. numValid++;
  102503. break;
  102504. }
  102505. }
  102506. }
  102507. // Cook up some sort of confidence score, based on presense of a BOM
  102508. // and the existence of valid and/or invalid multi-byte sequences.
  102509. confidence = 0;
  102510. if (hasBOM && numInvalid == 0)
  102511. confidence = 100;
  102512. else if (hasBOM && numValid > numInvalid * 10)
  102513. confidence = 80;
  102514. else if (numValid > 3 && numInvalid == 0)
  102515. confidence = 100;
  102516. else if (numValid > 0 && numInvalid == 0)
  102517. confidence = 80;
  102518. else if (numValid == 0 && numInvalid == 0)
  102519. // Plain ASCII.
  102520. confidence = 10;
  102521. else if (numValid > numInvalid * 10)
  102522. // Probably corruput utf-8 data. Valid sequences aren't likely by chance.
  102523. confidence = 25;
  102524. else
  102525. return null
  102526. return new Match(det, this, confidence);
  102527. };
  102528. };
  102529. /***/ }),
  102530. /* 753 */
  102531. /***/ (function(module, exports, __webpack_require__) {
  102532. var fs = __webpack_require__(12);
  102533. var utf8 = __webpack_require__(752),
  102534. unicode = __webpack_require__(751),
  102535. mbcs = __webpack_require__(749),
  102536. sbcs = __webpack_require__(750),
  102537. iso2022 = __webpack_require__(748);
  102538. var self = this;
  102539. var recognisers = [
  102540. new utf8,
  102541. new unicode.UTF_16BE,
  102542. new unicode.UTF_16LE,
  102543. new unicode.UTF_32BE,
  102544. new unicode.UTF_32LE,
  102545. new mbcs.sjis,
  102546. new mbcs.big5,
  102547. new mbcs.euc_jp,
  102548. new mbcs.euc_kr,
  102549. new mbcs.gb_18030,
  102550. new iso2022.ISO_2022_JP,
  102551. new iso2022.ISO_2022_KR,
  102552. new iso2022.ISO_2022_CN,
  102553. new sbcs.ISO_8859_1,
  102554. new sbcs.ISO_8859_2,
  102555. new sbcs.ISO_8859_5,
  102556. new sbcs.ISO_8859_6,
  102557. new sbcs.ISO_8859_7,
  102558. new sbcs.ISO_8859_8,
  102559. new sbcs.ISO_8859_9,
  102560. new sbcs.windows_1251,
  102561. new sbcs.windows_1256,
  102562. new sbcs.KOI8_R
  102563. ];
  102564. module.exports.detect = function(buffer, opts) {
  102565. // Tally up the byte occurence statistics.
  102566. var fByteStats = [];
  102567. for (var i = 0; i < 256; i++)
  102568. fByteStats[i] = 0;
  102569. for (var i = buffer.length - 1; i >= 0; i--)
  102570. fByteStats[buffer[i] & 0x00ff]++;
  102571. var fC1Bytes = false;
  102572. for (var i = 0x80; i <= 0x9F; i += 1) {
  102573. if (fByteStats[i] != 0) {
  102574. fC1Bytes = true;
  102575. break;
  102576. }
  102577. }
  102578. var context = {
  102579. fByteStats: fByteStats,
  102580. fC1Bytes: fC1Bytes,
  102581. fRawInput: buffer,
  102582. fRawLength: buffer.length,
  102583. fInputBytes: buffer,
  102584. fInputLen: buffer.length
  102585. };
  102586. var matches = recognisers.map(function(rec) {
  102587. return rec.match(context);
  102588. }).filter(function(match) {
  102589. return !!match;
  102590. }).sort(function(a, b) {
  102591. return b.confidence - a.confidence;
  102592. });
  102593. if (opts && opts.returnAllMatches === true) {
  102594. return matches;
  102595. }
  102596. else {
  102597. return matches.length > 0 ? matches[0].name : null;
  102598. }
  102599. };
  102600. module.exports.detectFile = function(filepath, opts, cb) {
  102601. if (typeof opts === 'function') {
  102602. cb = opts;
  102603. opts = undefined;
  102604. }
  102605. var fd;
  102606. var handler = function(err, buffer) {
  102607. if (fd) {
  102608. fs.closeSync(fd);
  102609. }
  102610. if (err) return cb(err, null);
  102611. cb(null, self.detect(buffer, opts));
  102612. };
  102613. if (opts && opts.sampleSize) {
  102614. fd = fs.openSync(filepath, 'r'),
  102615. sample = Buffer.allocUnsafe(opts.sampleSize);
  102616. fs.read(fd, sample, 0, opts.sampleSize, null, function(err) {
  102617. handler(err, sample);
  102618. });
  102619. return;
  102620. }
  102621. fs.readFile(filepath, handler);
  102622. };
  102623. module.exports.detectFileSync = function(filepath, opts) {
  102624. if (opts && opts.sampleSize) {
  102625. var fd = fs.openSync(filepath, 'r'),
  102626. sample = Buffer.allocUnsafe(opts.sampleSize);
  102627. fs.readSync(fd, sample, 0, opts.sampleSize);
  102628. fs.closeSync(fd);
  102629. return self.detect(sample, opts);
  102630. }
  102631. return self.detect(fs.readFileSync(filepath), opts);
  102632. };
  102633. // Wrappers for the previous functions to return all encodings
  102634. module.exports.detectAll = function(buffer, opts) {
  102635. if (typeof opts !== 'object') {
  102636. opts = {};
  102637. }
  102638. opts.returnAllMatches = true;
  102639. return self.detect(buffer, opts);
  102640. }
  102641. module.exports.detectFileAll = function(filepath, opts, cb) {
  102642. if (typeof opts === 'function') {
  102643. cb = opts;
  102644. opts = undefined;
  102645. }
  102646. if (typeof opts !== 'object') {
  102647. opts = {};
  102648. }
  102649. opts.returnAllMatches = true;
  102650. self.detectFile(filepath, opts, cb);
  102651. }
  102652. module.exports.detectFileAllSync = function(filepath, opts) {
  102653. if (typeof opts !== 'object') {
  102654. opts = {};
  102655. }
  102656. opts.returnAllMatches = true;
  102657. return self.detectFileSync(filepath, opts);
  102658. }
  102659. /***/ }),
  102660. /* 754 */
  102661. /***/ (function(module, exports, __webpack_require__) {
  102662. "use strict";
  102663. /***
  102664. * Node External Editor
  102665. *
  102666. * Kevin Gravier <kevin@mrkmg.com>
  102667. * MIT 2018
  102668. */
  102669. var __extends = (this && this.__extends) || (function () {
  102670. var extendStatics = function (d, b) {
  102671. extendStatics = Object.setPrototypeOf ||
  102672. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  102673. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  102674. return extendStatics(d, b);
  102675. }
  102676. return function (d, b) {
  102677. extendStatics(d, b);
  102678. function __() { this.constructor = d; }
  102679. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  102680. };
  102681. })();
  102682. Object.defineProperty(exports, "__esModule", { value: true });
  102683. var CreateFileError = /** @class */ (function (_super) {
  102684. __extends(CreateFileError, _super);
  102685. function CreateFileError(originalError) {
  102686. var _newTarget = this.constructor;
  102687. var _this = _super.call(this, "Failed to create temporary file for editor") || this;
  102688. _this.originalError = originalError;
  102689. var proto = _newTarget.prototype;
  102690. if (Object.setPrototypeOf) {
  102691. Object.setPrototypeOf(_this, proto);
  102692. }
  102693. else {
  102694. _this.__proto__ = _newTarget.prototype;
  102695. }
  102696. return _this;
  102697. }
  102698. return CreateFileError;
  102699. }(Error));
  102700. exports.CreateFileError = CreateFileError;
  102701. /***/ }),
  102702. /* 755 */
  102703. /***/ (function(module, exports, __webpack_require__) {
  102704. "use strict";
  102705. /***
  102706. * Node External Editor
  102707. *
  102708. * Kevin Gravier <kevin@mrkmg.com>
  102709. * MIT 2018
  102710. */
  102711. var __extends = (this && this.__extends) || (function () {
  102712. var extendStatics = function (d, b) {
  102713. extendStatics = Object.setPrototypeOf ||
  102714. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  102715. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  102716. return extendStatics(d, b);
  102717. }
  102718. return function (d, b) {
  102719. extendStatics(d, b);
  102720. function __() { this.constructor = d; }
  102721. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  102722. };
  102723. })();
  102724. Object.defineProperty(exports, "__esModule", { value: true });
  102725. var LaunchEditorError = /** @class */ (function (_super) {
  102726. __extends(LaunchEditorError, _super);
  102727. function LaunchEditorError(originalError) {
  102728. var _newTarget = this.constructor;
  102729. var _this = _super.call(this, "Failed launch editor") || this;
  102730. _this.originalError = originalError;
  102731. var proto = _newTarget.prototype;
  102732. if (Object.setPrototypeOf) {
  102733. Object.setPrototypeOf(_this, proto);
  102734. }
  102735. else {
  102736. _this.__proto__ = _newTarget.prototype;
  102737. }
  102738. return _this;
  102739. }
  102740. return LaunchEditorError;
  102741. }(Error));
  102742. exports.LaunchEditorError = LaunchEditorError;
  102743. /***/ }),
  102744. /* 756 */
  102745. /***/ (function(module, exports, __webpack_require__) {
  102746. "use strict";
  102747. /***
  102748. * Node External Editor
  102749. *
  102750. * Kevin Gravier <kevin@mrkmg.com>
  102751. * MIT 2018
  102752. */
  102753. var __extends = (this && this.__extends) || (function () {
  102754. var extendStatics = function (d, b) {
  102755. extendStatics = Object.setPrototypeOf ||
  102756. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  102757. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  102758. return extendStatics(d, b);
  102759. }
  102760. return function (d, b) {
  102761. extendStatics(d, b);
  102762. function __() { this.constructor = d; }
  102763. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  102764. };
  102765. })();
  102766. Object.defineProperty(exports, "__esModule", { value: true });
  102767. var ReadFileError = /** @class */ (function (_super) {
  102768. __extends(ReadFileError, _super);
  102769. function ReadFileError(originalError) {
  102770. var _newTarget = this.constructor;
  102771. var _this = _super.call(this, "Failed to read temporary file") || this;
  102772. _this.originalError = originalError;
  102773. var proto = _newTarget.prototype;
  102774. if (Object.setPrototypeOf) {
  102775. Object.setPrototypeOf(_this, proto);
  102776. }
  102777. else {
  102778. _this.__proto__ = _newTarget.prototype;
  102779. }
  102780. return _this;
  102781. }
  102782. return ReadFileError;
  102783. }(Error));
  102784. exports.ReadFileError = ReadFileError;
  102785. /***/ }),
  102786. /* 757 */
  102787. /***/ (function(module, exports, __webpack_require__) {
  102788. "use strict";
  102789. /***
  102790. * Node External Editor
  102791. *
  102792. * Kevin Gravier <kevin@mrkmg.com>
  102793. * MIT 2018
  102794. */
  102795. var __extends = (this && this.__extends) || (function () {
  102796. var extendStatics = function (d, b) {
  102797. extendStatics = Object.setPrototypeOf ||
  102798. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  102799. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  102800. return extendStatics(d, b);
  102801. }
  102802. return function (d, b) {
  102803. extendStatics(d, b);
  102804. function __() { this.constructor = d; }
  102805. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  102806. };
  102807. })();
  102808. Object.defineProperty(exports, "__esModule", { value: true });
  102809. var RemoveFileError = /** @class */ (function (_super) {
  102810. __extends(RemoveFileError, _super);
  102811. function RemoveFileError(originalError) {
  102812. var _newTarget = this.constructor;
  102813. var _this = _super.call(this, "Failed to cleanup temporary file") || this;
  102814. _this.originalError = originalError;
  102815. var proto = _newTarget.prototype;
  102816. if (Object.setPrototypeOf) {
  102817. Object.setPrototypeOf(_this, proto);
  102818. }
  102819. else {
  102820. _this.__proto__ = _newTarget.prototype;
  102821. }
  102822. return _this;
  102823. }
  102824. return RemoveFileError;
  102825. }(Error));
  102826. exports.RemoveFileError = RemoveFileError;
  102827. /***/ }),
  102828. /* 758 */
  102829. /***/ (function(module, exports, __webpack_require__) {
  102830. "use strict";
  102831. /***
  102832. * Node External Editor
  102833. *
  102834. * Kevin Gravier <kevin@mrkmg.com>
  102835. * MIT 2018
  102836. */
  102837. Object.defineProperty(exports, "__esModule", { value: true });
  102838. var chardet_1 = __webpack_require__(753);
  102839. var child_process_1 = __webpack_require__(271);
  102840. var fs_1 = __webpack_require__(12);
  102841. var iconv_lite_1 = __webpack_require__(775);
  102842. var tmp_1 = __webpack_require__(1027);
  102843. var CreateFileError_1 = __webpack_require__(754);
  102844. exports.CreateFileError = CreateFileError_1.CreateFileError;
  102845. var LaunchEditorError_1 = __webpack_require__(755);
  102846. exports.LaunchEditorError = LaunchEditorError_1.LaunchEditorError;
  102847. var ReadFileError_1 = __webpack_require__(756);
  102848. exports.ReadFileError = ReadFileError_1.ReadFileError;
  102849. var RemoveFileError_1 = __webpack_require__(757);
  102850. exports.RemoveFileError = RemoveFileError_1.RemoveFileError;
  102851. function edit(text) {
  102852. if (text === void 0) { text = ""; }
  102853. var editor = new ExternalEditor(text);
  102854. editor.run();
  102855. editor.cleanup();
  102856. return editor.text;
  102857. }
  102858. exports.edit = edit;
  102859. function editAsync(text, callback) {
  102860. if (text === void 0) { text = ""; }
  102861. var editor = new ExternalEditor(text);
  102862. editor.runAsync(function (err, result) {
  102863. if (err) {
  102864. setImmediate(callback, err, null);
  102865. }
  102866. else {
  102867. try {
  102868. editor.cleanup();
  102869. setImmediate(callback, null, result);
  102870. }
  102871. catch (cleanupError) {
  102872. setImmediate(callback, cleanupError, null);
  102873. }
  102874. }
  102875. });
  102876. }
  102877. exports.editAsync = editAsync;
  102878. var ExternalEditor = /** @class */ (function () {
  102879. function ExternalEditor(text) {
  102880. if (text === void 0) { text = ""; }
  102881. this.text = "";
  102882. this.text = text;
  102883. this.determineEditor();
  102884. this.createTemporaryFile();
  102885. }
  102886. ExternalEditor.splitStringBySpace = function (str) {
  102887. var pieces = [];
  102888. var currentString = "";
  102889. for (var strIndex = 0; strIndex < str.length; strIndex++) {
  102890. var currentLetter = str[strIndex];
  102891. if (strIndex > 0 && currentLetter === " " && str[strIndex - 1] !== "\\" && currentString.length > 0) {
  102892. pieces.push(currentString);
  102893. currentString = "";
  102894. }
  102895. else {
  102896. currentString += currentLetter;
  102897. }
  102898. }
  102899. if (currentString.length > 0) {
  102900. pieces.push(currentString);
  102901. }
  102902. return pieces;
  102903. };
  102904. Object.defineProperty(ExternalEditor.prototype, "temp_file", {
  102905. get: function () {
  102906. console.log("DEPRECATED: temp_file. Use tempFile moving forward.");
  102907. return this.tempFile;
  102908. },
  102909. enumerable: true,
  102910. configurable: true
  102911. });
  102912. Object.defineProperty(ExternalEditor.prototype, "last_exit_status", {
  102913. get: function () {
  102914. console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward.");
  102915. return this.lastExitStatus;
  102916. },
  102917. enumerable: true,
  102918. configurable: true
  102919. });
  102920. ExternalEditor.prototype.run = function () {
  102921. this.launchEditor();
  102922. this.readTemporaryFile();
  102923. return this.text;
  102924. };
  102925. ExternalEditor.prototype.runAsync = function (callback) {
  102926. var _this = this;
  102927. try {
  102928. this.launchEditorAsync(function () {
  102929. try {
  102930. _this.readTemporaryFile();
  102931. setImmediate(callback, null, _this.text);
  102932. }
  102933. catch (readError) {
  102934. setImmediate(callback, readError, null);
  102935. }
  102936. });
  102937. }
  102938. catch (launchError) {
  102939. setImmediate(callback, launchError, null);
  102940. }
  102941. };
  102942. ExternalEditor.prototype.cleanup = function () {
  102943. this.removeTemporaryFile();
  102944. };
  102945. ExternalEditor.prototype.determineEditor = function () {
  102946. var editor = process.env.VISUAL ? process.env.VISUAL :
  102947. process.env.EDITOR ? process.env.EDITOR :
  102948. /^win/.test(process.platform) ? "notepad" :
  102949. "vim";
  102950. var editorOpts = ExternalEditor.splitStringBySpace(editor).map(function (piece) { return piece.replace("\\ ", " "); });
  102951. var bin = editorOpts.shift();
  102952. this.editor = { args: editorOpts, bin: bin };
  102953. };
  102954. ExternalEditor.prototype.createTemporaryFile = function () {
  102955. try {
  102956. this.tempFile = tmp_1.tmpNameSync({});
  102957. fs_1.writeFileSync(this.tempFile, this.text, { encoding: "utf8" });
  102958. }
  102959. catch (createFileError) {
  102960. throw new CreateFileError_1.CreateFileError(createFileError);
  102961. }
  102962. };
  102963. ExternalEditor.prototype.readTemporaryFile = function () {
  102964. try {
  102965. var tempFileBuffer = fs_1.readFileSync(this.tempFile);
  102966. if (tempFileBuffer.length === 0) {
  102967. this.text = "";
  102968. }
  102969. else {
  102970. var encoding = chardet_1.detect(tempFileBuffer).toString();
  102971. if (!iconv_lite_1.encodingExists(encoding)) {
  102972. // Probably a bad idea, but will at least prevent crashing
  102973. encoding = "utf8";
  102974. }
  102975. this.text = iconv_lite_1.decode(tempFileBuffer, encoding);
  102976. }
  102977. }
  102978. catch (readFileError) {
  102979. throw new ReadFileError_1.ReadFileError(readFileError);
  102980. }
  102981. };
  102982. ExternalEditor.prototype.removeTemporaryFile = function () {
  102983. try {
  102984. fs_1.unlinkSync(this.tempFile);
  102985. }
  102986. catch (removeFileError) {
  102987. throw new RemoveFileError_1.RemoveFileError(removeFileError);
  102988. }
  102989. };
  102990. ExternalEditor.prototype.launchEditor = function () {
  102991. try {
  102992. var editorProcess = child_process_1.spawnSync(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
  102993. this.lastExitStatus = editorProcess.status;
  102994. }
  102995. catch (launchError) {
  102996. throw new LaunchEditorError_1.LaunchEditorError(launchError);
  102997. }
  102998. };
  102999. ExternalEditor.prototype.launchEditorAsync = function (callback) {
  103000. var _this = this;
  103001. try {
  103002. var editorProcess = child_process_1.spawn(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
  103003. editorProcess.on("exit", function (code) {
  103004. _this.lastExitStatus = code;
  103005. setImmediate(callback);
  103006. });
  103007. }
  103008. catch (launchError) {
  103009. throw new LaunchEditorError_1.LaunchEditorError(launchError);
  103010. }
  103011. };
  103012. return ExternalEditor;
  103013. }());
  103014. exports.ExternalEditor = ExternalEditor;
  103015. /***/ }),
  103016. /* 759 */
  103017. /***/ (function(module, exports, __webpack_require__) {
  103018. "use strict";
  103019. var Buffer = __webpack_require__(20).Buffer;
  103020. // Multibyte codec. In this scheme, a character is represented by 1 or more bytes.
  103021. // Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences.
  103022. // To save memory and loading time, we read table files only when requested.
  103023. exports._dbcs = DBCSCodec;
  103024. var UNASSIGNED = -1,
  103025. GB18030_CODE = -2,
  103026. SEQ_START = -10,
  103027. NODE_START = -1000,
  103028. UNASSIGNED_NODE = new Array(0x100),
  103029. DEF_CHAR = -1;
  103030. for (var i = 0; i < 0x100; i++)
  103031. UNASSIGNED_NODE[i] = UNASSIGNED;
  103032. // Class DBCSCodec reads and initializes mapping tables.
  103033. function DBCSCodec(codecOptions, iconv) {
  103034. this.encodingName = codecOptions.encodingName;
  103035. if (!codecOptions)
  103036. throw new Error("DBCS codec is called without the data.")
  103037. if (!codecOptions.table)
  103038. throw new Error("Encoding '" + this.encodingName + "' has no data.");
  103039. // Load tables.
  103040. var mappingTable = codecOptions.table();
  103041. // Decode tables: MBCS -> Unicode.
  103042. // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256.
  103043. // Trie root is decodeTables[0].
  103044. // Values: >= 0 -> unicode character code. can be > 0xFFFF
  103045. // == UNASSIGNED -> unknown/unassigned sequence.
  103046. // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence.
  103047. // <= NODE_START -> index of the next node in our trie to process next byte.
  103048. // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq.
  103049. this.decodeTables = [];
  103050. this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node.
  103051. // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here.
  103052. this.decodeTableSeq = [];
  103053. // Actual mapping tables consist of chunks. Use them to fill up decode tables.
  103054. for (var i = 0; i < mappingTable.length; i++)
  103055. this._addDecodeChunk(mappingTable[i]);
  103056. this.defaultCharUnicode = iconv.defaultCharUnicode;
  103057. // Encode tables: Unicode -> DBCS.
  103058. // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance.
  103059. // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null.
  103060. // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.).
  103061. // == UNASSIGNED -> no conversion found. Output a default char.
  103062. // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence.
  103063. this.encodeTable = [];
  103064. // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of
  103065. // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key
  103066. // means end of sequence (needed when one sequence is a strict subsequence of another).
  103067. // Objects are kept separately from encodeTable to increase performance.
  103068. this.encodeTableSeq = [];
  103069. // Some chars can be decoded, but need not be encoded.
  103070. var skipEncodeChars = {};
  103071. if (codecOptions.encodeSkipVals)
  103072. for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) {
  103073. var val = codecOptions.encodeSkipVals[i];
  103074. if (typeof val === 'number')
  103075. skipEncodeChars[val] = true;
  103076. else
  103077. for (var j = val.from; j <= val.to; j++)
  103078. skipEncodeChars[j] = true;
  103079. }
  103080. // Use decode trie to recursively fill out encode tables.
  103081. this._fillEncodeTable(0, 0, skipEncodeChars);
  103082. // Add more encoding pairs when needed.
  103083. if (codecOptions.encodeAdd) {
  103084. for (var uChar in codecOptions.encodeAdd)
  103085. if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar))
  103086. this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);
  103087. }
  103088. this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];
  103089. if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?'];
  103090. if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0);
  103091. // Load & create GB18030 tables when needed.
  103092. if (typeof codecOptions.gb18030 === 'function') {
  103093. this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges.
  103094. // Add GB18030 decode tables.
  103095. var thirdByteNodeIdx = this.decodeTables.length;
  103096. var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0);
  103097. var fourthByteNodeIdx = this.decodeTables.length;
  103098. var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0);
  103099. for (var i = 0x81; i <= 0xFE; i++) {
  103100. var secondByteNodeIdx = NODE_START - this.decodeTables[0][i];
  103101. var secondByteNode = this.decodeTables[secondByteNodeIdx];
  103102. for (var j = 0x30; j <= 0x39; j++)
  103103. secondByteNode[j] = NODE_START - thirdByteNodeIdx;
  103104. }
  103105. for (var i = 0x81; i <= 0xFE; i++)
  103106. thirdByteNode[i] = NODE_START - fourthByteNodeIdx;
  103107. for (var i = 0x30; i <= 0x39; i++)
  103108. fourthByteNode[i] = GB18030_CODE
  103109. }
  103110. }
  103111. DBCSCodec.prototype.encoder = DBCSEncoder;
  103112. DBCSCodec.prototype.decoder = DBCSDecoder;
  103113. // Decoder helpers
  103114. DBCSCodec.prototype._getDecodeTrieNode = function(addr) {
  103115. var bytes = [];
  103116. for (; addr > 0; addr >>= 8)
  103117. bytes.push(addr & 0xFF);
  103118. if (bytes.length == 0)
  103119. bytes.push(0);
  103120. var node = this.decodeTables[0];
  103121. for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie.
  103122. var val = node[bytes[i]];
  103123. if (val == UNASSIGNED) { // Create new node.
  103124. node[bytes[i]] = NODE_START - this.decodeTables.length;
  103125. this.decodeTables.push(node = UNASSIGNED_NODE.slice(0));
  103126. }
  103127. else if (val <= NODE_START) { // Existing node.
  103128. node = this.decodeTables[NODE_START - val];
  103129. }
  103130. else
  103131. throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16));
  103132. }
  103133. return node;
  103134. }
  103135. DBCSCodec.prototype._addDecodeChunk = function(chunk) {
  103136. // First element of chunk is the hex mbcs code where we start.
  103137. var curAddr = parseInt(chunk[0], 16);
  103138. // Choose the decoding node where we'll write our chars.
  103139. var writeTable = this._getDecodeTrieNode(curAddr);
  103140. curAddr = curAddr & 0xFF;
  103141. // Write all other elements of the chunk to the table.
  103142. for (var k = 1; k < chunk.length; k++) {
  103143. var part = chunk[k];
  103144. if (typeof part === "string") { // String, write as-is.
  103145. for (var l = 0; l < part.length;) {
  103146. var code = part.charCodeAt(l++);
  103147. if (0xD800 <= code && code < 0xDC00) { // Decode surrogate
  103148. var codeTrail = part.charCodeAt(l++);
  103149. if (0xDC00 <= codeTrail && codeTrail < 0xE000)
  103150. writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00);
  103151. else
  103152. throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]);
  103153. }
  103154. else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used)
  103155. var len = 0xFFF - code + 2;
  103156. var seq = [];
  103157. for (var m = 0; m < len; m++)
  103158. seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq.
  103159. writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;
  103160. this.decodeTableSeq.push(seq);
  103161. }
  103162. else
  103163. writeTable[curAddr++] = code; // Basic char
  103164. }
  103165. }
  103166. else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character.
  103167. var charCode = writeTable[curAddr - 1] + 1;
  103168. for (var l = 0; l < part; l++)
  103169. writeTable[curAddr++] = charCode++;
  103170. }
  103171. else
  103172. throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]);
  103173. }
  103174. if (curAddr > 0xFF)
  103175. throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr);
  103176. }
  103177. // Encoder helpers
  103178. DBCSCodec.prototype._getEncodeBucket = function(uCode) {
  103179. var high = uCode >> 8; // This could be > 0xFF because of astral characters.
  103180. if (this.encodeTable[high] === undefined)
  103181. this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand.
  103182. return this.encodeTable[high];
  103183. }
  103184. DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) {
  103185. var bucket = this._getEncodeBucket(uCode);
  103186. var low = uCode & 0xFF;
  103187. if (bucket[low] <= SEQ_START)
  103188. this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it.
  103189. else if (bucket[low] == UNASSIGNED)
  103190. bucket[low] = dbcsCode;
  103191. }
  103192. DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) {
  103193. // Get the root of character tree according to first character of the sequence.
  103194. var uCode = seq[0];
  103195. var bucket = this._getEncodeBucket(uCode);
  103196. var low = uCode & 0xFF;
  103197. var node;
  103198. if (bucket[low] <= SEQ_START) {
  103199. // There's already a sequence with - use it.
  103200. node = this.encodeTableSeq[SEQ_START-bucket[low]];
  103201. }
  103202. else {
  103203. // There was no sequence object - allocate a new one.
  103204. node = {};
  103205. if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence.
  103206. bucket[low] = SEQ_START - this.encodeTableSeq.length;
  103207. this.encodeTableSeq.push(node);
  103208. }
  103209. // Traverse the character tree, allocating new nodes as needed.
  103210. for (var j = 1; j < seq.length-1; j++) {
  103211. var oldVal = node[uCode];
  103212. if (typeof oldVal === 'object')
  103213. node = oldVal;
  103214. else {
  103215. node = node[uCode] = {}
  103216. if (oldVal !== undefined)
  103217. node[DEF_CHAR] = oldVal
  103218. }
  103219. }
  103220. // Set the leaf to given dbcsCode.
  103221. uCode = seq[seq.length-1];
  103222. node[uCode] = dbcsCode;
  103223. }
  103224. DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) {
  103225. var node = this.decodeTables[nodeIdx];
  103226. for (var i = 0; i < 0x100; i++) {
  103227. var uCode = node[i];
  103228. var mbCode = prefix + i;
  103229. if (skipEncodeChars[mbCode])
  103230. continue;
  103231. if (uCode >= 0)
  103232. this._setEncodeChar(uCode, mbCode);
  103233. else if (uCode <= NODE_START)
  103234. this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars);
  103235. else if (uCode <= SEQ_START)
  103236. this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode);
  103237. }
  103238. }
  103239. // == Encoder ==================================================================
  103240. function DBCSEncoder(options, codec) {
  103241. // Encoder state
  103242. this.leadSurrogate = -1;
  103243. this.seqObj = undefined;
  103244. // Static data
  103245. this.encodeTable = codec.encodeTable;
  103246. this.encodeTableSeq = codec.encodeTableSeq;
  103247. this.defaultCharSingleByte = codec.defCharSB;
  103248. this.gb18030 = codec.gb18030;
  103249. }
  103250. DBCSEncoder.prototype.write = function(str) {
  103251. var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)),
  103252. leadSurrogate = this.leadSurrogate,
  103253. seqObj = this.seqObj, nextChar = -1,
  103254. i = 0, j = 0;
  103255. while (true) {
  103256. // 0. Get next character.
  103257. if (nextChar === -1) {
  103258. if (i == str.length) break;
  103259. var uCode = str.charCodeAt(i++);
  103260. }
  103261. else {
  103262. var uCode = nextChar;
  103263. nextChar = -1;
  103264. }
  103265. // 1. Handle surrogates.
  103266. if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates.
  103267. if (uCode < 0xDC00) { // We've got lead surrogate.
  103268. if (leadSurrogate === -1) {
  103269. leadSurrogate = uCode;
  103270. continue;
  103271. } else {
  103272. leadSurrogate = uCode;
  103273. // Double lead surrogate found.
  103274. uCode = UNASSIGNED;
  103275. }
  103276. } else { // We've got trail surrogate.
  103277. if (leadSurrogate !== -1) {
  103278. uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00);
  103279. leadSurrogate = -1;
  103280. } else {
  103281. // Incomplete surrogate pair - only trail surrogate found.
  103282. uCode = UNASSIGNED;
  103283. }
  103284. }
  103285. }
  103286. else if (leadSurrogate !== -1) {
  103287. // Incomplete surrogate pair - only lead surrogate found.
  103288. nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char.
  103289. leadSurrogate = -1;
  103290. }
  103291. // 2. Convert uCode character.
  103292. var dbcsCode = UNASSIGNED;
  103293. if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence
  103294. var resCode = seqObj[uCode];
  103295. if (typeof resCode === 'object') { // Sequence continues.
  103296. seqObj = resCode;
  103297. continue;
  103298. } else if (typeof resCode == 'number') { // Sequence finished. Write it.
  103299. dbcsCode = resCode;
  103300. } else if (resCode == undefined) { // Current character is not part of the sequence.
  103301. // Try default character for this sequence
  103302. resCode = seqObj[DEF_CHAR];
  103303. if (resCode !== undefined) {
  103304. dbcsCode = resCode; // Found. Write it.
  103305. nextChar = uCode; // Current character will be written too in the next iteration.
  103306. } else {
  103307. // TODO: What if we have no default? (resCode == undefined)
  103308. // Then, we should write first char of the sequence as-is and try the rest recursively.
  103309. // Didn't do it for now because no encoding has this situation yet.
  103310. // Currently, just skip the sequence and write current char.
  103311. }
  103312. }
  103313. seqObj = undefined;
  103314. }
  103315. else if (uCode >= 0) { // Regular character
  103316. var subtable = this.encodeTable[uCode >> 8];
  103317. if (subtable !== undefined)
  103318. dbcsCode = subtable[uCode & 0xFF];
  103319. if (dbcsCode <= SEQ_START) { // Sequence start
  103320. seqObj = this.encodeTableSeq[SEQ_START-dbcsCode];
  103321. continue;
  103322. }
  103323. if (dbcsCode == UNASSIGNED && this.gb18030) {
  103324. // Use GB18030 algorithm to find character(s) to write.
  103325. var idx = findIdx(this.gb18030.uChars, uCode);
  103326. if (idx != -1) {
  103327. var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);
  103328. newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600;
  103329. newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260;
  103330. newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10;
  103331. newBuf[j++] = 0x30 + dbcsCode;
  103332. continue;
  103333. }
  103334. }
  103335. }
  103336. // 3. Write dbcsCode character.
  103337. if (dbcsCode === UNASSIGNED)
  103338. dbcsCode = this.defaultCharSingleByte;
  103339. if (dbcsCode < 0x100) {
  103340. newBuf[j++] = dbcsCode;
  103341. }
  103342. else if (dbcsCode < 0x10000) {
  103343. newBuf[j++] = dbcsCode >> 8; // high byte
  103344. newBuf[j++] = dbcsCode & 0xFF; // low byte
  103345. }
  103346. else {
  103347. newBuf[j++] = dbcsCode >> 16;
  103348. newBuf[j++] = (dbcsCode >> 8) & 0xFF;
  103349. newBuf[j++] = dbcsCode & 0xFF;
  103350. }
  103351. }
  103352. this.seqObj = seqObj;
  103353. this.leadSurrogate = leadSurrogate;
  103354. return newBuf.slice(0, j);
  103355. }
  103356. DBCSEncoder.prototype.end = function() {
  103357. if (this.leadSurrogate === -1 && this.seqObj === undefined)
  103358. return; // All clean. Most often case.
  103359. var newBuf = Buffer.alloc(10), j = 0;
  103360. if (this.seqObj) { // We're in the sequence.
  103361. var dbcsCode = this.seqObj[DEF_CHAR];
  103362. if (dbcsCode !== undefined) { // Write beginning of the sequence.
  103363. if (dbcsCode < 0x100) {
  103364. newBuf[j++] = dbcsCode;
  103365. }
  103366. else {
  103367. newBuf[j++] = dbcsCode >> 8; // high byte
  103368. newBuf[j++] = dbcsCode & 0xFF; // low byte
  103369. }
  103370. } else {
  103371. // See todo above.
  103372. }
  103373. this.seqObj = undefined;
  103374. }
  103375. if (this.leadSurrogate !== -1) {
  103376. // Incomplete surrogate pair - only lead surrogate found.
  103377. newBuf[j++] = this.defaultCharSingleByte;
  103378. this.leadSurrogate = -1;
  103379. }
  103380. return newBuf.slice(0, j);
  103381. }
  103382. // Export for testing
  103383. DBCSEncoder.prototype.findIdx = findIdx;
  103384. // == Decoder ==================================================================
  103385. function DBCSDecoder(options, codec) {
  103386. // Decoder state
  103387. this.nodeIdx = 0;
  103388. this.prevBuf = Buffer.alloc(0);
  103389. // Static data
  103390. this.decodeTables = codec.decodeTables;
  103391. this.decodeTableSeq = codec.decodeTableSeq;
  103392. this.defaultCharUnicode = codec.defaultCharUnicode;
  103393. this.gb18030 = codec.gb18030;
  103394. }
  103395. DBCSDecoder.prototype.write = function(buf) {
  103396. var newBuf = Buffer.alloc(buf.length*2),
  103397. nodeIdx = this.nodeIdx,
  103398. prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,
  103399. seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.
  103400. uCode;
  103401. if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later.
  103402. prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]);
  103403. for (var i = 0, j = 0; i < buf.length; i++) {
  103404. var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset];
  103405. // Lookup in current trie node.
  103406. var uCode = this.decodeTables[nodeIdx][curByte];
  103407. if (uCode >= 0) {
  103408. // Normal character, just use it.
  103409. }
  103410. else if (uCode === UNASSIGNED) { // Unknown char.
  103411. // TODO: Callback with seq.
  103412. //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);
  103413. i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle).
  103414. uCode = this.defaultCharUnicode.charCodeAt(0);
  103415. }
  103416. else if (uCode === GB18030_CODE) {
  103417. var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);
  103418. var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30);
  103419. var idx = findIdx(this.gb18030.gbChars, ptr);
  103420. uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx];
  103421. }
  103422. else if (uCode <= NODE_START) { // Go to next trie node.
  103423. nodeIdx = NODE_START - uCode;
  103424. continue;
  103425. }
  103426. else if (uCode <= SEQ_START) { // Output a sequence of chars.
  103427. var seq = this.decodeTableSeq[SEQ_START - uCode];
  103428. for (var k = 0; k < seq.length - 1; k++) {
  103429. uCode = seq[k];
  103430. newBuf[j++] = uCode & 0xFF;
  103431. newBuf[j++] = uCode >> 8;
  103432. }
  103433. uCode = seq[seq.length-1];
  103434. }
  103435. else
  103436. throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte);
  103437. // Write the character to buffer, handling higher planes using surrogate pair.
  103438. if (uCode > 0xFFFF) {
  103439. uCode -= 0x10000;
  103440. var uCodeLead = 0xD800 + Math.floor(uCode / 0x400);
  103441. newBuf[j++] = uCodeLead & 0xFF;
  103442. newBuf[j++] = uCodeLead >> 8;
  103443. uCode = 0xDC00 + uCode % 0x400;
  103444. }
  103445. newBuf[j++] = uCode & 0xFF;
  103446. newBuf[j++] = uCode >> 8;
  103447. // Reset trie node.
  103448. nodeIdx = 0; seqStart = i+1;
  103449. }
  103450. this.nodeIdx = nodeIdx;
  103451. this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset);
  103452. return newBuf.slice(0, j).toString('ucs2');
  103453. }
  103454. DBCSDecoder.prototype.end = function() {
  103455. var ret = '';
  103456. // Try to parse all remaining chars.
  103457. while (this.prevBuf.length > 0) {
  103458. // Skip 1 character in the buffer.
  103459. ret += this.defaultCharUnicode;
  103460. var buf = this.prevBuf.slice(1);
  103461. // Parse remaining as usual.
  103462. this.prevBuf = Buffer.alloc(0);
  103463. this.nodeIdx = 0;
  103464. if (buf.length > 0)
  103465. ret += this.write(buf);
  103466. }
  103467. this.nodeIdx = 0;
  103468. return ret;
  103469. }
  103470. // Binary search for GB18030. Returns largest i such that table[i] <= val.
  103471. function findIdx(table, val) {
  103472. if (table[0] > val)
  103473. return -1;
  103474. var l = 0, r = table.length;
  103475. while (l < r-1) { // always table[l] <= val < table[r]
  103476. var mid = l + Math.floor((r-l+1)/2);
  103477. if (table[mid] <= val)
  103478. l = mid;
  103479. else
  103480. r = mid;
  103481. }
  103482. return l;
  103483. }
  103484. /***/ }),
  103485. /* 760 */
  103486. /***/ (function(module, exports, __webpack_require__) {
  103487. "use strict";
  103488. // Description of supported double byte encodings and aliases.
  103489. // Tables are not require()-d until they are needed to speed up library load.
  103490. // require()-s are direct to support Browserify.
  103491. module.exports = {
  103492. // == Japanese/ShiftJIS ====================================================
  103493. // All japanese encodings are based on JIS X set of standards:
  103494. // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
  103495. // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes.
  103496. // Has several variations in 1978, 1983, 1990 and 1997.
  103497. // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
  103498. // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.
  103499. // 2 planes, first is superset of 0208, second - revised 0212.
  103500. // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)
  103501. // Byte encodings are:
  103502. // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte
  103503. // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.
  103504. // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.
  103505. // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes.
  103506. // 0x00-0x7F - lower part of 0201
  103507. // 0x8E, 0xA1-0xDF - upper part of 0201
  103508. // (0xA1-0xFE)x2 - 0208 plane (94x94).
  103509. // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).
  103510. // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
  103511. // Used as-is in ISO2022 family.
  103512. // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII,
  103513. // 0201-1976 Roman, 0208-1978, 0208-1983.
  103514. // * ISO2022-JP-1: Adds esc seq for 0212-1990.
  103515. // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.
  103516. // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.
  103517. // * ISO2022-JP-2004: Adds 0213-2004 Plane 1.
  103518. //
  103519. // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.
  103520. //
  103521. // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html
  103522. 'shiftjis': {
  103523. type: '_dbcs',
  103524. table: function() { return __webpack_require__(770) },
  103525. encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
  103526. encodeSkipVals: [{from: 0xED40, to: 0xF940}],
  103527. },
  103528. 'csshiftjis': 'shiftjis',
  103529. 'mskanji': 'shiftjis',
  103530. 'sjis': 'shiftjis',
  103531. 'windows31j': 'shiftjis',
  103532. 'ms31j': 'shiftjis',
  103533. 'xsjis': 'shiftjis',
  103534. 'windows932': 'shiftjis',
  103535. 'ms932': 'shiftjis',
  103536. '932': 'shiftjis',
  103537. 'cp932': 'shiftjis',
  103538. 'eucjp': {
  103539. type: '_dbcs',
  103540. table: function() { return __webpack_require__(768) },
  103541. encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
  103542. },
  103543. // TODO: KDDI extension to Shift_JIS
  103544. // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.
  103545. // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.
  103546. // == Chinese/GBK ==========================================================
  103547. // http://en.wikipedia.org/wiki/GBK
  103548. // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder
  103549. // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936
  103550. 'gb2312': 'cp936',
  103551. 'gb231280': 'cp936',
  103552. 'gb23121980': 'cp936',
  103553. 'csgb2312': 'cp936',
  103554. 'csiso58gb231280': 'cp936',
  103555. 'euccn': 'cp936',
  103556. // Microsoft's CP936 is a subset and approximation of GBK.
  103557. 'windows936': 'cp936',
  103558. 'ms936': 'cp936',
  103559. '936': 'cp936',
  103560. 'cp936': {
  103561. type: '_dbcs',
  103562. table: function() { return __webpack_require__(238) },
  103563. },
  103564. // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
  103565. 'gbk': {
  103566. type: '_dbcs',
  103567. table: function() { return __webpack_require__(238).concat(__webpack_require__(364)) },
  103568. },
  103569. 'xgbk': 'gbk',
  103570. 'isoir58': 'gbk',
  103571. // GB18030 is an algorithmic extension of GBK.
  103572. // Main source: https://www.w3.org/TR/encoding/#gbk-encoder
  103573. // http://icu-project.org/docs/papers/gb18030.html
  103574. // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
  103575. // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
  103576. 'gb18030': {
  103577. type: '_dbcs',
  103578. table: function() { return __webpack_require__(238).concat(__webpack_require__(364)) },
  103579. gb18030: function() { return __webpack_require__(769) },
  103580. encodeSkipVals: [0x80],
  103581. encodeAdd: {'€': 0xA2E3},
  103582. },
  103583. 'chinese': 'gb18030',
  103584. // == Korean ===============================================================
  103585. // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.
  103586. 'windows949': 'cp949',
  103587. 'ms949': 'cp949',
  103588. '949': 'cp949',
  103589. 'cp949': {
  103590. type: '_dbcs',
  103591. table: function() { return __webpack_require__(767) },
  103592. },
  103593. 'cseuckr': 'cp949',
  103594. 'csksc56011987': 'cp949',
  103595. 'euckr': 'cp949',
  103596. 'isoir149': 'cp949',
  103597. 'korean': 'cp949',
  103598. 'ksc56011987': 'cp949',
  103599. 'ksc56011989': 'cp949',
  103600. 'ksc5601': 'cp949',
  103601. // == Big5/Taiwan/Hong Kong ================================================
  103602. // There are lots of tables for Big5 and cp950. Please see the following links for history:
  103603. // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html
  103604. // Variations, in roughly number of defined chars:
  103605. // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
  103606. // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/
  103607. // * Big5-2003 (Taiwan standard) almost superset of cp950.
  103608. // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
  103609. // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard.
  103610. // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
  103611. // Plus, it has 4 combining sequences.
  103612. // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299
  103613. // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.
  103614. // Implementations are not consistent within browsers; sometimes labeled as just big5.
  103615. // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.
  103616. // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31
  103617. // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.
  103618. // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
  103619. // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
  103620. //
  103621. // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
  103622. // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
  103623. 'windows950': 'cp950',
  103624. 'ms950': 'cp950',
  103625. '950': 'cp950',
  103626. 'cp950': {
  103627. type: '_dbcs',
  103628. table: function() { return __webpack_require__(363) },
  103629. },
  103630. // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
  103631. 'big5': 'big5hkscs',
  103632. 'big5hkscs': {
  103633. type: '_dbcs',
  103634. table: function() { return __webpack_require__(363).concat(__webpack_require__(766)) },
  103635. encodeSkipVals: [0xa2cc],
  103636. },
  103637. 'cnbig5': 'big5hkscs',
  103638. 'csbig5': 'big5hkscs',
  103639. 'xxbig5': 'big5hkscs',
  103640. };
  103641. /***/ }),
  103642. /* 761 */
  103643. /***/ (function(module, exports, __webpack_require__) {
  103644. "use strict";
  103645. // Update this array if you add/rename/remove files in this directory.
  103646. // We support Browserify by skipping automatic module discovery and requiring modules directly.
  103647. var modules = [
  103648. __webpack_require__(762),
  103649. __webpack_require__(771),
  103650. __webpack_require__(772),
  103651. __webpack_require__(763),
  103652. __webpack_require__(765),
  103653. __webpack_require__(764),
  103654. __webpack_require__(759),
  103655. __webpack_require__(760),
  103656. ];
  103657. // Put all encoding/alias/codec definitions to single object and export it.
  103658. for (var i = 0; i < modules.length; i++) {
  103659. var module = modules[i];
  103660. for (var enc in module)
  103661. if (Object.prototype.hasOwnProperty.call(module, enc))
  103662. exports[enc] = module[enc];
  103663. }
  103664. /***/ }),
  103665. /* 762 */
  103666. /***/ (function(module, exports, __webpack_require__) {
  103667. "use strict";
  103668. var Buffer = __webpack_require__(20).Buffer;
  103669. // Export Node.js internal encodings.
  103670. module.exports = {
  103671. // Encodings
  103672. utf8: { type: "_internal", bomAware: true},
  103673. cesu8: { type: "_internal", bomAware: true},
  103674. unicode11utf8: "utf8",
  103675. ucs2: { type: "_internal", bomAware: true},
  103676. utf16le: "ucs2",
  103677. binary: { type: "_internal" },
  103678. base64: { type: "_internal" },
  103679. hex: { type: "_internal" },
  103680. // Codec.
  103681. _internal: InternalCodec,
  103682. };
  103683. //------------------------------------------------------------------------------
  103684. function InternalCodec(codecOptions, iconv) {
  103685. this.enc = codecOptions.encodingName;
  103686. this.bomAware = codecOptions.bomAware;
  103687. if (this.enc === "base64")
  103688. this.encoder = InternalEncoderBase64;
  103689. else if (this.enc === "cesu8") {
  103690. this.enc = "utf8"; // Use utf8 for decoding.
  103691. this.encoder = InternalEncoderCesu8;
  103692. // Add decoder for versions of Node not supporting CESU-8
  103693. if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') {
  103694. this.decoder = InternalDecoderCesu8;
  103695. this.defaultCharUnicode = iconv.defaultCharUnicode;
  103696. }
  103697. }
  103698. }
  103699. InternalCodec.prototype.encoder = InternalEncoder;
  103700. InternalCodec.prototype.decoder = InternalDecoder;
  103701. //------------------------------------------------------------------------------
  103702. // We use node.js internal decoder. Its signature is the same as ours.
  103703. var StringDecoder = __webpack_require__(272).StringDecoder;
  103704. if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method.
  103705. StringDecoder.prototype.end = function() {};
  103706. function InternalDecoder(options, codec) {
  103707. StringDecoder.call(this, codec.enc);
  103708. }
  103709. InternalDecoder.prototype = StringDecoder.prototype;
  103710. //------------------------------------------------------------------------------
  103711. // Encoder is mostly trivial
  103712. function InternalEncoder(options, codec) {
  103713. this.enc = codec.enc;
  103714. }
  103715. InternalEncoder.prototype.write = function(str) {
  103716. return Buffer.from(str, this.enc);
  103717. }
  103718. InternalEncoder.prototype.end = function() {
  103719. }
  103720. //------------------------------------------------------------------------------
  103721. // Except base64 encoder, which must keep its state.
  103722. function InternalEncoderBase64(options, codec) {
  103723. this.prevStr = '';
  103724. }
  103725. InternalEncoderBase64.prototype.write = function(str) {
  103726. str = this.prevStr + str;
  103727. var completeQuads = str.length - (str.length % 4);
  103728. this.prevStr = str.slice(completeQuads);
  103729. str = str.slice(0, completeQuads);
  103730. return Buffer.from(str, "base64");
  103731. }
  103732. InternalEncoderBase64.prototype.end = function() {
  103733. return Buffer.from(this.prevStr, "base64");
  103734. }
  103735. //------------------------------------------------------------------------------
  103736. // CESU-8 encoder is also special.
  103737. function InternalEncoderCesu8(options, codec) {
  103738. }
  103739. InternalEncoderCesu8.prototype.write = function(str) {
  103740. var buf = Buffer.alloc(str.length * 3), bufIdx = 0;
  103741. for (var i = 0; i < str.length; i++) {
  103742. var charCode = str.charCodeAt(i);
  103743. // Naive implementation, but it works because CESU-8 is especially easy
  103744. // to convert from UTF-16 (which all JS strings are encoded in).
  103745. if (charCode < 0x80)
  103746. buf[bufIdx++] = charCode;
  103747. else if (charCode < 0x800) {
  103748. buf[bufIdx++] = 0xC0 + (charCode >>> 6);
  103749. buf[bufIdx++] = 0x80 + (charCode & 0x3f);
  103750. }
  103751. else { // charCode will always be < 0x10000 in javascript.
  103752. buf[bufIdx++] = 0xE0 + (charCode >>> 12);
  103753. buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f);
  103754. buf[bufIdx++] = 0x80 + (charCode & 0x3f);
  103755. }
  103756. }
  103757. return buf.slice(0, bufIdx);
  103758. }
  103759. InternalEncoderCesu8.prototype.end = function() {
  103760. }
  103761. //------------------------------------------------------------------------------
  103762. // CESU-8 decoder is not implemented in Node v4.0+
  103763. function InternalDecoderCesu8(options, codec) {
  103764. this.acc = 0;
  103765. this.contBytes = 0;
  103766. this.accBytes = 0;
  103767. this.defaultCharUnicode = codec.defaultCharUnicode;
  103768. }
  103769. InternalDecoderCesu8.prototype.write = function(buf) {
  103770. var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes,
  103771. res = '';
  103772. for (var i = 0; i < buf.length; i++) {
  103773. var curByte = buf[i];
  103774. if ((curByte & 0xC0) !== 0x80) { // Leading byte
  103775. if (contBytes > 0) { // Previous code is invalid
  103776. res += this.defaultCharUnicode;
  103777. contBytes = 0;
  103778. }
  103779. if (curByte < 0x80) { // Single-byte code
  103780. res += String.fromCharCode(curByte);
  103781. } else if (curByte < 0xE0) { // Two-byte code
  103782. acc = curByte & 0x1F;
  103783. contBytes = 1; accBytes = 1;
  103784. } else if (curByte < 0xF0) { // Three-byte code
  103785. acc = curByte & 0x0F;
  103786. contBytes = 2; accBytes = 1;
  103787. } else { // Four or more are not supported for CESU-8.
  103788. res += this.defaultCharUnicode;
  103789. }
  103790. } else { // Continuation byte
  103791. if (contBytes > 0) { // We're waiting for it.
  103792. acc = (acc << 6) | (curByte & 0x3f);
  103793. contBytes--; accBytes++;
  103794. if (contBytes === 0) {
  103795. // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80)
  103796. if (accBytes === 2 && acc < 0x80 && acc > 0)
  103797. res += this.defaultCharUnicode;
  103798. else if (accBytes === 3 && acc < 0x800)
  103799. res += this.defaultCharUnicode;
  103800. else
  103801. // Actually add character.
  103802. res += String.fromCharCode(acc);
  103803. }
  103804. } else { // Unexpected continuation byte
  103805. res += this.defaultCharUnicode;
  103806. }
  103807. }
  103808. }
  103809. this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes;
  103810. return res;
  103811. }
  103812. InternalDecoderCesu8.prototype.end = function() {
  103813. var res = 0;
  103814. if (this.contBytes > 0)
  103815. res += this.defaultCharUnicode;
  103816. return res;
  103817. }
  103818. /***/ }),
  103819. /* 763 */
  103820. /***/ (function(module, exports, __webpack_require__) {
  103821. "use strict";
  103822. var Buffer = __webpack_require__(20).Buffer;
  103823. // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that
  103824. // correspond to encoded bytes (if 128 - then lower half is ASCII).
  103825. exports._sbcs = SBCSCodec;
  103826. function SBCSCodec(codecOptions, iconv) {
  103827. if (!codecOptions)
  103828. throw new Error("SBCS codec is called without the data.")
  103829. // Prepare char buffer for decoding.
  103830. if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))
  103831. throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)");
  103832. if (codecOptions.chars.length === 128) {
  103833. var asciiString = "";
  103834. for (var i = 0; i < 128; i++)
  103835. asciiString += String.fromCharCode(i);
  103836. codecOptions.chars = asciiString + codecOptions.chars;
  103837. }
  103838. this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2');
  103839. // Encoding buffer.
  103840. var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
  103841. for (var i = 0; i < codecOptions.chars.length; i++)
  103842. encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
  103843. this.encodeBuf = encodeBuf;
  103844. }
  103845. SBCSCodec.prototype.encoder = SBCSEncoder;
  103846. SBCSCodec.prototype.decoder = SBCSDecoder;
  103847. function SBCSEncoder(options, codec) {
  103848. this.encodeBuf = codec.encodeBuf;
  103849. }
  103850. SBCSEncoder.prototype.write = function(str) {
  103851. var buf = Buffer.alloc(str.length);
  103852. for (var i = 0; i < str.length; i++)
  103853. buf[i] = this.encodeBuf[str.charCodeAt(i)];
  103854. return buf;
  103855. }
  103856. SBCSEncoder.prototype.end = function() {
  103857. }
  103858. function SBCSDecoder(options, codec) {
  103859. this.decodeBuf = codec.decodeBuf;
  103860. }
  103861. SBCSDecoder.prototype.write = function(buf) {
  103862. // Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
  103863. var decodeBuf = this.decodeBuf;
  103864. var newBuf = Buffer.alloc(buf.length*2);
  103865. var idx1 = 0, idx2 = 0;
  103866. for (var i = 0; i < buf.length; i++) {
  103867. idx1 = buf[i]*2; idx2 = i*2;
  103868. newBuf[idx2] = decodeBuf[idx1];
  103869. newBuf[idx2+1] = decodeBuf[idx1+1];
  103870. }
  103871. return newBuf.toString('ucs2');
  103872. }
  103873. SBCSDecoder.prototype.end = function() {
  103874. }
  103875. /***/ }),
  103876. /* 764 */
  103877. /***/ (function(module, exports, __webpack_require__) {
  103878. "use strict";
  103879. // Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script.
  103880. module.exports = {
  103881. "437": "cp437",
  103882. "737": "cp737",
  103883. "775": "cp775",
  103884. "850": "cp850",
  103885. "852": "cp852",
  103886. "855": "cp855",
  103887. "856": "cp856",
  103888. "857": "cp857",
  103889. "858": "cp858",
  103890. "860": "cp860",
  103891. "861": "cp861",
  103892. "862": "cp862",
  103893. "863": "cp863",
  103894. "864": "cp864",
  103895. "865": "cp865",
  103896. "866": "cp866",
  103897. "869": "cp869",
  103898. "874": "windows874",
  103899. "922": "cp922",
  103900. "1046": "cp1046",
  103901. "1124": "cp1124",
  103902. "1125": "cp1125",
  103903. "1129": "cp1129",
  103904. "1133": "cp1133",
  103905. "1161": "cp1161",
  103906. "1162": "cp1162",
  103907. "1163": "cp1163",
  103908. "1250": "windows1250",
  103909. "1251": "windows1251",
  103910. "1252": "windows1252",
  103911. "1253": "windows1253",
  103912. "1254": "windows1254",
  103913. "1255": "windows1255",
  103914. "1256": "windows1256",
  103915. "1257": "windows1257",
  103916. "1258": "windows1258",
  103917. "28591": "iso88591",
  103918. "28592": "iso88592",
  103919. "28593": "iso88593",
  103920. "28594": "iso88594",
  103921. "28595": "iso88595",
  103922. "28596": "iso88596",
  103923. "28597": "iso88597",
  103924. "28598": "iso88598",
  103925. "28599": "iso88599",
  103926. "28600": "iso885910",
  103927. "28601": "iso885911",
  103928. "28603": "iso885913",
  103929. "28604": "iso885914",
  103930. "28605": "iso885915",
  103931. "28606": "iso885916",
  103932. "windows874": {
  103933. "type": "_sbcs",
  103934. "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
  103935. },
  103936. "win874": "windows874",
  103937. "cp874": "windows874",
  103938. "windows1250": {
  103939. "type": "_sbcs",
  103940. "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
  103941. },
  103942. "win1250": "windows1250",
  103943. "cp1250": "windows1250",
  103944. "windows1251": {
  103945. "type": "_sbcs",
  103946. "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
  103947. },
  103948. "win1251": "windows1251",
  103949. "cp1251": "windows1251",
  103950. "windows1252": {
  103951. "type": "_sbcs",
  103952. "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
  103953. },
  103954. "win1252": "windows1252",
  103955. "cp1252": "windows1252",
  103956. "windows1253": {
  103957. "type": "_sbcs",
  103958. "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
  103959. },
  103960. "win1253": "windows1253",
  103961. "cp1253": "windows1253",
  103962. "windows1254": {
  103963. "type": "_sbcs",
  103964. "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
  103965. },
  103966. "win1254": "windows1254",
  103967. "cp1254": "windows1254",
  103968. "windows1255": {
  103969. "type": "_sbcs",
  103970. "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"
  103971. },
  103972. "win1255": "windows1255",
  103973. "cp1255": "windows1255",
  103974. "windows1256": {
  103975. "type": "_sbcs",
  103976. "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے"
  103977. },
  103978. "win1256": "windows1256",
  103979. "cp1256": "windows1256",
  103980. "windows1257": {
  103981. "type": "_sbcs",
  103982. "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"
  103983. },
  103984. "win1257": "windows1257",
  103985. "cp1257": "windows1257",
  103986. "windows1258": {
  103987. "type": "_sbcs",
  103988. "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
  103989. },
  103990. "win1258": "windows1258",
  103991. "cp1258": "windows1258",
  103992. "iso88591": {
  103993. "type": "_sbcs",
  103994. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
  103995. },
  103996. "cp28591": "iso88591",
  103997. "iso88592": {
  103998. "type": "_sbcs",
  103999. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
  104000. },
  104001. "cp28592": "iso88592",
  104002. "iso88593": {
  104003. "type": "_sbcs",
  104004. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙"
  104005. },
  104006. "cp28593": "iso88593",
  104007. "iso88594": {
  104008. "type": "_sbcs",
  104009. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"
  104010. },
  104011. "cp28594": "iso88594",
  104012. "iso88595": {
  104013. "type": "_sbcs",
  104014. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"
  104015. },
  104016. "cp28595": "iso88595",
  104017. "iso88596": {
  104018. "type": "_sbcs",
  104019. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������"
  104020. },
  104021. "cp28596": "iso88596",
  104022. "iso88597": {
  104023. "type": "_sbcs",
  104024. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
  104025. },
  104026. "cp28597": "iso88597",
  104027. "iso88598": {
  104028. "type": "_sbcs",
  104029. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"
  104030. },
  104031. "cp28598": "iso88598",
  104032. "iso88599": {
  104033. "type": "_sbcs",
  104034. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
  104035. },
  104036. "cp28599": "iso88599",
  104037. "iso885910": {
  104038. "type": "_sbcs",
  104039. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"
  104040. },
  104041. "cp28600": "iso885910",
  104042. "iso885911": {
  104043. "type": "_sbcs",
  104044. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
  104045. },
  104046. "cp28601": "iso885911",
  104047. "iso885913": {
  104048. "type": "_sbcs",
  104049. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"
  104050. },
  104051. "cp28603": "iso885913",
  104052. "iso885914": {
  104053. "type": "_sbcs",
  104054. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"
  104055. },
  104056. "cp28604": "iso885914",
  104057. "iso885915": {
  104058. "type": "_sbcs",
  104059. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
  104060. },
  104061. "cp28605": "iso885915",
  104062. "iso885916": {
  104063. "type": "_sbcs",
  104064. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"
  104065. },
  104066. "cp28606": "iso885916",
  104067. "cp437": {
  104068. "type": "_sbcs",
  104069. "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  104070. },
  104071. "ibm437": "cp437",
  104072. "csibm437": "cp437",
  104073. "cp737": {
  104074. "type": "_sbcs",
  104075. "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "
  104076. },
  104077. "ibm737": "cp737",
  104078. "csibm737": "cp737",
  104079. "cp775": {
  104080. "type": "_sbcs",
  104081. "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ "
  104082. },
  104083. "ibm775": "cp775",
  104084. "csibm775": "cp775",
  104085. "cp850": {
  104086. "type": "_sbcs",
  104087. "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "
  104088. },
  104089. "ibm850": "cp850",
  104090. "csibm850": "cp850",
  104091. "cp852": {
  104092. "type": "_sbcs",
  104093. "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ "
  104094. },
  104095. "ibm852": "cp852",
  104096. "csibm852": "cp852",
  104097. "cp855": {
  104098. "type": "_sbcs",
  104099. "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ "
  104100. },
  104101. "ibm855": "cp855",
  104102. "csibm855": "cp855",
  104103. "cp856": {
  104104. "type": "_sbcs",
  104105. "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ "
  104106. },
  104107. "ibm856": "cp856",
  104108. "csibm856": "cp856",
  104109. "cp857": {
  104110. "type": "_sbcs",
  104111. "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ "
  104112. },
  104113. "ibm857": "cp857",
  104114. "csibm857": "cp857",
  104115. "cp858": {
  104116. "type": "_sbcs",
  104117. "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "
  104118. },
  104119. "ibm858": "cp858",
  104120. "csibm858": "cp858",
  104121. "cp860": {
  104122. "type": "_sbcs",
  104123. "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  104124. },
  104125. "ibm860": "cp860",
  104126. "csibm860": "cp860",
  104127. "cp861": {
  104128. "type": "_sbcs",
  104129. "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  104130. },
  104131. "ibm861": "cp861",
  104132. "csibm861": "cp861",
  104133. "cp862": {
  104134. "type": "_sbcs",
  104135. "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  104136. },
  104137. "ibm862": "cp862",
  104138. "csibm862": "cp862",
  104139. "cp863": {
  104140. "type": "_sbcs",
  104141. "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  104142. },
  104143. "ibm863": "cp863",
  104144. "csibm863": "cp863",
  104145. "cp864": {
  104146. "type": "_sbcs",
  104147. "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"
  104148. },
  104149. "ibm864": "cp864",
  104150. "csibm864": "cp864",
  104151. "cp865": {
  104152. "type": "_sbcs",
  104153. "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  104154. },
  104155. "ibm865": "cp865",
  104156. "csibm865": "cp865",
  104157. "cp866": {
  104158. "type": "_sbcs",
  104159. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "
  104160. },
  104161. "ibm866": "cp866",
  104162. "csibm866": "cp866",
  104163. "cp869": {
  104164. "type": "_sbcs",
  104165. "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "
  104166. },
  104167. "ibm869": "cp869",
  104168. "csibm869": "cp869",
  104169. "cp922": {
  104170. "type": "_sbcs",
  104171. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"
  104172. },
  104173. "ibm922": "cp922",
  104174. "csibm922": "cp922",
  104175. "cp1046": {
  104176. "type": "_sbcs",
  104177. "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"
  104178. },
  104179. "ibm1046": "cp1046",
  104180. "csibm1046": "cp1046",
  104181. "cp1124": {
  104182. "type": "_sbcs",
  104183. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"
  104184. },
  104185. "ibm1124": "cp1124",
  104186. "csibm1124": "cp1124",
  104187. "cp1125": {
  104188. "type": "_sbcs",
  104189. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "
  104190. },
  104191. "ibm1125": "cp1125",
  104192. "csibm1125": "cp1125",
  104193. "cp1129": {
  104194. "type": "_sbcs",
  104195. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
  104196. },
  104197. "ibm1129": "cp1129",
  104198. "csibm1129": "cp1129",
  104199. "cp1133": {
  104200. "type": "_sbcs",
  104201. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"
  104202. },
  104203. "ibm1133": "cp1133",
  104204. "csibm1133": "cp1133",
  104205. "cp1161": {
  104206. "type": "_sbcs",
  104207. "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "
  104208. },
  104209. "ibm1161": "cp1161",
  104210. "csibm1161": "cp1161",
  104211. "cp1162": {
  104212. "type": "_sbcs",
  104213. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
  104214. },
  104215. "ibm1162": "cp1162",
  104216. "csibm1162": "cp1162",
  104217. "cp1163": {
  104218. "type": "_sbcs",
  104219. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
  104220. },
  104221. "ibm1163": "cp1163",
  104222. "csibm1163": "cp1163",
  104223. "maccroatian": {
  104224. "type": "_sbcs",
  104225. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
  104226. },
  104227. "maccyrillic": {
  104228. "type": "_sbcs",
  104229. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
  104230. },
  104231. "macgreek": {
  104232. "type": "_sbcs",
  104233. "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"
  104234. },
  104235. "maciceland": {
  104236. "type": "_sbcs",
  104237. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
  104238. },
  104239. "macroman": {
  104240. "type": "_sbcs",
  104241. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
  104242. },
  104243. "macromania": {
  104244. "type": "_sbcs",
  104245. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
  104246. },
  104247. "macthai": {
  104248. "type": "_sbcs",
  104249. "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"
  104250. },
  104251. "macturkish": {
  104252. "type": "_sbcs",
  104253. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"
  104254. },
  104255. "macukraine": {
  104256. "type": "_sbcs",
  104257. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
  104258. },
  104259. "koi8r": {
  104260. "type": "_sbcs",
  104261. "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
  104262. },
  104263. "koi8u": {
  104264. "type": "_sbcs",
  104265. "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
  104266. },
  104267. "koi8ru": {
  104268. "type": "_sbcs",
  104269. "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
  104270. },
  104271. "koi8t": {
  104272. "type": "_sbcs",
  104273. "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
  104274. },
  104275. "armscii8": {
  104276. "type": "_sbcs",
  104277. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"
  104278. },
  104279. "rk1048": {
  104280. "type": "_sbcs",
  104281. "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
  104282. },
  104283. "tcvn": {
  104284. "type": "_sbcs",
  104285. "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"
  104286. },
  104287. "georgianacademy": {
  104288. "type": "_sbcs",
  104289. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
  104290. },
  104291. "georgianps": {
  104292. "type": "_sbcs",
  104293. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
  104294. },
  104295. "pt154": {
  104296. "type": "_sbcs",
  104297. "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
  104298. },
  104299. "viscii": {
  104300. "type": "_sbcs",
  104301. "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"
  104302. },
  104303. "iso646cn": {
  104304. "type": "_sbcs",
  104305. "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"
  104306. },
  104307. "iso646jp": {
  104308. "type": "_sbcs",
  104309. "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"
  104310. },
  104311. "hproman8": {
  104312. "type": "_sbcs",
  104313. "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"
  104314. },
  104315. "macintosh": {
  104316. "type": "_sbcs",
  104317. "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
  104318. },
  104319. "ascii": {
  104320. "type": "_sbcs",
  104321. "chars": "��������������������������������������������������������������������������������������������������������������������������������"
  104322. },
  104323. "tis620": {
  104324. "type": "_sbcs",
  104325. "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
  104326. }
  104327. }
  104328. /***/ }),
  104329. /* 765 */
  104330. /***/ (function(module, exports, __webpack_require__) {
  104331. "use strict";
  104332. // Manually added data to be used by sbcs codec in addition to generated one.
  104333. module.exports = {
  104334. // Not supported by iconv, not sure why.
  104335. "10029": "maccenteuro",
  104336. "maccenteuro": {
  104337. "type": "_sbcs",
  104338. "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"
  104339. },
  104340. "808": "cp808",
  104341. "ibm808": "cp808",
  104342. "cp808": {
  104343. "type": "_sbcs",
  104344. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "
  104345. },
  104346. "mik": {
  104347. "type": "_sbcs",
  104348. "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
  104349. },
  104350. // Aliases of generated encodings.
  104351. "ascii8bit": "ascii",
  104352. "usascii": "ascii",
  104353. "ansix34": "ascii",
  104354. "ansix341968": "ascii",
  104355. "ansix341986": "ascii",
  104356. "csascii": "ascii",
  104357. "cp367": "ascii",
  104358. "ibm367": "ascii",
  104359. "isoir6": "ascii",
  104360. "iso646us": "ascii",
  104361. "iso646irv": "ascii",
  104362. "us": "ascii",
  104363. "latin1": "iso88591",
  104364. "latin2": "iso88592",
  104365. "latin3": "iso88593",
  104366. "latin4": "iso88594",
  104367. "latin5": "iso88599",
  104368. "latin6": "iso885910",
  104369. "latin7": "iso885913",
  104370. "latin8": "iso885914",
  104371. "latin9": "iso885915",
  104372. "latin10": "iso885916",
  104373. "csisolatin1": "iso88591",
  104374. "csisolatin2": "iso88592",
  104375. "csisolatin3": "iso88593",
  104376. "csisolatin4": "iso88594",
  104377. "csisolatincyrillic": "iso88595",
  104378. "csisolatinarabic": "iso88596",
  104379. "csisolatingreek" : "iso88597",
  104380. "csisolatinhebrew": "iso88598",
  104381. "csisolatin5": "iso88599",
  104382. "csisolatin6": "iso885910",
  104383. "l1": "iso88591",
  104384. "l2": "iso88592",
  104385. "l3": "iso88593",
  104386. "l4": "iso88594",
  104387. "l5": "iso88599",
  104388. "l6": "iso885910",
  104389. "l7": "iso885913",
  104390. "l8": "iso885914",
  104391. "l9": "iso885915",
  104392. "l10": "iso885916",
  104393. "isoir14": "iso646jp",
  104394. "isoir57": "iso646cn",
  104395. "isoir100": "iso88591",
  104396. "isoir101": "iso88592",
  104397. "isoir109": "iso88593",
  104398. "isoir110": "iso88594",
  104399. "isoir144": "iso88595",
  104400. "isoir127": "iso88596",
  104401. "isoir126": "iso88597",
  104402. "isoir138": "iso88598",
  104403. "isoir148": "iso88599",
  104404. "isoir157": "iso885910",
  104405. "isoir166": "tis620",
  104406. "isoir179": "iso885913",
  104407. "isoir199": "iso885914",
  104408. "isoir203": "iso885915",
  104409. "isoir226": "iso885916",
  104410. "cp819": "iso88591",
  104411. "ibm819": "iso88591",
  104412. "cyrillic": "iso88595",
  104413. "arabic": "iso88596",
  104414. "arabic8": "iso88596",
  104415. "ecma114": "iso88596",
  104416. "asmo708": "iso88596",
  104417. "greek" : "iso88597",
  104418. "greek8" : "iso88597",
  104419. "ecma118" : "iso88597",
  104420. "elot928" : "iso88597",
  104421. "hebrew": "iso88598",
  104422. "hebrew8": "iso88598",
  104423. "turkish": "iso88599",
  104424. "turkish8": "iso88599",
  104425. "thai": "iso885911",
  104426. "thai8": "iso885911",
  104427. "celtic": "iso885914",
  104428. "celtic8": "iso885914",
  104429. "isoceltic": "iso885914",
  104430. "tis6200": "tis620",
  104431. "tis62025291": "tis620",
  104432. "tis62025330": "tis620",
  104433. "10000": "macroman",
  104434. "10006": "macgreek",
  104435. "10007": "maccyrillic",
  104436. "10079": "maciceland",
  104437. "10081": "macturkish",
  104438. "cspc8codepage437": "cp437",
  104439. "cspc775baltic": "cp775",
  104440. "cspc850multilingual": "cp850",
  104441. "cspcp852": "cp852",
  104442. "cspc862latinhebrew": "cp862",
  104443. "cpgr": "cp869",
  104444. "msee": "cp1250",
  104445. "mscyrl": "cp1251",
  104446. "msansi": "cp1252",
  104447. "msgreek": "cp1253",
  104448. "msturk": "cp1254",
  104449. "mshebr": "cp1255",
  104450. "msarab": "cp1256",
  104451. "winbaltrim": "cp1257",
  104452. "cp20866": "koi8r",
  104453. "20866": "koi8r",
  104454. "ibm878": "koi8r",
  104455. "cskoi8r": "koi8r",
  104456. "cp21866": "koi8u",
  104457. "21866": "koi8u",
  104458. "ibm1168": "koi8u",
  104459. "strk10482002": "rk1048",
  104460. "tcvn5712": "tcvn",
  104461. "tcvn57121": "tcvn",
  104462. "gb198880": "iso646cn",
  104463. "cn": "iso646cn",
  104464. "csiso14jisc6220ro": "iso646jp",
  104465. "jisc62201969ro": "iso646jp",
  104466. "jp": "iso646jp",
  104467. "cshproman8": "hproman8",
  104468. "r8": "hproman8",
  104469. "roman8": "hproman8",
  104470. "xroman8": "hproman8",
  104471. "ibm1051": "hproman8",
  104472. "mac": "macintosh",
  104473. "csmacintosh": "macintosh",
  104474. };
  104475. /***/ }),
  104476. /* 766 */
  104477. /***/ (function(module, exports) {
  104478. module.exports = [["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"],["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"],["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"],["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"],["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"],["8940","𪎩𡅅"],["8943","攊"],["8946","丽滝鵎釟"],["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"],["89a1","琑糼緍楆竉刧"],["89ab","醌碸酞肼"],["89b0","贋胶𠧧"],["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"],["89c1","溚舾甙"],["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"],["8a40","𧶄唥"],["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"],["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"],["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"],["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"],["8aac","䠋𠆩㿺塳𢶍"],["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"],["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"],["8ac9","𪘁𠸉𢫏𢳉"],["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"],["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"],["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"],["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"],["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"],["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"],["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"],["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"],["8ca1","𣏹椙橃𣱣泿"],["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"],["8cc9","顨杫䉶圽"],["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"],["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"],["8d40","𠮟"],["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"],["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"],["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"],["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"],["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"],["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"],["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"],["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"],["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"],["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"],["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"],["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"],["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"],["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"],["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"],["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"],["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"],["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"],["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"],["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"],["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"],["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"],["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"],["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"],["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"],["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"],["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"],["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"],["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"],["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"],["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"],["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"],["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"],["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"],["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"],["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"],["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"],["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"],["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"],["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"],["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"],["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"],["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"],["9fae","酙隁酜"],["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"],["9fc1","𤤙盖鮝个𠳔莾衂"],["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"],["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"],["9fe7","毺蠘罸"],["9feb","嘠𪙊蹷齓"],["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"],["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"],["a055","𡠻𦸅"],["a058","詾𢔛"],["a05b","惽癧髗鵄鍮鮏蟵"],["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"],["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"],["a0a1","嵗𨯂迚𨸹"],["a0a6","僙𡵆礆匲阸𠼻䁥"],["a0ae","矾"],["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"],["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"],["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"],["a3c0","␀",31,"␡"],["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23],["c740","す",58,"ァアィイ"],["c7a1","ゥ",81,"А",5,"ЁЖ",4],["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"],["c8a1","龰冈龱𧘇"],["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"],["c8f5","ʃɐɛɔɵœøŋʊɪ"],["f9fe","■"],["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"],["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"],["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"],["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"],["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"],["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"],["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"],["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"],["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"],["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"]]
  104479. /***/ }),
  104480. /* 767 */
  104481. /***/ (function(module, exports) {
  104482. module.exports = [["0","\u0000",127],["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"],["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"],["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"],["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5],["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"],["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18],["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7],["8361","긝",18,"긲긳긵긶긹긻긼"],["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8],["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8],["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18],["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"],["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4],["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"],["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"],["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"],["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10],["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"],["8741","놞",9,"놩",15],["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"],["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4],["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4],["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"],["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"],["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"],["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"],["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15],["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"],["8a61","둧",4,"둭",18,"뒁뒂"],["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"],["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"],["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8],["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18],["8c41","똀",15,"똒똓똕똖똗똙",4],["8c61","똞",6,"똦",5,"똭",6,"똵",5],["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16],["8d41","뛃",16,"뛕",8],["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"],["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"],["8e41","랟랡",6,"랪랮",5,"랶랷랹",8],["8e61","럂",4,"럈럊",19],["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7],["8f41","뢅",7,"뢎",17],["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4],["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5],["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"],["9061","륾",5,"릆릈릋릌릏",15],["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"],["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5],["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5],["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6],["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"],["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4],["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"],["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"],["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8],["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"],["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8],["9461","봞",5,"봥",6,"봭",12],["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24],["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"],["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"],["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14],["9641","뺸",23,"뻒뻓"],["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8],["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44],["9741","뾃",16,"뾕",8],["9761","뾞",17,"뾱",7],["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"],["9841","쁀",16,"쁒",5,"쁙쁚쁛"],["9861","쁝쁞쁟쁡",6,"쁪",15],["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"],["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"],["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"],["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"],["9a41","숤숥숦숧숪숬숮숰숳숵",16],["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"],["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"],["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8],["9b61","쌳",17,"썆",7],["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"],["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5],["9c61","쏿",8,"쐉",6,"쐑",9],["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12],["9d41","쒪",13,"쒹쒺쒻쒽",8],["9d61","쓆",25],["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"],["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"],["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"],["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"],["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"],["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"],["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"],["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"],["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13],["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"],["a141","좥좦좧좩",18,"좾좿죀죁"],["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"],["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"],["a241","줐줒",5,"줙",18],["a261","줭",6,"줵",18],["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"],["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"],["a361","즑",6,"즚즜즞",16],["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"],["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"],["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12],["a481","쨦쨧쨨쨪",28,"ㄱ",93],["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"],["a561","쩫",17,"쩾",5,"쪅쪆"],["a581","쪇",16,"쪙",14,"ⅰ",9],["a5b0","Ⅰ",9],["a5c1","Α",16,"Σ",6],["a5e1","α",16,"σ",6],["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"],["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6],["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7],["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7],["a761","쬪",22,"쭂쭃쭄"],["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"],["a841","쭭",10,"쭺",14],["a861","쮉",18,"쮝",6],["a881","쮤",19,"쮹",11,"ÆÐªĦ"],["a8a6","IJ"],["a8a8","ĿŁØŒºÞŦŊ"],["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"],["a941","쯅",14,"쯕",10],["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18],["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"],["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"],["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"],["aa81","챳챴챶",29,"ぁ",82],["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"],["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5],["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85],["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"],["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4],["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25],["acd1","а",5,"ёж",25],["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7],["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"],["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"],["ae41","췆",5,"췍췎췏췑",16],["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4],["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"],["af41","츬츭츮츯츲츴츶",19],["af61","칊",13,"칚칛칝칞칢",5,"칪칬"],["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"],["b041","캚",5,"캢캦",5,"캮",12],["b061","캻",5,"컂",19],["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"],["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"],["b161","켥",6,"켮켲",5,"켹",11],["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"],["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"],["b261","쾎",18,"쾢",5,"쾩"],["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"],["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"],["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5],["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"],["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5],["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"],["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"],["b541","킕",14,"킦킧킩킪킫킭",5],["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4],["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"],["b641","턅",7,"턎",17],["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"],["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"],["b741","텮",13,"텽",6,"톅톆톇톉톊"],["b761","톋",20,"톢톣톥톦톧"],["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"],["b841","퇐",7,"퇙",17],["b861","퇫",8,"퇵퇶퇷퇹",13],["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"],["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"],["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"],["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"],["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"],["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5],["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"],["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"],["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"],["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"],["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"],["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"],["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"],["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"],["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13],["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"],["be41","퐸",7,"푁푂푃푅",14],["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"],["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"],["bf41","풞",10,"풪",14],["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"],["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"],["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5],["c061","픞",25],["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"],["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"],["c161","햌햍햎햏햑",19,"햦햧"],["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"],["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"],["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"],["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"],["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4],["c361","홢",4,"홨홪",5,"홲홳홵",11],["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"],["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"],["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4],["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"],["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"],["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4],["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"],["c641","힍힎힏힑",6,"힚힜힞",5],["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"],["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"],["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"],["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"],["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"],["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"],["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"],["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"],["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"],["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"],["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"],["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"],["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"],["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"],["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"],["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"],["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"],["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"],["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"],["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"],["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"],["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"],["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"],["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"],["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"],["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"],["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"],["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"],["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"],["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"],["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"],["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"],["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"],["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"],["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"],["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"],["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"],["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"],["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"],["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"],["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"],["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"],["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"],["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"],["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"],["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"],["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"],["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"],["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"],["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"],["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"],["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"],["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"],["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"],["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"]]
  104483. /***/ }),
  104484. /* 768 */
  104485. /***/ (function(module, exports) {
  104486. module.exports = [["0","\u0000",127],["8ea1","。",62],["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"],["a2a1","◆□■△▲▽▼※〒→←↑↓〓"],["a2ba","∈∋⊆⊇⊂⊃∪∩"],["a2ca","∧∨¬⇒⇔∀∃"],["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["a2f2","ʼn♯♭♪†‡¶"],["a2fe","◯"],["a3b0","0",9],["a3c1","A",25],["a3e1","a",25],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["ada1","①",19,"Ⅰ",9],["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"],["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"],["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"],["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"],["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"],["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"],["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"],["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"],["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"],["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"],["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"],["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"],["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"],["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"],["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"],["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"],["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"],["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"],["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"],["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"],["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"],["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"],["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"],["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"],["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"],["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"],["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"],["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"],["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"],["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"],["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"],["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"],["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"],["f4a1","堯槇遙瑤凜熙"],["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"],["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"],["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["fcf1","ⅰ",9,"¬¦'""],["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"],["8fa2c2","¡¦¿"],["8fa2eb","ºª©®™¤№"],["8fa6e1","ΆΈΉΊΪ"],["8fa6e7","Ό"],["8fa6e9","ΎΫ"],["8fa6ec","Ώ"],["8fa6f1","άέήίϊΐόςύϋΰώ"],["8fa7c2","Ђ",10,"ЎЏ"],["8fa7f2","ђ",10,"ўџ"],["8fa9a1","ÆĐ"],["8fa9a4","Ħ"],["8fa9a6","IJ"],["8fa9a8","ŁĿ"],["8fa9ab","ŊØŒ"],["8fa9af","ŦÞ"],["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"],["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"],["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"],["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"],["8fabbd","ġĥíìïîǐ"],["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"],["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"],["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"],["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"],["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"],["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"],["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"],["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"],["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"],["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"],["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"],["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"],["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"],["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"],["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"],["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"],["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"],["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"],["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"],["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"],["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"],["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"],["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"],["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"],["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"],["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"],["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"],["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"],["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"],["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"],["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"],["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"],["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"],["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"],["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"],["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5],["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"],["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"],["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"],["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"],["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"],["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"],["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"],["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"],["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"],["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"],["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"],["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"],["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"],["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"],["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"],["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"],["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"],["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"],["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"],["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"],["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"],["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"],["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4],["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"],["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"],["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"],["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"]]
  104487. /***/ }),
  104488. /* 769 */
  104489. /***/ (function(module, exports) {
  104490. module.exports = {"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}
  104491. /***/ }),
  104492. /* 770 */
  104493. /***/ (function(module, exports) {
  104494. module.exports = [["0","\u0000",128],["a1","。",62],["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"],["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"],["81b8","∈∋⊆⊇⊂⊃∪∩"],["81c8","∧∨¬⇒⇔∀∃"],["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["81f0","ʼn♯♭♪†‡¶"],["81fc","◯"],["824f","0",9],["8260","A",25],["8281","a",25],["829f","ぁ",82],["8340","ァ",62],["8380","ム",22],["839f","Α",16,"Σ",6],["83bf","α",16,"σ",6],["8440","А",5,"ЁЖ",25],["8470","а",5,"ёж",7],["8480","о",17],["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["8740","①",19,"Ⅰ",9],["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["877e","㍻"],["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"],["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"],["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"],["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"],["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"],["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"],["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"],["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"],["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"],["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"],["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"],["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"],["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"],["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"],["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"],["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"],["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"],["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"],["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"],["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"],["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"],["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"],["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"],["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"],["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"],["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"],["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"],["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"],["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"],["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"],["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"],["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"],["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"],["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"],["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"],["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"],["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["eeef","ⅰ",9,"¬¦'""],["f040","",62],["f080","",124],["f140","",62],["f180","",124],["f240","",62],["f280","",124],["f340","",62],["f380","",124],["f440","",62],["f480","",124],["f540","",62],["f580","",124],["f640","",62],["f680","",124],["f740","",62],["f780","",124],["f840","",62],["f880","",124],["f940",""],["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"],["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"],["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"],["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"],["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"]]
  104495. /***/ }),
  104496. /* 771 */
  104497. /***/ (function(module, exports, __webpack_require__) {
  104498. "use strict";
  104499. var Buffer = __webpack_require__(20).Buffer;
  104500. // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js
  104501. // == UTF16-BE codec. ==========================================================
  104502. exports.utf16be = Utf16BECodec;
  104503. function Utf16BECodec() {
  104504. }
  104505. Utf16BECodec.prototype.encoder = Utf16BEEncoder;
  104506. Utf16BECodec.prototype.decoder = Utf16BEDecoder;
  104507. Utf16BECodec.prototype.bomAware = true;
  104508. // -- Encoding
  104509. function Utf16BEEncoder() {
  104510. }
  104511. Utf16BEEncoder.prototype.write = function(str) {
  104512. var buf = Buffer.from(str, 'ucs2');
  104513. for (var i = 0; i < buf.length; i += 2) {
  104514. var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp;
  104515. }
  104516. return buf;
  104517. }
  104518. Utf16BEEncoder.prototype.end = function() {
  104519. }
  104520. // -- Decoding
  104521. function Utf16BEDecoder() {
  104522. this.overflowByte = -1;
  104523. }
  104524. Utf16BEDecoder.prototype.write = function(buf) {
  104525. if (buf.length == 0)
  104526. return '';
  104527. var buf2 = Buffer.alloc(buf.length + 1),
  104528. i = 0, j = 0;
  104529. if (this.overflowByte !== -1) {
  104530. buf2[0] = buf[0];
  104531. buf2[1] = this.overflowByte;
  104532. i = 1; j = 2;
  104533. }
  104534. for (; i < buf.length-1; i += 2, j+= 2) {
  104535. buf2[j] = buf[i+1];
  104536. buf2[j+1] = buf[i];
  104537. }
  104538. this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1;
  104539. return buf2.slice(0, j).toString('ucs2');
  104540. }
  104541. Utf16BEDecoder.prototype.end = function() {
  104542. }
  104543. // == UTF-16 codec =============================================================
  104544. // Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic.
  104545. // Defaults to UTF-16LE, as it's prevalent and default in Node.
  104546. // http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le
  104547. // Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'});
  104548. // Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false).
  104549. exports.utf16 = Utf16Codec;
  104550. function Utf16Codec(codecOptions, iconv) {
  104551. this.iconv = iconv;
  104552. }
  104553. Utf16Codec.prototype.encoder = Utf16Encoder;
  104554. Utf16Codec.prototype.decoder = Utf16Decoder;
  104555. // -- Encoding (pass-through)
  104556. function Utf16Encoder(options, codec) {
  104557. options = options || {};
  104558. if (options.addBOM === undefined)
  104559. options.addBOM = true;
  104560. this.encoder = codec.iconv.getEncoder('utf-16le', options);
  104561. }
  104562. Utf16Encoder.prototype.write = function(str) {
  104563. return this.encoder.write(str);
  104564. }
  104565. Utf16Encoder.prototype.end = function() {
  104566. return this.encoder.end();
  104567. }
  104568. // -- Decoding
  104569. function Utf16Decoder(options, codec) {
  104570. this.decoder = null;
  104571. this.initialBytes = [];
  104572. this.initialBytesLen = 0;
  104573. this.options = options || {};
  104574. this.iconv = codec.iconv;
  104575. }
  104576. Utf16Decoder.prototype.write = function(buf) {
  104577. if (!this.decoder) {
  104578. // Codec is not chosen yet. Accumulate initial bytes.
  104579. this.initialBytes.push(buf);
  104580. this.initialBytesLen += buf.length;
  104581. if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below)
  104582. return '';
  104583. // We have enough bytes -> detect endianness.
  104584. var buf = Buffer.concat(this.initialBytes),
  104585. encoding = detectEncoding(buf, this.options.defaultEncoding);
  104586. this.decoder = this.iconv.getDecoder(encoding, this.options);
  104587. this.initialBytes.length = this.initialBytesLen = 0;
  104588. }
  104589. return this.decoder.write(buf);
  104590. }
  104591. Utf16Decoder.prototype.end = function() {
  104592. if (!this.decoder) {
  104593. var buf = Buffer.concat(this.initialBytes),
  104594. encoding = detectEncoding(buf, this.options.defaultEncoding);
  104595. this.decoder = this.iconv.getDecoder(encoding, this.options);
  104596. var res = this.decoder.write(buf),
  104597. trail = this.decoder.end();
  104598. return trail ? (res + trail) : res;
  104599. }
  104600. return this.decoder.end();
  104601. }
  104602. function detectEncoding(buf, defaultEncoding) {
  104603. var enc = defaultEncoding || 'utf-16le';
  104604. if (buf.length >= 2) {
  104605. // Check BOM.
  104606. if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM
  104607. enc = 'utf-16be';
  104608. else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM
  104609. enc = 'utf-16le';
  104610. else {
  104611. // No BOM found. Try to deduce encoding from initial content.
  104612. // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon.
  104613. // So, we count ASCII as if it was LE or BE, and decide from that.
  104614. var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions
  104615. _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even.
  104616. for (var i = 0; i < _len; i += 2) {
  104617. if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++;
  104618. if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++;
  104619. }
  104620. if (asciiCharsBE > asciiCharsLE)
  104621. enc = 'utf-16be';
  104622. else if (asciiCharsBE < asciiCharsLE)
  104623. enc = 'utf-16le';
  104624. }
  104625. }
  104626. return enc;
  104627. }
  104628. /***/ }),
  104629. /* 772 */
  104630. /***/ (function(module, exports, __webpack_require__) {
  104631. "use strict";
  104632. var Buffer = __webpack_require__(20).Buffer;
  104633. // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152
  104634. // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3
  104635. exports.utf7 = Utf7Codec;
  104636. exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7
  104637. function Utf7Codec(codecOptions, iconv) {
  104638. this.iconv = iconv;
  104639. };
  104640. Utf7Codec.prototype.encoder = Utf7Encoder;
  104641. Utf7Codec.prototype.decoder = Utf7Decoder;
  104642. Utf7Codec.prototype.bomAware = true;
  104643. // -- Encoding
  104644. var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;
  104645. function Utf7Encoder(options, codec) {
  104646. this.iconv = codec.iconv;
  104647. }
  104648. Utf7Encoder.prototype.write = function(str) {
  104649. // Naive implementation.
  104650. // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
  104651. return Buffer.from(str.replace(nonDirectChars, function(chunk) {
  104652. return "+" + (chunk === '+' ? '' :
  104653. this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, ''))
  104654. + "-";
  104655. }.bind(this)));
  104656. }
  104657. Utf7Encoder.prototype.end = function() {
  104658. }
  104659. // -- Decoding
  104660. function Utf7Decoder(options, codec) {
  104661. this.iconv = codec.iconv;
  104662. this.inBase64 = false;
  104663. this.base64Accum = '';
  104664. }
  104665. var base64Regex = /[A-Za-z0-9\/+]/;
  104666. var base64Chars = [];
  104667. for (var i = 0; i < 256; i++)
  104668. base64Chars[i] = base64Regex.test(String.fromCharCode(i));
  104669. var plusChar = '+'.charCodeAt(0),
  104670. minusChar = '-'.charCodeAt(0),
  104671. andChar = '&'.charCodeAt(0);
  104672. Utf7Decoder.prototype.write = function(buf) {
  104673. var res = "", lastI = 0,
  104674. inBase64 = this.inBase64,
  104675. base64Accum = this.base64Accum;
  104676. // The decoder is more involved as we must handle chunks in stream.
  104677. for (var i = 0; i < buf.length; i++) {
  104678. if (!inBase64) { // We're in direct mode.
  104679. // Write direct chars until '+'
  104680. if (buf[i] == plusChar) {
  104681. res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
  104682. lastI = i+1;
  104683. inBase64 = true;
  104684. }
  104685. } else { // We decode base64.
  104686. if (!base64Chars[buf[i]]) { // Base64 ended.
  104687. if (i == lastI && buf[i] == minusChar) {// "+-" -> "+"
  104688. res += "+";
  104689. } else {
  104690. var b64str = base64Accum + buf.slice(lastI, i).toString();
  104691. res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
  104692. }
  104693. if (buf[i] != minusChar) // Minus is absorbed after base64.
  104694. i--;
  104695. lastI = i+1;
  104696. inBase64 = false;
  104697. base64Accum = '';
  104698. }
  104699. }
  104700. }
  104701. if (!inBase64) {
  104702. res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
  104703. } else {
  104704. var b64str = base64Accum + buf.slice(lastI).toString();
  104705. var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
  104706. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
  104707. b64str = b64str.slice(0, canBeDecoded);
  104708. res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
  104709. }
  104710. this.inBase64 = inBase64;
  104711. this.base64Accum = base64Accum;
  104712. return res;
  104713. }
  104714. Utf7Decoder.prototype.end = function() {
  104715. var res = "";
  104716. if (this.inBase64 && this.base64Accum.length > 0)
  104717. res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
  104718. this.inBase64 = false;
  104719. this.base64Accum = '';
  104720. return res;
  104721. }
  104722. // UTF-7-IMAP codec.
  104723. // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)
  104724. // Differences:
  104725. // * Base64 part is started by "&" instead of "+"
  104726. // * Direct characters are 0x20-0x7E, except "&" (0x26)
  104727. // * In Base64, "," is used instead of "/"
  104728. // * Base64 must not be used to represent direct characters.
  104729. // * No implicit shift back from Base64 (should always end with '-')
  104730. // * String must end in non-shifted position.
  104731. // * "-&" while in base64 is not allowed.
  104732. exports.utf7imap = Utf7IMAPCodec;
  104733. function Utf7IMAPCodec(codecOptions, iconv) {
  104734. this.iconv = iconv;
  104735. };
  104736. Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;
  104737. Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;
  104738. Utf7IMAPCodec.prototype.bomAware = true;
  104739. // -- Encoding
  104740. function Utf7IMAPEncoder(options, codec) {
  104741. this.iconv = codec.iconv;
  104742. this.inBase64 = false;
  104743. this.base64Accum = Buffer.alloc(6);
  104744. this.base64AccumIdx = 0;
  104745. }
  104746. Utf7IMAPEncoder.prototype.write = function(str) {
  104747. var inBase64 = this.inBase64,
  104748. base64Accum = this.base64Accum,
  104749. base64AccumIdx = this.base64AccumIdx,
  104750. buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;
  104751. for (var i = 0; i < str.length; i++) {
  104752. var uChar = str.charCodeAt(i);
  104753. if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'.
  104754. if (inBase64) {
  104755. if (base64AccumIdx > 0) {
  104756. bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
  104757. base64AccumIdx = 0;
  104758. }
  104759. buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
  104760. inBase64 = false;
  104761. }
  104762. if (!inBase64) {
  104763. buf[bufIdx++] = uChar; // Write direct character
  104764. if (uChar === andChar) // Ampersand -> '&-'
  104765. buf[bufIdx++] = minusChar;
  104766. }
  104767. } else { // Non-direct character
  104768. if (!inBase64) {
  104769. buf[bufIdx++] = andChar; // Write '&', then go to base64 mode.
  104770. inBase64 = true;
  104771. }
  104772. if (inBase64) {
  104773. base64Accum[base64AccumIdx++] = uChar >> 8;
  104774. base64Accum[base64AccumIdx++] = uChar & 0xFF;
  104775. if (base64AccumIdx == base64Accum.length) {
  104776. bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx);
  104777. base64AccumIdx = 0;
  104778. }
  104779. }
  104780. }
  104781. }
  104782. this.inBase64 = inBase64;
  104783. this.base64AccumIdx = base64AccumIdx;
  104784. return buf.slice(0, bufIdx);
  104785. }
  104786. Utf7IMAPEncoder.prototype.end = function() {
  104787. var buf = Buffer.alloc(10), bufIdx = 0;
  104788. if (this.inBase64) {
  104789. if (this.base64AccumIdx > 0) {
  104790. bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
  104791. this.base64AccumIdx = 0;
  104792. }
  104793. buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
  104794. this.inBase64 = false;
  104795. }
  104796. return buf.slice(0, bufIdx);
  104797. }
  104798. // -- Decoding
  104799. function Utf7IMAPDecoder(options, codec) {
  104800. this.iconv = codec.iconv;
  104801. this.inBase64 = false;
  104802. this.base64Accum = '';
  104803. }
  104804. var base64IMAPChars = base64Chars.slice();
  104805. base64IMAPChars[','.charCodeAt(0)] = true;
  104806. Utf7IMAPDecoder.prototype.write = function(buf) {
  104807. var res = "", lastI = 0,
  104808. inBase64 = this.inBase64,
  104809. base64Accum = this.base64Accum;
  104810. // The decoder is more involved as we must handle chunks in stream.
  104811. // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).
  104812. for (var i = 0; i < buf.length; i++) {
  104813. if (!inBase64) { // We're in direct mode.
  104814. // Write direct chars until '&'
  104815. if (buf[i] == andChar) {
  104816. res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
  104817. lastI = i+1;
  104818. inBase64 = true;
  104819. }
  104820. } else { // We decode base64.
  104821. if (!base64IMAPChars[buf[i]]) { // Base64 ended.
  104822. if (i == lastI && buf[i] == minusChar) { // "&-" -> "&"
  104823. res += "&";
  104824. } else {
  104825. var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/');
  104826. res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
  104827. }
  104828. if (buf[i] != minusChar) // Minus may be absorbed after base64.
  104829. i--;
  104830. lastI = i+1;
  104831. inBase64 = false;
  104832. base64Accum = '';
  104833. }
  104834. }
  104835. }
  104836. if (!inBase64) {
  104837. res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
  104838. } else {
  104839. var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/');
  104840. var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
  104841. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
  104842. b64str = b64str.slice(0, canBeDecoded);
  104843. res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
  104844. }
  104845. this.inBase64 = inBase64;
  104846. this.base64Accum = base64Accum;
  104847. return res;
  104848. }
  104849. Utf7IMAPDecoder.prototype.end = function() {
  104850. var res = "";
  104851. if (this.inBase64 && this.base64Accum.length > 0)
  104852. res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
  104853. this.inBase64 = false;
  104854. this.base64Accum = '';
  104855. return res;
  104856. }
  104857. /***/ }),
  104858. /* 773 */
  104859. /***/ (function(module, exports, __webpack_require__) {
  104860. "use strict";
  104861. var BOMChar = '\uFEFF';
  104862. exports.PrependBOM = PrependBOMWrapper
  104863. function PrependBOMWrapper(encoder, options) {
  104864. this.encoder = encoder;
  104865. this.addBOM = true;
  104866. }
  104867. PrependBOMWrapper.prototype.write = function(str) {
  104868. if (this.addBOM) {
  104869. str = BOMChar + str;
  104870. this.addBOM = false;
  104871. }
  104872. return this.encoder.write(str);
  104873. }
  104874. PrependBOMWrapper.prototype.end = function() {
  104875. return this.encoder.end();
  104876. }
  104877. //------------------------------------------------------------------------------
  104878. exports.StripBOM = StripBOMWrapper;
  104879. function StripBOMWrapper(decoder, options) {
  104880. this.decoder = decoder;
  104881. this.pass = false;
  104882. this.options = options || {};
  104883. }
  104884. StripBOMWrapper.prototype.write = function(buf) {
  104885. var res = this.decoder.write(buf);
  104886. if (this.pass || !res)
  104887. return res;
  104888. if (res[0] === BOMChar) {
  104889. res = res.slice(1);
  104890. if (typeof this.options.stripBOM === 'function')
  104891. this.options.stripBOM();
  104892. }
  104893. this.pass = true;
  104894. return res;
  104895. }
  104896. StripBOMWrapper.prototype.end = function() {
  104897. return this.decoder.end();
  104898. }
  104899. /***/ }),
  104900. /* 774 */
  104901. /***/ (function(module, exports, __webpack_require__) {
  104902. "use strict";
  104903. var Buffer = __webpack_require__(94).Buffer;
  104904. // Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer
  104905. // == Extend Node primitives to use iconv-lite =================================
  104906. module.exports = function (iconv) {
  104907. var original = undefined; // Place to keep original methods.
  104908. // Node authors rewrote Buffer internals to make it compatible with
  104909. // Uint8Array and we cannot patch key functions since then.
  104910. // Note: this does use older Buffer API on a purpose
  104911. iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array);
  104912. iconv.extendNodeEncodings = function extendNodeEncodings() {
  104913. if (original) return;
  104914. original = {};
  104915. if (!iconv.supportsNodeEncodingsExtension) {
  104916. console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node");
  104917. console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility");
  104918. return;
  104919. }
  104920. var nodeNativeEncodings = {
  104921. 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true,
  104922. 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true,
  104923. };
  104924. Buffer.isNativeEncoding = function(enc) {
  104925. return enc && nodeNativeEncodings[enc.toLowerCase()];
  104926. }
  104927. // -- SlowBuffer -----------------------------------------------------------
  104928. var SlowBuffer = __webpack_require__(94).SlowBuffer;
  104929. original.SlowBufferToString = SlowBuffer.prototype.toString;
  104930. SlowBuffer.prototype.toString = function(encoding, start, end) {
  104931. encoding = String(encoding || 'utf8').toLowerCase();
  104932. // Use native conversion when possible
  104933. if (Buffer.isNativeEncoding(encoding))
  104934. return original.SlowBufferToString.call(this, encoding, start, end);
  104935. // Otherwise, use our decoding method.
  104936. if (typeof start == 'undefined') start = 0;
  104937. if (typeof end == 'undefined') end = this.length;
  104938. return iconv.decode(this.slice(start, end), encoding);
  104939. }
  104940. original.SlowBufferWrite = SlowBuffer.prototype.write;
  104941. SlowBuffer.prototype.write = function(string, offset, length, encoding) {
  104942. // Support both (string, offset, length, encoding)
  104943. // and the legacy (string, encoding, offset, length)
  104944. if (isFinite(offset)) {
  104945. if (!isFinite(length)) {
  104946. encoding = length;
  104947. length = undefined;
  104948. }
  104949. } else { // legacy
  104950. var swap = encoding;
  104951. encoding = offset;
  104952. offset = length;
  104953. length = swap;
  104954. }
  104955. offset = +offset || 0;
  104956. var remaining = this.length - offset;
  104957. if (!length) {
  104958. length = remaining;
  104959. } else {
  104960. length = +length;
  104961. if (length > remaining) {
  104962. length = remaining;
  104963. }
  104964. }
  104965. encoding = String(encoding || 'utf8').toLowerCase();
  104966. // Use native conversion when possible
  104967. if (Buffer.isNativeEncoding(encoding))
  104968. return original.SlowBufferWrite.call(this, string, offset, length, encoding);
  104969. if (string.length > 0 && (length < 0 || offset < 0))
  104970. throw new RangeError('attempt to write beyond buffer bounds');
  104971. // Otherwise, use our encoding method.
  104972. var buf = iconv.encode(string, encoding);
  104973. if (buf.length < length) length = buf.length;
  104974. buf.copy(this, offset, 0, length);
  104975. return length;
  104976. }
  104977. // -- Buffer ---------------------------------------------------------------
  104978. original.BufferIsEncoding = Buffer.isEncoding;
  104979. Buffer.isEncoding = function(encoding) {
  104980. return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding);
  104981. }
  104982. original.BufferByteLength = Buffer.byteLength;
  104983. Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) {
  104984. encoding = String(encoding || 'utf8').toLowerCase();
  104985. // Use native conversion when possible
  104986. if (Buffer.isNativeEncoding(encoding))
  104987. return original.BufferByteLength.call(this, str, encoding);
  104988. // Slow, I know, but we don't have a better way yet.
  104989. return iconv.encode(str, encoding).length;
  104990. }
  104991. original.BufferToString = Buffer.prototype.toString;
  104992. Buffer.prototype.toString = function(encoding, start, end) {
  104993. encoding = String(encoding || 'utf8').toLowerCase();
  104994. // Use native conversion when possible
  104995. if (Buffer.isNativeEncoding(encoding))
  104996. return original.BufferToString.call(this, encoding, start, end);
  104997. // Otherwise, use our decoding method.
  104998. if (typeof start == 'undefined') start = 0;
  104999. if (typeof end == 'undefined') end = this.length;
  105000. return iconv.decode(this.slice(start, end), encoding);
  105001. }
  105002. original.BufferWrite = Buffer.prototype.write;
  105003. Buffer.prototype.write = function(string, offset, length, encoding) {
  105004. var _offset = offset, _length = length, _encoding = encoding;
  105005. // Support both (string, offset, length, encoding)
  105006. // and the legacy (string, encoding, offset, length)
  105007. if (isFinite(offset)) {
  105008. if (!isFinite(length)) {
  105009. encoding = length;
  105010. length = undefined;
  105011. }
  105012. } else { // legacy
  105013. var swap = encoding;
  105014. encoding = offset;
  105015. offset = length;
  105016. length = swap;
  105017. }
  105018. encoding = String(encoding || 'utf8').toLowerCase();
  105019. // Use native conversion when possible
  105020. if (Buffer.isNativeEncoding(encoding))
  105021. return original.BufferWrite.call(this, string, _offset, _length, _encoding);
  105022. offset = +offset || 0;
  105023. var remaining = this.length - offset;
  105024. if (!length) {
  105025. length = remaining;
  105026. } else {
  105027. length = +length;
  105028. if (length > remaining) {
  105029. length = remaining;
  105030. }
  105031. }
  105032. if (string.length > 0 && (length < 0 || offset < 0))
  105033. throw new RangeError('attempt to write beyond buffer bounds');
  105034. // Otherwise, use our encoding method.
  105035. var buf = iconv.encode(string, encoding);
  105036. if (buf.length < length) length = buf.length;
  105037. buf.copy(this, offset, 0, length);
  105038. return length;
  105039. // TODO: Set _charsWritten.
  105040. }
  105041. // -- Readable -------------------------------------------------------------
  105042. if (iconv.supportsStreams) {
  105043. var Readable = __webpack_require__(36).Readable;
  105044. original.ReadableSetEncoding = Readable.prototype.setEncoding;
  105045. Readable.prototype.setEncoding = function setEncoding(enc, options) {
  105046. // Use our own decoder, it has the same interface.
  105047. // We cannot use original function as it doesn't handle BOM-s.
  105048. this._readableState.decoder = iconv.getDecoder(enc, options);
  105049. this._readableState.encoding = enc;
  105050. }
  105051. Readable.prototype.collect = iconv._collect;
  105052. }
  105053. }
  105054. // Remove iconv-lite Node primitive extensions.
  105055. iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() {
  105056. if (!iconv.supportsNodeEncodingsExtension)
  105057. return;
  105058. if (!original)
  105059. throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.")
  105060. delete Buffer.isNativeEncoding;
  105061. var SlowBuffer = __webpack_require__(94).SlowBuffer;
  105062. SlowBuffer.prototype.toString = original.SlowBufferToString;
  105063. SlowBuffer.prototype.write = original.SlowBufferWrite;
  105064. Buffer.isEncoding = original.BufferIsEncoding;
  105065. Buffer.byteLength = original.BufferByteLength;
  105066. Buffer.prototype.toString = original.BufferToString;
  105067. Buffer.prototype.write = original.BufferWrite;
  105068. if (iconv.supportsStreams) {
  105069. var Readable = __webpack_require__(36).Readable;
  105070. Readable.prototype.setEncoding = original.ReadableSetEncoding;
  105071. delete Readable.prototype.collect;
  105072. }
  105073. original = undefined;
  105074. }
  105075. }
  105076. /***/ }),
  105077. /* 775 */
  105078. /***/ (function(module, exports, __webpack_require__) {
  105079. "use strict";
  105080. // Some environments don't have global Buffer (e.g. React Native).
  105081. // Solution would be installing npm modules "buffer" and "stream" explicitly.
  105082. var Buffer = __webpack_require__(20).Buffer;
  105083. var bomHandling = __webpack_require__(773),
  105084. iconv = module.exports;
  105085. // All codecs and aliases are kept here, keyed by encoding name/alias.
  105086. // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
  105087. iconv.encodings = null;
  105088. // Characters emitted in case of error.
  105089. iconv.defaultCharUnicode = '�';
  105090. iconv.defaultCharSingleByte = '?';
  105091. // Public API.
  105092. iconv.encode = function encode(str, encoding, options) {
  105093. str = "" + (str || ""); // Ensure string.
  105094. var encoder = iconv.getEncoder(encoding, options);
  105095. var res = encoder.write(str);
  105096. var trail = encoder.end();
  105097. return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;
  105098. }
  105099. iconv.decode = function decode(buf, encoding, options) {
  105100. if (typeof buf === 'string') {
  105101. if (!iconv.skipDecodeWarning) {
  105102. console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');
  105103. iconv.skipDecodeWarning = true;
  105104. }
  105105. buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
  105106. }
  105107. var decoder = iconv.getDecoder(encoding, options);
  105108. var res = decoder.write(buf);
  105109. var trail = decoder.end();
  105110. return trail ? (res + trail) : res;
  105111. }
  105112. iconv.encodingExists = function encodingExists(enc) {
  105113. try {
  105114. iconv.getCodec(enc);
  105115. return true;
  105116. } catch (e) {
  105117. return false;
  105118. }
  105119. }
  105120. // Legacy aliases to convert functions
  105121. iconv.toEncoding = iconv.encode;
  105122. iconv.fromEncoding = iconv.decode;
  105123. // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
  105124. iconv._codecDataCache = {};
  105125. iconv.getCodec = function getCodec(encoding) {
  105126. if (!iconv.encodings)
  105127. iconv.encodings = __webpack_require__(761); // Lazy load all encoding definitions.
  105128. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
  105129. var enc = iconv._canonicalizeEncoding(encoding);
  105130. // Traverse iconv.encodings to find actual codec.
  105131. var codecOptions = {};
  105132. while (true) {
  105133. var codec = iconv._codecDataCache[enc];
  105134. if (codec)
  105135. return codec;
  105136. var codecDef = iconv.encodings[enc];
  105137. switch (typeof codecDef) {
  105138. case "string": // Direct alias to other encoding.
  105139. enc = codecDef;
  105140. break;
  105141. case "object": // Alias with options. Can be layered.
  105142. for (var key in codecDef)
  105143. codecOptions[key] = codecDef[key];
  105144. if (!codecOptions.encodingName)
  105145. codecOptions.encodingName = enc;
  105146. enc = codecDef.type;
  105147. break;
  105148. case "function": // Codec itself.
  105149. if (!codecOptions.encodingName)
  105150. codecOptions.encodingName = enc;
  105151. // The codec function must load all tables and return object with .encoder and .decoder methods.
  105152. // It'll be called only once (for each different options object).
  105153. codec = new codecDef(codecOptions, iconv);
  105154. iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
  105155. return codec;
  105156. default:
  105157. throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
  105158. }
  105159. }
  105160. }
  105161. iconv._canonicalizeEncoding = function(encoding) {
  105162. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
  105163. return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
  105164. }
  105165. iconv.getEncoder = function getEncoder(encoding, options) {
  105166. var codec = iconv.getCodec(encoding),
  105167. encoder = new codec.encoder(options, codec);
  105168. if (codec.bomAware && options && options.addBOM)
  105169. encoder = new bomHandling.PrependBOM(encoder, options);
  105170. return encoder;
  105171. }
  105172. iconv.getDecoder = function getDecoder(encoding, options) {
  105173. var codec = iconv.getCodec(encoding),
  105174. decoder = new codec.decoder(options, codec);
  105175. if (codec.bomAware && !(options && options.stripBOM === false))
  105176. decoder = new bomHandling.StripBOM(decoder, options);
  105177. return decoder;
  105178. }
  105179. // Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json.
  105180. var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node;
  105181. if (nodeVer) {
  105182. // Load streaming support in Node v0.10+
  105183. var nodeVerArr = nodeVer.split(".").map(Number);
  105184. if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {
  105185. __webpack_require__(776)(iconv);
  105186. }
  105187. // Load Node primitive extensions.
  105188. __webpack_require__(774)(iconv);
  105189. }
  105190. if (false) {
  105191. console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.");
  105192. }
  105193. /***/ }),
  105194. /* 776 */
  105195. /***/ (function(module, exports, __webpack_require__) {
  105196. "use strict";
  105197. var Buffer = __webpack_require__(94).Buffer,
  105198. Transform = __webpack_require__(36).Transform;
  105199. // == Exports ==================================================================
  105200. module.exports = function(iconv) {
  105201. // Additional Public API.
  105202. iconv.encodeStream = function encodeStream(encoding, options) {
  105203. return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options);
  105204. }
  105205. iconv.decodeStream = function decodeStream(encoding, options) {
  105206. return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options);
  105207. }
  105208. iconv.supportsStreams = true;
  105209. // Not published yet.
  105210. iconv.IconvLiteEncoderStream = IconvLiteEncoderStream;
  105211. iconv.IconvLiteDecoderStream = IconvLiteDecoderStream;
  105212. iconv._collect = IconvLiteDecoderStream.prototype.collect;
  105213. };
  105214. // == Encoder stream =======================================================
  105215. function IconvLiteEncoderStream(conv, options) {
  105216. this.conv = conv;
  105217. options = options || {};
  105218. options.decodeStrings = false; // We accept only strings, so we don't need to decode them.
  105219. Transform.call(this, options);
  105220. }
  105221. IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
  105222. constructor: { value: IconvLiteEncoderStream }
  105223. });
  105224. IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {
  105225. if (typeof chunk != 'string')
  105226. return done(new Error("Iconv encoding stream needs strings as its input."));
  105227. try {
  105228. var res = this.conv.write(chunk);
  105229. if (res && res.length) this.push(res);
  105230. done();
  105231. }
  105232. catch (e) {
  105233. done(e);
  105234. }
  105235. }
  105236. IconvLiteEncoderStream.prototype._flush = function(done) {
  105237. try {
  105238. var res = this.conv.end();
  105239. if (res && res.length) this.push(res);
  105240. done();
  105241. }
  105242. catch (e) {
  105243. done(e);
  105244. }
  105245. }
  105246. IconvLiteEncoderStream.prototype.collect = function(cb) {
  105247. var chunks = [];
  105248. this.on('error', cb);
  105249. this.on('data', function(chunk) { chunks.push(chunk); });
  105250. this.on('end', function() {
  105251. cb(null, Buffer.concat(chunks));
  105252. });
  105253. return this;
  105254. }
  105255. // == Decoder stream =======================================================
  105256. function IconvLiteDecoderStream(conv, options) {
  105257. this.conv = conv;
  105258. options = options || {};
  105259. options.encoding = this.encoding = 'utf8'; // We output strings.
  105260. Transform.call(this, options);
  105261. }
  105262. IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
  105263. constructor: { value: IconvLiteDecoderStream }
  105264. });
  105265. IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
  105266. if (!Buffer.isBuffer(chunk))
  105267. return done(new Error("Iconv decoding stream needs buffers as its input."));
  105268. try {
  105269. var res = this.conv.write(chunk);
  105270. if (res && res.length) this.push(res, this.encoding);
  105271. done();
  105272. }
  105273. catch (e) {
  105274. done(e);
  105275. }
  105276. }
  105277. IconvLiteDecoderStream.prototype._flush = function(done) {
  105278. try {
  105279. var res = this.conv.end();
  105280. if (res && res.length) this.push(res, this.encoding);
  105281. done();
  105282. }
  105283. catch (e) {
  105284. done(e);
  105285. }
  105286. }
  105287. IconvLiteDecoderStream.prototype.collect = function(cb) {
  105288. var res = '';
  105289. this.on('error', cb);
  105290. this.on('data', function(chunk) { res += chunk; });
  105291. this.on('end', function() {
  105292. cb(null, res);
  105293. });
  105294. return this;
  105295. }
  105296. /***/ }),
  105297. /* 777 */
  105298. /***/ (function(module, exports, __webpack_require__) {
  105299. "use strict";
  105300. const stripAnsi = __webpack_require__(270);
  105301. const isFullwidthCodePoint = __webpack_require__(785);
  105302. module.exports = str => {
  105303. if (typeof str !== 'string' || str.length === 0) {
  105304. return 0;
  105305. }
  105306. str = stripAnsi(str);
  105307. let width = 0;
  105308. for (let i = 0; i < str.length; i++) {
  105309. const code = str.codePointAt(i);
  105310. // Ignore control characters
  105311. if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {
  105312. continue;
  105313. }
  105314. // Ignore combining characters
  105315. if (code >= 0x300 && code <= 0x36F) {
  105316. continue;
  105317. }
  105318. // Surrogates
  105319. if (code > 0xFFFF) {
  105320. i++;
  105321. }
  105322. width += isFullwidthCodePoint(code) ? 2 : 1;
  105323. }
  105324. return width;
  105325. };
  105326. /***/ }),
  105327. /* 778 */
  105328. /***/ (function(module, exports) {
  105329. /*!
  105330. * Determine if an object is a Buffer
  105331. *
  105332. * @author Feross Aboukhadijeh <https://feross.org>
  105333. * @license MIT
  105334. */
  105335. // The _isBuffer check is for Safari 5-7 support, because it's missing
  105336. // Object.prototype.constructor. Remove this eventually
  105337. module.exports = function (obj) {
  105338. return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
  105339. }
  105340. function isBuffer (obj) {
  105341. return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
  105342. }
  105343. // For Node v0.10 support. Remove this eventually.
  105344. function isSlowBuffer (obj) {
  105345. return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
  105346. }
  105347. /***/ }),
  105348. /* 779 */
  105349. /***/ (function(module, exports, __webpack_require__) {
  105350. "use strict";
  105351. const builtinModules = __webpack_require__(780);
  105352. const moduleSet = new Set(builtinModules);
  105353. module.exports = moduleName => {
  105354. if (typeof moduleName !== 'string') {
  105355. throw new TypeError('Expected a string');
  105356. }
  105357. return moduleSet.has(moduleName);
  105358. };
  105359. /***/ }),
  105360. /* 780 */
  105361. /***/ (function(module, exports, __webpack_require__) {
  105362. "use strict";
  105363. const blacklist = [
  105364. 'freelist',
  105365. 'sys'
  105366. ];
  105367. module.exports = Object.keys(process.binding('natives'))
  105368. .filter(x => !/^_|^internal|\//.test(x) && blacklist.indexOf(x) === -1)
  105369. .sort();
  105370. /***/ }),
  105371. /* 781 */
  105372. /***/ (function(module, exports, __webpack_require__) {
  105373. "use strict";
  105374. module.exports = function (buf) {
  105375. if (!buf || buf.length < 2) return false
  105376. return buf[0] === 0x78 && (buf[1] === 1 || buf[1] === 0x9c || buf[1] === 0xda)
  105377. }
  105378. /***/ }),
  105379. /* 782 */
  105380. /***/ (function(module, exports) {
  105381. /*!
  105382. * is-dotfile <https://github.com/jonschlinkert/is-dotfile>
  105383. *
  105384. * Copyright (c) 2015-2017, Jon Schlinkert.
  105385. * Released under the MIT License.
  105386. */
  105387. module.exports = function(str) {
  105388. if (str.charCodeAt(0) === 46 /* . */ && str.indexOf('/', 1) === -1) {
  105389. return true;
  105390. }
  105391. var slash = str.lastIndexOf('/');
  105392. return slash !== -1 ? str.charCodeAt(slash + 1) === 46 /* . */ : false;
  105393. };
  105394. /***/ }),
  105395. /* 783 */
  105396. /***/ (function(module, exports, __webpack_require__) {
  105397. "use strict";
  105398. /*!
  105399. * is-equal-shallow <https://github.com/jonschlinkert/is-equal-shallow>
  105400. *
  105401. * Copyright (c) 2015, Jon Schlinkert.
  105402. * Licensed under the MIT License.
  105403. */
  105404. var isPrimitive = __webpack_require__(789);
  105405. module.exports = function isEqual(a, b) {
  105406. if (!a && !b) { return true; }
  105407. if (!a && b || a && !b) { return false; }
  105408. var numKeysA = 0, numKeysB = 0, key;
  105409. for (key in b) {
  105410. numKeysB++;
  105411. if (!isPrimitive(b[key]) || !a.hasOwnProperty(key) || (a[key] !== b[key])) {
  105412. return false;
  105413. }
  105414. }
  105415. for (key in a) {
  105416. numKeysA++;
  105417. }
  105418. return numKeysA === numKeysB;
  105419. };
  105420. /***/ }),
  105421. /* 784 */
  105422. /***/ (function(module, exports, __webpack_require__) {
  105423. "use strict";
  105424. /*!
  105425. * is-extendable <https://github.com/jonschlinkert/is-extendable>
  105426. *
  105427. * Copyright (c) 2015, Jon Schlinkert.
  105428. * Licensed under the MIT License.
  105429. */
  105430. module.exports = function isExtendable(val) {
  105431. return typeof val !== 'undefined' && val !== null
  105432. && (typeof val === 'object' || typeof val === 'function');
  105433. };
  105434. /***/ }),
  105435. /* 785 */
  105436. /***/ (function(module, exports, __webpack_require__) {
  105437. "use strict";
  105438. /* eslint-disable yoda */
  105439. module.exports = x => {
  105440. if (Number.isNaN(x)) {
  105441. return false;
  105442. }
  105443. // code points are derived from:
  105444. // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
  105445. if (
  105446. x >= 0x1100 && (
  105447. x <= 0x115f || // Hangul Jamo
  105448. x === 0x2329 || // LEFT-POINTING ANGLE BRACKET
  105449. x === 0x232a || // RIGHT-POINTING ANGLE BRACKET
  105450. // CJK Radicals Supplement .. Enclosed CJK Letters and Months
  105451. (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
  105452. // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
  105453. (0x3250 <= x && x <= 0x4dbf) ||
  105454. // CJK Unified Ideographs .. Yi Radicals
  105455. (0x4e00 <= x && x <= 0xa4c6) ||
  105456. // Hangul Jamo Extended-A
  105457. (0xa960 <= x && x <= 0xa97c) ||
  105458. // Hangul Syllables
  105459. (0xac00 <= x && x <= 0xd7a3) ||
  105460. // CJK Compatibility Ideographs
  105461. (0xf900 <= x && x <= 0xfaff) ||
  105462. // Vertical Forms
  105463. (0xfe10 <= x && x <= 0xfe19) ||
  105464. // CJK Compatibility Forms .. Small Form Variants
  105465. (0xfe30 <= x && x <= 0xfe6b) ||
  105466. // Halfwidth and Fullwidth Forms
  105467. (0xff01 <= x && x <= 0xff60) ||
  105468. (0xffe0 <= x && x <= 0xffe6) ||
  105469. // Kana Supplement
  105470. (0x1b000 <= x && x <= 0x1b001) ||
  105471. // Enclosed Ideographic Supplement
  105472. (0x1f200 <= x && x <= 0x1f251) ||
  105473. // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
  105474. (0x20000 <= x && x <= 0x3fffd)
  105475. )
  105476. ) {
  105477. return true;
  105478. }
  105479. return false;
  105480. };
  105481. /***/ }),
  105482. /* 786 */
  105483. /***/ (function(module, exports, __webpack_require__) {
  105484. "use strict";
  105485. /**
  105486. * Check if a Buffer/Uint8Array is a GZIP file
  105487. *
  105488. * @param {Buffer} buf
  105489. * @api public
  105490. */
  105491. module.exports = function (buf) {
  105492. if (!buf || buf.length < 3) {
  105493. return false;
  105494. }
  105495. return buf[0] === 31 && buf[1] === 139 && buf[2] === 8;
  105496. };
  105497. /***/ }),
  105498. /* 787 */
  105499. /***/ (function(module, exports, __webpack_require__) {
  105500. "use strict";
  105501. var toString = Object.prototype.toString;
  105502. module.exports = function (x) {
  105503. var prototype;
  105504. return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));
  105505. };
  105506. /***/ }),
  105507. /* 788 */
  105508. /***/ (function(module, exports) {
  105509. /*!
  105510. * is-posix-bracket <https://github.com/jonschlinkert/is-posix-bracket>
  105511. *
  105512. * Copyright (c) 2015-2016, Jon Schlinkert.
  105513. * Licensed under the MIT License.
  105514. */
  105515. module.exports = function isPosixBracket(str) {
  105516. return typeof str === 'string' && /\[([:.=+])(?:[^\[\]]|)+\1\]/.test(str);
  105517. };
  105518. /***/ }),
  105519. /* 789 */
  105520. /***/ (function(module, exports, __webpack_require__) {
  105521. "use strict";
  105522. /*!
  105523. * is-primitive <https://github.com/jonschlinkert/is-primitive>
  105524. *
  105525. * Copyright (c) 2014-2015, Jon Schlinkert.
  105526. * Licensed under the MIT License.
  105527. */
  105528. // see http://jsperf.com/testing-value-is-primitive/7
  105529. module.exports = function isPrimitive(value) {
  105530. return value == null || (typeof value !== 'function' && typeof value !== 'object');
  105531. };
  105532. /***/ }),
  105533. /* 790 */
  105534. /***/ (function(module, exports) {
  105535. module.exports = isPromise;
  105536. function isPromise(obj) {
  105537. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  105538. }
  105539. /***/ }),
  105540. /* 791 */
  105541. /***/ (function(module, exports) {
  105542. module.exports = isTypedArray
  105543. isTypedArray.strict = isStrictTypedArray
  105544. isTypedArray.loose = isLooseTypedArray
  105545. var toString = Object.prototype.toString
  105546. var names = {
  105547. '[object Int8Array]': true
  105548. , '[object Int16Array]': true
  105549. , '[object Int32Array]': true
  105550. , '[object Uint8Array]': true
  105551. , '[object Uint8ClampedArray]': true
  105552. , '[object Uint16Array]': true
  105553. , '[object Uint32Array]': true
  105554. , '[object Float32Array]': true
  105555. , '[object Float64Array]': true
  105556. }
  105557. function isTypedArray(arr) {
  105558. return (
  105559. isStrictTypedArray(arr)
  105560. || isLooseTypedArray(arr)
  105561. )
  105562. }
  105563. function isStrictTypedArray(arr) {
  105564. return (
  105565. arr instanceof Int8Array
  105566. || arr instanceof Int16Array
  105567. || arr instanceof Int32Array
  105568. || arr instanceof Uint8Array
  105569. || arr instanceof Uint8ClampedArray
  105570. || arr instanceof Uint16Array
  105571. || arr instanceof Uint32Array
  105572. || arr instanceof Float32Array
  105573. || arr instanceof Float64Array
  105574. )
  105575. }
  105576. function isLooseTypedArray(arr) {
  105577. return names[toString.call(arr)]
  105578. }
  105579. /***/ }),
  105580. /* 792 */
  105581. /***/ (function(module, exports, __webpack_require__) {
  105582. // @flow
  105583. /*::
  105584. declare var __webpack_require__: mixed;
  105585. */
  105586. module.exports = typeof __webpack_require__ !== "undefined";
  105587. /***/ }),
  105588. /* 793 */
  105589. /***/ (function(module, exports, __webpack_require__) {
  105590. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  105591. * is-windows <https://github.com/jonschlinkert/is-windows>
  105592. *
  105593. * Copyright © 2015-2018, Jon Schlinkert.
  105594. * Released under the MIT License.
  105595. */
  105596. (function(factory) {
  105597. if (exports && typeof exports === 'object' && typeof module !== 'undefined') {
  105598. module.exports = factory();
  105599. } else if (true) {
  105600. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  105601. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  105602. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  105603. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  105604. } else if (typeof window !== 'undefined') {
  105605. window.isWindows = factory();
  105606. } else if (typeof global !== 'undefined') {
  105607. global.isWindows = factory();
  105608. } else if (typeof self !== 'undefined') {
  105609. self.isWindows = factory();
  105610. } else {
  105611. this.isWindows = factory();
  105612. }
  105613. })(function() {
  105614. 'use strict';
  105615. return function isWindows() {
  105616. return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE));
  105617. };
  105618. });
  105619. /***/ }),
  105620. /* 794 */
  105621. /***/ (function(module, exports, __webpack_require__) {
  105622. "use strict";
  105623. var yaml = __webpack_require__(795);
  105624. module.exports = yaml;
  105625. /***/ }),
  105626. /* 795 */
  105627. /***/ (function(module, exports, __webpack_require__) {
  105628. "use strict";
  105629. var loader = __webpack_require__(797);
  105630. var dumper = __webpack_require__(796);
  105631. function deprecated(name) {
  105632. return function () {
  105633. throw new Error('Function ' + name + ' is deprecated and cannot be used.');
  105634. };
  105635. }
  105636. module.exports.Type = __webpack_require__(30);
  105637. module.exports.Schema = __webpack_require__(108);
  105638. module.exports.FAILSAFE_SCHEMA = __webpack_require__(239);
  105639. module.exports.JSON_SCHEMA = __webpack_require__(369);
  105640. module.exports.CORE_SCHEMA = __webpack_require__(368);
  105641. module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(133);
  105642. module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(168);
  105643. module.exports.load = loader.load;
  105644. module.exports.loadAll = loader.loadAll;
  105645. module.exports.safeLoad = loader.safeLoad;
  105646. module.exports.safeLoadAll = loader.safeLoadAll;
  105647. module.exports.dump = dumper.dump;
  105648. module.exports.safeDump = dumper.safeDump;
  105649. module.exports.YAMLException = __webpack_require__(132);
  105650. // Deprecated schema names from JS-YAML 2.0.x
  105651. module.exports.MINIMAL_SCHEMA = __webpack_require__(239);
  105652. module.exports.SAFE_SCHEMA = __webpack_require__(133);
  105653. module.exports.DEFAULT_SCHEMA = __webpack_require__(168);
  105654. // Deprecated functions from JS-YAML 1.x.x
  105655. module.exports.scan = deprecated('scan');
  105656. module.exports.parse = deprecated('parse');
  105657. module.exports.compose = deprecated('compose');
  105658. module.exports.addConstructor = deprecated('addConstructor');
  105659. /***/ }),
  105660. /* 796 */
  105661. /***/ (function(module, exports, __webpack_require__) {
  105662. "use strict";
  105663. /*eslint-disable no-use-before-define*/
  105664. var common = __webpack_require__(107);
  105665. var YAMLException = __webpack_require__(132);
  105666. var DEFAULT_FULL_SCHEMA = __webpack_require__(168);
  105667. var DEFAULT_SAFE_SCHEMA = __webpack_require__(133);
  105668. var _toString = Object.prototype.toString;
  105669. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  105670. var CHAR_TAB = 0x09; /* Tab */
  105671. var CHAR_LINE_FEED = 0x0A; /* LF */
  105672. var CHAR_SPACE = 0x20; /* Space */
  105673. var CHAR_EXCLAMATION = 0x21; /* ! */
  105674. var CHAR_DOUBLE_QUOTE = 0x22; /* " */
  105675. var CHAR_SHARP = 0x23; /* # */
  105676. var CHAR_PERCENT = 0x25; /* % */
  105677. var CHAR_AMPERSAND = 0x26; /* & */
  105678. var CHAR_SINGLE_QUOTE = 0x27; /* ' */
  105679. var CHAR_ASTERISK = 0x2A; /* * */
  105680. var CHAR_COMMA = 0x2C; /* , */
  105681. var CHAR_MINUS = 0x2D; /* - */
  105682. var CHAR_COLON = 0x3A; /* : */
  105683. var CHAR_GREATER_THAN = 0x3E; /* > */
  105684. var CHAR_QUESTION = 0x3F; /* ? */
  105685. var CHAR_COMMERCIAL_AT = 0x40; /* @ */
  105686. var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
  105687. var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
  105688. var CHAR_GRAVE_ACCENT = 0x60; /* ` */
  105689. var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
  105690. var CHAR_VERTICAL_LINE = 0x7C; /* | */
  105691. var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
  105692. var ESCAPE_SEQUENCES = {};
  105693. ESCAPE_SEQUENCES[0x00] = '\\0';
  105694. ESCAPE_SEQUENCES[0x07] = '\\a';
  105695. ESCAPE_SEQUENCES[0x08] = '\\b';
  105696. ESCAPE_SEQUENCES[0x09] = '\\t';
  105697. ESCAPE_SEQUENCES[0x0A] = '\\n';
  105698. ESCAPE_SEQUENCES[0x0B] = '\\v';
  105699. ESCAPE_SEQUENCES[0x0C] = '\\f';
  105700. ESCAPE_SEQUENCES[0x0D] = '\\r';
  105701. ESCAPE_SEQUENCES[0x1B] = '\\e';
  105702. ESCAPE_SEQUENCES[0x22] = '\\"';
  105703. ESCAPE_SEQUENCES[0x5C] = '\\\\';
  105704. ESCAPE_SEQUENCES[0x85] = '\\N';
  105705. ESCAPE_SEQUENCES[0xA0] = '\\_';
  105706. ESCAPE_SEQUENCES[0x2028] = '\\L';
  105707. ESCAPE_SEQUENCES[0x2029] = '\\P';
  105708. var DEPRECATED_BOOLEANS_SYNTAX = [
  105709. 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
  105710. 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
  105711. ];
  105712. function compileStyleMap(schema, map) {
  105713. var result, keys, index, length, tag, style, type;
  105714. if (map === null) return {};
  105715. result = {};
  105716. keys = Object.keys(map);
  105717. for (index = 0, length = keys.length; index < length; index += 1) {
  105718. tag = keys[index];
  105719. style = String(map[tag]);
  105720. if (tag.slice(0, 2) === '!!') {
  105721. tag = 'tag:yaml.org,2002:' + tag.slice(2);
  105722. }
  105723. type = schema.compiledTypeMap['fallback'][tag];
  105724. if (type && _hasOwnProperty.call(type.styleAliases, style)) {
  105725. style = type.styleAliases[style];
  105726. }
  105727. result[tag] = style;
  105728. }
  105729. return result;
  105730. }
  105731. function encodeHex(character) {
  105732. var string, handle, length;
  105733. string = character.toString(16).toUpperCase();
  105734. if (character <= 0xFF) {
  105735. handle = 'x';
  105736. length = 2;
  105737. } else if (character <= 0xFFFF) {
  105738. handle = 'u';
  105739. length = 4;
  105740. } else if (character <= 0xFFFFFFFF) {
  105741. handle = 'U';
  105742. length = 8;
  105743. } else {
  105744. throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
  105745. }
  105746. return '\\' + handle + common.repeat('0', length - string.length) + string;
  105747. }
  105748. function State(options) {
  105749. this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
  105750. this.indent = Math.max(1, (options['indent'] || 2));
  105751. this.noArrayIndent = options['noArrayIndent'] || false;
  105752. this.skipInvalid = options['skipInvalid'] || false;
  105753. this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
  105754. this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
  105755. this.sortKeys = options['sortKeys'] || false;
  105756. this.lineWidth = options['lineWidth'] || 80;
  105757. this.noRefs = options['noRefs'] || false;
  105758. this.noCompatMode = options['noCompatMode'] || false;
  105759. this.condenseFlow = options['condenseFlow'] || false;
  105760. this.implicitTypes = this.schema.compiledImplicit;
  105761. this.explicitTypes = this.schema.compiledExplicit;
  105762. this.tag = null;
  105763. this.result = '';
  105764. this.duplicates = [];
  105765. this.usedDuplicates = null;
  105766. }
  105767. // Indents every line in a string. Empty lines (\n only) are not indented.
  105768. function indentString(string, spaces) {
  105769. var ind = common.repeat(' ', spaces),
  105770. position = 0,
  105771. next = -1,
  105772. result = '',
  105773. line,
  105774. length = string.length;
  105775. while (position < length) {
  105776. next = string.indexOf('\n', position);
  105777. if (next === -1) {
  105778. line = string.slice(position);
  105779. position = length;
  105780. } else {
  105781. line = string.slice(position, next + 1);
  105782. position = next + 1;
  105783. }
  105784. if (line.length && line !== '\n') result += ind;
  105785. result += line;
  105786. }
  105787. return result;
  105788. }
  105789. function generateNextLine(state, level) {
  105790. return '\n' + common.repeat(' ', state.indent * level);
  105791. }
  105792. function testImplicitResolving(state, str) {
  105793. var index, length, type;
  105794. for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
  105795. type = state.implicitTypes[index];
  105796. if (type.resolve(str)) {
  105797. return true;
  105798. }
  105799. }
  105800. return false;
  105801. }
  105802. // [33] s-white ::= s-space | s-tab
  105803. function isWhitespace(c) {
  105804. return c === CHAR_SPACE || c === CHAR_TAB;
  105805. }
  105806. // Returns true if the character can be printed without escaping.
  105807. // From YAML 1.2: "any allowed characters known to be non-printable
  105808. // should also be escaped. [However,] This isn’t mandatory"
  105809. // Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
  105810. function isPrintable(c) {
  105811. return (0x00020 <= c && c <= 0x00007E)
  105812. || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
  105813. || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */)
  105814. || (0x10000 <= c && c <= 0x10FFFF);
  105815. }
  105816. // Simplified test for values allowed after the first character in plain style.
  105817. function isPlainSafe(c) {
  105818. // Uses a subset of nb-char - c-flow-indicator - ":" - "#"
  105819. // where nb-char ::= c-printable - b-char - c-byte-order-mark.
  105820. return isPrintable(c) && c !== 0xFEFF
  105821. // - c-flow-indicator
  105822. && c !== CHAR_COMMA
  105823. && c !== CHAR_LEFT_SQUARE_BRACKET
  105824. && c !== CHAR_RIGHT_SQUARE_BRACKET
  105825. && c !== CHAR_LEFT_CURLY_BRACKET
  105826. && c !== CHAR_RIGHT_CURLY_BRACKET
  105827. // - ":" - "#"
  105828. && c !== CHAR_COLON
  105829. && c !== CHAR_SHARP;
  105830. }
  105831. // Simplified test for values allowed as the first character in plain style.
  105832. function isPlainSafeFirst(c) {
  105833. // Uses a subset of ns-char - c-indicator
  105834. // where ns-char = nb-char - s-white.
  105835. return isPrintable(c) && c !== 0xFEFF
  105836. && !isWhitespace(c) // - s-white
  105837. // - (c-indicator ::=
  105838. // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
  105839. && c !== CHAR_MINUS
  105840. && c !== CHAR_QUESTION
  105841. && c !== CHAR_COLON
  105842. && c !== CHAR_COMMA
  105843. && c !== CHAR_LEFT_SQUARE_BRACKET
  105844. && c !== CHAR_RIGHT_SQUARE_BRACKET
  105845. && c !== CHAR_LEFT_CURLY_BRACKET
  105846. && c !== CHAR_RIGHT_CURLY_BRACKET
  105847. // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"”
  105848. && c !== CHAR_SHARP
  105849. && c !== CHAR_AMPERSAND
  105850. && c !== CHAR_ASTERISK
  105851. && c !== CHAR_EXCLAMATION
  105852. && c !== CHAR_VERTICAL_LINE
  105853. && c !== CHAR_GREATER_THAN
  105854. && c !== CHAR_SINGLE_QUOTE
  105855. && c !== CHAR_DOUBLE_QUOTE
  105856. // | “%” | “@” | “`”)
  105857. && c !== CHAR_PERCENT
  105858. && c !== CHAR_COMMERCIAL_AT
  105859. && c !== CHAR_GRAVE_ACCENT;
  105860. }
  105861. // Determines whether block indentation indicator is required.
  105862. function needIndentIndicator(string) {
  105863. var leadingSpaceRe = /^\n* /;
  105864. return leadingSpaceRe.test(string);
  105865. }
  105866. var STYLE_PLAIN = 1,
  105867. STYLE_SINGLE = 2,
  105868. STYLE_LITERAL = 3,
  105869. STYLE_FOLDED = 4,
  105870. STYLE_DOUBLE = 5;
  105871. // Determines which scalar styles are possible and returns the preferred style.
  105872. // lineWidth = -1 => no limit.
  105873. // Pre-conditions: str.length > 0.
  105874. // Post-conditions:
  105875. // STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
  105876. // STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
  105877. // STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
  105878. function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
  105879. var i;
  105880. var char;
  105881. var hasLineBreak = false;
  105882. var hasFoldableLine = false; // only checked if shouldTrackWidth
  105883. var shouldTrackWidth = lineWidth !== -1;
  105884. var previousLineBreak = -1; // count the first line correctly
  105885. var plain = isPlainSafeFirst(string.charCodeAt(0))
  105886. && !isWhitespace(string.charCodeAt(string.length - 1));
  105887. if (singleLineOnly) {
  105888. // Case: no block styles.
  105889. // Check for disallowed characters to rule out plain and single.
  105890. for (i = 0; i < string.length; i++) {
  105891. char = string.charCodeAt(i);
  105892. if (!isPrintable(char)) {
  105893. return STYLE_DOUBLE;
  105894. }
  105895. plain = plain && isPlainSafe(char);
  105896. }
  105897. } else {
  105898. // Case: block styles permitted.
  105899. for (i = 0; i < string.length; i++) {
  105900. char = string.charCodeAt(i);
  105901. if (char === CHAR_LINE_FEED) {
  105902. hasLineBreak = true;
  105903. // Check if any line can be folded.
  105904. if (shouldTrackWidth) {
  105905. hasFoldableLine = hasFoldableLine ||
  105906. // Foldable line = too long, and not more-indented.
  105907. (i - previousLineBreak - 1 > lineWidth &&
  105908. string[previousLineBreak + 1] !== ' ');
  105909. previousLineBreak = i;
  105910. }
  105911. } else if (!isPrintable(char)) {
  105912. return STYLE_DOUBLE;
  105913. }
  105914. plain = plain && isPlainSafe(char);
  105915. }
  105916. // in case the end is missing a \n
  105917. hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
  105918. (i - previousLineBreak - 1 > lineWidth &&
  105919. string[previousLineBreak + 1] !== ' '));
  105920. }
  105921. // Although every style can represent \n without escaping, prefer block styles
  105922. // for multiline, since they're more readable and they don't add empty lines.
  105923. // Also prefer folding a super-long line.
  105924. if (!hasLineBreak && !hasFoldableLine) {
  105925. // Strings interpretable as another type have to be quoted;
  105926. // e.g. the string 'true' vs. the boolean true.
  105927. return plain && !testAmbiguousType(string)
  105928. ? STYLE_PLAIN : STYLE_SINGLE;
  105929. }
  105930. // Edge case: block indentation indicator can only have one digit.
  105931. if (indentPerLevel > 9 && needIndentIndicator(string)) {
  105932. return STYLE_DOUBLE;
  105933. }
  105934. // At this point we know block styles are valid.
  105935. // Prefer literal style unless we want to fold.
  105936. return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
  105937. }
  105938. // Note: line breaking/folding is implemented for only the folded style.
  105939. // NB. We drop the last trailing newline (if any) of a returned block scalar
  105940. // since the dumper adds its own newline. This always works:
  105941. // • No ending newline => unaffected; already using strip "-" chomping.
  105942. // • Ending newline => removed then restored.
  105943. // Importantly, this keeps the "+" chomp indicator from gaining an extra line.
  105944. function writeScalar(state, string, level, iskey) {
  105945. state.dump = (function () {
  105946. if (string.length === 0) {
  105947. return "''";
  105948. }
  105949. if (!state.noCompatMode &&
  105950. DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
  105951. return "'" + string + "'";
  105952. }
  105953. var indent = state.indent * Math.max(1, level); // no 0-indent scalars
  105954. // As indentation gets deeper, let the width decrease monotonically
  105955. // to the lower bound min(state.lineWidth, 40).
  105956. // Note that this implies
  105957. // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.
  105958. // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
  105959. // This behaves better than a constant minimum width which disallows narrower options,
  105960. // or an indent threshold which causes the width to suddenly increase.
  105961. var lineWidth = state.lineWidth === -1
  105962. ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
  105963. // Without knowing if keys are implicit/explicit, assume implicit for safety.
  105964. var singleLineOnly = iskey
  105965. // No block styles in flow mode.
  105966. || (state.flowLevel > -1 && level >= state.flowLevel);
  105967. function testAmbiguity(string) {
  105968. return testImplicitResolving(state, string);
  105969. }
  105970. switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
  105971. case STYLE_PLAIN:
  105972. return string;
  105973. case STYLE_SINGLE:
  105974. return "'" + string.replace(/'/g, "''") + "'";
  105975. case STYLE_LITERAL:
  105976. return '|' + blockHeader(string, state.indent)
  105977. + dropEndingNewline(indentString(string, indent));
  105978. case STYLE_FOLDED:
  105979. return '>' + blockHeader(string, state.indent)
  105980. + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
  105981. case STYLE_DOUBLE:
  105982. return '"' + escapeString(string, lineWidth) + '"';
  105983. default:
  105984. throw new YAMLException('impossible error: invalid scalar style');
  105985. }
  105986. }());
  105987. }
  105988. // Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
  105989. function blockHeader(string, indentPerLevel) {
  105990. var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
  105991. // note the special case: the string '\n' counts as a "trailing" empty line.
  105992. var clip = string[string.length - 1] === '\n';
  105993. var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
  105994. var chomp = keep ? '+' : (clip ? '' : '-');
  105995. return indentIndicator + chomp + '\n';
  105996. }
  105997. // (See the note for writeScalar.)
  105998. function dropEndingNewline(string) {
  105999. return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
  106000. }
  106001. // Note: a long line without a suitable break point will exceed the width limit.
  106002. // Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
  106003. function foldString(string, width) {
  106004. // In folded style, $k$ consecutive newlines output as $k+1$ newlines—
  106005. // unless they're before or after a more-indented line, or at the very
  106006. // beginning or end, in which case $k$ maps to $k$.
  106007. // Therefore, parse each chunk as newline(s) followed by a content line.
  106008. var lineRe = /(\n+)([^\n]*)/g;
  106009. // first line (possibly an empty line)
  106010. var result = (function () {
  106011. var nextLF = string.indexOf('\n');
  106012. nextLF = nextLF !== -1 ? nextLF : string.length;
  106013. lineRe.lastIndex = nextLF;
  106014. return foldLine(string.slice(0, nextLF), width);
  106015. }());
  106016. // If we haven't reached the first content line yet, don't add an extra \n.
  106017. var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
  106018. var moreIndented;
  106019. // rest of the lines
  106020. var match;
  106021. while ((match = lineRe.exec(string))) {
  106022. var prefix = match[1], line = match[2];
  106023. moreIndented = (line[0] === ' ');
  106024. result += prefix
  106025. + (!prevMoreIndented && !moreIndented && line !== ''
  106026. ? '\n' : '')
  106027. + foldLine(line, width);
  106028. prevMoreIndented = moreIndented;
  106029. }
  106030. return result;
  106031. }
  106032. // Greedy line breaking.
  106033. // Picks the longest line under the limit each time,
  106034. // otherwise settles for the shortest line over the limit.
  106035. // NB. More-indented lines *cannot* be folded, as that would add an extra \n.
  106036. function foldLine(line, width) {
  106037. if (line === '' || line[0] === ' ') return line;
  106038. // Since a more-indented line adds a \n, breaks can't be followed by a space.
  106039. var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
  106040. var match;
  106041. // start is an inclusive index. end, curr, and next are exclusive.
  106042. var start = 0, end, curr = 0, next = 0;
  106043. var result = '';
  106044. // Invariants: 0 <= start <= length-1.
  106045. // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
  106046. // Inside the loop:
  106047. // A match implies length >= 2, so curr and next are <= length-2.
  106048. while ((match = breakRe.exec(line))) {
  106049. next = match.index;
  106050. // maintain invariant: curr - start <= width
  106051. if (next - start > width) {
  106052. end = (curr > start) ? curr : next; // derive end <= length-2
  106053. result += '\n' + line.slice(start, end);
  106054. // skip the space that was output as \n
  106055. start = end + 1; // derive start <= length-1
  106056. }
  106057. curr = next;
  106058. }
  106059. // By the invariants, start <= length-1, so there is something left over.
  106060. // It is either the whole string or a part starting from non-whitespace.
  106061. result += '\n';
  106062. // Insert a break if the remainder is too long and there is a break available.
  106063. if (line.length - start > width && curr > start) {
  106064. result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
  106065. } else {
  106066. result += line.slice(start);
  106067. }
  106068. return result.slice(1); // drop extra \n joiner
  106069. }
  106070. // Escapes a double-quoted string.
  106071. function escapeString(string) {
  106072. var result = '';
  106073. var char, nextChar;
  106074. var escapeSeq;
  106075. for (var i = 0; i < string.length; i++) {
  106076. char = string.charCodeAt(i);
  106077. // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates").
  106078. if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {
  106079. nextChar = string.charCodeAt(i + 1);
  106080. if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {
  106081. // Combine the surrogate pair and store it escaped.
  106082. result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);
  106083. // Advance index one extra since we already used that char here.
  106084. i++; continue;
  106085. }
  106086. }
  106087. escapeSeq = ESCAPE_SEQUENCES[char];
  106088. result += !escapeSeq && isPrintable(char)
  106089. ? string[i]
  106090. : escapeSeq || encodeHex(char);
  106091. }
  106092. return result;
  106093. }
  106094. function writeFlowSequence(state, level, object) {
  106095. var _result = '',
  106096. _tag = state.tag,
  106097. index,
  106098. length;
  106099. for (index = 0, length = object.length; index < length; index += 1) {
  106100. // Write only valid elements.
  106101. if (writeNode(state, level, object[index], false, false)) {
  106102. if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : '');
  106103. _result += state.dump;
  106104. }
  106105. }
  106106. state.tag = _tag;
  106107. state.dump = '[' + _result + ']';
  106108. }
  106109. function writeBlockSequence(state, level, object, compact) {
  106110. var _result = '',
  106111. _tag = state.tag,
  106112. index,
  106113. length;
  106114. for (index = 0, length = object.length; index < length; index += 1) {
  106115. // Write only valid elements.
  106116. if (writeNode(state, level + 1, object[index], true, true)) {
  106117. if (!compact || index !== 0) {
  106118. _result += generateNextLine(state, level);
  106119. }
  106120. if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
  106121. _result += '-';
  106122. } else {
  106123. _result += '- ';
  106124. }
  106125. _result += state.dump;
  106126. }
  106127. }
  106128. state.tag = _tag;
  106129. state.dump = _result || '[]'; // Empty sequence if no valid values.
  106130. }
  106131. function writeFlowMapping(state, level, object) {
  106132. var _result = '',
  106133. _tag = state.tag,
  106134. objectKeyList = Object.keys(object),
  106135. index,
  106136. length,
  106137. objectKey,
  106138. objectValue,
  106139. pairBuffer;
  106140. for (index = 0, length = objectKeyList.length; index < length; index += 1) {
  106141. pairBuffer = state.condenseFlow ? '"' : '';
  106142. if (index !== 0) pairBuffer += ', ';
  106143. objectKey = objectKeyList[index];
  106144. objectValue = object[objectKey];
  106145. if (!writeNode(state, level, objectKey, false, false)) {
  106146. continue; // Skip this pair because of invalid key;
  106147. }
  106148. if (state.dump.length > 1024) pairBuffer += '? ';
  106149. pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
  106150. if (!writeNode(state, level, objectValue, false, false)) {
  106151. continue; // Skip this pair because of invalid value.
  106152. }
  106153. pairBuffer += state.dump;
  106154. // Both key and value are valid.
  106155. _result += pairBuffer;
  106156. }
  106157. state.tag = _tag;
  106158. state.dump = '{' + _result + '}';
  106159. }
  106160. function writeBlockMapping(state, level, object, compact) {
  106161. var _result = '',
  106162. _tag = state.tag,
  106163. objectKeyList = Object.keys(object),
  106164. index,
  106165. length,
  106166. objectKey,
  106167. objectValue,
  106168. explicitPair,
  106169. pairBuffer;
  106170. // Allow sorting keys so that the output file is deterministic
  106171. if (state.sortKeys === true) {
  106172. // Default sorting
  106173. objectKeyList.sort();
  106174. } else if (typeof state.sortKeys === 'function') {
  106175. // Custom sort function
  106176. objectKeyList.sort(state.sortKeys);
  106177. } else if (state.sortKeys) {
  106178. // Something is wrong
  106179. throw new YAMLException('sortKeys must be a boolean or a function');
  106180. }
  106181. for (index = 0, length = objectKeyList.length; index < length; index += 1) {
  106182. pairBuffer = '';
  106183. if (!compact || index !== 0) {
  106184. pairBuffer += generateNextLine(state, level);
  106185. }
  106186. objectKey = objectKeyList[index];
  106187. objectValue = object[objectKey];
  106188. if (!writeNode(state, level + 1, objectKey, true, true, true)) {
  106189. continue; // Skip this pair because of invalid key.
  106190. }
  106191. explicitPair = (state.tag !== null && state.tag !== '?') ||
  106192. (state.dump && state.dump.length > 1024);
  106193. if (explicitPair) {
  106194. if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
  106195. pairBuffer += '?';
  106196. } else {
  106197. pairBuffer += '? ';
  106198. }
  106199. }
  106200. pairBuffer += state.dump;
  106201. if (explicitPair) {
  106202. pairBuffer += generateNextLine(state, level);
  106203. }
  106204. if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
  106205. continue; // Skip this pair because of invalid value.
  106206. }
  106207. if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
  106208. pairBuffer += ':';
  106209. } else {
  106210. pairBuffer += ': ';
  106211. }
  106212. pairBuffer += state.dump;
  106213. // Both key and value are valid.
  106214. _result += pairBuffer;
  106215. }
  106216. state.tag = _tag;
  106217. state.dump = _result || '{}'; // Empty mapping if no valid pairs.
  106218. }
  106219. function detectType(state, object, explicit) {
  106220. var _result, typeList, index, length, type, style;
  106221. typeList = explicit ? state.explicitTypes : state.implicitTypes;
  106222. for (index = 0, length = typeList.length; index < length; index += 1) {
  106223. type = typeList[index];
  106224. if ((type.instanceOf || type.predicate) &&
  106225. (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
  106226. (!type.predicate || type.predicate(object))) {
  106227. state.tag = explicit ? type.tag : '?';
  106228. if (type.represent) {
  106229. style = state.styleMap[type.tag] || type.defaultStyle;
  106230. if (_toString.call(type.represent) === '[object Function]') {
  106231. _result = type.represent(object, style);
  106232. } else if (_hasOwnProperty.call(type.represent, style)) {
  106233. _result = type.represent[style](object, style);
  106234. } else {
  106235. throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
  106236. }
  106237. state.dump = _result;
  106238. }
  106239. return true;
  106240. }
  106241. }
  106242. return false;
  106243. }
  106244. // Serializes `object` and writes it to global `result`.
  106245. // Returns true on success, or false on invalid object.
  106246. //
  106247. function writeNode(state, level, object, block, compact, iskey) {
  106248. state.tag = null;
  106249. state.dump = object;
  106250. if (!detectType(state, object, false)) {
  106251. detectType(state, object, true);
  106252. }
  106253. var type = _toString.call(state.dump);
  106254. if (block) {
  106255. block = (state.flowLevel < 0 || state.flowLevel > level);
  106256. }
  106257. var objectOrArray = type === '[object Object]' || type === '[object Array]',
  106258. duplicateIndex,
  106259. duplicate;
  106260. if (objectOrArray) {
  106261. duplicateIndex = state.duplicates.indexOf(object);
  106262. duplicate = duplicateIndex !== -1;
  106263. }
  106264. if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
  106265. compact = false;
  106266. }
  106267. if (duplicate && state.usedDuplicates[duplicateIndex]) {
  106268. state.dump = '*ref_' + duplicateIndex;
  106269. } else {
  106270. if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
  106271. state.usedDuplicates[duplicateIndex] = true;
  106272. }
  106273. if (type === '[object Object]') {
  106274. if (block && (Object.keys(state.dump).length !== 0)) {
  106275. writeBlockMapping(state, level, state.dump, compact);
  106276. if (duplicate) {
  106277. state.dump = '&ref_' + duplicateIndex + state.dump;
  106278. }
  106279. } else {
  106280. writeFlowMapping(state, level, state.dump);
  106281. if (duplicate) {
  106282. state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
  106283. }
  106284. }
  106285. } else if (type === '[object Array]') {
  106286. var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level;
  106287. if (block && (state.dump.length !== 0)) {
  106288. writeBlockSequence(state, arrayLevel, state.dump, compact);
  106289. if (duplicate) {
  106290. state.dump = '&ref_' + duplicateIndex + state.dump;
  106291. }
  106292. } else {
  106293. writeFlowSequence(state, arrayLevel, state.dump);
  106294. if (duplicate) {
  106295. state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
  106296. }
  106297. }
  106298. } else if (type === '[object String]') {
  106299. if (state.tag !== '?') {
  106300. writeScalar(state, state.dump, level, iskey);
  106301. }
  106302. } else {
  106303. if (state.skipInvalid) return false;
  106304. throw new YAMLException('unacceptable kind of an object to dump ' + type);
  106305. }
  106306. if (state.tag !== null && state.tag !== '?') {
  106307. state.dump = '!<' + state.tag + '> ' + state.dump;
  106308. }
  106309. }
  106310. return true;
  106311. }
  106312. function getDuplicateReferences(object, state) {
  106313. var objects = [],
  106314. duplicatesIndexes = [],
  106315. index,
  106316. length;
  106317. inspectNode(object, objects, duplicatesIndexes);
  106318. for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
  106319. state.duplicates.push(objects[duplicatesIndexes[index]]);
  106320. }
  106321. state.usedDuplicates = new Array(length);
  106322. }
  106323. function inspectNode(object, objects, duplicatesIndexes) {
  106324. var objectKeyList,
  106325. index,
  106326. length;
  106327. if (object !== null && typeof object === 'object') {
  106328. index = objects.indexOf(object);
  106329. if (index !== -1) {
  106330. if (duplicatesIndexes.indexOf(index) === -1) {
  106331. duplicatesIndexes.push(index);
  106332. }
  106333. } else {
  106334. objects.push(object);
  106335. if (Array.isArray(object)) {
  106336. for (index = 0, length = object.length; index < length; index += 1) {
  106337. inspectNode(object[index], objects, duplicatesIndexes);
  106338. }
  106339. } else {
  106340. objectKeyList = Object.keys(object);
  106341. for (index = 0, length = objectKeyList.length; index < length; index += 1) {
  106342. inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
  106343. }
  106344. }
  106345. }
  106346. }
  106347. }
  106348. function dump(input, options) {
  106349. options = options || {};
  106350. var state = new State(options);
  106351. if (!state.noRefs) getDuplicateReferences(input, state);
  106352. if (writeNode(state, 0, input, true, true)) return state.dump + '\n';
  106353. return '';
  106354. }
  106355. function safeDump(input, options) {
  106356. return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
  106357. }
  106358. module.exports.dump = dump;
  106359. module.exports.safeDump = safeDump;
  106360. /***/ }),
  106361. /* 797 */
  106362. /***/ (function(module, exports, __webpack_require__) {
  106363. "use strict";
  106364. /*eslint-disable max-len,no-use-before-define*/
  106365. var common = __webpack_require__(107);
  106366. var YAMLException = __webpack_require__(132);
  106367. var Mark = __webpack_require__(798);
  106368. var DEFAULT_SAFE_SCHEMA = __webpack_require__(133);
  106369. var DEFAULT_FULL_SCHEMA = __webpack_require__(168);
  106370. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  106371. var CONTEXT_FLOW_IN = 1;
  106372. var CONTEXT_FLOW_OUT = 2;
  106373. var CONTEXT_BLOCK_IN = 3;
  106374. var CONTEXT_BLOCK_OUT = 4;
  106375. var CHOMPING_CLIP = 1;
  106376. var CHOMPING_STRIP = 2;
  106377. var CHOMPING_KEEP = 3;
  106378. var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
  106379. var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
  106380. var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
  106381. var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
  106382. var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
  106383. function _class(obj) { return Object.prototype.toString.call(obj); }
  106384. function is_EOL(c) {
  106385. return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
  106386. }
  106387. function is_WHITE_SPACE(c) {
  106388. return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
  106389. }
  106390. function is_WS_OR_EOL(c) {
  106391. return (c === 0x09/* Tab */) ||
  106392. (c === 0x20/* Space */) ||
  106393. (c === 0x0A/* LF */) ||
  106394. (c === 0x0D/* CR */);
  106395. }
  106396. function is_FLOW_INDICATOR(c) {
  106397. return c === 0x2C/* , */ ||
  106398. c === 0x5B/* [ */ ||
  106399. c === 0x5D/* ] */ ||
  106400. c === 0x7B/* { */ ||
  106401. c === 0x7D/* } */;
  106402. }
  106403. function fromHexCode(c) {
  106404. var lc;
  106405. if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
  106406. return c - 0x30;
  106407. }
  106408. /*eslint-disable no-bitwise*/
  106409. lc = c | 0x20;
  106410. if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
  106411. return lc - 0x61 + 10;
  106412. }
  106413. return -1;
  106414. }
  106415. function escapedHexLen(c) {
  106416. if (c === 0x78/* x */) { return 2; }
  106417. if (c === 0x75/* u */) { return 4; }
  106418. if (c === 0x55/* U */) { return 8; }
  106419. return 0;
  106420. }
  106421. function fromDecimalCode(c) {
  106422. if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
  106423. return c - 0x30;
  106424. }
  106425. return -1;
  106426. }
  106427. function simpleEscapeSequence(c) {
  106428. /* eslint-disable indent */
  106429. return (c === 0x30/* 0 */) ? '\x00' :
  106430. (c === 0x61/* a */) ? '\x07' :
  106431. (c === 0x62/* b */) ? '\x08' :
  106432. (c === 0x74/* t */) ? '\x09' :
  106433. (c === 0x09/* Tab */) ? '\x09' :
  106434. (c === 0x6E/* n */) ? '\x0A' :
  106435. (c === 0x76/* v */) ? '\x0B' :
  106436. (c === 0x66/* f */) ? '\x0C' :
  106437. (c === 0x72/* r */) ? '\x0D' :
  106438. (c === 0x65/* e */) ? '\x1B' :
  106439. (c === 0x20/* Space */) ? ' ' :
  106440. (c === 0x22/* " */) ? '\x22' :
  106441. (c === 0x2F/* / */) ? '/' :
  106442. (c === 0x5C/* \ */) ? '\x5C' :
  106443. (c === 0x4E/* N */) ? '\x85' :
  106444. (c === 0x5F/* _ */) ? '\xA0' :
  106445. (c === 0x4C/* L */) ? '\u2028' :
  106446. (c === 0x50/* P */) ? '\u2029' : '';
  106447. }
  106448. function charFromCodepoint(c) {
  106449. if (c <= 0xFFFF) {
  106450. return String.fromCharCode(c);
  106451. }
  106452. // Encode UTF-16 surrogate pair
  106453. // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
  106454. return String.fromCharCode(
  106455. ((c - 0x010000) >> 10) + 0xD800,
  106456. ((c - 0x010000) & 0x03FF) + 0xDC00
  106457. );
  106458. }
  106459. var simpleEscapeCheck = new Array(256); // integer, for fast access
  106460. var simpleEscapeMap = new Array(256);
  106461. for (var i = 0; i < 256; i++) {
  106462. simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
  106463. simpleEscapeMap[i] = simpleEscapeSequence(i);
  106464. }
  106465. function State(input, options) {
  106466. this.input = input;
  106467. this.filename = options['filename'] || null;
  106468. this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
  106469. this.onWarning = options['onWarning'] || null;
  106470. this.legacy = options['legacy'] || false;
  106471. this.json = options['json'] || false;
  106472. this.listener = options['listener'] || null;
  106473. this.implicitTypes = this.schema.compiledImplicit;
  106474. this.typeMap = this.schema.compiledTypeMap;
  106475. this.length = input.length;
  106476. this.position = 0;
  106477. this.line = 0;
  106478. this.lineStart = 0;
  106479. this.lineIndent = 0;
  106480. this.documents = [];
  106481. /*
  106482. this.version;
  106483. this.checkLineBreaks;
  106484. this.tagMap;
  106485. this.anchorMap;
  106486. this.tag;
  106487. this.anchor;
  106488. this.kind;
  106489. this.result;*/
  106490. }
  106491. function generateError(state, message) {
  106492. return new YAMLException(
  106493. message,
  106494. new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
  106495. }
  106496. function throwError(state, message) {
  106497. throw generateError(state, message);
  106498. }
  106499. function throwWarning(state, message) {
  106500. if (state.onWarning) {
  106501. state.onWarning.call(null, generateError(state, message));
  106502. }
  106503. }
  106504. var directiveHandlers = {
  106505. YAML: function handleYamlDirective(state, name, args) {
  106506. var match, major, minor;
  106507. if (state.version !== null) {
  106508. throwError(state, 'duplication of %YAML directive');
  106509. }
  106510. if (args.length !== 1) {
  106511. throwError(state, 'YAML directive accepts exactly one argument');
  106512. }
  106513. match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
  106514. if (match === null) {
  106515. throwError(state, 'ill-formed argument of the YAML directive');
  106516. }
  106517. major = parseInt(match[1], 10);
  106518. minor = parseInt(match[2], 10);
  106519. if (major !== 1) {
  106520. throwError(state, 'unacceptable YAML version of the document');
  106521. }
  106522. state.version = args[0];
  106523. state.checkLineBreaks = (minor < 2);
  106524. if (minor !== 1 && minor !== 2) {
  106525. throwWarning(state, 'unsupported YAML version of the document');
  106526. }
  106527. },
  106528. TAG: function handleTagDirective(state, name, args) {
  106529. var handle, prefix;
  106530. if (args.length !== 2) {
  106531. throwError(state, 'TAG directive accepts exactly two arguments');
  106532. }
  106533. handle = args[0];
  106534. prefix = args[1];
  106535. if (!PATTERN_TAG_HANDLE.test(handle)) {
  106536. throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
  106537. }
  106538. if (_hasOwnProperty.call(state.tagMap, handle)) {
  106539. throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
  106540. }
  106541. if (!PATTERN_TAG_URI.test(prefix)) {
  106542. throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
  106543. }
  106544. state.tagMap[handle] = prefix;
  106545. }
  106546. };
  106547. function captureSegment(state, start, end, checkJson) {
  106548. var _position, _length, _character, _result;
  106549. if (start < end) {
  106550. _result = state.input.slice(start, end);
  106551. if (checkJson) {
  106552. for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
  106553. _character = _result.charCodeAt(_position);
  106554. if (!(_character === 0x09 ||
  106555. (0x20 <= _character && _character <= 0x10FFFF))) {
  106556. throwError(state, 'expected valid JSON character');
  106557. }
  106558. }
  106559. } else if (PATTERN_NON_PRINTABLE.test(_result)) {
  106560. throwError(state, 'the stream contains non-printable characters');
  106561. }
  106562. state.result += _result;
  106563. }
  106564. }
  106565. function mergeMappings(state, destination, source, overridableKeys) {
  106566. var sourceKeys, key, index, quantity;
  106567. if (!common.isObject(source)) {
  106568. throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
  106569. }
  106570. sourceKeys = Object.keys(source);
  106571. for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
  106572. key = sourceKeys[index];
  106573. if (!_hasOwnProperty.call(destination, key)) {
  106574. destination[key] = source[key];
  106575. overridableKeys[key] = true;
  106576. }
  106577. }
  106578. }
  106579. function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
  106580. var index, quantity;
  106581. // The output is a plain object here, so keys can only be strings.
  106582. // We need to convert keyNode to a string, but doing so can hang the process
  106583. // (deeply nested arrays that explode exponentially using aliases).
  106584. if (Array.isArray(keyNode)) {
  106585. keyNode = Array.prototype.slice.call(keyNode);
  106586. for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
  106587. if (Array.isArray(keyNode[index])) {
  106588. throwError(state, 'nested arrays are not supported inside keys');
  106589. }
  106590. if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
  106591. keyNode[index] = '[object Object]';
  106592. }
  106593. }
  106594. }
  106595. // Avoid code execution in load() via toString property
  106596. // (still use its own toString for arrays, timestamps,
  106597. // and whatever user schema extensions happen to have @@toStringTag)
  106598. if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
  106599. keyNode = '[object Object]';
  106600. }
  106601. keyNode = String(keyNode);
  106602. if (_result === null) {
  106603. _result = {};
  106604. }
  106605. if (keyTag === 'tag:yaml.org,2002:merge') {
  106606. if (Array.isArray(valueNode)) {
  106607. for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
  106608. mergeMappings(state, _result, valueNode[index], overridableKeys);
  106609. }
  106610. } else {
  106611. mergeMappings(state, _result, valueNode, overridableKeys);
  106612. }
  106613. } else {
  106614. if (!state.json &&
  106615. !_hasOwnProperty.call(overridableKeys, keyNode) &&
  106616. _hasOwnProperty.call(_result, keyNode)) {
  106617. state.line = startLine || state.line;
  106618. state.position = startPos || state.position;
  106619. throwError(state, 'duplicated mapping key');
  106620. }
  106621. _result[keyNode] = valueNode;
  106622. delete overridableKeys[keyNode];
  106623. }
  106624. return _result;
  106625. }
  106626. function readLineBreak(state) {
  106627. var ch;
  106628. ch = state.input.charCodeAt(state.position);
  106629. if (ch === 0x0A/* LF */) {
  106630. state.position++;
  106631. } else if (ch === 0x0D/* CR */) {
  106632. state.position++;
  106633. if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
  106634. state.position++;
  106635. }
  106636. } else {
  106637. throwError(state, 'a line break is expected');
  106638. }
  106639. state.line += 1;
  106640. state.lineStart = state.position;
  106641. }
  106642. function skipSeparationSpace(state, allowComments, checkIndent) {
  106643. var lineBreaks = 0,
  106644. ch = state.input.charCodeAt(state.position);
  106645. while (ch !== 0) {
  106646. while (is_WHITE_SPACE(ch)) {
  106647. ch = state.input.charCodeAt(++state.position);
  106648. }
  106649. if (allowComments && ch === 0x23/* # */) {
  106650. do {
  106651. ch = state.input.charCodeAt(++state.position);
  106652. } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
  106653. }
  106654. if (is_EOL(ch)) {
  106655. readLineBreak(state);
  106656. ch = state.input.charCodeAt(state.position);
  106657. lineBreaks++;
  106658. state.lineIndent = 0;
  106659. while (ch === 0x20/* Space */) {
  106660. state.lineIndent++;
  106661. ch = state.input.charCodeAt(++state.position);
  106662. }
  106663. } else {
  106664. break;
  106665. }
  106666. }
  106667. if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
  106668. throwWarning(state, 'deficient indentation');
  106669. }
  106670. return lineBreaks;
  106671. }
  106672. function testDocumentSeparator(state) {
  106673. var _position = state.position,
  106674. ch;
  106675. ch = state.input.charCodeAt(_position);
  106676. // Condition state.position === state.lineStart is tested
  106677. // in parent on each call, for efficiency. No needs to test here again.
  106678. if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
  106679. ch === state.input.charCodeAt(_position + 1) &&
  106680. ch === state.input.charCodeAt(_position + 2)) {
  106681. _position += 3;
  106682. ch = state.input.charCodeAt(_position);
  106683. if (ch === 0 || is_WS_OR_EOL(ch)) {
  106684. return true;
  106685. }
  106686. }
  106687. return false;
  106688. }
  106689. function writeFoldedLines(state, count) {
  106690. if (count === 1) {
  106691. state.result += ' ';
  106692. } else if (count > 1) {
  106693. state.result += common.repeat('\n', count - 1);
  106694. }
  106695. }
  106696. function readPlainScalar(state, nodeIndent, withinFlowCollection) {
  106697. var preceding,
  106698. following,
  106699. captureStart,
  106700. captureEnd,
  106701. hasPendingContent,
  106702. _line,
  106703. _lineStart,
  106704. _lineIndent,
  106705. _kind = state.kind,
  106706. _result = state.result,
  106707. ch;
  106708. ch = state.input.charCodeAt(state.position);
  106709. if (is_WS_OR_EOL(ch) ||
  106710. is_FLOW_INDICATOR(ch) ||
  106711. ch === 0x23/* # */ ||
  106712. ch === 0x26/* & */ ||
  106713. ch === 0x2A/* * */ ||
  106714. ch === 0x21/* ! */ ||
  106715. ch === 0x7C/* | */ ||
  106716. ch === 0x3E/* > */ ||
  106717. ch === 0x27/* ' */ ||
  106718. ch === 0x22/* " */ ||
  106719. ch === 0x25/* % */ ||
  106720. ch === 0x40/* @ */ ||
  106721. ch === 0x60/* ` */) {
  106722. return false;
  106723. }
  106724. if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
  106725. following = state.input.charCodeAt(state.position + 1);
  106726. if (is_WS_OR_EOL(following) ||
  106727. withinFlowCollection && is_FLOW_INDICATOR(following)) {
  106728. return false;
  106729. }
  106730. }
  106731. state.kind = 'scalar';
  106732. state.result = '';
  106733. captureStart = captureEnd = state.position;
  106734. hasPendingContent = false;
  106735. while (ch !== 0) {
  106736. if (ch === 0x3A/* : */) {
  106737. following = state.input.charCodeAt(state.position + 1);
  106738. if (is_WS_OR_EOL(following) ||
  106739. withinFlowCollection && is_FLOW_INDICATOR(following)) {
  106740. break;
  106741. }
  106742. } else if (ch === 0x23/* # */) {
  106743. preceding = state.input.charCodeAt(state.position - 1);
  106744. if (is_WS_OR_EOL(preceding)) {
  106745. break;
  106746. }
  106747. } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
  106748. withinFlowCollection && is_FLOW_INDICATOR(ch)) {
  106749. break;
  106750. } else if (is_EOL(ch)) {
  106751. _line = state.line;
  106752. _lineStart = state.lineStart;
  106753. _lineIndent = state.lineIndent;
  106754. skipSeparationSpace(state, false, -1);
  106755. if (state.lineIndent >= nodeIndent) {
  106756. hasPendingContent = true;
  106757. ch = state.input.charCodeAt(state.position);
  106758. continue;
  106759. } else {
  106760. state.position = captureEnd;
  106761. state.line = _line;
  106762. state.lineStart = _lineStart;
  106763. state.lineIndent = _lineIndent;
  106764. break;
  106765. }
  106766. }
  106767. if (hasPendingContent) {
  106768. captureSegment(state, captureStart, captureEnd, false);
  106769. writeFoldedLines(state, state.line - _line);
  106770. captureStart = captureEnd = state.position;
  106771. hasPendingContent = false;
  106772. }
  106773. if (!is_WHITE_SPACE(ch)) {
  106774. captureEnd = state.position + 1;
  106775. }
  106776. ch = state.input.charCodeAt(++state.position);
  106777. }
  106778. captureSegment(state, captureStart, captureEnd, false);
  106779. if (state.result) {
  106780. return true;
  106781. }
  106782. state.kind = _kind;
  106783. state.result = _result;
  106784. return false;
  106785. }
  106786. function readSingleQuotedScalar(state, nodeIndent) {
  106787. var ch,
  106788. captureStart, captureEnd;
  106789. ch = state.input.charCodeAt(state.position);
  106790. if (ch !== 0x27/* ' */) {
  106791. return false;
  106792. }
  106793. state.kind = 'scalar';
  106794. state.result = '';
  106795. state.position++;
  106796. captureStart = captureEnd = state.position;
  106797. while ((ch = state.input.charCodeAt(state.position)) !== 0) {
  106798. if (ch === 0x27/* ' */) {
  106799. captureSegment(state, captureStart, state.position, true);
  106800. ch = state.input.charCodeAt(++state.position);
  106801. if (ch === 0x27/* ' */) {
  106802. captureStart = state.position;
  106803. state.position++;
  106804. captureEnd = state.position;
  106805. } else {
  106806. return true;
  106807. }
  106808. } else if (is_EOL(ch)) {
  106809. captureSegment(state, captureStart, captureEnd, true);
  106810. writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
  106811. captureStart = captureEnd = state.position;
  106812. } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
  106813. throwError(state, 'unexpected end of the document within a single quoted scalar');
  106814. } else {
  106815. state.position++;
  106816. captureEnd = state.position;
  106817. }
  106818. }
  106819. throwError(state, 'unexpected end of the stream within a single quoted scalar');
  106820. }
  106821. function readDoubleQuotedScalar(state, nodeIndent) {
  106822. var captureStart,
  106823. captureEnd,
  106824. hexLength,
  106825. hexResult,
  106826. tmp,
  106827. ch;
  106828. ch = state.input.charCodeAt(state.position);
  106829. if (ch !== 0x22/* " */) {
  106830. return false;
  106831. }
  106832. state.kind = 'scalar';
  106833. state.result = '';
  106834. state.position++;
  106835. captureStart = captureEnd = state.position;
  106836. while ((ch = state.input.charCodeAt(state.position)) !== 0) {
  106837. if (ch === 0x22/* " */) {
  106838. captureSegment(state, captureStart, state.position, true);
  106839. state.position++;
  106840. return true;
  106841. } else if (ch === 0x5C/* \ */) {
  106842. captureSegment(state, captureStart, state.position, true);
  106843. ch = state.input.charCodeAt(++state.position);
  106844. if (is_EOL(ch)) {
  106845. skipSeparationSpace(state, false, nodeIndent);
  106846. // TODO: rework to inline fn with no type cast?
  106847. } else if (ch < 256 && simpleEscapeCheck[ch]) {
  106848. state.result += simpleEscapeMap[ch];
  106849. state.position++;
  106850. } else if ((tmp = escapedHexLen(ch)) > 0) {
  106851. hexLength = tmp;
  106852. hexResult = 0;
  106853. for (; hexLength > 0; hexLength--) {
  106854. ch = state.input.charCodeAt(++state.position);
  106855. if ((tmp = fromHexCode(ch)) >= 0) {
  106856. hexResult = (hexResult << 4) + tmp;
  106857. } else {
  106858. throwError(state, 'expected hexadecimal character');
  106859. }
  106860. }
  106861. state.result += charFromCodepoint(hexResult);
  106862. state.position++;
  106863. } else {
  106864. throwError(state, 'unknown escape sequence');
  106865. }
  106866. captureStart = captureEnd = state.position;
  106867. } else if (is_EOL(ch)) {
  106868. captureSegment(state, captureStart, captureEnd, true);
  106869. writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
  106870. captureStart = captureEnd = state.position;
  106871. } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
  106872. throwError(state, 'unexpected end of the document within a double quoted scalar');
  106873. } else {
  106874. state.position++;
  106875. captureEnd = state.position;
  106876. }
  106877. }
  106878. throwError(state, 'unexpected end of the stream within a double quoted scalar');
  106879. }
  106880. function readFlowCollection(state, nodeIndent) {
  106881. var readNext = true,
  106882. _line,
  106883. _tag = state.tag,
  106884. _result,
  106885. _anchor = state.anchor,
  106886. following,
  106887. terminator,
  106888. isPair,
  106889. isExplicitPair,
  106890. isMapping,
  106891. overridableKeys = {},
  106892. keyNode,
  106893. keyTag,
  106894. valueNode,
  106895. ch;
  106896. ch = state.input.charCodeAt(state.position);
  106897. if (ch === 0x5B/* [ */) {
  106898. terminator = 0x5D;/* ] */
  106899. isMapping = false;
  106900. _result = [];
  106901. } else if (ch === 0x7B/* { */) {
  106902. terminator = 0x7D;/* } */
  106903. isMapping = true;
  106904. _result = {};
  106905. } else {
  106906. return false;
  106907. }
  106908. if (state.anchor !== null) {
  106909. state.anchorMap[state.anchor] = _result;
  106910. }
  106911. ch = state.input.charCodeAt(++state.position);
  106912. while (ch !== 0) {
  106913. skipSeparationSpace(state, true, nodeIndent);
  106914. ch = state.input.charCodeAt(state.position);
  106915. if (ch === terminator) {
  106916. state.position++;
  106917. state.tag = _tag;
  106918. state.anchor = _anchor;
  106919. state.kind = isMapping ? 'mapping' : 'sequence';
  106920. state.result = _result;
  106921. return true;
  106922. } else if (!readNext) {
  106923. throwError(state, 'missed comma between flow collection entries');
  106924. }
  106925. keyTag = keyNode = valueNode = null;
  106926. isPair = isExplicitPair = false;
  106927. if (ch === 0x3F/* ? */) {
  106928. following = state.input.charCodeAt(state.position + 1);
  106929. if (is_WS_OR_EOL(following)) {
  106930. isPair = isExplicitPair = true;
  106931. state.position++;
  106932. skipSeparationSpace(state, true, nodeIndent);
  106933. }
  106934. }
  106935. _line = state.line;
  106936. composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
  106937. keyTag = state.tag;
  106938. keyNode = state.result;
  106939. skipSeparationSpace(state, true, nodeIndent);
  106940. ch = state.input.charCodeAt(state.position);
  106941. if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
  106942. isPair = true;
  106943. ch = state.input.charCodeAt(++state.position);
  106944. skipSeparationSpace(state, true, nodeIndent);
  106945. composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
  106946. valueNode = state.result;
  106947. }
  106948. if (isMapping) {
  106949. storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
  106950. } else if (isPair) {
  106951. _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
  106952. } else {
  106953. _result.push(keyNode);
  106954. }
  106955. skipSeparationSpace(state, true, nodeIndent);
  106956. ch = state.input.charCodeAt(state.position);
  106957. if (ch === 0x2C/* , */) {
  106958. readNext = true;
  106959. ch = state.input.charCodeAt(++state.position);
  106960. } else {
  106961. readNext = false;
  106962. }
  106963. }
  106964. throwError(state, 'unexpected end of the stream within a flow collection');
  106965. }
  106966. function readBlockScalar(state, nodeIndent) {
  106967. var captureStart,
  106968. folding,
  106969. chomping = CHOMPING_CLIP,
  106970. didReadContent = false,
  106971. detectedIndent = false,
  106972. textIndent = nodeIndent,
  106973. emptyLines = 0,
  106974. atMoreIndented = false,
  106975. tmp,
  106976. ch;
  106977. ch = state.input.charCodeAt(state.position);
  106978. if (ch === 0x7C/* | */) {
  106979. folding = false;
  106980. } else if (ch === 0x3E/* > */) {
  106981. folding = true;
  106982. } else {
  106983. return false;
  106984. }
  106985. state.kind = 'scalar';
  106986. state.result = '';
  106987. while (ch !== 0) {
  106988. ch = state.input.charCodeAt(++state.position);
  106989. if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
  106990. if (CHOMPING_CLIP === chomping) {
  106991. chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
  106992. } else {
  106993. throwError(state, 'repeat of a chomping mode identifier');
  106994. }
  106995. } else if ((tmp = fromDecimalCode(ch)) >= 0) {
  106996. if (tmp === 0) {
  106997. throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
  106998. } else if (!detectedIndent) {
  106999. textIndent = nodeIndent + tmp - 1;
  107000. detectedIndent = true;
  107001. } else {
  107002. throwError(state, 'repeat of an indentation width identifier');
  107003. }
  107004. } else {
  107005. break;
  107006. }
  107007. }
  107008. if (is_WHITE_SPACE(ch)) {
  107009. do { ch = state.input.charCodeAt(++state.position); }
  107010. while (is_WHITE_SPACE(ch));
  107011. if (ch === 0x23/* # */) {
  107012. do { ch = state.input.charCodeAt(++state.position); }
  107013. while (!is_EOL(ch) && (ch !== 0));
  107014. }
  107015. }
  107016. while (ch !== 0) {
  107017. readLineBreak(state);
  107018. state.lineIndent = 0;
  107019. ch = state.input.charCodeAt(state.position);
  107020. while ((!detectedIndent || state.lineIndent < textIndent) &&
  107021. (ch === 0x20/* Space */)) {
  107022. state.lineIndent++;
  107023. ch = state.input.charCodeAt(++state.position);
  107024. }
  107025. if (!detectedIndent && state.lineIndent > textIndent) {
  107026. textIndent = state.lineIndent;
  107027. }
  107028. if (is_EOL(ch)) {
  107029. emptyLines++;
  107030. continue;
  107031. }
  107032. // End of the scalar.
  107033. if (state.lineIndent < textIndent) {
  107034. // Perform the chomping.
  107035. if (chomping === CHOMPING_KEEP) {
  107036. state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
  107037. } else if (chomping === CHOMPING_CLIP) {
  107038. if (didReadContent) { // i.e. only if the scalar is not empty.
  107039. state.result += '\n';
  107040. }
  107041. }
  107042. // Break this `while` cycle and go to the funciton's epilogue.
  107043. break;
  107044. }
  107045. // Folded style: use fancy rules to handle line breaks.
  107046. if (folding) {
  107047. // Lines starting with white space characters (more-indented lines) are not folded.
  107048. if (is_WHITE_SPACE(ch)) {
  107049. atMoreIndented = true;
  107050. // except for the first content line (cf. Example 8.1)
  107051. state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
  107052. // End of more-indented block.
  107053. } else if (atMoreIndented) {
  107054. atMoreIndented = false;
  107055. state.result += common.repeat('\n', emptyLines + 1);
  107056. // Just one line break - perceive as the same line.
  107057. } else if (emptyLines === 0) {
  107058. if (didReadContent) { // i.e. only if we have already read some scalar content.
  107059. state.result += ' ';
  107060. }
  107061. // Several line breaks - perceive as different lines.
  107062. } else {
  107063. state.result += common.repeat('\n', emptyLines);
  107064. }
  107065. // Literal style: just add exact number of line breaks between content lines.
  107066. } else {
  107067. // Keep all line breaks except the header line break.
  107068. state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
  107069. }
  107070. didReadContent = true;
  107071. detectedIndent = true;
  107072. emptyLines = 0;
  107073. captureStart = state.position;
  107074. while (!is_EOL(ch) && (ch !== 0)) {
  107075. ch = state.input.charCodeAt(++state.position);
  107076. }
  107077. captureSegment(state, captureStart, state.position, false);
  107078. }
  107079. return true;
  107080. }
  107081. function readBlockSequence(state, nodeIndent) {
  107082. var _line,
  107083. _tag = state.tag,
  107084. _anchor = state.anchor,
  107085. _result = [],
  107086. following,
  107087. detected = false,
  107088. ch;
  107089. if (state.anchor !== null) {
  107090. state.anchorMap[state.anchor] = _result;
  107091. }
  107092. ch = state.input.charCodeAt(state.position);
  107093. while (ch !== 0) {
  107094. if (ch !== 0x2D/* - */) {
  107095. break;
  107096. }
  107097. following = state.input.charCodeAt(state.position + 1);
  107098. if (!is_WS_OR_EOL(following)) {
  107099. break;
  107100. }
  107101. detected = true;
  107102. state.position++;
  107103. if (skipSeparationSpace(state, true, -1)) {
  107104. if (state.lineIndent <= nodeIndent) {
  107105. _result.push(null);
  107106. ch = state.input.charCodeAt(state.position);
  107107. continue;
  107108. }
  107109. }
  107110. _line = state.line;
  107111. composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
  107112. _result.push(state.result);
  107113. skipSeparationSpace(state, true, -1);
  107114. ch = state.input.charCodeAt(state.position);
  107115. if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
  107116. throwError(state, 'bad indentation of a sequence entry');
  107117. } else if (state.lineIndent < nodeIndent) {
  107118. break;
  107119. }
  107120. }
  107121. if (detected) {
  107122. state.tag = _tag;
  107123. state.anchor = _anchor;
  107124. state.kind = 'sequence';
  107125. state.result = _result;
  107126. return true;
  107127. }
  107128. return false;
  107129. }
  107130. function readBlockMapping(state, nodeIndent, flowIndent) {
  107131. var following,
  107132. allowCompact,
  107133. _line,
  107134. _pos,
  107135. _tag = state.tag,
  107136. _anchor = state.anchor,
  107137. _result = {},
  107138. overridableKeys = {},
  107139. keyTag = null,
  107140. keyNode = null,
  107141. valueNode = null,
  107142. atExplicitKey = false,
  107143. detected = false,
  107144. ch;
  107145. if (state.anchor !== null) {
  107146. state.anchorMap[state.anchor] = _result;
  107147. }
  107148. ch = state.input.charCodeAt(state.position);
  107149. while (ch !== 0) {
  107150. following = state.input.charCodeAt(state.position + 1);
  107151. _line = state.line; // Save the current line.
  107152. _pos = state.position;
  107153. //
  107154. // Explicit notation case. There are two separate blocks:
  107155. // first for the key (denoted by "?") and second for the value (denoted by ":")
  107156. //
  107157. if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
  107158. if (ch === 0x3F/* ? */) {
  107159. if (atExplicitKey) {
  107160. storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
  107161. keyTag = keyNode = valueNode = null;
  107162. }
  107163. detected = true;
  107164. atExplicitKey = true;
  107165. allowCompact = true;
  107166. } else if (atExplicitKey) {
  107167. // i.e. 0x3A/* : */ === character after the explicit key.
  107168. atExplicitKey = false;
  107169. allowCompact = true;
  107170. } else {
  107171. throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
  107172. }
  107173. state.position += 1;
  107174. ch = following;
  107175. //
  107176. // Implicit notation case. Flow-style node as the key first, then ":", and the value.
  107177. //
  107178. } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
  107179. if (state.line === _line) {
  107180. ch = state.input.charCodeAt(state.position);
  107181. while (is_WHITE_SPACE(ch)) {
  107182. ch = state.input.charCodeAt(++state.position);
  107183. }
  107184. if (ch === 0x3A/* : */) {
  107185. ch = state.input.charCodeAt(++state.position);
  107186. if (!is_WS_OR_EOL(ch)) {
  107187. throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
  107188. }
  107189. if (atExplicitKey) {
  107190. storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
  107191. keyTag = keyNode = valueNode = null;
  107192. }
  107193. detected = true;
  107194. atExplicitKey = false;
  107195. allowCompact = false;
  107196. keyTag = state.tag;
  107197. keyNode = state.result;
  107198. } else if (detected) {
  107199. throwError(state, 'can not read an implicit mapping pair; a colon is missed');
  107200. } else {
  107201. state.tag = _tag;
  107202. state.anchor = _anchor;
  107203. return true; // Keep the result of `composeNode`.
  107204. }
  107205. } else if (detected) {
  107206. throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
  107207. } else {
  107208. state.tag = _tag;
  107209. state.anchor = _anchor;
  107210. return true; // Keep the result of `composeNode`.
  107211. }
  107212. } else {
  107213. break; // Reading is done. Go to the epilogue.
  107214. }
  107215. //
  107216. // Common reading code for both explicit and implicit notations.
  107217. //
  107218. if (state.line === _line || state.lineIndent > nodeIndent) {
  107219. if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
  107220. if (atExplicitKey) {
  107221. keyNode = state.result;
  107222. } else {
  107223. valueNode = state.result;
  107224. }
  107225. }
  107226. if (!atExplicitKey) {
  107227. storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
  107228. keyTag = keyNode = valueNode = null;
  107229. }
  107230. skipSeparationSpace(state, true, -1);
  107231. ch = state.input.charCodeAt(state.position);
  107232. }
  107233. if (state.lineIndent > nodeIndent && (ch !== 0)) {
  107234. throwError(state, 'bad indentation of a mapping entry');
  107235. } else if (state.lineIndent < nodeIndent) {
  107236. break;
  107237. }
  107238. }
  107239. //
  107240. // Epilogue.
  107241. //
  107242. // Special case: last mapping's node contains only the key in explicit notation.
  107243. if (atExplicitKey) {
  107244. storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
  107245. }
  107246. // Expose the resulting mapping.
  107247. if (detected) {
  107248. state.tag = _tag;
  107249. state.anchor = _anchor;
  107250. state.kind = 'mapping';
  107251. state.result = _result;
  107252. }
  107253. return detected;
  107254. }
  107255. function readTagProperty(state) {
  107256. var _position,
  107257. isVerbatim = false,
  107258. isNamed = false,
  107259. tagHandle,
  107260. tagName,
  107261. ch;
  107262. ch = state.input.charCodeAt(state.position);
  107263. if (ch !== 0x21/* ! */) return false;
  107264. if (state.tag !== null) {
  107265. throwError(state, 'duplication of a tag property');
  107266. }
  107267. ch = state.input.charCodeAt(++state.position);
  107268. if (ch === 0x3C/* < */) {
  107269. isVerbatim = true;
  107270. ch = state.input.charCodeAt(++state.position);
  107271. } else if (ch === 0x21/* ! */) {
  107272. isNamed = true;
  107273. tagHandle = '!!';
  107274. ch = state.input.charCodeAt(++state.position);
  107275. } else {
  107276. tagHandle = '!';
  107277. }
  107278. _position = state.position;
  107279. if (isVerbatim) {
  107280. do { ch = state.input.charCodeAt(++state.position); }
  107281. while (ch !== 0 && ch !== 0x3E/* > */);
  107282. if (state.position < state.length) {
  107283. tagName = state.input.slice(_position, state.position);
  107284. ch = state.input.charCodeAt(++state.position);
  107285. } else {
  107286. throwError(state, 'unexpected end of the stream within a verbatim tag');
  107287. }
  107288. } else {
  107289. while (ch !== 0 && !is_WS_OR_EOL(ch)) {
  107290. if (ch === 0x21/* ! */) {
  107291. if (!isNamed) {
  107292. tagHandle = state.input.slice(_position - 1, state.position + 1);
  107293. if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
  107294. throwError(state, 'named tag handle cannot contain such characters');
  107295. }
  107296. isNamed = true;
  107297. _position = state.position + 1;
  107298. } else {
  107299. throwError(state, 'tag suffix cannot contain exclamation marks');
  107300. }
  107301. }
  107302. ch = state.input.charCodeAt(++state.position);
  107303. }
  107304. tagName = state.input.slice(_position, state.position);
  107305. if (PATTERN_FLOW_INDICATORS.test(tagName)) {
  107306. throwError(state, 'tag suffix cannot contain flow indicator characters');
  107307. }
  107308. }
  107309. if (tagName && !PATTERN_TAG_URI.test(tagName)) {
  107310. throwError(state, 'tag name cannot contain such characters: ' + tagName);
  107311. }
  107312. if (isVerbatim) {
  107313. state.tag = tagName;
  107314. } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
  107315. state.tag = state.tagMap[tagHandle] + tagName;
  107316. } else if (tagHandle === '!') {
  107317. state.tag = '!' + tagName;
  107318. } else if (tagHandle === '!!') {
  107319. state.tag = 'tag:yaml.org,2002:' + tagName;
  107320. } else {
  107321. throwError(state, 'undeclared tag handle "' + tagHandle + '"');
  107322. }
  107323. return true;
  107324. }
  107325. function readAnchorProperty(state) {
  107326. var _position,
  107327. ch;
  107328. ch = state.input.charCodeAt(state.position);
  107329. if (ch !== 0x26/* & */) return false;
  107330. if (state.anchor !== null) {
  107331. throwError(state, 'duplication of an anchor property');
  107332. }
  107333. ch = state.input.charCodeAt(++state.position);
  107334. _position = state.position;
  107335. while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
  107336. ch = state.input.charCodeAt(++state.position);
  107337. }
  107338. if (state.position === _position) {
  107339. throwError(state, 'name of an anchor node must contain at least one character');
  107340. }
  107341. state.anchor = state.input.slice(_position, state.position);
  107342. return true;
  107343. }
  107344. function readAlias(state) {
  107345. var _position, alias,
  107346. ch;
  107347. ch = state.input.charCodeAt(state.position);
  107348. if (ch !== 0x2A/* * */) return false;
  107349. ch = state.input.charCodeAt(++state.position);
  107350. _position = state.position;
  107351. while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
  107352. ch = state.input.charCodeAt(++state.position);
  107353. }
  107354. if (state.position === _position) {
  107355. throwError(state, 'name of an alias node must contain at least one character');
  107356. }
  107357. alias = state.input.slice(_position, state.position);
  107358. if (!state.anchorMap.hasOwnProperty(alias)) {
  107359. throwError(state, 'unidentified alias "' + alias + '"');
  107360. }
  107361. state.result = state.anchorMap[alias];
  107362. skipSeparationSpace(state, true, -1);
  107363. return true;
  107364. }
  107365. function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
  107366. var allowBlockStyles,
  107367. allowBlockScalars,
  107368. allowBlockCollections,
  107369. indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
  107370. atNewLine = false,
  107371. hasContent = false,
  107372. typeIndex,
  107373. typeQuantity,
  107374. type,
  107375. flowIndent,
  107376. blockIndent;
  107377. if (state.listener !== null) {
  107378. state.listener('open', state);
  107379. }
  107380. state.tag = null;
  107381. state.anchor = null;
  107382. state.kind = null;
  107383. state.result = null;
  107384. allowBlockStyles = allowBlockScalars = allowBlockCollections =
  107385. CONTEXT_BLOCK_OUT === nodeContext ||
  107386. CONTEXT_BLOCK_IN === nodeContext;
  107387. if (allowToSeek) {
  107388. if (skipSeparationSpace(state, true, -1)) {
  107389. atNewLine = true;
  107390. if (state.lineIndent > parentIndent) {
  107391. indentStatus = 1;
  107392. } else if (state.lineIndent === parentIndent) {
  107393. indentStatus = 0;
  107394. } else if (state.lineIndent < parentIndent) {
  107395. indentStatus = -1;
  107396. }
  107397. }
  107398. }
  107399. if (indentStatus === 1) {
  107400. while (readTagProperty(state) || readAnchorProperty(state)) {
  107401. if (skipSeparationSpace(state, true, -1)) {
  107402. atNewLine = true;
  107403. allowBlockCollections = allowBlockStyles;
  107404. if (state.lineIndent > parentIndent) {
  107405. indentStatus = 1;
  107406. } else if (state.lineIndent === parentIndent) {
  107407. indentStatus = 0;
  107408. } else if (state.lineIndent < parentIndent) {
  107409. indentStatus = -1;
  107410. }
  107411. } else {
  107412. allowBlockCollections = false;
  107413. }
  107414. }
  107415. }
  107416. if (allowBlockCollections) {
  107417. allowBlockCollections = atNewLine || allowCompact;
  107418. }
  107419. if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
  107420. if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
  107421. flowIndent = parentIndent;
  107422. } else {
  107423. flowIndent = parentIndent + 1;
  107424. }
  107425. blockIndent = state.position - state.lineStart;
  107426. if (indentStatus === 1) {
  107427. if (allowBlockCollections &&
  107428. (readBlockSequence(state, blockIndent) ||
  107429. readBlockMapping(state, blockIndent, flowIndent)) ||
  107430. readFlowCollection(state, flowIndent)) {
  107431. hasContent = true;
  107432. } else {
  107433. if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
  107434. readSingleQuotedScalar(state, flowIndent) ||
  107435. readDoubleQuotedScalar(state, flowIndent)) {
  107436. hasContent = true;
  107437. } else if (readAlias(state)) {
  107438. hasContent = true;
  107439. if (state.tag !== null || state.anchor !== null) {
  107440. throwError(state, 'alias node should not have any properties');
  107441. }
  107442. } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
  107443. hasContent = true;
  107444. if (state.tag === null) {
  107445. state.tag = '?';
  107446. }
  107447. }
  107448. if (state.anchor !== null) {
  107449. state.anchorMap[state.anchor] = state.result;
  107450. }
  107451. }
  107452. } else if (indentStatus === 0) {
  107453. // Special case: block sequences are allowed to have same indentation level as the parent.
  107454. // http://www.yaml.org/spec/1.2/spec.html#id2799784
  107455. hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
  107456. }
  107457. }
  107458. if (state.tag !== null && state.tag !== '!') {
  107459. if (state.tag === '?') {
  107460. for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
  107461. type = state.implicitTypes[typeIndex];
  107462. // Implicit resolving is not allowed for non-scalar types, and '?'
  107463. // non-specific tag is only assigned to plain scalars. So, it isn't
  107464. // needed to check for 'kind' conformity.
  107465. if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
  107466. state.result = type.construct(state.result);
  107467. state.tag = type.tag;
  107468. if (state.anchor !== null) {
  107469. state.anchorMap[state.anchor] = state.result;
  107470. }
  107471. break;
  107472. }
  107473. }
  107474. } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
  107475. type = state.typeMap[state.kind || 'fallback'][state.tag];
  107476. if (state.result !== null && type.kind !== state.kind) {
  107477. throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
  107478. }
  107479. if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
  107480. throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
  107481. } else {
  107482. state.result = type.construct(state.result);
  107483. if (state.anchor !== null) {
  107484. state.anchorMap[state.anchor] = state.result;
  107485. }
  107486. }
  107487. } else {
  107488. throwError(state, 'unknown tag !<' + state.tag + '>');
  107489. }
  107490. }
  107491. if (state.listener !== null) {
  107492. state.listener('close', state);
  107493. }
  107494. return state.tag !== null || state.anchor !== null || hasContent;
  107495. }
  107496. function readDocument(state) {
  107497. var documentStart = state.position,
  107498. _position,
  107499. directiveName,
  107500. directiveArgs,
  107501. hasDirectives = false,
  107502. ch;
  107503. state.version = null;
  107504. state.checkLineBreaks = state.legacy;
  107505. state.tagMap = {};
  107506. state.anchorMap = {};
  107507. while ((ch = state.input.charCodeAt(state.position)) !== 0) {
  107508. skipSeparationSpace(state, true, -1);
  107509. ch = state.input.charCodeAt(state.position);
  107510. if (state.lineIndent > 0 || ch !== 0x25/* % */) {
  107511. break;
  107512. }
  107513. hasDirectives = true;
  107514. ch = state.input.charCodeAt(++state.position);
  107515. _position = state.position;
  107516. while (ch !== 0 && !is_WS_OR_EOL(ch)) {
  107517. ch = state.input.charCodeAt(++state.position);
  107518. }
  107519. directiveName = state.input.slice(_position, state.position);
  107520. directiveArgs = [];
  107521. if (directiveName.length < 1) {
  107522. throwError(state, 'directive name must not be less than one character in length');
  107523. }
  107524. while (ch !== 0) {
  107525. while (is_WHITE_SPACE(ch)) {
  107526. ch = state.input.charCodeAt(++state.position);
  107527. }
  107528. if (ch === 0x23/* # */) {
  107529. do { ch = state.input.charCodeAt(++state.position); }
  107530. while (ch !== 0 && !is_EOL(ch));
  107531. break;
  107532. }
  107533. if (is_EOL(ch)) break;
  107534. _position = state.position;
  107535. while (ch !== 0 && !is_WS_OR_EOL(ch)) {
  107536. ch = state.input.charCodeAt(++state.position);
  107537. }
  107538. directiveArgs.push(state.input.slice(_position, state.position));
  107539. }
  107540. if (ch !== 0) readLineBreak(state);
  107541. if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
  107542. directiveHandlers[directiveName](state, directiveName, directiveArgs);
  107543. } else {
  107544. throwWarning(state, 'unknown document directive "' + directiveName + '"');
  107545. }
  107546. }
  107547. skipSeparationSpace(state, true, -1);
  107548. if (state.lineIndent === 0 &&
  107549. state.input.charCodeAt(state.position) === 0x2D/* - */ &&
  107550. state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
  107551. state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
  107552. state.position += 3;
  107553. skipSeparationSpace(state, true, -1);
  107554. } else if (hasDirectives) {
  107555. throwError(state, 'directives end mark is expected');
  107556. }
  107557. composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
  107558. skipSeparationSpace(state, true, -1);
  107559. if (state.checkLineBreaks &&
  107560. PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
  107561. throwWarning(state, 'non-ASCII line breaks are interpreted as content');
  107562. }
  107563. state.documents.push(state.result);
  107564. if (state.position === state.lineStart && testDocumentSeparator(state)) {
  107565. if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
  107566. state.position += 3;
  107567. skipSeparationSpace(state, true, -1);
  107568. }
  107569. return;
  107570. }
  107571. if (state.position < (state.length - 1)) {
  107572. throwError(state, 'end of the stream or a document separator is expected');
  107573. } else {
  107574. return;
  107575. }
  107576. }
  107577. function loadDocuments(input, options) {
  107578. input = String(input);
  107579. options = options || {};
  107580. if (input.length !== 0) {
  107581. // Add tailing `\n` if not exists
  107582. if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
  107583. input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
  107584. input += '\n';
  107585. }
  107586. // Strip BOM
  107587. if (input.charCodeAt(0) === 0xFEFF) {
  107588. input = input.slice(1);
  107589. }
  107590. }
  107591. var state = new State(input, options);
  107592. // Use 0 as string terminator. That significantly simplifies bounds check.
  107593. state.input += '\0';
  107594. while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
  107595. state.lineIndent += 1;
  107596. state.position += 1;
  107597. }
  107598. while (state.position < (state.length - 1)) {
  107599. readDocument(state);
  107600. }
  107601. return state.documents;
  107602. }
  107603. function loadAll(input, iterator, options) {
  107604. var documents = loadDocuments(input, options), index, length;
  107605. if (typeof iterator !== 'function') {
  107606. return documents;
  107607. }
  107608. for (index = 0, length = documents.length; index < length; index += 1) {
  107609. iterator(documents[index]);
  107610. }
  107611. }
  107612. function load(input, options) {
  107613. var documents = loadDocuments(input, options);
  107614. if (documents.length === 0) {
  107615. /*eslint-disable no-undefined*/
  107616. return undefined;
  107617. } else if (documents.length === 1) {
  107618. return documents[0];
  107619. }
  107620. throw new YAMLException('expected a single document in the stream, but found more');
  107621. }
  107622. function safeLoadAll(input, output, options) {
  107623. if (typeof output === 'function') {
  107624. loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
  107625. } else {
  107626. return loadAll(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
  107627. }
  107628. }
  107629. function safeLoad(input, options) {
  107630. return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
  107631. }
  107632. module.exports.loadAll = loadAll;
  107633. module.exports.load = load;
  107634. module.exports.safeLoadAll = safeLoadAll;
  107635. module.exports.safeLoad = safeLoad;
  107636. /***/ }),
  107637. /* 798 */
  107638. /***/ (function(module, exports, __webpack_require__) {
  107639. "use strict";
  107640. var common = __webpack_require__(107);
  107641. function Mark(name, buffer, position, line, column) {
  107642. this.name = name;
  107643. this.buffer = buffer;
  107644. this.position = position;
  107645. this.line = line;
  107646. this.column = column;
  107647. }
  107648. Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
  107649. var head, start, tail, end, snippet;
  107650. if (!this.buffer) return null;
  107651. indent = indent || 4;
  107652. maxLength = maxLength || 75;
  107653. head = '';
  107654. start = this.position;
  107655. while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) {
  107656. start -= 1;
  107657. if (this.position - start > (maxLength / 2 - 1)) {
  107658. head = ' ... ';
  107659. start += 5;
  107660. break;
  107661. }
  107662. }
  107663. tail = '';
  107664. end = this.position;
  107665. while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) {
  107666. end += 1;
  107667. if (end - this.position > (maxLength / 2 - 1)) {
  107668. tail = ' ... ';
  107669. end -= 5;
  107670. break;
  107671. }
  107672. }
  107673. snippet = this.buffer.slice(start, end);
  107674. return common.repeat(' ', indent) + head + snippet + tail + '\n' +
  107675. common.repeat(' ', indent + this.position - start + head.length) + '^';
  107676. };
  107677. Mark.prototype.toString = function toString(compact) {
  107678. var snippet, where = '';
  107679. if (this.name) {
  107680. where += 'in "' + this.name + '" ';
  107681. }
  107682. where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
  107683. if (!compact) {
  107684. snippet = this.getSnippet();
  107685. if (snippet) {
  107686. where += ':\n' + snippet;
  107687. }
  107688. }
  107689. return where;
  107690. };
  107691. module.exports = Mark;
  107692. /***/ }),
  107693. /* 799 */
  107694. /***/ (function(module, exports, __webpack_require__) {
  107695. "use strict";
  107696. var require;
  107697. /*eslint-disable no-bitwise*/
  107698. var NodeBuffer;
  107699. try {
  107700. // A trick for browserified version, to not include `Buffer` shim
  107701. var _require = require;
  107702. NodeBuffer = __webpack_require__(94).Buffer;
  107703. } catch (__) {}
  107704. var Type = __webpack_require__(30);
  107705. // [ 64, 65, 66 ] -> [ padding, CR, LF ]
  107706. var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
  107707. function resolveYamlBinary(data) {
  107708. if (data === null) return false;
  107709. var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
  107710. // Convert one by one.
  107711. for (idx = 0; idx < max; idx++) {
  107712. code = map.indexOf(data.charAt(idx));
  107713. // Skip CR/LF
  107714. if (code > 64) continue;
  107715. // Fail on illegal characters
  107716. if (code < 0) return false;
  107717. bitlen += 6;
  107718. }
  107719. // If there are any bits left, source was corrupted
  107720. return (bitlen % 8) === 0;
  107721. }
  107722. function constructYamlBinary(data) {
  107723. var idx, tailbits,
  107724. input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
  107725. max = input.length,
  107726. map = BASE64_MAP,
  107727. bits = 0,
  107728. result = [];
  107729. // Collect by 6*4 bits (3 bytes)
  107730. for (idx = 0; idx < max; idx++) {
  107731. if ((idx % 4 === 0) && idx) {
  107732. result.push((bits >> 16) & 0xFF);
  107733. result.push((bits >> 8) & 0xFF);
  107734. result.push(bits & 0xFF);
  107735. }
  107736. bits = (bits << 6) | map.indexOf(input.charAt(idx));
  107737. }
  107738. // Dump tail
  107739. tailbits = (max % 4) * 6;
  107740. if (tailbits === 0) {
  107741. result.push((bits >> 16) & 0xFF);
  107742. result.push((bits >> 8) & 0xFF);
  107743. result.push(bits & 0xFF);
  107744. } else if (tailbits === 18) {
  107745. result.push((bits >> 10) & 0xFF);
  107746. result.push((bits >> 2) & 0xFF);
  107747. } else if (tailbits === 12) {
  107748. result.push((bits >> 4) & 0xFF);
  107749. }
  107750. // Wrap into Buffer for NodeJS and leave Array for browser
  107751. if (NodeBuffer) {
  107752. // Support node 6.+ Buffer API when available
  107753. return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
  107754. }
  107755. return result;
  107756. }
  107757. function representYamlBinary(object /*, style*/) {
  107758. var result = '', bits = 0, idx, tail,
  107759. max = object.length,
  107760. map = BASE64_MAP;
  107761. // Convert every three bytes to 4 ASCII characters.
  107762. for (idx = 0; idx < max; idx++) {
  107763. if ((idx % 3 === 0) && idx) {
  107764. result += map[(bits >> 18) & 0x3F];
  107765. result += map[(bits >> 12) & 0x3F];
  107766. result += map[(bits >> 6) & 0x3F];
  107767. result += map[bits & 0x3F];
  107768. }
  107769. bits = (bits << 8) + object[idx];
  107770. }
  107771. // Dump tail
  107772. tail = max % 3;
  107773. if (tail === 0) {
  107774. result += map[(bits >> 18) & 0x3F];
  107775. result += map[(bits >> 12) & 0x3F];
  107776. result += map[(bits >> 6) & 0x3F];
  107777. result += map[bits & 0x3F];
  107778. } else if (tail === 2) {
  107779. result += map[(bits >> 10) & 0x3F];
  107780. result += map[(bits >> 4) & 0x3F];
  107781. result += map[(bits << 2) & 0x3F];
  107782. result += map[64];
  107783. } else if (tail === 1) {
  107784. result += map[(bits >> 2) & 0x3F];
  107785. result += map[(bits << 4) & 0x3F];
  107786. result += map[64];
  107787. result += map[64];
  107788. }
  107789. return result;
  107790. }
  107791. function isBinary(object) {
  107792. return NodeBuffer && NodeBuffer.isBuffer(object);
  107793. }
  107794. module.exports = new Type('tag:yaml.org,2002:binary', {
  107795. kind: 'scalar',
  107796. resolve: resolveYamlBinary,
  107797. construct: constructYamlBinary,
  107798. predicate: isBinary,
  107799. represent: representYamlBinary
  107800. });
  107801. /***/ }),
  107802. /* 800 */
  107803. /***/ (function(module, exports, __webpack_require__) {
  107804. "use strict";
  107805. var Type = __webpack_require__(30);
  107806. function resolveYamlBoolean(data) {
  107807. if (data === null) return false;
  107808. var max = data.length;
  107809. return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
  107810. (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
  107811. }
  107812. function constructYamlBoolean(data) {
  107813. return data === 'true' ||
  107814. data === 'True' ||
  107815. data === 'TRUE';
  107816. }
  107817. function isBoolean(object) {
  107818. return Object.prototype.toString.call(object) === '[object Boolean]';
  107819. }
  107820. module.exports = new Type('tag:yaml.org,2002:bool', {
  107821. kind: 'scalar',
  107822. resolve: resolveYamlBoolean,
  107823. construct: constructYamlBoolean,
  107824. predicate: isBoolean,
  107825. represent: {
  107826. lowercase: function (object) { return object ? 'true' : 'false'; },
  107827. uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
  107828. camelcase: function (object) { return object ? 'True' : 'False'; }
  107829. },
  107830. defaultStyle: 'lowercase'
  107831. });
  107832. /***/ }),
  107833. /* 801 */
  107834. /***/ (function(module, exports, __webpack_require__) {
  107835. "use strict";
  107836. var common = __webpack_require__(107);
  107837. var Type = __webpack_require__(30);
  107838. var YAML_FLOAT_PATTERN = new RegExp(
  107839. // 2.5e4, 2.5 and integers
  107840. '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
  107841. // .2e4, .2
  107842. // special case, seems not from spec
  107843. '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
  107844. // 20:59
  107845. '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
  107846. // .inf
  107847. '|[-+]?\\.(?:inf|Inf|INF)' +
  107848. // .nan
  107849. '|\\.(?:nan|NaN|NAN))$');
  107850. function resolveYamlFloat(data) {
  107851. if (data === null) return false;
  107852. if (!YAML_FLOAT_PATTERN.test(data) ||
  107853. // Quick hack to not allow integers end with `_`
  107854. // Probably should update regexp & check speed
  107855. data[data.length - 1] === '_') {
  107856. return false;
  107857. }
  107858. return true;
  107859. }
  107860. function constructYamlFloat(data) {
  107861. var value, sign, base, digits;
  107862. value = data.replace(/_/g, '').toLowerCase();
  107863. sign = value[0] === '-' ? -1 : 1;
  107864. digits = [];
  107865. if ('+-'.indexOf(value[0]) >= 0) {
  107866. value = value.slice(1);
  107867. }
  107868. if (value === '.inf') {
  107869. return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
  107870. } else if (value === '.nan') {
  107871. return NaN;
  107872. } else if (value.indexOf(':') >= 0) {
  107873. value.split(':').forEach(function (v) {
  107874. digits.unshift(parseFloat(v, 10));
  107875. });
  107876. value = 0.0;
  107877. base = 1;
  107878. digits.forEach(function (d) {
  107879. value += d * base;
  107880. base *= 60;
  107881. });
  107882. return sign * value;
  107883. }
  107884. return sign * parseFloat(value, 10);
  107885. }
  107886. var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
  107887. function representYamlFloat(object, style) {
  107888. var res;
  107889. if (isNaN(object)) {
  107890. switch (style) {
  107891. case 'lowercase': return '.nan';
  107892. case 'uppercase': return '.NAN';
  107893. case 'camelcase': return '.NaN';
  107894. }
  107895. } else if (Number.POSITIVE_INFINITY === object) {
  107896. switch (style) {
  107897. case 'lowercase': return '.inf';
  107898. case 'uppercase': return '.INF';
  107899. case 'camelcase': return '.Inf';
  107900. }
  107901. } else if (Number.NEGATIVE_INFINITY === object) {
  107902. switch (style) {
  107903. case 'lowercase': return '-.inf';
  107904. case 'uppercase': return '-.INF';
  107905. case 'camelcase': return '-.Inf';
  107906. }
  107907. } else if (common.isNegativeZero(object)) {
  107908. return '-0.0';
  107909. }
  107910. res = object.toString(10);
  107911. // JS stringifier can build scientific format without dots: 5e-100,
  107912. // while YAML requres dot: 5.e-100. Fix it with simple hack
  107913. return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
  107914. }
  107915. function isFloat(object) {
  107916. return (Object.prototype.toString.call(object) === '[object Number]') &&
  107917. (object % 1 !== 0 || common.isNegativeZero(object));
  107918. }
  107919. module.exports = new Type('tag:yaml.org,2002:float', {
  107920. kind: 'scalar',
  107921. resolve: resolveYamlFloat,
  107922. construct: constructYamlFloat,
  107923. predicate: isFloat,
  107924. represent: representYamlFloat,
  107925. defaultStyle: 'lowercase'
  107926. });
  107927. /***/ }),
  107928. /* 802 */
  107929. /***/ (function(module, exports, __webpack_require__) {
  107930. "use strict";
  107931. var common = __webpack_require__(107);
  107932. var Type = __webpack_require__(30);
  107933. function isHexCode(c) {
  107934. return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
  107935. ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
  107936. ((0x61/* a */ <= c) && (c <= 0x66/* f */));
  107937. }
  107938. function isOctCode(c) {
  107939. return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
  107940. }
  107941. function isDecCode(c) {
  107942. return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
  107943. }
  107944. function resolveYamlInteger(data) {
  107945. if (data === null) return false;
  107946. var max = data.length,
  107947. index = 0,
  107948. hasDigits = false,
  107949. ch;
  107950. if (!max) return false;
  107951. ch = data[index];
  107952. // sign
  107953. if (ch === '-' || ch === '+') {
  107954. ch = data[++index];
  107955. }
  107956. if (ch === '0') {
  107957. // 0
  107958. if (index + 1 === max) return true;
  107959. ch = data[++index];
  107960. // base 2, base 8, base 16
  107961. if (ch === 'b') {
  107962. // base 2
  107963. index++;
  107964. for (; index < max; index++) {
  107965. ch = data[index];
  107966. if (ch === '_') continue;
  107967. if (ch !== '0' && ch !== '1') return false;
  107968. hasDigits = true;
  107969. }
  107970. return hasDigits && ch !== '_';
  107971. }
  107972. if (ch === 'x') {
  107973. // base 16
  107974. index++;
  107975. for (; index < max; index++) {
  107976. ch = data[index];
  107977. if (ch === '_') continue;
  107978. if (!isHexCode(data.charCodeAt(index))) return false;
  107979. hasDigits = true;
  107980. }
  107981. return hasDigits && ch !== '_';
  107982. }
  107983. // base 8
  107984. for (; index < max; index++) {
  107985. ch = data[index];
  107986. if (ch === '_') continue;
  107987. if (!isOctCode(data.charCodeAt(index))) return false;
  107988. hasDigits = true;
  107989. }
  107990. return hasDigits && ch !== '_';
  107991. }
  107992. // base 10 (except 0) or base 60
  107993. // value should not start with `_`;
  107994. if (ch === '_') return false;
  107995. for (; index < max; index++) {
  107996. ch = data[index];
  107997. if (ch === '_') continue;
  107998. if (ch === ':') break;
  107999. if (!isDecCode(data.charCodeAt(index))) {
  108000. return false;
  108001. }
  108002. hasDigits = true;
  108003. }
  108004. // Should have digits and should not end with `_`
  108005. if (!hasDigits || ch === '_') return false;
  108006. // if !base60 - done;
  108007. if (ch !== ':') return true;
  108008. // base60 almost not used, no needs to optimize
  108009. return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
  108010. }
  108011. function constructYamlInteger(data) {
  108012. var value = data, sign = 1, ch, base, digits = [];
  108013. if (value.indexOf('_') !== -1) {
  108014. value = value.replace(/_/g, '');
  108015. }
  108016. ch = value[0];
  108017. if (ch === '-' || ch === '+') {
  108018. if (ch === '-') sign = -1;
  108019. value = value.slice(1);
  108020. ch = value[0];
  108021. }
  108022. if (value === '0') return 0;
  108023. if (ch === '0') {
  108024. if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
  108025. if (value[1] === 'x') return sign * parseInt(value, 16);
  108026. return sign * parseInt(value, 8);
  108027. }
  108028. if (value.indexOf(':') !== -1) {
  108029. value.split(':').forEach(function (v) {
  108030. digits.unshift(parseInt(v, 10));
  108031. });
  108032. value = 0;
  108033. base = 1;
  108034. digits.forEach(function (d) {
  108035. value += (d * base);
  108036. base *= 60;
  108037. });
  108038. return sign * value;
  108039. }
  108040. return sign * parseInt(value, 10);
  108041. }
  108042. function isInteger(object) {
  108043. return (Object.prototype.toString.call(object)) === '[object Number]' &&
  108044. (object % 1 === 0 && !common.isNegativeZero(object));
  108045. }
  108046. module.exports = new Type('tag:yaml.org,2002:int', {
  108047. kind: 'scalar',
  108048. resolve: resolveYamlInteger,
  108049. construct: constructYamlInteger,
  108050. predicate: isInteger,
  108051. represent: {
  108052. binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
  108053. octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); },
  108054. decimal: function (obj) { return obj.toString(10); },
  108055. /* eslint-disable max-len */
  108056. hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
  108057. },
  108058. defaultStyle: 'decimal',
  108059. styleAliases: {
  108060. binary: [ 2, 'bin' ],
  108061. octal: [ 8, 'oct' ],
  108062. decimal: [ 10, 'dec' ],
  108063. hexadecimal: [ 16, 'hex' ]
  108064. }
  108065. });
  108066. /***/ }),
  108067. /* 803 */
  108068. /***/ (function(module, exports, __webpack_require__) {
  108069. "use strict";
  108070. var require;
  108071. var esprima;
  108072. // Browserified version does not have esprima
  108073. //
  108074. // 1. For node.js just require module as deps
  108075. // 2. For browser try to require mudule via external AMD system.
  108076. // If not found - try to fallback to window.esprima. If not
  108077. // found too - then fail to parse.
  108078. //
  108079. try {
  108080. // workaround to exclude package from browserify list.
  108081. var _require = require;
  108082. esprima = __webpack_require__(662);
  108083. } catch (_) {
  108084. /*global window */
  108085. if (typeof window !== 'undefined') esprima = window.esprima;
  108086. }
  108087. var Type = __webpack_require__(30);
  108088. function resolveJavascriptFunction(data) {
  108089. if (data === null) return false;
  108090. try {
  108091. var source = '(' + data + ')',
  108092. ast = esprima.parse(source, { range: true });
  108093. if (ast.type !== 'Program' ||
  108094. ast.body.length !== 1 ||
  108095. ast.body[0].type !== 'ExpressionStatement' ||
  108096. (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
  108097. ast.body[0].expression.type !== 'FunctionExpression')) {
  108098. return false;
  108099. }
  108100. return true;
  108101. } catch (err) {
  108102. return false;
  108103. }
  108104. }
  108105. function constructJavascriptFunction(data) {
  108106. /*jslint evil:true*/
  108107. var source = '(' + data + ')',
  108108. ast = esprima.parse(source, { range: true }),
  108109. params = [],
  108110. body;
  108111. if (ast.type !== 'Program' ||
  108112. ast.body.length !== 1 ||
  108113. ast.body[0].type !== 'ExpressionStatement' ||
  108114. (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
  108115. ast.body[0].expression.type !== 'FunctionExpression')) {
  108116. throw new Error('Failed to resolve function');
  108117. }
  108118. ast.body[0].expression.params.forEach(function (param) {
  108119. params.push(param.name);
  108120. });
  108121. body = ast.body[0].expression.body.range;
  108122. // Esprima's ranges include the first '{' and the last '}' characters on
  108123. // function expressions. So cut them out.
  108124. if (ast.body[0].expression.body.type === 'BlockStatement') {
  108125. /*eslint-disable no-new-func*/
  108126. return new Function(params, source.slice(body[0] + 1, body[1] - 1));
  108127. }
  108128. // ES6 arrow functions can omit the BlockStatement. In that case, just return
  108129. // the body.
  108130. /*eslint-disable no-new-func*/
  108131. return new Function(params, 'return ' + source.slice(body[0], body[1]));
  108132. }
  108133. function representJavascriptFunction(object /*, style*/) {
  108134. return object.toString();
  108135. }
  108136. function isFunction(object) {
  108137. return Object.prototype.toString.call(object) === '[object Function]';
  108138. }
  108139. module.exports = new Type('tag:yaml.org,2002:js/function', {
  108140. kind: 'scalar',
  108141. resolve: resolveJavascriptFunction,
  108142. construct: constructJavascriptFunction,
  108143. predicate: isFunction,
  108144. represent: representJavascriptFunction
  108145. });
  108146. /***/ }),
  108147. /* 804 */
  108148. /***/ (function(module, exports, __webpack_require__) {
  108149. "use strict";
  108150. var Type = __webpack_require__(30);
  108151. function resolveJavascriptRegExp(data) {
  108152. if (data === null) return false;
  108153. if (data.length === 0) return false;
  108154. var regexp = data,
  108155. tail = /\/([gim]*)$/.exec(data),
  108156. modifiers = '';
  108157. // if regexp starts with '/' it can have modifiers and must be properly closed
  108158. // `/foo/gim` - modifiers tail can be maximum 3 chars
  108159. if (regexp[0] === '/') {
  108160. if (tail) modifiers = tail[1];
  108161. if (modifiers.length > 3) return false;
  108162. // if expression starts with /, is should be properly terminated
  108163. if (regexp[regexp.length - modifiers.length - 1] !== '/') return false;
  108164. }
  108165. return true;
  108166. }
  108167. function constructJavascriptRegExp(data) {
  108168. var regexp = data,
  108169. tail = /\/([gim]*)$/.exec(data),
  108170. modifiers = '';
  108171. // `/foo/gim` - tail can be maximum 4 chars
  108172. if (regexp[0] === '/') {
  108173. if (tail) modifiers = tail[1];
  108174. regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
  108175. }
  108176. return new RegExp(regexp, modifiers);
  108177. }
  108178. function representJavascriptRegExp(object /*, style*/) {
  108179. var result = '/' + object.source + '/';
  108180. if (object.global) result += 'g';
  108181. if (object.multiline) result += 'm';
  108182. if (object.ignoreCase) result += 'i';
  108183. return result;
  108184. }
  108185. function isRegExp(object) {
  108186. return Object.prototype.toString.call(object) === '[object RegExp]';
  108187. }
  108188. module.exports = new Type('tag:yaml.org,2002:js/regexp', {
  108189. kind: 'scalar',
  108190. resolve: resolveJavascriptRegExp,
  108191. construct: constructJavascriptRegExp,
  108192. predicate: isRegExp,
  108193. represent: representJavascriptRegExp
  108194. });
  108195. /***/ }),
  108196. /* 805 */
  108197. /***/ (function(module, exports, __webpack_require__) {
  108198. "use strict";
  108199. var Type = __webpack_require__(30);
  108200. function resolveJavascriptUndefined() {
  108201. return true;
  108202. }
  108203. function constructJavascriptUndefined() {
  108204. /*eslint-disable no-undefined*/
  108205. return undefined;
  108206. }
  108207. function representJavascriptUndefined() {
  108208. return '';
  108209. }
  108210. function isUndefined(object) {
  108211. return typeof object === 'undefined';
  108212. }
  108213. module.exports = new Type('tag:yaml.org,2002:js/undefined', {
  108214. kind: 'scalar',
  108215. resolve: resolveJavascriptUndefined,
  108216. construct: constructJavascriptUndefined,
  108217. predicate: isUndefined,
  108218. represent: representJavascriptUndefined
  108219. });
  108220. /***/ }),
  108221. /* 806 */
  108222. /***/ (function(module, exports, __webpack_require__) {
  108223. "use strict";
  108224. var Type = __webpack_require__(30);
  108225. module.exports = new Type('tag:yaml.org,2002:map', {
  108226. kind: 'mapping',
  108227. construct: function (data) { return data !== null ? data : {}; }
  108228. });
  108229. /***/ }),
  108230. /* 807 */
  108231. /***/ (function(module, exports, __webpack_require__) {
  108232. "use strict";
  108233. var Type = __webpack_require__(30);
  108234. function resolveYamlMerge(data) {
  108235. return data === '<<' || data === null;
  108236. }
  108237. module.exports = new Type('tag:yaml.org,2002:merge', {
  108238. kind: 'scalar',
  108239. resolve: resolveYamlMerge
  108240. });
  108241. /***/ }),
  108242. /* 808 */
  108243. /***/ (function(module, exports, __webpack_require__) {
  108244. "use strict";
  108245. var Type = __webpack_require__(30);
  108246. function resolveYamlNull(data) {
  108247. if (data === null) return true;
  108248. var max = data.length;
  108249. return (max === 1 && data === '~') ||
  108250. (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
  108251. }
  108252. function constructYamlNull() {
  108253. return null;
  108254. }
  108255. function isNull(object) {
  108256. return object === null;
  108257. }
  108258. module.exports = new Type('tag:yaml.org,2002:null', {
  108259. kind: 'scalar',
  108260. resolve: resolveYamlNull,
  108261. construct: constructYamlNull,
  108262. predicate: isNull,
  108263. represent: {
  108264. canonical: function () { return '~'; },
  108265. lowercase: function () { return 'null'; },
  108266. uppercase: function () { return 'NULL'; },
  108267. camelcase: function () { return 'Null'; }
  108268. },
  108269. defaultStyle: 'lowercase'
  108270. });
  108271. /***/ }),
  108272. /* 809 */
  108273. /***/ (function(module, exports, __webpack_require__) {
  108274. "use strict";
  108275. var Type = __webpack_require__(30);
  108276. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  108277. var _toString = Object.prototype.toString;
  108278. function resolveYamlOmap(data) {
  108279. if (data === null) return true;
  108280. var objectKeys = [], index, length, pair, pairKey, pairHasKey,
  108281. object = data;
  108282. for (index = 0, length = object.length; index < length; index += 1) {
  108283. pair = object[index];
  108284. pairHasKey = false;
  108285. if (_toString.call(pair) !== '[object Object]') return false;
  108286. for (pairKey in pair) {
  108287. if (_hasOwnProperty.call(pair, pairKey)) {
  108288. if (!pairHasKey) pairHasKey = true;
  108289. else return false;
  108290. }
  108291. }
  108292. if (!pairHasKey) return false;
  108293. if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
  108294. else return false;
  108295. }
  108296. return true;
  108297. }
  108298. function constructYamlOmap(data) {
  108299. return data !== null ? data : [];
  108300. }
  108301. module.exports = new Type('tag:yaml.org,2002:omap', {
  108302. kind: 'sequence',
  108303. resolve: resolveYamlOmap,
  108304. construct: constructYamlOmap
  108305. });
  108306. /***/ }),
  108307. /* 810 */
  108308. /***/ (function(module, exports, __webpack_require__) {
  108309. "use strict";
  108310. var Type = __webpack_require__(30);
  108311. var _toString = Object.prototype.toString;
  108312. function resolveYamlPairs(data) {
  108313. if (data === null) return true;
  108314. var index, length, pair, keys, result,
  108315. object = data;
  108316. result = new Array(object.length);
  108317. for (index = 0, length = object.length; index < length; index += 1) {
  108318. pair = object[index];
  108319. if (_toString.call(pair) !== '[object Object]') return false;
  108320. keys = Object.keys(pair);
  108321. if (keys.length !== 1) return false;
  108322. result[index] = [ keys[0], pair[keys[0]] ];
  108323. }
  108324. return true;
  108325. }
  108326. function constructYamlPairs(data) {
  108327. if (data === null) return [];
  108328. var index, length, pair, keys, result,
  108329. object = data;
  108330. result = new Array(object.length);
  108331. for (index = 0, length = object.length; index < length; index += 1) {
  108332. pair = object[index];
  108333. keys = Object.keys(pair);
  108334. result[index] = [ keys[0], pair[keys[0]] ];
  108335. }
  108336. return result;
  108337. }
  108338. module.exports = new Type('tag:yaml.org,2002:pairs', {
  108339. kind: 'sequence',
  108340. resolve: resolveYamlPairs,
  108341. construct: constructYamlPairs
  108342. });
  108343. /***/ }),
  108344. /* 811 */
  108345. /***/ (function(module, exports, __webpack_require__) {
  108346. "use strict";
  108347. var Type = __webpack_require__(30);
  108348. module.exports = new Type('tag:yaml.org,2002:seq', {
  108349. kind: 'sequence',
  108350. construct: function (data) { return data !== null ? data : []; }
  108351. });
  108352. /***/ }),
  108353. /* 812 */
  108354. /***/ (function(module, exports, __webpack_require__) {
  108355. "use strict";
  108356. var Type = __webpack_require__(30);
  108357. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  108358. function resolveYamlSet(data) {
  108359. if (data === null) return true;
  108360. var key, object = data;
  108361. for (key in object) {
  108362. if (_hasOwnProperty.call(object, key)) {
  108363. if (object[key] !== null) return false;
  108364. }
  108365. }
  108366. return true;
  108367. }
  108368. function constructYamlSet(data) {
  108369. return data !== null ? data : {};
  108370. }
  108371. module.exports = new Type('tag:yaml.org,2002:set', {
  108372. kind: 'mapping',
  108373. resolve: resolveYamlSet,
  108374. construct: constructYamlSet
  108375. });
  108376. /***/ }),
  108377. /* 813 */
  108378. /***/ (function(module, exports, __webpack_require__) {
  108379. "use strict";
  108380. var Type = __webpack_require__(30);
  108381. module.exports = new Type('tag:yaml.org,2002:str', {
  108382. kind: 'scalar',
  108383. construct: function (data) { return data !== null ? data : ''; }
  108384. });
  108385. /***/ }),
  108386. /* 814 */
  108387. /***/ (function(module, exports, __webpack_require__) {
  108388. "use strict";
  108389. var Type = __webpack_require__(30);
  108390. var YAML_DATE_REGEXP = new RegExp(
  108391. '^([0-9][0-9][0-9][0-9])' + // [1] year
  108392. '-([0-9][0-9])' + // [2] month
  108393. '-([0-9][0-9])$'); // [3] day
  108394. var YAML_TIMESTAMP_REGEXP = new RegExp(
  108395. '^([0-9][0-9][0-9][0-9])' + // [1] year
  108396. '-([0-9][0-9]?)' + // [2] month
  108397. '-([0-9][0-9]?)' + // [3] day
  108398. '(?:[Tt]|[ \\t]+)' + // ...
  108399. '([0-9][0-9]?)' + // [4] hour
  108400. ':([0-9][0-9])' + // [5] minute
  108401. ':([0-9][0-9])' + // [6] second
  108402. '(?:\\.([0-9]*))?' + // [7] fraction
  108403. '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
  108404. '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
  108405. function resolveYamlTimestamp(data) {
  108406. if (data === null) return false;
  108407. if (YAML_DATE_REGEXP.exec(data) !== null) return true;
  108408. if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
  108409. return false;
  108410. }
  108411. function constructYamlTimestamp(data) {
  108412. var match, year, month, day, hour, minute, second, fraction = 0,
  108413. delta = null, tz_hour, tz_minute, date;
  108414. match = YAML_DATE_REGEXP.exec(data);
  108415. if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
  108416. if (match === null) throw new Error('Date resolve error');
  108417. // match: [1] year [2] month [3] day
  108418. year = +(match[1]);
  108419. month = +(match[2]) - 1; // JS month starts with 0
  108420. day = +(match[3]);
  108421. if (!match[4]) { // no hour
  108422. return new Date(Date.UTC(year, month, day));
  108423. }
  108424. // match: [4] hour [5] minute [6] second [7] fraction
  108425. hour = +(match[4]);
  108426. minute = +(match[5]);
  108427. second = +(match[6]);
  108428. if (match[7]) {
  108429. fraction = match[7].slice(0, 3);
  108430. while (fraction.length < 3) { // milli-seconds
  108431. fraction += '0';
  108432. }
  108433. fraction = +fraction;
  108434. }
  108435. // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
  108436. if (match[9]) {
  108437. tz_hour = +(match[10]);
  108438. tz_minute = +(match[11] || 0);
  108439. delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
  108440. if (match[9] === '-') delta = -delta;
  108441. }
  108442. date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
  108443. if (delta) date.setTime(date.getTime() - delta);
  108444. return date;
  108445. }
  108446. function representYamlTimestamp(object /*, style*/) {
  108447. return object.toISOString();
  108448. }
  108449. module.exports = new Type('tag:yaml.org,2002:timestamp', {
  108450. kind: 'scalar',
  108451. resolve: resolveYamlTimestamp,
  108452. construct: constructYamlTimestamp,
  108453. instanceOf: Date,
  108454. represent: representYamlTimestamp
  108455. });
  108456. /***/ }),
  108457. /* 815 */
  108458. /***/ (function(module, exports, __webpack_require__) {
  108459. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
  108460. * JSONSchema Validator - Validates JavaScript objects using JSON Schemas
  108461. * (http://www.json.com/json-schema-proposal/)
  108462. *
  108463. * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com)
  108464. * Licensed under the MIT (MIT-LICENSE.txt) license.
  108465. To use the validator call the validate function with an instance object and an optional schema object.
  108466. If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
  108467. that schema will be used to validate and the schema parameter is not necessary (if both exist,
  108468. both validations will occur).
  108469. The validate method will return an array of validation errors. If there are no errors, then an
  108470. empty list will be returned. A validation error will have two properties:
  108471. "property" which indicates which property had the error
  108472. "message" which indicates what the error was
  108473. */
  108474. (function (root, factory) {
  108475. if (true) {
  108476. // AMD. Register as an anonymous module.
  108477. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
  108478. return factory();
  108479. }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  108480. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  108481. } else if (typeof module === 'object' && module.exports) {
  108482. // Node. Does not work with strict CommonJS, but
  108483. // only CommonJS-like environments that support module.exports,
  108484. // like Node.
  108485. module.exports = factory();
  108486. } else {
  108487. // Browser globals
  108488. root.jsonSchema = factory();
  108489. }
  108490. }(this, function () {// setup primitive classes to be JSON Schema types
  108491. var exports = validate
  108492. exports.Integer = {type:"integer"};
  108493. var primitiveConstructors = {
  108494. String: String,
  108495. Boolean: Boolean,
  108496. Number: Number,
  108497. Object: Object,
  108498. Array: Array,
  108499. Date: Date
  108500. }
  108501. exports.validate = validate;
  108502. function validate(/*Any*/instance,/*Object*/schema) {
  108503. // Summary:
  108504. // To use the validator call JSONSchema.validate with an instance object and an optional schema object.
  108505. // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
  108506. // that schema will be used to validate and the schema parameter is not necessary (if both exist,
  108507. // both validations will occur).
  108508. // The validate method will return an object with two properties:
  108509. // valid: A boolean indicating if the instance is valid by the schema
  108510. // errors: An array of validation errors. If there are no errors, then an
  108511. // empty list will be returned. A validation error will have two properties:
  108512. // property: which indicates which property had the error
  108513. // message: which indicates what the error was
  108514. //
  108515. return validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false});
  108516. };
  108517. exports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) {
  108518. // Summary:
  108519. // The checkPropertyChange method will check to see if an value can legally be in property with the given schema
  108520. // This is slightly different than the validate method in that it will fail if the schema is readonly and it will
  108521. // not check for self-validation, it is assumed that the passed in value is already internally valid.
  108522. // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for
  108523. // information.
  108524. //
  108525. return validate(value, schema, {changing: property || "property"});
  108526. };
  108527. var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) {
  108528. if (!options) options = {};
  108529. var _changing = options.changing;
  108530. function getType(schema){
  108531. return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase());
  108532. }
  108533. var errors = [];
  108534. // validate a value against a property definition
  108535. function checkProp(value, schema, path,i){
  108536. var l;
  108537. path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i;
  108538. function addError(message){
  108539. errors.push({property:path,message:message});
  108540. }
  108541. if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){
  108542. if(typeof schema == 'function'){
  108543. if(!(value instanceof schema)){
  108544. addError("is not an instance of the class/constructor " + schema.name);
  108545. }
  108546. }else if(schema){
  108547. addError("Invalid schema/property definition " + schema);
  108548. }
  108549. return null;
  108550. }
  108551. if(_changing && schema.readonly){
  108552. addError("is a readonly field, it can not be changed");
  108553. }
  108554. if(schema['extends']){ // if it extends another schema, it must pass that schema as well
  108555. checkProp(value,schema['extends'],path,i);
  108556. }
  108557. // validate a value against a type definition
  108558. function checkType(type,value){
  108559. if(type){
  108560. if(typeof type == 'string' && type != 'any' &&
  108561. (type == 'null' ? value !== null : typeof value != type) &&
  108562. !(value instanceof Array && type == 'array') &&
  108563. !(value instanceof Date && type == 'date') &&
  108564. !(type == 'integer' && value%1===0)){
  108565. return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}];
  108566. }
  108567. if(type instanceof Array){
  108568. var unionErrors=[];
  108569. for(var j = 0; j < type.length; j++){ // a union type
  108570. if(!(unionErrors=checkType(type[j],value)).length){
  108571. break;
  108572. }
  108573. }
  108574. if(unionErrors.length){
  108575. return unionErrors;
  108576. }
  108577. }else if(typeof type == 'object'){
  108578. var priorErrors = errors;
  108579. errors = [];
  108580. checkProp(value,type,path);
  108581. var theseErrors = errors;
  108582. errors = priorErrors;
  108583. return theseErrors;
  108584. }
  108585. }
  108586. return [];
  108587. }
  108588. if(value === undefined){
  108589. if(schema.required){
  108590. addError("is missing and it is required");
  108591. }
  108592. }else{
  108593. errors = errors.concat(checkType(getType(schema),value));
  108594. if(schema.disallow && !checkType(schema.disallow,value).length){
  108595. addError(" disallowed value was matched");
  108596. }
  108597. if(value !== null){
  108598. if(value instanceof Array){
  108599. if(schema.items){
  108600. var itemsIsArray = schema.items instanceof Array;
  108601. var propDef = schema.items;
  108602. for (i = 0, l = value.length; i < l; i += 1) {
  108603. if (itemsIsArray)
  108604. propDef = schema.items[i];
  108605. if (options.coerce)
  108606. value[i] = options.coerce(value[i], propDef);
  108607. errors.concat(checkProp(value[i],propDef,path,i));
  108608. }
  108609. }
  108610. if(schema.minItems && value.length < schema.minItems){
  108611. addError("There must be a minimum of " + schema.minItems + " in the array");
  108612. }
  108613. if(schema.maxItems && value.length > schema.maxItems){
  108614. addError("There must be a maximum of " + schema.maxItems + " in the array");
  108615. }
  108616. }else if(schema.properties || schema.additionalProperties){
  108617. errors.concat(checkObj(value, schema.properties, path, schema.additionalProperties));
  108618. }
  108619. if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){
  108620. addError("does not match the regex pattern " + schema.pattern);
  108621. }
  108622. if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){
  108623. addError("may only be " + schema.maxLength + " characters long");
  108624. }
  108625. if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){
  108626. addError("must be at least " + schema.minLength + " characters long");
  108627. }
  108628. if(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum &&
  108629. schema.minimum > value){
  108630. addError("must have a minimum value of " + schema.minimum);
  108631. }
  108632. if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum &&
  108633. schema.maximum < value){
  108634. addError("must have a maximum value of " + schema.maximum);
  108635. }
  108636. if(schema['enum']){
  108637. var enumer = schema['enum'];
  108638. l = enumer.length;
  108639. var found;
  108640. for(var j = 0; j < l; j++){
  108641. if(enumer[j]===value){
  108642. found=1;
  108643. break;
  108644. }
  108645. }
  108646. if(!found){
  108647. addError("does not have a value in the enumeration " + enumer.join(", "));
  108648. }
  108649. }
  108650. if(typeof schema.maxDecimal == 'number' &&
  108651. (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){
  108652. addError("may only have " + schema.maxDecimal + " digits of decimal places");
  108653. }
  108654. }
  108655. }
  108656. return null;
  108657. }
  108658. // validate an object against a schema
  108659. function checkObj(instance,objTypeDef,path,additionalProp){
  108660. if(typeof objTypeDef =='object'){
  108661. if(typeof instance != 'object' || instance instanceof Array){
  108662. errors.push({property:path,message:"an object is required"});
  108663. }
  108664. for(var i in objTypeDef){
  108665. if(objTypeDef.hasOwnProperty(i)){
  108666. var value = instance[i];
  108667. // skip _not_ specified properties
  108668. if (value === undefined && options.existingOnly) continue;
  108669. var propDef = objTypeDef[i];
  108670. // set default
  108671. if(value === undefined && propDef["default"]){
  108672. value = instance[i] = propDef["default"];
  108673. }
  108674. if(options.coerce && i in instance){
  108675. value = instance[i] = options.coerce(value, propDef);
  108676. }
  108677. checkProp(value,propDef,path,i);
  108678. }
  108679. }
  108680. }
  108681. for(i in instance){
  108682. if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){
  108683. if (options.filter) {
  108684. delete instance[i];
  108685. continue;
  108686. } else {
  108687. errors.push({property:path,message:(typeof value) + "The property " + i +
  108688. " is not defined in the schema and the schema does not allow additional properties"});
  108689. }
  108690. }
  108691. var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;
  108692. if(requires && !(requires in instance)){
  108693. errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"});
  108694. }
  108695. value = instance[i];
  108696. if(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){
  108697. if(options.coerce){
  108698. value = instance[i] = options.coerce(value, additionalProp);
  108699. }
  108700. checkProp(value,additionalProp,path,i);
  108701. }
  108702. if(!_changing && value && value.$schema){
  108703. errors = errors.concat(checkProp(value,value.$schema,path,i));
  108704. }
  108705. }
  108706. return errors;
  108707. }
  108708. if(schema){
  108709. checkProp(instance,schema,'',_changing || '');
  108710. }
  108711. if(!_changing && instance && instance.$schema){
  108712. checkProp(instance,instance.$schema,'','');
  108713. }
  108714. return {valid:!errors.length,errors:errors};
  108715. };
  108716. exports.mustBeValid = function(result){
  108717. // summary:
  108718. // This checks to ensure that the result is valid and will throw an appropriate error message if it is not
  108719. // result: the result returned from checkPropertyChange or validate
  108720. if(!result.valid){
  108721. throw new TypeError(result.errors.map(function(error){return "for property " + error.property + ': ' + error.message;}).join(", \n"));
  108722. }
  108723. }
  108724. return exports;
  108725. }));
  108726. /***/ }),
  108727. /* 816 */
  108728. /***/ (function(module, exports) {
  108729. exports = module.exports = stringify
  108730. exports.getSerialize = serializer
  108731. function stringify(obj, replacer, spaces, cycleReplacer) {
  108732. return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
  108733. }
  108734. function serializer(replacer, cycleReplacer) {
  108735. var stack = [], keys = []
  108736. if (cycleReplacer == null) cycleReplacer = function(key, value) {
  108737. if (stack[0] === value) return "[Circular ~]"
  108738. return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"
  108739. }
  108740. return function(key, value) {
  108741. if (stack.length > 0) {
  108742. var thisPos = stack.indexOf(this)
  108743. ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
  108744. ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
  108745. if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)
  108746. }
  108747. else stack.push(value)
  108748. return replacer == null ? value : replacer.call(this, key, value)
  108749. }
  108750. }
  108751. /***/ }),
  108752. /* 817 */
  108753. /***/ (function(module, exports, __webpack_require__) {
  108754. /*
  108755. * lib/jsprim.js: utilities for primitive JavaScript types
  108756. */
  108757. var mod_assert = __webpack_require__(22);
  108758. var mod_util = __webpack_require__(9);
  108759. var mod_extsprintf = __webpack_require__(669);
  108760. var mod_verror = __webpack_require__(1033);
  108761. var mod_jsonschema = __webpack_require__(815);
  108762. /*
  108763. * Public interface
  108764. */
  108765. exports.deepCopy = deepCopy;
  108766. exports.deepEqual = deepEqual;
  108767. exports.isEmpty = isEmpty;
  108768. exports.hasKey = hasKey;
  108769. exports.forEachKey = forEachKey;
  108770. exports.pluck = pluck;
  108771. exports.flattenObject = flattenObject;
  108772. exports.flattenIter = flattenIter;
  108773. exports.validateJsonObject = validateJsonObjectJS;
  108774. exports.validateJsonObjectJS = validateJsonObjectJS;
  108775. exports.randElt = randElt;
  108776. exports.extraProperties = extraProperties;
  108777. exports.mergeObjects = mergeObjects;
  108778. exports.startsWith = startsWith;
  108779. exports.endsWith = endsWith;
  108780. exports.parseInteger = parseInteger;
  108781. exports.iso8601 = iso8601;
  108782. exports.rfc1123 = rfc1123;
  108783. exports.parseDateTime = parseDateTime;
  108784. exports.hrtimediff = hrtimeDiff;
  108785. exports.hrtimeDiff = hrtimeDiff;
  108786. exports.hrtimeAccum = hrtimeAccum;
  108787. exports.hrtimeAdd = hrtimeAdd;
  108788. exports.hrtimeNanosec = hrtimeNanosec;
  108789. exports.hrtimeMicrosec = hrtimeMicrosec;
  108790. exports.hrtimeMillisec = hrtimeMillisec;
  108791. /*
  108792. * Deep copy an acyclic *basic* Javascript object. This only handles basic
  108793. * scalars (strings, numbers, booleans) and arbitrarily deep arrays and objects
  108794. * containing these. This does *not* handle instances of other classes.
  108795. */
  108796. function deepCopy(obj)
  108797. {
  108798. var ret, key;
  108799. var marker = '__deepCopy';
  108800. if (obj && obj[marker])
  108801. throw (new Error('attempted deep copy of cyclic object'));
  108802. if (obj && obj.constructor == Object) {
  108803. ret = {};
  108804. obj[marker] = true;
  108805. for (key in obj) {
  108806. if (key == marker)
  108807. continue;
  108808. ret[key] = deepCopy(obj[key]);
  108809. }
  108810. delete (obj[marker]);
  108811. return (ret);
  108812. }
  108813. if (obj && obj.constructor == Array) {
  108814. ret = [];
  108815. obj[marker] = true;
  108816. for (key = 0; key < obj.length; key++)
  108817. ret.push(deepCopy(obj[key]));
  108818. delete (obj[marker]);
  108819. return (ret);
  108820. }
  108821. /*
  108822. * It must be a primitive type -- just return it.
  108823. */
  108824. return (obj);
  108825. }
  108826. function deepEqual(obj1, obj2)
  108827. {
  108828. if (typeof (obj1) != typeof (obj2))
  108829. return (false);
  108830. if (obj1 === null || obj2 === null || typeof (obj1) != 'object')
  108831. return (obj1 === obj2);
  108832. if (obj1.constructor != obj2.constructor)
  108833. return (false);
  108834. var k;
  108835. for (k in obj1) {
  108836. if (!obj2.hasOwnProperty(k))
  108837. return (false);
  108838. if (!deepEqual(obj1[k], obj2[k]))
  108839. return (false);
  108840. }
  108841. for (k in obj2) {
  108842. if (!obj1.hasOwnProperty(k))
  108843. return (false);
  108844. }
  108845. return (true);
  108846. }
  108847. function isEmpty(obj)
  108848. {
  108849. var key;
  108850. for (key in obj)
  108851. return (false);
  108852. return (true);
  108853. }
  108854. function hasKey(obj, key)
  108855. {
  108856. mod_assert.equal(typeof (key), 'string');
  108857. return (Object.prototype.hasOwnProperty.call(obj, key));
  108858. }
  108859. function forEachKey(obj, callback)
  108860. {
  108861. for (var key in obj) {
  108862. if (hasKey(obj, key)) {
  108863. callback(key, obj[key]);
  108864. }
  108865. }
  108866. }
  108867. function pluck(obj, key)
  108868. {
  108869. mod_assert.equal(typeof (key), 'string');
  108870. return (pluckv(obj, key));
  108871. }
  108872. function pluckv(obj, key)
  108873. {
  108874. if (obj === null || typeof (obj) !== 'object')
  108875. return (undefined);
  108876. if (obj.hasOwnProperty(key))
  108877. return (obj[key]);
  108878. var i = key.indexOf('.');
  108879. if (i == -1)
  108880. return (undefined);
  108881. var key1 = key.substr(0, i);
  108882. if (!obj.hasOwnProperty(key1))
  108883. return (undefined);
  108884. return (pluckv(obj[key1], key.substr(i + 1)));
  108885. }
  108886. /*
  108887. * Invoke callback(row) for each entry in the array that would be returned by
  108888. * flattenObject(data, depth). This is just like flattenObject(data,
  108889. * depth).forEach(callback), except that the intermediate array is never
  108890. * created.
  108891. */
  108892. function flattenIter(data, depth, callback)
  108893. {
  108894. doFlattenIter(data, depth, [], callback);
  108895. }
  108896. function doFlattenIter(data, depth, accum, callback)
  108897. {
  108898. var each;
  108899. var key;
  108900. if (depth === 0) {
  108901. each = accum.slice(0);
  108902. each.push(data);
  108903. callback(each);
  108904. return;
  108905. }
  108906. mod_assert.ok(data !== null);
  108907. mod_assert.equal(typeof (data), 'object');
  108908. mod_assert.equal(typeof (depth), 'number');
  108909. mod_assert.ok(depth >= 0);
  108910. for (key in data) {
  108911. each = accum.slice(0);
  108912. each.push(key);
  108913. doFlattenIter(data[key], depth - 1, each, callback);
  108914. }
  108915. }
  108916. function flattenObject(data, depth)
  108917. {
  108918. if (depth === 0)
  108919. return ([ data ]);
  108920. mod_assert.ok(data !== null);
  108921. mod_assert.equal(typeof (data), 'object');
  108922. mod_assert.equal(typeof (depth), 'number');
  108923. mod_assert.ok(depth >= 0);
  108924. var rv = [];
  108925. var key;
  108926. for (key in data) {
  108927. flattenObject(data[key], depth - 1).forEach(function (p) {
  108928. rv.push([ key ].concat(p));
  108929. });
  108930. }
  108931. return (rv);
  108932. }
  108933. function startsWith(str, prefix)
  108934. {
  108935. return (str.substr(0, prefix.length) == prefix);
  108936. }
  108937. function endsWith(str, suffix)
  108938. {
  108939. return (str.substr(
  108940. str.length - suffix.length, suffix.length) == suffix);
  108941. }
  108942. function iso8601(d)
  108943. {
  108944. if (typeof (d) == 'number')
  108945. d = new Date(d);
  108946. mod_assert.ok(d.constructor === Date);
  108947. return (mod_extsprintf.sprintf('%4d-%02d-%02dT%02d:%02d:%02d.%03dZ',
  108948. d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(),
  108949. d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(),
  108950. d.getUTCMilliseconds()));
  108951. }
  108952. var RFC1123_MONTHS = [
  108953. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  108954. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
  108955. var RFC1123_DAYS = [
  108956. 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
  108957. function rfc1123(date) {
  108958. return (mod_extsprintf.sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT',
  108959. RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(),
  108960. RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(),
  108961. date.getUTCHours(), date.getUTCMinutes(),
  108962. date.getUTCSeconds()));
  108963. }
  108964. /*
  108965. * Parses a date expressed as a string, as either a number of milliseconds since
  108966. * the epoch or any string format that Date accepts, giving preference to the
  108967. * former where these two sets overlap (e.g., small numbers).
  108968. */
  108969. function parseDateTime(str)
  108970. {
  108971. /*
  108972. * This is irritatingly implicit, but significantly more concise than
  108973. * alternatives. The "+str" will convert a string containing only a
  108974. * number directly to a Number, or NaN for other strings. Thus, if the
  108975. * conversion succeeds, we use it (this is the milliseconds-since-epoch
  108976. * case). Otherwise, we pass the string directly to the Date
  108977. * constructor to parse.
  108978. */
  108979. var numeric = +str;
  108980. if (!isNaN(numeric)) {
  108981. return (new Date(numeric));
  108982. } else {
  108983. return (new Date(str));
  108984. }
  108985. }
  108986. /*
  108987. * Number.*_SAFE_INTEGER isn't present before node v0.12, so we hardcode
  108988. * the ES6 definitions here, while allowing for them to someday be higher.
  108989. */
  108990. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
  108991. var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;
  108992. /*
  108993. * Default options for parseInteger().
  108994. */
  108995. var PI_DEFAULTS = {
  108996. base: 10,
  108997. allowSign: true,
  108998. allowPrefix: false,
  108999. allowTrailing: false,
  109000. allowImprecise: false,
  109001. trimWhitespace: false,
  109002. leadingZeroIsOctal: false
  109003. };
  109004. var CP_0 = 0x30;
  109005. var CP_9 = 0x39;
  109006. var CP_A = 0x41;
  109007. var CP_B = 0x42;
  109008. var CP_O = 0x4f;
  109009. var CP_T = 0x54;
  109010. var CP_X = 0x58;
  109011. var CP_Z = 0x5a;
  109012. var CP_a = 0x61;
  109013. var CP_b = 0x62;
  109014. var CP_o = 0x6f;
  109015. var CP_t = 0x74;
  109016. var CP_x = 0x78;
  109017. var CP_z = 0x7a;
  109018. var PI_CONV_DEC = 0x30;
  109019. var PI_CONV_UC = 0x37;
  109020. var PI_CONV_LC = 0x57;
  109021. /*
  109022. * A stricter version of parseInt() that provides options for changing what
  109023. * is an acceptable string (for example, disallowing trailing characters).
  109024. */
  109025. function parseInteger(str, uopts)
  109026. {
  109027. mod_assert.string(str, 'str');
  109028. mod_assert.optionalObject(uopts, 'options');
  109029. var baseOverride = false;
  109030. var options = PI_DEFAULTS;
  109031. if (uopts) {
  109032. baseOverride = hasKey(uopts, 'base');
  109033. options = mergeObjects(options, uopts);
  109034. mod_assert.number(options.base, 'options.base');
  109035. mod_assert.ok(options.base >= 2, 'options.base >= 2');
  109036. mod_assert.ok(options.base <= 36, 'options.base <= 36');
  109037. mod_assert.bool(options.allowSign, 'options.allowSign');
  109038. mod_assert.bool(options.allowPrefix, 'options.allowPrefix');
  109039. mod_assert.bool(options.allowTrailing,
  109040. 'options.allowTrailing');
  109041. mod_assert.bool(options.allowImprecise,
  109042. 'options.allowImprecise');
  109043. mod_assert.bool(options.trimWhitespace,
  109044. 'options.trimWhitespace');
  109045. mod_assert.bool(options.leadingZeroIsOctal,
  109046. 'options.leadingZeroIsOctal');
  109047. if (options.leadingZeroIsOctal) {
  109048. mod_assert.ok(!baseOverride,
  109049. '"base" and "leadingZeroIsOctal" are ' +
  109050. 'mutually exclusive');
  109051. }
  109052. }
  109053. var c;
  109054. var pbase = -1;
  109055. var base = options.base;
  109056. var start;
  109057. var mult = 1;
  109058. var value = 0;
  109059. var idx = 0;
  109060. var len = str.length;
  109061. /* Trim any whitespace on the left side. */
  109062. if (options.trimWhitespace) {
  109063. while (idx < len && isSpace(str.charCodeAt(idx))) {
  109064. ++idx;
  109065. }
  109066. }
  109067. /* Check the number for a leading sign. */
  109068. if (options.allowSign) {
  109069. if (str[idx] === '-') {
  109070. idx += 1;
  109071. mult = -1;
  109072. } else if (str[idx] === '+') {
  109073. idx += 1;
  109074. }
  109075. }
  109076. /* Parse the base-indicating prefix if there is one. */
  109077. if (str[idx] === '0') {
  109078. if (options.allowPrefix) {
  109079. pbase = prefixToBase(str.charCodeAt(idx + 1));
  109080. if (pbase !== -1 && (!baseOverride || pbase === base)) {
  109081. base = pbase;
  109082. idx += 2;
  109083. }
  109084. }
  109085. if (pbase === -1 && options.leadingZeroIsOctal) {
  109086. base = 8;
  109087. }
  109088. }
  109089. /* Parse the actual digits. */
  109090. for (start = idx; idx < len; ++idx) {
  109091. c = translateDigit(str.charCodeAt(idx));
  109092. if (c !== -1 && c < base) {
  109093. value *= base;
  109094. value += c;
  109095. } else {
  109096. break;
  109097. }
  109098. }
  109099. /* If we didn't parse any digits, we have an invalid number. */
  109100. if (start === idx) {
  109101. return (new Error('invalid number: ' + JSON.stringify(str)));
  109102. }
  109103. /* Trim any whitespace on the right side. */
  109104. if (options.trimWhitespace) {
  109105. while (idx < len && isSpace(str.charCodeAt(idx))) {
  109106. ++idx;
  109107. }
  109108. }
  109109. /* Check for trailing characters. */
  109110. if (idx < len && !options.allowTrailing) {
  109111. return (new Error('trailing characters after number: ' +
  109112. JSON.stringify(str.slice(idx))));
  109113. }
  109114. /* If our value is 0, we return now, to avoid returning -0. */
  109115. if (value === 0) {
  109116. return (0);
  109117. }
  109118. /* Calculate our final value. */
  109119. var result = value * mult;
  109120. /*
  109121. * If the string represents a value that cannot be precisely represented
  109122. * by JavaScript, then we want to check that:
  109123. *
  109124. * - We never increased the value past MAX_SAFE_INTEGER
  109125. * - We don't make the result negative and below MIN_SAFE_INTEGER
  109126. *
  109127. * Because we only ever increment the value during parsing, there's no
  109128. * chance of moving past MAX_SAFE_INTEGER and then dropping below it
  109129. * again, losing precision in the process. This means that we only need
  109130. * to do our checks here, at the end.
  109131. */
  109132. if (!options.allowImprecise &&
  109133. (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) {
  109134. return (new Error('number is outside of the supported range: ' +
  109135. JSON.stringify(str.slice(start, idx))));
  109136. }
  109137. return (result);
  109138. }
  109139. /*
  109140. * Interpret a character code as a base-36 digit.
  109141. */
  109142. function translateDigit(d)
  109143. {
  109144. if (d >= CP_0 && d <= CP_9) {
  109145. /* '0' to '9' -> 0 to 9 */
  109146. return (d - PI_CONV_DEC);
  109147. } else if (d >= CP_A && d <= CP_Z) {
  109148. /* 'A' - 'Z' -> 10 to 35 */
  109149. return (d - PI_CONV_UC);
  109150. } else if (d >= CP_a && d <= CP_z) {
  109151. /* 'a' - 'z' -> 10 to 35 */
  109152. return (d - PI_CONV_LC);
  109153. } else {
  109154. /* Invalid character code */
  109155. return (-1);
  109156. }
  109157. }
  109158. /*
  109159. * Test if a value matches the ECMAScript definition of trimmable whitespace.
  109160. */
  109161. function isSpace(c)
  109162. {
  109163. return (c === 0x20) ||
  109164. (c >= 0x0009 && c <= 0x000d) ||
  109165. (c === 0x00a0) ||
  109166. (c === 0x1680) ||
  109167. (c === 0x180e) ||
  109168. (c >= 0x2000 && c <= 0x200a) ||
  109169. (c === 0x2028) ||
  109170. (c === 0x2029) ||
  109171. (c === 0x202f) ||
  109172. (c === 0x205f) ||
  109173. (c === 0x3000) ||
  109174. (c === 0xfeff);
  109175. }
  109176. /*
  109177. * Determine which base a character indicates (e.g., 'x' indicates hex).
  109178. */
  109179. function prefixToBase(c)
  109180. {
  109181. if (c === CP_b || c === CP_B) {
  109182. /* 0b/0B (binary) */
  109183. return (2);
  109184. } else if (c === CP_o || c === CP_O) {
  109185. /* 0o/0O (octal) */
  109186. return (8);
  109187. } else if (c === CP_t || c === CP_T) {
  109188. /* 0t/0T (decimal) */
  109189. return (10);
  109190. } else if (c === CP_x || c === CP_X) {
  109191. /* 0x/0X (hexadecimal) */
  109192. return (16);
  109193. } else {
  109194. /* Not a meaningful character */
  109195. return (-1);
  109196. }
  109197. }
  109198. function validateJsonObjectJS(schema, input)
  109199. {
  109200. var report = mod_jsonschema.validate(input, schema);
  109201. if (report.errors.length === 0)
  109202. return (null);
  109203. /* Currently, we only do anything useful with the first error. */
  109204. var error = report.errors[0];
  109205. /* The failed property is given by a URI with an irrelevant prefix. */
  109206. var propname = error['property'];
  109207. var reason = error['message'].toLowerCase();
  109208. var i, j;
  109209. /*
  109210. * There's at least one case where the property error message is
  109211. * confusing at best. We work around this here.
  109212. */
  109213. if ((i = reason.indexOf('the property ')) != -1 &&
  109214. (j = reason.indexOf(' is not defined in the schema and the ' +
  109215. 'schema does not allow additional properties')) != -1) {
  109216. i += 'the property '.length;
  109217. if (propname === '')
  109218. propname = reason.substr(i, j - i);
  109219. else
  109220. propname = propname + '.' + reason.substr(i, j - i);
  109221. reason = 'unsupported property';
  109222. }
  109223. var rv = new mod_verror.VError('property "%s": %s', propname, reason);
  109224. rv.jsv_details = error;
  109225. return (rv);
  109226. }
  109227. function randElt(arr)
  109228. {
  109229. mod_assert.ok(Array.isArray(arr) && arr.length > 0,
  109230. 'randElt argument must be a non-empty array');
  109231. return (arr[Math.floor(Math.random() * arr.length)]);
  109232. }
  109233. function assertHrtime(a)
  109234. {
  109235. mod_assert.ok(a[0] >= 0 && a[1] >= 0,
  109236. 'negative numbers not allowed in hrtimes');
  109237. mod_assert.ok(a[1] < 1e9, 'nanoseconds column overflow');
  109238. }
  109239. /*
  109240. * Compute the time elapsed between hrtime readings A and B, where A is later
  109241. * than B. hrtime readings come from Node's process.hrtime(). There is no
  109242. * defined way to represent negative deltas, so it's illegal to diff B from A
  109243. * where the time denoted by B is later than the time denoted by A. If this
  109244. * becomes valuable, we can define a representation and extend the
  109245. * implementation to support it.
  109246. */
  109247. function hrtimeDiff(a, b)
  109248. {
  109249. assertHrtime(a);
  109250. assertHrtime(b);
  109251. mod_assert.ok(a[0] > b[0] || (a[0] == b[0] && a[1] >= b[1]),
  109252. 'negative differences not allowed');
  109253. var rv = [ a[0] - b[0], 0 ];
  109254. if (a[1] >= b[1]) {
  109255. rv[1] = a[1] - b[1];
  109256. } else {
  109257. rv[0]--;
  109258. rv[1] = 1e9 - (b[1] - a[1]);
  109259. }
  109260. return (rv);
  109261. }
  109262. /*
  109263. * Convert a hrtime reading from the array format returned by Node's
  109264. * process.hrtime() into a scalar number of nanoseconds.
  109265. */
  109266. function hrtimeNanosec(a)
  109267. {
  109268. assertHrtime(a);
  109269. return (Math.floor(a[0] * 1e9 + a[1]));
  109270. }
  109271. /*
  109272. * Convert a hrtime reading from the array format returned by Node's
  109273. * process.hrtime() into a scalar number of microseconds.
  109274. */
  109275. function hrtimeMicrosec(a)
  109276. {
  109277. assertHrtime(a);
  109278. return (Math.floor(a[0] * 1e6 + a[1] / 1e3));
  109279. }
  109280. /*
  109281. * Convert a hrtime reading from the array format returned by Node's
  109282. * process.hrtime() into a scalar number of milliseconds.
  109283. */
  109284. function hrtimeMillisec(a)
  109285. {
  109286. assertHrtime(a);
  109287. return (Math.floor(a[0] * 1e3 + a[1] / 1e6));
  109288. }
  109289. /*
  109290. * Add two hrtime readings A and B, overwriting A with the result of the
  109291. * addition. This function is useful for accumulating several hrtime intervals
  109292. * into a counter. Returns A.
  109293. */
  109294. function hrtimeAccum(a, b)
  109295. {
  109296. assertHrtime(a);
  109297. assertHrtime(b);
  109298. /*
  109299. * Accumulate the nanosecond component.
  109300. */
  109301. a[1] += b[1];
  109302. if (a[1] >= 1e9) {
  109303. /*
  109304. * The nanosecond component overflowed, so carry to the seconds
  109305. * field.
  109306. */
  109307. a[0]++;
  109308. a[1] -= 1e9;
  109309. }
  109310. /*
  109311. * Accumulate the seconds component.
  109312. */
  109313. a[0] += b[0];
  109314. return (a);
  109315. }
  109316. /*
  109317. * Add two hrtime readings A and B, returning the result as a new hrtime array.
  109318. * Does not modify either input argument.
  109319. */
  109320. function hrtimeAdd(a, b)
  109321. {
  109322. assertHrtime(a);
  109323. var rv = [ a[0], a[1] ];
  109324. return (hrtimeAccum(rv, b));
  109325. }
  109326. /*
  109327. * Check an object for unexpected properties. Accepts the object to check, and
  109328. * an array of allowed property names (strings). Returns an array of key names
  109329. * that were found on the object, but did not appear in the list of allowed
  109330. * properties. If no properties were found, the returned array will be of
  109331. * zero length.
  109332. */
  109333. function extraProperties(obj, allowed)
  109334. {
  109335. mod_assert.ok(typeof (obj) === 'object' && obj !== null,
  109336. 'obj argument must be a non-null object');
  109337. mod_assert.ok(Array.isArray(allowed),
  109338. 'allowed argument must be an array of strings');
  109339. for (var i = 0; i < allowed.length; i++) {
  109340. mod_assert.ok(typeof (allowed[i]) === 'string',
  109341. 'allowed argument must be an array of strings');
  109342. }
  109343. return (Object.keys(obj).filter(function (key) {
  109344. return (allowed.indexOf(key) === -1);
  109345. }));
  109346. }
  109347. /*
  109348. * Given three sets of properties "provided" (may be undefined), "overrides"
  109349. * (required), and "defaults" (may be undefined), construct an object containing
  109350. * the union of these sets with "overrides" overriding "provided", and
  109351. * "provided" overriding "defaults". None of the input objects are modified.
  109352. */
  109353. function mergeObjects(provided, overrides, defaults)
  109354. {
  109355. var rv, k;
  109356. rv = {};
  109357. if (defaults) {
  109358. for (k in defaults)
  109359. rv[k] = defaults[k];
  109360. }
  109361. if (provided) {
  109362. for (k in provided)
  109363. rv[k] = provided[k];
  109364. }
  109365. if (overrides) {
  109366. for (k in overrides)
  109367. rv[k] = overrides[k];
  109368. }
  109369. return (rv);
  109370. }
  109371. /***/ }),
  109372. /* 818 */
  109373. /***/ (function(module, exports, __webpack_require__) {
  109374. "use strict";
  109375. /* eslint-disable no-nested-ternary */
  109376. var arr = [];
  109377. var charCodeCache = [];
  109378. module.exports = function (a, b) {
  109379. if (a === b) {
  109380. return 0;
  109381. }
  109382. var swap = a;
  109383. // Swapping the strings if `a` is longer than `b` so we know which one is the
  109384. // shortest & which one is the longest
  109385. if (a.length > b.length) {
  109386. a = b;
  109387. b = swap;
  109388. }
  109389. var aLen = a.length;
  109390. var bLen = b.length;
  109391. if (aLen === 0) {
  109392. return bLen;
  109393. }
  109394. if (bLen === 0) {
  109395. return aLen;
  109396. }
  109397. // Performing suffix trimming:
  109398. // We can linearly drop suffix common to both strings since they
  109399. // don't increase distance at all
  109400. // Note: `~-` is the bitwise way to perform a `- 1` operation
  109401. while (aLen > 0 && (a.charCodeAt(~-aLen) === b.charCodeAt(~-bLen))) {
  109402. aLen--;
  109403. bLen--;
  109404. }
  109405. if (aLen === 0) {
  109406. return bLen;
  109407. }
  109408. // Performing prefix trimming
  109409. // We can linearly drop prefix common to both strings since they
  109410. // don't increase distance at all
  109411. var start = 0;
  109412. while (start < aLen && (a.charCodeAt(start) === b.charCodeAt(start))) {
  109413. start++;
  109414. }
  109415. aLen -= start;
  109416. bLen -= start;
  109417. if (aLen === 0) {
  109418. return bLen;
  109419. }
  109420. var bCharCode;
  109421. var ret;
  109422. var tmp;
  109423. var tmp2;
  109424. var i = 0;
  109425. var j = 0;
  109426. while (i < aLen) {
  109427. charCodeCache[start + i] = a.charCodeAt(start + i);
  109428. arr[i] = ++i;
  109429. }
  109430. while (j < bLen) {
  109431. bCharCode = b.charCodeAt(start + j);
  109432. tmp = j++;
  109433. ret = j;
  109434. for (i = 0; i < aLen; i++) {
  109435. tmp2 = bCharCode === charCodeCache[start + i] ? tmp : tmp + 1;
  109436. tmp = arr[i];
  109437. ret = arr[i] = tmp > ret ? tmp2 > ret ? ret + 1 : tmp2 : tmp2 > tmp ? tmp + 1 : tmp2;
  109438. }
  109439. }
  109440. return ret;
  109441. };
  109442. /***/ }),
  109443. /* 819 */
  109444. /***/ (function(module, exports, __webpack_require__) {
  109445. /* WEBPACK VAR INJECTION */(function(module) {/**
  109446. * lodash (Custom Build) <https://lodash.com/>
  109447. * Build: `lodash modularize exports="npm" -o ./`
  109448. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  109449. * Released under MIT license <https://lodash.com/license>
  109450. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  109451. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  109452. */
  109453. /** Used as the size to enable large array optimizations. */
  109454. var LARGE_ARRAY_SIZE = 200;
  109455. /** Used to stand-in for `undefined` hash values. */
  109456. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  109457. /** Used as references for various `Number` constants. */
  109458. var MAX_SAFE_INTEGER = 9007199254740991;
  109459. /** `Object#toString` result references. */
  109460. var argsTag = '[object Arguments]',
  109461. arrayTag = '[object Array]',
  109462. boolTag = '[object Boolean]',
  109463. dateTag = '[object Date]',
  109464. errorTag = '[object Error]',
  109465. funcTag = '[object Function]',
  109466. genTag = '[object GeneratorFunction]',
  109467. mapTag = '[object Map]',
  109468. numberTag = '[object Number]',
  109469. objectTag = '[object Object]',
  109470. promiseTag = '[object Promise]',
  109471. regexpTag = '[object RegExp]',
  109472. setTag = '[object Set]',
  109473. stringTag = '[object String]',
  109474. symbolTag = '[object Symbol]',
  109475. weakMapTag = '[object WeakMap]';
  109476. var arrayBufferTag = '[object ArrayBuffer]',
  109477. dataViewTag = '[object DataView]',
  109478. float32Tag = '[object Float32Array]',
  109479. float64Tag = '[object Float64Array]',
  109480. int8Tag = '[object Int8Array]',
  109481. int16Tag = '[object Int16Array]',
  109482. int32Tag = '[object Int32Array]',
  109483. uint8Tag = '[object Uint8Array]',
  109484. uint8ClampedTag = '[object Uint8ClampedArray]',
  109485. uint16Tag = '[object Uint16Array]',
  109486. uint32Tag = '[object Uint32Array]';
  109487. /**
  109488. * Used to match `RegExp`
  109489. * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
  109490. */
  109491. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  109492. /** Used to match `RegExp` flags from their coerced string values. */
  109493. var reFlags = /\w*$/;
  109494. /** Used to detect host constructors (Safari). */
  109495. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  109496. /** Used to detect unsigned integer values. */
  109497. var reIsUint = /^(?:0|[1-9]\d*)$/;
  109498. /** Used to identify `toStringTag` values supported by `_.clone`. */
  109499. var cloneableTags = {};
  109500. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  109501. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  109502. cloneableTags[boolTag] = cloneableTags[dateTag] =
  109503. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  109504. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  109505. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  109506. cloneableTags[numberTag] = cloneableTags[objectTag] =
  109507. cloneableTags[regexpTag] = cloneableTags[setTag] =
  109508. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  109509. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  109510. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  109511. cloneableTags[errorTag] = cloneableTags[funcTag] =
  109512. cloneableTags[weakMapTag] = false;
  109513. /** Used to determine if values are of the language type `Object`. */
  109514. var objectTypes = {
  109515. 'function': true,
  109516. 'object': true
  109517. };
  109518. /** Detect free variable `exports`. */
  109519. var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)
  109520. ? exports
  109521. : undefined;
  109522. /** Detect free variable `module`. */
  109523. var freeModule = (objectTypes[typeof module] && module && !module.nodeType)
  109524. ? module
  109525. : undefined;
  109526. /** Detect the popular CommonJS extension `module.exports`. */
  109527. var moduleExports = (freeModule && freeModule.exports === freeExports)
  109528. ? freeExports
  109529. : undefined;
  109530. /** Detect free variable `global` from Node.js. */
  109531. var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
  109532. /** Detect free variable `self`. */
  109533. var freeSelf = checkGlobal(objectTypes[typeof self] && self);
  109534. /** Detect free variable `window`. */
  109535. var freeWindow = checkGlobal(objectTypes[typeof window] && window);
  109536. /** Detect `this` as the global object. */
  109537. var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
  109538. /**
  109539. * Used as a reference to the global object.
  109540. *
  109541. * The `this` value is used if it's the global object to avoid Greasemonkey's
  109542. * restricted `window` object, otherwise the `window` object is used.
  109543. */
  109544. var root = freeGlobal ||
  109545. ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||
  109546. freeSelf || thisGlobal || Function('return this')();
  109547. /**
  109548. * Adds the key-value `pair` to `map`.
  109549. *
  109550. * @private
  109551. * @param {Object} map The map to modify.
  109552. * @param {Array} pair The key-value pair to add.
  109553. * @returns {Object} Returns `map`.
  109554. */
  109555. function addMapEntry(map, pair) {
  109556. // Don't return `Map#set` because it doesn't return the map instance in IE 11.
  109557. map.set(pair[0], pair[1]);
  109558. return map;
  109559. }
  109560. /**
  109561. * Adds `value` to `set`.
  109562. *
  109563. * @private
  109564. * @param {Object} set The set to modify.
  109565. * @param {*} value The value to add.
  109566. * @returns {Object} Returns `set`.
  109567. */
  109568. function addSetEntry(set, value) {
  109569. set.add(value);
  109570. return set;
  109571. }
  109572. /**
  109573. * A specialized version of `_.forEach` for arrays without support for
  109574. * iteratee shorthands.
  109575. *
  109576. * @private
  109577. * @param {Array} array The array to iterate over.
  109578. * @param {Function} iteratee The function invoked per iteration.
  109579. * @returns {Array} Returns `array`.
  109580. */
  109581. function arrayEach(array, iteratee) {
  109582. var index = -1,
  109583. length = array.length;
  109584. while (++index < length) {
  109585. if (iteratee(array[index], index, array) === false) {
  109586. break;
  109587. }
  109588. }
  109589. return array;
  109590. }
  109591. /**
  109592. * Appends the elements of `values` to `array`.
  109593. *
  109594. * @private
  109595. * @param {Array} array The array to modify.
  109596. * @param {Array} values The values to append.
  109597. * @returns {Array} Returns `array`.
  109598. */
  109599. function arrayPush(array, values) {
  109600. var index = -1,
  109601. length = values.length,
  109602. offset = array.length;
  109603. while (++index < length) {
  109604. array[offset + index] = values[index];
  109605. }
  109606. return array;
  109607. }
  109608. /**
  109609. * A specialized version of `_.reduce` for arrays without support for
  109610. * iteratee shorthands.
  109611. *
  109612. * @private
  109613. * @param {Array} array The array to iterate over.
  109614. * @param {Function} iteratee The function invoked per iteration.
  109615. * @param {*} [accumulator] The initial value.
  109616. * @param {boolean} [initAccum] Specify using the first element of `array` as
  109617. * the initial value.
  109618. * @returns {*} Returns the accumulated value.
  109619. */
  109620. function arrayReduce(array, iteratee, accumulator, initAccum) {
  109621. var index = -1,
  109622. length = array.length;
  109623. if (initAccum && length) {
  109624. accumulator = array[++index];
  109625. }
  109626. while (++index < length) {
  109627. accumulator = iteratee(accumulator, array[index], index, array);
  109628. }
  109629. return accumulator;
  109630. }
  109631. /**
  109632. * The base implementation of `_.times` without support for iteratee shorthands
  109633. * or max array length checks.
  109634. *
  109635. * @private
  109636. * @param {number} n The number of times to invoke `iteratee`.
  109637. * @param {Function} iteratee The function invoked per iteration.
  109638. * @returns {Array} Returns the array of results.
  109639. */
  109640. function baseTimes(n, iteratee) {
  109641. var index = -1,
  109642. result = Array(n);
  109643. while (++index < n) {
  109644. result[index] = iteratee(index);
  109645. }
  109646. return result;
  109647. }
  109648. /**
  109649. * Checks if `value` is a global object.
  109650. *
  109651. * @private
  109652. * @param {*} value The value to check.
  109653. * @returns {null|Object} Returns `value` if it's a global object, else `null`.
  109654. */
  109655. function checkGlobal(value) {
  109656. return (value && value.Object === Object) ? value : null;
  109657. }
  109658. /**
  109659. * Checks if `value` is a host object in IE < 9.
  109660. *
  109661. * @private
  109662. * @param {*} value The value to check.
  109663. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  109664. */
  109665. function isHostObject(value) {
  109666. // Many host objects are `Object` objects that can coerce to strings
  109667. // despite having improperly defined `toString` methods.
  109668. var result = false;
  109669. if (value != null && typeof value.toString != 'function') {
  109670. try {
  109671. result = !!(value + '');
  109672. } catch (e) {}
  109673. }
  109674. return result;
  109675. }
  109676. /**
  109677. * Converts `map` to its key-value pairs.
  109678. *
  109679. * @private
  109680. * @param {Object} map The map to convert.
  109681. * @returns {Array} Returns the key-value pairs.
  109682. */
  109683. function mapToArray(map) {
  109684. var index = -1,
  109685. result = Array(map.size);
  109686. map.forEach(function(value, key) {
  109687. result[++index] = [key, value];
  109688. });
  109689. return result;
  109690. }
  109691. /**
  109692. * Converts `set` to an array of its values.
  109693. *
  109694. * @private
  109695. * @param {Object} set The set to convert.
  109696. * @returns {Array} Returns the values.
  109697. */
  109698. function setToArray(set) {
  109699. var index = -1,
  109700. result = Array(set.size);
  109701. set.forEach(function(value) {
  109702. result[++index] = value;
  109703. });
  109704. return result;
  109705. }
  109706. /** Used for built-in method references. */
  109707. var arrayProto = Array.prototype,
  109708. objectProto = Object.prototype;
  109709. /** Used to resolve the decompiled source of functions. */
  109710. var funcToString = Function.prototype.toString;
  109711. /** Used to check objects for own properties. */
  109712. var hasOwnProperty = objectProto.hasOwnProperty;
  109713. /**
  109714. * Used to resolve the
  109715. * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
  109716. * of values.
  109717. */
  109718. var objectToString = objectProto.toString;
  109719. /** Used to detect if a method is native. */
  109720. var reIsNative = RegExp('^' +
  109721. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  109722. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  109723. );
  109724. /** Built-in value references. */
  109725. var Buffer = moduleExports ? root.Buffer : undefined,
  109726. Symbol = root.Symbol,
  109727. Uint8Array = root.Uint8Array,
  109728. getOwnPropertySymbols = Object.getOwnPropertySymbols,
  109729. objectCreate = Object.create,
  109730. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  109731. splice = arrayProto.splice;
  109732. /* Built-in method references for those with the same name as other `lodash` methods. */
  109733. var nativeGetPrototype = Object.getPrototypeOf,
  109734. nativeKeys = Object.keys;
  109735. /* Built-in method references that are verified to be native. */
  109736. var DataView = getNative(root, 'DataView'),
  109737. Map = getNative(root, 'Map'),
  109738. Promise = getNative(root, 'Promise'),
  109739. Set = getNative(root, 'Set'),
  109740. WeakMap = getNative(root, 'WeakMap'),
  109741. nativeCreate = getNative(Object, 'create');
  109742. /** Used to detect maps, sets, and weakmaps. */
  109743. var dataViewCtorString = toSource(DataView),
  109744. mapCtorString = toSource(Map),
  109745. promiseCtorString = toSource(Promise),
  109746. setCtorString = toSource(Set),
  109747. weakMapCtorString = toSource(WeakMap);
  109748. /** Used to convert symbols to primitives and strings. */
  109749. var symbolProto = Symbol ? Symbol.prototype : undefined,
  109750. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  109751. /**
  109752. * Creates a hash object.
  109753. *
  109754. * @private
  109755. * @constructor
  109756. * @param {Array} [entries] The key-value pairs to cache.
  109757. */
  109758. function Hash(entries) {
  109759. var index = -1,
  109760. length = entries ? entries.length : 0;
  109761. this.clear();
  109762. while (++index < length) {
  109763. var entry = entries[index];
  109764. this.set(entry[0], entry[1]);
  109765. }
  109766. }
  109767. /**
  109768. * Removes all key-value entries from the hash.
  109769. *
  109770. * @private
  109771. * @name clear
  109772. * @memberOf Hash
  109773. */
  109774. function hashClear() {
  109775. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  109776. }
  109777. /**
  109778. * Removes `key` and its value from the hash.
  109779. *
  109780. * @private
  109781. * @name delete
  109782. * @memberOf Hash
  109783. * @param {Object} hash The hash to modify.
  109784. * @param {string} key The key of the value to remove.
  109785. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  109786. */
  109787. function hashDelete(key) {
  109788. return this.has(key) && delete this.__data__[key];
  109789. }
  109790. /**
  109791. * Gets the hash value for `key`.
  109792. *
  109793. * @private
  109794. * @name get
  109795. * @memberOf Hash
  109796. * @param {string} key The key of the value to get.
  109797. * @returns {*} Returns the entry value.
  109798. */
  109799. function hashGet(key) {
  109800. var data = this.__data__;
  109801. if (nativeCreate) {
  109802. var result = data[key];
  109803. return result === HASH_UNDEFINED ? undefined : result;
  109804. }
  109805. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  109806. }
  109807. /**
  109808. * Checks if a hash value for `key` exists.
  109809. *
  109810. * @private
  109811. * @name has
  109812. * @memberOf Hash
  109813. * @param {string} key The key of the entry to check.
  109814. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  109815. */
  109816. function hashHas(key) {
  109817. var data = this.__data__;
  109818. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  109819. }
  109820. /**
  109821. * Sets the hash `key` to `value`.
  109822. *
  109823. * @private
  109824. * @name set
  109825. * @memberOf Hash
  109826. * @param {string} key The key of the value to set.
  109827. * @param {*} value The value to set.
  109828. * @returns {Object} Returns the hash instance.
  109829. */
  109830. function hashSet(key, value) {
  109831. var data = this.__data__;
  109832. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  109833. return this;
  109834. }
  109835. // Add methods to `Hash`.
  109836. Hash.prototype.clear = hashClear;
  109837. Hash.prototype['delete'] = hashDelete;
  109838. Hash.prototype.get = hashGet;
  109839. Hash.prototype.has = hashHas;
  109840. Hash.prototype.set = hashSet;
  109841. /**
  109842. * Creates an list cache object.
  109843. *
  109844. * @private
  109845. * @constructor
  109846. * @param {Array} [entries] The key-value pairs to cache.
  109847. */
  109848. function ListCache(entries) {
  109849. var index = -1,
  109850. length = entries ? entries.length : 0;
  109851. this.clear();
  109852. while (++index < length) {
  109853. var entry = entries[index];
  109854. this.set(entry[0], entry[1]);
  109855. }
  109856. }
  109857. /**
  109858. * Removes all key-value entries from the list cache.
  109859. *
  109860. * @private
  109861. * @name clear
  109862. * @memberOf ListCache
  109863. */
  109864. function listCacheClear() {
  109865. this.__data__ = [];
  109866. }
  109867. /**
  109868. * Removes `key` and its value from the list cache.
  109869. *
  109870. * @private
  109871. * @name delete
  109872. * @memberOf ListCache
  109873. * @param {string} key The key of the value to remove.
  109874. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  109875. */
  109876. function listCacheDelete(key) {
  109877. var data = this.__data__,
  109878. index = assocIndexOf(data, key);
  109879. if (index < 0) {
  109880. return false;
  109881. }
  109882. var lastIndex = data.length - 1;
  109883. if (index == lastIndex) {
  109884. data.pop();
  109885. } else {
  109886. splice.call(data, index, 1);
  109887. }
  109888. return true;
  109889. }
  109890. /**
  109891. * Gets the list cache value for `key`.
  109892. *
  109893. * @private
  109894. * @name get
  109895. * @memberOf ListCache
  109896. * @param {string} key The key of the value to get.
  109897. * @returns {*} Returns the entry value.
  109898. */
  109899. function listCacheGet(key) {
  109900. var data = this.__data__,
  109901. index = assocIndexOf(data, key);
  109902. return index < 0 ? undefined : data[index][1];
  109903. }
  109904. /**
  109905. * Checks if a list cache value for `key` exists.
  109906. *
  109907. * @private
  109908. * @name has
  109909. * @memberOf ListCache
  109910. * @param {string} key The key of the entry to check.
  109911. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  109912. */
  109913. function listCacheHas(key) {
  109914. return assocIndexOf(this.__data__, key) > -1;
  109915. }
  109916. /**
  109917. * Sets the list cache `key` to `value`.
  109918. *
  109919. * @private
  109920. * @name set
  109921. * @memberOf ListCache
  109922. * @param {string} key The key of the value to set.
  109923. * @param {*} value The value to set.
  109924. * @returns {Object} Returns the list cache instance.
  109925. */
  109926. function listCacheSet(key, value) {
  109927. var data = this.__data__,
  109928. index = assocIndexOf(data, key);
  109929. if (index < 0) {
  109930. data.push([key, value]);
  109931. } else {
  109932. data[index][1] = value;
  109933. }
  109934. return this;
  109935. }
  109936. // Add methods to `ListCache`.
  109937. ListCache.prototype.clear = listCacheClear;
  109938. ListCache.prototype['delete'] = listCacheDelete;
  109939. ListCache.prototype.get = listCacheGet;
  109940. ListCache.prototype.has = listCacheHas;
  109941. ListCache.prototype.set = listCacheSet;
  109942. /**
  109943. * Creates a map cache object to store key-value pairs.
  109944. *
  109945. * @private
  109946. * @constructor
  109947. * @param {Array} [entries] The key-value pairs to cache.
  109948. */
  109949. function MapCache(entries) {
  109950. var index = -1,
  109951. length = entries ? entries.length : 0;
  109952. this.clear();
  109953. while (++index < length) {
  109954. var entry = entries[index];
  109955. this.set(entry[0], entry[1]);
  109956. }
  109957. }
  109958. /**
  109959. * Removes all key-value entries from the map.
  109960. *
  109961. * @private
  109962. * @name clear
  109963. * @memberOf MapCache
  109964. */
  109965. function mapCacheClear() {
  109966. this.__data__ = {
  109967. 'hash': new Hash,
  109968. 'map': new (Map || ListCache),
  109969. 'string': new Hash
  109970. };
  109971. }
  109972. /**
  109973. * Removes `key` and its value from the map.
  109974. *
  109975. * @private
  109976. * @name delete
  109977. * @memberOf MapCache
  109978. * @param {string} key The key of the value to remove.
  109979. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  109980. */
  109981. function mapCacheDelete(key) {
  109982. return getMapData(this, key)['delete'](key);
  109983. }
  109984. /**
  109985. * Gets the map value for `key`.
  109986. *
  109987. * @private
  109988. * @name get
  109989. * @memberOf MapCache
  109990. * @param {string} key The key of the value to get.
  109991. * @returns {*} Returns the entry value.
  109992. */
  109993. function mapCacheGet(key) {
  109994. return getMapData(this, key).get(key);
  109995. }
  109996. /**
  109997. * Checks if a map value for `key` exists.
  109998. *
  109999. * @private
  110000. * @name has
  110001. * @memberOf MapCache
  110002. * @param {string} key The key of the entry to check.
  110003. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  110004. */
  110005. function mapCacheHas(key) {
  110006. return getMapData(this, key).has(key);
  110007. }
  110008. /**
  110009. * Sets the map `key` to `value`.
  110010. *
  110011. * @private
  110012. * @name set
  110013. * @memberOf MapCache
  110014. * @param {string} key The key of the value to set.
  110015. * @param {*} value The value to set.
  110016. * @returns {Object} Returns the map cache instance.
  110017. */
  110018. function mapCacheSet(key, value) {
  110019. getMapData(this, key).set(key, value);
  110020. return this;
  110021. }
  110022. // Add methods to `MapCache`.
  110023. MapCache.prototype.clear = mapCacheClear;
  110024. MapCache.prototype['delete'] = mapCacheDelete;
  110025. MapCache.prototype.get = mapCacheGet;
  110026. MapCache.prototype.has = mapCacheHas;
  110027. MapCache.prototype.set = mapCacheSet;
  110028. /**
  110029. * Creates a stack cache object to store key-value pairs.
  110030. *
  110031. * @private
  110032. * @constructor
  110033. * @param {Array} [entries] The key-value pairs to cache.
  110034. */
  110035. function Stack(entries) {
  110036. this.__data__ = new ListCache(entries);
  110037. }
  110038. /**
  110039. * Removes all key-value entries from the stack.
  110040. *
  110041. * @private
  110042. * @name clear
  110043. * @memberOf Stack
  110044. */
  110045. function stackClear() {
  110046. this.__data__ = new ListCache;
  110047. }
  110048. /**
  110049. * Removes `key` and its value from the stack.
  110050. *
  110051. * @private
  110052. * @name delete
  110053. * @memberOf Stack
  110054. * @param {string} key The key of the value to remove.
  110055. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  110056. */
  110057. function stackDelete(key) {
  110058. return this.__data__['delete'](key);
  110059. }
  110060. /**
  110061. * Gets the stack value for `key`.
  110062. *
  110063. * @private
  110064. * @name get
  110065. * @memberOf Stack
  110066. * @param {string} key The key of the value to get.
  110067. * @returns {*} Returns the entry value.
  110068. */
  110069. function stackGet(key) {
  110070. return this.__data__.get(key);
  110071. }
  110072. /**
  110073. * Checks if a stack value for `key` exists.
  110074. *
  110075. * @private
  110076. * @name has
  110077. * @memberOf Stack
  110078. * @param {string} key The key of the entry to check.
  110079. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  110080. */
  110081. function stackHas(key) {
  110082. return this.__data__.has(key);
  110083. }
  110084. /**
  110085. * Sets the stack `key` to `value`.
  110086. *
  110087. * @private
  110088. * @name set
  110089. * @memberOf Stack
  110090. * @param {string} key The key of the value to set.
  110091. * @param {*} value The value to set.
  110092. * @returns {Object} Returns the stack cache instance.
  110093. */
  110094. function stackSet(key, value) {
  110095. var cache = this.__data__;
  110096. if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) {
  110097. cache = this.__data__ = new MapCache(cache.__data__);
  110098. }
  110099. cache.set(key, value);
  110100. return this;
  110101. }
  110102. // Add methods to `Stack`.
  110103. Stack.prototype.clear = stackClear;
  110104. Stack.prototype['delete'] = stackDelete;
  110105. Stack.prototype.get = stackGet;
  110106. Stack.prototype.has = stackHas;
  110107. Stack.prototype.set = stackSet;
  110108. /**
  110109. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  110110. * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
  110111. * for equality comparisons.
  110112. *
  110113. * @private
  110114. * @param {Object} object The object to modify.
  110115. * @param {string} key The key of the property to assign.
  110116. * @param {*} value The value to assign.
  110117. */
  110118. function assignValue(object, key, value) {
  110119. var objValue = object[key];
  110120. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  110121. (value === undefined && !(key in object))) {
  110122. object[key] = value;
  110123. }
  110124. }
  110125. /**
  110126. * Gets the index at which the `key` is found in `array` of key-value pairs.
  110127. *
  110128. * @private
  110129. * @param {Array} array The array to search.
  110130. * @param {*} key The key to search for.
  110131. * @returns {number} Returns the index of the matched value, else `-1`.
  110132. */
  110133. function assocIndexOf(array, key) {
  110134. var length = array.length;
  110135. while (length--) {
  110136. if (eq(array[length][0], key)) {
  110137. return length;
  110138. }
  110139. }
  110140. return -1;
  110141. }
  110142. /**
  110143. * The base implementation of `_.assign` without support for multiple sources
  110144. * or `customizer` functions.
  110145. *
  110146. * @private
  110147. * @param {Object} object The destination object.
  110148. * @param {Object} source The source object.
  110149. * @returns {Object} Returns `object`.
  110150. */
  110151. function baseAssign(object, source) {
  110152. return object && copyObject(source, keys(source), object);
  110153. }
  110154. /**
  110155. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  110156. * traversed objects.
  110157. *
  110158. * @private
  110159. * @param {*} value The value to clone.
  110160. * @param {boolean} [isDeep] Specify a deep clone.
  110161. * @param {boolean} [isFull] Specify a clone including symbols.
  110162. * @param {Function} [customizer] The function to customize cloning.
  110163. * @param {string} [key] The key of `value`.
  110164. * @param {Object} [object] The parent object of `value`.
  110165. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  110166. * @returns {*} Returns the cloned value.
  110167. */
  110168. function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
  110169. var result;
  110170. if (customizer) {
  110171. result = object ? customizer(value, key, object, stack) : customizer(value);
  110172. }
  110173. if (result !== undefined) {
  110174. return result;
  110175. }
  110176. if (!isObject(value)) {
  110177. return value;
  110178. }
  110179. var isArr = isArray(value);
  110180. if (isArr) {
  110181. result = initCloneArray(value);
  110182. if (!isDeep) {
  110183. return copyArray(value, result);
  110184. }
  110185. } else {
  110186. var tag = getTag(value),
  110187. isFunc = tag == funcTag || tag == genTag;
  110188. if (isBuffer(value)) {
  110189. return cloneBuffer(value, isDeep);
  110190. }
  110191. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  110192. if (isHostObject(value)) {
  110193. return object ? value : {};
  110194. }
  110195. result = initCloneObject(isFunc ? {} : value);
  110196. if (!isDeep) {
  110197. return copySymbols(value, baseAssign(result, value));
  110198. }
  110199. } else {
  110200. if (!cloneableTags[tag]) {
  110201. return object ? value : {};
  110202. }
  110203. result = initCloneByTag(value, tag, baseClone, isDeep);
  110204. }
  110205. }
  110206. // Check for circular references and return its corresponding clone.
  110207. stack || (stack = new Stack);
  110208. var stacked = stack.get(value);
  110209. if (stacked) {
  110210. return stacked;
  110211. }
  110212. stack.set(value, result);
  110213. if (!isArr) {
  110214. var props = isFull ? getAllKeys(value) : keys(value);
  110215. }
  110216. // Recursively populate clone (susceptible to call stack limits).
  110217. arrayEach(props || value, function(subValue, key) {
  110218. if (props) {
  110219. key = subValue;
  110220. subValue = value[key];
  110221. }
  110222. assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
  110223. });
  110224. return result;
  110225. }
  110226. /**
  110227. * The base implementation of `_.create` without support for assigning
  110228. * properties to the created object.
  110229. *
  110230. * @private
  110231. * @param {Object} prototype The object to inherit from.
  110232. * @returns {Object} Returns the new object.
  110233. */
  110234. function baseCreate(proto) {
  110235. return isObject(proto) ? objectCreate(proto) : {};
  110236. }
  110237. /**
  110238. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  110239. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  110240. * symbols of `object`.
  110241. *
  110242. * @private
  110243. * @param {Object} object The object to query.
  110244. * @param {Function} keysFunc The function to get the keys of `object`.
  110245. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  110246. * @returns {Array} Returns the array of property names and symbols.
  110247. */
  110248. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  110249. var result = keysFunc(object);
  110250. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  110251. }
  110252. /**
  110253. * The base implementation of `_.has` without support for deep paths.
  110254. *
  110255. * @private
  110256. * @param {Object} object The object to query.
  110257. * @param {Array|string} key The key to check.
  110258. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  110259. */
  110260. function baseHas(object, key) {
  110261. // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
  110262. // that are composed entirely of index properties, return `false` for
  110263. // `hasOwnProperty` checks of them.
  110264. return hasOwnProperty.call(object, key) ||
  110265. (typeof object == 'object' && key in object && getPrototype(object) === null);
  110266. }
  110267. /**
  110268. * The base implementation of `_.keys` which doesn't skip the constructor
  110269. * property of prototypes or treat sparse arrays as dense.
  110270. *
  110271. * @private
  110272. * @param {Object} object The object to query.
  110273. * @returns {Array} Returns the array of property names.
  110274. */
  110275. function baseKeys(object) {
  110276. return nativeKeys(Object(object));
  110277. }
  110278. /**
  110279. * The base implementation of `_.property` without support for deep paths.
  110280. *
  110281. * @private
  110282. * @param {string} key The key of the property to get.
  110283. * @returns {Function} Returns the new accessor function.
  110284. */
  110285. function baseProperty(key) {
  110286. return function(object) {
  110287. return object == null ? undefined : object[key];
  110288. };
  110289. }
  110290. /**
  110291. * Creates a clone of `buffer`.
  110292. *
  110293. * @private
  110294. * @param {Buffer} buffer The buffer to clone.
  110295. * @param {boolean} [isDeep] Specify a deep clone.
  110296. * @returns {Buffer} Returns the cloned buffer.
  110297. */
  110298. function cloneBuffer(buffer, isDeep) {
  110299. if (isDeep) {
  110300. return buffer.slice();
  110301. }
  110302. var result = new buffer.constructor(buffer.length);
  110303. buffer.copy(result);
  110304. return result;
  110305. }
  110306. /**
  110307. * Creates a clone of `arrayBuffer`.
  110308. *
  110309. * @private
  110310. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  110311. * @returns {ArrayBuffer} Returns the cloned array buffer.
  110312. */
  110313. function cloneArrayBuffer(arrayBuffer) {
  110314. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  110315. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  110316. return result;
  110317. }
  110318. /**
  110319. * Creates a clone of `dataView`.
  110320. *
  110321. * @private
  110322. * @param {Object} dataView The data view to clone.
  110323. * @param {boolean} [isDeep] Specify a deep clone.
  110324. * @returns {Object} Returns the cloned data view.
  110325. */
  110326. function cloneDataView(dataView, isDeep) {
  110327. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  110328. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  110329. }
  110330. /**
  110331. * Creates a clone of `map`.
  110332. *
  110333. * @private
  110334. * @param {Object} map The map to clone.
  110335. * @param {Function} cloneFunc The function to clone values.
  110336. * @param {boolean} [isDeep] Specify a deep clone.
  110337. * @returns {Object} Returns the cloned map.
  110338. */
  110339. function cloneMap(map, isDeep, cloneFunc) {
  110340. var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
  110341. return arrayReduce(array, addMapEntry, new map.constructor);
  110342. }
  110343. /**
  110344. * Creates a clone of `regexp`.
  110345. *
  110346. * @private
  110347. * @param {Object} regexp The regexp to clone.
  110348. * @returns {Object} Returns the cloned regexp.
  110349. */
  110350. function cloneRegExp(regexp) {
  110351. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  110352. result.lastIndex = regexp.lastIndex;
  110353. return result;
  110354. }
  110355. /**
  110356. * Creates a clone of `set`.
  110357. *
  110358. * @private
  110359. * @param {Object} set The set to clone.
  110360. * @param {Function} cloneFunc The function to clone values.
  110361. * @param {boolean} [isDeep] Specify a deep clone.
  110362. * @returns {Object} Returns the cloned set.
  110363. */
  110364. function cloneSet(set, isDeep, cloneFunc) {
  110365. var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
  110366. return arrayReduce(array, addSetEntry, new set.constructor);
  110367. }
  110368. /**
  110369. * Creates a clone of the `symbol` object.
  110370. *
  110371. * @private
  110372. * @param {Object} symbol The symbol object to clone.
  110373. * @returns {Object} Returns the cloned symbol object.
  110374. */
  110375. function cloneSymbol(symbol) {
  110376. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  110377. }
  110378. /**
  110379. * Creates a clone of `typedArray`.
  110380. *
  110381. * @private
  110382. * @param {Object} typedArray The typed array to clone.
  110383. * @param {boolean} [isDeep] Specify a deep clone.
  110384. * @returns {Object} Returns the cloned typed array.
  110385. */
  110386. function cloneTypedArray(typedArray, isDeep) {
  110387. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  110388. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  110389. }
  110390. /**
  110391. * Copies the values of `source` to `array`.
  110392. *
  110393. * @private
  110394. * @param {Array} source The array to copy values from.
  110395. * @param {Array} [array=[]] The array to copy values to.
  110396. * @returns {Array} Returns `array`.
  110397. */
  110398. function copyArray(source, array) {
  110399. var index = -1,
  110400. length = source.length;
  110401. array || (array = Array(length));
  110402. while (++index < length) {
  110403. array[index] = source[index];
  110404. }
  110405. return array;
  110406. }
  110407. /**
  110408. * Copies properties of `source` to `object`.
  110409. *
  110410. * @private
  110411. * @param {Object} source The object to copy properties from.
  110412. * @param {Array} props The property identifiers to copy.
  110413. * @param {Object} [object={}] The object to copy properties to.
  110414. * @param {Function} [customizer] The function to customize copied values.
  110415. * @returns {Object} Returns `object`.
  110416. */
  110417. function copyObject(source, props, object, customizer) {
  110418. object || (object = {});
  110419. var index = -1,
  110420. length = props.length;
  110421. while (++index < length) {
  110422. var key = props[index];
  110423. var newValue = customizer
  110424. ? customizer(object[key], source[key], key, object, source)
  110425. : source[key];
  110426. assignValue(object, key, newValue);
  110427. }
  110428. return object;
  110429. }
  110430. /**
  110431. * Copies own symbol properties of `source` to `object`.
  110432. *
  110433. * @private
  110434. * @param {Object} source The object to copy symbols from.
  110435. * @param {Object} [object={}] The object to copy symbols to.
  110436. * @returns {Object} Returns `object`.
  110437. */
  110438. function copySymbols(source, object) {
  110439. return copyObject(source, getSymbols(source), object);
  110440. }
  110441. /**
  110442. * Creates an array of own enumerable property names and symbols of `object`.
  110443. *
  110444. * @private
  110445. * @param {Object} object The object to query.
  110446. * @returns {Array} Returns the array of property names and symbols.
  110447. */
  110448. function getAllKeys(object) {
  110449. return baseGetAllKeys(object, keys, getSymbols);
  110450. }
  110451. /**
  110452. * Gets the "length" property value of `object`.
  110453. *
  110454. * **Note:** This function is used to avoid a
  110455. * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
  110456. * Safari on at least iOS 8.1-8.3 ARM64.
  110457. *
  110458. * @private
  110459. * @param {Object} object The object to query.
  110460. * @returns {*} Returns the "length" value.
  110461. */
  110462. var getLength = baseProperty('length');
  110463. /**
  110464. * Gets the data for `map`.
  110465. *
  110466. * @private
  110467. * @param {Object} map The map to query.
  110468. * @param {string} key The reference key.
  110469. * @returns {*} Returns the map data.
  110470. */
  110471. function getMapData(map, key) {
  110472. var data = map.__data__;
  110473. return isKeyable(key)
  110474. ? data[typeof key == 'string' ? 'string' : 'hash']
  110475. : data.map;
  110476. }
  110477. /**
  110478. * Gets the native function at `key` of `object`.
  110479. *
  110480. * @private
  110481. * @param {Object} object The object to query.
  110482. * @param {string} key The key of the method to get.
  110483. * @returns {*} Returns the function if it's native, else `undefined`.
  110484. */
  110485. function getNative(object, key) {
  110486. var value = object[key];
  110487. return isNative(value) ? value : undefined;
  110488. }
  110489. /**
  110490. * Gets the `[[Prototype]]` of `value`.
  110491. *
  110492. * @private
  110493. * @param {*} value The value to query.
  110494. * @returns {null|Object} Returns the `[[Prototype]]`.
  110495. */
  110496. function getPrototype(value) {
  110497. return nativeGetPrototype(Object(value));
  110498. }
  110499. /**
  110500. * Creates an array of the own enumerable symbol properties of `object`.
  110501. *
  110502. * @private
  110503. * @param {Object} object The object to query.
  110504. * @returns {Array} Returns the array of symbols.
  110505. */
  110506. function getSymbols(object) {
  110507. // Coerce `object` to an object to avoid non-object errors in V8.
  110508. // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details.
  110509. return getOwnPropertySymbols(Object(object));
  110510. }
  110511. // Fallback for IE < 11.
  110512. if (!getOwnPropertySymbols) {
  110513. getSymbols = function() {
  110514. return [];
  110515. };
  110516. }
  110517. /**
  110518. * Gets the `toStringTag` of `value`.
  110519. *
  110520. * @private
  110521. * @param {*} value The value to query.
  110522. * @returns {string} Returns the `toStringTag`.
  110523. */
  110524. function getTag(value) {
  110525. return objectToString.call(value);
  110526. }
  110527. // Fallback for data views, maps, sets, and weak maps in IE 11,
  110528. // for data views in Edge, and promises in Node.js.
  110529. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  110530. (Map && getTag(new Map) != mapTag) ||
  110531. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  110532. (Set && getTag(new Set) != setTag) ||
  110533. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  110534. getTag = function(value) {
  110535. var result = objectToString.call(value),
  110536. Ctor = result == objectTag ? value.constructor : undefined,
  110537. ctorString = Ctor ? toSource(Ctor) : undefined;
  110538. if (ctorString) {
  110539. switch (ctorString) {
  110540. case dataViewCtorString: return dataViewTag;
  110541. case mapCtorString: return mapTag;
  110542. case promiseCtorString: return promiseTag;
  110543. case setCtorString: return setTag;
  110544. case weakMapCtorString: return weakMapTag;
  110545. }
  110546. }
  110547. return result;
  110548. };
  110549. }
  110550. /**
  110551. * Initializes an array clone.
  110552. *
  110553. * @private
  110554. * @param {Array} array The array to clone.
  110555. * @returns {Array} Returns the initialized clone.
  110556. */
  110557. function initCloneArray(array) {
  110558. var length = array.length,
  110559. result = array.constructor(length);
  110560. // Add properties assigned by `RegExp#exec`.
  110561. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  110562. result.index = array.index;
  110563. result.input = array.input;
  110564. }
  110565. return result;
  110566. }
  110567. /**
  110568. * Initializes an object clone.
  110569. *
  110570. * @private
  110571. * @param {Object} object The object to clone.
  110572. * @returns {Object} Returns the initialized clone.
  110573. */
  110574. function initCloneObject(object) {
  110575. return (typeof object.constructor == 'function' && !isPrototype(object))
  110576. ? baseCreate(getPrototype(object))
  110577. : {};
  110578. }
  110579. /**
  110580. * Initializes an object clone based on its `toStringTag`.
  110581. *
  110582. * **Note:** This function only supports cloning values with tags of
  110583. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  110584. *
  110585. * @private
  110586. * @param {Object} object The object to clone.
  110587. * @param {string} tag The `toStringTag` of the object to clone.
  110588. * @param {Function} cloneFunc The function to clone values.
  110589. * @param {boolean} [isDeep] Specify a deep clone.
  110590. * @returns {Object} Returns the initialized clone.
  110591. */
  110592. function initCloneByTag(object, tag, cloneFunc, isDeep) {
  110593. var Ctor = object.constructor;
  110594. switch (tag) {
  110595. case arrayBufferTag:
  110596. return cloneArrayBuffer(object);
  110597. case boolTag:
  110598. case dateTag:
  110599. return new Ctor(+object);
  110600. case dataViewTag:
  110601. return cloneDataView(object, isDeep);
  110602. case float32Tag: case float64Tag:
  110603. case int8Tag: case int16Tag: case int32Tag:
  110604. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  110605. return cloneTypedArray(object, isDeep);
  110606. case mapTag:
  110607. return cloneMap(object, isDeep, cloneFunc);
  110608. case numberTag:
  110609. case stringTag:
  110610. return new Ctor(object);
  110611. case regexpTag:
  110612. return cloneRegExp(object);
  110613. case setTag:
  110614. return cloneSet(object, isDeep, cloneFunc);
  110615. case symbolTag:
  110616. return cloneSymbol(object);
  110617. }
  110618. }
  110619. /**
  110620. * Creates an array of index keys for `object` values of arrays,
  110621. * `arguments` objects, and strings, otherwise `null` is returned.
  110622. *
  110623. * @private
  110624. * @param {Object} object The object to query.
  110625. * @returns {Array|null} Returns index keys, else `null`.
  110626. */
  110627. function indexKeys(object) {
  110628. var length = object ? object.length : undefined;
  110629. if (isLength(length) &&
  110630. (isArray(object) || isString(object) || isArguments(object))) {
  110631. return baseTimes(length, String);
  110632. }
  110633. return null;
  110634. }
  110635. /**
  110636. * Checks if `value` is a valid array-like index.
  110637. *
  110638. * @private
  110639. * @param {*} value The value to check.
  110640. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  110641. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  110642. */
  110643. function isIndex(value, length) {
  110644. length = length == null ? MAX_SAFE_INTEGER : length;
  110645. return !!length &&
  110646. (typeof value == 'number' || reIsUint.test(value)) &&
  110647. (value > -1 && value % 1 == 0 && value < length);
  110648. }
  110649. /**
  110650. * Checks if `value` is suitable for use as unique object key.
  110651. *
  110652. * @private
  110653. * @param {*} value The value to check.
  110654. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  110655. */
  110656. function isKeyable(value) {
  110657. var type = typeof value;
  110658. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  110659. ? (value !== '__proto__')
  110660. : (value === null);
  110661. }
  110662. /**
  110663. * Checks if `value` is likely a prototype object.
  110664. *
  110665. * @private
  110666. * @param {*} value The value to check.
  110667. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  110668. */
  110669. function isPrototype(value) {
  110670. var Ctor = value && value.constructor,
  110671. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  110672. return value === proto;
  110673. }
  110674. /**
  110675. * Converts `func` to its source code.
  110676. *
  110677. * @private
  110678. * @param {Function} func The function to process.
  110679. * @returns {string} Returns the source code.
  110680. */
  110681. function toSource(func) {
  110682. if (func != null) {
  110683. try {
  110684. return funcToString.call(func);
  110685. } catch (e) {}
  110686. try {
  110687. return (func + '');
  110688. } catch (e) {}
  110689. }
  110690. return '';
  110691. }
  110692. /**
  110693. * Performs a
  110694. * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
  110695. * comparison between two values to determine if they are equivalent.
  110696. *
  110697. * @static
  110698. * @memberOf _
  110699. * @since 4.0.0
  110700. * @category Lang
  110701. * @param {*} value The value to compare.
  110702. * @param {*} other The other value to compare.
  110703. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  110704. * @example
  110705. *
  110706. * var object = { 'user': 'fred' };
  110707. * var other = { 'user': 'fred' };
  110708. *
  110709. * _.eq(object, object);
  110710. * // => true
  110711. *
  110712. * _.eq(object, other);
  110713. * // => false
  110714. *
  110715. * _.eq('a', 'a');
  110716. * // => true
  110717. *
  110718. * _.eq('a', Object('a'));
  110719. * // => false
  110720. *
  110721. * _.eq(NaN, NaN);
  110722. * // => true
  110723. */
  110724. function eq(value, other) {
  110725. return value === other || (value !== value && other !== other);
  110726. }
  110727. /**
  110728. * Checks if `value` is likely an `arguments` object.
  110729. *
  110730. * @static
  110731. * @memberOf _
  110732. * @since 0.1.0
  110733. * @category Lang
  110734. * @param {*} value The value to check.
  110735. * @returns {boolean} Returns `true` if `value` is correctly classified,
  110736. * else `false`.
  110737. * @example
  110738. *
  110739. * _.isArguments(function() { return arguments; }());
  110740. * // => true
  110741. *
  110742. * _.isArguments([1, 2, 3]);
  110743. * // => false
  110744. */
  110745. function isArguments(value) {
  110746. // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
  110747. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
  110748. (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  110749. }
  110750. /**
  110751. * Checks if `value` is classified as an `Array` object.
  110752. *
  110753. * @static
  110754. * @memberOf _
  110755. * @since 0.1.0
  110756. * @type {Function}
  110757. * @category Lang
  110758. * @param {*} value The value to check.
  110759. * @returns {boolean} Returns `true` if `value` is correctly classified,
  110760. * else `false`.
  110761. * @example
  110762. *
  110763. * _.isArray([1, 2, 3]);
  110764. * // => true
  110765. *
  110766. * _.isArray(document.body.children);
  110767. * // => false
  110768. *
  110769. * _.isArray('abc');
  110770. * // => false
  110771. *
  110772. * _.isArray(_.noop);
  110773. * // => false
  110774. */
  110775. var isArray = Array.isArray;
  110776. /**
  110777. * Checks if `value` is array-like. A value is considered array-like if it's
  110778. * not a function and has a `value.length` that's an integer greater than or
  110779. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  110780. *
  110781. * @static
  110782. * @memberOf _
  110783. * @since 4.0.0
  110784. * @category Lang
  110785. * @param {*} value The value to check.
  110786. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  110787. * @example
  110788. *
  110789. * _.isArrayLike([1, 2, 3]);
  110790. * // => true
  110791. *
  110792. * _.isArrayLike(document.body.children);
  110793. * // => true
  110794. *
  110795. * _.isArrayLike('abc');
  110796. * // => true
  110797. *
  110798. * _.isArrayLike(_.noop);
  110799. * // => false
  110800. */
  110801. function isArrayLike(value) {
  110802. return value != null && isLength(getLength(value)) && !isFunction(value);
  110803. }
  110804. /**
  110805. * This method is like `_.isArrayLike` except that it also checks if `value`
  110806. * is an object.
  110807. *
  110808. * @static
  110809. * @memberOf _
  110810. * @since 4.0.0
  110811. * @category Lang
  110812. * @param {*} value The value to check.
  110813. * @returns {boolean} Returns `true` if `value` is an array-like object,
  110814. * else `false`.
  110815. * @example
  110816. *
  110817. * _.isArrayLikeObject([1, 2, 3]);
  110818. * // => true
  110819. *
  110820. * _.isArrayLikeObject(document.body.children);
  110821. * // => true
  110822. *
  110823. * _.isArrayLikeObject('abc');
  110824. * // => false
  110825. *
  110826. * _.isArrayLikeObject(_.noop);
  110827. * // => false
  110828. */
  110829. function isArrayLikeObject(value) {
  110830. return isObjectLike(value) && isArrayLike(value);
  110831. }
  110832. /**
  110833. * Checks if `value` is a buffer.
  110834. *
  110835. * @static
  110836. * @memberOf _
  110837. * @since 4.3.0
  110838. * @category Lang
  110839. * @param {*} value The value to check.
  110840. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  110841. * @example
  110842. *
  110843. * _.isBuffer(new Buffer(2));
  110844. * // => true
  110845. *
  110846. * _.isBuffer(new Uint8Array(2));
  110847. * // => false
  110848. */
  110849. var isBuffer = !Buffer ? constant(false) : function(value) {
  110850. return value instanceof Buffer;
  110851. };
  110852. /**
  110853. * Checks if `value` is classified as a `Function` object.
  110854. *
  110855. * @static
  110856. * @memberOf _
  110857. * @since 0.1.0
  110858. * @category Lang
  110859. * @param {*} value The value to check.
  110860. * @returns {boolean} Returns `true` if `value` is correctly classified,
  110861. * else `false`.
  110862. * @example
  110863. *
  110864. * _.isFunction(_);
  110865. * // => true
  110866. *
  110867. * _.isFunction(/abc/);
  110868. * // => false
  110869. */
  110870. function isFunction(value) {
  110871. // The use of `Object#toString` avoids issues with the `typeof` operator
  110872. // in Safari 8 which returns 'object' for typed array and weak map constructors,
  110873. // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
  110874. var tag = isObject(value) ? objectToString.call(value) : '';
  110875. return tag == funcTag || tag == genTag;
  110876. }
  110877. /**
  110878. * Checks if `value` is a valid array-like length.
  110879. *
  110880. * **Note:** This function is loosely based on
  110881. * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
  110882. *
  110883. * @static
  110884. * @memberOf _
  110885. * @since 4.0.0
  110886. * @category Lang
  110887. * @param {*} value The value to check.
  110888. * @returns {boolean} Returns `true` if `value` is a valid length,
  110889. * else `false`.
  110890. * @example
  110891. *
  110892. * _.isLength(3);
  110893. * // => true
  110894. *
  110895. * _.isLength(Number.MIN_VALUE);
  110896. * // => false
  110897. *
  110898. * _.isLength(Infinity);
  110899. * // => false
  110900. *
  110901. * _.isLength('3');
  110902. * // => false
  110903. */
  110904. function isLength(value) {
  110905. return typeof value == 'number' &&
  110906. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  110907. }
  110908. /**
  110909. * Checks if `value` is the
  110910. * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
  110911. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  110912. *
  110913. * @static
  110914. * @memberOf _
  110915. * @since 0.1.0
  110916. * @category Lang
  110917. * @param {*} value The value to check.
  110918. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  110919. * @example
  110920. *
  110921. * _.isObject({});
  110922. * // => true
  110923. *
  110924. * _.isObject([1, 2, 3]);
  110925. * // => true
  110926. *
  110927. * _.isObject(_.noop);
  110928. * // => true
  110929. *
  110930. * _.isObject(null);
  110931. * // => false
  110932. */
  110933. function isObject(value) {
  110934. var type = typeof value;
  110935. return !!value && (type == 'object' || type == 'function');
  110936. }
  110937. /**
  110938. * Checks if `value` is object-like. A value is object-like if it's not `null`
  110939. * and has a `typeof` result of "object".
  110940. *
  110941. * @static
  110942. * @memberOf _
  110943. * @since 4.0.0
  110944. * @category Lang
  110945. * @param {*} value The value to check.
  110946. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  110947. * @example
  110948. *
  110949. * _.isObjectLike({});
  110950. * // => true
  110951. *
  110952. * _.isObjectLike([1, 2, 3]);
  110953. * // => true
  110954. *
  110955. * _.isObjectLike(_.noop);
  110956. * // => false
  110957. *
  110958. * _.isObjectLike(null);
  110959. * // => false
  110960. */
  110961. function isObjectLike(value) {
  110962. return !!value && typeof value == 'object';
  110963. }
  110964. /**
  110965. * Checks if `value` is a native function.
  110966. *
  110967. * @static
  110968. * @memberOf _
  110969. * @since 3.0.0
  110970. * @category Lang
  110971. * @param {*} value The value to check.
  110972. * @returns {boolean} Returns `true` if `value` is a native function,
  110973. * else `false`.
  110974. * @example
  110975. *
  110976. * _.isNative(Array.prototype.push);
  110977. * // => true
  110978. *
  110979. * _.isNative(_);
  110980. * // => false
  110981. */
  110982. function isNative(value) {
  110983. if (!isObject(value)) {
  110984. return false;
  110985. }
  110986. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  110987. return pattern.test(toSource(value));
  110988. }
  110989. /**
  110990. * Checks if `value` is classified as a `String` primitive or object.
  110991. *
  110992. * @static
  110993. * @since 0.1.0
  110994. * @memberOf _
  110995. * @category Lang
  110996. * @param {*} value The value to check.
  110997. * @returns {boolean} Returns `true` if `value` is correctly classified,
  110998. * else `false`.
  110999. * @example
  111000. *
  111001. * _.isString('abc');
  111002. * // => true
  111003. *
  111004. * _.isString(1);
  111005. * // => false
  111006. */
  111007. function isString(value) {
  111008. return typeof value == 'string' ||
  111009. (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
  111010. }
  111011. /**
  111012. * Creates an array of the own enumerable property names of `object`.
  111013. *
  111014. * **Note:** Non-object values are coerced to objects. See the
  111015. * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
  111016. * for more details.
  111017. *
  111018. * @static
  111019. * @since 0.1.0
  111020. * @memberOf _
  111021. * @category Object
  111022. * @param {Object} object The object to query.
  111023. * @returns {Array} Returns the array of property names.
  111024. * @example
  111025. *
  111026. * function Foo() {
  111027. * this.a = 1;
  111028. * this.b = 2;
  111029. * }
  111030. *
  111031. * Foo.prototype.c = 3;
  111032. *
  111033. * _.keys(new Foo);
  111034. * // => ['a', 'b'] (iteration order is not guaranteed)
  111035. *
  111036. * _.keys('hi');
  111037. * // => ['0', '1']
  111038. */
  111039. function keys(object) {
  111040. var isProto = isPrototype(object);
  111041. if (!(isProto || isArrayLike(object))) {
  111042. return baseKeys(object);
  111043. }
  111044. var indexes = indexKeys(object),
  111045. skipIndexes = !!indexes,
  111046. result = indexes || [],
  111047. length = result.length;
  111048. for (var key in object) {
  111049. if (baseHas(object, key) &&
  111050. !(skipIndexes && (key == 'length' || isIndex(key, length))) &&
  111051. !(isProto && key == 'constructor')) {
  111052. result.push(key);
  111053. }
  111054. }
  111055. return result;
  111056. }
  111057. /**
  111058. * Creates a function that returns `value`.
  111059. *
  111060. * @static
  111061. * @memberOf _
  111062. * @since 2.4.0
  111063. * @category Util
  111064. * @param {*} value The value to return from the new function.
  111065. * @returns {Function} Returns the new constant function.
  111066. * @example
  111067. *
  111068. * var object = { 'user': 'fred' };
  111069. * var getter = _.constant(object);
  111070. *
  111071. * getter() === object;
  111072. * // => true
  111073. */
  111074. function constant(value) {
  111075. return function() {
  111076. return value;
  111077. };
  111078. }
  111079. module.exports = baseClone;
  111080. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(115)(module)))
  111081. /***/ }),
  111082. /* 820 */
  111083. /***/ (function(module, exports, __webpack_require__) {
  111084. /**
  111085. * lodash 4.3.2 (Custom Build) <https://lodash.com/>
  111086. * Build: `lodash modularize exports="npm" -o ./`
  111087. * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
  111088. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  111089. * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  111090. * Available under MIT license <https://lodash.com/license>
  111091. */
  111092. var baseClone = __webpack_require__(819);
  111093. /**
  111094. * Creates a shallow clone of `value`.
  111095. *
  111096. * **Note:** This method is loosely based on the
  111097. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  111098. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  111099. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  111100. * arrays. The own enumerable properties of `arguments` objects are cloned
  111101. * as plain objects. An empty object is returned for uncloneable values such
  111102. * as error objects, functions, DOM nodes, and WeakMaps.
  111103. *
  111104. * @static
  111105. * @memberOf _
  111106. * @category Lang
  111107. * @param {*} value The value to clone.
  111108. * @returns {*} Returns the cloned value.
  111109. * @example
  111110. *
  111111. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  111112. *
  111113. * var shallow = _.clone(objects);
  111114. * console.log(shallow[0] === objects[0]);
  111115. * // => true
  111116. */
  111117. function clone(value) {
  111118. return baseClone(value, false, true);
  111119. }
  111120. module.exports = clone;
  111121. /***/ }),
  111122. /* 821 */
  111123. /***/ (function(module, exports) {
  111124. /**
  111125. * lodash (Custom Build) <https://lodash.com/>
  111126. * Build: `lodash modularize exports="npm" -o ./`
  111127. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  111128. * Released under MIT license <https://lodash.com/license>
  111129. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  111130. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  111131. */
  111132. /** Used as references for various `Number` constants. */
  111133. var MAX_SAFE_INTEGER = 9007199254740991;
  111134. /** `Object#toString` result references. */
  111135. var argsTag = '[object Arguments]',
  111136. funcTag = '[object Function]',
  111137. genTag = '[object GeneratorFunction]',
  111138. mapTag = '[object Map]',
  111139. objectTag = '[object Object]',
  111140. promiseTag = '[object Promise]',
  111141. setTag = '[object Set]',
  111142. stringTag = '[object String]',
  111143. weakMapTag = '[object WeakMap]';
  111144. var dataViewTag = '[object DataView]';
  111145. /**
  111146. * Used to match `RegExp`
  111147. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  111148. */
  111149. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  111150. /** Used to detect host constructors (Safari). */
  111151. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  111152. /** Used to detect unsigned integer values. */
  111153. var reIsUint = /^(?:0|[1-9]\d*)$/;
  111154. /** Used to compose unicode character classes. */
  111155. var rsAstralRange = '\\ud800-\\udfff',
  111156. rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
  111157. rsComboSymbolsRange = '\\u20d0-\\u20f0',
  111158. rsVarRange = '\\ufe0e\\ufe0f';
  111159. /** Used to compose unicode capture groups. */
  111160. var rsAstral = '[' + rsAstralRange + ']',
  111161. rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
  111162. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  111163. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  111164. rsNonAstral = '[^' + rsAstralRange + ']',
  111165. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  111166. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  111167. rsZWJ = '\\u200d';
  111168. /** Used to compose unicode regexes. */
  111169. var reOptMod = rsModifier + '?',
  111170. rsOptVar = '[' + rsVarRange + ']?',
  111171. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  111172. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  111173. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  111174. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  111175. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  111176. /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  111177. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
  111178. /** Detect free variable `global` from Node.js. */
  111179. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  111180. /** Detect free variable `self`. */
  111181. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  111182. /** Used as a reference to the global object. */
  111183. var root = freeGlobal || freeSelf || Function('return this')();
  111184. /**
  111185. * A specialized version of `_.map` for arrays without support for iteratee
  111186. * shorthands.
  111187. *
  111188. * @private
  111189. * @param {Array} [array] The array to iterate over.
  111190. * @param {Function} iteratee The function invoked per iteration.
  111191. * @returns {Array} Returns the new mapped array.
  111192. */
  111193. function arrayMap(array, iteratee) {
  111194. var index = -1,
  111195. length = array ? array.length : 0,
  111196. result = Array(length);
  111197. while (++index < length) {
  111198. result[index] = iteratee(array[index], index, array);
  111199. }
  111200. return result;
  111201. }
  111202. /**
  111203. * Converts an ASCII `string` to an array.
  111204. *
  111205. * @private
  111206. * @param {string} string The string to convert.
  111207. * @returns {Array} Returns the converted array.
  111208. */
  111209. function asciiToArray(string) {
  111210. return string.split('');
  111211. }
  111212. /**
  111213. * The base implementation of `_.times` without support for iteratee shorthands
  111214. * or max array length checks.
  111215. *
  111216. * @private
  111217. * @param {number} n The number of times to invoke `iteratee`.
  111218. * @param {Function} iteratee The function invoked per iteration.
  111219. * @returns {Array} Returns the array of results.
  111220. */
  111221. function baseTimes(n, iteratee) {
  111222. var index = -1,
  111223. result = Array(n);
  111224. while (++index < n) {
  111225. result[index] = iteratee(index);
  111226. }
  111227. return result;
  111228. }
  111229. /**
  111230. * The base implementation of `_.values` and `_.valuesIn` which creates an
  111231. * array of `object` property values corresponding to the property names
  111232. * of `props`.
  111233. *
  111234. * @private
  111235. * @param {Object} object The object to query.
  111236. * @param {Array} props The property names to get values for.
  111237. * @returns {Object} Returns the array of property values.
  111238. */
  111239. function baseValues(object, props) {
  111240. return arrayMap(props, function(key) {
  111241. return object[key];
  111242. });
  111243. }
  111244. /**
  111245. * Gets the value at `key` of `object`.
  111246. *
  111247. * @private
  111248. * @param {Object} [object] The object to query.
  111249. * @param {string} key The key of the property to get.
  111250. * @returns {*} Returns the property value.
  111251. */
  111252. function getValue(object, key) {
  111253. return object == null ? undefined : object[key];
  111254. }
  111255. /**
  111256. * Checks if `string` contains Unicode symbols.
  111257. *
  111258. * @private
  111259. * @param {string} string The string to inspect.
  111260. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  111261. */
  111262. function hasUnicode(string) {
  111263. return reHasUnicode.test(string);
  111264. }
  111265. /**
  111266. * Checks if `value` is a host object in IE < 9.
  111267. *
  111268. * @private
  111269. * @param {*} value The value to check.
  111270. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  111271. */
  111272. function isHostObject(value) {
  111273. // Many host objects are `Object` objects that can coerce to strings
  111274. // despite having improperly defined `toString` methods.
  111275. var result = false;
  111276. if (value != null && typeof value.toString != 'function') {
  111277. try {
  111278. result = !!(value + '');
  111279. } catch (e) {}
  111280. }
  111281. return result;
  111282. }
  111283. /**
  111284. * Converts `iterator` to an array.
  111285. *
  111286. * @private
  111287. * @param {Object} iterator The iterator to convert.
  111288. * @returns {Array} Returns the converted array.
  111289. */
  111290. function iteratorToArray(iterator) {
  111291. var data,
  111292. result = [];
  111293. while (!(data = iterator.next()).done) {
  111294. result.push(data.value);
  111295. }
  111296. return result;
  111297. }
  111298. /**
  111299. * Converts `map` to its key-value pairs.
  111300. *
  111301. * @private
  111302. * @param {Object} map The map to convert.
  111303. * @returns {Array} Returns the key-value pairs.
  111304. */
  111305. function mapToArray(map) {
  111306. var index = -1,
  111307. result = Array(map.size);
  111308. map.forEach(function(value, key) {
  111309. result[++index] = [key, value];
  111310. });
  111311. return result;
  111312. }
  111313. /**
  111314. * Creates a unary function that invokes `func` with its argument transformed.
  111315. *
  111316. * @private
  111317. * @param {Function} func The function to wrap.
  111318. * @param {Function} transform The argument transform.
  111319. * @returns {Function} Returns the new function.
  111320. */
  111321. function overArg(func, transform) {
  111322. return function(arg) {
  111323. return func(transform(arg));
  111324. };
  111325. }
  111326. /**
  111327. * Converts `set` to an array of its values.
  111328. *
  111329. * @private
  111330. * @param {Object} set The set to convert.
  111331. * @returns {Array} Returns the values.
  111332. */
  111333. function setToArray(set) {
  111334. var index = -1,
  111335. result = Array(set.size);
  111336. set.forEach(function(value) {
  111337. result[++index] = value;
  111338. });
  111339. return result;
  111340. }
  111341. /**
  111342. * Converts `string` to an array.
  111343. *
  111344. * @private
  111345. * @param {string} string The string to convert.
  111346. * @returns {Array} Returns the converted array.
  111347. */
  111348. function stringToArray(string) {
  111349. return hasUnicode(string)
  111350. ? unicodeToArray(string)
  111351. : asciiToArray(string);
  111352. }
  111353. /**
  111354. * Converts a Unicode `string` to an array.
  111355. *
  111356. * @private
  111357. * @param {string} string The string to convert.
  111358. * @returns {Array} Returns the converted array.
  111359. */
  111360. function unicodeToArray(string) {
  111361. return string.match(reUnicode) || [];
  111362. }
  111363. /** Used for built-in method references. */
  111364. var funcProto = Function.prototype,
  111365. objectProto = Object.prototype;
  111366. /** Used to detect overreaching core-js shims. */
  111367. var coreJsData = root['__core-js_shared__'];
  111368. /** Used to detect methods masquerading as native. */
  111369. var maskSrcKey = (function() {
  111370. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  111371. return uid ? ('Symbol(src)_1.' + uid) : '';
  111372. }());
  111373. /** Used to resolve the decompiled source of functions. */
  111374. var funcToString = funcProto.toString;
  111375. /** Used to check objects for own properties. */
  111376. var hasOwnProperty = objectProto.hasOwnProperty;
  111377. /**
  111378. * Used to resolve the
  111379. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  111380. * of values.
  111381. */
  111382. var objectToString = objectProto.toString;
  111383. /** Used to detect if a method is native. */
  111384. var reIsNative = RegExp('^' +
  111385. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  111386. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  111387. );
  111388. /** Built-in value references. */
  111389. var Symbol = root.Symbol,
  111390. iteratorSymbol = Symbol ? Symbol.iterator : undefined,
  111391. propertyIsEnumerable = objectProto.propertyIsEnumerable;
  111392. /* Built-in method references for those with the same name as other `lodash` methods. */
  111393. var nativeKeys = overArg(Object.keys, Object);
  111394. /* Built-in method references that are verified to be native. */
  111395. var DataView = getNative(root, 'DataView'),
  111396. Map = getNative(root, 'Map'),
  111397. Promise = getNative(root, 'Promise'),
  111398. Set = getNative(root, 'Set'),
  111399. WeakMap = getNative(root, 'WeakMap');
  111400. /** Used to detect maps, sets, and weakmaps. */
  111401. var dataViewCtorString = toSource(DataView),
  111402. mapCtorString = toSource(Map),
  111403. promiseCtorString = toSource(Promise),
  111404. setCtorString = toSource(Set),
  111405. weakMapCtorString = toSource(WeakMap);
  111406. /**
  111407. * Creates an array of the enumerable property names of the array-like `value`.
  111408. *
  111409. * @private
  111410. * @param {*} value The value to query.
  111411. * @param {boolean} inherited Specify returning inherited property names.
  111412. * @returns {Array} Returns the array of property names.
  111413. */
  111414. function arrayLikeKeys(value, inherited) {
  111415. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  111416. // Safari 9 makes `arguments.length` enumerable in strict mode.
  111417. var result = (isArray(value) || isArguments(value))
  111418. ? baseTimes(value.length, String)
  111419. : [];
  111420. var length = result.length,
  111421. skipIndexes = !!length;
  111422. for (var key in value) {
  111423. if ((inherited || hasOwnProperty.call(value, key)) &&
  111424. !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  111425. result.push(key);
  111426. }
  111427. }
  111428. return result;
  111429. }
  111430. /**
  111431. * The base implementation of `getTag`.
  111432. *
  111433. * @private
  111434. * @param {*} value The value to query.
  111435. * @returns {string} Returns the `toStringTag`.
  111436. */
  111437. function baseGetTag(value) {
  111438. return objectToString.call(value);
  111439. }
  111440. /**
  111441. * The base implementation of `_.isNative` without bad shim checks.
  111442. *
  111443. * @private
  111444. * @param {*} value The value to check.
  111445. * @returns {boolean} Returns `true` if `value` is a native function,
  111446. * else `false`.
  111447. */
  111448. function baseIsNative(value) {
  111449. if (!isObject(value) || isMasked(value)) {
  111450. return false;
  111451. }
  111452. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  111453. return pattern.test(toSource(value));
  111454. }
  111455. /**
  111456. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  111457. *
  111458. * @private
  111459. * @param {Object} object The object to query.
  111460. * @returns {Array} Returns the array of property names.
  111461. */
  111462. function baseKeys(object) {
  111463. if (!isPrototype(object)) {
  111464. return nativeKeys(object);
  111465. }
  111466. var result = [];
  111467. for (var key in Object(object)) {
  111468. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  111469. result.push(key);
  111470. }
  111471. }
  111472. return result;
  111473. }
  111474. /**
  111475. * Copies the values of `source` to `array`.
  111476. *
  111477. * @private
  111478. * @param {Array} source The array to copy values from.
  111479. * @param {Array} [array=[]] The array to copy values to.
  111480. * @returns {Array} Returns `array`.
  111481. */
  111482. function copyArray(source, array) {
  111483. var index = -1,
  111484. length = source.length;
  111485. array || (array = Array(length));
  111486. while (++index < length) {
  111487. array[index] = source[index];
  111488. }
  111489. return array;
  111490. }
  111491. /**
  111492. * Gets the native function at `key` of `object`.
  111493. *
  111494. * @private
  111495. * @param {Object} object The object to query.
  111496. * @param {string} key The key of the method to get.
  111497. * @returns {*} Returns the function if it's native, else `undefined`.
  111498. */
  111499. function getNative(object, key) {
  111500. var value = getValue(object, key);
  111501. return baseIsNative(value) ? value : undefined;
  111502. }
  111503. /**
  111504. * Gets the `toStringTag` of `value`.
  111505. *
  111506. * @private
  111507. * @param {*} value The value to query.
  111508. * @returns {string} Returns the `toStringTag`.
  111509. */
  111510. var getTag = baseGetTag;
  111511. // Fallback for data views, maps, sets, and weak maps in IE 11,
  111512. // for data views in Edge < 14, and promises in Node.js.
  111513. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  111514. (Map && getTag(new Map) != mapTag) ||
  111515. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  111516. (Set && getTag(new Set) != setTag) ||
  111517. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  111518. getTag = function(value) {
  111519. var result = objectToString.call(value),
  111520. Ctor = result == objectTag ? value.constructor : undefined,
  111521. ctorString = Ctor ? toSource(Ctor) : undefined;
  111522. if (ctorString) {
  111523. switch (ctorString) {
  111524. case dataViewCtorString: return dataViewTag;
  111525. case mapCtorString: return mapTag;
  111526. case promiseCtorString: return promiseTag;
  111527. case setCtorString: return setTag;
  111528. case weakMapCtorString: return weakMapTag;
  111529. }
  111530. }
  111531. return result;
  111532. };
  111533. }
  111534. /**
  111535. * Checks if `value` is a valid array-like index.
  111536. *
  111537. * @private
  111538. * @param {*} value The value to check.
  111539. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  111540. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  111541. */
  111542. function isIndex(value, length) {
  111543. length = length == null ? MAX_SAFE_INTEGER : length;
  111544. return !!length &&
  111545. (typeof value == 'number' || reIsUint.test(value)) &&
  111546. (value > -1 && value % 1 == 0 && value < length);
  111547. }
  111548. /**
  111549. * Checks if `func` has its source masked.
  111550. *
  111551. * @private
  111552. * @param {Function} func The function to check.
  111553. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  111554. */
  111555. function isMasked(func) {
  111556. return !!maskSrcKey && (maskSrcKey in func);
  111557. }
  111558. /**
  111559. * Checks if `value` is likely a prototype object.
  111560. *
  111561. * @private
  111562. * @param {*} value The value to check.
  111563. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  111564. */
  111565. function isPrototype(value) {
  111566. var Ctor = value && value.constructor,
  111567. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  111568. return value === proto;
  111569. }
  111570. /**
  111571. * Converts `func` to its source code.
  111572. *
  111573. * @private
  111574. * @param {Function} func The function to process.
  111575. * @returns {string} Returns the source code.
  111576. */
  111577. function toSource(func) {
  111578. if (func != null) {
  111579. try {
  111580. return funcToString.call(func);
  111581. } catch (e) {}
  111582. try {
  111583. return (func + '');
  111584. } catch (e) {}
  111585. }
  111586. return '';
  111587. }
  111588. /**
  111589. * Checks if `value` is likely an `arguments` object.
  111590. *
  111591. * @static
  111592. * @memberOf _
  111593. * @since 0.1.0
  111594. * @category Lang
  111595. * @param {*} value The value to check.
  111596. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  111597. * else `false`.
  111598. * @example
  111599. *
  111600. * _.isArguments(function() { return arguments; }());
  111601. * // => true
  111602. *
  111603. * _.isArguments([1, 2, 3]);
  111604. * // => false
  111605. */
  111606. function isArguments(value) {
  111607. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  111608. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
  111609. (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  111610. }
  111611. /**
  111612. * Checks if `value` is classified as an `Array` object.
  111613. *
  111614. * @static
  111615. * @memberOf _
  111616. * @since 0.1.0
  111617. * @category Lang
  111618. * @param {*} value The value to check.
  111619. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  111620. * @example
  111621. *
  111622. * _.isArray([1, 2, 3]);
  111623. * // => true
  111624. *
  111625. * _.isArray(document.body.children);
  111626. * // => false
  111627. *
  111628. * _.isArray('abc');
  111629. * // => false
  111630. *
  111631. * _.isArray(_.noop);
  111632. * // => false
  111633. */
  111634. var isArray = Array.isArray;
  111635. /**
  111636. * Checks if `value` is array-like. A value is considered array-like if it's
  111637. * not a function and has a `value.length` that's an integer greater than or
  111638. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  111639. *
  111640. * @static
  111641. * @memberOf _
  111642. * @since 4.0.0
  111643. * @category Lang
  111644. * @param {*} value The value to check.
  111645. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  111646. * @example
  111647. *
  111648. * _.isArrayLike([1, 2, 3]);
  111649. * // => true
  111650. *
  111651. * _.isArrayLike(document.body.children);
  111652. * // => true
  111653. *
  111654. * _.isArrayLike('abc');
  111655. * // => true
  111656. *
  111657. * _.isArrayLike(_.noop);
  111658. * // => false
  111659. */
  111660. function isArrayLike(value) {
  111661. return value != null && isLength(value.length) && !isFunction(value);
  111662. }
  111663. /**
  111664. * This method is like `_.isArrayLike` except that it also checks if `value`
  111665. * is an object.
  111666. *
  111667. * @static
  111668. * @memberOf _
  111669. * @since 4.0.0
  111670. * @category Lang
  111671. * @param {*} value The value to check.
  111672. * @returns {boolean} Returns `true` if `value` is an array-like object,
  111673. * else `false`.
  111674. * @example
  111675. *
  111676. * _.isArrayLikeObject([1, 2, 3]);
  111677. * // => true
  111678. *
  111679. * _.isArrayLikeObject(document.body.children);
  111680. * // => true
  111681. *
  111682. * _.isArrayLikeObject('abc');
  111683. * // => false
  111684. *
  111685. * _.isArrayLikeObject(_.noop);
  111686. * // => false
  111687. */
  111688. function isArrayLikeObject(value) {
  111689. return isObjectLike(value) && isArrayLike(value);
  111690. }
  111691. /**
  111692. * Checks if `value` is classified as a `Function` object.
  111693. *
  111694. * @static
  111695. * @memberOf _
  111696. * @since 0.1.0
  111697. * @category Lang
  111698. * @param {*} value The value to check.
  111699. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  111700. * @example
  111701. *
  111702. * _.isFunction(_);
  111703. * // => true
  111704. *
  111705. * _.isFunction(/abc/);
  111706. * // => false
  111707. */
  111708. function isFunction(value) {
  111709. // The use of `Object#toString` avoids issues with the `typeof` operator
  111710. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  111711. var tag = isObject(value) ? objectToString.call(value) : '';
  111712. return tag == funcTag || tag == genTag;
  111713. }
  111714. /**
  111715. * Checks if `value` is a valid array-like length.
  111716. *
  111717. * **Note:** This method is loosely based on
  111718. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  111719. *
  111720. * @static
  111721. * @memberOf _
  111722. * @since 4.0.0
  111723. * @category Lang
  111724. * @param {*} value The value to check.
  111725. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  111726. * @example
  111727. *
  111728. * _.isLength(3);
  111729. * // => true
  111730. *
  111731. * _.isLength(Number.MIN_VALUE);
  111732. * // => false
  111733. *
  111734. * _.isLength(Infinity);
  111735. * // => false
  111736. *
  111737. * _.isLength('3');
  111738. * // => false
  111739. */
  111740. function isLength(value) {
  111741. return typeof value == 'number' &&
  111742. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  111743. }
  111744. /**
  111745. * Checks if `value` is the
  111746. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  111747. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  111748. *
  111749. * @static
  111750. * @memberOf _
  111751. * @since 0.1.0
  111752. * @category Lang
  111753. * @param {*} value The value to check.
  111754. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  111755. * @example
  111756. *
  111757. * _.isObject({});
  111758. * // => true
  111759. *
  111760. * _.isObject([1, 2, 3]);
  111761. * // => true
  111762. *
  111763. * _.isObject(_.noop);
  111764. * // => true
  111765. *
  111766. * _.isObject(null);
  111767. * // => false
  111768. */
  111769. function isObject(value) {
  111770. var type = typeof value;
  111771. return !!value && (type == 'object' || type == 'function');
  111772. }
  111773. /**
  111774. * Checks if `value` is object-like. A value is object-like if it's not `null`
  111775. * and has a `typeof` result of "object".
  111776. *
  111777. * @static
  111778. * @memberOf _
  111779. * @since 4.0.0
  111780. * @category Lang
  111781. * @param {*} value The value to check.
  111782. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  111783. * @example
  111784. *
  111785. * _.isObjectLike({});
  111786. * // => true
  111787. *
  111788. * _.isObjectLike([1, 2, 3]);
  111789. * // => true
  111790. *
  111791. * _.isObjectLike(_.noop);
  111792. * // => false
  111793. *
  111794. * _.isObjectLike(null);
  111795. * // => false
  111796. */
  111797. function isObjectLike(value) {
  111798. return !!value && typeof value == 'object';
  111799. }
  111800. /**
  111801. * Checks if `value` is classified as a `String` primitive or object.
  111802. *
  111803. * @static
  111804. * @since 0.1.0
  111805. * @memberOf _
  111806. * @category Lang
  111807. * @param {*} value The value to check.
  111808. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  111809. * @example
  111810. *
  111811. * _.isString('abc');
  111812. * // => true
  111813. *
  111814. * _.isString(1);
  111815. * // => false
  111816. */
  111817. function isString(value) {
  111818. return typeof value == 'string' ||
  111819. (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
  111820. }
  111821. /**
  111822. * Converts `value` to an array.
  111823. *
  111824. * @static
  111825. * @since 0.1.0
  111826. * @memberOf _
  111827. * @category Lang
  111828. * @param {*} value The value to convert.
  111829. * @returns {Array} Returns the converted array.
  111830. * @example
  111831. *
  111832. * _.toArray({ 'a': 1, 'b': 2 });
  111833. * // => [1, 2]
  111834. *
  111835. * _.toArray('abc');
  111836. * // => ['a', 'b', 'c']
  111837. *
  111838. * _.toArray(1);
  111839. * // => []
  111840. *
  111841. * _.toArray(null);
  111842. * // => []
  111843. */
  111844. function toArray(value) {
  111845. if (!value) {
  111846. return [];
  111847. }
  111848. if (isArrayLike(value)) {
  111849. return isString(value) ? stringToArray(value) : copyArray(value);
  111850. }
  111851. if (iteratorSymbol && value[iteratorSymbol]) {
  111852. return iteratorToArray(value[iteratorSymbol]());
  111853. }
  111854. var tag = getTag(value),
  111855. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  111856. return func(value);
  111857. }
  111858. /**
  111859. * Creates an array of the own enumerable property names of `object`.
  111860. *
  111861. * **Note:** Non-object values are coerced to objects. See the
  111862. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  111863. * for more details.
  111864. *
  111865. * @static
  111866. * @since 0.1.0
  111867. * @memberOf _
  111868. * @category Object
  111869. * @param {Object} object The object to query.
  111870. * @returns {Array} Returns the array of property names.
  111871. * @example
  111872. *
  111873. * function Foo() {
  111874. * this.a = 1;
  111875. * this.b = 2;
  111876. * }
  111877. *
  111878. * Foo.prototype.c = 3;
  111879. *
  111880. * _.keys(new Foo);
  111881. * // => ['a', 'b'] (iteration order is not guaranteed)
  111882. *
  111883. * _.keys('hi');
  111884. * // => ['0', '1']
  111885. */
  111886. function keys(object) {
  111887. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  111888. }
  111889. /**
  111890. * Creates an array of the own enumerable string keyed property values of `object`.
  111891. *
  111892. * **Note:** Non-object values are coerced to objects.
  111893. *
  111894. * @static
  111895. * @since 0.1.0
  111896. * @memberOf _
  111897. * @category Object
  111898. * @param {Object} object The object to query.
  111899. * @returns {Array} Returns the array of property values.
  111900. * @example
  111901. *
  111902. * function Foo() {
  111903. * this.a = 1;
  111904. * this.b = 2;
  111905. * }
  111906. *
  111907. * Foo.prototype.c = 3;
  111908. *
  111909. * _.values(new Foo);
  111910. * // => [1, 2] (iteration order is not guaranteed)
  111911. *
  111912. * _.values('hi');
  111913. * // => ['h', 'i']
  111914. */
  111915. function values(object) {
  111916. return object ? baseValues(object, keys(object)) : [];
  111917. }
  111918. module.exports = toArray;
  111919. /***/ }),
  111920. /* 822 */
  111921. /***/ (function(module, exports, __webpack_require__) {
  111922. var crypto = __webpack_require__(21)
  111923. var max = Math.pow(2, 32)
  111924. module.exports = random
  111925. module.exports.cryptographic = true
  111926. function random () {
  111927. var buf = crypto
  111928. .randomBytes(4)
  111929. .toString('hex')
  111930. return parseInt(buf, 16) / max
  111931. }
  111932. /***/ }),
  111933. /* 823 */
  111934. /***/ (function(module, exports, __webpack_require__) {
  111935. "use strict";
  111936. var chars = {}, unesc, temp;
  111937. function reverse(object, prepender) {
  111938. return Object.keys(object).reduce(function(reversed, key) {
  111939. var newKey = prepender ? prepender + key : key; // Optionally prepend a string to key.
  111940. reversed[object[key]] = newKey; // Swap key and value.
  111941. return reversed; // Return the result.
  111942. }, {});
  111943. }
  111944. /**
  111945. * Regex for common characters
  111946. */
  111947. chars.escapeRegex = {
  111948. '?': /\?/g,
  111949. '@': /\@/g,
  111950. '!': /\!/g,
  111951. '+': /\+/g,
  111952. '*': /\*/g,
  111953. '(': /\(/g,
  111954. ')': /\)/g,
  111955. '[': /\[/g,
  111956. ']': /\]/g
  111957. };
  111958. /**
  111959. * Escape characters
  111960. */
  111961. chars.ESC = {
  111962. '?': '__UNESC_QMRK__',
  111963. '@': '__UNESC_AMPE__',
  111964. '!': '__UNESC_EXCL__',
  111965. '+': '__UNESC_PLUS__',
  111966. '*': '__UNESC_STAR__',
  111967. ',': '__UNESC_COMMA__',
  111968. '(': '__UNESC_LTPAREN__',
  111969. ')': '__UNESC_RTPAREN__',
  111970. '[': '__UNESC_LTBRACK__',
  111971. ']': '__UNESC_RTBRACK__'
  111972. };
  111973. /**
  111974. * Unescape characters
  111975. */
  111976. chars.UNESC = unesc || (unesc = reverse(chars.ESC, '\\'));
  111977. chars.ESC_TEMP = {
  111978. '?': '__TEMP_QMRK__',
  111979. '@': '__TEMP_AMPE__',
  111980. '!': '__TEMP_EXCL__',
  111981. '*': '__TEMP_STAR__',
  111982. '+': '__TEMP_PLUS__',
  111983. ',': '__TEMP_COMMA__',
  111984. '(': '__TEMP_LTPAREN__',
  111985. ')': '__TEMP_RTPAREN__',
  111986. '[': '__TEMP_LTBRACK__',
  111987. ']': '__TEMP_RTBRACK__'
  111988. };
  111989. chars.TEMP = temp || (temp = reverse(chars.ESC_TEMP));
  111990. module.exports = chars;
  111991. /***/ }),
  111992. /* 824 */
  111993. /***/ (function(module, exports, __webpack_require__) {
  111994. "use strict";
  111995. /*!
  111996. * micromatch <https://github.com/jonschlinkert/micromatch>
  111997. *
  111998. * Copyright (c) 2014-2015, Jon Schlinkert.
  111999. * Licensed under the MIT License.
  112000. */
  112001. var utils = __webpack_require__(240);
  112002. var Glob = __webpack_require__(825);
  112003. /**
  112004. * Expose `expand`
  112005. */
  112006. module.exports = expand;
  112007. /**
  112008. * Expand a glob pattern to resolve braces and
  112009. * similar patterns before converting to regex.
  112010. *
  112011. * @param {String|Array} `pattern`
  112012. * @param {Array} `files`
  112013. * @param {Options} `opts`
  112014. * @return {Array}
  112015. */
  112016. function expand(pattern, options) {
  112017. if (typeof pattern !== 'string') {
  112018. throw new TypeError('micromatch.expand(): argument should be a string.');
  112019. }
  112020. var glob = new Glob(pattern, options || {});
  112021. var opts = glob.options;
  112022. if (!utils.isGlob(pattern)) {
  112023. glob.pattern = glob.pattern.replace(/([\/.])/g, '\\$1');
  112024. return glob;
  112025. }
  112026. glob.pattern = glob.pattern.replace(/(\+)(?!\()/g, '\\$1');
  112027. glob.pattern = glob.pattern.split('$').join('\\$');
  112028. if (typeof opts.braces !== 'boolean' && typeof opts.nobraces !== 'boolean') {
  112029. opts.braces = true;
  112030. }
  112031. if (glob.pattern === '.*') {
  112032. return {
  112033. pattern: '\\.' + star,
  112034. tokens: tok,
  112035. options: opts
  112036. };
  112037. }
  112038. if (glob.pattern === '*') {
  112039. return {
  112040. pattern: oneStar(opts.dot),
  112041. tokens: tok,
  112042. options: opts
  112043. };
  112044. }
  112045. // parse the glob pattern into tokens
  112046. glob.parse();
  112047. var tok = glob.tokens;
  112048. tok.is.negated = opts.negated;
  112049. // dotfile handling
  112050. if ((opts.dotfiles === true || tok.is.dotfile) && opts.dot !== false) {
  112051. opts.dotfiles = true;
  112052. opts.dot = true;
  112053. }
  112054. if ((opts.dotdirs === true || tok.is.dotdir) && opts.dot !== false) {
  112055. opts.dotdirs = true;
  112056. opts.dot = true;
  112057. }
  112058. // check for braces with a dotfile pattern
  112059. if (/[{,]\./.test(glob.pattern)) {
  112060. opts.makeRe = false;
  112061. opts.dot = true;
  112062. }
  112063. if (opts.nonegate !== true) {
  112064. opts.negated = glob.negated;
  112065. }
  112066. // if the leading character is a dot or a slash, escape it
  112067. if (glob.pattern.charAt(0) === '.' && glob.pattern.charAt(1) !== '/') {
  112068. glob.pattern = '\\' + glob.pattern;
  112069. }
  112070. /**
  112071. * Extended globs
  112072. */
  112073. // expand braces, e.g `{1..5}`
  112074. glob.track('before braces');
  112075. if (tok.is.braces) {
  112076. glob.braces();
  112077. }
  112078. glob.track('after braces');
  112079. // expand extglobs, e.g `foo/!(a|b)`
  112080. glob.track('before extglob');
  112081. if (tok.is.extglob) {
  112082. glob.extglob();
  112083. }
  112084. glob.track('after extglob');
  112085. // expand brackets, e.g `[[:alpha:]]`
  112086. glob.track('before brackets');
  112087. if (tok.is.brackets) {
  112088. glob.brackets();
  112089. }
  112090. glob.track('after brackets');
  112091. // special patterns
  112092. glob._replace('[!', '[^');
  112093. glob._replace('(?', '(%~');
  112094. glob._replace(/\[\]/, '\\[\\]');
  112095. glob._replace('/[', '/' + (opts.dot ? dotfiles : nodot) + '[', true);
  112096. glob._replace('/?', '/' + (opts.dot ? dotfiles : nodot) + '[^/]', true);
  112097. glob._replace('/.', '/(?=.)\\.', true);
  112098. // windows drives
  112099. glob._replace(/^(\w):([\\\/]+?)/gi, '(?=.)$1:$2', true);
  112100. // negate slashes in exclusion ranges
  112101. if (glob.pattern.indexOf('[^') !== -1) {
  112102. glob.pattern = negateSlash(glob.pattern);
  112103. }
  112104. if (opts.globstar !== false && glob.pattern === '**') {
  112105. glob.pattern = globstar(opts.dot);
  112106. } else {
  112107. glob.pattern = balance(glob.pattern, '[', ']');
  112108. glob.escape(glob.pattern);
  112109. // if the pattern has `**`
  112110. if (tok.is.globstar) {
  112111. glob.pattern = collapse(glob.pattern, '/**');
  112112. glob.pattern = collapse(glob.pattern, '**/');
  112113. glob._replace('/**/', '(?:/' + globstar(opts.dot) + '/|/)', true);
  112114. glob._replace(/\*{2,}/g, '**');
  112115. // 'foo/*'
  112116. glob._replace(/(\w+)\*(?!\/)/g, '$1[^/]*?', true);
  112117. glob._replace(/\*\*\/\*(\w)/g, globstar(opts.dot) + '\\/' + (opts.dot ? dotfiles : nodot) + '[^/]*?$1', true);
  112118. if (opts.dot !== true) {
  112119. glob._replace(/\*\*\/(.)/g, '(?:**\\/|)$1');
  112120. }
  112121. // 'foo/**' or '{**,*}', but not 'foo**'
  112122. if (tok.path.dirname !== '' || /,\*\*|\*\*,/.test(glob.orig)) {
  112123. glob._replace('**', globstar(opts.dot), true);
  112124. }
  112125. }
  112126. // ends with /*
  112127. glob._replace(/\/\*$/, '\\/' + oneStar(opts.dot), true);
  112128. // ends with *, no slashes
  112129. glob._replace(/(?!\/)\*$/, star, true);
  112130. // has 'n*.' (partial wildcard w/ file extension)
  112131. glob._replace(/([^\/]+)\*/, '$1' + oneStar(true), true);
  112132. // has '*'
  112133. glob._replace('*', oneStar(opts.dot), true);
  112134. glob._replace('?.', '?\\.', true);
  112135. glob._replace('?:', '?:', true);
  112136. glob._replace(/\?+/g, function(match) {
  112137. var len = match.length;
  112138. if (len === 1) {
  112139. return qmark;
  112140. }
  112141. return qmark + '{' + len + '}';
  112142. });
  112143. // escape '.abc' => '\\.abc'
  112144. glob._replace(/\.([*\w]+)/g, '\\.$1');
  112145. // fix '[^\\\\/]'
  112146. glob._replace(/\[\^[\\\/]+\]/g, qmark);
  112147. // '///' => '\/'
  112148. glob._replace(/\/+/g, '\\/');
  112149. // '\\\\\\' => '\\'
  112150. glob._replace(/\\{2,}/g, '\\');
  112151. }
  112152. // unescape previously escaped patterns
  112153. glob.unescape(glob.pattern);
  112154. glob._replace('__UNESC_STAR__', '*');
  112155. // escape dots that follow qmarks
  112156. glob._replace('?.', '?\\.');
  112157. // remove unnecessary slashes in character classes
  112158. glob._replace('[^\\/]', qmark);
  112159. if (glob.pattern.length > 1) {
  112160. if (/^[\[?*]/.test(glob.pattern)) {
  112161. // only prepend the string if we don't want to match dotfiles
  112162. glob.pattern = (opts.dot ? dotfiles : nodot) + glob.pattern;
  112163. }
  112164. }
  112165. return glob;
  112166. }
  112167. /**
  112168. * Collapse repeated character sequences.
  112169. *
  112170. * ```js
  112171. * collapse('a/../../../b', '../');
  112172. * //=> 'a/../b'
  112173. * ```
  112174. *
  112175. * @param {String} `str`
  112176. * @param {String} `ch` Character sequence to collapse
  112177. * @return {String}
  112178. */
  112179. function collapse(str, ch) {
  112180. var res = str.split(ch);
  112181. var isFirst = res[0] === '';
  112182. var isLast = res[res.length - 1] === '';
  112183. res = res.filter(Boolean);
  112184. if (isFirst) res.unshift('');
  112185. if (isLast) res.push('');
  112186. return res.join(ch);
  112187. }
  112188. /**
  112189. * Negate slashes in exclusion ranges, per glob spec:
  112190. *
  112191. * ```js
  112192. * negateSlash('[^foo]');
  112193. * //=> '[^\\/foo]'
  112194. * ```
  112195. *
  112196. * @param {String} `str` glob pattern
  112197. * @return {String}
  112198. */
  112199. function negateSlash(str) {
  112200. return str.replace(/\[\^([^\]]*?)\]/g, function(match, inner) {
  112201. if (inner.indexOf('/') === -1) {
  112202. inner = '\\/' + inner;
  112203. }
  112204. return '[^' + inner + ']';
  112205. });
  112206. }
  112207. /**
  112208. * Escape imbalanced braces/bracket. This is a very
  112209. * basic, naive implementation that only does enough
  112210. * to serve the purpose.
  112211. */
  112212. function balance(str, a, b) {
  112213. var aarr = str.split(a);
  112214. var alen = aarr.join('').length;
  112215. var blen = str.split(b).join('').length;
  112216. if (alen !== blen) {
  112217. str = aarr.join('\\' + a);
  112218. return str.split(b).join('\\' + b);
  112219. }
  112220. return str;
  112221. }
  112222. /**
  112223. * Special patterns to be converted to regex.
  112224. * Heuristics are used to simplify patterns
  112225. * and speed up processing.
  112226. */
  112227. /* eslint no-multi-spaces: 0 */
  112228. var qmark = '[^/]';
  112229. var star = qmark + '*?';
  112230. var nodot = '(?!\\.)(?=.)';
  112231. var dotfileGlob = '(?:\\/|^)\\.{1,2}($|\\/)';
  112232. var dotfiles = '(?!' + dotfileGlob + ')(?=.)';
  112233. var twoStarDot = '(?:(?!' + dotfileGlob + ').)*?';
  112234. /**
  112235. * Create a regex for `*`.
  112236. *
  112237. * If `dot` is true, or the pattern does not begin with
  112238. * a leading star, then return the simpler regex.
  112239. */
  112240. function oneStar(dotfile) {
  112241. return dotfile ? '(?!' + dotfileGlob + ')(?=.)' + star : (nodot + star);
  112242. }
  112243. function globstar(dotfile) {
  112244. if (dotfile) { return twoStarDot; }
  112245. return '(?:(?!(?:\\/|^)\\.).)*?';
  112246. }
  112247. /***/ }),
  112248. /* 825 */
  112249. /***/ (function(module, exports, __webpack_require__) {
  112250. "use strict";
  112251. var chars = __webpack_require__(823);
  112252. var utils = __webpack_require__(240);
  112253. /**
  112254. * Expose `Glob`
  112255. */
  112256. var Glob = module.exports = function Glob(pattern, options) {
  112257. if (!(this instanceof Glob)) {
  112258. return new Glob(pattern, options);
  112259. }
  112260. this.options = options || {};
  112261. this.pattern = pattern;
  112262. this.history = [];
  112263. this.tokens = {};
  112264. this.init(pattern);
  112265. };
  112266. /**
  112267. * Initialize defaults
  112268. */
  112269. Glob.prototype.init = function(pattern) {
  112270. this.orig = pattern;
  112271. this.negated = this.isNegated();
  112272. this.options.track = this.options.track || false;
  112273. this.options.makeRe = true;
  112274. };
  112275. /**
  112276. * Push a change into `glob.history`. Useful
  112277. * for debugging.
  112278. */
  112279. Glob.prototype.track = function(msg) {
  112280. if (this.options.track) {
  112281. this.history.push({msg: msg, pattern: this.pattern});
  112282. }
  112283. };
  112284. /**
  112285. * Return true if `glob.pattern` was negated
  112286. * with `!`, also remove the `!` from the pattern.
  112287. *
  112288. * @return {Boolean}
  112289. */
  112290. Glob.prototype.isNegated = function() {
  112291. if (this.pattern.charCodeAt(0) === 33 /* '!' */) {
  112292. this.pattern = this.pattern.slice(1);
  112293. return true;
  112294. }
  112295. return false;
  112296. };
  112297. /**
  112298. * Expand braces in the given glob pattern.
  112299. *
  112300. * We only need to use the [braces] lib when
  112301. * patterns are nested.
  112302. */
  112303. Glob.prototype.braces = function() {
  112304. if (this.options.nobraces !== true && this.options.nobrace !== true) {
  112305. // naive/fast check for imbalanced characters
  112306. var a = this.pattern.match(/[\{\(\[]/g);
  112307. var b = this.pattern.match(/[\}\)\]]/g);
  112308. // if imbalanced, don't optimize the pattern
  112309. if (a && b && (a.length !== b.length)) {
  112310. this.options.makeRe = false;
  112311. }
  112312. // expand brace patterns and join the resulting array
  112313. var expanded = utils.braces(this.pattern, this.options);
  112314. this.pattern = expanded.join('|');
  112315. }
  112316. };
  112317. /**
  112318. * Expand bracket expressions in `glob.pattern`
  112319. */
  112320. Glob.prototype.brackets = function() {
  112321. if (this.options.nobrackets !== true) {
  112322. this.pattern = utils.brackets(this.pattern);
  112323. }
  112324. };
  112325. /**
  112326. * Expand bracket expressions in `glob.pattern`
  112327. */
  112328. Glob.prototype.extglob = function() {
  112329. if (this.options.noextglob === true) return;
  112330. if (utils.isExtglob(this.pattern)) {
  112331. this.pattern = utils.extglob(this.pattern, {escape: true});
  112332. }
  112333. };
  112334. /**
  112335. * Parse the given pattern
  112336. */
  112337. Glob.prototype.parse = function(pattern) {
  112338. this.tokens = utils.parseGlob(pattern || this.pattern, true);
  112339. return this.tokens;
  112340. };
  112341. /**
  112342. * Replace `a` with `b`. Also tracks the change before and
  112343. * after each replacement. This is disabled by default, but
  112344. * can be enabled by setting `options.track` to true.
  112345. *
  112346. * Also, when the pattern is a string, `.split()` is used,
  112347. * because it's much faster than replace.
  112348. *
  112349. * @param {RegExp|String} `a`
  112350. * @param {String} `b`
  112351. * @param {Boolean} `escape` When `true`, escapes `*` and `?` in the replacement.
  112352. * @return {String}
  112353. */
  112354. Glob.prototype._replace = function(a, b, escape) {
  112355. this.track('before (find): "' + a + '" (replace with): "' + b + '"');
  112356. if (escape) b = esc(b);
  112357. if (a && b && typeof a === 'string') {
  112358. this.pattern = this.pattern.split(a).join(b);
  112359. } else {
  112360. this.pattern = this.pattern.replace(a, b);
  112361. }
  112362. this.track('after');
  112363. };
  112364. /**
  112365. * Escape special characters in the given string.
  112366. *
  112367. * @param {String} `str` Glob pattern
  112368. * @return {String}
  112369. */
  112370. Glob.prototype.escape = function(str) {
  112371. this.track('before escape: ');
  112372. var re = /["\\](['"]?[^"'\\]['"]?)/g;
  112373. this.pattern = str.replace(re, function($0, $1) {
  112374. var o = chars.ESC;
  112375. var ch = o && o[$1];
  112376. if (ch) {
  112377. return ch;
  112378. }
  112379. if (/[a-z]/i.test($0)) {
  112380. return $0.split('\\').join('');
  112381. }
  112382. return $0;
  112383. });
  112384. this.track('after escape: ');
  112385. };
  112386. /**
  112387. * Unescape special characters in the given string.
  112388. *
  112389. * @param {String} `str`
  112390. * @return {String}
  112391. */
  112392. Glob.prototype.unescape = function(str) {
  112393. var re = /__([A-Z]+)_([A-Z]+)__/g;
  112394. this.pattern = str.replace(re, function($0, $1) {
  112395. return chars[$1][$0];
  112396. });
  112397. this.pattern = unesc(this.pattern);
  112398. };
  112399. /**
  112400. * Escape/unescape utils
  112401. */
  112402. function esc(str) {
  112403. str = str.split('?').join('%~');
  112404. str = str.split('*').join('%%');
  112405. return str;
  112406. }
  112407. function unesc(str) {
  112408. str = str.split('%~').join('?');
  112409. str = str.split('%%').join('*');
  112410. return str;
  112411. }
  112412. /***/ }),
  112413. /* 826 */
  112414. /***/ (function(module, exports, __webpack_require__) {
  112415. "use strict";
  112416. /*!
  112417. * arr-diff <https://github.com/jonschlinkert/arr-diff>
  112418. *
  112419. * Copyright (c) 2014 Jon Schlinkert, contributors.
  112420. * Licensed under the MIT License
  112421. */
  112422. var flatten = __webpack_require__(451);
  112423. var slice = [].slice;
  112424. /**
  112425. * Return the difference between the first array and
  112426. * additional arrays.
  112427. *
  112428. * ```js
  112429. * var diff = require('{%= name %}');
  112430. *
  112431. * var a = ['a', 'b', 'c', 'd'];
  112432. * var b = ['b', 'c'];
  112433. *
  112434. * console.log(diff(a, b))
  112435. * //=> ['a', 'd']
  112436. * ```
  112437. *
  112438. * @param {Array} `a`
  112439. * @param {Array} `b`
  112440. * @return {Array}
  112441. * @api public
  112442. */
  112443. function diff(arr, arrays) {
  112444. var argsLen = arguments.length;
  112445. var len = arr.length, i = -1;
  112446. var res = [], arrays;
  112447. if (argsLen === 1) {
  112448. return arr;
  112449. }
  112450. if (argsLen > 2) {
  112451. arrays = flatten(slice.call(arguments, 1));
  112452. }
  112453. while (++i < len) {
  112454. if (!~arrays.indexOf(arr[i])) {
  112455. res.push(arr[i]);
  112456. }
  112457. }
  112458. return res;
  112459. }
  112460. /**
  112461. * Expose `diff`
  112462. */
  112463. module.exports = diff;
  112464. /***/ }),
  112465. /* 827 */
  112466. /***/ (function(module, exports, __webpack_require__) {
  112467. "use strict";
  112468. /*!
  112469. * array-unique <https://github.com/jonschlinkert/array-unique>
  112470. *
  112471. * Copyright (c) 2014-2015, Jon Schlinkert.
  112472. * Licensed under the MIT License.
  112473. */
  112474. module.exports = function unique(arr) {
  112475. if (!Array.isArray(arr)) {
  112476. throw new TypeError('array-unique expects an array.');
  112477. }
  112478. var len = arr.length;
  112479. var i = -1;
  112480. while (i++ < len) {
  112481. var j = i + 1;
  112482. for (; j < arr.length; ++j) {
  112483. if (arr[i] === arr[j]) {
  112484. arr.splice(j--, 1);
  112485. }
  112486. }
  112487. }
  112488. return arr;
  112489. };
  112490. /***/ }),
  112491. /* 828 */
  112492. /***/ (function(module, exports, __webpack_require__) {
  112493. "use strict";
  112494. /*!
  112495. * braces <https://github.com/jonschlinkert/braces>
  112496. *
  112497. * Copyright (c) 2014-2015, Jon Schlinkert.
  112498. * Licensed under the MIT license.
  112499. */
  112500. /**
  112501. * Module dependencies
  112502. */
  112503. var expand = __webpack_require__(664);
  112504. var repeat = __webpack_require__(381);
  112505. var tokens = __webpack_require__(850);
  112506. /**
  112507. * Expose `braces`
  112508. */
  112509. module.exports = function(str, options) {
  112510. if (typeof str !== 'string') {
  112511. throw new Error('braces expects a string');
  112512. }
  112513. return braces(str, options);
  112514. };
  112515. /**
  112516. * Expand `{foo,bar}` or `{1..5}` braces in the
  112517. * given `string`.
  112518. *
  112519. * @param {String} `str`
  112520. * @param {Array} `arr`
  112521. * @param {Object} `options`
  112522. * @return {Array}
  112523. */
  112524. function braces(str, arr, options) {
  112525. if (str === '') {
  112526. return [];
  112527. }
  112528. if (!Array.isArray(arr)) {
  112529. options = arr;
  112530. arr = [];
  112531. }
  112532. var opts = options || {};
  112533. arr = arr || [];
  112534. if (typeof opts.nodupes === 'undefined') {
  112535. opts.nodupes = true;
  112536. }
  112537. var fn = opts.fn;
  112538. var es6;
  112539. if (typeof opts === 'function') {
  112540. fn = opts;
  112541. opts = {};
  112542. }
  112543. if (!(patternRe instanceof RegExp)) {
  112544. patternRe = patternRegex();
  112545. }
  112546. var matches = str.match(patternRe) || [];
  112547. var m = matches[0];
  112548. switch(m) {
  112549. case '\\,':
  112550. return escapeCommas(str, arr, opts);
  112551. case '\\.':
  112552. return escapeDots(str, arr, opts);
  112553. case '\/.':
  112554. return escapePaths(str, arr, opts);
  112555. case ' ':
  112556. return splitWhitespace(str);
  112557. case '{,}':
  112558. return exponential(str, opts, braces);
  112559. case '{}':
  112560. return emptyBraces(str, arr, opts);
  112561. case '\\{':
  112562. case '\\}':
  112563. return escapeBraces(str, arr, opts);
  112564. case '${':
  112565. if (!/\{[^{]+\{/.test(str)) {
  112566. return arr.concat(str);
  112567. } else {
  112568. es6 = true;
  112569. str = tokens.before(str, es6Regex());
  112570. }
  112571. }
  112572. if (!(braceRe instanceof RegExp)) {
  112573. braceRe = braceRegex();
  112574. }
  112575. var match = braceRe.exec(str);
  112576. if (match == null) {
  112577. return [str];
  112578. }
  112579. var outter = match[1];
  112580. var inner = match[2];
  112581. if (inner === '') { return [str]; }
  112582. var segs, segsLength;
  112583. if (inner.indexOf('..') !== -1) {
  112584. segs = expand(inner, opts, fn) || inner.split(',');
  112585. segsLength = segs.length;
  112586. } else if (inner[0] === '"' || inner[0] === '\'') {
  112587. return arr.concat(str.split(/['"]/).join(''));
  112588. } else {
  112589. segs = inner.split(',');
  112590. if (opts.makeRe) {
  112591. return braces(str.replace(outter, wrap(segs, '|')), opts);
  112592. }
  112593. segsLength = segs.length;
  112594. if (segsLength === 1 && opts.bash) {
  112595. segs[0] = wrap(segs[0], '\\');
  112596. }
  112597. }
  112598. var len = segs.length;
  112599. var i = 0, val;
  112600. while (len--) {
  112601. var path = segs[i++];
  112602. if (/(\.[^.\/])/.test(path)) {
  112603. if (segsLength > 1) {
  112604. return segs;
  112605. } else {
  112606. return [str];
  112607. }
  112608. }
  112609. val = splice(str, outter, path);
  112610. if (/\{[^{}]+?\}/.test(val)) {
  112611. arr = braces(val, arr, opts);
  112612. } else if (val !== '') {
  112613. if (opts.nodupes && arr.indexOf(val) !== -1) { continue; }
  112614. arr.push(es6 ? tokens.after(val) : val);
  112615. }
  112616. }
  112617. if (opts.strict) { return filter(arr, filterEmpty); }
  112618. return arr;
  112619. }
  112620. /**
  112621. * Expand exponential ranges
  112622. *
  112623. * `a{,}{,}` => ['a', 'a', 'a', 'a']
  112624. */
  112625. function exponential(str, options, fn) {
  112626. if (typeof options === 'function') {
  112627. fn = options;
  112628. options = null;
  112629. }
  112630. var opts = options || {};
  112631. var esc = '__ESC_EXP__';
  112632. var exp = 0;
  112633. var res;
  112634. var parts = str.split('{,}');
  112635. if (opts.nodupes) {
  112636. return fn(parts.join(''), opts);
  112637. }
  112638. exp = parts.length - 1;
  112639. res = fn(parts.join(esc), opts);
  112640. var len = res.length;
  112641. var arr = [];
  112642. var i = 0;
  112643. while (len--) {
  112644. var ele = res[i++];
  112645. var idx = ele.indexOf(esc);
  112646. if (idx === -1) {
  112647. arr.push(ele);
  112648. } else {
  112649. ele = ele.split('__ESC_EXP__').join('');
  112650. if (!!ele && opts.nodupes !== false) {
  112651. arr.push(ele);
  112652. } else {
  112653. var num = Math.pow(2, exp);
  112654. arr.push.apply(arr, repeat(ele, num));
  112655. }
  112656. }
  112657. }
  112658. return arr;
  112659. }
  112660. /**
  112661. * Wrap a value with parens, brackets or braces,
  112662. * based on the given character/separator.
  112663. *
  112664. * @param {String|Array} `val`
  112665. * @param {String} `ch`
  112666. * @return {String}
  112667. */
  112668. function wrap(val, ch) {
  112669. if (ch === '|') {
  112670. return '(' + val.join(ch) + ')';
  112671. }
  112672. if (ch === ',') {
  112673. return '{' + val.join(ch) + '}';
  112674. }
  112675. if (ch === '-') {
  112676. return '[' + val.join(ch) + ']';
  112677. }
  112678. if (ch === '\\') {
  112679. return '\\{' + val + '\\}';
  112680. }
  112681. }
  112682. /**
  112683. * Handle empty braces: `{}`
  112684. */
  112685. function emptyBraces(str, arr, opts) {
  112686. return braces(str.split('{}').join('\\{\\}'), arr, opts);
  112687. }
  112688. /**
  112689. * Filter out empty-ish values
  112690. */
  112691. function filterEmpty(ele) {
  112692. return !!ele && ele !== '\\';
  112693. }
  112694. /**
  112695. * Handle patterns with whitespace
  112696. */
  112697. function splitWhitespace(str) {
  112698. var segs = str.split(' ');
  112699. var len = segs.length;
  112700. var res = [];
  112701. var i = 0;
  112702. while (len--) {
  112703. res.push.apply(res, braces(segs[i++]));
  112704. }
  112705. return res;
  112706. }
  112707. /**
  112708. * Handle escaped braces: `\\{foo,bar}`
  112709. */
  112710. function escapeBraces(str, arr, opts) {
  112711. if (!/\{[^{]+\{/.test(str)) {
  112712. return arr.concat(str.split('\\').join(''));
  112713. } else {
  112714. str = str.split('\\{').join('__LT_BRACE__');
  112715. str = str.split('\\}').join('__RT_BRACE__');
  112716. return map(braces(str, arr, opts), function(ele) {
  112717. ele = ele.split('__LT_BRACE__').join('{');
  112718. return ele.split('__RT_BRACE__').join('}');
  112719. });
  112720. }
  112721. }
  112722. /**
  112723. * Handle escaped dots: `{1\\.2}`
  112724. */
  112725. function escapeDots(str, arr, opts) {
  112726. if (!/[^\\]\..+\\\./.test(str)) {
  112727. return arr.concat(str.split('\\').join(''));
  112728. } else {
  112729. str = str.split('\\.').join('__ESC_DOT__');
  112730. return map(braces(str, arr, opts), function(ele) {
  112731. return ele.split('__ESC_DOT__').join('.');
  112732. });
  112733. }
  112734. }
  112735. /**
  112736. * Handle escaped dots: `{1\\.2}`
  112737. */
  112738. function escapePaths(str, arr, opts) {
  112739. str = str.split('\/.').join('__ESC_PATH__');
  112740. return map(braces(str, arr, opts), function(ele) {
  112741. return ele.split('__ESC_PATH__').join('\/.');
  112742. });
  112743. }
  112744. /**
  112745. * Handle escaped commas: `{a\\,b}`
  112746. */
  112747. function escapeCommas(str, arr, opts) {
  112748. if (!/\w,/.test(str)) {
  112749. return arr.concat(str.split('\\').join(''));
  112750. } else {
  112751. str = str.split('\\,').join('__ESC_COMMA__');
  112752. return map(braces(str, arr, opts), function(ele) {
  112753. return ele.split('__ESC_COMMA__').join(',');
  112754. });
  112755. }
  112756. }
  112757. /**
  112758. * Regex for common patterns
  112759. */
  112760. function patternRegex() {
  112761. return /\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\,(?=.*[{}])|\/\.(?=.*[{}])|\\\.(?={)|\\{|\\}/;
  112762. }
  112763. /**
  112764. * Braces regex.
  112765. */
  112766. function braceRegex() {
  112767. return /.*(\\?\{([^}]+)\})/;
  112768. }
  112769. /**
  112770. * es6 delimiter regex.
  112771. */
  112772. function es6Regex() {
  112773. return /\$\{([^}]+)\}/;
  112774. }
  112775. var braceRe;
  112776. var patternRe;
  112777. /**
  112778. * Faster alternative to `String.replace()` when the
  112779. * index of the token to be replaces can't be supplied
  112780. */
  112781. function splice(str, token, replacement) {
  112782. var i = str.indexOf(token);
  112783. return str.substr(0, i) + replacement
  112784. + str.substr(i + token.length);
  112785. }
  112786. /**
  112787. * Fast array map
  112788. */
  112789. function map(arr, fn) {
  112790. if (arr == null) {
  112791. return [];
  112792. }
  112793. var len = arr.length;
  112794. var res = new Array(len);
  112795. var i = -1;
  112796. while (++i < len) {
  112797. res[i] = fn(arr[i], i, arr);
  112798. }
  112799. return res;
  112800. }
  112801. /**
  112802. * Fast array filter
  112803. */
  112804. function filter(arr, cb) {
  112805. if (arr == null) return [];
  112806. if (typeof cb !== 'function') {
  112807. throw new TypeError('braces: filter expects a callback function.');
  112808. }
  112809. var len = arr.length;
  112810. var res = arr.slice();
  112811. var i = 0;
  112812. while (len--) {
  112813. if (!cb(arr[len], i++)) {
  112814. res.splice(len, 1);
  112815. }
  112816. }
  112817. return res;
  112818. }
  112819. /***/ }),
  112820. /* 829 */
  112821. /***/ (function(module, exports) {
  112822. module.exports = {"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/a2l":{"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/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"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},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"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","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/cbor":{"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},"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/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},"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/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":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["ecma","es"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true},"application/fhir+json":{"source":"iana","compressible":true},"application/fhir+xml":{"source":"iana","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mmt-usd+xml":{"source":"iana","compressible":true},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","compressible":true},"application/msc-mixer+xml":{"source":"iana","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana"},"application/n-triples":{"source":"iana"},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana"},"application/news-groupinfo":{"source":"iana"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana"},"application/nss":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p2p-overlay+xml":{"source":"iana","compressible":true},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana"},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","compressible":true},"application/pidf-diff+xml":{"source":"iana","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true},"application/route-s-tsid+xml":{"source":"iana","compressible":true},"application/route-usd+xml":{"source":"iana","compressible":true},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana"},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true},"application/tve-trigger":{"source":"iana"},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true},"application/urc-targetdesc+xml":{"source":"iana","compressible":true},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume-movie":{"source":"iana"},"application/vnd.desmume.movie":{"source":"apache"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana"},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos+xml":{"source":"iana","compressible":true},"application/vnd.paos.xml":{"source":"apache"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana"},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","compressible":true},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"apache","extensions":["der","crt","pem"]},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true},"application/xcap-caps+xml":{"source":"iana","compressible":true},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana"},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana"},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana"},"image/apng":{"compressible":false,"extensions":["apng"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana"},"image/emf":{"source":"iana"},"image/fits":{"source":"iana"},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana"},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana"},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana"},"image/tiff":{"source":"iana","compressible":false,"extensions":["tiff","tif"]},"image/tiff-fx":{"source":"iana"},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana"},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana"},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana"},"image/vnd.valve.source.texture":{"source":"iana"},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana"},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana"},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/stl":{"source":"iana"},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana"},"model/vnd.parasolid.transmit.binary":{"source":"iana"},"model/vnd.parasolid.transmit.text":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.usdz+zip":{"source":"iana","compressible":false},"model/vnd.valve.source.compiled-map":{"source":"iana"},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana"},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana"},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana","compressible":false},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shex":{"extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana"},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vp8":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}
  112823. /***/ }),
  112824. /* 830 */
  112825. /***/ (function(module, exports, __webpack_require__) {
  112826. /*!
  112827. * mime-db
  112828. * Copyright(c) 2014 Jonathan Ong
  112829. * MIT Licensed
  112830. */
  112831. /**
  112832. * Module exports.
  112833. */
  112834. module.exports = __webpack_require__(829)
  112835. /***/ }),
  112836. /* 831 */
  112837. /***/ (function(module, exports, __webpack_require__) {
  112838. "use strict";
  112839. module.exports = (to, from) => {
  112840. // TODO: use `Reflect.ownKeys()` when targeting Node.js 6
  112841. for (const prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from))) {
  112842. Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
  112843. }
  112844. return to;
  112845. };
  112846. /***/ }),
  112847. /* 832 */
  112848. /***/ (function(module, exports, __webpack_require__) {
  112849. "use strict";
  112850. const mkdirp = __webpack_require__(241)
  112851. module.exports = function (dir, opts) {
  112852. return new Promise((resolve, reject) => {
  112853. mkdirp(dir, opts, (err, made) => err === null ? resolve(made) : reject(err))
  112854. })
  112855. }
  112856. /***/ }),
  112857. /* 833 */
  112858. /***/ (function(module, exports) {
  112859. /**
  112860. * Helpers.
  112861. */
  112862. var s = 1000;
  112863. var m = s * 60;
  112864. var h = m * 60;
  112865. var d = h * 24;
  112866. var y = d * 365.25;
  112867. /**
  112868. * Parse or format the given `val`.
  112869. *
  112870. * Options:
  112871. *
  112872. * - `long` verbose formatting [false]
  112873. *
  112874. * @param {String|Number} val
  112875. * @param {Object} [options]
  112876. * @throws {Error} throw an error if val is not a non-empty string or a number
  112877. * @return {String|Number}
  112878. * @api public
  112879. */
  112880. module.exports = function(val, options) {
  112881. options = options || {};
  112882. var type = typeof val;
  112883. if (type === 'string' && val.length > 0) {
  112884. return parse(val);
  112885. } else if (type === 'number' && isNaN(val) === false) {
  112886. return options.long ? fmtLong(val) : fmtShort(val);
  112887. }
  112888. throw new Error(
  112889. 'val is not a non-empty string or a valid number. val=' +
  112890. JSON.stringify(val)
  112891. );
  112892. };
  112893. /**
  112894. * Parse the given `str` and return milliseconds.
  112895. *
  112896. * @param {String} str
  112897. * @return {Number}
  112898. * @api private
  112899. */
  112900. function parse(str) {
  112901. str = String(str);
  112902. if (str.length > 100) {
  112903. return;
  112904. }
  112905. var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
  112906. str
  112907. );
  112908. if (!match) {
  112909. return;
  112910. }
  112911. var n = parseFloat(match[1]);
  112912. var type = (match[2] || 'ms').toLowerCase();
  112913. switch (type) {
  112914. case 'years':
  112915. case 'year':
  112916. case 'yrs':
  112917. case 'yr':
  112918. case 'y':
  112919. return n * y;
  112920. case 'days':
  112921. case 'day':
  112922. case 'd':
  112923. return n * d;
  112924. case 'hours':
  112925. case 'hour':
  112926. case 'hrs':
  112927. case 'hr':
  112928. case 'h':
  112929. return n * h;
  112930. case 'minutes':
  112931. case 'minute':
  112932. case 'mins':
  112933. case 'min':
  112934. case 'm':
  112935. return n * m;
  112936. case 'seconds':
  112937. case 'second':
  112938. case 'secs':
  112939. case 'sec':
  112940. case 's':
  112941. return n * s;
  112942. case 'milliseconds':
  112943. case 'millisecond':
  112944. case 'msecs':
  112945. case 'msec':
  112946. case 'ms':
  112947. return n;
  112948. default:
  112949. return undefined;
  112950. }
  112951. }
  112952. /**
  112953. * Short format for `ms`.
  112954. *
  112955. * @param {Number} ms
  112956. * @return {String}
  112957. * @api private
  112958. */
  112959. function fmtShort(ms) {
  112960. if (ms >= d) {
  112961. return Math.round(ms / d) + 'd';
  112962. }
  112963. if (ms >= h) {
  112964. return Math.round(ms / h) + 'h';
  112965. }
  112966. if (ms >= m) {
  112967. return Math.round(ms / m) + 'm';
  112968. }
  112969. if (ms >= s) {
  112970. return Math.round(ms / s) + 's';
  112971. }
  112972. return ms + 'ms';
  112973. }
  112974. /**
  112975. * Long format for `ms`.
  112976. *
  112977. * @param {Number} ms
  112978. * @return {String}
  112979. * @api private
  112980. */
  112981. function fmtLong(ms) {
  112982. return plural(ms, d, 'day') ||
  112983. plural(ms, h, 'hour') ||
  112984. plural(ms, m, 'minute') ||
  112985. plural(ms, s, 'second') ||
  112986. ms + ' ms';
  112987. }
  112988. /**
  112989. * Pluralization helper.
  112990. */
  112991. function plural(ms, n, name) {
  112992. if (ms < n) {
  112993. return;
  112994. }
  112995. if (ms < n * 1.5) {
  112996. return Math.floor(ms / n) + ' ' + name;
  112997. }
  112998. return Math.ceil(ms / n) + ' ' + name + 's';
  112999. }
  113000. /***/ }),
  113001. /* 834 */
  113002. /***/ (function(module, exports, __webpack_require__) {
  113003. var Promise = __webpack_require__(278)
  113004. var fs
  113005. try {
  113006. fs = __webpack_require__(356)
  113007. } catch(err) {
  113008. fs = __webpack_require__(12)
  113009. }
  113010. var api = [
  113011. 'appendFile',
  113012. 'chmod',
  113013. 'chown',
  113014. 'close',
  113015. 'fchmod',
  113016. 'fchown',
  113017. 'fdatasync',
  113018. 'fstat',
  113019. 'fsync',
  113020. 'ftruncate',
  113021. 'futimes',
  113022. 'lchown',
  113023. 'link',
  113024. 'lstat',
  113025. 'mkdir',
  113026. 'open',
  113027. 'read',
  113028. 'readFile',
  113029. 'readdir',
  113030. 'readlink',
  113031. 'realpath',
  113032. 'rename',
  113033. 'rmdir',
  113034. 'stat',
  113035. 'symlink',
  113036. 'truncate',
  113037. 'unlink',
  113038. 'utimes',
  113039. 'write',
  113040. 'writeFile'
  113041. ]
  113042. typeof fs.access === 'function' && api.push('access')
  113043. typeof fs.copyFile === 'function' && api.push('copyFile')
  113044. typeof fs.mkdtemp === 'function' && api.push('mkdtemp')
  113045. __webpack_require__(1024).withCallback(fs, exports, api)
  113046. exports.exists = function (filename, callback) {
  113047. // callback
  113048. if (typeof callback === 'function') {
  113049. return fs.stat(filename, function (err) {
  113050. callback(null, !err);
  113051. })
  113052. }
  113053. // or promise
  113054. return new Promise(function (resolve) {
  113055. fs.stat(filename, function (err) {
  113056. resolve(!err)
  113057. })
  113058. })
  113059. }
  113060. /***/ }),
  113061. /* 835 */
  113062. /***/ (function(module, exports, __webpack_require__) {
  113063. /*jslint node: true*/
  113064. var toArray = __webpack_require__(821);
  113065. var emojiByName = __webpack_require__(836);
  113066. "use strict";
  113067. /**
  113068. * regex to parse emoji in a string - finds emoji, e.g. :coffee:
  113069. */
  113070. var emojiNameRegex = /:([a-zA-Z0-9_\-\+]+):/g;
  113071. /**
  113072. * regex to trim whitespace
  113073. * use instead of String.prototype.trim() for IE8 supprt
  113074. */
  113075. var trimSpaceRegex = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
  113076. /**
  113077. * Removes colons on either side
  113078. * of the string if present
  113079. * @param {string} str
  113080. * @return {string}
  113081. */
  113082. function stripColons (str) {
  113083. var colonIndex = str.indexOf(':');
  113084. if (colonIndex > -1) {
  113085. // :emoji: (http://www.emoji-cheat-sheet.com/)
  113086. if (colonIndex === str.length - 1) {
  113087. str = str.substring(0, colonIndex);
  113088. return stripColons(str);
  113089. } else {
  113090. str = str.substr(colonIndex + 1);
  113091. return stripColons(str);
  113092. }
  113093. }
  113094. return str;
  113095. }
  113096. /**
  113097. * Adds colons to either side
  113098. * of the string
  113099. * @param {string} str
  113100. * @return {string}
  113101. */
  113102. function wrapColons (str) {
  113103. return (typeof str === 'string' && str.length > 0) ? ':' + str + ':' : str;
  113104. }
  113105. /**
  113106. * Ensure that the word is wrapped in colons
  113107. * by only adding them, if they are not there.
  113108. * @param {string} str
  113109. * @return {string}
  113110. */
  113111. function ensureColons (str) {
  113112. return (typeof str === 'string' && str[0] !== ':') ? wrapColons(str) : str;
  113113. }
  113114. // Non spacing mark, some emoticons have them. It's the 'Variant Form',
  113115. // which provides more information so that emoticons can be rendered as
  113116. // more colorful graphics. FE0E is a unicode text version, where as FE0F
  113117. // should be rendered as a graphical version. The code gracefully degrades.
  113118. var NON_SPACING_MARK = String.fromCharCode(65039); // 65039 - '️' - 0xFE0F;
  113119. var nonSpacingRegex = new RegExp(NON_SPACING_MARK, 'g')
  113120. // Remove the non-spacing-mark from the code, never send a stripped version
  113121. // to the client, as it kills graphical emoticons.
  113122. function stripNSB (code) {
  113123. return code.replace(nonSpacingRegex, '');
  113124. };
  113125. // Reversed hash table, where as emojiByName contains a { heart: '❤' }
  113126. // dictionary emojiByCode contains { ❤: 'heart' }. The codes are normalized
  113127. // to the text version.
  113128. var emojiByCode = Object.keys(emojiByName).reduce(function(h,k) {
  113129. h[stripNSB(emojiByName[k])] = k;
  113130. return h;
  113131. }, {});
  113132. /**
  113133. * Emoji namespace
  113134. */
  113135. var Emoji = {
  113136. emoji: emojiByName,
  113137. };
  113138. /**
  113139. * get emoji code from name
  113140. * @param {string} emoji
  113141. * @return {string}
  113142. */
  113143. Emoji._get = function _get (emoji) {
  113144. if (emojiByName.hasOwnProperty(emoji)) {
  113145. return emojiByName[emoji];
  113146. }
  113147. return ensureColons(emoji);
  113148. };
  113149. /**
  113150. * get emoji code from :emoji: string or name
  113151. * @param {string} emoji
  113152. * @return {string}
  113153. */
  113154. Emoji.get = function get (emoji) {
  113155. emoji = stripColons(emoji);
  113156. return Emoji._get(emoji);
  113157. };
  113158. /**
  113159. * find the emoji by either code or name
  113160. * @param {string} nameOrCode The emoji to find, either `coffee`, `:coffee:` or `☕`;
  113161. * @return {object}
  113162. */
  113163. Emoji.find = function find (nameOrCode) {
  113164. return Emoji.findByName(nameOrCode) || Emoji.findByCode(nameOrCode);
  113165. };
  113166. /**
  113167. * find the emoji by name
  113168. * @param {string} name The emoji to find either `coffee` or `:coffee:`;
  113169. * @return {object}
  113170. */
  113171. Emoji.findByName = function findByName (name) {
  113172. var stripped = stripColons(name);
  113173. var emoji = emojiByName[stripped];
  113174. return emoji ? ({ emoji: emoji, key: stripped }) : undefined;
  113175. };
  113176. /**
  113177. * find the emoji by code (emoji)
  113178. * @param {string} code The emoji to find; for example `☕` or `☔`
  113179. * @return {object}
  113180. */
  113181. Emoji.findByCode = function findByCode (code) {
  113182. var stripped = stripNSB(code);
  113183. var name = emojiByCode[stripped];
  113184. // lookup emoji to ensure the Variant Form is returned
  113185. return name ? ({ emoji: emojiByName[name], key: name }) : undefined;
  113186. };
  113187. /**
  113188. * Check if an emoji is known by this library
  113189. * @param {string} nameOrCode The emoji to validate, either `coffee`, `:coffee:` or `☕`;
  113190. * @return {object}
  113191. */
  113192. Emoji.hasEmoji = function hasEmoji (nameOrCode) {
  113193. return Emoji.hasEmojiByName(nameOrCode) || Emoji.hasEmojiByCode(nameOrCode);
  113194. };
  113195. /**
  113196. * Check if an emoji with given name is known by this library
  113197. * @param {string} name The emoji to validate either `coffee` or `:coffee:`;
  113198. * @return {object}
  113199. */
  113200. Emoji.hasEmojiByName = function hasEmojiByName (name) {
  113201. var result = Emoji.findByName(name);
  113202. return !!result && result.key === stripColons(name);
  113203. };
  113204. /**
  113205. * Check if a given emoji is known by this library
  113206. * @param {string} code The emoji to validate; for example `☕` or `☔`
  113207. * @return {object}
  113208. */
  113209. Emoji.hasEmojiByCode = function hasEmojiByCode (code) {
  113210. var result = Emoji.findByCode(code);
  113211. return !!result && stripNSB(result.emoji) === stripNSB(code);
  113212. };
  113213. /**
  113214. * get emoji name from code
  113215. * @param {string} emoji
  113216. * @param {boolean} includeColons should the result include the ::
  113217. * @return {string}
  113218. */
  113219. Emoji.which = function which (emoji_code, includeColons) {
  113220. var code = stripNSB(emoji_code);
  113221. var word = emojiByCode[code];
  113222. return includeColons ? wrapColons(word) : word;
  113223. };
  113224. /**
  113225. * emojify a string (replace :emoji: with an emoji)
  113226. * @param {string} str
  113227. * @param {function} on_missing (gets emoji name without :: and returns a proper emoji if no emoji was found)
  113228. * @param {function} format (wrap the returned emoji in a custom element)
  113229. * @return {string}
  113230. */
  113231. Emoji.emojify = function emojify (str, on_missing, format) {
  113232. if (!str) return '';
  113233. return str.split(emojiNameRegex) // parse emoji via regex
  113234. .map(function parseEmoji(s, i) {
  113235. // every second element is an emoji, e.g. "test :fast_forward:" -> [ "test ", "fast_forward" ]
  113236. if (i % 2 === 0) return s;
  113237. var emoji = Emoji._get(s);
  113238. var isMissing = emoji.indexOf(':') > -1;
  113239. if (isMissing && typeof on_missing === 'function') {
  113240. return on_missing(s);
  113241. }
  113242. if (!isMissing && typeof format === 'function') {
  113243. return format(emoji, s);
  113244. }
  113245. return emoji;
  113246. })
  113247. .join('') // convert back to string
  113248. ;
  113249. };
  113250. /**
  113251. * return a random emoji
  113252. * @return {string}
  113253. */
  113254. Emoji.random = function random () {
  113255. var emojiKeys = Object.keys(emojiByName);
  113256. var randomIndex = Math.floor(Math.random() * emojiKeys.length);
  113257. var key = emojiKeys[randomIndex];
  113258. var emoji = Emoji._get(key);
  113259. return { key: key, emoji: emoji };
  113260. }
  113261. /**
  113262. * return an collection of potential emoji matches
  113263. * @param {string} str
  113264. * @return {Array.<Object>}
  113265. */
  113266. Emoji.search = function search (str) {
  113267. var emojiKeys = Object.keys(emojiByName);
  113268. var matcher = stripColons(str)
  113269. var matchingKeys = emojiKeys.filter(function(key) {
  113270. return key.toString().indexOf(matcher) === 0;
  113271. });
  113272. return matchingKeys.map(function(key) {
  113273. return {
  113274. key: key,
  113275. emoji: Emoji._get(key),
  113276. };
  113277. });
  113278. }
  113279. /**
  113280. * unemojify a string (replace emoji with :emoji:)
  113281. * @param {string} str
  113282. * @return {string}
  113283. */
  113284. Emoji.unemojify = function unemojify (str) {
  113285. if (!str) return '';
  113286. var words = toArray(str);
  113287. return words.map(function(word) {
  113288. return Emoji.which(word, true) || word;
  113289. }).join('');
  113290. };
  113291. /**
  113292. * replace emojis with replacement value
  113293. * @param {string} str
  113294. * @param {function|string} the string or callback function to replace the emoji with
  113295. * @param {boolean} should trailing whitespaces be cleaned? Defaults false
  113296. * @return {string}
  113297. */
  113298. Emoji.replace = function replace (str, replacement, cleanSpaces) {
  113299. if (!str) return '';
  113300. var replace = typeof replacement === 'function' ? replacement : function() { return replacement; };
  113301. var words = toArray(str);
  113302. var replaced = words.map(function(word, idx) {
  113303. var emoji = Emoji.findByCode(word);
  113304. if (emoji && cleanSpaces && words[idx + 1] === ' ') {
  113305. words[idx + 1] = '';
  113306. }
  113307. return emoji ? replace(emoji) : word;
  113308. }).join('');
  113309. return cleanSpaces ? replaced.replace(trimSpaceRegex, '') : replaced;
  113310. };
  113311. /**
  113312. * remove all emojis from a string
  113313. * @param {string} str
  113314. * @return {string}
  113315. */
  113316. Emoji.strip = function strip (str) {
  113317. return Emoji.replace(str, '', true);
  113318. };
  113319. module.exports = Emoji;
  113320. /***/ }),
  113321. /* 836 */
  113322. /***/ (function(module, exports) {
  113323. module.exports = {"100":"💯","1234":"🔢","interrobang":"⁉️","tm":"™️","information_source":"ℹ️","left_right_arrow":"↔️","arrow_up_down":"↕️","arrow_upper_left":"↖️","arrow_upper_right":"↗️","arrow_lower_right":"↘️","arrow_lower_left":"↙️","keyboard":"⌨","sunny":"☀️","cloud":"☁️","umbrella":"☔️","showman":"☃","comet":"☄","ballot_box_with_check":"☑️","coffee":"☕️","shamrock":"☘","skull_and_crossbones":"☠","radioactive_sign":"☢","biohazard_sign":"☣","orthodox_cross":"☦","wheel_of_dharma":"☸","white_frowning_face":"☹","aries":"♈️","taurus":"♉️","sagittarius":"♐️","capricorn":"♑️","aquarius":"♒️","pisces":"♓️","spades":"♠️","clubs":"♣️","hearts":"♥️","diamonds":"♦️","hotsprings":"♨️","hammer_and_pick":"⚒","anchor":"⚓️","crossed_swords":"⚔","scales":"⚖","alembic":"⚗","gear":"⚙","scissors":"✂️","white_check_mark":"✅","airplane":"✈️","email":"✉️","envelope":"✉️","black_nib":"✒️","heavy_check_mark":"✔️","heavy_multiplication_x":"✖️","star_of_david":"✡","sparkles":"✨","eight_spoked_asterisk":"✳️","eight_pointed_black_star":"✴️","snowflake":"❄️","sparkle":"❇️","question":"❓","grey_question":"❔","grey_exclamation":"❕","exclamation":"❗️","heavy_exclamation_mark":"❗️","heavy_heart_exclamation_mark_ornament":"❣","heart":"❤️","heavy_plus_sign":"➕","heavy_minus_sign":"➖","heavy_division_sign":"➗","arrow_heading_up":"⤴️","arrow_heading_down":"⤵️","wavy_dash":"〰️","congratulations":"㊗️","secret":"㊙️","copyright":"©️","registered":"®️","bangbang":"‼️","leftwards_arrow_with_hook":"↩️","arrow_right_hook":"↪️","watch":"⌚️","hourglass":"⌛️","fast_forward":"⏩","rewind":"⏪","arrow_double_up":"⏫","arrow_double_down":"⏬","black_right_pointing_double_triangle_with_vertical_bar":"⏭","black_left_pointing_double_triangle_with_vertical_bar":"⏮","black_right_pointing_triangle_with_double_vertical_bar":"⏯","alarm_clock":"⏰","stopwatch":"⏱","timer_clock":"⏲","hourglass_flowing_sand":"⏳","double_vertical_bar":"⏸","black_square_for_stop":"⏹","black_circle_for_record":"⏺","m":"Ⓜ️","black_small_square":"▪️","white_small_square":"▫️","arrow_forward":"▶️","arrow_backward":"◀️","white_medium_square":"◻️","black_medium_square":"◼️","white_medium_small_square":"◽️","black_medium_small_square":"◾️","phone":"☎️","telephone":"☎️","point_up":"☝️","star_and_crescent":"☪","peace_symbol":"☮","yin_yang":"☯","relaxed":"☺️","gemini":"♊️","cancer":"♋️","leo":"♌️","virgo":"♍️","libra":"♎️","scorpius":"♏️","recycle":"♻️","wheelchair":"♿️","atom_symbol":"⚛","fleur_de_lis":"⚜","warning":"⚠️","zap":"⚡️","white_circle":"⚪️","black_circle":"⚫️","coffin":"⚰","funeral_urn":"⚱","soccer":"⚽️","baseball":"⚾️","snowman":"⛄️","partly_sunny":"⛅️","thunder_cloud_and_rain":"⛈","ophiuchus":"⛎","pick":"⛏","helmet_with_white_cross":"⛑","chains":"⛓","no_entry":"⛔️","shinto_shrine":"⛩","church":"⛪️","mountain":"⛰","umbrella_on_ground":"⛱","fountain":"⛲️","golf":"⛳️","ferry":"⛴","boat":"⛵️","sailboat":"⛵️","skier":"⛷","ice_skate":"⛸","person_with_ball":"⛹","tent":"⛺️","fuelpump":"⛽️","fist":"✊","hand":"✋","raised_hand":"✋","v":"✌️","writing_hand":"✍","pencil2":"✏️","latin_cross":"✝","x":"❌","negative_squared_cross_mark":"❎","arrow_right":"➡️","curly_loop":"➰","loop":"➿","arrow_left":"⬅️","arrow_up":"⬆️","arrow_down":"⬇️","black_large_square":"⬛️","white_large_square":"⬜️","star":"⭐️","o":"⭕️","part_alternation_mark":"〽️","mahjong":"🀄️","black_joker":"🃏","a":"🅰️","b":"🅱️","o2":"🅾️","parking":"🅿️","ab":"🆎","cl":"🆑","cool":"🆒","free":"🆓","id":"🆔","new":"🆕","ng":"🆖","ok":"🆗","sos":"🆘","up":"🆙","vs":"🆚","koko":"🈁","sa":"🈂️","u7121":"🈚️","u6307":"🈯️","u7981":"🈲","u7a7a":"🈳","u5408":"🈴","u6e80":"🈵","u6709":"🈶","u6708":"🈷️","u7533":"🈸","u5272":"🈹","u55b6":"🈺","ideograph_advantage":"🉐","accept":"🉑","cyclone":"🌀","foggy":"🌁","closed_umbrella":"🌂","night_with_stars":"🌃","sunrise_over_mountains":"🌄","sunrise":"🌅","city_sunset":"🌆","city_sunrise":"🌇","rainbow":"🌈","bridge_at_night":"🌉","ocean":"🌊","volcano":"🌋","milky_way":"🌌","earth_africa":"🌍","earth_americas":"🌎","earth_asia":"🌏","globe_with_meridians":"🌐","new_moon":"🌑","waxing_crescent_moon":"🌒","first_quarter_moon":"🌓","moon":"🌔","waxing_gibbous_moon":"🌔","full_moon":"🌕","waning_gibbous_moon":"🌖","last_quarter_moon":"🌗","waning_crescent_moon":"🌘","crescent_moon":"🌙","new_moon_with_face":"🌚","first_quarter_moon_with_face":"🌛","last_quarter_moon_with_face":"🌜","full_moon_with_face":"🌝","sun_with_face":"🌞","star2":"🌟","stars":"🌠","thermometer":"🌡","mostly_sunny":"🌤","sun_small_cloud":"🌤","barely_sunny":"🌥","sun_behind_cloud":"🌥","partly_sunny_rain":"🌦","sun_behind_rain_cloud":"🌦","rain_cloud":"🌧","snow_cloud":"🌨","lightning":"🌩","lightning_cloud":"🌩","tornado":"🌪","tornado_cloud":"🌪","fog":"🌫","wind_blowing_face":"🌬","hotdog":"🌭","taco":"🌮","burrito":"🌯","chestnut":"🌰","seedling":"🌱","evergreen_tree":"🌲","deciduous_tree":"🌳","palm_tree":"🌴","cactus":"🌵","hot_pepper":"🌶","tulip":"🌷","cherry_blossom":"🌸","rose":"🌹","hibiscus":"🌺","sunflower":"🌻","blossom":"🌼","corn":"🌽","ear_of_rice":"🌾","herb":"🌿","four_leaf_clover":"🍀","maple_leaf":"🍁","fallen_leaf":"🍂","leaves":"🍃","mushroom":"🍄","tomato":"🍅","eggplant":"🍆","grapes":"🍇","melon":"🍈","watermelon":"🍉","tangerine":"🍊","lemon":"🍋","banana":"🍌","pineapple":"🍍","apple":"🍎","green_apple":"🍏","pear":"🍐","peach":"🍑","cherries":"🍒","strawberry":"🍓","hamburger":"🍔","pizza":"🍕","meat_on_bone":"🍖","poultry_leg":"🍗","rice_cracker":"🍘","rice_ball":"🍙","rice":"🍚","curry":"🍛","ramen":"🍜","spaghetti":"🍝","bread":"🍞","fries":"🍟","sweet_potato":"🍠","dango":"🍡","oden":"🍢","sushi":"🍣","fried_shrimp":"🍤","fish_cake":"🍥","icecream":"🍦","shaved_ice":"🍧","ice_cream":"🍨","doughnut":"🍩","cookie":"🍪","chocolate_bar":"🍫","candy":"🍬","lollipop":"🍭","custard":"🍮","honey_pot":"🍯","cake":"🍰","bento":"🍱","stew":"🍲","egg":"🍳","fork_and_knife":"🍴","tea":"🍵","sake":"🍶","wine_glass":"🍷","cocktail":"🍸","tropical_drink":"🍹","beer":"🍺","beers":"🍻","baby_bottle":"🍼","knife_fork_plate":"🍽","champagne":"🍾","popcorn":"🍿","ribbon":"🎀","gift":"🎁","birthday":"🎂","jack_o_lantern":"🎃","christmas_tree":"🎄","santa":"🎅","fireworks":"🎆","sparkler":"🎇","balloon":"🎈","tada":"🎉","confetti_ball":"🎊","tanabata_tree":"🎋","crossed_flags":"🎌","bamboo":"🎍","dolls":"🎎","flags":"🎏","wind_chime":"🎐","rice_scene":"🎑","school_satchel":"🎒","mortar_board":"🎓","medal":"🎖","reminder_ribbon":"🎗","studio_microphone":"🎙","level_slider":"🎚","control_knobs":"🎛","film_frames":"🎞","admission_tickets":"🎟","carousel_horse":"🎠","ferris_wheel":"🎡","roller_coaster":"🎢","fishing_pole_and_fish":"🎣","microphone":"🎤","movie_camera":"🎥","cinema":"🎦","headphones":"🎧","art":"🎨","tophat":"🎩","circus_tent":"🎪","ticket":"🎫","clapper":"🎬","performing_arts":"🎭","video_game":"🎮","dart":"🎯","slot_machine":"🎰","8ball":"🎱","game_die":"🎲","bowling":"🎳","flower_playing_cards":"🎴","musical_note":"🎵","notes":"🎶","saxophone":"🎷","guitar":"🎸","musical_keyboard":"🎹","trumpet":"🎺","violin":"🎻","musical_score":"🎼","running_shirt_with_sash":"🎽","tennis":"🎾","ski":"🎿","basketball":"🏀","checkered_flag":"🏁","snowboarder":"🏂","runner":"🏃","running":"🏃","surfer":"🏄","sports_medal":"🏅","trophy":"🏆","horse_racing":"🏇","football":"🏈","rugby_football":"🏉","swimmer":"🏊","weight_lifter":"🏋","golfer":"🏌","racing_motorcycle":"🏍","racing_car":"🏎","cricket_bat_and_ball":"🏏","volleyball":"🏐","field_hockey_stick_and_ball":"🏑","ice_hockey_stick_and_puck":"🏒","table_tennis_paddle_and_ball":"🏓","snow_capped_mountain":"🏔","camping":"🏕","beach_with_umbrella":"🏖","building_construction":"🏗","house_buildings":"🏘","cityscape":"🏙","derelict_house_building":"🏚","classical_building":"🏛","desert":"🏜","desert_island":"🏝","national_park":"🏞","stadium":"🏟","house":"🏠","house_with_garden":"🏡","office":"🏢","post_office":"🏣","european_post_office":"🏤","hospital":"🏥","bank":"🏦","atm":"🏧","hotel":"🏨","love_hotel":"🏩","convenience_store":"🏪","school":"🏫","department_store":"🏬","factory":"🏭","izakaya_lantern":"🏮","lantern":"🏮","japanese_castle":"🏯","european_castle":"🏰","waving_white_flag":"🏳","waving_black_flag":"🏴","rosette":"🏵","label":"🏷","badminton_racquet_and_shuttlecock":"🏸","bow_and_arrow":"🏹","amphora":"🏺","skin-tone-2":"🏻","skin-tone-3":"🏼","skin-tone-4":"🏽","skin-tone-5":"🏾","skin-tone-6":"🏿","rat":"🐀","mouse2":"🐁","ox":"🐂","water_buffalo":"🐃","cow2":"🐄","tiger2":"🐅","leopard":"🐆","rabbit2":"🐇","cat2":"🐈","dragon":"🐉","crocodile":"🐊","whale2":"🐋","snail":"🐌","snake":"🐍","racehorse":"🐎","ram":"🐏","goat":"🐐","sheep":"🐑","monkey":"🐒","rooster":"🐓","chicken":"🐔","dog2":"🐕","pig2":"🐖","boar":"🐗","elephant":"🐘","octopus":"🐙","shell":"🐚","bug":"🐛","ant":"🐜","bee":"🐝","honeybee":"🐝","beetle":"🐞","fish":"🐟","tropical_fish":"🐠","blowfish":"🐡","turtle":"🐢","hatching_chick":"🐣","baby_chick":"🐤","hatched_chick":"🐥","bird":"🐦","penguin":"🐧","koala":"🐨","poodle":"🐩","dromedary_camel":"🐪","camel":"🐫","dolphin":"🐬","flipper":"🐬","mouse":"🐭","cow":"🐮","tiger":"🐯","rabbit":"🐰","cat":"🐱","dragon_face":"🐲","whale":"🐳","horse":"🐴","monkey_face":"🐵","dog":"🐶","pig":"🐷","frog":"🐸","hamster":"🐹","wolf":"🐺","bear":"🐻","panda_face":"🐼","pig_nose":"🐽","feet":"🐾","paw_prints":"🐾","chipmunk":"🐿","eyes":"👀","eye":"👁","ear":"👂","nose":"👃","lips":"👄","tongue":"👅","point_up_2":"👆","point_down":"👇","point_left":"👈","point_right":"👉","facepunch":"👊","punch":"👊","wave":"👋","ok_hand":"👌","+1":"👍","thumbsup":"👍","-1":"👎","thumbsdown":"👎","clap":"👏","open_hands":"👐","crown":"👑","womans_hat":"👒","eyeglasses":"👓","necktie":"👔","shirt":"👕","tshirt":"👕","jeans":"👖","dress":"👗","kimono":"👘","bikini":"👙","womans_clothes":"👚","purse":"👛","handbag":"👜","pouch":"👝","mans_shoe":"👞","shoe":"👞","athletic_shoe":"👟","high_heel":"👠","sandal":"👡","boot":"👢","footprints":"👣","bust_in_silhouette":"👤","busts_in_silhouette":"👥","boy":"👦","girl":"👧","man":"👨","woman":"👩","family":"👨‍👩‍👦","man-woman-boy":"👨‍👩‍👦","couple":"👫","man_and_woman_holding_hands":"👫","two_men_holding_hands":"👬","two_women_holding_hands":"👭","cop":"👮","dancers":"👯","bride_with_veil":"👰","person_with_blond_hair":"👱","man_with_gua_pi_mao":"👲","man_with_turban":"👳","older_man":"👴","older_woman":"👵","baby":"👶","construction_worker":"👷","princess":"👸","japanese_ogre":"👹","japanese_goblin":"👺","ghost":"👻","angel":"👼","alien":"👽","space_invader":"👾","imp":"👿","skull":"💀","information_desk_person":"💁","guardsman":"💂","dancer":"💃","lipstick":"💄","nail_care":"💅","massage":"💆","haircut":"💇","barber":"💈","syringe":"💉","pill":"💊","kiss":"💋","love_letter":"💌","ring":"💍","gem":"💎","couplekiss":"💏","bouquet":"💐","couple_with_heart":"💑","wedding":"💒","heartbeat":"💓","broken_heart":"💔","two_hearts":"💕","sparkling_heart":"💖","heartpulse":"💗","cupid":"💘","blue_heart":"💙","green_heart":"💚","yellow_heart":"💛","purple_heart":"💜","gift_heart":"💝","revolving_hearts":"💞","heart_decoration":"💟","diamond_shape_with_a_dot_inside":"💠","bulb":"💡","anger":"💢","bomb":"💣","zzz":"💤","boom":"💥","collision":"💥","sweat_drops":"💦","droplet":"💧","dash":"💨","hankey":"💩","poop":"💩","shit":"💩","muscle":"💪","dizzy":"💫","speech_balloon":"💬","thought_balloon":"💭","white_flower":"💮","moneybag":"💰","currency_exchange":"💱","heavy_dollar_sign":"💲","credit_card":"💳","yen":"💴","dollar":"💵","euro":"💶","pound":"💷","money_with_wings":"💸","chart":"💹","seat":"💺","computer":"💻","briefcase":"💼","minidisc":"💽","floppy_disk":"💾","cd":"💿","dvd":"📀","file_folder":"📁","open_file_folder":"📂","page_with_curl":"📃","page_facing_up":"📄","date":"📅","calendar":"📆","card_index":"📇","chart_with_upwards_trend":"📈","chart_with_downwards_trend":"📉","bar_chart":"📊","clipboard":"📋","pushpin":"📌","round_pushpin":"📍","paperclip":"📎","straight_ruler":"📏","triangular_ruler":"📐","bookmark_tabs":"📑","ledger":"📒","notebook":"📓","notebook_with_decorative_cover":"📔","closed_book":"📕","book":"📖","open_book":"📖","green_book":"📗","blue_book":"📘","orange_book":"📙","books":"📚","name_badge":"📛","scroll":"📜","memo":"📝","pencil":"📝","telephone_receiver":"📞","pager":"📟","fax":"📠","satellite":"🛰","loudspeaker":"📢","mega":"📣","outbox_tray":"📤","inbox_tray":"📥","package":"📦","e-mail":"📧","incoming_envelope":"📨","envelope_with_arrow":"📩","mailbox_closed":"📪","mailbox":"📫","mailbox_with_mail":"📬","mailbox_with_no_mail":"📭","postbox":"📮","postal_horn":"📯","newspaper":"📰","iphone":"📱","calling":"📲","vibration_mode":"📳","mobile_phone_off":"📴","no_mobile_phones":"📵","signal_strength":"📶","camera":"📷","camera_with_flash":"📸","video_camera":"📹","tv":"📺","radio":"📻","vhs":"📼","film_projector":"📽","prayer_beads":"📿","twisted_rightwards_arrows":"🔀","repeat":"🔁","repeat_one":"🔂","arrows_clockwise":"🔃","arrows_counterclockwise":"🔄","low_brightness":"🔅","high_brightness":"🔆","mute":"🔇","speaker":"🔈","sound":"🔉","loud_sound":"🔊","battery":"🔋","electric_plug":"🔌","mag":"🔍","mag_right":"🔎","lock_with_ink_pen":"🔏","closed_lock_with_key":"🔐","key":"🔑","lock":"🔒","unlock":"🔓","bell":"🔔","no_bell":"🔕","bookmark":"🔖","link":"🔗","radio_button":"🔘","back":"🔙","end":"🔚","on":"🔛","soon":"🔜","top":"🔝","underage":"🔞","keycap_ten":"🔟","capital_abcd":"🔠","abcd":"🔡","symbols":"🔣","abc":"🔤","fire":"🔥","flashlight":"🔦","wrench":"🔧","hammer":"🔨","nut_and_bolt":"🔩","hocho":"🔪","knife":"🔪","gun":"🔫","microscope":"🔬","telescope":"🔭","crystal_ball":"🔮","six_pointed_star":"🔯","beginner":"🔰","trident":"🔱","black_square_button":"🔲","white_square_button":"🔳","red_circle":"🔴","large_blue_circle":"🔵","large_orange_diamond":"🔶","large_blue_diamond":"🔷","small_orange_diamond":"🔸","small_blue_diamond":"🔹","small_red_triangle":"🔺","small_red_triangle_down":"🔻","arrow_up_small":"🔼","arrow_down_small":"🔽","om_symbol":"🕉","dove_of_peace":"🕊","kaaba":"🕋","mosque":"🕌","synagogue":"🕍","menorah_with_nine_branches":"🕎","clock1":"🕐","clock2":"🕑","clock3":"🕒","clock4":"🕓","clock5":"🕔","clock6":"🕕","clock7":"🕖","clock8":"🕗","clock9":"🕘","clock10":"🕙","clock11":"🕚","clock12":"🕛","clock130":"🕜","clock230":"🕝","clock330":"🕞","clock430":"🕟","clock530":"🕠","clock630":"🕡","clock730":"🕢","clock830":"🕣","clock930":"🕤","clock1030":"🕥","clock1130":"🕦","clock1230":"🕧","candle":"🕯","mantelpiece_clock":"🕰","hole":"🕳","man_in_business_suit_levitating":"🕴","sleuth_or_spy":"🕵","dark_sunglasses":"🕶","spider":"🕷","spider_web":"🕸","joystick":"🕹","linked_paperclips":"🖇","lower_left_ballpoint_pen":"🖊","lower_left_fountain_pen":"🖋","lower_left_paintbrush":"🖌","lower_left_crayon":"🖍","raised_hand_with_fingers_splayed":"🖐","middle_finger":"🖕","reversed_hand_with_middle_finger_extended":"🖕","spock-hand":"🖖","desktop_computer":"🖥","printer":"🖨","three_button_mouse":"🖱","trackball":"🖲","frame_with_picture":"🖼","card_index_dividers":"🗂","card_file_box":"🗃","file_cabinet":"🗄","wastebasket":"🗑","spiral_note_pad":"🗒","spiral_calendar_pad":"🗓","compression":"🗜","old_key":"🗝","rolled_up_newspaper":"🗞","dagger_knife":"🗡","speaking_head_in_silhouette":"🗣","left_speech_bubble":"🗨","right_anger_bubble":"🗯","ballot_box_with_ballot":"🗳","world_map":"🗺","mount_fuji":"🗻","tokyo_tower":"🗼","statue_of_liberty":"🗽","japan":"🗾","moyai":"🗿","grinning":"😀","grin":"😁","joy":"😂","smiley":"😃","smile":"😄","sweat_smile":"😅","laughing":"😆","satisfied":"😆","innocent":"😇","smiling_imp":"😈","wink":"😉","blush":"😊","yum":"😋","relieved":"😌","heart_eyes":"😍","sunglasses":"😎","smirk":"😏","neutral_face":"😐","expressionless":"😑","unamused":"😒","sweat":"😓","pensive":"😔","confused":"😕","confounded":"😖","kissing":"😗","kissing_heart":"😘","kissing_smiling_eyes":"😙","kissing_closed_eyes":"😚","stuck_out_tongue":"😛","stuck_out_tongue_winking_eye":"😜","stuck_out_tongue_closed_eyes":"😝","disappointed":"😞","worried":"😟","angry":"😠","rage":"😡","cry":"😢","persevere":"😣","triumph":"😤","disappointed_relieved":"😥","frowning":"😦","anguished":"😧","fearful":"😨","weary":"😩","sleepy":"😪","tired_face":"😫","grimacing":"😬","sob":"😭","open_mouth":"😮","hushed":"😯","cold_sweat":"😰","scream":"😱","astonished":"😲","flushed":"😳","sleeping":"😴","dizzy_face":"😵","no_mouth":"😶","mask":"😷","smile_cat":"😸","joy_cat":"😹","smiley_cat":"😺","heart_eyes_cat":"😻","smirk_cat":"😼","kissing_cat":"😽","pouting_cat":"😾","crying_cat_face":"😿","scream_cat":"🙀","slightly_frowning_face":"🙁","slightly_smiling_face":"🙂","upside_down_face":"🙃","face_with_rolling_eyes":"🙄","no_good":"🙅","ok_woman":"🙆","bow":"🙇","see_no_evil":"🙈","hear_no_evil":"🙉","speak_no_evil":"🙊","raising_hand":"🙋","raised_hands":"🙌","person_frowning":"🙍","person_with_pouting_face":"🙎","pray":"🙏","rocket":"🚀","helicopter":"🚁","steam_locomotive":"🚂","railway_car":"🚃","bullettrain_side":"🚄","bullettrain_front":"🚅","train2":"🚆","metro":"🚇","light_rail":"🚈","station":"🚉","tram":"🚊","train":"🚋","bus":"🚌","oncoming_bus":"🚍","trolleybus":"🚎","busstop":"🚏","minibus":"🚐","ambulance":"🚑","fire_engine":"🚒","police_car":"🚓","oncoming_police_car":"🚔","taxi":"🚕","oncoming_taxi":"🚖","car":"🚗","red_car":"🚗","oncoming_automobile":"🚘","blue_car":"🚙","truck":"🚚","articulated_lorry":"🚛","tractor":"🚜","monorail":"🚝","mountain_railway":"🚞","suspension_railway":"🚟","mountain_cableway":"🚠","aerial_tramway":"🚡","ship":"🚢","rowboat":"🚣","speedboat":"🚤","traffic_light":"🚥","vertical_traffic_light":"🚦","construction":"🚧","rotating_light":"🚨","triangular_flag_on_post":"🚩","door":"🚪","no_entry_sign":"🚫","smoking":"🚬","no_smoking":"🚭","put_litter_in_its_place":"🚮","do_not_litter":"🚯","potable_water":"🚰","non-potable_water":"🚱","bike":"🚲","no_bicycles":"🚳","bicyclist":"🚴","mountain_bicyclist":"🚵","walking":"🚶","no_pedestrians":"🚷","children_crossing":"🚸","mens":"🚹","womens":"🚺","restroom":"🚻","baby_symbol":"🚼","toilet":"🚽","wc":"🚾","shower":"🚿","bath":"🛀","bathtub":"🛁","passport_control":"🛂","customs":"🛃","baggage_claim":"🛄","left_luggage":"🛅","couch_and_lamp":"🛋","sleeping_accommodation":"🛌","shopping_bags":"🛍","bellhop_bell":"🛎","bed":"🛏","place_of_worship":"🛐","hammer_and_wrench":"🛠","shield":"🛡","oil_drum":"🛢","motorway":"🛣","railway_track":"🛤","motor_boat":"🛥","small_airplane":"🛩","airplane_departure":"🛫","airplane_arriving":"🛬","passenger_ship":"🛳","zipper_mouth_face":"🤐","money_mouth_face":"🤑","face_with_thermometer":"🤒","nerd_face":"🤓","thinking_face":"🤔","face_with_head_bandage":"🤕","robot_face":"🤖","hugging_face":"🤗","the_horns":"🤘","sign_of_the_horns":"🤘","crab":"🦀","lion_face":"🦁","scorpion":"🦂","turkey":"🦃","unicorn_face":"🦄","cheese_wedge":"🧀","hash":"#️⃣","keycap_star":"*⃣","zero":"0️⃣","one":"1️⃣","two":"2️⃣","three":"3️⃣","four":"4️⃣","five":"5️⃣","six":"6️⃣","seven":"7️⃣","eight":"8️⃣","nine":"9️⃣","flag-ac":"🇦🇨","flag-ad":"🇦🇩","flag-ae":"🇦🇪","flag-af":"🇦🇫","flag-ag":"🇦🇬","flag-ai":"🇦🇮","flag-al":"🇦🇱","flag-am":"🇦🇲","flag-ao":"🇦🇴","flag-aq":"🇦🇶","flag-ar":"🇦🇷","flag-as":"🇦🇸","flag-at":"🇦🇹","flag-au":"🇦🇺","flag-aw":"🇦🇼","flag-ax":"🇦🇽","flag-az":"🇦🇿","flag-ba":"🇧🇦","flag-bb":"🇧🇧","flag-bd":"🇧🇩","flag-be":"🇧🇪","flag-bf":"🇧🇫","flag-bg":"🇧🇬","flag-bh":"🇧🇭","flag-bi":"🇧🇮","flag-bj":"🇧🇯","flag-bl":"🇧🇱","flag-bm":"🇧🇲","flag-bn":"🇧🇳","flag-bo":"🇧🇴","flag-bq":"🇧🇶","flag-br":"🇧🇷","flag-bs":"🇧🇸","flag-bt":"🇧🇹","flag-bv":"🇧🇻","flag-bw":"🇧🇼","flag-by":"🇧🇾","flag-bz":"🇧🇿","flag-ca":"🇨🇦","flag-cc":"🇨🇨","flag-cd":"🇨🇩","flag-cf":"🇨🇫","flag-cg":"🇨🇬","flag-ch":"🇨🇭","flag-ci":"🇨🇮","flag-ck":"🇨🇰","flag-cl":"🇨🇱","flag-cm":"🇨🇲","flag-cn":"🇨🇳","cn":"🇨🇳","flag-co":"🇨🇴","flag-cp":"🇨🇵","flag-cr":"🇨🇷","flag-cu":"🇨🇺","flag-cv":"🇨🇻","flag-cw":"🇨🇼","flag-cx":"🇨🇽","flag-cy":"🇨🇾","flag-cz":"🇨🇿","flag-de":"🇩🇪","de":"🇩🇪","flag-dg":"🇩🇬","flag-dj":"🇩🇯","flag-dk":"🇩🇰","flag-dm":"🇩🇲","flag-do":"🇩🇴","flag-dz":"🇩🇿","flag-ea":"🇪🇦","flag-ec":"🇪🇨","flag-ee":"🇪🇪","flag-eg":"🇪🇬","flag-eh":"🇪🇭","flag-er":"🇪🇷","flag-es":"🇪🇸","es":"🇪🇸","flag-et":"🇪🇹","flag-eu":"🇪🇺","flag-fi":"🇫🇮","flag-fj":"🇫🇯","flag-fk":"🇫🇰","flag-fm":"🇫🇲","flag-fo":"🇫🇴","flag-fr":"🇫🇷","fr":"🇫🇷","flag-ga":"🇬🇦","flag-gb":"🇬🇧","gb":"🇬🇧","uk":"🇬🇧","flag-gd":"🇬🇩","flag-ge":"🇬🇪","flag-gf":"🇬🇫","flag-gg":"🇬🇬","flag-gh":"🇬🇭","flag-gi":"🇬🇮","flag-gl":"🇬🇱","flag-gm":"🇬🇲","flag-gn":"🇬🇳","flag-gp":"🇬🇵","flag-gq":"🇬🇶","flag-gr":"🇬🇷","flag-gs":"🇬🇸","flag-gt":"🇬🇹","flag-gu":"🇬🇺","flag-gw":"🇬🇼","flag-gy":"🇬🇾","flag-hk":"🇭🇰","flag-hm":"🇭🇲","flag-hn":"🇭🇳","flag-hr":"🇭🇷","flag-ht":"🇭🇹","flag-hu":"🇭🇺","flag-ic":"🇮🇨","flag-id":"🇮🇩","flag-ie":"🇮🇪","flag-il":"🇮🇱","flag-im":"🇮🇲","flag-in":"🇮🇳","flag-io":"🇮🇴","flag-iq":"🇮🇶","flag-ir":"🇮🇷","flag-is":"🇮🇸","flag-it":"🇮🇹","it":"🇮🇹","flag-je":"🇯🇪","flag-jm":"🇯🇲","flag-jo":"🇯🇴","flag-jp":"🇯🇵","jp":"🇯🇵","flag-ke":"🇰🇪","flag-kg":"🇰🇬","flag-kh":"🇰🇭","flag-ki":"🇰🇮","flag-km":"🇰🇲","flag-kn":"🇰🇳","flag-kp":"🇰🇵","flag-kr":"🇰🇷","kr":"🇰🇷","flag-kw":"🇰🇼","flag-ky":"🇰🇾","flag-kz":"🇰🇿","flag-la":"🇱🇦","flag-lb":"🇱🇧","flag-lc":"🇱🇨","flag-li":"🇱🇮","flag-lk":"🇱🇰","flag-lr":"🇱🇷","flag-ls":"🇱🇸","flag-lt":"🇱🇹","flag-lu":"🇱🇺","flag-lv":"🇱🇻","flag-ly":"🇱🇾","flag-ma":"🇲🇦","flag-mc":"🇲🇨","flag-md":"🇲🇩","flag-me":"🇲🇪","flag-mf":"🇲🇫","flag-mg":"🇲🇬","flag-mh":"🇲🇭","flag-mk":"🇲🇰","flag-ml":"🇲🇱","flag-mm":"🇲🇲","flag-mn":"🇲🇳","flag-mo":"🇲🇴","flag-mp":"🇲🇵","flag-mq":"🇲🇶","flag-mr":"🇲🇷","flag-ms":"🇲🇸","flag-mt":"🇲🇹","flag-mu":"🇲🇺","flag-mv":"🇲🇻","flag-mw":"🇲🇼","flag-mx":"🇲🇽","flag-my":"🇲🇾","flag-mz":"🇲🇿","flag-na":"🇳🇦","flag-nc":"🇳🇨","flag-ne":"🇳🇪","flag-nf":"🇳🇫","flag-ng":"🇳🇬","flag-ni":"🇳🇮","flag-nl":"🇳🇱","flag-no":"🇳🇴","flag-np":"🇳🇵","flag-nr":"🇳🇷","flag-nu":"🇳🇺","flag-nz":"🇳🇿","flag-om":"🇴🇲","flag-pa":"🇵🇦","flag-pe":"🇵🇪","flag-pf":"🇵🇫","flag-pg":"🇵🇬","flag-ph":"🇵🇭","flag-pk":"🇵🇰","flag-pl":"🇵🇱","flag-pm":"🇵🇲","flag-pn":"🇵🇳","flag-pr":"🇵🇷","flag-ps":"🇵🇸","flag-pt":"🇵🇹","flag-pw":"🇵🇼","flag-py":"🇵🇾","flag-qa":"🇶🇦","flag-re":"🇷🇪","flag-ro":"🇷🇴","flag-rs":"🇷🇸","flag-ru":"🇷🇺","ru":"🇷🇺","flag-rw":"🇷🇼","flag-sa":"🇸🇦","flag-sb":"🇸🇧","flag-sc":"🇸🇨","flag-sd":"🇸🇩","flag-se":"🇸🇪","flag-sg":"🇸🇬","flag-sh":"🇸🇭","flag-si":"🇸🇮","flag-sj":"🇸🇯","flag-sk":"🇸🇰","flag-sl":"🇸🇱","flag-sm":"🇸🇲","flag-sn":"🇸🇳","flag-so":"🇸🇴","flag-sr":"🇸🇷","flag-ss":"🇸🇸","flag-st":"🇸🇹","flag-sv":"🇸🇻","flag-sx":"🇸🇽","flag-sy":"🇸🇾","flag-sz":"🇸🇿","flag-ta":"🇹🇦","flag-tc":"🇹🇨","flag-td":"🇹🇩","flag-tf":"🇹🇫","flag-tg":"🇹🇬","flag-th":"🇹🇭","flag-tj":"🇹🇯","flag-tk":"🇹🇰","flag-tl":"🇹🇱","flag-tm":"🇹🇲","flag-tn":"🇹🇳","flag-to":"🇹🇴","flag-tr":"🇹🇷","flag-tt":"🇹🇹","flag-tv":"🇹🇻","flag-tw":"🇹🇼","flag-tz":"🇹🇿","flag-ua":"🇺🇦","flag-ug":"🇺🇬","flag-um":"🇺🇲","flag-us":"🇺🇸","us":"🇺🇸","flag-uy":"🇺🇾","flag-uz":"🇺🇿","flag-va":"🇻🇦","flag-vc":"🇻🇨","flag-ve":"🇻🇪","flag-vg":"🇻🇬","flag-vi":"🇻🇮","flag-vn":"🇻🇳","flag-vu":"🇻🇺","flag-wf":"🇼🇫","flag-ws":"🇼🇸","flag-xk":"🇽🇰","flag-ye":"🇾🇪","flag-yt":"🇾🇹","flag-za":"🇿🇦","flag-zm":"🇿🇲","flag-zw":"🇿🇼","man-man-boy":"👨‍👨‍👦","man-man-boy-boy":"👨‍👨‍👦‍👦","man-man-girl":"👨‍👨‍👧","man-man-girl-boy":"👨‍👨‍👧‍👦","man-man-girl-girl":"👨‍👨‍👧‍👧","man-woman-boy-boy":"👨‍👩‍👦‍👦","man-woman-girl":"👨‍👩‍👧","man-woman-girl-boy":"👨‍👩‍👧‍👦","man-woman-girl-girl":"👨‍👩‍👧‍👧","man-heart-man":"👨‍❤️‍👨","man-kiss-man":"👨‍❤️‍💋‍👨","woman-woman-boy":"👩‍👩‍👦","woman-woman-boy-boy":"👩‍👩‍👦‍👦","woman-woman-girl":"👩‍👩‍👧","woman-woman-girl-boy":"👩‍👩‍👧‍👦","woman-woman-girl-girl":"👩‍👩‍👧‍👧","woman-heart-woman":"👩‍❤️‍👩","woman-kiss-woman":"👩‍❤️‍💋‍👩"}
  113324. /***/ }),
  113325. /* 837 */
  113326. /***/ (function(module, exports, __webpack_require__) {
  113327. /*!
  113328. * normalize-path <https://github.com/jonschlinkert/normalize-path>
  113329. *
  113330. * Copyright (c) 2014-2017, Jon Schlinkert.
  113331. * Released under the MIT License.
  113332. */
  113333. var removeTrailingSeparator = __webpack_require__(868);
  113334. module.exports = function normalizePath(str, stripTrailing) {
  113335. if (typeof str !== 'string') {
  113336. throw new TypeError('expected a string');
  113337. }
  113338. str = str.replace(/[\\\/]+/g, '/');
  113339. if (stripTrailing !== false) {
  113340. str = removeTrailingSeparator(str);
  113341. }
  113342. return str;
  113343. };
  113344. /***/ }),
  113345. /* 838 */
  113346. /***/ (function(module, exports, __webpack_require__) {
  113347. "use strict";
  113348. let path
  113349. class LogicalTree {
  113350. constructor (name, address, opts) {
  113351. this.name = name
  113352. this.version = opts.version
  113353. this.address = address || ''
  113354. this.optional = !!opts.optional
  113355. this.dev = !!opts.dev
  113356. this.bundled = !!opts.bundled
  113357. this.resolved = opts.resolved
  113358. this.integrity = opts.integrity
  113359. this.dependencies = new Map()
  113360. this.requiredBy = new Set()
  113361. }
  113362. get isRoot () { return !this.requiredBy.size }
  113363. addDep (dep) {
  113364. this.dependencies.set(dep.name, dep)
  113365. dep.requiredBy.add(this)
  113366. return this
  113367. }
  113368. delDep (dep) {
  113369. this.dependencies.delete(dep.name)
  113370. dep.requiredBy.delete(this)
  113371. return this
  113372. }
  113373. getDep (name) {
  113374. return this.dependencies.get(name)
  113375. }
  113376. path (prefix) {
  113377. if (this.isRoot) {
  113378. // The address of the root is the prefix itself.
  113379. return prefix || ''
  113380. } else {
  113381. if (!path) { path = __webpack_require__(1) }
  113382. return path.join(
  113383. prefix || '',
  113384. 'node_modules',
  113385. this.address.replace(/:/g, '/node_modules/')
  113386. )
  113387. }
  113388. }
  113389. // This finds cycles _from_ a given node: if some deeper dep has
  113390. // its own cycle, but that cycle does not refer to this node,
  113391. // it will return false.
  113392. hasCycle (_seen, _from) {
  113393. if (!_seen) { _seen = new Set() }
  113394. if (!_from) { _from = this }
  113395. for (let dep of this.dependencies.values()) {
  113396. if (_seen.has(dep)) { continue }
  113397. _seen.add(dep)
  113398. if (dep === _from || dep.hasCycle(_seen, _from)) {
  113399. return true
  113400. }
  113401. }
  113402. return false
  113403. }
  113404. forEachAsync (fn, opts, _pending) {
  113405. if (!opts) { opts = _pending || {} }
  113406. if (!_pending) { _pending = new Map() }
  113407. const P = opts.Promise || Promise
  113408. if (_pending.has(this)) {
  113409. return P.resolve(this.hasCycle() || _pending.get(this))
  113410. }
  113411. const pending = P.resolve().then(() => {
  113412. return fn(this, () => {
  113413. return promiseMap(
  113414. this.dependencies.values(),
  113415. dep => dep.forEachAsync(fn, opts, _pending),
  113416. opts
  113417. )
  113418. })
  113419. })
  113420. _pending.set(this, pending)
  113421. return pending
  113422. }
  113423. forEach (fn, _seen) {
  113424. if (!_seen) { _seen = new Set() }
  113425. if (_seen.has(this)) { return }
  113426. _seen.add(this)
  113427. fn(this, () => {
  113428. for (let dep of this.dependencies.values()) {
  113429. dep.forEach(fn, _seen)
  113430. }
  113431. })
  113432. }
  113433. }
  113434. module.exports = lockTree
  113435. function lockTree (pkg, pkgLock, opts) {
  113436. const tree = makeNode(pkg.name, null, pkg)
  113437. const allDeps = new Map()
  113438. Array.from(
  113439. new Set(Object.keys(pkg.devDependencies || {})
  113440. .concat(Object.keys(pkg.optionalDependencies || {}))
  113441. .concat(Object.keys(pkg.dependencies || {})))
  113442. ).forEach(name => {
  113443. let dep = allDeps.get(name)
  113444. if (!dep) {
  113445. const depNode = (pkgLock.dependencies || {})[name]
  113446. dep = makeNode(name, name, depNode)
  113447. }
  113448. addChild(dep, tree, allDeps, pkgLock)
  113449. })
  113450. return tree
  113451. }
  113452. module.exports.node = makeNode
  113453. function makeNode (name, address, opts) {
  113454. return new LogicalTree(name, address, opts || {})
  113455. }
  113456. function addChild (dep, tree, allDeps, pkgLock) {
  113457. tree.addDep(dep)
  113458. allDeps.set(dep.address, dep)
  113459. const addr = dep.address
  113460. const lockNode = atAddr(pkgLock, addr)
  113461. Object.keys(lockNode.requires || {}).forEach(name => {
  113462. const tdepAddr = reqAddr(pkgLock, name, addr)
  113463. let tdep = allDeps.get(tdepAddr)
  113464. if (!tdep) {
  113465. tdep = makeNode(name, tdepAddr, atAddr(pkgLock, tdepAddr))
  113466. addChild(tdep, dep, allDeps, pkgLock)
  113467. } else {
  113468. dep.addDep(tdep)
  113469. }
  113470. })
  113471. }
  113472. module.exports._reqAddr = reqAddr
  113473. function reqAddr (pkgLock, name, fromAddr) {
  113474. const lockNode = atAddr(pkgLock, fromAddr)
  113475. const child = (lockNode.dependencies || {})[name]
  113476. if (child) {
  113477. return `${fromAddr}:${name}`
  113478. } else {
  113479. const parts = fromAddr.split(':')
  113480. while (parts.length) {
  113481. parts.pop()
  113482. const joined = parts.join(':')
  113483. const parent = atAddr(pkgLock, joined)
  113484. if (parent) {
  113485. const child = (parent.dependencies || {})[name]
  113486. if (child) {
  113487. return `${joined}${parts.length ? ':' : ''}${name}`
  113488. }
  113489. }
  113490. }
  113491. const err = new Error(`${name} not accessible from ${fromAddr}`)
  113492. err.pkgLock = pkgLock
  113493. err.target = name
  113494. err.from = fromAddr
  113495. throw err
  113496. }
  113497. }
  113498. module.exports._atAddr = atAddr
  113499. function atAddr (pkgLock, addr) {
  113500. if (!addr.length) { return pkgLock }
  113501. const parts = addr.split(':')
  113502. return parts.reduce((acc, next) => {
  113503. return acc && (acc.dependencies || {})[next]
  113504. }, pkgLock)
  113505. }
  113506. function promiseMap (arr, fn, opts, _index) {
  113507. _index = _index || 0
  113508. const P = (opts && opts.Promise) || Promise
  113509. if (P.map) {
  113510. return P.map(arr, fn, opts)
  113511. } else {
  113512. if (!(arr instanceof Array)) {
  113513. arr = Array.from(arr)
  113514. }
  113515. if (_index >= arr.length) {
  113516. return P.resolve()
  113517. } else {
  113518. return P.resolve(fn(arr[_index], _index, arr))
  113519. .then(() => promiseMap(arr, fn, opts, _index + 1))
  113520. }
  113521. }
  113522. }
  113523. /***/ }),
  113524. /* 839 */
  113525. /***/ (function(module, exports, __webpack_require__) {
  113526. "use strict";
  113527. module.exports = Number.isNaN || function (x) {
  113528. return x !== x;
  113529. };
  113530. /***/ }),
  113531. /* 840 */
  113532. /***/ (function(module, exports, __webpack_require__) {
  113533. var crypto = __webpack_require__(21)
  113534. , qs = __webpack_require__(186)
  113535. ;
  113536. function sha1 (key, body) {
  113537. return crypto.createHmac('sha1', key).update(body).digest('base64')
  113538. }
  113539. function rsa (key, body) {
  113540. return crypto.createSign("RSA-SHA1").update(body).sign(key, 'base64');
  113541. }
  113542. function rfc3986 (str) {
  113543. return encodeURIComponent(str)
  113544. .replace(/!/g,'%21')
  113545. .replace(/\*/g,'%2A')
  113546. .replace(/\(/g,'%28')
  113547. .replace(/\)/g,'%29')
  113548. .replace(/'/g,'%27')
  113549. ;
  113550. }
  113551. // Maps object to bi-dimensional array
  113552. // Converts { foo: 'A', bar: [ 'b', 'B' ]} to
  113553. // [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ]
  113554. function map (obj) {
  113555. var key, val, arr = []
  113556. for (key in obj) {
  113557. val = obj[key]
  113558. if (Array.isArray(val))
  113559. for (var i = 0; i < val.length; i++)
  113560. arr.push([key, val[i]])
  113561. else if (typeof val === "object")
  113562. for (var prop in val)
  113563. arr.push([key + '[' + prop + ']', val[prop]]);
  113564. else
  113565. arr.push([key, val])
  113566. }
  113567. return arr
  113568. }
  113569. // Compare function for sort
  113570. function compare (a, b) {
  113571. return a > b ? 1 : a < b ? -1 : 0
  113572. }
  113573. function generateBase (httpMethod, base_uri, params) {
  113574. // adapted from https://dev.twitter.com/docs/auth/oauth and
  113575. // https://dev.twitter.com/docs/auth/creating-signature
  113576. // Parameter normalization
  113577. // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2
  113578. var normalized = map(params)
  113579. // 1. First, the name and value of each parameter are encoded
  113580. .map(function (p) {
  113581. return [ rfc3986(p[0]), rfc3986(p[1] || '') ]
  113582. })
  113583. // 2. The parameters are sorted by name, using ascending byte value
  113584. // ordering. If two or more parameters share the same name, they
  113585. // are sorted by their value.
  113586. .sort(function (a, b) {
  113587. return compare(a[0], b[0]) || compare(a[1], b[1])
  113588. })
  113589. // 3. The name of each parameter is concatenated to its corresponding
  113590. // value using an "=" character (ASCII code 61) as a separator, even
  113591. // if the value is empty.
  113592. .map(function (p) { return p.join('=') })
  113593. // 4. The sorted name/value pairs are concatenated together into a
  113594. // single string by using an "&" character (ASCII code 38) as
  113595. // separator.
  113596. .join('&')
  113597. var base = [
  113598. rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'),
  113599. rfc3986(base_uri),
  113600. rfc3986(normalized)
  113601. ].join('&')
  113602. return base
  113603. }
  113604. function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) {
  113605. var base = generateBase(httpMethod, base_uri, params)
  113606. var key = [
  113607. consumer_secret || '',
  113608. token_secret || ''
  113609. ].map(rfc3986).join('&')
  113610. return sha1(key, base)
  113611. }
  113612. function rsasign (httpMethod, base_uri, params, private_key, token_secret) {
  113613. var base = generateBase(httpMethod, base_uri, params)
  113614. var key = private_key || ''
  113615. return rsa(key, base)
  113616. }
  113617. function plaintext (consumer_secret, token_secret) {
  113618. var key = [
  113619. consumer_secret || '',
  113620. token_secret || ''
  113621. ].map(rfc3986).join('&')
  113622. return key
  113623. }
  113624. function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) {
  113625. var method
  113626. var skipArgs = 1
  113627. switch (signMethod) {
  113628. case 'RSA-SHA1':
  113629. method = rsasign
  113630. break
  113631. case 'HMAC-SHA1':
  113632. method = hmacsign
  113633. break
  113634. case 'PLAINTEXT':
  113635. method = plaintext
  113636. skipArgs = 4
  113637. break
  113638. default:
  113639. throw new Error("Signature method not supported: " + signMethod)
  113640. }
  113641. return method.apply(null, [].slice.call(arguments, skipArgs))
  113642. }
  113643. exports.hmacsign = hmacsign
  113644. exports.rsasign = rsasign
  113645. exports.plaintext = plaintext
  113646. exports.sign = sign
  113647. exports.rfc3986 = rfc3986
  113648. exports.generateBase = generateBase
  113649. /***/ }),
  113650. /* 841 */
  113651. /***/ (function(module, exports, __webpack_require__) {
  113652. "use strict";
  113653. /*!
  113654. * object.omit <https://github.com/jonschlinkert/object.omit>
  113655. *
  113656. * Copyright (c) 2014-2015, Jon Schlinkert.
  113657. * Licensed under the MIT License.
  113658. */
  113659. var isObject = __webpack_require__(784);
  113660. var forOwn = __webpack_require__(842);
  113661. module.exports = function omit(obj, keys) {
  113662. if (!isObject(obj)) return {};
  113663. keys = [].concat.apply([], [].slice.call(arguments, 1));
  113664. var last = keys[keys.length - 1];
  113665. var res = {}, fn;
  113666. if (typeof last === 'function') {
  113667. fn = keys.pop();
  113668. }
  113669. var isFunction = typeof fn === 'function';
  113670. if (!keys.length && !isFunction) {
  113671. return obj;
  113672. }
  113673. forOwn(obj, function(value, key) {
  113674. if (keys.indexOf(key) === -1) {
  113675. if (!isFunction) {
  113676. res[key] = value;
  113677. } else if (fn(value, key, obj)) {
  113678. res[key] = value;
  113679. }
  113680. }
  113681. });
  113682. return res;
  113683. };
  113684. /***/ }),
  113685. /* 842 */
  113686. /***/ (function(module, exports, __webpack_require__) {
  113687. "use strict";
  113688. /*!
  113689. * for-own <https://github.com/jonschlinkert/for-own>
  113690. *
  113691. * Copyright (c) 2014-2017, Jon Schlinkert.
  113692. * Released under the MIT License.
  113693. */
  113694. var forIn = __webpack_require__(671);
  113695. var hasOwn = Object.prototype.hasOwnProperty;
  113696. module.exports = function forOwn(obj, fn, thisArg) {
  113697. forIn(obj, function(val, key) {
  113698. if (hasOwn.call(obj, key)) {
  113699. return fn.call(thisArg, obj[key], key, obj);
  113700. }
  113701. });
  113702. };
  113703. /***/ }),
  113704. /* 843 */
  113705. /***/ (function(module, exports, __webpack_require__) {
  113706. "use strict";
  113707. const mimicFn = __webpack_require__(831);
  113708. module.exports = (fn, opts) => {
  113709. // TODO: Remove this in v3
  113710. if (opts === true) {
  113711. throw new TypeError('The second argument is now an options object');
  113712. }
  113713. if (typeof fn !== 'function') {
  113714. throw new TypeError('Expected a function');
  113715. }
  113716. opts = opts || {};
  113717. let ret;
  113718. let called = false;
  113719. const fnName = fn.displayName || fn.name || '<anonymous>';
  113720. const onetime = function () {
  113721. if (called) {
  113722. if (opts.throw === true) {
  113723. throw new Error(`Function \`${fnName}\` can only be called once`);
  113724. }
  113725. return ret;
  113726. }
  113727. called = true;
  113728. ret = fn.apply(this, arguments);
  113729. fn = null;
  113730. return ret;
  113731. };
  113732. mimicFn(onetime, fn);
  113733. return onetime;
  113734. };
  113735. /***/ }),
  113736. /* 844 */
  113737. /***/ (function(module, exports, __webpack_require__) {
  113738. "use strict";
  113739. var isWindows = process.platform === 'win32';
  113740. var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
  113741. // https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
  113742. module.exports = function () {
  113743. var path;
  113744. if (isWindows) {
  113745. path = process.env.TEMP ||
  113746. process.env.TMP ||
  113747. (process.env.SystemRoot || process.env.windir) + '\\temp';
  113748. } else {
  113749. path = process.env.TMPDIR ||
  113750. process.env.TMP ||
  113751. process.env.TEMP ||
  113752. '/tmp';
  113753. }
  113754. if (trailingSlashRe.test(path)) {
  113755. path = path.slice(0, -1);
  113756. }
  113757. return path;
  113758. };
  113759. /***/ }),
  113760. /* 845 */
  113761. /***/ (function(module, exports, __webpack_require__) {
  113762. "use strict";
  113763. /*!
  113764. * parse-glob <https://github.com/jonschlinkert/parse-glob>
  113765. *
  113766. * Copyright (c) 2015, Jon Schlinkert.
  113767. * Licensed under the MIT License.
  113768. */
  113769. var isGlob = __webpack_require__(167);
  113770. var findBase = __webpack_require__(677);
  113771. var extglob = __webpack_require__(166);
  113772. var dotfile = __webpack_require__(782);
  113773. /**
  113774. * Expose `cache`
  113775. */
  113776. var cache = module.exports.cache = {};
  113777. /**
  113778. * Parse a glob pattern into tokens.
  113779. *
  113780. * When no paths or '**' are in the glob, we use a
  113781. * different strategy for parsing the filename, since
  113782. * file names can contain braces and other difficult
  113783. * patterns. such as:
  113784. *
  113785. * - `*.{a,b}`
  113786. * - `(**|*.js)`
  113787. */
  113788. module.exports = function parseGlob(glob) {
  113789. if (cache.hasOwnProperty(glob)) {
  113790. return cache[glob];
  113791. }
  113792. var tok = {};
  113793. tok.orig = glob;
  113794. tok.is = {};
  113795. // unescape dots and slashes in braces/brackets
  113796. glob = escape(glob);
  113797. var parsed = findBase(glob);
  113798. tok.is.glob = parsed.isGlob;
  113799. tok.glob = parsed.glob;
  113800. tok.base = parsed.base;
  113801. var segs = /([^\/]*)$/.exec(glob);
  113802. tok.path = {};
  113803. tok.path.dirname = '';
  113804. tok.path.basename = segs[1] || '';
  113805. tok.path.dirname = glob.split(tok.path.basename).join('') || '';
  113806. var basename = (tok.path.basename || '').split('.') || '';
  113807. tok.path.filename = basename[0] || '';
  113808. tok.path.extname = basename.slice(1).join('.') || '';
  113809. tok.path.ext = '';
  113810. if (isGlob(tok.path.dirname) && !tok.path.basename) {
  113811. if (!/\/$/.test(tok.glob)) {
  113812. tok.path.basename = tok.glob;
  113813. }
  113814. tok.path.dirname = tok.base;
  113815. }
  113816. if (glob.indexOf('/') === -1 && !tok.is.globstar) {
  113817. tok.path.dirname = '';
  113818. tok.path.basename = tok.orig;
  113819. }
  113820. var dot = tok.path.basename.indexOf('.');
  113821. if (dot !== -1) {
  113822. tok.path.filename = tok.path.basename.slice(0, dot);
  113823. tok.path.extname = tok.path.basename.slice(dot);
  113824. }
  113825. if (tok.path.extname.charAt(0) === '.') {
  113826. var exts = tok.path.extname.split('.');
  113827. tok.path.ext = exts[exts.length - 1];
  113828. }
  113829. // unescape dots and slashes in braces/brackets
  113830. tok.glob = unescape(tok.glob);
  113831. tok.path.dirname = unescape(tok.path.dirname);
  113832. tok.path.basename = unescape(tok.path.basename);
  113833. tok.path.filename = unescape(tok.path.filename);
  113834. tok.path.extname = unescape(tok.path.extname);
  113835. // Booleans
  113836. var is = (glob && tok.is.glob);
  113837. tok.is.negated = glob && glob.charAt(0) === '!';
  113838. tok.is.extglob = glob && extglob(glob);
  113839. tok.is.braces = has(is, glob, '{');
  113840. tok.is.brackets = has(is, glob, '[:');
  113841. tok.is.globstar = has(is, glob, '**');
  113842. tok.is.dotfile = dotfile(tok.path.basename) || dotfile(tok.path.filename);
  113843. tok.is.dotdir = dotdir(tok.path.dirname);
  113844. return (cache[glob] = tok);
  113845. }
  113846. /**
  113847. * Returns true if the glob matches dot-directories.
  113848. *
  113849. * @param {Object} `tok` The tokens object
  113850. * @param {Object} `path` The path object
  113851. * @return {Object}
  113852. */
  113853. function dotdir(base) {
  113854. if (base.indexOf('/.') !== -1) {
  113855. return true;
  113856. }
  113857. if (base.charAt(0) === '.' && base.charAt(1) !== '/') {
  113858. return true;
  113859. }
  113860. return false;
  113861. }
  113862. /**
  113863. * Returns true if the pattern has the given `ch`aracter(s)
  113864. *
  113865. * @param {Object} `glob` The glob pattern.
  113866. * @param {Object} `ch` The character to test for
  113867. * @return {Object}
  113868. */
  113869. function has(is, glob, ch) {
  113870. return is && glob.indexOf(ch) !== -1;
  113871. }
  113872. /**
  113873. * Escape/unescape utils
  113874. */
  113875. function escape(str) {
  113876. var re = /\{([^{}]*?)}|\(([^()]*?)\)|\[([^\[\]]*?)\]/g;
  113877. return str.replace(re, function (outter, braces, parens, brackets) {
  113878. var inner = braces || parens || brackets;
  113879. if (!inner) { return outter; }
  113880. return outter.split(inner).join(esc(inner));
  113881. });
  113882. }
  113883. function esc(str) {
  113884. str = str.split('/').join('__SLASH__');
  113885. str = str.split('.').join('__DOT__');
  113886. return str;
  113887. }
  113888. function unescape(str) {
  113889. str = str.split('__SLASH__').join('/');
  113890. str = str.split('__DOT__').join('.');
  113891. return str;
  113892. }
  113893. /***/ }),
  113894. /* 846 */
  113895. /***/ (function(module, exports, __webpack_require__) {
  113896. "use strict";
  113897. var isWindows = process.platform === 'win32';
  113898. // Regex to split a windows path into three parts: [*, device, slash,
  113899. // tail] windows-only
  113900. var splitDeviceRe =
  113901. /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
  113902. // Regex to split the tail part of the above into [*, dir, basename, ext]
  113903. var splitTailRe =
  113904. /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/;
  113905. var win32 = {};
  113906. // Function to split a filename into [root, dir, basename, ext]
  113907. function win32SplitPath(filename) {
  113908. // Separate device+slash from tail
  113909. var result = splitDeviceRe.exec(filename),
  113910. device = (result[1] || '') + (result[2] || ''),
  113911. tail = result[3] || '';
  113912. // Split the tail into dir, basename and extension
  113913. var result2 = splitTailRe.exec(tail),
  113914. dir = result2[1],
  113915. basename = result2[2],
  113916. ext = result2[3];
  113917. return [device, dir, basename, ext];
  113918. }
  113919. win32.parse = function(pathString) {
  113920. if (typeof pathString !== 'string') {
  113921. throw new TypeError(
  113922. "Parameter 'pathString' must be a string, not " + typeof pathString
  113923. );
  113924. }
  113925. var allParts = win32SplitPath(pathString);
  113926. if (!allParts || allParts.length !== 4) {
  113927. throw new TypeError("Invalid path '" + pathString + "'");
  113928. }
  113929. return {
  113930. root: allParts[0],
  113931. dir: allParts[0] + allParts[1].slice(0, -1),
  113932. base: allParts[2],
  113933. ext: allParts[3],
  113934. name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
  113935. };
  113936. };
  113937. // Split a filename into [root, dir, basename, ext], unix version
  113938. // 'root' is just a slash, or nothing.
  113939. var splitPathRe =
  113940. /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
  113941. var posix = {};
  113942. function posixSplitPath(filename) {
  113943. return splitPathRe.exec(filename).slice(1);
  113944. }
  113945. posix.parse = function(pathString) {
  113946. if (typeof pathString !== 'string') {
  113947. throw new TypeError(
  113948. "Parameter 'pathString' must be a string, not " + typeof pathString
  113949. );
  113950. }
  113951. var allParts = posixSplitPath(pathString);
  113952. if (!allParts || allParts.length !== 4) {
  113953. throw new TypeError("Invalid path '" + pathString + "'");
  113954. }
  113955. allParts[1] = allParts[1] || '';
  113956. allParts[2] = allParts[2] || '';
  113957. allParts[3] = allParts[3] || '';
  113958. return {
  113959. root: allParts[0],
  113960. dir: allParts[0] + allParts[1].slice(0, -1),
  113961. base: allParts[2],
  113962. ext: allParts[3],
  113963. name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
  113964. };
  113965. };
  113966. if (isWindows)
  113967. module.exports = win32.parse;
  113968. else /* posix */
  113969. module.exports = posix.parse;
  113970. module.exports.posix = posix.parse;
  113971. module.exports.win32 = win32.parse;
  113972. /***/ }),
  113973. /* 847 */
  113974. /***/ (function(module, exports, __webpack_require__) {
  113975. var duplexify = __webpack_require__(349)
  113976. var through = __webpack_require__(432)
  113977. var bufferFrom = __webpack_require__(560)
  113978. var noop = function() {}
  113979. var isObject = function(data) {
  113980. return !Buffer.isBuffer(data) && typeof data !== 'string'
  113981. }
  113982. var peek = function(opts, onpeek) {
  113983. if (typeof opts === 'number') opts = {maxBuffer:opts}
  113984. if (typeof opts === 'function') return peek(null, opts)
  113985. if (!opts) opts = {}
  113986. var maxBuffer = typeof opts.maxBuffer === 'number' ? opts.maxBuffer : 65535
  113987. var strict = opts.strict
  113988. var newline = opts.newline !== false
  113989. var buffer = []
  113990. var bufferSize = 0
  113991. var dup = duplexify.obj()
  113992. var peeker = through.obj({highWaterMark:1}, function(data, enc, cb) {
  113993. if (isObject(data)) return ready(data, null, cb)
  113994. if (!Buffer.isBuffer(data)) data = bufferFrom(data)
  113995. if (newline) {
  113996. var nl = Array.prototype.indexOf.call(data, 10)
  113997. if (nl > 0 && data[nl-1] === 13) nl--
  113998. if (nl > -1) {
  113999. buffer.push(data.slice(0, nl))
  114000. return ready(Buffer.concat(buffer), data.slice(nl), cb)
  114001. }
  114002. }
  114003. buffer.push(data)
  114004. bufferSize += data.length
  114005. if (bufferSize < maxBuffer) return cb()
  114006. if (strict) return cb(new Error('No newline found'))
  114007. ready(Buffer.concat(buffer), null, cb)
  114008. })
  114009. var onpreend = function() {
  114010. if (strict) return dup.destroy(new Error('No newline found'))
  114011. dup.cork()
  114012. ready(Buffer.concat(buffer), null, function(err) {
  114013. if (err) return dup.destroy(err)
  114014. dup.uncork()
  114015. })
  114016. }
  114017. var ready = function(data, overflow, cb) {
  114018. dup.removeListener('preend', onpreend)
  114019. onpeek(data, function(err, parser) {
  114020. if (err) return cb(err)
  114021. dup.setWritable(parser)
  114022. dup.setReadable(parser)
  114023. if (data) parser.write(data)
  114024. if (overflow) parser.write(overflow)
  114025. overflow = buffer = peeker = null // free the data
  114026. cb()
  114027. })
  114028. }
  114029. dup.on('preend', onpreend)
  114030. dup.setWritable(peeker)
  114031. return dup
  114032. }
  114033. module.exports = peek
  114034. /***/ }),
  114035. /* 848 */
  114036. /***/ (function(module, exports) {
  114037. // Generated by CoffeeScript 1.12.2
  114038. (function() {
  114039. var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
  114040. if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
  114041. module.exports = function() {
  114042. return performance.now();
  114043. };
  114044. } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
  114045. module.exports = function() {
  114046. return (getNanoSeconds() - nodeLoadTime) / 1e6;
  114047. };
  114048. hrtime = process.hrtime;
  114049. getNanoSeconds = function() {
  114050. var hr;
  114051. hr = hrtime();
  114052. return hr[0] * 1e9 + hr[1];
  114053. };
  114054. moduleLoadTime = getNanoSeconds();
  114055. upTime = process.uptime() * 1e9;
  114056. nodeLoadTime = moduleLoadTime - upTime;
  114057. } else if (Date.now) {
  114058. module.exports = function() {
  114059. return Date.now() - loadTime;
  114060. };
  114061. loadTime = Date.now();
  114062. } else {
  114063. module.exports = function() {
  114064. return new Date().getTime() - loadTime;
  114065. };
  114066. loadTime = new Date().getTime();
  114067. }
  114068. }).call(this);
  114069. //# sourceMappingURL=performance-now.js.map
  114070. /***/ }),
  114071. /* 849 */
  114072. /***/ (function(module, exports, __webpack_require__) {
  114073. "use strict";
  114074. module.exports = (url, opts) => {
  114075. if (typeof url !== 'string') {
  114076. throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof url}\``);
  114077. }
  114078. url = url.trim();
  114079. opts = Object.assign({https: false}, opts);
  114080. if (/^\.*\/|^(?!localhost)\w+:/.test(url)) {
  114081. return url;
  114082. }
  114083. return url.replace(/^(?!(?:\w+:)?\/\/)/, opts.https ? 'https://' : 'http://');
  114084. };
  114085. /***/ }),
  114086. /* 850 */
  114087. /***/ (function(module, exports, __webpack_require__) {
  114088. "use strict";
  114089. /*!
  114090. * preserve <https://github.com/jonschlinkert/preserve>
  114091. *
  114092. * Copyright (c) 2014-2015, Jon Schlinkert.
  114093. * Licensed under the MIT license.
  114094. */
  114095. /**
  114096. * Replace tokens in `str` with a temporary, heuristic placeholder.
  114097. *
  114098. * ```js
  114099. * tokens.before('{a\\,b}');
  114100. * //=> '{__ID1__}'
  114101. * ```
  114102. *
  114103. * @param {String} `str`
  114104. * @return {String} String with placeholders.
  114105. * @api public
  114106. */
  114107. exports.before = function before(str, re) {
  114108. return str.replace(re, function (match) {
  114109. var id = randomize();
  114110. cache[id] = match;
  114111. return '__ID' + id + '__';
  114112. });
  114113. };
  114114. /**
  114115. * Replace placeholders in `str` with original tokens.
  114116. *
  114117. * ```js
  114118. * tokens.after('{__ID1__}');
  114119. * //=> '{a\\,b}'
  114120. * ```
  114121. *
  114122. * @param {String} `str` String with placeholders
  114123. * @return {String} `str` String with original tokens.
  114124. * @api public
  114125. */
  114126. exports.after = function after(str) {
  114127. return str.replace(/__ID(.{5})__/g, function (_, id) {
  114128. return cache[id];
  114129. });
  114130. };
  114131. function randomize() {
  114132. return Math.random().toString().slice(2, 7);
  114133. }
  114134. var cache = {};
  114135. /***/ }),
  114136. /* 851 */
  114137. /***/ (function(module, exports, __webpack_require__) {
  114138. "use strict";
  114139. function makeSync(fs, name) {
  114140. const fn = fs[`${name}Sync`];
  114141. return function () {
  114142. const callback = arguments[arguments.length - 1];
  114143. const args = Array.prototype.slice.call(arguments, 0, -1);
  114144. let ret;
  114145. try {
  114146. ret = fn.apply(fs, args);
  114147. } catch (err) {
  114148. return callback(err);
  114149. }
  114150. callback(null, ret);
  114151. };
  114152. }
  114153. function syncFs(fs) {
  114154. const fns = ['mkdir', 'realpath', 'stat', 'rmdir', 'utimes'];
  114155. const obj = {};
  114156. // Create the sync versions of the methods that we need
  114157. fns.forEach((name) => {
  114158. obj[name] = makeSync(fs, name);
  114159. });
  114160. // Copy the rest of the functions
  114161. for (const key in fs) {
  114162. if (!obj[key]) {
  114163. obj[key] = fs[key];
  114164. }
  114165. }
  114166. return obj;
  114167. }
  114168. module.exports = syncFs;
  114169. /***/ }),
  114170. /* 852 */
  114171. /***/ (function(module, exports, __webpack_require__) {
  114172. "use strict";
  114173. Object.defineProperty(exports, '__esModule', { value: true });
  114174. /**
  114175. * Key a method on your object with this symbol and you can get special
  114176. * formatting for that value! See ShellStringText, ShellStringUnquoted, or
  114177. * shellStringSemicolon for examples.
  114178. * @ignore
  114179. */
  114180. const formatSymbol = Symbol('format');
  114181. /**
  114182. * This symbol is for implementing advanced behaviors like the need for extra
  114183. * carets in Windows shell strings that use pipes. If present, it's called in
  114184. * an earlier phase than formatSymbol, and is passed a mutable context that can
  114185. * be read during the format phase to influence formatting.
  114186. * @ignore
  114187. */
  114188. const preformatSymbol = Symbol('preformat');
  114189. // When minimum Node version becomes 6, replace calls to sticky with /.../y and
  114190. // inline execFrom.
  114191. let stickySupported = true;
  114192. try {
  114193. new RegExp('', 'y');
  114194. } catch (e) {
  114195. stickySupported = false;
  114196. }
  114197. const sticky = stickySupported ? source => new RegExp(source, 'y') : source => new RegExp(`^(?:${source})`);
  114198. const execFrom = stickySupported ? (re, haystack, index) => (re.lastIndex = index, re.exec(haystack)) : (re, haystack, index) => re.exec(haystack.substr(index));
  114199. function quoteForCmd(text, forceQuote) {
  114200. let caretDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  114201. // See the below blog post for an explanation of this function and
  114202. // quoteForWin32:
  114203. // https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
  114204. if (!text.length) {
  114205. return '""';
  114206. }
  114207. if (/[\n\r]/.test(text)) {
  114208. throw new Error("Line breaks can't be quoted on Windows");
  114209. }
  114210. const caretEscape = /["%]/.test(text);
  114211. text = quoteForWin32(text, forceQuote || !caretEscape && /[&()<>^|]/.test(text));
  114212. if (caretEscape) {
  114213. // See Win32Context for explanation of what caretDepth is for.
  114214. do {
  114215. text = text.replace(/[\t "%&()<>^|]/g, '^$&');
  114216. } while (caretDepth--);
  114217. }
  114218. return text;
  114219. }
  114220. const quoteForWin32 = (text, forceQuote) => forceQuote || /[\t "]/.test(text) ? `"${text.replace(/\\+(?=$|")/g, '$&$&').replace(/"/g, '\\"')}"` : text;
  114221. const cmdMetaChars = /[\t\n\r "%&()<>^|]/;
  114222. class Win32Context {
  114223. constructor() {
  114224. this.currentScope = newScope(null);
  114225. this.scopesByObject = new Map();
  114226. }
  114227. read(text) {
  114228. // When cmd.exe pipes to or from a batch file, it spawns a second copy of
  114229. // itself to run the inner command. This necessitates doubling up on carets
  114230. // so that escaped characters survive both cmd.exe invocations. See:
  114231. // https://stackoverflow.com/questions/8192318/why-does-delayed-expansion-fail-when-inside-a-piped-block-of-code#8194279
  114232. // https://ss64.com/nt/syntax-redirection.html
  114233. //
  114234. // Parentheses can create an additional subshell, requiring additional
  114235. // escaping... it's a mess.
  114236. //
  114237. // So here's what we do about it: we read all unquoted text in a shell
  114238. // string and put it through this tiny parser that looks for pipes,
  114239. // sequence operators (&, &&, ||), and parentheses. This can't be part of
  114240. // the main Puka parsing, because it can be affected by `unquoted(...)`
  114241. // values provided at evaluation time.
  114242. //
  114243. // Then, after associating each thing that needs to be quoted with a scope
  114244. // (via `mark()`), we can determine the depth of caret escaping required
  114245. // in each scope and pass it (via `Formatter::quote()`) to `quoteForCmd()`.
  114246. //
  114247. // See also `ShellStringText`, which holds the logic for the previous
  114248. // paragraph.
  114249. const length = text.length;
  114250. for (let pos = 0, match; pos < length;) {
  114251. if (match = execFrom(reUnimportant, text, pos)) {
  114252. pos += match[0].length;
  114253. }
  114254. if (pos >= length) break;
  114255. if (match = execFrom(reSeqOp, text, pos)) {
  114256. this.seq();
  114257. pos += match[0].length;
  114258. } else {
  114259. const char = text.charCodeAt(pos);
  114260. if (char === CARET) {
  114261. pos += 2;
  114262. } else if (char === QUOTE) {
  114263. // If you were foolish enough to leave a dangling quotation mark in
  114264. // an unquoted span... you're likely to have bigger problems than
  114265. // incorrect escaping. So we just do the simplest thing of looking for
  114266. // the end quote only in this piece of text.
  114267. pos += execFrom(reNotQuote, text, pos + 1)[0].length + 2;
  114268. } else {
  114269. if (char === OPEN_PAREN) {
  114270. this.enterScope();
  114271. } else if (char === CLOSE_PAREN) {
  114272. this.exitScope();
  114273. } else {
  114274. // (char === '|')
  114275. this.currentScope.depthDelta = 1;
  114276. }
  114277. pos++;
  114278. }
  114279. }
  114280. }
  114281. }
  114282. enterScope() {
  114283. this.currentScope = newScope(this.currentScope);
  114284. }
  114285. exitScope() {
  114286. this.currentScope = this.currentScope.parent || (this.currentScope.parent = newScope(null));
  114287. }
  114288. seq() {
  114289. // | binds tighter than sequence operators, so the latter create new sibling
  114290. // scopes for future |s to mutate.
  114291. this.currentScope = newScope(this.currentScope.parent);
  114292. }
  114293. mark(obj) {
  114294. this.scopesByObject.set(obj, this.currentScope);
  114295. }
  114296. at(obj) {
  114297. return { depth: getDepth(this.scopesByObject.get(obj)) };
  114298. }
  114299. }
  114300. const getDepth = scope => scope === null ? 0 : scope.depth !== -1 ? scope.depth : scope.depth = getDepth(scope.parent) + scope.depthDelta;
  114301. const newScope = parent => ({ parent, depthDelta: 0, depth: -1 });
  114302. const CARET = '^'.charCodeAt();
  114303. const QUOTE = '"'.charCodeAt();
  114304. const OPEN_PAREN = '('.charCodeAt();
  114305. const CLOSE_PAREN = ')'.charCodeAt();
  114306. const reNotQuote = sticky('[^"]*');
  114307. const reSeqOp = sticky('&&?|\\|\\|');
  114308. const reUnimportant = sticky('(?:>&|[^"$&()^|])+');
  114309. const quoteForSh = (text, forceQuote) => text.length ? forceQuote || shMetaChars.test(text) ? `'${text.replace(/'/g, "'\\''")}'`.replace(/^(?:'')+(?!$)/, '').replace(/\\'''/g, "\\'") : text : "''";
  114310. const shMetaChars = /[\t\n\r "#$&'()*;<>?\\`|~]/;
  114311. /**
  114312. * To get a Formatter, call `Formatter.for`.
  114313. *
  114314. * To create a new Formatter, pass an object to `Formatter.declare`.
  114315. *
  114316. * To set the global default Formatter, assign to `Formatter.default`.
  114317. *
  114318. * @class
  114319. * @property {Formatter} default - The Formatter to be used when no platform
  114320. * is provided—for example, when creating strings with `sh`.
  114321. * @ignore
  114322. */
  114323. function Formatter() {}
  114324. Object.assign(Formatter, /** @lends Formatter */{
  114325. /**
  114326. * Gets a Formatter that has been declared for the provided platform, or
  114327. * the base `'sh'` formatter if there is no Formatter specific to this
  114328. * platform, or the Formatter for the current platform if no specific platform
  114329. * is provided.
  114330. */
  114331. for(platform) {
  114332. return platform == null ? Formatter.default || (Formatter.default = Formatter.for(process.platform)) : Formatter._registry.get(platform) || Formatter._registry.get('sh');
  114333. },
  114334. /**
  114335. * Creates a new Formatter or mutates the properties on an existing
  114336. * Formatter. The `platform` key on the provided properties object determines
  114337. * when the Formatter is retrieved.
  114338. */
  114339. declare(props) {
  114340. const platform = props && props.platform || 'sh';
  114341. const existingFormatter = Formatter._registry.get(platform);
  114342. const formatter = Object.assign(existingFormatter || new Formatter(), props);
  114343. formatter.emptyString === void 0 && (formatter.emptyString = formatter.quote('', true));
  114344. existingFormatter || Formatter._registry.set(formatter.platform, formatter);
  114345. },
  114346. _registry: new Map(),
  114347. prototype: {
  114348. platform: 'sh',
  114349. quote: quoteForSh,
  114350. metaChars: shMetaChars,
  114351. hasExtraMetaChars: false,
  114352. statementSeparator: ';',
  114353. createContext() {
  114354. return defaultContext;
  114355. }
  114356. }
  114357. });
  114358. const defaultContext = {
  114359. at() {}
  114360. };
  114361. Formatter.declare();
  114362. Formatter.declare({
  114363. platform: 'win32',
  114364. quote(text, forceQuote, opts) {
  114365. return quoteForCmd(text, forceQuote, opts && opts.depth || 0);
  114366. },
  114367. metaChars: cmdMetaChars,
  114368. hasExtraMetaChars: true,
  114369. statementSeparator: '&',
  114370. createContext(root) {
  114371. const context = new this.Context();
  114372. root[preformatSymbol](context);
  114373. return context;
  114374. },
  114375. Context: Win32Context
  114376. });
  114377. const isObject = any => any === Object(any);
  114378. function memoize(f) {
  114379. const cache = new WeakMap();
  114380. return arg => {
  114381. let result = cache.get(arg);
  114382. if (result === void 0) {
  114383. result = f(arg);
  114384. cache.set(arg, result);
  114385. }
  114386. return result;
  114387. };
  114388. }
  114389. /**
  114390. * Represents a contiguous span of text that may or must be quoted. The contents
  114391. * may already contain quoted segments, which will always be quoted. If unquoted
  114392. * segments also require quoting, the entire span will be quoted together.
  114393. * @ignore
  114394. */
  114395. class ShellStringText {
  114396. constructor(contents, untested) {
  114397. this.contents = contents;
  114398. this.untested = untested;
  114399. }
  114400. [formatSymbol](formatter, context) {
  114401. const unformattedContents = this.contents;
  114402. const length = unformattedContents.length;
  114403. const contents = new Array(length);
  114404. for (let i = 0; i < length; i++) {
  114405. const c = unformattedContents[i];
  114406. contents[i] = isObject(c) && formatSymbol in c ? c[formatSymbol](formatter) : c;
  114407. }
  114408. for (let unquoted = true, i = 0; i < length; i++) {
  114409. const content = contents[i];
  114410. if (content === null) {
  114411. unquoted = !unquoted;
  114412. } else {
  114413. if (unquoted && (formatter.hasExtraMetaChars || this.untested && this.untested.has(i)) && formatter.metaChars.test(content)) {
  114414. return formatter.quote(contents.join(''), false, context.at(this));
  114415. }
  114416. }
  114417. }
  114418. const parts = [];
  114419. for (let quoted = null, i = 0; i < length; i++) {
  114420. const content = contents[i];
  114421. if (content === null) {
  114422. quoted = quoted ? (parts.push(formatter.quote(quoted.join(''), true, context.at(this))), null) : [];
  114423. } else {
  114424. (quoted || parts).push(content);
  114425. }
  114426. }
  114427. const result = parts.join('');
  114428. return result.length ? result : formatter.emptyString;
  114429. }
  114430. [preformatSymbol](context) {
  114431. context.mark(this);
  114432. }
  114433. }
  114434. /**
  114435. * Represents a contiguous span of text that will not be quoted.
  114436. * @ignore
  114437. */
  114438. class ShellStringUnquoted {
  114439. constructor(value) {
  114440. this.value = value;
  114441. }
  114442. [formatSymbol]() {
  114443. return this.value;
  114444. }
  114445. [preformatSymbol](context) {
  114446. context.read(this.value);
  114447. }
  114448. }
  114449. /**
  114450. * Represents a semicolon... or an ampersand, on Windows.
  114451. * @ignore
  114452. */
  114453. const shellStringSemicolon = {
  114454. [formatSymbol](formatter) {
  114455. return formatter.statementSeparator;
  114456. },
  114457. [preformatSymbol](context) {
  114458. context.seq();
  114459. }
  114460. };
  114461. const PLACEHOLDER = {};
  114462. const parse = memoize(templateSpans => {
  114463. // These are the token types our DSL can recognize. Their values won't escape
  114464. // this function.
  114465. const TOKEN_TEXT = 0;
  114466. const TOKEN_QUOTE = 1;
  114467. const TOKEN_SEMI = 2;
  114468. const TOKEN_UNQUOTED = 3;
  114469. const TOKEN_SPACE = 4;
  114470. const TOKEN_REDIRECT = 5;
  114471. const result = [];
  114472. let placeholderCount = 0;
  114473. let prefix = null;
  114474. let onlyPrefixOnce = false;
  114475. let contents = [];
  114476. let quote = 0;
  114477. const lastSpan = templateSpans.length - 1;
  114478. for (let spanIndex = 0; spanIndex <= lastSpan; spanIndex++) {
  114479. const templateSpan = templateSpans[spanIndex];
  114480. const posEnd = templateSpan.length;
  114481. let tokenStart = 0;
  114482. if (spanIndex) {
  114483. placeholderCount++;
  114484. contents.push(PLACEHOLDER);
  114485. }
  114486. // For each span, we first do a recognizing pass in which we use regular
  114487. // expressions to identify the positions of tokens in the text, and then
  114488. // a second pass that actually splits the text into the minimum number of
  114489. // substrings necessary.
  114490. const recognized = []; // [type1, index1, type2, index2...]
  114491. let firstWordBreak = -1;
  114492. let lastWordBreak = -1;
  114493. {
  114494. let pos = 0,
  114495. match;
  114496. while (pos < posEnd) {
  114497. if (quote) {
  114498. if (match = execFrom(quote === CHAR_SQUO ? reQuotation1 : reQuotation2, templateSpan, pos)) {
  114499. recognized.push(TOKEN_TEXT, pos);
  114500. pos += match[0].length;
  114501. }
  114502. if (pos < posEnd) {
  114503. recognized.push(TOKEN_QUOTE, pos++);
  114504. quote = 0;
  114505. }
  114506. } else {
  114507. if (match = execFrom(reText, templateSpan, pos)) {
  114508. const setBreaks = match[1] != null;
  114509. setBreaks && firstWordBreak < 0 && (firstWordBreak = pos);
  114510. recognized.push(setBreaks ? TOKEN_UNQUOTED : TOKEN_TEXT, pos);
  114511. pos += match[0].length;
  114512. setBreaks && (lastWordBreak = pos);
  114513. }
  114514. if (match = execFrom(reRedirectOrSpace, templateSpan, pos)) {
  114515. firstWordBreak < 0 && (firstWordBreak = pos);
  114516. lastWordBreak = pos;
  114517. recognized.push(match[1] ? TOKEN_REDIRECT : TOKEN_SPACE, pos);
  114518. pos += match[0].length;
  114519. }
  114520. const char = templateSpan.charCodeAt(pos);
  114521. if (char === CHAR_SEMI) {
  114522. firstWordBreak < 0 && (firstWordBreak = pos);
  114523. recognized.push(TOKEN_SEMI, pos++);
  114524. lastWordBreak = pos;
  114525. } else if (char === CHAR_SQUO || char === CHAR_DQUO) {
  114526. recognized.push(TOKEN_QUOTE, pos++);
  114527. quote = char;
  114528. }
  114529. }
  114530. }
  114531. }
  114532. // Word breaks are only important if they separate words with placeholders,
  114533. // so we can ignore the first/last break if this is the first/last span.
  114534. spanIndex === 0 && (firstWordBreak = -1);
  114535. spanIndex === lastSpan && (lastWordBreak = posEnd);
  114536. // Here begins the second pass mentioned above. This loop runs one more
  114537. // iteration than there are tokens in recognized, because it handles tokens
  114538. // on a one-iteration delay; hence the i <= iEnd instead of i < iEnd.
  114539. const iEnd = recognized.length;
  114540. for (let i = 0, type = -1; i <= iEnd; i += 2) {
  114541. let typeNext = -1,
  114542. pos;
  114543. if (i === iEnd) {
  114544. pos = posEnd;
  114545. } else {
  114546. typeNext = recognized[i];
  114547. pos = recognized[i + 1];
  114548. // If the next token is space or redirect, but there's another word
  114549. // break in this span, then we can handle that token the same way we
  114550. // would handle unquoted text because it isn't being attached to a
  114551. // placeholder.
  114552. typeNext >= TOKEN_SPACE && pos !== lastWordBreak && (typeNext = TOKEN_UNQUOTED);
  114553. }
  114554. const breakHere = pos === firstWordBreak || pos === lastWordBreak;
  114555. if (pos && (breakHere || typeNext !== type)) {
  114556. let value = type === TOKEN_QUOTE ? null : type === TOKEN_SEMI ? shellStringSemicolon : templateSpan.substring(tokenStart, pos);
  114557. if (type >= TOKEN_SEMI) {
  114558. // This branch handles semicolons, unquoted text, spaces, and
  114559. // redirects. shellStringSemicolon is already a formatSymbol object;
  114560. // the rest need to be wrapped.
  114561. type === TOKEN_SEMI || (value = new ShellStringUnquoted(value));
  114562. // We don't need to check placeholderCount here like we do below;
  114563. // that's only relevant during the first word break of the span, and
  114564. // because this iteration of the loop is processing the token that
  114565. // was checked for breaks in the previous iteration, it will have
  114566. // already been handled. For the same reason, prefix is guaranteed to
  114567. // be null.
  114568. if (contents.length) {
  114569. result.push(new ShellStringText(contents, null));
  114570. contents = [];
  114571. }
  114572. // Only spaces and redirects become prefixes, but not if they've been
  114573. // rewritten to unquoted above.
  114574. if (type >= TOKEN_SPACE) {
  114575. prefix = value;
  114576. onlyPrefixOnce = type === TOKEN_SPACE;
  114577. } else {
  114578. result.push(value);
  114579. }
  114580. } else {
  114581. contents.push(value);
  114582. }
  114583. tokenStart = pos;
  114584. }
  114585. if (breakHere) {
  114586. if (placeholderCount) {
  114587. result.push({ contents, placeholderCount, prefix, onlyPrefixOnce });
  114588. } else {
  114589. // There's no prefix to handle in this branch; a prefix prior to this
  114590. // span would mean placeholderCount > 0, and a prefix in this span
  114591. // can't be created because spaces and redirects get rewritten to
  114592. // unquoted before the last word break.
  114593. contents.length && result.push(new ShellStringText(contents, null));
  114594. }
  114595. placeholderCount = 0;prefix = null;onlyPrefixOnce = false;
  114596. contents = [];
  114597. }
  114598. type = typeNext;
  114599. }
  114600. }
  114601. if (quote) {
  114602. throw new SyntaxError(`String is missing a ${String.fromCharCode(quote)} character`);
  114603. }
  114604. return result;
  114605. });
  114606. const CHAR_SEMI = ';'.charCodeAt();
  114607. const CHAR_SQUO = "'".charCodeAt();
  114608. const CHAR_DQUO = '"'.charCodeAt();
  114609. const reQuotation1 = sticky("[^']+");
  114610. const reQuotation2 = sticky('[^"]+');
  114611. const reText = sticky('[^\\s"#$&\'();<>\\\\`|]+|([#$&()\\\\`|]+)');
  114612. const reRedirectOrSpace = sticky('((?:\\s+\\d+|\\s*)[<>]+\\s*)|\\s+');
  114613. class BitSet {
  114614. constructor() {
  114615. this.vector = new Int32Array(1);
  114616. }
  114617. has(n) {
  114618. return (this.vector[n >>> 5] & 1 << n) !== 0;
  114619. }
  114620. add(n) {
  114621. const i = n >>> 5,
  114622. requiredLength = i + 1;
  114623. let vector = this.vector;var _vector = vector;
  114624. let length = _vector.length;
  114625. if (requiredLength > length) {
  114626. while (requiredLength > (length *= 2));
  114627. const oldValues = vector;
  114628. vector = new Int32Array(length);
  114629. vector.set(oldValues);
  114630. this.vector = vector;
  114631. }
  114632. vector[i] |= 1 << n;
  114633. }
  114634. }
  114635. function evaluate(template, values) {
  114636. values = values.map(toStringishArray);
  114637. const children = [];
  114638. let valuesStart = 0;
  114639. for (let i = 0, iMax = template.length; i < iMax; i++) {
  114640. const word = template[i];
  114641. if (formatSymbol in word) {
  114642. children.push(word);
  114643. continue;
  114644. }
  114645. const contents = word.contents,
  114646. placeholderCount = word.placeholderCount,
  114647. prefix = word.prefix,
  114648. onlyPrefixOnce = word.onlyPrefixOnce;
  114649. const kMax = contents.length;
  114650. const valuesEnd = valuesStart + placeholderCount;
  114651. const tuples = cartesianProduct(values, valuesStart, valuesEnd);
  114652. valuesStart = valuesEnd;
  114653. for (let j = 0, jMax = tuples.length; j < jMax; j++) {
  114654. const needSpace = j > 0;
  114655. const tuple = tuples[j];
  114656. (needSpace || prefix) && children.push(needSpace && (onlyPrefixOnce || !prefix) ? unquotedSpace : prefix);
  114657. let interpolatedContents = [];
  114658. let untested = null;
  114659. let quoting = false;
  114660. let tupleIndex = 0;
  114661. for (let k = 0; k < kMax; k++) {
  114662. const content = contents[k];
  114663. if (content === PLACEHOLDER) {
  114664. const value = tuple[tupleIndex++];
  114665. if (quoting) {
  114666. interpolatedContents.push(value);
  114667. } else {
  114668. if (isObject(value) && formatSymbol in value) {
  114669. if (interpolatedContents.length) {
  114670. children.push(new ShellStringText(interpolatedContents, untested));
  114671. interpolatedContents = [];
  114672. untested = null;
  114673. }
  114674. children.push(value);
  114675. } else {
  114676. (untested || (untested = new BitSet())).add(interpolatedContents.length);
  114677. interpolatedContents.push(value);
  114678. }
  114679. }
  114680. } else {
  114681. interpolatedContents.push(content);
  114682. content === null && (quoting = !quoting);
  114683. }
  114684. }
  114685. if (interpolatedContents.length) {
  114686. children.push(new ShellStringText(interpolatedContents, untested));
  114687. }
  114688. }
  114689. }
  114690. return children;
  114691. }
  114692. const primToStringish = value => value == null ? '' + value : value;
  114693. function toStringishArray(value) {
  114694. let array;
  114695. switch (true) {
  114696. default:
  114697. if (isObject(value)) {
  114698. if (Array.isArray(value)) {
  114699. array = value;break;
  114700. }
  114701. if (Symbol.iterator in value) {
  114702. array = Array.from(value);break;
  114703. }
  114704. }
  114705. array = [value];
  114706. }
  114707. return array.map(primToStringish);
  114708. }
  114709. function cartesianProduct(arrs, start, end) {
  114710. const size = end - start;
  114711. let resultLength = 1;
  114712. for (let i = start; i < end; i++) {
  114713. resultLength *= arrs[i].length;
  114714. }
  114715. if (resultLength > 1e6) {
  114716. throw new RangeError("Far too many elements to interpolate");
  114717. }
  114718. const result = new Array(resultLength);
  114719. const indices = new Array(size).fill(0);
  114720. for (let i = 0; i < resultLength; i++) {
  114721. const value = result[i] = new Array(size);
  114722. for (let j = 0; j < size; j++) {
  114723. value[j] = arrs[j + start][indices[j]];
  114724. }
  114725. for (let j = size - 1; j >= 0; j--) {
  114726. if (++indices[j] < arrs[j + start].length) break;
  114727. indices[j] = 0;
  114728. }
  114729. }
  114730. return result;
  114731. }
  114732. const unquotedSpace = new ShellStringUnquoted(' ');
  114733. /**
  114734. * A ShellString represents a shell command after it has been interpolated, but
  114735. * before it has been formatted for a particular platform. ShellStrings are
  114736. * useful if you want to prepare a command for a different platform than the
  114737. * current one, for instance.
  114738. *
  114739. * To create a ShellString, use `ShellString.sh` the same way you would use
  114740. * top-level `sh`.
  114741. */
  114742. class ShellString {
  114743. /** @hideconstructor */
  114744. constructor(children) {
  114745. this.children = children;
  114746. }
  114747. /**
  114748. * `ShellString.sh` is a template tag just like `sh`; the only difference is
  114749. * that this function returns a ShellString which has not yet been formatted
  114750. * into a String.
  114751. * @returns {ShellString}
  114752. * @function sh
  114753. * @static
  114754. * @memberof ShellString
  114755. */
  114756. static sh(templateSpans) {
  114757. for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  114758. values[_key - 1] = arguments[_key];
  114759. }
  114760. return new ShellString(evaluate(parse(templateSpans), values));
  114761. }
  114762. /**
  114763. * A method to format a ShellString into a regular String formatted for a
  114764. * particular platform.
  114765. *
  114766. * @param {String} [platform] a value that `process.platform` might take:
  114767. * `'win32'`, `'linux'`, etc.; determines how the string is to be formatted.
  114768. * When omitted, effectively the same as `process.platform`.
  114769. * @returns {String}
  114770. */
  114771. toString(platform) {
  114772. return this[formatSymbol](Formatter.for(platform));
  114773. }
  114774. [formatSymbol](formatter) {
  114775. let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : formatter.createContext(this);
  114776. return this.children.map(child => child[formatSymbol](formatter, context)).join('');
  114777. }
  114778. [preformatSymbol](context) {
  114779. const children = this.children;
  114780. for (let i = 0, iMax = children.length; i < iMax; i++) {
  114781. const child = children[i];
  114782. if (preformatSymbol in child) {
  114783. child[preformatSymbol](context);
  114784. }
  114785. }
  114786. }
  114787. }
  114788. /**
  114789. * A Windows-specific version of {@link quoteForShell}.
  114790. * @param {String} text to be quoted
  114791. * @param {Boolean} [forceQuote] whether to always add quotes even if the string
  114792. * is already safe. Defaults to `false`.
  114793. */
  114794. /**
  114795. * A Unix-specific version of {@link quoteForShell}.
  114796. * @param {String} text to be quoted
  114797. * @param {Boolean} [forceQuote] whether to always add quotes even if the string
  114798. * is already safe. Defaults to `false`.
  114799. */
  114800. /**
  114801. * Quotes a string for injecting into a shell command.
  114802. *
  114803. * This function is exposed for some hypothetical case when the `sh` DSL simply
  114804. * won't do; `sh` is expected to be the more convenient option almost always.
  114805. * Compare:
  114806. *
  114807. * ```javascript
  114808. * console.log('cmd' + args.map(a => ' ' + quoteForShell(a)).join(''));
  114809. * console.log(sh`cmd ${args}`); // same as above
  114810. *
  114811. * console.log('cmd' + args.map(a => ' ' + quoteForShell(a, true)).join(''));
  114812. * console.log(sh`cmd "${args}"`); // same as above
  114813. * ```
  114814. *
  114815. * Additionally, on Windows, `sh` checks the entire command string for pipes,
  114816. * which subtly change how arguments need to be quoted. If your commands may
  114817. * involve pipes, you are strongly encouraged to use `sh` and not try to roll
  114818. * your own with `quoteForShell`.
  114819. *
  114820. * @param {String} text to be quoted
  114821. * @param {Boolean} [forceQuote] whether to always add quotes even if the string
  114822. * is already safe. Defaults to `false`.
  114823. * @param {String} [platform] a value that `process.platform` might take:
  114824. * `'win32'`, `'linux'`, etc.; determines how the string is to be formatted.
  114825. * When omitted, effectively the same as `process.platform`.
  114826. *
  114827. * @returns {String} a string that is safe for the current (or specified)
  114828. * platform.
  114829. */
  114830. function quoteForShell(text, forceQuote, platform) {
  114831. return Formatter.for(platform).quote(text, forceQuote);
  114832. }
  114833. /**
  114834. * A string template tag for safely constructing cross-platform shell commands.
  114835. *
  114836. * An `sh` template is not actually treated as a literal string to be
  114837. * interpolated; instead, it is a tiny DSL designed to make working with shell
  114838. * strings safe, simple, and straightforward. To get started quickly, see the
  114839. * examples below. {@link #the-sh-dsl More detailed documentation} is available
  114840. * further down.
  114841. *
  114842. * @name sh
  114843. * @example
  114844. * const title = '"this" & "that"';
  114845. * sh`script --title=${title}`; // => "script '--title=\"this\" & \"that\"'"
  114846. * // Note: these examples show results for non-Windows platforms.
  114847. * // On Windows, the above would instead be
  114848. * // 'script ^"--title=\\^"this\\^" ^& \\^"that\\^"^"'.
  114849. *
  114850. * const names = ['file1', 'file 2'];
  114851. * sh`rimraf ${names}.txt`; // => "rimraf file1.txt 'file 2.txt'"
  114852. *
  114853. * const cmd1 = ['cat', 'file 1.txt', 'file 2.txt'];
  114854. * const cmd2 = ['use-input', '-abc'];
  114855. * sh`${cmd1}|${cmd2}`; // => "cat 'file 1.txt' 'file 2.txt'|use-input -abc"
  114856. *
  114857. * @returns {String} - a string formatted for the platform Node is currently
  114858. * running on.
  114859. */
  114860. const sh = function () {
  114861. return ShellString.sh.apply(ShellString, arguments).toString();
  114862. };
  114863. /**
  114864. * This function permits raw strings to be interpolated into a `sh` template.
  114865. *
  114866. * **IMPORTANT**: If you're using Puka due to security concerns, make sure you
  114867. * don't pass any untrusted content to `unquoted`. This may be obvious, but
  114868. * stray punctuation in an `unquoted` section can compromise the safety of the
  114869. * entire shell command.
  114870. *
  114871. * @param value - any value (it will be treated as a string)
  114872. *
  114873. * @example
  114874. * const both = true;
  114875. * sh`foo ${unquoted(both ? '&&' : '||')} bar`; // => 'foo && bar'
  114876. */
  114877. const unquoted = value => new ShellStringUnquoted(value);
  114878. exports.Formatter = Formatter;
  114879. exports.ShellString = ShellString;
  114880. exports.ShellStringText = ShellStringText;
  114881. exports.ShellStringUnquoted = ShellStringUnquoted;
  114882. exports.quoteForCmd = quoteForCmd;
  114883. exports.quoteForSh = quoteForSh;
  114884. exports.quoteForShell = quoteForShell;
  114885. exports.sh = sh;
  114886. exports.shellStringSemicolon = shellStringSemicolon;
  114887. exports.formatSymbol = formatSymbol;
  114888. exports.preformatSymbol = preformatSymbol;
  114889. exports.unquoted = unquoted;
  114890. /***/ }),
  114891. /* 853 */
  114892. /***/ (function(module, exports, __webpack_require__) {
  114893. var once = __webpack_require__(134)
  114894. var eos = __webpack_require__(164)
  114895. var fs = __webpack_require__(12) // we only need fs to get the ReadStream and WriteStream prototypes
  114896. var noop = function () {}
  114897. var isFn = function (fn) {
  114898. return typeof fn === 'function'
  114899. }
  114900. var isFS = function (stream) {
  114901. if (!fs) return false // browser
  114902. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  114903. }
  114904. var isRequest = function (stream) {
  114905. return stream.setHeader && isFn(stream.abort)
  114906. }
  114907. var destroyer = function (stream, reading, writing, callback) {
  114908. callback = once(callback)
  114909. var closed = false
  114910. stream.on('close', function () {
  114911. closed = true
  114912. })
  114913. eos(stream, {readable: reading, writable: writing}, function (err) {
  114914. if (err) return callback(err)
  114915. closed = true
  114916. callback()
  114917. })
  114918. var destroyed = false
  114919. return function (err) {
  114920. if (closed) return
  114921. if (destroyed) return
  114922. destroyed = true
  114923. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  114924. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  114925. if (isFn(stream.destroy)) return stream.destroy()
  114926. callback(err || new Error('stream was destroyed'))
  114927. }
  114928. }
  114929. var call = function (fn) {
  114930. fn()
  114931. }
  114932. var pipe = function (from, to) {
  114933. return from.pipe(to)
  114934. }
  114935. var pump = function () {
  114936. var streams = Array.prototype.slice.call(arguments)
  114937. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  114938. if (Array.isArray(streams[0])) streams = streams[0]
  114939. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  114940. var error
  114941. var destroys = streams.map(function (stream, i) {
  114942. var reading = i < streams.length - 1
  114943. var writing = i > 0
  114944. return destroyer(stream, reading, writing, function (err) {
  114945. if (!error) error = err
  114946. if (err) destroys.forEach(call)
  114947. if (reading) return
  114948. destroys.forEach(call)
  114949. callback(error)
  114950. })
  114951. })
  114952. return streams.reduce(pipe)
  114953. }
  114954. module.exports = pump
  114955. /***/ }),
  114956. /* 854 */
  114957. /***/ (function(module, exports, __webpack_require__) {
  114958. var pump = __webpack_require__(855)
  114959. var inherits = __webpack_require__(78)
  114960. var Duplexify = __webpack_require__(349)
  114961. var toArray = function(args) {
  114962. if (!args.length) return []
  114963. return Array.isArray(args[0]) ? args[0] : Array.prototype.slice.call(args)
  114964. }
  114965. var define = function(opts) {
  114966. var Pumpify = function() {
  114967. var streams = toArray(arguments)
  114968. if (!(this instanceof Pumpify)) return new Pumpify(streams)
  114969. Duplexify.call(this, null, null, opts)
  114970. if (streams.length) this.setPipeline(streams)
  114971. }
  114972. inherits(Pumpify, Duplexify)
  114973. Pumpify.prototype.setPipeline = function() {
  114974. var streams = toArray(arguments)
  114975. var self = this
  114976. var ended = false
  114977. var w = streams[0]
  114978. var r = streams[streams.length-1]
  114979. r = r.readable ? r : null
  114980. w = w.writable ? w : null
  114981. var onclose = function() {
  114982. streams[0].emit('error', new Error('stream was destroyed'))
  114983. }
  114984. this.on('close', onclose)
  114985. this.on('prefinish', function() {
  114986. if (!ended) self.cork()
  114987. })
  114988. pump(streams, function(err) {
  114989. self.removeListener('close', onclose)
  114990. if (err) return self.destroy(err.message === 'premature close' ? null : err)
  114991. ended = true
  114992. // pump ends after the last stream is not writable *but*
  114993. // pumpify still forwards the readable part so we need to catch errors
  114994. // still, so reenable autoDestroy in this case
  114995. if (self._autoDestroy === false) self._autoDestroy = true
  114996. self.uncork()
  114997. })
  114998. if (this.destroyed) return onclose()
  114999. this.setWritable(w)
  115000. this.setReadable(r)
  115001. }
  115002. return Pumpify
  115003. }
  115004. module.exports = define({autoDestroy:false, destroy:false})
  115005. module.exports.obj = define({autoDestroy: false, destroy:false, objectMode:true, highWaterMark:16})
  115006. module.exports.ctor = define
  115007. /***/ }),
  115008. /* 855 */
  115009. /***/ (function(module, exports, __webpack_require__) {
  115010. var once = __webpack_require__(134)
  115011. var eos = __webpack_require__(164)
  115012. var fs = __webpack_require__(12) // we only need fs to get the ReadStream and WriteStream prototypes
  115013. var noop = function () {}
  115014. var ancient = /^v?\.0/.test(process.version)
  115015. var isFn = function (fn) {
  115016. return typeof fn === 'function'
  115017. }
  115018. var isFS = function (stream) {
  115019. if (!ancient) return false // newer node version do not need to care about fs is a special way
  115020. if (!fs) return false // browser
  115021. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  115022. }
  115023. var isRequest = function (stream) {
  115024. return stream.setHeader && isFn(stream.abort)
  115025. }
  115026. var destroyer = function (stream, reading, writing, callback) {
  115027. callback = once(callback)
  115028. var closed = false
  115029. stream.on('close', function () {
  115030. closed = true
  115031. })
  115032. eos(stream, {readable: reading, writable: writing}, function (err) {
  115033. if (err) return callback(err)
  115034. closed = true
  115035. callback()
  115036. })
  115037. var destroyed = false
  115038. return function (err) {
  115039. if (closed) return
  115040. if (destroyed) return
  115041. destroyed = true
  115042. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  115043. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  115044. if (isFn(stream.destroy)) return stream.destroy()
  115045. callback(err || new Error('stream was destroyed'))
  115046. }
  115047. }
  115048. var call = function (fn) {
  115049. fn()
  115050. }
  115051. var pipe = function (from, to) {
  115052. return from.pipe(to)
  115053. }
  115054. var pump = function () {
  115055. var streams = Array.prototype.slice.call(arguments)
  115056. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  115057. if (Array.isArray(streams[0])) streams = streams[0]
  115058. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  115059. var error
  115060. var destroys = streams.map(function (stream, i) {
  115061. var reading = i < streams.length - 1
  115062. var writing = i > 0
  115063. return destroyer(stream, reading, writing, function (err) {
  115064. if (!error) error = err
  115065. if (err) destroys.forEach(call)
  115066. if (reading) return
  115067. destroys.forEach(call)
  115068. callback(error)
  115069. })
  115070. })
  115071. streams.reduce(pipe)
  115072. }
  115073. module.exports = pump
  115074. /***/ }),
  115075. /* 856 */
  115076. /***/ (function(module, exports, __webpack_require__) {
  115077. "use strict";
  115078. var utils = __webpack_require__(375);
  115079. var has = Object.prototype.hasOwnProperty;
  115080. var defaults = {
  115081. allowDots: false,
  115082. allowPrototypes: false,
  115083. arrayLimit: 20,
  115084. decoder: utils.decode,
  115085. delimiter: '&',
  115086. depth: 5,
  115087. parameterLimit: 1000,
  115088. plainObjects: false,
  115089. strictNullHandling: false
  115090. };
  115091. var parseValues = function parseQueryStringValues(str, options) {
  115092. var obj = {};
  115093. var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
  115094. var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
  115095. var parts = cleanStr.split(options.delimiter, limit);
  115096. for (var i = 0; i < parts.length; ++i) {
  115097. var part = parts[i];
  115098. var bracketEqualsPos = part.indexOf(']=');
  115099. var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
  115100. var key, val;
  115101. if (pos === -1) {
  115102. key = options.decoder(part, defaults.decoder);
  115103. val = options.strictNullHandling ? null : '';
  115104. } else {
  115105. key = options.decoder(part.slice(0, pos), defaults.decoder);
  115106. val = options.decoder(part.slice(pos + 1), defaults.decoder);
  115107. }
  115108. if (has.call(obj, key)) {
  115109. obj[key] = [].concat(obj[key]).concat(val);
  115110. } else {
  115111. obj[key] = val;
  115112. }
  115113. }
  115114. return obj;
  115115. };
  115116. var parseObject = function (chain, val, options) {
  115117. var leaf = val;
  115118. for (var i = chain.length - 1; i >= 0; --i) {
  115119. var obj;
  115120. var root = chain[i];
  115121. if (root === '[]') {
  115122. obj = [];
  115123. obj = obj.concat(leaf);
  115124. } else {
  115125. obj = options.plainObjects ? Object.create(null) : {};
  115126. var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
  115127. var index = parseInt(cleanRoot, 10);
  115128. if (
  115129. !isNaN(index)
  115130. && root !== cleanRoot
  115131. && String(index) === cleanRoot
  115132. && index >= 0
  115133. && (options.parseArrays && index <= options.arrayLimit)
  115134. ) {
  115135. obj = [];
  115136. obj[index] = leaf;
  115137. } else {
  115138. obj[cleanRoot] = leaf;
  115139. }
  115140. }
  115141. leaf = obj;
  115142. }
  115143. return leaf;
  115144. };
  115145. var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
  115146. if (!givenKey) {
  115147. return;
  115148. }
  115149. // Transform dot notation to bracket notation
  115150. var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
  115151. // The regex chunks
  115152. var brackets = /(\[[^[\]]*])/;
  115153. var child = /(\[[^[\]]*])/g;
  115154. // Get the parent
  115155. var segment = brackets.exec(key);
  115156. var parent = segment ? key.slice(0, segment.index) : key;
  115157. // Stash the parent if it exists
  115158. var keys = [];
  115159. if (parent) {
  115160. // If we aren't using plain objects, optionally prefix keys
  115161. // that would overwrite object prototype properties
  115162. if (!options.plainObjects && has.call(Object.prototype, parent)) {
  115163. if (!options.allowPrototypes) {
  115164. return;
  115165. }
  115166. }
  115167. keys.push(parent);
  115168. }
  115169. // Loop through children appending to the array until we hit depth
  115170. var i = 0;
  115171. while ((segment = child.exec(key)) !== null && i < options.depth) {
  115172. i += 1;
  115173. if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
  115174. if (!options.allowPrototypes) {
  115175. return;
  115176. }
  115177. }
  115178. keys.push(segment[1]);
  115179. }
  115180. // If there's a remainder, just add whatever is left
  115181. if (segment) {
  115182. keys.push('[' + key.slice(segment.index) + ']');
  115183. }
  115184. return parseObject(keys, val, options);
  115185. };
  115186. module.exports = function (str, opts) {
  115187. var options = opts ? utils.assign({}, opts) : {};
  115188. if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
  115189. throw new TypeError('Decoder has to be a function.');
  115190. }
  115191. options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
  115192. options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
  115193. options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
  115194. options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
  115195. options.parseArrays = options.parseArrays !== false;
  115196. options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
  115197. options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
  115198. options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
  115199. options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
  115200. options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
  115201. options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
  115202. if (str === '' || str === null || typeof str === 'undefined') {
  115203. return options.plainObjects ? Object.create(null) : {};
  115204. }
  115205. var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
  115206. var obj = options.plainObjects ? Object.create(null) : {};
  115207. // Iterate over the keys and setup the new object
  115208. var keys = Object.keys(tempObj);
  115209. for (var i = 0; i < keys.length; ++i) {
  115210. var key = keys[i];
  115211. var newObj = parseKeys(key, tempObj[key], options);
  115212. obj = utils.merge(obj, newObj, options);
  115213. }
  115214. return utils.compact(obj);
  115215. };
  115216. /***/ }),
  115217. /* 857 */
  115218. /***/ (function(module, exports, __webpack_require__) {
  115219. "use strict";
  115220. var utils = __webpack_require__(375);
  115221. var formats = __webpack_require__(373);
  115222. var arrayPrefixGenerators = {
  115223. brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
  115224. return prefix + '[]';
  115225. },
  115226. indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
  115227. return prefix + '[' + key + ']';
  115228. },
  115229. repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
  115230. return prefix;
  115231. }
  115232. };
  115233. var toISO = Date.prototype.toISOString;
  115234. var defaults = {
  115235. delimiter: '&',
  115236. encode: true,
  115237. encoder: utils.encode,
  115238. encodeValuesOnly: false,
  115239. serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
  115240. return toISO.call(date);
  115241. },
  115242. skipNulls: false,
  115243. strictNullHandling: false
  115244. };
  115245. var stringify = function stringify( // eslint-disable-line func-name-matching
  115246. object,
  115247. prefix,
  115248. generateArrayPrefix,
  115249. strictNullHandling,
  115250. skipNulls,
  115251. encoder,
  115252. filter,
  115253. sort,
  115254. allowDots,
  115255. serializeDate,
  115256. formatter,
  115257. encodeValuesOnly
  115258. ) {
  115259. var obj = object;
  115260. if (typeof filter === 'function') {
  115261. obj = filter(prefix, obj);
  115262. } else if (obj instanceof Date) {
  115263. obj = serializeDate(obj);
  115264. } else if (obj === null) {
  115265. if (strictNullHandling) {
  115266. return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
  115267. }
  115268. obj = '';
  115269. }
  115270. if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
  115271. if (encoder) {
  115272. var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
  115273. return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
  115274. }
  115275. return [formatter(prefix) + '=' + formatter(String(obj))];
  115276. }
  115277. var values = [];
  115278. if (typeof obj === 'undefined') {
  115279. return values;
  115280. }
  115281. var objKeys;
  115282. if (Array.isArray(filter)) {
  115283. objKeys = filter;
  115284. } else {
  115285. var keys = Object.keys(obj);
  115286. objKeys = sort ? keys.sort(sort) : keys;
  115287. }
  115288. for (var i = 0; i < objKeys.length; ++i) {
  115289. var key = objKeys[i];
  115290. if (skipNulls && obj[key] === null) {
  115291. continue;
  115292. }
  115293. if (Array.isArray(obj)) {
  115294. values = values.concat(stringify(
  115295. obj[key],
  115296. generateArrayPrefix(prefix, key),
  115297. generateArrayPrefix,
  115298. strictNullHandling,
  115299. skipNulls,
  115300. encoder,
  115301. filter,
  115302. sort,
  115303. allowDots,
  115304. serializeDate,
  115305. formatter,
  115306. encodeValuesOnly
  115307. ));
  115308. } else {
  115309. values = values.concat(stringify(
  115310. obj[key],
  115311. prefix + (allowDots ? '.' + key : '[' + key + ']'),
  115312. generateArrayPrefix,
  115313. strictNullHandling,
  115314. skipNulls,
  115315. encoder,
  115316. filter,
  115317. sort,
  115318. allowDots,
  115319. serializeDate,
  115320. formatter,
  115321. encodeValuesOnly
  115322. ));
  115323. }
  115324. }
  115325. return values;
  115326. };
  115327. module.exports = function (object, opts) {
  115328. var obj = object;
  115329. var options = opts ? utils.assign({}, opts) : {};
  115330. if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
  115331. throw new TypeError('Encoder has to be a function.');
  115332. }
  115333. var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
  115334. var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
  115335. var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
  115336. var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
  115337. var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
  115338. var sort = typeof options.sort === 'function' ? options.sort : null;
  115339. var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
  115340. var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
  115341. var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
  115342. if (typeof options.format === 'undefined') {
  115343. options.format = formats['default'];
  115344. } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
  115345. throw new TypeError('Unknown format option provided.');
  115346. }
  115347. var formatter = formats.formatters[options.format];
  115348. var objKeys;
  115349. var filter;
  115350. if (typeof options.filter === 'function') {
  115351. filter = options.filter;
  115352. obj = filter('', obj);
  115353. } else if (Array.isArray(options.filter)) {
  115354. filter = options.filter;
  115355. objKeys = filter;
  115356. }
  115357. var keys = [];
  115358. if (typeof obj !== 'object' || obj === null) {
  115359. return '';
  115360. }
  115361. var arrayFormat;
  115362. if (options.arrayFormat in arrayPrefixGenerators) {
  115363. arrayFormat = options.arrayFormat;
  115364. } else if ('indices' in options) {
  115365. arrayFormat = options.indices ? 'indices' : 'repeat';
  115366. } else {
  115367. arrayFormat = 'indices';
  115368. }
  115369. var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
  115370. if (!objKeys) {
  115371. objKeys = Object.keys(obj);
  115372. }
  115373. if (sort) {
  115374. objKeys.sort(sort);
  115375. }
  115376. for (var i = 0; i < objKeys.length; ++i) {
  115377. var key = objKeys[i];
  115378. if (skipNulls && obj[key] === null) {
  115379. continue;
  115380. }
  115381. keys = keys.concat(stringify(
  115382. obj[key],
  115383. key,
  115384. generateArrayPrefix,
  115385. strictNullHandling,
  115386. skipNulls,
  115387. encode ? encoder : null,
  115388. filter,
  115389. sort,
  115390. allowDots,
  115391. serializeDate,
  115392. formatter,
  115393. encodeValuesOnly
  115394. ));
  115395. }
  115396. var joined = keys.join(delimiter);
  115397. var prefix = options.addQueryPrefix === true ? '?' : '';
  115398. return joined.length > 0 ? prefix + joined : '';
  115399. };
  115400. /***/ }),
  115401. /* 858 */
  115402. /***/ (function(module, exports, __webpack_require__) {
  115403. "use strict";
  115404. var strictUriEncode = __webpack_require__(1016);
  115405. var objectAssign = __webpack_require__(243);
  115406. var decodeComponent = __webpack_require__(653);
  115407. function encoderForArrayFormat(opts) {
  115408. switch (opts.arrayFormat) {
  115409. case 'index':
  115410. return function (key, value, index) {
  115411. return value === null ? [
  115412. encode(key, opts),
  115413. '[',
  115414. index,
  115415. ']'
  115416. ].join('') : [
  115417. encode(key, opts),
  115418. '[',
  115419. encode(index, opts),
  115420. ']=',
  115421. encode(value, opts)
  115422. ].join('');
  115423. };
  115424. case 'bracket':
  115425. return function (key, value) {
  115426. return value === null ? encode(key, opts) : [
  115427. encode(key, opts),
  115428. '[]=',
  115429. encode(value, opts)
  115430. ].join('');
  115431. };
  115432. default:
  115433. return function (key, value) {
  115434. return value === null ? encode(key, opts) : [
  115435. encode(key, opts),
  115436. '=',
  115437. encode(value, opts)
  115438. ].join('');
  115439. };
  115440. }
  115441. }
  115442. function parserForArrayFormat(opts) {
  115443. var result;
  115444. switch (opts.arrayFormat) {
  115445. case 'index':
  115446. return function (key, value, accumulator) {
  115447. result = /\[(\d*)\]$/.exec(key);
  115448. key = key.replace(/\[\d*\]$/, '');
  115449. if (!result) {
  115450. accumulator[key] = value;
  115451. return;
  115452. }
  115453. if (accumulator[key] === undefined) {
  115454. accumulator[key] = {};
  115455. }
  115456. accumulator[key][result[1]] = value;
  115457. };
  115458. case 'bracket':
  115459. return function (key, value, accumulator) {
  115460. result = /(\[\])$/.exec(key);
  115461. key = key.replace(/\[\]$/, '');
  115462. if (!result) {
  115463. accumulator[key] = value;
  115464. return;
  115465. } else if (accumulator[key] === undefined) {
  115466. accumulator[key] = [value];
  115467. return;
  115468. }
  115469. accumulator[key] = [].concat(accumulator[key], value);
  115470. };
  115471. default:
  115472. return function (key, value, accumulator) {
  115473. if (accumulator[key] === undefined) {
  115474. accumulator[key] = value;
  115475. return;
  115476. }
  115477. accumulator[key] = [].concat(accumulator[key], value);
  115478. };
  115479. }
  115480. }
  115481. function encode(value, opts) {
  115482. if (opts.encode) {
  115483. return opts.strict ? strictUriEncode(value) : encodeURIComponent(value);
  115484. }
  115485. return value;
  115486. }
  115487. function keysSorter(input) {
  115488. if (Array.isArray(input)) {
  115489. return input.sort();
  115490. } else if (typeof input === 'object') {
  115491. return keysSorter(Object.keys(input)).sort(function (a, b) {
  115492. return Number(a) - Number(b);
  115493. }).map(function (key) {
  115494. return input[key];
  115495. });
  115496. }
  115497. return input;
  115498. }
  115499. function extract(str) {
  115500. var queryStart = str.indexOf('?');
  115501. if (queryStart === -1) {
  115502. return '';
  115503. }
  115504. return str.slice(queryStart + 1);
  115505. }
  115506. function parse(str, opts) {
  115507. opts = objectAssign({arrayFormat: 'none'}, opts);
  115508. var formatter = parserForArrayFormat(opts);
  115509. // Create an object with no prototype
  115510. // https://github.com/sindresorhus/query-string/issues/47
  115511. var ret = Object.create(null);
  115512. if (typeof str !== 'string') {
  115513. return ret;
  115514. }
  115515. str = str.trim().replace(/^[?#&]/, '');
  115516. if (!str) {
  115517. return ret;
  115518. }
  115519. str.split('&').forEach(function (param) {
  115520. var parts = param.replace(/\+/g, ' ').split('=');
  115521. // Firefox (pre 40) decodes `%3D` to `=`
  115522. // https://github.com/sindresorhus/query-string/pull/37
  115523. var key = parts.shift();
  115524. var val = parts.length > 0 ? parts.join('=') : undefined;
  115525. // missing `=` should be `null`:
  115526. // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
  115527. val = val === undefined ? null : decodeComponent(val);
  115528. formatter(decodeComponent(key), val, ret);
  115529. });
  115530. return Object.keys(ret).sort().reduce(function (result, key) {
  115531. var val = ret[key];
  115532. if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) {
  115533. // Sort object keys, not values
  115534. result[key] = keysSorter(val);
  115535. } else {
  115536. result[key] = val;
  115537. }
  115538. return result;
  115539. }, Object.create(null));
  115540. }
  115541. exports.extract = extract;
  115542. exports.parse = parse;
  115543. exports.stringify = function (obj, opts) {
  115544. var defaults = {
  115545. encode: true,
  115546. strict: true,
  115547. arrayFormat: 'none'
  115548. };
  115549. opts = objectAssign(defaults, opts);
  115550. if (opts.sort === false) {
  115551. opts.sort = function () {};
  115552. }
  115553. var formatter = encoderForArrayFormat(opts);
  115554. return obj ? Object.keys(obj).sort(opts.sort).map(function (key) {
  115555. var val = obj[key];
  115556. if (val === undefined) {
  115557. return '';
  115558. }
  115559. if (val === null) {
  115560. return encode(key, opts);
  115561. }
  115562. if (Array.isArray(val)) {
  115563. var result = [];
  115564. val.slice().forEach(function (val2) {
  115565. if (val2 === undefined) {
  115566. return;
  115567. }
  115568. result.push(formatter(key, val2, result.length));
  115569. });
  115570. return result.join('&');
  115571. }
  115572. return encode(key, opts) + '=' + encode(val, opts);
  115573. }).filter(function (x) {
  115574. return x.length > 0;
  115575. }).join('&') : '';
  115576. };
  115577. exports.parseUrl = function (str, opts) {
  115578. return {
  115579. url: str.split('?')[0] || '',
  115580. query: parse(extract(str), opts)
  115581. };
  115582. };
  115583. /***/ }),
  115584. /* 859 */
  115585. /***/ (function(module, exports, __webpack_require__) {
  115586. "use strict";
  115587. /*!
  115588. * randomatic <https://github.com/jonschlinkert/randomatic>
  115589. *
  115590. * Copyright (c) 2014-2017, Jon Schlinkert.
  115591. * Released under the MIT License.
  115592. */
  115593. var isNumber = __webpack_require__(860);
  115594. var typeOf = __webpack_require__(861);
  115595. var mathRandom = __webpack_require__(822);
  115596. /**
  115597. * Expose `randomatic`
  115598. */
  115599. module.exports = randomatic;
  115600. module.exports.isCrypto = !!mathRandom.cryptographic;
  115601. /**
  115602. * Available mask characters
  115603. */
  115604. var type = {
  115605. lower: 'abcdefghijklmnopqrstuvwxyz',
  115606. upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  115607. number: '0123456789',
  115608. special: '~!@#$%^&()_+-={}[];\',.'
  115609. };
  115610. type.all = type.lower + type.upper + type.number + type.special;
  115611. /**
  115612. * Generate random character sequences of a specified `length`,
  115613. * based on the given `pattern`.
  115614. *
  115615. * @param {String} `pattern` The pattern to use for generating the random string.
  115616. * @param {String} `length` The length of the string to generate.
  115617. * @param {String} `options`
  115618. * @return {String}
  115619. * @api public
  115620. */
  115621. function randomatic(pattern, length, options) {
  115622. if (typeof pattern === 'undefined') {
  115623. throw new Error('randomatic expects a string or number.');
  115624. }
  115625. var custom = false;
  115626. if (arguments.length === 1) {
  115627. if (typeof pattern === 'string') {
  115628. length = pattern.length;
  115629. } else if (isNumber(pattern)) {
  115630. options = {};
  115631. length = pattern;
  115632. pattern = '*';
  115633. }
  115634. }
  115635. if (typeOf(length) === 'object' && length.hasOwnProperty('chars')) {
  115636. options = length;
  115637. pattern = options.chars;
  115638. length = pattern.length;
  115639. custom = true;
  115640. }
  115641. var opts = options || {};
  115642. var mask = '';
  115643. var res = '';
  115644. // Characters to be used
  115645. if (pattern.indexOf('?') !== -1) mask += opts.chars;
  115646. if (pattern.indexOf('a') !== -1) mask += type.lower;
  115647. if (pattern.indexOf('A') !== -1) mask += type.upper;
  115648. if (pattern.indexOf('0') !== -1) mask += type.number;
  115649. if (pattern.indexOf('!') !== -1) mask += type.special;
  115650. if (pattern.indexOf('*') !== -1) mask += type.all;
  115651. if (custom) mask += pattern;
  115652. while (length--) {
  115653. res += mask.charAt(parseInt(mathRandom() * mask.length, 10));
  115654. }
  115655. return res;
  115656. };
  115657. /***/ }),
  115658. /* 860 */
  115659. /***/ (function(module, exports, __webpack_require__) {
  115660. "use strict";
  115661. /*!
  115662. * is-number <https://github.com/jonschlinkert/is-number>
  115663. *
  115664. * Copyright (c) 2014-2017, Jon Schlinkert.
  115665. * Released under the MIT License.
  115666. */
  115667. module.exports = function isNumber(num) {
  115668. var type = typeof num;
  115669. if (type === 'string' || num instanceof String) {
  115670. // an empty string would be coerced to true with the below logic
  115671. if (!num.trim()) return false;
  115672. } else if (type !== 'number' && !(num instanceof Number)) {
  115673. return false;
  115674. }
  115675. return (num - num + 1) >= 0;
  115676. };
  115677. /***/ }),
  115678. /* 861 */
  115679. /***/ (function(module, exports) {
  115680. var toString = Object.prototype.toString;
  115681. module.exports = function kindOf(val) {
  115682. if (val === void 0) return 'undefined';
  115683. if (val === null) return 'null';
  115684. var type = typeof val;
  115685. if (type === 'boolean') return 'boolean';
  115686. if (type === 'string') return 'string';
  115687. if (type === 'number') return 'number';
  115688. if (type === 'symbol') return 'symbol';
  115689. if (type === 'function') {
  115690. return isGeneratorFn(val) ? 'generatorfunction' : 'function';
  115691. }
  115692. if (isArray(val)) return 'array';
  115693. if (isBuffer(val)) return 'buffer';
  115694. if (isArguments(val)) return 'arguments';
  115695. if (isDate(val)) return 'date';
  115696. if (isError(val)) return 'error';
  115697. if (isRegexp(val)) return 'regexp';
  115698. switch (ctorName(val)) {
  115699. case 'Symbol': return 'symbol';
  115700. case 'Promise': return 'promise';
  115701. // Set, Map, WeakSet, WeakMap
  115702. case 'WeakMap': return 'weakmap';
  115703. case 'WeakSet': return 'weakset';
  115704. case 'Map': return 'map';
  115705. case 'Set': return 'set';
  115706. // 8-bit typed arrays
  115707. case 'Int8Array': return 'int8array';
  115708. case 'Uint8Array': return 'uint8array';
  115709. case 'Uint8ClampedArray': return 'uint8clampedarray';
  115710. // 16-bit typed arrays
  115711. case 'Int16Array': return 'int16array';
  115712. case 'Uint16Array': return 'uint16array';
  115713. // 32-bit typed arrays
  115714. case 'Int32Array': return 'int32array';
  115715. case 'Uint32Array': return 'uint32array';
  115716. case 'Float32Array': return 'float32array';
  115717. case 'Float64Array': return 'float64array';
  115718. }
  115719. if (isGeneratorObj(val)) {
  115720. return 'generator';
  115721. }
  115722. // Non-plain objects
  115723. type = toString.call(val);
  115724. switch (type) {
  115725. case '[object Object]': return 'object';
  115726. // iterators
  115727. case '[object Map Iterator]': return 'mapiterator';
  115728. case '[object Set Iterator]': return 'setiterator';
  115729. case '[object String Iterator]': return 'stringiterator';
  115730. case '[object Array Iterator]': return 'arrayiterator';
  115731. }
  115732. // other
  115733. return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
  115734. };
  115735. function ctorName(val) {
  115736. return val.constructor ? val.constructor.name : null;
  115737. }
  115738. function isArray(val) {
  115739. if (Array.isArray) return Array.isArray(val);
  115740. return val instanceof Array;
  115741. }
  115742. function isError(val) {
  115743. return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number');
  115744. }
  115745. function isDate(val) {
  115746. if (val instanceof Date) return true;
  115747. return typeof val.toDateString === 'function'
  115748. && typeof val.getDate === 'function'
  115749. && typeof val.setDate === 'function';
  115750. }
  115751. function isRegexp(val) {
  115752. if (val instanceof RegExp) return true;
  115753. return typeof val.flags === 'string'
  115754. && typeof val.ignoreCase === 'boolean'
  115755. && typeof val.multiline === 'boolean'
  115756. && typeof val.global === 'boolean';
  115757. }
  115758. function isGeneratorFn(name, val) {
  115759. return ctorName(name) === 'GeneratorFunction';
  115760. }
  115761. function isGeneratorObj(val) {
  115762. return typeof val.throw === 'function'
  115763. && typeof val.return === 'function'
  115764. && typeof val.next === 'function';
  115765. }
  115766. function isArguments(val) {
  115767. try {
  115768. if (typeof val.length === 'number' && typeof val.callee === 'function') {
  115769. return true;
  115770. }
  115771. } catch (err) {
  115772. if (err.message.indexOf('callee') !== -1) {
  115773. return true;
  115774. }
  115775. }
  115776. return false;
  115777. }
  115778. /**
  115779. * If you need to support Safari 5-7 (8-10 yr-old browser),
  115780. * take a look at https://github.com/feross/is-buffer
  115781. */
  115782. function isBuffer(val) {
  115783. if (val.constructor && typeof val.constructor.isBuffer === 'function') {
  115784. return val.constructor.isBuffer(val);
  115785. }
  115786. return false;
  115787. }
  115788. /***/ }),
  115789. /* 862 */
  115790. /***/ (function(module, exports, __webpack_require__) {
  115791. module.exports = read
  115792. var readline = __webpack_require__(187)
  115793. var Mute = __webpack_require__(371)
  115794. function read (opts, cb) {
  115795. if (opts.num) {
  115796. throw new Error('read() no longer accepts a char number limit')
  115797. }
  115798. if (typeof opts.default !== 'undefined' &&
  115799. typeof opts.default !== 'string' &&
  115800. typeof opts.default !== 'number') {
  115801. throw new Error('default value must be string or number')
  115802. }
  115803. var input = opts.input || process.stdin
  115804. var output = opts.output || process.stdout
  115805. var prompt = (opts.prompt || '').trim() + ' '
  115806. var silent = opts.silent
  115807. var editDef = false
  115808. var timeout = opts.timeout
  115809. var def = opts.default || ''
  115810. if (def) {
  115811. if (silent) {
  115812. prompt += '(<default hidden>) '
  115813. } else if (opts.edit) {
  115814. editDef = true
  115815. } else {
  115816. prompt += '(' + def + ') '
  115817. }
  115818. }
  115819. var terminal = !!(opts.terminal || output.isTTY)
  115820. var m = new Mute({ replace: opts.replace, prompt: prompt })
  115821. m.pipe(output, {end: false})
  115822. output = m
  115823. var rlOpts = { input: input, output: output, terminal: terminal }
  115824. if (process.version.match(/^v0\.6/)) {
  115825. var rl = readline.createInterface(rlOpts.input, rlOpts.output)
  115826. } else {
  115827. var rl = readline.createInterface(rlOpts)
  115828. }
  115829. output.unmute()
  115830. rl.setPrompt(prompt)
  115831. rl.prompt()
  115832. if (silent) {
  115833. output.mute()
  115834. } else if (editDef) {
  115835. rl.line = def
  115836. rl.cursor = def.length
  115837. rl._refreshLine()
  115838. }
  115839. var called = false
  115840. rl.on('line', onLine)
  115841. rl.on('error', onError)
  115842. rl.on('SIGINT', function () {
  115843. rl.close()
  115844. onError(new Error('canceled'))
  115845. })
  115846. var timer
  115847. if (timeout) {
  115848. timer = setTimeout(function () {
  115849. onError(new Error('timed out'))
  115850. }, timeout)
  115851. }
  115852. function done () {
  115853. called = true
  115854. rl.close()
  115855. if (process.version.match(/^v0\.6/)) {
  115856. rl.input.removeAllListeners('data')
  115857. rl.input.removeAllListeners('keypress')
  115858. rl.input.pause()
  115859. }
  115860. clearTimeout(timer)
  115861. output.mute()
  115862. output.end()
  115863. }
  115864. function onError (er) {
  115865. if (called) return
  115866. done()
  115867. return cb(er)
  115868. }
  115869. function onLine (line) {
  115870. if (called) return
  115871. if (silent && terminal) {
  115872. output.unmute()
  115873. output.write('\r\n')
  115874. }
  115875. done()
  115876. // truncate the \n at the end.
  115877. line = line.replace(/\r?\n$/, '')
  115878. var isDefault = !!(editDef && line === def)
  115879. if (def && !line) {
  115880. isDefault = true
  115881. line = def
  115882. }
  115883. cb(null, line, isDefault)
  115884. }
  115885. }
  115886. /***/ }),
  115887. /* 863 */
  115888. /***/ (function(module, exports, __webpack_require__) {
  115889. module.exports = __webpack_require__(91).Duplex
  115890. /***/ }),
  115891. /* 864 */
  115892. /***/ (function(module, exports, __webpack_require__) {
  115893. "use strict";
  115894. // Copyright Joyent, Inc. and other Node contributors.
  115895. //
  115896. // Permission is hereby granted, free of charge, to any person obtaining a
  115897. // copy of this software and associated documentation files (the
  115898. // "Software"), to deal in the Software without restriction, including
  115899. // without limitation the rights to use, copy, modify, merge, publish,
  115900. // distribute, sublicense, and/or sell copies of the Software, and to permit
  115901. // persons to whom the Software is furnished to do so, subject to the
  115902. // following conditions:
  115903. //
  115904. // The above copyright notice and this permission notice shall be included
  115905. // in all copies or substantial portions of the Software.
  115906. //
  115907. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  115908. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  115909. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  115910. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  115911. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  115912. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  115913. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  115914. // a passthrough stream.
  115915. // basically just the most minimal sort of Transform stream.
  115916. // Every written chunk gets output as-is.
  115917. module.exports = PassThrough;
  115918. var Transform = __webpack_require__(377);
  115919. /*<replacement>*/
  115920. var util = __webpack_require__(105);
  115921. util.inherits = __webpack_require__(78);
  115922. /*</replacement>*/
  115923. util.inherits(PassThrough, Transform);
  115924. function PassThrough(options) {
  115925. if (!(this instanceof PassThrough)) return new PassThrough(options);
  115926. Transform.call(this, options);
  115927. }
  115928. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  115929. cb(null, chunk);
  115930. };
  115931. /***/ }),
  115932. /* 865 */
  115933. /***/ (function(module, exports, __webpack_require__) {
  115934. "use strict";
  115935. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  115936. var Buffer = __webpack_require__(60).Buffer;
  115937. var util = __webpack_require__(9);
  115938. function copyBuffer(src, target, offset) {
  115939. src.copy(target, offset);
  115940. }
  115941. module.exports = function () {
  115942. function BufferList() {
  115943. _classCallCheck(this, BufferList);
  115944. this.head = null;
  115945. this.tail = null;
  115946. this.length = 0;
  115947. }
  115948. BufferList.prototype.push = function push(v) {
  115949. var entry = { data: v, next: null };
  115950. if (this.length > 0) this.tail.next = entry;else this.head = entry;
  115951. this.tail = entry;
  115952. ++this.length;
  115953. };
  115954. BufferList.prototype.unshift = function unshift(v) {
  115955. var entry = { data: v, next: this.head };
  115956. if (this.length === 0) this.tail = entry;
  115957. this.head = entry;
  115958. ++this.length;
  115959. };
  115960. BufferList.prototype.shift = function shift() {
  115961. if (this.length === 0) return;
  115962. var ret = this.head.data;
  115963. if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
  115964. --this.length;
  115965. return ret;
  115966. };
  115967. BufferList.prototype.clear = function clear() {
  115968. this.head = this.tail = null;
  115969. this.length = 0;
  115970. };
  115971. BufferList.prototype.join = function join(s) {
  115972. if (this.length === 0) return '';
  115973. var p = this.head;
  115974. var ret = '' + p.data;
  115975. while (p = p.next) {
  115976. ret += s + p.data;
  115977. }return ret;
  115978. };
  115979. BufferList.prototype.concat = function concat(n) {
  115980. if (this.length === 0) return Buffer.alloc(0);
  115981. if (this.length === 1) return this.head.data;
  115982. var ret = Buffer.allocUnsafe(n >>> 0);
  115983. var p = this.head;
  115984. var i = 0;
  115985. while (p) {
  115986. copyBuffer(p.data, ret, i);
  115987. i += p.data.length;
  115988. p = p.next;
  115989. }
  115990. return ret;
  115991. };
  115992. return BufferList;
  115993. }();
  115994. if (util && util.inspect && util.inspect.custom) {
  115995. module.exports.prototype[util.inspect.custom] = function () {
  115996. var obj = util.inspect({ length: this.length });
  115997. return this.constructor.name + ' ' + obj;
  115998. };
  115999. }
  116000. /***/ }),
  116001. /* 866 */
  116002. /***/ (function(module, exports, __webpack_require__) {
  116003. module.exports = __webpack_require__(91).Transform
  116004. /***/ }),
  116005. /* 867 */
  116006. /***/ (function(module, exports, __webpack_require__) {
  116007. "use strict";
  116008. /*!
  116009. * regex-cache <https://github.com/jonschlinkert/regex-cache>
  116010. *
  116011. * Copyright (c) 2015-2017, Jon Schlinkert.
  116012. * Released under the MIT License.
  116013. */
  116014. var equal = __webpack_require__(783);
  116015. var basic = {};
  116016. var cache = {};
  116017. /**
  116018. * Expose `regexCache`
  116019. */
  116020. module.exports = regexCache;
  116021. /**
  116022. * Memoize the results of a call to the new RegExp constructor.
  116023. *
  116024. * @param {Function} fn [description]
  116025. * @param {String} str [description]
  116026. * @param {Options} options [description]
  116027. * @param {Boolean} nocompare [description]
  116028. * @return {RegExp}
  116029. */
  116030. function regexCache(fn, str, opts) {
  116031. var key = '_default_', regex, cached;
  116032. if (!str && !opts) {
  116033. if (typeof fn !== 'function') {
  116034. return fn;
  116035. }
  116036. return basic[key] || (basic[key] = fn(str));
  116037. }
  116038. var isString = typeof str === 'string';
  116039. if (isString) {
  116040. if (!opts) {
  116041. return basic[str] || (basic[str] = fn(str));
  116042. }
  116043. key = str;
  116044. } else {
  116045. opts = str;
  116046. }
  116047. cached = cache[key];
  116048. if (cached && equal(cached.opts, opts)) {
  116049. return cached.regex;
  116050. }
  116051. memo(key, opts, (regex = fn(str, opts)));
  116052. return regex;
  116053. }
  116054. function memo(key, opts, regex) {
  116055. cache[key] = {regex: regex, opts: opts};
  116056. }
  116057. /**
  116058. * Expose `cache`
  116059. */
  116060. module.exports.cache = cache;
  116061. module.exports.basic = basic;
  116062. /***/ }),
  116063. /* 868 */
  116064. /***/ (function(module, exports) {
  116065. var isWin = process.platform === 'win32';
  116066. module.exports = function (str) {
  116067. var i = str.length - 1;
  116068. if (i < 2) {
  116069. return str;
  116070. }
  116071. while (isSeparator(str, i)) {
  116072. i--;
  116073. }
  116074. return str.substr(0, i + 1);
  116075. };
  116076. function isSeparator(str, i) {
  116077. var char = str[i];
  116078. return i > 0 && (char === '/' || (isWin && char === '\\'));
  116079. }
  116080. /***/ }),
  116081. /* 869 */
  116082. /***/ (function(module, exports, __webpack_require__) {
  116083. "use strict";
  116084. /*!
  116085. * repeat-string <https://github.com/jonschlinkert/repeat-string>
  116086. *
  116087. * Copyright (c) 2014-2015, Jon Schlinkert.
  116088. * Licensed under the MIT License.
  116089. */
  116090. /**
  116091. * Results cache
  116092. */
  116093. var res = '';
  116094. var cache;
  116095. /**
  116096. * Expose `repeat`
  116097. */
  116098. module.exports = repeat;
  116099. /**
  116100. * Repeat the given `string` the specified `number`
  116101. * of times.
  116102. *
  116103. * **Example:**
  116104. *
  116105. * ```js
  116106. * var repeat = require('repeat-string');
  116107. * repeat('A', 5);
  116108. * //=> AAAAA
  116109. * ```
  116110. *
  116111. * @param {String} `string` The string to repeat
  116112. * @param {Number} `number` The number of times to repeat the string
  116113. * @return {String} Repeated string
  116114. * @api public
  116115. */
  116116. function repeat(str, num) {
  116117. if (typeof str !== 'string') {
  116118. throw new TypeError('expected a string');
  116119. }
  116120. // cover common, quick use cases
  116121. if (num === 1) return str;
  116122. if (num === 2) return str + str;
  116123. var max = str.length * num;
  116124. if (cache !== str || typeof cache === 'undefined') {
  116125. cache = str;
  116126. res = '';
  116127. } else if (res.length >= max) {
  116128. return res.substr(0, max);
  116129. }
  116130. while (max > res.length && num > 1) {
  116131. if (num & 1) {
  116132. res += str;
  116133. }
  116134. num >>= 1;
  116135. str += str;
  116136. }
  116137. res += str;
  116138. res = res.substr(0, max);
  116139. return res;
  116140. }
  116141. /***/ }),
  116142. /* 870 */
  116143. /***/ (function(module, exports) {
  116144. module.exports = {"name":"request-capture-har","version":"1.2.2","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test && node request-capture-har.js"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":"Lars Thorup <lars@zealake.com> (http://github.com/larsthorup)","license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"devDependencies":{"semistandard":"^8.0.0"}}
  116145. /***/ }),
  116146. /* 871 */
  116147. /***/ (function(module, exports, __webpack_require__) {
  116148. var fs = __webpack_require__(12);
  116149. var pkg = __webpack_require__(870);
  116150. function buildHarHeaders (headers) {
  116151. return headers ? Object.keys(headers).map(function (key) {
  116152. return {
  116153. name: key,
  116154. // header values are required to be strings
  116155. value: headers[key].toString()
  116156. };
  116157. }) : [];
  116158. }
  116159. function appendPostData (entry, request) {
  116160. if (!request.body) return;
  116161. entry.request.postData = {
  116162. mimeType: 'application/octet-stream',
  116163. text: request.body
  116164. };
  116165. }
  116166. function toMs (num) {
  116167. return Math.round(num * 1000) / 1000;
  116168. }
  116169. function HarWrapper (requestModule) {
  116170. this.requestModule = requestModule;
  116171. this.clear();
  116172. }
  116173. HarWrapper.prototype.request = function (options) {
  116174. // include detailed timing data in response object
  116175. Object.assign(options, { time: true });
  116176. var self = this;
  116177. // make call to true request module
  116178. return this.requestModule(options, function (err, incomingMessage, response) {
  116179. // create new har entry with reponse timings
  116180. if (!err) {
  116181. self.entries.push(self.buildHarEntry(incomingMessage));
  116182. }
  116183. // fire any callback provided in options, as request has ignored it
  116184. // https://github.com/request/request/blob/v2.75.0/index.js#L40
  116185. if (typeof options.callback === 'function') {
  116186. options.callback.apply(null, arguments);
  116187. }
  116188. });
  116189. };
  116190. HarWrapper.prototype.clear = function () {
  116191. this.entries = [];
  116192. this.earliestTime = new Date(2099, 1, 1);
  116193. };
  116194. HarWrapper.prototype.saveHar = function (fileName) {
  116195. var httpArchive = {
  116196. log: {
  116197. version: '1.2',
  116198. creator: {name: 'request-capture-har', version: pkg.version},
  116199. pages: [{
  116200. startedDateTime: new Date(this.earliestTime).toISOString(),
  116201. id: 'request-capture-har',
  116202. title: 'request-capture-har',
  116203. pageTimings: { }
  116204. }],
  116205. entries: this.entries
  116206. }
  116207. };
  116208. fs.writeFileSync(fileName, JSON.stringify(httpArchive, null, 2));
  116209. };
  116210. HarWrapper.prototype.buildTimings = function (entry, response) {
  116211. var startTs = response.request.startTime;
  116212. var endTs = startTs + response.elapsedTime;
  116213. var totalTime = endTs - startTs;
  116214. if (new Date(startTs) < this.earliestTime) {
  116215. this.earliestTime = new Date(startTs);
  116216. }
  116217. entry.startedDateTime = new Date(startTs).toISOString();
  116218. entry.time = totalTime;
  116219. // new timing data added in request 2.81.0
  116220. if (response.timingPhases) {
  116221. entry.timings = {
  116222. 'blocked': toMs(response.timingPhases.wait),
  116223. 'dns': toMs(response.timingPhases.dns),
  116224. 'connect': toMs(response.timingPhases.tcp),
  116225. 'send': 0,
  116226. 'wait': toMs(response.timingPhases.firstByte),
  116227. 'receive': toMs(response.timingPhases.download)
  116228. };
  116229. return;
  116230. }
  116231. var responseStartTs = response.request.response.responseStartTime;
  116232. var waitingTime = responseStartTs - startTs;
  116233. var receiveTime = endTs - responseStartTs;
  116234. entry.timings = {
  116235. send: 0,
  116236. wait: waitingTime,
  116237. receive: receiveTime
  116238. };
  116239. };
  116240. HarWrapper.prototype.buildHarEntry = function (response) {
  116241. var entry = {
  116242. request: {
  116243. method: response.request.method,
  116244. url: response.request.uri.href,
  116245. httpVersion: 'HTTP/' + response.httpVersion,
  116246. cookies: [],
  116247. headers: buildHarHeaders(response.request.headers),
  116248. queryString: [],
  116249. headersSize: -1,
  116250. bodySize: -1
  116251. },
  116252. response: {
  116253. status: response.statusCode,
  116254. statusText: response.statusMessage,
  116255. httpVersion: 'HTTP/' + response.httpVersion,
  116256. cookies: [],
  116257. headers: buildHarHeaders(response.headers),
  116258. _transferSize: response.body.length,
  116259. content: {
  116260. size: response.body.length,
  116261. mimeType: response.headers['content-type']
  116262. },
  116263. redirectURL: '',
  116264. headersSize: -1,
  116265. bodySize: -1
  116266. },
  116267. cache: {}
  116268. };
  116269. this.buildTimings(entry, response);
  116270. appendPostData(entry, response.request);
  116271. return entry;
  116272. };
  116273. module.exports = HarWrapper;
  116274. /***/ }),
  116275. /* 872 */
  116276. /***/ (function(module, exports, __webpack_require__) {
  116277. "use strict";
  116278. // Copyright 2010-2012 Mikeal Rogers
  116279. //
  116280. // Licensed under the Apache License, Version 2.0 (the "License");
  116281. // you may not use this file except in compliance with the License.
  116282. // You may obtain a copy of the License at
  116283. //
  116284. // http://www.apache.org/licenses/LICENSE-2.0
  116285. //
  116286. // Unless required by applicable law or agreed to in writing, software
  116287. // distributed under the License is distributed on an "AS IS" BASIS,
  116288. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  116289. // See the License for the specific language governing permissions and
  116290. // limitations under the License.
  116291. var extend = __webpack_require__(232)
  116292. var cookies = __webpack_require__(382)
  116293. var helpers = __webpack_require__(247)
  116294. var paramsHaveRequestBody = helpers.paramsHaveRequestBody
  116295. // organize params for patch, post, put, head, del
  116296. function initParams (uri, options, callback) {
  116297. if (typeof options === 'function') {
  116298. callback = options
  116299. }
  116300. var params = {}
  116301. if (typeof options === 'object') {
  116302. extend(params, options, {uri: uri})
  116303. } else if (typeof uri === 'string') {
  116304. extend(params, {uri: uri})
  116305. } else {
  116306. extend(params, uri)
  116307. }
  116308. params.callback = callback || params.callback
  116309. return params
  116310. }
  116311. function request (uri, options, callback) {
  116312. if (typeof uri === 'undefined') {
  116313. throw new Error('undefined is not a valid uri or options object.')
  116314. }
  116315. var params = initParams(uri, options, callback)
  116316. if (params.method === 'HEAD' && paramsHaveRequestBody(params)) {
  116317. throw new Error('HTTP HEAD requests MUST NOT include a request body.')
  116318. }
  116319. return new request.Request(params)
  116320. }
  116321. function verbFunc (verb) {
  116322. var method = verb.toUpperCase()
  116323. return function (uri, options, callback) {
  116324. var params = initParams(uri, options, callback)
  116325. params.method = method
  116326. return request(params, params.callback)
  116327. }
  116328. }
  116329. // define like this to please codeintel/intellisense IDEs
  116330. request.get = verbFunc('get')
  116331. request.head = verbFunc('head')
  116332. request.options = verbFunc('options')
  116333. request.post = verbFunc('post')
  116334. request.put = verbFunc('put')
  116335. request.patch = verbFunc('patch')
  116336. request.del = verbFunc('delete')
  116337. request['delete'] = verbFunc('delete')
  116338. request.jar = function (store) {
  116339. return cookies.jar(store)
  116340. }
  116341. request.cookie = function (str) {
  116342. return cookies.parse(str)
  116343. }
  116344. function wrapRequestMethod (method, options, requester, verb) {
  116345. return function (uri, opts, callback) {
  116346. var params = initParams(uri, opts, callback)
  116347. var target = {}
  116348. extend(true, target, options, params)
  116349. target.pool = params.pool || options.pool
  116350. if (verb) {
  116351. target.method = verb.toUpperCase()
  116352. }
  116353. if (typeof requester === 'function') {
  116354. method = requester
  116355. }
  116356. return method(target, target.callback)
  116357. }
  116358. }
  116359. request.defaults = function (options, requester) {
  116360. var self = this
  116361. options = options || {}
  116362. if (typeof options === 'function') {
  116363. requester = options
  116364. options = {}
  116365. }
  116366. var defaults = wrapRequestMethod(self, options, requester)
  116367. var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete']
  116368. verbs.forEach(function (verb) {
  116369. defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)
  116370. })
  116371. defaults.cookie = wrapRequestMethod(self.cookie, options, requester)
  116372. defaults.jar = self.jar
  116373. defaults.defaults = self.defaults
  116374. return defaults
  116375. }
  116376. request.forever = function (agentOptions, optionsArg) {
  116377. var options = {}
  116378. if (optionsArg) {
  116379. extend(options, optionsArg)
  116380. }
  116381. if (agentOptions) {
  116382. options.agentOptions = agentOptions
  116383. }
  116384. options.forever = true
  116385. return request.defaults(options)
  116386. }
  116387. // Exports
  116388. module.exports = request
  116389. request.Request = __webpack_require__(885)
  116390. request.initParams = initParams
  116391. // Backwards compatibility for request.debug
  116392. Object.defineProperty(request, 'debug', {
  116393. enumerable: true,
  116394. get: function () {
  116395. return request.Request.debug
  116396. },
  116397. set: function (debug) {
  116398. request.Request.debug = debug
  116399. }
  116400. })
  116401. /***/ }),
  116402. /* 873 */
  116403. /***/ (function(module, exports, __webpack_require__) {
  116404. "use strict";
  116405. var caseless = __webpack_require__(212)
  116406. var uuid = __webpack_require__(114)
  116407. var helpers = __webpack_require__(247)
  116408. var md5 = helpers.md5
  116409. var toBase64 = helpers.toBase64
  116410. function Auth (request) {
  116411. // define all public properties here
  116412. this.request = request
  116413. this.hasAuth = false
  116414. this.sentAuth = false
  116415. this.bearerToken = null
  116416. this.user = null
  116417. this.pass = null
  116418. }
  116419. Auth.prototype.basic = function (user, pass, sendImmediately) {
  116420. var self = this
  116421. if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {
  116422. self.request.emit('error', new Error('auth() received invalid user or password'))
  116423. }
  116424. self.user = user
  116425. self.pass = pass
  116426. self.hasAuth = true
  116427. var header = user + ':' + (pass || '')
  116428. if (sendImmediately || typeof sendImmediately === 'undefined') {
  116429. var authHeader = 'Basic ' + toBase64(header)
  116430. self.sentAuth = true
  116431. return authHeader
  116432. }
  116433. }
  116434. Auth.prototype.bearer = function (bearer, sendImmediately) {
  116435. var self = this
  116436. self.bearerToken = bearer
  116437. self.hasAuth = true
  116438. if (sendImmediately || typeof sendImmediately === 'undefined') {
  116439. if (typeof bearer === 'function') {
  116440. bearer = bearer()
  116441. }
  116442. var authHeader = 'Bearer ' + (bearer || '')
  116443. self.sentAuth = true
  116444. return authHeader
  116445. }
  116446. }
  116447. Auth.prototype.digest = function (method, path, authHeader) {
  116448. // TODO: More complete implementation of RFC 2617.
  116449. // - handle challenge.domain
  116450. // - support qop="auth-int" only
  116451. // - handle Authentication-Info (not necessarily?)
  116452. // - check challenge.stale (not necessarily?)
  116453. // - increase nc (not necessarily?)
  116454. // For reference:
  116455. // http://tools.ietf.org/html/rfc2617#section-3
  116456. // https://github.com/bagder/curl/blob/master/lib/http_digest.c
  116457. var self = this
  116458. var challenge = {}
  116459. var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi
  116460. for (;;) {
  116461. var match = re.exec(authHeader)
  116462. if (!match) {
  116463. break
  116464. }
  116465. challenge[match[1]] = match[2] || match[3]
  116466. }
  116467. /**
  116468. * RFC 2617: handle both MD5 and MD5-sess algorithms.
  116469. *
  116470. * If the algorithm directive's value is "MD5" or unspecified, then HA1 is
  116471. * HA1=MD5(username:realm:password)
  116472. * If the algorithm directive's value is "MD5-sess", then HA1 is
  116473. * HA1=MD5(MD5(username:realm:password):nonce:cnonce)
  116474. */
  116475. var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) {
  116476. var ha1 = md5(user + ':' + realm + ':' + pass)
  116477. if (algorithm && algorithm.toLowerCase() === 'md5-sess') {
  116478. return md5(ha1 + ':' + nonce + ':' + cnonce)
  116479. } else {
  116480. return ha1
  116481. }
  116482. }
  116483. var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth'
  116484. var nc = qop && '00000001'
  116485. var cnonce = qop && uuid().replace(/-/g, '')
  116486. var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce)
  116487. var ha2 = md5(method + ':' + path)
  116488. var digestResponse = qop
  116489. ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)
  116490. : md5(ha1 + ':' + challenge.nonce + ':' + ha2)
  116491. var authValues = {
  116492. username: self.user,
  116493. realm: challenge.realm,
  116494. nonce: challenge.nonce,
  116495. uri: path,
  116496. qop: qop,
  116497. response: digestResponse,
  116498. nc: nc,
  116499. cnonce: cnonce,
  116500. algorithm: challenge.algorithm,
  116501. opaque: challenge.opaque
  116502. }
  116503. authHeader = []
  116504. for (var k in authValues) {
  116505. if (authValues[k]) {
  116506. if (k === 'qop' || k === 'nc' || k === 'algorithm') {
  116507. authHeader.push(k + '=' + authValues[k])
  116508. } else {
  116509. authHeader.push(k + '="' + authValues[k] + '"')
  116510. }
  116511. }
  116512. }
  116513. authHeader = 'Digest ' + authHeader.join(', ')
  116514. self.sentAuth = true
  116515. return authHeader
  116516. }
  116517. Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {
  116518. var self = this
  116519. var request = self.request
  116520. var authHeader
  116521. if (bearer === undefined && user === undefined) {
  116522. self.request.emit('error', new Error('no auth mechanism defined'))
  116523. } else if (bearer !== undefined) {
  116524. authHeader = self.bearer(bearer, sendImmediately)
  116525. } else {
  116526. authHeader = self.basic(user, pass, sendImmediately)
  116527. }
  116528. if (authHeader) {
  116529. request.setHeader('authorization', authHeader)
  116530. }
  116531. }
  116532. Auth.prototype.onResponse = function (response) {
  116533. var self = this
  116534. var request = self.request
  116535. if (!self.hasAuth || self.sentAuth) { return null }
  116536. var c = caseless(response.headers)
  116537. var authHeader = c.get('www-authenticate')
  116538. var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase()
  116539. request.debug('reauth', authVerb)
  116540. switch (authVerb) {
  116541. case 'basic':
  116542. return self.basic(self.user, self.pass, true)
  116543. case 'bearer':
  116544. return self.bearer(self.bearerToken, true)
  116545. case 'digest':
  116546. return self.digest(request.method, request.path, authHeader)
  116547. }
  116548. }
  116549. exports.Auth = Auth
  116550. /***/ }),
  116551. /* 874 */
  116552. /***/ (function(module, exports, __webpack_require__) {
  116553. "use strict";
  116554. function formatHostname (hostname) {
  116555. // canonicalize the hostname, so that 'oogle.com' won't match 'google.com'
  116556. return hostname.replace(/^\.*/, '.').toLowerCase()
  116557. }
  116558. function parseNoProxyZone (zone) {
  116559. zone = zone.trim().toLowerCase()
  116560. var zoneParts = zone.split(':', 2)
  116561. var zoneHost = formatHostname(zoneParts[0])
  116562. var zonePort = zoneParts[1]
  116563. var hasPort = zone.indexOf(':') > -1
  116564. return {hostname: zoneHost, port: zonePort, hasPort: hasPort}
  116565. }
  116566. function uriInNoProxy (uri, noProxy) {
  116567. var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')
  116568. var hostname = formatHostname(uri.hostname)
  116569. var noProxyList = noProxy.split(',')
  116570. // iterate through the noProxyList until it finds a match.
  116571. return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) {
  116572. var isMatchedAt = hostname.indexOf(noProxyZone.hostname)
  116573. var hostnameMatched = (
  116574. isMatchedAt > -1 &&
  116575. (isMatchedAt === hostname.length - noProxyZone.hostname.length)
  116576. )
  116577. if (noProxyZone.hasPort) {
  116578. return (port === noProxyZone.port) && hostnameMatched
  116579. }
  116580. return hostnameMatched
  116581. })
  116582. }
  116583. function getProxyFromURI (uri) {
  116584. // Decide the proper request proxy to use based on the request URI object and the
  116585. // environmental variables (NO_PROXY, HTTP_PROXY, etc.)
  116586. // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html)
  116587. var noProxy = process.env.NO_PROXY || process.env.no_proxy || ''
  116588. // if the noProxy is a wildcard then return null
  116589. if (noProxy === '*') {
  116590. return null
  116591. }
  116592. // if the noProxy is not empty and the uri is found return null
  116593. if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {
  116594. return null
  116595. }
  116596. // Check for HTTP or HTTPS Proxy in environment Else default to null
  116597. if (uri.protocol === 'http:') {
  116598. return process.env.HTTP_PROXY ||
  116599. process.env.http_proxy || null
  116600. }
  116601. if (uri.protocol === 'https:') {
  116602. return process.env.HTTPS_PROXY ||
  116603. process.env.https_proxy ||
  116604. process.env.HTTP_PROXY ||
  116605. process.env.http_proxy || null
  116606. }
  116607. // if none of that works, return null
  116608. // (What uri protocol are you using then?)
  116609. return null
  116610. }
  116611. module.exports = getProxyFromURI
  116612. /***/ }),
  116613. /* 875 */
  116614. /***/ (function(module, exports, __webpack_require__) {
  116615. "use strict";
  116616. var fs = __webpack_require__(12)
  116617. var qs = __webpack_require__(186)
  116618. var validate = __webpack_require__(703)
  116619. var extend = __webpack_require__(232)
  116620. function Har (request) {
  116621. this.request = request
  116622. }
  116623. Har.prototype.reducer = function (obj, pair) {
  116624. // new property ?
  116625. if (obj[pair.name] === undefined) {
  116626. obj[pair.name] = pair.value
  116627. return obj
  116628. }
  116629. // existing? convert to array
  116630. var arr = [
  116631. obj[pair.name],
  116632. pair.value
  116633. ]
  116634. obj[pair.name] = arr
  116635. return obj
  116636. }
  116637. Har.prototype.prep = function (data) {
  116638. // construct utility properties
  116639. data.queryObj = {}
  116640. data.headersObj = {}
  116641. data.postData.jsonObj = false
  116642. data.postData.paramsObj = false
  116643. // construct query objects
  116644. if (data.queryString && data.queryString.length) {
  116645. data.queryObj = data.queryString.reduce(this.reducer, {})
  116646. }
  116647. // construct headers objects
  116648. if (data.headers && data.headers.length) {
  116649. // loweCase header keys
  116650. data.headersObj = data.headers.reduceRight(function (headers, header) {
  116651. headers[header.name] = header.value
  116652. return headers
  116653. }, {})
  116654. }
  116655. // construct Cookie header
  116656. if (data.cookies && data.cookies.length) {
  116657. var cookies = data.cookies.map(function (cookie) {
  116658. return cookie.name + '=' + cookie.value
  116659. })
  116660. if (cookies.length) {
  116661. data.headersObj.cookie = cookies.join('; ')
  116662. }
  116663. }
  116664. // prep body
  116665. function some (arr) {
  116666. return arr.some(function (type) {
  116667. return data.postData.mimeType.indexOf(type) === 0
  116668. })
  116669. }
  116670. if (some([
  116671. 'multipart/mixed',
  116672. 'multipart/related',
  116673. 'multipart/form-data',
  116674. 'multipart/alternative'])) {
  116675. // reset values
  116676. data.postData.mimeType = 'multipart/form-data'
  116677. } else if (some([
  116678. 'application/x-www-form-urlencoded'])) {
  116679. if (!data.postData.params) {
  116680. data.postData.text = ''
  116681. } else {
  116682. data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})
  116683. // always overwrite
  116684. data.postData.text = qs.stringify(data.postData.paramsObj)
  116685. }
  116686. } else if (some([
  116687. 'text/json',
  116688. 'text/x-json',
  116689. 'application/json',
  116690. 'application/x-json'])) {
  116691. data.postData.mimeType = 'application/json'
  116692. if (data.postData.text) {
  116693. try {
  116694. data.postData.jsonObj = JSON.parse(data.postData.text)
  116695. } catch (e) {
  116696. this.request.debug(e)
  116697. // force back to text/plain
  116698. data.postData.mimeType = 'text/plain'
  116699. }
  116700. }
  116701. }
  116702. return data
  116703. }
  116704. Har.prototype.options = function (options) {
  116705. // skip if no har property defined
  116706. if (!options.har) {
  116707. return options
  116708. }
  116709. var har = {}
  116710. extend(har, options.har)
  116711. // only process the first entry
  116712. if (har.log && har.log.entries) {
  116713. har = har.log.entries[0]
  116714. }
  116715. // add optional properties to make validation successful
  116716. har.url = har.url || options.url || options.uri || options.baseUrl || '/'
  116717. har.httpVersion = har.httpVersion || 'HTTP/1.1'
  116718. har.queryString = har.queryString || []
  116719. har.headers = har.headers || []
  116720. har.cookies = har.cookies || []
  116721. har.postData = har.postData || {}
  116722. har.postData.mimeType = har.postData.mimeType || 'application/octet-stream'
  116723. har.bodySize = 0
  116724. har.headersSize = 0
  116725. har.postData.size = 0
  116726. if (!validate.request(har)) {
  116727. return options
  116728. }
  116729. // clean up and get some utility properties
  116730. var req = this.prep(har)
  116731. // construct new options
  116732. if (req.url) {
  116733. options.url = req.url
  116734. }
  116735. if (req.method) {
  116736. options.method = req.method
  116737. }
  116738. if (Object.keys(req.queryObj).length) {
  116739. options.qs = req.queryObj
  116740. }
  116741. if (Object.keys(req.headersObj).length) {
  116742. options.headers = req.headersObj
  116743. }
  116744. function test (type) {
  116745. return req.postData.mimeType.indexOf(type) === 0
  116746. }
  116747. if (test('application/x-www-form-urlencoded')) {
  116748. options.form = req.postData.paramsObj
  116749. } else if (test('application/json')) {
  116750. if (req.postData.jsonObj) {
  116751. options.body = req.postData.jsonObj
  116752. options.json = true
  116753. }
  116754. } else if (test('multipart/form-data')) {
  116755. options.formData = {}
  116756. req.postData.params.forEach(function (param) {
  116757. var attachment = {}
  116758. if (!param.fileName && !param.fileName && !param.contentType) {
  116759. options.formData[param.name] = param.value
  116760. return
  116761. }
  116762. // attempt to read from disk!
  116763. if (param.fileName && !param.value) {
  116764. attachment.value = fs.createReadStream(param.fileName)
  116765. } else if (param.value) {
  116766. attachment.value = param.value
  116767. }
  116768. if (param.fileName) {
  116769. attachment.options = {
  116770. filename: param.fileName,
  116771. contentType: param.contentType ? param.contentType : null
  116772. }
  116773. }
  116774. options.formData[param.name] = attachment
  116775. })
  116776. } else {
  116777. if (req.postData.text) {
  116778. options.body = req.postData.text
  116779. }
  116780. }
  116781. return options
  116782. }
  116783. exports.Har = Har
  116784. /***/ }),
  116785. /* 876 */
  116786. /***/ (function(module, exports, __webpack_require__) {
  116787. "use strict";
  116788. var crypto = __webpack_require__(21)
  116789. function randomString (size) {
  116790. var bits = (size + 1) * 6
  116791. var buffer = crypto.randomBytes(Math.ceil(bits / 8))
  116792. var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '')
  116793. return string.slice(0, size)
  116794. }
  116795. function calculatePayloadHash (payload, algorithm, contentType) {
  116796. var hash = crypto.createHash(algorithm)
  116797. hash.update('hawk.1.payload\n')
  116798. hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\n')
  116799. hash.update(payload || '')
  116800. hash.update('\n')
  116801. return hash.digest('base64')
  116802. }
  116803. exports.calculateMac = function (credentials, opts) {
  116804. var normalized = 'hawk.1.header\n' +
  116805. opts.ts + '\n' +
  116806. opts.nonce + '\n' +
  116807. (opts.method || '').toUpperCase() + '\n' +
  116808. opts.resource + '\n' +
  116809. opts.host.toLowerCase() + '\n' +
  116810. opts.port + '\n' +
  116811. (opts.hash || '') + '\n'
  116812. if (opts.ext) {
  116813. normalized = normalized + opts.ext.replace('\\', '\\\\').replace('\n', '\\n')
  116814. }
  116815. normalized = normalized + '\n'
  116816. if (opts.app) {
  116817. normalized = normalized + opts.app + '\n' + (opts.dlg || '') + '\n'
  116818. }
  116819. var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized)
  116820. var digest = hmac.digest('base64')
  116821. return digest
  116822. }
  116823. exports.header = function (uri, method, opts) {
  116824. var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000)
  116825. var credentials = opts.credentials
  116826. if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) {
  116827. return ''
  116828. }
  116829. if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) {
  116830. return ''
  116831. }
  116832. var artifacts = {
  116833. ts: timestamp,
  116834. nonce: opts.nonce || randomString(6),
  116835. method: method,
  116836. resource: uri.pathname + (uri.search || ''),
  116837. host: uri.hostname,
  116838. port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
  116839. hash: opts.hash,
  116840. ext: opts.ext,
  116841. app: opts.app,
  116842. dlg: opts.dlg
  116843. }
  116844. if (!artifacts.hash && (opts.payload || opts.payload === '')) {
  116845. artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType)
  116846. }
  116847. var mac = exports.calculateMac(credentials, artifacts)
  116848. var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''
  116849. var header = 'Hawk id="' + credentials.id +
  116850. '", ts="' + artifacts.ts +
  116851. '", nonce="' + artifacts.nonce +
  116852. (artifacts.hash ? '", hash="' + artifacts.hash : '') +
  116853. (hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : '') +
  116854. '", mac="' + mac + '"'
  116855. if (artifacts.app) {
  116856. header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"'
  116857. }
  116858. return header
  116859. }
  116860. /***/ }),
  116861. /* 877 */
  116862. /***/ (function(module, exports, __webpack_require__) {
  116863. "use strict";
  116864. var uuid = __webpack_require__(114)
  116865. var CombinedStream = __webpack_require__(323)
  116866. var isstream = __webpack_require__(367)
  116867. var Buffer = __webpack_require__(60).Buffer
  116868. function Multipart (request) {
  116869. this.request = request
  116870. this.boundary = uuid()
  116871. this.chunked = false
  116872. this.body = null
  116873. }
  116874. Multipart.prototype.isChunked = function (options) {
  116875. var self = this
  116876. var chunked = false
  116877. var parts = options.data || options
  116878. if (!parts.forEach) {
  116879. self.request.emit('error', new Error('Argument error, options.multipart.'))
  116880. }
  116881. if (options.chunked !== undefined) {
  116882. chunked = options.chunked
  116883. }
  116884. if (self.request.getHeader('transfer-encoding') === 'chunked') {
  116885. chunked = true
  116886. }
  116887. if (!chunked) {
  116888. parts.forEach(function (part) {
  116889. if (typeof part.body === 'undefined') {
  116890. self.request.emit('error', new Error('Body attribute missing in multipart.'))
  116891. }
  116892. if (isstream(part.body)) {
  116893. chunked = true
  116894. }
  116895. })
  116896. }
  116897. return chunked
  116898. }
  116899. Multipart.prototype.setHeaders = function (chunked) {
  116900. var self = this
  116901. if (chunked && !self.request.hasHeader('transfer-encoding')) {
  116902. self.request.setHeader('transfer-encoding', 'chunked')
  116903. }
  116904. var header = self.request.getHeader('content-type')
  116905. if (!header || header.indexOf('multipart') === -1) {
  116906. self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)
  116907. } else {
  116908. if (header.indexOf('boundary') !== -1) {
  116909. self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1')
  116910. } else {
  116911. self.request.setHeader('content-type', header + '; boundary=' + self.boundary)
  116912. }
  116913. }
  116914. }
  116915. Multipart.prototype.build = function (parts, chunked) {
  116916. var self = this
  116917. var body = chunked ? new CombinedStream() : []
  116918. function add (part) {
  116919. if (typeof part === 'number') {
  116920. part = part.toString()
  116921. }
  116922. return chunked ? body.append(part) : body.push(Buffer.from(part))
  116923. }
  116924. if (self.request.preambleCRLF) {
  116925. add('\r\n')
  116926. }
  116927. parts.forEach(function (part) {
  116928. var preamble = '--' + self.boundary + '\r\n'
  116929. Object.keys(part).forEach(function (key) {
  116930. if (key === 'body') { return }
  116931. preamble += key + ': ' + part[key] + '\r\n'
  116932. })
  116933. preamble += '\r\n'
  116934. add(preamble)
  116935. add(part.body)
  116936. add('\r\n')
  116937. })
  116938. add('--' + self.boundary + '--')
  116939. if (self.request.postambleCRLF) {
  116940. add('\r\n')
  116941. }
  116942. return body
  116943. }
  116944. Multipart.prototype.onRequest = function (options) {
  116945. var self = this
  116946. var chunked = self.isChunked(options)
  116947. var parts = options.data || options
  116948. self.setHeaders(chunked)
  116949. self.chunked = chunked
  116950. self.body = self.build(parts, chunked)
  116951. }
  116952. exports.Multipart = Multipart
  116953. /***/ }),
  116954. /* 878 */
  116955. /***/ (function(module, exports, __webpack_require__) {
  116956. "use strict";
  116957. var url = __webpack_require__(29)
  116958. var qs = __webpack_require__(374)
  116959. var caseless = __webpack_require__(212)
  116960. var uuid = __webpack_require__(114)
  116961. var oauth = __webpack_require__(840)
  116962. var crypto = __webpack_require__(21)
  116963. var Buffer = __webpack_require__(60).Buffer
  116964. function OAuth (request) {
  116965. this.request = request
  116966. this.params = null
  116967. }
  116968. OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) {
  116969. var oa = {}
  116970. for (var i in _oauth) {
  116971. oa['oauth_' + i] = _oauth[i]
  116972. }
  116973. if (!oa.oauth_version) {
  116974. oa.oauth_version = '1.0'
  116975. }
  116976. if (!oa.oauth_timestamp) {
  116977. oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString()
  116978. }
  116979. if (!oa.oauth_nonce) {
  116980. oa.oauth_nonce = uuid().replace(/-/g, '')
  116981. }
  116982. if (!oa.oauth_signature_method) {
  116983. oa.oauth_signature_method = 'HMAC-SHA1'
  116984. }
  116985. var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase
  116986. delete oa.oauth_consumer_secret
  116987. delete oa.oauth_private_key
  116988. var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase
  116989. delete oa.oauth_token_secret
  116990. var realm = oa.oauth_realm
  116991. delete oa.oauth_realm
  116992. delete oa.oauth_transport_method
  116993. var baseurl = uri.protocol + '//' + uri.host + uri.pathname
  116994. var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
  116995. oa.oauth_signature = oauth.sign(
  116996. oa.oauth_signature_method,
  116997. method,
  116998. baseurl,
  116999. params,
  117000. consumer_secret_or_private_key, // eslint-disable-line camelcase
  117001. token_secret // eslint-disable-line camelcase
  117002. )
  117003. if (realm) {
  117004. oa.realm = realm
  117005. }
  117006. return oa
  117007. }
  117008. OAuth.prototype.buildBodyHash = function (_oauth, body) {
  117009. if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) {
  117010. this.request.emit('error', new Error('oauth: ' + _oauth.signature_method +
  117011. ' signature_method not supported with body_hash signing.'))
  117012. }
  117013. var shasum = crypto.createHash('sha1')
  117014. shasum.update(body || '')
  117015. var sha1 = shasum.digest('hex')
  117016. return Buffer.from(sha1, 'hex').toString('base64')
  117017. }
  117018. OAuth.prototype.concatParams = function (oa, sep, wrap) {
  117019. wrap = wrap || ''
  117020. var params = Object.keys(oa).filter(function (i) {
  117021. return i !== 'realm' && i !== 'oauth_signature'
  117022. }).sort()
  117023. if (oa.realm) {
  117024. params.splice(0, 0, 'realm')
  117025. }
  117026. params.push('oauth_signature')
  117027. return params.map(function (i) {
  117028. return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap
  117029. }).join(sep)
  117030. }
  117031. OAuth.prototype.onRequest = function (_oauth) {
  117032. var self = this
  117033. self.params = _oauth
  117034. var uri = self.request.uri || {}
  117035. var method = self.request.method || ''
  117036. var headers = caseless(self.request.headers)
  117037. var body = self.request.body || ''
  117038. var qsLib = self.request.qsLib || qs
  117039. var form
  117040. var query
  117041. var contentType = headers.get('content-type') || ''
  117042. var formContentType = 'application/x-www-form-urlencoded'
  117043. var transport = _oauth.transport_method || 'header'
  117044. if (contentType.slice(0, formContentType.length) === formContentType) {
  117045. contentType = formContentType
  117046. form = body
  117047. }
  117048. if (uri.query) {
  117049. query = uri.query
  117050. }
  117051. if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) {
  117052. self.request.emit('error', new Error('oauth: transport_method of body requires POST ' +
  117053. 'and content-type ' + formContentType))
  117054. }
  117055. if (!form && typeof _oauth.body_hash === 'boolean') {
  117056. _oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString())
  117057. }
  117058. var oa = self.buildParams(_oauth, uri, method, query, form, qsLib)
  117059. switch (transport) {
  117060. case 'header':
  117061. self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '"'))
  117062. break
  117063. case 'query':
  117064. var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&')
  117065. self.request.uri = url.parse(href)
  117066. self.request.path = self.request.uri.path
  117067. break
  117068. case 'body':
  117069. self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&')
  117070. break
  117071. default:
  117072. self.request.emit('error', new Error('oauth: transport_method invalid'))
  117073. }
  117074. }
  117075. exports.OAuth = OAuth
  117076. /***/ }),
  117077. /* 879 */
  117078. /***/ (function(module, exports, __webpack_require__) {
  117079. "use strict";
  117080. var qs = __webpack_require__(374)
  117081. var querystring = __webpack_require__(186)
  117082. function Querystring (request) {
  117083. this.request = request
  117084. this.lib = null
  117085. this.useQuerystring = null
  117086. this.parseOptions = null
  117087. this.stringifyOptions = null
  117088. }
  117089. Querystring.prototype.init = function (options) {
  117090. if (this.lib) { return }
  117091. this.useQuerystring = options.useQuerystring
  117092. this.lib = (this.useQuerystring ? querystring : qs)
  117093. this.parseOptions = options.qsParseOptions || {}
  117094. this.stringifyOptions = options.qsStringifyOptions || {}
  117095. }
  117096. Querystring.prototype.stringify = function (obj) {
  117097. return (this.useQuerystring)
  117098. ? this.rfc3986(this.lib.stringify(obj,
  117099. this.stringifyOptions.sep || null,
  117100. this.stringifyOptions.eq || null,
  117101. this.stringifyOptions))
  117102. : this.lib.stringify(obj, this.stringifyOptions)
  117103. }
  117104. Querystring.prototype.parse = function (str) {
  117105. return (this.useQuerystring)
  117106. ? this.lib.parse(str,
  117107. this.parseOptions.sep || null,
  117108. this.parseOptions.eq || null,
  117109. this.parseOptions)
  117110. : this.lib.parse(str, this.parseOptions)
  117111. }
  117112. Querystring.prototype.rfc3986 = function (str) {
  117113. return str.replace(/[!'()*]/g, function (c) {
  117114. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  117115. })
  117116. }
  117117. Querystring.prototype.unescape = querystring.unescape
  117118. exports.Querystring = Querystring
  117119. /***/ }),
  117120. /* 880 */
  117121. /***/ (function(module, exports, __webpack_require__) {
  117122. "use strict";
  117123. var url = __webpack_require__(29)
  117124. var isUrl = /^https?:/
  117125. function Redirect (request) {
  117126. this.request = request
  117127. this.followRedirect = true
  117128. this.followRedirects = true
  117129. this.followAllRedirects = false
  117130. this.followOriginalHttpMethod = false
  117131. this.allowRedirect = function () { return true }
  117132. this.maxRedirects = 10
  117133. this.redirects = []
  117134. this.redirectsFollowed = 0
  117135. this.removeRefererHeader = false
  117136. }
  117137. Redirect.prototype.onRequest = function (options) {
  117138. var self = this
  117139. if (options.maxRedirects !== undefined) {
  117140. self.maxRedirects = options.maxRedirects
  117141. }
  117142. if (typeof options.followRedirect === 'function') {
  117143. self.allowRedirect = options.followRedirect
  117144. }
  117145. if (options.followRedirect !== undefined) {
  117146. self.followRedirects = !!options.followRedirect
  117147. }
  117148. if (options.followAllRedirects !== undefined) {
  117149. self.followAllRedirects = options.followAllRedirects
  117150. }
  117151. if (self.followRedirects || self.followAllRedirects) {
  117152. self.redirects = self.redirects || []
  117153. }
  117154. if (options.removeRefererHeader !== undefined) {
  117155. self.removeRefererHeader = options.removeRefererHeader
  117156. }
  117157. if (options.followOriginalHttpMethod !== undefined) {
  117158. self.followOriginalHttpMethod = options.followOriginalHttpMethod
  117159. }
  117160. }
  117161. Redirect.prototype.redirectTo = function (response) {
  117162. var self = this
  117163. var request = self.request
  117164. var redirectTo = null
  117165. if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) {
  117166. var location = response.caseless.get('location')
  117167. request.debug('redirect', location)
  117168. if (self.followAllRedirects) {
  117169. redirectTo = location
  117170. } else if (self.followRedirects) {
  117171. switch (request.method) {
  117172. case 'PATCH':
  117173. case 'PUT':
  117174. case 'POST':
  117175. case 'DELETE':
  117176. // Do not follow redirects
  117177. break
  117178. default:
  117179. redirectTo = location
  117180. break
  117181. }
  117182. }
  117183. } else if (response.statusCode === 401) {
  117184. var authHeader = request._auth.onResponse(response)
  117185. if (authHeader) {
  117186. request.setHeader('authorization', authHeader)
  117187. redirectTo = request.uri
  117188. }
  117189. }
  117190. return redirectTo
  117191. }
  117192. Redirect.prototype.onResponse = function (response) {
  117193. var self = this
  117194. var request = self.request
  117195. var redirectTo = self.redirectTo(response)
  117196. if (!redirectTo || !self.allowRedirect.call(request, response)) {
  117197. return false
  117198. }
  117199. request.debug('redirect to', redirectTo)
  117200. // ignore any potential response body. it cannot possibly be useful
  117201. // to us at this point.
  117202. // response.resume should be defined, but check anyway before calling. Workaround for browserify.
  117203. if (response.resume) {
  117204. response.resume()
  117205. }
  117206. if (self.redirectsFollowed >= self.maxRedirects) {
  117207. request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href))
  117208. return false
  117209. }
  117210. self.redirectsFollowed += 1
  117211. if (!isUrl.test(redirectTo)) {
  117212. redirectTo = url.resolve(request.uri.href, redirectTo)
  117213. }
  117214. var uriPrev = request.uri
  117215. request.uri = url.parse(redirectTo)
  117216. // handle the case where we change protocol from https to http or vice versa
  117217. if (request.uri.protocol !== uriPrev.protocol) {
  117218. delete request.agent
  117219. }
  117220. self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo })
  117221. if (self.followAllRedirects && request.method !== 'HEAD' &&
  117222. response.statusCode !== 401 && response.statusCode !== 307) {
  117223. request.method = self.followOriginalHttpMethod ? request.method : 'GET'
  117224. }
  117225. // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215
  117226. delete request.src
  117227. delete request.req
  117228. delete request._started
  117229. if (response.statusCode !== 401 && response.statusCode !== 307) {
  117230. // Remove parameters from the previous response, unless this is the second request
  117231. // for a server that requires digest authentication.
  117232. delete request.body
  117233. delete request._form
  117234. if (request.headers) {
  117235. request.removeHeader('host')
  117236. request.removeHeader('content-type')
  117237. request.removeHeader('content-length')
  117238. if (request.uri.hostname !== request.originalHost.split(':')[0]) {
  117239. // Remove authorization if changing hostnames (but not if just
  117240. // changing ports or protocols). This matches the behavior of curl:
  117241. // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710
  117242. request.removeHeader('authorization')
  117243. }
  117244. }
  117245. }
  117246. if (!self.removeRefererHeader) {
  117247. request.setHeader('referer', uriPrev.href)
  117248. }
  117249. request.emit('redirect')
  117250. request.init()
  117251. return true
  117252. }
  117253. exports.Redirect = Redirect
  117254. /***/ }),
  117255. /* 881 */
  117256. /***/ (function(module, exports, __webpack_require__) {
  117257. "use strict";
  117258. var url = __webpack_require__(29)
  117259. var tunnel = __webpack_require__(1028)
  117260. var defaultProxyHeaderWhiteList = [
  117261. 'accept',
  117262. 'accept-charset',
  117263. 'accept-encoding',
  117264. 'accept-language',
  117265. 'accept-ranges',
  117266. 'cache-control',
  117267. 'content-encoding',
  117268. 'content-language',
  117269. 'content-location',
  117270. 'content-md5',
  117271. 'content-range',
  117272. 'content-type',
  117273. 'connection',
  117274. 'date',
  117275. 'expect',
  117276. 'max-forwards',
  117277. 'pragma',
  117278. 'referer',
  117279. 'te',
  117280. 'user-agent',
  117281. 'via'
  117282. ]
  117283. var defaultProxyHeaderExclusiveList = [
  117284. 'proxy-authorization'
  117285. ]
  117286. function constructProxyHost (uriObject) {
  117287. var port = uriObject.port
  117288. var protocol = uriObject.protocol
  117289. var proxyHost = uriObject.hostname + ':'
  117290. if (port) {
  117291. proxyHost += port
  117292. } else if (protocol === 'https:') {
  117293. proxyHost += '443'
  117294. } else {
  117295. proxyHost += '80'
  117296. }
  117297. return proxyHost
  117298. }
  117299. function constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) {
  117300. var whiteList = proxyHeaderWhiteList
  117301. .reduce(function (set, header) {
  117302. set[header.toLowerCase()] = true
  117303. return set
  117304. }, {})
  117305. return Object.keys(headers)
  117306. .filter(function (header) {
  117307. return whiteList[header.toLowerCase()]
  117308. })
  117309. .reduce(function (set, header) {
  117310. set[header] = headers[header]
  117311. return set
  117312. }, {})
  117313. }
  117314. function constructTunnelOptions (request, proxyHeaders) {
  117315. var proxy = request.proxy
  117316. var tunnelOptions = {
  117317. proxy: {
  117318. host: proxy.hostname,
  117319. port: +proxy.port,
  117320. proxyAuth: proxy.auth,
  117321. headers: proxyHeaders
  117322. },
  117323. headers: request.headers,
  117324. ca: request.ca,
  117325. cert: request.cert,
  117326. key: request.key,
  117327. passphrase: request.passphrase,
  117328. pfx: request.pfx,
  117329. ciphers: request.ciphers,
  117330. rejectUnauthorized: request.rejectUnauthorized,
  117331. secureOptions: request.secureOptions,
  117332. secureProtocol: request.secureProtocol
  117333. }
  117334. return tunnelOptions
  117335. }
  117336. function constructTunnelFnName (uri, proxy) {
  117337. var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')
  117338. var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')
  117339. return [uriProtocol, proxyProtocol].join('Over')
  117340. }
  117341. function getTunnelFn (request) {
  117342. var uri = request.uri
  117343. var proxy = request.proxy
  117344. var tunnelFnName = constructTunnelFnName(uri, proxy)
  117345. return tunnel[tunnelFnName]
  117346. }
  117347. function Tunnel (request) {
  117348. this.request = request
  117349. this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList
  117350. this.proxyHeaderExclusiveList = []
  117351. if (typeof request.tunnel !== 'undefined') {
  117352. this.tunnelOverride = request.tunnel
  117353. }
  117354. }
  117355. Tunnel.prototype.isEnabled = function () {
  117356. var self = this
  117357. var request = self.request
  117358. // Tunnel HTTPS by default. Allow the user to override this setting.
  117359. // If self.tunnelOverride is set (the user specified a value), use it.
  117360. if (typeof self.tunnelOverride !== 'undefined') {
  117361. return self.tunnelOverride
  117362. }
  117363. // If the destination is HTTPS, tunnel.
  117364. if (request.uri.protocol === 'https:') {
  117365. return true
  117366. }
  117367. // Otherwise, do not use tunnel.
  117368. return false
  117369. }
  117370. Tunnel.prototype.setup = function (options) {
  117371. var self = this
  117372. var request = self.request
  117373. options = options || {}
  117374. if (typeof request.proxy === 'string') {
  117375. request.proxy = url.parse(request.proxy)
  117376. }
  117377. if (!request.proxy || !request.tunnel) {
  117378. return false
  117379. }
  117380. // Setup Proxy Header Exclusive List and White List
  117381. if (options.proxyHeaderWhiteList) {
  117382. self.proxyHeaderWhiteList = options.proxyHeaderWhiteList
  117383. }
  117384. if (options.proxyHeaderExclusiveList) {
  117385. self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList
  117386. }
  117387. var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)
  117388. var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)
  117389. // Setup Proxy Headers and Proxy Headers Host
  117390. // Only send the Proxy White Listed Header names
  117391. var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList)
  117392. proxyHeaders.host = constructProxyHost(request.uri)
  117393. proxyHeaderExclusiveList.forEach(request.removeHeader, request)
  117394. // Set Agent from Tunnel Data
  117395. var tunnelFn = getTunnelFn(request)
  117396. var tunnelOptions = constructTunnelOptions(request, proxyHeaders)
  117397. request.agent = tunnelFn(tunnelOptions)
  117398. return true
  117399. }
  117400. Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList
  117401. Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList
  117402. exports.Tunnel = Tunnel
  117403. /***/ }),
  117404. /* 882 */
  117405. /***/ (function(module, exports, __webpack_require__) {
  117406. "use strict";
  117407. /*!
  117408. * Copyright (c) 2015, Salesforce.com, Inc.
  117409. * All rights reserved.
  117410. *
  117411. * Redistribution and use in source and binary forms, with or without
  117412. * modification, are permitted provided that the following conditions are met:
  117413. *
  117414. * 1. Redistributions of source code must retain the above copyright notice,
  117415. * this list of conditions and the following disclaimer.
  117416. *
  117417. * 2. Redistributions in binary form must reproduce the above copyright notice,
  117418. * this list of conditions and the following disclaimer in the documentation
  117419. * and/or other materials provided with the distribution.
  117420. *
  117421. * 3. Neither the name of Salesforce.com nor the names of its contributors may
  117422. * be used to endorse or promote products derived from this software without
  117423. * specific prior written permission.
  117424. *
  117425. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  117426. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  117427. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  117428. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  117429. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  117430. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  117431. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  117432. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  117433. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  117434. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  117435. * POSSIBILITY OF SUCH DAMAGE.
  117436. */
  117437. var net = __webpack_require__(151);
  117438. var urlParse = __webpack_require__(29).parse;
  117439. var pubsuffix = __webpack_require__(385);
  117440. var Store = __webpack_require__(386).Store;
  117441. var MemoryCookieStore = __webpack_require__(883).MemoryCookieStore;
  117442. var pathMatch = __webpack_require__(383).pathMatch;
  117443. var VERSION = __webpack_require__(884).version;
  117444. var punycode;
  117445. try {
  117446. punycode = __webpack_require__(246);
  117447. } catch(e) {
  117448. console.warn("cookie: can't load punycode; won't use punycode for domain normalization");
  117449. }
  117450. // From RFC6265 S4.1.1
  117451. // note that it excludes \x3B ";"
  117452. var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/;
  117453. var CONTROL_CHARS = /[\x00-\x1F]/;
  117454. // From Chromium // '\r', '\n' and '\0' should be treated as a terminator in
  117455. // the "relaxed" mode, see:
  117456. // https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60
  117457. var TERMINATORS = ['\n', '\r', '\0'];
  117458. // RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"'
  117459. // Note ';' is \x3B
  117460. var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/;
  117461. // date-time parsing constants (RFC6265 S5.1.1)
  117462. var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/;
  117463. var MONTH_TO_NUM = {
  117464. jan:0, feb:1, mar:2, apr:3, may:4, jun:5,
  117465. jul:6, aug:7, sep:8, oct:9, nov:10, dec:11
  117466. };
  117467. var NUM_TO_MONTH = [
  117468. 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'
  117469. ];
  117470. var NUM_TO_DAY = [
  117471. 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'
  117472. ];
  117473. var MAX_TIME = 2147483647000; // 31-bit max
  117474. var MIN_TIME = 0; // 31-bit min
  117475. /*
  117476. * Parses a Natural number (i.e., non-negative integer) with either the
  117477. * <min>*<max>DIGIT ( non-digit *OCTET )
  117478. * or
  117479. * <min>*<max>DIGIT
  117480. * grammar (RFC6265 S5.1.1).
  117481. *
  117482. * The "trailingOK" boolean controls if the grammar accepts a
  117483. * "( non-digit *OCTET )" trailer.
  117484. */
  117485. function parseDigits(token, minDigits, maxDigits, trailingOK) {
  117486. var count = 0;
  117487. while (count < token.length) {
  117488. var c = token.charCodeAt(count);
  117489. // "non-digit = %x00-2F / %x3A-FF"
  117490. if (c <= 0x2F || c >= 0x3A) {
  117491. break;
  117492. }
  117493. count++;
  117494. }
  117495. // constrain to a minimum and maximum number of digits.
  117496. if (count < minDigits || count > maxDigits) {
  117497. return null;
  117498. }
  117499. if (!trailingOK && count != token.length) {
  117500. return null;
  117501. }
  117502. return parseInt(token.substr(0,count), 10);
  117503. }
  117504. function parseTime(token) {
  117505. var parts = token.split(':');
  117506. var result = [0,0,0];
  117507. /* RF6256 S5.1.1:
  117508. * time = hms-time ( non-digit *OCTET )
  117509. * hms-time = time-field ":" time-field ":" time-field
  117510. * time-field = 1*2DIGIT
  117511. */
  117512. if (parts.length !== 3) {
  117513. return null;
  117514. }
  117515. for (var i = 0; i < 3; i++) {
  117516. // "time-field" must be strictly "1*2DIGIT", HOWEVER, "hms-time" can be
  117517. // followed by "( non-digit *OCTET )" so therefore the last time-field can
  117518. // have a trailer
  117519. var trailingOK = (i == 2);
  117520. var num = parseDigits(parts[i], 1, 2, trailingOK);
  117521. if (num === null) {
  117522. return null;
  117523. }
  117524. result[i] = num;
  117525. }
  117526. return result;
  117527. }
  117528. function parseMonth(token) {
  117529. token = String(token).substr(0,3).toLowerCase();
  117530. var num = MONTH_TO_NUM[token];
  117531. return num >= 0 ? num : null;
  117532. }
  117533. /*
  117534. * RFC6265 S5.1.1 date parser (see RFC for full grammar)
  117535. */
  117536. function parseDate(str) {
  117537. if (!str) {
  117538. return;
  117539. }
  117540. /* RFC6265 S5.1.1:
  117541. * 2. Process each date-token sequentially in the order the date-tokens
  117542. * appear in the cookie-date
  117543. */
  117544. var tokens = str.split(DATE_DELIM);
  117545. if (!tokens) {
  117546. return;
  117547. }
  117548. var hour = null;
  117549. var minute = null;
  117550. var second = null;
  117551. var dayOfMonth = null;
  117552. var month = null;
  117553. var year = null;
  117554. for (var i=0; i<tokens.length; i++) {
  117555. var token = tokens[i].trim();
  117556. if (!token.length) {
  117557. continue;
  117558. }
  117559. var result;
  117560. /* 2.1. If the found-time flag is not set and the token matches the time
  117561. * production, set the found-time flag and set the hour- value,
  117562. * minute-value, and second-value to the numbers denoted by the digits in
  117563. * the date-token, respectively. Skip the remaining sub-steps and continue
  117564. * to the next date-token.
  117565. */
  117566. if (second === null) {
  117567. result = parseTime(token);
  117568. if (result) {
  117569. hour = result[0];
  117570. minute = result[1];
  117571. second = result[2];
  117572. continue;
  117573. }
  117574. }
  117575. /* 2.2. If the found-day-of-month flag is not set and the date-token matches
  117576. * the day-of-month production, set the found-day-of- month flag and set
  117577. * the day-of-month-value to the number denoted by the date-token. Skip
  117578. * the remaining sub-steps and continue to the next date-token.
  117579. */
  117580. if (dayOfMonth === null) {
  117581. // "day-of-month = 1*2DIGIT ( non-digit *OCTET )"
  117582. result = parseDigits(token, 1, 2, true);
  117583. if (result !== null) {
  117584. dayOfMonth = result;
  117585. continue;
  117586. }
  117587. }
  117588. /* 2.3. If the found-month flag is not set and the date-token matches the
  117589. * month production, set the found-month flag and set the month-value to
  117590. * the month denoted by the date-token. Skip the remaining sub-steps and
  117591. * continue to the next date-token.
  117592. */
  117593. if (month === null) {
  117594. result = parseMonth(token);
  117595. if (result !== null) {
  117596. month = result;
  117597. continue;
  117598. }
  117599. }
  117600. /* 2.4. If the found-year flag is not set and the date-token matches the
  117601. * year production, set the found-year flag and set the year-value to the
  117602. * number denoted by the date-token. Skip the remaining sub-steps and
  117603. * continue to the next date-token.
  117604. */
  117605. if (year === null) {
  117606. // "year = 2*4DIGIT ( non-digit *OCTET )"
  117607. result = parseDigits(token, 2, 4, true);
  117608. if (result !== null) {
  117609. year = result;
  117610. /* From S5.1.1:
  117611. * 3. If the year-value is greater than or equal to 70 and less
  117612. * than or equal to 99, increment the year-value by 1900.
  117613. * 4. If the year-value is greater than or equal to 0 and less
  117614. * than or equal to 69, increment the year-value by 2000.
  117615. */
  117616. if (year >= 70 && year <= 99) {
  117617. year += 1900;
  117618. } else if (year >= 0 && year <= 69) {
  117619. year += 2000;
  117620. }
  117621. }
  117622. }
  117623. }
  117624. /* RFC 6265 S5.1.1
  117625. * "5. Abort these steps and fail to parse the cookie-date if:
  117626. * * at least one of the found-day-of-month, found-month, found-
  117627. * year, or found-time flags is not set,
  117628. * * the day-of-month-value is less than 1 or greater than 31,
  117629. * * the year-value is less than 1601,
  117630. * * the hour-value is greater than 23,
  117631. * * the minute-value is greater than 59, or
  117632. * * the second-value is greater than 59.
  117633. * (Note that leap seconds cannot be represented in this syntax.)"
  117634. *
  117635. * So, in order as above:
  117636. */
  117637. if (
  117638. dayOfMonth === null || month === null || year === null || second === null ||
  117639. dayOfMonth < 1 || dayOfMonth > 31 ||
  117640. year < 1601 ||
  117641. hour > 23 ||
  117642. minute > 59 ||
  117643. second > 59
  117644. ) {
  117645. return;
  117646. }
  117647. return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));
  117648. }
  117649. function formatDate(date) {
  117650. var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;
  117651. var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;
  117652. var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;
  117653. var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;
  117654. return NUM_TO_DAY[date.getUTCDay()] + ', ' +
  117655. d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+
  117656. h+':'+m+':'+s+' GMT';
  117657. }
  117658. // S5.1.2 Canonicalized Host Names
  117659. function canonicalDomain(str) {
  117660. if (str == null) {
  117661. return null;
  117662. }
  117663. str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading .
  117664. // convert to IDN if any non-ASCII characters
  117665. if (punycode && /[^\u0001-\u007f]/.test(str)) {
  117666. str = punycode.toASCII(str);
  117667. }
  117668. return str.toLowerCase();
  117669. }
  117670. // S5.1.3 Domain Matching
  117671. function domainMatch(str, domStr, canonicalize) {
  117672. if (str == null || domStr == null) {
  117673. return null;
  117674. }
  117675. if (canonicalize !== false) {
  117676. str = canonicalDomain(str);
  117677. domStr = canonicalDomain(domStr);
  117678. }
  117679. /*
  117680. * "The domain string and the string are identical. (Note that both the
  117681. * domain string and the string will have been canonicalized to lower case at
  117682. * this point)"
  117683. */
  117684. if (str == domStr) {
  117685. return true;
  117686. }
  117687. /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */
  117688. /* "* The string is a host name (i.e., not an IP address)." */
  117689. if (net.isIP(str)) {
  117690. return false;
  117691. }
  117692. /* "* The domain string is a suffix of the string" */
  117693. var idx = str.indexOf(domStr);
  117694. if (idx <= 0) {
  117695. return false; // it's a non-match (-1) or prefix (0)
  117696. }
  117697. // e.g "a.b.c".indexOf("b.c") === 2
  117698. // 5 === 3+2
  117699. if (str.length !== domStr.length + idx) { // it's not a suffix
  117700. return false;
  117701. }
  117702. /* "* The last character of the string that is not included in the domain
  117703. * string is a %x2E (".") character." */
  117704. if (str.substr(idx-1,1) !== '.') {
  117705. return false;
  117706. }
  117707. return true;
  117708. }
  117709. // RFC6265 S5.1.4 Paths and Path-Match
  117710. /*
  117711. * "The user agent MUST use an algorithm equivalent to the following algorithm
  117712. * to compute the default-path of a cookie:"
  117713. *
  117714. * Assumption: the path (and not query part or absolute uri) is passed in.
  117715. */
  117716. function defaultPath(path) {
  117717. // "2. If the uri-path is empty or if the first character of the uri-path is not
  117718. // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps.
  117719. if (!path || path.substr(0,1) !== "/") {
  117720. return "/";
  117721. }
  117722. // "3. If the uri-path contains no more than one %x2F ("/") character, output
  117723. // %x2F ("/") and skip the remaining step."
  117724. if (path === "/") {
  117725. return path;
  117726. }
  117727. var rightSlash = path.lastIndexOf("/");
  117728. if (rightSlash === 0) {
  117729. return "/";
  117730. }
  117731. // "4. Output the characters of the uri-path from the first character up to,
  117732. // but not including, the right-most %x2F ("/")."
  117733. return path.slice(0, rightSlash);
  117734. }
  117735. function trimTerminator(str) {
  117736. for (var t = 0; t < TERMINATORS.length; t++) {
  117737. var terminatorIdx = str.indexOf(TERMINATORS[t]);
  117738. if (terminatorIdx !== -1) {
  117739. str = str.substr(0,terminatorIdx);
  117740. }
  117741. }
  117742. return str;
  117743. }
  117744. function parseCookiePair(cookiePair, looseMode) {
  117745. cookiePair = trimTerminator(cookiePair);
  117746. var firstEq = cookiePair.indexOf('=');
  117747. if (looseMode) {
  117748. if (firstEq === 0) { // '=' is immediately at start
  117749. cookiePair = cookiePair.substr(1);
  117750. firstEq = cookiePair.indexOf('='); // might still need to split on '='
  117751. }
  117752. } else { // non-loose mode
  117753. if (firstEq <= 0) { // no '=' or is at start
  117754. return; // needs to have non-empty "cookie-name"
  117755. }
  117756. }
  117757. var cookieName, cookieValue;
  117758. if (firstEq <= 0) {
  117759. cookieName = "";
  117760. cookieValue = cookiePair.trim();
  117761. } else {
  117762. cookieName = cookiePair.substr(0, firstEq).trim();
  117763. cookieValue = cookiePair.substr(firstEq+1).trim();
  117764. }
  117765. if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) {
  117766. return;
  117767. }
  117768. var c = new Cookie();
  117769. c.key = cookieName;
  117770. c.value = cookieValue;
  117771. return c;
  117772. }
  117773. function parse(str, options) {
  117774. if (!options || typeof options !== 'object') {
  117775. options = {};
  117776. }
  117777. str = str.trim();
  117778. // We use a regex to parse the "name-value-pair" part of S5.2
  117779. var firstSemi = str.indexOf(';'); // S5.2 step 1
  117780. var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi);
  117781. var c = parseCookiePair(cookiePair, !!options.loose);
  117782. if (!c) {
  117783. return;
  117784. }
  117785. if (firstSemi === -1) {
  117786. return c;
  117787. }
  117788. // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string
  117789. // (including the %x3B (";") in question)." plus later on in the same section
  117790. // "discard the first ";" and trim".
  117791. var unparsed = str.slice(firstSemi + 1).trim();
  117792. // "If the unparsed-attributes string is empty, skip the rest of these
  117793. // steps."
  117794. if (unparsed.length === 0) {
  117795. return c;
  117796. }
  117797. /*
  117798. * S5.2 says that when looping over the items "[p]rocess the attribute-name
  117799. * and attribute-value according to the requirements in the following
  117800. * subsections" for every item. Plus, for many of the individual attributes
  117801. * in S5.3 it says to use the "attribute-value of the last attribute in the
  117802. * cookie-attribute-list". Therefore, in this implementation, we overwrite
  117803. * the previous value.
  117804. */
  117805. var cookie_avs = unparsed.split(';');
  117806. while (cookie_avs.length) {
  117807. var av = cookie_avs.shift().trim();
  117808. if (av.length === 0) { // happens if ";;" appears
  117809. continue;
  117810. }
  117811. var av_sep = av.indexOf('=');
  117812. var av_key, av_value;
  117813. if (av_sep === -1) {
  117814. av_key = av;
  117815. av_value = null;
  117816. } else {
  117817. av_key = av.substr(0,av_sep);
  117818. av_value = av.substr(av_sep+1);
  117819. }
  117820. av_key = av_key.trim().toLowerCase();
  117821. if (av_value) {
  117822. av_value = av_value.trim();
  117823. }
  117824. switch(av_key) {
  117825. case 'expires': // S5.2.1
  117826. if (av_value) {
  117827. var exp = parseDate(av_value);
  117828. // "If the attribute-value failed to parse as a cookie date, ignore the
  117829. // cookie-av."
  117830. if (exp) {
  117831. // over and underflow not realistically a concern: V8's getTime() seems to
  117832. // store something larger than a 32-bit time_t (even with 32-bit node)
  117833. c.expires = exp;
  117834. }
  117835. }
  117836. break;
  117837. case 'max-age': // S5.2.2
  117838. if (av_value) {
  117839. // "If the first character of the attribute-value is not a DIGIT or a "-"
  117840. // character ...[or]... If the remainder of attribute-value contains a
  117841. // non-DIGIT character, ignore the cookie-av."
  117842. if (/^-?[0-9]+$/.test(av_value)) {
  117843. var delta = parseInt(av_value, 10);
  117844. // "If delta-seconds is less than or equal to zero (0), let expiry-time
  117845. // be the earliest representable date and time."
  117846. c.setMaxAge(delta);
  117847. }
  117848. }
  117849. break;
  117850. case 'domain': // S5.2.3
  117851. // "If the attribute-value is empty, the behavior is undefined. However,
  117852. // the user agent SHOULD ignore the cookie-av entirely."
  117853. if (av_value) {
  117854. // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E
  117855. // (".") character."
  117856. var domain = av_value.trim().replace(/^\./, '');
  117857. if (domain) {
  117858. // "Convert the cookie-domain to lower case."
  117859. c.domain = domain.toLowerCase();
  117860. }
  117861. }
  117862. break;
  117863. case 'path': // S5.2.4
  117864. /*
  117865. * "If the attribute-value is empty or if the first character of the
  117866. * attribute-value is not %x2F ("/"):
  117867. * Let cookie-path be the default-path.
  117868. * Otherwise:
  117869. * Let cookie-path be the attribute-value."
  117870. *
  117871. * We'll represent the default-path as null since it depends on the
  117872. * context of the parsing.
  117873. */
  117874. c.path = av_value && av_value[0] === "/" ? av_value : null;
  117875. break;
  117876. case 'secure': // S5.2.5
  117877. /*
  117878. * "If the attribute-name case-insensitively matches the string "Secure",
  117879. * the user agent MUST append an attribute to the cookie-attribute-list
  117880. * with an attribute-name of Secure and an empty attribute-value."
  117881. */
  117882. c.secure = true;
  117883. break;
  117884. case 'httponly': // S5.2.6 -- effectively the same as 'secure'
  117885. c.httpOnly = true;
  117886. break;
  117887. default:
  117888. c.extensions = c.extensions || [];
  117889. c.extensions.push(av);
  117890. break;
  117891. }
  117892. }
  117893. return c;
  117894. }
  117895. // avoid the V8 deoptimization monster!
  117896. function jsonParse(str) {
  117897. var obj;
  117898. try {
  117899. obj = JSON.parse(str);
  117900. } catch (e) {
  117901. return e;
  117902. }
  117903. return obj;
  117904. }
  117905. function fromJSON(str) {
  117906. if (!str) {
  117907. return null;
  117908. }
  117909. var obj;
  117910. if (typeof str === 'string') {
  117911. obj = jsonParse(str);
  117912. if (obj instanceof Error) {
  117913. return null;
  117914. }
  117915. } else {
  117916. // assume it's an Object
  117917. obj = str;
  117918. }
  117919. var c = new Cookie();
  117920. for (var i=0; i<Cookie.serializableProperties.length; i++) {
  117921. var prop = Cookie.serializableProperties[i];
  117922. if (obj[prop] === undefined ||
  117923. obj[prop] === Cookie.prototype[prop])
  117924. {
  117925. continue; // leave as prototype default
  117926. }
  117927. if (prop === 'expires' ||
  117928. prop === 'creation' ||
  117929. prop === 'lastAccessed')
  117930. {
  117931. if (obj[prop] === null) {
  117932. c[prop] = null;
  117933. } else {
  117934. c[prop] = obj[prop] == "Infinity" ?
  117935. "Infinity" : new Date(obj[prop]);
  117936. }
  117937. } else {
  117938. c[prop] = obj[prop];
  117939. }
  117940. }
  117941. return c;
  117942. }
  117943. /* Section 5.4 part 2:
  117944. * "* Cookies with longer paths are listed before cookies with
  117945. * shorter paths.
  117946. *
  117947. * * Among cookies that have equal-length path fields, cookies with
  117948. * earlier creation-times are listed before cookies with later
  117949. * creation-times."
  117950. */
  117951. function cookieCompare(a,b) {
  117952. var cmp = 0;
  117953. // descending for length: b CMP a
  117954. var aPathLen = a.path ? a.path.length : 0;
  117955. var bPathLen = b.path ? b.path.length : 0;
  117956. cmp = bPathLen - aPathLen;
  117957. if (cmp !== 0) {
  117958. return cmp;
  117959. }
  117960. // ascending for time: a CMP b
  117961. var aTime = a.creation ? a.creation.getTime() : MAX_TIME;
  117962. var bTime = b.creation ? b.creation.getTime() : MAX_TIME;
  117963. cmp = aTime - bTime;
  117964. if (cmp !== 0) {
  117965. return cmp;
  117966. }
  117967. // break ties for the same millisecond (precision of JavaScript's clock)
  117968. cmp = a.creationIndex - b.creationIndex;
  117969. return cmp;
  117970. }
  117971. // Gives the permutation of all possible pathMatch()es of a given path. The
  117972. // array is in longest-to-shortest order. Handy for indexing.
  117973. function permutePath(path) {
  117974. if (path === '/') {
  117975. return ['/'];
  117976. }
  117977. if (path.lastIndexOf('/') === path.length-1) {
  117978. path = path.substr(0,path.length-1);
  117979. }
  117980. var permutations = [path];
  117981. while (path.length > 1) {
  117982. var lindex = path.lastIndexOf('/');
  117983. if (lindex === 0) {
  117984. break;
  117985. }
  117986. path = path.substr(0,lindex);
  117987. permutations.push(path);
  117988. }
  117989. permutations.push('/');
  117990. return permutations;
  117991. }
  117992. function getCookieContext(url) {
  117993. if (url instanceof Object) {
  117994. return url;
  117995. }
  117996. // NOTE: decodeURI will throw on malformed URIs (see GH-32).
  117997. // Therefore, we will just skip decoding for such URIs.
  117998. try {
  117999. url = decodeURI(url);
  118000. }
  118001. catch(err) {
  118002. // Silently swallow error
  118003. }
  118004. return urlParse(url);
  118005. }
  118006. function Cookie(options) {
  118007. options = options || {};
  118008. Object.keys(options).forEach(function(prop) {
  118009. if (Cookie.prototype.hasOwnProperty(prop) &&
  118010. Cookie.prototype[prop] !== options[prop] &&
  118011. prop.substr(0,1) !== '_')
  118012. {
  118013. this[prop] = options[prop];
  118014. }
  118015. }, this);
  118016. this.creation = this.creation || new Date();
  118017. // used to break creation ties in cookieCompare():
  118018. Object.defineProperty(this, 'creationIndex', {
  118019. configurable: false,
  118020. enumerable: false, // important for assert.deepEqual checks
  118021. writable: true,
  118022. value: ++Cookie.cookiesCreated
  118023. });
  118024. }
  118025. Cookie.cookiesCreated = 0; // incremented each time a cookie is created
  118026. Cookie.parse = parse;
  118027. Cookie.fromJSON = fromJSON;
  118028. Cookie.prototype.key = "";
  118029. Cookie.prototype.value = "";
  118030. // the order in which the RFC has them:
  118031. Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity
  118032. Cookie.prototype.maxAge = null; // takes precedence over expires for TTL
  118033. Cookie.prototype.domain = null;
  118034. Cookie.prototype.path = null;
  118035. Cookie.prototype.secure = false;
  118036. Cookie.prototype.httpOnly = false;
  118037. Cookie.prototype.extensions = null;
  118038. // set by the CookieJar:
  118039. Cookie.prototype.hostOnly = null; // boolean when set
  118040. Cookie.prototype.pathIsDefault = null; // boolean when set
  118041. Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse
  118042. Cookie.prototype.lastAccessed = null; // Date when set
  118043. Object.defineProperty(Cookie.prototype, 'creationIndex', {
  118044. configurable: true,
  118045. enumerable: false,
  118046. writable: true,
  118047. value: 0
  118048. });
  118049. Cookie.serializableProperties = Object.keys(Cookie.prototype)
  118050. .filter(function(prop) {
  118051. return !(
  118052. Cookie.prototype[prop] instanceof Function ||
  118053. prop === 'creationIndex' ||
  118054. prop.substr(0,1) === '_'
  118055. );
  118056. });
  118057. Cookie.prototype.inspect = function inspect() {
  118058. var now = Date.now();
  118059. return 'Cookie="'+this.toString() +
  118060. '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +
  118061. '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +
  118062. '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +
  118063. '"';
  118064. };
  118065. Cookie.prototype.toJSON = function() {
  118066. var obj = {};
  118067. var props = Cookie.serializableProperties;
  118068. for (var i=0; i<props.length; i++) {
  118069. var prop = props[i];
  118070. if (this[prop] === Cookie.prototype[prop]) {
  118071. continue; // leave as prototype default
  118072. }
  118073. if (prop === 'expires' ||
  118074. prop === 'creation' ||
  118075. prop === 'lastAccessed')
  118076. {
  118077. if (this[prop] === null) {
  118078. obj[prop] = null;
  118079. } else {
  118080. obj[prop] = this[prop] == "Infinity" ? // intentionally not ===
  118081. "Infinity" : this[prop].toISOString();
  118082. }
  118083. } else if (prop === 'maxAge') {
  118084. if (this[prop] !== null) {
  118085. // again, intentionally not ===
  118086. obj[prop] = (this[prop] == Infinity || this[prop] == -Infinity) ?
  118087. this[prop].toString() : this[prop];
  118088. }
  118089. } else {
  118090. if (this[prop] !== Cookie.prototype[prop]) {
  118091. obj[prop] = this[prop];
  118092. }
  118093. }
  118094. }
  118095. return obj;
  118096. };
  118097. Cookie.prototype.clone = function() {
  118098. return fromJSON(this.toJSON());
  118099. };
  118100. Cookie.prototype.validate = function validate() {
  118101. if (!COOKIE_OCTETS.test(this.value)) {
  118102. return false;
  118103. }
  118104. if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires)) {
  118105. return false;
  118106. }
  118107. if (this.maxAge != null && this.maxAge <= 0) {
  118108. return false; // "Max-Age=" non-zero-digit *DIGIT
  118109. }
  118110. if (this.path != null && !PATH_VALUE.test(this.path)) {
  118111. return false;
  118112. }
  118113. var cdomain = this.cdomain();
  118114. if (cdomain) {
  118115. if (cdomain.match(/\.$/)) {
  118116. return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this
  118117. }
  118118. var suffix = pubsuffix.getPublicSuffix(cdomain);
  118119. if (suffix == null) { // it's a public suffix
  118120. return false;
  118121. }
  118122. }
  118123. return true;
  118124. };
  118125. Cookie.prototype.setExpires = function setExpires(exp) {
  118126. if (exp instanceof Date) {
  118127. this.expires = exp;
  118128. } else {
  118129. this.expires = parseDate(exp) || "Infinity";
  118130. }
  118131. };
  118132. Cookie.prototype.setMaxAge = function setMaxAge(age) {
  118133. if (age === Infinity || age === -Infinity) {
  118134. this.maxAge = age.toString(); // so JSON.stringify() works
  118135. } else {
  118136. this.maxAge = age;
  118137. }
  118138. };
  118139. // gives Cookie header format
  118140. Cookie.prototype.cookieString = function cookieString() {
  118141. var val = this.value;
  118142. if (val == null) {
  118143. val = '';
  118144. }
  118145. if (this.key === '') {
  118146. return val;
  118147. }
  118148. return this.key+'='+val;
  118149. };
  118150. // gives Set-Cookie header format
  118151. Cookie.prototype.toString = function toString() {
  118152. var str = this.cookieString();
  118153. if (this.expires != Infinity) {
  118154. if (this.expires instanceof Date) {
  118155. str += '; Expires='+formatDate(this.expires);
  118156. } else {
  118157. str += '; Expires='+this.expires;
  118158. }
  118159. }
  118160. if (this.maxAge != null && this.maxAge != Infinity) {
  118161. str += '; Max-Age='+this.maxAge;
  118162. }
  118163. if (this.domain && !this.hostOnly) {
  118164. str += '; Domain='+this.domain;
  118165. }
  118166. if (this.path) {
  118167. str += '; Path='+this.path;
  118168. }
  118169. if (this.secure) {
  118170. str += '; Secure';
  118171. }
  118172. if (this.httpOnly) {
  118173. str += '; HttpOnly';
  118174. }
  118175. if (this.extensions) {
  118176. this.extensions.forEach(function(ext) {
  118177. str += '; '+ext;
  118178. });
  118179. }
  118180. return str;
  118181. };
  118182. // TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
  118183. // elsewhere)
  118184. // S5.3 says to give the "latest representable date" for which we use Infinity
  118185. // For "expired" we use 0
  118186. Cookie.prototype.TTL = function TTL(now) {
  118187. /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires
  118188. * attribute, the Max-Age attribute has precedence and controls the
  118189. * expiration date of the cookie.
  118190. * (Concurs with S5.3 step 3)
  118191. */
  118192. if (this.maxAge != null) {
  118193. return this.maxAge<=0 ? 0 : this.maxAge*1000;
  118194. }
  118195. var expires = this.expires;
  118196. if (expires != Infinity) {
  118197. if (!(expires instanceof Date)) {
  118198. expires = parseDate(expires) || Infinity;
  118199. }
  118200. if (expires == Infinity) {
  118201. return Infinity;
  118202. }
  118203. return expires.getTime() - (now || Date.now());
  118204. }
  118205. return Infinity;
  118206. };
  118207. // expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
  118208. // elsewhere)
  118209. Cookie.prototype.expiryTime = function expiryTime(now) {
  118210. if (this.maxAge != null) {
  118211. var relativeTo = now || this.creation || new Date();
  118212. var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000;
  118213. return relativeTo.getTime() + age;
  118214. }
  118215. if (this.expires == Infinity) {
  118216. return Infinity;
  118217. }
  118218. return this.expires.getTime();
  118219. };
  118220. // expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
  118221. // elsewhere), except it returns a Date
  118222. Cookie.prototype.expiryDate = function expiryDate(now) {
  118223. var millisec = this.expiryTime(now);
  118224. if (millisec == Infinity) {
  118225. return new Date(MAX_TIME);
  118226. } else if (millisec == -Infinity) {
  118227. return new Date(MIN_TIME);
  118228. } else {
  118229. return new Date(millisec);
  118230. }
  118231. };
  118232. // This replaces the "persistent-flag" parts of S5.3 step 3
  118233. Cookie.prototype.isPersistent = function isPersistent() {
  118234. return (this.maxAge != null || this.expires != Infinity);
  118235. };
  118236. // Mostly S5.1.2 and S5.2.3:
  118237. Cookie.prototype.cdomain =
  118238. Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() {
  118239. if (this.domain == null) {
  118240. return null;
  118241. }
  118242. return canonicalDomain(this.domain);
  118243. };
  118244. function CookieJar(store, options) {
  118245. if (typeof options === "boolean") {
  118246. options = {rejectPublicSuffixes: options};
  118247. } else if (options == null) {
  118248. options = {};
  118249. }
  118250. if (options.rejectPublicSuffixes != null) {
  118251. this.rejectPublicSuffixes = options.rejectPublicSuffixes;
  118252. }
  118253. if (options.looseMode != null) {
  118254. this.enableLooseMode = options.looseMode;
  118255. }
  118256. if (!store) {
  118257. store = new MemoryCookieStore();
  118258. }
  118259. this.store = store;
  118260. }
  118261. CookieJar.prototype.store = null;
  118262. CookieJar.prototype.rejectPublicSuffixes = true;
  118263. CookieJar.prototype.enableLooseMode = false;
  118264. var CAN_BE_SYNC = [];
  118265. CAN_BE_SYNC.push('setCookie');
  118266. CookieJar.prototype.setCookie = function(cookie, url, options, cb) {
  118267. var err;
  118268. var context = getCookieContext(url);
  118269. if (options instanceof Function) {
  118270. cb = options;
  118271. options = {};
  118272. }
  118273. var host = canonicalDomain(context.hostname);
  118274. var loose = this.enableLooseMode;
  118275. if (options.loose != null) {
  118276. loose = options.loose;
  118277. }
  118278. // S5.3 step 1
  118279. if (!(cookie instanceof Cookie)) {
  118280. cookie = Cookie.parse(cookie, { loose: loose });
  118281. }
  118282. if (!cookie) {
  118283. err = new Error("Cookie failed to parse");
  118284. return cb(options.ignoreError ? null : err);
  118285. }
  118286. // S5.3 step 2
  118287. var now = options.now || new Date(); // will assign later to save effort in the face of errors
  118288. // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()
  118289. // S5.3 step 4: NOOP; domain is null by default
  118290. // S5.3 step 5: public suffixes
  118291. if (this.rejectPublicSuffixes && cookie.domain) {
  118292. var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());
  118293. if (suffix == null) { // e.g. "com"
  118294. err = new Error("Cookie has domain set to a public suffix");
  118295. return cb(options.ignoreError ? null : err);
  118296. }
  118297. }
  118298. // S5.3 step 6:
  118299. if (cookie.domain) {
  118300. if (!domainMatch(host, cookie.cdomain(), false)) {
  118301. err = new Error("Cookie not in this host's domain. Cookie:"+cookie.cdomain()+" Request:"+host);
  118302. return cb(options.ignoreError ? null : err);
  118303. }
  118304. if (cookie.hostOnly == null) { // don't reset if already set
  118305. cookie.hostOnly = false;
  118306. }
  118307. } else {
  118308. cookie.hostOnly = true;
  118309. cookie.domain = host;
  118310. }
  118311. //S5.2.4 If the attribute-value is empty or if the first character of the
  118312. //attribute-value is not %x2F ("/"):
  118313. //Let cookie-path be the default-path.
  118314. if (!cookie.path || cookie.path[0] !== '/') {
  118315. cookie.path = defaultPath(context.pathname);
  118316. cookie.pathIsDefault = true;
  118317. }
  118318. // S5.3 step 8: NOOP; secure attribute
  118319. // S5.3 step 9: NOOP; httpOnly attribute
  118320. // S5.3 step 10
  118321. if (options.http === false && cookie.httpOnly) {
  118322. err = new Error("Cookie is HttpOnly and this isn't an HTTP API");
  118323. return cb(options.ignoreError ? null : err);
  118324. }
  118325. var store = this.store;
  118326. if (!store.updateCookie) {
  118327. store.updateCookie = function(oldCookie, newCookie, cb) {
  118328. this.putCookie(newCookie, cb);
  118329. };
  118330. }
  118331. function withCookie(err, oldCookie) {
  118332. if (err) {
  118333. return cb(err);
  118334. }
  118335. var next = function(err) {
  118336. if (err) {
  118337. return cb(err);
  118338. } else {
  118339. cb(null, cookie);
  118340. }
  118341. };
  118342. if (oldCookie) {
  118343. // S5.3 step 11 - "If the cookie store contains a cookie with the same name,
  118344. // domain, and path as the newly created cookie:"
  118345. if (options.http === false && oldCookie.httpOnly) { // step 11.2
  118346. err = new Error("old Cookie is HttpOnly and this isn't an HTTP API");
  118347. return cb(options.ignoreError ? null : err);
  118348. }
  118349. cookie.creation = oldCookie.creation; // step 11.3
  118350. cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker
  118351. cookie.lastAccessed = now;
  118352. // Step 11.4 (delete cookie) is implied by just setting the new one:
  118353. store.updateCookie(oldCookie, cookie, next); // step 12
  118354. } else {
  118355. cookie.creation = cookie.lastAccessed = now;
  118356. store.putCookie(cookie, next); // step 12
  118357. }
  118358. }
  118359. store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
  118360. };
  118361. // RFC6365 S5.4
  118362. CAN_BE_SYNC.push('getCookies');
  118363. CookieJar.prototype.getCookies = function(url, options, cb) {
  118364. var context = getCookieContext(url);
  118365. if (options instanceof Function) {
  118366. cb = options;
  118367. options = {};
  118368. }
  118369. var host = canonicalDomain(context.hostname);
  118370. var path = context.pathname || '/';
  118371. var secure = options.secure;
  118372. if (secure == null && context.protocol &&
  118373. (context.protocol == 'https:' || context.protocol == 'wss:'))
  118374. {
  118375. secure = true;
  118376. }
  118377. var http = options.http;
  118378. if (http == null) {
  118379. http = true;
  118380. }
  118381. var now = options.now || Date.now();
  118382. var expireCheck = options.expire !== false;
  118383. var allPaths = !!options.allPaths;
  118384. var store = this.store;
  118385. function matchingCookie(c) {
  118386. // "Either:
  118387. // The cookie's host-only-flag is true and the canonicalized
  118388. // request-host is identical to the cookie's domain.
  118389. // Or:
  118390. // The cookie's host-only-flag is false and the canonicalized
  118391. // request-host domain-matches the cookie's domain."
  118392. if (c.hostOnly) {
  118393. if (c.domain != host) {
  118394. return false;
  118395. }
  118396. } else {
  118397. if (!domainMatch(host, c.domain, false)) {
  118398. return false;
  118399. }
  118400. }
  118401. // "The request-uri's path path-matches the cookie's path."
  118402. if (!allPaths && !pathMatch(path, c.path)) {
  118403. return false;
  118404. }
  118405. // "If the cookie's secure-only-flag is true, then the request-uri's
  118406. // scheme must denote a "secure" protocol"
  118407. if (c.secure && !secure) {
  118408. return false;
  118409. }
  118410. // "If the cookie's http-only-flag is true, then exclude the cookie if the
  118411. // cookie-string is being generated for a "non-HTTP" API"
  118412. if (c.httpOnly && !http) {
  118413. return false;
  118414. }
  118415. // deferred from S5.3
  118416. // non-RFC: allow retention of expired cookies by choice
  118417. if (expireCheck && c.expiryTime() <= now) {
  118418. store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored
  118419. return false;
  118420. }
  118421. return true;
  118422. }
  118423. store.findCookies(host, allPaths ? null : path, function(err,cookies) {
  118424. if (err) {
  118425. return cb(err);
  118426. }
  118427. cookies = cookies.filter(matchingCookie);
  118428. // sorting of S5.4 part 2
  118429. if (options.sort !== false) {
  118430. cookies = cookies.sort(cookieCompare);
  118431. }
  118432. // S5.4 part 3
  118433. var now = new Date();
  118434. cookies.forEach(function(c) {
  118435. c.lastAccessed = now;
  118436. });
  118437. // TODO persist lastAccessed
  118438. cb(null,cookies);
  118439. });
  118440. };
  118441. CAN_BE_SYNC.push('getCookieString');
  118442. CookieJar.prototype.getCookieString = function(/*..., cb*/) {
  118443. var args = Array.prototype.slice.call(arguments,0);
  118444. var cb = args.pop();
  118445. var next = function(err,cookies) {
  118446. if (err) {
  118447. cb(err);
  118448. } else {
  118449. cb(null, cookies
  118450. .sort(cookieCompare)
  118451. .map(function(c){
  118452. return c.cookieString();
  118453. })
  118454. .join('; '));
  118455. }
  118456. };
  118457. args.push(next);
  118458. this.getCookies.apply(this,args);
  118459. };
  118460. CAN_BE_SYNC.push('getSetCookieStrings');
  118461. CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {
  118462. var args = Array.prototype.slice.call(arguments,0);
  118463. var cb = args.pop();
  118464. var next = function(err,cookies) {
  118465. if (err) {
  118466. cb(err);
  118467. } else {
  118468. cb(null, cookies.map(function(c){
  118469. return c.toString();
  118470. }));
  118471. }
  118472. };
  118473. args.push(next);
  118474. this.getCookies.apply(this,args);
  118475. };
  118476. CAN_BE_SYNC.push('serialize');
  118477. CookieJar.prototype.serialize = function(cb) {
  118478. var type = this.store.constructor.name;
  118479. if (type === 'Object') {
  118480. type = null;
  118481. }
  118482. // update README.md "Serialization Format" if you change this, please!
  118483. var serialized = {
  118484. // The version of tough-cookie that serialized this jar. Generally a good
  118485. // practice since future versions can make data import decisions based on
  118486. // known past behavior. When/if this matters, use `semver`.
  118487. version: 'tough-cookie@'+VERSION,
  118488. // add the store type, to make humans happy:
  118489. storeType: type,
  118490. // CookieJar configuration:
  118491. rejectPublicSuffixes: !!this.rejectPublicSuffixes,
  118492. // this gets filled from getAllCookies:
  118493. cookies: []
  118494. };
  118495. if (!(this.store.getAllCookies &&
  118496. typeof this.store.getAllCookies === 'function'))
  118497. {
  118498. return cb(new Error('store does not support getAllCookies and cannot be serialized'));
  118499. }
  118500. this.store.getAllCookies(function(err,cookies) {
  118501. if (err) {
  118502. return cb(err);
  118503. }
  118504. serialized.cookies = cookies.map(function(cookie) {
  118505. // convert to serialized 'raw' cookies
  118506. cookie = (cookie instanceof Cookie) ? cookie.toJSON() : cookie;
  118507. // Remove the index so new ones get assigned during deserialization
  118508. delete cookie.creationIndex;
  118509. return cookie;
  118510. });
  118511. return cb(null, serialized);
  118512. });
  118513. };
  118514. // well-known name that JSON.stringify calls
  118515. CookieJar.prototype.toJSON = function() {
  118516. return this.serializeSync();
  118517. };
  118518. // use the class method CookieJar.deserialize instead of calling this directly
  118519. CAN_BE_SYNC.push('_importCookies');
  118520. CookieJar.prototype._importCookies = function(serialized, cb) {
  118521. var jar = this;
  118522. var cookies = serialized.cookies;
  118523. if (!cookies || !Array.isArray(cookies)) {
  118524. return cb(new Error('serialized jar has no cookies array'));
  118525. }
  118526. cookies = cookies.slice(); // do not modify the original
  118527. function putNext(err) {
  118528. if (err) {
  118529. return cb(err);
  118530. }
  118531. if (!cookies.length) {
  118532. return cb(err, jar);
  118533. }
  118534. var cookie;
  118535. try {
  118536. cookie = fromJSON(cookies.shift());
  118537. } catch (e) {
  118538. return cb(e);
  118539. }
  118540. if (cookie === null) {
  118541. return putNext(null); // skip this cookie
  118542. }
  118543. jar.store.putCookie(cookie, putNext);
  118544. }
  118545. putNext();
  118546. };
  118547. CookieJar.deserialize = function(strOrObj, store, cb) {
  118548. if (arguments.length !== 3) {
  118549. // store is optional
  118550. cb = store;
  118551. store = null;
  118552. }
  118553. var serialized;
  118554. if (typeof strOrObj === 'string') {
  118555. serialized = jsonParse(strOrObj);
  118556. if (serialized instanceof Error) {
  118557. return cb(serialized);
  118558. }
  118559. } else {
  118560. serialized = strOrObj;
  118561. }
  118562. var jar = new CookieJar(store, serialized.rejectPublicSuffixes);
  118563. jar._importCookies(serialized, function(err) {
  118564. if (err) {
  118565. return cb(err);
  118566. }
  118567. cb(null, jar);
  118568. });
  118569. };
  118570. CookieJar.deserializeSync = function(strOrObj, store) {
  118571. var serialized = typeof strOrObj === 'string' ?
  118572. JSON.parse(strOrObj) : strOrObj;
  118573. var jar = new CookieJar(store, serialized.rejectPublicSuffixes);
  118574. // catch this mistake early:
  118575. if (!jar.store.synchronous) {
  118576. throw new Error('CookieJar store is not synchronous; use async API instead.');
  118577. }
  118578. jar._importCookiesSync(serialized);
  118579. return jar;
  118580. };
  118581. CookieJar.fromJSON = CookieJar.deserializeSync;
  118582. CAN_BE_SYNC.push('clone');
  118583. CookieJar.prototype.clone = function(newStore, cb) {
  118584. if (arguments.length === 1) {
  118585. cb = newStore;
  118586. newStore = null;
  118587. }
  118588. this.serialize(function(err,serialized) {
  118589. if (err) {
  118590. return cb(err);
  118591. }
  118592. CookieJar.deserialize(newStore, serialized, cb);
  118593. });
  118594. };
  118595. // Use a closure to provide a true imperative API for synchronous stores.
  118596. function syncWrap(method) {
  118597. return function() {
  118598. if (!this.store.synchronous) {
  118599. throw new Error('CookieJar store is not synchronous; use async API instead.');
  118600. }
  118601. var args = Array.prototype.slice.call(arguments);
  118602. var syncErr, syncResult;
  118603. args.push(function syncCb(err, result) {
  118604. syncErr = err;
  118605. syncResult = result;
  118606. });
  118607. this[method].apply(this, args);
  118608. if (syncErr) {
  118609. throw syncErr;
  118610. }
  118611. return syncResult;
  118612. };
  118613. }
  118614. // wrap all declared CAN_BE_SYNC methods in the sync wrapper
  118615. CAN_BE_SYNC.forEach(function(method) {
  118616. CookieJar.prototype[method+'Sync'] = syncWrap(method);
  118617. });
  118618. module.exports = {
  118619. CookieJar: CookieJar,
  118620. Cookie: Cookie,
  118621. Store: Store,
  118622. MemoryCookieStore: MemoryCookieStore,
  118623. parseDate: parseDate,
  118624. formatDate: formatDate,
  118625. parse: parse,
  118626. fromJSON: fromJSON,
  118627. domainMatch: domainMatch,
  118628. defaultPath: defaultPath,
  118629. pathMatch: pathMatch,
  118630. getPublicSuffix: pubsuffix.getPublicSuffix,
  118631. cookieCompare: cookieCompare,
  118632. permuteDomain: __webpack_require__(384).permuteDomain,
  118633. permutePath: permutePath,
  118634. canonicalDomain: canonicalDomain
  118635. };
  118636. /***/ }),
  118637. /* 883 */
  118638. /***/ (function(module, exports, __webpack_require__) {
  118639. "use strict";
  118640. /*!
  118641. * Copyright (c) 2015, Salesforce.com, Inc.
  118642. * All rights reserved.
  118643. *
  118644. * Redistribution and use in source and binary forms, with or without
  118645. * modification, are permitted provided that the following conditions are met:
  118646. *
  118647. * 1. Redistributions of source code must retain the above copyright notice,
  118648. * this list of conditions and the following disclaimer.
  118649. *
  118650. * 2. Redistributions in binary form must reproduce the above copyright notice,
  118651. * this list of conditions and the following disclaimer in the documentation
  118652. * and/or other materials provided with the distribution.
  118653. *
  118654. * 3. Neither the name of Salesforce.com nor the names of its contributors may
  118655. * be used to endorse or promote products derived from this software without
  118656. * specific prior written permission.
  118657. *
  118658. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  118659. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  118660. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  118661. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  118662. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  118663. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  118664. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  118665. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  118666. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  118667. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  118668. * POSSIBILITY OF SUCH DAMAGE.
  118669. */
  118670. var Store = __webpack_require__(386).Store;
  118671. var permuteDomain = __webpack_require__(384).permuteDomain;
  118672. var pathMatch = __webpack_require__(383).pathMatch;
  118673. var util = __webpack_require__(9);
  118674. function MemoryCookieStore() {
  118675. Store.call(this);
  118676. this.idx = {};
  118677. }
  118678. util.inherits(MemoryCookieStore, Store);
  118679. exports.MemoryCookieStore = MemoryCookieStore;
  118680. MemoryCookieStore.prototype.idx = null;
  118681. // Since it's just a struct in RAM, this Store is synchronous
  118682. MemoryCookieStore.prototype.synchronous = true;
  118683. // force a default depth:
  118684. MemoryCookieStore.prototype.inspect = function() {
  118685. return "{ idx: "+util.inspect(this.idx, false, 2)+' }';
  118686. };
  118687. MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {
  118688. if (!this.idx[domain]) {
  118689. return cb(null,undefined);
  118690. }
  118691. if (!this.idx[domain][path]) {
  118692. return cb(null,undefined);
  118693. }
  118694. return cb(null,this.idx[domain][path][key]||null);
  118695. };
  118696. MemoryCookieStore.prototype.findCookies = function(domain, path, cb) {
  118697. var results = [];
  118698. if (!domain) {
  118699. return cb(null,[]);
  118700. }
  118701. var pathMatcher;
  118702. if (!path) {
  118703. // null means "all paths"
  118704. pathMatcher = function matchAll(domainIndex) {
  118705. for (var curPath in domainIndex) {
  118706. var pathIndex = domainIndex[curPath];
  118707. for (var key in pathIndex) {
  118708. results.push(pathIndex[key]);
  118709. }
  118710. }
  118711. };
  118712. } else {
  118713. pathMatcher = function matchRFC(domainIndex) {
  118714. //NOTE: we should use path-match algorithm from S5.1.4 here
  118715. //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)
  118716. Object.keys(domainIndex).forEach(function (cookiePath) {
  118717. if (pathMatch(path, cookiePath)) {
  118718. var pathIndex = domainIndex[cookiePath];
  118719. for (var key in pathIndex) {
  118720. results.push(pathIndex[key]);
  118721. }
  118722. }
  118723. });
  118724. };
  118725. }
  118726. var domains = permuteDomain(domain) || [domain];
  118727. var idx = this.idx;
  118728. domains.forEach(function(curDomain) {
  118729. var domainIndex = idx[curDomain];
  118730. if (!domainIndex) {
  118731. return;
  118732. }
  118733. pathMatcher(domainIndex);
  118734. });
  118735. cb(null,results);
  118736. };
  118737. MemoryCookieStore.prototype.putCookie = function(cookie, cb) {
  118738. if (!this.idx[cookie.domain]) {
  118739. this.idx[cookie.domain] = {};
  118740. }
  118741. if (!this.idx[cookie.domain][cookie.path]) {
  118742. this.idx[cookie.domain][cookie.path] = {};
  118743. }
  118744. this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
  118745. cb(null);
  118746. };
  118747. MemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {
  118748. // updateCookie() may avoid updating cookies that are identical. For example,
  118749. // lastAccessed may not be important to some stores and an equality
  118750. // comparison could exclude that field.
  118751. this.putCookie(newCookie,cb);
  118752. };
  118753. MemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) {
  118754. if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {
  118755. delete this.idx[domain][path][key];
  118756. }
  118757. cb(null);
  118758. };
  118759. MemoryCookieStore.prototype.removeCookies = function(domain, path, cb) {
  118760. if (this.idx[domain]) {
  118761. if (path) {
  118762. delete this.idx[domain][path];
  118763. } else {
  118764. delete this.idx[domain];
  118765. }
  118766. }
  118767. return cb(null);
  118768. };
  118769. MemoryCookieStore.prototype.getAllCookies = function(cb) {
  118770. var cookies = [];
  118771. var idx = this.idx;
  118772. var domains = Object.keys(idx);
  118773. domains.forEach(function(domain) {
  118774. var paths = Object.keys(idx[domain]);
  118775. paths.forEach(function(path) {
  118776. var keys = Object.keys(idx[domain][path]);
  118777. keys.forEach(function(key) {
  118778. if (key !== null) {
  118779. cookies.push(idx[domain][path][key]);
  118780. }
  118781. });
  118782. });
  118783. });
  118784. // Sort by creationIndex so deserializing retains the creation order.
  118785. // When implementing your own store, this SHOULD retain the order too
  118786. cookies.sort(function(a,b) {
  118787. return (a.creationIndex||0) - (b.creationIndex||0);
  118788. });
  118789. cb(null, cookies);
  118790. };
  118791. /***/ }),
  118792. /* 884 */
  118793. /***/ (function(module, exports) {
  118794. module.exports = {"author":{"name":"Jeremy Stashewsky","email":"jstashewsky@salesforce.com","website":"https://github.com/stash"},"contributors":[{"name":"Alexander Savin","website":"https://github.com/apsavin"},{"name":"Ian Livingstone","website":"https://github.com/ianlivingstone"},{"name":"Ivan Nikulin","website":"https://github.com/inikulin"},{"name":"Lalit Kapoor","website":"https://github.com/lalitkapoor"},{"name":"Sam Thompson","website":"https://github.com/sambthompson"},{"name":"Sebastian Mayr","website":"https://github.com/Sebmaster"}],"license":"BSD-3-Clause","name":"tough-cookie","description":"RFC6265 Cookies and Cookie Jar for node.js","keywords":["HTTP","cookie","cookies","set-cookie","cookiejar","jar","RFC6265","RFC2965"],"version":"2.3.4","homepage":"https://github.com/salesforce/tough-cookie","repository":{"type":"git","url":"git://github.com/salesforce/tough-cookie.git"},"bugs":{"url":"https://github.com/salesforce/tough-cookie/issues"},"main":"./lib/cookie","files":["lib"],"scripts":{"suffixup":"curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js","test":"vows test/*_test.js"},"engines":{"node":">=0.8"},"devDependencies":{"async":"^1.4.2","string.prototype.repeat":"^0.2.0","vows":"^0.8.1"},"dependencies":{"punycode":"^1.4.1"}}
  118795. /***/ }),
  118796. /* 885 */
  118797. /***/ (function(module, exports, __webpack_require__) {
  118798. "use strict";
  118799. var http = __webpack_require__(83)
  118800. var https = __webpack_require__(185)
  118801. var url = __webpack_require__(29)
  118802. var util = __webpack_require__(9)
  118803. var stream = __webpack_require__(36)
  118804. var zlib = __webpack_require__(188)
  118805. var aws2 = __webpack_require__(462)
  118806. var aws4 = __webpack_require__(463)
  118807. var httpSignature = __webpack_require__(741)
  118808. var mime = __webpack_require__(370)
  118809. var caseless = __webpack_require__(212)
  118810. var ForeverAgent = __webpack_require__(672)
  118811. var FormData = __webpack_require__(673)
  118812. var extend = __webpack_require__(232)
  118813. var isstream = __webpack_require__(367)
  118814. var isTypedArray = __webpack_require__(791).strict
  118815. var helpers = __webpack_require__(247)
  118816. var cookies = __webpack_require__(382)
  118817. var getProxyFromURI = __webpack_require__(874)
  118818. var Querystring = __webpack_require__(879).Querystring
  118819. var Har = __webpack_require__(875).Har
  118820. var Auth = __webpack_require__(873).Auth
  118821. var OAuth = __webpack_require__(878).OAuth
  118822. var hawk = __webpack_require__(876)
  118823. var Multipart = __webpack_require__(877).Multipart
  118824. var Redirect = __webpack_require__(880).Redirect
  118825. var Tunnel = __webpack_require__(881).Tunnel
  118826. var now = __webpack_require__(848)
  118827. var Buffer = __webpack_require__(60).Buffer
  118828. var safeStringify = helpers.safeStringify
  118829. var isReadStream = helpers.isReadStream
  118830. var toBase64 = helpers.toBase64
  118831. var defer = helpers.defer
  118832. var copy = helpers.copy
  118833. var version = helpers.version
  118834. var globalCookieJar = cookies.jar()
  118835. var globalPool = {}
  118836. function filterForNonReserved (reserved, options) {
  118837. // Filter out properties that are not reserved.
  118838. // Reserved values are passed in at call site.
  118839. var object = {}
  118840. for (var i in options) {
  118841. var notReserved = (reserved.indexOf(i) === -1)
  118842. if (notReserved) {
  118843. object[i] = options[i]
  118844. }
  118845. }
  118846. return object
  118847. }
  118848. function filterOutReservedFunctions (reserved, options) {
  118849. // Filter out properties that are functions and are reserved.
  118850. // Reserved values are passed in at call site.
  118851. var object = {}
  118852. for (var i in options) {
  118853. var isReserved = !(reserved.indexOf(i) === -1)
  118854. var isFunction = (typeof options[i] === 'function')
  118855. if (!(isReserved && isFunction)) {
  118856. object[i] = options[i]
  118857. }
  118858. }
  118859. return object
  118860. }
  118861. // Return a simpler request object to allow serialization
  118862. function requestToJSON () {
  118863. var self = this
  118864. return {
  118865. uri: self.uri,
  118866. method: self.method,
  118867. headers: self.headers
  118868. }
  118869. }
  118870. // Return a simpler response object to allow serialization
  118871. function responseToJSON () {
  118872. var self = this
  118873. return {
  118874. statusCode: self.statusCode,
  118875. body: self.body,
  118876. headers: self.headers,
  118877. request: requestToJSON.call(self.request)
  118878. }
  118879. }
  118880. function Request (options) {
  118881. // if given the method property in options, set property explicitMethod to true
  118882. // extend the Request instance with any non-reserved properties
  118883. // remove any reserved functions from the options object
  118884. // set Request instance to be readable and writable
  118885. // call init
  118886. var self = this
  118887. // start with HAR, then override with additional options
  118888. if (options.har) {
  118889. self._har = new Har(self)
  118890. options = self._har.options(options)
  118891. }
  118892. stream.Stream.call(self)
  118893. var reserved = Object.keys(Request.prototype)
  118894. var nonReserved = filterForNonReserved(reserved, options)
  118895. extend(self, nonReserved)
  118896. options = filterOutReservedFunctions(reserved, options)
  118897. self.readable = true
  118898. self.writable = true
  118899. if (options.method) {
  118900. self.explicitMethod = true
  118901. }
  118902. self._qs = new Querystring(self)
  118903. self._auth = new Auth(self)
  118904. self._oauth = new OAuth(self)
  118905. self._multipart = new Multipart(self)
  118906. self._redirect = new Redirect(self)
  118907. self._tunnel = new Tunnel(self)
  118908. self.init(options)
  118909. }
  118910. util.inherits(Request, stream.Stream)
  118911. // Debugging
  118912. Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG)
  118913. function debug () {
  118914. if (Request.debug) {
  118915. console.error('REQUEST %s', util.format.apply(util, arguments))
  118916. }
  118917. }
  118918. Request.prototype.debug = debug
  118919. Request.prototype.init = function (options) {
  118920. // init() contains all the code to setup the request object.
  118921. // the actual outgoing request is not started until start() is called
  118922. // this function is called from both the constructor and on redirect.
  118923. var self = this
  118924. if (!options) {
  118925. options = {}
  118926. }
  118927. self.headers = self.headers ? copy(self.headers) : {}
  118928. // Delete headers with value undefined since they break
  118929. // ClientRequest.OutgoingMessage.setHeader in node 0.12
  118930. for (var headerName in self.headers) {
  118931. if (typeof self.headers[headerName] === 'undefined') {
  118932. delete self.headers[headerName]
  118933. }
  118934. }
  118935. caseless.httpify(self, self.headers)
  118936. if (!self.method) {
  118937. self.method = options.method || 'GET'
  118938. }
  118939. if (!self.localAddress) {
  118940. self.localAddress = options.localAddress
  118941. }
  118942. self._qs.init(options)
  118943. debug(options)
  118944. if (!self.pool && self.pool !== false) {
  118945. self.pool = globalPool
  118946. }
  118947. self.dests = self.dests || []
  118948. self.__isRequestRequest = true
  118949. // Protect against double callback
  118950. if (!self._callback && self.callback) {
  118951. self._callback = self.callback
  118952. self.callback = function () {
  118953. if (self._callbackCalled) {
  118954. return // Print a warning maybe?
  118955. }
  118956. self._callbackCalled = true
  118957. self._callback.apply(self, arguments)
  118958. }
  118959. self.on('error', self.callback.bind())
  118960. self.on('complete', self.callback.bind(self, null))
  118961. }
  118962. // People use this property instead all the time, so support it
  118963. if (!self.uri && self.url) {
  118964. self.uri = self.url
  118965. delete self.url
  118966. }
  118967. // If there's a baseUrl, then use it as the base URL (i.e. uri must be
  118968. // specified as a relative path and is appended to baseUrl).
  118969. if (self.baseUrl) {
  118970. if (typeof self.baseUrl !== 'string') {
  118971. return self.emit('error', new Error('options.baseUrl must be a string'))
  118972. }
  118973. if (typeof self.uri !== 'string') {
  118974. return self.emit('error', new Error('options.uri must be a string when using options.baseUrl'))
  118975. }
  118976. if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) {
  118977. return self.emit('error', new Error('options.uri must be a path when using options.baseUrl'))
  118978. }
  118979. // Handle all cases to make sure that there's only one slash between
  118980. // baseUrl and uri.
  118981. var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1
  118982. var uriStartsWithSlash = self.uri.indexOf('/') === 0
  118983. if (baseUrlEndsWithSlash && uriStartsWithSlash) {
  118984. self.uri = self.baseUrl + self.uri.slice(1)
  118985. } else if (baseUrlEndsWithSlash || uriStartsWithSlash) {
  118986. self.uri = self.baseUrl + self.uri
  118987. } else if (self.uri === '') {
  118988. self.uri = self.baseUrl
  118989. } else {
  118990. self.uri = self.baseUrl + '/' + self.uri
  118991. }
  118992. delete self.baseUrl
  118993. }
  118994. // A URI is needed by this point, emit error if we haven't been able to get one
  118995. if (!self.uri) {
  118996. return self.emit('error', new Error('options.uri is a required argument'))
  118997. }
  118998. // If a string URI/URL was given, parse it into a URL object
  118999. if (typeof self.uri === 'string') {
  119000. self.uri = url.parse(self.uri)
  119001. }
  119002. // Some URL objects are not from a URL parsed string and need href added
  119003. if (!self.uri.href) {
  119004. self.uri.href = url.format(self.uri)
  119005. }
  119006. // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme
  119007. if (self.uri.protocol === 'unix:') {
  119008. return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`'))
  119009. }
  119010. // Support Unix Sockets
  119011. if (self.uri.host === 'unix') {
  119012. self.enableUnixSocket()
  119013. }
  119014. if (self.strictSSL === false) {
  119015. self.rejectUnauthorized = false
  119016. }
  119017. if (!self.uri.pathname) { self.uri.pathname = '/' }
  119018. if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) {
  119019. // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar
  119020. // Detect and reject it as soon as possible
  119021. var faultyUri = url.format(self.uri)
  119022. var message = 'Invalid URI "' + faultyUri + '"'
  119023. if (Object.keys(options).length === 0) {
  119024. // No option ? This can be the sign of a redirect
  119025. // As this is a case where the user cannot do anything (they didn't call request directly with this URL)
  119026. // they should be warned that it can be caused by a redirection (can save some hair)
  119027. message += '. This can be caused by a crappy redirection.'
  119028. }
  119029. // This error was fatal
  119030. self.abort()
  119031. return self.emit('error', new Error(message))
  119032. }
  119033. if (!self.hasOwnProperty('proxy')) {
  119034. self.proxy = getProxyFromURI(self.uri)
  119035. }
  119036. self.tunnel = self._tunnel.isEnabled()
  119037. if (self.proxy) {
  119038. self._tunnel.setup(options)
  119039. }
  119040. self._redirect.onRequest(options)
  119041. self.setHost = false
  119042. if (!self.hasHeader('host')) {
  119043. var hostHeaderName = self.originalHostHeaderName || 'host'
  119044. // When used with an IPv6 address, `host` will provide
  119045. // the correct bracketed format, unlike using `hostname` and
  119046. // optionally adding the `port` when necessary.
  119047. self.setHeader(hostHeaderName, self.uri.host)
  119048. self.setHost = true
  119049. }
  119050. self.jar(self._jar || options.jar)
  119051. if (!self.uri.port) {
  119052. if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 }
  119053. }
  119054. if (self.proxy && !self.tunnel) {
  119055. self.port = self.proxy.port
  119056. self.host = self.proxy.hostname
  119057. } else {
  119058. self.port = self.uri.port
  119059. self.host = self.uri.hostname
  119060. }
  119061. if (options.form) {
  119062. self.form(options.form)
  119063. }
  119064. if (options.formData) {
  119065. var formData = options.formData
  119066. var requestForm = self.form()
  119067. var appendFormValue = function (key, value) {
  119068. if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) {
  119069. requestForm.append(key, value.value, value.options)
  119070. } else {
  119071. requestForm.append(key, value)
  119072. }
  119073. }
  119074. for (var formKey in formData) {
  119075. if (formData.hasOwnProperty(formKey)) {
  119076. var formValue = formData[formKey]
  119077. if (formValue instanceof Array) {
  119078. for (var j = 0; j < formValue.length; j++) {
  119079. appendFormValue(formKey, formValue[j])
  119080. }
  119081. } else {
  119082. appendFormValue(formKey, formValue)
  119083. }
  119084. }
  119085. }
  119086. }
  119087. if (options.qs) {
  119088. self.qs(options.qs)
  119089. }
  119090. if (self.uri.path) {
  119091. self.path = self.uri.path
  119092. } else {
  119093. self.path = self.uri.pathname + (self.uri.search || '')
  119094. }
  119095. if (self.path.length === 0) {
  119096. self.path = '/'
  119097. }
  119098. // Auth must happen last in case signing is dependent on other headers
  119099. if (options.aws) {
  119100. self.aws(options.aws)
  119101. }
  119102. if (options.hawk) {
  119103. self.hawk(options.hawk)
  119104. }
  119105. if (options.httpSignature) {
  119106. self.httpSignature(options.httpSignature)
  119107. }
  119108. if (options.auth) {
  119109. if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) {
  119110. options.auth.user = options.auth.username
  119111. }
  119112. if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) {
  119113. options.auth.pass = options.auth.password
  119114. }
  119115. self.auth(
  119116. options.auth.user,
  119117. options.auth.pass,
  119118. options.auth.sendImmediately,
  119119. options.auth.bearer
  119120. )
  119121. }
  119122. if (self.gzip && !self.hasHeader('accept-encoding')) {
  119123. self.setHeader('accept-encoding', 'gzip, deflate')
  119124. }
  119125. if (self.uri.auth && !self.hasHeader('authorization')) {
  119126. var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) })
  119127. self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true)
  119128. }
  119129. if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) {
  119130. var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) })
  119131. var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':'))
  119132. self.setHeader('proxy-authorization', authHeader)
  119133. }
  119134. if (self.proxy && !self.tunnel) {
  119135. self.path = (self.uri.protocol + '//' + self.uri.host + self.path)
  119136. }
  119137. if (options.json) {
  119138. self.json(options.json)
  119139. }
  119140. if (options.multipart) {
  119141. self.multipart(options.multipart)
  119142. }
  119143. if (options.time) {
  119144. self.timing = true
  119145. // NOTE: elapsedTime is deprecated in favor of .timings
  119146. self.elapsedTime = self.elapsedTime || 0
  119147. }
  119148. function setContentLength () {
  119149. if (isTypedArray(self.body)) {
  119150. self.body = Buffer.from(self.body)
  119151. }
  119152. if (!self.hasHeader('content-length')) {
  119153. var length
  119154. if (typeof self.body === 'string') {
  119155. length = Buffer.byteLength(self.body)
  119156. } else if (Array.isArray(self.body)) {
  119157. length = self.body.reduce(function (a, b) { return a + b.length }, 0)
  119158. } else {
  119159. length = self.body.length
  119160. }
  119161. if (length) {
  119162. self.setHeader('content-length', length)
  119163. } else {
  119164. self.emit('error', new Error('Argument error, options.body.'))
  119165. }
  119166. }
  119167. }
  119168. if (self.body && !isstream(self.body)) {
  119169. setContentLength()
  119170. }
  119171. if (options.oauth) {
  119172. self.oauth(options.oauth)
  119173. } else if (self._oauth.params && self.hasHeader('authorization')) {
  119174. self.oauth(self._oauth.params)
  119175. }
  119176. var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol
  119177. var defaultModules = {'http:': http, 'https:': https}
  119178. var httpModules = self.httpModules || {}
  119179. self.httpModule = httpModules[protocol] || defaultModules[protocol]
  119180. if (!self.httpModule) {
  119181. return self.emit('error', new Error('Invalid protocol: ' + protocol))
  119182. }
  119183. if (options.ca) {
  119184. self.ca = options.ca
  119185. }
  119186. if (!self.agent) {
  119187. if (options.agentOptions) {
  119188. self.agentOptions = options.agentOptions
  119189. }
  119190. if (options.agentClass) {
  119191. self.agentClass = options.agentClass
  119192. } else if (options.forever) {
  119193. var v = version()
  119194. // use ForeverAgent in node 0.10- only
  119195. if (v.major === 0 && v.minor <= 10) {
  119196. self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL
  119197. } else {
  119198. self.agentClass = self.httpModule.Agent
  119199. self.agentOptions = self.agentOptions || {}
  119200. self.agentOptions.keepAlive = true
  119201. }
  119202. } else {
  119203. self.agentClass = self.httpModule.Agent
  119204. }
  119205. }
  119206. if (self.pool === false) {
  119207. self.agent = false
  119208. } else {
  119209. self.agent = self.agent || self.getNewAgent()
  119210. }
  119211. self.on('pipe', function (src) {
  119212. if (self.ntick && self._started) {
  119213. self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.'))
  119214. }
  119215. self.src = src
  119216. if (isReadStream(src)) {
  119217. if (!self.hasHeader('content-type')) {
  119218. self.setHeader('content-type', mime.lookup(src.path))
  119219. }
  119220. } else {
  119221. if (src.headers) {
  119222. for (var i in src.headers) {
  119223. if (!self.hasHeader(i)) {
  119224. self.setHeader(i, src.headers[i])
  119225. }
  119226. }
  119227. }
  119228. if (self._json && !self.hasHeader('content-type')) {
  119229. self.setHeader('content-type', 'application/json')
  119230. }
  119231. if (src.method && !self.explicitMethod) {
  119232. self.method = src.method
  119233. }
  119234. }
  119235. // self.on('pipe', function () {
  119236. // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.')
  119237. // })
  119238. })
  119239. defer(function () {
  119240. if (self._aborted) {
  119241. return
  119242. }
  119243. var end = function () {
  119244. if (self._form) {
  119245. if (!self._auth.hasAuth) {
  119246. self._form.pipe(self)
  119247. } else if (self._auth.hasAuth && self._auth.sentAuth) {
  119248. self._form.pipe(self)
  119249. }
  119250. }
  119251. if (self._multipart && self._multipart.chunked) {
  119252. self._multipart.body.pipe(self)
  119253. }
  119254. if (self.body) {
  119255. if (isstream(self.body)) {
  119256. self.body.pipe(self)
  119257. } else {
  119258. setContentLength()
  119259. if (Array.isArray(self.body)) {
  119260. self.body.forEach(function (part) {
  119261. self.write(part)
  119262. })
  119263. } else {
  119264. self.write(self.body)
  119265. }
  119266. self.end()
  119267. }
  119268. } else if (self.requestBodyStream) {
  119269. console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.')
  119270. self.requestBodyStream.pipe(self)
  119271. } else if (!self.src) {
  119272. if (self._auth.hasAuth && !self._auth.sentAuth) {
  119273. self.end()
  119274. return
  119275. }
  119276. if (self.method !== 'GET' && typeof self.method !== 'undefined') {
  119277. self.setHeader('content-length', 0)
  119278. }
  119279. self.end()
  119280. }
  119281. }
  119282. if (self._form && !self.hasHeader('content-length')) {
  119283. // Before ending the request, we had to compute the length of the whole form, asyncly
  119284. self.setHeader(self._form.getHeaders(), true)
  119285. self._form.getLength(function (err, length) {
  119286. if (!err && !isNaN(length)) {
  119287. self.setHeader('content-length', length)
  119288. }
  119289. end()
  119290. })
  119291. } else {
  119292. end()
  119293. }
  119294. self.ntick = true
  119295. })
  119296. }
  119297. Request.prototype.getNewAgent = function () {
  119298. var self = this
  119299. var Agent = self.agentClass
  119300. var options = {}
  119301. if (self.agentOptions) {
  119302. for (var i in self.agentOptions) {
  119303. options[i] = self.agentOptions[i]
  119304. }
  119305. }
  119306. if (self.ca) {
  119307. options.ca = self.ca
  119308. }
  119309. if (self.ciphers) {
  119310. options.ciphers = self.ciphers
  119311. }
  119312. if (self.secureProtocol) {
  119313. options.secureProtocol = self.secureProtocol
  119314. }
  119315. if (self.secureOptions) {
  119316. options.secureOptions = self.secureOptions
  119317. }
  119318. if (typeof self.rejectUnauthorized !== 'undefined') {
  119319. options.rejectUnauthorized = self.rejectUnauthorized
  119320. }
  119321. if (self.cert && self.key) {
  119322. options.key = self.key
  119323. options.cert = self.cert
  119324. }
  119325. if (self.pfx) {
  119326. options.pfx = self.pfx
  119327. }
  119328. if (self.passphrase) {
  119329. options.passphrase = self.passphrase
  119330. }
  119331. var poolKey = ''
  119332. // different types of agents are in different pools
  119333. if (Agent !== self.httpModule.Agent) {
  119334. poolKey += Agent.name
  119335. }
  119336. // ca option is only relevant if proxy or destination are https
  119337. var proxy = self.proxy
  119338. if (typeof proxy === 'string') {
  119339. proxy = url.parse(proxy)
  119340. }
  119341. var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:'
  119342. if (isHttps) {
  119343. if (options.ca) {
  119344. if (poolKey) {
  119345. poolKey += ':'
  119346. }
  119347. poolKey += options.ca
  119348. }
  119349. if (typeof options.rejectUnauthorized !== 'undefined') {
  119350. if (poolKey) {
  119351. poolKey += ':'
  119352. }
  119353. poolKey += options.rejectUnauthorized
  119354. }
  119355. if (options.cert) {
  119356. if (poolKey) {
  119357. poolKey += ':'
  119358. }
  119359. poolKey += options.cert.toString('ascii') + options.key.toString('ascii')
  119360. }
  119361. if (options.pfx) {
  119362. if (poolKey) {
  119363. poolKey += ':'
  119364. }
  119365. poolKey += options.pfx.toString('ascii')
  119366. }
  119367. if (options.ciphers) {
  119368. if (poolKey) {
  119369. poolKey += ':'
  119370. }
  119371. poolKey += options.ciphers
  119372. }
  119373. if (options.secureProtocol) {
  119374. if (poolKey) {
  119375. poolKey += ':'
  119376. }
  119377. poolKey += options.secureProtocol
  119378. }
  119379. if (options.secureOptions) {
  119380. if (poolKey) {
  119381. poolKey += ':'
  119382. }
  119383. poolKey += options.secureOptions
  119384. }
  119385. }
  119386. if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) {
  119387. // not doing anything special. Use the globalAgent
  119388. return self.httpModule.globalAgent
  119389. }
  119390. // we're using a stored agent. Make sure it's protocol-specific
  119391. poolKey = self.uri.protocol + poolKey
  119392. // generate a new agent for this setting if none yet exists
  119393. if (!self.pool[poolKey]) {
  119394. self.pool[poolKey] = new Agent(options)
  119395. // properly set maxSockets on new agents
  119396. if (self.pool.maxSockets) {
  119397. self.pool[poolKey].maxSockets = self.pool.maxSockets
  119398. }
  119399. }
  119400. return self.pool[poolKey]
  119401. }
  119402. Request.prototype.start = function () {
  119403. // start() is called once we are ready to send the outgoing HTTP request.
  119404. // this is usually called on the first write(), end() or on nextTick()
  119405. var self = this
  119406. if (self.timing) {
  119407. // All timings will be relative to this request's startTime. In order to do this,
  119408. // we need to capture the wall-clock start time (via Date), immediately followed
  119409. // by the high-resolution timer (via now()). While these two won't be set
  119410. // at the _exact_ same time, they should be close enough to be able to calculate
  119411. // high-resolution, monotonically non-decreasing timestamps relative to startTime.
  119412. var startTime = new Date().getTime()
  119413. var startTimeNow = now()
  119414. }
  119415. if (self._aborted) {
  119416. return
  119417. }
  119418. self._started = true
  119419. self.method = self.method || 'GET'
  119420. self.href = self.uri.href
  119421. if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) {
  119422. self.setHeader('content-length', self.src.stat.size)
  119423. }
  119424. if (self._aws) {
  119425. self.aws(self._aws, true)
  119426. }
  119427. // We have a method named auth, which is completely different from the http.request
  119428. // auth option. If we don't remove it, we're gonna have a bad time.
  119429. var reqOptions = copy(self)
  119430. delete reqOptions.auth
  119431. debug('make request', self.uri.href)
  119432. // node v6.8.0 now supports a `timeout` value in `http.request()`, but we
  119433. // should delete it for now since we handle timeouts manually for better
  119434. // consistency with node versions before v6.8.0
  119435. delete reqOptions.timeout
  119436. try {
  119437. self.req = self.httpModule.request(reqOptions)
  119438. } catch (err) {
  119439. self.emit('error', err)
  119440. return
  119441. }
  119442. if (self.timing) {
  119443. self.startTime = startTime
  119444. self.startTimeNow = startTimeNow
  119445. // Timing values will all be relative to startTime (by comparing to startTimeNow
  119446. // so we have an accurate clock)
  119447. self.timings = {}
  119448. }
  119449. var timeout
  119450. if (self.timeout && !self.timeoutTimer) {
  119451. if (self.timeout < 0) {
  119452. timeout = 0
  119453. } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) {
  119454. timeout = self.timeout
  119455. }
  119456. }
  119457. self.req.on('response', self.onRequestResponse.bind(self))
  119458. self.req.on('error', self.onRequestError.bind(self))
  119459. self.req.on('drain', function () {
  119460. self.emit('drain')
  119461. })
  119462. self.req.on('socket', function (socket) {
  119463. // `._connecting` was the old property which was made public in node v6.1.0
  119464. var isConnecting = socket._connecting || socket.connecting
  119465. if (self.timing) {
  119466. self.timings.socket = now() - self.startTimeNow
  119467. if (isConnecting) {
  119468. var onLookupTiming = function () {
  119469. self.timings.lookup = now() - self.startTimeNow
  119470. }
  119471. var onConnectTiming = function () {
  119472. self.timings.connect = now() - self.startTimeNow
  119473. }
  119474. socket.once('lookup', onLookupTiming)
  119475. socket.once('connect', onConnectTiming)
  119476. // clean up timing event listeners if needed on error
  119477. self.req.once('error', function () {
  119478. socket.removeListener('lookup', onLookupTiming)
  119479. socket.removeListener('connect', onConnectTiming)
  119480. })
  119481. }
  119482. }
  119483. var setReqTimeout = function () {
  119484. // This timeout sets the amount of time to wait *between* bytes sent
  119485. // from the server once connected.
  119486. //
  119487. // In particular, it's useful for erroring if the server fails to send
  119488. // data halfway through streaming a response.
  119489. self.req.setTimeout(timeout, function () {
  119490. if (self.req) {
  119491. self.abort()
  119492. var e = new Error('ESOCKETTIMEDOUT')
  119493. e.code = 'ESOCKETTIMEDOUT'
  119494. e.connect = false
  119495. self.emit('error', e)
  119496. }
  119497. })
  119498. }
  119499. if (timeout !== undefined) {
  119500. // Only start the connection timer if we're actually connecting a new
  119501. // socket, otherwise if we're already connected (because this is a
  119502. // keep-alive connection) do not bother. This is important since we won't
  119503. // get a 'connect' event for an already connected socket.
  119504. if (isConnecting) {
  119505. var onReqSockConnect = function () {
  119506. socket.removeListener('connect', onReqSockConnect)
  119507. clearTimeout(self.timeoutTimer)
  119508. self.timeoutTimer = null
  119509. setReqTimeout()
  119510. }
  119511. socket.on('connect', onReqSockConnect)
  119512. self.req.on('error', function (err) { // eslint-disable-line handle-callback-err
  119513. socket.removeListener('connect', onReqSockConnect)
  119514. })
  119515. // Set a timeout in memory - this block will throw if the server takes more
  119516. // than `timeout` to write the HTTP status and headers (corresponding to
  119517. // the on('response') event on the client). NB: this measures wall-clock
  119518. // time, not the time between bytes sent by the server.
  119519. self.timeoutTimer = setTimeout(function () {
  119520. socket.removeListener('connect', onReqSockConnect)
  119521. self.abort()
  119522. var e = new Error('ETIMEDOUT')
  119523. e.code = 'ETIMEDOUT'
  119524. e.connect = true
  119525. self.emit('error', e)
  119526. }, timeout)
  119527. } else {
  119528. // We're already connected
  119529. setReqTimeout()
  119530. }
  119531. }
  119532. self.emit('socket', socket)
  119533. })
  119534. self.emit('request', self.req)
  119535. }
  119536. Request.prototype.onRequestError = function (error) {
  119537. var self = this
  119538. if (self._aborted) {
  119539. return
  119540. }
  119541. if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' &&
  119542. self.agent.addRequestNoreuse) {
  119543. self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) }
  119544. self.start()
  119545. self.req.end()
  119546. return
  119547. }
  119548. if (self.timeout && self.timeoutTimer) {
  119549. clearTimeout(self.timeoutTimer)
  119550. self.timeoutTimer = null
  119551. }
  119552. self.emit('error', error)
  119553. }
  119554. Request.prototype.onRequestResponse = function (response) {
  119555. var self = this
  119556. if (self.timing) {
  119557. self.timings.response = now() - self.startTimeNow
  119558. }
  119559. debug('onRequestResponse', self.uri.href, response.statusCode, response.headers)
  119560. response.on('end', function () {
  119561. if (self.timing) {
  119562. self.timings.end = now() - self.startTimeNow
  119563. response.timingStart = self.startTime
  119564. // fill in the blanks for any periods that didn't trigger, such as
  119565. // no lookup or connect due to keep alive
  119566. if (!self.timings.socket) {
  119567. self.timings.socket = 0
  119568. }
  119569. if (!self.timings.lookup) {
  119570. self.timings.lookup = self.timings.socket
  119571. }
  119572. if (!self.timings.connect) {
  119573. self.timings.connect = self.timings.lookup
  119574. }
  119575. if (!self.timings.response) {
  119576. self.timings.response = self.timings.connect
  119577. }
  119578. debug('elapsed time', self.timings.end)
  119579. // elapsedTime includes all redirects
  119580. self.elapsedTime += Math.round(self.timings.end)
  119581. // NOTE: elapsedTime is deprecated in favor of .timings
  119582. response.elapsedTime = self.elapsedTime
  119583. // timings is just for the final fetch
  119584. response.timings = self.timings
  119585. // pre-calculate phase timings as well
  119586. response.timingPhases = {
  119587. wait: self.timings.socket,
  119588. dns: self.timings.lookup - self.timings.socket,
  119589. tcp: self.timings.connect - self.timings.lookup,
  119590. firstByte: self.timings.response - self.timings.connect,
  119591. download: self.timings.end - self.timings.response,
  119592. total: self.timings.end
  119593. }
  119594. }
  119595. debug('response end', self.uri.href, response.statusCode, response.headers)
  119596. })
  119597. if (self._aborted) {
  119598. debug('aborted', self.uri.href)
  119599. response.resume()
  119600. return
  119601. }
  119602. self.response = response
  119603. response.request = self
  119604. response.toJSON = responseToJSON
  119605. // XXX This is different on 0.10, because SSL is strict by default
  119606. if (self.httpModule === https &&
  119607. self.strictSSL && (!response.hasOwnProperty('socket') ||
  119608. !response.socket.authorized)) {
  119609. debug('strict ssl error', self.uri.href)
  119610. var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL'
  119611. self.emit('error', new Error('SSL Error: ' + sslErr))
  119612. return
  119613. }
  119614. // Save the original host before any redirect (if it changes, we need to
  119615. // remove any authorization headers). Also remember the case of the header
  119616. // name because lots of broken servers expect Host instead of host and we
  119617. // want the caller to be able to specify this.
  119618. self.originalHost = self.getHeader('host')
  119619. if (!self.originalHostHeaderName) {
  119620. self.originalHostHeaderName = self.hasHeader('host')
  119621. }
  119622. if (self.setHost) {
  119623. self.removeHeader('host')
  119624. }
  119625. if (self.timeout && self.timeoutTimer) {
  119626. clearTimeout(self.timeoutTimer)
  119627. self.timeoutTimer = null
  119628. }
  119629. var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar
  119630. var addCookie = function (cookie) {
  119631. // set the cookie if it's domain in the href's domain.
  119632. try {
  119633. targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true})
  119634. } catch (e) {
  119635. self.emit('error', e)
  119636. }
  119637. }
  119638. response.caseless = caseless(response.headers)
  119639. if (response.caseless.has('set-cookie') && (!self._disableCookies)) {
  119640. var headerName = response.caseless.has('set-cookie')
  119641. if (Array.isArray(response.headers[headerName])) {
  119642. response.headers[headerName].forEach(addCookie)
  119643. } else {
  119644. addCookie(response.headers[headerName])
  119645. }
  119646. }
  119647. if (self._redirect.onResponse(response)) {
  119648. return // Ignore the rest of the response
  119649. } else {
  119650. // Be a good stream and emit end when the response is finished.
  119651. // Hack to emit end on close because of a core bug that never fires end
  119652. response.on('close', function () {
  119653. if (!self._ended) {
  119654. self.response.emit('end')
  119655. }
  119656. })
  119657. response.once('end', function () {
  119658. self._ended = true
  119659. })
  119660. var noBody = function (code) {
  119661. return (
  119662. self.method === 'HEAD' ||
  119663. // Informational
  119664. (code >= 100 && code < 200) ||
  119665. // No Content
  119666. code === 204 ||
  119667. // Not Modified
  119668. code === 304
  119669. )
  119670. }
  119671. var responseContent
  119672. if (self.gzip && !noBody(response.statusCode)) {
  119673. var contentEncoding = response.headers['content-encoding'] || 'identity'
  119674. contentEncoding = contentEncoding.trim().toLowerCase()
  119675. // Be more lenient with decoding compressed responses, since (very rarely)
  119676. // servers send slightly invalid gzip responses that are still accepted
  119677. // by common browsers.
  119678. // Always using Z_SYNC_FLUSH is what cURL does.
  119679. var zlibOptions = {
  119680. flush: zlib.Z_SYNC_FLUSH,
  119681. finishFlush: zlib.Z_SYNC_FLUSH
  119682. }
  119683. if (contentEncoding === 'gzip') {
  119684. responseContent = zlib.createGunzip(zlibOptions)
  119685. response.pipe(responseContent)
  119686. } else if (contentEncoding === 'deflate') {
  119687. responseContent = zlib.createInflate(zlibOptions)
  119688. response.pipe(responseContent)
  119689. } else {
  119690. // Since previous versions didn't check for Content-Encoding header,
  119691. // ignore any invalid values to preserve backwards-compatibility
  119692. if (contentEncoding !== 'identity') {
  119693. debug('ignoring unrecognized Content-Encoding ' + contentEncoding)
  119694. }
  119695. responseContent = response
  119696. }
  119697. } else {
  119698. responseContent = response
  119699. }
  119700. if (self.encoding) {
  119701. if (self.dests.length !== 0) {
  119702. console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.')
  119703. } else {
  119704. responseContent.setEncoding(self.encoding)
  119705. }
  119706. }
  119707. if (self._paused) {
  119708. responseContent.pause()
  119709. }
  119710. self.responseContent = responseContent
  119711. self.emit('response', response)
  119712. self.dests.forEach(function (dest) {
  119713. self.pipeDest(dest)
  119714. })
  119715. responseContent.on('data', function (chunk) {
  119716. if (self.timing && !self.responseStarted) {
  119717. self.responseStartTime = (new Date()).getTime()
  119718. // NOTE: responseStartTime is deprecated in favor of .timings
  119719. response.responseStartTime = self.responseStartTime
  119720. }
  119721. self._destdata = true
  119722. self.emit('data', chunk)
  119723. })
  119724. responseContent.once('end', function (chunk) {
  119725. self.emit('end', chunk)
  119726. })
  119727. responseContent.on('error', function (error) {
  119728. self.emit('error', error)
  119729. })
  119730. responseContent.on('close', function () { self.emit('close') })
  119731. if (self.callback) {
  119732. self.readResponseBody(response)
  119733. } else { // if no callback
  119734. self.on('end', function () {
  119735. if (self._aborted) {
  119736. debug('aborted', self.uri.href)
  119737. return
  119738. }
  119739. self.emit('complete', response)
  119740. })
  119741. }
  119742. }
  119743. debug('finish init function', self.uri.href)
  119744. }
  119745. Request.prototype.readResponseBody = function (response) {
  119746. var self = this
  119747. debug("reading response's body")
  119748. var buffers = []
  119749. var bufferLength = 0
  119750. var strings = []
  119751. self.on('data', function (chunk) {
  119752. if (!Buffer.isBuffer(chunk)) {
  119753. strings.push(chunk)
  119754. } else if (chunk.length) {
  119755. bufferLength += chunk.length
  119756. buffers.push(chunk)
  119757. }
  119758. })
  119759. self.on('end', function () {
  119760. debug('end event', self.uri.href)
  119761. if (self._aborted) {
  119762. debug('aborted', self.uri.href)
  119763. // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request.
  119764. // This can lead to leaky behavior if the user retains a reference to the request object.
  119765. buffers = []
  119766. bufferLength = 0
  119767. return
  119768. }
  119769. if (bufferLength) {
  119770. debug('has body', self.uri.href, bufferLength)
  119771. response.body = Buffer.concat(buffers, bufferLength)
  119772. if (self.encoding !== null) {
  119773. response.body = response.body.toString(self.encoding)
  119774. }
  119775. // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request.
  119776. // This can lead to leaky behavior if the user retains a reference to the request object.
  119777. buffers = []
  119778. bufferLength = 0
  119779. } else if (strings.length) {
  119780. // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.
  119781. // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().
  119782. if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') {
  119783. strings[0] = strings[0].substring(1)
  119784. }
  119785. response.body = strings.join('')
  119786. }
  119787. if (self._json) {
  119788. try {
  119789. response.body = JSON.parse(response.body, self._jsonReviver)
  119790. } catch (e) {
  119791. debug('invalid JSON received', self.uri.href)
  119792. }
  119793. }
  119794. debug('emitting complete', self.uri.href)
  119795. if (typeof response.body === 'undefined' && !self._json) {
  119796. response.body = self.encoding === null ? Buffer.alloc(0) : ''
  119797. }
  119798. self.emit('complete', response, response.body)
  119799. })
  119800. }
  119801. Request.prototype.abort = function () {
  119802. var self = this
  119803. self._aborted = true
  119804. if (self.req) {
  119805. self.req.abort()
  119806. } else if (self.response) {
  119807. self.response.destroy()
  119808. }
  119809. self.emit('abort')
  119810. }
  119811. Request.prototype.pipeDest = function (dest) {
  119812. var self = this
  119813. var response = self.response
  119814. // Called after the response is received
  119815. if (dest.headers && !dest.headersSent) {
  119816. if (response.caseless.has('content-type')) {
  119817. var ctname = response.caseless.has('content-type')
  119818. if (dest.setHeader) {
  119819. dest.setHeader(ctname, response.headers[ctname])
  119820. } else {
  119821. dest.headers[ctname] = response.headers[ctname]
  119822. }
  119823. }
  119824. if (response.caseless.has('content-length')) {
  119825. var clname = response.caseless.has('content-length')
  119826. if (dest.setHeader) {
  119827. dest.setHeader(clname, response.headers[clname])
  119828. } else {
  119829. dest.headers[clname] = response.headers[clname]
  119830. }
  119831. }
  119832. }
  119833. if (dest.setHeader && !dest.headersSent) {
  119834. for (var i in response.headers) {
  119835. // If the response content is being decoded, the Content-Encoding header
  119836. // of the response doesn't represent the piped content, so don't pass it.
  119837. if (!self.gzip || i !== 'content-encoding') {
  119838. dest.setHeader(i, response.headers[i])
  119839. }
  119840. }
  119841. dest.statusCode = response.statusCode
  119842. }
  119843. if (self.pipefilter) {
  119844. self.pipefilter(response, dest)
  119845. }
  119846. }
  119847. Request.prototype.qs = function (q, clobber) {
  119848. var self = this
  119849. var base
  119850. if (!clobber && self.uri.query) {
  119851. base = self._qs.parse(self.uri.query)
  119852. } else {
  119853. base = {}
  119854. }
  119855. for (var i in q) {
  119856. base[i] = q[i]
  119857. }
  119858. var qs = self._qs.stringify(base)
  119859. if (qs === '') {
  119860. return self
  119861. }
  119862. self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs)
  119863. self.url = self.uri
  119864. self.path = self.uri.path
  119865. if (self.uri.host === 'unix') {
  119866. self.enableUnixSocket()
  119867. }
  119868. return self
  119869. }
  119870. Request.prototype.form = function (form) {
  119871. var self = this
  119872. if (form) {
  119873. if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) {
  119874. self.setHeader('content-type', 'application/x-www-form-urlencoded')
  119875. }
  119876. self.body = (typeof form === 'string')
  119877. ? self._qs.rfc3986(form.toString('utf8'))
  119878. : self._qs.stringify(form).toString('utf8')
  119879. return self
  119880. }
  119881. // create form-data object
  119882. self._form = new FormData()
  119883. self._form.on('error', function (err) {
  119884. err.message = 'form-data: ' + err.message
  119885. self.emit('error', err)
  119886. self.abort()
  119887. })
  119888. return self._form
  119889. }
  119890. Request.prototype.multipart = function (multipart) {
  119891. var self = this
  119892. self._multipart.onRequest(multipart)
  119893. if (!self._multipart.chunked) {
  119894. self.body = self._multipart.body
  119895. }
  119896. return self
  119897. }
  119898. Request.prototype.json = function (val) {
  119899. var self = this
  119900. if (!self.hasHeader('accept')) {
  119901. self.setHeader('accept', 'application/json')
  119902. }
  119903. if (typeof self.jsonReplacer === 'function') {
  119904. self._jsonReplacer = self.jsonReplacer
  119905. }
  119906. self._json = true
  119907. if (typeof val === 'boolean') {
  119908. if (self.body !== undefined) {
  119909. if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) {
  119910. self.body = safeStringify(self.body, self._jsonReplacer)
  119911. } else {
  119912. self.body = self._qs.rfc3986(self.body)
  119913. }
  119914. if (!self.hasHeader('content-type')) {
  119915. self.setHeader('content-type', 'application/json')
  119916. }
  119917. }
  119918. } else {
  119919. self.body = safeStringify(val, self._jsonReplacer)
  119920. if (!self.hasHeader('content-type')) {
  119921. self.setHeader('content-type', 'application/json')
  119922. }
  119923. }
  119924. if (typeof self.jsonReviver === 'function') {
  119925. self._jsonReviver = self.jsonReviver
  119926. }
  119927. return self
  119928. }
  119929. Request.prototype.getHeader = function (name, headers) {
  119930. var self = this
  119931. var result, re, match
  119932. if (!headers) {
  119933. headers = self.headers
  119934. }
  119935. Object.keys(headers).forEach(function (key) {
  119936. if (key.length !== name.length) {
  119937. return
  119938. }
  119939. re = new RegExp(name, 'i')
  119940. match = key.match(re)
  119941. if (match) {
  119942. result = headers[key]
  119943. }
  119944. })
  119945. return result
  119946. }
  119947. Request.prototype.enableUnixSocket = function () {
  119948. // Get the socket & request paths from the URL
  119949. var unixParts = this.uri.path.split(':')
  119950. var host = unixParts[0]
  119951. var path = unixParts[1]
  119952. // Apply unix properties to request
  119953. this.socketPath = host
  119954. this.uri.pathname = path
  119955. this.uri.path = path
  119956. this.uri.host = host
  119957. this.uri.hostname = host
  119958. this.uri.isUnix = true
  119959. }
  119960. Request.prototype.auth = function (user, pass, sendImmediately, bearer) {
  119961. var self = this
  119962. self._auth.onRequest(user, pass, sendImmediately, bearer)
  119963. return self
  119964. }
  119965. Request.prototype.aws = function (opts, now) {
  119966. var self = this
  119967. if (!now) {
  119968. self._aws = opts
  119969. return self
  119970. }
  119971. if (opts.sign_version === 4 || opts.sign_version === '4') {
  119972. // use aws4
  119973. var options = {
  119974. host: self.uri.host,
  119975. path: self.uri.path,
  119976. method: self.method,
  119977. headers: {
  119978. 'content-type': self.getHeader('content-type') || ''
  119979. },
  119980. body: self.body
  119981. }
  119982. var signRes = aws4.sign(options, {
  119983. accessKeyId: opts.key,
  119984. secretAccessKey: opts.secret,
  119985. sessionToken: opts.session
  119986. })
  119987. self.setHeader('authorization', signRes.headers.Authorization)
  119988. self.setHeader('x-amz-date', signRes.headers['X-Amz-Date'])
  119989. if (signRes.headers['X-Amz-Security-Token']) {
  119990. self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token'])
  119991. }
  119992. } else {
  119993. // default: use aws-sign2
  119994. var date = new Date()
  119995. self.setHeader('date', date.toUTCString())
  119996. var auth = {
  119997. key: opts.key,
  119998. secret: opts.secret,
  119999. verb: self.method.toUpperCase(),
  120000. date: date,
  120001. contentType: self.getHeader('content-type') || '',
  120002. md5: self.getHeader('content-md5') || '',
  120003. amazonHeaders: aws2.canonicalizeHeaders(self.headers)
  120004. }
  120005. var path = self.uri.path
  120006. if (opts.bucket && path) {
  120007. auth.resource = '/' + opts.bucket + path
  120008. } else if (opts.bucket && !path) {
  120009. auth.resource = '/' + opts.bucket
  120010. } else if (!opts.bucket && path) {
  120011. auth.resource = path
  120012. } else if (!opts.bucket && !path) {
  120013. auth.resource = '/'
  120014. }
  120015. auth.resource = aws2.canonicalizeResource(auth.resource)
  120016. self.setHeader('authorization', aws2.authorization(auth))
  120017. }
  120018. return self
  120019. }
  120020. Request.prototype.httpSignature = function (opts) {
  120021. var self = this
  120022. httpSignature.signRequest({
  120023. getHeader: function (header) {
  120024. return self.getHeader(header, self.headers)
  120025. },
  120026. setHeader: function (header, value) {
  120027. self.setHeader(header, value)
  120028. },
  120029. method: self.method,
  120030. path: self.path
  120031. }, opts)
  120032. debug('httpSignature authorization', self.getHeader('authorization'))
  120033. return self
  120034. }
  120035. Request.prototype.hawk = function (opts) {
  120036. var self = this
  120037. self.setHeader('Authorization', hawk.header(self.uri, self.method, opts))
  120038. }
  120039. Request.prototype.oauth = function (_oauth) {
  120040. var self = this
  120041. self._oauth.onRequest(_oauth)
  120042. return self
  120043. }
  120044. Request.prototype.jar = function (jar) {
  120045. var self = this
  120046. var cookies
  120047. if (self._redirect.redirectsFollowed === 0) {
  120048. self.originalCookieHeader = self.getHeader('cookie')
  120049. }
  120050. if (!jar) {
  120051. // disable cookies
  120052. cookies = false
  120053. self._disableCookies = true
  120054. } else {
  120055. var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar
  120056. var urihref = self.uri.href
  120057. // fetch cookie in the Specified host
  120058. if (targetCookieJar) {
  120059. cookies = targetCookieJar.getCookieString(urihref)
  120060. }
  120061. }
  120062. // if need cookie and cookie is not empty
  120063. if (cookies && cookies.length) {
  120064. if (self.originalCookieHeader) {
  120065. // Don't overwrite existing Cookie header
  120066. self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies)
  120067. } else {
  120068. self.setHeader('cookie', cookies)
  120069. }
  120070. }
  120071. self._jar = jar
  120072. return self
  120073. }
  120074. // Stream API
  120075. Request.prototype.pipe = function (dest, opts) {
  120076. var self = this
  120077. if (self.response) {
  120078. if (self._destdata) {
  120079. self.emit('error', new Error('You cannot pipe after data has been emitted from the response.'))
  120080. } else if (self._ended) {
  120081. self.emit('error', new Error('You cannot pipe after the response has been ended.'))
  120082. } else {
  120083. stream.Stream.prototype.pipe.call(self, dest, opts)
  120084. self.pipeDest(dest)
  120085. return dest
  120086. }
  120087. } else {
  120088. self.dests.push(dest)
  120089. stream.Stream.prototype.pipe.call(self, dest, opts)
  120090. return dest
  120091. }
  120092. }
  120093. Request.prototype.write = function () {
  120094. var self = this
  120095. if (self._aborted) { return }
  120096. if (!self._started) {
  120097. self.start()
  120098. }
  120099. if (self.req) {
  120100. return self.req.write.apply(self.req, arguments)
  120101. }
  120102. }
  120103. Request.prototype.end = function (chunk) {
  120104. var self = this
  120105. if (self._aborted) { return }
  120106. if (chunk) {
  120107. self.write(chunk)
  120108. }
  120109. if (!self._started) {
  120110. self.start()
  120111. }
  120112. if (self.req) {
  120113. self.req.end()
  120114. }
  120115. }
  120116. Request.prototype.pause = function () {
  120117. var self = this
  120118. if (!self.responseContent) {
  120119. self._paused = true
  120120. } else {
  120121. self.responseContent.pause.apply(self.responseContent, arguments)
  120122. }
  120123. }
  120124. Request.prototype.resume = function () {
  120125. var self = this
  120126. if (!self.responseContent) {
  120127. self._paused = false
  120128. } else {
  120129. self.responseContent.resume.apply(self.responseContent, arguments)
  120130. }
  120131. }
  120132. Request.prototype.destroy = function () {
  120133. var self = this
  120134. if (!self._ended) {
  120135. self.end()
  120136. } else if (self.response) {
  120137. self.response.destroy()
  120138. }
  120139. }
  120140. Request.defaultProxyHeaderWhiteList =
  120141. Tunnel.defaultProxyHeaderWhiteList.slice()
  120142. Request.defaultProxyHeaderExclusiveList =
  120143. Tunnel.defaultProxyHeaderExclusiveList.slice()
  120144. // Exports
  120145. Request.prototype.toJSON = requestToJSON
  120146. module.exports = Request
  120147. /***/ }),
  120148. /* 886 */
  120149. /***/ (function(module, exports, __webpack_require__) {
  120150. var core = __webpack_require__(248);
  120151. var async = __webpack_require__(887);
  120152. async.core = core;
  120153. async.isCore = function isCore(x) { return core[x]; };
  120154. async.sync = __webpack_require__(889);
  120155. exports = async;
  120156. module.exports = async;
  120157. /***/ }),
  120158. /* 887 */
  120159. /***/ (function(module, exports, __webpack_require__) {
  120160. var core = __webpack_require__(248);
  120161. var fs = __webpack_require__(12);
  120162. var path = __webpack_require__(1);
  120163. var caller = __webpack_require__(387);
  120164. var nodeModulesPaths = __webpack_require__(388);
  120165. var defaultIsFile = function isFile(file, cb) {
  120166. fs.stat(file, function (err, stat) {
  120167. if (!err) {
  120168. return cb(null, stat.isFile() || stat.isFIFO());
  120169. }
  120170. if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
  120171. return cb(err);
  120172. });
  120173. };
  120174. module.exports = function resolve(x, options, callback) {
  120175. var cb = callback;
  120176. var opts = options || {};
  120177. if (typeof opts === 'function') {
  120178. cb = opts;
  120179. opts = {};
  120180. }
  120181. if (typeof x !== 'string') {
  120182. var err = new TypeError('Path must be a string.');
  120183. return process.nextTick(function () {
  120184. cb(err);
  120185. });
  120186. }
  120187. var isFile = opts.isFile || defaultIsFile;
  120188. var readFile = opts.readFile || fs.readFile;
  120189. var extensions = opts.extensions || ['.js'];
  120190. var basedir = opts.basedir || path.dirname(caller());
  120191. var parent = opts.filename || basedir;
  120192. opts.paths = opts.paths || [];
  120193. if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
  120194. var res = path.resolve(basedir, x);
  120195. if (x === '..' || x.slice(-1) === '/') res += '/';
  120196. if (/\/$/.test(x) && res === basedir) {
  120197. loadAsDirectory(res, opts.package, onfile);
  120198. } else loadAsFile(res, opts.package, onfile);
  120199. } else loadNodeModules(x, basedir, function (err, n, pkg) {
  120200. if (err) cb(err);
  120201. else if (n) cb(null, n, pkg);
  120202. else if (core[x]) return cb(null, x);
  120203. else {
  120204. var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
  120205. moduleError.code = 'MODULE_NOT_FOUND';
  120206. cb(moduleError);
  120207. }
  120208. });
  120209. function onfile(err, m, pkg) {
  120210. if (err) cb(err);
  120211. else if (m) cb(null, m, pkg);
  120212. else loadAsDirectory(res, function (err, d, pkg) {
  120213. if (err) cb(err);
  120214. else if (d) cb(null, d, pkg);
  120215. else {
  120216. var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
  120217. moduleError.code = 'MODULE_NOT_FOUND';
  120218. cb(moduleError);
  120219. }
  120220. });
  120221. }
  120222. function loadAsFile(x, thePackage, callback) {
  120223. var loadAsFilePackage = thePackage;
  120224. var cb = callback;
  120225. if (typeof loadAsFilePackage === 'function') {
  120226. cb = loadAsFilePackage;
  120227. loadAsFilePackage = undefined;
  120228. }
  120229. var exts = [''].concat(extensions);
  120230. load(exts, x, loadAsFilePackage);
  120231. function load(exts, x, loadPackage) {
  120232. if (exts.length === 0) return cb(null, undefined, loadPackage);
  120233. var file = x + exts[0];
  120234. var pkg = loadPackage;
  120235. if (pkg) onpkg(null, pkg);
  120236. else loadpkg(path.dirname(file), onpkg);
  120237. function onpkg(err, pkg_, dir) {
  120238. pkg = pkg_;
  120239. if (err) return cb(err);
  120240. if (dir && pkg && opts.pathFilter) {
  120241. var rfile = path.relative(dir, file);
  120242. var rel = rfile.slice(0, rfile.length - exts[0].length);
  120243. var r = opts.pathFilter(pkg, x, rel);
  120244. if (r) return load(
  120245. [''].concat(extensions.slice()),
  120246. path.resolve(dir, r),
  120247. pkg
  120248. );
  120249. }
  120250. isFile(file, onex);
  120251. }
  120252. function onex(err, ex) {
  120253. if (err) return cb(err);
  120254. if (ex) return cb(null, file, pkg);
  120255. load(exts.slice(1), x, pkg);
  120256. }
  120257. }
  120258. }
  120259. function loadpkg(dir, cb) {
  120260. if (dir === '' || dir === '/') return cb(null);
  120261. if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
  120262. return cb(null);
  120263. }
  120264. if (/[/\\]node_modules[/\\]*$/.test(dir)) return cb(null);
  120265. var pkgfile = path.join(dir, 'package.json');
  120266. isFile(pkgfile, function (err, ex) {
  120267. // on err, ex is false
  120268. if (!ex) return loadpkg(path.dirname(dir), cb);
  120269. readFile(pkgfile, function (err, body) {
  120270. if (err) cb(err);
  120271. try { var pkg = JSON.parse(body); } catch (jsonErr) {}
  120272. if (pkg && opts.packageFilter) {
  120273. pkg = opts.packageFilter(pkg, pkgfile);
  120274. }
  120275. cb(null, pkg, dir);
  120276. });
  120277. });
  120278. }
  120279. function loadAsDirectory(x, loadAsDirectoryPackage, callback) {
  120280. var cb = callback;
  120281. var fpkg = loadAsDirectoryPackage;
  120282. if (typeof fpkg === 'function') {
  120283. cb = fpkg;
  120284. fpkg = opts.package;
  120285. }
  120286. var pkgfile = path.join(x, 'package.json');
  120287. isFile(pkgfile, function (err, ex) {
  120288. if (err) return cb(err);
  120289. if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb);
  120290. readFile(pkgfile, function (err, body) {
  120291. if (err) return cb(err);
  120292. try {
  120293. var pkg = JSON.parse(body);
  120294. } catch (jsonErr) {}
  120295. if (opts.packageFilter) {
  120296. pkg = opts.packageFilter(pkg, pkgfile);
  120297. }
  120298. if (pkg.main) {
  120299. if (pkg.main === '.' || pkg.main === './') {
  120300. pkg.main = 'index';
  120301. }
  120302. loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) {
  120303. if (err) return cb(err);
  120304. if (m) return cb(null, m, pkg);
  120305. if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb);
  120306. var dir = path.resolve(x, pkg.main);
  120307. loadAsDirectory(dir, pkg, function (err, n, pkg) {
  120308. if (err) return cb(err);
  120309. if (n) return cb(null, n, pkg);
  120310. loadAsFile(path.join(x, 'index'), pkg, cb);
  120311. });
  120312. });
  120313. return;
  120314. }
  120315. loadAsFile(path.join(x, '/index'), pkg, cb);
  120316. });
  120317. });
  120318. }
  120319. function processDirs(cb, dirs) {
  120320. if (dirs.length === 0) return cb(null, undefined);
  120321. var dir = dirs[0];
  120322. var file = path.join(dir, x);
  120323. loadAsFile(file, opts.package, onfile);
  120324. function onfile(err, m, pkg) {
  120325. if (err) return cb(err);
  120326. if (m) return cb(null, m, pkg);
  120327. loadAsDirectory(path.join(dir, x), opts.package, ondir);
  120328. }
  120329. function ondir(err, n, pkg) {
  120330. if (err) return cb(err);
  120331. if (n) return cb(null, n, pkg);
  120332. processDirs(cb, dirs.slice(1));
  120333. }
  120334. }
  120335. function loadNodeModules(x, start, cb) {
  120336. processDirs(cb, nodeModulesPaths(start, opts));
  120337. }
  120338. };
  120339. /***/ }),
  120340. /* 888 */
  120341. /***/ (function(module, exports) {
  120342. module.exports = {"assert":true,"async_hooks":">= 8","buffer_ieee754":"< 0.9.7","buffer":true,"child_process":true,"cluster":true,"console":true,"constants":true,"crypto":true,"_debugger":"< 8","dgram":true,"dns":true,"domain":true,"events":true,"freelist":"< 6","fs":true,"fs/promises":">= 10 && < 10.1","_http_agent":">= 0.11.1","_http_client":">= 0.11.1","_http_common":">= 0.11.1","_http_incoming":">= 0.11.1","_http_outgoing":">= 0.11.1","_http_server":">= 0.11.1","http":true,"http2":">= 8.8","https":true,"inspector":">= 8.0.0","_linklist":"< 8","module":true,"net":true,"node-inspect/lib/_inspect":">= 7.6.0","node-inspect/lib/internal/inspect_client":">= 7.6.0","node-inspect/lib/internal/inspect_repl":">= 7.6.0","os":true,"path":true,"perf_hooks":">= 8.5","process":">= 1","punycode":true,"querystring":true,"readline":true,"repl":true,"smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","_stream_transform":">= 0.9.4","_stream_wrap":">= 1.4.1","_stream_passthrough":">= 0.9.4","_stream_readable":">= 0.9.4","_stream_writable":">= 0.9.4","stream":true,"string_decoder":true,"sys":true,"timers":true,"_tls_common":">= 0.11.13","_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","tls":true,"trace_events":">= 10","tty":true,"url":true,"util":true,"v8/tools/arguments":">= 10","v8/tools/codemap":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/consarray":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/csvparser":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/logreader":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/profile_view":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/splaytree":[">= 4.4.0 && < 5",">= 5.2.0"],"v8":">= 1","vm":true,"zlib":true}
  120343. /***/ }),
  120344. /* 889 */
  120345. /***/ (function(module, exports, __webpack_require__) {
  120346. var core = __webpack_require__(248);
  120347. var fs = __webpack_require__(12);
  120348. var path = __webpack_require__(1);
  120349. var caller = __webpack_require__(387);
  120350. var nodeModulesPaths = __webpack_require__(388);
  120351. var defaultIsFile = function isFile(file) {
  120352. try {
  120353. var stat = fs.statSync(file);
  120354. } catch (e) {
  120355. if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
  120356. throw e;
  120357. }
  120358. return stat.isFile() || stat.isFIFO();
  120359. };
  120360. module.exports = function (x, options) {
  120361. if (typeof x !== 'string') {
  120362. throw new TypeError('Path must be a string.');
  120363. }
  120364. var opts = options || {};
  120365. var isFile = opts.isFile || defaultIsFile;
  120366. var readFileSync = opts.readFileSync || fs.readFileSync;
  120367. var extensions = opts.extensions || ['.js'];
  120368. var basedir = opts.basedir || path.dirname(caller());
  120369. var parent = opts.filename || basedir;
  120370. opts.paths = opts.paths || [];
  120371. if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
  120372. var res = path.resolve(basedir, x);
  120373. if (x === '..' || x.slice(-1) === '/') res += '/';
  120374. var m = loadAsFileSync(res) || loadAsDirectorySync(res);
  120375. if (m) return m;
  120376. } else {
  120377. var n = loadNodeModulesSync(x, basedir);
  120378. if (n) return n;
  120379. }
  120380. if (core[x]) return x;
  120381. var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
  120382. err.code = 'MODULE_NOT_FOUND';
  120383. throw err;
  120384. function loadAsFileSync(x) {
  120385. var pkg = loadpkg(path.dirname(x));
  120386. if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
  120387. var rfile = path.relative(pkg.dir, x);
  120388. var r = opts.pathFilter(pkg.pkg, x, rfile);
  120389. if (r) {
  120390. x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign
  120391. }
  120392. }
  120393. if (isFile(x)) {
  120394. return x;
  120395. }
  120396. for (var i = 0; i < extensions.length; i++) {
  120397. var file = x + extensions[i];
  120398. if (isFile(file)) {
  120399. return file;
  120400. }
  120401. }
  120402. }
  120403. function loadpkg(dir) {
  120404. if (dir === '' || dir === '/') return;
  120405. if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
  120406. return;
  120407. }
  120408. if (/[/\\]node_modules[/\\]*$/.test(dir)) return;
  120409. var pkgfile = path.join(dir, 'package.json');
  120410. if (!isFile(pkgfile)) {
  120411. return loadpkg(path.dirname(dir));
  120412. }
  120413. var body = readFileSync(pkgfile);
  120414. try {
  120415. var pkg = JSON.parse(body);
  120416. } catch (jsonErr) {}
  120417. if (pkg && opts.packageFilter) {
  120418. pkg = opts.packageFilter(pkg, dir);
  120419. }
  120420. return { pkg: pkg, dir: dir };
  120421. }
  120422. function loadAsDirectorySync(x) {
  120423. var pkgfile = path.join(x, '/package.json');
  120424. if (isFile(pkgfile)) {
  120425. try {
  120426. var body = readFileSync(pkgfile, 'UTF8');
  120427. var pkg = JSON.parse(body);
  120428. if (opts.packageFilter) {
  120429. pkg = opts.packageFilter(pkg, x);
  120430. }
  120431. if (pkg.main) {
  120432. if (pkg.main === '.' || pkg.main === './') {
  120433. pkg.main = 'index';
  120434. }
  120435. var m = loadAsFileSync(path.resolve(x, pkg.main));
  120436. if (m) return m;
  120437. var n = loadAsDirectorySync(path.resolve(x, pkg.main));
  120438. if (n) return n;
  120439. }
  120440. } catch (e) {}
  120441. }
  120442. return loadAsFileSync(path.join(x, '/index'));
  120443. }
  120444. function loadNodeModulesSync(x, start) {
  120445. var dirs = nodeModulesPaths(start, opts);
  120446. for (var i = 0; i < dirs.length; i++) {
  120447. var dir = dirs[i];
  120448. var m = loadAsFileSync(path.join(dir, '/', x));
  120449. if (m) return m;
  120450. var n = loadAsDirectorySync(path.join(dir, '/', x));
  120451. if (n) return n;
  120452. }
  120453. }
  120454. };
  120455. /***/ }),
  120456. /* 890 */
  120457. /***/ (function(module, exports, __webpack_require__) {
  120458. "use strict";
  120459. const onetime = __webpack_require__(843);
  120460. const signalExit = __webpack_require__(421);
  120461. module.exports = onetime(() => {
  120462. signalExit(() => {
  120463. process.stderr.write('\u001b[?25h');
  120464. }, {alwaysLast: true});
  120465. });
  120466. /***/ }),
  120467. /* 891 */
  120468. /***/ (function(module, exports, __webpack_require__) {
  120469. module.exports = __webpack_require__(892);
  120470. /***/ }),
  120471. /* 892 */
  120472. /***/ (function(module, exports, __webpack_require__) {
  120473. var RetryOperation = __webpack_require__(893);
  120474. exports.operation = function(options) {
  120475. var timeouts = exports.timeouts(options);
  120476. return new RetryOperation(timeouts, {
  120477. forever: options && options.forever,
  120478. unref: options && options.unref
  120479. });
  120480. };
  120481. exports.timeouts = function(options) {
  120482. if (options instanceof Array) {
  120483. return [].concat(options);
  120484. }
  120485. var opts = {
  120486. retries: 10,
  120487. factor: 2,
  120488. minTimeout: 1 * 1000,
  120489. maxTimeout: Infinity,
  120490. randomize: false
  120491. };
  120492. for (var key in options) {
  120493. opts[key] = options[key];
  120494. }
  120495. if (opts.minTimeout > opts.maxTimeout) {
  120496. throw new Error('minTimeout is greater than maxTimeout');
  120497. }
  120498. var timeouts = [];
  120499. for (var i = 0; i < opts.retries; i++) {
  120500. timeouts.push(this.createTimeout(i, opts));
  120501. }
  120502. if (options && options.forever && !timeouts.length) {
  120503. timeouts.push(this.createTimeout(i, opts));
  120504. }
  120505. // sort the array numerically ascending
  120506. timeouts.sort(function(a,b) {
  120507. return a - b;
  120508. });
  120509. return timeouts;
  120510. };
  120511. exports.createTimeout = function(attempt, opts) {
  120512. var random = (opts.randomize)
  120513. ? (Math.random() + 1)
  120514. : 1;
  120515. var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt));
  120516. timeout = Math.min(timeout, opts.maxTimeout);
  120517. return timeout;
  120518. };
  120519. exports.wrap = function(obj, options, methods) {
  120520. if (options instanceof Array) {
  120521. methods = options;
  120522. options = null;
  120523. }
  120524. if (!methods) {
  120525. methods = [];
  120526. for (var key in obj) {
  120527. if (typeof obj[key] === 'function') {
  120528. methods.push(key);
  120529. }
  120530. }
  120531. }
  120532. for (var i = 0; i < methods.length; i++) {
  120533. var method = methods[i];
  120534. var original = obj[method];
  120535. obj[method] = function retryWrapper() {
  120536. var op = exports.operation(options);
  120537. var args = Array.prototype.slice.call(arguments);
  120538. var callback = args.pop();
  120539. args.push(function(err) {
  120540. if (op.retry(err)) {
  120541. return;
  120542. }
  120543. if (err) {
  120544. arguments[0] = op.mainError();
  120545. }
  120546. callback.apply(this, arguments);
  120547. });
  120548. op.attempt(function() {
  120549. original.apply(obj, args);
  120550. });
  120551. };
  120552. obj[method].options = options;
  120553. }
  120554. };
  120555. /***/ }),
  120556. /* 893 */
  120557. /***/ (function(module, exports) {
  120558. function RetryOperation(timeouts, options) {
  120559. // Compatibility for the old (timeouts, retryForever) signature
  120560. if (typeof options === 'boolean') {
  120561. options = { forever: options };
  120562. }
  120563. this._timeouts = timeouts;
  120564. this._options = options || {};
  120565. this._fn = null;
  120566. this._errors = [];
  120567. this._attempts = 1;
  120568. this._operationTimeout = null;
  120569. this._operationTimeoutCb = null;
  120570. this._timeout = null;
  120571. if (this._options.forever) {
  120572. this._cachedTimeouts = this._timeouts.slice(0);
  120573. }
  120574. }
  120575. module.exports = RetryOperation;
  120576. RetryOperation.prototype.stop = function() {
  120577. if (this._timeout) {
  120578. clearTimeout(this._timeout);
  120579. }
  120580. this._timeouts = [];
  120581. this._cachedTimeouts = null;
  120582. };
  120583. RetryOperation.prototype.retry = function(err) {
  120584. if (this._timeout) {
  120585. clearTimeout(this._timeout);
  120586. }
  120587. if (!err) {
  120588. return false;
  120589. }
  120590. this._errors.push(err);
  120591. var timeout = this._timeouts.shift();
  120592. if (timeout === undefined) {
  120593. if (this._cachedTimeouts) {
  120594. // retry forever, only keep last error
  120595. this._errors.splice(this._errors.length - 1, this._errors.length);
  120596. this._timeouts = this._cachedTimeouts.slice(0);
  120597. timeout = this._timeouts.shift();
  120598. } else {
  120599. return false;
  120600. }
  120601. }
  120602. var self = this;
  120603. var timer = setTimeout(function() {
  120604. self._attempts++;
  120605. if (self._operationTimeoutCb) {
  120606. self._timeout = setTimeout(function() {
  120607. self._operationTimeoutCb(self._attempts);
  120608. }, self._operationTimeout);
  120609. if (this._options.unref) {
  120610. self._timeout.unref();
  120611. }
  120612. }
  120613. self._fn(self._attempts);
  120614. }, timeout);
  120615. if (this._options.unref) {
  120616. timer.unref();
  120617. }
  120618. return true;
  120619. };
  120620. RetryOperation.prototype.attempt = function(fn, timeoutOps) {
  120621. this._fn = fn;
  120622. if (timeoutOps) {
  120623. if (timeoutOps.timeout) {
  120624. this._operationTimeout = timeoutOps.timeout;
  120625. }
  120626. if (timeoutOps.cb) {
  120627. this._operationTimeoutCb = timeoutOps.cb;
  120628. }
  120629. }
  120630. var self = this;
  120631. if (this._operationTimeoutCb) {
  120632. this._timeout = setTimeout(function() {
  120633. self._operationTimeoutCb();
  120634. }, self._operationTimeout);
  120635. }
  120636. this._fn(this._attempts);
  120637. };
  120638. RetryOperation.prototype.try = function(fn) {
  120639. console.log('Using RetryOperation.try() is deprecated');
  120640. this.attempt(fn);
  120641. };
  120642. RetryOperation.prototype.start = function(fn) {
  120643. console.log('Using RetryOperation.start() is deprecated');
  120644. this.attempt(fn);
  120645. };
  120646. RetryOperation.prototype.start = RetryOperation.prototype.try;
  120647. RetryOperation.prototype.errors = function() {
  120648. return this._errors;
  120649. };
  120650. RetryOperation.prototype.attempts = function() {
  120651. return this._attempts;
  120652. };
  120653. RetryOperation.prototype.mainError = function() {
  120654. if (this._errors.length === 0) {
  120655. return null;
  120656. }
  120657. var counts = {};
  120658. var mainError = null;
  120659. var mainErrorCount = 0;
  120660. for (var i = 0; i < this._errors.length; i++) {
  120661. var error = this._errors[i];
  120662. var message = error.message;
  120663. var count = (counts[message] || 0) + 1;
  120664. counts[message] = count;
  120665. if (count >= mainErrorCount) {
  120666. mainError = error;
  120667. mainErrorCount = count;
  120668. }
  120669. }
  120670. return mainError;
  120671. };
  120672. /***/ }),
  120673. /* 894 */
  120674. /***/ (function(module, exports, __webpack_require__) {
  120675. module.exports = rimraf
  120676. rimraf.sync = rimrafSync
  120677. var assert = __webpack_require__(50)
  120678. var path = __webpack_require__(1)
  120679. var fs = __webpack_require__(12)
  120680. var glob = __webpack_require__(234)
  120681. var _0666 = parseInt('666', 8)
  120682. var defaultGlobOpts = {
  120683. nosort: true,
  120684. silent: true
  120685. }
  120686. // for EMFILE handling
  120687. var timeout = 0
  120688. var isWindows = (process.platform === "win32")
  120689. function defaults (options) {
  120690. var methods = [
  120691. 'unlink',
  120692. 'chmod',
  120693. 'stat',
  120694. 'lstat',
  120695. 'rmdir',
  120696. 'readdir'
  120697. ]
  120698. methods.forEach(function(m) {
  120699. options[m] = options[m] || fs[m]
  120700. m = m + 'Sync'
  120701. options[m] = options[m] || fs[m]
  120702. })
  120703. options.maxBusyTries = options.maxBusyTries || 3
  120704. options.emfileWait = options.emfileWait || 1000
  120705. if (options.glob === false) {
  120706. options.disableGlob = true
  120707. }
  120708. options.disableGlob = options.disableGlob || false
  120709. options.glob = options.glob || defaultGlobOpts
  120710. }
  120711. function rimraf (p, options, cb) {
  120712. if (typeof options === 'function') {
  120713. cb = options
  120714. options = {}
  120715. }
  120716. assert(p, 'rimraf: missing path')
  120717. assert.equal(typeof p, 'string', 'rimraf: path should be a string')
  120718. assert.equal(typeof cb, 'function', 'rimraf: callback function required')
  120719. assert(options, 'rimraf: invalid options argument provided')
  120720. assert.equal(typeof options, 'object', 'rimraf: options should be object')
  120721. defaults(options)
  120722. var busyTries = 0
  120723. var errState = null
  120724. var n = 0
  120725. if (options.disableGlob || !glob.hasMagic(p))
  120726. return afterGlob(null, [p])
  120727. options.lstat(p, function (er, stat) {
  120728. if (!er)
  120729. return afterGlob(null, [p])
  120730. glob(p, options.glob, afterGlob)
  120731. })
  120732. function next (er) {
  120733. errState = errState || er
  120734. if (--n === 0)
  120735. cb(errState)
  120736. }
  120737. function afterGlob (er, results) {
  120738. if (er)
  120739. return cb(er)
  120740. n = results.length
  120741. if (n === 0)
  120742. return cb()
  120743. results.forEach(function (p) {
  120744. rimraf_(p, options, function CB (er) {
  120745. if (er) {
  120746. if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
  120747. busyTries < options.maxBusyTries) {
  120748. busyTries ++
  120749. var time = busyTries * 100
  120750. // try again, with the same exact callback as this one.
  120751. return setTimeout(function () {
  120752. rimraf_(p, options, CB)
  120753. }, time)
  120754. }
  120755. // this one won't happen if graceful-fs is used.
  120756. if (er.code === "EMFILE" && timeout < options.emfileWait) {
  120757. return setTimeout(function () {
  120758. rimraf_(p, options, CB)
  120759. }, timeout ++)
  120760. }
  120761. // already gone
  120762. if (er.code === "ENOENT") er = null
  120763. }
  120764. timeout = 0
  120765. next(er)
  120766. })
  120767. })
  120768. }
  120769. }
  120770. // Two possible strategies.
  120771. // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
  120772. // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
  120773. //
  120774. // Both result in an extra syscall when you guess wrong. However, there
  120775. // are likely far more normal files in the world than directories. This
  120776. // is based on the assumption that a the average number of files per
  120777. // directory is >= 1.
  120778. //
  120779. // If anyone ever complains about this, then I guess the strategy could
  120780. // be made configurable somehow. But until then, YAGNI.
  120781. function rimraf_ (p, options, cb) {
  120782. assert(p)
  120783. assert(options)
  120784. assert(typeof cb === 'function')
  120785. // sunos lets the root user unlink directories, which is... weird.
  120786. // so we have to lstat here and make sure it's not a dir.
  120787. options.lstat(p, function (er, st) {
  120788. if (er && er.code === "ENOENT")
  120789. return cb(null)
  120790. // Windows can EPERM on stat. Life is suffering.
  120791. if (er && er.code === "EPERM" && isWindows)
  120792. fixWinEPERM(p, options, er, cb)
  120793. if (st && st.isDirectory())
  120794. return rmdir(p, options, er, cb)
  120795. options.unlink(p, function (er) {
  120796. if (er) {
  120797. if (er.code === "ENOENT")
  120798. return cb(null)
  120799. if (er.code === "EPERM")
  120800. return (isWindows)
  120801. ? fixWinEPERM(p, options, er, cb)
  120802. : rmdir(p, options, er, cb)
  120803. if (er.code === "EISDIR")
  120804. return rmdir(p, options, er, cb)
  120805. }
  120806. return cb(er)
  120807. })
  120808. })
  120809. }
  120810. function fixWinEPERM (p, options, er, cb) {
  120811. assert(p)
  120812. assert(options)
  120813. assert(typeof cb === 'function')
  120814. if (er)
  120815. assert(er instanceof Error)
  120816. options.chmod(p, _0666, function (er2) {
  120817. if (er2)
  120818. cb(er2.code === "ENOENT" ? null : er)
  120819. else
  120820. options.stat(p, function(er3, stats) {
  120821. if (er3)
  120822. cb(er3.code === "ENOENT" ? null : er)
  120823. else if (stats.isDirectory())
  120824. rmdir(p, options, er, cb)
  120825. else
  120826. options.unlink(p, cb)
  120827. })
  120828. })
  120829. }
  120830. function fixWinEPERMSync (p, options, er) {
  120831. assert(p)
  120832. assert(options)
  120833. if (er)
  120834. assert(er instanceof Error)
  120835. try {
  120836. options.chmodSync(p, _0666)
  120837. } catch (er2) {
  120838. if (er2.code === "ENOENT")
  120839. return
  120840. else
  120841. throw er
  120842. }
  120843. try {
  120844. var stats = options.statSync(p)
  120845. } catch (er3) {
  120846. if (er3.code === "ENOENT")
  120847. return
  120848. else
  120849. throw er
  120850. }
  120851. if (stats.isDirectory())
  120852. rmdirSync(p, options, er)
  120853. else
  120854. options.unlinkSync(p)
  120855. }
  120856. function rmdir (p, options, originalEr, cb) {
  120857. assert(p)
  120858. assert(options)
  120859. if (originalEr)
  120860. assert(originalEr instanceof Error)
  120861. assert(typeof cb === 'function')
  120862. // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
  120863. // if we guessed wrong, and it's not a directory, then
  120864. // raise the original error.
  120865. options.rmdir(p, function (er) {
  120866. if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
  120867. rmkids(p, options, cb)
  120868. else if (er && er.code === "ENOTDIR")
  120869. cb(originalEr)
  120870. else
  120871. cb(er)
  120872. })
  120873. }
  120874. function rmkids(p, options, cb) {
  120875. assert(p)
  120876. assert(options)
  120877. assert(typeof cb === 'function')
  120878. options.readdir(p, function (er, files) {
  120879. if (er)
  120880. return cb(er)
  120881. var n = files.length
  120882. if (n === 0)
  120883. return options.rmdir(p, cb)
  120884. var errState
  120885. files.forEach(function (f) {
  120886. rimraf(path.join(p, f), options, function (er) {
  120887. if (errState)
  120888. return
  120889. if (er)
  120890. return cb(errState = er)
  120891. if (--n === 0)
  120892. options.rmdir(p, cb)
  120893. })
  120894. })
  120895. })
  120896. }
  120897. // this looks simpler, and is strictly *faster*, but will
  120898. // tie up the JavaScript thread and fail on excessively
  120899. // deep directory trees.
  120900. function rimrafSync (p, options) {
  120901. options = options || {}
  120902. defaults(options)
  120903. assert(p, 'rimraf: missing path')
  120904. assert.equal(typeof p, 'string', 'rimraf: path should be a string')
  120905. assert(options, 'rimraf: missing options')
  120906. assert.equal(typeof options, 'object', 'rimraf: options should be object')
  120907. var results
  120908. if (options.disableGlob || !glob.hasMagic(p)) {
  120909. results = [p]
  120910. } else {
  120911. try {
  120912. options.lstatSync(p)
  120913. results = [p]
  120914. } catch (er) {
  120915. results = glob.sync(p, options.glob)
  120916. }
  120917. }
  120918. if (!results.length)
  120919. return
  120920. for (var i = 0; i < results.length; i++) {
  120921. var p = results[i]
  120922. try {
  120923. var st = options.lstatSync(p)
  120924. } catch (er) {
  120925. if (er.code === "ENOENT")
  120926. return
  120927. // Windows can EPERM on stat. Life is suffering.
  120928. if (er.code === "EPERM" && isWindows)
  120929. fixWinEPERMSync(p, options, er)
  120930. }
  120931. try {
  120932. // sunos lets the root user unlink directories, which is... weird.
  120933. if (st && st.isDirectory())
  120934. rmdirSync(p, options, null)
  120935. else
  120936. options.unlinkSync(p)
  120937. } catch (er) {
  120938. if (er.code === "ENOENT")
  120939. return
  120940. if (er.code === "EPERM")
  120941. return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
  120942. if (er.code !== "EISDIR")
  120943. throw er
  120944. rmdirSync(p, options, er)
  120945. }
  120946. }
  120947. }
  120948. function rmdirSync (p, options, originalEr) {
  120949. assert(p)
  120950. assert(options)
  120951. if (originalEr)
  120952. assert(originalEr instanceof Error)
  120953. try {
  120954. options.rmdirSync(p)
  120955. } catch (er) {
  120956. if (er.code === "ENOENT")
  120957. return
  120958. if (er.code === "ENOTDIR")
  120959. throw originalEr
  120960. if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
  120961. rmkidsSync(p, options)
  120962. }
  120963. }
  120964. function rmkidsSync (p, options) {
  120965. assert(p)
  120966. assert(options)
  120967. options.readdirSync(p).forEach(function (f) {
  120968. rimrafSync(path.join(p, f), options)
  120969. })
  120970. // We only end up here once we got ENOTEMPTY at least once, and
  120971. // at this point, we are guaranteed to have removed all the kids.
  120972. // So, we know that it won't be ENOENT or ENOTDIR or anything else.
  120973. // try really hard to delete stuff on windows, because it has a
  120974. // PROFOUNDLY annoying habit of not closing handles promptly when
  120975. // files are deleted, resulting in spurious ENOTEMPTY errors.
  120976. var retries = isWindows ? 100 : 1
  120977. var i = 0
  120978. do {
  120979. var threw = true
  120980. try {
  120981. var ret = options.rmdirSync(p, options)
  120982. threw = false
  120983. return ret
  120984. } finally {
  120985. if (++i < retries && threw)
  120986. continue
  120987. }
  120988. } while (true)
  120989. }
  120990. /***/ }),
  120991. /* 895 */
  120992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  120993. "use strict";
  120994. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SubscribeOnObservable; });
  120995. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  120996. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(17);
  120997. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__ = __webpack_require__(408);
  120998. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isNumeric__ = __webpack_require__(181);
  120999. /** PURE_IMPORTS_START tslib,_Observable,_scheduler_asap,_util_isNumeric PURE_IMPORTS_END */
  121000. var SubscribeOnObservable = /*@__PURE__*/ (function (_super) {
  121001. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubscribeOnObservable, _super);
  121002. function SubscribeOnObservable(source, delayTime, scheduler) {
  121003. if (delayTime === void 0) {
  121004. delayTime = 0;
  121005. }
  121006. if (scheduler === void 0) {
  121007. scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__["a" /* asap */];
  121008. }
  121009. var _this = _super.call(this) || this;
  121010. _this.source = source;
  121011. _this.delayTime = delayTime;
  121012. _this.scheduler = scheduler;
  121013. if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isNumeric__["a" /* isNumeric */])(delayTime) || delayTime < 0) {
  121014. _this.delayTime = 0;
  121015. }
  121016. if (!scheduler || typeof scheduler.schedule !== 'function') {
  121017. _this.scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__["a" /* asap */];
  121018. }
  121019. return _this;
  121020. }
  121021. SubscribeOnObservable.create = function (source, delay, scheduler) {
  121022. if (delay === void 0) {
  121023. delay = 0;
  121024. }
  121025. if (scheduler === void 0) {
  121026. scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__["a" /* asap */];
  121027. }
  121028. return new SubscribeOnObservable(source, delay, scheduler);
  121029. };
  121030. SubscribeOnObservable.dispatch = function (arg) {
  121031. var source = arg.source, subscriber = arg.subscriber;
  121032. return this.add(source.subscribe(subscriber));
  121033. };
  121034. SubscribeOnObservable.prototype._subscribe = function (subscriber) {
  121035. var delay = this.delayTime;
  121036. var source = this.source;
  121037. var scheduler = this.scheduler;
  121038. return scheduler.schedule(SubscribeOnObservable.dispatch, delay, {
  121039. source: source, subscriber: subscriber
  121040. });
  121041. };
  121042. return SubscribeOnObservable;
  121043. }(__WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */]));
  121044. //# sourceMappingURL=SubscribeOnObservable.js.map
  121045. /***/ }),
  121046. /* 896 */
  121047. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121048. "use strict";
  121049. /* harmony export (immutable) */ __webpack_exports__["a"] = bindCallback;
  121050. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121051. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__ = __webpack_require__(174);
  121052. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__operators_map__ = __webpack_require__(54);
  121053. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_canReportError__ = __webpack_require__(263);
  121054. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isArray__ = __webpack_require__(48);
  121055. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_isScheduler__ = __webpack_require__(56);
  121056. /** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_canReportError,_util_isArray,_util_isScheduler PURE_IMPORTS_END */
  121057. function bindCallback(callbackFunc, resultSelector, scheduler) {
  121058. if (resultSelector) {
  121059. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* isScheduler */])(resultSelector)) {
  121060. scheduler = resultSelector;
  121061. }
  121062. else {
  121063. return function () {
  121064. var args = [];
  121065. for (var _i = 0; _i < arguments.length; _i++) {
  121066. args[_i] = arguments[_i];
  121067. }
  121068. return bindCallback(callbackFunc, scheduler).apply(void 0, args).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isArray__["a" /* isArray */])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
  121069. };
  121070. }
  121071. }
  121072. return function () {
  121073. var args = [];
  121074. for (var _i = 0; _i < arguments.length; _i++) {
  121075. args[_i] = arguments[_i];
  121076. }
  121077. var context = this;
  121078. var subject;
  121079. var params = {
  121080. context: context,
  121081. subject: subject,
  121082. callbackFunc: callbackFunc,
  121083. scheduler: scheduler,
  121084. };
  121085. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121086. if (!scheduler) {
  121087. if (!subject) {
  121088. subject = new __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* AsyncSubject */]();
  121089. var handler = function () {
  121090. var innerArgs = [];
  121091. for (var _i = 0; _i < arguments.length; _i++) {
  121092. innerArgs[_i] = arguments[_i];
  121093. }
  121094. subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
  121095. subject.complete();
  121096. };
  121097. try {
  121098. callbackFunc.apply(context, args.concat([handler]));
  121099. }
  121100. catch (err) {
  121101. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_canReportError__["a" /* canReportError */])(subject)) {
  121102. subject.error(err);
  121103. }
  121104. else {
  121105. console.warn(err);
  121106. }
  121107. }
  121108. }
  121109. return subject.subscribe(subscriber);
  121110. }
  121111. else {
  121112. var state = {
  121113. args: args, subscriber: subscriber, params: params,
  121114. };
  121115. return scheduler.schedule(dispatch, 0, state);
  121116. }
  121117. });
  121118. };
  121119. }
  121120. function dispatch(state) {
  121121. var _this = this;
  121122. var self = this;
  121123. var args = state.args, subscriber = state.subscriber, params = state.params;
  121124. var callbackFunc = params.callbackFunc, context = params.context, scheduler = params.scheduler;
  121125. var subject = params.subject;
  121126. if (!subject) {
  121127. subject = params.subject = new __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* AsyncSubject */]();
  121128. var handler = function () {
  121129. var innerArgs = [];
  121130. for (var _i = 0; _i < arguments.length; _i++) {
  121131. innerArgs[_i] = arguments[_i];
  121132. }
  121133. var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
  121134. _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
  121135. };
  121136. try {
  121137. callbackFunc.apply(context, args.concat([handler]));
  121138. }
  121139. catch (err) {
  121140. subject.error(err);
  121141. }
  121142. }
  121143. this.add(subject.subscribe(subscriber));
  121144. }
  121145. function dispatchNext(state) {
  121146. var value = state.value, subject = state.subject;
  121147. subject.next(value);
  121148. subject.complete();
  121149. }
  121150. function dispatchError(state) {
  121151. var err = state.err, subject = state.subject;
  121152. subject.error(err);
  121153. }
  121154. //# sourceMappingURL=bindCallback.js.map
  121155. /***/ }),
  121156. /* 897 */
  121157. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121158. "use strict";
  121159. /* harmony export (immutable) */ __webpack_exports__["a"] = bindNodeCallback;
  121160. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121161. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__ = __webpack_require__(174);
  121162. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__operators_map__ = __webpack_require__(54);
  121163. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_canReportError__ = __webpack_require__(263);
  121164. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isScheduler__ = __webpack_require__(56);
  121165. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_isArray__ = __webpack_require__(48);
  121166. /** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_canReportError,_util_isScheduler,_util_isArray PURE_IMPORTS_END */
  121167. function bindNodeCallback(callbackFunc, resultSelector, scheduler) {
  121168. if (resultSelector) {
  121169. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isScheduler__["a" /* isScheduler */])(resultSelector)) {
  121170. scheduler = resultSelector;
  121171. }
  121172. else {
  121173. return function () {
  121174. var args = [];
  121175. for (var _i = 0; _i < arguments.length; _i++) {
  121176. args[_i] = arguments[_i];
  121177. }
  121178. return bindNodeCallback(callbackFunc, scheduler).apply(void 0, args).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isArray__["a" /* isArray */])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
  121179. };
  121180. }
  121181. }
  121182. return function () {
  121183. var args = [];
  121184. for (var _i = 0; _i < arguments.length; _i++) {
  121185. args[_i] = arguments[_i];
  121186. }
  121187. var params = {
  121188. subject: undefined,
  121189. args: args,
  121190. callbackFunc: callbackFunc,
  121191. scheduler: scheduler,
  121192. context: this,
  121193. };
  121194. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121195. var context = params.context;
  121196. var subject = params.subject;
  121197. if (!scheduler) {
  121198. if (!subject) {
  121199. subject = params.subject = new __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* AsyncSubject */]();
  121200. var handler = function () {
  121201. var innerArgs = [];
  121202. for (var _i = 0; _i < arguments.length; _i++) {
  121203. innerArgs[_i] = arguments[_i];
  121204. }
  121205. var err = innerArgs.shift();
  121206. if (err) {
  121207. subject.error(err);
  121208. return;
  121209. }
  121210. subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
  121211. subject.complete();
  121212. };
  121213. try {
  121214. callbackFunc.apply(context, args.concat([handler]));
  121215. }
  121216. catch (err) {
  121217. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_canReportError__["a" /* canReportError */])(subject)) {
  121218. subject.error(err);
  121219. }
  121220. else {
  121221. console.warn(err);
  121222. }
  121223. }
  121224. }
  121225. return subject.subscribe(subscriber);
  121226. }
  121227. else {
  121228. return scheduler.schedule(dispatch, 0, { params: params, subscriber: subscriber, context: context });
  121229. }
  121230. });
  121231. };
  121232. }
  121233. function dispatch(state) {
  121234. var _this = this;
  121235. var params = state.params, subscriber = state.subscriber, context = state.context;
  121236. var callbackFunc = params.callbackFunc, args = params.args, scheduler = params.scheduler;
  121237. var subject = params.subject;
  121238. if (!subject) {
  121239. subject = params.subject = new __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* AsyncSubject */]();
  121240. var handler = function () {
  121241. var innerArgs = [];
  121242. for (var _i = 0; _i < arguments.length; _i++) {
  121243. innerArgs[_i] = arguments[_i];
  121244. }
  121245. var err = innerArgs.shift();
  121246. if (err) {
  121247. _this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
  121248. }
  121249. else {
  121250. var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
  121251. _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
  121252. }
  121253. };
  121254. try {
  121255. callbackFunc.apply(context, args.concat([handler]));
  121256. }
  121257. catch (err) {
  121258. this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
  121259. }
  121260. }
  121261. this.add(subject.subscribe(subscriber));
  121262. }
  121263. function dispatchNext(arg) {
  121264. var value = arg.value, subject = arg.subject;
  121265. subject.next(value);
  121266. subject.complete();
  121267. }
  121268. function dispatchError(arg) {
  121269. var err = arg.err, subject = arg.subject;
  121270. subject.error(err);
  121271. }
  121272. //# sourceMappingURL=bindNodeCallback.js.map
  121273. /***/ }),
  121274. /* 898 */
  121275. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121276. "use strict";
  121277. /* harmony export (immutable) */ __webpack_exports__["a"] = forkJoin;
  121278. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  121279. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(17);
  121280. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48);
  121281. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__empty__ = __webpack_require__(46);
  121282. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
  121283. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__ = __webpack_require__(18);
  121284. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__operators_map__ = __webpack_require__(54);
  121285. /** PURE_IMPORTS_START tslib,_Observable,_util_isArray,_empty,_util_subscribeToResult,_OuterSubscriber,_operators_map PURE_IMPORTS_END */
  121286. function forkJoin() {
  121287. var sources = [];
  121288. for (var _i = 0; _i < arguments.length; _i++) {
  121289. sources[_i] = arguments[_i];
  121290. }
  121291. var resultSelector;
  121292. if (typeof sources[sources.length - 1] === 'function') {
  121293. resultSelector = sources.pop();
  121294. }
  121295. if (sources.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(sources[0])) {
  121296. sources = sources[0];
  121297. }
  121298. if (sources.length === 0) {
  121299. return __WEBPACK_IMPORTED_MODULE_3__empty__["b" /* EMPTY */];
  121300. }
  121301. if (resultSelector) {
  121302. return forkJoin(sources).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__operators_map__["a" /* map */])(function (args) { return resultSelector.apply(void 0, args); }));
  121303. }
  121304. return new __WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */](function (subscriber) {
  121305. return new ForkJoinSubscriber(subscriber, sources);
  121306. });
  121307. }
  121308. var ForkJoinSubscriber = /*@__PURE__*/ (function (_super) {
  121309. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ForkJoinSubscriber, _super);
  121310. function ForkJoinSubscriber(destination, sources) {
  121311. var _this = _super.call(this, destination) || this;
  121312. _this.sources = sources;
  121313. _this.completed = 0;
  121314. _this.haveValues = 0;
  121315. var len = sources.length;
  121316. _this.values = new Array(len);
  121317. for (var i = 0; i < len; i++) {
  121318. var source = sources[i];
  121319. var innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(_this, source, null, i);
  121320. if (innerSubscription) {
  121321. _this.add(innerSubscription);
  121322. }
  121323. }
  121324. return _this;
  121325. }
  121326. ForkJoinSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  121327. this.values[outerIndex] = innerValue;
  121328. if (!innerSub._hasValue) {
  121329. innerSub._hasValue = true;
  121330. this.haveValues++;
  121331. }
  121332. };
  121333. ForkJoinSubscriber.prototype.notifyComplete = function (innerSub) {
  121334. var _a = this, destination = _a.destination, haveValues = _a.haveValues, values = _a.values;
  121335. var len = values.length;
  121336. if (!innerSub._hasValue) {
  121337. destination.complete();
  121338. return;
  121339. }
  121340. this.completed++;
  121341. if (this.completed !== len) {
  121342. return;
  121343. }
  121344. if (haveValues === len) {
  121345. destination.next(values);
  121346. }
  121347. destination.complete();
  121348. };
  121349. return ForkJoinSubscriber;
  121350. }(__WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__["a" /* OuterSubscriber */]));
  121351. //# sourceMappingURL=forkJoin.js.map
  121352. /***/ }),
  121353. /* 899 */
  121354. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121355. "use strict";
  121356. /* harmony export (immutable) */ __webpack_exports__["a"] = fromEvent;
  121357. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121358. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isArray__ = __webpack_require__(48);
  121359. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(143);
  121360. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_map__ = __webpack_require__(54);
  121361. /** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */
  121362. var toString = Object.prototype.toString;
  121363. function fromEvent(target, eventName, options, resultSelector) {
  121364. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(options)) {
  121365. resultSelector = options;
  121366. options = undefined;
  121367. }
  121368. if (resultSelector) {
  121369. return fromEvent(target, eventName, options).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isArray__["a" /* isArray */])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
  121370. }
  121371. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121372. function handler(e) {
  121373. if (arguments.length > 1) {
  121374. subscriber.next(Array.prototype.slice.call(arguments));
  121375. }
  121376. else {
  121377. subscriber.next(e);
  121378. }
  121379. }
  121380. setupSubscription(target, eventName, handler, subscriber, options);
  121381. });
  121382. }
  121383. function setupSubscription(sourceObj, eventName, handler, subscriber, options) {
  121384. var unsubscribe;
  121385. if (isEventTarget(sourceObj)) {
  121386. var source_1 = sourceObj;
  121387. sourceObj.addEventListener(eventName, handler, options);
  121388. unsubscribe = function () { return source_1.removeEventListener(eventName, handler, options); };
  121389. }
  121390. else if (isJQueryStyleEventEmitter(sourceObj)) {
  121391. var source_2 = sourceObj;
  121392. sourceObj.on(eventName, handler);
  121393. unsubscribe = function () { return source_2.off(eventName, handler); };
  121394. }
  121395. else if (isNodeStyleEventEmitter(sourceObj)) {
  121396. var source_3 = sourceObj;
  121397. sourceObj.addListener(eventName, handler);
  121398. unsubscribe = function () { return source_3.removeListener(eventName, handler); };
  121399. }
  121400. else if (sourceObj && sourceObj.length) {
  121401. for (var i = 0, len = sourceObj.length; i < len; i++) {
  121402. setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
  121403. }
  121404. }
  121405. else {
  121406. throw new TypeError('Invalid event target');
  121407. }
  121408. subscriber.add(unsubscribe);
  121409. }
  121410. function isNodeStyleEventEmitter(sourceObj) {
  121411. return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
  121412. }
  121413. function isJQueryStyleEventEmitter(sourceObj) {
  121414. return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
  121415. }
  121416. function isEventTarget(sourceObj) {
  121417. return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
  121418. }
  121419. //# sourceMappingURL=fromEvent.js.map
  121420. /***/ }),
  121421. /* 900 */
  121422. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121423. "use strict";
  121424. /* harmony export (immutable) */ __webpack_exports__["a"] = fromEventPattern;
  121425. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121426. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isArray__ = __webpack_require__(48);
  121427. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(143);
  121428. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_map__ = __webpack_require__(54);
  121429. /** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */
  121430. function fromEventPattern(addHandler, removeHandler, resultSelector) {
  121431. if (resultSelector) {
  121432. return fromEventPattern(addHandler, removeHandler).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isArray__["a" /* isArray */])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
  121433. }
  121434. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121435. var handler = function () {
  121436. var e = [];
  121437. for (var _i = 0; _i < arguments.length; _i++) {
  121438. e[_i] = arguments[_i];
  121439. }
  121440. return subscriber.next(e.length === 1 ? e[0] : e);
  121441. };
  121442. var retValue;
  121443. try {
  121444. retValue = addHandler(handler);
  121445. }
  121446. catch (err) {
  121447. subscriber.error(err);
  121448. return undefined;
  121449. }
  121450. if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(removeHandler)) {
  121451. return undefined;
  121452. }
  121453. return function () { return removeHandler(handler, retValue); };
  121454. });
  121455. }
  121456. //# sourceMappingURL=fromEventPattern.js.map
  121457. /***/ }),
  121458. /* 901 */
  121459. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121460. "use strict";
  121461. /* harmony export (immutable) */ __webpack_exports__["a"] = fromIterable;
  121462. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121463. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
  121464. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__symbol_iterator__ = __webpack_require__(140);
  121465. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToIterable__ = __webpack_require__(418);
  121466. /** PURE_IMPORTS_START _Observable,_Subscription,_symbol_iterator,_util_subscribeToIterable PURE_IMPORTS_END */
  121467. function fromIterable(input, scheduler) {
  121468. if (!input) {
  121469. throw new Error('Iterable cannot be null');
  121470. }
  121471. if (!scheduler) {
  121472. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToIterable__["a" /* subscribeToIterable */])(input));
  121473. }
  121474. else {
  121475. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121476. var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
  121477. var iterator;
  121478. sub.add(function () {
  121479. if (iterator && typeof iterator.return === 'function') {
  121480. iterator.return();
  121481. }
  121482. });
  121483. sub.add(scheduler.schedule(function () {
  121484. iterator = input[__WEBPACK_IMPORTED_MODULE_2__symbol_iterator__["a" /* iterator */]]();
  121485. sub.add(scheduler.schedule(function () {
  121486. if (subscriber.closed) {
  121487. return;
  121488. }
  121489. var value;
  121490. var done;
  121491. try {
  121492. var result = iterator.next();
  121493. value = result.value;
  121494. done = result.done;
  121495. }
  121496. catch (err) {
  121497. subscriber.error(err);
  121498. return;
  121499. }
  121500. if (done) {
  121501. subscriber.complete();
  121502. }
  121503. else {
  121504. subscriber.next(value);
  121505. this.schedule();
  121506. }
  121507. }));
  121508. }));
  121509. return sub;
  121510. });
  121511. }
  121512. }
  121513. //# sourceMappingURL=fromIterable.js.map
  121514. /***/ }),
  121515. /* 902 */
  121516. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121517. "use strict";
  121518. /* harmony export (immutable) */ __webpack_exports__["a"] = fromObservable;
  121519. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121520. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
  121521. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__symbol_observable__ = __webpack_require__(112);
  121522. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToObservable__ = __webpack_require__(419);
  121523. /** PURE_IMPORTS_START _Observable,_Subscription,_symbol_observable,_util_subscribeToObservable PURE_IMPORTS_END */
  121524. function fromObservable(input, scheduler) {
  121525. if (!scheduler) {
  121526. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToObservable__["a" /* subscribeToObservable */])(input));
  121527. }
  121528. else {
  121529. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121530. var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
  121531. sub.add(scheduler.schedule(function () {
  121532. var observable = input[__WEBPACK_IMPORTED_MODULE_2__symbol_observable__["a" /* observable */]]();
  121533. sub.add(observable.subscribe({
  121534. next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },
  121535. error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },
  121536. complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },
  121537. }));
  121538. }));
  121539. return sub;
  121540. });
  121541. }
  121542. }
  121543. //# sourceMappingURL=fromObservable.js.map
  121544. /***/ }),
  121545. /* 903 */
  121546. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121547. "use strict";
  121548. /* harmony export (immutable) */ __webpack_exports__["a"] = fromPromise;
  121549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121550. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
  121551. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToPromise__ = __webpack_require__(420);
  121552. /** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToPromise PURE_IMPORTS_END */
  121553. function fromPromise(input, scheduler) {
  121554. if (!scheduler) {
  121555. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToPromise__["a" /* subscribeToPromise */])(input));
  121556. }
  121557. else {
  121558. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121559. var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
  121560. sub.add(scheduler.schedule(function () {
  121561. return input.then(function (value) {
  121562. sub.add(scheduler.schedule(function () {
  121563. subscriber.next(value);
  121564. sub.add(scheduler.schedule(function () { return subscriber.complete(); }));
  121565. }));
  121566. }, function (err) {
  121567. sub.add(scheduler.schedule(function () { return subscriber.error(err); }));
  121568. });
  121569. }));
  121570. return sub;
  121571. });
  121572. }
  121573. }
  121574. //# sourceMappingURL=fromPromise.js.map
  121575. /***/ }),
  121576. /* 904 */
  121577. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121578. "use strict";
  121579. /* harmony export (immutable) */ __webpack_exports__["a"] = generate;
  121580. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121581. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_identity__ = __webpack_require__(113);
  121582. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isScheduler__ = __webpack_require__(56);
  121583. /** PURE_IMPORTS_START _Observable,_util_identity,_util_isScheduler PURE_IMPORTS_END */
  121584. function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {
  121585. var resultSelector;
  121586. var initialState;
  121587. if (arguments.length == 1) {
  121588. var options = initialStateOrOptions;
  121589. initialState = options.initialState;
  121590. condition = options.condition;
  121591. iterate = options.iterate;
  121592. resultSelector = options.resultSelector || __WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */];
  121593. scheduler = options.scheduler;
  121594. }
  121595. else if (resultSelectorOrObservable === undefined || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isScheduler__["a" /* isScheduler */])(resultSelectorOrObservable)) {
  121596. initialState = initialStateOrOptions;
  121597. resultSelector = __WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */];
  121598. scheduler = resultSelectorOrObservable;
  121599. }
  121600. else {
  121601. initialState = initialStateOrOptions;
  121602. resultSelector = resultSelectorOrObservable;
  121603. }
  121604. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121605. var state = initialState;
  121606. if (scheduler) {
  121607. return scheduler.schedule(dispatch, 0, {
  121608. subscriber: subscriber,
  121609. iterate: iterate,
  121610. condition: condition,
  121611. resultSelector: resultSelector,
  121612. state: state
  121613. });
  121614. }
  121615. do {
  121616. if (condition) {
  121617. var conditionResult = void 0;
  121618. try {
  121619. conditionResult = condition(state);
  121620. }
  121621. catch (err) {
  121622. subscriber.error(err);
  121623. return undefined;
  121624. }
  121625. if (!conditionResult) {
  121626. subscriber.complete();
  121627. break;
  121628. }
  121629. }
  121630. var value = void 0;
  121631. try {
  121632. value = resultSelector(state);
  121633. }
  121634. catch (err) {
  121635. subscriber.error(err);
  121636. return undefined;
  121637. }
  121638. subscriber.next(value);
  121639. if (subscriber.closed) {
  121640. break;
  121641. }
  121642. try {
  121643. state = iterate(state);
  121644. }
  121645. catch (err) {
  121646. subscriber.error(err);
  121647. return undefined;
  121648. }
  121649. } while (true);
  121650. return undefined;
  121651. });
  121652. }
  121653. function dispatch(state) {
  121654. var subscriber = state.subscriber, condition = state.condition;
  121655. if (subscriber.closed) {
  121656. return undefined;
  121657. }
  121658. if (state.needIterate) {
  121659. try {
  121660. state.state = state.iterate(state.state);
  121661. }
  121662. catch (err) {
  121663. subscriber.error(err);
  121664. return undefined;
  121665. }
  121666. }
  121667. else {
  121668. state.needIterate = true;
  121669. }
  121670. if (condition) {
  121671. var conditionResult = void 0;
  121672. try {
  121673. conditionResult = condition(state.state);
  121674. }
  121675. catch (err) {
  121676. subscriber.error(err);
  121677. return undefined;
  121678. }
  121679. if (!conditionResult) {
  121680. subscriber.complete();
  121681. return undefined;
  121682. }
  121683. if (subscriber.closed) {
  121684. return undefined;
  121685. }
  121686. }
  121687. var value;
  121688. try {
  121689. value = state.resultSelector(state.state);
  121690. }
  121691. catch (err) {
  121692. subscriber.error(err);
  121693. return undefined;
  121694. }
  121695. if (subscriber.closed) {
  121696. return undefined;
  121697. }
  121698. subscriber.next(value);
  121699. if (subscriber.closed) {
  121700. return undefined;
  121701. }
  121702. return this.schedule(state);
  121703. }
  121704. //# sourceMappingURL=generate.js.map
  121705. /***/ }),
  121706. /* 905 */
  121707. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121708. "use strict";
  121709. /* harmony export (immutable) */ __webpack_exports__["a"] = iif;
  121710. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defer__ = __webpack_require__(251);
  121711. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__empty__ = __webpack_require__(46);
  121712. /** PURE_IMPORTS_START _defer,_empty PURE_IMPORTS_END */
  121713. function iif(condition, trueResult, falseResult) {
  121714. if (trueResult === void 0) {
  121715. trueResult = __WEBPACK_IMPORTED_MODULE_1__empty__["b" /* EMPTY */];
  121716. }
  121717. if (falseResult === void 0) {
  121718. falseResult = __WEBPACK_IMPORTED_MODULE_1__empty__["b" /* EMPTY */];
  121719. }
  121720. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__defer__["a" /* defer */])(function () { return condition() ? trueResult : falseResult; });
  121721. }
  121722. //# sourceMappingURL=iif.js.map
  121723. /***/ }),
  121724. /* 906 */
  121725. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121726. "use strict";
  121727. /* harmony export (immutable) */ __webpack_exports__["a"] = interval;
  121728. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121729. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47);
  121730. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isNumeric__ = __webpack_require__(181);
  121731. /** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric PURE_IMPORTS_END */
  121732. function interval(period, scheduler) {
  121733. if (period === void 0) {
  121734. period = 0;
  121735. }
  121736. if (scheduler === void 0) {
  121737. scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
  121738. }
  121739. if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isNumeric__["a" /* isNumeric */])(period) || period < 0) {
  121740. period = 0;
  121741. }
  121742. if (!scheduler || typeof scheduler.schedule !== 'function') {
  121743. scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
  121744. }
  121745. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121746. subscriber.add(scheduler.schedule(dispatch, period, { subscriber: subscriber, counter: 0, period: period }));
  121747. return subscriber;
  121748. });
  121749. }
  121750. function dispatch(state) {
  121751. var subscriber = state.subscriber, counter = state.counter, period = state.period;
  121752. subscriber.next(counter);
  121753. this.schedule({ subscriber: subscriber, counter: counter + 1, period: period }, period);
  121754. }
  121755. //# sourceMappingURL=interval.js.map
  121756. /***/ }),
  121757. /* 907 */
  121758. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121759. "use strict";
  121760. /* harmony export (immutable) */ __webpack_exports__["a"] = onErrorResumeNext;
  121761. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121762. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__from__ = __webpack_require__(64);
  121763. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48);
  121764. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__empty__ = __webpack_require__(46);
  121765. /** PURE_IMPORTS_START _Observable,_from,_util_isArray,_empty PURE_IMPORTS_END */
  121766. function onErrorResumeNext() {
  121767. var sources = [];
  121768. for (var _i = 0; _i < arguments.length; _i++) {
  121769. sources[_i] = arguments[_i];
  121770. }
  121771. if (sources.length === 0) {
  121772. return __WEBPACK_IMPORTED_MODULE_3__empty__["b" /* EMPTY */];
  121773. }
  121774. var first = sources[0], remainder = sources.slice(1);
  121775. if (sources.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(first)) {
  121776. return onErrorResumeNext.apply(void 0, first);
  121777. }
  121778. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121779. var subNext = function () { return subscriber.add(onErrorResumeNext.apply(void 0, remainder).subscribe(subscriber)); };
  121780. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__from__["a" /* from */])(first).subscribe({
  121781. next: function (value) { subscriber.next(value); },
  121782. error: subNext,
  121783. complete: subNext,
  121784. });
  121785. });
  121786. }
  121787. //# sourceMappingURL=onErrorResumeNext.js.map
  121788. /***/ }),
  121789. /* 908 */
  121790. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121791. "use strict";
  121792. /* harmony export (immutable) */ __webpack_exports__["a"] = pairs;
  121793. /* unused harmony export dispatch */
  121794. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121795. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
  121796. /** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */
  121797. function pairs(obj, scheduler) {
  121798. if (!scheduler) {
  121799. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121800. var keys = Object.keys(obj);
  121801. for (var i = 0; i < keys.length && !subscriber.closed; i++) {
  121802. var key = keys[i];
  121803. if (obj.hasOwnProperty(key)) {
  121804. subscriber.next([key, obj[key]]);
  121805. }
  121806. }
  121807. subscriber.complete();
  121808. });
  121809. }
  121810. else {
  121811. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121812. var keys = Object.keys(obj);
  121813. var subscription = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
  121814. subscription.add(scheduler.schedule(dispatch, 0, { keys: keys, index: 0, subscriber: subscriber, subscription: subscription, obj: obj }));
  121815. return subscription;
  121816. });
  121817. }
  121818. }
  121819. function dispatch(state) {
  121820. var keys = state.keys, index = state.index, subscriber = state.subscriber, subscription = state.subscription, obj = state.obj;
  121821. if (!subscriber.closed) {
  121822. if (index < keys.length) {
  121823. var key = keys[index];
  121824. subscriber.next([key, obj[key]]);
  121825. subscription.add(this.schedule({ keys: keys, index: index + 1, subscriber: subscriber, subscription: subscription, obj: obj }));
  121826. }
  121827. else {
  121828. subscriber.complete();
  121829. }
  121830. }
  121831. }
  121832. //# sourceMappingURL=pairs.js.map
  121833. /***/ }),
  121834. /* 909 */
  121835. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121836. "use strict";
  121837. /* harmony export (immutable) */ __webpack_exports__["a"] = range;
  121838. /* unused harmony export dispatch */
  121839. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121840. /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
  121841. function range(start, count, scheduler) {
  121842. if (start === void 0) {
  121843. start = 0;
  121844. }
  121845. if (count === void 0) {
  121846. count = 0;
  121847. }
  121848. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121849. var index = 0;
  121850. var current = start;
  121851. if (scheduler) {
  121852. return scheduler.schedule(dispatch, 0, {
  121853. index: index, count: count, start: start, subscriber: subscriber
  121854. });
  121855. }
  121856. else {
  121857. do {
  121858. if (index++ >= count) {
  121859. subscriber.complete();
  121860. break;
  121861. }
  121862. subscriber.next(current++);
  121863. if (subscriber.closed) {
  121864. break;
  121865. }
  121866. } while (true);
  121867. }
  121868. return undefined;
  121869. });
  121870. }
  121871. function dispatch(state) {
  121872. var start = state.start, index = state.index, count = state.count, subscriber = state.subscriber;
  121873. if (index >= count) {
  121874. subscriber.complete();
  121875. return;
  121876. }
  121877. subscriber.next(start);
  121878. if (subscriber.closed) {
  121879. return;
  121880. }
  121881. state.index = index + 1;
  121882. state.start = start + 1;
  121883. this.schedule(state);
  121884. }
  121885. //# sourceMappingURL=range.js.map
  121886. /***/ }),
  121887. /* 910 */
  121888. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121889. "use strict";
  121890. /* harmony export (immutable) */ __webpack_exports__["a"] = using;
  121891. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  121892. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__from__ = __webpack_require__(64);
  121893. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__empty__ = __webpack_require__(46);
  121894. /** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */
  121895. function using(resourceFactory, observableFactory) {
  121896. return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
  121897. var resource;
  121898. try {
  121899. resource = resourceFactory();
  121900. }
  121901. catch (err) {
  121902. subscriber.error(err);
  121903. return undefined;
  121904. }
  121905. var result;
  121906. try {
  121907. result = observableFactory(resource);
  121908. }
  121909. catch (err) {
  121910. subscriber.error(err);
  121911. return undefined;
  121912. }
  121913. var source = result ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__from__["a" /* from */])(result) : __WEBPACK_IMPORTED_MODULE_2__empty__["b" /* EMPTY */];
  121914. var subscription = source.subscribe(subscriber);
  121915. return function () {
  121916. subscription.unsubscribe();
  121917. if (resource) {
  121918. resource.unsubscribe();
  121919. }
  121920. };
  121921. });
  121922. }
  121923. //# sourceMappingURL=using.js.map
  121924. /***/ }),
  121925. /* 911 */
  121926. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121927. "use strict";
  121928. /* harmony export (immutable) */ __webpack_exports__["a"] = auditTime;
  121929. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(47);
  121930. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__audit__ = __webpack_require__(398);
  121931. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_timer__ = __webpack_require__(397);
  121932. /** PURE_IMPORTS_START _scheduler_async,_audit,_observable_timer PURE_IMPORTS_END */
  121933. function auditTime(duration, scheduler) {
  121934. if (scheduler === void 0) {
  121935. scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */];
  121936. }
  121937. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__audit__["a" /* audit */])(function () { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_timer__["a" /* timer */])(duration, scheduler); });
  121938. }
  121939. //# sourceMappingURL=auditTime.js.map
  121940. /***/ }),
  121941. /* 912 */
  121942. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121943. "use strict";
  121944. /* harmony export (immutable) */ __webpack_exports__["a"] = buffer;
  121945. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  121946. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  121947. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
  121948. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  121949. function buffer(closingNotifier) {
  121950. return function bufferOperatorFunction(source) {
  121951. return source.lift(new BufferOperator(closingNotifier));
  121952. };
  121953. }
  121954. var BufferOperator = /*@__PURE__*/ (function () {
  121955. function BufferOperator(closingNotifier) {
  121956. this.closingNotifier = closingNotifier;
  121957. }
  121958. BufferOperator.prototype.call = function (subscriber, source) {
  121959. return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
  121960. };
  121961. return BufferOperator;
  121962. }());
  121963. var BufferSubscriber = /*@__PURE__*/ (function (_super) {
  121964. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferSubscriber, _super);
  121965. function BufferSubscriber(destination, closingNotifier) {
  121966. var _this = _super.call(this, destination) || this;
  121967. _this.buffer = [];
  121968. _this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(_this, closingNotifier));
  121969. return _this;
  121970. }
  121971. BufferSubscriber.prototype._next = function (value) {
  121972. this.buffer.push(value);
  121973. };
  121974. BufferSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  121975. var buffer = this.buffer;
  121976. this.buffer = [];
  121977. this.destination.next(buffer);
  121978. };
  121979. return BufferSubscriber;
  121980. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  121981. //# sourceMappingURL=buffer.js.map
  121982. /***/ }),
  121983. /* 913 */
  121984. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  121985. "use strict";
  121986. /* harmony export (immutable) */ __webpack_exports__["a"] = bufferCount;
  121987. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  121988. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  121989. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  121990. function bufferCount(bufferSize, startBufferEvery) {
  121991. if (startBufferEvery === void 0) {
  121992. startBufferEvery = null;
  121993. }
  121994. return function bufferCountOperatorFunction(source) {
  121995. return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));
  121996. };
  121997. }
  121998. var BufferCountOperator = /*@__PURE__*/ (function () {
  121999. function BufferCountOperator(bufferSize, startBufferEvery) {
  122000. this.bufferSize = bufferSize;
  122001. this.startBufferEvery = startBufferEvery;
  122002. if (!startBufferEvery || bufferSize === startBufferEvery) {
  122003. this.subscriberClass = BufferCountSubscriber;
  122004. }
  122005. else {
  122006. this.subscriberClass = BufferSkipCountSubscriber;
  122007. }
  122008. }
  122009. BufferCountOperator.prototype.call = function (subscriber, source) {
  122010. return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));
  122011. };
  122012. return BufferCountOperator;
  122013. }());
  122014. var BufferCountSubscriber = /*@__PURE__*/ (function (_super) {
  122015. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferCountSubscriber, _super);
  122016. function BufferCountSubscriber(destination, bufferSize) {
  122017. var _this = _super.call(this, destination) || this;
  122018. _this.bufferSize = bufferSize;
  122019. _this.buffer = [];
  122020. return _this;
  122021. }
  122022. BufferCountSubscriber.prototype._next = function (value) {
  122023. var buffer = this.buffer;
  122024. buffer.push(value);
  122025. if (buffer.length == this.bufferSize) {
  122026. this.destination.next(buffer);
  122027. this.buffer = [];
  122028. }
  122029. };
  122030. BufferCountSubscriber.prototype._complete = function () {
  122031. var buffer = this.buffer;
  122032. if (buffer.length > 0) {
  122033. this.destination.next(buffer);
  122034. }
  122035. _super.prototype._complete.call(this);
  122036. };
  122037. return BufferCountSubscriber;
  122038. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  122039. var BufferSkipCountSubscriber = /*@__PURE__*/ (function (_super) {
  122040. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferSkipCountSubscriber, _super);
  122041. function BufferSkipCountSubscriber(destination, bufferSize, startBufferEvery) {
  122042. var _this = _super.call(this, destination) || this;
  122043. _this.bufferSize = bufferSize;
  122044. _this.startBufferEvery = startBufferEvery;
  122045. _this.buffers = [];
  122046. _this.count = 0;
  122047. return _this;
  122048. }
  122049. BufferSkipCountSubscriber.prototype._next = function (value) {
  122050. var _a = this, bufferSize = _a.bufferSize, startBufferEvery = _a.startBufferEvery, buffers = _a.buffers, count = _a.count;
  122051. this.count++;
  122052. if (count % startBufferEvery === 0) {
  122053. buffers.push([]);
  122054. }
  122055. for (var i = buffers.length; i--;) {
  122056. var buffer = buffers[i];
  122057. buffer.push(value);
  122058. if (buffer.length === bufferSize) {
  122059. buffers.splice(i, 1);
  122060. this.destination.next(buffer);
  122061. }
  122062. }
  122063. };
  122064. BufferSkipCountSubscriber.prototype._complete = function () {
  122065. var _a = this, buffers = _a.buffers, destination = _a.destination;
  122066. while (buffers.length > 0) {
  122067. var buffer = buffers.shift();
  122068. if (buffer.length > 0) {
  122069. destination.next(buffer);
  122070. }
  122071. }
  122072. _super.prototype._complete.call(this);
  122073. };
  122074. return BufferSkipCountSubscriber;
  122075. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  122076. //# sourceMappingURL=bufferCount.js.map
  122077. /***/ }),
  122078. /* 914 */
  122079. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122080. "use strict";
  122081. /* harmony export (immutable) */ __webpack_exports__["a"] = bufferTime;
  122082. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  122083. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47);
  122084. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(5);
  122085. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isScheduler__ = __webpack_require__(56);
  122086. /** PURE_IMPORTS_START tslib,_scheduler_async,_Subscriber,_util_isScheduler PURE_IMPORTS_END */
  122087. function bufferTime(bufferTimeSpan) {
  122088. var length = arguments.length;
  122089. var scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
  122090. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isScheduler__["a" /* isScheduler */])(arguments[arguments.length - 1])) {
  122091. scheduler = arguments[arguments.length - 1];
  122092. length--;
  122093. }
  122094. var bufferCreationInterval = null;
  122095. if (length >= 2) {
  122096. bufferCreationInterval = arguments[1];
  122097. }
  122098. var maxBufferSize = Number.POSITIVE_INFINITY;
  122099. if (length >= 3) {
  122100. maxBufferSize = arguments[2];
  122101. }
  122102. return function bufferTimeOperatorFunction(source) {
  122103. return source.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler));
  122104. };
  122105. }
  122106. var BufferTimeOperator = /*@__PURE__*/ (function () {
  122107. function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
  122108. this.bufferTimeSpan = bufferTimeSpan;
  122109. this.bufferCreationInterval = bufferCreationInterval;
  122110. this.maxBufferSize = maxBufferSize;
  122111. this.scheduler = scheduler;
  122112. }
  122113. BufferTimeOperator.prototype.call = function (subscriber, source) {
  122114. return source.subscribe(new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler));
  122115. };
  122116. return BufferTimeOperator;
  122117. }());
  122118. var Context = /*@__PURE__*/ (function () {
  122119. function Context() {
  122120. this.buffer = [];
  122121. }
  122122. return Context;
  122123. }());
  122124. var BufferTimeSubscriber = /*@__PURE__*/ (function (_super) {
  122125. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferTimeSubscriber, _super);
  122126. function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
  122127. var _this = _super.call(this, destination) || this;
  122128. _this.bufferTimeSpan = bufferTimeSpan;
  122129. _this.bufferCreationInterval = bufferCreationInterval;
  122130. _this.maxBufferSize = maxBufferSize;
  122131. _this.scheduler = scheduler;
  122132. _this.contexts = [];
  122133. var context = _this.openContext();
  122134. _this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0;
  122135. if (_this.timespanOnly) {
  122136. var timeSpanOnlyState = { subscriber: _this, context: context, bufferTimeSpan: bufferTimeSpan };
  122137. _this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
  122138. }
  122139. else {
  122140. var closeState = { subscriber: _this, context: context };
  122141. var creationState = { bufferTimeSpan: bufferTimeSpan, bufferCreationInterval: bufferCreationInterval, subscriber: _this, scheduler: scheduler };
  122142. _this.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState));
  122143. _this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState));
  122144. }
  122145. return _this;
  122146. }
  122147. BufferTimeSubscriber.prototype._next = function (value) {
  122148. var contexts = this.contexts;
  122149. var len = contexts.length;
  122150. var filledBufferContext;
  122151. for (var i = 0; i < len; i++) {
  122152. var context_1 = contexts[i];
  122153. var buffer = context_1.buffer;
  122154. buffer.push(value);
  122155. if (buffer.length == this.maxBufferSize) {
  122156. filledBufferContext = context_1;
  122157. }
  122158. }
  122159. if (filledBufferContext) {
  122160. this.onBufferFull(filledBufferContext);
  122161. }
  122162. };
  122163. BufferTimeSubscriber.prototype._error = function (err) {
  122164. this.contexts.length = 0;
  122165. _super.prototype._error.call(this, err);
  122166. };
  122167. BufferTimeSubscriber.prototype._complete = function () {
  122168. var _a = this, contexts = _a.contexts, destination = _a.destination;
  122169. while (contexts.length > 0) {
  122170. var context_2 = contexts.shift();
  122171. destination.next(context_2.buffer);
  122172. }
  122173. _super.prototype._complete.call(this);
  122174. };
  122175. BufferTimeSubscriber.prototype._unsubscribe = function () {
  122176. this.contexts = null;
  122177. };
  122178. BufferTimeSubscriber.prototype.onBufferFull = function (context) {
  122179. this.closeContext(context);
  122180. var closeAction = context.closeAction;
  122181. closeAction.unsubscribe();
  122182. this.remove(closeAction);
  122183. if (!this.closed && this.timespanOnly) {
  122184. context = this.openContext();
  122185. var bufferTimeSpan = this.bufferTimeSpan;
  122186. var timeSpanOnlyState = { subscriber: this, context: context, bufferTimeSpan: bufferTimeSpan };
  122187. this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
  122188. }
  122189. };
  122190. BufferTimeSubscriber.prototype.openContext = function () {
  122191. var context = new Context();
  122192. this.contexts.push(context);
  122193. return context;
  122194. };
  122195. BufferTimeSubscriber.prototype.closeContext = function (context) {
  122196. this.destination.next(context.buffer);
  122197. var contexts = this.contexts;
  122198. var spliceIndex = contexts ? contexts.indexOf(context) : -1;
  122199. if (spliceIndex >= 0) {
  122200. contexts.splice(contexts.indexOf(context), 1);
  122201. }
  122202. };
  122203. return BufferTimeSubscriber;
  122204. }(__WEBPACK_IMPORTED_MODULE_2__Subscriber__["a" /* Subscriber */]));
  122205. function dispatchBufferTimeSpanOnly(state) {
  122206. var subscriber = state.subscriber;
  122207. var prevContext = state.context;
  122208. if (prevContext) {
  122209. subscriber.closeContext(prevContext);
  122210. }
  122211. if (!subscriber.closed) {
  122212. state.context = subscriber.openContext();
  122213. state.context.closeAction = this.schedule(state, state.bufferTimeSpan);
  122214. }
  122215. }
  122216. function dispatchBufferCreation(state) {
  122217. var bufferCreationInterval = state.bufferCreationInterval, bufferTimeSpan = state.bufferTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler;
  122218. var context = subscriber.openContext();
  122219. var action = this;
  122220. if (!subscriber.closed) {
  122221. subscriber.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { subscriber: subscriber, context: context }));
  122222. action.schedule(state, bufferCreationInterval);
  122223. }
  122224. }
  122225. function dispatchBufferClose(arg) {
  122226. var subscriber = arg.subscriber, context = arg.context;
  122227. subscriber.closeContext(context);
  122228. }
  122229. //# sourceMappingURL=bufferTime.js.map
  122230. /***/ }),
  122231. /* 915 */
  122232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122233. "use strict";
  122234. /* harmony export (immutable) */ __webpack_exports__["a"] = bufferToggle;
  122235. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  122236. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
  122237. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
  122238. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
  122239. /** PURE_IMPORTS_START tslib,_Subscription,_util_subscribeToResult,_OuterSubscriber PURE_IMPORTS_END */
  122240. function bufferToggle(openings, closingSelector) {
  122241. return function bufferToggleOperatorFunction(source) {
  122242. return source.lift(new BufferToggleOperator(openings, closingSelector));
  122243. };
  122244. }
  122245. var BufferToggleOperator = /*@__PURE__*/ (function () {
  122246. function BufferToggleOperator(openings, closingSelector) {
  122247. this.openings = openings;
  122248. this.closingSelector = closingSelector;
  122249. }
  122250. BufferToggleOperator.prototype.call = function (subscriber, source) {
  122251. return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector));
  122252. };
  122253. return BufferToggleOperator;
  122254. }());
  122255. var BufferToggleSubscriber = /*@__PURE__*/ (function (_super) {
  122256. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferToggleSubscriber, _super);
  122257. function BufferToggleSubscriber(destination, openings, closingSelector) {
  122258. var _this = _super.call(this, destination) || this;
  122259. _this.openings = openings;
  122260. _this.closingSelector = closingSelector;
  122261. _this.contexts = [];
  122262. _this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(_this, openings));
  122263. return _this;
  122264. }
  122265. BufferToggleSubscriber.prototype._next = function (value) {
  122266. var contexts = this.contexts;
  122267. var len = contexts.length;
  122268. for (var i = 0; i < len; i++) {
  122269. contexts[i].buffer.push(value);
  122270. }
  122271. };
  122272. BufferToggleSubscriber.prototype._error = function (err) {
  122273. var contexts = this.contexts;
  122274. while (contexts.length > 0) {
  122275. var context_1 = contexts.shift();
  122276. context_1.subscription.unsubscribe();
  122277. context_1.buffer = null;
  122278. context_1.subscription = null;
  122279. }
  122280. this.contexts = null;
  122281. _super.prototype._error.call(this, err);
  122282. };
  122283. BufferToggleSubscriber.prototype._complete = function () {
  122284. var contexts = this.contexts;
  122285. while (contexts.length > 0) {
  122286. var context_2 = contexts.shift();
  122287. this.destination.next(context_2.buffer);
  122288. context_2.subscription.unsubscribe();
  122289. context_2.buffer = null;
  122290. context_2.subscription = null;
  122291. }
  122292. this.contexts = null;
  122293. _super.prototype._complete.call(this);
  122294. };
  122295. BufferToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  122296. outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue);
  122297. };
  122298. BufferToggleSubscriber.prototype.notifyComplete = function (innerSub) {
  122299. this.closeBuffer(innerSub.context);
  122300. };
  122301. BufferToggleSubscriber.prototype.openBuffer = function (value) {
  122302. try {
  122303. var closingSelector = this.closingSelector;
  122304. var closingNotifier = closingSelector.call(this, value);
  122305. if (closingNotifier) {
  122306. this.trySubscribe(closingNotifier);
  122307. }
  122308. }
  122309. catch (err) {
  122310. this._error(err);
  122311. }
  122312. };
  122313. BufferToggleSubscriber.prototype.closeBuffer = function (context) {
  122314. var contexts = this.contexts;
  122315. if (contexts && context) {
  122316. var buffer = context.buffer, subscription = context.subscription;
  122317. this.destination.next(buffer);
  122318. contexts.splice(contexts.indexOf(context), 1);
  122319. this.remove(subscription);
  122320. subscription.unsubscribe();
  122321. }
  122322. };
  122323. BufferToggleSubscriber.prototype.trySubscribe = function (closingNotifier) {
  122324. var contexts = this.contexts;
  122325. var buffer = [];
  122326. var subscription = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
  122327. var context = { buffer: buffer, subscription: subscription };
  122328. contexts.push(context);
  122329. var innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(this, closingNotifier, context);
  122330. if (!innerSubscription || innerSubscription.closed) {
  122331. this.closeBuffer(context);
  122332. }
  122333. else {
  122334. innerSubscription.context = context;
  122335. this.add(innerSubscription);
  122336. subscription.add(innerSubscription);
  122337. }
  122338. };
  122339. return BufferToggleSubscriber;
  122340. }(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
  122341. //# sourceMappingURL=bufferToggle.js.map
  122342. /***/ }),
  122343. /* 916 */
  122344. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122345. "use strict";
  122346. /* harmony export (immutable) */ __webpack_exports__["a"] = bufferWhen;
  122347. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  122348. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
  122349. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
  122350. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
  122351. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
  122352. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
  122353. /** PURE_IMPORTS_START tslib,_Subscription,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  122354. function bufferWhen(closingSelector) {
  122355. return function (source) {
  122356. return source.lift(new BufferWhenOperator(closingSelector));
  122357. };
  122358. }
  122359. var BufferWhenOperator = /*@__PURE__*/ (function () {
  122360. function BufferWhenOperator(closingSelector) {
  122361. this.closingSelector = closingSelector;
  122362. }
  122363. BufferWhenOperator.prototype.call = function (subscriber, source) {
  122364. return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));
  122365. };
  122366. return BufferWhenOperator;
  122367. }());
  122368. var BufferWhenSubscriber = /*@__PURE__*/ (function (_super) {
  122369. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferWhenSubscriber, _super);
  122370. function BufferWhenSubscriber(destination, closingSelector) {
  122371. var _this = _super.call(this, destination) || this;
  122372. _this.closingSelector = closingSelector;
  122373. _this.subscribing = false;
  122374. _this.openBuffer();
  122375. return _this;
  122376. }
  122377. BufferWhenSubscriber.prototype._next = function (value) {
  122378. this.buffer.push(value);
  122379. };
  122380. BufferWhenSubscriber.prototype._complete = function () {
  122381. var buffer = this.buffer;
  122382. if (buffer) {
  122383. this.destination.next(buffer);
  122384. }
  122385. _super.prototype._complete.call(this);
  122386. };
  122387. BufferWhenSubscriber.prototype._unsubscribe = function () {
  122388. this.buffer = null;
  122389. this.subscribing = false;
  122390. };
  122391. BufferWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  122392. this.openBuffer();
  122393. };
  122394. BufferWhenSubscriber.prototype.notifyComplete = function () {
  122395. if (this.subscribing) {
  122396. this.complete();
  122397. }
  122398. else {
  122399. this.openBuffer();
  122400. }
  122401. };
  122402. BufferWhenSubscriber.prototype.openBuffer = function () {
  122403. var closingSubscription = this.closingSubscription;
  122404. if (closingSubscription) {
  122405. this.remove(closingSubscription);
  122406. closingSubscription.unsubscribe();
  122407. }
  122408. var buffer = this.buffer;
  122409. if (this.buffer) {
  122410. this.destination.next(buffer);
  122411. }
  122412. this.buffer = [];
  122413. var closingNotifier = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.closingSelector)();
  122414. if (closingNotifier === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
  122415. this.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e);
  122416. }
  122417. else {
  122418. closingSubscription = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
  122419. this.closingSubscription = closingSubscription;
  122420. this.add(closingSubscription);
  122421. this.subscribing = true;
  122422. closingSubscription.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, closingNotifier));
  122423. this.subscribing = false;
  122424. }
  122425. };
  122426. return BufferWhenSubscriber;
  122427. }(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
  122428. //# sourceMappingURL=bufferWhen.js.map
  122429. /***/ }),
  122430. /* 917 */
  122431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122432. "use strict";
  122433. /* harmony export (immutable) */ __webpack_exports__["a"] = catchError;
  122434. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  122435. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  122436. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(80);
  122437. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
  122438. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  122439. function catchError(selector) {
  122440. return function catchErrorOperatorFunction(source) {
  122441. var operator = new CatchOperator(selector);
  122442. var caught = source.lift(operator);
  122443. return (operator.caught = caught);
  122444. };
  122445. }
  122446. var CatchOperator = /*@__PURE__*/ (function () {
  122447. function CatchOperator(selector) {
  122448. this.selector = selector;
  122449. }
  122450. CatchOperator.prototype.call = function (subscriber, source) {
  122451. return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));
  122452. };
  122453. return CatchOperator;
  122454. }());
  122455. var CatchSubscriber = /*@__PURE__*/ (function (_super) {
  122456. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](CatchSubscriber, _super);
  122457. function CatchSubscriber(destination, selector, caught) {
  122458. var _this = _super.call(this, destination) || this;
  122459. _this.selector = selector;
  122460. _this.caught = caught;
  122461. return _this;
  122462. }
  122463. CatchSubscriber.prototype.error = function (err) {
  122464. if (!this.isStopped) {
  122465. var result = void 0;
  122466. try {
  122467. result = this.selector(err, this.caught);
  122468. }
  122469. catch (err2) {
  122470. _super.prototype.error.call(this, err2);
  122471. return;
  122472. }
  122473. this._unsubscribeAndRecycle();
  122474. var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
  122475. this.add(innerSubscriber);
  122476. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, undefined, undefined, innerSubscriber);
  122477. }
  122478. };
  122479. return CatchSubscriber;
  122480. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  122481. //# sourceMappingURL=catchError.js.map
  122482. /***/ }),
  122483. /* 918 */
  122484. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122485. "use strict";
  122486. /* harmony export (immutable) */ __webpack_exports__["a"] = combineAll;
  122487. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_combineLatest__ = __webpack_require__(250);
  122488. /** PURE_IMPORTS_START _observable_combineLatest PURE_IMPORTS_END */
  122489. function combineAll(project) {
  122490. return function (source) { return source.lift(new __WEBPACK_IMPORTED_MODULE_0__observable_combineLatest__["b" /* CombineLatestOperator */](project)); };
  122491. }
  122492. //# sourceMappingURL=combineAll.js.map
  122493. /***/ }),
  122494. /* 919 */
  122495. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122496. "use strict";
  122497. /* harmony export (immutable) */ __webpack_exports__["a"] = combineLatest;
  122498. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(48);
  122499. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_combineLatest__ = __webpack_require__(250);
  122500. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_from__ = __webpack_require__(64);
  122501. /** PURE_IMPORTS_START _util_isArray,_observable_combineLatest,_observable_from PURE_IMPORTS_END */
  122502. var none = {};
  122503. function combineLatest() {
  122504. var observables = [];
  122505. for (var _i = 0; _i < arguments.length; _i++) {
  122506. observables[_i] = arguments[_i];
  122507. }
  122508. var project = null;
  122509. if (typeof observables[observables.length - 1] === 'function') {
  122510. project = observables.pop();
  122511. }
  122512. if (observables.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(observables[0])) {
  122513. observables = observables[0].slice();
  122514. }
  122515. return function (source) { return source.lift.call(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_from__["a" /* from */])([source].concat(observables)), new __WEBPACK_IMPORTED_MODULE_1__observable_combineLatest__["b" /* CombineLatestOperator */](project)); };
  122516. }
  122517. //# sourceMappingURL=combineLatest.js.map
  122518. /***/ }),
  122519. /* 920 */
  122520. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122521. "use strict";
  122522. /* harmony export (immutable) */ __webpack_exports__["a"] = concat;
  122523. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_concat__ = __webpack_require__(177);
  122524. /** PURE_IMPORTS_START _observable_concat PURE_IMPORTS_END */
  122525. function concat() {
  122526. var observables = [];
  122527. for (var _i = 0; _i < arguments.length; _i++) {
  122528. observables[_i] = arguments[_i];
  122529. }
  122530. return function (source) { return source.lift.call(__WEBPACK_IMPORTED_MODULE_0__observable_concat__["a" /* concat */].apply(void 0, [source].concat(observables))); };
  122531. }
  122532. //# sourceMappingURL=concat.js.map
  122533. /***/ }),
  122534. /* 921 */
  122535. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122536. "use strict";
  122537. /* harmony export (immutable) */ __webpack_exports__["a"] = concatMapTo;
  122538. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__concatMap__ = __webpack_require__(400);
  122539. /** PURE_IMPORTS_START _concatMap PURE_IMPORTS_END */
  122540. function concatMapTo(innerObservable, resultSelector) {
  122541. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__concatMap__["a" /* concatMap */])(function () { return innerObservable; }, resultSelector);
  122542. }
  122543. //# sourceMappingURL=concatMapTo.js.map
  122544. /***/ }),
  122545. /* 922 */
  122546. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122547. "use strict";
  122548. /* harmony export (immutable) */ __webpack_exports__["a"] = count;
  122549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  122550. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  122551. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  122552. function count(predicate) {
  122553. return function (source) { return source.lift(new CountOperator(predicate, source)); };
  122554. }
  122555. var CountOperator = /*@__PURE__*/ (function () {
  122556. function CountOperator(predicate, source) {
  122557. this.predicate = predicate;
  122558. this.source = source;
  122559. }
  122560. CountOperator.prototype.call = function (subscriber, source) {
  122561. return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source));
  122562. };
  122563. return CountOperator;
  122564. }());
  122565. var CountSubscriber = /*@__PURE__*/ (function (_super) {
  122566. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](CountSubscriber, _super);
  122567. function CountSubscriber(destination, predicate, source) {
  122568. var _this = _super.call(this, destination) || this;
  122569. _this.predicate = predicate;
  122570. _this.source = source;
  122571. _this.count = 0;
  122572. _this.index = 0;
  122573. return _this;
  122574. }
  122575. CountSubscriber.prototype._next = function (value) {
  122576. if (this.predicate) {
  122577. this._tryPredicate(value);
  122578. }
  122579. else {
  122580. this.count++;
  122581. }
  122582. };
  122583. CountSubscriber.prototype._tryPredicate = function (value) {
  122584. var result;
  122585. try {
  122586. result = this.predicate(value, this.index++, this.source);
  122587. }
  122588. catch (err) {
  122589. this.destination.error(err);
  122590. return;
  122591. }
  122592. if (result) {
  122593. this.count++;
  122594. }
  122595. };
  122596. CountSubscriber.prototype._complete = function () {
  122597. this.destination.next(this.count);
  122598. this.destination.complete();
  122599. };
  122600. return CountSubscriber;
  122601. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  122602. //# sourceMappingURL=count.js.map
  122603. /***/ }),
  122604. /* 923 */
  122605. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122606. "use strict";
  122607. /* harmony export (immutable) */ __webpack_exports__["a"] = debounce;
  122608. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  122609. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  122610. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
  122611. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  122612. function debounce(durationSelector) {
  122613. return function (source) { return source.lift(new DebounceOperator(durationSelector)); };
  122614. }
  122615. var DebounceOperator = /*@__PURE__*/ (function () {
  122616. function DebounceOperator(durationSelector) {
  122617. this.durationSelector = durationSelector;
  122618. }
  122619. DebounceOperator.prototype.call = function (subscriber, source) {
  122620. return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));
  122621. };
  122622. return DebounceOperator;
  122623. }());
  122624. var DebounceSubscriber = /*@__PURE__*/ (function (_super) {
  122625. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DebounceSubscriber, _super);
  122626. function DebounceSubscriber(destination, durationSelector) {
  122627. var _this = _super.call(this, destination) || this;
  122628. _this.durationSelector = durationSelector;
  122629. _this.hasValue = false;
  122630. _this.durationSubscription = null;
  122631. return _this;
  122632. }
  122633. DebounceSubscriber.prototype._next = function (value) {
  122634. try {
  122635. var result = this.durationSelector.call(this, value);
  122636. if (result) {
  122637. this._tryNext(value, result);
  122638. }
  122639. }
  122640. catch (err) {
  122641. this.destination.error(err);
  122642. }
  122643. };
  122644. DebounceSubscriber.prototype._complete = function () {
  122645. this.emitValue();
  122646. this.destination.complete();
  122647. };
  122648. DebounceSubscriber.prototype._tryNext = function (value, duration) {
  122649. var subscription = this.durationSubscription;
  122650. this.value = value;
  122651. this.hasValue = true;
  122652. if (subscription) {
  122653. subscription.unsubscribe();
  122654. this.remove(subscription);
  122655. }
  122656. subscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(this, duration);
  122657. if (subscription && !subscription.closed) {
  122658. this.add(this.durationSubscription = subscription);
  122659. }
  122660. };
  122661. DebounceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  122662. this.emitValue();
  122663. };
  122664. DebounceSubscriber.prototype.notifyComplete = function () {
  122665. this.emitValue();
  122666. };
  122667. DebounceSubscriber.prototype.emitValue = function () {
  122668. if (this.hasValue) {
  122669. var value = this.value;
  122670. var subscription = this.durationSubscription;
  122671. if (subscription) {
  122672. this.durationSubscription = null;
  122673. subscription.unsubscribe();
  122674. this.remove(subscription);
  122675. }
  122676. this.value = null;
  122677. this.hasValue = false;
  122678. _super.prototype._next.call(this, value);
  122679. }
  122680. };
  122681. return DebounceSubscriber;
  122682. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  122683. //# sourceMappingURL=debounce.js.map
  122684. /***/ }),
  122685. /* 924 */
  122686. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122687. "use strict";
  122688. /* harmony export (immutable) */ __webpack_exports__["a"] = debounceTime;
  122689. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  122690. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  122691. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(47);
  122692. /** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */
  122693. function debounceTime(dueTime, scheduler) {
  122694. if (scheduler === void 0) {
  122695. scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* async */];
  122696. }
  122697. return function (source) { return source.lift(new DebounceTimeOperator(dueTime, scheduler)); };
  122698. }
  122699. var DebounceTimeOperator = /*@__PURE__*/ (function () {
  122700. function DebounceTimeOperator(dueTime, scheduler) {
  122701. this.dueTime = dueTime;
  122702. this.scheduler = scheduler;
  122703. }
  122704. DebounceTimeOperator.prototype.call = function (subscriber, source) {
  122705. return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));
  122706. };
  122707. return DebounceTimeOperator;
  122708. }());
  122709. var DebounceTimeSubscriber = /*@__PURE__*/ (function (_super) {
  122710. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DebounceTimeSubscriber, _super);
  122711. function DebounceTimeSubscriber(destination, dueTime, scheduler) {
  122712. var _this = _super.call(this, destination) || this;
  122713. _this.dueTime = dueTime;
  122714. _this.scheduler = scheduler;
  122715. _this.debouncedSubscription = null;
  122716. _this.lastValue = null;
  122717. _this.hasValue = false;
  122718. return _this;
  122719. }
  122720. DebounceTimeSubscriber.prototype._next = function (value) {
  122721. this.clearDebounce();
  122722. this.lastValue = value;
  122723. this.hasValue = true;
  122724. this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));
  122725. };
  122726. DebounceTimeSubscriber.prototype._complete = function () {
  122727. this.debouncedNext();
  122728. this.destination.complete();
  122729. };
  122730. DebounceTimeSubscriber.prototype.debouncedNext = function () {
  122731. this.clearDebounce();
  122732. if (this.hasValue) {
  122733. var lastValue = this.lastValue;
  122734. this.lastValue = null;
  122735. this.hasValue = false;
  122736. this.destination.next(lastValue);
  122737. }
  122738. };
  122739. DebounceTimeSubscriber.prototype.clearDebounce = function () {
  122740. var debouncedSubscription = this.debouncedSubscription;
  122741. if (debouncedSubscription !== null) {
  122742. this.remove(debouncedSubscription);
  122743. debouncedSubscription.unsubscribe();
  122744. this.debouncedSubscription = null;
  122745. }
  122746. };
  122747. return DebounceTimeSubscriber;
  122748. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  122749. function dispatchNext(subscriber) {
  122750. subscriber.debouncedNext();
  122751. }
  122752. //# sourceMappingURL=debounceTime.js.map
  122753. /***/ }),
  122754. /* 925 */
  122755. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122756. "use strict";
  122757. /* harmony export (immutable) */ __webpack_exports__["a"] = delay;
  122758. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  122759. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47);
  122760. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isDate__ = __webpack_require__(413);
  122761. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(5);
  122762. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Notification__ = __webpack_require__(175);
  122763. /** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_Subscriber,_Notification PURE_IMPORTS_END */
  122764. function delay(delay, scheduler) {
  122765. if (scheduler === void 0) {
  122766. scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
  122767. }
  122768. var absoluteDelay = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isDate__["a" /* isDate */])(delay);
  122769. var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);
  122770. return function (source) { return source.lift(new DelayOperator(delayFor, scheduler)); };
  122771. }
  122772. var DelayOperator = /*@__PURE__*/ (function () {
  122773. function DelayOperator(delay, scheduler) {
  122774. this.delay = delay;
  122775. this.scheduler = scheduler;
  122776. }
  122777. DelayOperator.prototype.call = function (subscriber, source) {
  122778. return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));
  122779. };
  122780. return DelayOperator;
  122781. }());
  122782. var DelaySubscriber = /*@__PURE__*/ (function (_super) {
  122783. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DelaySubscriber, _super);
  122784. function DelaySubscriber(destination, delay, scheduler) {
  122785. var _this = _super.call(this, destination) || this;
  122786. _this.delay = delay;
  122787. _this.scheduler = scheduler;
  122788. _this.queue = [];
  122789. _this.active = false;
  122790. _this.errored = false;
  122791. return _this;
  122792. }
  122793. DelaySubscriber.dispatch = function (state) {
  122794. var source = state.source;
  122795. var queue = source.queue;
  122796. var scheduler = state.scheduler;
  122797. var destination = state.destination;
  122798. while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {
  122799. queue.shift().notification.observe(destination);
  122800. }
  122801. if (queue.length > 0) {
  122802. var delay_1 = Math.max(0, queue[0].time - scheduler.now());
  122803. this.schedule(state, delay_1);
  122804. }
  122805. else {
  122806. this.unsubscribe();
  122807. source.active = false;
  122808. }
  122809. };
  122810. DelaySubscriber.prototype._schedule = function (scheduler) {
  122811. this.active = true;
  122812. var destination = this.destination;
  122813. destination.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {
  122814. source: this, destination: this.destination, scheduler: scheduler
  122815. }));
  122816. };
  122817. DelaySubscriber.prototype.scheduleNotification = function (notification) {
  122818. if (this.errored === true) {
  122819. return;
  122820. }
  122821. var scheduler = this.scheduler;
  122822. var message = new DelayMessage(scheduler.now() + this.delay, notification);
  122823. this.queue.push(message);
  122824. if (this.active === false) {
  122825. this._schedule(scheduler);
  122826. }
  122827. };
  122828. DelaySubscriber.prototype._next = function (value) {
  122829. this.scheduleNotification(__WEBPACK_IMPORTED_MODULE_4__Notification__["a" /* Notification */].createNext(value));
  122830. };
  122831. DelaySubscriber.prototype._error = function (err) {
  122832. this.errored = true;
  122833. this.queue = [];
  122834. this.destination.error(err);
  122835. this.unsubscribe();
  122836. };
  122837. DelaySubscriber.prototype._complete = function () {
  122838. this.scheduleNotification(__WEBPACK_IMPORTED_MODULE_4__Notification__["a" /* Notification */].createComplete());
  122839. this.unsubscribe();
  122840. };
  122841. return DelaySubscriber;
  122842. }(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* Subscriber */]));
  122843. var DelayMessage = /*@__PURE__*/ (function () {
  122844. function DelayMessage(time, notification) {
  122845. this.time = time;
  122846. this.notification = notification;
  122847. }
  122848. return DelayMessage;
  122849. }());
  122850. //# sourceMappingURL=delay.js.map
  122851. /***/ }),
  122852. /* 926 */
  122853. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122854. "use strict";
  122855. /* harmony export (immutable) */ __webpack_exports__["a"] = delayWhen;
  122856. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  122857. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  122858. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observable__ = __webpack_require__(17);
  122859. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
  122860. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
  122861. /** PURE_IMPORTS_START tslib,_Subscriber,_Observable,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  122862. function delayWhen(delayDurationSelector, subscriptionDelay) {
  122863. if (subscriptionDelay) {
  122864. return function (source) {
  122865. return new SubscriptionDelayObservable(source, subscriptionDelay)
  122866. .lift(new DelayWhenOperator(delayDurationSelector));
  122867. };
  122868. }
  122869. return function (source) { return source.lift(new DelayWhenOperator(delayDurationSelector)); };
  122870. }
  122871. var DelayWhenOperator = /*@__PURE__*/ (function () {
  122872. function DelayWhenOperator(delayDurationSelector) {
  122873. this.delayDurationSelector = delayDurationSelector;
  122874. }
  122875. DelayWhenOperator.prototype.call = function (subscriber, source) {
  122876. return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector));
  122877. };
  122878. return DelayWhenOperator;
  122879. }());
  122880. var DelayWhenSubscriber = /*@__PURE__*/ (function (_super) {
  122881. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DelayWhenSubscriber, _super);
  122882. function DelayWhenSubscriber(destination, delayDurationSelector) {
  122883. var _this = _super.call(this, destination) || this;
  122884. _this.delayDurationSelector = delayDurationSelector;
  122885. _this.completed = false;
  122886. _this.delayNotifierSubscriptions = [];
  122887. _this.index = 0;
  122888. return _this;
  122889. }
  122890. DelayWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  122891. this.destination.next(outerValue);
  122892. this.removeSubscription(innerSub);
  122893. this.tryComplete();
  122894. };
  122895. DelayWhenSubscriber.prototype.notifyError = function (error, innerSub) {
  122896. this._error(error);
  122897. };
  122898. DelayWhenSubscriber.prototype.notifyComplete = function (innerSub) {
  122899. var value = this.removeSubscription(innerSub);
  122900. if (value) {
  122901. this.destination.next(value);
  122902. }
  122903. this.tryComplete();
  122904. };
  122905. DelayWhenSubscriber.prototype._next = function (value) {
  122906. var index = this.index++;
  122907. try {
  122908. var delayNotifier = this.delayDurationSelector(value, index);
  122909. if (delayNotifier) {
  122910. this.tryDelay(delayNotifier, value);
  122911. }
  122912. }
  122913. catch (err) {
  122914. this.destination.error(err);
  122915. }
  122916. };
  122917. DelayWhenSubscriber.prototype._complete = function () {
  122918. this.completed = true;
  122919. this.tryComplete();
  122920. this.unsubscribe();
  122921. };
  122922. DelayWhenSubscriber.prototype.removeSubscription = function (subscription) {
  122923. subscription.unsubscribe();
  122924. var subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription);
  122925. if (subscriptionIdx !== -1) {
  122926. this.delayNotifierSubscriptions.splice(subscriptionIdx, 1);
  122927. }
  122928. return subscription.outerValue;
  122929. };
  122930. DelayWhenSubscriber.prototype.tryDelay = function (delayNotifier, value) {
  122931. var notifierSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, delayNotifier, value);
  122932. if (notifierSubscription && !notifierSubscription.closed) {
  122933. var destination = this.destination;
  122934. destination.add(notifierSubscription);
  122935. this.delayNotifierSubscriptions.push(notifierSubscription);
  122936. }
  122937. };
  122938. DelayWhenSubscriber.prototype.tryComplete = function () {
  122939. if (this.completed && this.delayNotifierSubscriptions.length === 0) {
  122940. this.destination.complete();
  122941. }
  122942. };
  122943. return DelayWhenSubscriber;
  122944. }(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
  122945. var SubscriptionDelayObservable = /*@__PURE__*/ (function (_super) {
  122946. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubscriptionDelayObservable, _super);
  122947. function SubscriptionDelayObservable(source, subscriptionDelay) {
  122948. var _this = _super.call(this) || this;
  122949. _this.source = source;
  122950. _this.subscriptionDelay = subscriptionDelay;
  122951. return _this;
  122952. }
  122953. SubscriptionDelayObservable.prototype._subscribe = function (subscriber) {
  122954. this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source));
  122955. };
  122956. return SubscriptionDelayObservable;
  122957. }(__WEBPACK_IMPORTED_MODULE_2__Observable__["a" /* Observable */]));
  122958. var SubscriptionDelaySubscriber = /*@__PURE__*/ (function (_super) {
  122959. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubscriptionDelaySubscriber, _super);
  122960. function SubscriptionDelaySubscriber(parent, source) {
  122961. var _this = _super.call(this) || this;
  122962. _this.parent = parent;
  122963. _this.source = source;
  122964. _this.sourceSubscribed = false;
  122965. return _this;
  122966. }
  122967. SubscriptionDelaySubscriber.prototype._next = function (unused) {
  122968. this.subscribeToSource();
  122969. };
  122970. SubscriptionDelaySubscriber.prototype._error = function (err) {
  122971. this.unsubscribe();
  122972. this.parent.error(err);
  122973. };
  122974. SubscriptionDelaySubscriber.prototype._complete = function () {
  122975. this.unsubscribe();
  122976. this.subscribeToSource();
  122977. };
  122978. SubscriptionDelaySubscriber.prototype.subscribeToSource = function () {
  122979. if (!this.sourceSubscribed) {
  122980. this.sourceSubscribed = true;
  122981. this.unsubscribe();
  122982. this.source.subscribe(this.parent);
  122983. }
  122984. };
  122985. return SubscriptionDelaySubscriber;
  122986. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  122987. //# sourceMappingURL=delayWhen.js.map
  122988. /***/ }),
  122989. /* 927 */
  122990. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  122991. "use strict";
  122992. /* harmony export (immutable) */ __webpack_exports__["a"] = dematerialize;
  122993. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  122994. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  122995. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  122996. function dematerialize() {
  122997. return function dematerializeOperatorFunction(source) {
  122998. return source.lift(new DeMaterializeOperator());
  122999. };
  123000. }
  123001. var DeMaterializeOperator = /*@__PURE__*/ (function () {
  123002. function DeMaterializeOperator() {
  123003. }
  123004. DeMaterializeOperator.prototype.call = function (subscriber, source) {
  123005. return source.subscribe(new DeMaterializeSubscriber(subscriber));
  123006. };
  123007. return DeMaterializeOperator;
  123008. }());
  123009. var DeMaterializeSubscriber = /*@__PURE__*/ (function (_super) {
  123010. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DeMaterializeSubscriber, _super);
  123011. function DeMaterializeSubscriber(destination) {
  123012. return _super.call(this, destination) || this;
  123013. }
  123014. DeMaterializeSubscriber.prototype._next = function (value) {
  123015. value.observe(this.destination);
  123016. };
  123017. return DeMaterializeSubscriber;
  123018. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  123019. //# sourceMappingURL=dematerialize.js.map
  123020. /***/ }),
  123021. /* 928 */
  123022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123023. "use strict";
  123024. /* harmony export (immutable) */ __webpack_exports__["a"] = distinct;
  123025. /* unused harmony export DistinctSubscriber */
  123026. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123027. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  123028. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
  123029. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  123030. function distinct(keySelector, flushes) {
  123031. return function (source) { return source.lift(new DistinctOperator(keySelector, flushes)); };
  123032. }
  123033. var DistinctOperator = /*@__PURE__*/ (function () {
  123034. function DistinctOperator(keySelector, flushes) {
  123035. this.keySelector = keySelector;
  123036. this.flushes = flushes;
  123037. }
  123038. DistinctOperator.prototype.call = function (subscriber, source) {
  123039. return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));
  123040. };
  123041. return DistinctOperator;
  123042. }());
  123043. var DistinctSubscriber = /*@__PURE__*/ (function (_super) {
  123044. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DistinctSubscriber, _super);
  123045. function DistinctSubscriber(destination, keySelector, flushes) {
  123046. var _this = _super.call(this, destination) || this;
  123047. _this.keySelector = keySelector;
  123048. _this.values = new Set();
  123049. if (flushes) {
  123050. _this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(_this, flushes));
  123051. }
  123052. return _this;
  123053. }
  123054. DistinctSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  123055. this.values.clear();
  123056. };
  123057. DistinctSubscriber.prototype.notifyError = function (error, innerSub) {
  123058. this._error(error);
  123059. };
  123060. DistinctSubscriber.prototype._next = function (value) {
  123061. if (this.keySelector) {
  123062. this._useKeySelector(value);
  123063. }
  123064. else {
  123065. this._finalizeNext(value, value);
  123066. }
  123067. };
  123068. DistinctSubscriber.prototype._useKeySelector = function (value) {
  123069. var key;
  123070. var destination = this.destination;
  123071. try {
  123072. key = this.keySelector(value);
  123073. }
  123074. catch (err) {
  123075. destination.error(err);
  123076. return;
  123077. }
  123078. this._finalizeNext(key, value);
  123079. };
  123080. DistinctSubscriber.prototype._finalizeNext = function (key, value) {
  123081. var values = this.values;
  123082. if (!values.has(key)) {
  123083. values.add(key);
  123084. this.destination.next(value);
  123085. }
  123086. };
  123087. return DistinctSubscriber;
  123088. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  123089. //# sourceMappingURL=distinct.js.map
  123090. /***/ }),
  123091. /* 929 */
  123092. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123093. "use strict";
  123094. /* harmony export (immutable) */ __webpack_exports__["a"] = distinctUntilKeyChanged;
  123095. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__distinctUntilChanged__ = __webpack_require__(401);
  123096. /** PURE_IMPORTS_START _distinctUntilChanged PURE_IMPORTS_END */
  123097. function distinctUntilKeyChanged(key, compare) {
  123098. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__distinctUntilChanged__["a" /* distinctUntilChanged */])(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });
  123099. }
  123100. //# sourceMappingURL=distinctUntilKeyChanged.js.map
  123101. /***/ }),
  123102. /* 930 */
  123103. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123104. "use strict";
  123105. /* harmony export (immutable) */ __webpack_exports__["a"] = elementAt;
  123106. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_ArgumentOutOfRangeError__ = __webpack_require__(141);
  123107. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(136);
  123108. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__throwIfEmpty__ = __webpack_require__(179);
  123109. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__ = __webpack_require__(135);
  123110. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__take__ = __webpack_require__(260);
  123111. /** PURE_IMPORTS_START _util_ArgumentOutOfRangeError,_filter,_throwIfEmpty,_defaultIfEmpty,_take PURE_IMPORTS_END */
  123112. function elementAt(index, defaultValue) {
  123113. if (index < 0) {
  123114. throw new __WEBPACK_IMPORTED_MODULE_0__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */]();
  123115. }
  123116. var hasDefaultValue = arguments.length >= 2;
  123117. return function (source) {
  123118. return source.pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(function (v, i) { return i === index; }), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__take__["a" /* take */])(1), hasDefaultValue
  123119. ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__["a" /* defaultIfEmpty */])(defaultValue)
  123120. : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__throwIfEmpty__["a" /* throwIfEmpty */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */](); }));
  123121. };
  123122. }
  123123. //# sourceMappingURL=elementAt.js.map
  123124. /***/ }),
  123125. /* 931 */
  123126. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123127. "use strict";
  123128. /* harmony export (immutable) */ __webpack_exports__["a"] = endWith;
  123129. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_fromArray__ = __webpack_require__(81);
  123130. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_scalar__ = __webpack_require__(253);
  123131. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_empty__ = __webpack_require__(46);
  123132. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_concat__ = __webpack_require__(177);
  123133. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isScheduler__ = __webpack_require__(56);
  123134. /** PURE_IMPORTS_START _observable_fromArray,_observable_scalar,_observable_empty,_observable_concat,_util_isScheduler PURE_IMPORTS_END */
  123135. function endWith() {
  123136. var array = [];
  123137. for (var _i = 0; _i < arguments.length; _i++) {
  123138. array[_i] = arguments[_i];
  123139. }
  123140. return function (source) {
  123141. var scheduler = array[array.length - 1];
  123142. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isScheduler__["a" /* isScheduler */])(scheduler)) {
  123143. array.pop();
  123144. }
  123145. else {
  123146. scheduler = null;
  123147. }
  123148. var len = array.length;
  123149. if (len === 1 && !scheduler) {
  123150. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(source, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_scalar__["a" /* scalar */])(array[0]));
  123151. }
  123152. else if (len > 0) {
  123153. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(source, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__observable_fromArray__["a" /* fromArray */])(array, scheduler));
  123154. }
  123155. else {
  123156. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(source, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_empty__["a" /* empty */])(scheduler));
  123157. }
  123158. };
  123159. }
  123160. //# sourceMappingURL=endWith.js.map
  123161. /***/ }),
  123162. /* 932 */
  123163. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123164. "use strict";
  123165. /* harmony export (immutable) */ __webpack_exports__["a"] = every;
  123166. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123167. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  123168. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  123169. function every(predicate, thisArg) {
  123170. return function (source) { return source.lift(new EveryOperator(predicate, thisArg, source)); };
  123171. }
  123172. var EveryOperator = /*@__PURE__*/ (function () {
  123173. function EveryOperator(predicate, thisArg, source) {
  123174. this.predicate = predicate;
  123175. this.thisArg = thisArg;
  123176. this.source = source;
  123177. }
  123178. EveryOperator.prototype.call = function (observer, source) {
  123179. return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));
  123180. };
  123181. return EveryOperator;
  123182. }());
  123183. var EverySubscriber = /*@__PURE__*/ (function (_super) {
  123184. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](EverySubscriber, _super);
  123185. function EverySubscriber(destination, predicate, thisArg, source) {
  123186. var _this = _super.call(this, destination) || this;
  123187. _this.predicate = predicate;
  123188. _this.thisArg = thisArg;
  123189. _this.source = source;
  123190. _this.index = 0;
  123191. _this.thisArg = thisArg || _this;
  123192. return _this;
  123193. }
  123194. EverySubscriber.prototype.notifyComplete = function (everyValueMatch) {
  123195. this.destination.next(everyValueMatch);
  123196. this.destination.complete();
  123197. };
  123198. EverySubscriber.prototype._next = function (value) {
  123199. var result = false;
  123200. try {
  123201. result = this.predicate.call(this.thisArg, value, this.index++, this.source);
  123202. }
  123203. catch (err) {
  123204. this.destination.error(err);
  123205. return;
  123206. }
  123207. if (!result) {
  123208. this.notifyComplete(false);
  123209. }
  123210. };
  123211. EverySubscriber.prototype._complete = function () {
  123212. this.notifyComplete(true);
  123213. };
  123214. return EverySubscriber;
  123215. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  123216. //# sourceMappingURL=every.js.map
  123217. /***/ }),
  123218. /* 933 */
  123219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123220. "use strict";
  123221. /* harmony export (immutable) */ __webpack_exports__["a"] = exhaust;
  123222. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123223. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  123224. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
  123225. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  123226. function exhaust() {
  123227. return function (source) { return source.lift(new SwitchFirstOperator()); };
  123228. }
  123229. var SwitchFirstOperator = /*@__PURE__*/ (function () {
  123230. function SwitchFirstOperator() {
  123231. }
  123232. SwitchFirstOperator.prototype.call = function (subscriber, source) {
  123233. return source.subscribe(new SwitchFirstSubscriber(subscriber));
  123234. };
  123235. return SwitchFirstOperator;
  123236. }());
  123237. var SwitchFirstSubscriber = /*@__PURE__*/ (function (_super) {
  123238. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SwitchFirstSubscriber, _super);
  123239. function SwitchFirstSubscriber(destination) {
  123240. var _this = _super.call(this, destination) || this;
  123241. _this.hasCompleted = false;
  123242. _this.hasSubscription = false;
  123243. return _this;
  123244. }
  123245. SwitchFirstSubscriber.prototype._next = function (value) {
  123246. if (!this.hasSubscription) {
  123247. this.hasSubscription = true;
  123248. this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(this, value));
  123249. }
  123250. };
  123251. SwitchFirstSubscriber.prototype._complete = function () {
  123252. this.hasCompleted = true;
  123253. if (!this.hasSubscription) {
  123254. this.destination.complete();
  123255. }
  123256. };
  123257. SwitchFirstSubscriber.prototype.notifyComplete = function (innerSub) {
  123258. this.remove(innerSub);
  123259. this.hasSubscription = false;
  123260. if (this.hasCompleted) {
  123261. this.destination.complete();
  123262. }
  123263. };
  123264. return SwitchFirstSubscriber;
  123265. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  123266. //# sourceMappingURL=exhaust.js.map
  123267. /***/ }),
  123268. /* 934 */
  123269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123270. "use strict";
  123271. /* harmony export (immutable) */ __webpack_exports__["a"] = exhaustMap;
  123272. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123273. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  123274. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(80);
  123275. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
  123276. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(54);
  123277. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(64);
  123278. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */
  123279. function exhaustMap(project, resultSelector) {
  123280. if (resultSelector) {
  123281. return function (source) { return source.pipe(exhaustMap(function (a, i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__observable_from__["a" /* from */])(project(a, i)).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__map__["a" /* map */])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
  123282. }
  123283. return function (source) {
  123284. return source.lift(new ExhauseMapOperator(project));
  123285. };
  123286. }
  123287. var ExhauseMapOperator = /*@__PURE__*/ (function () {
  123288. function ExhauseMapOperator(project) {
  123289. this.project = project;
  123290. }
  123291. ExhauseMapOperator.prototype.call = function (subscriber, source) {
  123292. return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));
  123293. };
  123294. return ExhauseMapOperator;
  123295. }());
  123296. var ExhaustMapSubscriber = /*@__PURE__*/ (function (_super) {
  123297. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ExhaustMapSubscriber, _super);
  123298. function ExhaustMapSubscriber(destination, project) {
  123299. var _this = _super.call(this, destination) || this;
  123300. _this.project = project;
  123301. _this.hasSubscription = false;
  123302. _this.hasCompleted = false;
  123303. _this.index = 0;
  123304. return _this;
  123305. }
  123306. ExhaustMapSubscriber.prototype._next = function (value) {
  123307. if (!this.hasSubscription) {
  123308. this.tryNext(value);
  123309. }
  123310. };
  123311. ExhaustMapSubscriber.prototype.tryNext = function (value) {
  123312. var result;
  123313. var index = this.index++;
  123314. try {
  123315. result = this.project(value, index);
  123316. }
  123317. catch (err) {
  123318. this.destination.error(err);
  123319. return;
  123320. }
  123321. this.hasSubscription = true;
  123322. this._innerSub(result, value, index);
  123323. };
  123324. ExhaustMapSubscriber.prototype._innerSub = function (result, value, index) {
  123325. var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
  123326. var destination = this.destination;
  123327. destination.add(innerSubscriber);
  123328. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, value, index, innerSubscriber);
  123329. };
  123330. ExhaustMapSubscriber.prototype._complete = function () {
  123331. this.hasCompleted = true;
  123332. if (!this.hasSubscription) {
  123333. this.destination.complete();
  123334. }
  123335. this.unsubscribe();
  123336. };
  123337. ExhaustMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  123338. this.destination.next(innerValue);
  123339. };
  123340. ExhaustMapSubscriber.prototype.notifyError = function (err) {
  123341. this.destination.error(err);
  123342. };
  123343. ExhaustMapSubscriber.prototype.notifyComplete = function (innerSub) {
  123344. var destination = this.destination;
  123345. destination.remove(innerSub);
  123346. this.hasSubscription = false;
  123347. if (this.hasCompleted) {
  123348. this.destination.complete();
  123349. }
  123350. };
  123351. return ExhaustMapSubscriber;
  123352. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  123353. //# sourceMappingURL=exhaustMap.js.map
  123354. /***/ }),
  123355. /* 935 */
  123356. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123357. "use strict";
  123358. /* harmony export (immutable) */ __webpack_exports__["a"] = expand;
  123359. /* unused harmony export ExpandOperator */
  123360. /* unused harmony export ExpandSubscriber */
  123361. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123362. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_tryCatch__ = __webpack_require__(59);
  123363. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_errorObject__ = __webpack_require__(55);
  123364. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
  123365. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
  123366. /** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  123367. function expand(project, concurrent, scheduler) {
  123368. if (concurrent === void 0) {
  123369. concurrent = Number.POSITIVE_INFINITY;
  123370. }
  123371. if (scheduler === void 0) {
  123372. scheduler = undefined;
  123373. }
  123374. concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent;
  123375. return function (source) { return source.lift(new ExpandOperator(project, concurrent, scheduler)); };
  123376. }
  123377. var ExpandOperator = /*@__PURE__*/ (function () {
  123378. function ExpandOperator(project, concurrent, scheduler) {
  123379. this.project = project;
  123380. this.concurrent = concurrent;
  123381. this.scheduler = scheduler;
  123382. }
  123383. ExpandOperator.prototype.call = function (subscriber, source) {
  123384. return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler));
  123385. };
  123386. return ExpandOperator;
  123387. }());
  123388. var ExpandSubscriber = /*@__PURE__*/ (function (_super) {
  123389. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ExpandSubscriber, _super);
  123390. function ExpandSubscriber(destination, project, concurrent, scheduler) {
  123391. var _this = _super.call(this, destination) || this;
  123392. _this.project = project;
  123393. _this.concurrent = concurrent;
  123394. _this.scheduler = scheduler;
  123395. _this.index = 0;
  123396. _this.active = 0;
  123397. _this.hasCompleted = false;
  123398. if (concurrent < Number.POSITIVE_INFINITY) {
  123399. _this.buffer = [];
  123400. }
  123401. return _this;
  123402. }
  123403. ExpandSubscriber.dispatch = function (arg) {
  123404. var subscriber = arg.subscriber, result = arg.result, value = arg.value, index = arg.index;
  123405. subscriber.subscribeToProjection(result, value, index);
  123406. };
  123407. ExpandSubscriber.prototype._next = function (value) {
  123408. var destination = this.destination;
  123409. if (destination.closed) {
  123410. this._complete();
  123411. return;
  123412. }
  123413. var index = this.index++;
  123414. if (this.active < this.concurrent) {
  123415. destination.next(value);
  123416. var result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_tryCatch__["a" /* tryCatch */])(this.project)(value, index);
  123417. if (result === __WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */]) {
  123418. destination.error(__WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */].e);
  123419. }
  123420. else if (!this.scheduler) {
  123421. this.subscribeToProjection(result, value, index);
  123422. }
  123423. else {
  123424. var state = { subscriber: this, result: result, value: value, index: index };
  123425. var destination_1 = this.destination;
  123426. destination_1.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state));
  123427. }
  123428. }
  123429. else {
  123430. this.buffer.push(value);
  123431. }
  123432. };
  123433. ExpandSubscriber.prototype.subscribeToProjection = function (result, value, index) {
  123434. this.active++;
  123435. var destination = this.destination;
  123436. destination.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, value, index));
  123437. };
  123438. ExpandSubscriber.prototype._complete = function () {
  123439. this.hasCompleted = true;
  123440. if (this.hasCompleted && this.active === 0) {
  123441. this.destination.complete();
  123442. }
  123443. this.unsubscribe();
  123444. };
  123445. ExpandSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  123446. this._next(innerValue);
  123447. };
  123448. ExpandSubscriber.prototype.notifyComplete = function (innerSub) {
  123449. var buffer = this.buffer;
  123450. var destination = this.destination;
  123451. destination.remove(innerSub);
  123452. this.active--;
  123453. if (buffer && buffer.length > 0) {
  123454. this._next(buffer.shift());
  123455. }
  123456. if (this.hasCompleted && this.active === 0) {
  123457. this.destination.complete();
  123458. }
  123459. };
  123460. return ExpandSubscriber;
  123461. }(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
  123462. //# sourceMappingURL=expand.js.map
  123463. /***/ }),
  123464. /* 936 */
  123465. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123466. "use strict";
  123467. /* harmony export (immutable) */ __webpack_exports__["a"] = finalize;
  123468. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123469. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  123470. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(31);
  123471. /** PURE_IMPORTS_START tslib,_Subscriber,_Subscription PURE_IMPORTS_END */
  123472. function finalize(callback) {
  123473. return function (source) { return source.lift(new FinallyOperator(callback)); };
  123474. }
  123475. var FinallyOperator = /*@__PURE__*/ (function () {
  123476. function FinallyOperator(callback) {
  123477. this.callback = callback;
  123478. }
  123479. FinallyOperator.prototype.call = function (subscriber, source) {
  123480. return source.subscribe(new FinallySubscriber(subscriber, this.callback));
  123481. };
  123482. return FinallyOperator;
  123483. }());
  123484. var FinallySubscriber = /*@__PURE__*/ (function (_super) {
  123485. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](FinallySubscriber, _super);
  123486. function FinallySubscriber(destination, callback) {
  123487. var _this = _super.call(this, destination) || this;
  123488. _this.add(new __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */](callback));
  123489. return _this;
  123490. }
  123491. return FinallySubscriber;
  123492. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  123493. //# sourceMappingURL=finalize.js.map
  123494. /***/ }),
  123495. /* 937 */
  123496. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123497. "use strict";
  123498. /* harmony export (immutable) */ __webpack_exports__["a"] = findIndex;
  123499. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__operators_find__ = __webpack_require__(402);
  123500. /** PURE_IMPORTS_START _operators_find PURE_IMPORTS_END */
  123501. function findIndex(predicate, thisArg) {
  123502. return function (source) { return source.lift(new __WEBPACK_IMPORTED_MODULE_0__operators_find__["b" /* FindValueOperator */](predicate, source, true, thisArg)); };
  123503. }
  123504. //# sourceMappingURL=findIndex.js.map
  123505. /***/ }),
  123506. /* 938 */
  123507. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123508. "use strict";
  123509. /* harmony export (immutable) */ __webpack_exports__["a"] = first;
  123510. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__ = __webpack_require__(142);
  123511. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(136);
  123512. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__take__ = __webpack_require__(260);
  123513. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__ = __webpack_require__(135);
  123514. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__throwIfEmpty__ = __webpack_require__(179);
  123515. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_identity__ = __webpack_require__(113);
  123516. /** PURE_IMPORTS_START _util_EmptyError,_filter,_take,_defaultIfEmpty,_throwIfEmpty,_util_identity PURE_IMPORTS_END */
  123517. function first(predicate, defaultValue) {
  123518. var hasDefaultValue = arguments.length >= 2;
  123519. return function (source) { return source.pipe(predicate ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(function (v, i) { return predicate(v, i, source); }) : __WEBPACK_IMPORTED_MODULE_5__util_identity__["a" /* identity */], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__take__["a" /* take */])(1), hasDefaultValue ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__["a" /* defaultIfEmpty */])(defaultValue) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__throwIfEmpty__["a" /* throwIfEmpty */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__["a" /* EmptyError */](); })); };
  123520. }
  123521. //# sourceMappingURL=first.js.map
  123522. /***/ }),
  123523. /* 939 */
  123524. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123525. "use strict";
  123526. /* harmony export (immutable) */ __webpack_exports__["a"] = ignoreElements;
  123527. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123528. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  123529. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  123530. function ignoreElements() {
  123531. return function ignoreElementsOperatorFunction(source) {
  123532. return source.lift(new IgnoreElementsOperator());
  123533. };
  123534. }
  123535. var IgnoreElementsOperator = /*@__PURE__*/ (function () {
  123536. function IgnoreElementsOperator() {
  123537. }
  123538. IgnoreElementsOperator.prototype.call = function (subscriber, source) {
  123539. return source.subscribe(new IgnoreElementsSubscriber(subscriber));
  123540. };
  123541. return IgnoreElementsOperator;
  123542. }());
  123543. var IgnoreElementsSubscriber = /*@__PURE__*/ (function (_super) {
  123544. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](IgnoreElementsSubscriber, _super);
  123545. function IgnoreElementsSubscriber() {
  123546. return _super !== null && _super.apply(this, arguments) || this;
  123547. }
  123548. IgnoreElementsSubscriber.prototype._next = function (unused) {
  123549. };
  123550. return IgnoreElementsSubscriber;
  123551. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  123552. //# sourceMappingURL=ignoreElements.js.map
  123553. /***/ }),
  123554. /* 940 */
  123555. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123556. "use strict";
  123557. /* harmony export (immutable) */ __webpack_exports__["a"] = isEmpty;
  123558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  123560. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  123561. function isEmpty() {
  123562. return function (source) { return source.lift(new IsEmptyOperator()); };
  123563. }
  123564. var IsEmptyOperator = /*@__PURE__*/ (function () {
  123565. function IsEmptyOperator() {
  123566. }
  123567. IsEmptyOperator.prototype.call = function (observer, source) {
  123568. return source.subscribe(new IsEmptySubscriber(observer));
  123569. };
  123570. return IsEmptyOperator;
  123571. }());
  123572. var IsEmptySubscriber = /*@__PURE__*/ (function (_super) {
  123573. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](IsEmptySubscriber, _super);
  123574. function IsEmptySubscriber(destination) {
  123575. return _super.call(this, destination) || this;
  123576. }
  123577. IsEmptySubscriber.prototype.notifyComplete = function (isEmpty) {
  123578. var destination = this.destination;
  123579. destination.next(isEmpty);
  123580. destination.complete();
  123581. };
  123582. IsEmptySubscriber.prototype._next = function (value) {
  123583. this.notifyComplete(false);
  123584. };
  123585. IsEmptySubscriber.prototype._complete = function () {
  123586. this.notifyComplete(true);
  123587. };
  123588. return IsEmptySubscriber;
  123589. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  123590. //# sourceMappingURL=isEmpty.js.map
  123591. /***/ }),
  123592. /* 941 */
  123593. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123594. "use strict";
  123595. /* harmony export (immutable) */ __webpack_exports__["a"] = last;
  123596. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__ = __webpack_require__(142);
  123597. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(136);
  123598. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__takeLast__ = __webpack_require__(261);
  123599. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__throwIfEmpty__ = __webpack_require__(179);
  123600. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__defaultIfEmpty__ = __webpack_require__(135);
  123601. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_identity__ = __webpack_require__(113);
  123602. /** PURE_IMPORTS_START _util_EmptyError,_filter,_takeLast,_throwIfEmpty,_defaultIfEmpty,_util_identity PURE_IMPORTS_END */
  123603. function last(predicate, defaultValue) {
  123604. var hasDefaultValue = arguments.length >= 2;
  123605. return function (source) { return source.pipe(predicate ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(function (v, i) { return predicate(v, i, source); }) : __WEBPACK_IMPORTED_MODULE_5__util_identity__["a" /* identity */], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__takeLast__["a" /* takeLast */])(1), hasDefaultValue ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__defaultIfEmpty__["a" /* defaultIfEmpty */])(defaultValue) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__throwIfEmpty__["a" /* throwIfEmpty */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__["a" /* EmptyError */](); })); };
  123606. }
  123607. //# sourceMappingURL=last.js.map
  123608. /***/ }),
  123609. /* 942 */
  123610. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123611. "use strict";
  123612. /* harmony export (immutable) */ __webpack_exports__["a"] = mapTo;
  123613. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123614. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  123615. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  123616. function mapTo(value) {
  123617. return function (source) { return source.lift(new MapToOperator(value)); };
  123618. }
  123619. var MapToOperator = /*@__PURE__*/ (function () {
  123620. function MapToOperator(value) {
  123621. this.value = value;
  123622. }
  123623. MapToOperator.prototype.call = function (subscriber, source) {
  123624. return source.subscribe(new MapToSubscriber(subscriber, this.value));
  123625. };
  123626. return MapToOperator;
  123627. }());
  123628. var MapToSubscriber = /*@__PURE__*/ (function (_super) {
  123629. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MapToSubscriber, _super);
  123630. function MapToSubscriber(destination, value) {
  123631. var _this = _super.call(this, destination) || this;
  123632. _this.value = value;
  123633. return _this;
  123634. }
  123635. MapToSubscriber.prototype._next = function (x) {
  123636. this.destination.next(this.value);
  123637. };
  123638. return MapToSubscriber;
  123639. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  123640. //# sourceMappingURL=mapTo.js.map
  123641. /***/ }),
  123642. /* 943 */
  123643. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123644. "use strict";
  123645. /* harmony export (immutable) */ __webpack_exports__["a"] = materialize;
  123646. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123647. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  123648. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Notification__ = __webpack_require__(175);
  123649. /** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */
  123650. function materialize() {
  123651. return function materializeOperatorFunction(source) {
  123652. return source.lift(new MaterializeOperator());
  123653. };
  123654. }
  123655. var MaterializeOperator = /*@__PURE__*/ (function () {
  123656. function MaterializeOperator() {
  123657. }
  123658. MaterializeOperator.prototype.call = function (subscriber, source) {
  123659. return source.subscribe(new MaterializeSubscriber(subscriber));
  123660. };
  123661. return MaterializeOperator;
  123662. }());
  123663. var MaterializeSubscriber = /*@__PURE__*/ (function (_super) {
  123664. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MaterializeSubscriber, _super);
  123665. function MaterializeSubscriber(destination) {
  123666. return _super.call(this, destination) || this;
  123667. }
  123668. MaterializeSubscriber.prototype._next = function (value) {
  123669. this.destination.next(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createNext(value));
  123670. };
  123671. MaterializeSubscriber.prototype._error = function (err) {
  123672. var destination = this.destination;
  123673. destination.next(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createError(err));
  123674. destination.complete();
  123675. };
  123676. MaterializeSubscriber.prototype._complete = function () {
  123677. var destination = this.destination;
  123678. destination.next(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createComplete());
  123679. destination.complete();
  123680. };
  123681. return MaterializeSubscriber;
  123682. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  123683. //# sourceMappingURL=materialize.js.map
  123684. /***/ }),
  123685. /* 944 */
  123686. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123687. "use strict";
  123688. /* harmony export (immutable) */ __webpack_exports__["a"] = max;
  123689. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__reduce__ = __webpack_require__(178);
  123690. /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
  123691. function max(comparer) {
  123692. var max = (typeof comparer === 'function')
  123693. ? function (x, y) { return comparer(x, y) > 0 ? x : y; }
  123694. : function (x, y) { return x > y ? x : y; };
  123695. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__reduce__["a" /* reduce */])(max);
  123696. }
  123697. //# sourceMappingURL=max.js.map
  123698. /***/ }),
  123699. /* 945 */
  123700. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123701. "use strict";
  123702. /* harmony export (immutable) */ __webpack_exports__["a"] = merge;
  123703. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_merge__ = __webpack_require__(394);
  123704. /** PURE_IMPORTS_START _observable_merge PURE_IMPORTS_END */
  123705. function merge() {
  123706. var observables = [];
  123707. for (var _i = 0; _i < arguments.length; _i++) {
  123708. observables[_i] = arguments[_i];
  123709. }
  123710. return function (source) { return source.lift.call(__WEBPACK_IMPORTED_MODULE_0__observable_merge__["a" /* merge */].apply(void 0, [source].concat(observables))); };
  123711. }
  123712. //# sourceMappingURL=merge.js.map
  123713. /***/ }),
  123714. /* 946 */
  123715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123716. "use strict";
  123717. /* harmony export (immutable) */ __webpack_exports__["a"] = mergeMapTo;
  123718. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeMap__ = __webpack_require__(137);
  123719. /** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */
  123720. function mergeMapTo(innerObservable, resultSelector, concurrent) {
  123721. if (concurrent === void 0) {
  123722. concurrent = Number.POSITIVE_INFINITY;
  123723. }
  123724. if (typeof resultSelector === 'function') {
  123725. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(function () { return innerObservable; }, resultSelector, concurrent);
  123726. }
  123727. if (typeof resultSelector === 'number') {
  123728. concurrent = resultSelector;
  123729. }
  123730. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(function () { return innerObservable; }, concurrent);
  123731. }
  123732. //# sourceMappingURL=mergeMapTo.js.map
  123733. /***/ }),
  123734. /* 947 */
  123735. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123736. "use strict";
  123737. /* harmony export (immutable) */ __webpack_exports__["a"] = mergeScan;
  123738. /* unused harmony export MergeScanOperator */
  123739. /* unused harmony export MergeScanSubscriber */
  123740. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123741. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_tryCatch__ = __webpack_require__(59);
  123742. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_errorObject__ = __webpack_require__(55);
  123743. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
  123744. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
  123745. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__InnerSubscriber__ = __webpack_require__(80);
  123746. /** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber PURE_IMPORTS_END */
  123747. function mergeScan(accumulator, seed, concurrent) {
  123748. if (concurrent === void 0) {
  123749. concurrent = Number.POSITIVE_INFINITY;
  123750. }
  123751. return function (source) { return source.lift(new MergeScanOperator(accumulator, seed, concurrent)); };
  123752. }
  123753. var MergeScanOperator = /*@__PURE__*/ (function () {
  123754. function MergeScanOperator(accumulator, seed, concurrent) {
  123755. this.accumulator = accumulator;
  123756. this.seed = seed;
  123757. this.concurrent = concurrent;
  123758. }
  123759. MergeScanOperator.prototype.call = function (subscriber, source) {
  123760. return source.subscribe(new MergeScanSubscriber(subscriber, this.accumulator, this.seed, this.concurrent));
  123761. };
  123762. return MergeScanOperator;
  123763. }());
  123764. var MergeScanSubscriber = /*@__PURE__*/ (function (_super) {
  123765. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MergeScanSubscriber, _super);
  123766. function MergeScanSubscriber(destination, accumulator, acc, concurrent) {
  123767. var _this = _super.call(this, destination) || this;
  123768. _this.accumulator = accumulator;
  123769. _this.acc = acc;
  123770. _this.concurrent = concurrent;
  123771. _this.hasValue = false;
  123772. _this.hasCompleted = false;
  123773. _this.buffer = [];
  123774. _this.active = 0;
  123775. _this.index = 0;
  123776. return _this;
  123777. }
  123778. MergeScanSubscriber.prototype._next = function (value) {
  123779. if (this.active < this.concurrent) {
  123780. var index = this.index++;
  123781. var ish = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_tryCatch__["a" /* tryCatch */])(this.accumulator)(this.acc, value);
  123782. var destination = this.destination;
  123783. if (ish === __WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */]) {
  123784. destination.error(__WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */].e);
  123785. }
  123786. else {
  123787. this.active++;
  123788. this._innerSub(ish, value, index);
  123789. }
  123790. }
  123791. else {
  123792. this.buffer.push(value);
  123793. }
  123794. };
  123795. MergeScanSubscriber.prototype._innerSub = function (ish, value, index) {
  123796. var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_5__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
  123797. var destination = this.destination;
  123798. destination.add(innerSubscriber);
  123799. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, ish, value, index, innerSubscriber);
  123800. };
  123801. MergeScanSubscriber.prototype._complete = function () {
  123802. this.hasCompleted = true;
  123803. if (this.active === 0 && this.buffer.length === 0) {
  123804. if (this.hasValue === false) {
  123805. this.destination.next(this.acc);
  123806. }
  123807. this.destination.complete();
  123808. }
  123809. this.unsubscribe();
  123810. };
  123811. MergeScanSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  123812. var destination = this.destination;
  123813. this.acc = innerValue;
  123814. this.hasValue = true;
  123815. destination.next(innerValue);
  123816. };
  123817. MergeScanSubscriber.prototype.notifyComplete = function (innerSub) {
  123818. var buffer = this.buffer;
  123819. var destination = this.destination;
  123820. destination.remove(innerSub);
  123821. this.active--;
  123822. if (buffer.length > 0) {
  123823. this._next(buffer.shift());
  123824. }
  123825. else if (this.active === 0 && this.hasCompleted) {
  123826. if (this.hasValue === false) {
  123827. this.destination.next(this.acc);
  123828. }
  123829. this.destination.complete();
  123830. }
  123831. };
  123832. return MergeScanSubscriber;
  123833. }(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
  123834. //# sourceMappingURL=mergeScan.js.map
  123835. /***/ }),
  123836. /* 948 */
  123837. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123838. "use strict";
  123839. /* harmony export (immutable) */ __webpack_exports__["a"] = min;
  123840. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__reduce__ = __webpack_require__(178);
  123841. /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
  123842. function min(comparer) {
  123843. var min = (typeof comparer === 'function')
  123844. ? function (x, y) { return comparer(x, y) < 0 ? x : y; }
  123845. : function (x, y) { return x < y ? x : y; };
  123846. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__reduce__["a" /* reduce */])(min);
  123847. }
  123848. //# sourceMappingURL=min.js.map
  123849. /***/ }),
  123850. /* 949 */
  123851. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123852. "use strict";
  123853. /* harmony export (immutable) */ __webpack_exports__["a"] = onErrorResumeNext;
  123854. /* unused harmony export onErrorResumeNextStatic */
  123855. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123856. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_from__ = __webpack_require__(64);
  123857. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48);
  123858. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
  123859. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__InnerSubscriber__ = __webpack_require__(80);
  123860. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
  123861. /** PURE_IMPORTS_START tslib,_observable_from,_util_isArray,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  123862. function onErrorResumeNext() {
  123863. var nextSources = [];
  123864. for (var _i = 0; _i < arguments.length; _i++) {
  123865. nextSources[_i] = arguments[_i];
  123866. }
  123867. if (nextSources.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(nextSources[0])) {
  123868. nextSources = nextSources[0];
  123869. }
  123870. return function (source) { return source.lift(new OnErrorResumeNextOperator(nextSources)); };
  123871. }
  123872. function onErrorResumeNextStatic() {
  123873. var nextSources = [];
  123874. for (var _i = 0; _i < arguments.length; _i++) {
  123875. nextSources[_i] = arguments[_i];
  123876. }
  123877. var source = null;
  123878. if (nextSources.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(nextSources[0])) {
  123879. nextSources = nextSources[0];
  123880. }
  123881. source = nextSources.shift();
  123882. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_from__["a" /* from */])(source, null).lift(new OnErrorResumeNextOperator(nextSources));
  123883. }
  123884. var OnErrorResumeNextOperator = /*@__PURE__*/ (function () {
  123885. function OnErrorResumeNextOperator(nextSources) {
  123886. this.nextSources = nextSources;
  123887. }
  123888. OnErrorResumeNextOperator.prototype.call = function (subscriber, source) {
  123889. return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));
  123890. };
  123891. return OnErrorResumeNextOperator;
  123892. }());
  123893. var OnErrorResumeNextSubscriber = /*@__PURE__*/ (function (_super) {
  123894. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](OnErrorResumeNextSubscriber, _super);
  123895. function OnErrorResumeNextSubscriber(destination, nextSources) {
  123896. var _this = _super.call(this, destination) || this;
  123897. _this.destination = destination;
  123898. _this.nextSources = nextSources;
  123899. return _this;
  123900. }
  123901. OnErrorResumeNextSubscriber.prototype.notifyError = function (error, innerSub) {
  123902. this.subscribeToNextSource();
  123903. };
  123904. OnErrorResumeNextSubscriber.prototype.notifyComplete = function (innerSub) {
  123905. this.subscribeToNextSource();
  123906. };
  123907. OnErrorResumeNextSubscriber.prototype._error = function (err) {
  123908. this.subscribeToNextSource();
  123909. this.unsubscribe();
  123910. };
  123911. OnErrorResumeNextSubscriber.prototype._complete = function () {
  123912. this.subscribeToNextSource();
  123913. this.unsubscribe();
  123914. };
  123915. OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () {
  123916. var next = this.nextSources.shift();
  123917. if (next) {
  123918. var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_4__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
  123919. var destination = this.destination;
  123920. destination.add(innerSubscriber);
  123921. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, next, undefined, undefined, innerSubscriber);
  123922. }
  123923. else {
  123924. this.destination.complete();
  123925. }
  123926. };
  123927. return OnErrorResumeNextSubscriber;
  123928. }(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
  123929. //# sourceMappingURL=onErrorResumeNext.js.map
  123930. /***/ }),
  123931. /* 950 */
  123932. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123933. "use strict";
  123934. /* harmony export (immutable) */ __webpack_exports__["a"] = pairwise;
  123935. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  123936. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  123937. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  123938. function pairwise() {
  123939. return function (source) { return source.lift(new PairwiseOperator()); };
  123940. }
  123941. var PairwiseOperator = /*@__PURE__*/ (function () {
  123942. function PairwiseOperator() {
  123943. }
  123944. PairwiseOperator.prototype.call = function (subscriber, source) {
  123945. return source.subscribe(new PairwiseSubscriber(subscriber));
  123946. };
  123947. return PairwiseOperator;
  123948. }());
  123949. var PairwiseSubscriber = /*@__PURE__*/ (function (_super) {
  123950. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](PairwiseSubscriber, _super);
  123951. function PairwiseSubscriber(destination) {
  123952. var _this = _super.call(this, destination) || this;
  123953. _this.hasPrev = false;
  123954. return _this;
  123955. }
  123956. PairwiseSubscriber.prototype._next = function (value) {
  123957. if (this.hasPrev) {
  123958. this.destination.next([this.prev, value]);
  123959. }
  123960. else {
  123961. this.hasPrev = true;
  123962. }
  123963. this.prev = value;
  123964. };
  123965. return PairwiseSubscriber;
  123966. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  123967. //# sourceMappingURL=pairwise.js.map
  123968. /***/ }),
  123969. /* 951 */
  123970. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123971. "use strict";
  123972. /* harmony export (immutable) */ __webpack_exports__["a"] = partition;
  123973. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_not__ = __webpack_require__(1004);
  123974. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(136);
  123975. /** PURE_IMPORTS_START _util_not,_filter PURE_IMPORTS_END */
  123976. function partition(predicate, thisArg) {
  123977. return function (source) {
  123978. return [
  123979. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(predicate, thisArg)(source),
  123980. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_not__["a" /* not */])(predicate, thisArg))(source)
  123981. ];
  123982. };
  123983. }
  123984. //# sourceMappingURL=partition.js.map
  123985. /***/ }),
  123986. /* 952 */
  123987. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  123988. "use strict";
  123989. /* harmony export (immutable) */ __webpack_exports__["a"] = pluck;
  123990. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__map__ = __webpack_require__(54);
  123991. /** PURE_IMPORTS_START _map PURE_IMPORTS_END */
  123992. function pluck() {
  123993. var properties = [];
  123994. for (var _i = 0; _i < arguments.length; _i++) {
  123995. properties[_i] = arguments[_i];
  123996. }
  123997. var length = properties.length;
  123998. if (length === 0) {
  123999. throw new Error('list of properties cannot be empty.');
  124000. }
  124001. return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__map__["a" /* map */])(plucker(properties, length))(source); };
  124002. }
  124003. function plucker(props, length) {
  124004. var mapper = function (x) {
  124005. var currentProp = x;
  124006. for (var i = 0; i < length; i++) {
  124007. var p = currentProp[props[i]];
  124008. if (typeof p !== 'undefined') {
  124009. currentProp = p;
  124010. }
  124011. else {
  124012. return undefined;
  124013. }
  124014. }
  124015. return currentProp;
  124016. };
  124017. return mapper;
  124018. }
  124019. //# sourceMappingURL=pluck.js.map
  124020. /***/ }),
  124021. /* 953 */
  124022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124023. "use strict";
  124024. /* harmony export (immutable) */ __webpack_exports__["a"] = publish;
  124025. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Subject__ = __webpack_require__(43);
  124026. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(111);
  124027. /** PURE_IMPORTS_START _Subject,_multicast PURE_IMPORTS_END */
  124028. function publish(selector) {
  124029. return selector ?
  124030. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__Subject__["a" /* Subject */](); }, selector) :
  124031. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(new __WEBPACK_IMPORTED_MODULE_0__Subject__["a" /* Subject */]());
  124032. }
  124033. //# sourceMappingURL=publish.js.map
  124034. /***/ }),
  124035. /* 954 */
  124036. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124037. "use strict";
  124038. /* harmony export (immutable) */ __webpack_exports__["a"] = publishBehavior;
  124039. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BehaviorSubject__ = __webpack_require__(389);
  124040. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(111);
  124041. /** PURE_IMPORTS_START _BehaviorSubject,_multicast PURE_IMPORTS_END */
  124042. function publishBehavior(value) {
  124043. return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(new __WEBPACK_IMPORTED_MODULE_0__BehaviorSubject__["a" /* BehaviorSubject */](value))(source); };
  124044. }
  124045. //# sourceMappingURL=publishBehavior.js.map
  124046. /***/ }),
  124047. /* 955 */
  124048. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124049. "use strict";
  124050. /* harmony export (immutable) */ __webpack_exports__["a"] = publishLast;
  124051. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AsyncSubject__ = __webpack_require__(174);
  124052. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(111);
  124053. /** PURE_IMPORTS_START _AsyncSubject,_multicast PURE_IMPORTS_END */
  124054. function publishLast() {
  124055. return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(new __WEBPACK_IMPORTED_MODULE_0__AsyncSubject__["a" /* AsyncSubject */]())(source); };
  124056. }
  124057. //# sourceMappingURL=publishLast.js.map
  124058. /***/ }),
  124059. /* 956 */
  124060. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124061. "use strict";
  124062. /* harmony export (immutable) */ __webpack_exports__["a"] = publishReplay;
  124063. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__ = __webpack_require__(249);
  124064. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(111);
  124065. /** PURE_IMPORTS_START _ReplaySubject,_multicast PURE_IMPORTS_END */
  124066. function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) {
  124067. if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {
  124068. scheduler = selectorOrScheduler;
  124069. }
  124070. var selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;
  124071. var subject = new __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__["a" /* ReplaySubject */](bufferSize, windowTime, scheduler);
  124072. return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(function () { return subject; }, selector)(source); };
  124073. }
  124074. //# sourceMappingURL=publishReplay.js.map
  124075. /***/ }),
  124076. /* 957 */
  124077. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124078. "use strict";
  124079. /* harmony export (immutable) */ __webpack_exports__["a"] = race;
  124080. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(48);
  124081. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_race__ = __webpack_require__(396);
  124082. /** PURE_IMPORTS_START _util_isArray,_observable_race PURE_IMPORTS_END */
  124083. function race() {
  124084. var observables = [];
  124085. for (var _i = 0; _i < arguments.length; _i++) {
  124086. observables[_i] = arguments[_i];
  124087. }
  124088. return function raceOperatorFunction(source) {
  124089. if (observables.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(observables[0])) {
  124090. observables = observables[0];
  124091. }
  124092. return source.lift.call(__WEBPACK_IMPORTED_MODULE_1__observable_race__["a" /* race */].apply(void 0, [source].concat(observables)));
  124093. };
  124094. }
  124095. //# sourceMappingURL=race.js.map
  124096. /***/ }),
  124097. /* 958 */
  124098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124099. "use strict";
  124100. /* harmony export (immutable) */ __webpack_exports__["a"] = repeat;
  124101. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124102. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  124103. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_empty__ = __webpack_require__(46);
  124104. /** PURE_IMPORTS_START tslib,_Subscriber,_observable_empty PURE_IMPORTS_END */
  124105. function repeat(count) {
  124106. if (count === void 0) {
  124107. count = -1;
  124108. }
  124109. return function (source) {
  124110. if (count === 0) {
  124111. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_empty__["a" /* empty */])();
  124112. }
  124113. else if (count < 0) {
  124114. return source.lift(new RepeatOperator(-1, source));
  124115. }
  124116. else {
  124117. return source.lift(new RepeatOperator(count - 1, source));
  124118. }
  124119. };
  124120. }
  124121. var RepeatOperator = /*@__PURE__*/ (function () {
  124122. function RepeatOperator(count, source) {
  124123. this.count = count;
  124124. this.source = source;
  124125. }
  124126. RepeatOperator.prototype.call = function (subscriber, source) {
  124127. return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));
  124128. };
  124129. return RepeatOperator;
  124130. }());
  124131. var RepeatSubscriber = /*@__PURE__*/ (function (_super) {
  124132. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RepeatSubscriber, _super);
  124133. function RepeatSubscriber(destination, count, source) {
  124134. var _this = _super.call(this, destination) || this;
  124135. _this.count = count;
  124136. _this.source = source;
  124137. return _this;
  124138. }
  124139. RepeatSubscriber.prototype.complete = function () {
  124140. if (!this.isStopped) {
  124141. var _a = this, source = _a.source, count = _a.count;
  124142. if (count === 0) {
  124143. return _super.prototype.complete.call(this);
  124144. }
  124145. else if (count > -1) {
  124146. this.count = count - 1;
  124147. }
  124148. source.subscribe(this._unsubscribeAndRecycle());
  124149. }
  124150. };
  124151. return RepeatSubscriber;
  124152. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  124153. //# sourceMappingURL=repeat.js.map
  124154. /***/ }),
  124155. /* 959 */
  124156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124157. "use strict";
  124158. /* harmony export (immutable) */ __webpack_exports__["a"] = repeatWhen;
  124159. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124160. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
  124161. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
  124162. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
  124163. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
  124164. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
  124165. /** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  124166. function repeatWhen(notifier) {
  124167. return function (source) { return source.lift(new RepeatWhenOperator(notifier)); };
  124168. }
  124169. var RepeatWhenOperator = /*@__PURE__*/ (function () {
  124170. function RepeatWhenOperator(notifier) {
  124171. this.notifier = notifier;
  124172. }
  124173. RepeatWhenOperator.prototype.call = function (subscriber, source) {
  124174. return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source));
  124175. };
  124176. return RepeatWhenOperator;
  124177. }());
  124178. var RepeatWhenSubscriber = /*@__PURE__*/ (function (_super) {
  124179. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RepeatWhenSubscriber, _super);
  124180. function RepeatWhenSubscriber(destination, notifier, source) {
  124181. var _this = _super.call(this, destination) || this;
  124182. _this.notifier = notifier;
  124183. _this.source = source;
  124184. _this.sourceIsBeingSubscribedTo = true;
  124185. return _this;
  124186. }
  124187. RepeatWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  124188. this.sourceIsBeingSubscribedTo = true;
  124189. this.source.subscribe(this);
  124190. };
  124191. RepeatWhenSubscriber.prototype.notifyComplete = function (innerSub) {
  124192. if (this.sourceIsBeingSubscribedTo === false) {
  124193. return _super.prototype.complete.call(this);
  124194. }
  124195. };
  124196. RepeatWhenSubscriber.prototype.complete = function () {
  124197. this.sourceIsBeingSubscribedTo = false;
  124198. if (!this.isStopped) {
  124199. if (!this.retries) {
  124200. this.subscribeToRetries();
  124201. }
  124202. if (!this.retriesSubscription || this.retriesSubscription.closed) {
  124203. return _super.prototype.complete.call(this);
  124204. }
  124205. this._unsubscribeAndRecycle();
  124206. this.notifications.next();
  124207. }
  124208. };
  124209. RepeatWhenSubscriber.prototype._unsubscribe = function () {
  124210. var _a = this, notifications = _a.notifications, retriesSubscription = _a.retriesSubscription;
  124211. if (notifications) {
  124212. notifications.unsubscribe();
  124213. this.notifications = null;
  124214. }
  124215. if (retriesSubscription) {
  124216. retriesSubscription.unsubscribe();
  124217. this.retriesSubscription = null;
  124218. }
  124219. this.retries = null;
  124220. };
  124221. RepeatWhenSubscriber.prototype._unsubscribeAndRecycle = function () {
  124222. var _unsubscribe = this._unsubscribe;
  124223. this._unsubscribe = null;
  124224. _super.prototype._unsubscribeAndRecycle.call(this);
  124225. this._unsubscribe = _unsubscribe;
  124226. return this;
  124227. };
  124228. RepeatWhenSubscriber.prototype.subscribeToRetries = function () {
  124229. this.notifications = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
  124230. var retries = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.notifier)(this.notifications);
  124231. if (retries === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
  124232. return _super.prototype.complete.call(this);
  124233. }
  124234. this.retries = retries;
  124235. this.retriesSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, retries);
  124236. };
  124237. return RepeatWhenSubscriber;
  124238. }(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
  124239. //# sourceMappingURL=repeatWhen.js.map
  124240. /***/ }),
  124241. /* 960 */
  124242. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124243. "use strict";
  124244. /* harmony export (immutable) */ __webpack_exports__["a"] = retry;
  124245. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124246. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  124247. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  124248. function retry(count) {
  124249. if (count === void 0) {
  124250. count = -1;
  124251. }
  124252. return function (source) { return source.lift(new RetryOperator(count, source)); };
  124253. }
  124254. var RetryOperator = /*@__PURE__*/ (function () {
  124255. function RetryOperator(count, source) {
  124256. this.count = count;
  124257. this.source = source;
  124258. }
  124259. RetryOperator.prototype.call = function (subscriber, source) {
  124260. return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source));
  124261. };
  124262. return RetryOperator;
  124263. }());
  124264. var RetrySubscriber = /*@__PURE__*/ (function (_super) {
  124265. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RetrySubscriber, _super);
  124266. function RetrySubscriber(destination, count, source) {
  124267. var _this = _super.call(this, destination) || this;
  124268. _this.count = count;
  124269. _this.source = source;
  124270. return _this;
  124271. }
  124272. RetrySubscriber.prototype.error = function (err) {
  124273. if (!this.isStopped) {
  124274. var _a = this, source = _a.source, count = _a.count;
  124275. if (count === 0) {
  124276. return _super.prototype.error.call(this, err);
  124277. }
  124278. else if (count > -1) {
  124279. this.count = count - 1;
  124280. }
  124281. source.subscribe(this._unsubscribeAndRecycle());
  124282. }
  124283. };
  124284. return RetrySubscriber;
  124285. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  124286. //# sourceMappingURL=retry.js.map
  124287. /***/ }),
  124288. /* 961 */
  124289. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124290. "use strict";
  124291. /* harmony export (immutable) */ __webpack_exports__["a"] = retryWhen;
  124292. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124293. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
  124294. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
  124295. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
  124296. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
  124297. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
  124298. /** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  124299. function retryWhen(notifier) {
  124300. return function (source) { return source.lift(new RetryWhenOperator(notifier, source)); };
  124301. }
  124302. var RetryWhenOperator = /*@__PURE__*/ (function () {
  124303. function RetryWhenOperator(notifier, source) {
  124304. this.notifier = notifier;
  124305. this.source = source;
  124306. }
  124307. RetryWhenOperator.prototype.call = function (subscriber, source) {
  124308. return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source));
  124309. };
  124310. return RetryWhenOperator;
  124311. }());
  124312. var RetryWhenSubscriber = /*@__PURE__*/ (function (_super) {
  124313. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RetryWhenSubscriber, _super);
  124314. function RetryWhenSubscriber(destination, notifier, source) {
  124315. var _this = _super.call(this, destination) || this;
  124316. _this.notifier = notifier;
  124317. _this.source = source;
  124318. return _this;
  124319. }
  124320. RetryWhenSubscriber.prototype.error = function (err) {
  124321. if (!this.isStopped) {
  124322. var errors = this.errors;
  124323. var retries = this.retries;
  124324. var retriesSubscription = this.retriesSubscription;
  124325. if (!retries) {
  124326. errors = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
  124327. retries = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.notifier)(errors);
  124328. if (retries === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
  124329. return _super.prototype.error.call(this, __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e);
  124330. }
  124331. retriesSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, retries);
  124332. }
  124333. else {
  124334. this.errors = null;
  124335. this.retriesSubscription = null;
  124336. }
  124337. this._unsubscribeAndRecycle();
  124338. this.errors = errors;
  124339. this.retries = retries;
  124340. this.retriesSubscription = retriesSubscription;
  124341. errors.next(err);
  124342. }
  124343. };
  124344. RetryWhenSubscriber.prototype._unsubscribe = function () {
  124345. var _a = this, errors = _a.errors, retriesSubscription = _a.retriesSubscription;
  124346. if (errors) {
  124347. errors.unsubscribe();
  124348. this.errors = null;
  124349. }
  124350. if (retriesSubscription) {
  124351. retriesSubscription.unsubscribe();
  124352. this.retriesSubscription = null;
  124353. }
  124354. this.retries = null;
  124355. };
  124356. RetryWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  124357. var _unsubscribe = this._unsubscribe;
  124358. this._unsubscribe = null;
  124359. this._unsubscribeAndRecycle();
  124360. this._unsubscribe = _unsubscribe;
  124361. this.source.subscribe(this);
  124362. };
  124363. return RetryWhenSubscriber;
  124364. }(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
  124365. //# sourceMappingURL=retryWhen.js.map
  124366. /***/ }),
  124367. /* 962 */
  124368. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124369. "use strict";
  124370. /* harmony export (immutable) */ __webpack_exports__["a"] = sample;
  124371. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124372. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  124373. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
  124374. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  124375. function sample(notifier) {
  124376. return function (source) { return source.lift(new SampleOperator(notifier)); };
  124377. }
  124378. var SampleOperator = /*@__PURE__*/ (function () {
  124379. function SampleOperator(notifier) {
  124380. this.notifier = notifier;
  124381. }
  124382. SampleOperator.prototype.call = function (subscriber, source) {
  124383. var sampleSubscriber = new SampleSubscriber(subscriber);
  124384. var subscription = source.subscribe(sampleSubscriber);
  124385. subscription.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(sampleSubscriber, this.notifier));
  124386. return subscription;
  124387. };
  124388. return SampleOperator;
  124389. }());
  124390. var SampleSubscriber = /*@__PURE__*/ (function (_super) {
  124391. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SampleSubscriber, _super);
  124392. function SampleSubscriber() {
  124393. var _this = _super !== null && _super.apply(this, arguments) || this;
  124394. _this.hasValue = false;
  124395. return _this;
  124396. }
  124397. SampleSubscriber.prototype._next = function (value) {
  124398. this.value = value;
  124399. this.hasValue = true;
  124400. };
  124401. SampleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  124402. this.emitValue();
  124403. };
  124404. SampleSubscriber.prototype.notifyComplete = function () {
  124405. this.emitValue();
  124406. };
  124407. SampleSubscriber.prototype.emitValue = function () {
  124408. if (this.hasValue) {
  124409. this.hasValue = false;
  124410. this.destination.next(this.value);
  124411. }
  124412. };
  124413. return SampleSubscriber;
  124414. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  124415. //# sourceMappingURL=sample.js.map
  124416. /***/ }),
  124417. /* 963 */
  124418. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124419. "use strict";
  124420. /* harmony export (immutable) */ __webpack_exports__["a"] = sampleTime;
  124421. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124422. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  124423. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(47);
  124424. /** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */
  124425. function sampleTime(period, scheduler) {
  124426. if (scheduler === void 0) {
  124427. scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* async */];
  124428. }
  124429. return function (source) { return source.lift(new SampleTimeOperator(period, scheduler)); };
  124430. }
  124431. var SampleTimeOperator = /*@__PURE__*/ (function () {
  124432. function SampleTimeOperator(period, scheduler) {
  124433. this.period = period;
  124434. this.scheduler = scheduler;
  124435. }
  124436. SampleTimeOperator.prototype.call = function (subscriber, source) {
  124437. return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));
  124438. };
  124439. return SampleTimeOperator;
  124440. }());
  124441. var SampleTimeSubscriber = /*@__PURE__*/ (function (_super) {
  124442. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SampleTimeSubscriber, _super);
  124443. function SampleTimeSubscriber(destination, period, scheduler) {
  124444. var _this = _super.call(this, destination) || this;
  124445. _this.period = period;
  124446. _this.scheduler = scheduler;
  124447. _this.hasValue = false;
  124448. _this.add(scheduler.schedule(dispatchNotification, period, { subscriber: _this, period: period }));
  124449. return _this;
  124450. }
  124451. SampleTimeSubscriber.prototype._next = function (value) {
  124452. this.lastValue = value;
  124453. this.hasValue = true;
  124454. };
  124455. SampleTimeSubscriber.prototype.notifyNext = function () {
  124456. if (this.hasValue) {
  124457. this.hasValue = false;
  124458. this.destination.next(this.lastValue);
  124459. }
  124460. };
  124461. return SampleTimeSubscriber;
  124462. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  124463. function dispatchNotification(state) {
  124464. var subscriber = state.subscriber, period = state.period;
  124465. subscriber.notifyNext();
  124466. this.schedule(state, period);
  124467. }
  124468. //# sourceMappingURL=sampleTime.js.map
  124469. /***/ }),
  124470. /* 964 */
  124471. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124472. "use strict";
  124473. /* harmony export (immutable) */ __webpack_exports__["a"] = sequenceEqual;
  124474. /* unused harmony export SequenceEqualOperator */
  124475. /* unused harmony export SequenceEqualSubscriber */
  124476. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124477. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  124478. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
  124479. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
  124480. /** PURE_IMPORTS_START tslib,_Subscriber,_util_tryCatch,_util_errorObject PURE_IMPORTS_END */
  124481. function sequenceEqual(compareTo, comparor) {
  124482. return function (source) { return source.lift(new SequenceEqualOperator(compareTo, comparor)); };
  124483. }
  124484. var SequenceEqualOperator = /*@__PURE__*/ (function () {
  124485. function SequenceEqualOperator(compareTo, comparor) {
  124486. this.compareTo = compareTo;
  124487. this.comparor = comparor;
  124488. }
  124489. SequenceEqualOperator.prototype.call = function (subscriber, source) {
  124490. return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparor));
  124491. };
  124492. return SequenceEqualOperator;
  124493. }());
  124494. var SequenceEqualSubscriber = /*@__PURE__*/ (function (_super) {
  124495. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SequenceEqualSubscriber, _super);
  124496. function SequenceEqualSubscriber(destination, compareTo, comparor) {
  124497. var _this = _super.call(this, destination) || this;
  124498. _this.compareTo = compareTo;
  124499. _this.comparor = comparor;
  124500. _this._a = [];
  124501. _this._b = [];
  124502. _this._oneComplete = false;
  124503. _this.destination.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, _this)));
  124504. return _this;
  124505. }
  124506. SequenceEqualSubscriber.prototype._next = function (value) {
  124507. if (this._oneComplete && this._b.length === 0) {
  124508. this.emit(false);
  124509. }
  124510. else {
  124511. this._a.push(value);
  124512. this.checkValues();
  124513. }
  124514. };
  124515. SequenceEqualSubscriber.prototype._complete = function () {
  124516. if (this._oneComplete) {
  124517. this.emit(this._a.length === 0 && this._b.length === 0);
  124518. }
  124519. else {
  124520. this._oneComplete = true;
  124521. }
  124522. this.unsubscribe();
  124523. };
  124524. SequenceEqualSubscriber.prototype.checkValues = function () {
  124525. var _c = this, _a = _c._a, _b = _c._b, comparor = _c.comparor;
  124526. while (_a.length > 0 && _b.length > 0) {
  124527. var a = _a.shift();
  124528. var b = _b.shift();
  124529. var areEqual = false;
  124530. if (comparor) {
  124531. areEqual = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(comparor)(a, b);
  124532. if (areEqual === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
  124533. this.destination.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e);
  124534. }
  124535. }
  124536. else {
  124537. areEqual = a === b;
  124538. }
  124539. if (!areEqual) {
  124540. this.emit(false);
  124541. }
  124542. }
  124543. };
  124544. SequenceEqualSubscriber.prototype.emit = function (value) {
  124545. var destination = this.destination;
  124546. destination.next(value);
  124547. destination.complete();
  124548. };
  124549. SequenceEqualSubscriber.prototype.nextB = function (value) {
  124550. if (this._oneComplete && this._a.length === 0) {
  124551. this.emit(false);
  124552. }
  124553. else {
  124554. this._b.push(value);
  124555. this.checkValues();
  124556. }
  124557. };
  124558. SequenceEqualSubscriber.prototype.completeB = function () {
  124559. if (this._oneComplete) {
  124560. this.emit(this._a.length === 0 && this._b.length === 0);
  124561. }
  124562. else {
  124563. this._oneComplete = true;
  124564. }
  124565. };
  124566. return SequenceEqualSubscriber;
  124567. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  124568. var SequenceEqualCompareToSubscriber = /*@__PURE__*/ (function (_super) {
  124569. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SequenceEqualCompareToSubscriber, _super);
  124570. function SequenceEqualCompareToSubscriber(destination, parent) {
  124571. var _this = _super.call(this, destination) || this;
  124572. _this.parent = parent;
  124573. return _this;
  124574. }
  124575. SequenceEqualCompareToSubscriber.prototype._next = function (value) {
  124576. this.parent.nextB(value);
  124577. };
  124578. SequenceEqualCompareToSubscriber.prototype._error = function (err) {
  124579. this.parent.error(err);
  124580. this.unsubscribe();
  124581. };
  124582. SequenceEqualCompareToSubscriber.prototype._complete = function () {
  124583. this.parent.completeB();
  124584. this.unsubscribe();
  124585. };
  124586. return SequenceEqualCompareToSubscriber;
  124587. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  124588. //# sourceMappingURL=sequenceEqual.js.map
  124589. /***/ }),
  124590. /* 965 */
  124591. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124592. "use strict";
  124593. /* harmony export (immutable) */ __webpack_exports__["a"] = share;
  124594. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__multicast__ = __webpack_require__(111);
  124595. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__refCount__ = __webpack_require__(257);
  124596. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subject__ = __webpack_require__(43);
  124597. /** PURE_IMPORTS_START _multicast,_refCount,_Subject PURE_IMPORTS_END */
  124598. function shareSubjectFactory() {
  124599. return new __WEBPACK_IMPORTED_MODULE_2__Subject__["a" /* Subject */]();
  124600. }
  124601. function share() {
  124602. return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__refCount__["a" /* refCount */])()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__multicast__["a" /* multicast */])(shareSubjectFactory)(source)); };
  124603. }
  124604. //# sourceMappingURL=share.js.map
  124605. /***/ }),
  124606. /* 966 */
  124607. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124608. "use strict";
  124609. /* harmony export (immutable) */ __webpack_exports__["a"] = shareReplay;
  124610. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__ = __webpack_require__(249);
  124611. /** PURE_IMPORTS_START _ReplaySubject PURE_IMPORTS_END */
  124612. function shareReplay(bufferSize, windowTime, scheduler) {
  124613. if (bufferSize === void 0) {
  124614. bufferSize = Number.POSITIVE_INFINITY;
  124615. }
  124616. if (windowTime === void 0) {
  124617. windowTime = Number.POSITIVE_INFINITY;
  124618. }
  124619. return function (source) { return source.lift(shareReplayOperator(bufferSize, windowTime, scheduler)); };
  124620. }
  124621. function shareReplayOperator(bufferSize, windowTime, scheduler) {
  124622. var subject;
  124623. var refCount = 0;
  124624. var subscription;
  124625. var hasError = false;
  124626. var isComplete = false;
  124627. return function shareReplayOperation(source) {
  124628. refCount++;
  124629. if (!subject || hasError) {
  124630. hasError = false;
  124631. subject = new __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__["a" /* ReplaySubject */](bufferSize, windowTime, scheduler);
  124632. subscription = source.subscribe({
  124633. next: function (value) { subject.next(value); },
  124634. error: function (err) {
  124635. hasError = true;
  124636. subject.error(err);
  124637. },
  124638. complete: function () {
  124639. isComplete = true;
  124640. subject.complete();
  124641. },
  124642. });
  124643. }
  124644. var innerSub = subject.subscribe(this);
  124645. return function () {
  124646. refCount--;
  124647. innerSub.unsubscribe();
  124648. if (subscription && refCount === 0 && isComplete) {
  124649. subscription.unsubscribe();
  124650. }
  124651. };
  124652. };
  124653. }
  124654. //# sourceMappingURL=shareReplay.js.map
  124655. /***/ }),
  124656. /* 967 */
  124657. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124658. "use strict";
  124659. /* harmony export (immutable) */ __webpack_exports__["a"] = single;
  124660. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124661. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  124662. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_EmptyError__ = __webpack_require__(142);
  124663. /** PURE_IMPORTS_START tslib,_Subscriber,_util_EmptyError PURE_IMPORTS_END */
  124664. function single(predicate) {
  124665. return function (source) { return source.lift(new SingleOperator(predicate, source)); };
  124666. }
  124667. var SingleOperator = /*@__PURE__*/ (function () {
  124668. function SingleOperator(predicate, source) {
  124669. this.predicate = predicate;
  124670. this.source = source;
  124671. }
  124672. SingleOperator.prototype.call = function (subscriber, source) {
  124673. return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source));
  124674. };
  124675. return SingleOperator;
  124676. }());
  124677. var SingleSubscriber = /*@__PURE__*/ (function (_super) {
  124678. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SingleSubscriber, _super);
  124679. function SingleSubscriber(destination, predicate, source) {
  124680. var _this = _super.call(this, destination) || this;
  124681. _this.predicate = predicate;
  124682. _this.source = source;
  124683. _this.seenValue = false;
  124684. _this.index = 0;
  124685. return _this;
  124686. }
  124687. SingleSubscriber.prototype.applySingleValue = function (value) {
  124688. if (this.seenValue) {
  124689. this.destination.error('Sequence contains more than one element');
  124690. }
  124691. else {
  124692. this.seenValue = true;
  124693. this.singleValue = value;
  124694. }
  124695. };
  124696. SingleSubscriber.prototype._next = function (value) {
  124697. var index = this.index++;
  124698. if (this.predicate) {
  124699. this.tryNext(value, index);
  124700. }
  124701. else {
  124702. this.applySingleValue(value);
  124703. }
  124704. };
  124705. SingleSubscriber.prototype.tryNext = function (value, index) {
  124706. try {
  124707. if (this.predicate(value, index, this.source)) {
  124708. this.applySingleValue(value);
  124709. }
  124710. }
  124711. catch (err) {
  124712. this.destination.error(err);
  124713. }
  124714. };
  124715. SingleSubscriber.prototype._complete = function () {
  124716. var destination = this.destination;
  124717. if (this.index > 0) {
  124718. destination.next(this.seenValue ? this.singleValue : undefined);
  124719. destination.complete();
  124720. }
  124721. else {
  124722. destination.error(new __WEBPACK_IMPORTED_MODULE_2__util_EmptyError__["a" /* EmptyError */]);
  124723. }
  124724. };
  124725. return SingleSubscriber;
  124726. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  124727. //# sourceMappingURL=single.js.map
  124728. /***/ }),
  124729. /* 968 */
  124730. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124731. "use strict";
  124732. /* harmony export (immutable) */ __webpack_exports__["a"] = skip;
  124733. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124734. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  124735. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  124736. function skip(count) {
  124737. return function (source) { return source.lift(new SkipOperator(count)); };
  124738. }
  124739. var SkipOperator = /*@__PURE__*/ (function () {
  124740. function SkipOperator(total) {
  124741. this.total = total;
  124742. }
  124743. SkipOperator.prototype.call = function (subscriber, source) {
  124744. return source.subscribe(new SkipSubscriber(subscriber, this.total));
  124745. };
  124746. return SkipOperator;
  124747. }());
  124748. var SkipSubscriber = /*@__PURE__*/ (function (_super) {
  124749. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SkipSubscriber, _super);
  124750. function SkipSubscriber(destination, total) {
  124751. var _this = _super.call(this, destination) || this;
  124752. _this.total = total;
  124753. _this.count = 0;
  124754. return _this;
  124755. }
  124756. SkipSubscriber.prototype._next = function (x) {
  124757. if (++this.count > this.total) {
  124758. this.destination.next(x);
  124759. }
  124760. };
  124761. return SkipSubscriber;
  124762. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  124763. //# sourceMappingURL=skip.js.map
  124764. /***/ }),
  124765. /* 969 */
  124766. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124767. "use strict";
  124768. /* harmony export (immutable) */ __webpack_exports__["a"] = skipLast;
  124769. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124770. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  124771. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__ = __webpack_require__(141);
  124772. /** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError PURE_IMPORTS_END */
  124773. function skipLast(count) {
  124774. return function (source) { return source.lift(new SkipLastOperator(count)); };
  124775. }
  124776. var SkipLastOperator = /*@__PURE__*/ (function () {
  124777. function SkipLastOperator(_skipCount) {
  124778. this._skipCount = _skipCount;
  124779. if (this._skipCount < 0) {
  124780. throw new __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */];
  124781. }
  124782. }
  124783. SkipLastOperator.prototype.call = function (subscriber, source) {
  124784. if (this._skipCount === 0) {
  124785. return source.subscribe(new __WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */](subscriber));
  124786. }
  124787. else {
  124788. return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));
  124789. }
  124790. };
  124791. return SkipLastOperator;
  124792. }());
  124793. var SkipLastSubscriber = /*@__PURE__*/ (function (_super) {
  124794. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SkipLastSubscriber, _super);
  124795. function SkipLastSubscriber(destination, _skipCount) {
  124796. var _this = _super.call(this, destination) || this;
  124797. _this._skipCount = _skipCount;
  124798. _this._count = 0;
  124799. _this._ring = new Array(_skipCount);
  124800. return _this;
  124801. }
  124802. SkipLastSubscriber.prototype._next = function (value) {
  124803. var skipCount = this._skipCount;
  124804. var count = this._count++;
  124805. if (count < skipCount) {
  124806. this._ring[count] = value;
  124807. }
  124808. else {
  124809. var currentIndex = count % skipCount;
  124810. var ring = this._ring;
  124811. var oldValue = ring[currentIndex];
  124812. ring[currentIndex] = value;
  124813. this.destination.next(oldValue);
  124814. }
  124815. };
  124816. return SkipLastSubscriber;
  124817. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  124818. //# sourceMappingURL=skipLast.js.map
  124819. /***/ }),
  124820. /* 970 */
  124821. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124822. "use strict";
  124823. /* harmony export (immutable) */ __webpack_exports__["a"] = skipUntil;
  124824. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124825. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  124826. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(80);
  124827. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
  124828. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  124829. function skipUntil(notifier) {
  124830. return function (source) { return source.lift(new SkipUntilOperator(notifier)); };
  124831. }
  124832. var SkipUntilOperator = /*@__PURE__*/ (function () {
  124833. function SkipUntilOperator(notifier) {
  124834. this.notifier = notifier;
  124835. }
  124836. SkipUntilOperator.prototype.call = function (destination, source) {
  124837. return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
  124838. };
  124839. return SkipUntilOperator;
  124840. }());
  124841. var SkipUntilSubscriber = /*@__PURE__*/ (function (_super) {
  124842. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SkipUntilSubscriber, _super);
  124843. function SkipUntilSubscriber(destination, notifier) {
  124844. var _this = _super.call(this, destination) || this;
  124845. _this.hasValue = false;
  124846. var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](_this, undefined, undefined);
  124847. _this.add(innerSubscriber);
  124848. _this.innerSubscription = innerSubscriber;
  124849. __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(_this, notifier, undefined, undefined, innerSubscriber);
  124850. return _this;
  124851. }
  124852. SkipUntilSubscriber.prototype._next = function (value) {
  124853. if (this.hasValue) {
  124854. _super.prototype._next.call(this, value);
  124855. }
  124856. };
  124857. SkipUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  124858. this.hasValue = true;
  124859. if (this.innerSubscription) {
  124860. this.innerSubscription.unsubscribe();
  124861. }
  124862. };
  124863. SkipUntilSubscriber.prototype.notifyComplete = function () {
  124864. };
  124865. return SkipUntilSubscriber;
  124866. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  124867. //# sourceMappingURL=skipUntil.js.map
  124868. /***/ }),
  124869. /* 971 */
  124870. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124871. "use strict";
  124872. /* harmony export (immutable) */ __webpack_exports__["a"] = skipWhile;
  124873. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  124874. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  124875. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  124876. function skipWhile(predicate) {
  124877. return function (source) { return source.lift(new SkipWhileOperator(predicate)); };
  124878. }
  124879. var SkipWhileOperator = /*@__PURE__*/ (function () {
  124880. function SkipWhileOperator(predicate) {
  124881. this.predicate = predicate;
  124882. }
  124883. SkipWhileOperator.prototype.call = function (subscriber, source) {
  124884. return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));
  124885. };
  124886. return SkipWhileOperator;
  124887. }());
  124888. var SkipWhileSubscriber = /*@__PURE__*/ (function (_super) {
  124889. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SkipWhileSubscriber, _super);
  124890. function SkipWhileSubscriber(destination, predicate) {
  124891. var _this = _super.call(this, destination) || this;
  124892. _this.predicate = predicate;
  124893. _this.skipping = true;
  124894. _this.index = 0;
  124895. return _this;
  124896. }
  124897. SkipWhileSubscriber.prototype._next = function (value) {
  124898. var destination = this.destination;
  124899. if (this.skipping) {
  124900. this.tryCallPredicate(value);
  124901. }
  124902. if (!this.skipping) {
  124903. destination.next(value);
  124904. }
  124905. };
  124906. SkipWhileSubscriber.prototype.tryCallPredicate = function (value) {
  124907. try {
  124908. var result = this.predicate(value, this.index++);
  124909. this.skipping = Boolean(result);
  124910. }
  124911. catch (err) {
  124912. this.destination.error(err);
  124913. }
  124914. };
  124915. return SkipWhileSubscriber;
  124916. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  124917. //# sourceMappingURL=skipWhile.js.map
  124918. /***/ }),
  124919. /* 972 */
  124920. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124921. "use strict";
  124922. /* harmony export (immutable) */ __webpack_exports__["a"] = startWith;
  124923. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_fromArray__ = __webpack_require__(81);
  124924. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_scalar__ = __webpack_require__(253);
  124925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_empty__ = __webpack_require__(46);
  124926. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_concat__ = __webpack_require__(177);
  124927. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isScheduler__ = __webpack_require__(56);
  124928. /** PURE_IMPORTS_START _observable_fromArray,_observable_scalar,_observable_empty,_observable_concat,_util_isScheduler PURE_IMPORTS_END */
  124929. function startWith() {
  124930. var array = [];
  124931. for (var _i = 0; _i < arguments.length; _i++) {
  124932. array[_i] = arguments[_i];
  124933. }
  124934. return function (source) {
  124935. var scheduler = array[array.length - 1];
  124936. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isScheduler__["a" /* isScheduler */])(scheduler)) {
  124937. array.pop();
  124938. }
  124939. else {
  124940. scheduler = null;
  124941. }
  124942. var len = array.length;
  124943. if (len === 1 && !scheduler) {
  124944. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_scalar__["a" /* scalar */])(array[0]), source);
  124945. }
  124946. else if (len > 0) {
  124947. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__observable_fromArray__["a" /* fromArray */])(array, scheduler), source);
  124948. }
  124949. else {
  124950. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_empty__["a" /* empty */])(scheduler), source);
  124951. }
  124952. };
  124953. }
  124954. //# sourceMappingURL=startWith.js.map
  124955. /***/ }),
  124956. /* 973 */
  124957. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124958. "use strict";
  124959. /* harmony export (immutable) */ __webpack_exports__["a"] = subscribeOn;
  124960. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_SubscribeOnObservable__ = __webpack_require__(895);
  124961. /** PURE_IMPORTS_START _observable_SubscribeOnObservable PURE_IMPORTS_END */
  124962. function subscribeOn(scheduler, delay) {
  124963. if (delay === void 0) {
  124964. delay = 0;
  124965. }
  124966. return function subscribeOnOperatorFunction(source) {
  124967. return source.lift(new SubscribeOnOperator(scheduler, delay));
  124968. };
  124969. }
  124970. var SubscribeOnOperator = /*@__PURE__*/ (function () {
  124971. function SubscribeOnOperator(scheduler, delay) {
  124972. this.scheduler = scheduler;
  124973. this.delay = delay;
  124974. }
  124975. SubscribeOnOperator.prototype.call = function (subscriber, source) {
  124976. return new __WEBPACK_IMPORTED_MODULE_0__observable_SubscribeOnObservable__["a" /* SubscribeOnObservable */](source, this.delay, this.scheduler).subscribe(subscriber);
  124977. };
  124978. return SubscribeOnOperator;
  124979. }());
  124980. //# sourceMappingURL=subscribeOn.js.map
  124981. /***/ }),
  124982. /* 974 */
  124983. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124984. "use strict";
  124985. /* harmony export (immutable) */ __webpack_exports__["a"] = switchAll;
  124986. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__switchMap__ = __webpack_require__(259);
  124987. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_identity__ = __webpack_require__(113);
  124988. /** PURE_IMPORTS_START _switchMap,_util_identity PURE_IMPORTS_END */
  124989. function switchAll() {
  124990. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__switchMap__["a" /* switchMap */])(__WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */]);
  124991. }
  124992. //# sourceMappingURL=switchAll.js.map
  124993. /***/ }),
  124994. /* 975 */
  124995. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  124996. "use strict";
  124997. /* harmony export (immutable) */ __webpack_exports__["a"] = switchMapTo;
  124998. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__switchMap__ = __webpack_require__(259);
  124999. /** PURE_IMPORTS_START _switchMap PURE_IMPORTS_END */
  125000. function switchMapTo(innerObservable, resultSelector) {
  125001. return resultSelector ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__switchMap__["a" /* switchMap */])(function () { return innerObservable; }, resultSelector) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__switchMap__["a" /* switchMap */])(function () { return innerObservable; });
  125002. }
  125003. //# sourceMappingURL=switchMapTo.js.map
  125004. /***/ }),
  125005. /* 976 */
  125006. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125007. "use strict";
  125008. /* harmony export (immutable) */ __webpack_exports__["a"] = takeUntil;
  125009. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  125010. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  125011. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
  125012. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  125013. function takeUntil(notifier) {
  125014. return function (source) { return source.lift(new TakeUntilOperator(notifier)); };
  125015. }
  125016. var TakeUntilOperator = /*@__PURE__*/ (function () {
  125017. function TakeUntilOperator(notifier) {
  125018. this.notifier = notifier;
  125019. }
  125020. TakeUntilOperator.prototype.call = function (subscriber, source) {
  125021. var takeUntilSubscriber = new TakeUntilSubscriber(subscriber);
  125022. var notifierSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(takeUntilSubscriber, this.notifier);
  125023. if (notifierSubscription && !takeUntilSubscriber.seenValue) {
  125024. takeUntilSubscriber.add(notifierSubscription);
  125025. return source.subscribe(takeUntilSubscriber);
  125026. }
  125027. return takeUntilSubscriber;
  125028. };
  125029. return TakeUntilOperator;
  125030. }());
  125031. var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) {
  125032. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TakeUntilSubscriber, _super);
  125033. function TakeUntilSubscriber(destination) {
  125034. var _this = _super.call(this, destination) || this;
  125035. _this.seenValue = false;
  125036. return _this;
  125037. }
  125038. TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  125039. this.seenValue = true;
  125040. this.complete();
  125041. };
  125042. TakeUntilSubscriber.prototype.notifyComplete = function () {
  125043. };
  125044. return TakeUntilSubscriber;
  125045. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  125046. //# sourceMappingURL=takeUntil.js.map
  125047. /***/ }),
  125048. /* 977 */
  125049. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125050. "use strict";
  125051. /* harmony export (immutable) */ __webpack_exports__["a"] = takeWhile;
  125052. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  125053. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  125054. /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
  125055. function takeWhile(predicate) {
  125056. return function (source) { return source.lift(new TakeWhileOperator(predicate)); };
  125057. }
  125058. var TakeWhileOperator = /*@__PURE__*/ (function () {
  125059. function TakeWhileOperator(predicate) {
  125060. this.predicate = predicate;
  125061. }
  125062. TakeWhileOperator.prototype.call = function (subscriber, source) {
  125063. return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate));
  125064. };
  125065. return TakeWhileOperator;
  125066. }());
  125067. var TakeWhileSubscriber = /*@__PURE__*/ (function (_super) {
  125068. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TakeWhileSubscriber, _super);
  125069. function TakeWhileSubscriber(destination, predicate) {
  125070. var _this = _super.call(this, destination) || this;
  125071. _this.predicate = predicate;
  125072. _this.index = 0;
  125073. return _this;
  125074. }
  125075. TakeWhileSubscriber.prototype._next = function (value) {
  125076. var destination = this.destination;
  125077. var result;
  125078. try {
  125079. result = this.predicate(value, this.index++);
  125080. }
  125081. catch (err) {
  125082. destination.error(err);
  125083. return;
  125084. }
  125085. this.nextOrComplete(value, result);
  125086. };
  125087. TakeWhileSubscriber.prototype.nextOrComplete = function (value, predicateResult) {
  125088. var destination = this.destination;
  125089. if (Boolean(predicateResult)) {
  125090. destination.next(value);
  125091. }
  125092. else {
  125093. destination.complete();
  125094. }
  125095. };
  125096. return TakeWhileSubscriber;
  125097. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  125098. //# sourceMappingURL=takeWhile.js.map
  125099. /***/ }),
  125100. /* 978 */
  125101. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125102. "use strict";
  125103. /* harmony export (immutable) */ __webpack_exports__["a"] = throttleTime;
  125104. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  125105. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  125106. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(47);
  125107. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__throttle__ = __webpack_require__(406);
  125108. /** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async,_throttle PURE_IMPORTS_END */
  125109. function throttleTime(duration, scheduler, config) {
  125110. if (scheduler === void 0) {
  125111. scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* async */];
  125112. }
  125113. if (config === void 0) {
  125114. config = __WEBPACK_IMPORTED_MODULE_3__throttle__["b" /* defaultThrottleConfig */];
  125115. }
  125116. return function (source) { return source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing)); };
  125117. }
  125118. var ThrottleTimeOperator = /*@__PURE__*/ (function () {
  125119. function ThrottleTimeOperator(duration, scheduler, leading, trailing) {
  125120. this.duration = duration;
  125121. this.scheduler = scheduler;
  125122. this.leading = leading;
  125123. this.trailing = trailing;
  125124. }
  125125. ThrottleTimeOperator.prototype.call = function (subscriber, source) {
  125126. return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));
  125127. };
  125128. return ThrottleTimeOperator;
  125129. }());
  125130. var ThrottleTimeSubscriber = /*@__PURE__*/ (function (_super) {
  125131. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ThrottleTimeSubscriber, _super);
  125132. function ThrottleTimeSubscriber(destination, duration, scheduler, leading, trailing) {
  125133. var _this = _super.call(this, destination) || this;
  125134. _this.duration = duration;
  125135. _this.scheduler = scheduler;
  125136. _this.leading = leading;
  125137. _this.trailing = trailing;
  125138. _this._hasTrailingValue = false;
  125139. _this._trailingValue = null;
  125140. return _this;
  125141. }
  125142. ThrottleTimeSubscriber.prototype._next = function (value) {
  125143. if (this.throttled) {
  125144. if (this.trailing) {
  125145. this._trailingValue = value;
  125146. this._hasTrailingValue = true;
  125147. }
  125148. }
  125149. else {
  125150. this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this }));
  125151. if (this.leading) {
  125152. this.destination.next(value);
  125153. }
  125154. }
  125155. };
  125156. ThrottleTimeSubscriber.prototype._complete = function () {
  125157. if (this._hasTrailingValue) {
  125158. this.destination.next(this._trailingValue);
  125159. this.destination.complete();
  125160. }
  125161. else {
  125162. this.destination.complete();
  125163. }
  125164. };
  125165. ThrottleTimeSubscriber.prototype.clearThrottle = function () {
  125166. var throttled = this.throttled;
  125167. if (throttled) {
  125168. if (this.trailing && this._hasTrailingValue) {
  125169. this.destination.next(this._trailingValue);
  125170. this._trailingValue = null;
  125171. this._hasTrailingValue = false;
  125172. }
  125173. throttled.unsubscribe();
  125174. this.remove(throttled);
  125175. this.throttled = null;
  125176. }
  125177. };
  125178. return ThrottleTimeSubscriber;
  125179. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  125180. function dispatchNext(arg) {
  125181. var subscriber = arg.subscriber;
  125182. subscriber.clearThrottle();
  125183. }
  125184. //# sourceMappingURL=throttleTime.js.map
  125185. /***/ }),
  125186. /* 979 */
  125187. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125188. "use strict";
  125189. /* harmony export (immutable) */ __webpack_exports__["a"] = timeInterval;
  125190. /* unused harmony export TimeInterval */
  125191. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(47);
  125192. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scan__ = __webpack_require__(258);
  125193. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_defer__ = __webpack_require__(251);
  125194. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__map__ = __webpack_require__(54);
  125195. /** PURE_IMPORTS_START _scheduler_async,_scan,_observable_defer,_map PURE_IMPORTS_END */
  125196. function timeInterval(scheduler) {
  125197. if (scheduler === void 0) {
  125198. scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */];
  125199. }
  125200. return function (source) {
  125201. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_defer__["a" /* defer */])(function () {
  125202. return source.pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__scan__["a" /* scan */])(function (_a, value) {
  125203. var current = _a.current;
  125204. return ({ value: value, current: scheduler.now(), last: current });
  125205. }, { current: scheduler.now(), value: undefined, last: undefined }), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__map__["a" /* map */])(function (_a) {
  125206. var current = _a.current, last = _a.last, value = _a.value;
  125207. return new TimeInterval(value, current - last);
  125208. }));
  125209. });
  125210. };
  125211. }
  125212. var TimeInterval = /*@__PURE__*/ (function () {
  125213. function TimeInterval(value, interval) {
  125214. this.value = value;
  125215. this.interval = interval;
  125216. }
  125217. return TimeInterval;
  125218. }());
  125219. //# sourceMappingURL=timeInterval.js.map
  125220. /***/ }),
  125221. /* 980 */
  125222. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125223. "use strict";
  125224. /* harmony export (immutable) */ __webpack_exports__["a"] = timeout;
  125225. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(47);
  125226. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_TimeoutError__ = __webpack_require__(410);
  125227. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__timeoutWith__ = __webpack_require__(407);
  125228. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_throwError__ = __webpack_require__(254);
  125229. /** PURE_IMPORTS_START _scheduler_async,_util_TimeoutError,_timeoutWith,_observable_throwError PURE_IMPORTS_END */
  125230. function timeout(due, scheduler) {
  125231. if (scheduler === void 0) {
  125232. scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */];
  125233. }
  125234. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__timeoutWith__["a" /* timeoutWith */])(due, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_throwError__["a" /* throwError */])(new __WEBPACK_IMPORTED_MODULE_1__util_TimeoutError__["a" /* TimeoutError */]()), scheduler);
  125235. }
  125236. //# sourceMappingURL=timeout.js.map
  125237. /***/ }),
  125238. /* 981 */
  125239. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125240. "use strict";
  125241. /* harmony export (immutable) */ __webpack_exports__["a"] = timestamp;
  125242. /* unused harmony export Timestamp */
  125243. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(47);
  125244. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__map__ = __webpack_require__(54);
  125245. /** PURE_IMPORTS_START _scheduler_async,_map PURE_IMPORTS_END */
  125246. function timestamp(scheduler) {
  125247. if (scheduler === void 0) {
  125248. scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */];
  125249. }
  125250. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__map__["a" /* map */])(function (value) { return new Timestamp(value, scheduler.now()); });
  125251. }
  125252. var Timestamp = /*@__PURE__*/ (function () {
  125253. function Timestamp(value, timestamp) {
  125254. this.value = value;
  125255. this.timestamp = timestamp;
  125256. }
  125257. return Timestamp;
  125258. }());
  125259. //# sourceMappingURL=timestamp.js.map
  125260. /***/ }),
  125261. /* 982 */
  125262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125263. "use strict";
  125264. /* harmony export (immutable) */ __webpack_exports__["a"] = toArray;
  125265. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__reduce__ = __webpack_require__(178);
  125266. /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
  125267. function toArrayReducer(arr, item, index) {
  125268. if (index === 0) {
  125269. return [item];
  125270. }
  125271. arr.push(item);
  125272. return arr;
  125273. }
  125274. function toArray() {
  125275. return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__reduce__["a" /* reduce */])(toArrayReducer, []);
  125276. }
  125277. //# sourceMappingURL=toArray.js.map
  125278. /***/ }),
  125279. /* 983 */
  125280. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125281. "use strict";
  125282. /* harmony export (immutable) */ __webpack_exports__["a"] = window;
  125283. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  125284. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
  125285. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__ = __webpack_require__(18);
  125286. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
  125287. /** PURE_IMPORTS_START tslib,_Subject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  125288. function window(windowBoundaries) {
  125289. return function windowOperatorFunction(source) {
  125290. return source.lift(new WindowOperator(windowBoundaries));
  125291. };
  125292. }
  125293. var WindowOperator = /*@__PURE__*/ (function () {
  125294. function WindowOperator(windowBoundaries) {
  125295. this.windowBoundaries = windowBoundaries;
  125296. }
  125297. WindowOperator.prototype.call = function (subscriber, source) {
  125298. var windowSubscriber = new WindowSubscriber(subscriber);
  125299. var sourceSubscription = source.subscribe(windowSubscriber);
  125300. if (!sourceSubscription.closed) {
  125301. windowSubscriber.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(windowSubscriber, this.windowBoundaries));
  125302. }
  125303. return sourceSubscription;
  125304. };
  125305. return WindowOperator;
  125306. }());
  125307. var WindowSubscriber = /*@__PURE__*/ (function (_super) {
  125308. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WindowSubscriber, _super);
  125309. function WindowSubscriber(destination) {
  125310. var _this = _super.call(this, destination) || this;
  125311. _this.window = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
  125312. destination.next(_this.window);
  125313. return _this;
  125314. }
  125315. WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  125316. this.openWindow();
  125317. };
  125318. WindowSubscriber.prototype.notifyError = function (error, innerSub) {
  125319. this._error(error);
  125320. };
  125321. WindowSubscriber.prototype.notifyComplete = function (innerSub) {
  125322. this._complete();
  125323. };
  125324. WindowSubscriber.prototype._next = function (value) {
  125325. this.window.next(value);
  125326. };
  125327. WindowSubscriber.prototype._error = function (err) {
  125328. this.window.error(err);
  125329. this.destination.error(err);
  125330. };
  125331. WindowSubscriber.prototype._complete = function () {
  125332. this.window.complete();
  125333. this.destination.complete();
  125334. };
  125335. WindowSubscriber.prototype._unsubscribe = function () {
  125336. this.window = null;
  125337. };
  125338. WindowSubscriber.prototype.openWindow = function () {
  125339. var prevWindow = this.window;
  125340. if (prevWindow) {
  125341. prevWindow.complete();
  125342. }
  125343. var destination = this.destination;
  125344. var newWindow = this.window = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
  125345. destination.next(newWindow);
  125346. };
  125347. return WindowSubscriber;
  125348. }(__WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__["a" /* OuterSubscriber */]));
  125349. //# sourceMappingURL=window.js.map
  125350. /***/ }),
  125351. /* 984 */
  125352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125353. "use strict";
  125354. /* harmony export (immutable) */ __webpack_exports__["a"] = windowCount;
  125355. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  125356. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
  125357. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subject__ = __webpack_require__(43);
  125358. /** PURE_IMPORTS_START tslib,_Subscriber,_Subject PURE_IMPORTS_END */
  125359. function windowCount(windowSize, startWindowEvery) {
  125360. if (startWindowEvery === void 0) {
  125361. startWindowEvery = 0;
  125362. }
  125363. return function windowCountOperatorFunction(source) {
  125364. return source.lift(new WindowCountOperator(windowSize, startWindowEvery));
  125365. };
  125366. }
  125367. var WindowCountOperator = /*@__PURE__*/ (function () {
  125368. function WindowCountOperator(windowSize, startWindowEvery) {
  125369. this.windowSize = windowSize;
  125370. this.startWindowEvery = startWindowEvery;
  125371. }
  125372. WindowCountOperator.prototype.call = function (subscriber, source) {
  125373. return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));
  125374. };
  125375. return WindowCountOperator;
  125376. }());
  125377. var WindowCountSubscriber = /*@__PURE__*/ (function (_super) {
  125378. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WindowCountSubscriber, _super);
  125379. function WindowCountSubscriber(destination, windowSize, startWindowEvery) {
  125380. var _this = _super.call(this, destination) || this;
  125381. _this.destination = destination;
  125382. _this.windowSize = windowSize;
  125383. _this.startWindowEvery = startWindowEvery;
  125384. _this.windows = [new __WEBPACK_IMPORTED_MODULE_2__Subject__["a" /* Subject */]()];
  125385. _this.count = 0;
  125386. destination.next(_this.windows[0]);
  125387. return _this;
  125388. }
  125389. WindowCountSubscriber.prototype._next = function (value) {
  125390. var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;
  125391. var destination = this.destination;
  125392. var windowSize = this.windowSize;
  125393. var windows = this.windows;
  125394. var len = windows.length;
  125395. for (var i = 0; i < len && !this.closed; i++) {
  125396. windows[i].next(value);
  125397. }
  125398. var c = this.count - windowSize + 1;
  125399. if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {
  125400. windows.shift().complete();
  125401. }
  125402. if (++this.count % startWindowEvery === 0 && !this.closed) {
  125403. var window_1 = new __WEBPACK_IMPORTED_MODULE_2__Subject__["a" /* Subject */]();
  125404. windows.push(window_1);
  125405. destination.next(window_1);
  125406. }
  125407. };
  125408. WindowCountSubscriber.prototype._error = function (err) {
  125409. var windows = this.windows;
  125410. if (windows) {
  125411. while (windows.length > 0 && !this.closed) {
  125412. windows.shift().error(err);
  125413. }
  125414. }
  125415. this.destination.error(err);
  125416. };
  125417. WindowCountSubscriber.prototype._complete = function () {
  125418. var windows = this.windows;
  125419. if (windows) {
  125420. while (windows.length > 0 && !this.closed) {
  125421. windows.shift().complete();
  125422. }
  125423. }
  125424. this.destination.complete();
  125425. };
  125426. WindowCountSubscriber.prototype._unsubscribe = function () {
  125427. this.count = 0;
  125428. this.windows = null;
  125429. };
  125430. return WindowCountSubscriber;
  125431. }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
  125432. //# sourceMappingURL=windowCount.js.map
  125433. /***/ }),
  125434. /* 985 */
  125435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125436. "use strict";
  125437. /* harmony export (immutable) */ __webpack_exports__["a"] = windowTime;
  125438. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  125439. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
  125440. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(47);
  125441. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(5);
  125442. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isNumeric__ = __webpack_require__(181);
  125443. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_isScheduler__ = __webpack_require__(56);
  125444. /** PURE_IMPORTS_START tslib,_Subject,_scheduler_async,_Subscriber,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */
  125445. function windowTime(windowTimeSpan) {
  125446. var scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* async */];
  125447. var windowCreationInterval = null;
  125448. var maxWindowSize = Number.POSITIVE_INFINITY;
  125449. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* isScheduler */])(arguments[3])) {
  125450. scheduler = arguments[3];
  125451. }
  125452. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* isScheduler */])(arguments[2])) {
  125453. scheduler = arguments[2];
  125454. }
  125455. else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isNumeric__["a" /* isNumeric */])(arguments[2])) {
  125456. maxWindowSize = arguments[2];
  125457. }
  125458. if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* isScheduler */])(arguments[1])) {
  125459. scheduler = arguments[1];
  125460. }
  125461. else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isNumeric__["a" /* isNumeric */])(arguments[1])) {
  125462. windowCreationInterval = arguments[1];
  125463. }
  125464. return function windowTimeOperatorFunction(source) {
  125465. return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));
  125466. };
  125467. }
  125468. var WindowTimeOperator = /*@__PURE__*/ (function () {
  125469. function WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
  125470. this.windowTimeSpan = windowTimeSpan;
  125471. this.windowCreationInterval = windowCreationInterval;
  125472. this.maxWindowSize = maxWindowSize;
  125473. this.scheduler = scheduler;
  125474. }
  125475. WindowTimeOperator.prototype.call = function (subscriber, source) {
  125476. return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));
  125477. };
  125478. return WindowTimeOperator;
  125479. }());
  125480. var CountedSubject = /*@__PURE__*/ (function (_super) {
  125481. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](CountedSubject, _super);
  125482. function CountedSubject() {
  125483. var _this = _super !== null && _super.apply(this, arguments) || this;
  125484. _this._numberOfNextedValues = 0;
  125485. return _this;
  125486. }
  125487. CountedSubject.prototype.next = function (value) {
  125488. this._numberOfNextedValues++;
  125489. _super.prototype.next.call(this, value);
  125490. };
  125491. Object.defineProperty(CountedSubject.prototype, "numberOfNextedValues", {
  125492. get: function () {
  125493. return this._numberOfNextedValues;
  125494. },
  125495. enumerable: true,
  125496. configurable: true
  125497. });
  125498. return CountedSubject;
  125499. }(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]));
  125500. var WindowTimeSubscriber = /*@__PURE__*/ (function (_super) {
  125501. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WindowTimeSubscriber, _super);
  125502. function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
  125503. var _this = _super.call(this, destination) || this;
  125504. _this.destination = destination;
  125505. _this.windowTimeSpan = windowTimeSpan;
  125506. _this.windowCreationInterval = windowCreationInterval;
  125507. _this.maxWindowSize = maxWindowSize;
  125508. _this.scheduler = scheduler;
  125509. _this.windows = [];
  125510. var window = _this.openWindow();
  125511. if (windowCreationInterval !== null && windowCreationInterval >= 0) {
  125512. var closeState = { subscriber: _this, window: window, context: null };
  125513. var creationState = { windowTimeSpan: windowTimeSpan, windowCreationInterval: windowCreationInterval, subscriber: _this, scheduler: scheduler };
  125514. _this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));
  125515. _this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));
  125516. }
  125517. else {
  125518. var timeSpanOnlyState = { subscriber: _this, window: window, windowTimeSpan: windowTimeSpan };
  125519. _this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));
  125520. }
  125521. return _this;
  125522. }
  125523. WindowTimeSubscriber.prototype._next = function (value) {
  125524. var windows = this.windows;
  125525. var len = windows.length;
  125526. for (var i = 0; i < len; i++) {
  125527. var window_1 = windows[i];
  125528. if (!window_1.closed) {
  125529. window_1.next(value);
  125530. if (window_1.numberOfNextedValues >= this.maxWindowSize) {
  125531. this.closeWindow(window_1);
  125532. }
  125533. }
  125534. }
  125535. };
  125536. WindowTimeSubscriber.prototype._error = function (err) {
  125537. var windows = this.windows;
  125538. while (windows.length > 0) {
  125539. windows.shift().error(err);
  125540. }
  125541. this.destination.error(err);
  125542. };
  125543. WindowTimeSubscriber.prototype._complete = function () {
  125544. var windows = this.windows;
  125545. while (windows.length > 0) {
  125546. var window_2 = windows.shift();
  125547. if (!window_2.closed) {
  125548. window_2.complete();
  125549. }
  125550. }
  125551. this.destination.complete();
  125552. };
  125553. WindowTimeSubscriber.prototype.openWindow = function () {
  125554. var window = new CountedSubject();
  125555. this.windows.push(window);
  125556. var destination = this.destination;
  125557. destination.next(window);
  125558. return window;
  125559. };
  125560. WindowTimeSubscriber.prototype.closeWindow = function (window) {
  125561. window.complete();
  125562. var windows = this.windows;
  125563. windows.splice(windows.indexOf(window), 1);
  125564. };
  125565. return WindowTimeSubscriber;
  125566. }(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* Subscriber */]));
  125567. function dispatchWindowTimeSpanOnly(state) {
  125568. var subscriber = state.subscriber, windowTimeSpan = state.windowTimeSpan, window = state.window;
  125569. if (window) {
  125570. subscriber.closeWindow(window);
  125571. }
  125572. state.window = subscriber.openWindow();
  125573. this.schedule(state, windowTimeSpan);
  125574. }
  125575. function dispatchWindowCreation(state) {
  125576. var windowTimeSpan = state.windowTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler, windowCreationInterval = state.windowCreationInterval;
  125577. var window = subscriber.openWindow();
  125578. var action = this;
  125579. var context = { action: action, subscription: null };
  125580. var timeSpanState = { subscriber: subscriber, window: window, context: context };
  125581. context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);
  125582. action.add(context.subscription);
  125583. action.schedule(state, windowCreationInterval);
  125584. }
  125585. function dispatchWindowClose(state) {
  125586. var subscriber = state.subscriber, window = state.window, context = state.context;
  125587. if (context && context.action && context.subscription) {
  125588. context.action.remove(context.subscription);
  125589. }
  125590. subscriber.closeWindow(window);
  125591. }
  125592. //# sourceMappingURL=windowTime.js.map
  125593. /***/ }),
  125594. /* 986 */
  125595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125596. "use strict";
  125597. /* harmony export (immutable) */ __webpack_exports__["a"] = windowToggle;
  125598. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  125599. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
  125600. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(31);
  125601. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(59);
  125602. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(55);
  125603. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__ = __webpack_require__(18);
  125604. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_subscribeToResult__ = __webpack_require__(19);
  125605. /** PURE_IMPORTS_START tslib,_Subject,_Subscription,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  125606. function windowToggle(openings, closingSelector) {
  125607. return function (source) { return source.lift(new WindowToggleOperator(openings, closingSelector)); };
  125608. }
  125609. var WindowToggleOperator = /*@__PURE__*/ (function () {
  125610. function WindowToggleOperator(openings, closingSelector) {
  125611. this.openings = openings;
  125612. this.closingSelector = closingSelector;
  125613. }
  125614. WindowToggleOperator.prototype.call = function (subscriber, source) {
  125615. return source.subscribe(new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector));
  125616. };
  125617. return WindowToggleOperator;
  125618. }());
  125619. var WindowToggleSubscriber = /*@__PURE__*/ (function (_super) {
  125620. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WindowToggleSubscriber, _super);
  125621. function WindowToggleSubscriber(destination, openings, closingSelector) {
  125622. var _this = _super.call(this, destination) || this;
  125623. _this.openings = openings;
  125624. _this.closingSelector = closingSelector;
  125625. _this.contexts = [];
  125626. _this.add(_this.openSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_subscribeToResult__["a" /* subscribeToResult */])(_this, openings, openings));
  125627. return _this;
  125628. }
  125629. WindowToggleSubscriber.prototype._next = function (value) {
  125630. var contexts = this.contexts;
  125631. if (contexts) {
  125632. var len = contexts.length;
  125633. for (var i = 0; i < len; i++) {
  125634. contexts[i].window.next(value);
  125635. }
  125636. }
  125637. };
  125638. WindowToggleSubscriber.prototype._error = function (err) {
  125639. var contexts = this.contexts;
  125640. this.contexts = null;
  125641. if (contexts) {
  125642. var len = contexts.length;
  125643. var index = -1;
  125644. while (++index < len) {
  125645. var context_1 = contexts[index];
  125646. context_1.window.error(err);
  125647. context_1.subscription.unsubscribe();
  125648. }
  125649. }
  125650. _super.prototype._error.call(this, err);
  125651. };
  125652. WindowToggleSubscriber.prototype._complete = function () {
  125653. var contexts = this.contexts;
  125654. this.contexts = null;
  125655. if (contexts) {
  125656. var len = contexts.length;
  125657. var index = -1;
  125658. while (++index < len) {
  125659. var context_2 = contexts[index];
  125660. context_2.window.complete();
  125661. context_2.subscription.unsubscribe();
  125662. }
  125663. }
  125664. _super.prototype._complete.call(this);
  125665. };
  125666. WindowToggleSubscriber.prototype._unsubscribe = function () {
  125667. var contexts = this.contexts;
  125668. this.contexts = null;
  125669. if (contexts) {
  125670. var len = contexts.length;
  125671. var index = -1;
  125672. while (++index < len) {
  125673. var context_3 = contexts[index];
  125674. context_3.window.unsubscribe();
  125675. context_3.subscription.unsubscribe();
  125676. }
  125677. }
  125678. };
  125679. WindowToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  125680. if (outerValue === this.openings) {
  125681. var closingSelector = this.closingSelector;
  125682. var closingNotifier = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(closingSelector)(innerValue);
  125683. if (closingNotifier === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) {
  125684. return this.error(__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e);
  125685. }
  125686. else {
  125687. var window_1 = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
  125688. var subscription = new __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */]();
  125689. var context_4 = { window: window_1, subscription: subscription };
  125690. this.contexts.push(context_4);
  125691. var innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_subscribeToResult__["a" /* subscribeToResult */])(this, closingNotifier, context_4);
  125692. if (innerSubscription.closed) {
  125693. this.closeWindow(this.contexts.length - 1);
  125694. }
  125695. else {
  125696. innerSubscription.context = context_4;
  125697. subscription.add(innerSubscription);
  125698. }
  125699. this.destination.next(window_1);
  125700. }
  125701. }
  125702. else {
  125703. this.closeWindow(this.contexts.indexOf(outerValue));
  125704. }
  125705. };
  125706. WindowToggleSubscriber.prototype.notifyError = function (err) {
  125707. this.error(err);
  125708. };
  125709. WindowToggleSubscriber.prototype.notifyComplete = function (inner) {
  125710. if (inner !== this.openSubscription) {
  125711. this.closeWindow(this.contexts.indexOf(inner.context));
  125712. }
  125713. };
  125714. WindowToggleSubscriber.prototype.closeWindow = function (index) {
  125715. if (index === -1) {
  125716. return;
  125717. }
  125718. var contexts = this.contexts;
  125719. var context = contexts[index];
  125720. var window = context.window, subscription = context.subscription;
  125721. contexts.splice(index, 1);
  125722. window.complete();
  125723. subscription.unsubscribe();
  125724. };
  125725. return WindowToggleSubscriber;
  125726. }(__WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__["a" /* OuterSubscriber */]));
  125727. //# sourceMappingURL=windowToggle.js.map
  125728. /***/ }),
  125729. /* 987 */
  125730. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125731. "use strict";
  125732. /* harmony export (immutable) */ __webpack_exports__["a"] = windowWhen;
  125733. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  125734. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
  125735. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
  125736. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
  125737. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
  125738. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
  125739. /** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  125740. function windowWhen(closingSelector) {
  125741. return function windowWhenOperatorFunction(source) {
  125742. return source.lift(new WindowOperator(closingSelector));
  125743. };
  125744. }
  125745. var WindowOperator = /*@__PURE__*/ (function () {
  125746. function WindowOperator(closingSelector) {
  125747. this.closingSelector = closingSelector;
  125748. }
  125749. WindowOperator.prototype.call = function (subscriber, source) {
  125750. return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));
  125751. };
  125752. return WindowOperator;
  125753. }());
  125754. var WindowSubscriber = /*@__PURE__*/ (function (_super) {
  125755. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WindowSubscriber, _super);
  125756. function WindowSubscriber(destination, closingSelector) {
  125757. var _this = _super.call(this, destination) || this;
  125758. _this.destination = destination;
  125759. _this.closingSelector = closingSelector;
  125760. _this.openWindow();
  125761. return _this;
  125762. }
  125763. WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  125764. this.openWindow(innerSub);
  125765. };
  125766. WindowSubscriber.prototype.notifyError = function (error, innerSub) {
  125767. this._error(error);
  125768. };
  125769. WindowSubscriber.prototype.notifyComplete = function (innerSub) {
  125770. this.openWindow(innerSub);
  125771. };
  125772. WindowSubscriber.prototype._next = function (value) {
  125773. this.window.next(value);
  125774. };
  125775. WindowSubscriber.prototype._error = function (err) {
  125776. this.window.error(err);
  125777. this.destination.error(err);
  125778. this.unsubscribeClosingNotification();
  125779. };
  125780. WindowSubscriber.prototype._complete = function () {
  125781. this.window.complete();
  125782. this.destination.complete();
  125783. this.unsubscribeClosingNotification();
  125784. };
  125785. WindowSubscriber.prototype.unsubscribeClosingNotification = function () {
  125786. if (this.closingNotification) {
  125787. this.closingNotification.unsubscribe();
  125788. }
  125789. };
  125790. WindowSubscriber.prototype.openWindow = function (innerSub) {
  125791. if (innerSub === void 0) {
  125792. innerSub = null;
  125793. }
  125794. if (innerSub) {
  125795. this.remove(innerSub);
  125796. innerSub.unsubscribe();
  125797. }
  125798. var prevWindow = this.window;
  125799. if (prevWindow) {
  125800. prevWindow.complete();
  125801. }
  125802. var window = this.window = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
  125803. this.destination.next(window);
  125804. var closingNotifier = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.closingSelector)();
  125805. if (closingNotifier === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
  125806. var err = __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e;
  125807. this.destination.error(err);
  125808. this.window.error(err);
  125809. }
  125810. else {
  125811. this.add(this.closingNotification = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, closingNotifier));
  125812. }
  125813. };
  125814. return WindowSubscriber;
  125815. }(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
  125816. //# sourceMappingURL=windowWhen.js.map
  125817. /***/ }),
  125818. /* 988 */
  125819. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125820. "use strict";
  125821. /* harmony export (immutable) */ __webpack_exports__["a"] = withLatestFrom;
  125822. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  125823. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
  125824. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
  125825. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  125826. function withLatestFrom() {
  125827. var args = [];
  125828. for (var _i = 0; _i < arguments.length; _i++) {
  125829. args[_i] = arguments[_i];
  125830. }
  125831. return function (source) {
  125832. var project;
  125833. if (typeof args[args.length - 1] === 'function') {
  125834. project = args.pop();
  125835. }
  125836. var observables = args;
  125837. return source.lift(new WithLatestFromOperator(observables, project));
  125838. };
  125839. }
  125840. var WithLatestFromOperator = /*@__PURE__*/ (function () {
  125841. function WithLatestFromOperator(observables, project) {
  125842. this.observables = observables;
  125843. this.project = project;
  125844. }
  125845. WithLatestFromOperator.prototype.call = function (subscriber, source) {
  125846. return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));
  125847. };
  125848. return WithLatestFromOperator;
  125849. }());
  125850. var WithLatestFromSubscriber = /*@__PURE__*/ (function (_super) {
  125851. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WithLatestFromSubscriber, _super);
  125852. function WithLatestFromSubscriber(destination, observables, project) {
  125853. var _this = _super.call(this, destination) || this;
  125854. _this.observables = observables;
  125855. _this.project = project;
  125856. _this.toRespond = [];
  125857. var len = observables.length;
  125858. _this.values = new Array(len);
  125859. for (var i = 0; i < len; i++) {
  125860. _this.toRespond.push(i);
  125861. }
  125862. for (var i = 0; i < len; i++) {
  125863. var observable = observables[i];
  125864. _this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(_this, observable, observable, i));
  125865. }
  125866. return _this;
  125867. }
  125868. WithLatestFromSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  125869. this.values[outerIndex] = innerValue;
  125870. var toRespond = this.toRespond;
  125871. if (toRespond.length > 0) {
  125872. var found = toRespond.indexOf(outerIndex);
  125873. if (found !== -1) {
  125874. toRespond.splice(found, 1);
  125875. }
  125876. }
  125877. };
  125878. WithLatestFromSubscriber.prototype.notifyComplete = function () {
  125879. };
  125880. WithLatestFromSubscriber.prototype._next = function (value) {
  125881. if (this.toRespond.length === 0) {
  125882. var args = [value].concat(this.values);
  125883. if (this.project) {
  125884. this._tryProject(args);
  125885. }
  125886. else {
  125887. this.destination.next(args);
  125888. }
  125889. }
  125890. };
  125891. WithLatestFromSubscriber.prototype._tryProject = function (args) {
  125892. var result;
  125893. try {
  125894. result = this.project.apply(this, args);
  125895. }
  125896. catch (err) {
  125897. this.destination.error(err);
  125898. return;
  125899. }
  125900. this.destination.next(result);
  125901. };
  125902. return WithLatestFromSubscriber;
  125903. }(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
  125904. //# sourceMappingURL=withLatestFrom.js.map
  125905. /***/ }),
  125906. /* 989 */
  125907. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125908. "use strict";
  125909. /* harmony export (immutable) */ __webpack_exports__["a"] = zip;
  125910. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_zip__ = __webpack_require__(255);
  125911. /** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */
  125912. function zip() {
  125913. var observables = [];
  125914. for (var _i = 0; _i < arguments.length; _i++) {
  125915. observables[_i] = arguments[_i];
  125916. }
  125917. return function zipOperatorFunction(source) {
  125918. return source.lift.call(__WEBPACK_IMPORTED_MODULE_0__observable_zip__["a" /* zip */].apply(void 0, [source].concat(observables)));
  125919. };
  125920. }
  125921. //# sourceMappingURL=zip.js.map
  125922. /***/ }),
  125923. /* 990 */
  125924. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125925. "use strict";
  125926. /* harmony export (immutable) */ __webpack_exports__["a"] = zipAll;
  125927. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_zip__ = __webpack_require__(255);
  125928. /** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */
  125929. function zipAll(project) {
  125930. return function (source) { return source.lift(new __WEBPACK_IMPORTED_MODULE_0__observable_zip__["b" /* ZipOperator */](project)); };
  125931. }
  125932. //# sourceMappingURL=zipAll.js.map
  125933. /***/ }),
  125934. /* 991 */
  125935. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125936. "use strict";
  125937. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Action; });
  125938. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  125939. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
  125940. /** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */
  125941. var Action = /*@__PURE__*/ (function (_super) {
  125942. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Action, _super);
  125943. function Action(scheduler, work) {
  125944. return _super.call(this) || this;
  125945. }
  125946. Action.prototype.schedule = function (state, delay) {
  125947. if (delay === void 0) {
  125948. delay = 0;
  125949. }
  125950. return this;
  125951. };
  125952. return Action;
  125953. }(__WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]));
  125954. //# sourceMappingURL=Action.js.map
  125955. /***/ }),
  125956. /* 992 */
  125957. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  125958. "use strict";
  125959. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnimationFrameAction; });
  125960. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  125961. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncAction__ = __webpack_require__(138);
  125962. /** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */
  125963. var AnimationFrameAction = /*@__PURE__*/ (function (_super) {
  125964. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AnimationFrameAction, _super);
  125965. function AnimationFrameAction(scheduler, work) {
  125966. var _this = _super.call(this, scheduler, work) || this;
  125967. _this.scheduler = scheduler;
  125968. _this.work = work;
  125969. return _this;
  125970. }
  125971. AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) {
  125972. if (delay === void 0) {
  125973. delay = 0;
  125974. }
  125975. if (delay !== null && delay > 0) {
  125976. return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
  125977. }
  125978. scheduler.actions.push(this);
  125979. return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(function () { return scheduler.flush(null); }));
  125980. };
  125981. AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
  125982. if (delay === void 0) {
  125983. delay = 0;
  125984. }
  125985. if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
  125986. return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
  125987. }
  125988. if (scheduler.actions.length === 0) {
  125989. cancelAnimationFrame(id);
  125990. scheduler.scheduled = undefined;
  125991. }
  125992. return undefined;
  125993. };
  125994. return AnimationFrameAction;
  125995. }(__WEBPACK_IMPORTED_MODULE_1__AsyncAction__["a" /* AsyncAction */]));
  125996. //# sourceMappingURL=AnimationFrameAction.js.map
  125997. /***/ }),
  125998. /* 993 */
  125999. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126000. "use strict";
  126001. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnimationFrameScheduler; });
  126002. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  126003. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(139);
  126004. /** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */
  126005. var AnimationFrameScheduler = /*@__PURE__*/ (function (_super) {
  126006. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AnimationFrameScheduler, _super);
  126007. function AnimationFrameScheduler() {
  126008. return _super !== null && _super.apply(this, arguments) || this;
  126009. }
  126010. AnimationFrameScheduler.prototype.flush = function (action) {
  126011. this.active = true;
  126012. this.scheduled = undefined;
  126013. var actions = this.actions;
  126014. var error;
  126015. var index = -1;
  126016. var count = actions.length;
  126017. action = action || actions.shift();
  126018. do {
  126019. if (error = action.execute(action.state, action.delay)) {
  126020. break;
  126021. }
  126022. } while (++index < count && (action = actions.shift()));
  126023. this.active = false;
  126024. if (error) {
  126025. while (++index < count && (action = actions.shift())) {
  126026. action.unsubscribe();
  126027. }
  126028. throw error;
  126029. }
  126030. };
  126031. return AnimationFrameScheduler;
  126032. }(__WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */]));
  126033. //# sourceMappingURL=AnimationFrameScheduler.js.map
  126034. /***/ }),
  126035. /* 994 */
  126036. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126037. "use strict";
  126038. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsapAction; });
  126039. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  126040. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_Immediate__ = __webpack_require__(1000);
  126041. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__AsyncAction__ = __webpack_require__(138);
  126042. /** PURE_IMPORTS_START tslib,_util_Immediate,_AsyncAction PURE_IMPORTS_END */
  126043. var AsapAction = /*@__PURE__*/ (function (_super) {
  126044. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsapAction, _super);
  126045. function AsapAction(scheduler, work) {
  126046. var _this = _super.call(this, scheduler, work) || this;
  126047. _this.scheduler = scheduler;
  126048. _this.work = work;
  126049. return _this;
  126050. }
  126051. AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {
  126052. if (delay === void 0) {
  126053. delay = 0;
  126054. }
  126055. if (delay !== null && delay > 0) {
  126056. return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
  126057. }
  126058. scheduler.actions.push(this);
  126059. return scheduler.scheduled || (scheduler.scheduled = __WEBPACK_IMPORTED_MODULE_1__util_Immediate__["a" /* Immediate */].setImmediate(scheduler.flush.bind(scheduler, null)));
  126060. };
  126061. AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
  126062. if (delay === void 0) {
  126063. delay = 0;
  126064. }
  126065. if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
  126066. return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
  126067. }
  126068. if (scheduler.actions.length === 0) {
  126069. __WEBPACK_IMPORTED_MODULE_1__util_Immediate__["a" /* Immediate */].clearImmediate(id);
  126070. scheduler.scheduled = undefined;
  126071. }
  126072. return undefined;
  126073. };
  126074. return AsapAction;
  126075. }(__WEBPACK_IMPORTED_MODULE_2__AsyncAction__["a" /* AsyncAction */]));
  126076. //# sourceMappingURL=AsapAction.js.map
  126077. /***/ }),
  126078. /* 995 */
  126079. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126080. "use strict";
  126081. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsapScheduler; });
  126082. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  126083. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(139);
  126084. /** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */
  126085. var AsapScheduler = /*@__PURE__*/ (function (_super) {
  126086. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsapScheduler, _super);
  126087. function AsapScheduler() {
  126088. return _super !== null && _super.apply(this, arguments) || this;
  126089. }
  126090. AsapScheduler.prototype.flush = function (action) {
  126091. this.active = true;
  126092. this.scheduled = undefined;
  126093. var actions = this.actions;
  126094. var error;
  126095. var index = -1;
  126096. var count = actions.length;
  126097. action = action || actions.shift();
  126098. do {
  126099. if (error = action.execute(action.state, action.delay)) {
  126100. break;
  126101. }
  126102. } while (++index < count && (action = actions.shift()));
  126103. this.active = false;
  126104. if (error) {
  126105. while (++index < count && (action = actions.shift())) {
  126106. action.unsubscribe();
  126107. }
  126108. throw error;
  126109. }
  126110. };
  126111. return AsapScheduler;
  126112. }(__WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */]));
  126113. //# sourceMappingURL=AsapScheduler.js.map
  126114. /***/ }),
  126115. /* 996 */
  126116. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126117. "use strict";
  126118. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return QueueAction; });
  126119. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  126120. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncAction__ = __webpack_require__(138);
  126121. /** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */
  126122. var QueueAction = /*@__PURE__*/ (function (_super) {
  126123. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](QueueAction, _super);
  126124. function QueueAction(scheduler, work) {
  126125. var _this = _super.call(this, scheduler, work) || this;
  126126. _this.scheduler = scheduler;
  126127. _this.work = work;
  126128. return _this;
  126129. }
  126130. QueueAction.prototype.schedule = function (state, delay) {
  126131. if (delay === void 0) {
  126132. delay = 0;
  126133. }
  126134. if (delay > 0) {
  126135. return _super.prototype.schedule.call(this, state, delay);
  126136. }
  126137. this.delay = delay;
  126138. this.state = state;
  126139. this.scheduler.flush(this);
  126140. return this;
  126141. };
  126142. QueueAction.prototype.execute = function (state, delay) {
  126143. return (delay > 0 || this.closed) ?
  126144. _super.prototype.execute.call(this, state, delay) :
  126145. this._execute(state, delay);
  126146. };
  126147. QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {
  126148. if (delay === void 0) {
  126149. delay = 0;
  126150. }
  126151. if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
  126152. return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
  126153. }
  126154. return scheduler.flush(this);
  126155. };
  126156. return QueueAction;
  126157. }(__WEBPACK_IMPORTED_MODULE_1__AsyncAction__["a" /* AsyncAction */]));
  126158. //# sourceMappingURL=QueueAction.js.map
  126159. /***/ }),
  126160. /* 997 */
  126161. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126162. "use strict";
  126163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return QueueScheduler; });
  126164. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  126165. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(139);
  126166. /** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */
  126167. var QueueScheduler = /*@__PURE__*/ (function (_super) {
  126168. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](QueueScheduler, _super);
  126169. function QueueScheduler() {
  126170. return _super !== null && _super.apply(this, arguments) || this;
  126171. }
  126172. return QueueScheduler;
  126173. }(__WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */]));
  126174. //# sourceMappingURL=QueueScheduler.js.map
  126175. /***/ }),
  126176. /* 998 */
  126177. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126178. "use strict";
  126179. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VirtualTimeScheduler; });
  126180. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return VirtualAction; });
  126181. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
  126182. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncAction__ = __webpack_require__(138);
  126183. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__AsyncScheduler__ = __webpack_require__(139);
  126184. /** PURE_IMPORTS_START tslib,_AsyncAction,_AsyncScheduler PURE_IMPORTS_END */
  126185. var VirtualTimeScheduler = /*@__PURE__*/ (function (_super) {
  126186. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](VirtualTimeScheduler, _super);
  126187. function VirtualTimeScheduler(SchedulerAction, maxFrames) {
  126188. if (SchedulerAction === void 0) {
  126189. SchedulerAction = VirtualAction;
  126190. }
  126191. if (maxFrames === void 0) {
  126192. maxFrames = Number.POSITIVE_INFINITY;
  126193. }
  126194. var _this = _super.call(this, SchedulerAction, function () { return _this.frame; }) || this;
  126195. _this.maxFrames = maxFrames;
  126196. _this.frame = 0;
  126197. _this.index = -1;
  126198. return _this;
  126199. }
  126200. VirtualTimeScheduler.prototype.flush = function () {
  126201. var _a = this, actions = _a.actions, maxFrames = _a.maxFrames;
  126202. var error, action;
  126203. while ((action = actions.shift()) && (this.frame = action.delay) <= maxFrames) {
  126204. if (error = action.execute(action.state, action.delay)) {
  126205. break;
  126206. }
  126207. }
  126208. if (error) {
  126209. while (action = actions.shift()) {
  126210. action.unsubscribe();
  126211. }
  126212. throw error;
  126213. }
  126214. };
  126215. VirtualTimeScheduler.frameTimeFactor = 10;
  126216. return VirtualTimeScheduler;
  126217. }(__WEBPACK_IMPORTED_MODULE_2__AsyncScheduler__["a" /* AsyncScheduler */]));
  126218. var VirtualAction = /*@__PURE__*/ (function (_super) {
  126219. __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](VirtualAction, _super);
  126220. function VirtualAction(scheduler, work, index) {
  126221. if (index === void 0) {
  126222. index = scheduler.index += 1;
  126223. }
  126224. var _this = _super.call(this, scheduler, work) || this;
  126225. _this.scheduler = scheduler;
  126226. _this.work = work;
  126227. _this.index = index;
  126228. _this.active = true;
  126229. _this.index = scheduler.index = index;
  126230. return _this;
  126231. }
  126232. VirtualAction.prototype.schedule = function (state, delay) {
  126233. if (delay === void 0) {
  126234. delay = 0;
  126235. }
  126236. if (!this.id) {
  126237. return _super.prototype.schedule.call(this, state, delay);
  126238. }
  126239. this.active = false;
  126240. var action = new VirtualAction(this.scheduler, this.work);
  126241. this.add(action);
  126242. return action.schedule(state, delay);
  126243. };
  126244. VirtualAction.prototype.requestAsyncId = function (scheduler, id, delay) {
  126245. if (delay === void 0) {
  126246. delay = 0;
  126247. }
  126248. this.delay = scheduler.frame + delay;
  126249. var actions = scheduler.actions;
  126250. actions.push(this);
  126251. actions.sort(VirtualAction.sortActions);
  126252. return true;
  126253. };
  126254. VirtualAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
  126255. if (delay === void 0) {
  126256. delay = 0;
  126257. }
  126258. return undefined;
  126259. };
  126260. VirtualAction.prototype._execute = function (state, delay) {
  126261. if (this.active === true) {
  126262. return _super.prototype._execute.call(this, state, delay);
  126263. }
  126264. };
  126265. VirtualAction.sortActions = function (a, b) {
  126266. if (a.delay === b.delay) {
  126267. if (a.index === b.index) {
  126268. return 0;
  126269. }
  126270. else if (a.index > b.index) {
  126271. return 1;
  126272. }
  126273. else {
  126274. return -1;
  126275. }
  126276. }
  126277. else if (a.delay > b.delay) {
  126278. return 1;
  126279. }
  126280. else {
  126281. return -1;
  126282. }
  126283. };
  126284. return VirtualAction;
  126285. }(__WEBPACK_IMPORTED_MODULE_1__AsyncAction__["a" /* AsyncAction */]));
  126286. //# sourceMappingURL=VirtualTimeScheduler.js.map
  126287. /***/ }),
  126288. /* 999 */
  126289. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126290. "use strict";
  126291. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return animationFrame; });
  126292. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AnimationFrameAction__ = __webpack_require__(992);
  126293. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AnimationFrameScheduler__ = __webpack_require__(993);
  126294. /** PURE_IMPORTS_START _AnimationFrameAction,_AnimationFrameScheduler PURE_IMPORTS_END */
  126295. var animationFrame = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__AnimationFrameScheduler__["a" /* AnimationFrameScheduler */](__WEBPACK_IMPORTED_MODULE_0__AnimationFrameAction__["a" /* AnimationFrameAction */]);
  126296. //# sourceMappingURL=animationFrame.js.map
  126297. /***/ }),
  126298. /* 1000 */
  126299. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126300. "use strict";
  126301. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Immediate; });
  126302. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  126303. var nextHandle = 1;
  126304. var tasksByHandle = {};
  126305. function runIfPresent(handle) {
  126306. var cb = tasksByHandle[handle];
  126307. if (cb) {
  126308. cb();
  126309. }
  126310. }
  126311. var Immediate = {
  126312. setImmediate: function (cb) {
  126313. var handle = nextHandle++;
  126314. tasksByHandle[handle] = cb;
  126315. Promise.resolve().then(function () { return runIfPresent(handle); });
  126316. return handle;
  126317. },
  126318. clearImmediate: function (handle) {
  126319. delete tasksByHandle[handle];
  126320. },
  126321. };
  126322. //# sourceMappingURL=Immediate.js.map
  126323. /***/ }),
  126324. /* 1001 */
  126325. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126326. "use strict";
  126327. /* harmony export (immutable) */ __webpack_exports__["a"] = isInteropObservable;
  126328. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_observable__ = __webpack_require__(112);
  126329. /** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */
  126330. function isInteropObservable(input) {
  126331. return input && typeof input[__WEBPACK_IMPORTED_MODULE_0__symbol_observable__["a" /* observable */]] === 'function';
  126332. }
  126333. //# sourceMappingURL=isInteropObservable.js.map
  126334. /***/ }),
  126335. /* 1002 */
  126336. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126337. "use strict";
  126338. /* harmony export (immutable) */ __webpack_exports__["a"] = isIterable;
  126339. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_iterator__ = __webpack_require__(140);
  126340. /** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */
  126341. function isIterable(input) {
  126342. return input && typeof input[__WEBPACK_IMPORTED_MODULE_0__symbol_iterator__["a" /* iterator */]] === 'function';
  126343. }
  126344. //# sourceMappingURL=isIterable.js.map
  126345. /***/ }),
  126346. /* 1003 */
  126347. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126348. "use strict";
  126349. /* harmony export (immutable) */ __webpack_exports__["a"] = isObservable;
  126350. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
  126351. /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
  126352. function isObservable(obj) {
  126353. return !!obj && (obj instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));
  126354. }
  126355. //# sourceMappingURL=isObservable.js.map
  126356. /***/ }),
  126357. /* 1004 */
  126358. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126359. "use strict";
  126360. /* harmony export (immutable) */ __webpack_exports__["a"] = not;
  126361. /** PURE_IMPORTS_START PURE_IMPORTS_END */
  126362. function not(pred, thisArg) {
  126363. function notPred() {
  126364. return !(notPred.pred.apply(notPred.thisArg, arguments));
  126365. }
  126366. notPred.pred = pred;
  126367. notPred.thisArg = thisArg;
  126368. return notPred;
  126369. }
  126370. //# sourceMappingURL=not.js.map
  126371. /***/ }),
  126372. /* 1005 */
  126373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  126374. "use strict";
  126375. /* harmony export (immutable) */ __webpack_exports__["a"] = toSubscriber;
  126376. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Subscriber__ = __webpack_require__(5);
  126377. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__symbol_rxSubscriber__ = __webpack_require__(262);
  126378. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(390);
  126379. /** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */
  126380. function toSubscriber(nextOrObserver, error, complete) {
  126381. if (nextOrObserver) {
  126382. if (nextOrObserver instanceof __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */]) {
  126383. return nextOrObserver;
  126384. }
  126385. if (nextOrObserver[__WEBPACK_IMPORTED_MODULE_1__symbol_rxSubscriber__["a" /* rxSubscriber */]]) {
  126386. return nextOrObserver[__WEBPACK_IMPORTED_MODULE_1__symbol_rxSubscriber__["a" /* rxSubscriber */]]();
  126387. }
  126388. }
  126389. if (!nextOrObserver && !error && !complete) {
  126390. return new __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */](__WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]);
  126391. }
  126392. return new __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */](nextOrObserver, error, complete);
  126393. }
  126394. //# sourceMappingURL=toSubscriber.js.map
  126395. /***/ }),
  126396. /* 1006 */
  126397. /***/ (function(module, exports) {
  126398. // This is not the set of all possible signals.
  126399. //
  126400. // It IS, however, the set of all signals that trigger
  126401. // an exit on either Linux or BSD systems. Linux is a
  126402. // superset of the signal names supported on BSD, and
  126403. // the unknown signals just fail to register, so we can
  126404. // catch that easily enough.
  126405. //
  126406. // Don't bother with SIGKILL. It's uncatchable, which
  126407. // means that we can't fire any callbacks anyway.
  126408. //
  126409. // If a user does happen to register a handler on a non-
  126410. // fatal signal like SIGWINCH or something, and then
  126411. // exit, it'll end up firing `process.emit('exit')`, so
  126412. // the handler will be fired anyway.
  126413. //
  126414. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  126415. // artificially, inherently leave the process in a
  126416. // state from which it is not safe to try and enter JS
  126417. // listeners.
  126418. module.exports = [
  126419. 'SIGABRT',
  126420. 'SIGALRM',
  126421. 'SIGHUP',
  126422. 'SIGINT',
  126423. 'SIGTERM'
  126424. ]
  126425. if (process.platform !== 'win32') {
  126426. module.exports.push(
  126427. 'SIGVTALRM',
  126428. 'SIGXCPU',
  126429. 'SIGXFSZ',
  126430. 'SIGUSR2',
  126431. 'SIGTRAP',
  126432. 'SIGSYS',
  126433. 'SIGQUIT',
  126434. 'SIGIOT'
  126435. // should detect profiler and enable/disable accordingly.
  126436. // see #21
  126437. // 'SIGPROF'
  126438. )
  126439. }
  126440. if (process.platform === 'linux') {
  126441. module.exports.push(
  126442. 'SIGIO',
  126443. 'SIGPOLL',
  126444. 'SIGPWR',
  126445. 'SIGSTKFLT',
  126446. 'SIGUNUSED'
  126447. )
  126448. }
  126449. /***/ }),
  126450. /* 1007 */
  126451. /***/ (function(module, exports, __webpack_require__) {
  126452. "use strict";
  126453. const isPlainObj = __webpack_require__(787);
  126454. module.exports = (obj, opts) => {
  126455. if (!isPlainObj(obj)) {
  126456. throw new TypeError('Expected a plain object');
  126457. }
  126458. opts = opts || {};
  126459. // DEPRECATED
  126460. if (typeof opts === 'function') {
  126461. throw new TypeError('Specify the compare function as an option instead');
  126462. }
  126463. const deep = opts.deep;
  126464. const seenInput = [];
  126465. const seenOutput = [];
  126466. const sortKeys = x => {
  126467. const seenIndex = seenInput.indexOf(x);
  126468. if (seenIndex !== -1) {
  126469. return seenOutput[seenIndex];
  126470. }
  126471. const ret = {};
  126472. const keys = Object.keys(x).sort(opts.compare);
  126473. seenInput.push(x);
  126474. seenOutput.push(ret);
  126475. for (let i = 0; i < keys.length; i++) {
  126476. const key = keys[i];
  126477. const val = x[key];
  126478. if (deep && Array.isArray(val)) {
  126479. const retArr = [];
  126480. for (let j = 0; j < val.length; j++) {
  126481. retArr[j] = isPlainObj(val[j]) ? sortKeys(val[j]) : val[j];
  126482. }
  126483. ret[key] = retArr;
  126484. continue;
  126485. }
  126486. ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val;
  126487. }
  126488. return ret;
  126489. };
  126490. return sortKeys(obj);
  126491. };
  126492. /***/ }),
  126493. /* 1008 */
  126494. /***/ (function(module, exports, __webpack_require__) {
  126495. /*
  126496. Copyright 2015 Kyle E. Mitchell
  126497. Licensed under the Apache License, Version 2.0 (the "License");
  126498. you may not use this file except in compliance with the License.
  126499. You may obtain a copy of the License at
  126500. http://www.apache.org/licenses/LICENSE-2.0
  126501. Unless required by applicable law or agreed to in writing, software
  126502. distributed under the License is distributed on an "AS IS" BASIS,
  126503. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  126504. See the License for the specific language governing permissions and
  126505. limitations under the License.
  126506. */
  126507. var parse = __webpack_require__(422)
  126508. var spdxLicenseIds = __webpack_require__(423)
  126509. function valid (string) {
  126510. try {
  126511. parse(string)
  126512. return true
  126513. } catch (error) {
  126514. return false
  126515. }
  126516. }
  126517. // Common transpositions of license identifier acronyms
  126518. var transpositions = [
  126519. ['APGL', 'AGPL'],
  126520. ['Gpl', 'GPL'],
  126521. ['GLP', 'GPL'],
  126522. ['APL', 'Apache'],
  126523. ['ISD', 'ISC'],
  126524. ['GLP', 'GPL'],
  126525. ['IST', 'ISC'],
  126526. ['Claude', 'Clause'],
  126527. [' or later', '+'],
  126528. [' International', ''],
  126529. ['GNU', 'GPL'],
  126530. ['GUN', 'GPL'],
  126531. ['+', ''],
  126532. ['GNU GPL', 'GPL'],
  126533. ['GNU/GPL', 'GPL'],
  126534. ['GNU GLP', 'GPL'],
  126535. ['GNU General Public License', 'GPL'],
  126536. ['Gnu public license', 'GPL'],
  126537. ['GNU Public License', 'GPL'],
  126538. ['GNU GENERAL PUBLIC LICENSE', 'GPL'],
  126539. ['MTI', 'MIT'],
  126540. ['Mozilla Public License', 'MPL'],
  126541. ['WTH', 'WTF'],
  126542. ['-License', '']
  126543. ]
  126544. var TRANSPOSED = 0
  126545. var CORRECT = 1
  126546. // Simple corrections to nearly valid identifiers.
  126547. var transforms = [
  126548. // e.g. 'mit'
  126549. function (argument) {
  126550. return argument.toUpperCase()
  126551. },
  126552. // e.g. 'MIT '
  126553. function (argument) {
  126554. return argument.trim()
  126555. },
  126556. // e.g. 'M.I.T.'
  126557. function (argument) {
  126558. return argument.replace(/\./g, '')
  126559. },
  126560. // e.g. 'Apache- 2.0'
  126561. function (argument) {
  126562. return argument.replace(/\s+/g, '')
  126563. },
  126564. // e.g. 'CC BY 4.0''
  126565. function (argument) {
  126566. return argument.replace(/\s+/g, '-')
  126567. },
  126568. // e.g. 'LGPLv2.1'
  126569. function (argument) {
  126570. return argument.replace('v', '-')
  126571. },
  126572. // e.g. 'Apache 2.0'
  126573. function (argument) {
  126574. return argument.replace(/,?\s*(\d)/, '-$1')
  126575. },
  126576. // e.g. 'GPL 2'
  126577. function (argument) {
  126578. return argument.replace(/,?\s*(\d)/, '-$1.0')
  126579. },
  126580. // e.g. 'Apache Version 2.0'
  126581. function (argument) {
  126582. return argument
  126583. .replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2')
  126584. },
  126585. // e.g. 'Apache Version 2'
  126586. function (argument) {
  126587. return argument
  126588. .replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2.0')
  126589. },
  126590. // e.g. 'ZLIB'
  126591. function (argument) {
  126592. return argument[0].toUpperCase() + argument.slice(1)
  126593. },
  126594. // e.g. 'MPL/2.0'
  126595. function (argument) {
  126596. return argument.replace('/', '-')
  126597. },
  126598. // e.g. 'Apache 2'
  126599. function (argument) {
  126600. return argument
  126601. .replace(/\s*V\s*(\d)/, '-$1')
  126602. .replace(/(\d)$/, '$1.0')
  126603. },
  126604. // e.g. 'GPL-2.0', 'GPL-3.0'
  126605. function (argument) {
  126606. if (argument.indexOf('3.0') !== -1) {
  126607. return argument + '-or-later'
  126608. } else {
  126609. return argument + '-only'
  126610. }
  126611. },
  126612. // e.g. 'GPL-2.0-'
  126613. function (argument) {
  126614. return argument + 'only'
  126615. },
  126616. // e.g. 'GPL2'
  126617. function (argument) {
  126618. return argument.replace(/(\d)$/, '-$1.0')
  126619. },
  126620. // e.g. 'BSD 3'
  126621. function (argument) {
  126622. return argument.replace(/(-| )?(\d)$/, '-$2-Clause')
  126623. },
  126624. // e.g. 'BSD clause 3'
  126625. function (argument) {
  126626. return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause')
  126627. },
  126628. // e.g. 'BY-NC-4.0'
  126629. function (argument) {
  126630. return 'CC-' + argument
  126631. },
  126632. // e.g. 'BY-NC'
  126633. function (argument) {
  126634. return 'CC-' + argument + '-4.0'
  126635. },
  126636. // e.g. 'Attribution-NonCommercial'
  126637. function (argument) {
  126638. return argument
  126639. .replace('Attribution', 'BY')
  126640. .replace('NonCommercial', 'NC')
  126641. .replace('NoDerivatives', 'ND')
  126642. .replace(/ (\d)/, '-$1')
  126643. .replace(/ ?International/, '')
  126644. },
  126645. // e.g. 'Attribution-NonCommercial'
  126646. function (argument) {
  126647. return 'CC-' +
  126648. argument
  126649. .replace('Attribution', 'BY')
  126650. .replace('NonCommercial', 'NC')
  126651. .replace('NoDerivatives', 'ND')
  126652. .replace(/ (\d)/, '-$1')
  126653. .replace(/ ?International/, '') +
  126654. '-4.0'
  126655. }
  126656. ]
  126657. var licensesWithVersions = spdxLicenseIds
  126658. .map(function (id) {
  126659. var match = /^(.*)-\d+\.\d+$/.exec(id)
  126660. return match
  126661. ? [match[0], match[1]]
  126662. : [id, null]
  126663. })
  126664. .reduce(function (objectMap, item) {
  126665. var key = item[1]
  126666. objectMap[key] = objectMap[key] || []
  126667. objectMap[key].push(item[0])
  126668. return objectMap
  126669. }, {})
  126670. var licensesWithOneVersion = Object.keys(licensesWithVersions)
  126671. .map(function makeEntries (key) {
  126672. return [key, licensesWithVersions[key]]
  126673. })
  126674. .filter(function identifySoleVersions (item) {
  126675. return (
  126676. // Licenses has just one valid version suffix.
  126677. item[1].length === 1 &&
  126678. item[0] !== null &&
  126679. // APL will be considered Apache, rather than APL-1.0
  126680. item[0] !== 'APL'
  126681. )
  126682. })
  126683. .map(function createLastResorts (item) {
  126684. return [item[0], item[1][0]]
  126685. })
  126686. licensesWithVersions = undefined
  126687. // If all else fails, guess that strings containing certain substrings
  126688. // meant to identify certain licenses.
  126689. var lastResorts = [
  126690. ['UNLI', 'Unlicense'],
  126691. ['WTF', 'WTFPL'],
  126692. ['2 CLAUSE', 'BSD-2-Clause'],
  126693. ['2-CLAUSE', 'BSD-2-Clause'],
  126694. ['3 CLAUSE', 'BSD-3-Clause'],
  126695. ['3-CLAUSE', 'BSD-3-Clause'],
  126696. ['AFFERO', 'AGPL-3.0-or-later'],
  126697. ['AGPL', 'AGPL-3.0-or-later'],
  126698. ['APACHE', 'Apache-2.0'],
  126699. ['ARTISTIC', 'Artistic-2.0'],
  126700. ['Affero', 'AGPL-3.0-or-later'],
  126701. ['BEER', 'Beerware'],
  126702. ['BOOST', 'BSL-1.0'],
  126703. ['BSD', 'BSD-2-Clause'],
  126704. ['CDDL', 'CDDL-1.1'],
  126705. ['ECLIPSE', 'EPL-1.0'],
  126706. ['FUCK', 'WTFPL'],
  126707. ['GNU', 'GPL-3.0-or-later'],
  126708. ['LGPL', 'LGPL-3.0-or-later'],
  126709. ['GPLV1', 'GPL-1.0-only'],
  126710. ['GPLV2', 'GPL-2.0-only'],
  126711. ['GPL', 'GPL-3.0-or-later'],
  126712. ['MIT +NO-FALSE-ATTRIBS', 'MITNFA'],
  126713. ['MIT', 'MIT'],
  126714. ['MPL', 'MPL-2.0'],
  126715. ['X11', 'X11'],
  126716. ['ZLIB', 'Zlib']
  126717. ].concat(licensesWithOneVersion)
  126718. var SUBSTRING = 0
  126719. var IDENTIFIER = 1
  126720. var validTransformation = function (identifier) {
  126721. for (var i = 0; i < transforms.length; i++) {
  126722. var transformed = transforms[i](identifier).trim()
  126723. if (transformed !== identifier && valid(transformed)) {
  126724. return transformed
  126725. }
  126726. }
  126727. return null
  126728. }
  126729. var validLastResort = function (identifier) {
  126730. var upperCased = identifier.toUpperCase()
  126731. for (var i = 0; i < lastResorts.length; i++) {
  126732. var lastResort = lastResorts[i]
  126733. if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) {
  126734. return lastResort[IDENTIFIER]
  126735. }
  126736. }
  126737. return null
  126738. }
  126739. var anyCorrection = function (identifier, check) {
  126740. for (var i = 0; i < transpositions.length; i++) {
  126741. var transposition = transpositions[i]
  126742. var transposed = transposition[TRANSPOSED]
  126743. if (identifier.indexOf(transposed) > -1) {
  126744. var corrected = identifier.replace(
  126745. transposed,
  126746. transposition[CORRECT]
  126747. )
  126748. var checked = check(corrected)
  126749. if (checked !== null) {
  126750. return checked
  126751. }
  126752. }
  126753. }
  126754. return null
  126755. }
  126756. module.exports = function (identifier) {
  126757. var validArugment = (
  126758. typeof identifier === 'string' &&
  126759. identifier.trim().length !== 0
  126760. )
  126761. if (!validArugment) {
  126762. throw Error('Invalid argument. Expected non-empty string.')
  126763. }
  126764. identifier = identifier.replace(/\+$/, '').trim()
  126765. if (valid(identifier)) {
  126766. return upgradeGPLs(identifier)
  126767. }
  126768. var transformed = validTransformation(identifier)
  126769. if (transformed !== null) {
  126770. return upgradeGPLs(transformed)
  126771. }
  126772. transformed = anyCorrection(identifier, function (argument) {
  126773. if (valid(argument)) {
  126774. return argument
  126775. }
  126776. return validTransformation(argument)
  126777. })
  126778. if (transformed !== null) {
  126779. return upgradeGPLs(transformed)
  126780. }
  126781. transformed = validLastResort(identifier)
  126782. if (transformed !== null) {
  126783. return upgradeGPLs(transformed)
  126784. }
  126785. transformed = anyCorrection(identifier, validLastResort)
  126786. if (transformed !== null) {
  126787. return upgradeGPLs(transformed)
  126788. }
  126789. return null
  126790. }
  126791. function upgradeGPLs (value) {
  126792. if ([
  126793. 'GPL-1.0', 'LGPL-1.0', 'AGPL-1.0',
  126794. 'GPL-2.0', 'LGPL-2.0', 'AGPL-2.0',
  126795. 'LGPL-2.1'
  126796. ].indexOf(value) !== -1) {
  126797. return value + '-only'
  126798. } else if (['GPL-3.0', 'LGPL-3.0', 'AGPL-3.0'].indexOf(value) !== -1) {
  126799. return value + '-or-later'
  126800. } else {
  126801. return value
  126802. }
  126803. }
  126804. /***/ }),
  126805. /* 1009 */
  126806. /***/ (function(module, exports) {
  126807. module.exports = ["389-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Bison-exception-2.2","Bootloader-exception","CLISP-exception-2.0","Classpath-exception-2.0","DigiRule-FOSS-exception","FLTK-exception","Fawkes-Runtime-exception","Font-exception-2.0","GCC-exception-2.0","GCC-exception-3.1","LZMA-exception","Libtool-exception","Linux-syscall-note","Nokia-Qt-exception-1.1","OCCT-exception-1.0","Qwt-exception-1.0","WxWindows-exception-3.1","eCos-exception-2.0","freertos-exception-2.0","gnu-javamail-exception","i2p-gpl-java-exception","mif-exception","openvpn-openssl-exception","u-boot-exception-2.0"]
  126808. /***/ }),
  126809. /* 1010 */
  126810. /***/ (function(module, exports, __webpack_require__) {
  126811. "use strict";
  126812. // The ABNF grammar in the spec is totally ambiguous.
  126813. //
  126814. // This parser follows the operator precedence defined in the
  126815. // `Order of Precedence and Parentheses` section.
  126816. module.exports = function (tokens) {
  126817. var index = 0
  126818. function hasMore () {
  126819. return index < tokens.length
  126820. }
  126821. function token () {
  126822. return hasMore() ? tokens[index] : null
  126823. }
  126824. function next () {
  126825. if (!hasMore()) {
  126826. throw new Error()
  126827. }
  126828. index++
  126829. }
  126830. function parseOperator (operator) {
  126831. var t = token()
  126832. if (t && t.type === 'OPERATOR' && operator === t.string) {
  126833. next()
  126834. return t.string
  126835. }
  126836. }
  126837. function parseWith () {
  126838. if (parseOperator('WITH')) {
  126839. var t = token()
  126840. if (t && t.type === 'EXCEPTION') {
  126841. next()
  126842. return t.string
  126843. }
  126844. throw new Error('Expected exception after `WITH`')
  126845. }
  126846. }
  126847. function parseLicenseRef () {
  126848. // TODO: Actually, everything is concatenated into one string
  126849. // for backward-compatibility but it could be better to return
  126850. // a nice structure.
  126851. var begin = index
  126852. var string = ''
  126853. var t = token()
  126854. if (t.type === 'DOCUMENTREF') {
  126855. next()
  126856. string += 'DocumentRef-' + t.string + ':'
  126857. if (!parseOperator(':')) {
  126858. throw new Error('Expected `:` after `DocumentRef-...`')
  126859. }
  126860. }
  126861. t = token()
  126862. if (t.type === 'LICENSEREF') {
  126863. next()
  126864. string += 'LicenseRef-' + t.string
  126865. return {license: string}
  126866. }
  126867. index = begin
  126868. }
  126869. function parseLicense () {
  126870. var t = token()
  126871. if (t && t.type === 'LICENSE') {
  126872. next()
  126873. var node = {license: t.string}
  126874. if (parseOperator('+')) {
  126875. node.plus = true
  126876. }
  126877. var exception = parseWith()
  126878. if (exception) {
  126879. node.exception = exception
  126880. }
  126881. return node
  126882. }
  126883. }
  126884. function parseParenthesizedExpression () {
  126885. var left = parseOperator('(')
  126886. if (!left) {
  126887. return
  126888. }
  126889. var expr = parseExpression()
  126890. if (!parseOperator(')')) {
  126891. throw new Error('Expected `)`')
  126892. }
  126893. return expr
  126894. }
  126895. function parseAtom () {
  126896. return (
  126897. parseParenthesizedExpression() ||
  126898. parseLicenseRef() ||
  126899. parseLicense()
  126900. )
  126901. }
  126902. function makeBinaryOpParser (operator, nextParser) {
  126903. return function parseBinaryOp () {
  126904. var left = nextParser()
  126905. if (!left) {
  126906. return
  126907. }
  126908. if (!parseOperator(operator)) {
  126909. return left
  126910. }
  126911. var right = parseBinaryOp()
  126912. if (!right) {
  126913. throw new Error('Expected expression')
  126914. }
  126915. return {
  126916. left: left,
  126917. conjunction: operator.toLowerCase(),
  126918. right: right
  126919. }
  126920. }
  126921. }
  126922. var parseAnd = makeBinaryOpParser('AND', parseAtom)
  126923. var parseExpression = makeBinaryOpParser('OR', parseAnd)
  126924. var node = parseExpression()
  126925. if (!node || hasMore()) {
  126926. throw new Error('Syntax error')
  126927. }
  126928. return node
  126929. }
  126930. /***/ }),
  126931. /* 1011 */
  126932. /***/ (function(module, exports, __webpack_require__) {
  126933. "use strict";
  126934. var licenses = []
  126935. .concat(__webpack_require__(423))
  126936. .concat(__webpack_require__(1012))
  126937. var exceptions = __webpack_require__(1009)
  126938. module.exports = function (source) {
  126939. var index = 0
  126940. function hasMore () {
  126941. return index < source.length
  126942. }
  126943. // `value` can be a regexp or a string.
  126944. // If it is recognized, the matching source string is returned and
  126945. // the index is incremented. Otherwise `undefined` is returned.
  126946. function read (value) {
  126947. if (value instanceof RegExp) {
  126948. var chars = source.slice(index)
  126949. var match = chars.match(value)
  126950. if (match) {
  126951. index += match[0].length
  126952. return match[0]
  126953. }
  126954. } else {
  126955. if (source.indexOf(value, index) === index) {
  126956. index += value.length
  126957. return value
  126958. }
  126959. }
  126960. }
  126961. function skipWhitespace () {
  126962. read(/[ ]*/)
  126963. }
  126964. function operator () {
  126965. var string
  126966. var possibilities = ['WITH', 'AND', 'OR', '(', ')', ':', '+']
  126967. for (var i = 0; i < possibilities.length; i++) {
  126968. string = read(possibilities[i])
  126969. if (string) {
  126970. break
  126971. }
  126972. }
  126973. if (string === '+' && index > 1 && source[index - 2] === ' ') {
  126974. throw new Error('Space before `+`')
  126975. }
  126976. return string && {
  126977. type: 'OPERATOR',
  126978. string: string
  126979. }
  126980. }
  126981. function idstring () {
  126982. return read(/[A-Za-z0-9-.]+/)
  126983. }
  126984. function expectIdstring () {
  126985. var string = idstring()
  126986. if (!string) {
  126987. throw new Error('Expected idstring at offset ' + index)
  126988. }
  126989. return string
  126990. }
  126991. function documentRef () {
  126992. if (read('DocumentRef-')) {
  126993. var string = expectIdstring()
  126994. return {type: 'DOCUMENTREF', string: string}
  126995. }
  126996. }
  126997. function licenseRef () {
  126998. if (read('LicenseRef-')) {
  126999. var string = expectIdstring()
  127000. return {type: 'LICENSEREF', string: string}
  127001. }
  127002. }
  127003. function identifier () {
  127004. var begin = index
  127005. var string = idstring()
  127006. if (licenses.indexOf(string) !== -1) {
  127007. return {
  127008. type: 'LICENSE',
  127009. string: string
  127010. }
  127011. } else if (exceptions.indexOf(string) !== -1) {
  127012. return {
  127013. type: 'EXCEPTION',
  127014. string: string
  127015. }
  127016. }
  127017. index = begin
  127018. }
  127019. // Tries to read the next token. Returns `undefined` if no token is
  127020. // recognized.
  127021. function parseToken () {
  127022. // Ordering matters
  127023. return (
  127024. operator() ||
  127025. documentRef() ||
  127026. licenseRef() ||
  127027. identifier()
  127028. )
  127029. }
  127030. var tokens = []
  127031. while (hasMore()) {
  127032. skipWhitespace()
  127033. if (!hasMore()) {
  127034. break
  127035. }
  127036. var token = parseToken()
  127037. if (!token) {
  127038. throw new Error('Unexpected `' + source[index] +
  127039. '` at offset ' + index)
  127040. }
  127041. tokens.push(token)
  127042. }
  127043. return tokens
  127044. }
  127045. /***/ }),
  127046. /* 1012 */
  127047. /***/ (function(module, exports) {
  127048. module.exports = ["AGPL-3.0","eCos-2.0","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-2.0-with-GCC-exception","GPL-2.0","GPL-3.0-with-autoconf-exception","GPL-3.0-with-GCC-exception","GPL-3.0","LGPL-2.0","LGPL-2.1","LGPL-3.0","Nunit","StandardML-NJ","wxWindows"]
  127049. /***/ }),
  127050. /* 1013 */
  127051. /***/ (function(module, exports, __webpack_require__) {
  127052. // Copyright 2017 Joyent, Inc.
  127053. module.exports = {
  127054. read: read,
  127055. verify: verify,
  127056. sign: sign,
  127057. signAsync: signAsync,
  127058. write: write,
  127059. /* Internal private API */
  127060. fromBuffer: fromBuffer,
  127061. toBuffer: toBuffer
  127062. };
  127063. var assert = __webpack_require__(22);
  127064. var SSHBuffer = __webpack_require__(148);
  127065. var crypto = __webpack_require__(21);
  127066. var Buffer = __webpack_require__(20).Buffer;
  127067. var algs = __webpack_require__(39);
  127068. var Key = __webpack_require__(35);
  127069. var PrivateKey = __webpack_require__(40);
  127070. var Identity = __webpack_require__(147);
  127071. var rfc4253 = __webpack_require__(92);
  127072. var Signature = __webpack_require__(71);
  127073. var utils = __webpack_require__(32);
  127074. var Certificate = __webpack_require__(144);
  127075. function verify(cert, key) {
  127076. /*
  127077. * We always give an issuerKey, so if our verify() is being called then
  127078. * there was no signature. Return false.
  127079. */
  127080. return (false);
  127081. }
  127082. var TYPES = {
  127083. 'user': 1,
  127084. 'host': 2
  127085. };
  127086. Object.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; });
  127087. var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/;
  127088. function read(buf, options) {
  127089. if (Buffer.isBuffer(buf))
  127090. buf = buf.toString('ascii');
  127091. var parts = buf.trim().split(/[ \t\n]+/g);
  127092. if (parts.length < 2 || parts.length > 3)
  127093. throw (new Error('Not a valid SSH certificate line'));
  127094. var algo = parts[0];
  127095. var data = parts[1];
  127096. data = Buffer.from(data, 'base64');
  127097. return (fromBuffer(data, algo));
  127098. }
  127099. function fromBuffer(data, algo, partial) {
  127100. var sshbuf = new SSHBuffer({ buffer: data });
  127101. var innerAlgo = sshbuf.readString();
  127102. if (algo !== undefined && innerAlgo !== algo)
  127103. throw (new Error('SSH certificate algorithm mismatch'));
  127104. if (algo === undefined)
  127105. algo = innerAlgo;
  127106. var cert = {};
  127107. cert.signatures = {};
  127108. cert.signatures.openssh = {};
  127109. cert.signatures.openssh.nonce = sshbuf.readBuffer();
  127110. var key = {};
  127111. var parts = (key.parts = []);
  127112. key.type = getAlg(algo);
  127113. var partCount = algs.info[key.type].parts.length;
  127114. while (parts.length < partCount)
  127115. parts.push(sshbuf.readPart());
  127116. assert.ok(parts.length >= 1, 'key must have at least one part');
  127117. var algInfo = algs.info[key.type];
  127118. if (key.type === 'ecdsa') {
  127119. var res = ECDSA_ALGO.exec(algo);
  127120. assert.ok(res !== null);
  127121. assert.strictEqual(res[1], parts[0].data.toString());
  127122. }
  127123. for (var i = 0; i < algInfo.parts.length; ++i) {
  127124. parts[i].name = algInfo.parts[i];
  127125. if (parts[i].name !== 'curve' &&
  127126. algInfo.normalize !== false) {
  127127. var p = parts[i];
  127128. p.data = utils.mpNormalize(p.data);
  127129. }
  127130. }
  127131. cert.subjectKey = new Key(key);
  127132. cert.serial = sshbuf.readInt64();
  127133. var type = TYPES[sshbuf.readInt()];
  127134. assert.string(type, 'valid cert type');
  127135. cert.signatures.openssh.keyId = sshbuf.readString();
  127136. var principals = [];
  127137. var pbuf = sshbuf.readBuffer();
  127138. var psshbuf = new SSHBuffer({ buffer: pbuf });
  127139. while (!psshbuf.atEnd())
  127140. principals.push(psshbuf.readString());
  127141. if (principals.length === 0)
  127142. principals = ['*'];
  127143. cert.subjects = principals.map(function (pr) {
  127144. if (type === 'user')
  127145. return (Identity.forUser(pr));
  127146. else if (type === 'host')
  127147. return (Identity.forHost(pr));
  127148. throw (new Error('Unknown identity type ' + type));
  127149. });
  127150. cert.validFrom = int64ToDate(sshbuf.readInt64());
  127151. cert.validUntil = int64ToDate(sshbuf.readInt64());
  127152. cert.signatures.openssh.critical = sshbuf.readBuffer();
  127153. cert.signatures.openssh.exts = sshbuf.readBuffer();
  127154. /* reserved */
  127155. sshbuf.readBuffer();
  127156. var signingKeyBuf = sshbuf.readBuffer();
  127157. cert.issuerKey = rfc4253.read(signingKeyBuf);
  127158. /*
  127159. * OpenSSH certs don't give the identity of the issuer, just their
  127160. * public key. So, we use an Identity that matches anything. The
  127161. * isSignedBy() function will later tell you if the key matches.
  127162. */
  127163. cert.issuer = Identity.forHost('**');
  127164. var sigBuf = sshbuf.readBuffer();
  127165. cert.signatures.openssh.signature =
  127166. Signature.parse(sigBuf, cert.issuerKey.type, 'ssh');
  127167. if (partial !== undefined) {
  127168. partial.remainder = sshbuf.remainder();
  127169. partial.consumed = sshbuf._offset;
  127170. }
  127171. return (new Certificate(cert));
  127172. }
  127173. function int64ToDate(buf) {
  127174. var i = buf.readUInt32BE(0) * 4294967296;
  127175. i += buf.readUInt32BE(4);
  127176. var d = new Date();
  127177. d.setTime(i * 1000);
  127178. d.sourceInt64 = buf;
  127179. return (d);
  127180. }
  127181. function dateToInt64(date) {
  127182. if (date.sourceInt64 !== undefined)
  127183. return (date.sourceInt64);
  127184. var i = Math.round(date.getTime() / 1000);
  127185. var upper = Math.floor(i / 4294967296);
  127186. var lower = Math.floor(i % 4294967296);
  127187. var buf = Buffer.alloc(8);
  127188. buf.writeUInt32BE(upper, 0);
  127189. buf.writeUInt32BE(lower, 4);
  127190. return (buf);
  127191. }
  127192. function sign(cert, key) {
  127193. if (cert.signatures.openssh === undefined)
  127194. cert.signatures.openssh = {};
  127195. try {
  127196. var blob = toBuffer(cert, true);
  127197. } catch (e) {
  127198. delete (cert.signatures.openssh);
  127199. return (false);
  127200. }
  127201. var sig = cert.signatures.openssh;
  127202. var hashAlgo = undefined;
  127203. if (key.type === 'rsa' || key.type === 'dsa')
  127204. hashAlgo = 'sha1';
  127205. var signer = key.createSign(hashAlgo);
  127206. signer.write(blob);
  127207. sig.signature = signer.sign();
  127208. return (true);
  127209. }
  127210. function signAsync(cert, signer, done) {
  127211. if (cert.signatures.openssh === undefined)
  127212. cert.signatures.openssh = {};
  127213. try {
  127214. var blob = toBuffer(cert, true);
  127215. } catch (e) {
  127216. delete (cert.signatures.openssh);
  127217. done(e);
  127218. return;
  127219. }
  127220. var sig = cert.signatures.openssh;
  127221. signer(blob, function (err, signature) {
  127222. if (err) {
  127223. done(err);
  127224. return;
  127225. }
  127226. try {
  127227. /*
  127228. * This will throw if the signature isn't of a
  127229. * type/algo that can be used for SSH.
  127230. */
  127231. signature.toBuffer('ssh');
  127232. } catch (e) {
  127233. done(e);
  127234. return;
  127235. }
  127236. sig.signature = signature;
  127237. done();
  127238. });
  127239. }
  127240. function write(cert, options) {
  127241. if (options === undefined)
  127242. options = {};
  127243. var blob = toBuffer(cert);
  127244. var out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64');
  127245. if (options.comment)
  127246. out = out + ' ' + options.comment;
  127247. return (out);
  127248. }
  127249. function toBuffer(cert, noSig) {
  127250. assert.object(cert.signatures.openssh, 'signature for openssh format');
  127251. var sig = cert.signatures.openssh;
  127252. if (sig.nonce === undefined)
  127253. sig.nonce = crypto.randomBytes(16);
  127254. var buf = new SSHBuffer({});
  127255. buf.writeString(getCertType(cert.subjectKey));
  127256. buf.writeBuffer(sig.nonce);
  127257. var key = cert.subjectKey;
  127258. var algInfo = algs.info[key.type];
  127259. algInfo.parts.forEach(function (part) {
  127260. buf.writePart(key.part[part]);
  127261. });
  127262. buf.writeInt64(cert.serial);
  127263. var type = cert.subjects[0].type;
  127264. assert.notStrictEqual(type, 'unknown');
  127265. cert.subjects.forEach(function (id) {
  127266. assert.strictEqual(id.type, type);
  127267. });
  127268. type = TYPES[type];
  127269. buf.writeInt(type);
  127270. if (sig.keyId === undefined) {
  127271. sig.keyId = cert.subjects[0].type + '_' +
  127272. (cert.subjects[0].uid || cert.subjects[0].hostname);
  127273. }
  127274. buf.writeString(sig.keyId);
  127275. var sub = new SSHBuffer({});
  127276. cert.subjects.forEach(function (id) {
  127277. if (type === TYPES.host)
  127278. sub.writeString(id.hostname);
  127279. else if (type === TYPES.user)
  127280. sub.writeString(id.uid);
  127281. });
  127282. buf.writeBuffer(sub.toBuffer());
  127283. buf.writeInt64(dateToInt64(cert.validFrom));
  127284. buf.writeInt64(dateToInt64(cert.validUntil));
  127285. if (sig.critical === undefined)
  127286. sig.critical = Buffer.alloc(0);
  127287. buf.writeBuffer(sig.critical);
  127288. if (sig.exts === undefined)
  127289. sig.exts = Buffer.alloc(0);
  127290. buf.writeBuffer(sig.exts);
  127291. /* reserved */
  127292. buf.writeBuffer(Buffer.alloc(0));
  127293. sub = rfc4253.write(cert.issuerKey);
  127294. buf.writeBuffer(sub);
  127295. if (!noSig)
  127296. buf.writeBuffer(sig.signature.toBuffer('ssh'));
  127297. return (buf.toBuffer());
  127298. }
  127299. function getAlg(certType) {
  127300. if (certType === 'ssh-rsa-cert-v01@openssh.com')
  127301. return ('rsa');
  127302. if (certType === 'ssh-dss-cert-v01@openssh.com')
  127303. return ('dsa');
  127304. if (certType.match(ECDSA_ALGO))
  127305. return ('ecdsa');
  127306. if (certType === 'ssh-ed25519-cert-v01@openssh.com')
  127307. return ('ed25519');
  127308. throw (new Error('Unsupported cert type ' + certType));
  127309. }
  127310. function getCertType(key) {
  127311. if (key.type === 'rsa')
  127312. return ('ssh-rsa-cert-v01@openssh.com');
  127313. if (key.type === 'dsa')
  127314. return ('ssh-dss-cert-v01@openssh.com');
  127315. if (key.type === 'ecdsa')
  127316. return ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com');
  127317. if (key.type === 'ed25519')
  127318. return ('ssh-ed25519-cert-v01@openssh.com');
  127319. throw (new Error('Unsupported key type ' + key.type));
  127320. }
  127321. /***/ }),
  127322. /* 1014 */
  127323. /***/ (function(module, exports, __webpack_require__) {
  127324. // Copyright 2016 Joyent, Inc.
  127325. var x509 = __webpack_require__(427);
  127326. module.exports = {
  127327. read: read,
  127328. verify: x509.verify,
  127329. sign: x509.sign,
  127330. write: write
  127331. };
  127332. var assert = __webpack_require__(22);
  127333. var asn1 = __webpack_require__(67);
  127334. var Buffer = __webpack_require__(20).Buffer;
  127335. var algs = __webpack_require__(39);
  127336. var utils = __webpack_require__(32);
  127337. var Key = __webpack_require__(35);
  127338. var PrivateKey = __webpack_require__(40);
  127339. var pem = __webpack_require__(82);
  127340. var Identity = __webpack_require__(147);
  127341. var Signature = __webpack_require__(71);
  127342. var Certificate = __webpack_require__(144);
  127343. function read(buf, options) {
  127344. if (typeof (buf) !== 'string') {
  127345. assert.buffer(buf, 'buf');
  127346. buf = buf.toString('ascii');
  127347. }
  127348. var lines = buf.trim().split(/[\r\n]+/g);
  127349. var m = lines[0].match(/*JSSTYLED*/
  127350. /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/);
  127351. assert.ok(m, 'invalid PEM header');
  127352. var m2 = lines[lines.length - 1].match(/*JSSTYLED*/
  127353. /[-]+[ ]*END CERTIFICATE[ ]*[-]+/);
  127354. assert.ok(m2, 'invalid PEM footer');
  127355. var headers = {};
  127356. while (true) {
  127357. lines = lines.slice(1);
  127358. m = lines[0].match(/*JSSTYLED*/
  127359. /^([A-Za-z0-9-]+): (.+)$/);
  127360. if (!m)
  127361. break;
  127362. headers[m[1].toLowerCase()] = m[2];
  127363. }
  127364. /* Chop off the first and last lines */
  127365. lines = lines.slice(0, -1).join('');
  127366. buf = Buffer.from(lines, 'base64');
  127367. return (x509.read(buf, options));
  127368. }
  127369. function write(cert, options) {
  127370. var dbuf = x509.write(cert, options);
  127371. var header = 'CERTIFICATE';
  127372. var tmp = dbuf.toString('base64');
  127373. var len = tmp.length + (tmp.length / 64) +
  127374. 18 + 16 + header.length*2 + 10;
  127375. var buf = Buffer.alloc(len);
  127376. var o = 0;
  127377. o += buf.write('-----BEGIN ' + header + '-----\n', o);
  127378. for (var i = 0; i < tmp.length; ) {
  127379. var limit = i + 64;
  127380. if (limit > tmp.length)
  127381. limit = tmp.length;
  127382. o += buf.write(tmp.slice(i, limit), o);
  127383. buf[o++] = 10;
  127384. i = limit;
  127385. }
  127386. o += buf.write('-----END ' + header + '-----\n', o);
  127387. return (buf.slice(0, o));
  127388. }
  127389. /***/ }),
  127390. /* 1015 */
  127391. /***/ (function(module, exports) {
  127392. module.exports = shift
  127393. function shift (stream) {
  127394. var rs = stream._readableState
  127395. if (!rs) return null
  127396. return rs.objectMode ? stream.read() : stream.read(getStateLength(rs))
  127397. }
  127398. function getStateLength (state) {
  127399. if (state.buffer.length) {
  127400. // Since node 6.3.0 state.buffer is a BufferList not an array
  127401. if (state.buffer.head) {
  127402. return state.buffer.head.data.length
  127403. }
  127404. return state.buffer[0].length
  127405. }
  127406. return state.length
  127407. }
  127408. /***/ }),
  127409. /* 1016 */
  127410. /***/ (function(module, exports, __webpack_require__) {
  127411. "use strict";
  127412. module.exports = function (str) {
  127413. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  127414. return '%' + c.charCodeAt(0).toString(16).toUpperCase();
  127415. });
  127416. };
  127417. /***/ }),
  127418. /* 1017 */
  127419. /***/ (function(module, exports, __webpack_require__) {
  127420. "use strict";
  127421. var stripAnsi = __webpack_require__(1019);
  127422. var codePointAt = __webpack_require__(573);
  127423. var isFullwidthCodePoint = __webpack_require__(1018);
  127424. // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345
  127425. module.exports = function (str) {
  127426. if (typeof str !== 'string' || str.length === 0) {
  127427. return 0;
  127428. }
  127429. var width = 0;
  127430. str = stripAnsi(str);
  127431. for (var i = 0; i < str.length; i++) {
  127432. var code = codePointAt(str, i);
  127433. // ignore control characters
  127434. if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) {
  127435. continue;
  127436. }
  127437. // surrogates
  127438. if (code >= 0x10000) {
  127439. i++;
  127440. }
  127441. if (isFullwidthCodePoint(code)) {
  127442. width += 2;
  127443. } else {
  127444. width++;
  127445. }
  127446. }
  127447. return width;
  127448. };
  127449. /***/ }),
  127450. /* 1018 */
  127451. /***/ (function(module, exports, __webpack_require__) {
  127452. "use strict";
  127453. var numberIsNan = __webpack_require__(839);
  127454. module.exports = function (x) {
  127455. if (numberIsNan(x)) {
  127456. return false;
  127457. }
  127458. // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369
  127459. // code points are derived from:
  127460. // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
  127461. if (x >= 0x1100 && (
  127462. x <= 0x115f || // Hangul Jamo
  127463. 0x2329 === x || // LEFT-POINTING ANGLE BRACKET
  127464. 0x232a === x || // RIGHT-POINTING ANGLE BRACKET
  127465. // CJK Radicals Supplement .. Enclosed CJK Letters and Months
  127466. (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
  127467. // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
  127468. 0x3250 <= x && x <= 0x4dbf ||
  127469. // CJK Unified Ideographs .. Yi Radicals
  127470. 0x4e00 <= x && x <= 0xa4c6 ||
  127471. // Hangul Jamo Extended-A
  127472. 0xa960 <= x && x <= 0xa97c ||
  127473. // Hangul Syllables
  127474. 0xac00 <= x && x <= 0xd7a3 ||
  127475. // CJK Compatibility Ideographs
  127476. 0xf900 <= x && x <= 0xfaff ||
  127477. // Vertical Forms
  127478. 0xfe10 <= x && x <= 0xfe19 ||
  127479. // CJK Compatibility Forms .. Small Form Variants
  127480. 0xfe30 <= x && x <= 0xfe6b ||
  127481. // Halfwidth and Fullwidth Forms
  127482. 0xff01 <= x && x <= 0xff60 ||
  127483. 0xffe0 <= x && x <= 0xffe6 ||
  127484. // Kana Supplement
  127485. 0x1b000 <= x && x <= 0x1b001 ||
  127486. // Enclosed Ideographic Supplement
  127487. 0x1f200 <= x && x <= 0x1f251 ||
  127488. // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
  127489. 0x20000 <= x && x <= 0x3fffd)) {
  127490. return true;
  127491. }
  127492. return false;
  127493. }
  127494. /***/ }),
  127495. /* 1019 */
  127496. /***/ (function(module, exports, __webpack_require__) {
  127497. "use strict";
  127498. var ansiRegex = __webpack_require__(446)();
  127499. module.exports = function (str) {
  127500. return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
  127501. };
  127502. /***/ }),
  127503. /* 1020 */
  127504. /***/ (function(module, exports, __webpack_require__) {
  127505. "use strict";
  127506. module.exports = () => {
  127507. const pattern = [
  127508. '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
  127509. '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
  127510. ].join('|');
  127511. return new RegExp(pattern, 'g');
  127512. };
  127513. /***/ }),
  127514. /* 1021 */
  127515. /***/ (function(module, exports, __webpack_require__) {
  127516. "use strict";
  127517. var hasFlag = __webpack_require__(736);
  127518. var support = function (level) {
  127519. if (level === 0) {
  127520. return false;
  127521. }
  127522. return {
  127523. level: level,
  127524. hasBasic: true,
  127525. has256: level >= 2,
  127526. has16m: level >= 3
  127527. };
  127528. };
  127529. var supportLevel = (function () {
  127530. if (hasFlag('no-color') ||
  127531. hasFlag('no-colors') ||
  127532. hasFlag('color=false')) {
  127533. return 0;
  127534. }
  127535. if (hasFlag('color=16m') ||
  127536. hasFlag('color=full') ||
  127537. hasFlag('color=truecolor')) {
  127538. return 3;
  127539. }
  127540. if (hasFlag('color=256')) {
  127541. return 2;
  127542. }
  127543. if (hasFlag('color') ||
  127544. hasFlag('colors') ||
  127545. hasFlag('color=true') ||
  127546. hasFlag('color=always')) {
  127547. return 1;
  127548. }
  127549. if (process.stdout && !process.stdout.isTTY) {
  127550. return 0;
  127551. }
  127552. if (process.platform === 'win32') {
  127553. return 1;
  127554. }
  127555. if ('CI' in process.env) {
  127556. if ('TRAVIS' in process.env || process.env.CI === 'Travis') {
  127557. return 1;
  127558. }
  127559. return 0;
  127560. }
  127561. if ('TEAMCITY_VERSION' in process.env) {
  127562. return process.env.TEAMCITY_VERSION.match(/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/) === null ? 0 : 1;
  127563. }
  127564. if (/^(screen|xterm)-256(?:color)?/.test(process.env.TERM)) {
  127565. return 2;
  127566. }
  127567. if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
  127568. return 1;
  127569. }
  127570. if ('COLORTERM' in process.env) {
  127571. return 1;
  127572. }
  127573. if (process.env.TERM === 'dumb') {
  127574. return 0;
  127575. }
  127576. return 0;
  127577. })();
  127578. if (supportLevel === 0 && 'FORCE_COLOR' in process.env) {
  127579. supportLevel = 1;
  127580. }
  127581. module.exports = process && support(supportLevel);
  127582. /***/ }),
  127583. /* 1022 */
  127584. /***/ (function(module, exports, __webpack_require__) {
  127585. var util = __webpack_require__(9)
  127586. var bl = __webpack_require__(556)
  127587. var xtend = __webpack_require__(437)
  127588. var headers = __webpack_require__(430)
  127589. var Writable = __webpack_require__(91).Writable
  127590. var PassThrough = __webpack_require__(91).PassThrough
  127591. var noop = function () {}
  127592. var overflow = function (size) {
  127593. size &= 511
  127594. return size && 512 - size
  127595. }
  127596. var emptyStream = function (self, offset) {
  127597. var s = new Source(self, offset)
  127598. s.end()
  127599. return s
  127600. }
  127601. var mixinPax = function (header, pax) {
  127602. if (pax.path) header.name = pax.path
  127603. if (pax.linkpath) header.linkname = pax.linkpath
  127604. if (pax.size) header.size = parseInt(pax.size, 10)
  127605. header.pax = pax
  127606. return header
  127607. }
  127608. var Source = function (self, offset) {
  127609. this._parent = self
  127610. this.offset = offset
  127611. PassThrough.call(this)
  127612. }
  127613. util.inherits(Source, PassThrough)
  127614. Source.prototype.destroy = function (err) {
  127615. this._parent.destroy(err)
  127616. }
  127617. var Extract = function (opts) {
  127618. if (!(this instanceof Extract)) return new Extract(opts)
  127619. Writable.call(this, opts)
  127620. opts = opts || {}
  127621. this._offset = 0
  127622. this._buffer = bl()
  127623. this._missing = 0
  127624. this._partial = false
  127625. this._onparse = noop
  127626. this._header = null
  127627. this._stream = null
  127628. this._overflow = null
  127629. this._cb = null
  127630. this._locked = false
  127631. this._destroyed = false
  127632. this._pax = null
  127633. this._paxGlobal = null
  127634. this._gnuLongPath = null
  127635. this._gnuLongLinkPath = null
  127636. var self = this
  127637. var b = self._buffer
  127638. var oncontinue = function () {
  127639. self._continue()
  127640. }
  127641. var onunlock = function (err) {
  127642. self._locked = false
  127643. if (err) return self.destroy(err)
  127644. if (!self._stream) oncontinue()
  127645. }
  127646. var onstreamend = function () {
  127647. self._stream = null
  127648. var drain = overflow(self._header.size)
  127649. if (drain) self._parse(drain, ondrain)
  127650. else self._parse(512, onheader)
  127651. if (!self._locked) oncontinue()
  127652. }
  127653. var ondrain = function () {
  127654. self._buffer.consume(overflow(self._header.size))
  127655. self._parse(512, onheader)
  127656. oncontinue()
  127657. }
  127658. var onpaxglobalheader = function () {
  127659. var size = self._header.size
  127660. self._paxGlobal = headers.decodePax(b.slice(0, size))
  127661. b.consume(size)
  127662. onstreamend()
  127663. }
  127664. var onpaxheader = function () {
  127665. var size = self._header.size
  127666. self._pax = headers.decodePax(b.slice(0, size))
  127667. if (self._paxGlobal) self._pax = xtend(self._paxGlobal, self._pax)
  127668. b.consume(size)
  127669. onstreamend()
  127670. }
  127671. var ongnulongpath = function () {
  127672. var size = self._header.size
  127673. this._gnuLongPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding)
  127674. b.consume(size)
  127675. onstreamend()
  127676. }
  127677. var ongnulonglinkpath = function () {
  127678. var size = self._header.size
  127679. this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding)
  127680. b.consume(size)
  127681. onstreamend()
  127682. }
  127683. var onheader = function () {
  127684. var offset = self._offset
  127685. var header
  127686. try {
  127687. header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding)
  127688. } catch (err) {
  127689. self.emit('error', err)
  127690. }
  127691. b.consume(512)
  127692. if (!header) {
  127693. self._parse(512, onheader)
  127694. oncontinue()
  127695. return
  127696. }
  127697. if (header.type === 'gnu-long-path') {
  127698. self._parse(header.size, ongnulongpath)
  127699. oncontinue()
  127700. return
  127701. }
  127702. if (header.type === 'gnu-long-link-path') {
  127703. self._parse(header.size, ongnulonglinkpath)
  127704. oncontinue()
  127705. return
  127706. }
  127707. if (header.type === 'pax-global-header') {
  127708. self._parse(header.size, onpaxglobalheader)
  127709. oncontinue()
  127710. return
  127711. }
  127712. if (header.type === 'pax-header') {
  127713. self._parse(header.size, onpaxheader)
  127714. oncontinue()
  127715. return
  127716. }
  127717. if (self._gnuLongPath) {
  127718. header.name = self._gnuLongPath
  127719. self._gnuLongPath = null
  127720. }
  127721. if (self._gnuLongLinkPath) {
  127722. header.linkname = self._gnuLongLinkPath
  127723. self._gnuLongLinkPath = null
  127724. }
  127725. if (self._pax) {
  127726. self._header = header = mixinPax(header, self._pax)
  127727. self._pax = null
  127728. }
  127729. self._locked = true
  127730. if (!header.size || header.type === 'directory') {
  127731. self._parse(512, onheader)
  127732. self.emit('entry', header, emptyStream(self, offset), onunlock)
  127733. return
  127734. }
  127735. self._stream = new Source(self, offset)
  127736. self.emit('entry', header, self._stream, onunlock)
  127737. self._parse(header.size, onstreamend)
  127738. oncontinue()
  127739. }
  127740. this._onheader = onheader
  127741. this._parse(512, onheader)
  127742. }
  127743. util.inherits(Extract, Writable)
  127744. Extract.prototype.destroy = function (err) {
  127745. if (this._destroyed) return
  127746. this._destroyed = true
  127747. if (err) this.emit('error', err)
  127748. this.emit('close')
  127749. if (this._stream) this._stream.emit('close')
  127750. }
  127751. Extract.prototype._parse = function (size, onparse) {
  127752. if (this._destroyed) return
  127753. this._offset += size
  127754. this._missing = size
  127755. if (onparse === this._onheader) this._partial = false
  127756. this._onparse = onparse
  127757. }
  127758. Extract.prototype._continue = function () {
  127759. if (this._destroyed) return
  127760. var cb = this._cb
  127761. this._cb = noop
  127762. if (this._overflow) this._write(this._overflow, undefined, cb)
  127763. else cb()
  127764. }
  127765. Extract.prototype._write = function (data, enc, cb) {
  127766. if (this._destroyed) return
  127767. var s = this._stream
  127768. var b = this._buffer
  127769. var missing = this._missing
  127770. if (data.length) this._partial = true
  127771. // we do not reach end-of-chunk now. just forward it
  127772. if (data.length < missing) {
  127773. this._missing -= data.length
  127774. this._overflow = null
  127775. if (s) return s.write(data, cb)
  127776. b.append(data)
  127777. return cb()
  127778. }
  127779. // end-of-chunk. the parser should call cb.
  127780. this._cb = cb
  127781. this._missing = 0
  127782. var overflow = null
  127783. if (data.length > missing) {
  127784. overflow = data.slice(missing)
  127785. data = data.slice(0, missing)
  127786. }
  127787. if (s) s.end(data)
  127788. else b.append(data)
  127789. this._overflow = overflow
  127790. this._onparse()
  127791. }
  127792. Extract.prototype._final = function (cb) {
  127793. if (this._partial) return this.destroy(new Error('Unexpected end of data'))
  127794. cb()
  127795. }
  127796. module.exports = Extract
  127797. /***/ }),
  127798. /* 1023 */
  127799. /***/ (function(module, exports, __webpack_require__) {
  127800. var constants = __webpack_require__(675)
  127801. var eos = __webpack_require__(164)
  127802. var util = __webpack_require__(9)
  127803. var alloc = __webpack_require__(318)
  127804. var toBuffer = __webpack_require__(433)
  127805. var Readable = __webpack_require__(91).Readable
  127806. var Writable = __webpack_require__(91).Writable
  127807. var StringDecoder = __webpack_require__(272).StringDecoder
  127808. var headers = __webpack_require__(430)
  127809. var DMODE = parseInt('755', 8)
  127810. var FMODE = parseInt('644', 8)
  127811. var END_OF_TAR = alloc(1024)
  127812. var noop = function () {}
  127813. var overflow = function (self, size) {
  127814. size &= 511
  127815. if (size) self.push(END_OF_TAR.slice(0, 512 - size))
  127816. }
  127817. function modeToType (mode) {
  127818. switch (mode & constants.S_IFMT) {
  127819. case constants.S_IFBLK: return 'block-device'
  127820. case constants.S_IFCHR: return 'character-device'
  127821. case constants.S_IFDIR: return 'directory'
  127822. case constants.S_IFIFO: return 'fifo'
  127823. case constants.S_IFLNK: return 'symlink'
  127824. }
  127825. return 'file'
  127826. }
  127827. var Sink = function (to) {
  127828. Writable.call(this)
  127829. this.written = 0
  127830. this._to = to
  127831. this._destroyed = false
  127832. }
  127833. util.inherits(Sink, Writable)
  127834. Sink.prototype._write = function (data, enc, cb) {
  127835. this.written += data.length
  127836. if (this._to.push(data)) return cb()
  127837. this._to._drain = cb
  127838. }
  127839. Sink.prototype.destroy = function () {
  127840. if (this._destroyed) return
  127841. this._destroyed = true
  127842. this.emit('close')
  127843. }
  127844. var LinkSink = function () {
  127845. Writable.call(this)
  127846. this.linkname = ''
  127847. this._decoder = new StringDecoder('utf-8')
  127848. this._destroyed = false
  127849. }
  127850. util.inherits(LinkSink, Writable)
  127851. LinkSink.prototype._write = function (data, enc, cb) {
  127852. this.linkname += this._decoder.write(data)
  127853. cb()
  127854. }
  127855. LinkSink.prototype.destroy = function () {
  127856. if (this._destroyed) return
  127857. this._destroyed = true
  127858. this.emit('close')
  127859. }
  127860. var Void = function () {
  127861. Writable.call(this)
  127862. this._destroyed = false
  127863. }
  127864. util.inherits(Void, Writable)
  127865. Void.prototype._write = function (data, enc, cb) {
  127866. cb(new Error('No body allowed for this entry'))
  127867. }
  127868. Void.prototype.destroy = function () {
  127869. if (this._destroyed) return
  127870. this._destroyed = true
  127871. this.emit('close')
  127872. }
  127873. var Pack = function (opts) {
  127874. if (!(this instanceof Pack)) return new Pack(opts)
  127875. Readable.call(this, opts)
  127876. this._drain = noop
  127877. this._finalized = false
  127878. this._finalizing = false
  127879. this._destroyed = false
  127880. this._stream = null
  127881. }
  127882. util.inherits(Pack, Readable)
  127883. Pack.prototype.entry = function (header, buffer, callback) {
  127884. if (this._stream) throw new Error('already piping an entry')
  127885. if (this._finalized || this._destroyed) return
  127886. if (typeof buffer === 'function') {
  127887. callback = buffer
  127888. buffer = null
  127889. }
  127890. if (!callback) callback = noop
  127891. var self = this
  127892. if (!header.size || header.type === 'symlink') header.size = 0
  127893. if (!header.type) header.type = modeToType(header.mode)
  127894. if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE
  127895. if (!header.uid) header.uid = 0
  127896. if (!header.gid) header.gid = 0
  127897. if (!header.mtime) header.mtime = new Date()
  127898. if (typeof buffer === 'string') buffer = toBuffer(buffer)
  127899. if (Buffer.isBuffer(buffer)) {
  127900. header.size = buffer.length
  127901. this._encode(header)
  127902. this.push(buffer)
  127903. overflow(self, header.size)
  127904. process.nextTick(callback)
  127905. return new Void()
  127906. }
  127907. if (header.type === 'symlink' && !header.linkname) {
  127908. var linkSink = new LinkSink()
  127909. eos(linkSink, function (err) {
  127910. if (err) { // stream was closed
  127911. self.destroy()
  127912. return callback(err)
  127913. }
  127914. header.linkname = linkSink.linkname
  127915. self._encode(header)
  127916. callback()
  127917. })
  127918. return linkSink
  127919. }
  127920. this._encode(header)
  127921. if (header.type !== 'file' && header.type !== 'contiguous-file') {
  127922. process.nextTick(callback)
  127923. return new Void()
  127924. }
  127925. var sink = new Sink(this)
  127926. this._stream = sink
  127927. eos(sink, function (err) {
  127928. self._stream = null
  127929. if (err) { // stream was closed
  127930. self.destroy()
  127931. return callback(err)
  127932. }
  127933. if (sink.written !== header.size) { // corrupting tar
  127934. self.destroy()
  127935. return callback(new Error('size mismatch'))
  127936. }
  127937. overflow(self, header.size)
  127938. if (self._finalizing) self.finalize()
  127939. callback()
  127940. })
  127941. return sink
  127942. }
  127943. Pack.prototype.finalize = function () {
  127944. if (this._stream) {
  127945. this._finalizing = true
  127946. return
  127947. }
  127948. if (this._finalized) return
  127949. this._finalized = true
  127950. this.push(END_OF_TAR)
  127951. this.push(null)
  127952. }
  127953. Pack.prototype.destroy = function (err) {
  127954. if (this._destroyed) return
  127955. this._destroyed = true
  127956. if (err) this.emit('error', err)
  127957. this.emit('close')
  127958. if (this._stream && this._stream.destroy) this._stream.destroy()
  127959. }
  127960. Pack.prototype._encode = function (header) {
  127961. if (!header.pax) {
  127962. var buf = headers.encode(header)
  127963. if (buf) {
  127964. this.push(buf)
  127965. return
  127966. }
  127967. }
  127968. this._encodePax(header)
  127969. }
  127970. Pack.prototype._encodePax = function (header) {
  127971. var paxHeader = headers.encodePax({
  127972. name: header.name,
  127973. linkname: header.linkname,
  127974. pax: header.pax
  127975. })
  127976. var newHeader = {
  127977. name: 'PaxHeader',
  127978. mode: header.mode,
  127979. uid: header.uid,
  127980. gid: header.gid,
  127981. size: paxHeader.length,
  127982. mtime: header.mtime,
  127983. type: 'pax-header',
  127984. linkname: header.linkname && 'PaxHeader',
  127985. uname: header.uname,
  127986. gname: header.gname,
  127987. devmajor: header.devmajor,
  127988. devminor: header.devminor
  127989. }
  127990. this.push(headers.encode(newHeader))
  127991. this.push(paxHeader)
  127992. overflow(this, paxHeader.length)
  127993. newHeader.size = header.size
  127994. newHeader.type = header.type
  127995. this.push(headers.encode(newHeader))
  127996. }
  127997. Pack.prototype._read = function (n) {
  127998. var drain = this._drain
  127999. this._drain = noop
  128000. drain()
  128001. }
  128002. module.exports = Pack
  128003. /***/ }),
  128004. /* 1024 */
  128005. /***/ (function(module, exports, __webpack_require__) {
  128006. var thenify = __webpack_require__(1025)
  128007. module.exports = thenifyAll
  128008. thenifyAll.withCallback = withCallback
  128009. thenifyAll.thenify = thenify
  128010. /**
  128011. * Promisifies all the selected functions in an object.
  128012. *
  128013. * @param {Object} source the source object for the async functions
  128014. * @param {Object} [destination] the destination to set all the promisified methods
  128015. * @param {Array} [methods] an array of method names of `source`
  128016. * @return {Object}
  128017. * @api public
  128018. */
  128019. function thenifyAll(source, destination, methods) {
  128020. return promisifyAll(source, destination, methods, thenify)
  128021. }
  128022. /**
  128023. * Promisifies all the selected functions in an object and backward compatible with callback.
  128024. *
  128025. * @param {Object} source the source object for the async functions
  128026. * @param {Object} [destination] the destination to set all the promisified methods
  128027. * @param {Array} [methods] an array of method names of `source`
  128028. * @return {Object}
  128029. * @api public
  128030. */
  128031. function withCallback(source, destination, methods) {
  128032. return promisifyAll(source, destination, methods, thenify.withCallback)
  128033. }
  128034. function promisifyAll(source, destination, methods, promisify) {
  128035. if (!destination) {
  128036. destination = {};
  128037. methods = Object.keys(source)
  128038. }
  128039. if (Array.isArray(destination)) {
  128040. methods = destination
  128041. destination = {}
  128042. }
  128043. if (!methods) {
  128044. methods = Object.keys(source)
  128045. }
  128046. if (typeof source === 'function') destination = promisify(source)
  128047. methods.forEach(function (name) {
  128048. // promisify only if it's a function
  128049. if (typeof source[name] === 'function') destination[name] = promisify(source[name])
  128050. })
  128051. // proxy the rest
  128052. Object.keys(source).forEach(function (name) {
  128053. if (deprecated(source, name)) return
  128054. if (destination[name]) return
  128055. destination[name] = source[name]
  128056. })
  128057. return destination
  128058. }
  128059. function deprecated(source, name) {
  128060. var desc = Object.getOwnPropertyDescriptor(source, name)
  128061. if (!desc || !desc.get) return false
  128062. if (desc.get.name === 'deprecated') return true
  128063. return false
  128064. }
  128065. /***/ }),
  128066. /* 1025 */
  128067. /***/ (function(module, exports, __webpack_require__) {
  128068. var Promise = __webpack_require__(278)
  128069. var assert = __webpack_require__(50)
  128070. module.exports = thenify
  128071. /**
  128072. * Turn async functions into promises
  128073. *
  128074. * @param {Function} $$__fn__$$
  128075. * @return {Function}
  128076. * @api public
  128077. */
  128078. function thenify($$__fn__$$, options) {
  128079. assert(typeof $$__fn__$$ === 'function')
  128080. return eval(createWrapper($$__fn__$$.name, options))
  128081. }
  128082. /**
  128083. * Turn async functions into promises and backward compatible with callback
  128084. *
  128085. * @param {Function} $$__fn__$$
  128086. * @return {Function}
  128087. * @api public
  128088. */
  128089. thenify.withCallback = function ($$__fn__$$, options) {
  128090. assert(typeof $$__fn__$$ === 'function')
  128091. options = options || {}
  128092. options.withCallback = true
  128093. if (options.multiArgs === undefined) options.multiArgs = true
  128094. return eval(createWrapper($$__fn__$$.name, options))
  128095. }
  128096. function createCallback(resolve, reject, multiArgs) {
  128097. return function(err, value) {
  128098. if (err) return reject(err)
  128099. var length = arguments.length
  128100. if (length <= 2 || !multiArgs) return resolve(value)
  128101. if (Array.isArray(multiArgs)) {
  128102. var values = {}
  128103. for (var i = 1; i < length; i++) values[multiArgs[i - 1]] = arguments[i]
  128104. return resolve(values)
  128105. }
  128106. var values = new Array(length - 1)
  128107. for (var i = 1; i < length; ++i) values[i - 1] = arguments[i]
  128108. resolve(values)
  128109. }
  128110. }
  128111. function createWrapper(name, options) {
  128112. name = (name || '').replace(/\s|bound(?!$)/g, '')
  128113. options = options || {}
  128114. // default to true
  128115. var multiArgs = options.multiArgs !== undefined ? options.multiArgs : true
  128116. multiArgs = 'var multiArgs = ' + JSON.stringify(multiArgs) + '\n'
  128117. var withCallback = options.withCallback ?
  128118. 'var lastType = typeof arguments[len - 1]\n'
  128119. + 'if (lastType === "function") return $$__fn__$$.apply(self, arguments)\n'
  128120. : ''
  128121. return '(function ' + name + '() {\n'
  128122. + 'var self = this\n'
  128123. + 'var len = arguments.length\n'
  128124. + multiArgs
  128125. + withCallback
  128126. + 'var args = new Array(len + 1)\n'
  128127. + 'for (var i = 0; i < len; ++i) args[i] = arguments[i]\n'
  128128. + 'var lastIndex = i\n'
  128129. + 'return new Promise(function (resolve, reject) {\n'
  128130. + 'args[lastIndex] = createCallback(resolve, reject, multiArgs)\n'
  128131. + '$$__fn__$$.apply(self, args)\n'
  128132. + '})\n'
  128133. + '})'
  128134. }
  128135. /***/ }),
  128136. /* 1026 */
  128137. /***/ (function(module, exports, __webpack_require__) {
  128138. var Stream = __webpack_require__(36)
  128139. // through
  128140. //
  128141. // a stream that does nothing but re-emit the input.
  128142. // useful for aggregating a series of changing but not ending streams into one stream)
  128143. exports = module.exports = through
  128144. through.through = through
  128145. //create a readable writable stream.
  128146. function through (write, end, opts) {
  128147. write = write || function (data) { this.queue(data) }
  128148. end = end || function () { this.queue(null) }
  128149. var ended = false, destroyed = false, buffer = [], _ended = false
  128150. var stream = new Stream()
  128151. stream.readable = stream.writable = true
  128152. stream.paused = false
  128153. // stream.autoPause = !(opts && opts.autoPause === false)
  128154. stream.autoDestroy = !(opts && opts.autoDestroy === false)
  128155. stream.write = function (data) {
  128156. write.call(this, data)
  128157. return !stream.paused
  128158. }
  128159. function drain() {
  128160. while(buffer.length && !stream.paused) {
  128161. var data = buffer.shift()
  128162. if(null === data)
  128163. return stream.emit('end')
  128164. else
  128165. stream.emit('data', data)
  128166. }
  128167. }
  128168. stream.queue = stream.push = function (data) {
  128169. // console.error(ended)
  128170. if(_ended) return stream
  128171. if(data === null) _ended = true
  128172. buffer.push(data)
  128173. drain()
  128174. return stream
  128175. }
  128176. //this will be registered as the first 'end' listener
  128177. //must call destroy next tick, to make sure we're after any
  128178. //stream piped from here.
  128179. //this is only a problem if end is not emitted synchronously.
  128180. //a nicer way to do this is to make sure this is the last listener for 'end'
  128181. stream.on('end', function () {
  128182. stream.readable = false
  128183. if(!stream.writable && stream.autoDestroy)
  128184. process.nextTick(function () {
  128185. stream.destroy()
  128186. })
  128187. })
  128188. function _end () {
  128189. stream.writable = false
  128190. end.call(stream)
  128191. if(!stream.readable && stream.autoDestroy)
  128192. stream.destroy()
  128193. }
  128194. stream.end = function (data) {
  128195. if(ended) return
  128196. ended = true
  128197. if(arguments.length) stream.write(data)
  128198. _end() // will emit or queue
  128199. return stream
  128200. }
  128201. stream.destroy = function () {
  128202. if(destroyed) return
  128203. destroyed = true
  128204. ended = true
  128205. buffer.length = 0
  128206. stream.writable = stream.readable = false
  128207. stream.emit('close')
  128208. return stream
  128209. }
  128210. stream.pause = function () {
  128211. if(stream.paused) return
  128212. stream.paused = true
  128213. return stream
  128214. }
  128215. stream.resume = function () {
  128216. if(stream.paused) {
  128217. stream.paused = false
  128218. stream.emit('resume')
  128219. }
  128220. drain()
  128221. //may have become paused again,
  128222. //as drain emits 'data'.
  128223. if(!stream.paused)
  128224. stream.emit('drain')
  128225. return stream
  128226. }
  128227. return stream
  128228. }
  128229. /***/ }),
  128230. /* 1027 */
  128231. /***/ (function(module, exports, __webpack_require__) {
  128232. /*!
  128233. * Tmp
  128234. *
  128235. * Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
  128236. *
  128237. * MIT Licensed
  128238. */
  128239. /*
  128240. * Module dependencies.
  128241. */
  128242. const fs = __webpack_require__(12);
  128243. const path = __webpack_require__(1);
  128244. const crypto = __webpack_require__(21);
  128245. const osTmpDir = __webpack_require__(844);
  128246. const _c = process.binding('constants');
  128247. /*
  128248. * The working inner variables.
  128249. */
  128250. const
  128251. /**
  128252. * The temporary directory.
  128253. * @type {string}
  128254. */
  128255. tmpDir = osTmpDir(),
  128256. // the random characters to choose from
  128257. RANDOM_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
  128258. TEMPLATE_PATTERN = /XXXXXX/,
  128259. DEFAULT_TRIES = 3,
  128260. CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR),
  128261. EBADF = _c.EBADF || _c.os.errno.EBADF,
  128262. ENOENT = _c.ENOENT || _c.os.errno.ENOENT,
  128263. DIR_MODE = 448 /* 0o700 */,
  128264. FILE_MODE = 384 /* 0o600 */,
  128265. // this will hold the objects need to be removed on exit
  128266. _removeObjects = [];
  128267. var
  128268. _gracefulCleanup = false,
  128269. _uncaughtException = false;
  128270. /**
  128271. * Random name generator based on crypto.
  128272. * Adapted from http://blog.tompawlak.org/how-to-generate-random-values-nodejs-javascript
  128273. *
  128274. * @param {number} howMany
  128275. * @returns {string} the generated random name
  128276. * @private
  128277. */
  128278. function _randomChars(howMany) {
  128279. var
  128280. value = [],
  128281. rnd = null;
  128282. // make sure that we do not fail because we ran out of entropy
  128283. try {
  128284. rnd = crypto.randomBytes(howMany);
  128285. } catch (e) {
  128286. rnd = crypto.pseudoRandomBytes(howMany);
  128287. }
  128288. for (var i = 0; i < howMany; i++) {
  128289. value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]);
  128290. }
  128291. return value.join('');
  128292. }
  128293. /**
  128294. * Checks whether the `obj` parameter is defined or not.
  128295. *
  128296. * @param {Object} obj
  128297. * @returns {boolean} true if the object is undefined
  128298. * @private
  128299. */
  128300. function _isUndefined(obj) {
  128301. return typeof obj === 'undefined';
  128302. }
  128303. /**
  128304. * Parses the function arguments.
  128305. *
  128306. * This function helps to have optional arguments.
  128307. *
  128308. * @param {(Options|Function)} options
  128309. * @param {Function} callback
  128310. * @returns {Array} parsed arguments
  128311. * @private
  128312. */
  128313. function _parseArguments(options, callback) {
  128314. if (typeof options == 'function') {
  128315. return [callback || {}, options];
  128316. }
  128317. if (_isUndefined(options)) {
  128318. return [{}, callback];
  128319. }
  128320. return [options, callback];
  128321. }
  128322. /**
  128323. * Generates a new temporary name.
  128324. *
  128325. * @param {Object} opts
  128326. * @returns {string} the new random name according to opts
  128327. * @private
  128328. */
  128329. function _generateTmpName(opts) {
  128330. if (opts.name) {
  128331. return path.join(opts.dir || tmpDir, opts.name);
  128332. }
  128333. // mkstemps like template
  128334. if (opts.template) {
  128335. return opts.template.replace(TEMPLATE_PATTERN, _randomChars(6));
  128336. }
  128337. // prefix and postfix
  128338. const name = [
  128339. opts.prefix || 'tmp-',
  128340. process.pid,
  128341. _randomChars(12),
  128342. opts.postfix || ''
  128343. ].join('');
  128344. return path.join(opts.dir || tmpDir, name);
  128345. }
  128346. /**
  128347. * Gets a temporary file name.
  128348. *
  128349. * @param {(Options|tmpNameCallback)} options options or callback
  128350. * @param {?tmpNameCallback} callback the callback function
  128351. */
  128352. function tmpName(options, callback) {
  128353. var
  128354. args = _parseArguments(options, callback),
  128355. opts = args[0],
  128356. cb = args[1],
  128357. tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES;
  128358. if (isNaN(tries) || tries < 0)
  128359. return cb(new Error('Invalid tries'));
  128360. if (opts.template && !opts.template.match(TEMPLATE_PATTERN))
  128361. return cb(new Error('Invalid template provided'));
  128362. (function _getUniqueName() {
  128363. const name = _generateTmpName(opts);
  128364. // check whether the path exists then retry if needed
  128365. fs.stat(name, function (err) {
  128366. if (!err) {
  128367. if (tries-- > 0) return _getUniqueName();
  128368. return cb(new Error('Could not get a unique tmp filename, max tries reached ' + name));
  128369. }
  128370. cb(null, name);
  128371. });
  128372. }());
  128373. }
  128374. /**
  128375. * Synchronous version of tmpName.
  128376. *
  128377. * @param {Object} options
  128378. * @returns {string} the generated random name
  128379. * @throws {Error} if the options are invalid or could not generate a filename
  128380. */
  128381. function tmpNameSync(options) {
  128382. var
  128383. args = _parseArguments(options),
  128384. opts = args[0],
  128385. tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES;
  128386. if (isNaN(tries) || tries < 0)
  128387. throw new Error('Invalid tries');
  128388. if (opts.template && !opts.template.match(TEMPLATE_PATTERN))
  128389. throw new Error('Invalid template provided');
  128390. do {
  128391. const name = _generateTmpName(opts);
  128392. try {
  128393. fs.statSync(name);
  128394. } catch (e) {
  128395. return name;
  128396. }
  128397. } while (tries-- > 0);
  128398. throw new Error('Could not get a unique tmp filename, max tries reached');
  128399. }
  128400. /**
  128401. * Creates and opens a temporary file.
  128402. *
  128403. * @param {(Options|fileCallback)} options the config options or the callback function
  128404. * @param {?fileCallback} callback
  128405. */
  128406. function file(options, callback) {
  128407. var
  128408. args = _parseArguments(options, callback),
  128409. opts = args[0],
  128410. cb = args[1];
  128411. opts.postfix = (_isUndefined(opts.postfix)) ? '.tmp' : opts.postfix;
  128412. // gets a temporary filename
  128413. tmpName(opts, function _tmpNameCreated(err, name) {
  128414. if (err) return cb(err);
  128415. // create and open the file
  128416. fs.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err, fd) {
  128417. if (err) return cb(err);
  128418. if (opts.discardDescriptor) {
  128419. return fs.close(fd, function _discardCallback(err) {
  128420. if (err) {
  128421. // Low probability, and the file exists, so this could be
  128422. // ignored. If it isn't we certainly need to unlink the
  128423. // file, and if that fails too its error is more
  128424. // important.
  128425. try {
  128426. fs.unlinkSync(name);
  128427. } catch (e) {
  128428. if (!isENOENT(e)) {
  128429. err = e;
  128430. }
  128431. }
  128432. return cb(err);
  128433. }
  128434. cb(null, name, undefined, _prepareTmpFileRemoveCallback(name, -1, opts));
  128435. });
  128436. }
  128437. if (opts.detachDescriptor) {
  128438. return cb(null, name, fd, _prepareTmpFileRemoveCallback(name, -1, opts));
  128439. }
  128440. cb(null, name, fd, _prepareTmpFileRemoveCallback(name, fd, opts));
  128441. });
  128442. });
  128443. }
  128444. /**
  128445. * Synchronous version of file.
  128446. *
  128447. * @param {Options} options
  128448. * @returns {FileSyncObject} object consists of name, fd and removeCallback
  128449. * @throws {Error} if cannot create a file
  128450. */
  128451. function fileSync(options) {
  128452. var
  128453. args = _parseArguments(options),
  128454. opts = args[0];
  128455. opts.postfix = opts.postfix || '.tmp';
  128456. const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
  128457. const name = tmpNameSync(opts);
  128458. var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);
  128459. if (opts.discardDescriptor) {
  128460. fs.closeSync(fd);
  128461. fd = undefined;
  128462. }
  128463. return {
  128464. name: name,
  128465. fd: fd,
  128466. removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts)
  128467. };
  128468. }
  128469. /**
  128470. * Removes files and folders in a directory recursively.
  128471. *
  128472. * @param {string} root
  128473. * @private
  128474. */
  128475. function _rmdirRecursiveSync(root) {
  128476. const dirs = [root];
  128477. do {
  128478. var
  128479. dir = dirs.pop(),
  128480. deferred = false,
  128481. files = fs.readdirSync(dir);
  128482. for (var i = 0, length = files.length; i < length; i++) {
  128483. var
  128484. file = path.join(dir, files[i]),
  128485. stat = fs.lstatSync(file); // lstat so we don't recurse into symlinked directories
  128486. if (stat.isDirectory()) {
  128487. if (!deferred) {
  128488. deferred = true;
  128489. dirs.push(dir);
  128490. }
  128491. dirs.push(file);
  128492. } else {
  128493. fs.unlinkSync(file);
  128494. }
  128495. }
  128496. if (!deferred) {
  128497. fs.rmdirSync(dir);
  128498. }
  128499. } while (dirs.length !== 0);
  128500. }
  128501. /**
  128502. * Creates a temporary directory.
  128503. *
  128504. * @param {(Options|dirCallback)} options the options or the callback function
  128505. * @param {?dirCallback} callback
  128506. */
  128507. function dir(options, callback) {
  128508. var
  128509. args = _parseArguments(options, callback),
  128510. opts = args[0],
  128511. cb = args[1];
  128512. // gets a temporary filename
  128513. tmpName(opts, function _tmpNameCreated(err, name) {
  128514. if (err) return cb(err);
  128515. // create the directory
  128516. fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err) {
  128517. if (err) return cb(err);
  128518. cb(null, name, _prepareTmpDirRemoveCallback(name, opts));
  128519. });
  128520. });
  128521. }
  128522. /**
  128523. * Synchronous version of dir.
  128524. *
  128525. * @param {Options} options
  128526. * @returns {DirSyncObject} object consists of name and removeCallback
  128527. * @throws {Error} if it cannot create a directory
  128528. */
  128529. function dirSync(options) {
  128530. var
  128531. args = _parseArguments(options),
  128532. opts = args[0];
  128533. const name = tmpNameSync(opts);
  128534. fs.mkdirSync(name, opts.mode || DIR_MODE);
  128535. return {
  128536. name: name,
  128537. removeCallback: _prepareTmpDirRemoveCallback(name, opts)
  128538. };
  128539. }
  128540. /**
  128541. * Prepares the callback for removal of the temporary file.
  128542. *
  128543. * @param {string} name the path of the file
  128544. * @param {number} fd file descriptor
  128545. * @param {Object} opts
  128546. * @returns {fileCallback}
  128547. * @private
  128548. */
  128549. function _prepareTmpFileRemoveCallback(name, fd, opts) {
  128550. const removeCallback = _prepareRemoveCallback(function _removeCallback(fdPath) {
  128551. try {
  128552. if (0 <= fdPath[0]) {
  128553. fs.closeSync(fdPath[0]);
  128554. }
  128555. }
  128556. catch (e) {
  128557. // under some node/windows related circumstances, a temporary file
  128558. // may have not be created as expected or the file was already closed
  128559. // by the user, in which case we will simply ignore the error
  128560. if (!isEBADF(e) && !isENOENT(e)) {
  128561. // reraise any unanticipated error
  128562. throw e;
  128563. }
  128564. }
  128565. try {
  128566. fs.unlinkSync(fdPath[1]);
  128567. }
  128568. catch (e) {
  128569. if (!isENOENT(e)) {
  128570. // reraise any unanticipated error
  128571. throw e;
  128572. }
  128573. }
  128574. }, [fd, name]);
  128575. if (!opts.keep) {
  128576. _removeObjects.unshift(removeCallback);
  128577. }
  128578. return removeCallback;
  128579. }
  128580. /**
  128581. * Prepares the callback for removal of the temporary directory.
  128582. *
  128583. * @param {string} name
  128584. * @param {Object} opts
  128585. * @returns {Function} the callback
  128586. * @private
  128587. */
  128588. function _prepareTmpDirRemoveCallback(name, opts) {
  128589. const removeFunction = opts.unsafeCleanup ? _rmdirRecursiveSync : fs.rmdirSync.bind(fs);
  128590. const removeCallback = _prepareRemoveCallback(removeFunction, name);
  128591. if (!opts.keep) {
  128592. _removeObjects.unshift(removeCallback);
  128593. }
  128594. return removeCallback;
  128595. }
  128596. /**
  128597. * Creates a guarded function wrapping the removeFunction call.
  128598. *
  128599. * @param {Function} removeFunction
  128600. * @param {Object} arg
  128601. * @returns {Function}
  128602. * @private
  128603. */
  128604. function _prepareRemoveCallback(removeFunction, arg) {
  128605. var called = false;
  128606. return function _cleanupCallback(next) {
  128607. if (!called) {
  128608. const index = _removeObjects.indexOf(_cleanupCallback);
  128609. if (index >= 0) {
  128610. _removeObjects.splice(index, 1);
  128611. }
  128612. called = true;
  128613. removeFunction(arg);
  128614. }
  128615. if (next) next(null);
  128616. };
  128617. }
  128618. /**
  128619. * The garbage collector.
  128620. *
  128621. * @private
  128622. */
  128623. function _garbageCollector() {
  128624. if (_uncaughtException && !_gracefulCleanup) {
  128625. return;
  128626. }
  128627. // the function being called removes itself from _removeObjects,
  128628. // loop until _removeObjects is empty
  128629. while (_removeObjects.length) {
  128630. try {
  128631. _removeObjects[0].call(null);
  128632. } catch (e) {
  128633. // already removed?
  128634. }
  128635. }
  128636. }
  128637. /**
  128638. * Helper for testing against EBADF to compensate changes made to Node 7.x under Windows.
  128639. */
  128640. function isEBADF(error) {
  128641. return isExpectedError(error, -EBADF, 'EBADF');
  128642. }
  128643. /**
  128644. * Helper for testing against ENOENT to compensate changes made to Node 7.x under Windows.
  128645. */
  128646. function isENOENT(error) {
  128647. return isExpectedError(error, -ENOENT, 'ENOENT');
  128648. }
  128649. /**
  128650. * Helper to determine whether the expected error code matches the actual code and errno,
  128651. * which will differ between the supported node versions.
  128652. *
  128653. * - Node >= 7.0:
  128654. * error.code {String}
  128655. * error.errno {String|Number} any numerical value will be negated
  128656. *
  128657. * - Node >= 6.0 < 7.0:
  128658. * error.code {String}
  128659. * error.errno {Number} negated
  128660. *
  128661. * - Node >= 4.0 < 6.0: introduces SystemError
  128662. * error.code {String}
  128663. * error.errno {Number} negated
  128664. *
  128665. * - Node >= 0.10 < 4.0:
  128666. * error.code {Number} negated
  128667. * error.errno n/a
  128668. */
  128669. function isExpectedError(error, code, errno) {
  128670. return error.code == code || error.code == errno;
  128671. }
  128672. /**
  128673. * Sets the graceful cleanup.
  128674. *
  128675. * Also removes the created files and directories when an uncaught exception occurs.
  128676. */
  128677. function setGracefulCleanup() {
  128678. _gracefulCleanup = true;
  128679. }
  128680. const version = process.versions.node.split('.').map(function (value) {
  128681. return parseInt(value, 10);
  128682. });
  128683. if (version[0] === 0 && (version[1] < 9 || version[1] === 9 && version[2] < 5)) {
  128684. process.addListener('uncaughtException', function _uncaughtExceptionThrown(err) {
  128685. _uncaughtException = true;
  128686. _garbageCollector();
  128687. throw err;
  128688. });
  128689. }
  128690. process.addListener('exit', function _exit(code) {
  128691. if (code) _uncaughtException = true;
  128692. _garbageCollector();
  128693. });
  128694. /**
  128695. * Configuration options.
  128696. *
  128697. * @typedef {Object} Options
  128698. * @property {?number} tries the number of tries before give up the name generation
  128699. * @property {?string} template the "mkstemp" like filename template
  128700. * @property {?string} name fix name
  128701. * @property {?string} dir the tmp directory to use
  128702. * @property {?string} prefix prefix for the generated name
  128703. * @property {?string} postfix postfix for the generated name
  128704. */
  128705. /**
  128706. * @typedef {Object} FileSyncObject
  128707. * @property {string} name the name of the file
  128708. * @property {string} fd the file descriptor
  128709. * @property {fileCallback} removeCallback the callback function to remove the file
  128710. */
  128711. /**
  128712. * @typedef {Object} DirSyncObject
  128713. * @property {string} name the name of the directory
  128714. * @property {fileCallback} removeCallback the callback function to remove the directory
  128715. */
  128716. /**
  128717. * @callback tmpNameCallback
  128718. * @param {?Error} err the error object if anything goes wrong
  128719. * @param {string} name the temporary file name
  128720. */
  128721. /**
  128722. * @callback fileCallback
  128723. * @param {?Error} err the error object if anything goes wrong
  128724. * @param {string} name the temporary file name
  128725. * @param {number} fd the file descriptor
  128726. * @param {cleanupCallback} fn the cleanup callback function
  128727. */
  128728. /**
  128729. * @callback dirCallback
  128730. * @param {?Error} err the error object if anything goes wrong
  128731. * @param {string} name the temporary file name
  128732. * @param {cleanupCallback} fn the cleanup callback function
  128733. */
  128734. /**
  128735. * Removes the temporary created file or directory.
  128736. *
  128737. * @callback cleanupCallback
  128738. * @param {simpleCallback} [next] function to call after entry was removed
  128739. */
  128740. /**
  128741. * Callback function for function composition.
  128742. * @see {@link https://github.com/raszi/node-tmp/issues/57|raszi/node-tmp#57}
  128743. *
  128744. * @callback simpleCallback
  128745. */
  128746. // exporting all the needed methods
  128747. module.exports.tmpdir = tmpDir;
  128748. module.exports.dir = dir;
  128749. module.exports.dirSync = dirSync;
  128750. module.exports.file = file;
  128751. module.exports.fileSync = fileSync;
  128752. module.exports.tmpName = tmpName;
  128753. module.exports.tmpNameSync = tmpNameSync;
  128754. module.exports.setGracefulCleanup = setGracefulCleanup;
  128755. /***/ }),
  128756. /* 1028 */
  128757. /***/ (function(module, exports, __webpack_require__) {
  128758. "use strict";
  128759. var net = __webpack_require__(151)
  128760. , tls = __webpack_require__(440)
  128761. , http = __webpack_require__(83)
  128762. , https = __webpack_require__(185)
  128763. , events = __webpack_require__(95)
  128764. , assert = __webpack_require__(50)
  128765. , util = __webpack_require__(9)
  128766. , Buffer = __webpack_require__(60).Buffer
  128767. ;
  128768. exports.httpOverHttp = httpOverHttp
  128769. exports.httpsOverHttp = httpsOverHttp
  128770. exports.httpOverHttps = httpOverHttps
  128771. exports.httpsOverHttps = httpsOverHttps
  128772. function httpOverHttp(options) {
  128773. var agent = new TunnelingAgent(options)
  128774. agent.request = http.request
  128775. return agent
  128776. }
  128777. function httpsOverHttp(options) {
  128778. var agent = new TunnelingAgent(options)
  128779. agent.request = http.request
  128780. agent.createSocket = createSecureSocket
  128781. agent.defaultPort = 443
  128782. return agent
  128783. }
  128784. function httpOverHttps(options) {
  128785. var agent = new TunnelingAgent(options)
  128786. agent.request = https.request
  128787. return agent
  128788. }
  128789. function httpsOverHttps(options) {
  128790. var agent = new TunnelingAgent(options)
  128791. agent.request = https.request
  128792. agent.createSocket = createSecureSocket
  128793. agent.defaultPort = 443
  128794. return agent
  128795. }
  128796. function TunnelingAgent(options) {
  128797. var self = this
  128798. self.options = options || {}
  128799. self.proxyOptions = self.options.proxy || {}
  128800. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets
  128801. self.requests = []
  128802. self.sockets = []
  128803. self.on('free', function onFree(socket, host, port) {
  128804. for (var i = 0, len = self.requests.length; i < len; ++i) {
  128805. var pending = self.requests[i]
  128806. if (pending.host === host && pending.port === port) {
  128807. // Detect the request to connect same origin server,
  128808. // reuse the connection.
  128809. self.requests.splice(i, 1)
  128810. pending.request.onSocket(socket)
  128811. return
  128812. }
  128813. }
  128814. socket.destroy()
  128815. self.removeSocket(socket)
  128816. })
  128817. }
  128818. util.inherits(TunnelingAgent, events.EventEmitter)
  128819. TunnelingAgent.prototype.addRequest = function addRequest(req, options) {
  128820. var self = this
  128821. // Legacy API: addRequest(req, host, port, path)
  128822. if (typeof options === 'string') {
  128823. options = {
  128824. host: options,
  128825. port: arguments[2],
  128826. path: arguments[3]
  128827. };
  128828. }
  128829. if (self.sockets.length >= this.maxSockets) {
  128830. // We are over limit so we'll add it to the queue.
  128831. self.requests.push({host: options.host, port: options.port, request: req})
  128832. return
  128833. }
  128834. // If we are under maxSockets create a new one.
  128835. self.createConnection({host: options.host, port: options.port, request: req})
  128836. }
  128837. TunnelingAgent.prototype.createConnection = function createConnection(pending) {
  128838. var self = this
  128839. self.createSocket(pending, function(socket) {
  128840. socket.on('free', onFree)
  128841. socket.on('close', onCloseOrRemove)
  128842. socket.on('agentRemove', onCloseOrRemove)
  128843. pending.request.onSocket(socket)
  128844. function onFree() {
  128845. self.emit('free', socket, pending.host, pending.port)
  128846. }
  128847. function onCloseOrRemove(err) {
  128848. self.removeSocket(socket)
  128849. socket.removeListener('free', onFree)
  128850. socket.removeListener('close', onCloseOrRemove)
  128851. socket.removeListener('agentRemove', onCloseOrRemove)
  128852. }
  128853. })
  128854. }
  128855. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  128856. var self = this
  128857. var placeholder = {}
  128858. self.sockets.push(placeholder)
  128859. var connectOptions = mergeOptions({}, self.proxyOptions,
  128860. { method: 'CONNECT'
  128861. , path: options.host + ':' + options.port
  128862. , agent: false
  128863. }
  128864. )
  128865. if (connectOptions.proxyAuth) {
  128866. connectOptions.headers = connectOptions.headers || {}
  128867. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  128868. Buffer.from(connectOptions.proxyAuth).toString('base64')
  128869. }
  128870. debug('making CONNECT request')
  128871. var connectReq = self.request(connectOptions)
  128872. connectReq.useChunkedEncodingByDefault = false // for v0.6
  128873. connectReq.once('response', onResponse) // for v0.6
  128874. connectReq.once('upgrade', onUpgrade) // for v0.6
  128875. connectReq.once('connect', onConnect) // for v0.7 or later
  128876. connectReq.once('error', onError)
  128877. connectReq.end()
  128878. function onResponse(res) {
  128879. // Very hacky. This is necessary to avoid http-parser leaks.
  128880. res.upgrade = true
  128881. }
  128882. function onUpgrade(res, socket, head) {
  128883. // Hacky.
  128884. process.nextTick(function() {
  128885. onConnect(res, socket, head)
  128886. })
  128887. }
  128888. function onConnect(res, socket, head) {
  128889. connectReq.removeAllListeners()
  128890. socket.removeAllListeners()
  128891. if (res.statusCode === 200) {
  128892. assert.equal(head.length, 0)
  128893. debug('tunneling connection has established')
  128894. self.sockets[self.sockets.indexOf(placeholder)] = socket
  128895. cb(socket)
  128896. } else {
  128897. debug('tunneling socket could not be established, statusCode=%d', res.statusCode)
  128898. var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode)
  128899. error.code = 'ECONNRESET'
  128900. options.request.emit('error', error)
  128901. self.removeSocket(placeholder)
  128902. }
  128903. }
  128904. function onError(cause) {
  128905. connectReq.removeAllListeners()
  128906. debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack)
  128907. var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message)
  128908. error.code = 'ECONNRESET'
  128909. options.request.emit('error', error)
  128910. self.removeSocket(placeholder)
  128911. }
  128912. }
  128913. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  128914. var pos = this.sockets.indexOf(socket)
  128915. if (pos === -1) return
  128916. this.sockets.splice(pos, 1)
  128917. var pending = this.requests.shift()
  128918. if (pending) {
  128919. // If we have pending requests and a socket gets closed a new one
  128920. // needs to be created to take over in the pool for the one that closed.
  128921. this.createConnection(pending)
  128922. }
  128923. }
  128924. function createSecureSocket(options, cb) {
  128925. var self = this
  128926. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  128927. // 0 is dummy port for v0.6
  128928. var secureSocket = tls.connect(0, mergeOptions({}, self.options,
  128929. { servername: options.host
  128930. , socket: socket
  128931. }
  128932. ))
  128933. self.sockets[self.sockets.indexOf(socket)] = secureSocket
  128934. cb(secureSocket)
  128935. })
  128936. }
  128937. function mergeOptions(target) {
  128938. for (var i = 1, len = arguments.length; i < len; ++i) {
  128939. var overrides = arguments[i]
  128940. if (typeof overrides === 'object') {
  128941. var keys = Object.keys(overrides)
  128942. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  128943. var k = keys[j]
  128944. if (overrides[k] !== undefined) {
  128945. target[k] = overrides[k]
  128946. }
  128947. }
  128948. }
  128949. }
  128950. return target
  128951. }
  128952. var debug
  128953. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  128954. debug = function() {
  128955. var args = Array.prototype.slice.call(arguments)
  128956. if (typeof args[0] === 'string') {
  128957. args[0] = 'TUNNEL: ' + args[0]
  128958. } else {
  128959. args.unshift('TUNNEL:')
  128960. }
  128961. console.error.apply(console, args)
  128962. }
  128963. } else {
  128964. debug = function() {}
  128965. }
  128966. exports.debug = debug // for test
  128967. /***/ }),
  128968. /* 1029 */
  128969. /***/ (function(module, exports, __webpack_require__) {
  128970. /**
  128971. * For Node.js, simply re-export the core `util.deprecate` function.
  128972. */
  128973. module.exports = __webpack_require__(9).deprecate;
  128974. /***/ }),
  128975. /* 1030 */
  128976. /***/ (function(module, exports, __webpack_require__) {
  128977. var rng = __webpack_require__(435);
  128978. var bytesToUuid = __webpack_require__(434);
  128979. // **`v1()` - Generate time-based UUID**
  128980. //
  128981. // Inspired by https://github.com/LiosK/UUID.js
  128982. // and http://docs.python.org/library/uuid.html
  128983. var _nodeId;
  128984. var _clockseq;
  128985. // Previous uuid creation time
  128986. var _lastMSecs = 0;
  128987. var _lastNSecs = 0;
  128988. // See https://github.com/broofa/node-uuid for API details
  128989. function v1(options, buf, offset) {
  128990. var i = buf && offset || 0;
  128991. var b = buf || [];
  128992. options = options || {};
  128993. var node = options.node || _nodeId;
  128994. var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
  128995. // node and clockseq need to be initialized to random values if they're not
  128996. // specified. We do this lazily to minimize issues related to insufficient
  128997. // system entropy. See #189
  128998. if (node == null || clockseq == null) {
  128999. var seedBytes = rng();
  129000. if (node == null) {
  129001. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  129002. node = _nodeId = [
  129003. seedBytes[0] | 0x01,
  129004. seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
  129005. ];
  129006. }
  129007. if (clockseq == null) {
  129008. // Per 4.2.2, randomize (14 bit) clockseq
  129009. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  129010. }
  129011. }
  129012. // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  129013. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  129014. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  129015. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  129016. var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
  129017. // Per 4.2.1.2, use count of uuid's generated during the current clock
  129018. // cycle to simulate higher resolution clock
  129019. var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
  129020. // Time since last uuid creation (in msecs)
  129021. var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
  129022. // Per 4.2.1.2, Bump clockseq on clock regression
  129023. if (dt < 0 && options.clockseq === undefined) {
  129024. clockseq = clockseq + 1 & 0x3fff;
  129025. }
  129026. // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  129027. // time interval
  129028. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  129029. nsecs = 0;
  129030. }
  129031. // Per 4.2.1.2 Throw error if too many uuids are requested
  129032. if (nsecs >= 10000) {
  129033. throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
  129034. }
  129035. _lastMSecs = msecs;
  129036. _lastNSecs = nsecs;
  129037. _clockseq = clockseq;
  129038. // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  129039. msecs += 12219292800000;
  129040. // `time_low`
  129041. var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  129042. b[i++] = tl >>> 24 & 0xff;
  129043. b[i++] = tl >>> 16 & 0xff;
  129044. b[i++] = tl >>> 8 & 0xff;
  129045. b[i++] = tl & 0xff;
  129046. // `time_mid`
  129047. var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
  129048. b[i++] = tmh >>> 8 & 0xff;
  129049. b[i++] = tmh & 0xff;
  129050. // `time_high_and_version`
  129051. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  129052. b[i++] = tmh >>> 16 & 0xff;
  129053. // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  129054. b[i++] = clockseq >>> 8 | 0x80;
  129055. // `clock_seq_low`
  129056. b[i++] = clockseq & 0xff;
  129057. // `node`
  129058. for (var n = 0; n < 6; ++n) {
  129059. b[i + n] = node[n];
  129060. }
  129061. return buf ? buf : bytesToUuid(b);
  129062. }
  129063. module.exports = v1;
  129064. /***/ }),
  129065. /* 1031 */
  129066. /***/ (function(module, exports, __webpack_require__) {
  129067. var rng = __webpack_require__(435);
  129068. var bytesToUuid = __webpack_require__(434);
  129069. function v4(options, buf, offset) {
  129070. var i = buf && offset || 0;
  129071. if (typeof(options) == 'string') {
  129072. buf = options === 'binary' ? new Array(16) : null;
  129073. options = null;
  129074. }
  129075. options = options || {};
  129076. var rnds = options.random || (options.rng || rng)();
  129077. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  129078. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  129079. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  129080. // Copy bytes to buffer, if provided
  129081. if (buf) {
  129082. for (var ii = 0; ii < 16; ++ii) {
  129083. buf[i + ii] = rnds[ii];
  129084. }
  129085. }
  129086. return buf || bytesToUuid(rnds);
  129087. }
  129088. module.exports = v4;
  129089. /***/ }),
  129090. /* 1032 */
  129091. /***/ (function(module, exports, __webpack_require__) {
  129092. var parse = __webpack_require__(422);
  129093. var correct = __webpack_require__(1008);
  129094. var genericWarning = (
  129095. 'license should be ' +
  129096. 'a valid SPDX license expression (without "LicenseRef"), ' +
  129097. '"UNLICENSED", or ' +
  129098. '"SEE LICENSE IN <filename>"'
  129099. );
  129100. var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
  129101. function startsWith(prefix, string) {
  129102. return string.slice(0, prefix.length) === prefix;
  129103. }
  129104. function usesLicenseRef(ast) {
  129105. if (ast.hasOwnProperty('license')) {
  129106. var license = ast.license;
  129107. return (
  129108. startsWith('LicenseRef', license) ||
  129109. startsWith('DocumentRef', license)
  129110. );
  129111. } else {
  129112. return (
  129113. usesLicenseRef(ast.left) ||
  129114. usesLicenseRef(ast.right)
  129115. );
  129116. }
  129117. }
  129118. module.exports = function(argument) {
  129119. var ast;
  129120. try {
  129121. ast = parse(argument);
  129122. } catch (e) {
  129123. var match
  129124. if (
  129125. argument === 'UNLICENSED' ||
  129126. argument === 'UNLICENCED'
  129127. ) {
  129128. return {
  129129. validForOldPackages: true,
  129130. validForNewPackages: true,
  129131. unlicensed: true
  129132. };
  129133. } else if (match = fileReferenceRE.exec(argument)) {
  129134. return {
  129135. validForOldPackages: true,
  129136. validForNewPackages: true,
  129137. inFile: match[1]
  129138. };
  129139. } else {
  129140. var result = {
  129141. validForOldPackages: false,
  129142. validForNewPackages: false,
  129143. warnings: [genericWarning]
  129144. };
  129145. if (argument.trim().length !== 0) {
  129146. var corrected = correct(argument);
  129147. if (corrected) {
  129148. result.warnings.push(
  129149. 'license is similar to the valid expression "' + corrected + '"'
  129150. );
  129151. }
  129152. }
  129153. return result;
  129154. }
  129155. }
  129156. if (usesLicenseRef(ast)) {
  129157. return {
  129158. validForNewPackages: false,
  129159. validForOldPackages: false,
  129160. spdx: true,
  129161. warnings: [genericWarning]
  129162. };
  129163. } else {
  129164. return {
  129165. validForNewPackages: true,
  129166. validForOldPackages: true,
  129167. spdx: true
  129168. };
  129169. }
  129170. };
  129171. /***/ }),
  129172. /* 1033 */
  129173. /***/ (function(module, exports, __webpack_require__) {
  129174. /*
  129175. * verror.js: richer JavaScript errors
  129176. */
  129177. var mod_assertplus = __webpack_require__(22);
  129178. var mod_util = __webpack_require__(9);
  129179. var mod_extsprintf = __webpack_require__(1034);
  129180. var mod_isError = __webpack_require__(105).isError;
  129181. var sprintf = mod_extsprintf.sprintf;
  129182. /*
  129183. * Public interface
  129184. */
  129185. /* So you can 'var VError = require('verror')' */
  129186. module.exports = VError;
  129187. /* For compatibility */
  129188. VError.VError = VError;
  129189. /* Other exported classes */
  129190. VError.SError = SError;
  129191. VError.WError = WError;
  129192. VError.MultiError = MultiError;
  129193. /*
  129194. * Common function used to parse constructor arguments for VError, WError, and
  129195. * SError. Named arguments to this function:
  129196. *
  129197. * strict force strict interpretation of sprintf arguments, even
  129198. * if the options in "argv" don't say so
  129199. *
  129200. * argv error's constructor arguments, which are to be
  129201. * interpreted as described in README.md. For quick
  129202. * reference, "argv" has one of the following forms:
  129203. *
  129204. * [ sprintf_args... ] (argv[0] is a string)
  129205. * [ cause, sprintf_args... ] (argv[0] is an Error)
  129206. * [ options, sprintf_args... ] (argv[0] is an object)
  129207. *
  129208. * This function normalizes these forms, producing an object with the following
  129209. * properties:
  129210. *
  129211. * options equivalent to "options" in third form. This will never
  129212. * be a direct reference to what the caller passed in
  129213. * (i.e., it may be a shallow copy), so it can be freely
  129214. * modified.
  129215. *
  129216. * shortmessage result of sprintf(sprintf_args), taking options.strict
  129217. * into account as described in README.md.
  129218. */
  129219. function parseConstructorArguments(args)
  129220. {
  129221. var argv, options, sprintf_args, shortmessage, k;
  129222. mod_assertplus.object(args, 'args');
  129223. mod_assertplus.bool(args.strict, 'args.strict');
  129224. mod_assertplus.array(args.argv, 'args.argv');
  129225. argv = args.argv;
  129226. /*
  129227. * First, figure out which form of invocation we've been given.
  129228. */
  129229. if (argv.length === 0) {
  129230. options = {};
  129231. sprintf_args = [];
  129232. } else if (mod_isError(argv[0])) {
  129233. options = { 'cause': argv[0] };
  129234. sprintf_args = argv.slice(1);
  129235. } else if (typeof (argv[0]) === 'object') {
  129236. options = {};
  129237. for (k in argv[0]) {
  129238. options[k] = argv[0][k];
  129239. }
  129240. sprintf_args = argv.slice(1);
  129241. } else {
  129242. mod_assertplus.string(argv[0],
  129243. 'first argument to VError, SError, or WError ' +
  129244. 'constructor must be a string, object, or Error');
  129245. options = {};
  129246. sprintf_args = argv;
  129247. }
  129248. /*
  129249. * Now construct the error's message.
  129250. *
  129251. * extsprintf (which we invoke here with our caller's arguments in order
  129252. * to construct this Error's message) is strict in its interpretation of
  129253. * values to be processed by the "%s" specifier. The value passed to
  129254. * extsprintf must actually be a string or something convertible to a
  129255. * String using .toString(). Passing other values (notably "null" and
  129256. * "undefined") is considered a programmer error. The assumption is
  129257. * that if you actually want to print the string "null" or "undefined",
  129258. * then that's easy to do that when you're calling extsprintf; on the
  129259. * other hand, if you did NOT want that (i.e., there's actually a bug
  129260. * where the program assumes some variable is non-null and tries to
  129261. * print it, which might happen when constructing a packet or file in
  129262. * some specific format), then it's better to stop immediately than
  129263. * produce bogus output.
  129264. *
  129265. * However, sometimes the bug is only in the code calling VError, and a
  129266. * programmer might prefer to have the error message contain "null" or
  129267. * "undefined" rather than have the bug in the error path crash the
  129268. * program (making the first bug harder to identify). For that reason,
  129269. * by default VError converts "null" or "undefined" arguments to their
  129270. * string representations and passes those to extsprintf. Programmers
  129271. * desiring the strict behavior can use the SError class or pass the
  129272. * "strict" option to the VError constructor.
  129273. */
  129274. mod_assertplus.object(options);
  129275. if (!options.strict && !args.strict) {
  129276. sprintf_args = sprintf_args.map(function (a) {
  129277. return (a === null ? 'null' :
  129278. a === undefined ? 'undefined' : a);
  129279. });
  129280. }
  129281. if (sprintf_args.length === 0) {
  129282. shortmessage = '';
  129283. } else {
  129284. shortmessage = sprintf.apply(null, sprintf_args);
  129285. }
  129286. return ({
  129287. 'options': options,
  129288. 'shortmessage': shortmessage
  129289. });
  129290. }
  129291. /*
  129292. * See README.md for reference documentation.
  129293. */
  129294. function VError()
  129295. {
  129296. var args, obj, parsed, cause, ctor, message, k;
  129297. args = Array.prototype.slice.call(arguments, 0);
  129298. /*
  129299. * This is a regrettable pattern, but JavaScript's built-in Error class
  129300. * is defined to work this way, so we allow the constructor to be called
  129301. * without "new".
  129302. */
  129303. if (!(this instanceof VError)) {
  129304. obj = Object.create(VError.prototype);
  129305. VError.apply(obj, arguments);
  129306. return (obj);
  129307. }
  129308. /*
  129309. * For convenience and backwards compatibility, we support several
  129310. * different calling forms. Normalize them here.
  129311. */
  129312. parsed = parseConstructorArguments({
  129313. 'argv': args,
  129314. 'strict': false
  129315. });
  129316. /*
  129317. * If we've been given a name, apply it now.
  129318. */
  129319. if (parsed.options.name) {
  129320. mod_assertplus.string(parsed.options.name,
  129321. 'error\'s "name" must be a string');
  129322. this.name = parsed.options.name;
  129323. }
  129324. /*
  129325. * For debugging, we keep track of the original short message (attached
  129326. * this Error particularly) separately from the complete message (which
  129327. * includes the messages of our cause chain).
  129328. */
  129329. this.jse_shortmsg = parsed.shortmessage;
  129330. message = parsed.shortmessage;
  129331. /*
  129332. * If we've been given a cause, record a reference to it and update our
  129333. * message appropriately.
  129334. */
  129335. cause = parsed.options.cause;
  129336. if (cause) {
  129337. mod_assertplus.ok(mod_isError(cause), 'cause is not an Error');
  129338. this.jse_cause = cause;
  129339. if (!parsed.options.skipCauseMessage) {
  129340. message += ': ' + cause.message;
  129341. }
  129342. }
  129343. /*
  129344. * If we've been given an object with properties, shallow-copy that
  129345. * here. We don't want to use a deep copy in case there are non-plain
  129346. * objects here, but we don't want to use the original object in case
  129347. * the caller modifies it later.
  129348. */
  129349. this.jse_info = {};
  129350. if (parsed.options.info) {
  129351. for (k in parsed.options.info) {
  129352. this.jse_info[k] = parsed.options.info[k];
  129353. }
  129354. }
  129355. this.message = message;
  129356. Error.call(this, message);
  129357. if (Error.captureStackTrace) {
  129358. ctor = parsed.options.constructorOpt || this.constructor;
  129359. Error.captureStackTrace(this, ctor);
  129360. }
  129361. return (this);
  129362. }
  129363. mod_util.inherits(VError, Error);
  129364. VError.prototype.name = 'VError';
  129365. VError.prototype.toString = function ve_toString()
  129366. {
  129367. var str = (this.hasOwnProperty('name') && this.name ||
  129368. this.constructor.name || this.constructor.prototype.name);
  129369. if (this.message)
  129370. str += ': ' + this.message;
  129371. return (str);
  129372. };
  129373. /*
  129374. * This method is provided for compatibility. New callers should use
  129375. * VError.cause() instead. That method also uses the saner `null` return value
  129376. * when there is no cause.
  129377. */
  129378. VError.prototype.cause = function ve_cause()
  129379. {
  129380. var cause = VError.cause(this);
  129381. return (cause === null ? undefined : cause);
  129382. };
  129383. /*
  129384. * Static methods
  129385. *
  129386. * These class-level methods are provided so that callers can use them on
  129387. * instances of Errors that are not VErrors. New interfaces should be provided
  129388. * only using static methods to eliminate the class of programming mistake where
  129389. * people fail to check whether the Error object has the corresponding methods.
  129390. */
  129391. VError.cause = function (err)
  129392. {
  129393. mod_assertplus.ok(mod_isError(err), 'err must be an Error');
  129394. return (mod_isError(err.jse_cause) ? err.jse_cause : null);
  129395. };
  129396. VError.info = function (err)
  129397. {
  129398. var rv, cause, k;
  129399. mod_assertplus.ok(mod_isError(err), 'err must be an Error');
  129400. cause = VError.cause(err);
  129401. if (cause !== null) {
  129402. rv = VError.info(cause);
  129403. } else {
  129404. rv = {};
  129405. }
  129406. if (typeof (err.jse_info) == 'object' && err.jse_info !== null) {
  129407. for (k in err.jse_info) {
  129408. rv[k] = err.jse_info[k];
  129409. }
  129410. }
  129411. return (rv);
  129412. };
  129413. VError.findCauseByName = function (err, name)
  129414. {
  129415. var cause;
  129416. mod_assertplus.ok(mod_isError(err), 'err must be an Error');
  129417. mod_assertplus.string(name, 'name');
  129418. mod_assertplus.ok(name.length > 0, 'name cannot be empty');
  129419. for (cause = err; cause !== null; cause = VError.cause(cause)) {
  129420. mod_assertplus.ok(mod_isError(cause));
  129421. if (cause.name == name) {
  129422. return (cause);
  129423. }
  129424. }
  129425. return (null);
  129426. };
  129427. VError.hasCauseWithName = function (err, name)
  129428. {
  129429. return (VError.findCauseByName(err, name) !== null);
  129430. };
  129431. VError.fullStack = function (err)
  129432. {
  129433. mod_assertplus.ok(mod_isError(err), 'err must be an Error');
  129434. var cause = VError.cause(err);
  129435. if (cause) {
  129436. return (err.stack + '\ncaused by: ' + VError.fullStack(cause));
  129437. }
  129438. return (err.stack);
  129439. };
  129440. VError.errorFromList = function (errors)
  129441. {
  129442. mod_assertplus.arrayOfObject(errors, 'errors');
  129443. if (errors.length === 0) {
  129444. return (null);
  129445. }
  129446. errors.forEach(function (e) {
  129447. mod_assertplus.ok(mod_isError(e));
  129448. });
  129449. if (errors.length == 1) {
  129450. return (errors[0]);
  129451. }
  129452. return (new MultiError(errors));
  129453. };
  129454. VError.errorForEach = function (err, func)
  129455. {
  129456. mod_assertplus.ok(mod_isError(err), 'err must be an Error');
  129457. mod_assertplus.func(func, 'func');
  129458. if (err instanceof MultiError) {
  129459. err.errors().forEach(function iterError(e) { func(e); });
  129460. } else {
  129461. func(err);
  129462. }
  129463. };
  129464. /*
  129465. * SError is like VError, but stricter about types. You cannot pass "null" or
  129466. * "undefined" as string arguments to the formatter.
  129467. */
  129468. function SError()
  129469. {
  129470. var args, obj, parsed, options;
  129471. args = Array.prototype.slice.call(arguments, 0);
  129472. if (!(this instanceof SError)) {
  129473. obj = Object.create(SError.prototype);
  129474. SError.apply(obj, arguments);
  129475. return (obj);
  129476. }
  129477. parsed = parseConstructorArguments({
  129478. 'argv': args,
  129479. 'strict': true
  129480. });
  129481. options = parsed.options;
  129482. VError.call(this, options, '%s', parsed.shortmessage);
  129483. return (this);
  129484. }
  129485. /*
  129486. * We don't bother setting SError.prototype.name because once constructed,
  129487. * SErrors are just like VErrors.
  129488. */
  129489. mod_util.inherits(SError, VError);
  129490. /*
  129491. * Represents a collection of errors for the purpose of consumers that generally
  129492. * only deal with one error. Callers can extract the individual errors
  129493. * contained in this object, but may also just treat it as a normal single
  129494. * error, in which case a summary message will be printed.
  129495. */
  129496. function MultiError(errors)
  129497. {
  129498. mod_assertplus.array(errors, 'list of errors');
  129499. mod_assertplus.ok(errors.length > 0, 'must be at least one error');
  129500. this.ase_errors = errors;
  129501. VError.call(this, {
  129502. 'cause': errors[0]
  129503. }, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');
  129504. }
  129505. mod_util.inherits(MultiError, VError);
  129506. MultiError.prototype.name = 'MultiError';
  129507. MultiError.prototype.errors = function me_errors()
  129508. {
  129509. return (this.ase_errors.slice(0));
  129510. };
  129511. /*
  129512. * See README.md for reference details.
  129513. */
  129514. function WError()
  129515. {
  129516. var args, obj, parsed, options;
  129517. args = Array.prototype.slice.call(arguments, 0);
  129518. if (!(this instanceof WError)) {
  129519. obj = Object.create(WError.prototype);
  129520. WError.apply(obj, args);
  129521. return (obj);
  129522. }
  129523. parsed = parseConstructorArguments({
  129524. 'argv': args,
  129525. 'strict': false
  129526. });
  129527. options = parsed.options;
  129528. options['skipCauseMessage'] = true;
  129529. VError.call(this, options, '%s', parsed.shortmessage);
  129530. return (this);
  129531. }
  129532. mod_util.inherits(WError, VError);
  129533. WError.prototype.name = 'WError';
  129534. WError.prototype.toString = function we_toString()
  129535. {
  129536. var str = (this.hasOwnProperty('name') && this.name ||
  129537. this.constructor.name || this.constructor.prototype.name);
  129538. if (this.message)
  129539. str += ': ' + this.message;
  129540. if (this.jse_cause && this.jse_cause.message)
  129541. str += '; caused by ' + this.jse_cause.toString();
  129542. return (str);
  129543. };
  129544. /*
  129545. * For purely historical reasons, WError's cause() function allows you to set
  129546. * the cause.
  129547. */
  129548. WError.prototype.cause = function we_cause(c)
  129549. {
  129550. if (mod_isError(c))
  129551. this.jse_cause = c;
  129552. return (this.jse_cause);
  129553. };
  129554. /***/ }),
  129555. /* 1034 */
  129556. /***/ (function(module, exports, __webpack_require__) {
  129557. /*
  129558. * extsprintf.js: extended POSIX-style sprintf
  129559. */
  129560. var mod_assert = __webpack_require__(50);
  129561. var mod_util = __webpack_require__(9);
  129562. /*
  129563. * Public interface
  129564. */
  129565. exports.sprintf = jsSprintf;
  129566. exports.printf = jsPrintf;
  129567. exports.fprintf = jsFprintf;
  129568. /*
  129569. * Stripped down version of s[n]printf(3c). We make a best effort to throw an
  129570. * exception when given a format string we don't understand, rather than
  129571. * ignoring it, so that we won't break existing programs if/when we go implement
  129572. * the rest of this.
  129573. *
  129574. * This implementation currently supports specifying
  129575. * - field alignment ('-' flag),
  129576. * - zero-pad ('0' flag)
  129577. * - always show numeric sign ('+' flag),
  129578. * - field width
  129579. * - conversions for strings, decimal integers, and floats (numbers).
  129580. * - argument size specifiers. These are all accepted but ignored, since
  129581. * Javascript has no notion of the physical size of an argument.
  129582. *
  129583. * Everything else is currently unsupported, most notably precision, unsigned
  129584. * numbers, non-decimal numbers, and characters.
  129585. */
  129586. function jsSprintf(ofmt)
  129587. {
  129588. var regex = [
  129589. '([^%]*)', /* normal text */
  129590. '%', /* start of format */
  129591. '([\'\\-+ #0]*?)', /* flags (optional) */
  129592. '([1-9]\\d*)?', /* width (optional) */
  129593. '(\\.([1-9]\\d*))?', /* precision (optional) */
  129594. '[lhjztL]*?', /* length mods (ignored) */
  129595. '([diouxXfFeEgGaAcCsSp%jr])' /* conversion */
  129596. ].join('');
  129597. var re = new RegExp(regex);
  129598. /* variadic arguments used to fill in conversion specifiers */
  129599. var args = Array.prototype.slice.call(arguments, 1);
  129600. /* remaining format string */
  129601. var fmt = ofmt;
  129602. /* components of the current conversion specifier */
  129603. var flags, width, precision, conversion;
  129604. var left, pad, sign, arg, match;
  129605. /* return value */
  129606. var ret = '';
  129607. /* current variadic argument (1-based) */
  129608. var argn = 1;
  129609. /* 0-based position in the format string that we've read */
  129610. var posn = 0;
  129611. /* 1-based position in the format string of the current conversion */
  129612. var convposn;
  129613. /* current conversion specifier */
  129614. var curconv;
  129615. mod_assert.equal('string', typeof (fmt),
  129616. 'first argument must be a format string');
  129617. while ((match = re.exec(fmt)) !== null) {
  129618. ret += match[1];
  129619. fmt = fmt.substring(match[0].length);
  129620. /*
  129621. * Update flags related to the current conversion specifier's
  129622. * position so that we can report clear error messages.
  129623. */
  129624. curconv = match[0].substring(match[1].length);
  129625. convposn = posn + match[1].length + 1;
  129626. posn += match[0].length;
  129627. flags = match[2] || '';
  129628. width = match[3] || 0;
  129629. precision = match[4] || '';
  129630. conversion = match[6];
  129631. left = false;
  129632. sign = false;
  129633. pad = ' ';
  129634. if (conversion == '%') {
  129635. ret += '%';
  129636. continue;
  129637. }
  129638. if (args.length === 0) {
  129639. throw (jsError(ofmt, convposn, curconv,
  129640. 'has no matching argument ' +
  129641. '(too few arguments passed)'));
  129642. }
  129643. arg = args.shift();
  129644. argn++;
  129645. if (flags.match(/[\' #]/)) {
  129646. throw (jsError(ofmt, convposn, curconv,
  129647. 'uses unsupported flags'));
  129648. }
  129649. if (precision.length > 0) {
  129650. throw (jsError(ofmt, convposn, curconv,
  129651. 'uses non-zero precision (not supported)'));
  129652. }
  129653. if (flags.match(/-/))
  129654. left = true;
  129655. if (flags.match(/0/))
  129656. pad = '0';
  129657. if (flags.match(/\+/))
  129658. sign = true;
  129659. switch (conversion) {
  129660. case 's':
  129661. if (arg === undefined || arg === null) {
  129662. throw (jsError(ofmt, convposn, curconv,
  129663. 'attempted to print undefined or null ' +
  129664. 'as a string (argument ' + argn + ' to ' +
  129665. 'sprintf)'));
  129666. }
  129667. ret += doPad(pad, width, left, arg.toString());
  129668. break;
  129669. case 'd':
  129670. arg = Math.floor(arg);
  129671. /*jsl:fallthru*/
  129672. case 'f':
  129673. sign = sign && arg > 0 ? '+' : '';
  129674. ret += sign + doPad(pad, width, left,
  129675. arg.toString());
  129676. break;
  129677. case 'x':
  129678. ret += doPad(pad, width, left, arg.toString(16));
  129679. break;
  129680. case 'j': /* non-standard */
  129681. if (width === 0)
  129682. width = 10;
  129683. ret += mod_util.inspect(arg, false, width);
  129684. break;
  129685. case 'r': /* non-standard */
  129686. ret += dumpException(arg);
  129687. break;
  129688. default:
  129689. throw (jsError(ofmt, convposn, curconv,
  129690. 'is not supported'));
  129691. }
  129692. }
  129693. ret += fmt;
  129694. return (ret);
  129695. }
  129696. function jsError(fmtstr, convposn, curconv, reason) {
  129697. mod_assert.equal(typeof (fmtstr), 'string');
  129698. mod_assert.equal(typeof (curconv), 'string');
  129699. mod_assert.equal(typeof (convposn), 'number');
  129700. mod_assert.equal(typeof (reason), 'string');
  129701. return (new Error('format string "' + fmtstr +
  129702. '": conversion specifier "' + curconv + '" at character ' +
  129703. convposn + ' ' + reason));
  129704. }
  129705. function jsPrintf() {
  129706. var args = Array.prototype.slice.call(arguments);
  129707. args.unshift(process.stdout);
  129708. jsFprintf.apply(null, args);
  129709. }
  129710. function jsFprintf(stream) {
  129711. var args = Array.prototype.slice.call(arguments, 1);
  129712. return (stream.write(jsSprintf.apply(this, args)));
  129713. }
  129714. function doPad(chr, width, left, str)
  129715. {
  129716. var ret = str;
  129717. while (ret.length < width) {
  129718. if (left)
  129719. ret += chr;
  129720. else
  129721. ret = chr + ret;
  129722. }
  129723. return (ret);
  129724. }
  129725. /*
  129726. * This function dumps long stack traces for exceptions having a cause() method.
  129727. * See node-verror for an example.
  129728. */
  129729. function dumpException(ex)
  129730. {
  129731. var ret;
  129732. if (!(ex instanceof Error))
  129733. throw (new Error(jsSprintf('invalid type for %%r: %j', ex)));
  129734. /* Note that V8 prepends "ex.stack" with ex.toString(). */
  129735. ret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;
  129736. if (ex.cause && typeof (ex.cause) === 'function') {
  129737. var cex = ex.cause();
  129738. if (cex) {
  129739. ret += '\nCaused by: ' + dumpException(cex);
  129740. }
  129741. }
  129742. return (ret);
  129743. }
  129744. /***/ }),
  129745. /* 1035 */
  129746. /***/ (function(module, exports, __webpack_require__) {
  129747. "use strict";
  129748. const lenient = __webpack_require__(1036);
  129749. module.exports = (val, opts) => {
  129750. val = String(val).trim();
  129751. opts = Object.assign({
  129752. lenient: false,
  129753. default: null
  129754. }, opts);
  129755. if (opts.default !== null && typeof opts.default !== 'boolean') {
  129756. throw new TypeError(`Expected the \`default\` option to be of type \`boolean\`, got \`${typeof opts.default}\``);
  129757. }
  129758. if (/^(?:y|yes|true|1)$/i.test(val)) {
  129759. return true;
  129760. }
  129761. if (/^(?:n|no|false|0)$/i.test(val)) {
  129762. return false;
  129763. }
  129764. if (opts.lenient === true) {
  129765. return lenient(val, opts);
  129766. }
  129767. return opts.default;
  129768. };
  129769. /***/ }),
  129770. /* 1036 */
  129771. /***/ (function(module, exports, __webpack_require__) {
  129772. "use strict";
  129773. const YES_MATCH_SCORE_THRESHOLD = 2;
  129774. const NO_MATCH_SCORE_THRESHOLD = 1.25;
  129775. const yMatch = new Map([
  129776. [5, 0.25],
  129777. [6, 0.25],
  129778. [7, 0.25],
  129779. ['t', 0.75],
  129780. ['y', 1],
  129781. ['u', 0.75],
  129782. ['g', 0.25],
  129783. ['h', 0.25],
  129784. ['k', 0.25]
  129785. ]);
  129786. const eMatch = new Map([
  129787. [2, 0.25],
  129788. [3, 0.25],
  129789. [4, 0.25],
  129790. ['w', 0.75],
  129791. ['e', 1],
  129792. ['r', 0.75],
  129793. ['s', 0.25],
  129794. ['d', 0.25],
  129795. ['f', 0.25]
  129796. ]);
  129797. const sMatch = new Map([
  129798. ['q', 0.25],
  129799. ['w', 0.25],
  129800. ['e', 0.25],
  129801. ['a', 0.75],
  129802. ['s', 1],
  129803. ['d', 0.75],
  129804. ['z', 0.25],
  129805. ['x', 0.25],
  129806. ['c', 0.25]
  129807. ]);
  129808. const nMatch = new Map([
  129809. ['h', 0.25],
  129810. ['j', 0.25],
  129811. ['k', 0.25],
  129812. ['b', 0.75],
  129813. ['n', 1],
  129814. ['m', 0.75]
  129815. ]);
  129816. const oMatch = new Map([
  129817. [9, 0.25],
  129818. [0, 0.25],
  129819. ['i', 0.75],
  129820. ['o', 1],
  129821. ['p', 0.75],
  129822. ['k', 0.25],
  129823. ['l', 0.25]
  129824. ]);
  129825. function getYesMatchScore(val) {
  129826. let score = 0;
  129827. const y = val[0];
  129828. const e = val[1];
  129829. const s = val[2];
  129830. if (yMatch.has(y)) {
  129831. score += yMatch.get(y);
  129832. }
  129833. if (eMatch.has(e)) {
  129834. score += eMatch.get(e);
  129835. }
  129836. if (sMatch.has(s)) {
  129837. score += sMatch.get(s);
  129838. }
  129839. return score;
  129840. }
  129841. function getNoMatchScore(val) {
  129842. let score = 0;
  129843. const n = val[0];
  129844. const o = val[1];
  129845. if (nMatch.has(n)) {
  129846. score += nMatch.get(n);
  129847. }
  129848. if (oMatch.has(o)) {
  129849. score += oMatch.get(o);
  129850. }
  129851. return score;
  129852. }
  129853. module.exports = (val, opts) => {
  129854. if (getYesMatchScore(val) >= YES_MATCH_SCORE_THRESHOLD) {
  129855. return true;
  129856. }
  129857. if (getNoMatchScore(val) >= NO_MATCH_SCORE_THRESHOLD) {
  129858. return false;
  129859. }
  129860. return opts.default;
  129861. };
  129862. /***/ }),
  129863. /* 1037 */
  129864. /***/ (function(module, exports) {
  129865. module.exports = require("dns");
  129866. /***/ }),
  129867. /* 1038 */
  129868. /***/ (function(module, exports) {
  129869. module.exports = require("domain");
  129870. /***/ })
  129871. /******/ ]);