libram 0.3.2 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/Clan.js +268 -485
  2. package/dist/Copier.js +11 -48
  3. package/dist/Dungeon.js +77 -157
  4. package/dist/Kmail.d.ts +13 -7
  5. package/dist/Kmail.js +92 -233
  6. package/dist/Path.js +68 -120
  7. package/dist/ascend.js +153 -172
  8. package/dist/combat.d.ts +86 -1
  9. package/dist/combat.js +295 -387
  10. package/dist/console.js +13 -36
  11. package/dist/diet/index.d.ts +31 -0
  12. package/dist/diet/index.js +333 -0
  13. package/dist/diet/knapsack.d.ts +7 -0
  14. package/dist/diet/knapsack.js +106 -0
  15. package/dist/dungeons/Dreadsylvania.d.ts +4 -0
  16. package/dist/dungeons/Dreadsylvania.js +14 -0
  17. package/dist/dungeons/Dungeon.d.ts +28 -0
  18. package/dist/dungeons/Dungeon.js +99 -0
  19. package/dist/dungeons/Hobopolis.d.ts +4 -0
  20. package/dist/dungeons/Hobopolis.js +14 -0
  21. package/dist/dungeons/SlimeTube.d.ts +4 -0
  22. package/dist/dungeons/SlimeTube.js +14 -0
  23. package/dist/freerun.d.ts +23 -0
  24. package/dist/freerun.js +92 -0
  25. package/dist/index.d.ts +6 -1
  26. package/dist/index.js +21 -263
  27. package/dist/lib.d.ts +43 -0
  28. package/dist/lib.js +296 -405
  29. package/dist/logger.js +23 -63
  30. package/dist/maximize.d.ts +29 -12
  31. package/dist/maximize.js +318 -421
  32. package/dist/modifier.d.ts +13 -0
  33. package/dist/modifier.js +35 -0
  34. package/dist/modifierTypes.d.ts +16 -0
  35. package/dist/modifierTypes.js +9 -0
  36. package/dist/mood.js +220 -531
  37. package/dist/property.d.ts +2 -0
  38. package/dist/property.js +96 -242
  39. package/dist/propertyTypes.d.ts +9 -0
  40. package/dist/propertyTypes.js +1 -0
  41. package/dist/propertyTyping.d.ts +2 -9
  42. package/dist/propertyTyping.js +42 -53
  43. package/dist/resources/2007/CandyHearts.d.ts +9 -0
  44. package/dist/resources/2007/CandyHearts.js +24 -0
  45. package/dist/resources/2008/DivineFavors.d.ts +9 -0
  46. package/dist/resources/2008/DivineFavors.js +27 -0
  47. package/dist/resources/2009/Bandersnatch.js +37 -112
  48. package/dist/resources/2009/LoveSongs.d.ts +9 -0
  49. package/dist/resources/2009/LoveSongs.js +24 -0
  50. package/dist/resources/2009/SpookyPutty.js +20 -46
  51. package/dist/resources/2010/Brickos.d.ts +9 -0
  52. package/dist/resources/2010/Brickos.js +21 -0
  53. package/dist/resources/2010/CrownOfThrones.d.ts +18 -0
  54. package/dist/resources/2010/CrownOfThrones.js +550 -0
  55. package/dist/resources/2011/Gygaxian.d.ts +9 -0
  56. package/dist/resources/2011/Gygaxian.js +24 -0
  57. package/dist/resources/2011/ObtuseAngel.js +21 -63
  58. package/dist/resources/2012/RainDoh.js +14 -40
  59. package/dist/resources/2012/Resolutions.d.ts +9 -0
  60. package/dist/resources/2012/Resolutions.js +28 -0
  61. package/dist/resources/2013/Florist.d.ts +61 -0
  62. package/dist/resources/2013/Florist.js +149 -0
  63. package/dist/resources/2013/PulledTaffy.d.ts +9 -0
  64. package/dist/resources/2013/PulledTaffy.js +33 -0
  65. package/dist/resources/2014/WinterGarden.js +15 -43
  66. package/dist/resources/2015/ChateauMantegna.js +52 -86
  67. package/dist/resources/2015/MayoClinic.d.ts +13 -0
  68. package/dist/resources/2015/MayoClinic.js +36 -0
  69. package/dist/resources/2016/SourceTerminal.d.ts +1 -0
  70. package/dist/resources/2016/SourceTerminal.js +114 -237
  71. package/dist/resources/2016/Witchess.js +33 -59
  72. package/dist/resources/2017/TunnelOfLove.js +62 -111
  73. package/dist/resources/2018/SongBoom.js +32 -68
  74. package/dist/resources/2019/BeachComb.d.ts +2 -0
  75. package/dist/resources/2019/BeachComb.js +26 -0
  76. package/dist/resources/2019/Snapper.d.ts +28 -0
  77. package/dist/resources/2019/Snapper.js +70 -0
  78. package/dist/resources/2020/Guzzlr.js +79 -163
  79. package/dist/resources/LibramSummon.d.ts +12 -0
  80. package/dist/resources/LibramSummon.js +66 -0
  81. package/dist/resources/index.d.ts +18 -11
  82. package/dist/resources/index.js +19 -85
  83. package/dist/resources/putty-likes.js +15 -30
  84. package/dist/ring-buffer.d.ts +24 -0
  85. package/dist/ring-buffer.js +135 -0
  86. package/dist/since.d.ts +1 -0
  87. package/dist/since.js +56 -112
  88. package/dist/template-string.js +40 -132
  89. package/dist/utils.d.ts +14 -0
  90. package/dist/utils.js +50 -114
  91. package/package.json +5 -3
  92. package/dist/libram-example-briefcase.js +0 -16073
  93. package/dist/libram-example-clan.js +0 -8898
  94. package/dist/libram-example-consult.js +0 -6179
  95. package/dist/libram-example-item.js +0 -3248
  96. package/dist/libram-example-kmail.js +0 -2065
  97. package/dist/libram-example-lib.js +0 -7608
  98. package/dist/libram-example-props.js +0 -4770
  99. package/dist/libram-example-resources.js +0 -12226
