@barchart/portfolio-api-common 1.4.2 → 1.5.1

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.
@@ -272,7 +272,7 @@ module.exports = (() => {
272
272
  return InstrumentType;
273
273
  })();
274
274
 
275
- },{"@barchart/common-js/lang/Enum":24,"@barchart/common-js/lang/assert":29,"uuid":47}],2:[function(require,module,exports){
275
+ },{"@barchart/common-js/lang/Enum":26,"@barchart/common-js/lang/assert":31,"uuid":49}],2:[function(require,module,exports){
276
276
  const assert = require('@barchart/common-js/lang/assert'),
277
277
  Decimal = require('@barchart/common-js/lang/Decimal'),
278
278
  Enum = require('@barchart/common-js/lang/Enum');
@@ -406,7 +406,7 @@ module.exports = (() => {
406
406
  return PositionDirection;
407
407
  })();
408
408
 
409
- },{"@barchart/common-js/lang/Decimal":22,"@barchart/common-js/lang/Enum":24,"@barchart/common-js/lang/assert":29}],3:[function(require,module,exports){
409
+ },{"@barchart/common-js/lang/Decimal":24,"@barchart/common-js/lang/Enum":26,"@barchart/common-js/lang/assert":31}],3:[function(require,module,exports){
410
410
  const array = require('@barchart/common-js/lang/array'),
411
411
  assert = require('@barchart/common-js/lang/assert'),
412
412
  Day = require('@barchart/common-js/lang/Day'),
@@ -754,7 +754,7 @@ module.exports = (() => {
754
754
  return PositionSummaryFrame;
755
755
  })();
756
756
 
757
- },{"@barchart/common-js/lang/Day":21,"@barchart/common-js/lang/Decimal":22,"@barchart/common-js/lang/Enum":24,"@barchart/common-js/lang/array":28,"@barchart/common-js/lang/assert":29}],4:[function(require,module,exports){
757
+ },{"@barchart/common-js/lang/Day":23,"@barchart/common-js/lang/Decimal":24,"@barchart/common-js/lang/Enum":26,"@barchart/common-js/lang/array":30,"@barchart/common-js/lang/assert":31}],4:[function(require,module,exports){
758
758
  const assert = require('@barchart/common-js/lang/assert'),
759
759
  Enum = require('@barchart/common-js/lang/Enum');
760
760
 
@@ -1288,7 +1288,7 @@ module.exports = (() => {
1288
1288
  return TransactionType;
1289
1289
  })();
1290
1290
 
1291
- },{"@barchart/common-js/lang/Enum":24,"@barchart/common-js/lang/assert":29}],5:[function(require,module,exports){
1291
+ },{"@barchart/common-js/lang/Enum":26,"@barchart/common-js/lang/assert":31}],5:[function(require,module,exports){
1292
1292
  const assert = require('@barchart/common-js/lang/assert'),
1293
1293
  array = require('@barchart/common-js/lang/array'),
1294
1294
  is = require('@barchart/common-js/lang/is'),
@@ -1595,7 +1595,68 @@ module.exports = (() => {
1595
1595
  return TransactionValidator;
1596
1596
  })();
1597
1597
 
1598
- },{"./InstrumentType":1,"./PositionDirection":2,"./TransactionType":4,"@barchart/common-js/lang/Day":21,"@barchart/common-js/lang/array":28,"@barchart/common-js/lang/assert":29,"@barchart/common-js/lang/is":33}],6:[function(require,module,exports){
1598
+ },{"./InstrumentType":1,"./PositionDirection":2,"./TransactionType":4,"@barchart/common-js/lang/Day":23,"@barchart/common-js/lang/array":30,"@barchart/common-js/lang/assert":31,"@barchart/common-js/lang/is":35}],6:[function(require,module,exports){
1599
+ const Enum = require('@barchart/common-js/lang/Enum');
1600
+
1601
+ module.exports = (() => {
1602
+ 'use strict';
1603
+
1604
+ /**
1605
+ * An enumeration item that describes a strategy for calculating basis.
1606
+ *
1607
+ * @public
1608
+ * @extends {Enum}
1609
+ * @param {String} description
1610
+ * @param {String} code
1611
+ */
1612
+ class ValuationType extends Enum {
1613
+ constructor(code, description) {
1614
+ super(code, description);
1615
+ }
1616
+
1617
+ /**
1618
+ * Given a code, returns the enumeration item.
1619
+ *
1620
+ * @public
1621
+ * @param {String} code
1622
+ * @returns {ValuationType|null}
1623
+ */
1624
+ static parse(code) {
1625
+ return Enum.fromCode(ValuationType, code);
1626
+ }
1627
+
1628
+ /**
1629
+ * A valuation method that uses average costing.
1630
+ *
1631
+ * @public
1632
+ * @returns {ValuationType}
1633
+ */
1634
+ static get AVERAGE_COST() {
1635
+ return averageCost;
1636
+ }
1637
+
1638
+ /**
1639
+ * A valuation method that uses first-in, first-out methodology.
1640
+ *
1641
+ * @public
1642
+ * @returns {ValuationType}
1643
+ */
1644
+ static get FIFO() {
1645
+ return fifo;
1646
+ }
1647
+
1648
+ toString() {
1649
+ return `[ValuationType (code=${this.code})]`;
1650
+ }
1651
+ }
1652
+
1653
+ const fifo = new ValuationType('FIFO', 'first in, first out');
1654
+ const averageCost = new ValuationType('AVG', 'average cost');
1655
+
1656
+ return ValuationType;
1657
+ })();
1658
+
1659
+ },{"@barchart/common-js/lang/Enum":26}],7:[function(require,module,exports){
1599
1660
  const array = require('@barchart/common-js/lang/array'),
1600
1661
  assert = require('@barchart/common-js/lang/assert'),
1601
1662
  ComparatorBuilder = require('@barchart/common-js/collections/sorting/ComparatorBuilder'),
@@ -2732,7 +2793,7 @@ module.exports = (() => {
2732
2793
  return PositionContainer;
2733
2794
  })();
2734
2795
 
2735
- },{"./../data/PositionSummaryFrame":3,"./PositionGroup":7,"./PositionItem":8,"./definitions/PositionLevelDefinition":9,"./definitions/PositionLevelType":10,"./definitions/PositionTreeDefinition":11,"@barchart/common-js/collections/Tree":15,"@barchart/common-js/collections/sorting/ComparatorBuilder":16,"@barchart/common-js/collections/sorting/comparators":17,"@barchart/common-js/collections/specialized/DisposableStack":18,"@barchart/common-js/lang/Currency":20,"@barchart/common-js/lang/Day":21,"@barchart/common-js/lang/Decimal":22,"@barchart/common-js/lang/Rate":26,"@barchart/common-js/lang/array":28,"@barchart/common-js/lang/assert":29,"@barchart/common-js/lang/is":33,"@barchart/common-js/messaging/Event":35}],7:[function(require,module,exports){
2796
+ },{"./../data/PositionSummaryFrame":3,"./PositionGroup":8,"./PositionItem":9,"./definitions/PositionLevelDefinition":10,"./definitions/PositionLevelType":11,"./definitions/PositionTreeDefinition":12,"@barchart/common-js/collections/Tree":17,"@barchart/common-js/collections/sorting/ComparatorBuilder":18,"@barchart/common-js/collections/sorting/comparators":19,"@barchart/common-js/collections/specialized/DisposableStack":20,"@barchart/common-js/lang/Currency":22,"@barchart/common-js/lang/Day":23,"@barchart/common-js/lang/Decimal":24,"@barchart/common-js/lang/Rate":28,"@barchart/common-js/lang/array":30,"@barchart/common-js/lang/assert":31,"@barchart/common-js/lang/is":35,"@barchart/common-js/messaging/Event":37}],8:[function(require,module,exports){
2736
2797
  const array = require('@barchart/common-js/lang/array'),
2737
2798
  assert = require('@barchart/common-js/lang/assert'),
2738
2799
  Currency = require('@barchart/common-js/lang/Currency'),
@@ -3761,7 +3822,7 @@ module.exports = (() => {
3761
3822
  return PositionGroup;
3762
3823
  })();
3763
3824
 
3764
- },{"./../data/InstrumentType":1,"./definitions/PositionLevelDefinition":9,"./definitions/PositionLevelType":10,"@barchart/common-js/collections/specialized/DisposableStack":18,"@barchart/common-js/lang/Currency":20,"@barchart/common-js/lang/Decimal":22,"@barchart/common-js/lang/Disposable":23,"@barchart/common-js/lang/Rate":26,"@barchart/common-js/lang/array":28,"@barchart/common-js/lang/assert":29,"@barchart/common-js/lang/formatter":31,"@barchart/common-js/lang/is":33,"@barchart/common-js/messaging/Event":35}],8:[function(require,module,exports){
3825
+ },{"./../data/InstrumentType":1,"./definitions/PositionLevelDefinition":10,"./definitions/PositionLevelType":11,"@barchart/common-js/collections/specialized/DisposableStack":20,"@barchart/common-js/lang/Currency":22,"@barchart/common-js/lang/Decimal":24,"@barchart/common-js/lang/Disposable":25,"@barchart/common-js/lang/Rate":28,"@barchart/common-js/lang/array":30,"@barchart/common-js/lang/assert":31,"@barchart/common-js/lang/formatter":33,"@barchart/common-js/lang/is":35,"@barchart/common-js/messaging/Event":37}],9:[function(require,module,exports){
3765
3826
  const assert = require('@barchart/common-js/lang/assert'),
3766
3827
  Currency = require('@barchart/common-js/lang/Currency'),
3767
3828
  Decimal = require('@barchart/common-js/lang/Decimal'),
@@ -3804,14 +3865,14 @@ module.exports = (() => {
3804
3865
 
3805
3866
  this._reporting = reporting;
3806
3867
 
3807
- this._data = { };
3808
-
3809
- this._data.basis = null;
3810
-
3811
3868
  this._currentQuote = null;
3812
3869
  this._previousQuote = null;
3813
3870
  this._currentPrice = null;
3814
3871
 
3872
+ this._data = { };
3873
+
3874
+ this._data.basis = null;
3875
+
3815
3876
  this._data.currentPrice = null;
3816
3877
  this._data.currentPricePrevious = null;
3817
3878
 
@@ -4546,7 +4607,7 @@ module.exports = (() => {
4546
4607
  return PositionItem;
4547
4608
  })();
4548
4609
 
4549
- },{"./../data/InstrumentType":1,"./../data/PositionDirection":2,"@barchart/common-js/lang/Currency":20,"@barchart/common-js/lang/Decimal":22,"@barchart/common-js/lang/Disposable":23,"@barchart/common-js/lang/assert":29,"@barchart/common-js/lang/is":33,"@barchart/common-js/messaging/Event":35}],9:[function(require,module,exports){
4610
+ },{"./../data/InstrumentType":1,"./../data/PositionDirection":2,"@barchart/common-js/lang/Currency":22,"@barchart/common-js/lang/Decimal":24,"@barchart/common-js/lang/Disposable":25,"@barchart/common-js/lang/assert":31,"@barchart/common-js/lang/is":35,"@barchart/common-js/messaging/Event":37}],10:[function(require,module,exports){
4550
4611
  const assert = require('@barchart/common-js/lang/assert'),
4551
4612
  Currency = require('@barchart/common-js/lang/Currency'),
4552
4613
  is = require('@barchart/common-js/lang/is');
@@ -4830,7 +4891,7 @@ module.exports = (() => {
4830
4891
  return PositionLevelDefinition;
4831
4892
  })();
4832
4893
 
4833
- },{"./../../data/InstrumentType":1,"./PositionLevelType":10,"@barchart/common-js/lang/Currency":20,"@barchart/common-js/lang/assert":29,"@barchart/common-js/lang/is":33}],10:[function(require,module,exports){
4894
+ },{"./../../data/InstrumentType":1,"./PositionLevelType":11,"@barchart/common-js/lang/Currency":22,"@barchart/common-js/lang/assert":31,"@barchart/common-js/lang/is":35}],11:[function(require,module,exports){
4834
4895
  const Enum = require('@barchart/common-js/lang/Enum');
4835
4896
 
4836
4897
  module.exports = (() => {
@@ -4891,7 +4952,7 @@ module.exports = (() => {
4891
4952
  return PositionLevelType;
4892
4953
  })();
4893
4954
 
4894
- },{"@barchart/common-js/lang/Enum":24}],11:[function(require,module,exports){
4955
+ },{"@barchart/common-js/lang/Enum":26}],12:[function(require,module,exports){
4895
4956
  const assert = require('@barchart/common-js/lang/assert');
4896
4957
 
4897
4958
  const PositionLevelDefinition = require('./PositionLevelDefinition');
@@ -4963,7 +5024,188 @@ module.exports = (() => {
4963
5024
  return PositionTreeDefinitions;
4964
5025
  })();
4965
5026
 
4966
- },{"./PositionLevelDefinition":9,"@barchart/common-js/lang/assert":29}],12:[function(require,module,exports){
5027
+ },{"./PositionLevelDefinition":10,"@barchart/common-js/lang/assert":31}],13:[function(require,module,exports){
5028
+ const Currency = require('@barchart/common-js/lang/Currency'),
5029
+ DataType = require('@barchart/common-js/serialization/json/DataType'),
5030
+ Enum = require('@barchart/common-js/lang/Enum'),
5031
+ Schema = require('@barchart/common-js/serialization/json/Schema'),
5032
+ SchemaBuilder = require('@barchart/common-js/serialization/json/builders/SchemaBuilder');
5033
+
5034
+ const InstrumentType = require('./../data/InstrumentType'),
5035
+ PositionDirection = require('./../data/PositionDirection'),
5036
+ ValuationType = require('./../data/ValuationType');
5037
+
5038
+ module.exports = (() => {
5039
+ 'use strict';
5040
+
5041
+ /**
5042
+ * The schemas which can be used to represent position objects.
5043
+ *
5044
+ * @public
5045
+ * @extends {Enum}
5046
+ */
5047
+ class PositionSchema extends Enum {
5048
+ constructor(schema) {
5049
+ super(schema.name, schema.name);
5050
+
5051
+ this._schema = schema;
5052
+ }
5053
+
5054
+ /**
5055
+ * The actual {@link Schema}.
5056
+ *
5057
+ * @public
5058
+ * @returns {Schema}
5059
+ */
5060
+ get schema() {
5061
+ return this._schema;
5062
+ }
5063
+
5064
+ /**
5065
+ * The complete position schema.
5066
+ *
5067
+ * @static
5068
+ * @public
5069
+ * @returns {PositionSchema}
5070
+ */
5071
+ static get COMPLETE() {
5072
+ return complete;
5073
+ }
5074
+
5075
+ /**
5076
+ * Position data transmitted to the client, omitting some system data.
5077
+ *
5078
+ * @static
5079
+ * @public
5080
+ * @returns {PositionSchema}
5081
+ */
5082
+ static get CLIENT() {
5083
+ return client;
5084
+ }
5085
+
5086
+ /**
5087
+ * Data required to update a position.
5088
+ *
5089
+ * @static
5090
+ * @public
5091
+ * @returns {PositionSchema}
5092
+ */
5093
+ static get UPDATE() {
5094
+ return update;
5095
+ }
5096
+
5097
+ /**
5098
+ * Result item for query of positions by symbol.
5099
+ *
5100
+ * @static
5101
+ * @public
5102
+ * @returns {PositionSchema}
5103
+ */
5104
+ static get SIMPLE() {
5105
+ return simple;
5106
+ }
5107
+
5108
+ toString() {
5109
+ return '[PositionSchema]';
5110
+ }
5111
+ }
5112
+
5113
+ const complete = new PositionSchema(SchemaBuilder.withName('complete')
5114
+ .withField('user', DataType.STRING)
5115
+ .withField('portfolio', DataType.STRING)
5116
+ .withField('instrument.id', DataType.STRING)
5117
+ .withField('instrument.name', DataType.STRING)
5118
+ .withField('instrument.type', DataType.forEnum(InstrumentType, 'InstrumentType'))
5119
+ .withField('instrument.currency', DataType.forEnum(Currency, 'Currency'))
5120
+ .withField('instrument.delist', DataType.DAY, true)
5121
+ .withField('instrument.symbol.barchart', DataType.STRING, true)
5122
+ .withField('instrument.symbol.display', DataType.STRING, true)
5123
+ .withField('position', DataType.STRING)
5124
+ .withField('open', DataType.BOOLEAN, true)
5125
+ .withField('transaction', DataType.NUMBER)
5126
+ .withField('cash', DataType.BOOLEAN, true)
5127
+ .withField('reinvest', DataType.BOOLEAN, true)
5128
+ .withField('valuation', DataType.forEnum(ValuationType, 'ValuationType'))
5129
+ .withField('snapshot.date', DataType.DAY)
5130
+ .withField('snapshot.open', DataType.DECIMAL)
5131
+ .withField('snapshot.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
5132
+ .withField('snapshot.buys', DataType.DECIMAL)
5133
+ .withField('snapshot.sells', DataType.DECIMAL)
5134
+ .withField('snapshot.gain', DataType.DECIMAL)
5135
+ .withField('snapshot.basis', DataType.DECIMAL)
5136
+ .withField('snapshot.income', DataType.DECIMAL)
5137
+ .withField('snapshot.value', DataType.DECIMAL)
5138
+ .withField('legacy.system', DataType.STRING, true)
5139
+ .withField('legacy.user', DataType.STRING, true)
5140
+ .withField('legacy.portfolio', DataType.STRING, true)
5141
+ .withField('legacy.position', DataType.STRING, true)
5142
+ .withField('system.version', DataType.NUMBER, true)
5143
+ .withField('system.calculate.processors', DataType.NUMBER, true)
5144
+ .withField('system.locked', DataType.BOOLEAN, true)
5145
+ .withField('root', DataType.STRING, true)
5146
+ .schema
5147
+ );
5148
+
5149
+ const client = new PositionSchema(SchemaBuilder.withName('client')
5150
+ .withField('user', DataType.STRING)
5151
+ .withField('portfolio', DataType.STRING)
5152
+ .withField('instrument.id', DataType.STRING)
5153
+ .withField('instrument.name', DataType.STRING)
5154
+ .withField('instrument.type', DataType.forEnum(InstrumentType, 'InstrumentType'))
5155
+ .withField('instrument.currency', DataType.forEnum(Currency, 'Currency'))
5156
+ .withField('instrument.delist', DataType.DAY, true)
5157
+ .withField('instrument.symbol.barchart', DataType.STRING, true)
5158
+ .withField('instrument.symbol.display', DataType.STRING, true)
5159
+ .withField('position', DataType.STRING)
5160
+ .withField('open', DataType.BOOLEAN, true)
5161
+ .withField('transaction', DataType.NUMBER)
5162
+ .withField('cash', DataType.BOOLEAN, true)
5163
+ .withField('reinvest', DataType.BOOLEAN, true)
5164
+ .withField('valuation', DataType.forEnum(ValuationType, 'ValuationType'))
5165
+ .withField('snapshot.date', DataType.DAY)
5166
+ .withField('snapshot.open', DataType.DECIMAL)
5167
+ .withField('snapshot.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
5168
+ .withField('snapshot.buys', DataType.DECIMAL)
5169
+ .withField('snapshot.sells', DataType.DECIMAL)
5170
+ .withField('snapshot.gain', DataType.DECIMAL)
5171
+ .withField('snapshot.basis', DataType.DECIMAL)
5172
+ .withField('snapshot.income', DataType.DECIMAL)
5173
+ .withField('snapshot.value', DataType.DECIMAL)
5174
+ .withField('system.calculate.processors', DataType.NUMBER, true)
5175
+ .withField('system.locked', DataType.BOOLEAN, true)
5176
+ .withField('previous', DataType.NUMBER, true)
5177
+ .schema
5178
+ );
5179
+
5180
+ const update = new PositionSchema(SchemaBuilder.withName('update')
5181
+ .withField('portfolio', DataType.STRING)
5182
+ .withField('position', DataType.STRING)
5183
+ .withField('mapping.name', DataType.STRING, true)
5184
+ .withField('mapping.type', DataType.forEnum(InstrumentType, 'InstrumentType'), true)
5185
+ .withField('mapping.currency', DataType.forEnum(Currency, 'Currency'), true)
5186
+ .withField('mapping.symbol.barchart', DataType.STRING, true)
5187
+ .withField('mapping.symbol.display', DataType.STRING, true)
5188
+ .withField('cash', DataType.BOOLEAN, true)
5189
+ .withField('reinvest', DataType.BOOLEAN, true)
5190
+ .schema
5191
+ );
5192
+
5193
+ const simple = new PositionSchema(SchemaBuilder.withName('simple')
5194
+ .withField('user', DataType.STRING)
5195
+ .withField('portfolio', DataType.STRING)
5196
+ .withField('instrument.id', DataType.STRING)
5197
+ .withField('instrument.name', DataType.STRING)
5198
+ .withField('instrument.symbol.barchart', DataType.STRING, true)
5199
+ .withField('instrument.symbol.display', DataType.STRING, true)
5200
+ .withField('position', DataType.STRING)
5201
+ .withField('open', DataType.BOOLEAN, true)
5202
+ .schema
5203
+ );
5204
+
5205
+ return PositionSchema;
5206
+ })();
5207
+
5208
+ },{"./../data/InstrumentType":1,"./../data/PositionDirection":2,"./../data/ValuationType":6,"@barchart/common-js/lang/Currency":22,"@barchart/common-js/lang/Enum":26,"@barchart/common-js/serialization/json/DataType":39,"@barchart/common-js/serialization/json/Schema":41,"@barchart/common-js/serialization/json/builders/SchemaBuilder":43}],14:[function(require,module,exports){
4967
5209
  const is = require('@barchart/common-js/lang/is'),
4968
5210
  Currency = require('@barchart/common-js/lang/Currency'),
4969
5211
  DataType = require('@barchart/common-js/serialization/json/DataType'),
@@ -5345,7 +5587,7 @@ module.exports = (() => {
5345
5587
  return TransactionSchema;
5346
5588
  })();
5347
5589
 
5348
- },{"./../data/InstrumentType":1,"./../data/PositionDirection":2,"./../data/TransactionType":4,"@barchart/common-js/lang/Currency":20,"@barchart/common-js/lang/Enum":24,"@barchart/common-js/lang/is":33,"@barchart/common-js/serialization/json/DataType":37,"@barchart/common-js/serialization/json/Schema":39,"@barchart/common-js/serialization/json/builders/SchemaBuilder":41}],13:[function(require,module,exports){
5590
+ },{"./../data/InstrumentType":1,"./../data/PositionDirection":2,"./../data/TransactionType":4,"@barchart/common-js/lang/Currency":22,"@barchart/common-js/lang/Enum":26,"@barchart/common-js/lang/is":35,"@barchart/common-js/serialization/json/DataType":39,"@barchart/common-js/serialization/json/Schema":41,"@barchart/common-js/serialization/json/builders/SchemaBuilder":43}],15:[function(require,module,exports){
5349
5591
  module.exports = (() => {
5350
5592
  'use strict';
5351
5593
  /**
@@ -5424,7 +5666,7 @@ module.exports = (() => {
5424
5666
  return LinkedList;
5425
5667
  })();
5426
5668
 
5427
- },{}],14:[function(require,module,exports){
5669
+ },{}],16:[function(require,module,exports){
5428
5670
  const assert = require('./../lang/assert');
5429
5671
 
5430
5672
  module.exports = (() => {
@@ -5529,7 +5771,7 @@ module.exports = (() => {
5529
5771
  return Stack;
5530
5772
  })();
5531
5773
 
5532
- },{"./../lang/assert":29}],15:[function(require,module,exports){
5774
+ },{"./../lang/assert":31}],17:[function(require,module,exports){
5533
5775
  const is = require('./../lang/is');
5534
5776
 
5535
5777
  module.exports = (() => {
@@ -5847,7 +6089,7 @@ module.exports = (() => {
5847
6089
  return Tree;
5848
6090
  })();
5849
6091
 
5850
- },{"./../lang/is":33}],16:[function(require,module,exports){
6092
+ },{"./../lang/is":35}],18:[function(require,module,exports){
5851
6093
  const assert = require('./../../lang/assert'),
5852
6094
  comparators = require('./comparators');
5853
6095
 
@@ -5966,7 +6208,7 @@ module.exports = (() => {
5966
6208
  return ComparatorBuilder;
5967
6209
  })();
5968
6210
 
5969
- },{"./../../lang/assert":29,"./comparators":17}],17:[function(require,module,exports){
6211
+ },{"./../../lang/assert":31,"./comparators":19}],19:[function(require,module,exports){
5970
6212
  const assert = require('./../../lang/assert');
5971
6213
 
5972
6214
  module.exports = (() => {
@@ -6056,7 +6298,7 @@ module.exports = (() => {
6056
6298
  };
6057
6299
  })();
6058
6300
 
6059
- },{"./../../lang/assert":29}],18:[function(require,module,exports){
6301
+ },{"./../../lang/assert":31}],20:[function(require,module,exports){
6060
6302
  const Stack = require('./../Stack');
6061
6303
 
6062
6304
  const assert = require('./../../lang/assert'),
@@ -6135,7 +6377,7 @@ module.exports = (() => {
6135
6377
  return DisposableStack;
6136
6378
  })();
6137
6379
 
6138
- },{"./../../lang/Disposable":23,"./../../lang/assert":29,"./../../lang/is":33,"./../Stack":14}],19:[function(require,module,exports){
6380
+ },{"./../../lang/Disposable":25,"./../../lang/assert":31,"./../../lang/is":35,"./../Stack":16}],21:[function(require,module,exports){
6139
6381
  const assert = require('./assert');
6140
6382
 
6141
6383
  module.exports = (() => {
@@ -6201,7 +6443,7 @@ module.exports = (() => {
6201
6443
  return AdHoc;
6202
6444
  })();
6203
6445
 
6204
- },{"./assert":29}],20:[function(require,module,exports){
6446
+ },{"./assert":31}],22:[function(require,module,exports){
6205
6447
  const assert = require('./assert'),
6206
6448
  Enum = require('./Enum'),
6207
6449
  is = require('./is');
@@ -6307,7 +6549,7 @@ module.exports = (() => {
6307
6549
  return Currency;
6308
6550
  })();
6309
6551
 
6310
- },{"./Enum":24,"./assert":29,"./is":33}],21:[function(require,module,exports){
6552
+ },{"./Enum":26,"./assert":31,"./is":35}],23:[function(require,module,exports){
6311
6553
  const assert = require('./assert'),
6312
6554
  ComparatorBuilder = require('./../collections/sorting/ComparatorBuilder'),
6313
6555
  comparators = require('./../collections/sorting/comparators'),
@@ -6826,7 +7068,7 @@ module.exports = (() => {
6826
7068
  return Day;
6827
7069
  })();
6828
7070
 
6829
- },{"./../collections/sorting/ComparatorBuilder":16,"./../collections/sorting/comparators":17,"./assert":29,"./is":33}],22:[function(require,module,exports){
7071
+ },{"./../collections/sorting/ComparatorBuilder":18,"./../collections/sorting/comparators":19,"./assert":31,"./is":35}],24:[function(require,module,exports){
6830
7072
  const assert = require('./assert'),
6831
7073
  Enum = require('./Enum'),
6832
7074
  is = require('./is');
@@ -7408,7 +7650,7 @@ module.exports = (() => {
7408
7650
  return Decimal;
7409
7651
  })();
7410
7652
 
7411
- },{"./Enum":24,"./assert":29,"./is":33,"big.js":42}],23:[function(require,module,exports){
7653
+ },{"./Enum":26,"./assert":31,"./is":35,"big.js":44}],25:[function(require,module,exports){
7412
7654
  const assert = require('./assert');
7413
7655
 
7414
7656
  module.exports = (() => {
@@ -7519,7 +7761,7 @@ module.exports = (() => {
7519
7761
  return Disposable;
7520
7762
  })();
7521
7763
 
7522
- },{"./assert":29}],24:[function(require,module,exports){
7764
+ },{"./assert":31}],26:[function(require,module,exports){
7523
7765
  const assert = require('./assert');
7524
7766
 
7525
7767
  module.exports = (() => {
@@ -7639,7 +7881,7 @@ module.exports = (() => {
7639
7881
  return Enum;
7640
7882
  })();
7641
7883
 
7642
- },{"./assert":29}],25:[function(require,module,exports){
7884
+ },{"./assert":31}],27:[function(require,module,exports){
7643
7885
  const assert = require('./assert'),
7644
7886
  is = require('./is');
7645
7887
 
@@ -7740,7 +7982,7 @@ module.exports = (() => {
7740
7982
  return Money;
7741
7983
  })();
7742
7984
 
7743
- },{"./Currency":20,"./Decimal":22,"./assert":29,"./is":33}],26:[function(require,module,exports){
7985
+ },{"./Currency":22,"./Decimal":24,"./assert":31,"./is":35}],28:[function(require,module,exports){
7744
7986
  const assert = require('./assert'),
7745
7987
  memoize = require('./memoize');
7746
7988
 
@@ -7952,7 +8194,7 @@ module.exports = (() => {
7952
8194
  return Rate;
7953
8195
  })();
7954
8196
 
7955
- },{"./Currency":20,"./Decimal":22,"./assert":29,"./memoize":34}],27:[function(require,module,exports){
8197
+ },{"./Currency":22,"./Decimal":24,"./assert":31,"./memoize":36}],29:[function(require,module,exports){
7956
8198
  const assert = require('./assert'),
7957
8199
  is = require('./is');
7958
8200
 
@@ -8064,7 +8306,7 @@ module.exports = (() => {
8064
8306
  return Timestamp;
8065
8307
  })();
8066
8308
 
8067
- },{"./assert":29,"./is":33,"moment-timezone":44}],28:[function(require,module,exports){
8309
+ },{"./assert":31,"./is":35,"moment-timezone":46}],30:[function(require,module,exports){
8068
8310
  const assert = require('./assert'),
8069
8311
  is = require('./is');
8070
8312
 
@@ -8519,7 +8761,7 @@ module.exports = (() => {
8519
8761
  }
8520
8762
  })();
8521
8763
 
8522
- },{"./assert":29,"./is":33}],29:[function(require,module,exports){
8764
+ },{"./assert":31,"./is":35}],31:[function(require,module,exports){
8523
8765
  const is = require('./is');
8524
8766
 
8525
8767
  module.exports = (() => {
@@ -8664,7 +8906,7 @@ module.exports = (() => {
8664
8906
  };
8665
8907
  })();
8666
8908
 
8667
- },{"./is":33}],30:[function(require,module,exports){
8909
+ },{"./is":35}],32:[function(require,module,exports){
8668
8910
  const assert = require('./assert'),
8669
8911
  is = require('./is');
8670
8912
 
@@ -8827,7 +9069,7 @@ module.exports = (() => {
8827
9069
  };
8828
9070
  })();
8829
9071
 
8830
- },{"./assert":29,"./is":33}],31:[function(require,module,exports){
9072
+ },{"./assert":31,"./is":35}],33:[function(require,module,exports){
8831
9073
  module.exports = (() => {
8832
9074
  'use strict';
8833
9075
 
@@ -8887,7 +9129,7 @@ module.exports = (() => {
8887
9129
  };
8888
9130
  })();
8889
9131
 
8890
- },{}],32:[function(require,module,exports){
9132
+ },{}],34:[function(require,module,exports){
8891
9133
  module.exports = (() => {
8892
9134
  'use strict';
8893
9135
 
@@ -8930,7 +9172,7 @@ module.exports = (() => {
8930
9172
  };
8931
9173
  })();
8932
9174
 
8933
- },{}],33:[function(require,module,exports){
9175
+ },{}],35:[function(require,module,exports){
8934
9176
  module.exports = (() => {
8935
9177
  'use strict';
8936
9178
  /**
@@ -8942,7 +9184,7 @@ module.exports = (() => {
8942
9184
 
8943
9185
  return {
8944
9186
  /**
8945
- * Returns true, if the argument is a number. NaN will return false.
9187
+ * Returns true if the argument is a number. NaN will return false.
8946
9188
  *
8947
9189
  * @static
8948
9190
  * @public
@@ -8954,7 +9196,7 @@ module.exports = (() => {
8954
9196
  },
8955
9197
 
8956
9198
  /**
8957
- * Returns true, if the argument is NaN.
9199
+ * Returns true if the argument is NaN.
8958
9200
  *
8959
9201
  * @static
8960
9202
  * @public
@@ -8966,7 +9208,7 @@ module.exports = (() => {
8966
9208
  },
8967
9209
 
8968
9210
  /**
8969
- * Returns true, if the argument is a valid 32-bit integer.
9211
+ * Returns true if the argument is a valid 32-bit integer.
8970
9212
  *
8971
9213
  * @static
8972
9214
  * @public
@@ -8978,7 +9220,7 @@ module.exports = (() => {
8978
9220
  },
8979
9221
 
8980
9222
  /**
8981
- * Returns true, if the argument is a valid integer (which can exceed 32 bits); however,
9223
+ * Returns true if the argument is a valid integer (which can exceed 32 bits); however,
8982
9224
  * the check can fail above the value of Number.MAX_SAFE_INTEGER.
8983
9225
  *
8984
9226
  * @static
@@ -8991,7 +9233,7 @@ module.exports = (() => {
8991
9233
  },
8992
9234
 
8993
9235
  /**
8994
- * Returns true, if the argument is a number that is positive.
9236
+ * Returns true if the argument is a number that is positive.
8995
9237
  *
8996
9238
  * @static
8997
9239
  * @public
@@ -9003,7 +9245,7 @@ module.exports = (() => {
9003
9245
  },
9004
9246
 
9005
9247
  /**
9006
- * Returns true, if the argument is a number that is negative.
9248
+ * Returns true if the argument is a number that is negative.
9007
9249
  *
9008
9250
  * @static
9009
9251
  * @public
@@ -9015,7 +9257,19 @@ module.exports = (() => {
9015
9257
  },
9016
9258
 
9017
9259
  /**
9018
- * Returns true, if the argument is a string.
9260
+ * Returns true if the argument is iterable.
9261
+ *
9262
+ * @static
9263
+ * @public
9264
+ * @param {*} candidate
9265
+ * @returns {boolean}
9266
+ */
9267
+ iterable(candidate) {
9268
+ return !this.null(candidate) && !this.undefined(candidate) && this.fn(candidate[Symbol.iterator]);
9269
+ },
9270
+
9271
+ /**
9272
+ * Returns true if the argument is a string.
9019
9273
  *
9020
9274
  * @static
9021
9275
  * @public
@@ -9027,7 +9281,7 @@ module.exports = (() => {
9027
9281
  },
9028
9282
 
9029
9283
  /**
9030
- * Returns true, if the argument is a JavaScript Date instance.
9284
+ * Returns true if the argument is a JavaScript Date instance.
9031
9285
  *
9032
9286
  * @static
9033
9287
  * @public
@@ -9039,7 +9293,7 @@ module.exports = (() => {
9039
9293
  },
9040
9294
 
9041
9295
  /**
9042
- * Returns true, if the argument is a function.
9296
+ * Returns true if the argument is a function.
9043
9297
  *
9044
9298
  * @static
9045
9299
  * @public
@@ -9051,7 +9305,7 @@ module.exports = (() => {
9051
9305
  },
9052
9306
 
9053
9307
  /**
9054
- * Returns true, if the argument is an array.
9308
+ * Returns true if the argument is an array.
9055
9309
  *
9056
9310
  * @static
9057
9311
  * @public
@@ -9063,7 +9317,7 @@ module.exports = (() => {
9063
9317
  },
9064
9318
 
9065
9319
  /**
9066
- * Returns true, if the argument is a Boolean value.
9320
+ * Returns true if the argument is a Boolean value.
9067
9321
  *
9068
9322
  * @static
9069
9323
  * @public
@@ -9075,7 +9329,7 @@ module.exports = (() => {
9075
9329
  },
9076
9330
 
9077
9331
  /**
9078
- * Returns true, if the argument is an object.
9332
+ * Returns true if the argument is an object.
9079
9333
  *
9080
9334
  * @static
9081
9335
  * @public
@@ -9087,7 +9341,7 @@ module.exports = (() => {
9087
9341
  },
9088
9342
 
9089
9343
  /**
9090
- * Returns true, if the argument is a null value.
9344
+ * Returns true if the argument is a null value.
9091
9345
  *
9092
9346
  * @static
9093
9347
  * @public
@@ -9099,7 +9353,7 @@ module.exports = (() => {
9099
9353
  },
9100
9354
 
9101
9355
  /**
9102
- * Returns true, if the argument is an undefined value.
9356
+ * Returns true if the argument is an undefined value.
9103
9357
  *
9104
9358
  * @static
9105
9359
  * @public
@@ -9110,6 +9364,18 @@ module.exports = (() => {
9110
9364
  return candidate === undefined;
9111
9365
  },
9112
9366
 
9367
+ /**
9368
+ * Returns true if the argument is a zero-length string.
9369
+ *
9370
+ * @static
9371
+ * @public
9372
+ * @param {*} candidate
9373
+ * @returns {boolean}
9374
+ */
9375
+ zeroLengthString(candidate) {
9376
+ return this.string(candidate) && candidate.length === 0;
9377
+ },
9378
+
9113
9379
  /**
9114
9380
  * Given two classes, determines if the "child" class extends
9115
9381
  * the "parent" class (without instantiation).
@@ -9125,7 +9391,7 @@ module.exports = (() => {
9125
9391
  };
9126
9392
  })();
9127
9393
 
9128
- },{}],34:[function(require,module,exports){
9394
+ },{}],36:[function(require,module,exports){
9129
9395
  const assert = require('./assert');
9130
9396
 
9131
9397
  module.exports = (() => {
@@ -9149,11 +9415,11 @@ module.exports = (() => {
9149
9415
  simple(fn) {
9150
9416
  const cache = {};
9151
9417
  return x => {
9152
- if (cache.hasOwnProperty(x)) {
9153
- return cache[x];
9154
- } else {
9155
- return cache[x] = fn(x);
9418
+ if (!cache.hasOwnProperty(x)) {
9419
+ cache[x] = fn(x);
9156
9420
  }
9421
+
9422
+ return cache[x];
9157
9423
  };
9158
9424
  },
9159
9425
 
@@ -9189,7 +9455,7 @@ module.exports = (() => {
9189
9455
  };
9190
9456
  })();
9191
9457
 
9192
- },{"./assert":29}],35:[function(require,module,exports){
9458
+ },{"./assert":31}],37:[function(require,module,exports){
9193
9459
  const assert = require('./../lang/assert'),
9194
9460
  Disposable = require('./../lang/Disposable');
9195
9461
 
@@ -9321,7 +9587,7 @@ module.exports = (() => {
9321
9587
  return Event;
9322
9588
  })();
9323
9589
 
9324
- },{"./../lang/Disposable":23,"./../lang/assert":29}],36:[function(require,module,exports){
9590
+ },{"./../lang/Disposable":25,"./../lang/assert":31}],38:[function(require,module,exports){
9325
9591
  const Currency = require('./../../lang/Currency'),
9326
9592
  Money = require('./../../lang/Money');
9327
9593
 
@@ -9397,7 +9663,7 @@ module.exports = (() => {
9397
9663
  return Component;
9398
9664
  })();
9399
9665
 
9400
- },{"./../../lang/Currency":20,"./../../lang/Money":25,"./DataType":37,"./Field":38}],37:[function(require,module,exports){
9666
+ },{"./../../lang/Currency":22,"./../../lang/Money":27,"./DataType":39,"./Field":40}],39:[function(require,module,exports){
9401
9667
  const moment = require('moment');
9402
9668
 
9403
9669
  const AdHoc = require('./../../lang/AdHoc'),
@@ -9713,7 +9979,7 @@ module.exports = (() => {
9713
9979
  return DataType;
9714
9980
  })();
9715
9981
 
9716
- },{"./../../lang/AdHoc":19,"./../../lang/Day":21,"./../../lang/Decimal":22,"./../../lang/Enum":24,"./../../lang/Timestamp":27,"./../../lang/assert":29,"./../../lang/is":33,"moment":46}],38:[function(require,module,exports){
9982
+ },{"./../../lang/AdHoc":21,"./../../lang/Day":23,"./../../lang/Decimal":24,"./../../lang/Enum":26,"./../../lang/Timestamp":29,"./../../lang/assert":31,"./../../lang/is":35,"moment":48}],40:[function(require,module,exports){
9717
9983
  module.exports = (() => {
9718
9984
  'use strict';
9719
9985
  /**
@@ -9774,7 +10040,7 @@ module.exports = (() => {
9774
10040
  return Field;
9775
10041
  })();
9776
10042
 
9777
- },{}],39:[function(require,module,exports){
10043
+ },{}],41:[function(require,module,exports){
9778
10044
  const attributes = require('./../../lang/attributes'),
9779
10045
  functions = require('./../../lang/functions'),
9780
10046
  is = require('./../../lang/is');
@@ -10097,7 +10363,7 @@ module.exports = (() => {
10097
10363
  return Schema;
10098
10364
  })();
10099
10365
 
10100
- },{"./../../collections/LinkedList":13,"./../../collections/Tree":15,"./../../lang/attributes":30,"./../../lang/functions":32,"./../../lang/is":33,"./Component":36,"./Field":38}],40:[function(require,module,exports){
10366
+ },{"./../../collections/LinkedList":15,"./../../collections/Tree":17,"./../../lang/attributes":32,"./../../lang/functions":34,"./../../lang/is":35,"./Component":38,"./Field":40}],42:[function(require,module,exports){
10101
10367
  const assert = require('./../../../lang/assert');
10102
10368
 
10103
10369
  const Component = require('./../Component'),
@@ -10172,7 +10438,7 @@ module.exports = (() => {
10172
10438
  return ComponentBuilder;
10173
10439
  })();
10174
10440
 
10175
- },{"./../../../lang/assert":29,"./../Component":36,"./../DataType":37,"./../Field":38}],41:[function(require,module,exports){
10441
+ },{"./../../../lang/assert":31,"./../Component":38,"./../DataType":39,"./../Field":40}],43:[function(require,module,exports){
10176
10442
  const assert = require('./../../../lang/assert'),
10177
10443
  is = require('./../../../lang/is');
10178
10444
 
@@ -10286,11 +10552,11 @@ module.exports = (() => {
10286
10552
  return SchemaBuilder;
10287
10553
  })();
10288
10554
 
10289
- },{"./../../../lang/assert":29,"./../../../lang/is":33,"./../Component":36,"./../DataType":37,"./../Field":38,"./../Schema":39,"./ComponentBuilder":40}],42:[function(require,module,exports){
10555
+ },{"./../../../lang/assert":31,"./../../../lang/is":35,"./../Component":38,"./../DataType":39,"./../Field":40,"./../Schema":41,"./ComponentBuilder":42}],44:[function(require,module,exports){
10290
10556
  /*
10291
- * big.js v5.0.3
10557
+ * big.js v5.2.2
10292
10558
  * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
10293
- * Copyright (c) 2017 Michael Mclaughlin <M8ch88l@gmail.com>
10559
+ * Copyright (c) 2018 Michael Mclaughlin <M8ch88l@gmail.com>
10294
10560
  * https://github.com/MikeMcl/big.js/LICENCE
10295
10561
  */
10296
10562
  ;(function (GLOBAL) {
@@ -10396,7 +10662,7 @@ module.exports = (() => {
10396
10662
  Big.RM = RM;
10397
10663
  Big.NE = NE;
10398
10664
  Big.PE = PE;
10399
- Big.version = '5.0.2';
10665
+ Big.version = '5.2.2';
10400
10666
 
10401
10667
  return Big;
10402
10668
  }
@@ -10480,7 +10746,7 @@ module.exports = (() => {
10480
10746
  more = xc[i] > 5 || xc[i] == 5 &&
10481
10747
  (more || i < 0 || xc[i + 1] !== UNDEFINED || xc[i - 1] & 1);
10482
10748
  } else if (rm === 3) {
10483
- more = more || xc[i] !== UNDEFINED || i < 0;
10749
+ more = more || !!xc[0];
10484
10750
  } else {
10485
10751
  more = false;
10486
10752
  if (rm !== 0) throw Error(INVALID_RM);
@@ -10947,7 +11213,7 @@ module.exports = (() => {
10947
11213
  xc = xc.slice();
10948
11214
 
10949
11215
  // Prepend zeros to equalise exponents.
10950
- // Note: Faster to use reverse then do unshifts.
11216
+ // Note: reverse faster than unshifts.
10951
11217
  if (a = xe - ye) {
10952
11218
  if (a > 0) {
10953
11219
  ye = xe;
@@ -11019,18 +11285,19 @@ module.exports = (() => {
11019
11285
 
11020
11286
 
11021
11287
  /*
11022
- * Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal
11023
- * places using rounding mode rm.
11288
+ * Return a new Big whose value is the value of this Big rounded using rounding mode rm
11289
+ * to a maximum of dp decimal places, or, if dp is negative, to an integer which is a
11290
+ * multiple of 10**-dp.
11024
11291
  * If dp is not specified, round to 0 decimal places.
11025
11292
  * If rm is not specified, use Big.RM.
11026
11293
  *
11027
- * dp? {number} Integer, 0 to MAX_DP inclusive.
11294
+ * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.
11028
11295
  * rm? 0, 1, 2 or 3 (ROUND_DOWN, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_UP)
11029
11296
  */
11030
11297
  P.round = function (dp, rm) {
11031
11298
  var Big = this.constructor;
11032
11299
  if (dp === UNDEFINED) dp = 0;
11033
- else if (dp !== ~~dp || dp < 0 || dp > MAX_DP) throw Error(INVALID_DP);
11300
+ else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) throw Error(INVALID_DP);
11034
11301
  return round(new Big(this), dp, rm === UNDEFINED ? Big.RM : rm);
11035
11302
  };
11036
11303
 
@@ -11054,17 +11321,18 @@ module.exports = (() => {
11054
11321
  if (s < 0) throw Error(NAME + 'No square root');
11055
11322
 
11056
11323
  // Estimate.
11057
- s = Math.sqrt(x.toString());
11324
+ s = Math.sqrt(x + '');
11058
11325
 
11059
11326
  // Math.sqrt underflow/overflow?
11060
- // Re-estimate: pass x to Math.sqrt as integer, then adjust the result exponent.
11327
+ // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.
11061
11328
  if (s === 0 || s === 1 / 0) {
11062
11329
  c = x.c.join('');
11063
11330
  if (!(c.length + e & 1)) c += '0';
11064
- r = new Big(Math.sqrt(c).toString());
11065
- r.e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);
11331
+ s = Math.sqrt(c);
11332
+ e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);
11333
+ r = new Big((s == 1 / 0 ? '1e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);
11066
11334
  } else {
11067
- r = new Big(s.toString());
11335
+ r = new Big(s);
11068
11336
  }
11069
11337
 
11070
11338
  e = r.e + (Big.DP += 4);
@@ -11227,7 +11495,7 @@ module.exports = (() => {
11227
11495
  }
11228
11496
  })(this);
11229
11497
 
11230
- },{}],43:[function(require,module,exports){
11498
+ },{}],45:[function(require,module,exports){
11231
11499
  module.exports={
11232
11500
  "version": "2019b",
11233
11501
  "zones": [
@@ -11828,11 +12096,11 @@ module.exports={
11828
12096
  "Pacific/Tarawa|Pacific/Wallis"
11829
12097
  ]
11830
12098
  }
11831
- },{}],44:[function(require,module,exports){
12099
+ },{}],46:[function(require,module,exports){
11832
12100
  var moment = module.exports = require("./moment-timezone");
11833
12101
  moment.tz.load(require('./data/packed/latest.json'));
11834
12102
 
11835
- },{"./data/packed/latest.json":43,"./moment-timezone":45}],45:[function(require,module,exports){
12103
+ },{"./data/packed/latest.json":45,"./moment-timezone":47}],47:[function(require,module,exports){
11836
12104
  //! moment-timezone.js
11837
12105
  //! version : 0.5.26
11838
12106
  //! Copyright (c) JS Foundation and other contributors
@@ -12461,7 +12729,7 @@ moment.tz.load(require('./data/packed/latest.json'));
12461
12729
  return moment;
12462
12730
  }));
12463
12731
 
12464
- },{"moment":46}],46:[function(require,module,exports){
12732
+ },{"moment":48}],48:[function(require,module,exports){
12465
12733
  //! moment.js
12466
12734
 
12467
12735
  ;(function (global, factory) {
@@ -17065,7 +17333,7 @@ moment.tz.load(require('./data/packed/latest.json'));
17065
17333
 
17066
17334
  })));
17067
17335
 
17068
- },{}],47:[function(require,module,exports){
17336
+ },{}],49:[function(require,module,exports){
17069
17337
  var v1 = require('./v1');
17070
17338
  var v4 = require('./v4');
17071
17339
 
@@ -17075,7 +17343,7 @@ uuid.v4 = v4;
17075
17343
 
17076
17344
  module.exports = uuid;
17077
17345
 
17078
- },{"./v1":50,"./v4":51}],48:[function(require,module,exports){
17346
+ },{"./v1":52,"./v4":53}],50:[function(require,module,exports){
17079
17347
  /**
17080
17348
  * Convert array of 16 byte values to UUID string format of the form:
17081
17349
  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
@@ -17088,43 +17356,48 @@ for (var i = 0; i < 256; ++i) {
17088
17356
  function bytesToUuid(buf, offset) {
17089
17357
  var i = offset || 0;
17090
17358
  var bth = byteToHex;
17091
- return bth[buf[i++]] + bth[buf[i++]] +
17092
- bth[buf[i++]] + bth[buf[i++]] + '-' +
17093
- bth[buf[i++]] + bth[buf[i++]] + '-' +
17094
- bth[buf[i++]] + bth[buf[i++]] + '-' +
17095
- bth[buf[i++]] + bth[buf[i++]] + '-' +
17096
- bth[buf[i++]] + bth[buf[i++]] +
17097
- bth[buf[i++]] + bth[buf[i++]] +
17098
- bth[buf[i++]] + bth[buf[i++]];
17359
+ // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
17360
+ return ([
17361
+ bth[buf[i++]], bth[buf[i++]],
17362
+ bth[buf[i++]], bth[buf[i++]], '-',
17363
+ bth[buf[i++]], bth[buf[i++]], '-',
17364
+ bth[buf[i++]], bth[buf[i++]], '-',
17365
+ bth[buf[i++]], bth[buf[i++]], '-',
17366
+ bth[buf[i++]], bth[buf[i++]],
17367
+ bth[buf[i++]], bth[buf[i++]],
17368
+ bth[buf[i++]], bth[buf[i++]]
17369
+ ]).join('');
17099
17370
  }
17100
17371
 
17101
17372
  module.exports = bytesToUuid;
17102
17373
 
17103
- },{}],49:[function(require,module,exports){
17104
- (function (global){
17374
+ },{}],51:[function(require,module,exports){
17105
17375
  // Unique ID creation requires a high quality random # generator. In the
17106
17376
  // browser this is a little complicated due to unknown quality of Math.random()
17107
17377
  // and inconsistent support for the `crypto` API. We do the best we can via
17108
17378
  // feature-detection
17109
- var rng;
17110
17379
 
17111
- var crypto = global.crypto || global.msCrypto; // for IE 11
17112
- if (crypto && crypto.getRandomValues) {
17380
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto
17381
+ // implementation. Also, find the complete implementation of crypto on IE11.
17382
+ var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
17383
+ (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
17384
+
17385
+ if (getRandomValues) {
17113
17386
  // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
17114
17387
  var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
17115
- rng = function whatwgRNG() {
17116
- crypto.getRandomValues(rnds8);
17388
+
17389
+ module.exports = function whatwgRNG() {
17390
+ getRandomValues(rnds8);
17117
17391
  return rnds8;
17118
17392
  };
17119
- }
17120
-
17121
- if (!rng) {
17393
+ } else {
17122
17394
  // Math.random()-based (RNG)
17123
17395
  //
17124
17396
  // If all else fails, use Math.random(). It's fast, but is of unspecified
17125
17397
  // quality.
17126
17398
  var rnds = new Array(16);
17127
- rng = function() {
17399
+
17400
+ module.exports = function mathRNG() {
17128
17401
  for (var i = 0, r; i < 16; i++) {
17129
17402
  if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
17130
17403
  rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
@@ -17134,10 +17407,7 @@ if (!rng) {
17134
17407
  };
17135
17408
  }
17136
17409
 
17137
- module.exports = rng;
17138
-
17139
- }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
17140
- },{}],50:[function(require,module,exports){
17410
+ },{}],52:[function(require,module,exports){
17141
17411
  var rng = require('./lib/rng');
17142
17412
  var bytesToUuid = require('./lib/bytesToUuid');
17143
17413
 
@@ -17146,30 +17416,40 @@ var bytesToUuid = require('./lib/bytesToUuid');
17146
17416
  // Inspired by https://github.com/LiosK/UUID.js
17147
17417
  // and http://docs.python.org/library/uuid.html
17148
17418
 
17149
- // random #'s we need to init node and clockseq
17150
- var _seedBytes = rng();
17151
-
17152
- // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
17153
- var _nodeId = [
17154
- _seedBytes[0] | 0x01,
17155
- _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]
17156
- ];
17157
-
17158
- // Per 4.2.2, randomize (14 bit) clockseq
17159
- var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
17419
+ var _nodeId;
17420
+ var _clockseq;
17160
17421
 
17161
17422
  // Previous uuid creation time
17162
- var _lastMSecs = 0, _lastNSecs = 0;
17423
+ var _lastMSecs = 0;
17424
+ var _lastNSecs = 0;
17163
17425
 
17164
- // See https://github.com/broofa/node-uuid for API details
17426
+ // See https://github.com/uuidjs/uuid for API details
17165
17427
  function v1(options, buf, offset) {
17166
17428
  var i = buf && offset || 0;
17167
17429
  var b = buf || [];
17168
17430
 
17169
17431
  options = options || {};
17170
-
17432
+ var node = options.node || _nodeId;
17171
17433
  var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
17172
17434
 
17435
+ // node and clockseq need to be initialized to random values if they're not
17436
+ // specified. We do this lazily to minimize issues related to insufficient
17437
+ // system entropy. See #189
17438
+ if (node == null || clockseq == null) {
17439
+ var seedBytes = rng();
17440
+ if (node == null) {
17441
+ // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
17442
+ node = _nodeId = [
17443
+ seedBytes[0] | 0x01,
17444
+ seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
17445
+ ];
17446
+ }
17447
+ if (clockseq == null) {
17448
+ // Per 4.2.2, randomize (14 bit) clockseq
17449
+ clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
17450
+ }
17451
+ }
17452
+
17173
17453
  // UUID timestamps are 100 nano-second units since the Gregorian epoch,
17174
17454
  // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
17175
17455
  // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
@@ -17229,7 +17509,6 @@ function v1(options, buf, offset) {
17229
17509
  b[i++] = clockseq & 0xff;
17230
17510
 
17231
17511
  // `node`
17232
- var node = options.node || _nodeId;
17233
17512
  for (var n = 0; n < 6; ++n) {
17234
17513
  b[i + n] = node[n];
17235
17514
  }
@@ -17239,7 +17518,7 @@ function v1(options, buf, offset) {
17239
17518
 
17240
17519
  module.exports = v1;
17241
17520
 
17242
- },{"./lib/bytesToUuid":48,"./lib/rng":49}],51:[function(require,module,exports){
17521
+ },{"./lib/bytesToUuid":50,"./lib/rng":51}],53:[function(require,module,exports){
17243
17522
  var rng = require('./lib/rng');
17244
17523
  var bytesToUuid = require('./lib/bytesToUuid');
17245
17524
 
@@ -17247,7 +17526,7 @@ function v4(options, buf, offset) {
17247
17526
  var i = buf && offset || 0;
17248
17527
 
17249
17528
  if (typeof(options) == 'string') {
17250
- buf = options == 'binary' ? new Array(16) : null;
17529
+ buf = options === 'binary' ? new Array(16) : null;
17251
17530
  options = null;
17252
17531
  }
17253
17532
  options = options || {};
@@ -17270,7 +17549,7 @@ function v4(options, buf, offset) {
17270
17549
 
17271
17550
  module.exports = v4;
17272
17551
 
17273
- },{"./lib/bytesToUuid":48,"./lib/rng":49}],52:[function(require,module,exports){
17552
+ },{"./lib/bytesToUuid":50,"./lib/rng":51}],54:[function(require,module,exports){
17274
17553
  const Day = require('@barchart/common-js/lang/Day'),
17275
17554
  Decimal = require('@barchart/common-js/lang/Decimal');
17276
17555
 
@@ -17901,7 +18180,7 @@ describe('After the PositionSummaryFrame enumeration is initialized', () => {
17901
18180
  });
17902
18181
  });
17903
18182
 
17904
- },{"./../../../lib/data/PositionSummaryFrame":3,"./../../../lib/data/TransactionType":4,"@barchart/common-js/lang/Day":21,"@barchart/common-js/lang/Decimal":22}],53:[function(require,module,exports){
18183
+ },{"./../../../lib/data/PositionSummaryFrame":3,"./../../../lib/data/TransactionType":4,"@barchart/common-js/lang/Day":23,"@barchart/common-js/lang/Decimal":24}],55:[function(require,module,exports){
17905
18184
  const Day = require('@barchart/common-js/lang/Day');
17906
18185
 
17907
18186
  const TransactionType = require('./../../../lib/data/TransactionType'),
@@ -17996,7 +18275,7 @@ describe('When requesting all the user-initiated transaction types', () => {
17996
18275
  expect(userInitiated.length).toEqual(9);
17997
18276
  });
17998
18277
  });
17999
- },{"./../../../lib/data/TransactionType":4,"./../../../lib/data/TransactionValidator":5,"@barchart/common-js/lang/Day":21}],54:[function(require,module,exports){
18278
+ },{"./../../../lib/data/TransactionType":4,"./../../../lib/data/TransactionValidator":5,"@barchart/common-js/lang/Day":23}],56:[function(require,module,exports){
18000
18279
  const Currency = require('@barchart/common-js/lang/Currency'),
18001
18280
  Decimal = require('@barchart/common-js/lang/Decimal');
18002
18281
 
@@ -18183,7 +18462,73 @@ describe('When a position container data is gathered', () => {
18183
18462
  });
18184
18463
  });
18185
18464
 
18186
- },{"./../../../lib/data/InstrumentType":1,"./../../../lib/data/PositionSummaryFrame":3,"./../../../lib/processing/PositionContainer":6,"./../../../lib/processing/definitions/PositionLevelDefinition":9,"./../../../lib/processing/definitions/PositionLevelType":10,"./../../../lib/processing/definitions/PositionTreeDefinition":11,"@barchart/common-js/lang/Currency":20,"@barchart/common-js/lang/Decimal":22}],55:[function(require,module,exports){
18465
+ },{"./../../../lib/data/InstrumentType":1,"./../../../lib/data/PositionSummaryFrame":3,"./../../../lib/processing/PositionContainer":7,"./../../../lib/processing/definitions/PositionLevelDefinition":10,"./../../../lib/processing/definitions/PositionLevelType":11,"./../../../lib/processing/definitions/PositionTreeDefinition":12,"@barchart/common-js/lang/Currency":22,"@barchart/common-js/lang/Decimal":24}],57:[function(require,module,exports){
18466
+ const PositionSchema = require('./../../../lib/serialization/PositionSchema');
18467
+
18468
+ describe('When positions are serialized', () => {
18469
+ 'use strict';
18470
+
18471
+ describe('for a read operation (user error #1)', () => {
18472
+ let position;
18473
+ let serialized;
18474
+
18475
+ beforeEach(() => {
18476
+ position = {
18477
+ "user": "855e15c0-9e32-40ac-9bd9-5f0cc2780111",
18478
+ "portfolio": "c2a743e8-8efa-4a88-9a6c-9202d3fec29f",
18479
+ "instrument": {
18480
+ "id": "TGAM-CASH-USD",
18481
+ "name": "US Dollar",
18482
+ "type": "CASH",
18483
+ "currency": "USD"
18484
+ },
18485
+ "position": "a5cdc2e8-d9c6-4a1f-8f05-e271a5824f87",
18486
+ "transaction": 2987,
18487
+ "cash": true,
18488
+ "valuation": "AVG",
18489
+ "snapshot": {
18490
+ "date": "2020-06-11",
18491
+ "open": "222105.56",
18492
+ "direction": "LONG",
18493
+ "buys": "0",
18494
+ "sells": "0",
18495
+ "gain": "0",
18496
+ "basis": "0",
18497
+ "income": "0",
18498
+ "value": "0"
18499
+ },
18500
+ "system": {
18501
+ "calculate": {
18502
+ "processors": 1
18503
+ },
18504
+ "locked": false
18505
+ }
18506
+ };
18507
+
18508
+ serialized = JSON.stringify(position);
18509
+ });
18510
+
18511
+ describe('and the data is deserialized', () => {
18512
+ let deserialized;
18513
+
18514
+ beforeEach(() => {
18515
+ const reviver = PositionSchema.CLIENT.schema.getReviver();
18516
+
18517
+ deserialized = JSON.parse(serialized, reviver);
18518
+ });
18519
+
18520
+ it('the deserialized data should be an object', () => {
18521
+ expect(typeof deserialized).toEqual('object');
18522
+ });
18523
+
18524
+ it('the deserialized data should be correct', () => {
18525
+ expect(deserialized.position).toEqual(position.position);
18526
+ });
18527
+ });
18528
+ });
18529
+ });
18530
+
18531
+ },{"./../../../lib/serialization/PositionSchema":13}],58:[function(require,module,exports){
18187
18532
  const Day = require('@barchart/common-js/lang/Day'),
18188
18533
  Decimal = require('@barchart/common-js/lang/Decimal');
18189
18534
 
@@ -18234,7 +18579,7 @@ describe('When transactions are serialized', () => {
18234
18579
  expect(typeof serialized === 'string').toEqual(true);
18235
18580
  });
18236
18581
 
18237
- describe('and the serialized data is deserialized', function() {
18582
+ describe('and the data is deserialized', () => {
18238
18583
  let deserialized;
18239
18584
 
18240
18585
  beforeEach(() => {
@@ -18250,4 +18595,4 @@ describe('When transactions are serialized', () => {
18250
18595
  });
18251
18596
  });
18252
18597
 
18253
- },{"./../../../lib/data/TransactionType":4,"./../../../lib/serialization/TransactionSchema":12,"@barchart/common-js/lang/Day":21,"@barchart/common-js/lang/Decimal":22}]},{},[52,53,54,55]);
18598
+ },{"./../../../lib/data/TransactionType":4,"./../../../lib/serialization/TransactionSchema":14,"@barchart/common-js/lang/Day":23,"@barchart/common-js/lang/Decimal":24}]},{},[54,55,56,57,58]);