@monei-js/components 1.7.9 → 1.7.10

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.
@@ -3114,69 +3114,139 @@ var getClientEnv = function getClientEnv() {
3114
3114
  })].join('|');
3115
3115
  return window.btoa(env);
3116
3116
  };
3117
+ var FINGERPRINT_SEED_KEY = '_monei_fp';
3118
+
3119
+ var randomHex = function randomHex(length) {
3120
+ if (typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function') {
3121
+ var bytes = new Uint8Array(length);
3122
+ crypto.getRandomValues(bytes);
3123
+ return Array.from(bytes, function (b) {
3124
+ return (b % 16).toString(16);
3125
+ }).join('');
3126
+ }
3127
+
3128
+ return Array.from({
3129
+ length: length
3130
+ }, function () {
3131
+ return Math.floor(Math.random() * 16).toString(16);
3132
+ }).join('');
3133
+ };
3134
+
3135
+ var cachedSeed = null;
3136
+
3137
+ var getPersistentSeed = /*#__PURE__*/function () {
3138
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
3139
+ var localStorage;
3140
+ return runtime_1.wrap(function _callee$(_context) {
3141
+ while (1) {
3142
+ switch (_context.prev = _context.next) {
3143
+ case 0:
3144
+ if (!cachedSeed) {
3145
+ _context.next = 2;
3146
+ break;
3147
+ }
3148
+
3149
+ return _context.abrupt("return", {
3150
+ seed: cachedSeed
3151
+ });
3152
+
3153
+ case 2:
3154
+ try {
3155
+ localStorage = fixLocalstorage();
3156
+ cachedSeed = localStorage.getItem(FINGERPRINT_SEED_KEY);
3157
+
3158
+ if (!cachedSeed) {
3159
+ cachedSeed = randomHex(32);
3160
+
3161
+ try {
3162
+ localStorage.setItem(FINGERPRINT_SEED_KEY, cachedSeed);
3163
+ } catch (_unused2) {}
3164
+ }
3165
+ } catch (_unused3) {
3166
+ cachedSeed = randomHex(32);
3167
+ }
3168
+
3169
+ return _context.abrupt("return", {
3170
+ seed: cachedSeed
3171
+ });
3172
+
3173
+ case 4:
3174
+ case "end":
3175
+ return _context.stop();
3176
+ }
3177
+ }
3178
+ }, _callee);
3179
+ }));
3180
+
3181
+ return function getPersistentSeed() {
3182
+ return _ref.apply(this, arguments);
3183
+ };
3184
+ }();
3185
+
3117
3186
  var thumbmark = /*#__PURE__*/new ue({
3118
- stabilize: []
3187
+ logging: false
3119
3188
  });
3189
+ thumbmark.includeComponent('persistent_seed', getPersistentSeed);
3120
3190
  var getClientFingerprint = /*#__PURE__*/function () {
3121
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
3191
+ var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
3122
3192
  var _result$thumbmark;
3123
3193
 
3124
3194
  var _yield$withError, result;
3125
3195
 
3126
- return runtime_1.wrap(function _callee$(_context) {
3196
+ return runtime_1.wrap(function _callee2$(_context2) {
3127
3197
  while (1) {
3128
- switch (_context.prev = _context.next) {
3198
+ switch (_context2.prev = _context2.next) {
3129
3199
  case 0:
3130
- _context.next = 2;
3200
+ _context2.next = 2;
3131
3201
  return withError(thumbmark.get());
3132
3202
 
3133
3203
  case 2:
3134
- _yield$withError = _context.sent;
3204
+ _yield$withError = _context2.sent;
3135
3205
  result = _yield$withError[1];
3136
- return _context.abrupt("return", (_result$thumbmark = result == null ? void 0 : result.thumbmark) != null ? _result$thumbmark : '');
3206
+ return _context2.abrupt("return", (_result$thumbmark = result == null ? void 0 : result.thumbmark) != null ? _result$thumbmark : '');
3137
3207
 
3138
3208
  case 5:
3139
3209
  case "end":
3140
- return _context.stop();
3210
+ return _context2.stop();
3141
3211
  }
3142
3212
  }
3143
- }, _callee);
3213
+ }, _callee2);
3144
3214
  }));
3145
3215
 
3146
3216
  return function getClientFingerprint() {
3147
- return _ref.apply(this, arguments);
3217
+ return _ref2.apply(this, arguments);
3148
3218
  };
3149
3219
  }();
3150
3220
  var withError = /*#__PURE__*/function () {
3151
- var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(p) {
3152
- return runtime_1.wrap(function _callee2$(_context2) {
3221
+ var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(p) {
3222
+ return runtime_1.wrap(function _callee3$(_context3) {
3153
3223
  while (1) {
3154
- switch (_context2.prev = _context2.next) {
3224
+ switch (_context3.prev = _context3.next) {
3155
3225
  case 0:
3156
- _context2.prev = 0;
3157
- _context2.t0 = undefined;
3158
- _context2.next = 4;
3226
+ _context3.prev = 0;
3227
+ _context3.t0 = undefined;
3228
+ _context3.next = 4;
3159
3229
  return p;
3160
3230
 
3161
3231
  case 4:
3162
- _context2.t1 = _context2.sent;
3163
- return _context2.abrupt("return", [_context2.t0, _context2.t1]);
3232
+ _context3.t1 = _context3.sent;
3233
+ return _context3.abrupt("return", [_context3.t0, _context3.t1]);
3164
3234
 
3165
3235
  case 8:
3166
- _context2.prev = 8;
3167
- _context2.t2 = _context2["catch"](0);
3168
- return _context2.abrupt("return", [_context2.t2, undefined]);
3236
+ _context3.prev = 8;
3237
+ _context3.t2 = _context3["catch"](0);
3238
+ return _context3.abrupt("return", [_context3.t2, undefined]);
3169
3239
 
3170
3240
  case 11:
3171
3241
  case "end":
3172
- return _context2.stop();
3242
+ return _context3.stop();
3173
3243
  }
3174
3244
  }
3175
- }, _callee2, null, [[0, 8]]);
3245
+ }, _callee3, null, [[0, 8]]);
3176
3246
  }));
3177
3247
 
3178
3248
  return function withError(_x) {
3179
- return _ref2.apply(this, arguments);
3249
+ return _ref3.apply(this, arguments);
3180
3250
  };
3181
3251
  }();
3182
3252
  var isMethodSupported = function isMethodSupported(config, paymentMethod) {