@@ -1,2065 +0,0 @@
1
- (function(e, a) { for(var i in a) e[i] = a[i]; if(a.__esModule) Object.defineProperty(e, "__esModule", { value: true }); }(exports,
2
- /******/ (() => { // webpackBootstrap
3
- /******/ var __webpack_modules__ = ({
4
-
5
- /***/ "./examples/kmail.ts":
6
- /*!***************************!*
7
- !*** ./examples/kmail.ts ***!
8
- \***************************/
9
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10
-
11
- "use strict";
12
- __webpack_require__.r(__webpack_exports__);
13
- /* harmony import */ var kolmafia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! kolmafia */ "kolmafia");
14
- /* harmony import */ var kolmafia__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(kolmafia__WEBPACK_IMPORTED_MODULE_0__);
15
- /* harmony import */ var _src__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../src */ "./src/Kmail.ts");
16
- /* harmony import */ var _src__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../src */ "./src/template-string.ts");
17
- /* provided dependency */ var console = __webpack_require__(/*! ./src/console */ "./src/console.ts");
18
- function _templateObject2() {
19
- var data = _taggedTemplateLiteral(["toast"]);
20
-
21
- _templateObject2 = function _templateObject2() {
22
- return data;
23
- };
24
-
25
- return data;
26
- }
27
-
28
- function _templateObject() {
29
- var data = _taggedTemplateLiteral(["toast"]);
30
-
31
- _templateObject = function _templateObject() {
32
- return data;
33
- };
34
-
35
- return data;
36
- }
37
-
38
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
39
-
40
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
41
-
42
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
43
-
44
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
45
-
46
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
47
-
48
- function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
49
-
50
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
51
-
52
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
53
-
54
-
55
-
56
-
57
- var _iterator = _createForOfIteratorHelper(_src__WEBPACK_IMPORTED_MODULE_1__.default.inbox()),
58
- _step;
59
-
60
- try {
61
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
62
- var kmail = _step.value;
63
-
64
- if (kmail.items().has((0,_src__WEBPACK_IMPORTED_MODULE_2__.$item)(_templateObject()))) {
65
- console.log("Thanking ".concat(kmail.senderName, " for ").concat(kmail.items().get((0,_src__WEBPACK_IMPORTED_MODULE_2__.$item)(_templateObject2())), " toast!"));
66
- kmail.reply("Thanks!");
67
- kmail["delete"]();
68
- }
69
- } //Kmail.send(myId(), "Gob!", [$item`gob of wet hair`], 1000);
70
-
71
- } catch (err) {
72
- _iterator.e(err);
73
- } finally {
74
- _iterator.f();
75
- }
76
-
77
- var randomShit = new Map(Object.entries((0,kolmafia__WEBPACK_IMPORTED_MODULE_0__.getInventory)()).map(function (_ref) {
78
- var _ref2 = _slicedToArray(_ref, 2),
79
- i = _ref2[0],
80
- q = _ref2[1];
81
-
82
- return [Item.get(i), q];
83
- }).filter(function (_ref3) {
84
- var _ref4 = _slicedToArray(_ref3, 1),
85
- i = _ref4[0];
86
-
87
- return (0,kolmafia__WEBPACK_IMPORTED_MODULE_0__.isGiftable)(i);
88
- }).slice(0, 10));
89
- _src__WEBPACK_IMPORTED_MODULE_1__.default.gift((0,kolmafia__WEBPACK_IMPORTED_MODULE_0__.myId)(), "Two!", randomShit, 1000);
90
-
91
- /***/ }),
92
-
93
- /***/ "./node_modules/core-js/es/object/entries.js":
94
- /*!***************************************************!*
95
- !*** ./node_modules/core-js/es/object/entries.js ***!
96
- \***************************************************/
97
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
98
-
99
- __webpack_require__(/*! ../../modules/es.object.entries */ "./node_modules/core-js/modules/es.object.entries.js");
100
-
101
- var path = __webpack_require__(/*! ../../internals/path */ "./node_modules/core-js/internals/path.js");
102
-
103
- module.exports = path.Object.entries;
104
-
105
- /***/ }),
106
-
107
- /***/ "./node_modules/core-js/features/object/entries.js":
108
- /*!*********************************************************!*
109
- !*** ./node_modules/core-js/features/object/entries.js ***!
110
- \*********************************************************/
111
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
112
-
113
- var parent = __webpack_require__(/*! ../../es/object/entries */ "./node_modules/core-js/es/object/entries.js");
114
-
115
- module.exports = parent;
116
-
117
- /***/ }),
118
-
119
- /***/ "./node_modules/core-js/internals/an-object.js":
120
- /*!*****************************************************!*
121
- !*** ./node_modules/core-js/internals/an-object.js ***!
122
- \*****************************************************/
123
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
124
-
125
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
126
-
127
- module.exports = function (it) {
128
- if (!isObject(it)) {
129
- throw TypeError(String(it) + ' is not an object');
130
- }
131
-
132
- return it;
133
- };
134
-
135
- /***/ }),
136
-
137
- /***/ "./node_modules/core-js/internals/array-includes.js":
138
- /*!**********************************************************!*
139
- !*** ./node_modules/core-js/internals/array-includes.js ***!
140
- \**********************************************************/
141
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
142
-
143
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
144
-
145
- var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js");
146
-
147
- var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "./node_modules/core-js/internals/to-absolute-index.js"); // `Array.prototype.{ indexOf, includes }` methods implementation
148
-
149
-
150
- var createMethod = function createMethod(IS_INCLUDES) {
151
- return function ($this, el, fromIndex) {
152
- var O = toIndexedObject($this);
153
- var length = toLength(O.length);
154
- var index = toAbsoluteIndex(fromIndex, length);
155
- var value; // Array#includes uses SameValueZero equality algorithm
156
- // eslint-disable-next-line no-self-compare -- NaN check
157
-
158
- if (IS_INCLUDES && el != el) while (length > index) {
159
- value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check
160
-
161
- if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not
162
- } else for (; length > index; index++) {
163
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
164
- }
165
- return !IS_INCLUDES && -1;
166
- };
167
- };
168
-
169
- module.exports = {
170
- // `Array.prototype.includes` method
171
- // https://tc39.es/ecma262/#sec-array.prototype.includes
172
- includes: createMethod(true),
173
- // `Array.prototype.indexOf` method
174
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
175
- indexOf: createMethod(false)
176
- };
177
-
178
- /***/ }),
179
-
180
- /***/ "./node_modules/core-js/internals/classof-raw.js":
181
- /*!*******************************************************!*
182
- !*** ./node_modules/core-js/internals/classof-raw.js ***!
183
- \*******************************************************/
184
- /***/ ((module) => {
185
-
186
- var toString = {}.toString;
187
-
188
- module.exports = function (it) {
189
- return toString.call(it).slice(8, -1);
190
- };
191
-
192
- /***/ }),
193
-
194
- /***/ "./node_modules/core-js/internals/copy-constructor-properties.js":
195
- /*!***********************************************************************!*
196
- !*** ./node_modules/core-js/internals/copy-constructor-properties.js ***!
197
- \***********************************************************************/
198
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
199
-
200
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
201
-
202
- var ownKeys = __webpack_require__(/*! ../internals/own-keys */ "./node_modules/core-js/internals/own-keys.js");
203
-
204
- var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js");
205
-
206
- var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
207
-
208
- module.exports = function (target, source) {
209
- var keys = ownKeys(source);
210
- var defineProperty = definePropertyModule.f;
211
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
212
-
213
- for (var i = 0; i < keys.length; i++) {
214
- var key = keys[i];
215
- if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
216
- }
217
- };
218
-
219
- /***/ }),
220
-
221
- /***/ "./node_modules/core-js/internals/create-non-enumerable-property.js":
222
- /*!**************************************************************************!*
223
- !*** ./node_modules/core-js/internals/create-non-enumerable-property.js ***!
224
- \**************************************************************************/
225
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
226
-
227
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
228
-
229
- var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js");
230
-
231
- var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
232
-
233
- module.exports = DESCRIPTORS ? function (object, key, value) {
234
- return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
235
- } : function (object, key, value) {
236
- object[key] = value;
237
- return object;
238
- };
239
-
240
- /***/ }),
241
-
242
- /***/ "./node_modules/core-js/internals/create-property-descriptor.js":
243
- /*!**********************************************************************!*
244
- !*** ./node_modules/core-js/internals/create-property-descriptor.js ***!
245
- \**********************************************************************/
246
- /***/ ((module) => {
247
-
248
- module.exports = function (bitmap, value) {
249
- return {
250
- enumerable: !(bitmap & 1),
251
- configurable: !(bitmap & 2),
252
- writable: !(bitmap & 4),
253
- value: value
254
- };
255
- };
256
-
257
- /***/ }),
258
-
259
- /***/ "./node_modules/core-js/internals/descriptors.js":
260
- /*!*******************************************************!*
261
- !*** ./node_modules/core-js/internals/descriptors.js ***!
262
- \*******************************************************/
263
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
264
-
265
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); // Detect IE8's incomplete defineProperty implementation
266
-
267
-
268
- module.exports = !fails(function () {
269
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
270
- return Object.defineProperty({}, 1, {
271
- get: function get() {
272
- return 7;
273
- }
274
- })[1] != 7;
275
- });
276
-
277
- /***/ }),
278
-
279
- /***/ "./node_modules/core-js/internals/document-create-element.js":
280
- /*!*******************************************************************!*
281
- !*** ./node_modules/core-js/internals/document-create-element.js ***!
282
- \*******************************************************************/
283
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
284
-
285
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
286
-
287
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
288
-
289
- var document = global.document; // typeof document.createElement is 'object' in old IE
290
-
291
- var EXISTS = isObject(document) && isObject(document.createElement);
292
-
293
- module.exports = function (it) {
294
- return EXISTS ? document.createElement(it) : {};
295
- };
296
-
297
- /***/ }),
298
-
299
- /***/ "./node_modules/core-js/internals/enum-bug-keys.js":
300
- /*!*********************************************************!*
301
- !*** ./node_modules/core-js/internals/enum-bug-keys.js ***!
302
- \*********************************************************/
303
- /***/ ((module) => {
304
-
305
- // IE8- don't enum bug keys
306
- module.exports = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
307
-
308
- /***/ }),
309
-
310
- /***/ "./node_modules/core-js/internals/export.js":
311
- /*!**************************************************!*
312
- !*** ./node_modules/core-js/internals/export.js ***!
313
- \**************************************************/
314
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
315
-
316
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
317
-
318
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
319
-
320
- var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "./node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
321
-
322
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
323
-
324
- var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js");
325
-
326
- var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/core-js/internals/set-global.js");
327
-
328
- var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "./node_modules/core-js/internals/copy-constructor-properties.js");
329
-
330
- var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js");
331
- /*
332
- options.target - name of the target object
333
- options.global - target is the global object
334
- options.stat - export as static methods of target
335
- options.proto - export as prototype methods of target
336
- options.real - real prototype method for the `pure` version
337
- options.forced - export even if the native feature is available
338
- options.bind - bind methods to the target, required for the `pure` version
339
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
340
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
341
- options.sham - add a flag to not completely full polyfills
342
- options.enumerable - export as enumerable property
343
- options.noTargetGet - prevent calling a getter on target
344
- */
345
-
346
-
347
- module.exports = function (options, source) {
348
- var TARGET = options.target;
349
- var GLOBAL = options.global;
350
- var STATIC = options.stat;
351
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
352
-
353
- if (GLOBAL) {
354
- target = global;
355
- } else if (STATIC) {
356
- target = global[TARGET] || setGlobal(TARGET, {});
357
- } else {
358
- target = (global[TARGET] || {}).prototype;
359
- }
360
-
361
- if (target) for (key in source) {
362
- sourceProperty = source[key];
363
-
364
- if (options.noTargetGet) {
365
- descriptor = getOwnPropertyDescriptor(target, key);
366
- targetProperty = descriptor && descriptor.value;
367
- } else targetProperty = target[key];
368
-
369
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target
370
-
371
- if (!FORCED && targetProperty !== undefined) {
372
- if (_typeof(sourceProperty) === _typeof(targetProperty)) continue;
373
- copyConstructorProperties(sourceProperty, targetProperty);
374
- } // add a flag to not completely full polyfills
375
-
376
-
377
- if (options.sham || targetProperty && targetProperty.sham) {
378
- createNonEnumerableProperty(sourceProperty, 'sham', true);
379
- } // extend global
380
-
381
-
382
- redefine(target, key, sourceProperty, options);
383
- }
384
- };
385
-
386
- /***/ }),
387
-
388
- /***/ "./node_modules/core-js/internals/fails.js":
389
- /*!*************************************************!*
390
- !*** ./node_modules/core-js/internals/fails.js ***!
391
- \*************************************************/
392
- /***/ ((module) => {
393
-
394
- module.exports = function (exec) {
395
- try {
396
- return !!exec();
397
- } catch (error) {
398
- return true;
399
- }
400
- };
401
-
402
- /***/ }),
403
-
404
- /***/ "./node_modules/core-js/internals/get-built-in.js":
405
- /*!********************************************************!*
406
- !*** ./node_modules/core-js/internals/get-built-in.js ***!
407
- \********************************************************/
408
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
409
-
410
- var path = __webpack_require__(/*! ../internals/path */ "./node_modules/core-js/internals/path.js");
411
-
412
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
413
-
414
- var aFunction = function aFunction(variable) {
415
- return typeof variable == 'function' ? variable : undefined;
416
- };
417
-
418
- module.exports = function (namespace, method) {
419
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
420
- };
421
-
422
- /***/ }),
423
-
424
- /***/ "./node_modules/core-js/internals/global.js":
425
- /*!**************************************************!*
426
- !*** ./node_modules/core-js/internals/global.js ***!
427
- \**************************************************/
428
- /***/ ((module) => {
429
-
430
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
431
-
432
- var check = function check(it) {
433
- return it && it.Math == Math && it;
434
- }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
435
-
436
-
437
- module.exports = // eslint-disable-next-line es/no-global-this -- safe
438
- check((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) == 'object' && globalThis) || check((typeof window === "undefined" ? "undefined" : _typeof(window)) == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe
439
- check((typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self) || check((typeof global === "undefined" ? "undefined" : _typeof(global)) == 'object' && global) || // eslint-disable-next-line no-new-func -- fallback
440
- function () {
441
- return this;
442
- }() || Function('return this')();
443
-
444
- /***/ }),
445
-
446
- /***/ "./node_modules/core-js/internals/has.js":
447
- /*!***********************************************!*
448
- !*** ./node_modules/core-js/internals/has.js ***!
449
- \***********************************************/
450
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
451
-
452
- var toObject = __webpack_require__(/*! ../internals/to-object */ "./node_modules/core-js/internals/to-object.js");
453
-
454
- var hasOwnProperty = {}.hasOwnProperty;
455
-
456
- module.exports = Object.hasOwn || function hasOwn(it, key) {
457
- return hasOwnProperty.call(toObject(it), key);
458
- };
459
-
460
- /***/ }),
461
-
462
- /***/ "./node_modules/core-js/internals/hidden-keys.js":
463
- /*!*******************************************************!*
464
- !*** ./node_modules/core-js/internals/hidden-keys.js ***!
465
- \*******************************************************/
466
- /***/ ((module) => {
467
-
468
- module.exports = {};
469
-
470
- /***/ }),
471
-
472
- /***/ "./node_modules/core-js/internals/ie8-dom-define.js":
473
- /*!**********************************************************!*
474
- !*** ./node_modules/core-js/internals/ie8-dom-define.js ***!
475
- \**********************************************************/
476
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
477
-
478
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
479
-
480
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
481
-
482
- var createElement = __webpack_require__(/*! ../internals/document-create-element */ "./node_modules/core-js/internals/document-create-element.js"); // Thank's IE8 for his funny defineProperty
483
-
484
-
485
- module.exports = !DESCRIPTORS && !fails(function () {
486
- // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
487
- return Object.defineProperty(createElement('div'), 'a', {
488
- get: function get() {
489
- return 7;
490
- }
491
- }).a != 7;
492
- });
493
-
494
- /***/ }),
495
-
496
- /***/ "./node_modules/core-js/internals/indexed-object.js":
497
- /*!**********************************************************!*
498
- !*** ./node_modules/core-js/internals/indexed-object.js ***!
499
- \**********************************************************/
500
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
501
-
502
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
503
-
504
- var classof = __webpack_require__(/*! ../internals/classof-raw */ "./node_modules/core-js/internals/classof-raw.js");
505
-
506
- var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings
507
-
508
- module.exports = fails(function () {
509
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
510
- // eslint-disable-next-line no-prototype-builtins -- safe
511
- return !Object('z').propertyIsEnumerable(0);
512
- }) ? function (it) {
513
- return classof(it) == 'String' ? split.call(it, '') : Object(it);
514
- } : Object;
515
-
516
- /***/ }),
517
-
518
- /***/ "./node_modules/core-js/internals/inspect-source.js":
519
- /*!**********************************************************!*
520
- !*** ./node_modules/core-js/internals/inspect-source.js ***!
521
- \**********************************************************/
522
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
523
-
524
- var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js");
525
-
526
- var functionToString = Function.toString; // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
527
-
528
- if (typeof store.inspectSource != 'function') {
529
- store.inspectSource = function (it) {
530
- return functionToString.call(it);
531
- };
532
- }
533
-
534
- module.exports = store.inspectSource;
535
-
536
- /***/ }),
537
-
538
- /***/ "./node_modules/core-js/internals/internal-state.js":
539
- /*!**********************************************************!*
540
- !*** ./node_modules/core-js/internals/internal-state.js ***!
541
- \**********************************************************/
542
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
543
-
544
- var NATIVE_WEAK_MAP = __webpack_require__(/*! ../internals/native-weak-map */ "./node_modules/core-js/internals/native-weak-map.js");
545
-
546
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
547
-
548
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js");
549
-
550
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
551
-
552
- var objectHas = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
553
-
554
- var shared = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js");
555
-
556
- var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "./node_modules/core-js/internals/shared-key.js");
557
-
558
- var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
559
-
560
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
561
- var WeakMap = global.WeakMap;
562
- var set, get, has;
563
-
564
- var enforce = function enforce(it) {
565
- return has(it) ? get(it) : set(it, {});
566
- };
567
-
568
- var getterFor = function getterFor(TYPE) {
569
- return function (it) {
570
- var state;
571
-
572
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
573
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
574
- }
575
-
576
- return state;
577
- };
578
- };
579
-
580
- if (NATIVE_WEAK_MAP || shared.state) {
581
- var store = shared.state || (shared.state = new WeakMap());
582
- var wmget = store.get;
583
- var wmhas = store.has;
584
- var wmset = store.set;
585
-
586
- set = function set(it, metadata) {
587
- if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
588
- metadata.facade = it;
589
- wmset.call(store, it, metadata);
590
- return metadata;
591
- };
592
-
593
- get = function get(it) {
594
- return wmget.call(store, it) || {};
595
- };
596
-
597
- has = function has(it) {
598
- return wmhas.call(store, it);
599
- };
600
- } else {
601
- var STATE = sharedKey('state');
602
- hiddenKeys[STATE] = true;
603
-
604
- set = function set(it, metadata) {
605
- if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
606
- metadata.facade = it;
607
- createNonEnumerableProperty(it, STATE, metadata);
608
- return metadata;
609
- };
610
-
611
- get = function get(it) {
612
- return objectHas(it, STATE) ? it[STATE] : {};
613
- };
614
-
615
- has = function has(it) {
616
- return objectHas(it, STATE);
617
- };
618
- }
619
-
620
- module.exports = {
621
- set: set,
622
- get: get,
623
- has: has,
624
- enforce: enforce,
625
- getterFor: getterFor
626
- };
627
-
628
- /***/ }),
629
-
630
- /***/ "./node_modules/core-js/internals/is-forced.js":
631
- /*!*****************************************************!*
632
- !*** ./node_modules/core-js/internals/is-forced.js ***!
633
- \*****************************************************/
634
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
635
-
636
- var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js");
637
-
638
- var replacement = /#|\.prototype\./;
639
-
640
- var isForced = function isForced(feature, detection) {
641
- var value = data[normalize(feature)];
642
- return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection;
643
- };
644
-
645
- var normalize = isForced.normalize = function (string) {
646
- return String(string).replace(replacement, '.').toLowerCase();
647
- };
648
-
649
- var data = isForced.data = {};
650
- var NATIVE = isForced.NATIVE = 'N';
651
- var POLYFILL = isForced.POLYFILL = 'P';
652
- module.exports = isForced;
653
-
654
- /***/ }),
655
-
656
- /***/ "./node_modules/core-js/internals/is-object.js":
657
- /*!*****************************************************!*
658
- !*** ./node_modules/core-js/internals/is-object.js ***!
659
- \*****************************************************/
660
- /***/ ((module) => {
661
-
662
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
663
-
664
- module.exports = function (it) {
665
- return _typeof(it) === 'object' ? it !== null : typeof it === 'function';
666
- };
667
-
668
- /***/ }),
669
-
670
- /***/ "./node_modules/core-js/internals/is-pure.js":
671
- /*!***************************************************!*
672
- !*** ./node_modules/core-js/internals/is-pure.js ***!
673
- \***************************************************/
674
- /***/ ((module) => {
675
-
676
- module.exports = false;
677
-
678
- /***/ }),
679
-
680
- /***/ "./node_modules/core-js/internals/native-weak-map.js":
681
- /*!***********************************************************!*
682
- !*** ./node_modules/core-js/internals/native-weak-map.js ***!
683
- \***********************************************************/
684
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
685
-
686
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
687
-
688
- var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/core-js/internals/inspect-source.js");
689
-
690
- var WeakMap = global.WeakMap;
691
- module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
692
-
693
- /***/ }),
694
-
695
- /***/ "./node_modules/core-js/internals/object-define-property.js":
696
- /*!******************************************************************!*
697
- !*** ./node_modules/core-js/internals/object-define-property.js ***!
698
- \******************************************************************/
699
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
700
-
701
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
702
-
703
- var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/core-js/internals/ie8-dom-define.js");
704
-
705
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js");
706
-
707
- var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js"); // eslint-disable-next-line es/no-object-defineproperty -- safe
708
-
709
-
710
- var $defineProperty = Object.defineProperty; // `Object.defineProperty` method
711
- // https://tc39.es/ecma262/#sec-object.defineproperty
712
-
713
- exports.f = DESCRIPTORS ? $defineProperty : function defineProperty(O, P, Attributes) {
714
- anObject(O);
715
- P = toPrimitive(P, true);
716
- anObject(Attributes);
717
- if (IE8_DOM_DEFINE) try {
718
- return $defineProperty(O, P, Attributes);
719
- } catch (error) {
720
- /* empty */
721
- }
722
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
723
- if ('value' in Attributes) O[P] = Attributes.value;
724
- return O;
725
- };
726
-
727
- /***/ }),
728
-
729
- /***/ "./node_modules/core-js/internals/object-get-own-property-descriptor.js":
730
- /*!******************************************************************************!*
731
- !*** ./node_modules/core-js/internals/object-get-own-property-descriptor.js ***!
732
- \******************************************************************************/
733
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
734
-
735
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
736
-
737
- var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js");
738
-
739
- var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "./node_modules/core-js/internals/create-property-descriptor.js");
740
-
741
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
742
-
743
- var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "./node_modules/core-js/internals/to-primitive.js");
744
-
745
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
746
-
747
- var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "./node_modules/core-js/internals/ie8-dom-define.js"); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
748
-
749
-
750
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method
751
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
752
-
753
- exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
754
- O = toIndexedObject(O);
755
- P = toPrimitive(P, true);
756
- if (IE8_DOM_DEFINE) try {
757
- return $getOwnPropertyDescriptor(O, P);
758
- } catch (error) {
759
- /* empty */
760
- }
761
- if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
762
- };
763
-
764
- /***/ }),
765
-
766
- /***/ "./node_modules/core-js/internals/object-get-own-property-names.js":
767
- /*!*************************************************************************!*
768
- !*** ./node_modules/core-js/internals/object-get-own-property-names.js ***!
769
- \*************************************************************************/
770
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
771
-
772
- var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/core-js/internals/object-keys-internal.js");
773
-
774
- var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js");
775
-
776
- var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method
777
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
778
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
779
-
780
- exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
781
- return internalObjectKeys(O, hiddenKeys);
782
- };
783
-
784
- /***/ }),
785
-
786
- /***/ "./node_modules/core-js/internals/object-get-own-property-symbols.js":
787
- /*!***************************************************************************!*
788
- !*** ./node_modules/core-js/internals/object-get-own-property-symbols.js ***!
789
- \***************************************************************************/
790
- /***/ ((__unused_webpack_module, exports) => {
791
-
792
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
793
- exports.f = Object.getOwnPropertySymbols;
794
-
795
- /***/ }),
796
-
797
- /***/ "./node_modules/core-js/internals/object-keys-internal.js":
798
- /*!****************************************************************!*
799
- !*** ./node_modules/core-js/internals/object-keys-internal.js ***!
800
- \****************************************************************/
801
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
802
-
803
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
804
-
805
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
806
-
807
- var indexOf = __webpack_require__(/*! ../internals/array-includes */ "./node_modules/core-js/internals/array-includes.js").indexOf;
808
-
809
- var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "./node_modules/core-js/internals/hidden-keys.js");
810
-
811
- module.exports = function (object, names) {
812
- var O = toIndexedObject(object);
813
- var i = 0;
814
- var result = [];
815
- var key;
816
-
817
- for (key in O) {
818
- !has(hiddenKeys, key) && has(O, key) && result.push(key);
819
- } // Don't enum bug & hidden keys
820
-
821
-
822
- while (names.length > i) {
823
- if (has(O, key = names[i++])) {
824
- ~indexOf(result, key) || result.push(key);
825
- }
826
- }
827
-
828
- return result;
829
- };
830
-
831
- /***/ }),
832
-
833
- /***/ "./node_modules/core-js/internals/object-keys.js":
834
- /*!*******************************************************!*
835
- !*** ./node_modules/core-js/internals/object-keys.js ***!
836
- \*******************************************************/
837
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
838
-
839
- var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "./node_modules/core-js/internals/object-keys-internal.js");
840
-
841
- var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "./node_modules/core-js/internals/enum-bug-keys.js"); // `Object.keys` method
842
- // https://tc39.es/ecma262/#sec-object.keys
843
- // eslint-disable-next-line es/no-object-keys -- safe
844
-
845
-
846
- module.exports = Object.keys || function keys(O) {
847
- return internalObjectKeys(O, enumBugKeys);
848
- };
849
-
850
- /***/ }),
851
-
852
- /***/ "./node_modules/core-js/internals/object-property-is-enumerable.js":
853
- /*!*************************************************************************!*
854
- !*** ./node_modules/core-js/internals/object-property-is-enumerable.js ***!
855
- \*************************************************************************/
856
- /***/ ((__unused_webpack_module, exports) => {
857
-
858
- "use strict";
859
-
860
-
861
- var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
862
-
863
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug
864
-
865
- var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({
866
- 1: 2
867
- }, 1); // `Object.prototype.propertyIsEnumerable` method implementation
868
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
869
-
870
- exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
871
- var descriptor = getOwnPropertyDescriptor(this, V);
872
- return !!descriptor && descriptor.enumerable;
873
- } : $propertyIsEnumerable;
874
-
875
- /***/ }),
876
-
877
- /***/ "./node_modules/core-js/internals/object-to-array.js":
878
- /*!***********************************************************!*
879
- !*** ./node_modules/core-js/internals/object-to-array.js ***!
880
- \***********************************************************/
881
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
882
-
883
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js");
884
-
885
- var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "./node_modules/core-js/internals/object-keys.js");
886
-
887
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "./node_modules/core-js/internals/to-indexed-object.js");
888
-
889
- var propertyIsEnumerable = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "./node_modules/core-js/internals/object-property-is-enumerable.js").f; // `Object.{ entries, values }` methods implementation
890
-
891
-
892
- var createMethod = function createMethod(TO_ENTRIES) {
893
- return function (it) {
894
- var O = toIndexedObject(it);
895
- var keys = objectKeys(O);
896
- var length = keys.length;
897
- var i = 0;
898
- var result = [];
899
- var key;
900
-
901
- while (length > i) {
902
- key = keys[i++];
903
-
904
- if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {
905
- result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
906
- }
907
- }
908
-
909
- return result;
910
- };
911
- };
912
-
913
- module.exports = {
914
- // `Object.entries` method
915
- // https://tc39.es/ecma262/#sec-object.entries
916
- entries: createMethod(true),
917
- // `Object.values` method
918
- // https://tc39.es/ecma262/#sec-object.values
919
- values: createMethod(false)
920
- };
921
-
922
- /***/ }),
923
-
924
- /***/ "./node_modules/core-js/internals/own-keys.js":
925
- /*!****************************************************!*
926
- !*** ./node_modules/core-js/internals/own-keys.js ***!
927
- \****************************************************/
928
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
929
-
930
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js");
931
-
932
- var getOwnPropertyNamesModule = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js");
933
-
934
- var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "./node_modules/core-js/internals/object-get-own-property-symbols.js");
935
-
936
- var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js"); // all object keys, includes non-enumerable and symbols
937
-
938
-
939
- module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
940
- var keys = getOwnPropertyNamesModule.f(anObject(it));
941
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
942
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
943
- };
944
-
945
- /***/ }),
946
-
947
- /***/ "./node_modules/core-js/internals/path.js":
948
- /*!************************************************!*
949
- !*** ./node_modules/core-js/internals/path.js ***!
950
- \************************************************/
951
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
952
-
953
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
954
-
955
- module.exports = global;
956
-
957
- /***/ }),
958
-
959
- /***/ "./node_modules/core-js/internals/redefine.js":
960
- /*!****************************************************!*
961
- !*** ./node_modules/core-js/internals/redefine.js ***!
962
- \****************************************************/
963
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
964
-
965
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
966
-
967
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
968
-
969
- var has = __webpack_require__(/*! ../internals/has */ "./node_modules/core-js/internals/has.js");
970
-
971
- var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/core-js/internals/set-global.js");
972
-
973
- var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "./node_modules/core-js/internals/inspect-source.js");
974
-
975
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js");
976
-
977
- var getInternalState = InternalStateModule.get;
978
- var enforceInternalState = InternalStateModule.enforce;
979
- var TEMPLATE = String(String).split('String');
980
- (module.exports = function (O, key, value, options) {
981
- var unsafe = options ? !!options.unsafe : false;
982
- var simple = options ? !!options.enumerable : false;
983
- var noTargetGet = options ? !!options.noTargetGet : false;
984
- var state;
985
-
986
- if (typeof value == 'function') {
987
- if (typeof key == 'string' && !has(value, 'name')) {
988
- createNonEnumerableProperty(value, 'name', key);
989
- }
990
-
991
- state = enforceInternalState(value);
992
-
993
- if (!state.source) {
994
- state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
995
- }
996
- }
997
-
998
- if (O === global) {
999
- if (simple) O[key] = value;else setGlobal(key, value);
1000
- return;
1001
- } else if (!unsafe) {
1002
- delete O[key];
1003
- } else if (!noTargetGet && O[key]) {
1004
- simple = true;
1005
- }
1006
-
1007
- if (simple) O[key] = value;else createNonEnumerableProperty(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
1008
- })(Function.prototype, 'toString', function toString() {
1009
- return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
1010
- });
1011
-
1012
- /***/ }),
1013
-
1014
- /***/ "./node_modules/core-js/internals/require-object-coercible.js":
1015
- /*!********************************************************************!*
1016
- !*** ./node_modules/core-js/internals/require-object-coercible.js ***!
1017
- \********************************************************************/
1018
- /***/ ((module) => {
1019
-
1020
- // `RequireObjectCoercible` abstract operation
1021
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
1022
- module.exports = function (it) {
1023
- if (it == undefined) throw TypeError("Can't call method on " + it);
1024
- return it;
1025
- };
1026
-
1027
- /***/ }),
1028
-
1029
- /***/ "./node_modules/core-js/internals/set-global.js":
1030
- /*!******************************************************!*
1031
- !*** ./node_modules/core-js/internals/set-global.js ***!
1032
- \******************************************************/
1033
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1034
-
1035
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
1036
-
1037
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "./node_modules/core-js/internals/create-non-enumerable-property.js");
1038
-
1039
- module.exports = function (key, value) {
1040
- try {
1041
- createNonEnumerableProperty(global, key, value);
1042
- } catch (error) {
1043
- global[key] = value;
1044
- }
1045
-
1046
- return value;
1047
- };
1048
-
1049
- /***/ }),
1050
-
1051
- /***/ "./node_modules/core-js/internals/shared-key.js":
1052
- /*!******************************************************!*
1053
- !*** ./node_modules/core-js/internals/shared-key.js ***!
1054
- \******************************************************/
1055
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1056
-
1057
- var shared = __webpack_require__(/*! ../internals/shared */ "./node_modules/core-js/internals/shared.js");
1058
-
1059
- var uid = __webpack_require__(/*! ../internals/uid */ "./node_modules/core-js/internals/uid.js");
1060
-
1061
- var keys = shared('keys');
1062
-
1063
- module.exports = function (key) {
1064
- return keys[key] || (keys[key] = uid(key));
1065
- };
1066
-
1067
- /***/ }),
1068
-
1069
- /***/ "./node_modules/core-js/internals/shared-store.js":
1070
- /*!********************************************************!*
1071
- !*** ./node_modules/core-js/internals/shared-store.js ***!
1072
- \********************************************************/
1073
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1074
-
1075
- var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js");
1076
-
1077
- var setGlobal = __webpack_require__(/*! ../internals/set-global */ "./node_modules/core-js/internals/set-global.js");
1078
-
1079
- var SHARED = '__core-js_shared__';
1080
- var store = global[SHARED] || setGlobal(SHARED, {});
1081
- module.exports = store;
1082
-
1083
- /***/ }),
1084
-
1085
- /***/ "./node_modules/core-js/internals/shared.js":
1086
- /*!**************************************************!*
1087
- !*** ./node_modules/core-js/internals/shared.js ***!
1088
- \**************************************************/
1089
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1090
-
1091
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "./node_modules/core-js/internals/is-pure.js");
1092
-
1093
- var store = __webpack_require__(/*! ../internals/shared-store */ "./node_modules/core-js/internals/shared-store.js");
1094
-
1095
- (module.exports = function (key, value) {
1096
- return store[key] || (store[key] = value !== undefined ? value : {});
1097
- })('versions', []).push({
1098
- version: '3.15.2',
1099
- mode: IS_PURE ? 'pure' : 'global',
1100
- copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
1101
- });
1102
-
1103
- /***/ }),
1104
-
1105
- /***/ "./node_modules/core-js/internals/to-absolute-index.js":
1106
- /*!*************************************************************!*
1107
- !*** ./node_modules/core-js/internals/to-absolute-index.js ***!
1108
- \*************************************************************/
1109
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1110
-
1111
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
1112
-
1113
- var max = Math.max;
1114
- var min = Math.min; // Helper for a popular repeating case of the spec:
1115
- // Let integer be ? ToInteger(index).
1116
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
1117
-
1118
- module.exports = function (index, length) {
1119
- var integer = toInteger(index);
1120
- return integer < 0 ? max(integer + length, 0) : min(integer, length);
1121
- };
1122
-
1123
- /***/ }),
1124
-
1125
- /***/ "./node_modules/core-js/internals/to-indexed-object.js":
1126
- /*!*************************************************************!*
1127
- !*** ./node_modules/core-js/internals/to-indexed-object.js ***!
1128
- \*************************************************************/
1129
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1130
-
1131
- // toObject with fallback for non-array-like ES3 strings
1132
- var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "./node_modules/core-js/internals/indexed-object.js");
1133
-
1134
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js");
1135
-
1136
- module.exports = function (it) {
1137
- return IndexedObject(requireObjectCoercible(it));
1138
- };
1139
-
1140
- /***/ }),
1141
-
1142
- /***/ "./node_modules/core-js/internals/to-integer.js":
1143
- /*!******************************************************!*
1144
- !*** ./node_modules/core-js/internals/to-integer.js ***!
1145
- \******************************************************/
1146
- /***/ ((module) => {
1147
-
1148
- var ceil = Math.ceil;
1149
- var floor = Math.floor; // `ToInteger` abstract operation
1150
- // https://tc39.es/ecma262/#sec-tointeger
1151
-
1152
- module.exports = function (argument) {
1153
- return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
1154
- };
1155
-
1156
- /***/ }),
1157
-
1158
- /***/ "./node_modules/core-js/internals/to-length.js":
1159
- /*!*****************************************************!*
1160
- !*** ./node_modules/core-js/internals/to-length.js ***!
1161
- \*****************************************************/
1162
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1163
-
1164
- var toInteger = __webpack_require__(/*! ../internals/to-integer */ "./node_modules/core-js/internals/to-integer.js");
1165
-
1166
- var min = Math.min; // `ToLength` abstract operation
1167
- // https://tc39.es/ecma262/#sec-tolength
1168
-
1169
- module.exports = function (argument) {
1170
- return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
1171
- };
1172
-
1173
- /***/ }),
1174
-
1175
- /***/ "./node_modules/core-js/internals/to-object.js":
1176
- /*!*****************************************************!*
1177
- !*** ./node_modules/core-js/internals/to-object.js ***!
1178
- \*****************************************************/
1179
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1180
-
1181
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js"); // `ToObject` abstract operation
1182
- // https://tc39.es/ecma262/#sec-toobject
1183
-
1184
-
1185
- module.exports = function (argument) {
1186
- return Object(requireObjectCoercible(argument));
1187
- };
1188
-
1189
- /***/ }),
1190
-
1191
- /***/ "./node_modules/core-js/internals/to-primitive.js":
1192
- /*!********************************************************!*
1193
- !*** ./node_modules/core-js/internals/to-primitive.js ***!
1194
- \********************************************************/
1195
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1196
-
1197
- var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js"); // `ToPrimitive` abstract operation
1198
- // https://tc39.es/ecma262/#sec-toprimitive
1199
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
1200
- // and the second argument - flag - preferred type is a string
1201
-
1202
-
1203
- module.exports = function (input, PREFERRED_STRING) {
1204
- if (!isObject(input)) return input;
1205
- var fn, val;
1206
- if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
1207
- if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
1208
- if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
1209
- throw TypeError("Can't convert object to primitive value");
1210
- };
1211
-
1212
- /***/ }),
1213
-
1214
- /***/ "./node_modules/core-js/internals/uid.js":
1215
- /*!***********************************************!*
1216
- !*** ./node_modules/core-js/internals/uid.js ***!
1217
- \***********************************************/
1218
- /***/ ((module) => {
1219
-
1220
- var id = 0;
1221
- var postfix = Math.random();
1222
-
1223
- module.exports = function (key) {
1224
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
1225
- };
1226
-
1227
- /***/ }),
1228
-
1229
- /***/ "./node_modules/core-js/modules/es.object.entries.js":
1230
- /*!***********************************************************!*
1231
- !*** ./node_modules/core-js/modules/es.object.entries.js ***!
1232
- \***********************************************************/
1233
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
1234
-
1235
- var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js");
1236
-
1237
- var $entries = __webpack_require__(/*! ../internals/object-to-array */ "./node_modules/core-js/internals/object-to-array.js").entries; // `Object.entries` method
1238
- // https://tc39.es/ecma262/#sec-object.entries
1239
-
1240
-
1241
- $({
1242
- target: 'Object',
1243
- stat: true
1244
- }, {
1245
- entries: function entries(O) {
1246
- return $entries(O);
1247
- }
1248
- });
1249
-
1250
- /***/ }),
1251
-
1252
- /***/ "./src/Kmail.ts":
1253
- /*!**********************!*
1254
- !*** ./src/Kmail.ts ***!
1255
- \**********************/
1256
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1257
-
1258
- "use strict";
1259
- __webpack_require__.r(__webpack_exports__);
1260
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1261
- /* harmony export */ "default": () => /* binding */ Kmail
1262
- /* harmony export */ });
1263
- /* harmony import */ var core_js_features_object_entries__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/features/object/entries */ "./node_modules/core-js/features/object/entries.js");
1264
- /* harmony import */ var core_js_features_object_entries__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_features_object_entries__WEBPACK_IMPORTED_MODULE_0__);
1265
- /* harmony import */ var kolmafia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! kolmafia */ "kolmafia");
1266
- /* harmony import */ var kolmafia__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(kolmafia__WEBPACK_IMPORTED_MODULE_1__);
1267
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./src/utils.ts");
1268
- /* provided dependency */ var console = __webpack_require__(/*! ./src/console */ "./src/console.ts");
1269
- function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
1270
-
1271
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1272
-
1273
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1274
-
1275
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1276
-
1277
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1278
-
1279
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1280
-
1281
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1282
-
1283
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1284
-
1285
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
1286
-
1287
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1288
-
1289
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1290
-
1291
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1292
-
1293
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1294
-
1295
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1296
-
1297
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1298
-
1299
-
1300
-
1301
-
1302
-
1303
- var Kmail = /*#__PURE__*/function () {
1304
- _createClass(Kmail, null, [{
1305
- key: "parse",
1306
-
1307
- /**
1308
- * Parses a kmail from KoL's native format
1309
- *
1310
- * @param rawKmail Kmail in the format supplies by api.php
1311
- * @returns Parsed kmail
1312
- */
1313
- value: function parse(rawKmail) {
1314
- return new Kmail(rawKmail);
1315
- }
1316
- /**
1317
- * Returns all of the player's kmails
1318
- *
1319
- * @returns Parsed kmails
1320
- */
1321
-
1322
- }, {
1323
- key: "inbox",
1324
- value: function inbox() {
1325
- return JSON.parse((0,kolmafia__WEBPACK_IMPORTED_MODULE_1__.visitUrl)("api.php?what=kmail&for=ASSistant")).map(Kmail.parse);
1326
- }
1327
- /**
1328
- * Bulk delete kmails
1329
- *
1330
- * @param kmails Kmails to delete
1331
- * @returns Number of kmails deleted
1332
- */
1333
-
1334
- }, {
1335
- key: "delete",
1336
- value: function _delete(kmails) {
1337
- var _results$match$, _results$match;
1338
-
1339
- var results = (0,kolmafia__WEBPACK_IMPORTED_MODULE_1__.visitUrl)("messages.php?the_action=delete&box=Inbox&pwd&".concat(kmails.map(function (k) {
1340
- return "sel".concat(k.id, "=on");
1341
- }).join("&")));
1342
- return Number((_results$match$ = (_results$match = results.match(/<td>(\d) messages? deleted.<\/td>/)) === null || _results$match === void 0 ? void 0 : _results$match[1]) !== null && _results$match$ !== void 0 ? _results$match$ : 0);
1343
- }
1344
- }, {
1345
- key: "_genericSend",
1346
- value: function _genericSend(to, message, items, meat, chunkSize, constructUrl, successString) {
1347
- var m = meat;
1348
-
1349
- var sendableItems = _toConsumableArray((0,_utils__WEBPACK_IMPORTED_MODULE_2__.arrayToCountedMap)(items).entries()).filter(function (_ref) {
1350
- var _ref2 = _slicedToArray(_ref, 1),
1351
- item = _ref2[0];
1352
-
1353
- return (0,kolmafia__WEBPACK_IMPORTED_MODULE_1__.isGiftable)(item);
1354
- });
1355
-
1356
- var result = true;
1357
- var chunks = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.chunk)(sendableItems, chunkSize);
1358
- console.log(chunks.length); // Split the items to be sent into chunks of max 11 item types
1359
-
1360
- var _iterator = _createForOfIteratorHelper(chunks.length > 0 ? chunks : [null]),
1361
- _step;
1362
-
1363
- try {
1364
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
1365
- var c = _step.value;
1366
-
1367
- var _itemsQuery = c === null ? [] : c.map(function (_ref3, index) {
1368
- var _ref4 = _slicedToArray(_ref3, 2),
1369
- item = _ref4[0],
1370
- quantity = _ref4[1];
1371
-
1372
- return "whichitem".concat(index + 1, "=").concat((0,kolmafia__WEBPACK_IMPORTED_MODULE_1__.toInt)(item), "&howmany").concat(index + 1, "=").concat(quantity);
1373
- });
1374
-
1375
- var url = constructUrl(m, _itemsQuery.join("&"), _itemsQuery.length);
1376
- console.log(url);
1377
- var r = (0,kolmafia__WEBPACK_IMPORTED_MODULE_1__.visitUrl)(url);
1378
-
1379
- if (r.includes("That player cannot receive Meat or items")) {
1380
- return Kmail.gift(to, message, items, meat);
1381
- } // Make sure we don't send the same batch of meat with every chunk
1382
-
1383
-
1384
- m = 0;
1385
- result && (result = r.includes(successString));
1386
- }
1387
- } catch (err) {
1388
- _iterator.e(err);
1389
- } finally {
1390
- _iterator.f();
1391
- }
1392
-
1393
- return result;
1394
- }
1395
- /**
1396
- * Sends a kmail to a player
1397
- *
1398
- * Sends multiple kmails if more than 11 unique item types are attached.
1399
- * Ignores any ungiftable items.
1400
- * Sends a gift package to players in run
1401
- *
1402
- * @param to The player name or id to receive the kmail
1403
- * @param message The text contents of the message
1404
- * @param items The items to be attached
1405
- * @param meat The quantity of meat to be attached
1406
- * @returns True if the kmail was successfully sent
1407
- */
1408
-
1409
- }, {
1410
- key: "send",
1411
- value: function send(to) {
1412
- var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
1413
- var items = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
1414
- var meat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
1415
- return Kmail._genericSend(to, message, items, meat, 11, function (meat, itemsQuery) {
1416
- return "sendmessage.php?action=send&pwd&towho=".concat(to, "&message=").concat(message).concat(itemsQuery ? "&".concat(itemsQuery) : "", "&sendmeat=").concat(meat);
1417
- }, ">Message sent.</");
1418
- }
1419
- /**
1420
- * Sends a gift to a player
1421
- *
1422
- * Sends multiple kmails if more than 3 unique item types are attached.
1423
- * Ignores any ungiftable items.
1424
- *
1425
- * @param to The player name or id to receive the gift
1426
- * @param note The note on the outside of the gift
1427
- * @param items The items to be attached
1428
- * @param meat The quantity of meat to be attached
1429
- * @param insideNode The note on the inside of the gift
1430
- * @returns True if the gift was successfully sent
1431
- */
1432
-
1433
- }, {
1434
- key: "gift",
1435
- value: function gift(to) {
1436
- var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
1437
- var items = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
1438
- var meat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
1439
- var insideNote = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
1440
- var baseUrl = "town_sendgift.php?action=Yep.&pwd&fromwhere=0&note=".concat(message, "&insidenote=").concat(insideNote, "&towho=").concat(to);
1441
- return Kmail._genericSend(to, message, items, meat, 3, function (m, itemsQuery, chunkSize) {
1442
- return "".concat(baseUrl, "&whichpackage=").concat(chunkSize).concat(itemsQuery ? "&".concat(itemsQuery) : "", "&sendmeat=").concat(m);
1443
- }, ">Package sent.</");
1444
- }
1445
- }]);
1446
-
1447
- function Kmail(rawKmail) {
1448
- _classCallCheck(this, Kmail);
1449
-
1450
- _defineProperty(this, "id", void 0);
1451
-
1452
- _defineProperty(this, "date", void 0);
1453
-
1454
- _defineProperty(this, "type", void 0);
1455
-
1456
- _defineProperty(this, "senderId", void 0);
1457
-
1458
- _defineProperty(this, "senderName", void 0);
1459
-
1460
- _defineProperty(this, "message", void 0);
1461
-
1462
- this.id = Number(rawKmail.id);
1463
- this.date = new Date(rawKmail.localtime);
1464
- this.type = rawKmail.type;
1465
- this.senderId = Number(rawKmail.fromid);
1466
- this.senderName = rawKmail.fromname;
1467
- this.message = rawKmail.message;
1468
- }
1469
- /**
1470
- * Delete the kmail
1471
- *
1472
- * @returns Whether the kmail was deleted
1473
- */
1474
-
1475
-
1476
- _createClass(Kmail, [{
1477
- key: "delete",
1478
- value: function _delete() {
1479
- return Kmail["delete"]([this]) === 1;
1480
- }
1481
- /**
1482
- * Get items attached to the kmail
1483
- *
1484
- * @returns Map of items attached to the kmail and their quantities
1485
- */
1486
-
1487
- }, {
1488
- key: "items",
1489
- value: function items() {
1490
- return new Map(Object.entries((0,kolmafia__WEBPACK_IMPORTED_MODULE_1__.extractItems)(this.message)).map(function (_ref5) {
1491
- var _ref6 = _slicedToArray(_ref5, 2),
1492
- itemName = _ref6[0],
1493
- quantity = _ref6[1];
1494
-
1495
- return [Item.get(itemName), quantity];
1496
- }));
1497
- }
1498
- /**
1499
- * Get meat attached to the kmail
1500
- *
1501
- * @returns Meat attached to the kmail
1502
- */
1503
-
1504
- }, {
1505
- key: "meat",
1506
- value: function meat() {
1507
- return (0,kolmafia__WEBPACK_IMPORTED_MODULE_1__.extractMeat)(this.message);
1508
- }
1509
- /**
1510
- * Reply to kmail
1511
- *
1512
- * @see Kmail.send
1513
- *
1514
- * @returns True if the kmail was successfully sent
1515
- */
1516
-
1517
- }, {
1518
- key: "reply",
1519
- value: function reply() {
1520
- var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
1521
- var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1522
- var meat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1523
- return Kmail.send(this.senderId, message, items, meat);
1524
- }
1525
- }]);
1526
-
1527
- return Kmail;
1528
- }();
1529
-
1530
-
1531
-
1532
- /***/ }),
1533
-
1534
- /***/ "./src/console.ts":
1535
- /*!************************!*
1536
- !*** ./src/console.ts ***!
1537
- \************************/
1538
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1539
-
1540
- "use strict";
1541
- __webpack_require__.r(__webpack_exports__);
1542
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1543
- /* harmony export */ "log": () => /* binding */ log,
1544
- /* harmony export */ "info": () => /* binding */ info,
1545
- /* harmony export */ "warn": () => /* binding */ warn,
1546
- /* harmony export */ "error": () => /* binding */ error
1547
- /* harmony export */ });
1548
- /* harmony import */ var kolmafia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! kolmafia */ "kolmafia");
1549
- /* harmony import */ var kolmafia__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(kolmafia__WEBPACK_IMPORTED_MODULE_0__);
1550
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1551
-
1552
- var logColor = function logColor(color) {
1553
- return function () {
1554
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1555
- args[_key] = arguments[_key];
1556
- }
1557
-
1558
- var output = args.map(function (x) {
1559
- return x.toString();
1560
- }).join(" ");
1561
-
1562
- if (color) {
1563
- (0,kolmafia__WEBPACK_IMPORTED_MODULE_0__.print)(output, color);
1564
- } else {
1565
- (0,kolmafia__WEBPACK_IMPORTED_MODULE_0__.print)(output);
1566
- }
1567
- };
1568
- };
1569
-
1570
- var log = logColor();
1571
- var info = logColor("blue");
1572
- var warn = logColor("red");
1573
- var error = logColor("red");
1574
-
1575
- /***/ }),
1576
-
1577
- /***/ "./src/template-string.ts":
1578
- /*!********************************!*
1579
- !*** ./src/template-string.ts ***!
1580
- \********************************/
1581
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1582
-
1583
- "use strict";
1584
- __webpack_require__.r(__webpack_exports__);
1585
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1586
- /* harmony export */ "$bounty": () => /* binding */ $bounty,
1587
- /* harmony export */ "$bounties": () => /* binding */ $bounties,
1588
- /* harmony export */ "$class": () => /* binding */ $class,
1589
- /* harmony export */ "$classes": () => /* binding */ $classes,
1590
- /* harmony export */ "$coinmaster": () => /* binding */ $coinmaster,
1591
- /* harmony export */ "$coinmasters": () => /* binding */ $coinmasters,
1592
- /* harmony export */ "$effect": () => /* binding */ $effect,
1593
- /* harmony export */ "$effects": () => /* binding */ $effects,
1594
- /* harmony export */ "$element": () => /* binding */ $element,
1595
- /* harmony export */ "$elements": () => /* binding */ $elements,
1596
- /* harmony export */ "$familiar": () => /* binding */ $familiar,
1597
- /* harmony export */ "$familiars": () => /* binding */ $familiars,
1598
- /* harmony export */ "$item": () => /* binding */ $item,
1599
- /* harmony export */ "$items": () => /* binding */ $items,
1600
- /* harmony export */ "$location": () => /* binding */ $location,
1601
- /* harmony export */ "$locations": () => /* binding */ $locations,
1602
- /* harmony export */ "$monster": () => /* binding */ $monster,
1603
- /* harmony export */ "$monsters": () => /* binding */ $monsters,
1604
- /* harmony export */ "$phylum": () => /* binding */ $phylum,
1605
- /* harmony export */ "$phyla": () => /* binding */ $phyla,
1606
- /* harmony export */ "$servant": () => /* binding */ $servant,
1607
- /* harmony export */ "$servants": () => /* binding */ $servants,
1608
- /* harmony export */ "$skill": () => /* binding */ $skill,
1609
- /* harmony export */ "$skills": () => /* binding */ $skills,
1610
- /* harmony export */ "$slot": () => /* binding */ $slot,
1611
- /* harmony export */ "$slots": () => /* binding */ $slots,
1612
- /* harmony export */ "$stat": () => /* binding */ $stat,
1613
- /* harmony export */ "$stats": () => /* binding */ $stats,
1614
- /* harmony export */ "$thrall": () => /* binding */ $thrall,
1615
- /* harmony export */ "$thralls": () => /* binding */ $thralls
1616
- /* harmony export */ });
1617
- var concatTemplateString = function concatTemplateString(literals) {
1618
- for (var _len = arguments.length, placeholders = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1619
- placeholders[_key - 1] = arguments[_key];
1620
- }
1621
-
1622
- return literals.reduce(function (acc, literal, i) {
1623
- return acc + literal + (placeholders[i] || "");
1624
- }, "");
1625
- };
1626
-
1627
- var createSingleConstant = function createSingleConstant(Type) {
1628
- return function (literals) {
1629
- for (var _len2 = arguments.length, placeholders = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1630
- placeholders[_key2 - 1] = arguments[_key2];
1631
- }
1632
-
1633
- var input = concatTemplateString.apply(void 0, [literals].concat(placeholders));
1634
- return Type.get(input);
1635
- };
1636
- };
1637
-
1638
- var createPluralConstant = function createPluralConstant(Type) {
1639
- return function (literals) {
1640
- for (var _len3 = arguments.length, placeholders = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
1641
- placeholders[_key3 - 1] = arguments[_key3];
1642
- }
1643
-
1644
- var input = concatTemplateString.apply(void 0, [literals].concat(placeholders));
1645
-
1646
- if (input === "") {
1647
- return Type.all();
1648
- }
1649
-
1650
- return Type.get(input.split(/\s*,\s*/));
1651
- };
1652
- };
1653
- /**
1654
- * A Bounty specified by name.
1655
- *
1656
- * @category In-game constant
1657
- */
1658
-
1659
-
1660
- var $bounty = createSingleConstant(Bounty);
1661
- /**
1662
- * A list of Bounties specified by a comma-separated list of names.
1663
- * For a list of all possible Bounties, leave the template string blank.
1664
- *
1665
- * @category In-game constant
1666
- */
1667
-
1668
- var $bounties = createPluralConstant(Bounty);
1669
- /**
1670
- * A Class specified by name.
1671
- *
1672
- * @category In-game constant
1673
- */
1674
-
1675
- var $class = createSingleConstant(Class);
1676
- /**
1677
- * A list of Classes specified by a comma-separated list of names.
1678
- * For a list of all possible Classes, leave the template string blank.
1679
- *
1680
- * @category In-game constant
1681
- */
1682
-
1683
- var $classes = createPluralConstant(Class);
1684
- /**
1685
- * A Coinmaster specified by name.
1686
- *
1687
- * @category In-game constant
1688
- */
1689
-
1690
- var $coinmaster = createSingleConstant(Coinmaster);
1691
- /**
1692
- * A list of Coinmasters specified by a comma-separated list of names.
1693
- * For a list of all possible Coinmasters, leave the template string blank.
1694
- *
1695
- * @category In-game constant
1696
- */
1697
-
1698
- var $coinmasters = createPluralConstant(Coinmaster);
1699
- /**
1700
- * An Effect specified by name.
1701
- *
1702
- * @category In-game constant
1703
- */
1704
-
1705
- var $effect = createSingleConstant(Effect);
1706
- /**
1707
- * A list of Effects specified by a comma-separated list of names.
1708
- * For a list of all possible Effects, leave the template string blank.
1709
- *
1710
- * @category In-game constant
1711
- */
1712
-
1713
- var $effects = createPluralConstant(Effect);
1714
- /**
1715
- * An Element specified by name.
1716
- *
1717
- * @category In-game constant
1718
- */
1719
-
1720
- var $element = createSingleConstant(Element);
1721
- /**
1722
- * A list of Elements specified by a comma-separated list of names.
1723
- * For a list of all possible Elements, leave the template string blank.
1724
- *
1725
- * @category In-game constant
1726
- */
1727
-
1728
- var $elements = createPluralConstant(Element);
1729
- /**
1730
- * A Familiar specified by name.
1731
- *
1732
- * @category In-game constant
1733
- */
1734
-
1735
- var $familiar = createSingleConstant(Familiar);
1736
- /**
1737
- * A list of Familiars specified by a comma-separated list of names.
1738
- * For a list of all possible Familiars, leave the template string blank.
1739
- *
1740
- * @category In-game constant
1741
- */
1742
-
1743
- var $familiars = createPluralConstant(Familiar);
1744
- /**
1745
- * An Item specified by name.
1746
- *
1747
- * @category In-game constant
1748
- */
1749
-
1750
- var $item = createSingleConstant(Item);
1751
- /**
1752
- * A list of Items specified by a comma-separated list of names.
1753
- * For a list of all possible Items, leave the template string blank.
1754
- *
1755
- * @category In-game constant
1756
- */
1757
-
1758
- var $items = createPluralConstant(Item);
1759
- /**
1760
- * A Location specified by name.
1761
- *
1762
- * @category In-game constant
1763
- */
1764
-
1765
- var $location = createSingleConstant(Location);
1766
- /**
1767
- * A list of Locations specified by a comma-separated list of names.
1768
- * For a list of all possible Locations, leave the template string blank.
1769
- *
1770
- * @category In-game constant
1771
- */
1772
-
1773
- var $locations = createPluralConstant(Location);
1774
- /**
1775
- * A Monster specified by name.
1776
- *
1777
- * @category In-game constant
1778
- */
1779
-
1780
- var $monster = createSingleConstant(Monster);
1781
- /**
1782
- * A list of Monsters specified by a comma-separated list of names.
1783
- * For a list of all possible Monsters, leave the template string blank.
1784
- *
1785
- * @category In-game constant
1786
- */
1787
-
1788
- var $monsters = createPluralConstant(Monster);
1789
- /**
1790
- * A Phylum specified by name.
1791
- *
1792
- * @category In-game constant
1793
- */
1794
-
1795
- var $phylum = createSingleConstant(Phylum);
1796
- /**
1797
- * A list of Phyla specified by a comma-separated list of names.
1798
- * For a list of all possible Phyla, leave the template string blank.
1799
- *
1800
- * @category In-game constant
1801
- */
1802
-
1803
- var $phyla = createPluralConstant(Phylum);
1804
- /**
1805
- * A Servant specified by name.
1806
- *
1807
- * @category In-game constant
1808
- */
1809
-
1810
- var $servant = createSingleConstant(Servant);
1811
- /**
1812
- * A list of Servants specified by a comma-separated list of names.
1813
- * For a list of all possible Servants, leave the template string blank.
1814
- *
1815
- * @category In-game constant
1816
- */
1817
-
1818
- var $servants = createPluralConstant(Servant);
1819
- /**
1820
- * A Skill specified by name.
1821
- *
1822
- * @category In-game constant
1823
- */
1824
-
1825
- var $skill = createSingleConstant(Skill);
1826
- /**
1827
- * A list of Skills specified by a comma-separated list of names.
1828
- * For a list of all possible Skills, leave the template string blank.
1829
- *
1830
- * @category In-game constant
1831
- */
1832
-
1833
- var $skills = createPluralConstant(Skill);
1834
- /**
1835
- * A Slot specified by name.
1836
- *
1837
- * @category In-game constant
1838
- */
1839
-
1840
- var $slot = createSingleConstant(Slot);
1841
- /**
1842
- * A list of Slots specified by a comma-separated list of names.
1843
- * For a list of all possible Slots, leave the template string blank.
1844
- *
1845
- * @category In-game constant
1846
- */
1847
-
1848
- var $slots = createPluralConstant(Slot);
1849
- /**
1850
- * A Stat specified by name.
1851
- *
1852
- * @category In-game constant
1853
- */
1854
-
1855
- var $stat = createSingleConstant(Stat);
1856
- /**
1857
- * A list of Stats specified by a comma-separated list of names.
1858
- * For a list of all possible Stats, leave the template string blank.
1859
- *
1860
- * @category In-game constant
1861
- */
1862
-
1863
- var $stats = createPluralConstant(Stat);
1864
- /**
1865
- * A Thrall specified by name.
1866
- *
1867
- * @category In-game constant
1868
- */
1869
-
1870
- var $thrall = createSingleConstant(Thrall);
1871
- /**
1872
- * A list of Thralls specified by a comma-separated list of names.
1873
- * For a list of all possible Thralls, leave the template string blank.
1874
- *
1875
- * @category In-game constant
1876
- */
1877
-
1878
- var $thralls = createPluralConstant(Thrall);
1879
-
1880
- /***/ }),
1881
-
1882
- /***/ "./src/utils.ts":
1883
- /*!**********************!*
1884
- !*** ./src/utils.ts ***!
1885
- \**********************/
1886
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1887
-
1888
- "use strict";
1889
- __webpack_require__.r(__webpack_exports__);
1890
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1891
- /* harmony export */ "notNull": () => /* binding */ notNull,
1892
- /* harmony export */ "parseNumber": () => /* binding */ parseNumber,
1893
- /* harmony export */ "clamp": () => /* binding */ clamp,
1894
- /* harmony export */ "chunk": () => /* binding */ chunk,
1895
- /* harmony export */ "arrayToCountedMap": () => /* binding */ arrayToCountedMap,
1896
- /* harmony export */ "countedMapToArray": () => /* binding */ countedMapToArray,
1897
- /* harmony export */ "countedMapToString": () => /* binding */ countedMapToString
1898
- /* harmony export */ });
1899
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1900
-
1901
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1902
-
1903
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1904
-
1905
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1906
-
1907
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1908
-
1909
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1910
-
1911
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1912
-
1913
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
1914
-
1915
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1916
-
1917
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1918
-
1919
- function notNull(value) {
1920
- return value !== null;
1921
- }
1922
- function parseNumber(n) {
1923
- return Number.parseInt(n.replace(/,/g, ""));
1924
- }
1925
- /**
1926
- * Clamp a number between lower and upper bounds.
1927
- *
1928
- * @param n Number to clamp.
1929
- * @param min Lower bound.
1930
- * @param max Upper bound.
1931
- */
1932
-
1933
- function clamp(n, min, max) {
1934
- return Math.max(min, Math.min(max, n));
1935
- }
1936
- /**
1937
- * Split an {@param array} into {@param chunkSize} sized chunks
1938
- *
1939
- * @param array Array to split
1940
- * @param chunkSize Size of chunk
1941
- */
1942
-
1943
- function chunk(array, chunkSize) {
1944
- var result = [];
1945
-
1946
- for (var i = 0; i < array.length; i += chunkSize) {
1947
- result.push(array.slice(i, i + chunkSize));
1948
- }
1949
-
1950
- return result;
1951
- }
1952
- function arrayToCountedMap(array) {
1953
- if (!Array.isArray(array)) return array;
1954
- var map = new Map();
1955
- array.forEach(function (item) {
1956
- map.set(item, (map.get(item) || 0) + 1);
1957
- });
1958
- return map;
1959
- }
1960
- function countedMapToArray(map) {
1961
- return _toConsumableArray(map).flatMap(function (_ref) {
1962
- var _ref2 = _slicedToArray(_ref, 2),
1963
- item = _ref2[0],
1964
- quantity = _ref2[1];
1965
-
1966
- return Array(quantity).fill(item);
1967
- });
1968
- }
1969
- function countedMapToString(map) {
1970
- return _toConsumableArray(map).map(function (_ref3) {
1971
- var _ref4 = _slicedToArray(_ref3, 2),
1972
- item = _ref4[0],
1973
- quantity = _ref4[1];
1974
-
1975
- return "".concat(quantity, " x ").concat(item);
1976
- }).join(", ");
1977
- }
1978
-
1979
- /***/ }),
1980
-
1981
- /***/ "kolmafia":
1982
- /*!***************************!*
1983
- !*** external "kolmafia" ***!
1984
- \***************************/
1985
- /***/ ((module) => {
1986
-
1987
- "use strict";
1988
- module.exports = require("kolmafia");;
1989
-
1990
- /***/ })
1991
-
1992
- /******/ });
1993
- /************************************************************************/
1994
- /******/ // The module cache
1995
- /******/ var __webpack_module_cache__ = {};
1996
- /******/
1997
- /******/ // The require function
1998
- /******/ function __webpack_require__(moduleId) {
1999
- /******/ // Check if module is in cache
2000
- /******/ if(__webpack_module_cache__[moduleId]) {
2001
- /******/ return __webpack_module_cache__[moduleId].exports;
2002
- /******/ }
2003
- /******/ // Create a new module (and put it into the cache)
2004
- /******/ var module = __webpack_module_cache__[moduleId] = {
2005
- /******/ // no module.id needed
2006
- /******/ // no module.loaded needed
2007
- /******/ exports: {}
2008
- /******/ };
2009
- /******/
2010
- /******/ // Execute the module function
2011
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
2012
- /******/
2013
- /******/ // Return the exports of the module
2014
- /******/ return module.exports;
2015
- /******/ }
2016
- /******/
2017
- /************************************************************************/
2018
- /******/ /* webpack/runtime/compat get default export */
2019
- /******/ (() => {
2020
- /******/ // getDefaultExport function for compatibility with non-harmony modules
2021
- /******/ __webpack_require__.n = (module) => {
2022
- /******/ var getter = module && module.__esModule ?
2023
- /******/ () => module['default'] :
2024
- /******/ () => module;
2025
- /******/ __webpack_require__.d(getter, { a: getter });
2026
- /******/ return getter;
2027
- /******/ };
2028
- /******/ })();
2029
- /******/
2030
- /******/ /* webpack/runtime/define property getters */
2031
- /******/ (() => {
2032
- /******/ // define getter functions for harmony exports
2033
- /******/ __webpack_require__.d = (exports, definition) => {
2034
- /******/ for(var key in definition) {
2035
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
2036
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
2037
- /******/ }
2038
- /******/ }
2039
- /******/ };
2040
- /******/ })();
2041
- /******/
2042
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
2043
- /******/ (() => {
2044
- /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)
2045
- /******/ })();
2046
- /******/
2047
- /******/ /* webpack/runtime/make namespace object */
2048
- /******/ (() => {
2049
- /******/ // define __esModule on exports
2050
- /******/ __webpack_require__.r = (exports) => {
2051
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2052
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2053
- /******/ }
2054
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
2055
- /******/ };
2056
- /******/ })();
2057
- /******/
2058
- /************************************************************************/
2059
- /******/ // module exports must be returned from runtime so entry inlining is disabled
2060
- /******/ // startup
2061
- /******/ // Load entry module and return exports
2062
- /******/ return __webpack_require__("./examples/kmail.ts");
2063
- /******/ })()
2064
-
2065
- ));