@spscommerce/utils 5.18.1 → 5.18.3-ie2

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 (209) hide show
  1. package/dist/out-tsc/array/flatten.d.ts +1 -0
  2. package/dist/out-tsc/array/flatten.js +7 -0
  3. package/dist/out-tsc/array/flatten.js.map +1 -0
  4. package/dist/out-tsc/array/flatten.spec.d.ts +1 -0
  5. package/dist/out-tsc/array/flatten.spec.js +10 -0
  6. package/dist/out-tsc/array/flatten.spec.js.map +1 -0
  7. package/dist/out-tsc/array/index.d.ts +3 -0
  8. package/dist/out-tsc/array/index.js +4 -0
  9. package/dist/out-tsc/array/index.js.map +1 -0
  10. package/dist/out-tsc/array/is-subset.d.ts +4 -0
  11. package/dist/out-tsc/array/is-subset.js +41 -0
  12. package/dist/out-tsc/array/is-subset.js.map +1 -0
  13. package/dist/out-tsc/array/is-subset.spec.d.ts +1 -0
  14. package/dist/out-tsc/array/is-subset.spec.js +41 -0
  15. package/dist/out-tsc/array/is-subset.spec.js.map +1 -0
  16. package/dist/out-tsc/array/range.d.ts +5 -0
  17. package/dist/out-tsc/array/range.js +16 -0
  18. package/dist/out-tsc/array/range.js.map +1 -0
  19. package/dist/out-tsc/array/range.spec.d.ts +1 -0
  20. package/dist/out-tsc/array/range.spec.js +26 -0
  21. package/dist/out-tsc/array/range.spec.js.map +1 -0
  22. package/dist/out-tsc/classes/custom-event.d.ts +4 -0
  23. package/dist/out-tsc/classes/custom-event.js +87 -0
  24. package/dist/out-tsc/classes/custom-event.js.map +1 -0
  25. package/dist/out-tsc/classes/index.d.ts +1 -0
  26. package/dist/out-tsc/classes/index.js +2 -0
  27. package/dist/out-tsc/classes/index.js.map +1 -0
  28. package/dist/out-tsc/data/doctypes.d.ts +4 -0
  29. package/dist/out-tsc/data/doctypes.js +302 -0
  30. package/dist/out-tsc/data/doctypes.js.map +1 -0
  31. package/dist/out-tsc/data/index.d.ts +1 -0
  32. package/dist/out-tsc/data/index.js +2 -0
  33. package/dist/out-tsc/data/index.js.map +1 -0
  34. package/dist/out-tsc/decorators/cast-to-number.d.ts +5 -0
  35. package/dist/out-tsc/decorators/cast-to-number.js +29 -0
  36. package/dist/out-tsc/decorators/cast-to-number.js.map +1 -0
  37. package/dist/out-tsc/decorators/debounced.broken_spec.d.ts +0 -0
  38. package/dist/out-tsc/decorators/debounced.broken_spec.js +38 -0
  39. package/dist/out-tsc/decorators/debounced.broken_spec.js.map +1 -0
  40. package/dist/out-tsc/decorators/debounced.d.ts +11 -0
  41. package/dist/out-tsc/decorators/debounced.js +35 -0
  42. package/dist/out-tsc/decorators/debounced.js.map +1 -0
  43. package/dist/out-tsc/decorators/index.d.ts +5 -0
  44. package/dist/out-tsc/decorators/index.js +6 -0
  45. package/dist/out-tsc/decorators/index.js.map +1 -0
  46. package/dist/out-tsc/decorators/locked-to-animation-frames.d.ts +4 -0
  47. package/dist/out-tsc/decorators/locked-to-animation-frames.js +34 -0
  48. package/dist/out-tsc/decorators/locked-to-animation-frames.js.map +1 -0
  49. package/dist/out-tsc/decorators/locked-to-animation-frames.spec.d.ts +0 -0
  50. package/dist/out-tsc/decorators/locked-to-animation-frames.spec.js +63 -0
  51. package/dist/out-tsc/decorators/locked-to-animation-frames.spec.js.map +1 -0
  52. package/dist/out-tsc/decorators/simple-metadata-decorator-applicator.d.ts +11 -0
  53. package/dist/out-tsc/decorators/simple-metadata-decorator-applicator.js +80 -0
  54. package/dist/out-tsc/decorators/simple-metadata-decorator-applicator.js.map +1 -0
  55. package/dist/out-tsc/decorators/tick-delay.d.ts +6 -0
  56. package/dist/out-tsc/decorators/tick-delay.js +31 -0
  57. package/dist/out-tsc/decorators/tick-delay.js.map +1 -0
  58. package/dist/out-tsc/function/debounce.d.ts +9 -0
  59. package/dist/out-tsc/function/debounce.js +102 -0
  60. package/dist/out-tsc/function/debounce.js.map +1 -0
  61. package/dist/out-tsc/function/debounce.spec.d.ts +1 -0
  62. package/dist/out-tsc/function/debounce.spec.js +150 -0
  63. package/dist/out-tsc/function/debounce.spec.js.map +1 -0
  64. package/dist/out-tsc/function/debounced-function.interface.d.ts +10 -0
  65. package/dist/out-tsc/function/debounced-function.interface.js +2 -0
  66. package/dist/out-tsc/function/debounced-function.interface.js.map +1 -0
  67. package/dist/out-tsc/function/delayed-function.interface.d.ts +10 -0
  68. package/dist/out-tsc/function/delayed-function.interface.js +2 -0
  69. package/dist/out-tsc/function/delayed-function.interface.js.map +1 -0
  70. package/dist/out-tsc/function/index.d.ts +6 -0
  71. package/dist/out-tsc/function/index.js +7 -0
  72. package/dist/out-tsc/function/index.js.map +1 -0
  73. package/dist/out-tsc/function/lock-to-animation-frames.d.ts +7 -0
  74. package/dist/out-tsc/function/lock-to-animation-frames.js +43 -0
  75. package/dist/out-tsc/function/lock-to-animation-frames.js.map +1 -0
  76. package/dist/out-tsc/function/lock-to-animation-frames.spec.d.ts +0 -0
  77. package/dist/out-tsc/function/lock-to-animation-frames.spec.js +53 -0
  78. package/dist/out-tsc/function/lock-to-animation-frames.spec.js.map +1 -0
  79. package/dist/out-tsc/function/on-next-tick.d.ts +8 -0
  80. package/dist/out-tsc/function/on-next-tick.js +12 -0
  81. package/dist/out-tsc/function/on-next-tick.js.map +1 -0
  82. package/dist/out-tsc/function/on-next-tick.spec.d.ts +1 -0
  83. package/dist/out-tsc/function/on-next-tick.spec.js +13 -0
  84. package/dist/out-tsc/function/on-next-tick.spec.js.map +1 -0
  85. package/dist/out-tsc/function/op.d.ts +32 -0
  86. package/dist/out-tsc/function/op.js +34 -0
  87. package/dist/out-tsc/function/op.js.map +1 -0
  88. package/dist/out-tsc/function/op.spec.d.ts +1 -0
  89. package/dist/out-tsc/function/op.spec.js +94 -0
  90. package/dist/out-tsc/function/op.spec.js.map +1 -0
  91. package/dist/out-tsc/index.d.ts +9 -0
  92. package/dist/out-tsc/index.js +10 -0
  93. package/dist/out-tsc/index.js.map +1 -0
  94. package/dist/out-tsc/number/constrain.d.ts +7 -0
  95. package/dist/out-tsc/number/constrain.js +16 -0
  96. package/dist/out-tsc/number/constrain.js.map +1 -0
  97. package/dist/out-tsc/number/decimal-round.d.ts +7 -0
  98. package/dist/out-tsc/number/decimal-round.js +19 -0
  99. package/dist/out-tsc/number/decimal-round.js.map +1 -0
  100. package/dist/out-tsc/number/decimal-round.spec.d.ts +1 -0
  101. package/dist/out-tsc/number/decimal-round.spec.js +10 -0
  102. package/dist/out-tsc/number/decimal-round.spec.js.map +1 -0
  103. package/dist/out-tsc/number/index.d.ts +3 -0
  104. package/dist/out-tsc/number/index.js +4 -0
  105. package/dist/out-tsc/number/index.js.map +1 -0
  106. package/dist/out-tsc/number/to-file-size-string.d.ts +5 -0
  107. package/dist/out-tsc/number/to-file-size-string.js +24 -0
  108. package/dist/out-tsc/number/to-file-size-string.js.map +1 -0
  109. package/dist/out-tsc/object/copy-property.d.ts +6 -0
  110. package/dist/out-tsc/object/copy-property.js +9 -0
  111. package/dist/out-tsc/object/copy-property.js.map +1 -0
  112. package/dist/out-tsc/object/copy-property.spec.d.ts +1 -0
  113. package/dist/out-tsc/object/copy-property.spec.js +16 -0
  114. package/dist/out-tsc/object/copy-property.spec.js.map +1 -0
  115. package/dist/out-tsc/object/crumble-path.d.ts +6 -0
  116. package/dist/out-tsc/object/crumble-path.js +9 -0
  117. package/dist/out-tsc/object/crumble-path.js.map +1 -0
  118. package/dist/out-tsc/object/crumble-path.spec.d.ts +1 -0
  119. package/dist/out-tsc/object/crumble-path.spec.js +24 -0
  120. package/dist/out-tsc/object/crumble-path.spec.js.map +1 -0
  121. package/dist/out-tsc/object/deep-freeze.d.ts +1 -0
  122. package/dist/out-tsc/object/deep-freeze.js +36 -0
  123. package/dist/out-tsc/object/deep-freeze.js.map +1 -0
  124. package/dist/out-tsc/object/deep-freeze.spec.d.ts +1 -0
  125. package/dist/out-tsc/object/deep-freeze.spec.js +14 -0
  126. package/dist/out-tsc/object/deep-freeze.spec.js.map +1 -0
  127. package/dist/out-tsc/object/diff.d.ts +12 -0
  128. package/dist/out-tsc/object/diff.js +92 -0
  129. package/dist/out-tsc/object/diff.js.map +1 -0
  130. package/dist/out-tsc/object/diff.spec.d.ts +1 -0
  131. package/dist/out-tsc/object/diff.spec.js +40 -0
  132. package/dist/out-tsc/object/diff.spec.js.map +1 -0
  133. package/dist/out-tsc/object/for-each-entry-deep.d.ts +4 -0
  134. package/dist/out-tsc/object/for-each-entry-deep.js +38 -0
  135. package/dist/out-tsc/object/for-each-entry-deep.js.map +1 -0
  136. package/dist/out-tsc/object/for-each-entry-deep.spec.d.ts +1 -0
  137. package/dist/out-tsc/object/for-each-entry-deep.spec.js +24 -0
  138. package/dist/out-tsc/object/for-each-entry-deep.spec.js.map +1 -0
  139. package/dist/out-tsc/object/for-each-nested-object.d.ts +4 -0
  140. package/dist/out-tsc/object/for-each-nested-object.js +38 -0
  141. package/dist/out-tsc/object/for-each-nested-object.js.map +1 -0
  142. package/dist/out-tsc/object/for-each-nested-object.spec.d.ts +1 -0
  143. package/dist/out-tsc/object/for-each-nested-object.spec.js +46 -0
  144. package/dist/out-tsc/object/for-each-nested-object.spec.js.map +1 -0
  145. package/dist/out-tsc/object/get-path.d.ts +5 -0
  146. package/dist/out-tsc/object/get-path.js +67 -0
  147. package/dist/out-tsc/object/get-path.js.map +1 -0
  148. package/dist/out-tsc/object/get-path.spec.d.ts +1 -0
  149. package/dist/out-tsc/object/get-path.spec.js +44 -0
  150. package/dist/out-tsc/object/get-path.spec.js.map +1 -0
  151. package/dist/out-tsc/object/index.d.ts +13 -0
  152. package/dist/out-tsc/object/index.js +14 -0
  153. package/dist/out-tsc/object/index.js.map +1 -0
  154. package/dist/out-tsc/object/merge-deep.d.ts +4 -0
  155. package/dist/out-tsc/object/merge-deep.js +60 -0
  156. package/dist/out-tsc/object/merge-deep.js.map +1 -0
  157. package/dist/out-tsc/object/merge-deep.spec.d.ts +1 -0
  158. package/dist/out-tsc/object/merge-deep.spec.js +16 -0
  159. package/dist/out-tsc/object/merge-deep.spec.js.map +1 -0
  160. package/dist/out-tsc/object/merge-properties-deep.d.ts +4 -0
  161. package/dist/out-tsc/object/merge-properties-deep.js +61 -0
  162. package/dist/out-tsc/object/merge-properties-deep.js.map +1 -0
  163. package/dist/out-tsc/object/merge-properties-deep.spec.d.ts +1 -0
  164. package/dist/out-tsc/object/merge-properties-deep.spec.js +24 -0
  165. package/dist/out-tsc/object/merge-properties-deep.spec.js.map +1 -0
  166. package/dist/out-tsc/object/omit.d.ts +1 -0
  167. package/dist/out-tsc/object/omit.js +40 -0
  168. package/dist/out-tsc/object/omit.js.map +1 -0
  169. package/dist/out-tsc/object/omit.spec.d.ts +1 -0
  170. package/dist/out-tsc/object/omit.spec.js +10 -0
  171. package/dist/out-tsc/object/omit.spec.js.map +1 -0
  172. package/dist/out-tsc/object/set-path.d.ts +2 -0
  173. package/dist/out-tsc/object/set-path.js +45 -0
  174. package/dist/out-tsc/object/set-path.js.map +1 -0
  175. package/dist/out-tsc/object/set-path.spec.d.ts +1 -0
  176. package/dist/out-tsc/object/set-path.spec.js +36 -0
  177. package/dist/out-tsc/object/set-path.spec.js.map +1 -0
  178. package/dist/out-tsc/object/traverse-path.d.ts +2 -0
  179. package/dist/out-tsc/object/traverse-path.js +81 -0
  180. package/dist/out-tsc/object/traverse-path.js.map +1 -0
  181. package/dist/out-tsc/object/values.d.ts +2 -0
  182. package/dist/out-tsc/object/values.js +31 -0
  183. package/dist/out-tsc/object/values.js.map +1 -0
  184. package/dist/out-tsc/object/values.spec.d.ts +1 -0
  185. package/dist/out-tsc/object/values.spec.js +7 -0
  186. package/dist/out-tsc/object/values.spec.js.map +1 -0
  187. package/dist/out-tsc/string/code.template-tag.d.ts +2 -0
  188. package/dist/out-tsc/string/code.template-tag.js +38 -0
  189. package/dist/out-tsc/string/code.template-tag.js.map +1 -0
  190. package/dist/out-tsc/string/index.d.ts +3 -0
  191. package/dist/out-tsc/string/index.js +4 -0
  192. package/dist/out-tsc/string/index.js.map +1 -0
  193. package/dist/out-tsc/string/parse-file-size.d.ts +5 -0
  194. package/dist/out-tsc/string/parse-file-size.js +43 -0
  195. package/dist/out-tsc/string/parse-file-size.js.map +1 -0
  196. package/dist/out-tsc/string/template.d.ts +15 -0
  197. package/dist/out-tsc/string/template.js +28 -0
  198. package/dist/out-tsc/string/template.js.map +1 -0
  199. package/dist/out-tsc/string/template.spec.d.ts +1 -0
  200. package/dist/out-tsc/string/template.spec.js +39 -0
  201. package/dist/out-tsc/string/template.spec.js.map +1 -0
  202. package/dist/out-tsc/typings.d.ts +1 -0
  203. package/dist/out-tsc/typings.js +2 -0
  204. package/dist/out-tsc/typings.js.map +1 -0
  205. package/lib/index.cjs.js +2437 -1
  206. package/lib/index.es.js +2268 -893
  207. package/package.json +5 -5
  208. package/rollup.config.js +22 -0
  209. package/vite.config.js +1 -1
