comprodls-sdk 2.21.1 → 2.23.0

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.
@@ -45,10 +45,12 @@ var workflows = require('./services/workflows');
45
45
  var integrations = require('./services/integrations');
46
46
  var validations = require('./token/validations');
47
47
  var drive = require('./services/drive');
48
+ var taxonomy = require('./services/taxonomy');
49
+ var rules = require('./services/rules');
48
50
 
49
51
 
50
52
  /*********************************
51
- * Setting Up Module Entry Point
53
+ * Setting Up Module Entry Point
52
54
  **********************************/
53
55
  exports.init = init;
54
56
 
@@ -62,10 +64,10 @@ function comproDLS(environment, realm, options) {
62
64
  options = options || {};
63
65
  environment = environment || 'production';
64
66
  realm = realm || 'global';
65
- /*
67
+ /*
66
68
  * Instance level parameters, used across all API calls. These are set to null.
67
69
  * Either authWithToken or authWithCredentials must be called to set these
68
- * with valid values.
70
+ * with valid values.
69
71
  */
70
72
 
71
73
  /* API Token is a JSON Object with following structure
@@ -75,7 +77,7 @@ function comproDLS(environment, realm, options) {
75
77
  */
76
78
  this.token = null;
77
79
 
78
- //Organization Id
80
+ //Organization Id
79
81
  this.orgId = null;
80
82
  this.traceid = options.traceid;
81
83
 
@@ -112,7 +114,7 @@ function comproDLS(environment, realm, options) {
112
114
  }
113
115
 
114
116
  /****************************************
115
- * Setting Up SDK Public Functions/Objects
117
+ * Setting Up SDK Public Functions/Objects
116
118
  *****************************************/
117
119
  //Token Management
118
120
  comproDLS.prototype.authWithCredentials = token_manager.authWithCredentials;
@@ -145,8 +147,10 @@ comproDLS.prototype.Invitations = invitations;
145
147
  comproDLS.prototype.Workflows = workflows;
146
148
  comproDLS.prototype.Integrations = integrations;
147
149
  comproDLS.prototype.Drive = drive;
150
+ comproDLS.prototype.Taxonomy = taxonomy;
151
+ comproDLS.prototype.Rules = rules;
148
152
 
149
- },{"./config":2,"./helpers":3,"./open_access":10,"./services/activity":13,"./services/analytics":14,"./services/attempts":15,"./services/auth":16,"./services/collab":17,"./services/drive":18,"./services/integrations":19,"./services/invitations":20,"./services/lrs":21,"./services/product":22,"./services/pub":23,"./services/push":26,"./services/pushX":24,"./services/sisevents":27,"./services/spaces":28,"./services/superuser":29,"./services/workflows":30,"./services/xapi":31,"./token":32,"./token/validations":33}],2:[function(require,module,exports){
153
+ },{"./config":2,"./helpers":3,"./open_access":10,"./services/activity":13,"./services/analytics":14,"./services/attempts":15,"./services/auth":16,"./services/collab":17,"./services/drive":18,"./services/integrations":19,"./services/invitations":20,"./services/lrs":21,"./services/product":22,"./services/pub":23,"./services/push":26,"./services/pushX":24,"./services/rules":27,"./services/sisevents":28,"./services/spaces":29,"./services/superuser":30,"./services/taxonomy":31,"./services/workflows":32,"./services/xapi":33,"./token":34,"./token/validations":35}],2:[function(require,module,exports){
150
154
  /*************************************************************************
151
155
  *
152
156
  * COMPRO CONFIDENTIAL
@@ -460,6 +464,18 @@ exports.DRIVE_API_URLS = {
460
464
  getAParticularDocument: '/accounts/{accountid}/users/{extuserid}/documents/{documentid}',
461
465
  getAllDocumentsInAFolder: '/accounts/{accountid}/users/{extuserid}/documents'
462
466
  };
467
+
468
+ exports.TAXONOMY_API_URLS = {
469
+ associateTagsWithEntity: '/org/{orgId}/taxonomy/associate-tags-with-entity',
470
+ tags: '/org/{orgId}/context/{context}/taxonomy/{taxonomyId}/tags'
471
+ };
472
+
473
+ exports.RULES_API_URLS = {
474
+ rules: '/org/{orgId}/context/{context}/rule_type/{ruleType}/rules',
475
+ particularRule: '/org/{orgId}/context/{context}/rule_type/{ruleType}/rules/{ruleId}',
476
+ updateRuleDisplay: '/org/{orgId}/context/{context}/rule_type/{ruleType}/rules/{ruleId}/update-rule-display',
477
+ getUserRule: '/org/{orgId}/context/{context}/rule_type/{ruleType}/users/{userId}/rules'
478
+ };
463
479
 
464
480
  },{}],3:[function(require,module,exports){
465
481
  /*************************************************************************
@@ -746,7 +762,7 @@ function addClassIdQueryParam(url, classId) {
746
762
  function setupAPIToken(request, token) {
747
763
  return request.set('Authorization', token.access_token);
748
764
  };
749
- },{"../../../config":2,"../../../helpers":3,"../errors":7,"./validations":6,"q":88,"string-template":129,"superagent":131}],6:[function(require,module,exports){
765
+ },{"../../../config":2,"../../../helpers":3,"../errors":7,"./validations":6,"q":90,"string-template":131,"superagent":133}],6:[function(require,module,exports){
750
766
  /*************************************************************************
751
767
  *
752
768
  * COMPRO CONFIDENTIAL
@@ -1078,7 +1094,7 @@ validator.validators.contains = function(value, options) {
1078
1094
  }
1079
1095
  }
1080
1096
  };
1081
- },{"./errors":7,"validate.js":139}],10:[function(require,module,exports){
1097
+ },{"./errors":7,"validate.js":141}],10:[function(require,module,exports){
1082
1098
  /*************************************************************************
1083
1099
  *
1084
1100
  * COMPRO CONFIDENTIAL
@@ -1201,7 +1217,7 @@ function getSingleInvitation(organizationId, options) {
1201
1217
  }
1202
1218
 
1203
1219
 
1204
- },{"../helpers":3,"q":88,"superagent":131}],11:[function(require,module,exports){
1220
+ },{"../helpers":3,"q":90,"superagent":133}],11:[function(require,module,exports){
1205
1221
  /*************************************************************************
1206
1222
  *
1207
1223
  * COMPRO CONFIDENTIAL
@@ -1412,7 +1428,7 @@ Activity.prototype.getQuestionsCount = function () {
1412
1428
  return dfd.promise;
1413
1429
  }
1414
1430
 
1415
- },{"../../helpers":3,"./attempt":12,"extend":66,"q":88,"superagent":131}],12:[function(require,module,exports){
1431
+ },{"../../helpers":3,"./attempt":12,"extend":68,"q":90,"superagent":133}],12:[function(require,module,exports){
1416
1432
  /*************************************************************************
1417
1433
  *
1418
1434
  * COMPRO CONFIDENTIAL
@@ -1845,7 +1861,7 @@ Attempt.prototype.submit = function (userresponse) {
1845
1861
  return dfd.promise;
1846
1862
  };
1847
1863
 
1848
- },{"../../helpers":3,"extend":66,"q":88,"superagent":131}],13:[function(require,module,exports){
1864
+ },{"../../helpers":3,"extend":68,"q":90,"superagent":133}],13:[function(require,module,exports){
1849
1865
  /*************************************************************************
1850
1866
  *
1851
1867
  * COMPRO CONFIDENTIAL
@@ -3484,7 +3500,7 @@ function getTimeseriesAnalytics(options) {
3484
3500
  }
3485
3501
  return dfd.promise;
3486
3502
  }
3487
- },{"../../helpers":3,"agentkeepalive":35,"q":88,"superagent":131}],15:[function(require,module,exports){
3503
+ },{"../../helpers":3,"agentkeepalive":37,"q":90,"superagent":133}],15:[function(require,module,exports){
3488
3504
  /*************************************************************************
3489
3505
  *
3490
3506
  * COMPRO CONFIDENTIAL
@@ -3828,7 +3844,7 @@ function getUserLastAttemptForActivity(options) {
3828
3844
  return dfd.promise;
3829
3845
  }
3830
3846
 
3831
- },{"../../helpers":3,"q":88,"superagent":131}],16:[function(require,module,exports){
3847
+ },{"../../helpers":3,"q":90,"superagent":133}],16:[function(require,module,exports){
3832
3848
  /*************************************************************************
3833
3849
  *
3834
3850
  * COMPRO CONFIDENTIAL
@@ -4609,15 +4625,21 @@ function getJob(options) {
4609
4625
  return dfd.promise;
4610
4626
  }
4611
4627
 
4612
- //options = {
4613
- // search: 'search string', //optional.
4614
- // sortField: ['startdate', 'enddate', 'title', 'created'] //optional, By default is 'created’.
4615
- // sortOrder: ['desc', 'asc'] //optional, By default is 'desc’.
4616
- // cursor: 'cursor' //optional, cursor to get next set of groups.
4617
- // limit: integer, // (optional) limit number of Classes in response.
4618
- // lookup: 'string', // (optional) Search query (',' separated key value pairs),
4619
- // Eg. key1:val1,key2:val2
4620
- //}
4628
+
4629
+ /**
4630
+ * @param {*} options {
4631
+ * search: 'search string', // Optional
4632
+ * sortField: ['startdate', 'enddate', 'title', 'created', 'tagname_1'] // Optional
4633
+ * // Default: 'created’.
4634
+ * sortOrder: ['desc', 'asc'] // Optional, Default: 'desc’.
4635
+ * cursor: 'cursor' // Optional, cursor to get next set of groups.
4636
+ * limit: integer, // Optional, limit number of Classes in response.
4637
+ * lookup: 'string', // Optional, Exact query search (',' separated key value pairs).
4638
+ * // E.g. key1:val1,key2:val2
4639
+ * lookup-operator: ['OR', 'AND'] // Optional
4640
+ * }
4641
+ * @returns {entities: [{}, {}, ...], count: <integer>, cursor: <string>}
4642
+ */
4621
4643
  function getAllClasses(options) {
4622
4644
  var self = this;
4623
4645
 
@@ -4626,11 +4648,23 @@ function getAllClasses(options) {
4626
4648
 
4627
4649
  //Validations
4628
4650
  var err = helpers.validations.isAuthenticated(self.orgId, self.token);
4651
+
4629
4652
  if(err) {
4630
4653
  dfd.reject(err);
4631
4654
  } else {
4632
4655
  var queryStr = 'orgid:"' + self.orgId + '"';
4633
4656
 
4657
+ if (options.lookup && options['lookup-operator']) {
4658
+ var lookupString = options.lookup;
4659
+ var lookupArray = lookupString.split(',').map(function (item) {
4660
+ var lookupItem = item.trim();
4661
+ var tempArr = lookupItem.split(':');
4662
+ lookupItem = '(' + tempArr[0] + '.keyword:' + tempArr[1] + ')';
4663
+ return lookupItem;
4664
+ });
4665
+ queryStr += ' AND (' + lookupArray.join(' ' + options['lookup-operator'] + ' ') + ')';
4666
+ }
4667
+
4634
4668
  if(options.search) {
4635
4669
  queryStr = queryStr + ' AND (title:"' + options.search + '" OR class.instructor.first_name:"' + options.search +
4636
4670
  '" OR class.instructor.last_name:"' + options.search + '" OR description:"' + options.search + '")';
@@ -4638,12 +4672,19 @@ function getAllClasses(options) {
4638
4672
 
4639
4673
  var sortField = options.sortField || '';
4640
4674
  sortField = sortField.replace(/ext_/ig, '').split(',').shift().trim() || 'created';
4675
+
4641
4676
  if(sortField === 'enddate' || sortField === 'startdate') {
4642
4677
  sortField = 'class.' + sortField;
4643
4678
  }
4679
+
4644
4680
  if(sortField === 'title') {
4645
4681
  sortField = sortField + '.keyword';
4646
4682
  }
4683
+
4684
+ if (sortField === 'tagname_1') {
4685
+ sortField = sortField + '.keyword';
4686
+ }
4687
+
4647
4688
  var sortOrder = options.sortOrder || 'desc';
4648
4689
  var sortObj = {}, sortArr = [];
4649
4690
  sortObj[sortField] = sortOrder;
@@ -4715,6 +4756,28 @@ function getAllClasses(options) {
4715
4756
  provision_method: classEntity.class.provision_method,
4716
4757
  title: classEntity.title
4717
4758
  };
4759
+
4760
+ /**
4761
+ * Add class-tag association specific fields
4762
+ */
4763
+ if (classEntity.tagid_1) {
4764
+ classObj.tagid_1 = classEntity.tagid_1;
4765
+ classObj.tagname_1 = classEntity.tagname_1;
4766
+ classObj.taglookup_1 = classEntity.taglookup_1;
4767
+ }
4768
+
4769
+ if (classEntity.tagid_2) {
4770
+ classObj.tagid_2 = classEntity.tagid_2;
4771
+ classObj.tagname_2 = classEntity.tagname_2;
4772
+ classObj.taglookup_2 = classEntity.taglookup_2;
4773
+ }
4774
+
4775
+ if (classEntity.tagid_3) {
4776
+ classObj.tagid_3 = classEntity.tagid_3;
4777
+ classObj.tagname_3 = classEntity.tagname_3;
4778
+ classObj.taglookup_3 = classEntity.taglookup_3;
4779
+ }
4780
+
4718
4781
  responseObject.entities.push(classObj);
4719
4782
  }
4720
4783
  dfd.resolve(responseObject);
@@ -6504,7 +6567,7 @@ function cloneClass(options) {
6504
6567
  return dfd.promise;
6505
6568
  }
6506
6569
 
6507
- },{"../../helpers":3,"../../helpers/lib/api/converter":4,"agentkeepalive":35,"q":88,"superagent":131}],17:[function(require,module,exports){
6570
+ },{"../../helpers":3,"../../helpers/lib/api/converter":4,"agentkeepalive":37,"q":90,"superagent":133}],17:[function(require,module,exports){
6508
6571
  /*************************************************************************
6509
6572
  *
6510
6573
  * COMPRO CONFIDENTIAL
@@ -6974,7 +7037,7 @@ function updateConnectionForUser(orgid, token, config, options, action) {
6974
7037
  return dfd.promise;
6975
7038
  }
6976
7039
 
6977
- },{"../../helpers":3,"q":88,"superagent":131}],18:[function(require,module,exports){
7040
+ },{"../../helpers":3,"q":90,"superagent":133}],18:[function(require,module,exports){
6978
7041
  /*************************************************************************
6979
7042
  *
6980
7043
  * COMPRO CONFIDENTIAL
@@ -7120,7 +7183,7 @@ function getAllDocumentsInAFolder(options) {
7120
7183
  return dfd.promise;
7121
7184
  }
7122
7185
 
7123
- },{"../../helpers":3,"q":88,"superagent":131}],19:[function(require,module,exports){
7186
+ },{"../../helpers":3,"q":90,"superagent":133}],19:[function(require,module,exports){
7124
7187
  /*************************************************************************
7125
7188
  *
7126
7189
  * COMPRO CONFIDENTIAL
@@ -7458,7 +7521,7 @@ function publishCustomEvents(options) {
7458
7521
  return deferred.promise;
7459
7522
  }
7460
7523
 
7461
- },{"../../helpers":3,"../../helpers/lib/api/converter":4,"q":88,"superagent":131}],20:[function(require,module,exports){
7524
+ },{"../../helpers":3,"../../helpers/lib/api/converter":4,"q":90,"superagent":133}],20:[function(require,module,exports){
7462
7525
  /*************************************************************************
7463
7526
  *
7464
7527
  * COMPRO CONFIDENTIAL
@@ -7783,7 +7846,7 @@ function resendSingleInvitation(options) {
7783
7846
  return dfd.promise;
7784
7847
  }
7785
7848
 
7786
- },{"../../helpers":3,"q":88,"superagent":131}],21:[function(require,module,exports){
7849
+ },{"../../helpers":3,"q":90,"superagent":133}],21:[function(require,module,exports){
7787
7850
  /*************************************************************************
7788
7851
  *
7789
7852
  * COMPRO CONFIDENTIAL
@@ -8244,7 +8307,7 @@ function createStatement(options) {
8244
8307
  }*/
8245
8308
 
8246
8309
 
8247
- },{"../../helpers":3,"q":88,"tincanjs":133}],22:[function(require,module,exports){
8310
+ },{"../../helpers":3,"q":90,"tincanjs":135}],22:[function(require,module,exports){
8248
8311
  /*************************************************************************
8249
8312
  *
8250
8313
  * COMPRO CONFIDENTIAL
@@ -8592,7 +8655,7 @@ function getSingleProductFamily(options) {
8592
8655
  return dfd.promise;
8593
8656
  }
8594
8657
 
8595
- },{"../../helpers":3,"q":88,"superagent":131}],23:[function(require,module,exports){
8658
+ },{"../../helpers":3,"q":90,"superagent":133}],23:[function(require,module,exports){
8596
8659
  /*************************************************************************
8597
8660
  *
8598
8661
  * COMPRO CONFIDENTIAL
@@ -9192,7 +9255,7 @@ function getAllProductFamilies(options) {
9192
9255
  return dfd.promise;
9193
9256
  }
9194
9257
 
9195
- },{"../../helpers":3,"q":88,"superagent":131}],24:[function(require,module,exports){
9258
+ },{"../../helpers":3,"q":90,"superagent":133}],24:[function(require,module,exports){
9196
9259
  /*************************************************************************
9197
9260
  *
9198
9261
  * COMPRO CONFIDENTIAL
@@ -9384,7 +9447,7 @@ function grantByAccountIdOnExtUserId(options) {
9384
9447
  }
9385
9448
 
9386
9449
 
9387
- },{"../../helpers":3,"./pubnubClientWrapper":25,"q":88,"superagent":131}],25:[function(require,module,exports){
9450
+ },{"../../helpers":3,"./pubnubClientWrapper":25,"q":90,"superagent":133}],25:[function(require,module,exports){
9388
9451
  var pubNub = require("pubnub");
9389
9452
  var EventEmitter = require("events").EventEmitter;
9390
9453
  var helpers = require('../../helpers');
@@ -9597,7 +9660,7 @@ module.exports = function () {
9597
9660
 
9598
9661
  }; //End of Client Wrapper module
9599
9662
 
9600
- },{"../../helpers":3,"events":65,"pubnub":86}],26:[function(require,module,exports){
9663
+ },{"../../helpers":3,"events":67,"pubnub":88}],26:[function(require,module,exports){
9601
9664
  /*************************************************************************
9602
9665
  *
9603
9666
  * COMPRO CONFIDENTIAL
@@ -9786,7 +9849,474 @@ function _setup(orgId, userId) {
9786
9849
  return dfd.promise;
9787
9850
  }
9788
9851
 
9789
- },{"../../helpers":3,"events":65,"q":88,"socket.io-client":107}],27:[function(require,module,exports){
9852
+ },{"../../helpers":3,"events":67,"q":90,"socket.io-client":109}],27:[function(require,module,exports){
9853
+ /*************************************************************************
9854
+ *
9855
+ * COMPRO CONFIDENTIAL
9856
+ * __________________
9857
+ *
9858
+ * [2015] - [2020] Compro Technologies Private Limited
9859
+ * All Rights Reserved.
9860
+ *
9861
+ * NOTICE: All information contained herein is, and remains
9862
+ * the property of Compro Technologies Private Limited. The
9863
+ * intellectual and technical concepts contained herein are
9864
+ * proprietary to Compro Technologies Private Limited and may
9865
+ * be covered by U.S. and Foreign Patents, patents in process,
9866
+ * and are protected by trade secret or copyright law.
9867
+ *
9868
+ * Dissemination of this information or reproduction of this material
9869
+ * is strictly forbidden unless prior written permission is obtained
9870
+ * from Compro Technologies Pvt. Ltd..
9871
+ ***************************************************************************/
9872
+
9873
+ /***********************************************************
9874
+ * comproDLS SDK Rules API Adaptor
9875
+ * Functions for calling Rules API.
9876
+ ************************************************************/
9877
+
9878
+ var q = require('q');
9879
+ var request = require('superagent');
9880
+ var helpers = require('../../helpers');
9881
+
9882
+ var DLSError = helpers.errors.DLSError;
9883
+
9884
+ /*********************************
9885
+ * Setting Up Module Entry Point
9886
+ **********************************/
9887
+ module.exports = rules;
9888
+ //Rules Adaptor Contsructor
9889
+ function rules() {
9890
+ return {
9891
+ getRules: getRules.bind(this),
9892
+ getParticularRule: getParticularRule.bind(this),
9893
+ getUserRule: getUserRule.bind(this),
9894
+ updateRuleDisplay: updateRuleDisplay.bind(this),
9895
+ createRule: createRule.bind(this),
9896
+ updateRule: updateRule.bind(this),
9897
+ deleteRule: deleteRule.bind(this)
9898
+ };
9899
+ }
9900
+
9901
+ /*********************************
9902
+ * Public Function definitions
9903
+ **********************************/
9904
+
9905
+ /**
9906
+ * options = {
9907
+ * context: '', // Mandatory
9908
+ * ruleType: '', // Mandatory
9909
+ * cursor: '' // Optional
9910
+ * }
9911
+ */
9912
+ function getRules(options) {
9913
+ var self = this;
9914
+
9915
+ //Initializing promise
9916
+ var dfd = q.defer();
9917
+
9918
+ //Validations
9919
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
9920
+ if (err) {
9921
+ dfd.reject(err);
9922
+ } else {
9923
+ if (options && options.context && options.ruleType) {
9924
+ //Passed all validations, Contruct API url
9925
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.rules;
9926
+ url = helpers.api.constructAPIUrl(url, {
9927
+ orgId: self.orgId,
9928
+ context: encodeURIComponent(options.context),
9929
+ ruleType: options.ruleType
9930
+ });
9931
+
9932
+ //Setup request with URL and Params
9933
+ var queryParam = { cursor: options.cursor };
9934
+
9935
+ var requestAPI = request.get(url)
9936
+ .set('Content-Type', 'application/json')
9937
+ .set('Accept', 'application/json')
9938
+ .query(queryParam);
9939
+
9940
+ if (self.traceid) {
9941
+ requestAPI.set('X-Amzn-Trace-Id', self.traceid);
9942
+ }
9943
+
9944
+ //Setup token in Authorization header
9945
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
9946
+
9947
+ requestAPI.end(function (err, response) {
9948
+ if (err) {
9949
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
9950
+ dfd.reject(err);
9951
+ } else {
9952
+ dfd.resolve(response.body);
9953
+ }
9954
+ });
9955
+ } else {
9956
+ err = {};
9957
+ err.message = err.description = 'context or ruleType not found in request options.';
9958
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
9959
+ dfd.reject(err);
9960
+ }
9961
+ }
9962
+ return dfd.promise;
9963
+ }
9964
+
9965
+ /**
9966
+ * options = {
9967
+ * context: '', // Mandatory
9968
+ * ruleType: '', // Mandatory
9969
+ * ruleId: '' // Mandatory
9970
+ * }
9971
+ */
9972
+ function getParticularRule(options) {
9973
+ var self = this;
9974
+
9975
+ //Initializing promise
9976
+ var dfd = q.defer();
9977
+
9978
+ //Validations
9979
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
9980
+ if (err) {
9981
+ dfd.reject(err);
9982
+ } else {
9983
+ if (options && options.context && options.ruleType && options.ruleId) {
9984
+ //Passed all validations, Contruct API url
9985
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.particularRule;
9986
+ url = helpers.api.constructAPIUrl(url, {
9987
+ orgId: self.orgId,
9988
+ context: encodeURIComponent(options.context),
9989
+ ruleType: options.ruleType,
9990
+ ruleId: options.ruleId
9991
+ });
9992
+
9993
+ //Setup request with URL and Params
9994
+ var requestAPI = request.get(url);
9995
+
9996
+ if (self.traceid) {
9997
+ requestAPI.set('X-Amzn-Trace-Id', self.traceid);
9998
+ }
9999
+
10000
+ //Setup token in Authorization header
10001
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10002
+
10003
+ requestAPI.end(function (err, response) {
10004
+ if (err) {
10005
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
10006
+ dfd.reject(err);
10007
+ } else {
10008
+ dfd.resolve(response.body);
10009
+ }
10010
+ });
10011
+ } else {
10012
+ err = {};
10013
+ err.message = err.description = 'context or ruleType or ruleId not found' +
10014
+ ' in request options.';
10015
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10016
+ dfd.reject(err);
10017
+ }
10018
+ }
10019
+ return dfd.promise;
10020
+ }
10021
+
10022
+ /**
10023
+ * options = {
10024
+ * orgId: '', // Mandatory
10025
+ * context: '', // Mandatory
10026
+ * ruleType: '', // Mandatory
10027
+ * userId: '', // Mandatory
10028
+ * mergeGlobalRules:'' // Optional
10029
+ * }
10030
+ */
10031
+ function getUserRule(options) {
10032
+ var self = this;
10033
+
10034
+ //Initializing promise
10035
+ var dfd = q.defer();
10036
+
10037
+ if (options && options.orgId && options.context && options.ruleType && options.userId) {
10038
+ //Passed all validations, Contruct API url
10039
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.getUserRule;
10040
+ url = helpers.api.constructAPIUrl(url, {
10041
+ orgId: self.orgId,
10042
+ context: encodeURIComponent(options.context),
10043
+ ruleType: options.ruleType,
10044
+ userId: options.userId
10045
+ });
10046
+
10047
+ //Setup request with URL and Params
10048
+ var queryParam = { mergeGlobalRules: options.mergeGlobalRules };
10049
+
10050
+ var requestAPI = request.get(url)
10051
+ .set('Content-Type', 'application/json')
10052
+ .set('Accept', 'application/json')
10053
+ .query(queryParam);
10054
+
10055
+ if (self.traceid) {
10056
+ requestAPI.set('X-Amzn-Trace-Id', self.traceid);
10057
+ }
10058
+
10059
+ //Setup token in Authorization header
10060
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10061
+
10062
+ requestAPI.end(function (err, response) {
10063
+ if (err) {
10064
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
10065
+ dfd.reject(err);
10066
+ } else {
10067
+ dfd.resolve(response.body);
10068
+ }
10069
+ });
10070
+ } else {
10071
+ var err = {};
10072
+ err.message = err.description = 'Mandatory params - orgId or context or ruleType or userId ' +
10073
+ 'not found in request options.';
10074
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10075
+ dfd.reject(err);
10076
+ }
10077
+
10078
+ return dfd.promise;
10079
+ }
10080
+
10081
+ /**
10082
+ * options = {
10083
+ * context: '', // Mandatory
10084
+ * ruleType: '', // Mandatory
10085
+ * ruleId: '', // Mandatory
10086
+ * body: {
10087
+ * rule_display: '' // Mandatory
10088
+ * }
10089
+ * }
10090
+ */
10091
+ function updateRuleDisplay(options) {
10092
+ var self = this;
10093
+ // Initializing promise
10094
+ var dfd = q.defer();
10095
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
10096
+ if (err) { dfd.reject(err); }
10097
+ else {
10098
+ if (options && options.context && options.ruleType && options.ruleId &&
10099
+ options.body && options.body.rule_display) {
10100
+ // Passed all validations, Contruct API url
10101
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.updateRuleDisplay;
10102
+ url = helpers.api.constructAPIUrl(url, {
10103
+ orgId: self.orgId,
10104
+ context: encodeURIComponent(options.context),
10105
+ ruleType: options.ruleType,
10106
+ ruleId: options.ruleId
10107
+ });
10108
+
10109
+ // Setup request with URL and Params
10110
+ var requestAPI = request.put(url)
10111
+ .set('Content-Type', 'application/json')
10112
+ .set('Accept', 'application/json')
10113
+ .send(options.body);
10114
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
10115
+
10116
+ //Setup token in Authorization header
10117
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10118
+
10119
+ requestAPI.end(function (error, response) {
10120
+ if (error) {
10121
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
10122
+ dfd.reject(err);
10123
+ }
10124
+ else { dfd.resolve(response.body); }
10125
+ });
10126
+ } else {
10127
+ err = {};
10128
+ err.message = err.description = 'Mandatory params - context or ruleType or ruleId ' +
10129
+ 'or body.rule_display not found in request options.';
10130
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10131
+ dfd.reject(err);
10132
+ }
10133
+ }
10134
+ return dfd.promise;
10135
+ }
10136
+
10137
+ /**
10138
+ * options = {
10139
+ * context: '', // Mandatory
10140
+ * ruleType: '', // Mandatory
10141
+ * body: {
10142
+ * ruleid: '', // Mandatory
10143
+ * scope: '', // Mandatory
10144
+ * entities: [ // Min. length 1
10145
+ * {
10146
+ * id:'', // eg. item code
10147
+ * type:'' // eg. item/folder/product
10148
+ * },
10149
+ * ...],
10150
+ * user: ['extuserid1','extuserid2', ...],
10151
+ * rule_data_individual: {},
10152
+ * rule_data_common: {},
10153
+ * rule_display: {}
10154
+ * }
10155
+ * }
10156
+ */
10157
+ function createRule(options) {
10158
+ var self = this;
10159
+ // Initializing promise
10160
+ var dfd = q.defer();
10161
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
10162
+ if (err) { dfd.reject(err); }
10163
+ else {
10164
+ if (options && options.context && options.ruleType && options.body) {
10165
+ // Passed all validations, Contruct API url
10166
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.rules;
10167
+ url = helpers.api.constructAPIUrl(url, {
10168
+ orgId: self.orgId,
10169
+ context: encodeURIComponent(options.context),
10170
+ ruleType: options.ruleType
10171
+ });
10172
+
10173
+ // Setup request with URL and Params
10174
+ var requestAPI = request.post(url)
10175
+ .set('Content-Type', 'application/json')
10176
+ .set('Accept', 'application/json')
10177
+ .send(options.body);
10178
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
10179
+
10180
+ //Setup token in Authorization header
10181
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10182
+
10183
+ requestAPI.end(function (error, response) {
10184
+ if (error) {
10185
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
10186
+ dfd.reject(err);
10187
+ }
10188
+ else { dfd.resolve(response.body); }
10189
+ });
10190
+ } else {
10191
+ err = {};
10192
+ err.message = err.description = 'Mandatory params - context or ruleType or body' +
10193
+ ' not found in request options.';
10194
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10195
+ dfd.reject(err);
10196
+ }
10197
+ }
10198
+ return dfd.promise;
10199
+ }
10200
+
10201
+ /**
10202
+ * options = {
10203
+ * context: '', // Mandatory
10204
+ * ruleType: '', // Mandatory
10205
+ * ruleId: '', // Mandatory
10206
+ * body: {
10207
+ * scope: '', // Mandatory
10208
+ * entities: [ // Min. length 1
10209
+ * {
10210
+ * id:'', // eg. item code
10211
+ * type:'' // eg. item/folder/product
10212
+ * },
10213
+ * ...],
10214
+ * user: ['extuserid1','extuserid2', ...],
10215
+ * rule_data_individual: {}, // Optional
10216
+ * rule_data_common: {} // Optional
10217
+ * }
10218
+ * }
10219
+ */
10220
+ function updateRule(options) {
10221
+ var self = this;
10222
+ // Initializing promise
10223
+ var dfd = q.defer();
10224
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
10225
+ if (err) { dfd.reject(err); }
10226
+ else {
10227
+ if (options && options.context && options.ruleType && options.ruleId && options.body) {
10228
+ // Passed all validations, Contruct API url
10229
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.particularRule;
10230
+ url = helpers.api.constructAPIUrl(url, {
10231
+ orgId: self.orgId,
10232
+ context: encodeURIComponent(options.context),
10233
+ ruleType: options.ruleType,
10234
+ ruleId: options.ruleId
10235
+ });
10236
+
10237
+ // Setup request with URL and Params
10238
+ var requestAPI = request.put(url)
10239
+ .set('Content-Type', 'application/json')
10240
+ .set('Accept', 'application/json')
10241
+ .send(options.body);
10242
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
10243
+
10244
+ //Setup token in Authorization header
10245
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10246
+
10247
+ requestAPI.end(function (error, response) {
10248
+ if (error) {
10249
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
10250
+ dfd.reject(err);
10251
+ }
10252
+ else { dfd.resolve(response.body); }
10253
+ });
10254
+ } else {
10255
+ err = {};
10256
+ err.message = err.description = 'Mandatory params - context or ruleType or ruleId or body ' +
10257
+ 'not found in request options.';
10258
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10259
+ dfd.reject(err);
10260
+ }
10261
+ }
10262
+ return dfd.promise;
10263
+ }
10264
+
10265
+ /**
10266
+ * options = {
10267
+ * context: '', // Mandatory
10268
+ * ruleType: '', // Mandatory
10269
+ * ruleId: '' // Mandatory
10270
+ * }
10271
+ */
10272
+ function deleteRule(options) {
10273
+ var self = this;
10274
+ // Initializing promise
10275
+ var dfd = q.defer();
10276
+
10277
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
10278
+ if (err) { dfd.reject(err); }
10279
+ else {
10280
+ if (options && options.context && options.ruleType && options.ruleId) {
10281
+ // Passed all validations, Contruct API url
10282
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.particularRule;
10283
+ url = helpers.api.constructAPIUrl(url, {
10284
+ orgId: self.orgId,
10285
+ context: encodeURIComponent(options.context),
10286
+ ruleType: options.ruleType,
10287
+ ruleId: options.ruleId
10288
+ });
10289
+
10290
+ // Setup request with URL and Params
10291
+ var requestAPI = request.delete(url);
10292
+
10293
+ //Setup token in Authorization header
10294
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10295
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
10296
+
10297
+ requestAPI.end(function (error, response) {
10298
+ if (error) {
10299
+ err = {};
10300
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
10301
+ dfd.reject(err);
10302
+ }
10303
+ else {
10304
+ dfd.resolve(response.body);
10305
+ }
10306
+ });
10307
+ }
10308
+ else {
10309
+ err = {};
10310
+ err.message = err.description = 'Mandatory params - context or ruleType or ruleId not found' +
10311
+ ' in request options.';
10312
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10313
+ dfd.reject(err);
10314
+ }
10315
+ }
10316
+ return dfd.promise;
10317
+ }
10318
+
10319
+ },{"../../helpers":3,"q":90,"superagent":133}],28:[function(require,module,exports){
9790
10320
  /*************************************************************************
9791
10321
  *
9792
10322
  * COMPRO CONFIDENTIAL
@@ -9901,7 +10431,7 @@ function postSISEvent(options) {
9901
10431
  return dfd.promise;
9902
10432
  }
9903
10433
 
9904
- },{"../../helpers":3,"q":88,"superagent":131,"underscore":135}],28:[function(require,module,exports){
10434
+ },{"../../helpers":3,"q":90,"superagent":133,"underscore":137}],29:[function(require,module,exports){
9905
10435
  /*************************************************************************
9906
10436
  *
9907
10437
  * COMPRO CONFIDENTIAL
@@ -10938,7 +11468,7 @@ function updateInstituteTitle(options){
10938
11468
  return dfd.promise;
10939
11469
  }
10940
11470
 
10941
- },{"../../helpers":3,"q":88,"superagent":131}],29:[function(require,module,exports){
11471
+ },{"../../helpers":3,"q":90,"superagent":133}],30:[function(require,module,exports){
10942
11472
  /*************************************************************************
10943
11473
  *
10944
11474
  * COMPRO CONFIDENTIAL
@@ -11115,7 +11645,444 @@ function provisionSpacesToSuperAdmin(options) {
11115
11645
  return dfd.promise;
11116
11646
  }
11117
11647
 
11118
- },{"../../helpers":3,"q":88,"superagent":131}],30:[function(require,module,exports){
11648
+ },{"../../helpers":3,"q":90,"superagent":133}],31:[function(require,module,exports){
11649
+ /*************************************************************************
11650
+ *
11651
+ * COMPRO CONFIDENTIAL
11652
+ * __________________
11653
+ *
11654
+ * [2015] - [2020] Compro Technologies Private Limited
11655
+ * All Rights Reserved.
11656
+ *
11657
+ * NOTICE: All information contained herein is, and remains
11658
+ * the property of Compro Technologies Private Limited. The
11659
+ * intellectual and technical concepts contained herein are
11660
+ * proprietary to Compro Technologies Private Limited and may
11661
+ * be covered by U.S. and Foreign Patents, patents in process,
11662
+ * and are protected by trade secret or copyright law.
11663
+ *
11664
+ * Dissemination of this information or reproduction of this material
11665
+ * is strictly forbidden unless prior written permission is obtained
11666
+ * from Compro Technologies Pvt. Ltd..
11667
+ ***************************************************************************/
11668
+
11669
+ /***********************************************************
11670
+ * comproDLS SDK AUTH API Adaptor
11671
+ * Functions for calling AUTH API.
11672
+ ************************************************************/
11673
+
11674
+ var q = require('q');
11675
+ var request = require('superagent');
11676
+ var helpers = require('../../helpers');
11677
+
11678
+ var DLSError = helpers.errors.DLSError;
11679
+
11680
+ /*********************************
11681
+ * Setting Up Module Entry Point
11682
+ **********************************/
11683
+ module.exports = taxonomy;
11684
+ //Taxonomy Adaptor Contsructor
11685
+ function taxonomy() {
11686
+ return {
11687
+ associateTagsWithEntity: associateTagsWithEntity.bind(this),
11688
+ createTags: createTags.bind(this),
11689
+ updateTags: updateTags.bind(this),
11690
+ deleteTags: deleteTags.bind(this),
11691
+ getTag: getTag.bind(this),
11692
+ getTagHierarchy: getTagHierarchy.bind(this),
11693
+ getAllTags: getAllTags.bind(this)
11694
+ };
11695
+ }
11696
+
11697
+ /*********************************
11698
+ * Public Function definitions
11699
+ **********************************/
11700
+
11701
+ /**
11702
+ * options = {
11703
+ * entity_type: 'type of entity',
11704
+ * entity_id: 'id of the entity',
11705
+ * tags: 'array of tags for association with entity'
11706
+ */
11707
+ function associateTagsWithEntity(options) {
11708
+ var self = this;
11709
+
11710
+ //Initializing promise
11711
+ var dfd = q.defer();
11712
+
11713
+ //Validations
11714
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
11715
+ if (err) {
11716
+ dfd.reject(err);
11717
+ } else {
11718
+ if (options && options.entity_type && options.entity_id && options.tags) {
11719
+ //Passed all validations, Contruct API url
11720
+ var url = self.config.DEFAULT_HOSTS.AUTH +
11721
+ self.config.TAXONOMY_API_URLS.associateTagsWithEntity;
11722
+ url = helpers.api.constructAPIUrl(url, { orgId: self.orgId });
11723
+
11724
+ //Setup request with URL and Params
11725
+ var requestAPI = request.put(url).send(options);
11726
+
11727
+ if (self.traceid) {
11728
+ requestAPI.set('X-Amzn-Trace-Id', self.traceid);
11729
+ }
11730
+
11731
+ //Setup token in Authorization header
11732
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
11733
+
11734
+ requestAPI.end(function(err, response) {
11735
+ if (err) {
11736
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
11737
+ dfd.reject(err);
11738
+ } else {
11739
+ dfd.resolve(response.body);
11740
+ }
11741
+ });
11742
+ } else {
11743
+ err = {};
11744
+ err.message = err.description = 'entity_id or entity_type or tags not found in request options.';
11745
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
11746
+ dfd.reject(err);
11747
+ }
11748
+ }
11749
+
11750
+ return dfd.promise;
11751
+ }
11752
+
11753
+
11754
+ /*
11755
+ options = {
11756
+ context: "string", //mandatory
11757
+ taxonomyid: "string", //mandatory
11758
+ body: {
11759
+ tags: [{
11760
+ "tagid": "",
11761
+ "tagname": "",
11762
+ "tag_data": {} // optional
11763
+ }]
11764
+ }
11765
+ }
11766
+ */
11767
+ function createTags(options) {
11768
+ var self = this;
11769
+ // Initializing promise
11770
+ var dfd = q.defer();
11771
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
11772
+ if(err) { dfd.reject(err); }
11773
+ else {
11774
+ if(options && options.context && options.taxonomyid && options.body && options.body.tags && (options.body.tags.length > 0)) {
11775
+ // Passed all validations, Contruct API url
11776
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
11777
+ url = helpers.api.constructAPIUrl(url, {
11778
+ orgId: self.orgId,
11779
+ context: encodeURIComponent(options.context),
11780
+ taxonomyId: options.taxonomyid
11781
+ });
11782
+
11783
+ var requestAPI = request.post(url)
11784
+ .set('Content-Type', 'application/json')
11785
+ .set('Accept', 'application/json')
11786
+ .send(options.body);
11787
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
11788
+ //Setup token in Authorization header
11789
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
11790
+
11791
+ requestAPI.end(function(error, response) {
11792
+ if(error) {
11793
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
11794
+ dfd.reject(err);
11795
+ }
11796
+ else { dfd.resolve(response.body); }
11797
+ });
11798
+ } else {
11799
+ err = {};
11800
+ err.message = err.description = 'Mandatory param - context or taxonomyid or body.tags(min. 1 tag) ' +
11801
+ 'not found in request options.';
11802
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
11803
+ dfd.reject(err);
11804
+ }
11805
+ }
11806
+ return dfd.promise;
11807
+ }
11808
+
11809
+ /* options = {
11810
+ "context": "string", //mandatory
11811
+ "taxonomyid": "string" //mandatory
11812
+ "body": {
11813
+ "tagid": "string", //mandatory
11814
+ "tagname": "string",
11815
+ "tag_data": {}
11816
+ }
11817
+ };
11818
+ */
11819
+ function updateTags(options) {
11820
+ var self = this;
11821
+ // Initializing promise
11822
+ var dfd = q.defer();
11823
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
11824
+ if(err) { dfd.reject(err); }
11825
+ else {
11826
+ if(options && options.context && options.taxonomyid && options.body && options.body.tagid) {
11827
+
11828
+ // Passed all validations, Contruct API url
11829
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
11830
+ url = helpers.api.constructAPIUrl(url, {
11831
+ orgId: self.orgId,
11832
+ context: encodeURIComponent(options.context),
11833
+ taxonomyId: options.taxonomyid
11834
+ });
11835
+
11836
+ // Setup request with URL and Params
11837
+ var requestAPI = request.put(url)
11838
+ .set('Content-Type', 'application/json')
11839
+ .set('Accept', 'application/json')
11840
+ .send(options.body);
11841
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
11842
+
11843
+ //Setup token in Authorization header
11844
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
11845
+
11846
+ requestAPI.end(function (error, response) {
11847
+ if(error) {
11848
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
11849
+ dfd.reject(err);
11850
+ }
11851
+ else { dfd.resolve(response.body); }
11852
+ });
11853
+ }
11854
+ else {
11855
+ err = {};
11856
+ err.message = err.description = 'Mandatory params - context or taxonomyid or tagid not found in ' +
11857
+ 'request options.';
11858
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
11859
+ dfd.reject(err);
11860
+ }
11861
+ }
11862
+ return dfd.promise;
11863
+ }
11864
+
11865
+ /* options = {
11866
+ "context": "string", // required
11867
+ "taxonomyid" : "string", // required
11868
+ "tagid" : "string"
11869
+ };
11870
+ */
11871
+ function deleteTags(options) {
11872
+ var self = this;
11873
+ // Initializing promise
11874
+ var dfd = q.defer();
11875
+
11876
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
11877
+ if(err) { dfd.reject(err); }
11878
+ else {
11879
+ if (options && options.context && options.taxonomyid) {
11880
+ // Passed all validations, Contruct API url
11881
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
11882
+ url = helpers.api.constructAPIUrl(url, {
11883
+ orgId: self.orgId,
11884
+ context: encodeURIComponent(options.context),
11885
+ taxonomyId: options.taxonomyid
11886
+ });
11887
+
11888
+ var queryParam = {};
11889
+ if(options.tagid) { queryParam.tagid = options.tagid; }
11890
+
11891
+ // Setup request with URL and Params
11892
+ var requestAPI = request.delete(url).query(queryParam);
11893
+
11894
+ //Setup token in Authorization header
11895
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
11896
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
11897
+
11898
+ requestAPI.end(function (error, response) {
11899
+ if (error) {
11900
+ err = {};
11901
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
11902
+ dfd.reject(err);
11903
+ }
11904
+ else {
11905
+ dfd.resolve(response.body);
11906
+ }
11907
+ });
11908
+ }
11909
+ else {
11910
+ err = {};
11911
+ err.message = err.description = 'context or taxonomyid or tagid not found in request options.';
11912
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
11913
+ dfd.reject(err);
11914
+ }
11915
+ }
11916
+ return dfd.promise;
11917
+ }
11918
+
11919
+ /*
11920
+ options = {
11921
+ context: "string", //mandatory
11922
+ taxonomyid: "string", //mandatory
11923
+ tagid: "string" //mandatory
11924
+ }
11925
+ */
11926
+ function getTag(options) {
11927
+ var self = this;
11928
+ // Initializing promise
11929
+ var dfd = q.defer();
11930
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
11931
+ if(err) { dfd.reject(err); }
11932
+ // Validations
11933
+ else {
11934
+ if(options && options.context && options.taxonomyid && options.tagid) {
11935
+ // Passed all validations, Contruct API url
11936
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
11937
+ url = helpers.api.constructAPIUrl(url, {
11938
+ orgId: self.orgId,
11939
+ context: encodeURIComponent(options.context),
11940
+ taxonomyId: options.taxonomyid
11941
+ });
11942
+
11943
+ // Setup request with URL and Params
11944
+ var queryParam = {
11945
+ hierarchy: false,
11946
+ tagid: options.tagid
11947
+ };
11948
+
11949
+ var requestAPI = request.get(url)
11950
+ .set('Content-Type', 'application/json')
11951
+ .set('Accept', 'application/json')
11952
+ .query(queryParam);
11953
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
11954
+
11955
+ //Setup token in Authorization header
11956
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
11957
+
11958
+ requestAPI.end(function(error, response) {
11959
+ if(error) {
11960
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
11961
+ dfd.reject(err);
11962
+ }
11963
+ else { dfd.resolve(response.body); }
11964
+ });
11965
+ } else {
11966
+ err = {};
11967
+ err.message = err.description = 'Mandatory param - context or taxonomyid or tagid not found in request options.';
11968
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
11969
+ dfd.reject(err);
11970
+ }
11971
+ }
11972
+ return dfd.promise;
11973
+ }
11974
+
11975
+ /*
11976
+ options = {
11977
+ context: "string", //mandatory
11978
+ taxonomyid: "string", //mandatory
11979
+ tagid: "string" //mandatory
11980
+ }
11981
+ */
11982
+ function getTagHierarchy(options) {
11983
+ var self = this;
11984
+ // Initializing promise
11985
+ var dfd = q.defer();
11986
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
11987
+ if(err) { dfd.reject(err); }
11988
+ // Validations
11989
+ else {
11990
+ if(options && options.context && options.taxonomyid && options.tagid) {
11991
+ // Passed all validations, Contruct API url
11992
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
11993
+ url = helpers.api.constructAPIUrl(url, {
11994
+ orgId: self.orgId,
11995
+ context: encodeURIComponent(options.context),
11996
+ taxonomyId: options.taxonomyid
11997
+ });
11998
+
11999
+ // Setup request with URL and Params
12000
+ var queryParam = {
12001
+ hierarchy: true,
12002
+ tagid: options.tagid
12003
+ };
12004
+
12005
+ var requestAPI = request.get(url)
12006
+ .set('Content-Type', 'application/json')
12007
+ .set('Accept', 'application/json')
12008
+ .query(queryParam);
12009
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
12010
+
12011
+ //Setup token in Authorization header
12012
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
12013
+
12014
+ requestAPI.end(function(error, response) {
12015
+ if(error) {
12016
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
12017
+ dfd.reject(err);
12018
+ }
12019
+ else { dfd.resolve(response.body); }
12020
+ });
12021
+ } else {
12022
+ err = {};
12023
+ err.message = err.description = 'Mandatory param - context or taxonomyid or tagid not found in request options.';
12024
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
12025
+ dfd.reject(err);
12026
+ }
12027
+ }
12028
+ return dfd.promise;
12029
+ }
12030
+
12031
+ /*
12032
+ options = {
12033
+ context: "string", //mandatory
12034
+ taxonomyid: "string" //mandatory
12035
+ }
12036
+ */
12037
+ function getAllTags(options) {
12038
+ var self = this;
12039
+ // Initializing promise
12040
+ var dfd = q.defer();
12041
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
12042
+ if(err) { dfd.reject(err); }
12043
+ // Validations
12044
+ else {
12045
+ if(options && options.context && options.taxonomyid) {
12046
+ // Passed all validations, Contruct API url
12047
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
12048
+ url = helpers.api.constructAPIUrl(url, {
12049
+ orgId: self.orgId,
12050
+ context: encodeURIComponent(options.context),
12051
+ taxonomyId: options.taxonomyid
12052
+ });
12053
+
12054
+ // Setup request with URL and Params
12055
+ var queryParam = {
12056
+ hierarchy: true
12057
+ };
12058
+
12059
+ var requestAPI = request.get(url)
12060
+ .set('Content-Type', 'application/json')
12061
+ .set('Accept', 'application/json')
12062
+ .query(queryParam);
12063
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
12064
+
12065
+ //Setup token in Authorization header
12066
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
12067
+
12068
+ requestAPI.end(function(error, response) {
12069
+ if(error) {
12070
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
12071
+ dfd.reject(err);
12072
+ }
12073
+ else { dfd.resolve(response.body); }
12074
+ });
12075
+ } else {
12076
+ err = {};
12077
+ err.message = err.description = 'Mandatory param - context or taxonomyid not found in request options.';
12078
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
12079
+ dfd.reject(err);
12080
+ }
12081
+ }
12082
+ return dfd.promise;
12083
+ }
12084
+
12085
+ },{"../../helpers":3,"q":90,"superagent":133}],32:[function(require,module,exports){
11119
12086
  /*************************************************************************
11120
12087
  *
11121
12088
  * COMPRO CONFIDENTIAL
@@ -11581,7 +12548,7 @@ function updateWorkflowRequest(options) {
11581
12548
  }
11582
12549
  return dfd.promise;
11583
12550
  }
11584
- },{"./../../helpers":3,"q":88,"superagent":131}],31:[function(require,module,exports){
12551
+ },{"./../../helpers":3,"q":90,"superagent":133}],33:[function(require,module,exports){
11585
12552
  /*************************************************************************
11586
12553
  *
11587
12554
  * COMPRO CONFIDENTIAL
@@ -11858,7 +12825,7 @@ function resetUserProductProgress(options) {
11858
12825
  return dfd.promise;
11859
12826
  }
11860
12827
 
11861
- },{"../../helpers":3,"q":88,"superagent":131}],32:[function(require,module,exports){
12828
+ },{"../../helpers":3,"q":90,"superagent":133}],34:[function(require,module,exports){
11862
12829
  /*************************************************************************
11863
12830
  *
11864
12831
  * COMPRO CONFIDENTIAL
@@ -11974,7 +12941,7 @@ function authWithToken(organizationId, token, options) {
11974
12941
  return dfd.promise;
11975
12942
  };
11976
12943
 
11977
- },{"../helpers":3,"./validations":33,"q":88,"superagent":131}],33:[function(require,module,exports){
12944
+ },{"../helpers":3,"./validations":35,"q":90,"superagent":133}],35:[function(require,module,exports){
11978
12945
  /*************************************************************************
11979
12946
  *
11980
12947
  * COMPRO CONFIDENTIAL
@@ -12064,7 +13031,7 @@ function validateAuthWithExtUser(organizationId, options) {
12064
13031
  };
12065
13032
 
12066
13033
 
12067
- },{"../helpers":3}],34:[function(require,module,exports){
13034
+ },{"../helpers":3}],36:[function(require,module,exports){
12068
13035
  module.exports = after
12069
13036
 
12070
13037
  function after(count, callback, err_cb) {
@@ -12094,14 +13061,14 @@ function after(count, callback, err_cb) {
12094
13061
 
12095
13062
  function noop() {}
12096
13063
 
12097
- },{}],35:[function(require,module,exports){
13064
+ },{}],37:[function(require,module,exports){
12098
13065
  module.exports = noop;
12099
13066
  module.exports.HttpsAgent = noop;
12100
13067
 
12101
13068
  // Noop function for browser since native api's don't use agents.
12102
13069
  function noop () {}
12103
13070
 
12104
- },{}],36:[function(require,module,exports){
13071
+ },{}],38:[function(require,module,exports){
12105
13072
  /**
12106
13073
  * An abstraction for slicing an arraybuffer even when
12107
13074
  * ArrayBuffer.prototype.slice is not supported
@@ -12132,7 +13099,7 @@ module.exports = function(arraybuffer, start, end) {
12132
13099
  return result.buffer;
12133
13100
  };
12134
13101
 
12135
- },{}],37:[function(require,module,exports){
13102
+ },{}],39:[function(require,module,exports){
12136
13103
 
12137
13104
  /**
12138
13105
  * Expose `Backoff`.
@@ -12219,7 +13186,7 @@ Backoff.prototype.setJitter = function(jitter){
12219
13186
  };
12220
13187
 
12221
13188
 
12222
- },{}],38:[function(require,module,exports){
13189
+ },{}],40:[function(require,module,exports){
12223
13190
  /*
12224
13191
  * base64-arraybuffer
12225
13192
  * https://github.com/niklasvh/base64-arraybuffer
@@ -12280,7 +13247,7 @@ Backoff.prototype.setJitter = function(jitter){
12280
13247
  };
12281
13248
  })("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
12282
13249
 
12283
- },{}],39:[function(require,module,exports){
13250
+ },{}],41:[function(require,module,exports){
12284
13251
  var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
12285
13252
 
12286
13253
  ;(function (exports) {
@@ -12406,7 +13373,7 @@ var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
12406
13373
  exports.fromByteArray = uint8ToBase64
12407
13374
  }(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
12408
13375
 
12409
- },{}],40:[function(require,module,exports){
13376
+ },{}],42:[function(require,module,exports){
12410
13377
  (function (global){
12411
13378
  /**
12412
13379
  * Create a blob builder even when vendor prefixes exist
@@ -12506,9 +13473,9 @@ module.exports = (function() {
12506
13473
  })();
12507
13474
 
12508
13475
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
12509
- },{}],41:[function(require,module,exports){
13476
+ },{}],43:[function(require,module,exports){
12510
13477
 
12511
- },{}],42:[function(require,module,exports){
13478
+ },{}],44:[function(require,module,exports){
12512
13479
  (function (global){
12513
13480
  /*!
12514
13481
  * The buffer module from node.js, for the browser.
@@ -14060,7 +15027,7 @@ function blitBuffer (src, dst, offset, length) {
14060
15027
  }
14061
15028
 
14062
15029
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
14063
- },{"base64-js":39,"ieee754":72,"isarray":75}],43:[function(require,module,exports){
15030
+ },{"base64-js":41,"ieee754":74,"isarray":77}],45:[function(require,module,exports){
14064
15031
  module.exports = {
14065
15032
  "100": "Continue",
14066
15033
  "101": "Switching Protocols",
@@ -14121,7 +15088,7 @@ module.exports = {
14121
15088
  "511": "Network Authentication Required"
14122
15089
  }
14123
15090
 
14124
- },{}],44:[function(require,module,exports){
15091
+ },{}],46:[function(require,module,exports){
14125
15092
  /**
14126
15093
  * Slice reference.
14127
15094
  */
@@ -14146,7 +15113,7 @@ module.exports = function(obj, fn){
14146
15113
  }
14147
15114
  };
14148
15115
 
14149
- },{}],45:[function(require,module,exports){
15116
+ },{}],47:[function(require,module,exports){
14150
15117
 
14151
15118
  module.exports = function(a, b){
14152
15119
  var fn = function(){};
@@ -14154,7 +15121,7 @@ module.exports = function(a, b){
14154
15121
  a.prototype = new fn;
14155
15122
  a.prototype.constructor = a;
14156
15123
  };
14157
- },{}],46:[function(require,module,exports){
15124
+ },{}],48:[function(require,module,exports){
14158
15125
  // Copyright Joyent, Inc. and other Node contributors.
14159
15126
  //
14160
15127
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -14263,11 +15230,11 @@ function objectToString(o) {
14263
15230
  return Object.prototype.toString.call(o);
14264
15231
  }
14265
15232
 
14266
- },{"buffer":42}],47:[function(require,module,exports){
15233
+ },{"buffer":44}],49:[function(require,module,exports){
14267
15234
 
14268
15235
  module.exports = require('./lib/');
14269
15236
 
14270
- },{"./lib/":48}],48:[function(require,module,exports){
15237
+ },{"./lib/":50}],50:[function(require,module,exports){
14271
15238
 
14272
15239
  module.exports = require('./socket');
14273
15240
 
@@ -14279,7 +15246,7 @@ module.exports = require('./socket');
14279
15246
  */
14280
15247
  module.exports.parser = require('engine.io-parser');
14281
15248
 
14282
- },{"./socket":49,"engine.io-parser":61}],49:[function(require,module,exports){
15249
+ },{"./socket":51,"engine.io-parser":63}],51:[function(require,module,exports){
14283
15250
  (function (global){
14284
15251
  /**
14285
15252
  * Module dependencies.
@@ -15011,7 +15978,7 @@ Socket.prototype.filterUpgrades = function (upgrades) {
15011
15978
  };
15012
15979
 
15013
15980
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15014
- },{"./transport":50,"./transports":51,"component-emitter":57,"debug":58,"engine.io-parser":61,"indexof":73,"parsejson":81,"parseqs":82,"parseuri":83}],50:[function(require,module,exports){
15981
+ },{"./transport":52,"./transports":53,"component-emitter":59,"debug":60,"engine.io-parser":63,"indexof":75,"parsejson":83,"parseqs":84,"parseuri":85}],52:[function(require,module,exports){
15015
15982
  /**
15016
15983
  * Module dependencies.
15017
15984
  */
@@ -15168,7 +16135,7 @@ Transport.prototype.onClose = function () {
15168
16135
  this.emit('close');
15169
16136
  };
15170
16137
 
15171
- },{"component-emitter":57,"engine.io-parser":61}],51:[function(require,module,exports){
16138
+ },{"component-emitter":59,"engine.io-parser":63}],53:[function(require,module,exports){
15172
16139
  (function (global){
15173
16140
  /**
15174
16141
  * Module dependencies
@@ -15225,7 +16192,7 @@ function polling(opts){
15225
16192
  }
15226
16193
 
15227
16194
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15228
- },{"./polling-jsonp":52,"./polling-xhr":53,"./websocket":55,"xmlhttprequest-ssl":56}],52:[function(require,module,exports){
16195
+ },{"./polling-jsonp":54,"./polling-xhr":55,"./websocket":57,"xmlhttprequest-ssl":58}],54:[function(require,module,exports){
15229
16196
  (function (global){
15230
16197
 
15231
16198
  /**
@@ -15467,7 +16434,7 @@ JSONPPolling.prototype.doWrite = function (data, fn) {
15467
16434
  };
15468
16435
 
15469
16436
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15470
- },{"./polling":54,"component-inherit":45}],53:[function(require,module,exports){
16437
+ },{"./polling":56,"component-inherit":47}],55:[function(require,module,exports){
15471
16438
  (function (global){
15472
16439
  /**
15473
16440
  * Module requirements.
@@ -15883,7 +16850,7 @@ function unloadHandler() {
15883
16850
  }
15884
16851
 
15885
16852
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15886
- },{"./polling":54,"component-emitter":57,"component-inherit":45,"debug":58,"xmlhttprequest-ssl":56}],54:[function(require,module,exports){
16853
+ },{"./polling":56,"component-emitter":59,"component-inherit":47,"debug":60,"xmlhttprequest-ssl":58}],56:[function(require,module,exports){
15887
16854
  /**
15888
16855
  * Module dependencies.
15889
16856
  */
@@ -16132,7 +17099,7 @@ Polling.prototype.uri = function(){
16132
17099
  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
16133
17100
  };
16134
17101
 
16135
- },{"../transport":50,"component-inherit":45,"debug":58,"engine.io-parser":61,"parseqs":82,"xmlhttprequest-ssl":56,"yeast":142}],55:[function(require,module,exports){
17102
+ },{"../transport":52,"component-inherit":47,"debug":60,"engine.io-parser":63,"parseqs":84,"xmlhttprequest-ssl":58,"yeast":144}],57:[function(require,module,exports){
16136
17103
  (function (global){
16137
17104
  /**
16138
17105
  * Module dependencies.
@@ -16424,7 +17391,7 @@ WS.prototype.check = function(){
16424
17391
  };
16425
17392
 
16426
17393
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
16427
- },{"../transport":50,"component-inherit":45,"debug":58,"engine.io-parser":61,"parseqs":82,"ws":41,"yeast":142}],56:[function(require,module,exports){
17394
+ },{"../transport":52,"component-inherit":47,"debug":60,"engine.io-parser":63,"parseqs":84,"ws":43,"yeast":144}],58:[function(require,module,exports){
16428
17395
  // browser shim for xmlhttprequest module
16429
17396
  var hasCORS = require('has-cors');
16430
17397
 
@@ -16462,7 +17429,7 @@ module.exports = function(opts) {
16462
17429
  }
16463
17430
  }
16464
17431
 
16465
- },{"has-cors":70}],57:[function(require,module,exports){
17432
+ },{"has-cors":72}],59:[function(require,module,exports){
16466
17433
 
16467
17434
  /**
16468
17435
  * Expose `Emitter`.
@@ -16628,7 +17595,7 @@ Emitter.prototype.hasListeners = function(event){
16628
17595
  return !! this.listeners(event).length;
16629
17596
  };
16630
17597
 
16631
- },{}],58:[function(require,module,exports){
17598
+ },{}],60:[function(require,module,exports){
16632
17599
 
16633
17600
  /**
16634
17601
  * This is the web browser implementation of `debug()`.
@@ -16798,7 +17765,7 @@ function localstorage(){
16798
17765
  } catch (e) {}
16799
17766
  }
16800
17767
 
16801
- },{"./debug":59}],59:[function(require,module,exports){
17768
+ },{"./debug":61}],61:[function(require,module,exports){
16802
17769
 
16803
17770
  /**
16804
17771
  * This is the common logic for both the Node.js and web browser
@@ -16997,7 +17964,7 @@ function coerce(val) {
16997
17964
  return val;
16998
17965
  }
16999
17966
 
17000
- },{"ms":60}],60:[function(require,module,exports){
17967
+ },{"ms":62}],62:[function(require,module,exports){
17001
17968
  /**
17002
17969
  * Helpers.
17003
17970
  */
@@ -17124,7 +18091,7 @@ function plural(ms, n, name) {
17124
18091
  return Math.ceil(ms / n) + ' ' + name + 's';
17125
18092
  }
17126
18093
 
17127
- },{}],61:[function(require,module,exports){
18094
+ },{}],63:[function(require,module,exports){
17128
18095
  (function (global){
17129
18096
  /**
17130
18097
  * Module dependencies.
@@ -17722,7 +18689,7 @@ exports.decodePayloadAsBinary = function (data, binaryType, callback) {
17722
18689
  };
17723
18690
 
17724
18691
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
17725
- },{"./keys":62,"after":34,"arraybuffer.slice":36,"base64-arraybuffer":38,"blob":40,"has-binary":63,"utf8":137}],62:[function(require,module,exports){
18692
+ },{"./keys":64,"after":36,"arraybuffer.slice":38,"base64-arraybuffer":40,"blob":42,"has-binary":65,"utf8":139}],64:[function(require,module,exports){
17726
18693
 
17727
18694
  /**
17728
18695
  * Gets the keys for an object.
@@ -17743,7 +18710,7 @@ module.exports = Object.keys || function keys (obj){
17743
18710
  return arr;
17744
18711
  };
17745
18712
 
17746
- },{}],63:[function(require,module,exports){
18713
+ },{}],65:[function(require,module,exports){
17747
18714
  (function (global){
17748
18715
 
17749
18716
  /*
@@ -17805,12 +18772,12 @@ function hasBinary(data) {
17805
18772
  }
17806
18773
 
17807
18774
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
17808
- },{"isarray":64}],64:[function(require,module,exports){
18775
+ },{"isarray":66}],66:[function(require,module,exports){
17809
18776
  module.exports = Array.isArray || function (arr) {
17810
18777
  return Object.prototype.toString.call(arr) == '[object Array]';
17811
18778
  };
17812
18779
 
17813
- },{}],65:[function(require,module,exports){
18780
+ },{}],67:[function(require,module,exports){
17814
18781
  // Copyright Joyent, Inc. and other Node contributors.
17815
18782
  //
17816
18783
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -18113,7 +19080,7 @@ function isUndefined(arg) {
18113
19080
  return arg === void 0;
18114
19081
  }
18115
19082
 
18116
- },{}],66:[function(require,module,exports){
19083
+ },{}],68:[function(require,module,exports){
18117
19084
  var hasOwn = Object.prototype.hasOwnProperty;
18118
19085
  var toStr = Object.prototype.toString;
18119
19086
  var defineProperty = Object.defineProperty;
@@ -18234,7 +19201,7 @@ module.exports = function extend() {
18234
19201
  return target;
18235
19202
  };
18236
19203
 
18237
- },{}],67:[function(require,module,exports){
19204
+ },{}],69:[function(require,module,exports){
18238
19205
 
18239
19206
  var hasOwn = Object.prototype.hasOwnProperty;
18240
19207
  var toString = Object.prototype.toString;
@@ -18258,7 +19225,7 @@ module.exports = function forEach (obj, fn, ctx) {
18258
19225
  };
18259
19226
 
18260
19227
 
18261
- },{}],68:[function(require,module,exports){
19228
+ },{}],70:[function(require,module,exports){
18262
19229
  (function (global){
18263
19230
 
18264
19231
  /*
@@ -18321,9 +19288,9 @@ function hasBinary(data) {
18321
19288
  }
18322
19289
 
18323
19290
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
18324
- },{"isarray":69}],69:[function(require,module,exports){
18325
- arguments[4][64][0].apply(exports,arguments)
18326
- },{"dup":64}],70:[function(require,module,exports){
19291
+ },{"isarray":71}],71:[function(require,module,exports){
19292
+ arguments[4][66][0].apply(exports,arguments)
19293
+ },{"dup":66}],72:[function(require,module,exports){
18327
19294
 
18328
19295
  /**
18329
19296
  * Module exports.
@@ -18342,7 +19309,7 @@ try {
18342
19309
  module.exports = false;
18343
19310
  }
18344
19311
 
18345
- },{}],71:[function(require,module,exports){
19312
+ },{}],73:[function(require,module,exports){
18346
19313
  var http = require('http');
18347
19314
 
18348
19315
  var https = module.exports;
@@ -18358,7 +19325,7 @@ https.request = function (params, cb) {
18358
19325
  return http.request.call(this, params, cb);
18359
19326
  }
18360
19327
 
18361
- },{"http":125}],72:[function(require,module,exports){
19328
+ },{"http":127}],74:[function(require,module,exports){
18362
19329
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
18363
19330
  exports.read = function (buffer, offset, isLE, mLen, nBytes) {
18364
19331
  var e, m
@@ -18445,7 +19412,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
18445
19412
  buffer[offset + i - d] |= s * 128
18446
19413
  }
18447
19414
 
18448
- },{}],73:[function(require,module,exports){
19415
+ },{}],75:[function(require,module,exports){
18449
19416
 
18450
19417
  var indexOf = [].indexOf;
18451
19418
 
@@ -18456,7 +19423,7 @@ module.exports = function(arr, obj){
18456
19423
  }
18457
19424
  return -1;
18458
19425
  };
18459
- },{}],74:[function(require,module,exports){
19426
+ },{}],76:[function(require,module,exports){
18460
19427
  if (typeof Object.create === 'function') {
18461
19428
  // implementation from standard node.js 'util' module
18462
19429
  module.exports = function inherits(ctor, superCtor) {
@@ -18485,14 +19452,14 @@ if (typeof Object.create === 'function') {
18485
19452
  }
18486
19453
  }
18487
19454
 
18488
- },{}],75:[function(require,module,exports){
19455
+ },{}],77:[function(require,module,exports){
18489
19456
  var toString = {}.toString;
18490
19457
 
18491
19458
  module.exports = Array.isArray || function (arr) {
18492
19459
  return toString.call(arr) == '[object Array]';
18493
19460
  };
18494
19461
 
18495
- },{}],76:[function(require,module,exports){
19462
+ },{}],78:[function(require,module,exports){
18496
19463
  (function (global){
18497
19464
  /*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */
18498
19465
  ;(function () {
@@ -19398,7 +20365,7 @@ module.exports = Array.isArray || function (arr) {
19398
20365
  }).call(this);
19399
20366
 
19400
20367
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
19401
- },{}],77:[function(require,module,exports){
20368
+ },{}],79:[function(require,module,exports){
19402
20369
  'use strict';
19403
20370
 
19404
20371
  var keysShim;
@@ -19522,7 +20489,7 @@ if (!Object.keys) {
19522
20489
  }
19523
20490
  module.exports = keysShim;
19524
20491
 
19525
- },{"./isArguments":79}],78:[function(require,module,exports){
20492
+ },{"./isArguments":81}],80:[function(require,module,exports){
19526
20493
  'use strict';
19527
20494
 
19528
20495
  var slice = Array.prototype.slice;
@@ -19556,7 +20523,7 @@ keysShim.shim = function shimObjectKeys() {
19556
20523
 
19557
20524
  module.exports = keysShim;
19558
20525
 
19559
- },{"./implementation":77,"./isArguments":79}],79:[function(require,module,exports){
20526
+ },{"./implementation":79,"./isArguments":81}],81:[function(require,module,exports){
19560
20527
  'use strict';
19561
20528
 
19562
20529
  var toStr = Object.prototype.toString;
@@ -19575,7 +20542,7 @@ module.exports = function isArguments(value) {
19575
20542
  return isArgs;
19576
20543
  };
19577
20544
 
19578
- },{}],80:[function(require,module,exports){
20545
+ },{}],82:[function(require,module,exports){
19579
20546
  exports.endianness = function () { return 'LE' };
19580
20547
 
19581
20548
  exports.hostname = function () {
@@ -19622,7 +20589,7 @@ exports.tmpdir = exports.tmpDir = function () {
19622
20589
 
19623
20590
  exports.EOL = '\n';
19624
20591
 
19625
- },{}],81:[function(require,module,exports){
20592
+ },{}],83:[function(require,module,exports){
19626
20593
  (function (global){
19627
20594
  /**
19628
20595
  * JSON parse.
@@ -19657,7 +20624,7 @@ module.exports = function parsejson(data) {
19657
20624
  }
19658
20625
  };
19659
20626
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
19660
- },{}],82:[function(require,module,exports){
20627
+ },{}],84:[function(require,module,exports){
19661
20628
  /**
19662
20629
  * Compiles a querystring
19663
20630
  * Returns string representation of the object
@@ -19696,7 +20663,7 @@ exports.decode = function(qs){
19696
20663
  return qry;
19697
20664
  };
19698
20665
 
19699
- },{}],83:[function(require,module,exports){
20666
+ },{}],85:[function(require,module,exports){
19700
20667
  /**
19701
20668
  * Parses an URI
19702
20669
  *
@@ -19737,7 +20704,7 @@ module.exports = function parseuri(str) {
19737
20704
  return uri;
19738
20705
  };
19739
20706
 
19740
- },{}],84:[function(require,module,exports){
20707
+ },{}],86:[function(require,module,exports){
19741
20708
  (function (process){
19742
20709
  'use strict';
19743
20710
 
@@ -19786,7 +20753,7 @@ function nextTick(fn, arg1, arg2, arg3) {
19786
20753
 
19787
20754
 
19788
20755
  }).call(this,require('_process'))
19789
- },{"_process":85}],85:[function(require,module,exports){
20756
+ },{"_process":87}],87:[function(require,module,exports){
19790
20757
  // shim for using process in browser
19791
20758
  var process = module.exports = {};
19792
20759
 
@@ -19972,11 +20939,11 @@ process.chdir = function (dir) {
19972
20939
  };
19973
20940
  process.umask = function() { return 0; };
19974
20941
 
19975
- },{}],86:[function(require,module,exports){
20942
+ },{}],88:[function(require,module,exports){
19976
20943
  !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PubNub=t():e.PubNub=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){if(!navigator||!navigator.sendBeacon)return!1;navigator.sendBeacon(e)}Object.defineProperty(t,"__esModule",{value:!0});var u=n(1),c=r(u),l=n(40),h=r(l),f=n(41),p=r(f),d=n(42),y=(n(5),function(e){function t(e){i(this,t);var n=e.listenToBrowserNetworkEvents,r=void 0===n||n;e.db=p.default,e.sdkFamily="Web",e.networking=new h.default({del:d.del,get:d.get,post:d.post,sendBeacon:a});var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r&&(window.addEventListener("offline",function(){o.networkDownDetected()}),window.addEventListener("online",function(){o.networkUpDetected()})),o}return o(t,e),t}(c.default));t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(2),u=i(a),c=n(6),l=i(c),h=n(8),f=i(h),p=n(9),d=i(p),y=n(16),g=i(y),b=n(17),v=r(b),_=n(18),m=r(_),k=n(19),P=r(k),O=n(20),T=r(O),S=n(21),w=r(S),C=n(22),M=r(C),E=n(23),x=r(E),N=n(24),R=r(N),A=n(25),D=r(A),K=n(26),j=r(K),G=n(27),U=r(G),I=n(28),H=r(I),B=n(29),L=r(B),q=n(30),F=r(q),z=n(31),X=r(z),W=n(32),J=r(W),V=n(33),$=r(V),Q=n(34),Y=r(Q),Z=n(35),ee=r(Z),te=n(36),ne=r(te),re=n(37),ie=r(re),se=n(38),oe=r(se),ae=n(12),ue=r(ae),ce=n(39),le=r(ce),he=n(13),fe=i(he),pe=n(10),de=i(pe),ye=(n(5),n(3)),ge=i(ye),be=function(){function e(t){var n=this;s(this,e);var r=t.db,i=t.networking,o=this._config=new u.default({setup:t,db:r}),a=new l.default({config:o});i.init(o);var c={config:o,networking:i,crypto:a},h=g.default.bind(this,c,ue),p=g.default.bind(this,c,j),y=g.default.bind(this,c,H),b=g.default.bind(this,c,F),_=g.default.bind(this,c,le),k=this._listenerManager=new d.default,O=new f.default({timeEndpoint:h,leaveEndpoint:p,heartbeatEndpoint:y,setStateEndpoint:b,subscribeEndpoint:_,crypto:c.crypto,config:c.config,listenerManager:k});this.addListener=k.addListener.bind(k),this.removeListener=k.removeListener.bind(k),this.removeAllListeners=k.removeAllListeners.bind(k),this.channelGroups={listGroups:g.default.bind(this,c,T),listChannels:g.default.bind(this,c,w),addChannels:g.default.bind(this,c,v),removeChannels:g.default.bind(this,c,m),deleteGroup:g.default.bind(this,c,P)},this.push={addChannels:g.default.bind(this,c,M),removeChannels:g.default.bind(this,c,x),deleteDevice:g.default.bind(this,c,D),listChannels:g.default.bind(this,c,R)},this.hereNow=g.default.bind(this,c,X),this.whereNow=g.default.bind(this,c,U),this.getState=g.default.bind(this,c,L),this.setState=O.adaptStateChange.bind(O),this.grant=g.default.bind(this,c,$),this.audit=g.default.bind(this,c,J),this.publish=g.default.bind(this,c,Y),this.fire=function(e,t){return e.replicate=!1,e.storeInHistory=!1,n.publish(e,t)},this.history=g.default.bind(this,c,ee),this.deleteMessages=g.default.bind(this,c,ne),this.messageCounts=g.default.bind(this,c,ie),this.fetchMessages=g.default.bind(this,c,oe),this.time=h,this.subscribe=O.adaptSubscribeChange.bind(O),this.presence=O.adaptPresenceChange.bind(O),this.unsubscribe=O.adaptUnsubscribeChange.bind(O),this.disconnect=O.disconnect.bind(O),this.reconnect=O.reconnect.bind(O),this.destroy=function(e){O.unsubscribeAll(e),O.disconnect()},this.stop=this.destroy,this.unsubscribeAll=O.unsubscribeAll.bind(O),this.getSubscribedChannels=O.getSubscribedChannels.bind(O),this.getSubscribedChannelGroups=O.getSubscribedChannelGroups.bind(O),this.encrypt=a.encrypt.bind(a),this.decrypt=a.decrypt.bind(a),this.getAuthKey=c.config.getAuthKey.bind(c.config),this.setAuthKey=c.config.setAuthKey.bind(c.config),this.setCipherKey=c.config.setCipherKey.bind(c.config),this.getUUID=c.config.getUUID.bind(c.config),this.setUUID=c.config.setUUID.bind(c.config),this.getFilterExpression=c.config.getFilterExpression.bind(c.config),this.setFilterExpression=c.config.setFilterExpression.bind(c.config),this.setHeartbeatInterval=c.config.setHeartbeatInterval.bind(c.config),i.hasModule("proxy")&&(this.setProxy=function(e){c.config.setProxy(e),n.reconnect()})}return o(e,[{key:"getVersion",value:function(){return this._config.getVersion()}},{key:"networkDownDetected",value:function(){this._listenerManager.announceNetworkDown(),this._config.restore?this.disconnect():this.destroy(!0)}},{key:"networkUpDetected",value:function(){this._listenerManager.announceNetworkUp(),this.reconnect()}}],[{key:"generateUUID",value:function(){return ge.default.createUUID()}}]),e}();be.OPERATIONS=fe.default,be.CATEGORIES=de.default,t.default=be,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(3),o=function(e){return e&&e.__esModule?e:{default:e}}(s),a=(n(5),function(){function e(t){var n=t.setup,i=t.db;r(this,e),this._db=i,this.instanceId="pn-"+o.default.createUUID(),this.secretKey=n.secretKey||n.secret_key,this.subscribeKey=n.subscribeKey||n.subscribe_key,this.publishKey=n.publishKey||n.publish_key,this.sdkName=n.sdkName,this.sdkFamily=n.sdkFamily,this.partnerId=n.partnerId,this.setAuthKey(n.authKey),this.setCipherKey(n.cipherKey),this.setFilterExpression(n.filterExpression),this.origin=n.origin||"ps.pndsn.com",this.secure=n.ssl||!1,this.restore=n.restore||!1,this.proxy=n.proxy,this.keepAlive=n.keepAlive,this.keepAliveSettings=n.keepAliveSettings,this.autoNetworkDetection=n.autoNetworkDetection||!1,this.dedupeOnSubscribe=n.dedupeOnSubscribe||!1,this.maximumCacheSize=n.maximumCacheSize||100,this.customEncrypt=n.customEncrypt,this.customDecrypt=n.customDecrypt,"undefined"!=typeof location&&"https:"===location.protocol&&(this.secure=!0),this.logVerbosity=n.logVerbosity||!1,this.suppressLeaveEvents=n.suppressLeaveEvents||!1,this.announceFailedHeartbeats=n.announceFailedHeartbeats||!0,this.announceSuccessfulHeartbeats=n.announceSuccessfulHeartbeats||!1,this.useInstanceId=n.useInstanceId||!1,this.useRequestId=n.useRequestId||!1,this.requestMessageCountThreshold=n.requestMessageCountThreshold,this.setTransactionTimeout(n.transactionalRequestTimeout||15e3),this.setSubscribeTimeout(n.subscribeRequestTimeout||31e4),this.setSendBeaconConfig(n.useSendBeacon||!0),this.setPresenceTimeout(n.presenceTimeout||300),null!=n.heartbeatInterval&&this.setHeartbeatInterval(n.heartbeatInterval),this.setUUID(this._decideUUID(n.uuid))}return i(e,[{key:"getAuthKey",value:function(){return this.authKey}},{key:"setAuthKey",value:function(e){return this.authKey=e,this}},{key:"setCipherKey",value:function(e){return this.cipherKey=e,this}},{key:"getUUID",value:function(){return this.UUID}},{key:"setUUID",value:function(e){return this._db&&this._db.set&&this._db.set(this.subscribeKey+"uuid",e),this.UUID=e,this}},{key:"getFilterExpression",value:function(){return this.filterExpression}},{key:"setFilterExpression",value:function(e){return this.filterExpression=e,this}},{key:"getPresenceTimeout",value:function(){return this._presenceTimeout}},{key:"setPresenceTimeout",value:function(e){return this._presenceTimeout=e,this.setHeartbeatInterval(this._presenceTimeout/2-1),this}},{key:"setProxy",value:function(e){this.proxy=e}},{key:"getHeartbeatInterval",value:function(){return this._heartbeatInterval}},{key:"setHeartbeatInterval",value:function(e){return this._heartbeatInterval=e,this}},{key:"getSubscribeTimeout",value:function(){return this._subscribeRequestTimeout}},{key:"setSubscribeTimeout",value:function(e){return this._subscribeRequestTimeout=e,this}},{key:"getTransactionTimeout",value:function(){return this._transactionalRequestTimeout}},{key:"setTransactionTimeout",value:function(e){return this._transactionalRequestTimeout=e,this}},{key:"isSendBeaconEnabled",value:function(){return this._useSendBeacon}},{key:"setSendBeaconConfig",value:function(e){return this._useSendBeacon=e,this}},{key:"getVersion",value:function(){return"4.24.2"}},{key:"_decideUUID",value:function(e){return e||(this._db&&this._db.get&&this._db.get(this.subscribeKey+"uuid")?this._db.get(this.subscribeKey+"uuid"):"pn-"+o.default.createUUID())}}]),e}());t.default=a,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default={createUUID:function(){return i.default.uuid?i.default.uuid():(0,i.default)()}},e.exports=t.default},function(e,t,n){var r,i,s;!function(n,o){i=[t],r=o,void 0!==(s="function"==typeof r?r.apply(t,i):r)&&(e.exports=s)}(0,function(e){function t(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n}function n(e,t){var n=r[t||"all"];return n&&n.test(e)||!1}var r={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};t.isUUID=n,t.VERSION="0.1.0",e.uuid=t,e.isUUID=n})},function(e,t){"use strict";e.exports={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),a=(r(o),n(7)),u=r(a),c=function(){function e(t){var n=t.config;i(this,e),this._config=n,this._iv="0123456789012345",this._allowedKeyEncodings=["hex","utf8","base64","binary"],this._allowedKeyLengths=[128,256],this._allowedModes=["ecb","cbc"],this._defaultOptions={encryptKey:!0,keyEncoding:"utf8",keyLength:256,mode:"cbc"}}return s(e,[{key:"HMACSHA256",value:function(e){return u.default.HmacSHA256(e,this._config.secretKey).toString(u.default.enc.Base64)}},{key:"SHA256",value:function(e){return u.default.SHA256(e).toString(u.default.enc.Hex)}},{key:"_parseOptions",value:function(e){var t=e||{};return t.hasOwnProperty("encryptKey")||(t.encryptKey=this._defaultOptions.encryptKey),t.hasOwnProperty("keyEncoding")||(t.keyEncoding=this._defaultOptions.keyEncoding),t.hasOwnProperty("keyLength")||(t.keyLength=this._defaultOptions.keyLength),t.hasOwnProperty("mode")||(t.mode=this._defaultOptions.mode),-1===this._allowedKeyEncodings.indexOf(t.keyEncoding.toLowerCase())&&(t.keyEncoding=this._defaultOptions.keyEncoding),-1===this._allowedKeyLengths.indexOf(parseInt(t.keyLength,10))&&(t.keyLength=this._defaultOptions.keyLength),-1===this._allowedModes.indexOf(t.mode.toLowerCase())&&(t.mode=this._defaultOptions.mode),t}},{key:"_decodeKey",value:function(e,t){return"base64"===t.keyEncoding?u.default.enc.Base64.parse(e):"hex"===t.keyEncoding?u.default.enc.Hex.parse(e):e}},{key:"_getPaddedKey",value:function(e,t){return e=this._decodeKey(e,t),t.encryptKey?u.default.enc.Utf8.parse(this.SHA256(e).slice(0,32)):e}},{key:"_getMode",value:function(e){return"ecb"===e.mode?u.default.mode.ECB:u.default.mode.CBC}},{key:"_getIV",value:function(e){return"cbc"===e.mode?u.default.enc.Utf8.parse(this._iv):null}},{key:"encrypt",value:function(e,t,n){return this._config.customEncrypt?this._config.customEncrypt(e):this.pnEncrypt(e,t,n)}},{key:"decrypt",value:function(e,t,n){return this._config.customDecrypt?this._config.customDecrypt(e):this.pnDecrypt(e,t,n)}},{key:"pnEncrypt",value:function(e,t,n){if(!t&&!this._config.cipherKey)return e;n=this._parseOptions(n);var r=this._getIV(n),i=this._getMode(n),s=this._getPaddedKey(t||this._config.cipherKey,n);return u.default.AES.encrypt(e,s,{iv:r,mode:i}).ciphertext.toString(u.default.enc.Base64)||e}},{key:"pnDecrypt",value:function(e,t,n){if(!t&&!this._config.cipherKey)return e;n=this._parseOptions(n);var r=this._getIV(n),i=this._getMode(n),s=this._getPaddedKey(t||this._config.cipherKey,n);try{var o=u.default.enc.Base64.parse(e),a=u.default.AES.decrypt({ciphertext:o},s,{iv:r,mode:i}).toString(u.default.enc.Utf8);return JSON.parse(a)}catch(e){return null}}}]),e}();t.default=c,e.exports=t.default},function(e,t){"use strict";var n=n||function(e,t){var n={},r=n.lib={},i=function(){},s=r.Base={extend:function(e){i.prototype=this;var t=new i;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=r.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes;if(e=e.sigBytes,this.clamp(),r%4)for(var i=0;i<e;i++)t[r+i>>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535<n.length)for(i=0;i<e;i+=4)t[r+i>>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r<t;r+=4)n.push(4294967296*e.random()|0);return new o.init(n,t)}}),a=n.enc={},u=a.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++){var i=t[r>>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=a.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++)n.push(String.fromCharCode(t[r>>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},l=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},h=r.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,s=this.blockSize,a=i/(4*s),a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0);if(t=a*s,i=e.min(4*t,i),t){for(var u=0;u<t;u+=s)this._doProcessBlock(r,u);u=r.splice(0,t),n.sigBytes-=i}return new o.init(u,i)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});r.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new f.HMAC.init(e,n).finalize(t)}}});var f=n.algo={};return n}(Math);!function(e){for(var t=n,r=t.lib,i=r.WordArray,s=r.Hasher,r=t.algo,o=[],a=[],u=function(e){return 4294967296*(e-(0|e))|0},c=2,l=0;64>l;){var h;e:{h=c;for(var f=e.sqrt(h),p=2;p<=f;p++)if(!(h%p)){h=!1;break e}h=!0}h&&(8>l&&(o[l]=u(e.pow(c,.5))),a[l]=u(e.pow(c,1/3)),l++),c++}var d=[],r=r.SHA256=s.extend({_doReset:function(){this._hash=new i.init(o.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],c=n[5],l=n[6],h=n[7],f=0;64>f;f++){if(16>f)d[f]=0|e[t+f];else{var p=d[f-15],y=d[f-2];d[f]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+d[f-7]+((y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10)+d[f-16]}p=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+a[f]+d[f],y=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&s^i&s),h=l,l=c,c=u,u=o+p|0,o=s,s=i,i=r,r=p+y|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+o|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=s._createHelper(r),t.HmacSHA256=s._createHmacHelper(r)}(Math),function(){var e=n,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,i=4*r;n.sigBytes>i&&(n=e.finalize(n)),n.clamp();for(var s=this._oKey=n.clone(),o=this._iKey=n.clone(),a=s.words,u=o.words,c=0;c<r;c++)a[c]^=1549556828,u[c]^=909522486;s.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;return e=t.finalize(e),t.reset(),t.finalize(this._oKey.clone().concat(e))}})}(),function(){var e=n,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp(),e=[];for(var i=0;i<n;i+=3)for(var s=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,o=0;4>o&&i+.75*o<n;o++)e.push(r.charAt(s>>>6*(3-o)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map,i=r.charAt(64);i&&-1!=(i=e.indexOf(i))&&(n=i);for(var i=[],s=0,o=0;o<n;o++)if(o%4){var a=r.indexOf(e.charAt(o-1))<<o%4*2,u=r.indexOf(e.charAt(o))>>>6-o%4*2;i[s>>>2]|=(a|u)<<24-s%4*8,s++}return t.create(i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,n,r,i,s,o){return((e=e+(t&n|~t&r)+i+o)<<s|e>>>32-s)+t}function r(e,t,n,r,i,s,o){return((e=e+(t&r|n&~r)+i+o)<<s|e>>>32-s)+t}function i(e,t,n,r,i,s,o){return((e=e+(t^n^r)+i+o)<<s|e>>>32-s)+t}function s(e,t,n,r,i,s,o){return((e=e+(n^(t|~r))+i+o)<<s|e>>>32-s)+t}for(var o=n,a=o.lib,u=a.WordArray,c=a.Hasher,a=o.algo,l=[],h=0;64>h;h++)l[h]=4294967296*e.abs(e.sin(h+1))|0;a=a.MD5=c.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,n){for(var o=0;16>o;o++){var a=n+o,u=e[a];e[a]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}var o=this._hash.words,a=e[n+0],u=e[n+1],c=e[n+2],h=e[n+3],f=e[n+4],p=e[n+5],d=e[n+6],y=e[n+7],g=e[n+8],b=e[n+9],v=e[n+10],_=e[n+11],m=e[n+12],k=e[n+13],P=e[n+14],O=e[n+15],T=o[0],S=o[1],w=o[2],C=o[3],T=t(T,S,w,C,a,7,l[0]),C=t(C,T,S,w,u,12,l[1]),w=t(w,C,T,S,c,17,l[2]),S=t(S,w,C,T,h,22,l[3]),T=t(T,S,w,C,f,7,l[4]),C=t(C,T,S,w,p,12,l[5]),w=t(w,C,T,S,d,17,l[6]),S=t(S,w,C,T,y,22,l[7]),T=t(T,S,w,C,g,7,l[8]),C=t(C,T,S,w,b,12,l[9]),w=t(w,C,T,S,v,17,l[10]),S=t(S,w,C,T,_,22,l[11]),T=t(T,S,w,C,m,7,l[12]),C=t(C,T,S,w,k,12,l[13]),w=t(w,C,T,S,P,17,l[14]),S=t(S,w,C,T,O,22,l[15]),T=r(T,S,w,C,u,5,l[16]),C=r(C,T,S,w,d,9,l[17]),w=r(w,C,T,S,_,14,l[18]),S=r(S,w,C,T,a,20,l[19]),T=r(T,S,w,C,p,5,l[20]),C=r(C,T,S,w,v,9,l[21]),w=r(w,C,T,S,O,14,l[22]),S=r(S,w,C,T,f,20,l[23]),T=r(T,S,w,C,b,5,l[24]),C=r(C,T,S,w,P,9,l[25]),w=r(w,C,T,S,h,14,l[26]),S=r(S,w,C,T,g,20,l[27]),T=r(T,S,w,C,k,5,l[28]),C=r(C,T,S,w,c,9,l[29]),w=r(w,C,T,S,y,14,l[30]),S=r(S,w,C,T,m,20,l[31]),T=i(T,S,w,C,p,4,l[32]),C=i(C,T,S,w,g,11,l[33]),w=i(w,C,T,S,_,16,l[34]),S=i(S,w,C,T,P,23,l[35]),T=i(T,S,w,C,u,4,l[36]),C=i(C,T,S,w,f,11,l[37]),w=i(w,C,T,S,y,16,l[38]),S=i(S,w,C,T,v,23,l[39]),T=i(T,S,w,C,k,4,l[40]),C=i(C,T,S,w,a,11,l[41]),w=i(w,C,T,S,h,16,l[42]),S=i(S,w,C,T,d,23,l[43]),T=i(T,S,w,C,b,4,l[44]),C=i(C,T,S,w,m,11,l[45]),w=i(w,C,T,S,O,16,l[46]),S=i(S,w,C,T,c,23,l[47]),T=s(T,S,w,C,a,6,l[48]),C=s(C,T,S,w,y,10,l[49]),w=s(w,C,T,S,P,15,l[50]),S=s(S,w,C,T,p,21,l[51]),T=s(T,S,w,C,m,6,l[52]),C=s(C,T,S,w,h,10,l[53]),w=s(w,C,T,S,v,15,l[54]),S=s(S,w,C,T,u,21,l[55]),T=s(T,S,w,C,g,6,l[56]),C=s(C,T,S,w,O,10,l[57]),w=s(w,C,T,S,d,15,l[58]),S=s(S,w,C,T,k,21,l[59]),T=s(T,S,w,C,f,6,l[60]),C=s(C,T,S,w,_,10,l[61]),w=s(w,C,T,S,c,15,l[62]),S=s(S,w,C,T,b,21,l[63]);o[0]=o[0]+T|0,o[1]=o[1]+S|0,o[2]=o[2]+w|0,o[3]=o[3]+C|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var s=e.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process(),t=this._hash,n=t.words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}}),o.MD5=c._createHelper(a),o.HmacMD5=c._createHmacHelper(a)}(Math),function(){var e=n,t=e.lib,r=t.Base,i=t.WordArray,t=e.algo,s=t.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=n.hasher.create(),s=i.create(),o=s.words,a=n.keySize,n=n.iterations;o.length<a;){u&&r.update(u);var u=r.update(e).finalize(t);r.reset();for(var c=1;c<n;c++)u=r.finalize(u),r.reset();s.concat(u)}return s.sigBytes=4*a,s}});e.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}}(),n.lib.Cipher||function(e){var t=n,r=t.lib,i=r.Base,s=r.WordArray,o=r.BufferedBlockAlgorithm,a=t.enc.Base64,u=t.algo.EvpKDF,c=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,n,r){return("string"==typeof n?y:d).encrypt(e,t,n,r)},decrypt:function(t,n,r){return("string"==typeof n?y:d).decrypt(e,t,n,r)}}}});r.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=t.mode={},h=function(e,t,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)e[t+i]^=r[i]},f=(r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();f.Encryptor=f.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize;h.call(this,e,t,r),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+r)}}),f.Decryptor=f.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=e.slice(t,t+r);n.decryptBlock(e,t),h.call(this,e,t,r),this._prevBlock=i}}),l=l.CBC=f,f=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,n=n-e.sigBytes%n,r=n<<24|n<<16|n<<8|n,i=[],o=0;o<n;o+=4)i.push(r);n=s.create(i,n),e.concat(n)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},r.BlockCipher=c.extend({cfg:c.cfg.extend({mode:l,padding:f}),reset:function(){c.reset.call(this);var e=this.cfg,t=e.iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var p=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),l=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return e=e.salt,(e?s.create([1398893684,1701076831]).concat(e).concat(t):t).toString(a)},parse:function(e){e=a.parse(e);var t=e.words;if(1398893684==t[0]&&1701076831==t[1]){var n=s.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return p.create({ciphertext:e,salt:n})}},d=r.SerializableCipher=i.extend({cfg:i.extend({format:l}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r);return t=i.finalize(t),i=i.cfg,p.create({ciphertext:t,key:n,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),t=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){return r||(r=s.random(8)),e=u.create({keySize:t+n}).compute(e,r),n=s.create(e.words.slice(t),4*n),e.sigBytes=4*t,p.create({key:e,iv:n,salt:r})}},y=r.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:t}),encrypt:function(e,t,n,r){return r=this.cfg.extend(r),n=r.kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,e=d.encrypt.call(this,e,t,n.key,r),e.mixIn(n),e},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),n=r.kdf.execute(n,e.keySize,e.ivSize,t.salt),r.iv=n.iv,d.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],s=[],o=[],a=[],u=[],c=[],l=[],h=[],f=[],p=[],d=[],y=0;256>y;y++)d[y]=128>y?y<<1:y<<1^283;for(var g=0,b=0,y=0;256>y;y++){var v=b^b<<1^b<<2^b<<3^b<<4,v=v>>>8^255&v^99;i[g]=v,s[v]=g;var _=d[g],m=d[_],k=d[m],P=257*d[v]^16843008*v;o[g]=P<<24|P>>>8,a[g]=P<<16|P>>>16,u[g]=P<<8|P>>>24,c[g]=P,P=16843009*k^65537*m^257*_^16843008*g,l[v]=P<<24|P>>>8,h[v]=P<<16|P>>>16,f[v]=P<<8|P>>>24,p[v]=P,g?(g=_^d[d[d[k^_]]],b^=d[d[b]]):g=b=1}var O=[0,1,2,4,8,16,32,64,128,27,54],r=r.AES=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes/4,e=4*((this._nRounds=n+6)+1),r=this._keySchedule=[],s=0;s<e;s++)if(s<n)r[s]=t[s];else{var o=r[s-1];s%n?6<n&&4==s%n&&(o=i[o>>>24]<<24|i[o>>>16&255]<<16|i[o>>>8&255]<<8|i[255&o]):(o=o<<8|o>>>24,o=i[o>>>24]<<24|i[o>>>16&255]<<16|i[o>>>8&255]<<8|i[255&o],o^=O[s/n|0]<<24),r[s]=r[s-n]^o}for(t=this._invKeySchedule=[],n=0;n<e;n++)s=e-n,o=n%4?r[s]:r[s-4],t[n]=4>n||4>=s?o:l[i[o>>>24]]^h[i[o>>>16&255]]^f[i[o>>>8&255]]^p[i[255&o]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,u,c,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,h,f,p,s),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,s,o,a){for(var u=this._nRounds,c=e[t]^n[0],l=e[t+1]^n[1],h=e[t+2]^n[2],f=e[t+3]^n[3],p=4,d=1;d<u;d++)var y=r[c>>>24]^i[l>>>16&255]^s[h>>>8&255]^o[255&f]^n[p++],g=r[l>>>24]^i[h>>>16&255]^s[f>>>8&255]^o[255&c]^n[p++],b=r[h>>>24]^i[f>>>16&255]^s[c>>>8&255]^o[255&l]^n[p++],f=r[f>>>24]^i[c>>>16&255]^s[l>>>8&255]^o[255&h]^n[p++],c=y,l=g,h=b;y=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^n[p++],g=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&c])^n[p++],b=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^n[p++],f=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^n[p++],e[t]=y,e[t+1]=g,e[t+2]=b,e[t+3]=f},keySize:8});e.AES=t._createHelper(r)}(),n.mode.ECB=function(){var e=n.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),e.Decryptor=e.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),e}(),e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(6),a=(r(o),n(2)),u=(r(a),n(9)),c=(r(u),n(11)),l=r(c),h=n(14),f=r(h),p=n(15),d=r(p),y=(n(5),n(10)),g=r(y),b=function(){function e(t){var n=t.subscribeEndpoint,r=t.leaveEndpoint,s=t.heartbeatEndpoint,o=t.setStateEndpoint,a=t.timeEndpoint,u=t.config,c=t.crypto,h=t.listenerManager;i(this,e),this._listenerManager=h,this._config=u,this._leaveEndpoint=r,this._heartbeatEndpoint=s,this._setStateEndpoint=o,this._subscribeEndpoint=n,this._crypto=c,this._channels={},this._presenceChannels={},this._heartbeatChannels={},this._heartbeatChannelGroups={},this._channelGroups={},this._presenceChannelGroups={},this._pendingChannelSubscriptions=[],this._pendingChannelGroupSubscriptions=[],this._currentTimetoken=0,this._lastTimetoken=0,this._storedTimetoken=null,this._subscriptionStatusAnnounced=!1,this._isOnline=!0,this._reconnectionManager=new l.default({timeEndpoint:a}),this._dedupingManager=new f.default({config:u})}return s(e,[{key:"adaptStateChange",value:function(e,t){var n=this,r=e.state,i=e.channels,s=void 0===i?[]:i,o=e.channelGroups,a=void 0===o?[]:o;return s.forEach(function(e){e in n._channels&&(n._channels[e].state=r)}),a.forEach(function(e){e in n._channelGroups&&(n._channelGroups[e].state=r)}),this._setStateEndpoint({state:r,channels:s,channelGroups:a},t)}},{key:"adaptPresenceChange",value:function(e){var t=this,n=e.connected,r=e.channels,i=void 0===r?[]:r,s=e.channelGroups,o=void 0===s?[]:s;n?(i.forEach(function(e){t._heartbeatChannels[e]={state:{}}}),o.forEach(function(e){t._heartbeatChannelGroups[e]={state:{}}})):(i.forEach(function(e){e in t._heartbeatChannels&&delete t._heartbeatChannels[e]}),o.forEach(function(e){e in t._heartbeatChannelGroups&&delete t._heartbeatChannelGroups[e]}),!1===this._config.suppressLeaveEvents&&this._leaveEndpoint({channels:i,channelGroups:o},function(e){t._listenerManager.announceStatus(e)})),this.reconnect()}},{key:"adaptSubscribeChange",value:function(e){var t=this,n=e.timetoken,r=e.channels,i=void 0===r?[]:r,s=e.channelGroups,o=void 0===s?[]:s,a=e.withPresence,u=void 0!==a&&a,c=e.withHeartbeats,l=void 0!==c&&c;if(!this._config.subscribeKey||""===this._config.subscribeKey)return void(console&&console.log&&console.log("subscribe key missing; aborting subscribe"));n&&(this._lastTimetoken=this._currentTimetoken,
19977
20944
  this._currentTimetoken=n),"0"!==this._currentTimetoken&&0!==this._currentTimetoken&&(this._storedTimetoken=this._currentTimetoken,this._currentTimetoken=0),i.forEach(function(e){t._channels[e]={state:{}},u&&(t._presenceChannels[e]={}),l&&(t._heartbeatChannels[e]={}),t._pendingChannelSubscriptions.push(e)}),o.forEach(function(e){t._channelGroups[e]={state:{}},u&&(t._presenceChannelGroups[e]={}),l&&(t._heartbeatChannelGroups[e]={}),t._pendingChannelGroupSubscriptions.push(e)}),this._subscriptionStatusAnnounced=!1,this.reconnect()}},{key:"adaptUnsubscribeChange",value:function(e,t){var n=this,r=e.channels,i=void 0===r?[]:r,s=e.channelGroups,o=void 0===s?[]:s,a=[],u=[];i.forEach(function(e){e in n._channels&&(delete n._channels[e],a.push(e),e in n._heartbeatChannels&&delete n._heartbeatChannels[e]),e in n._presenceChannels&&(delete n._presenceChannels[e],a.push(e))}),o.forEach(function(e){e in n._channelGroups&&(delete n._channelGroups[e],u.push(e),e in n._heartbeatChannelGroups&&delete n._heartbeatChannelGroups[e]),e in n._presenceChannelGroups&&(delete n._channelGroups[e],u.push(e))}),0===a.length&&0===u.length||(!1!==this._config.suppressLeaveEvents||t||this._leaveEndpoint({channels:a,channelGroups:u},function(e){e.affectedChannels=a,e.affectedChannelGroups=u,e.currentTimetoken=n._currentTimetoken,e.lastTimetoken=n._lastTimetoken,n._listenerManager.announceStatus(e)}),0===Object.keys(this._channels).length&&0===Object.keys(this._presenceChannels).length&&0===Object.keys(this._channelGroups).length&&0===Object.keys(this._presenceChannelGroups).length&&(this._lastTimetoken=0,this._currentTimetoken=0,this._storedTimetoken=null,this._region=null,this._reconnectionManager.stopPolling()),this.reconnect())}},{key:"unsubscribeAll",value:function(e){this.adaptUnsubscribeChange({channels:this.getSubscribedChannels(),channelGroups:this.getSubscribedChannelGroups()},e)}},{key:"getHeartbeatChannels",value:function(){return Object.keys(this._heartbeatChannels)}},{key:"getHeartbeatChannelGroups",value:function(){return Object.keys(this._heartbeatChannelGroups)}},{key:"getSubscribedChannels",value:function(){return Object.keys(this._channels)}},{key:"getSubscribedChannelGroups",value:function(){return Object.keys(this._channelGroups)}},{key:"reconnect",value:function(){this._startSubscribeLoop(),this._registerHeartbeatTimer()}},{key:"disconnect",value:function(){this._stopSubscribeLoop(),this._stopHeartbeatTimer(),this._reconnectionManager.stopPolling()}},{key:"_registerHeartbeatTimer",value:function(){this._stopHeartbeatTimer(),0!==this._config.getHeartbeatInterval()&&(this._performHeartbeatLoop(),this._heartbeatTimer=setInterval(this._performHeartbeatLoop.bind(this),1e3*this._config.getHeartbeatInterval()))}},{key:"_stopHeartbeatTimer",value:function(){this._heartbeatTimer&&(clearInterval(this._heartbeatTimer),this._heartbeatTimer=null)}},{key:"_performHeartbeatLoop",value:function(){var e=this,t=this.getHeartbeatChannels(),n=this.getHeartbeatChannelGroups(),r={};if(0!==t.length||0!==n.length){this.getSubscribedChannels().forEach(function(t){var n=e._channels[t].state;Object.keys(n).length&&(r[t]=n)}),this.getSubscribedChannelGroups().forEach(function(t){var n=e._channelGroups[t].state;Object.keys(n).length&&(r[t]=n)});var i=function(t){t.error&&e._config.announceFailedHeartbeats&&e._listenerManager.announceStatus(t),t.error&&e._config.autoNetworkDetection&&e._isOnline&&(e._isOnline=!1,e.disconnect(),e._listenerManager.announceNetworkDown(),e.reconnect()),!t.error&&e._config.announceSuccessfulHeartbeats&&e._listenerManager.announceStatus(t)};this._heartbeatEndpoint({channels:t,channelGroups:n,state:r},i.bind(this))}}},{key:"_startSubscribeLoop",value:function(){var e=this;this._stopSubscribeLoop();var t={},n=[],r=[];if(Object.keys(this._channels).forEach(function(r){var i=e._channels[r].state;Object.keys(i).length&&(t[r]=i),n.push(r)}),Object.keys(this._presenceChannels).forEach(function(e){n.push(e+"-pnpres")}),Object.keys(this._channelGroups).forEach(function(n){var i=e._channelGroups[n].state;Object.keys(i).length&&(t[n]=i),r.push(n)}),Object.keys(this._presenceChannelGroups).forEach(function(e){r.push(e+"-pnpres")}),0!==n.length||0!==r.length){var i={channels:n,channelGroups:r,state:t,timetoken:this._currentTimetoken,filterExpression:this._config.filterExpression,region:this._region};this._subscribeCall=this._subscribeEndpoint(i,this._processSubscribeResponse.bind(this))}}},{key:"_processSubscribeResponse",value:function(e,t){var n=this;if(e.error)return void(e.category===g.default.PNTimeoutCategory?this._startSubscribeLoop():e.category===g.default.PNNetworkIssuesCategory?(this.disconnect(),e.error&&this._config.autoNetworkDetection&&this._isOnline&&(this._isOnline=!1,this._listenerManager.announceNetworkDown()),this._reconnectionManager.onReconnection(function(){n._config.autoNetworkDetection&&!n._isOnline&&(n._isOnline=!0,n._listenerManager.announceNetworkUp()),n.reconnect(),n._subscriptionStatusAnnounced=!0;var t={category:g.default.PNReconnectedCategory,operation:e.operation,lastTimetoken:n._lastTimetoken,currentTimetoken:n._currentTimetoken};n._listenerManager.announceStatus(t)}),this._reconnectionManager.startPolling(),this._listenerManager.announceStatus(e)):e.category===g.default.PNBadRequestCategory?(this._stopHeartbeatTimer(),this._listenerManager.announceStatus(e)):this._listenerManager.announceStatus(e));if(this._storedTimetoken?(this._currentTimetoken=this._storedTimetoken,this._storedTimetoken=null):(this._lastTimetoken=this._currentTimetoken,this._currentTimetoken=t.metadata.timetoken),!this._subscriptionStatusAnnounced){var r={};r.category=g.default.PNConnectedCategory,r.operation=e.operation,r.affectedChannels=this._pendingChannelSubscriptions,r.subscribedChannels=this.getSubscribedChannels(),r.affectedChannelGroups=this._pendingChannelGroupSubscriptions,r.lastTimetoken=this._lastTimetoken,r.currentTimetoken=this._currentTimetoken,this._subscriptionStatusAnnounced=!0,this._listenerManager.announceStatus(r),this._pendingChannelSubscriptions=[],this._pendingChannelGroupSubscriptions=[]}var i=t.messages||[],s=this._config,o=s.requestMessageCountThreshold,a=s.dedupeOnSubscribe;if(o&&i.length>=o){var u={};u.category=g.default.PNRequestMessageCountExceededCategory,u.operation=e.operation,this._listenerManager.announceStatus(u)}i.forEach(function(e){var t=e.channel,r=e.subscriptionMatch,i=e.publishMetaData;if(t===r&&(r=null),a){if(n._dedupingManager.isDuplicate(e))return;n._dedupingManager.addEntry(e)}if(d.default.endsWith(e.channel,"-pnpres")){var s={};s.channel=null,s.subscription=null,s.actualChannel=null!=r?t:null,s.subscribedChannel=null!=r?r:t,t&&(s.channel=t.substring(0,t.lastIndexOf("-pnpres"))),r&&(s.subscription=r.substring(0,r.lastIndexOf("-pnpres"))),s.action=e.payload.action,s.state=e.payload.data,s.timetoken=i.publishTimetoken,s.occupancy=e.payload.occupancy,s.uuid=e.payload.uuid,s.timestamp=e.payload.timestamp,e.payload.join&&(s.join=e.payload.join),e.payload.leave&&(s.leave=e.payload.leave),e.payload.timeout&&(s.timeout=e.payload.timeout),n._listenerManager.announcePresence(s)}else{var o={};o.channel=null,o.subscription=null,o.actualChannel=null!=r?t:null,o.subscribedChannel=null!=r?r:t,o.channel=t,o.subscription=r,o.timetoken=i.publishTimetoken,o.publisher=e.issuingClientId,e.userMetadata&&(o.userMetadata=e.userMetadata),n._config.cipherKey?o.message=n._crypto.decrypt(e.payload):o.message=e.payload,n._listenerManager.announceMessage(o)}}),this._region=t.metadata.region,this._startSubscribeLoop()}},{key:"_stopSubscribeLoop",value:function(){this._subscribeCall&&("function"==typeof this._subscribeCall.abort&&this._subscribeCall.abort(),this._subscribeCall=null)}}]),e}();t.default=b,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=(n(5),n(10)),o=function(e){return e&&e.__esModule?e:{default:e}}(s),a=function(){function e(){r(this,e),this._listeners=[]}return i(e,[{key:"addListener",value:function(e){this._listeners.push(e)}},{key:"removeListener",value:function(e){var t=[];this._listeners.forEach(function(n){n!==e&&t.push(n)}),this._listeners=t}},{key:"removeAllListeners",value:function(){this._listeners=[]}},{key:"announcePresence",value:function(e){this._listeners.forEach(function(t){t.presence&&t.presence(e)})}},{key:"announceStatus",value:function(e){this._listeners.forEach(function(t){t.status&&t.status(e)})}},{key:"announceMessage",value:function(e){this._listeners.forEach(function(t){t.message&&t.message(e)})}},{key:"announceNetworkUp",value:function(){var e={};e.category=o.default.PNNetworkUpCategory,this.announceStatus(e)}},{key:"announceNetworkDown",value:function(){var e={};e.category=o.default.PNNetworkDownCategory,this.announceStatus(e)}}]),e}();t.default=a,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={PNNetworkUpCategory:"PNNetworkUpCategory",PNNetworkDownCategory:"PNNetworkDownCategory",PNNetworkIssuesCategory:"PNNetworkIssuesCategory",PNTimeoutCategory:"PNTimeoutCategory",PNBadRequestCategory:"PNBadRequestCategory",PNAccessDeniedCategory:"PNAccessDeniedCategory",PNUnknownCategory:"PNUnknownCategory",PNReconnectedCategory:"PNReconnectedCategory",PNConnectedCategory:"PNConnectedCategory",PNRequestMessageCountExceededCategory:"PNRequestMessageCountExceededCategory"},e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(12),o=(function(e){e&&e.__esModule}(s),n(5),function(){function e(t){var n=t.timeEndpoint;r(this,e),this._timeEndpoint=n}return i(e,[{key:"onReconnection",value:function(e){this._reconnectionCallback=e}},{key:"startPolling",value:function(){this._timeTimer=setInterval(this._performTimeLoop.bind(this),3e3)}},{key:"stopPolling",value:function(){clearInterval(this._timeTimer)}},{key:"_performTimeLoop",value:function(){var e=this;this._timeEndpoint(function(t){t.error||(clearInterval(e._timeTimer),e._reconnectionCallback())})}}]),e}());t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(){return h.default.PNTimeOperation}function i(){return"/time/0"}function s(e){return e.config.getTransactionTimeout()}function o(){return{}}function a(){return!1}function u(e,t){return{timetoken:t[0]}}function c(){}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.getURL=i,t.getRequestTimeout=s,t.prepareParams=o,t.isAuthSupported=a,t.handleResponse=u,t.validateParams=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={PNTimeOperation:"PNTimeOperation",PNHistoryOperation:"PNHistoryOperation",PNDeleteMessagesOperation:"PNDeleteMessagesOperation",PNFetchMessagesOperation:"PNFetchMessagesOperation",PNMessageCounts:"PNMessageCountsOperation",PNSubscribeOperation:"PNSubscribeOperation",PNUnsubscribeOperation:"PNUnsubscribeOperation",PNPublishOperation:"PNPublishOperation",PNPushNotificationEnabledChannelsOperation:"PNPushNotificationEnabledChannelsOperation",PNRemoveAllPushNotificationsOperation:"PNRemoveAllPushNotificationsOperation",PNWhereNowOperation:"PNWhereNowOperation",PNSetStateOperation:"PNSetStateOperation",PNHereNowOperation:"PNHereNowOperation",PNGetStateOperation:"PNGetStateOperation",PNHeartbeatOperation:"PNHeartbeatOperation",PNChannelGroupsOperation:"PNChannelGroupsOperation",PNRemoveGroupOperation:"PNRemoveGroupOperation",PNChannelsForGroupOperation:"PNChannelsForGroupOperation",PNAddChannelsToGroupOperation:"PNAddChannelsToGroupOperation",PNRemoveChannelsFromGroupOperation:"PNRemoveChannelsFromGroupOperation",PNAccessManagerGrant:"PNAccessManagerGrant",PNAccessManagerAudit:"PNAccessManagerAudit"},e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(2),o=(function(e){e&&e.__esModule}(s),n(5),function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n+=1){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t}),a=function(){function e(t){var n=t.config;r(this,e),this.hashHistory=[],this._config=n}return i(e,[{key:"getKey",value:function(e){var t=o(JSON.stringify(e.payload)).toString();return e.publishMetaData.publishTimetoken+"-"+t}},{key:"isDuplicate",value:function(e){return this.hashHistory.includes(this.getKey(e))}},{key:"addEntry",value:function(e){this.hashHistory.length>=this._config.maximumCacheSize&&this.hashHistory.shift(),this.hashHistory.push(this.getKey(e))}},{key:"clearHistory",value:function(){this.hashHistory=[]}}]),e}();t.default=a,e.exports=t.default},function(e,t){"use strict";function n(e){var t=[];return Object.keys(e).forEach(function(e){return t.push(e)}),t}function r(e){return encodeURIComponent(e).replace(/[!~*'()]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function i(e){return n(e).sort()}function s(e){return i(e).map(function(t){return t+"="+r(e[t])}).join("&")}function o(e,t){return-1!==e.indexOf(t,this.length-t.length)}function a(){var e=void 0,t=void 0;return{promise:new Promise(function(n,r){e=n,t=r}),reject:t,fulfill:e}}e.exports={signPamFromParams:s,endsWith:o,createPromise:a,encodeString:r}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){return e.type=t,e.error=!0,e}function u(e){return a({message:e},"validationError")}function c(e,t,n){return e.usePost&&e.usePost(t,n)?e.postURL(t,n):e.getURL(t,n)}function l(e){if(e.sdkName)return e.sdkName;var t="PubNub-JS-"+e.sdkFamily;return e.partnerId&&(t+="-"+e.partnerId),t+="/"+e.getVersion()}function h(e,t,n){var r=e.config,i=e.crypto;n.timestamp=Math.floor((new Date).getTime()/1e3);var s=r.subscribeKey+"\n"+r.publishKey+"\n"+t+"\n";s+=y.default.signPamFromParams(n);var o=i.HMACSHA256(s);o=o.replace(/\+/g,"-"),o=o.replace(/\//g,"_"),n.signature=o}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=e.networking,r=e.config,i=null,s=null,o={};t.getOperation()===v.default.PNTimeOperation||t.getOperation()===v.default.PNChannelGroupsOperation?i=arguments.length<=2?void 0:arguments[2]:(o=arguments.length<=2?void 0:arguments[2],i=arguments.length<=3?void 0:arguments[3]),"undefined"==typeof Promise||i||(s=y.default.createPromise());var a=t.validateParams(e,o);if(!a){var f=t.prepareParams(e,o),d=c(t,e,o),g=void 0,b={url:d,operation:t.getOperation(),timeout:t.getRequestTimeout(e)};f.uuid=r.UUID,f.pnsdk=l(r),r.useInstanceId&&(f.instanceid=r.instanceId),r.useRequestId&&(f.requestid=p.default.createUUID()),t.isAuthSupported()&&r.getAuthKey()&&(f.auth=r.getAuthKey()),r.secretKey&&h(e,d,f);var m=function(n,r){if(n.error)return void(i?i(n):s&&s.reject(new _("PubNub call failed, check status for details",n)));var a=t.handleResponse(e,r,o);i?i(n,a):s&&s.fulfill(a)};if(t.usePost&&t.usePost(e,o)){var k=t.postPayload(e,o);g=n.POST(f,k,b,m)}else g=t.useDelete&&t.useDelete()?n.DELETE(f,b,m):n.GET(f,b,m);return t.getOperation()===v.default.PNSubscribeOperation?g:s?s.promise:void 0}return i?i(u(a)):s?(s.reject(new _("Validation failed, check status for details",u(a))),s.promise):void 0};var f=n(3),p=r(f),d=(n(5),n(15)),y=r(d),g=n(2),b=(r(g),n(13)),v=r(b),_=function(e){function t(e,n){i(this,t);var r=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.name=r.constructor.name,r.status=n,r.message=e,r}return o(t,e),t}(Error);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNAddChannelsToGroupOperation}function s(e,t){var n=t.channels,r=t.channelGroup,i=e.config;return r?n&&0!==n.length?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channels;return{add:(void 0===n?[]:n).join(",")}}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNRemoveChannelsFromGroupOperation}function s(e,t){var n=t.channels,r=t.channelGroup,i=e.config;return r?n&&0!==n.length?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channels;return{remove:(void 0===n?[]:n).join(",")}}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNRemoveGroupOperation}function s(e,t){var n=t.channelGroup,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)+"/remove"}function a(){return!0}function u(e){return e.config.getTransactionTimeout()}function c(){return{}}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.isAuthSupported=a,t.getRequestTimeout=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNChannelGroupsOperation}function i(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function s(e){return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group"}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(){return{}}function c(e,t){return{groups:t.payload.groups}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNChannelsForGroupOperation}function s(e,t){var n=t.channelGroup,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(){return{}}function l(e,t){return{channels:t.payload.channels}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNPushNotificationEnabledChannelsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=t.channels,s=e.config;return n?r?i&&0!==i.length?s.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){var n=t.pushGateway,r=t.channels;return{type:n,add:(void 0===r?[]:r).join(",")}}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNPushNotificationEnabledChannelsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=t.channels,s=e.config;return n?r?i&&0!==i.length?s.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){var n=t.pushGateway,r=t.channels;return{type:n,remove:(void 0===r?[]:r).join(",")}}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNPushNotificationEnabledChannelsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=e.config;return n?r?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){return{type:t.pushGateway}}function c(e,t){return{channels:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNRemoveAllPushNotificationsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=e.config;return n?r?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n+"/remove"}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){return{type:t.pushGateway}}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNUnsubscribeOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(s)+"/leave"}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i={};return r.length>0&&(i["channel-group"]=r.join(",")),i}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNWhereNowOperation}function i(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function s(e,t){var n=e.config,r=t.uuid,i=void 0===r?n.UUID:r;return"/v2/presence/sub-key/"+n.subscribeKey+"/uuid/"+i}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(){return{}}function c(e,t){return t.payload?{channels:t.payload.channels}:{channels:[]}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNHeartbeatOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(s)+"/heartbeat"}function a(){return!0}function u(e){return e.config.getTransactionTimeout()}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i=t.state,s=void 0===i?{}:i,o=e.config,a={};return r.length>0&&(a["channel-group"]=r.join(",")),a.state=JSON.stringify(s),a.heartbeat=o.getPresenceTimeout(),a}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.isAuthSupported=a,t.getRequestTimeout=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNGetStateOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.uuid,i=void 0===r?n.UUID:r,s=t.channels,o=void 0===s?[]:s,a=o.length>0?o.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(a)+"/uuid/"+i}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i={};return r.length>0&&(i["channel-group"]=r.join(",")),i}function l(e,t,n){var r=n.channels,i=void 0===r?[]:r,s=n.channelGroups,o=void 0===s?[]:s,a={};return 1===i.length&&0===o.length?a[i[0]]=t.payload:a=t.payload,{channels:a}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNSetStateOperation}function s(e,t){var n=e.config,r=t.state,i=t.channels,s=void 0===i?[]:i,o=t.channelGroups,a=void 0===o?[]:o;return r?n.subscribeKey?0===s.length&&0===a.length?"Please provide a list of channels and/or channel-groups":void 0:"Missing Subscribe Key":"Missing State"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(s)+"/uuid/"+n.UUID+"/data"}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.state,r=t.channelGroups,i=void 0===r?[]:r,s={};return s.state=JSON.stringify(n),i.length>0&&(s["channel-group"]=i.join(",")),s}function l(e,t){return{state:t.payload}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNHereNowOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=t.channelGroups,o=void 0===s?[]:s,a="/v2/presence/sub-key/"+n.subscribeKey;if(i.length>0||o.length>0){var u=i.length>0?i.join(","):",";a+="/channel/"+d.default.encodeString(u)}return a}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i=t.includeUUIDs,s=void 0===i||i,o=t.includeState,a=void 0!==o&&o,u={};return s||(u.disable_uuids=1),a&&(u.state=1),r.length>0&&(u["channel-group"]=r.join(",")),u}function l(e,t,n){var r=n.channels,i=void 0===r?[]:r,s=n.channelGroups,o=void 0===s?[]:s,a=n.includeUUIDs,u=void 0===a||a,c=n.includeState,l=void 0!==c&&c;return i.length>1||o.length>0||0===o.length&&0===i.length?function(){var e={};return e.totalChannels=t.payload.total_channels,e.totalOccupancy=t.payload.total_occupancy,e.channels={},Object.keys(t.payload.channels).forEach(function(n){var r=t.payload.channels[n],i=[];return e.channels[n]={occupants:i,name:n,occupancy:r.occupancy},u&&r.uuids.forEach(function(e){l?i.push({state:e.state,uuid:e.uuid}):i.push({state:null,uuid:e})}),e}),e}():function(){var e={},n=[];return e.totalChannels=1,e.totalOccupancy=t.occupancy,e.channels={},e.channels[i[0]]={occupants:n,name:i[0],occupancy:t.occupancy},u&&t.uuids&&t.uuids.forEach(function(e){l?n.push({state:e.state,uuid:e.uuid}):n.push({state:null,uuid:e})}),e}()}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNAccessManagerAudit}function i(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function s(e){return"/v2/auth/audit/sub-key/"+e.config.subscribeKey}function o(e){return e.config.getTransactionTimeout()}function a(){return!1}function u(e,t){var n=t.channel,r=t.channelGroup,i=t.authKeys,s=void 0===i?[]:i,o={};return n&&(o.channel=n),r&&(o["channel-group"]=r),s.length>0&&(o.auth=s.join(",")),o}function c(e,t){return t.payload}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNAccessManagerGrant}function i(e){var t=e.config;return t.subscribeKey?t.publishKey?t.secretKey?void 0:"Missing Secret Key":"Missing Publish Key":"Missing Subscribe Key"}function s(e){return"/v2/auth/grant/sub-key/"+e.config.subscribeKey}function o(e){return e.config.getTransactionTimeout()}function a(){return!1}function u(e,t){var n=t.channels,r=void 0===n?[]:n,i=t.channelGroups,s=void 0===i?[]:i,o=t.ttl,a=t.read,u=void 0!==a&&a,c=t.write,l=void 0!==c&&c,h=t.manage,f=void 0!==h&&h,p=t.authKeys,d=void 0===p?[]:p,y={};return y.r=u?"1":"0",y.w=l?"1":"0",y.m=f?"1":"0",r.length>0&&(y.channel=r.join(",")),s.length>0&&(y["channel-group"]=s.join(",")),
19978
20945
  d.length>0&&(y.auth=d.join(",")),(o||0===o)&&(y.ttl=o),y}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e.crypto,r=e.config,i=JSON.stringify(t);return r.cipherKey&&(i=n.encrypt(i),i=JSON.stringify(i)),i}function s(){return b.default.PNPublishOperation}function o(e,t){var n=e.config,r=t.message;return t.channel?r?n.subscribeKey?void 0:"Missing Subscribe Key":"Missing Message":"Missing Channel"}function a(e,t){var n=t.sendByPost;return void 0!==n&&n}function u(e,t){var n=e.config,r=t.channel,s=t.message,o=i(e,s);return"/publish/"+n.publishKey+"/"+n.subscribeKey+"/0/"+_.default.encodeString(r)+"/0/"+_.default.encodeString(o)}function c(e,t){var n=e.config,r=t.channel;return"/publish/"+n.publishKey+"/"+n.subscribeKey+"/0/"+_.default.encodeString(r)+"/0"}function l(e){return e.config.getTransactionTimeout()}function h(){return!0}function f(e,t){return i(e,t.message)}function p(e,t){var n=t.meta,r=t.replicate,i=void 0===r||r,s=t.storeInHistory,o=t.ttl,a={};return null!=s&&(a.store=s?"1":"0"),o&&(a.ttl=o),!1===i&&(a.norep="true"),n&&"object"===(void 0===n?"undefined":y(n))&&(a.meta=JSON.stringify(n)),a}function d(e,t){return{timetoken:t[2]}}Object.defineProperty(t,"__esModule",{value:!0});var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getOperation=s,t.validateParams=o,t.usePost=a,t.getURL=u,t.postURL=c,t.getRequestTimeout=l,t.isAuthSupported=h,t.postPayload=f,t.prepareParams=p,t.handleResponse=d;var g=(n(5),n(13)),b=r(g),v=n(15),_=r(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e.config,r=e.crypto;if(!n.cipherKey)return t;try{return r.decrypt(t)}catch(e){return t}}function s(){return p.default.PNHistoryOperation}function o(e,t){var n=t.channel,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"}function a(e,t){var n=t.channel;return"/v2/history/sub-key/"+e.config.subscribeKey+"/channel/"+y.default.encodeString(n)}function u(e){return e.config.getTransactionTimeout()}function c(){return!0}function l(e,t){var n=t.start,r=t.end,i=t.reverse,s=t.count,o=void 0===s?100:s,a=t.stringifiedTimeToken,u=void 0!==a&&a,c={include_token:"true"};return c.count=o,n&&(c.start=n),r&&(c.end=r),u&&(c.string_message_token="true"),null!=i&&(c.reverse=i.toString()),c}function h(e,t){var n={messages:[],startTimeToken:t[1],endTimeToken:t[2]};return t[0].forEach(function(t){var r={timetoken:t.timetoken,entry:i(e,t.message)};n.messages.push(r)}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=s,t.validateParams=o,t.getURL=a,t.getRequestTimeout=u,t.isAuthSupported=c,t.prepareParams=l,t.handleResponse=h;var f=(n(5),n(13)),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return p.default.PNDeleteMessagesOperation}function s(e,t){var n=t.channel,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"}function o(){return!0}function a(e,t){var n=t.channel;return"/v3/history/sub-key/"+e.config.subscribeKey+"/channel/"+y.default.encodeString(n)}function u(e){return e.config.getTransactionTimeout()}function c(){return!0}function l(e,t){var n=t.start,r=t.end,i={};return n&&(i.start=n),r&&(i.end=r),i}function h(e,t){return t.payload}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.useDelete=o,t.getURL=a,t.getRequestTimeout=u,t.isAuthSupported=c,t.prepareParams=l,t.handleResponse=h;var f=(n(5),n(13)),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return p.default.PNMessageCounts}function s(e,t){var n=t.channels,r=t.timetoken,i=t.channelTimetokens,s=e.config;return n?r&&i?"timetoken and channelTimetokens are incompatible together":r&&i&&i.length>1&&n.length!==i.length?"Length of channelTimetokens and channels do not match":s.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"}function o(e,t){var n=t.channels,r=e.config,i=n.join(",");return"/v3/history/sub-key/"+r.subscribeKey+"/message-counts/"+y.default.encodeString(i)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.timetoken,r=t.channelTimetokens,i={};if(r&&1===r.length){var s=h(r,1),o=s[0];i.timetoken=o}else r?i.channelsTimetoken=r.join(","):n&&(i.timetoken=n);return i}function l(e,t){return{channels:t.channels}}Object.defineProperty(t,"__esModule",{value:!0});var h=function(){function e(e,t){var n=[],r=!0,i=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,s=e}finally{try{!r&&a.return&&a.return()}finally{if(i)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var f=n(13),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e.config,r=e.crypto;if(!n.cipherKey)return t;try{return r.decrypt(t)}catch(e){return t}}function s(){return p.default.PNFetchMessagesOperation}function o(e,t){var n=t.channels,r=e.config;return n&&0!==n.length?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channels"}function a(e,t){var n=t.channels,r=void 0===n?[]:n,i=e.config,s=r.length>0?r.join(","):",";return"/v3/history/sub-key/"+i.subscribeKey+"/channel/"+y.default.encodeString(s)}function u(e){return e.config.getTransactionTimeout()}function c(){return!0}function l(e,t){var n=t.start,r=t.end,i=t.count,s=t.stringifiedTimeToken,o=void 0!==s&&s,a={};return i&&(a.max=i),n&&(a.start=n),r&&(a.end=r),o&&(a.string_message_token="true"),a}function h(e,t){var n={channels:{}};return Object.keys(t.channels||{}).forEach(function(r){n.channels[r]=[],(t.channels[r]||[]).forEach(function(t){var s={};s.channel=r,s.subscription=null,s.timetoken=t.timetoken,s.message=i(e,t.message),n.channels[r].push(s)})}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=s,t.validateParams=o,t.getURL=a,t.getRequestTimeout=u,t.isAuthSupported=c,t.prepareParams=l,t.handleResponse=h;var f=(n(5),n(13)),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNSubscribeOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/subscribe/"+n.subscribeKey+"/"+d.default.encodeString(s)+"/0"}function a(e){return e.config.getSubscribeTimeout()}function u(){return!0}function c(e,t){var n=e.config,r=t.state,i=t.channelGroups,s=void 0===i?[]:i,o=t.timetoken,a=t.filterExpression,u=t.region,c={heartbeat:n.getPresenceTimeout()};return s.length>0&&(c["channel-group"]=s.join(",")),a&&a.length>0&&(c["filter-expr"]=a),Object.keys(r).length&&(c.state=JSON.stringify(r)),o&&(c.tt=o),u&&(c.tr=u),c}function l(e,t){var n=[];t.m.forEach(function(e){var t={publishTimetoken:e.p.t,region:e.p.r},r={shard:parseInt(e.a,10),subscriptionMatch:e.b,channel:e.c,payload:e.d,flags:e.f,issuingClientId:e.i,subscribeKey:e.k,originationTimetoken:e.o,userMetadata:e.u,publishMetaData:t};n.push(r)});var r={timetoken:t.t.t,region:t.t.r};return{messages:n,metadata:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),a=(r(o),n(10)),u=r(a),c=(n(5),function(){function e(t){var n=this;i(this,e),this._modules={},Object.keys(t).forEach(function(e){n._modules[e]=t[e].bind(n)})}return s(e,[{key:"init",value:function(e){this._config=e,this._maxSubDomain=20,this._currentSubDomain=Math.floor(Math.random()*this._maxSubDomain),this._providedFQDN=(this._config.secure?"https://":"http://")+this._config.origin,this._coreParams={},this.shiftStandardOrigin()}},{key:"nextOrigin",value:function(){if(-1===this._providedFQDN.indexOf("ps."))return this._providedFQDN;var e=void 0;return this._currentSubDomain=this._currentSubDomain+1,this._currentSubDomain>=this._maxSubDomain&&(this._currentSubDomain=1),e=this._currentSubDomain.toString(),this._providedFQDN.replace("ps.","ps"+e+".")}},{key:"hasModule",value:function(e){return e in this._modules}},{key:"shiftStandardOrigin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._standardOrigin=this.nextOrigin(e),this._standardOrigin}},{key:"getStandardOrigin",value:function(){return this._standardOrigin}},{key:"POST",value:function(e,t,n,r){return this._modules.post(e,t,n,r)}},{key:"GET",value:function(e,t,n){return this._modules.get(e,t,n)}},{key:"DELETE",value:function(e,t,n){return this._modules.del(e,t,n)}},{key:"_detectErrorCategory",value:function(e){if("ENOTFOUND"===e.code)return u.default.PNNetworkIssuesCategory;if("ECONNREFUSED"===e.code)return u.default.PNNetworkIssuesCategory;if("ECONNRESET"===e.code)return u.default.PNNetworkIssuesCategory;if("EAI_AGAIN"===e.code)return u.default.PNNetworkIssuesCategory;if(0===e.status||e.hasOwnProperty("status")&&void 0===e.status)return u.default.PNNetworkIssuesCategory;if(e.timeout)return u.default.PNTimeoutCategory;if("ETIMEDOUT"===e.code)return u.default.PNNetworkIssuesCategory;if(e.response){if(e.response.badRequest)return u.default.PNBadRequestCategory;if(e.response.forbidden)return u.default.PNAccessDeniedCategory}return u.default.PNUnknownCategory}}]),e}());t.default=c,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={get:function(e){try{return localStorage.getItem(e)}catch(e){return null}},set:function(e,t){try{return localStorage.setItem(e,t)}catch(e){return null}}},e.exports=t.default},function(e,t,n){"use strict";function r(e){var t=(new Date).getTime(),n=(new Date).toISOString(),r=function(){return console&&console.log?console:window&&window.console&&window.console.log?window.console:console}();r.log("<<<<<"),r.log("["+n+"]","\n",e.url,"\n",e.qs),r.log("-----"),e.on("response",function(n){var i=(new Date).getTime(),s=i-t,o=(new Date).toISOString();r.log(">>>>>>"),r.log("["+o+" / "+s+"]","\n",e.url,"\n",e.qs,"\n",n.text),r.log("-----")})}function i(e,t,n){var i=this;return this._config.logVerbosity&&(e=e.use(r)),this._config.proxy&&this._modules.proxy&&(e=this._modules.proxy.call(this,e)),this._config.keepAlive&&this._modules.keepAlive&&(e=this._modules.keepAlive(e)),e.timeout(t.timeout).end(function(e,r){var s=void 0,o={};if(o.error=null!==e,o.operation=t.operation,r&&r.status&&(o.statusCode=r.status),e){if(e.response&&e.response.text&&!i._config.logVerbosity)try{o.errorData=JSON.parse(e.response.text)}catch(t){o.errorData=e}else o.errorData=e;return o.category=i._detectErrorCategory(e),n(o,null)}try{s=JSON.parse(r.text)}catch(e){return o.errorData=r,o.error=!0,n(o,null)}return s.error&&1===s.error&&s.status&&s.message&&s.service?(o.errorData=s,o.statusCode=s.status,o.error=!0,o.category=i._detectErrorCategory(o),n(o,null)):n(o,s)})}function s(e,t,n){var r=c.default.get(this.getStandardOrigin()+t.url).query(e);return i.call(this,r,t,n)}function o(e,t,n,r){var s=c.default.post(this.getStandardOrigin()+n.url).query(e).send(t);return i.call(this,s,n,r)}function a(e,t,n){var r=c.default.delete(this.getStandardOrigin()+t.url).query(e);return i.call(this,r,t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.get=s,t.post=o,t.del=a;var u=n(43),c=function(e){return e&&e.__esModule?e:{default:e}}(u);n(5)},function(e,t,n){function r(){}function i(e){if(!y(e))return e;var t=[];for(var n in e)s(t,n,e[n]);return t.join("&")}function s(e,t,n){if(null!=n)if(Array.isArray(n))n.forEach(function(n){s(e,t,n)});else if(y(n))for(var r in n)s(e,t+"["+r+"]",n[r]);else e.push(encodeURIComponent(t)+"="+encodeURIComponent(n));else null===n&&e.push(encodeURIComponent(t))}function o(e){for(var t,n,r={},i=e.split("&"),s=0,o=i.length;s<o;++s)t=i[s],n=t.indexOf("="),-1==n?r[decodeURIComponent(t)]="":r[decodeURIComponent(t.slice(0,n))]=decodeURIComponent(t.slice(n+1));return r}function a(e){for(var t,n,r,i,s=e.split(/\r?\n/),o={},a=0,u=s.length;a<u;++a)n=s[a],-1!==(t=n.indexOf(":"))&&(r=n.slice(0,t).toLowerCase(),i=_(n.slice(t+1)),o[r]=i);return o}function u(e){return/[\/+]json($|[^-\w])/.test(e)}function c(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.header=this.headers=a(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"!=this.req.method?this._parseBody(this.text?this.text:this.xhr.response):null}function l(e,t){var n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new c(n)}catch(t){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=t,n.xhr?(e.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,e.status=n.xhr.status?n.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),n.callback(e)}n.emit("response",t);var r;try{n._isResponseOK(t)||(r=new Error(t.statusText||"Unsuccessful HTTP response"))}catch(e){r=e}r?(r.original=e,r.response=t,r.status=t.status,n.callback(r,t)):n.callback(null,t)})}function h(e,t,n){var r=v("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}var f;"undefined"!=typeof window?f=window:"undefined"!=typeof self?f=self:(console.warn("Using browser-only version of superagent in non-browser environment"),f=this);var p=n(44),d=n(45),y=n(46),g=n(47),b=n(49),v=t=e.exports=function(e,n){return"function"==typeof n?new t.Request("GET",e).end(n):1==arguments.length?new t.Request("GET",e):new t.Request(e,n)};t.Request=l,v.getXHR=function(){if(!(!f.XMLHttpRequest||f.location&&"file:"==f.location.protocol&&f.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw Error("Browser-only version of superagent could not find XHR")};var _="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};v.serializeObject=i,v.parseString=o,v.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},v.serialize={"application/x-www-form-urlencoded":i,"application/json":JSON.stringify},v.parse={"application/x-www-form-urlencoded":o,"application/json":JSON.parse},g(c.prototype),c.prototype._parseBody=function(e){var t=v.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&u(this.type)&&(t=v.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null)},c.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},v.Response=c,p(l.prototype),d(l.prototype),l.prototype.type=function(e){return this.set("Content-Type",v.types[e]||e),this},l.prototype.accept=function(e){return this.set("Accept",v.types[e]||e),this},l.prototype.auth=function(e,t,n){1===arguments.length&&(t=""),"object"==typeof t&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});var r=function(e){if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,n,r)},l.prototype.query=function(e){return"string"!=typeof e&&(e=i(e)),e&&this._query.push(e),this},l.prototype.attach=function(e,t,n){if(t){if(this._data)throw Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},l.prototype._getFormData=function(){return this._formData||(this._formData=new f.FormData),this._formData},l.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},l.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},l.prototype.buffer=l.prototype.ca=l.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},l.prototype.pipe=l.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},l.prototype._isHost=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},l.prototype.end=function(e){return this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||r,this._finalizeQueryString(),this._end()},l.prototype._end=function(){var e=this,t=this.xhr=v.getXHR(),n=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==n){var r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.onprogress=r.bind(null,"download"),t.upload&&(t.upload.onprogress=r.bind(null,"upload"))}catch(e){}try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof n&&!this._isHost(n)){var i=this._header["content-type"],s=this._serializer||v.serialize[i?i.split(";")[0]:""];!s&&u(i)&&(s=v.serialize["application/json"]),s&&(n=s(n))}for(var o in this.header)null!=this.header[o]&&this.header.hasOwnProperty(o)&&t.setRequestHeader(o,this.header[o]);return this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0!==n?n:null),this},v.agent=function(){return new b},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(e){b.prototype[e.toLowerCase()]=function(t,n){var r=new v.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}}),b.prototype.del=b.prototype.delete,v.get=function(e,t,n){var r=v("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},v.head=function(e,t,n){var r=v("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},v.options=function(e,t,n){var r=v("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},v.del=h,v.delete=h,v.patch=function(e,t,n){var r=v("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},v.post=function(e,t,n){var r=v("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},v.put=function(e,t,n){var r=v("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},function(e,t,n){function r(e){if(e)return i(e)}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if((r=n[i])===t||r.fn===t){n.splice(i,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){"use strict";function r(e){if(e)return i(e)}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}var s=n(46);e.exports=r,r.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},r.prototype.parse=function(e){return this._parser=e,this},r.prototype.responseType=function(e){return this._responseType=e,this},r.prototype.serialize=function(e){return this._serializer=e,this},r.prototype.timeout=function(e){if(!e||"object"!=typeof e)return this._timeout=e,this._responseTimeout=0,this;for(var t in e)switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;default:console.warn("Unknown timeout option",t)}return this},r.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};var o=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];r.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&t.status>=500&&501!=t.status)return!0;if(e){if(e.code&&~o.indexOf(e.code))return!0;if(e.timeout&&"ECONNABORTED"==e.code)return!0;if(e.crossDomain)return!0}return!1},r.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},r.prototype.then=function(e,t){if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(e,t){n.end(function(n,r){n?t(n):e(r)})})}return this._fullfilledPromise.then(e,t)},r.prototype.catch=function(e){return this.then(void 0,e)},r.prototype.use=function(e){return e(this),this},r.prototype.ok=function(e){if("function"!=typeof e)throw Error("Callback required");return this._okCallback=e,this},r.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},r.prototype.get=function(e){return this._header[e.toLowerCase()]},r.prototype.getHeader=r.prototype.get,r.prototype.set=function(e,t){if(s(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},r.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},r.prototype.field=function(e,t){if(null===e||void 0===e)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),s(e)){for(var n in e)this.field(n,e[n]);return this}if(Array.isArray(t)){for(var r in t)this.field(e,t[r]);return this}if(null===t||void 0===t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=""+t),this._getFormData().append(e,t),this},r.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},r.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization","Basic "+r(e+":"+t));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer "+e)}return this},r.prototype.withCredentials=function(e){return void 0==e&&(e=!0),this._withCredentials=e,this},r.prototype.redirects=function(e){return this._maxRedirects=e,this},r.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw TypeError("Invalid argument");return this._maxResponseSize=e,this},r.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},r.prototype.send=function(e){var t=s(e),n=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(t&&s(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],this._data="application/x-www-form-urlencoded"==n?this._data?this._data+"&"+e:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)?this:(n||this.type("json"),this)},r.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},r.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var n=this.url.substring(t+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,t)+"?"+n.join("&")}}},r.prototype._appendQueryString=function(){console.trace("Unsupported")},r.prototype._timeoutError=function(e,t,n){if(!this._aborted){var r=new Error(e+t+"ms exceeded");r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.abort(),this.callback(r)}},r.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(e,t){"use strict";function n(e){return null!==e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict";function r(e){if(e)return i(e)}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}var s=n(48);e.exports=r,r.prototype.get=function(e){return this.header[e.toLowerCase()]},r.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=s.type(t);var n=s.params(t);for(var r in n)this[r]=n[r];this.links={};try{e.link&&(this.links=s.parseLinks(e.link))}catch(e){}},r.prototype._setStatusProperties=function(e){var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.redirect=3==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.created=201==e,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.forbidden=403==e,this.notFound=404==e,this.unprocessableEntity=422==e}},function(e,t){"use strict";t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){return e.split(/ *; */).reduce(function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e},{})},t.parseLinks=function(e){return e.split(/ *, */).reduce(function(e,t){var n=t.split(/ *; */),r=n[0].slice(1,-1);return e[n[1].split(/ *= */)[1].slice(1,-1)]=r,e},{})},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},function(e,t){function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(e){n.prototype[e]=function(){return this._defaults.push({fn:e,arguments:arguments}),this}}),n.prototype._setDefaults=function(e){this._defaults.forEach(function(t){e[t.fn].apply(e,t.arguments)})},e.exports=n}])});
19979
- },{}],87:[function(require,module,exports){
20946
+ },{}],89:[function(require,module,exports){
19980
20947
  (function (global){
19981
20948
  /*! https://mths.be/punycode v1.4.1 by @mathias */
19982
20949
  ;(function(root) {
@@ -20513,7 +21480,7 @@ d.length>0&&(y.auth=d.join(",")),(o||0===o)&&(y.ttl=o),y}function c(){return{}}O
20513
21480
  }(this));
20514
21481
 
20515
21482
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
20516
- },{}],88:[function(require,module,exports){
21483
+ },{}],90:[function(require,module,exports){
20517
21484
  (function (process){
20518
21485
  // vim:ts=4:sts=4:sw=4:
20519
21486
  /*!
@@ -22565,7 +23532,7 @@ return Q;
22565
23532
  });
22566
23533
 
22567
23534
  }).call(this,require('_process'))
22568
- },{"_process":85}],89:[function(require,module,exports){
23535
+ },{"_process":87}],91:[function(require,module,exports){
22569
23536
  // Copyright Joyent, Inc. and other Node contributors.
22570
23537
  //
22571
23538
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -22651,7 +23618,7 @@ var isArray = Array.isArray || function (xs) {
22651
23618
  return Object.prototype.toString.call(xs) === '[object Array]';
22652
23619
  };
22653
23620
 
22654
- },{}],90:[function(require,module,exports){
23621
+ },{}],92:[function(require,module,exports){
22655
23622
  // Copyright Joyent, Inc. and other Node contributors.
22656
23623
  //
22657
23624
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -22738,16 +23705,16 @@ var objectKeys = Object.keys || function (obj) {
22738
23705
  return res;
22739
23706
  };
22740
23707
 
22741
- },{}],91:[function(require,module,exports){
23708
+ },{}],93:[function(require,module,exports){
22742
23709
  'use strict';
22743
23710
 
22744
23711
  exports.decode = exports.parse = require('./decode');
22745
23712
  exports.encode = exports.stringify = require('./encode');
22746
23713
 
22747
- },{"./decode":89,"./encode":90}],92:[function(require,module,exports){
23714
+ },{"./decode":91,"./encode":92}],94:[function(require,module,exports){
22748
23715
  module.exports = require('./lib/_stream_duplex.js');
22749
23716
 
22750
- },{"./lib/_stream_duplex.js":93}],93:[function(require,module,exports){
23717
+ },{"./lib/_stream_duplex.js":95}],95:[function(require,module,exports){
22751
23718
  // Copyright Joyent, Inc. and other Node contributors.
22752
23719
  //
22753
23720
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -22879,7 +23846,7 @@ Duplex.prototype._destroy = function (err, cb) {
22879
23846
 
22880
23847
  pna.nextTick(cb, err);
22881
23848
  };
22882
- },{"./_stream_readable":95,"./_stream_writable":97,"core-util-is":46,"inherits":74,"process-nextick-args":84}],94:[function(require,module,exports){
23849
+ },{"./_stream_readable":97,"./_stream_writable":99,"core-util-is":48,"inherits":76,"process-nextick-args":86}],96:[function(require,module,exports){
22883
23850
  // Copyright Joyent, Inc. and other Node contributors.
22884
23851
  //
22885
23852
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -22927,7 +23894,7 @@ function PassThrough(options) {
22927
23894
  PassThrough.prototype._transform = function (chunk, encoding, cb) {
22928
23895
  cb(null, chunk);
22929
23896
  };
22930
- },{"./_stream_transform":96,"core-util-is":46,"inherits":74}],95:[function(require,module,exports){
23897
+ },{"./_stream_transform":98,"core-util-is":48,"inherits":76}],97:[function(require,module,exports){
22931
23898
  (function (process,global){
22932
23899
  // Copyright Joyent, Inc. and other Node contributors.
22933
23900
  //
@@ -23949,7 +24916,7 @@ function indexOf(xs, x) {
23949
24916
  return -1;
23950
24917
  }
23951
24918
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
23952
- },{"./_stream_duplex":93,"./internal/streams/BufferList":98,"./internal/streams/destroy":99,"./internal/streams/stream":100,"_process":85,"core-util-is":46,"events":65,"inherits":74,"isarray":75,"process-nextick-args":84,"safe-buffer":106,"string_decoder/":130,"util":41}],96:[function(require,module,exports){
24919
+ },{"./_stream_duplex":95,"./internal/streams/BufferList":100,"./internal/streams/destroy":101,"./internal/streams/stream":102,"_process":87,"core-util-is":48,"events":67,"inherits":76,"isarray":77,"process-nextick-args":86,"safe-buffer":108,"string_decoder/":132,"util":43}],98:[function(require,module,exports){
23953
24920
  // Copyright Joyent, Inc. and other Node contributors.
23954
24921
  //
23955
24922
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -24164,7 +25131,7 @@ function done(stream, er, data) {
24164
25131
 
24165
25132
  return stream.push(null);
24166
25133
  }
24167
- },{"./_stream_duplex":93,"core-util-is":46,"inherits":74}],97:[function(require,module,exports){
25134
+ },{"./_stream_duplex":95,"core-util-is":48,"inherits":76}],99:[function(require,module,exports){
24168
25135
  (function (process,global){
24169
25136
  // Copyright Joyent, Inc. and other Node contributors.
24170
25137
  //
@@ -24854,7 +25821,7 @@ Writable.prototype._destroy = function (err, cb) {
24854
25821
  cb(err);
24855
25822
  };
24856
25823
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
24857
- },{"./_stream_duplex":93,"./internal/streams/destroy":99,"./internal/streams/stream":100,"_process":85,"core-util-is":46,"inherits":74,"process-nextick-args":84,"safe-buffer":106,"util-deprecate":138}],98:[function(require,module,exports){
25824
+ },{"./_stream_duplex":95,"./internal/streams/destroy":101,"./internal/streams/stream":102,"_process":87,"core-util-is":48,"inherits":76,"process-nextick-args":86,"safe-buffer":108,"util-deprecate":140}],100:[function(require,module,exports){
24858
25825
  'use strict';
24859
25826
 
24860
25827
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -24934,7 +25901,7 @@ if (util && util.inspect && util.inspect.custom) {
24934
25901
  return this.constructor.name + ' ' + obj;
24935
25902
  };
24936
25903
  }
24937
- },{"safe-buffer":106,"util":41}],99:[function(require,module,exports){
25904
+ },{"safe-buffer":108,"util":43}],101:[function(require,module,exports){
24938
25905
  'use strict';
24939
25906
 
24940
25907
  /*<replacement>*/
@@ -25009,13 +25976,13 @@ module.exports = {
25009
25976
  destroy: destroy,
25010
25977
  undestroy: undestroy
25011
25978
  };
25012
- },{"process-nextick-args":84}],100:[function(require,module,exports){
25979
+ },{"process-nextick-args":86}],102:[function(require,module,exports){
25013
25980
  module.exports = require('events').EventEmitter;
25014
25981
 
25015
- },{"events":65}],101:[function(require,module,exports){
25982
+ },{"events":67}],103:[function(require,module,exports){
25016
25983
  module.exports = require('./readable').PassThrough
25017
25984
 
25018
- },{"./readable":102}],102:[function(require,module,exports){
25985
+ },{"./readable":104}],104:[function(require,module,exports){
25019
25986
  exports = module.exports = require('./lib/_stream_readable.js');
25020
25987
  exports.Stream = exports;
25021
25988
  exports.Readable = exports;
@@ -25024,13 +25991,13 @@ exports.Duplex = require('./lib/_stream_duplex.js');
25024
25991
  exports.Transform = require('./lib/_stream_transform.js');
25025
25992
  exports.PassThrough = require('./lib/_stream_passthrough.js');
25026
25993
 
25027
- },{"./lib/_stream_duplex.js":93,"./lib/_stream_passthrough.js":94,"./lib/_stream_readable.js":95,"./lib/_stream_transform.js":96,"./lib/_stream_writable.js":97}],103:[function(require,module,exports){
25994
+ },{"./lib/_stream_duplex.js":95,"./lib/_stream_passthrough.js":96,"./lib/_stream_readable.js":97,"./lib/_stream_transform.js":98,"./lib/_stream_writable.js":99}],105:[function(require,module,exports){
25028
25995
  module.exports = require('./readable').Transform
25029
25996
 
25030
- },{"./readable":102}],104:[function(require,module,exports){
25997
+ },{"./readable":104}],106:[function(require,module,exports){
25031
25998
  module.exports = require('./lib/_stream_writable.js');
25032
25999
 
25033
- },{"./lib/_stream_writable.js":97}],105:[function(require,module,exports){
26000
+ },{"./lib/_stream_writable.js":99}],107:[function(require,module,exports){
25034
26001
 
25035
26002
  /**
25036
26003
  * Reduce `arr` with `fn`.
@@ -25055,7 +26022,7 @@ module.exports = function(arr, fn, initial){
25055
26022
 
25056
26023
  return curr;
25057
26024
  };
25058
- },{}],106:[function(require,module,exports){
26025
+ },{}],108:[function(require,module,exports){
25059
26026
  /* eslint-disable node/no-deprecated-api */
25060
26027
  var buffer = require('buffer')
25061
26028
  var Buffer = buffer.Buffer
@@ -25119,7 +26086,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
25119
26086
  return buffer.SlowBuffer(size)
25120
26087
  }
25121
26088
 
25122
- },{"buffer":42}],107:[function(require,module,exports){
26089
+ },{"buffer":44}],109:[function(require,module,exports){
25123
26090
 
25124
26091
  /**
25125
26092
  * Module dependencies.
@@ -25213,7 +26180,7 @@ exports.connect = lookup;
25213
26180
  exports.Manager = require('./manager');
25214
26181
  exports.Socket = require('./socket');
25215
26182
 
25216
- },{"./manager":108,"./socket":110,"./url":111,"debug":113,"socket.io-parser":117}],108:[function(require,module,exports){
26183
+ },{"./manager":110,"./socket":112,"./url":113,"debug":115,"socket.io-parser":119}],110:[function(require,module,exports){
25217
26184
 
25218
26185
  /**
25219
26186
  * Module dependencies.
@@ -25772,7 +26739,7 @@ Manager.prototype.onreconnect = function(){
25772
26739
  this.emitAll('reconnect', attempt);
25773
26740
  };
25774
26741
 
25775
- },{"./on":109,"./socket":110,"backo2":37,"component-bind":44,"component-emitter":112,"debug":113,"engine.io-client":47,"indexof":73,"socket.io-parser":117}],109:[function(require,module,exports){
26742
+ },{"./on":111,"./socket":112,"backo2":39,"component-bind":46,"component-emitter":114,"debug":115,"engine.io-client":49,"indexof":75,"socket.io-parser":119}],111:[function(require,module,exports){
25776
26743
 
25777
26744
  /**
25778
26745
  * Module exports.
@@ -25798,7 +26765,7 @@ function on(obj, ev, fn) {
25798
26765
  };
25799
26766
  }
25800
26767
 
25801
- },{}],110:[function(require,module,exports){
26768
+ },{}],112:[function(require,module,exports){
25802
26769
 
25803
26770
  /**
25804
26771
  * Module dependencies.
@@ -26212,7 +27179,7 @@ Socket.prototype.compress = function(compress){
26212
27179
  return this;
26213
27180
  };
26214
27181
 
26215
- },{"./on":109,"component-bind":44,"component-emitter":112,"debug":113,"has-binary":68,"socket.io-parser":117,"to-array":134}],111:[function(require,module,exports){
27182
+ },{"./on":111,"component-bind":46,"component-emitter":114,"debug":115,"has-binary":70,"socket.io-parser":119,"to-array":136}],113:[function(require,module,exports){
26216
27183
  (function (global){
26217
27184
 
26218
27185
  /**
@@ -26292,7 +27259,7 @@ function url(uri, loc){
26292
27259
  }
26293
27260
 
26294
27261
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
26295
- },{"debug":113,"parseuri":83}],112:[function(require,module,exports){
27262
+ },{"debug":115,"parseuri":85}],114:[function(require,module,exports){
26296
27263
 
26297
27264
  /**
26298
27265
  * Expose `Emitter`.
@@ -26455,13 +27422,13 @@ Emitter.prototype.hasListeners = function(event){
26455
27422
  return !! this.listeners(event).length;
26456
27423
  };
26457
27424
 
26458
- },{}],113:[function(require,module,exports){
26459
- arguments[4][58][0].apply(exports,arguments)
26460
- },{"./debug":114,"dup":58}],114:[function(require,module,exports){
26461
- arguments[4][59][0].apply(exports,arguments)
26462
- },{"dup":59,"ms":115}],115:[function(require,module,exports){
27425
+ },{}],115:[function(require,module,exports){
26463
27426
  arguments[4][60][0].apply(exports,arguments)
26464
- },{"dup":60}],116:[function(require,module,exports){
27427
+ },{"./debug":116,"dup":60}],116:[function(require,module,exports){
27428
+ arguments[4][61][0].apply(exports,arguments)
27429
+ },{"dup":61,"ms":117}],117:[function(require,module,exports){
27430
+ arguments[4][62][0].apply(exports,arguments)
27431
+ },{"dup":62}],118:[function(require,module,exports){
26465
27432
  (function (global){
26466
27433
  /*global Blob,File*/
26467
27434
 
@@ -26606,7 +27573,7 @@ exports.removeBlobs = function(data, callback) {
26606
27573
  };
26607
27574
 
26608
27575
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
26609
- },{"./is-buffer":118,"isarray":122}],117:[function(require,module,exports){
27576
+ },{"./is-buffer":120,"isarray":124}],119:[function(require,module,exports){
26610
27577
 
26611
27578
  /**
26612
27579
  * Module dependencies.
@@ -27008,7 +27975,7 @@ function error(data){
27008
27975
  };
27009
27976
  }
27010
27977
 
27011
- },{"./binary":116,"./is-buffer":118,"component-emitter":119,"debug":120,"isarray":122,"json3":76}],118:[function(require,module,exports){
27978
+ },{"./binary":118,"./is-buffer":120,"component-emitter":121,"debug":122,"isarray":124,"json3":78}],120:[function(require,module,exports){
27012
27979
  (function (global){
27013
27980
 
27014
27981
  module.exports = isBuf;
@@ -27025,17 +27992,17 @@ function isBuf(obj) {
27025
27992
  }
27026
27993
 
27027
27994
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
27028
- },{}],119:[function(require,module,exports){
27029
- arguments[4][57][0].apply(exports,arguments)
27030
- },{"dup":57}],120:[function(require,module,exports){
27031
- arguments[4][58][0].apply(exports,arguments)
27032
- },{"./debug":121,"dup":58}],121:[function(require,module,exports){
27995
+ },{}],121:[function(require,module,exports){
27033
27996
  arguments[4][59][0].apply(exports,arguments)
27034
- },{"dup":59,"ms":123}],122:[function(require,module,exports){
27035
- arguments[4][64][0].apply(exports,arguments)
27036
- },{"dup":64}],123:[function(require,module,exports){
27997
+ },{"dup":59}],122:[function(require,module,exports){
27037
27998
  arguments[4][60][0].apply(exports,arguments)
27038
- },{"dup":60}],124:[function(require,module,exports){
27999
+ },{"./debug":123,"dup":60}],123:[function(require,module,exports){
28000
+ arguments[4][61][0].apply(exports,arguments)
28001
+ },{"dup":61,"ms":125}],124:[function(require,module,exports){
28002
+ arguments[4][66][0].apply(exports,arguments)
28003
+ },{"dup":66}],125:[function(require,module,exports){
28004
+ arguments[4][62][0].apply(exports,arguments)
28005
+ },{"dup":62}],126:[function(require,module,exports){
27039
28006
  // Copyright Joyent, Inc. and other Node contributors.
27040
28007
  //
27041
28008
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -27164,7 +28131,7 @@ Stream.prototype.pipe = function(dest, options) {
27164
28131
  return dest;
27165
28132
  };
27166
28133
 
27167
- },{"events":65,"inherits":74,"readable-stream/duplex.js":92,"readable-stream/passthrough.js":101,"readable-stream/readable.js":102,"readable-stream/transform.js":103,"readable-stream/writable.js":104}],125:[function(require,module,exports){
28134
+ },{"events":67,"inherits":76,"readable-stream/duplex.js":94,"readable-stream/passthrough.js":103,"readable-stream/readable.js":104,"readable-stream/transform.js":105,"readable-stream/writable.js":106}],127:[function(require,module,exports){
27168
28135
  var ClientRequest = require('./lib/request')
27169
28136
  var extend = require('xtend')
27170
28137
  var statusCodes = require('builtin-status-codes')
@@ -27239,7 +28206,7 @@ http.METHODS = [
27239
28206
  'UNLOCK',
27240
28207
  'UNSUBSCRIBE'
27241
28208
  ]
27242
- },{"./lib/request":127,"builtin-status-codes":43,"url":136,"xtend":141}],126:[function(require,module,exports){
28209
+ },{"./lib/request":129,"builtin-status-codes":45,"url":138,"xtend":143}],128:[function(require,module,exports){
27243
28210
  (function (global){
27244
28211
  exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableByteStream)
27245
28212
 
@@ -27283,7 +28250,7 @@ function isFunction (value) {
27283
28250
  xhr = null // Help gc
27284
28251
 
27285
28252
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
27286
- },{}],127:[function(require,module,exports){
28253
+ },{}],129:[function(require,module,exports){
27287
28254
  (function (process,global,Buffer){
27288
28255
  // var Base64 = require('Base64')
27289
28256
  var capability = require('./capability')
@@ -27565,7 +28532,7 @@ var unsafeHeaders = [
27565
28532
  ]
27566
28533
 
27567
28534
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
27568
- },{"./capability":126,"./response":128,"_process":85,"buffer":42,"foreach":67,"indexof":73,"inherits":74,"object-keys":78,"stream":124}],128:[function(require,module,exports){
28535
+ },{"./capability":128,"./response":130,"_process":87,"buffer":44,"foreach":69,"indexof":75,"inherits":76,"object-keys":80,"stream":126}],130:[function(require,module,exports){
27569
28536
  (function (process,global,Buffer){
27570
28537
  var capability = require('./capability')
27571
28538
  var foreach = require('foreach')
@@ -27742,7 +28709,7 @@ IncomingMessage.prototype._onXHRProgress = function () {
27742
28709
  }
27743
28710
 
27744
28711
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
27745
- },{"./capability":126,"_process":85,"buffer":42,"foreach":67,"inherits":74,"stream":124}],129:[function(require,module,exports){
28712
+ },{"./capability":128,"_process":87,"buffer":44,"foreach":69,"inherits":76,"stream":126}],131:[function(require,module,exports){
27746
28713
  var nargs = /\{([0-9a-zA-Z_]+)\}/g
27747
28714
 
27748
28715
  module.exports = template
@@ -27780,7 +28747,7 @@ function template(string) {
27780
28747
  })
27781
28748
  }
27782
28749
 
27783
- },{}],130:[function(require,module,exports){
28750
+ },{}],132:[function(require,module,exports){
27784
28751
  // Copyright Joyent, Inc. and other Node contributors.
27785
28752
  //
27786
28753
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -28077,7 +29044,7 @@ function simpleWrite(buf) {
28077
29044
  function simpleEnd(buf) {
28078
29045
  return buf && buf.length ? this.write(buf) : '';
28079
29046
  }
28080
- },{"safe-buffer":106}],131:[function(require,module,exports){
29047
+ },{"safe-buffer":108}],133:[function(require,module,exports){
28081
29048
  /**
28082
29049
  * Module dependencies.
28083
29050
  */
@@ -29270,7 +30237,7 @@ request.put = function(url, data, fn){
29270
30237
 
29271
30238
  module.exports = request;
29272
30239
 
29273
- },{"emitter":132,"reduce":105}],132:[function(require,module,exports){
30240
+ },{"emitter":134,"reduce":107}],134:[function(require,module,exports){
29274
30241
 
29275
30242
  /**
29276
30243
  * Expose `Emitter`.
@@ -29435,7 +30402,7 @@ Emitter.prototype.hasListeners = function(event){
29435
30402
  return !! this.listeners(event).length;
29436
30403
  };
29437
30404
 
29438
- },{}],133:[function(require,module,exports){
30405
+ },{}],135:[function(require,module,exports){
29439
30406
  (function (Buffer){
29440
30407
  "0.50.0";
29441
30408
  /*
@@ -37632,7 +38599,7 @@ TinCan client library
37632
38599
  }());
37633
38600
 
37634
38601
  }).call(this,require("buffer").Buffer)
37635
- },{"buffer":42,"querystring":91,"xhr2":140}],134:[function(require,module,exports){
38602
+ },{"buffer":44,"querystring":93,"xhr2":142}],136:[function(require,module,exports){
37636
38603
  module.exports = toArray
37637
38604
 
37638
38605
  function toArray(list, index) {
@@ -37647,7 +38614,7 @@ function toArray(list, index) {
37647
38614
  return array
37648
38615
  }
37649
38616
 
37650
- },{}],135:[function(require,module,exports){
38617
+ },{}],137:[function(require,module,exports){
37651
38618
  // Underscore.js 1.8.3
37652
38619
  // http://underscorejs.org
37653
38620
  // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
@@ -39197,7 +40164,7 @@ function toArray(list, index) {
39197
40164
  }
39198
40165
  }.call(this));
39199
40166
 
39200
- },{}],136:[function(require,module,exports){
40167
+ },{}],138:[function(require,module,exports){
39201
40168
  // Copyright Joyent, Inc. and other Node contributors.
39202
40169
  //
39203
40170
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -39906,7 +40873,7 @@ function isNullOrUndefined(arg) {
39906
40873
  return arg == null;
39907
40874
  }
39908
40875
 
39909
- },{"punycode":87,"querystring":91}],137:[function(require,module,exports){
40876
+ },{"punycode":89,"querystring":93}],139:[function(require,module,exports){
39910
40877
  (function (global){
39911
40878
  /*! https://mths.be/utf8js v2.0.0 by @mathias */
39912
40879
  ;(function(root) {
@@ -40154,7 +41121,7 @@ function isNullOrUndefined(arg) {
40154
41121
  }(this));
40155
41122
 
40156
41123
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
40157
- },{}],138:[function(require,module,exports){
41124
+ },{}],140:[function(require,module,exports){
40158
41125
  (function (global){
40159
41126
 
40160
41127
  /**
@@ -40225,7 +41192,7 @@ function config (name) {
40225
41192
  }
40226
41193
 
40227
41194
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
40228
- },{}],139:[function(require,module,exports){
41195
+ },{}],141:[function(require,module,exports){
40229
41196
  /*!
40230
41197
  * validate.js 0.9.0
40231
41198
  *
@@ -41313,7 +42280,7 @@ function config (name) {
41313
42280
  typeof module !== 'undefined' ? /* istanbul ignore next */ module : null,
41314
42281
  typeof define !== 'undefined' ? /* istanbul ignore next */ define : null);
41315
42282
 
41316
- },{}],140:[function(require,module,exports){
42283
+ },{}],142:[function(require,module,exports){
41317
42284
  (function (process,Buffer){
41318
42285
  // Generated by CoffeeScript 1.6.3
41319
42286
  (function() {
@@ -42151,7 +43118,7 @@ function config (name) {
42151
43118
  }).call(this);
42152
43119
 
42153
43120
  }).call(this,require('_process'),require("buffer").Buffer)
42154
- },{"_process":85,"buffer":42,"http":125,"https":71,"os":80,"url":136}],141:[function(require,module,exports){
43121
+ },{"_process":87,"buffer":44,"http":127,"https":73,"os":82,"url":138}],143:[function(require,module,exports){
42155
43122
  module.exports = extend
42156
43123
 
42157
43124
  var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -42172,7 +43139,7 @@ function extend() {
42172
43139
  return target
42173
43140
  }
42174
43141
 
42175
- },{}],142:[function(require,module,exports){
43142
+ },{}],144:[function(require,module,exports){
42176
43143
  'use strict';
42177
43144
 
42178
43145
  var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')