package/lib/index.es.js CHANGED
@@ -1,1024 +1,2399 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
1
  function _mergeNamespaces(n, m) {
18
- m.forEach(function(e) {
19
- Object.keys(e).forEach(function(k) {
20
- if (k !== "default" && !(k in n)) {
21
- var d = Object.getOwnPropertyDescriptor(e, k);
22
- Object.defineProperty(n, k, d.get ? d : {
23
- enumerable: true,
24
- get: function() {
25
- return e[k];
26
- }
2
+ m.forEach(function (e) {
3
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
4
+ if (k !== 'default' && !(k in n)) {
5
+ var d = Object.getOwnPropertyDescriptor(e, k);
6
+ Object.defineProperty(n, k, d.get ? d : {
7
+ enumerable: true,
8
+ get: function () { return e[k]; }
9
+ });
10
+ }
27
11
  });
28
- }
29
12
  });
30
- });
31
- return Object.freeze(n);
13
+ return Object.freeze(n);
32
14
  }
15
+
33
16
  function flatten(arg) {
34
- if (!Array.isArray(arg)) {
35
- return arg;
36
- }
37
- return arg.reduce((acc, x) => acc.concat(flatten(x)), []);
17
+ if (!Array.isArray(arg)) {
18
+ return arg;
19
+ }
20
+ return arg.reduce(function (acc, x) { return acc.concat(flatten(x)); }, []);
38
21
  }
22
+
23
+ var __values$d = (undefined && undefined.__values) || function(o) {
24
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
25
+ if (m) return m.call(o);
26
+ if (o && typeof o.length === "number") return {
27
+ next: function () {
28
+ if (o && i >= o.length) o = void 0;
29
+ return { value: o && o[i++], done: !o };
30
+ }
31
+ };
32
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
33
+ };
34
+ /**
35
+ * Tests if candidate is a subset of array
36
+ */
39
37
  function isSubset(candidate, array) {
40
- const set = new Set(array);
41
- for (const member of candidate) {
42
- if (!set.has(member)) {
43
- return false;
38
+ var e_1, _a;
39
+ /*
40
+ * Set.prototype.has is required by the ECMAScript spec to be
41
+ * implemented in sub-linear time, so by converting array to Set
42
+ * we can avoid n^2 complexity. (In WebKit, Sets are HashMaps
43
+ * internally, so has() is constant time)
44
+ */
45
+ var set = new Set(array);
46
+ try {
47
+ for (var candidate_1 = __values$d(candidate), candidate_1_1 = candidate_1.next(); !candidate_1_1.done; candidate_1_1 = candidate_1.next()) {
48
+ var member = candidate_1_1.value;
49
+ if (!set.has(member)) {
50
+ return false;
51
+ }
52
+ }
44
53
  }
45
- }
46
- return true;
54
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
55
+ finally {
56
+ try {
57
+ if (candidate_1_1 && !candidate_1_1.done && (_a = candidate_1.return)) _a.call(candidate_1);
58
+ }
59
+ finally { if (e_1) throw e_1.error; }
60
+ }
61
+ return true;
47
62
  }
63
+
64
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
65
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
66
+ return new (P || (P = Promise))(function (resolve, reject) {
67
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
68
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
69
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
70
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
71
+ });
72
+ };
73
+ var __generator$1 = (undefined && undefined.__generator) || function (thisArg, body) {
74
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
75
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
76
+ function verb(n) { return function (v) { return step([n, v]); }; }
77
+ function step(op) {
78
+ if (f) throw new TypeError("Generator is already executing.");
79
+ while (_) try {
80
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
81
+ if (y = 0, t) op = [op[0] & 2, t.value];
82
+ switch (op[0]) {
83
+ case 0: case 1: t = op; break;
84
+ case 4: _.label++; return { value: op[1], done: false };
85
+ case 5: _.label++; y = op[1]; op = [0]; continue;
86
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
87
+ default:
88
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
89
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
90
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
91
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
92
+ if (t[2]) _.ops.pop();
93
+ _.trys.pop(); continue;
94
+ }
95
+ op = body.call(thisArg, _);
96
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
97
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
98
+ }
99
+ };
100
+ /**
101
+ * If the function is set to be called, cancel the
102
+ * timeout that would call it. Reset id & pending to defaults.
103
+ *
104
+ * @returns - Whether an invocation was actually canceled or not.
105
+ */
48
106
  function resetDebouncedFn() {
49
- this.pending = false;
50
- if (typeof this.id === "number") {
51
- clearTimeout(this.id);
52
- delete this.id;
53
- return true;
54
- }
55
- return false;
107
+ this.pending = false;
108
+ if (typeof this.id === "number") {
109
+ clearTimeout(this.id);
110
+ delete this.id;
111
+ return true;
112
+ }
113
+ return false;
56
114
  }
115
+ /**
116
+ * Takes in a function and returns a new function that debounces it.
117
+ * The returned function returns an observable that can be subscribed to
118
+ * if you need to have something happen when the debounced function
119
+ * finally gets called and returns a value.
120
+ */
57
121
  function debounce(functionToDebounce, milliseconds, thisArg) {
58
- const debFn = function debouncedFn(...args) {
59
- return new Promise((resolve, reject) => {
60
- debFn.reset();
61
- debFn.pending = true;
62
- function executor() {
63
- void (async () => {
64
- try {
65
- let output = functionToDebounce.apply(thisArg || this, args);
66
- if (output instanceof Promise) {
67
- output = await output;
68
- }
69
- resolve(output);
70
- } catch (err) {
71
- reject(err);
72
- } finally {
122
+ var debFn = function debouncedFn() {
123
+ var args = [];
124
+ for (var _i = 0; _i < arguments.length; _i++) {
125
+ args[_i] = arguments[_i];
126
+ }
127
+ return new Promise(function (resolve, reject) {
73
128
  debFn.reset();
74
- }
75
- })();
76
- }
77
- debFn.id = window.setTimeout(executor, milliseconds);
78
- });
79
- };
80
- debFn.reset = resetDebouncedFn.bind(debFn);
81
- return debFn;
129
+ debFn.pending = true;
130
+ function executor() {
131
+ var _this = this;
132
+ void (function () { return __awaiter(_this, void 0, void 0, function () {
133
+ var output, err_1;
134
+ return __generator$1(this, function (_a) {
135
+ switch (_a.label) {
136
+ case 0:
137
+ _a.trys.push([0, 3, 4, 5]);
138
+ output = functionToDebounce.apply(thisArg || this, args);
139
+ if (!(output instanceof Promise)) return [3 /*break*/, 2];
140
+ return [4 /*yield*/, output];
141
+ case 1:
142
+ output = _a.sent();
143
+ _a.label = 2;
144
+ case 2:
145
+ resolve(output);
146
+ return [3 /*break*/, 5];
147
+ case 3:
148
+ err_1 = _a.sent();
149
+ reject(err_1);
150
+ return [3 /*break*/, 5];
151
+ case 4:
152
+ debFn.reset();
153
+ return [7 /*endfinally*/];
154
+ case 5: return [2 /*return*/];
155
+ }
156
+ });
157
+ }); })();
158
+ }
159
+ debFn.id = window.setTimeout(executor, milliseconds);
160
+ });
161
+ };
162
+ debFn.reset = resetDebouncedFn.bind(debFn);
163
+ return debFn;
82
164
  }
165
+
166
+ /**
167
+ * If the function is set to be called, cancel the
168
+ * timeout that would call it. Reset id & pending to defaults.
169
+ *
170
+ * @returns - Whether an invocation was actually canceled or not.
171
+ */
83
172
  function resetLockedFn() {
84
- this.pending = false;
85
- if (typeof this.id === "number") {
86
- window.cancelAnimationFrame(this.id);
87
- delete this.id;
88
- return true;
89
- }
90
- return false;
173
+ this.pending = false;
174
+ if (typeof this.id === "number") {
175
+ window.cancelAnimationFrame(this.id);
176
+ delete this.id;
177
+ return true;
178
+ }
179
+ return false;
91
180
  }
181
+ /**
182
+ * Return a new function to replace the passed in one which ensures that
183
+ * the given function will run only in `requestAnimationFrame()` and at
184
+ * most once per frame.
185
+ */
92
186
  function lockToAnimationFrames(functionToLock, thisArg) {
93
- const lockFn = function lockedFn(...args) {
94
- if (lockFn.pending) {
95
- lockFn.reset();
96
- }
97
- lockFn.id = window.requestAnimationFrame(() => {
98
- if (functionToLock) {
99
- functionToLock.apply(thisArg || this, args);
100
- }
101
- lockFn.reset();
102
- });
103
- lockFn.pending = true;
104
- };
105
- lockFn.pending = false;
106
- lockFn.reset = resetLockedFn.bind(lockFn);
107
- return lockFn;
187
+ var lockFn = function lockedFn() {
188
+ var _this = this;
189
+ var args = [];
190
+ for (var _i = 0; _i < arguments.length; _i++) {
191
+ args[_i] = arguments[_i];
192
+ }
193
+ if (lockFn.pending) {
194
+ lockFn.reset();
195
+ }
196
+ lockFn.id = window.requestAnimationFrame(function () {
197
+ if (functionToLock) {
198
+ functionToLock.apply(thisArg || _this, args);
199
+ }
200
+ lockFn.reset();
201
+ });
202
+ lockFn.pending = true;
203
+ };
204
+ lockFn.pending = false;
205
+ lockFn.reset = resetLockedFn.bind(lockFn);
206
+ return lockFn;
108
207
  }
208
+
209
+ /**
210
+ * Enqueues the given function to run on the next "tick" of the JS event
211
+ * loop cycle. If you ever encounter the "value changed after it was
212
+ * checked" error in Angular when trying to assign a value of a
213
+ * component class, performing that assignment on the next tick, i.e. when
214
+ * all of Angular's current cycle is finished, will resolve that error.
215
+ */
109
216
  function onNextTick(fn, thisArg) {
110
- const boundFn = thisArg ? fn.bind(thisArg) : fn;
111
- setTimeout(boundFn, 0);
217
+ var boundFn = thisArg ? fn.bind(thisArg) : fn;
218
+ setTimeout(boundFn, 0);
112
219
  }
113
- const Op = {
114
- add: (a, b) => a + b,
115
- and: (a, b) => a && b,
116
- band: (a, b) => a & b,
117
- bor: (a, b) => a | b,
118
- bxor: (a, b) => a ^ b,
119
- bnot: (a) => ~a,
120
- decr: (a) => a - 1,
121
- div: (a, b) => a / b,
122
- eq: (a, b) => a === b,
123
- exp: (a, b) => a ** b,
124
- gt: (a, b) => a > b,
125
- gte: (a, b) => a >= b,
126
- incr: (a) => a + 1,
127
- lshift: (a, b) => a << b,
128
- lt: (a, b) => a < b,
129
- lte: (a, b) => a <= b,
130
- mul: (a, b) => a * b,
131
- neg: (a) => -a,
132
- neq: (a, b) => a !== b,
133
- not: (a) => !a,
134
- or: (a, b) => a || b,
135
- rem: (a, b) => a % b,
136
- rshift: (a, b) => a >> b,
137
- rshift_zf: (a, b) => a >>> b,
138
- sub: (a, b) => a - b,
139
- xor: (a, b) => (a || b) && !(a && b)
220
+
221
+ /**
222
+ * Functions for various operators, most useful in combination
223
+ * with functional programming tools like map, filter, and reduce.
224
+ */
225
+ var Op = {
226
+ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
227
+ add: function (a, b) { return a + b; },
228
+ and: function (a, b) { return a && b; },
229
+ band: function (a, b) { return a & b; },
230
+ bor: function (a, b) { return a | b; },
231
+ bxor: function (a, b) { return a ^ b; },
232
+ bnot: function (a) { return ~a; },
233
+ decr: function (a) { return a - 1; },
234
+ div: function (a, b) { return a / b; },
235
+ eq: function (a, b) { return a === b; },
236
+ exp: function (a, b) { return Math.pow(a, b); },
237
+ gt: function (a, b) { return a > b; },
238
+ gte: function (a, b) { return a >= b; },
239
+ incr: function (a) { return a + 1; },
240
+ lshift: function (a, b) { return a << b; },
241
+ lt: function (a, b) { return a < b; },
242
+ lte: function (a, b) { return a <= b; },
243
+ mul: function (a, b) { return a * b; },
244
+ neg: function (a) { return -a; },
245
+ neq: function (a, b) { return a !== b; },
246
+ not: function (a) { return !a; },
247
+ or: function (a, b) { return a || b; },
248
+ rem: function (a, b) { return a % b; },
249
+ rshift: function (a, b) { return a >> b; },
250
+ rshift_zf: function (a, b) { return a >>> b; },
251
+ sub: function (a, b) { return a - b; },
252
+ xor: function (a, b) { return (a || b) && !(a && b); },
140
253
  };
254
+
255
+ /**
256
+ * Unlike lodash range, includes the specified end number.
257
+ * So range(1, 10) gives you 1-10 instead of 1-9.
258
+ */
141
259
  function range(start, end) {
142
- if (!Number.isInteger(start)) {
143
- throw new Error("start must be an integer");
144
- }
145
- if (!Number.isInteger(end)) {
146
- throw new Error("end must be an integer");
147
- }
148
- return new Array(Math.abs(end - start) + 1).fill(start).map(start > end ? Op.sub : Op.add);
260
+ if (!Number.isInteger(start)) {
261
+ throw new Error("start must be an integer");
262
+ }
263
+ if (!Number.isInteger(end)) {
264
+ throw new Error("end must be an integer");
265
+ }
266
+ return new Array(Math.abs(end - start) + 1).fill(start)
267
+ .map(start > end ? Op.sub : Op.add);
149
268
  }
150
- class CustomEvent {
151
- constructor(eventName, initDict = {}) {
152
- let event;
153
- if (typeof Event === "function") {
154
- event = new Event(eventName, initDict);
155
- } else {
156
- event = document.createEvent("Event");
157
- event.initEvent(eventName, initDict.bubbles, initDict.cancelable);
158
- for (const key of Object.keys(initDict)) {
159
- if (key !== "bubbles" && key !== "cancelable") {
160
- event[key] = initDict[key];
269
+
270
+ /* eslint-disable @typescript-eslint/no-redeclare, @typescript-eslint/no-extraneous-class */
271
+ /** docs:ignore */
272
+ var __values$c = (undefined && undefined.__values) || function(o) {
273
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
274
+ if (m) return m.call(o);
275
+ if (o && typeof o.length === "number") return {
276
+ next: function () {
277
+ if (o && i >= o.length) o = void 0;
278
+ return { value: o && o[i++], done: !o };
161
279
  }
162
- }
163
- }
164
- Object.setPrototypeOf(this, event);
165
- const descriptors = Object.getOwnPropertyDescriptors(Event.prototype);
166
- for (const propKey of Object.keys(descriptors)) {
167
- const descriptor = descriptors[propKey];
168
- for (const key of Object.keys(descriptor)) {
169
- if (typeof descriptor[key] === "function") {
170
- descriptor[key] = descriptor[key].bind(event);
280
+ };
281
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
282
+ };
283
+ /*
284
+ * This was intended to be a replacement for Event that allows subclassing
285
+ * However it doesn't work in all browsers
286
+ * TODO: Drop this, use built-in CustomEvent once IE11 is dead
287
+ */
288
+ var CustomEvent = /** @class */ (function () {
289
+ function CustomEvent(eventName, initDict) {
290
+ var e_1, _a, e_2, _b, e_3, _c;
291
+ if (initDict === void 0) { initDict = {}; }
292
+ var event;
293
+ if (typeof Event === "function") {
294
+ event = new Event(eventName, initDict);
171
295
  }
172
- }
296
+ else {
297
+ // IE11
298
+ event = document.createEvent("Event");
299
+ event.initEvent(eventName, initDict.bubbles, initDict.cancelable);
300
+ try {
301
+ for (var _d = __values$c(Object.keys(initDict)), _e = _d.next(); !_e.done; _e = _d.next()) {
302
+ var key = _e.value;
303
+ if (key !== "bubbles" && key !== "cancelable") {
304
+ event[key] = initDict[key];
305
+ }
306
+ }
307
+ }
308
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
309
+ finally {
310
+ try {
311
+ if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
312
+ }
313
+ finally { if (e_1) throw e_1.error; }
314
+ }
315
+ }
316
+ Object.setPrototypeOf(this, event);
317
+ /*
318
+ * Native functions like the getters, setters, and methods on Event.prototype
319
+ * cannot be called with "this" being a custom object. So what we're doing here
320
+ * works around that.
321
+ */
322
+ var descriptors = Object.getOwnPropertyDescriptors(Event.prototype);
323
+ try {
324
+ for (var _f = __values$c(Object.keys(descriptors)), _g = _f.next(); !_g.done; _g = _f.next()) {
325
+ var propKey = _g.value;
326
+ var descriptor = descriptors[propKey];
327
+ try {
328
+ for (var _h = (e_3 = void 0, __values$c(Object.keys(descriptor))), _j = _h.next(); !_j.done; _j = _h.next()) {
329
+ var key = _j.value;
330
+ if (typeof descriptor[key] === "function") {
331
+ descriptor[key] = descriptor[key].bind(event);
332
+ }
333
+ }
334
+ }
335
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
336
+ finally {
337
+ try {
338
+ if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
339
+ }
340
+ finally { if (e_3) throw e_3.error; }
341
+ }
342
+ }
343
+ }
344
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
345
+ finally {
346
+ try {
347
+ if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
348
+ }
349
+ finally { if (e_2) throw e_2.error; }
350
+ }
351
+ Object.defineProperties(this, descriptors);
173
352
  }
174
- Object.defineProperties(this, descriptors);
175
- }
176
- }
177
- const EDI_DOCUMENT_TYPE = Object.freeze({
178
- 100: { name: "Insurance Plan Description" },
179
- 101: { name: "Name and Address Lists" },
180
- 104: { name: "Air Shipment Information" },
181
- 106: { name: "Motor Carrier Rate Proposal" },
182
- 107: { name: "Request for Motor Carrier Rate Proposal" },
183
- 108: { name: "Response to a Motor Carrier Rate Proposal" },
184
- 109: { name: "Vessel Content Details" },
185
- 110: { name: "Air Freight Details and Invoice" },
186
- 112: { name: "Property Damage Report" },
187
- 120: { name: "Vehicle Shipping Order" },
188
- 121: { name: "Vehicle Service" },
189
- 124: { name: "Vehicle Damage" },
190
- 125: { name: "Multilevel Railcar Load Details" },
191
- 126: { name: "Vehicle Application Advice" },
192
- 127: { name: "Vehicle Baying Order" },
193
- 128: { name: "Dealer Information" },
194
- 129: { name: "Vehicle Carrier Rate Update" },
195
- 130: { name: "Student Educational Record (Transcript)" },
196
- 131: { name: "Student Educational Record (Transcript) Acknowledgment" },
197
- 135: { name: "Student Loan Application" },
198
- 138: { name: "Testing Results Request and Report" },
199
- 139: { name: "Student Loan Guarantee Result" },
200
- 140: { name: "Product Registration" },
201
- 141: { name: "Product Service Claim Response" },
202
- 142: { name: "Product Service Claim" },
203
- 143: { name: "Product Service Notification" },
204
- 144: { name: "Student Loan Transfer and Status Verification" },
205
- 146: { name: "Request for Student Educational Record (Transcript)" },
206
- 147: { name: "Response to Request for Student Educational Record (Transcript)" },
207
- 148: { name: "Report of Injury, Illness or Incident" },
208
- 149: { name: "Notice of Tax Adjustment or Assessment" },
209
- 150: { name: "Tax Rate Notification" },
210
- 151: { name: "Electronic Filing of Tax Return Data Acknowledgment" },
211
- 152: { name: "Statistical Government Information" },
212
- 153: { name: "Unemployment Insurance Tax Claim or Charge Information" },
213
- 154: { name: "Uniform Commercial Code Filing" },
214
- 155: { name: "Business Credit Report" },
215
- 157: { name: "Notice of Power of Attorney" },
216
- 159: { name: "Motion Picture Booking Confirmation" },
217
- 160: { name: "Transportation Automatic Equipment Identification" },
218
- 161: { name: "Train Sheet" },
219
- 169: { name: "Transportation Appointment Schedule Information" },
220
- 170: { name: "Revenue Receipts Statement" },
221
- 175: { name: "Court and Law Enforcement Notice" },
222
- 176: { name: "Court Submission TYPE" },
223
- 180: { name: "Return Merchandise Authorization and Notification" },
224
- 185: { name: "Royalty Regulatory Report" },
225
- 186: { name: "Insurance Underwriting Requirements Reporting" },
226
- 188: { name: "Educational Course Inventory" },
227
- 189: { name: "Application for Admission to Educational Institutions" },
228
- 190: { name: "Student Enrollment Verification" },
229
- 191: { name: "Student Loan Pre-Claims and Claims" },
230
- 194: { name: "Grant or Assistance Application" },
231
- 195: { name: "Federal Communications Commission (FCC) License Application" },
232
- 196: { name: "Contractor Cost Data Reporting" },
233
- 197: { name: "Real Estate Title Evidence" },
234
- 198: { name: "Loan Verification Information" },
235
- 199: { name: "Real Estate Settlement Information" },
236
- 200: { name: "Mortgage Credit Report" },
237
- 201: { name: "Residential Loan Application" },
238
- 202: { name: "Secondary Mortgage Market Loan Delivery" },
239
- 203: { name: "Secondary Mortgage Market Investor Report" },
240
- 204: { name: "Motor Carrier Load Tender" },
241
- 205: { name: "Mortgage Note" },
242
- 206: { name: "Real Estate Inspection" },
243
- 210: { name: "Motor Carrier Freight Details and Invoice" },
244
- 211: { name: "Motor Carrier Bill of Lading", edifactId: "IFTMCE" },
245
- 212: { name: "Motor Carrier Delivery Trailer Manifest" },
246
- 213: { name: "Motor Carrier Shipment Status Inquiry" },
247
- 214: { name: "Transportation Carrier Shipment Status Message" },
248
- 215: { name: "Motor Carrier Pick-up Manifest" },
249
- 216: { name: "Motor Carrier Shipment Pick-up Notification" },
250
- 217: { name: "Motor Carrier Loading and Route Guide" },
251
- 218: { name: "Motor Carrier Tariff Information" },
252
- 219: { name: "Logistics Service Request" },
253
- 220: { name: "Logistics Service Response" },
254
- 222: { name: "Cartage Work Assignment" },
255
- 223: { name: "Consolidators Freight Bill and Invoice" },
256
- 224: { name: "Motor Carrier Summary Freight Bill Manifest" },
257
- 225: { name: "Response to a Cartage Work Assignment" },
258
- 240: { name: "Motor Carrier Package Status" },
259
- 242: { name: "Data Status Tracking" },
260
- 244: { name: "Product Source Information" },
261
- 248: { name: "Account Assignment/Inquiry and Service/Status" },
262
- 249: { name: "Animal Toxicological Data" },
263
- 250: { name: "Purchase Order Shipment Management Document" },
264
- 251: { name: "Pricing Support" },
265
- 252: { name: "Insurance Producer Administration" },
266
- 255: { name: "Underwriting Information Services" },
267
- 256: { name: "Periodic Compensation" },
268
- 260: { name: "Application for Mortgage Insurance Benefits" },
269
- 261: { name: "Real Estate Information Request" },
270
- 262: { name: "Real Estate Information Report" },
271
- 263: { name: "Residential Mortgage Insurance Application Response" },
272
- 264: { name: "Mortgage Loan Default Status" },
273
- 265: { name: "Real Estate Title Insurance Services Order" },
274
- 266: { name: "Mortgage or Property Record Change Notification" },
275
- 267: { name: "Individual Life, Annuity and Disability Application" },
276
- 268: { name: "Annuity Activity" },
277
- 270: { name: "Eligibility, Coverage or Benefit Inquiry" },
278
- 271: { name: "Eligibility, Coverage or Benefit Information" },
279
- 272: { name: "Property and Casualty Loss Notification" },
280
- 273: { name: "Insurance/Annuity Application Status" },
281
- 274: { name: "Health Care Provider Information" },
282
- 275: { name: "Patient Information" },
283
- 276: { name: "Health Care Claim Status Request" },
284
- 277: { name: "Health Care Claim Status Notification" },
285
- 278: { name: "Health Care Services Insurance/Benefit Review Information" },
286
- 280: { name: "Voter Registration Information" },
287
- 285: { name: "Commercial Vehicle Safety and Credentials Information Exchange" },
288
- 286: { name: "Commercial Vehicle Credentials" },
289
- 288: { name: "Wage Determination" },
290
- 290: { name: "Cooperative Advertising Agreements" },
291
- 300: { name: "Reservation (Booking Request) (Ocean)" },
292
- 301: { name: "Confirmation (Ocean)", edifactId: "IFTMBC" },
293
- 303: { name: "Booking Cancellation (Ocean)" },
294
- 304: { name: "Shipping Instructions" },
295
- 309: { name: "U.S. Customs Manifest" },
296
- 310: { name: "Freight Receipt and Invoice (Ocean)" },
297
- 311: { name: "Canadian Customs Information" },
298
- 312: { name: "Arrival Notice (Ocean)" },
299
- 313: { name: "Shipment Status Inquiry (Ocean)" },
300
- 315: { name: "Status Details (Ocean)" },
301
- 317: { name: "Delivery/Pickup Order" },
302
- 319: { name: "Terminal Information" },
303
- 322: { name: "Terminal Operations and Intermodal Ramp Activity" },
304
- 323: { name: "Vessel Schedule and Itinerary (Ocean)" },
305
- 324: { name: "Vessel Stow Plan (Ocean)" },
306
- 325: { name: "Consolidation of Goods In Container" },
307
- 326: { name: "Consignment Summary List" },
308
- 350: { name: "U.S. Customs Status Information" },
309
- 352: { name: "U.S. Customs Carrier General Order Status" },
310
- 353: { name: "U.S. Customs Events Advisory Details" },
311
- 354: { name: "U.S. Customs Automated Manifest Archive Status" },
312
- 355: { name: "U.S. Customs Acceptance/Rejection" },
313
- 356: { name: "U.S. Customs Permit to Transfer Request" },
314
- 357: { name: "U.S. Customs In-Bond Information" },
315
- 358: { name: "U.S. Customs Consist Information" },
316
- 361: { name: "Carrier Interchange Agreement (Ocean)" },
317
- 362: { name: "Cargo Insurance Advice of Shipment" },
318
- 404: { name: "Rail Carrier Shipment Information" },
319
- 410: { name: "Rail Carrier Freight Details and Invoice" },
320
- 411: { name: "Rail Carrier Freight Details and Invoice Summary" },
321
- 412: { name: "Trailer or Container Repair Billing" },
322
- 414: { name: "Rail Carhire Settlements" },
323
- 417: { name: "Rail Carrier Waybill Interchange" },
324
- 418: { name: "Rail Advance Interchange Consist" },
325
- 419: { name: "Advance Car Disposition" },
326
- 420: { name: "Car Handling Information" },
327
- 421: { name: "Estimated Time of Arrival and Car Scheduling" },
328
- 422: { name: "Shipper's Car Order" },
329
- 423: { name: "Rail Industrial Switch List" },
330
- 424: { name: "Rail Carrier Services Settlement" },
331
- 425: { name: "Rail Waybill Request" },
332
- 426: { name: "Rail Revenue Waybill" },
333
- 427: { name: "Rail Waybill Response" },
334
- 429: { name: "Railroad Retirement Activity" },
335
- 431: { name: "Railroad Station Master File" },
336
- 432: { name: "Rail Deprescription" },
337
- 433: { name: "Railroad Reciprocal Switch File" },
338
- 434: { name: "Railroad Mark Register Update Activity" },
339
- 435: { name: "Standard Transportation Commodity Code (STCC) Master" },
340
- 436: { name: "Locomotive Information" },
341
- 437: { name: "Railroad Junctions and Interchanges Activity" },
342
- 440: { name: "Shipment Weights" },
343
- 451: { name: "Railroad Event Report" },
344
- 452: { name: "Railroad Problem Log Inquiry or Advice" },
345
- 453: { name: "Railroad Service Commitment Advice" },
346
- 455: { name: "Railroad Parameter Trace Registration" },
347
- 456: { name: "Railroad Equipment Inquiry or Advice" },
348
- 460: { name: "Railroad Price Distribution Request or Response" },
349
- 463: { name: "Rail Rate Reply" },
350
- 466: { name: "Rate Request" },
351
- 468: { name: "Rate Docket Journal Log" },
352
- 470: { name: "Railroad Clearance" },
353
- 475: { name: "Rail Route File Maintenance" },
354
- 485: { name: "Ratemaking Action" },
355
- 486: { name: "Rate Docket Expiration" },
356
- 490: { name: "Rate Group Definition" },
357
- 492: { name: "Miscellaneous Rates" },
358
- 494: { name: "Rail Scale Rates" },
359
- 500: { name: "Medical Event Reporting" },
360
- 501: { name: "Vendor Performance Review" },
361
- 503: { name: "Pricing History" },
362
- 504: { name: "Clauses and Provisions" },
363
- 511: { name: "Requisition" },
364
- 517: { name: "Material Obligation Validation" },
365
- 521: { name: "Income or Asset Offset" },
366
- 527: { name: "Material Due-In and Receipt" },
367
- 536: { name: "Logistics Reassignment" },
368
- 540: { name: "Notice of Employment Status" },
369
- 561: { name: "Contract Abstract" },
370
- 567: { name: "Contract Completion Status" },
371
- 568: { name: "Contract Payment Management Report" },
372
- 601: { name: "U.S. Customs Export Shipment Information" },
373
- 602: { name: "Transportation Services Tender" },
374
- 620: { name: "Excavation Communication" },
375
- 625: { name: "Well Information" },
376
- 650: { name: "Maintenance Service Order" },
377
- 715: { name: "Intermodal Group Loading Plan" },
378
- 805: { name: "Contract Pricing Proposal" },
379
- 806: { name: "Project Schedule Reporting" },
380
- 810: { name: "Invoice", edifactId: "INVOIC" },
381
- 811: { name: "Consolidated Service Invoice/Statement" },
382
- 812: { name: "Credit/Debit Adjustment" },
383
- 813: { name: "Electronic Filing of Tax Return Data" },
384
- 814: { name: "General Request, Response or Confirmation" },
385
- 815: { name: "Cryptographic Service Message" },
386
- 816: { name: "Organizational Relationships" },
387
- 818: { name: "Commission Sales Report" },
388
- 819: { name: "Operating Expense Statement" },
389
- 820: { name: "Payment Order/Remittance Advice", edifactId: "REMADV" },
390
- 821: { name: "Financial Information Reporting" },
391
- 822: { name: "Account Analysis" },
392
- 823: { name: "Lockbox" },
393
- 824: { name: "Application Advice", edifactId: "APERAK" },
394
- 826: { name: "Tax Information Exchange" },
395
- 827: { name: "Financial Return Notice" },
396
- 828: { name: "Debit Authorization" },
397
- 829: { name: "Payment Cancellation Request" },
398
- 830: { name: "Planning Schedule with Release Capability", edifactId: "DELFOR" },
399
- 831: { name: "Application Control Totals" },
400
- 832: { name: "Price/Sales Catalog", edifactId: "PRICAT" },
401
- 833: { name: "Mortgage Credit Report Order" },
402
- 834: { name: "Benefit Enrollment and Maintenance" },
403
- 835: { name: "Health Care Claim Payment/Advice" },
404
- 836: { name: "Procurement Notices" },
405
- 837: { name: "Health Care Claim" },
406
- 838: { name: "Trading Partner Profile" },
407
- 839: { name: "Project Cost Reporting" },
408
- 840: { name: "Request for Quotation", edifactId: "REQUOTE" },
409
- 841: { name: "Specifications/Technical Information" },
410
- 842: { name: "Nonconformance Report" },
411
- 843: { name: "Response to Request for Quotation", edifactId: "QUOTES" },
412
- 844: { name: "Product Transfer Account Adjustment", edifactId: "SSDCLM" },
413
- 845: { name: "Price Authorization Acknowledgment/Status", edifactId: "ATHSTS" },
414
- 846: { name: "Inventory Inquiry/Advice", edifactId: "INVRPT" },
415
- 847: { name: "Material Claim" },
416
- 848: { name: "Material Safety Data Sheet" },
417
- 849: { name: "Response to Product Transfer Account Adjustment" },
418
- 850: { name: "Purchase Order", edifactId: "ORDERS" },
419
- 851: { name: "Asset Schedule" },
420
- 852: { name: "Product Activity Data", edifactId: "SLSRPT" },
421
- 853: { name: "Routing and Carrier Instruction" },
422
- 854: { name: "Shipment Delivery Discrepancy Information" },
423
- 855: { name: "Purchase Order Acknowledgment", edifactId: "ORDRSP" },
424
- 856: { name: "Advance Ship Notice/Manifest", edifactId: "DESADV" },
425
- 857: { name: "Shipment and Billing Notice" },
426
- 858: { name: "Shipment Information" },
427
- 859: { name: "Freight Invoice" },
428
- 860: { name: "Purchase Order Change", edifactId: "ORDCHG" },
429
- 861: { name: "Receiving Advice/Acceptance Certificate", edifactId: "RECADV" },
430
- 862: { name: "Shipping Schedule", edifactId: "DELJIT" },
431
- 863: { name: "Report of Test Results" },
432
- 864: { name: "Text Message" },
433
- 865: { name: "Purchase Order Change", edifactId: "ORDRSP" },
434
- 866: { name: "Production Sequence" },
435
- 867: { name: "Product Transfer and Resale Report", edifactId: "SLSRPT" },
436
- 868: { name: "Electronic Form Structure" },
437
- 869: { name: "Order Status Inquiry", edifactId: "ORSSTA" },
438
- 870: { name: "Order Status Report", edifactId: "ORDREP" },
439
- 871: { name: "Component Parts Content" },
440
- 872: { name: "Residential Mortgage Insurance Application" },
441
- 875: { name: "Grocery Products Purchase Order" },
442
- 876: { name: "Grocery Products Purchase Order Change" },
443
- 877: { name: "Manufacturer Coupon Family Code Structure" },
444
- 878: { name: "Product Authorization/De-authorization" },
445
- 879: { name: "Price Information" },
446
- 880: { name: "Grocery Products Invoice" },
447
- 881: { name: "Manufacturer Coupon Redemption Detail" },
448
- 882: { name: "Direct Store Delivery Summary Information" },
449
- 883: { name: "Market Development Fund Allocation" },
450
- 884: { name: "Market Development Fund Settlement" },
451
- 885: { name: "Retail Account Characteristics" },
452
- 886: { name: "Customer Call Reporting" },
453
- 887: { name: "Coupon Notification" },
454
- 888: { name: "Item Maintenance" },
455
- 889: { name: "Promotion Announcement" },
456
- 891: { name: "Deduction Research Report" },
457
- 893: { name: "Item Information Request" },
458
- 894: { name: "Delivery/Return Base Record" },
459
- 895: { name: "Delivery/Return Acknowledgment or Adjustment" },
460
- 896: { name: "Product Dimension Maintenance" },
461
- 920: { name: "Loss or Damage Claim - General Commodities" },
462
- 924: { name: "Loss or Damage Claim - Motor Vehicle" },
463
- 925: { name: "Claim Tracer" },
464
- 926: { name: "Claim Status Report and Tracer Reply" },
465
- 928: { name: "Automotive Inspection Detail" },
466
- 940: { name: "Warehouse Shipping Order" },
467
- 943: { name: "Warehouse Stock Transfer Shipment Advice" },
468
- 944: { name: "Warehouse Stock Transfer Receipt Advice" },
469
- 945: { name: "Warehouse Shipping Advice" },
470
- 947: { name: "Warehouse Inventory Adjustment Advice" },
471
- 980: { name: "Functional Group Totals" },
472
- 990: { name: "Response to a Load Tender" },
473
- 996: { name: "File Transfer" },
474
- 997: { name: "Functional Acknowledgment", edifactId: "CONTROL" },
475
- 998: { name: "Set Cancellation" },
476
- 999: { name: "Implementation Acknowledgment" }
353
+ return CustomEvent;
354
+ }());
355
+
356
+ var EDI_DOCUMENT_TYPE = Object.freeze({
357
+ 100: { name: "Insurance Plan Description" },
358
+ 101: { name: "Name and Address Lists" },
359
+ 104: { name: "Air Shipment Information" },
360
+ 106: { name: "Motor Carrier Rate Proposal" },
361
+ 107: { name: "Request for Motor Carrier Rate Proposal" },
362
+ 108: { name: "Response to a Motor Carrier Rate Proposal" },
363
+ 109: { name: "Vessel Content Details" },
364
+ 110: { name: "Air Freight Details and Invoice" },
365
+ 112: { name: "Property Damage Report" },
366
+ 120: { name: "Vehicle Shipping Order" },
367
+ 121: { name: "Vehicle Service" },
368
+ 124: { name: "Vehicle Damage" },
369
+ 125: { name: "Multilevel Railcar Load Details" },
370
+ 126: { name: "Vehicle Application Advice" },
371
+ 127: { name: "Vehicle Baying Order" },
372
+ 128: { name: "Dealer Information" },
373
+ 129: { name: "Vehicle Carrier Rate Update" },
374
+ 130: { name: "Student Educational Record (Transcript)" },
375
+ 131: { name: "Student Educational Record (Transcript) Acknowledgment" },
376
+ 135: { name: "Student Loan Application" },
377
+ 138: { name: "Testing Results Request and Report" },
378
+ 139: { name: "Student Loan Guarantee Result" },
379
+ 140: { name: "Product Registration" },
380
+ 141: { name: "Product Service Claim Response" },
381
+ 142: { name: "Product Service Claim" },
382
+ 143: { name: "Product Service Notification" },
383
+ 144: { name: "Student Loan Transfer and Status Verification" },
384
+ 146: { name: "Request for Student Educational Record (Transcript)" },
385
+ 147: { name: "Response to Request for Student Educational Record (Transcript)" },
386
+ 148: { name: "Report of Injury, Illness or Incident" },
387
+ 149: { name: "Notice of Tax Adjustment or Assessment" },
388
+ 150: { name: "Tax Rate Notification" },
389
+ 151: { name: "Electronic Filing of Tax Return Data Acknowledgment" },
390
+ 152: { name: "Statistical Government Information" },
391
+ 153: { name: "Unemployment Insurance Tax Claim or Charge Information" },
392
+ 154: { name: "Uniform Commercial Code Filing" },
393
+ 155: { name: "Business Credit Report" },
394
+ 157: { name: "Notice of Power of Attorney" },
395
+ 159: { name: "Motion Picture Booking Confirmation" },
396
+ 160: { name: "Transportation Automatic Equipment Identification" },
397
+ 161: { name: "Train Sheet" },
398
+ 169: { name: "Transportation Appointment Schedule Information" },
399
+ 170: { name: "Revenue Receipts Statement" },
400
+ 175: { name: "Court and Law Enforcement Notice" },
401
+ 176: { name: "Court Submission TYPE" },
402
+ 180: { name: "Return Merchandise Authorization and Notification" },
403
+ 185: { name: "Royalty Regulatory Report" },
404
+ 186: { name: "Insurance Underwriting Requirements Reporting" },
405
+ 188: { name: "Educational Course Inventory" },
406
+ 189: { name: "Application for Admission to Educational Institutions" },
407
+ 190: { name: "Student Enrollment Verification" },
408
+ 191: { name: "Student Loan Pre-Claims and Claims" },
409
+ 194: { name: "Grant or Assistance Application" },
410
+ 195: { name: "Federal Communications Commission (FCC) License Application" },
411
+ 196: { name: "Contractor Cost Data Reporting" },
412
+ 197: { name: "Real Estate Title Evidence" },
413
+ 198: { name: "Loan Verification Information" },
414
+ 199: { name: "Real Estate Settlement Information" },
415
+ 200: { name: "Mortgage Credit Report" },
416
+ 201: { name: "Residential Loan Application" },
417
+ 202: { name: "Secondary Mortgage Market Loan Delivery" },
418
+ 203: { name: "Secondary Mortgage Market Investor Report" },
419
+ 204: { name: "Motor Carrier Load Tender" },
420
+ 205: { name: "Mortgage Note" },
421
+ 206: { name: "Real Estate Inspection" },
422
+ 210: { name: "Motor Carrier Freight Details and Invoice" },
423
+ 211: { name: "Motor Carrier Bill of Lading", edifactId: "IFTMCE" },
424
+ 212: { name: "Motor Carrier Delivery Trailer Manifest" },
425
+ 213: { name: "Motor Carrier Shipment Status Inquiry" },
426
+ 214: { name: "Transportation Carrier Shipment Status Message" },
427
+ 215: { name: "Motor Carrier Pick-up Manifest" },
428
+ 216: { name: "Motor Carrier Shipment Pick-up Notification" },
429
+ 217: { name: "Motor Carrier Loading and Route Guide" },
430
+ 218: { name: "Motor Carrier Tariff Information" },
431
+ 219: { name: "Logistics Service Request" },
432
+ 220: { name: "Logistics Service Response" },
433
+ 222: { name: "Cartage Work Assignment" },
434
+ 223: { name: "Consolidators Freight Bill and Invoice" },
435
+ 224: { name: "Motor Carrier Summary Freight Bill Manifest" },
436
+ 225: { name: "Response to a Cartage Work Assignment" },
437
+ 240: { name: "Motor Carrier Package Status" },
438
+ 242: { name: "Data Status Tracking" },
439
+ 244: { name: "Product Source Information" },
440
+ 248: { name: "Account Assignment/Inquiry and Service/Status" },
441
+ 249: { name: "Animal Toxicological Data" },
442
+ 250: { name: "Purchase Order Shipment Management Document" },
443
+ 251: { name: "Pricing Support" },
444
+ 252: { name: "Insurance Producer Administration" },
445
+ 255: { name: "Underwriting Information Services" },
446
+ 256: { name: "Periodic Compensation" },
447
+ 260: { name: "Application for Mortgage Insurance Benefits" },
448
+ 261: { name: "Real Estate Information Request" },
449
+ 262: { name: "Real Estate Information Report" },
450
+ 263: { name: "Residential Mortgage Insurance Application Response" },
451
+ 264: { name: "Mortgage Loan Default Status" },
452
+ 265: { name: "Real Estate Title Insurance Services Order" },
453
+ 266: { name: "Mortgage or Property Record Change Notification" },
454
+ 267: { name: "Individual Life, Annuity and Disability Application" },
455
+ 268: { name: "Annuity Activity" },
456
+ 270: { name: "Eligibility, Coverage or Benefit Inquiry" },
457
+ 271: { name: "Eligibility, Coverage or Benefit Information" },
458
+ 272: { name: "Property and Casualty Loss Notification" },
459
+ 273: { name: "Insurance/Annuity Application Status" },
460
+ 274: { name: "Health Care Provider Information" },
461
+ 275: { name: "Patient Information" },
462
+ 276: { name: "Health Care Claim Status Request" },
463
+ 277: { name: "Health Care Claim Status Notification" },
464
+ 278: { name: "Health Care Services Insurance/Benefit Review Information" },
465
+ 280: { name: "Voter Registration Information" },
466
+ 285: { name: "Commercial Vehicle Safety and Credentials Information Exchange" },
467
+ 286: { name: "Commercial Vehicle Credentials" },
468
+ 288: { name: "Wage Determination" },
469
+ 290: { name: "Cooperative Advertising Agreements" },
470
+ 300: { name: "Reservation (Booking Request) (Ocean)" },
471
+ 301: { name: "Confirmation (Ocean)", edifactId: "IFTMBC" },
472
+ 303: { name: "Booking Cancellation (Ocean)" },
473
+ 304: { name: "Shipping Instructions" },
474
+ 309: { name: "U.S. Customs Manifest" },
475
+ 310: { name: "Freight Receipt and Invoice (Ocean)" },
476
+ 311: { name: "Canadian Customs Information" },
477
+ 312: { name: "Arrival Notice (Ocean)" },
478
+ 313: { name: "Shipment Status Inquiry (Ocean)" },
479
+ 315: { name: "Status Details (Ocean)" },
480
+ 317: { name: "Delivery/Pickup Order" },
481
+ 319: { name: "Terminal Information" },
482
+ 322: { name: "Terminal Operations and Intermodal Ramp Activity" },
483
+ 323: { name: "Vessel Schedule and Itinerary (Ocean)" },
484
+ 324: { name: "Vessel Stow Plan (Ocean)" },
485
+ 325: { name: "Consolidation of Goods In Container" },
486
+ 326: { name: "Consignment Summary List" },
487
+ 350: { name: "U.S. Customs Status Information" },
488
+ 352: { name: "U.S. Customs Carrier General Order Status" },
489
+ 353: { name: "U.S. Customs Events Advisory Details" },
490
+ 354: { name: "U.S. Customs Automated Manifest Archive Status" },
491
+ 355: { name: "U.S. Customs Acceptance/Rejection" },
492
+ 356: { name: "U.S. Customs Permit to Transfer Request" },
493
+ 357: { name: "U.S. Customs In-Bond Information" },
494
+ 358: { name: "U.S. Customs Consist Information" },
495
+ 361: { name: "Carrier Interchange Agreement (Ocean)" },
496
+ 362: { name: "Cargo Insurance Advice of Shipment" },
497
+ 404: { name: "Rail Carrier Shipment Information" },
498
+ 410: { name: "Rail Carrier Freight Details and Invoice" },
499
+ 411: { name: "Rail Carrier Freight Details and Invoice Summary" },
500
+ 412: { name: "Trailer or Container Repair Billing" },
501
+ 414: { name: "Rail Carhire Settlements" },
502
+ 417: { name: "Rail Carrier Waybill Interchange" },
503
+ 418: { name: "Rail Advance Interchange Consist" },
504
+ 419: { name: "Advance Car Disposition" },
505
+ 420: { name: "Car Handling Information" },
506
+ 421: { name: "Estimated Time of Arrival and Car Scheduling" },
507
+ 422: { name: "Shipper's Car Order" },
508
+ 423: { name: "Rail Industrial Switch List" },
509
+ 424: { name: "Rail Carrier Services Settlement" },
510
+ 425: { name: "Rail Waybill Request" },
511
+ 426: { name: "Rail Revenue Waybill" },
512
+ 427: { name: "Rail Waybill Response" },
513
+ 429: { name: "Railroad Retirement Activity" },
514
+ 431: { name: "Railroad Station Master File" },
515
+ 432: { name: "Rail Deprescription" },
516
+ 433: { name: "Railroad Reciprocal Switch File" },
517
+ 434: { name: "Railroad Mark Register Update Activity" },
518
+ 435: { name: "Standard Transportation Commodity Code (STCC) Master" },
519
+ 436: { name: "Locomotive Information" },
520
+ 437: { name: "Railroad Junctions and Interchanges Activity" },
521
+ 440: { name: "Shipment Weights" },
522
+ 451: { name: "Railroad Event Report" },
523
+ 452: { name: "Railroad Problem Log Inquiry or Advice" },
524
+ 453: { name: "Railroad Service Commitment Advice" },
525
+ 455: { name: "Railroad Parameter Trace Registration" },
526
+ 456: { name: "Railroad Equipment Inquiry or Advice" },
527
+ 460: { name: "Railroad Price Distribution Request or Response" },
528
+ 463: { name: "Rail Rate Reply" },
529
+ 466: { name: "Rate Request" },
530
+ 468: { name: "Rate Docket Journal Log" },
531
+ 470: { name: "Railroad Clearance" },
532
+ 475: { name: "Rail Route File Maintenance" },
533
+ 485: { name: "Ratemaking Action" },
534
+ 486: { name: "Rate Docket Expiration" },
535
+ 490: { name: "Rate Group Definition" },
536
+ 492: { name: "Miscellaneous Rates" },
537
+ 494: { name: "Rail Scale Rates" },
538
+ 500: { name: "Medical Event Reporting" },
539
+ 501: { name: "Vendor Performance Review" },
540
+ 503: { name: "Pricing History" },
541
+ 504: { name: "Clauses and Provisions" },
542
+ 511: { name: "Requisition" },
543
+ 517: { name: "Material Obligation Validation" },
544
+ 521: { name: "Income or Asset Offset" },
545
+ 527: { name: "Material Due-In and Receipt" },
546
+ 536: { name: "Logistics Reassignment" },
547
+ 540: { name: "Notice of Employment Status" },
548
+ 561: { name: "Contract Abstract" },
549
+ 567: { name: "Contract Completion Status" },
550
+ 568: { name: "Contract Payment Management Report" },
551
+ 601: { name: "U.S. Customs Export Shipment Information" },
552
+ 602: { name: "Transportation Services Tender" },
553
+ 620: { name: "Excavation Communication" },
554
+ 625: { name: "Well Information" },
555
+ 650: { name: "Maintenance Service Order" },
556
+ 715: { name: "Intermodal Group Loading Plan" },
557
+ 805: { name: "Contract Pricing Proposal" },
558
+ 806: { name: "Project Schedule Reporting" },
559
+ 810: { name: "Invoice", edifactId: "INVOIC" },
560
+ 811: { name: "Consolidated Service Invoice/Statement" },
561
+ 812: { name: "Credit/Debit Adjustment" },
562
+ 813: { name: "Electronic Filing of Tax Return Data" },
563
+ 814: { name: "General Request, Response or Confirmation" },
564
+ 815: { name: "Cryptographic Service Message" },
565
+ 816: { name: "Organizational Relationships" },
566
+ 818: { name: "Commission Sales Report" },
567
+ 819: { name: "Operating Expense Statement" },
568
+ 820: { name: "Payment Order/Remittance Advice", edifactId: "REMADV" },
569
+ 821: { name: "Financial Information Reporting" },
570
+ 822: { name: "Account Analysis" },
571
+ 823: { name: "Lockbox" },
572
+ 824: { name: "Application Advice", edifactId: "APERAK" },
573
+ 826: { name: "Tax Information Exchange" },
574
+ 827: { name: "Financial Return Notice" },
575
+ 828: { name: "Debit Authorization" },
576
+ 829: { name: "Payment Cancellation Request" },
577
+ 830: { name: "Planning Schedule with Release Capability", edifactId: "DELFOR" },
578
+ 831: { name: "Application Control Totals" },
579
+ 832: { name: "Price/Sales Catalog", edifactId: "PRICAT" },
580
+ 833: { name: "Mortgage Credit Report Order" },
581
+ 834: { name: "Benefit Enrollment and Maintenance" },
582
+ 835: { name: "Health Care Claim Payment/Advice" },
583
+ 836: { name: "Procurement Notices" },
584
+ 837: { name: "Health Care Claim" },
585
+ 838: { name: "Trading Partner Profile" },
586
+ 839: { name: "Project Cost Reporting" },
587
+ 840: { name: "Request for Quotation", edifactId: "REQUOTE" },
588
+ 841: { name: "Specifications/Technical Information" },
589
+ 842: { name: "Nonconformance Report" },
590
+ 843: { name: "Response to Request for Quotation", edifactId: "QUOTES" },
591
+ 844: { name: "Product Transfer Account Adjustment", edifactId: "SSDCLM" },
592
+ 845: { name: "Price Authorization Acknowledgment/Status", edifactId: "ATHSTS" },
593
+ 846: { name: "Inventory Inquiry/Advice", edifactId: "INVRPT" },
594
+ 847: { name: "Material Claim" },
595
+ 848: { name: "Material Safety Data Sheet" },
596
+ 849: { name: "Response to Product Transfer Account Adjustment" },
597
+ 850: { name: "Purchase Order", edifactId: "ORDERS" },
598
+ 851: { name: "Asset Schedule" },
599
+ 852: { name: "Product Activity Data", edifactId: "SLSRPT" },
600
+ 853: { name: "Routing and Carrier Instruction" },
601
+ 854: { name: "Shipment Delivery Discrepancy Information" },
602
+ 855: { name: "Purchase Order Acknowledgment", edifactId: "ORDRSP" },
603
+ 856: { name: "Advance Ship Notice/Manifest", edifactId: "DESADV" },
604
+ 857: { name: "Shipment and Billing Notice" },
605
+ 858: { name: "Shipment Information" },
606
+ 859: { name: "Freight Invoice" },
607
+ 860: { name: "Purchase Order Change", edifactId: "ORDCHG" },
608
+ 861: { name: "Receiving Advice/Acceptance Certificate", edifactId: "RECADV" },
609
+ 862: { name: "Shipping Schedule", edifactId: "DELJIT" },
610
+ 863: { name: "Report of Test Results" },
611
+ 864: { name: "Text Message" },
612
+ 865: { name: "Purchase Order Change", edifactId: "ORDRSP" },
613
+ 866: { name: "Production Sequence" },
614
+ 867: { name: "Product Transfer and Resale Report", edifactId: "SLSRPT" },
615
+ 868: { name: "Electronic Form Structure" },
616
+ 869: { name: "Order Status Inquiry", edifactId: "ORSSTA" },
617
+ 870: { name: "Order Status Report", edifactId: "ORDREP" },
618
+ 871: { name: "Component Parts Content" },
619
+ 872: { name: "Residential Mortgage Insurance Application" },
620
+ 875: { name: "Grocery Products Purchase Order" },
621
+ 876: { name: "Grocery Products Purchase Order Change" },
622
+ 877: { name: "Manufacturer Coupon Family Code Structure" },
623
+ 878: { name: "Product Authorization/De-authorization" },
624
+ 879: { name: "Price Information" },
625
+ 880: { name: "Grocery Products Invoice" },
626
+ 881: { name: "Manufacturer Coupon Redemption Detail" },
627
+ 882: { name: "Direct Store Delivery Summary Information" },
628
+ 883: { name: "Market Development Fund Allocation" },
629
+ 884: { name: "Market Development Fund Settlement" },
630
+ 885: { name: "Retail Account Characteristics" },
631
+ 886: { name: "Customer Call Reporting" },
632
+ 887: { name: "Coupon Notification" },
633
+ 888: { name: "Item Maintenance" },
634
+ 889: { name: "Promotion Announcement" },
635
+ 891: { name: "Deduction Research Report" },
636
+ 893: { name: "Item Information Request" },
637
+ 894: { name: "Delivery/Return Base Record" },
638
+ 895: { name: "Delivery/Return Acknowledgment or Adjustment" },
639
+ 896: { name: "Product Dimension Maintenance" },
640
+ 920: { name: "Loss or Damage Claim - General Commodities" },
641
+ 924: { name: "Loss or Damage Claim - Motor Vehicle" },
642
+ 925: { name: "Claim Tracer" },
643
+ 926: { name: "Claim Status Report and Tracer Reply" },
644
+ 928: { name: "Automotive Inspection Detail" },
645
+ 940: { name: "Warehouse Shipping Order" },
646
+ 943: { name: "Warehouse Stock Transfer Shipment Advice" },
647
+ 944: { name: "Warehouse Stock Transfer Receipt Advice" },
648
+ 945: { name: "Warehouse Shipping Advice" },
649
+ 947: { name: "Warehouse Inventory Adjustment Advice" },
650
+ 980: { name: "Functional Group Totals" },
651
+ 990: { name: "Response to a Load Tender" },
652
+ 996: { name: "File Transfer" },
653
+ 997: { name: "Functional Acknowledgment", edifactId: "CONTROL" },
654
+ 998: { name: "Set Cancellation" },
655
+ 999: { name: "Implementation Acknowledgment" },
477
656
  });
657
+
658
+ /**
659
+ * A property decorated with this will have any value assigned
660
+ * to it cast to a number with the unary `+` operator.
661
+ */
478
662
  function castToNumber() {
479
- return (target, key) => {
480
- const internalKey = `_${String(key)}`;
481
- Object.defineProperties(target, {
482
- [internalKey]: {
483
- enumerable: false,
484
- configurable: true,
485
- writable: true,
486
- value: void 0
487
- },
488
- [key]: {
489
- enumerable: true,
490
- configurable: true,
491
- get() {
492
- return this[internalKey];
493
- },
494
- set(newValue) {
495
- this[internalKey] = Number(newValue);
496
- }
497
- }
498
- });
499
- };
663
+ return function (target, key) {
664
+ var _a;
665
+ var internalKey = "_" + String(key);
666
+ Object.defineProperties(target, (_a = {},
667
+ _a[internalKey] = {
668
+ enumerable: false,
669
+ configurable: true,
670
+ writable: true,
671
+ value: undefined,
672
+ },
673
+ _a[key] = {
674
+ enumerable: true,
675
+ configurable: true,
676
+ get: function () {
677
+ return this[internalKey];
678
+ },
679
+ set: function (newValue) {
680
+ this[internalKey] = Number(newValue);
681
+ },
682
+ },
683
+ _a));
684
+ };
500
685
  }
686
+
687
+ var __assign$3 = (undefined && undefined.__assign) || function () {
688
+ __assign$3 = Object.assign || function(t) {
689
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
690
+ s = arguments[i];
691
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
692
+ t[p] = s[p];
693
+ }
694
+ return t;
695
+ };
696
+ return __assign$3.apply(this, arguments);
697
+ };
698
+ /**
699
+ * Decorator that applies `debounce`
700
+ */
501
701
  function debounced(ms) {
502
- return (target, propertyKey, descriptor) => {
503
- const originalDescriptorCopy = __spreadValues({}, descriptor);
504
- originalDescriptorCopy.get = function get() {
505
- const newDescriptorWithDebounced = __spreadValues({}, originalDescriptorCopy);
506
- newDescriptorWithDebounced.value = debounce(originalDescriptorCopy.value, ms, this);
507
- Object.defineProperty(this, propertyKey, newDescriptorWithDebounced);
508
- return newDescriptorWithDebounced.value;
702
+ return function (target, propertyKey, descriptor) {
703
+ var originalDescriptorCopy = __assign$3({}, descriptor);
704
+ originalDescriptorCopy.get = function get() {
705
+ /*
706
+ * Make a new copy each time; if you don't then every instance after the first
707
+ * one of the class containing the decorated method will break.
708
+ */
709
+ var newDescriptorWithDebounced = __assign$3({}, originalDescriptorCopy);
710
+ newDescriptorWithDebounced.value = debounce(originalDescriptorCopy.value, ms, this);
711
+ Object.defineProperty(this, propertyKey, newDescriptorWithDebounced);
712
+ return newDescriptorWithDebounced.value;
713
+ };
714
+ originalDescriptorCopy.configurable = true;
715
+ delete originalDescriptorCopy.writable;
716
+ delete originalDescriptorCopy.value;
717
+ return originalDescriptorCopy;
509
718
  };
510
- originalDescriptorCopy.configurable = true;
511
- delete originalDescriptorCopy.writable;
512
- delete originalDescriptorCopy.value;
513
- return originalDescriptorCopy;
514
- };
515
719
  }
720
+
721
+ var __assign$2 = (undefined && undefined.__assign) || function () {
722
+ __assign$2 = Object.assign || function(t) {
723
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
724
+ s = arguments[i];
725
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
726
+ t[p] = s[p];
727
+ }
728
+ return t;
729
+ };
730
+ return __assign$2.apply(this, arguments);
731
+ };
732
+ /**
733
+ * Decorator that applies `lockToAnimationFrames`
734
+ */
516
735
  function lockedToAnimationFrames(target, propertyKey, descriptor) {
517
- const originalDescriptorCopy = __spreadValues({}, descriptor);
518
- descriptor.get = function get() {
519
- const newDescriptor = __spreadValues({}, originalDescriptorCopy);
520
- newDescriptor.value = lockToAnimationFrames(originalDescriptorCopy.value, this);
521
- Object.defineProperty(this, propertyKey, newDescriptor);
522
- return newDescriptor.value;
523
- };
524
- descriptor.configurable = true;
525
- delete descriptor.writable;
526
- delete descriptor.value;
527
- return descriptor;
736
+ var originalDescriptorCopy = __assign$2({}, descriptor);
737
+ descriptor.get = function get() {
738
+ /*
739
+ * Make a new copy each time; if you don't then every instance after the first
740
+ * one of the class containing the decorated method will break.
741
+ */
742
+ var newDescriptor = __assign$2({}, originalDescriptorCopy);
743
+ newDescriptor.value = lockToAnimationFrames(originalDescriptorCopy.value, this);
744
+ Object.defineProperty(this, propertyKey, newDescriptor);
745
+ return newDescriptor.value;
746
+ };
747
+ descriptor.configurable = true;
748
+ delete descriptor.writable;
749
+ delete descriptor.value;
750
+ return descriptor;
528
751
  }
752
+
753
+ var __assign$1 = (undefined && undefined.__assign) || function () {
754
+ __assign$1 = Object.assign || function(t) {
755
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
756
+ s = arguments[i];
757
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
758
+ t[p] = s[p];
759
+ }
760
+ return t;
761
+ };
762
+ return __assign$1.apply(this, arguments);
763
+ };
764
+ var __values$b = (undefined && undefined.__values) || function(o) {
765
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
766
+ if (m) return m.call(o);
767
+ if (o && typeof o.length === "number") return {
768
+ next: function () {
769
+ if (o && i >= o.length) o = void 0;
770
+ return { value: o && o[i++], done: !o };
771
+ }
772
+ };
773
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
774
+ };
775
+ /**
776
+ * This would be simpler to understand as a factory that returns a decorator function,
777
+ * but TypeScript AoT compliation doesn't allow that. This lets you create a decorator
778
+ * that takes in a metadata object as an argument and assigns its values along with
779
+ * default values to the decorated method. The decorator will look like a standard
780
+ * decorator but calling this method and returning the result is the only thing it
781
+ * needs to do.
782
+ */
529
783
  function simpleMetadataDecoratorApplicator(metadata, defaults, target, key, descriptor) {
530
- const updatedDescriptor = descriptor || Object.getOwnPropertyDescriptor(target, key);
531
- const getter = updatedDescriptor.get;
532
- const { value } = updatedDescriptor;
533
- updatedDescriptor.get = function get() {
534
- const self2 = this;
535
- const fn = value || getter.call(this);
536
- const boundFn = fn.bind(this);
537
- const updatedMetadata = __spreadValues(__spreadValues({}, defaults), metadata);
538
- for (const prop of Object.keys(defaults)) {
539
- if (typeof metadata[prop] === "function") {
540
- Object.defineProperty(boundFn, prop, {
541
- get() {
542
- return updatedMetadata[prop](self2);
543
- }
784
+ var updatedDescriptor = descriptor || Object.getOwnPropertyDescriptor(target, key);
785
+ var getter = updatedDescriptor.get;
786
+ var value = updatedDescriptor.value;
787
+ updatedDescriptor.get = function get() {
788
+ var e_1, _a;
789
+ // I don't remember why I did this "this" alias & want to ensure we don't break anything...
790
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
791
+ var self = this;
792
+ var fn = value || getter.call(this);
793
+ var boundFn = fn.bind(this);
794
+ var updatedMetadata = __assign$1(__assign$1({}, defaults), metadata);
795
+ var _loop_1 = function (prop) {
796
+ if (typeof metadata[prop] === "function") {
797
+ Object.defineProperty(boundFn, prop, {
798
+ get: function () {
799
+ return updatedMetadata[prop](self);
800
+ },
801
+ });
802
+ }
803
+ else {
804
+ boundFn[prop] = updatedMetadata[prop];
805
+ }
806
+ };
807
+ try {
808
+ for (var _b = __values$b(Object.keys(defaults)), _c = _b.next(); !_c.done; _c = _b.next()) {
809
+ var prop = _c.value;
810
+ _loop_1(prop);
811
+ }
812
+ }
813
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
814
+ finally {
815
+ try {
816
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
817
+ }
818
+ finally { if (e_1) throw e_1.error; }
819
+ }
820
+ Object.defineProperty(this, key, {
821
+ writable: true,
822
+ configurable: true,
823
+ enumerable: updatedDescriptor.enumerable,
824
+ value: boundFn,
544
825
  });
545
- } else {
546
- boundFn[prop] = updatedMetadata[prop];
547
- }
548
- }
549
- Object.defineProperty(this, key, {
550
- writable: true,
551
- configurable: true,
552
- enumerable: updatedDescriptor.enumerable,
553
- value: boundFn
554
- });
555
- return boundFn;
556
- };
557
- delete updatedDescriptor.value;
558
- delete updatedDescriptor.writable;
559
- return updatedDescriptor;
826
+ return boundFn;
827
+ };
828
+ delete updatedDescriptor.value;
829
+ delete updatedDescriptor.writable;
830
+ return updatedDescriptor;
560
831
  }
832
+
833
+ var __assign = (undefined && undefined.__assign) || function () {
834
+ __assign = Object.assign || function(t) {
835
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
836
+ s = arguments[i];
837
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
838
+ t[p] = s[p];
839
+ }
840
+ return t;
841
+ };
842
+ return __assign.apply(this, arguments);
843
+ };
844
+ /** Method decorator that configures the method to always run the tick after it's invoked */
561
845
  function tickDelay(target, propertyKey, descriptor) {
562
- const originalDescriptorCopy = __spreadValues({}, descriptor);
563
- originalDescriptorCopy.get = function get() {
564
- const newDescriptor = __spreadValues({}, originalDescriptorCopy);
565
- const boundFn = originalDescriptorCopy.value.bind(this);
566
- newDescriptor.value = () => setTimeout(boundFn, 0);
567
- Object.defineProperty(this, propertyKey, newDescriptor);
568
- return newDescriptor.value;
569
- };
570
- originalDescriptorCopy.configurable = true;
571
- delete originalDescriptorCopy.writable;
572
- delete originalDescriptorCopy.value;
573
- return originalDescriptorCopy;
846
+ var originalDescriptorCopy = __assign({}, descriptor);
847
+ originalDescriptorCopy.get = function get() {
848
+ /*
849
+ * Make a new copy each time; if you don't then every instance after the first
850
+ * one of the class containing the decorated method will break.
851
+ */
852
+ var newDescriptor = __assign({}, originalDescriptorCopy);
853
+ var boundFn = originalDescriptorCopy.value.bind(this);
854
+ newDescriptor.value = function () { return setTimeout(boundFn, 0); };
855
+ Object.defineProperty(this, propertyKey, newDescriptor);
856
+ return newDescriptor.value;
857
+ };
858
+ originalDescriptorCopy.configurable = true;
859
+ delete originalDescriptorCopy.writable;
860
+ delete originalDescriptorCopy.value;
861
+ return originalDescriptorCopy;
574
862
  }
575
- function constrain(n, range2) {
576
- if (!n || n < range2[0]) {
577
- return range2[0];
578
- }
579
- if (n > range2[1]) {
580
- return range2[1];
581
- }
582
- return n;
863
+
864
+ /**
865
+ * Constrains a number to the given range. If the number is below the
866
+ * low end of the range, the low end will be returned. If the number is
867
+ * above the top end of the range, the top end will be returned. Otherwise
868
+ * the number itself will be returned.
869
+ */
870
+ function constrain(n, range) {
871
+ if (!n || n < range[0]) {
872
+ return range[0];
873
+ }
874
+ if (n > range[1]) {
875
+ return range[1];
876
+ }
877
+ return n;
583
878
  }
584
- function decimalRound(num, decimalPlaces = 0) {
585
- const integralAndFractionalSplit = String(num).split(".");
586
- const allDecimalPlaces = integralAndFractionalSplit.length > 1 ? integralAndFractionalSplit[1].length : 0;
587
- let roundedNum = num;
588
- for (let i = allDecimalPlaces - 1; i >= decimalPlaces; i -= 1) {
589
- roundedNum = Number(`${Math.round(Number(`${roundedNum}e${i}`))}e-${i}`);
590
- }
591
- return roundedNum;
879
+
880
+ /**
881
+ * Progressively rounds `num` to `decimalPlaces` places. This differs from other
882
+ * rounding methods out there such as lodash's, which are not progressive. For example,
883
+ * `(0.149).toFixed(1)` and lodash `_.round(0.149, 1)` both return `0.1`, but this
884
+ * function rounds `0.149` to `0.15` and then `0.15` to `0.2` and returns `0.2`.
885
+ */
886
+ function decimalRound(num, decimalPlaces) {
887
+ if (decimalPlaces === void 0) { decimalPlaces = 0; }
888
+ var integralAndFractionalSplit = String(num).split(".");
889
+ var allDecimalPlaces = integralAndFractionalSplit.length > 1
890
+ ? integralAndFractionalSplit[1].length
891
+ : 0;
892
+ var roundedNum = num;
893
+ for (var i = allDecimalPlaces - 1; i >= decimalPlaces; i -= 1) {
894
+ roundedNum = Number(Math.round(Number(roundedNum + "e" + i)) + "e-" + i);
895
+ }
896
+ return roundedNum;
592
897
  }
593
- function toFileSizeString(n, precision = 2) {
594
- if (n > Number.MAX_SAFE_INTEGER) {
595
- throw new Error("Number is greater than MAX_SAFE_INTEGER; toFileSizeString does not support orders of magnitude higher than petabytes for this reason until BigInt achieves broad browser support.");
596
- }
597
- const magnitude = Math.min(Math.floor(Math.log(n) / Math.log(1024)), 5);
598
- const unit = [
599
- "B",
600
- "KB",
601
- "MB",
602
- "GB",
603
- "TB",
604
- "PB"
605
- ][magnitude];
606
- const decimalPlaces = magnitude ? precision : 0;
607
- return decimalRound(n / 1024 ** magnitude, decimalPlaces).toFixed(decimalPlaces) + unit;
898
+
899
+ /**
900
+ * Converts a file size in bytes to a human-friendly string. For example,
901
+ * `toFileSizeString(2048)` will return `"2.00KB"`.
902
+ */
903
+ function toFileSizeString(n, precision) {
904
+ if (precision === void 0) { precision = 2; }
905
+ if (n > Number.MAX_SAFE_INTEGER) {
906
+ throw new Error("Number is greater than MAX_SAFE_INTEGER; "
907
+ + "toFileSizeString does not support orders of magnitude "
908
+ + "higher than petabytes for this reason until BigInt "
909
+ + "achieves broad browser support.");
910
+ }
911
+ var magnitude = Math.min(Math.floor(Math.log(n) / Math.log(1024)), 5);
912
+ var unit = ["B",
913
+ "KB",
914
+ "MB",
915
+ "GB",
916
+ "TB",
917
+ "PB"][magnitude];
918
+ var decimalPlaces = magnitude ? precision : 0;
919
+ return decimalRound(n / (Math.pow(1024, magnitude)), decimalPlaces).toFixed(decimalPlaces) + unit;
608
920
  }
921
+
922
+ /**
923
+ * Converts a path to crumbs.
924
+ * For example:
925
+ * "a.b[0].c" -> ["a", "b", "0", "c"]
926
+ */
609
927
  function crumblePath(path) {
610
- return typeof path === "string" ? path.match(/[^.[\]]+/g) || [] : [].concat(path);
928
+ return typeof path === "string" ? path.match(/[^.[\]]+/g) || [] : [].concat(path);
611
929
  }
930
+
931
+ /**
932
+ * Copy a property from one object to another using its property descriptor.
933
+ * In other words, if it's a getter/setter on `sourceObject` it'll be the same
934
+ * getter/setter on `destObject`. If it's just a value it'll be just a value.
935
+ */
612
936
  function copyProperty(propName, sourceObject, destObject) {
613
- Object.defineProperty(destObject, propName, Object.getOwnPropertyDescriptor(sourceObject, propName));
937
+ Object.defineProperty(destObject, propName, Object.getOwnPropertyDescriptor(sourceObject, propName));
614
938
  }
615
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
616
- var objectTag = "[object Object]";
939
+
940
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
941
+
942
+ /**
943
+ * lodash (Custom Build) <https://lodash.com/>
944
+ * Build: `lodash modularize exports="npm" -o ./`
945
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
946
+ * Released under MIT license <https://lodash.com/license>
947
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
948
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
949
+ */
950
+
951
+ /** `Object#toString` result references. */
952
+ var objectTag = '[object Object]';
953
+
954
+ /**
955
+ * Checks if `value` is a host object in IE < 9.
956
+ *
957
+ * @private
958
+ * @param {*} value The value to check.
959
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
960
+ */
617
961
  function isHostObject(value) {
962
+ // Many host objects are `Object` objects that can coerce to strings
963
+ // despite having improperly defined `toString` methods.
618
964
  var result = false;
619
- if (value != null && typeof value.toString != "function") {
965
+ if (value != null && typeof value.toString != 'function') {
620
966
  try {
621
- result = !!(value + "");
622
- } catch (e) {
623
- }
967
+ result = !!(value + '');
968
+ } catch (e) {}
624
969
  }
625
970
  return result;
626
971
  }
972
+
973
+ /**
974
+ * Creates a unary function that invokes `func` with its argument transformed.
975
+ *
976
+ * @private
977
+ * @param {Function} func The function to wrap.
978
+ * @param {Function} transform The argument transform.
979
+ * @returns {Function} Returns the new function.
980
+ */
627
981
  function overArg(func, transform) {
628
982
  return function(arg) {
629
983
  return func(transform(arg));
630
984
  };
631
985
  }
632
- var funcProto = Function.prototype, objectProto = Object.prototype;
986
+
987
+ /** Used for built-in method references. */
988
+ var funcProto = Function.prototype,
989
+ objectProto = Object.prototype;
990
+
991
+ /** Used to resolve the decompiled source of functions. */
633
992
  var funcToString = funcProto.toString;
993
+
994
+ /** Used to check objects for own properties. */
634
995
  var hasOwnProperty = objectProto.hasOwnProperty;
996
+
997
+ /** Used to infer the `Object` constructor. */
635
998
  var objectCtorString = funcToString.call(Object);
999
+
1000
+ /**
1001
+ * Used to resolve the
1002
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1003
+ * of values.
1004
+ */
636
1005
  var objectToString = objectProto.toString;
1006
+
1007
+ /** Built-in value references. */
637
1008
  var getPrototype = overArg(Object.getPrototypeOf, Object);
1009
+
1010
+ /**
1011
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1012
+ * and has a `typeof` result of "object".
1013
+ *
1014
+ * @static
1015
+ * @memberOf _
1016
+ * @since 4.0.0
1017
+ * @category Lang
1018
+ * @param {*} value The value to check.
1019
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1020
+ * @example
1021
+ *
1022
+ * _.isObjectLike({});
1023
+ * // => true
1024
+ *
1025
+ * _.isObjectLike([1, 2, 3]);
1026
+ * // => true
1027
+ *
1028
+ * _.isObjectLike(_.noop);
1029
+ * // => false
1030
+ *
1031
+ * _.isObjectLike(null);
1032
+ * // => false
1033
+ */
638
1034
  function isObjectLike(value) {
639
- return !!value && typeof value == "object";
1035
+ return !!value && typeof value == 'object';
640
1036
  }
1037
+
1038
+ /**
1039
+ * Checks if `value` is a plain object, that is, an object created by the
1040
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
1041
+ *
1042
+ * @static
1043
+ * @memberOf _
1044
+ * @since 0.8.0
1045
+ * @category Lang
1046
+ * @param {*} value The value to check.
1047
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
1048
+ * @example
1049
+ *
1050
+ * function Foo() {
1051
+ * this.a = 1;
1052
+ * }
1053
+ *
1054
+ * _.isPlainObject(new Foo);
1055
+ * // => false
1056
+ *
1057
+ * _.isPlainObject([1, 2, 3]);
1058
+ * // => false
1059
+ *
1060
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
1061
+ * // => true
1062
+ *
1063
+ * _.isPlainObject(Object.create(null));
1064
+ * // => true
1065
+ */
641
1066
  function isPlainObject(value) {
642
- if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) {
1067
+ if (!isObjectLike(value) ||
1068
+ objectToString.call(value) != objectTag || isHostObject(value)) {
643
1069
  return false;
644
1070
  }
645
1071
  var proto = getPrototype(value);
646
1072
  if (proto === null) {
647
1073
  return true;
648
1074
  }
649
- var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
650
- return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
1075
+ var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
1076
+ return (typeof Ctor == 'function' &&
1077
+ Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
651
1078
  }
1079
+
652
1080
  var lodash_isplainobject = isPlainObject;
1081
+
1082
+ var __values$a = (undefined && undefined.__values) || function(o) {
1083
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1084
+ if (m) return m.call(o);
1085
+ if (o && typeof o.length === "number") return {
1086
+ next: function () {
1087
+ if (o && i >= o.length) o = void 0;
1088
+ return { value: o && o[i++], done: !o };
1089
+ }
1090
+ };
1091
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1092
+ };
1093
+ /*
1094
+ * Recursive Object.freeze on plain objects and arrays
1095
+ */
653
1096
  function deepFreeze(obj) {
654
- Object.freeze(obj);
655
- for (const key of Object.keys(obj)) {
656
- const val = obj[key];
657
- if (lodash_isplainobject(val) || Array.isArray(val)) {
658
- deepFreeze(val);
1097
+ var e_1, _a;
1098
+ Object.freeze(obj);
1099
+ try {
1100
+ for (var _b = __values$a(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
1101
+ var key = _c.value;
1102
+ var val = obj[key];
1103
+ if (lodash_isplainobject(val) || Array.isArray(val)) {
1104
+ deepFreeze(val);
1105
+ }
1106
+ }
1107
+ }
1108
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1109
+ finally {
1110
+ try {
1111
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1112
+ }
1113
+ finally { if (e_1) throw e_1.error; }
659
1114
  }
660
- }
661
1115
  }
1116
+
1117
+ var __read$3 = (undefined && undefined.__read) || function (o, n) {
1118
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
1119
+ if (!m) return o;
1120
+ var i = m.call(o), r, ar = [], e;
1121
+ try {
1122
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
1123
+ }
1124
+ catch (error) { e = { error: error }; }
1125
+ finally {
1126
+ try {
1127
+ if (r && !r.done && (m = i["return"])) m.call(i);
1128
+ }
1129
+ finally { if (e) throw e.error; }
1130
+ }
1131
+ return ar;
1132
+ };
1133
+ var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
1134
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
1135
+ if (ar || !(i in from)) {
1136
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
1137
+ ar[i] = from[i];
1138
+ }
1139
+ }
1140
+ return to.concat(ar || Array.prototype.slice.call(from));
1141
+ };
1142
+ var __values$9 = (undefined && undefined.__values) || function(o) {
1143
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1144
+ if (m) return m.call(o);
1145
+ if (o && typeof o.length === "number") return {
1146
+ next: function () {
1147
+ if (o && i >= o.length) o = void 0;
1148
+ return { value: o && o[i++], done: !o };
1149
+ }
1150
+ };
1151
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1152
+ };
662
1153
  var DiffChange;
663
- (function(DiffChange2) {
664
- DiffChange2[DiffChange2["ADDITION"] = 0] = "ADDITION";
665
- DiffChange2[DiffChange2["DELETION"] = 1] = "DELETION";
666
- DiffChange2[DiffChange2["ALTERATION"] = 2] = "ALTERATION";
1154
+ (function (DiffChange) {
1155
+ DiffChange[DiffChange["ADDITION"] = 0] = "ADDITION";
1156
+ DiffChange[DiffChange["DELETION"] = 1] = "DELETION";
1157
+ DiffChange[DiffChange["ALTERATION"] = 2] = "ALTERATION";
667
1158
  })(DiffChange || (DiffChange = {}));
668
- function diff(o1, o2, parentPath = []) {
669
- let d = [];
670
- for (const key of new Set([...Object.keys(o1), ...Object.keys(o2)])) {
671
- const o1HasKey = Object.prototype.hasOwnProperty.call(o1, key);
672
- const o2HasKey = Object.prototype.hasOwnProperty.call(o2, key);
673
- if (o1HasKey && !o2HasKey) {
674
- d.push({
675
- type: 1,
676
- key,
677
- parentPath,
678
- objects: [o1, o2]
679
- });
680
- } else if (!o1HasKey && o2HasKey) {
681
- d.push({
682
- type: 0,
683
- key,
684
- parentPath,
685
- objects: [o1, o2]
686
- });
687
- } else if (lodash_isplainobject(o1[key]) && lodash_isplainobject(o2[key]) || Array.isArray(o1[key]) && Array.isArray(o2[key])) {
688
- d = d.concat(diff(o1[key], o2[key], [...parentPath, key]));
689
- } else if (o1[key] !== o2[key]) {
690
- d.push({
691
- type: 2,
692
- key,
693
- parentPath,
694
- objects: [o1, o2]
695
- });
1159
+ function diff(o1, o2, parentPath) {
1160
+ var e_1, _a;
1161
+ if (parentPath === void 0) { parentPath = []; }
1162
+ var d = [];
1163
+ try {
1164
+ for (var _b = __values$9(new Set(__spreadArray$1(__spreadArray$1([], __read$3(Object.keys(o1)), false), __read$3(Object.keys(o2)), false))), _c = _b.next(); !_c.done; _c = _b.next()) {
1165
+ var key = _c.value;
1166
+ var o1HasKey = Object.prototype.hasOwnProperty.call(o1, key);
1167
+ var o2HasKey = Object.prototype.hasOwnProperty.call(o2, key);
1168
+ if (o1HasKey && !o2HasKey) {
1169
+ d.push({
1170
+ type: DiffChange.DELETION,
1171
+ key: key,
1172
+ parentPath: parentPath,
1173
+ objects: [o1, o2],
1174
+ });
1175
+ }
1176
+ else if (!o1HasKey && o2HasKey) {
1177
+ d.push({
1178
+ type: DiffChange.ADDITION,
1179
+ key: key,
1180
+ parentPath: parentPath,
1181
+ objects: [o1, o2],
1182
+ });
1183
+ }
1184
+ else if ((lodash_isplainobject(o1[key]) && lodash_isplainobject(o2[key]))
1185
+ || (Array.isArray(o1[key]) && Array.isArray(o2[key]))) {
1186
+ d = d.concat(diff(o1[key], o2[key], __spreadArray$1(__spreadArray$1([], __read$3(parentPath), false), [key], false)));
1187
+ }
1188
+ else if (o1[key] !== o2[key]) {
1189
+ d.push({
1190
+ type: DiffChange.ALTERATION,
1191
+ key: key,
1192
+ parentPath: parentPath,
1193
+ objects: [o1, o2],
1194
+ });
1195
+ }
1196
+ }
696
1197
  }
697
- }
698
- return d;
1198
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1199
+ finally {
1200
+ try {
1201
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1202
+ }
1203
+ finally { if (e_1) throw e_1.error; }
1204
+ }
1205
+ return d;
699
1206
  }
1207
+
1208
+ var __values$8 = (undefined && undefined.__values) || function(o) {
1209
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1210
+ if (m) return m.call(o);
1211
+ if (o && typeof o.length === "number") return {
1212
+ next: function () {
1213
+ if (o && i >= o.length) o = void 0;
1214
+ return { value: o && o[i++], done: !o };
1215
+ }
1216
+ };
1217
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1218
+ };
1219
+ /**
1220
+ * Recursively navigate a nested object & call `fn` for each key/value pair
1221
+ */
700
1222
  function forEachEntryDeep(object, fn) {
701
- for (const key of Object.keys(object)) {
702
- const value = object[key];
703
- if (lodash_isplainobject(value) || Array.isArray(value)) {
704
- forEachEntryDeep(value, fn);
705
- } else {
706
- fn(key, value, object);
1223
+ var e_1, _a;
1224
+ try {
1225
+ for (var _b = __values$8(Object.keys(object)), _c = _b.next(); !_c.done; _c = _b.next()) {
1226
+ var key = _c.value;
1227
+ var value = object[key];
1228
+ if (lodash_isplainobject(value) || Array.isArray(value)) {
1229
+ forEachEntryDeep(value, fn);
1230
+ }
1231
+ else {
1232
+ fn(key, value, object);
1233
+ }
1234
+ }
1235
+ }
1236
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1237
+ finally {
1238
+ try {
1239
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1240
+ }
1241
+ finally { if (e_1) throw e_1.error; }
707
1242
  }
708
- }
709
1243
  }
710
- function forEachNestedObject(object, fn, path = []) {
711
- fn(path, object);
712
- for (const key of Object.keys(object)) {
713
- const value = object[key];
714
- if (lodash_isplainobject(value) || Array.isArray(value)) {
715
- const newPath = path.concat(key);
716
- forEachNestedObject(value, fn, newPath);
1244
+
1245
+ var __values$7 = (undefined && undefined.__values) || function(o) {
1246
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1247
+ if (m) return m.call(o);
1248
+ if (o && typeof o.length === "number") return {
1249
+ next: function () {
1250
+ if (o && i >= o.length) o = void 0;
1251
+ return { value: o && o[i++], done: !o };
1252
+ }
1253
+ };
1254
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1255
+ };
1256
+ /**
1257
+ * Recursively navigate a nested object & call `fn` for each subobject
1258
+ */
1259
+ function forEachNestedObject(object, fn, path) {
1260
+ var e_1, _a;
1261
+ if (path === void 0) { path = []; }
1262
+ fn(path, object);
1263
+ try {
1264
+ for (var _b = __values$7(Object.keys(object)), _c = _b.next(); !_c.done; _c = _b.next()) {
1265
+ var key = _c.value;
1266
+ var value = object[key];
1267
+ if (lodash_isplainobject(value) || Array.isArray(value)) {
1268
+ var newPath = path.concat(key);
1269
+ forEachNestedObject(value, fn, newPath);
1270
+ }
1271
+ }
1272
+ }
1273
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1274
+ finally {
1275
+ try {
1276
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1277
+ }
1278
+ finally { if (e_1) throw e_1.error; }
717
1279
  }
718
- }
719
1280
  }
1281
+
1282
+ /**
1283
+ * lodash 4.0.0 (Custom Build) <https://lodash.com/>
1284
+ * Build: `lodash modularize exports="npm" -o ./`
1285
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
1286
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1287
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1288
+ * Available under MIT license <https://lodash.com/license>
1289
+ */
1290
+
1291
+ /**
1292
+ * Checks if `value` is `null` or `undefined`.
1293
+ *
1294
+ * @static
1295
+ * @memberOf _
1296
+ * @category Lang
1297
+ * @param {*} value The value to check.
1298
+ * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
1299
+ * @example
1300
+ *
1301
+ * _.isNil(null);
1302
+ * // => true
1303
+ *
1304
+ * _.isNil(void 0);
1305
+ * // => true
1306
+ *
1307
+ * _.isNil(NaN);
1308
+ * // => false
1309
+ */
720
1310
  function isNil$1(value) {
721
1311
  return value == null;
722
1312
  }
1313
+
723
1314
  var lodash_isnil = isNil$1;
724
- var isNilImport = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ _mergeNamespaces({
725
- __proto__: null,
726
- [Symbol.toStringTag]: "Module",
727
- "default": lodash_isnil
1315
+
1316
+ var isNilImport = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({
1317
+ __proto__: null,
1318
+ 'default': lodash_isnil
728
1319
  }, [lodash_isnil]));
729
- var lodash_isempty$1 = { exports: {} };
730
- (function(module, exports) {
731
- var MAX_SAFE_INTEGER = 9007199254740991;
732
- var argsTag = "[object Arguments]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", objectTag2 = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]";
733
- var dataViewTag = "[object DataView]";
734
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
735
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
736
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
737
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
738
- var root = freeGlobal || freeSelf || Function("return this")();
739
- var freeExports = exports && !exports.nodeType && exports;
740
- var freeModule = freeExports && true && module && !module.nodeType && module;
741
- var moduleExports = freeModule && freeModule.exports === freeExports;
742
- function getValue(object, key) {
743
- return object == null ? void 0 : object[key];
1320
+
1321
+ var lodash_isempty$1 = {exports: {}};
1322
+
1323
+ /**
1324
+ * lodash (Custom Build) <https://lodash.com/>
1325
+ * Build: `lodash modularize exports="npm" -o ./`
1326
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
1327
+ * Released under MIT license <https://lodash.com/license>
1328
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1329
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1330
+ */
1331
+
1332
+ (function (module, exports) {
1333
+ /** Used as references for various `Number` constants. */
1334
+ var MAX_SAFE_INTEGER = 9007199254740991;
1335
+
1336
+ /** `Object#toString` result references. */
1337
+ var argsTag = '[object Arguments]',
1338
+ funcTag = '[object Function]',
1339
+ genTag = '[object GeneratorFunction]',
1340
+ mapTag = '[object Map]',
1341
+ objectTag = '[object Object]',
1342
+ promiseTag = '[object Promise]',
1343
+ setTag = '[object Set]',
1344
+ weakMapTag = '[object WeakMap]';
1345
+
1346
+ var dataViewTag = '[object DataView]';
1347
+
1348
+ /**
1349
+ * Used to match `RegExp`
1350
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
1351
+ */
1352
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1353
+
1354
+ /** Used to detect host constructors (Safari). */
1355
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
1356
+
1357
+ /** Detect free variable `global` from Node.js. */
1358
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
1359
+
1360
+ /** Detect free variable `self`. */
1361
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
1362
+
1363
+ /** Used as a reference to the global object. */
1364
+ var root = freeGlobal || freeSelf || Function('return this')();
1365
+
1366
+ /** Detect free variable `exports`. */
1367
+ var freeExports = exports && !exports.nodeType && exports;
1368
+
1369
+ /** Detect free variable `module`. */
1370
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
1371
+
1372
+ /** Detect the popular CommonJS extension `module.exports`. */
1373
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1374
+
1375
+ /**
1376
+ * Gets the value at `key` of `object`.
1377
+ *
1378
+ * @private
1379
+ * @param {Object} [object] The object to query.
1380
+ * @param {string} key The key of the property to get.
1381
+ * @returns {*} Returns the property value.
1382
+ */
1383
+ function getValue(object, key) {
1384
+ return object == null ? undefined : object[key];
1385
+ }
1386
+
1387
+ /**
1388
+ * Checks if `value` is a host object in IE < 9.
1389
+ *
1390
+ * @private
1391
+ * @param {*} value The value to check.
1392
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
1393
+ */
1394
+ function isHostObject(value) {
1395
+ // Many host objects are `Object` objects that can coerce to strings
1396
+ // despite having improperly defined `toString` methods.
1397
+ var result = false;
1398
+ if (value != null && typeof value.toString != 'function') {
1399
+ try {
1400
+ result = !!(value + '');
1401
+ } catch (e) {}
744
1402
  }
745
- function isHostObject2(value) {
746
- var result = false;
747
- if (value != null && typeof value.toString != "function") {
748
- try {
749
- result = !!(value + "");
750
- } catch (e) {
1403
+ return result;
1404
+ }
1405
+
1406
+ /**
1407
+ * Creates a unary function that invokes `func` with its argument transformed.
1408
+ *
1409
+ * @private
1410
+ * @param {Function} func The function to wrap.
1411
+ * @param {Function} transform The argument transform.
1412
+ * @returns {Function} Returns the new function.
1413
+ */
1414
+ function overArg(func, transform) {
1415
+ return function(arg) {
1416
+ return func(transform(arg));
1417
+ };
1418
+ }
1419
+
1420
+ /** Used for built-in method references. */
1421
+ var funcProto = Function.prototype,
1422
+ objectProto = Object.prototype;
1423
+
1424
+ /** Used to detect overreaching core-js shims. */
1425
+ var coreJsData = root['__core-js_shared__'];
1426
+
1427
+ /** Used to detect methods masquerading as native. */
1428
+ var maskSrcKey = (function() {
1429
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
1430
+ return uid ? ('Symbol(src)_1.' + uid) : '';
1431
+ }());
1432
+
1433
+ /** Used to resolve the decompiled source of functions. */
1434
+ var funcToString = funcProto.toString;
1435
+
1436
+ /** Used to check objects for own properties. */
1437
+ var hasOwnProperty = objectProto.hasOwnProperty;
1438
+
1439
+ /**
1440
+ * Used to resolve the
1441
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1442
+ * of values.
1443
+ */
1444
+ var objectToString = objectProto.toString;
1445
+
1446
+ /** Used to detect if a method is native. */
1447
+ var reIsNative = RegExp('^' +
1448
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
1449
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
1450
+ );
1451
+
1452
+ /** Built-in value references. */
1453
+ var Buffer = moduleExports ? root.Buffer : undefined,
1454
+ propertyIsEnumerable = objectProto.propertyIsEnumerable;
1455
+
1456
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1457
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
1458
+ nativeKeys = overArg(Object.keys, Object);
1459
+
1460
+ /* Built-in method references that are verified to be native. */
1461
+ var DataView = getNative(root, 'DataView'),
1462
+ Map = getNative(root, 'Map'),
1463
+ Promise = getNative(root, 'Promise'),
1464
+ Set = getNative(root, 'Set'),
1465
+ WeakMap = getNative(root, 'WeakMap');
1466
+
1467
+ /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
1468
+ var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
1469
+
1470
+ /** Used to detect maps, sets, and weakmaps. */
1471
+ var dataViewCtorString = toSource(DataView),
1472
+ mapCtorString = toSource(Map),
1473
+ promiseCtorString = toSource(Promise),
1474
+ setCtorString = toSource(Set),
1475
+ weakMapCtorString = toSource(WeakMap);
1476
+
1477
+ /**
1478
+ * The base implementation of `getTag`.
1479
+ *
1480
+ * @private
1481
+ * @param {*} value The value to query.
1482
+ * @returns {string} Returns the `toStringTag`.
1483
+ */
1484
+ function baseGetTag(value) {
1485
+ return objectToString.call(value);
1486
+ }
1487
+
1488
+ /**
1489
+ * The base implementation of `_.isNative` without bad shim checks.
1490
+ *
1491
+ * @private
1492
+ * @param {*} value The value to check.
1493
+ * @returns {boolean} Returns `true` if `value` is a native function,
1494
+ * else `false`.
1495
+ */
1496
+ function baseIsNative(value) {
1497
+ if (!isObject(value) || isMasked(value)) {
1498
+ return false;
1499
+ }
1500
+ var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
1501
+ return pattern.test(toSource(value));
1502
+ }
1503
+
1504
+ /**
1505
+ * Gets the native function at `key` of `object`.
1506
+ *
1507
+ * @private
1508
+ * @param {Object} object The object to query.
1509
+ * @param {string} key The key of the method to get.
1510
+ * @returns {*} Returns the function if it's native, else `undefined`.
1511
+ */
1512
+ function getNative(object, key) {
1513
+ var value = getValue(object, key);
1514
+ return baseIsNative(value) ? value : undefined;
1515
+ }
1516
+
1517
+ /**
1518
+ * Gets the `toStringTag` of `value`.
1519
+ *
1520
+ * @private
1521
+ * @param {*} value The value to query.
1522
+ * @returns {string} Returns the `toStringTag`.
1523
+ */
1524
+ var getTag = baseGetTag;
1525
+
1526
+ // Fallback for data views, maps, sets, and weak maps in IE 11,
1527
+ // for data views in Edge < 14, and promises in Node.js.
1528
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
1529
+ (Map && getTag(new Map) != mapTag) ||
1530
+ (Promise && getTag(Promise.resolve()) != promiseTag) ||
1531
+ (Set && getTag(new Set) != setTag) ||
1532
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
1533
+ getTag = function(value) {
1534
+ var result = objectToString.call(value),
1535
+ Ctor = result == objectTag ? value.constructor : undefined,
1536
+ ctorString = Ctor ? toSource(Ctor) : undefined;
1537
+
1538
+ if (ctorString) {
1539
+ switch (ctorString) {
1540
+ case dataViewCtorString: return dataViewTag;
1541
+ case mapCtorString: return mapTag;
1542
+ case promiseCtorString: return promiseTag;
1543
+ case setCtorString: return setTag;
1544
+ case weakMapCtorString: return weakMapTag;
751
1545
  }
752
1546
  }
753
1547
  return result;
1548
+ };
1549
+ }
1550
+
1551
+ /**
1552
+ * Checks if `func` has its source masked.
1553
+ *
1554
+ * @private
1555
+ * @param {Function} func The function to check.
1556
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1557
+ */
1558
+ function isMasked(func) {
1559
+ return !!maskSrcKey && (maskSrcKey in func);
1560
+ }
1561
+
1562
+ /**
1563
+ * Checks if `value` is likely a prototype object.
1564
+ *
1565
+ * @private
1566
+ * @param {*} value The value to check.
1567
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1568
+ */
1569
+ function isPrototype(value) {
1570
+ var Ctor = value && value.constructor,
1571
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
1572
+
1573
+ return value === proto;
1574
+ }
1575
+
1576
+ /**
1577
+ * Converts `func` to its source code.
1578
+ *
1579
+ * @private
1580
+ * @param {Function} func The function to process.
1581
+ * @returns {string} Returns the source code.
1582
+ */
1583
+ function toSource(func) {
1584
+ if (func != null) {
1585
+ try {
1586
+ return funcToString.call(func);
1587
+ } catch (e) {}
1588
+ try {
1589
+ return (func + '');
1590
+ } catch (e) {}
754
1591
  }
755
- function overArg2(func, transform) {
756
- return function(arg) {
757
- return func(transform(arg));
758
- };
1592
+ return '';
1593
+ }
1594
+
1595
+ /**
1596
+ * Checks if `value` is likely an `arguments` object.
1597
+ *
1598
+ * @static
1599
+ * @memberOf _
1600
+ * @since 0.1.0
1601
+ * @category Lang
1602
+ * @param {*} value The value to check.
1603
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1604
+ * else `false`.
1605
+ * @example
1606
+ *
1607
+ * _.isArguments(function() { return arguments; }());
1608
+ * // => true
1609
+ *
1610
+ * _.isArguments([1, 2, 3]);
1611
+ * // => false
1612
+ */
1613
+ function isArguments(value) {
1614
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
1615
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
1616
+ (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
1617
+ }
1618
+
1619
+ /**
1620
+ * Checks if `value` is classified as an `Array` object.
1621
+ *
1622
+ * @static
1623
+ * @memberOf _
1624
+ * @since 0.1.0
1625
+ * @category Lang
1626
+ * @param {*} value The value to check.
1627
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1628
+ * @example
1629
+ *
1630
+ * _.isArray([1, 2, 3]);
1631
+ * // => true
1632
+ *
1633
+ * _.isArray(document.body.children);
1634
+ * // => false
1635
+ *
1636
+ * _.isArray('abc');
1637
+ * // => false
1638
+ *
1639
+ * _.isArray(_.noop);
1640
+ * // => false
1641
+ */
1642
+ var isArray = Array.isArray;
1643
+
1644
+ /**
1645
+ * Checks if `value` is array-like. A value is considered array-like if it's
1646
+ * not a function and has a `value.length` that's an integer greater than or
1647
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1648
+ *
1649
+ * @static
1650
+ * @memberOf _
1651
+ * @since 4.0.0
1652
+ * @category Lang
1653
+ * @param {*} value The value to check.
1654
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1655
+ * @example
1656
+ *
1657
+ * _.isArrayLike([1, 2, 3]);
1658
+ * // => true
1659
+ *
1660
+ * _.isArrayLike(document.body.children);
1661
+ * // => true
1662
+ *
1663
+ * _.isArrayLike('abc');
1664
+ * // => true
1665
+ *
1666
+ * _.isArrayLike(_.noop);
1667
+ * // => false
1668
+ */
1669
+ function isArrayLike(value) {
1670
+ return value != null && isLength(value.length) && !isFunction(value);
1671
+ }
1672
+
1673
+ /**
1674
+ * This method is like `_.isArrayLike` except that it also checks if `value`
1675
+ * is an object.
1676
+ *
1677
+ * @static
1678
+ * @memberOf _
1679
+ * @since 4.0.0
1680
+ * @category Lang
1681
+ * @param {*} value The value to check.
1682
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
1683
+ * else `false`.
1684
+ * @example
1685
+ *
1686
+ * _.isArrayLikeObject([1, 2, 3]);
1687
+ * // => true
1688
+ *
1689
+ * _.isArrayLikeObject(document.body.children);
1690
+ * // => true
1691
+ *
1692
+ * _.isArrayLikeObject('abc');
1693
+ * // => false
1694
+ *
1695
+ * _.isArrayLikeObject(_.noop);
1696
+ * // => false
1697
+ */
1698
+ function isArrayLikeObject(value) {
1699
+ return isObjectLike(value) && isArrayLike(value);
1700
+ }
1701
+
1702
+ /**
1703
+ * Checks if `value` is a buffer.
1704
+ *
1705
+ * @static
1706
+ * @memberOf _
1707
+ * @since 4.3.0
1708
+ * @category Lang
1709
+ * @param {*} value The value to check.
1710
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1711
+ * @example
1712
+ *
1713
+ * _.isBuffer(new Buffer(2));
1714
+ * // => true
1715
+ *
1716
+ * _.isBuffer(new Uint8Array(2));
1717
+ * // => false
1718
+ */
1719
+ var isBuffer = nativeIsBuffer || stubFalse;
1720
+
1721
+ /**
1722
+ * Checks if `value` is an empty object, collection, map, or set.
1723
+ *
1724
+ * Objects are considered empty if they have no own enumerable string keyed
1725
+ * properties.
1726
+ *
1727
+ * Array-like values such as `arguments` objects, arrays, buffers, strings, or
1728
+ * jQuery-like collections are considered empty if they have a `length` of `0`.
1729
+ * Similarly, maps and sets are considered empty if they have a `size` of `0`.
1730
+ *
1731
+ * @static
1732
+ * @memberOf _
1733
+ * @since 0.1.0
1734
+ * @category Lang
1735
+ * @param {*} value The value to check.
1736
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
1737
+ * @example
1738
+ *
1739
+ * _.isEmpty(null);
1740
+ * // => true
1741
+ *
1742
+ * _.isEmpty(true);
1743
+ * // => true
1744
+ *
1745
+ * _.isEmpty(1);
1746
+ * // => true
1747
+ *
1748
+ * _.isEmpty([1, 2, 3]);
1749
+ * // => false
1750
+ *
1751
+ * _.isEmpty({ 'a': 1 });
1752
+ * // => false
1753
+ */
1754
+ function isEmpty(value) {
1755
+ if (isArrayLike(value) &&
1756
+ (isArray(value) || typeof value == 'string' ||
1757
+ typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) {
1758
+ return !value.length;
759
1759
  }
760
- var funcProto2 = Function.prototype, objectProto2 = Object.prototype;
761
- var coreJsData = root["__core-js_shared__"];
762
- var maskSrcKey = function() {
763
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
764
- return uid ? "Symbol(src)_1." + uid : "";
765
- }();
766
- var funcToString2 = funcProto2.toString;
767
- var hasOwnProperty2 = objectProto2.hasOwnProperty;
768
- var objectToString2 = objectProto2.toString;
769
- var reIsNative = RegExp("^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
770
- var Buffer2 = moduleExports ? root.Buffer : void 0, propertyIsEnumerable = objectProto2.propertyIsEnumerable;
771
- var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0, nativeKeys = overArg2(Object.keys, Object);
772
- var DataView = getNative(root, "DataView"), Map = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set2 = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap");
773
- var nonEnumShadows = !propertyIsEnumerable.call({ "valueOf": 1 }, "valueOf");
774
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap);
775
- function baseGetTag(value) {
776
- return objectToString2.call(value);
1760
+ var tag = getTag(value);
1761
+ if (tag == mapTag || tag == setTag) {
1762
+ return !value.size;
777
1763
  }
778
- function baseIsNative(value) {
779
- if (!isObject(value) || isMasked(value)) {
1764
+ if (nonEnumShadows || isPrototype(value)) {
1765
+ return !nativeKeys(value).length;
1766
+ }
1767
+ for (var key in value) {
1768
+ if (hasOwnProperty.call(value, key)) {
780
1769
  return false;
781
1770
  }
782
- var pattern = isFunction(value) || isHostObject2(value) ? reIsNative : reIsHostCtor;
783
- return pattern.test(toSource(value));
784
- }
785
- function getNative(object, key) {
786
- var value = getValue(object, key);
787
- return baseIsNative(value) ? value : void 0;
788
1771
  }
789
- var getTag = baseGetTag;
790
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
791
- getTag = function(value) {
792
- var result = objectToString2.call(value), Ctor = result == objectTag2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
793
- if (ctorString) {
794
- switch (ctorString) {
795
- case dataViewCtorString:
796
- return dataViewTag;
797
- case mapCtorString:
798
- return mapTag;
799
- case promiseCtorString:
800
- return promiseTag;
801
- case setCtorString:
802
- return setTag;
803
- case weakMapCtorString:
804
- return weakMapTag;
1772
+ return true;
1773
+ }
1774
+
1775
+ /**
1776
+ * Checks if `value` is classified as a `Function` object.
1777
+ *
1778
+ * @static
1779
+ * @memberOf _
1780
+ * @since 0.1.0
1781
+ * @category Lang
1782
+ * @param {*} value The value to check.
1783
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1784
+ * @example
1785
+ *
1786
+ * _.isFunction(_);
1787
+ * // => true
1788
+ *
1789
+ * _.isFunction(/abc/);
1790
+ * // => false
1791
+ */
1792
+ function isFunction(value) {
1793
+ // The use of `Object#toString` avoids issues with the `typeof` operator
1794
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
1795
+ var tag = isObject(value) ? objectToString.call(value) : '';
1796
+ return tag == funcTag || tag == genTag;
1797
+ }
1798
+
1799
+ /**
1800
+ * Checks if `value` is a valid array-like length.
1801
+ *
1802
+ * **Note:** This method is loosely based on
1803
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1804
+ *
1805
+ * @static
1806
+ * @memberOf _
1807
+ * @since 4.0.0
1808
+ * @category Lang
1809
+ * @param {*} value The value to check.
1810
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1811
+ * @example
1812
+ *
1813
+ * _.isLength(3);
1814
+ * // => true
1815
+ *
1816
+ * _.isLength(Number.MIN_VALUE);
1817
+ * // => false
1818
+ *
1819
+ * _.isLength(Infinity);
1820
+ * // => false
1821
+ *
1822
+ * _.isLength('3');
1823
+ * // => false
1824
+ */
1825
+ function isLength(value) {
1826
+ return typeof value == 'number' &&
1827
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1828
+ }
1829
+
1830
+ /**
1831
+ * Checks if `value` is the
1832
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1833
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1834
+ *
1835
+ * @static
1836
+ * @memberOf _
1837
+ * @since 0.1.0
1838
+ * @category Lang
1839
+ * @param {*} value The value to check.
1840
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1841
+ * @example
1842
+ *
1843
+ * _.isObject({});
1844
+ * // => true
1845
+ *
1846
+ * _.isObject([1, 2, 3]);
1847
+ * // => true
1848
+ *
1849
+ * _.isObject(_.noop);
1850
+ * // => true
1851
+ *
1852
+ * _.isObject(null);
1853
+ * // => false
1854
+ */
1855
+ function isObject(value) {
1856
+ var type = typeof value;
1857
+ return !!value && (type == 'object' || type == 'function');
1858
+ }
1859
+
1860
+ /**
1861
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1862
+ * and has a `typeof` result of "object".
1863
+ *
1864
+ * @static
1865
+ * @memberOf _
1866
+ * @since 4.0.0
1867
+ * @category Lang
1868
+ * @param {*} value The value to check.
1869
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1870
+ * @example
1871
+ *
1872
+ * _.isObjectLike({});
1873
+ * // => true
1874
+ *
1875
+ * _.isObjectLike([1, 2, 3]);
1876
+ * // => true
1877
+ *
1878
+ * _.isObjectLike(_.noop);
1879
+ * // => false
1880
+ *
1881
+ * _.isObjectLike(null);
1882
+ * // => false
1883
+ */
1884
+ function isObjectLike(value) {
1885
+ return !!value && typeof value == 'object';
1886
+ }
1887
+
1888
+ /**
1889
+ * This method returns `false`.
1890
+ *
1891
+ * @static
1892
+ * @memberOf _
1893
+ * @since 4.13.0
1894
+ * @category Util
1895
+ * @returns {boolean} Returns `false`.
1896
+ * @example
1897
+ *
1898
+ * _.times(2, _.stubFalse);
1899
+ * // => [false, false]
1900
+ */
1901
+ function stubFalse() {
1902
+ return false;
1903
+ }
1904
+
1905
+ module.exports = isEmpty;
1906
+ }(lodash_isempty$1, lodash_isempty$1.exports));
1907
+
1908
+ var lodash_isempty = lodash_isempty$1.exports;
1909
+
1910
+ var isEmptyImport = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({
1911
+ __proto__: null,
1912
+ 'default': lodash_isempty
1913
+ }, [lodash_isempty$1.exports]));
1914
+
1915
+ var __values$6 = (undefined && undefined.__values) || function(o) {
1916
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1917
+ if (m) return m.call(o);
1918
+ if (o && typeof o.length === "number") return {
1919
+ next: function () {
1920
+ if (o && i >= o.length) o = void 0;
1921
+ return { value: o && o[i++], done: !o };
805
1922
  }
806
- }
807
- return result;
808
1923
  };
809
- }
810
- function isMasked(func) {
811
- return !!maskSrcKey && maskSrcKey in func;
812
- }
813
- function isPrototype(value) {
814
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto2;
815
- return value === proto;
816
- }
817
- function toSource(func) {
818
- if (func != null) {
819
- try {
820
- return funcToString2.call(func);
821
- } catch (e) {
822
- }
823
- try {
824
- return func + "";
825
- } catch (e) {
826
- }
1924
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1925
+ };
1926
+ var __read$2 = (undefined && undefined.__read) || function (o, n) {
1927
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
1928
+ if (!m) return o;
1929
+ var i = m.call(o), r, ar = [], e;
1930
+ try {
1931
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
827
1932
  }
828
- return "";
829
- }
830
- function isArguments(value) {
831
- return isArrayLikeObject(value) && hasOwnProperty2.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString2.call(value) == argsTag);
832
- }
833
- var isArray = Array.isArray;
834
- function isArrayLike(value) {
835
- return value != null && isLength(value.length) && !isFunction(value);
836
- }
837
- function isArrayLikeObject(value) {
838
- return isObjectLike2(value) && isArrayLike(value);
839
- }
840
- var isBuffer = nativeIsBuffer || stubFalse;
841
- function isEmpty2(value) {
842
- if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isArguments(value))) {
843
- return !value.length;
1933
+ catch (error) { e = { error: error }; }
1934
+ finally {
1935
+ try {
1936
+ if (r && !r.done && (m = i["return"])) m.call(i);
1937
+ }
1938
+ finally { if (e) throw e.error; }
844
1939
  }
845
- var tag = getTag(value);
846
- if (tag == mapTag || tag == setTag) {
847
- return !value.size;
1940
+ return ar;
1941
+ };
1942
+ var isNil = lodash_isnil || isNilImport;
1943
+ var isEmpty$1 = lodash_isempty || isEmptyImport;
1944
+ /**
1945
+ * Get the value at `path` starting from `object`.
1946
+ * Allows optional chaining, e.g. `get(obj, 'a.b?.c')`
1947
+ */
1948
+ function getPath(object, path, defaultValue, allOptional) {
1949
+ var e_1, _a, _b;
1950
+ if (allOptional === void 0) { allOptional = false; }
1951
+ if (isEmpty$1(path)) {
1952
+ return object;
848
1953
  }
849
- if (nonEnumShadows || isPrototype(value)) {
850
- return !nativeKeys(value).length;
1954
+ var value = object;
1955
+ try {
1956
+ for (var _c = __values$6(crumblePath(path)), _d = _c.next(); !_d.done; _d = _c.next()) {
1957
+ var crumb = _d.value;
1958
+ var key = crumb;
1959
+ var optional = void 0;
1960
+ if (typeof crumb === "string") {
1961
+ _b = __read$2(/^([^?]+)(\?)?$/.exec(crumb), 3), key = _b[1], optional = _b[2];
1962
+ }
1963
+ value = value[key];
1964
+ if (isNil(value) && (optional || allOptional)) {
1965
+ return defaultValue;
1966
+ }
1967
+ }
851
1968
  }
852
- for (var key in value) {
853
- if (hasOwnProperty2.call(value, key)) {
854
- return false;
855
- }
1969
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1970
+ finally {
1971
+ try {
1972
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
1973
+ }
1974
+ finally { if (e_1) throw e_1.error; }
856
1975
  }
857
- return true;
858
- }
859
- function isFunction(value) {
860
- var tag = isObject(value) ? objectToString2.call(value) : "";
861
- return tag == funcTag || tag == genTag;
862
- }
863
- function isLength(value) {
864
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
865
- }
866
- function isObject(value) {
867
- var type = typeof value;
868
- return !!value && (type == "object" || type == "function");
869
- }
870
- function isObjectLike2(value) {
871
- return !!value && typeof value == "object";
872
- }
873
- function stubFalse() {
874
- return false;
875
- }
876
- module.exports = isEmpty2;
877
- })(lodash_isempty$1, lodash_isempty$1.exports);
878
- var lodash_isempty = lodash_isempty$1.exports;
879
- var isEmptyImport = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ _mergeNamespaces({
880
- __proto__: null,
881
- [Symbol.toStringTag]: "Module",
882
- "default": lodash_isempty
883
- }, [lodash_isempty$1.exports]));
884
- const isNil = lodash_isnil || isNilImport;
885
- const isEmpty$1 = lodash_isempty || isEmptyImport;
886
- function getPath(object, path, defaultValue, allOptional = false) {
887
- if (isEmpty$1(path)) {
888
- return object;
889
- }
890
- let value = object;
891
- for (const crumb of crumblePath(path)) {
892
- let key = crumb;
893
- let optional;
894
- if (typeof crumb === "string") {
895
- [
896
- ,
897
- key,
898
- optional
899
- ] = /^([^?]+)(\?)?$/.exec(crumb);
1976
+ return isNil(value) ? defaultValue : value;
1977
+ }
1978
+
1979
+ var __values$5 = (undefined && undefined.__values) || function(o) {
1980
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1981
+ if (m) return m.call(o);
1982
+ if (o && typeof o.length === "number") return {
1983
+ next: function () {
1984
+ if (o && i >= o.length) o = void 0;
1985
+ return { value: o && o[i++], done: !o };
1986
+ }
1987
+ };
1988
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1989
+ };
1990
+ /*
1991
+ * Return a copy of `obj` without the key `key`
1992
+ */
1993
+ function omit(obj) {
1994
+ var e_1, _a;
1995
+ var keys = [];
1996
+ for (var _i = 1; _i < arguments.length; _i++) {
1997
+ keys[_i - 1] = arguments[_i];
900
1998
  }
901
- value = value[key];
902
- if (isNil(value) && (optional || allOptional)) {
903
- return defaultValue;
1999
+ var keySet = new Set(keys);
2000
+ var result = {};
2001
+ try {
2002
+ for (var _b = __values$5(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
2003
+ var k = _c.value;
2004
+ if (!keySet.has(k)) {
2005
+ result[k] = obj[k];
2006
+ }
2007
+ }
904
2008
  }
905
- }
906
- return isNil(value) ? defaultValue : value;
907
- }
908
- function omit(obj, ...keys) {
909
- const keySet = new Set(keys);
910
- const result = {};
911
- for (const k of Object.keys(obj)) {
912
- if (!keySet.has(k)) {
913
- result[k] = obj[k];
2009
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2010
+ finally {
2011
+ try {
2012
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2013
+ }
2014
+ finally { if (e_1) throw e_1.error; }
914
2015
  }
915
- }
916
- return result;
2016
+ return result;
917
2017
  }
918
- const isEmpty = lodash_isempty || isEmptyImport;
2018
+
2019
+ var __values$4 = (undefined && undefined.__values) || function(o) {
2020
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
2021
+ if (m) return m.call(o);
2022
+ if (o && typeof o.length === "number") return {
2023
+ next: function () {
2024
+ if (o && i >= o.length) o = void 0;
2025
+ return { value: o && o[i++], done: !o };
2026
+ }
2027
+ };
2028
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2029
+ };
2030
+ var isEmpty = lodash_isempty || isEmptyImport;
2031
+ /** Set the value at `path` on `object`. */
919
2032
  function setPath(object, path, newValue) {
920
- if (typeof object !== "object") {
921
- throw new Error("object is required");
922
- }
923
- if (isEmpty(path)) {
924
- throw new Error("path is required");
925
- }
926
- const crumbs = crumblePath(path);
927
- const finalCrumb = crumbs.splice(crumbs.length - 1, 1)[0];
928
- let current = object;
929
- for (const crumb of crumbs) {
930
- current = current[crumb];
931
- if (typeof current !== "object") {
932
- throw new Error(`Cannot set value at given path: Path deadends at ${String(crumb)}`);
2033
+ var e_1, _a;
2034
+ if (typeof object !== "object") {
2035
+ throw new Error("object is required");
933
2036
  }
934
- }
935
- current[finalCrumb] = newValue;
2037
+ if (isEmpty(path)) {
2038
+ throw new Error("path is required");
2039
+ }
2040
+ var crumbs = crumblePath(path);
2041
+ var finalCrumb = crumbs.splice(crumbs.length - 1, 1)[0];
2042
+ var current = object;
2043
+ try {
2044
+ for (var crumbs_1 = __values$4(crumbs), crumbs_1_1 = crumbs_1.next(); !crumbs_1_1.done; crumbs_1_1 = crumbs_1.next()) {
2045
+ var crumb = crumbs_1_1.value;
2046
+ current = current[crumb];
2047
+ if (typeof current !== "object") {
2048
+ throw new Error("Cannot set value at given path: Path deadends at " + String(crumb));
2049
+ }
2050
+ }
2051
+ }
2052
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2053
+ finally {
2054
+ try {
2055
+ if (crumbs_1_1 && !crumbs_1_1.done && (_a = crumbs_1.return)) _a.call(crumbs_1);
2056
+ }
2057
+ finally { if (e_1) throw e_1.error; }
2058
+ }
2059
+ current[finalCrumb] = newValue;
936
2060
  }
937
- function* traversePath(object, path) {
938
- yield object;
939
- let obj = object;
940
- for (const crumb of crumblePath(path)) {
941
- obj = obj[crumb];
942
- yield obj;
943
- }
2061
+
2062
+ var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
2063
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
2064
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
2065
+ function verb(n) { return function (v) { return step([n, v]); }; }
2066
+ function step(op) {
2067
+ if (f) throw new TypeError("Generator is already executing.");
2068
+ while (_) try {
2069
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
2070
+ if (y = 0, t) op = [op[0] & 2, t.value];
2071
+ switch (op[0]) {
2072
+ case 0: case 1: t = op; break;
2073
+ case 4: _.label++; return { value: op[1], done: false };
2074
+ case 5: _.label++; y = op[1]; op = [0]; continue;
2075
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
2076
+ default:
2077
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
2078
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
2079
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
2080
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
2081
+ if (t[2]) _.ops.pop();
2082
+ _.trys.pop(); continue;
2083
+ }
2084
+ op = body.call(thisArg, _);
2085
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
2086
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
2087
+ }
2088
+ };
2089
+ var __values$3 = (undefined && undefined.__values) || function(o) {
2090
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
2091
+ if (m) return m.call(o);
2092
+ if (o && typeof o.length === "number") return {
2093
+ next: function () {
2094
+ if (o && i >= o.length) o = void 0;
2095
+ return { value: o && o[i++], done: !o };
2096
+ }
2097
+ };
2098
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2099
+ };
2100
+ /** Generator for iterating down a path on an object. */
2101
+ function traversePath(object, path) {
2102
+ var obj, _a, _b, crumb, e_1_1;
2103
+ var e_1, _c;
2104
+ return __generator(this, function (_d) {
2105
+ switch (_d.label) {
2106
+ case 0: return [4 /*yield*/, object];
2107
+ case 1:
2108
+ _d.sent();
2109
+ obj = object;
2110
+ _d.label = 2;
2111
+ case 2:
2112
+ _d.trys.push([2, 7, 8, 9]);
2113
+ _a = __values$3(crumblePath(path)), _b = _a.next();
2114
+ _d.label = 3;
2115
+ case 3:
2116
+ if (!!_b.done) return [3 /*break*/, 6];
2117
+ crumb = _b.value;
2118
+ obj = obj[crumb];
2119
+ return [4 /*yield*/, obj];
2120
+ case 4:
2121
+ _d.sent();
2122
+ _d.label = 5;
2123
+ case 5:
2124
+ _b = _a.next();
2125
+ return [3 /*break*/, 3];
2126
+ case 6: return [3 /*break*/, 9];
2127
+ case 7:
2128
+ e_1_1 = _d.sent();
2129
+ e_1 = { error: e_1_1 };
2130
+ return [3 /*break*/, 9];
2131
+ case 8:
2132
+ try {
2133
+ if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
2134
+ }
2135
+ finally { if (e_1) throw e_1.error; }
2136
+ return [7 /*endfinally*/];
2137
+ case 9: return [2 /*return*/];
2138
+ }
2139
+ });
944
2140
  }
945
- function mergeDeep(...objectsToMerge) {
946
- const result = {};
947
- for (const mergee of objectsToMerge) {
948
- for (const key of Object.keys(mergee)) {
949
- if (Object.prototype.hasOwnProperty.call(result, key) && Object.getOwnPropertyDescriptor(result, key).writable && lodash_isplainobject(result[key])) {
950
- result[key] = mergeDeep(result[key], mergee[key]);
951
- } else if (lodash_isplainobject(mergee[key])) {
952
- result[key] = mergeDeep({}, mergee[key]);
953
- } else {
954
- result[key] = mergee[key];
955
- }
2141
+
2142
+ var __values$2 = (undefined && undefined.__values) || function(o) {
2143
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
2144
+ if (m) return m.call(o);
2145
+ if (o && typeof o.length === "number") return {
2146
+ next: function () {
2147
+ if (o && i >= o.length) o = void 0;
2148
+ return { value: o && o[i++], done: !o };
2149
+ }
2150
+ };
2151
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2152
+ };
2153
+ /**
2154
+ * Recursive merge of any number of objects
2155
+ */
2156
+ function mergeDeep() {
2157
+ var e_1, _a, e_2, _b;
2158
+ var objectsToMerge = [];
2159
+ for (var _i = 0; _i < arguments.length; _i++) {
2160
+ objectsToMerge[_i] = arguments[_i];
956
2161
  }
957
- }
958
- return result;
2162
+ var result = {};
2163
+ try {
2164
+ for (var objectsToMerge_1 = __values$2(objectsToMerge), objectsToMerge_1_1 = objectsToMerge_1.next(); !objectsToMerge_1_1.done; objectsToMerge_1_1 = objectsToMerge_1.next()) {
2165
+ var mergee = objectsToMerge_1_1.value;
2166
+ try {
2167
+ for (var _c = (e_2 = void 0, __values$2(Object.keys(mergee))), _d = _c.next(); !_d.done; _d = _c.next()) {
2168
+ var key = _d.value;
2169
+ if (Object.prototype.hasOwnProperty.call(result, key)
2170
+ && Object.getOwnPropertyDescriptor(result, key).writable
2171
+ && lodash_isplainobject(result[key])) {
2172
+ result[key] = mergeDeep(result[key], mergee[key]);
2173
+ }
2174
+ else if (lodash_isplainobject(mergee[key])) {
2175
+ result[key] = mergeDeep({}, mergee[key]);
2176
+ }
2177
+ else {
2178
+ result[key] = mergee[key];
2179
+ }
2180
+ }
2181
+ }
2182
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
2183
+ finally {
2184
+ try {
2185
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2186
+ }
2187
+ finally { if (e_2) throw e_2.error; }
2188
+ }
2189
+ }
2190
+ }
2191
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2192
+ finally {
2193
+ try {
2194
+ if (objectsToMerge_1_1 && !objectsToMerge_1_1.done && (_a = objectsToMerge_1.return)) _a.call(objectsToMerge_1);
2195
+ }
2196
+ finally { if (e_1) throw e_1.error; }
2197
+ }
2198
+ return result;
959
2199
  }
960
- function mergePropertiesDeep(...objectsToMerge) {
961
- const result = {};
962
- for (const mergee of objectsToMerge) {
963
- for (const key of Object.keys(mergee)) {
964
- if (Object.prototype.hasOwnProperty.call(result, key) && Object.getOwnPropertyDescriptor(result, key).writable && lodash_isplainobject(result[key])) {
965
- result[key] = mergePropertiesDeep(result[key], mergee[key]);
966
- } else if (lodash_isplainobject(mergee[key])) {
967
- result[key] = mergePropertiesDeep({}, mergee[key]);
968
- } else {
969
- copyProperty(key, mergee, result);
970
- }
2200
+
2201
+ var __values$1 = (undefined && undefined.__values) || function(o) {
2202
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
2203
+ if (m) return m.call(o);
2204
+ if (o && typeof o.length === "number") return {
2205
+ next: function () {
2206
+ if (o && i >= o.length) o = void 0;
2207
+ return { value: o && o[i++], done: !o };
2208
+ }
2209
+ };
2210
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2211
+ };
2212
+ /**
2213
+ * Recursive merge of any number of objects using `copyProperty()` rather than assignment
2214
+ */
2215
+ function mergePropertiesDeep() {
2216
+ var e_1, _a, e_2, _b;
2217
+ var objectsToMerge = [];
2218
+ for (var _i = 0; _i < arguments.length; _i++) {
2219
+ objectsToMerge[_i] = arguments[_i];
971
2220
  }
972
- }
973
- return result;
2221
+ var result = {};
2222
+ try {
2223
+ for (var objectsToMerge_1 = __values$1(objectsToMerge), objectsToMerge_1_1 = objectsToMerge_1.next(); !objectsToMerge_1_1.done; objectsToMerge_1_1 = objectsToMerge_1.next()) {
2224
+ var mergee = objectsToMerge_1_1.value;
2225
+ try {
2226
+ for (var _c = (e_2 = void 0, __values$1(Object.keys(mergee))), _d = _c.next(); !_d.done; _d = _c.next()) {
2227
+ var key = _d.value;
2228
+ if (Object.prototype.hasOwnProperty.call(result, key)
2229
+ && Object.getOwnPropertyDescriptor(result, key).writable
2230
+ && lodash_isplainobject(result[key])) {
2231
+ result[key] = mergePropertiesDeep(result[key], mergee[key]);
2232
+ }
2233
+ else if (lodash_isplainobject(mergee[key])) {
2234
+ result[key] = mergePropertiesDeep({}, mergee[key]);
2235
+ }
2236
+ else {
2237
+ copyProperty(key, mergee, result);
2238
+ }
2239
+ }
2240
+ }
2241
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
2242
+ finally {
2243
+ try {
2244
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2245
+ }
2246
+ finally { if (e_2) throw e_2.error; }
2247
+ }
2248
+ }
2249
+ }
2250
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2251
+ finally {
2252
+ try {
2253
+ if (objectsToMerge_1_1 && !objectsToMerge_1_1.done && (_a = objectsToMerge_1.return)) _a.call(objectsToMerge_1);
2254
+ }
2255
+ finally { if (e_1) throw e_1.error; }
2256
+ }
2257
+ return result;
974
2258
  }
2259
+
2260
+ var __values = (undefined && undefined.__values) || function(o) {
2261
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
2262
+ if (m) return m.call(o);
2263
+ if (o && typeof o.length === "number") return {
2264
+ next: function () {
2265
+ if (o && i >= o.length) o = void 0;
2266
+ return { value: o && o[i++], done: !o };
2267
+ }
2268
+ };
2269
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2270
+ };
2271
+ /** Returns the values of an object. */
975
2272
  function values(object) {
976
- const vals = [];
977
- for (const key of Object.keys(object)) {
978
- vals.push(object[key]);
979
- }
980
- return vals;
2273
+ var e_1, _a;
2274
+ var vals = [];
2275
+ try {
2276
+ for (var _b = __values(Object.keys(object)), _c = _b.next(); !_c.done; _c = _b.next()) {
2277
+ var key = _c.value;
2278
+ vals.push(object[key]);
2279
+ }
2280
+ }
2281
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2282
+ finally {
2283
+ try {
2284
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2285
+ }
2286
+ finally { if (e_1) throw e_1.error; }
2287
+ }
2288
+ return vals;
981
2289
  }
982
- function code(strings, ...interpolations) {
983
- const s = strings.reduce((a, b, i) => `${a}${i <= interpolations.length ? String(interpolations[i - 1]) : ""}${b}`);
984
- const leadingWhitespace = Math.min(...s.split(/[\r\n]/).filter((l) => l.trim()).map((l) => /^ */.exec(l)[0].length));
985
- return s.replace(new RegExp(`^ {${leadingWhitespace}}`, "gm"), "").trim();
2290
+
2291
+ var __read$1 = (undefined && undefined.__read) || function (o, n) {
2292
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
2293
+ if (!m) return o;
2294
+ var i = m.call(o), r, ar = [], e;
2295
+ try {
2296
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
2297
+ }
2298
+ catch (error) { e = { error: error }; }
2299
+ finally {
2300
+ try {
2301
+ if (r && !r.done && (m = i["return"])) m.call(i);
2302
+ }
2303
+ finally { if (e) throw e.error; }
2304
+ }
2305
+ return ar;
2306
+ };
2307
+ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
2308
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
2309
+ if (ar || !(i in from)) {
2310
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
2311
+ ar[i] = from[i];
2312
+ }
2313
+ }
2314
+ return to.concat(ar || Array.prototype.slice.call(from));
2315
+ };
2316
+ /** Template tag function for making strings containing code blocks easier to deal with. */
2317
+ function code(strings) {
2318
+ var interpolations = [];
2319
+ for (var _i = 1; _i < arguments.length; _i++) {
2320
+ interpolations[_i - 1] = arguments[_i];
2321
+ }
2322
+ var s = strings.reduce(function (a, b, i) { return "" + a + (i <= interpolations.length ? String(interpolations[i - 1]) : "") + b; });
2323
+ var leadingWhitespace = Math.min.apply(Math, __spreadArray([], __read$1(s.split(/[\r\n]/)
2324
+ .filter(function (l) { return l.trim(); })
2325
+ .map(function (l) { return (/^ */.exec(l))[0].length; })), false));
2326
+ return s.replace(new RegExp("^ {" + leadingWhitespace + "}", "gm"), "").trim();
986
2327
  }
2328
+
2329
+ var __read = (undefined && undefined.__read) || function (o, n) {
2330
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
2331
+ if (!m) return o;
2332
+ var i = m.call(o), r, ar = [], e;
2333
+ try {
2334
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
2335
+ }
2336
+ catch (error) { e = { error: error }; }
2337
+ finally {
2338
+ try {
2339
+ if (r && !r.done && (m = i["return"])) m.call(i);
2340
+ }
2341
+ finally { if (e) throw e.error; }
2342
+ }
2343
+ return ar;
2344
+ };
2345
+ /**
2346
+ * Parses a string as a file size and returns the size in bytes. For example,
2347
+ * `parseFileSize("2KB")` will return `2048`.
2348
+ */
987
2349
  function parseFileSize(fileSize) {
988
- const unitMatch = /[A-Z]?B$/.exec(fileSize);
989
- if (!unitMatch) {
990
- throw new Error(`Input to parseFileSize ("${fileSize}") doesn't seem like a file size; cannot identify a unit (e.g. KB, GB)`);
991
- }
992
- const [unit] = unitMatch;
993
- const num = Number(fileSize.replace(unit, ""));
994
- if (Number.isNaN(num)) {
995
- throw new Error(`Could not parse a number out of input to parseFileSize ("${fileSize}")`);
996
- }
997
- const magnitude = [
998
- "B",
999
- "KB",
1000
- "MB",
1001
- "GB",
1002
- "TB",
1003
- "PB"
1004
- ].indexOf(unit);
1005
- if (magnitude === -1) {
1006
- throw new Error("parseFileSize does not support units above PB");
1007
- }
1008
- return Math.ceil(num * 1024 ** magnitude);
2350
+ var unitMatch = /[A-Z]?B$/.exec(fileSize);
2351
+ if (!unitMatch) {
2352
+ throw new Error("Input to parseFileSize (\"" + fileSize + "\") doesn't seem like a file size; "
2353
+ + "cannot identify a unit (e.g. KB, GB)");
2354
+ }
2355
+ var _a = __read(unitMatch, 1), unit = _a[0];
2356
+ var num = Number(fileSize.replace(unit, ""));
2357
+ if (Number.isNaN(num)) {
2358
+ throw new Error("Could not parse a number out of input to parseFileSize (\"" + fileSize + "\")");
2359
+ }
2360
+ var magnitude = ["B",
2361
+ "KB",
2362
+ "MB",
2363
+ "GB",
2364
+ "TB",
2365
+ "PB"].indexOf(unit);
2366
+ if (magnitude === -1) {
2367
+ throw new Error("parseFileSize does not support units above PB");
2368
+ }
2369
+ return Math.ceil(num * (Math.pow(1024, magnitude)));
1009
2370
  }
1010
- const REGEX_REPLACEMENT = /(<%=|{{)(.+?)(%>|}})/g;
1011
- const REGEX_IF = /<%\?(.+?)%>(.+?)<\/%>/g;
1012
- const SYMBOL_TEMPLATE_SOURCE = Symbol("sps.utils.templateSrc");
2371
+
2372
+ var REGEX_REPLACEMENT = /(<%=|{{)(.+?)(%>|}})/g;
2373
+ var REGEX_IF = /<%\?(.+?)%>(.+?)<\/%>/g;
2374
+ var SYMBOL_TEMPLATE_SOURCE = Symbol("sps.utils.templateSrc");
2375
+ /**
2376
+ * Every string templating thing out there whether lodash, doT, handlebars, etc
2377
+ * is extremely complicated to cover a variety of use cases. This just has two
2378
+ * very simple features and great caution should be exercised in making it any more
2379
+ * complex than that. A value can be interpolated like so:
2380
+ * `<%= foo.bar %>`
2381
+ * And a basic "if" conditional can be used like so:
2382
+ * `<%? a?.b?.c %>This part will only appear if a.b.c is truthy!</%>`
2383
+ * You can put interpolations inside a conditional, as you'd expect. That's it.
2384
+ */
1013
2385
  function template(string) {
1014
- const fn = (data) => string.replace(REGEX_IF, (match, pathToCheck, content) => getPath(data, pathToCheck.trim()) ? content : "").replace(REGEX_REPLACEMENT, (match, _, pathToInterpolate) => getPath(data, pathToInterpolate.trim(), ""));
1015
- fn[SYMBOL_TEMPLATE_SOURCE] = string;
1016
- return fn;
2386
+ var fn = function (data) { return string
2387
+ .replace(REGEX_IF, function (match, pathToCheck, content) { return (getPath(data, pathToCheck.trim()) ? content : ""); })
2388
+ .replace(REGEX_REPLACEMENT, function (match, _, pathToInterpolate) { return getPath(data, pathToInterpolate.trim(), ""); }); };
2389
+ fn[SYMBOL_TEMPLATE_SOURCE] = string;
2390
+ return fn;
1017
2391
  }
1018
2392
  function isTemplate(x) {
1019
- return typeof x === "string" && (REGEX_REPLACEMENT.test(x) || REGEX_IF.test(x));
2393
+ return typeof x === "string" && (REGEX_REPLACEMENT.test(x) || REGEX_IF.test(x));
1020
2394
  }
1021
2395
  function isTemplateFn(x) {
1022
- return typeof x === "function" && Object.prototype.hasOwnProperty.call(x, SYMBOL_TEMPLATE_SOURCE);
2396
+ return typeof x === "function" && Object.prototype.hasOwnProperty.call(x, SYMBOL_TEMPLATE_SOURCE);
1023
2397
  }
2398
+
1024
2399
  export { CustomEvent, DiffChange, EDI_DOCUMENT_TYPE, Op, castToNumber, code, constrain, copyProperty, crumblePath, debounce, debounced, decimalRound, deepFreeze, diff, flatten, forEachEntryDeep, forEachNestedObject, getPath, isSubset, isTemplate, isTemplateFn, lockToAnimationFrames, lockedToAnimationFrames, mergeDeep, mergePropertiesDeep, omit, onNextTick, parseFileSize, range, setPath, simpleMetadataDecoratorApplicator, template, tickDelay, toFileSizeString, traversePath, values };