@depay/widgets 8.0.2 → 8.0.3

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.
package/dist/esm/index.js CHANGED
@@ -84,6 +84,9 @@ function _regeneratorRuntime() {
84
84
  var exports = {},
85
85
  Op = Object.prototype,
86
86
  hasOwn = Op.hasOwnProperty,
87
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
88
+ obj[key] = desc.value;
89
+ },
87
90
  $Symbol = "function" == typeof Symbol ? Symbol : {},
88
91
  iteratorSymbol = $Symbol.iterator || "@@iterator",
89
92
  asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
@@ -107,40 +110,9 @@ function _regeneratorRuntime() {
107
110
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
108
111
  generator = Object.create(protoGenerator.prototype),
109
112
  context = new Context(tryLocsList || []);
110
- return generator._invoke = function (innerFn, self, context) {
111
- var state = "suspendedStart";
112
- return function (method, arg) {
113
- if ("executing" === state) throw new Error("Generator is already running");
114
- if ("completed" === state) {
115
- if ("throw" === method) throw arg;
116
- return doneResult();
117
- }
118
- for (context.method = method, context.arg = arg;;) {
119
- var delegate = context.delegate;
120
- if (delegate) {
121
- var delegateResult = maybeInvokeDelegate(delegate, context);
122
- if (delegateResult) {
123
- if (delegateResult === ContinueSentinel) continue;
124
- return delegateResult;
125
- }
126
- }
127
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
128
- if ("suspendedStart" === state) throw state = "completed", context.arg;
129
- context.dispatchException(context.arg);
130
- } else "return" === context.method && context.abrupt("return", context.arg);
131
- state = "executing";
132
- var record = tryCatch(innerFn, self, context);
133
- if ("normal" === record.type) {
134
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
135
- return {
136
- value: record.arg,
137
- done: context.done
138
- };
139
- }
140
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
141
- }
142
- };
143
- }(innerFn, self, context), generator;
113
+ return defineProperty(generator, "_invoke", {
114
+ value: makeInvokeMethod(innerFn, self, context)
115
+ }), generator;
144
116
  }
145
117
  function tryCatch(fn, obj, arg) {
146
118
  try {
@@ -194,13 +166,49 @@ function _regeneratorRuntime() {
194
166
  reject(record.arg);
195
167
  }
196
168
  var previousPromise;
197
- this._invoke = function (method, arg) {
198
- function callInvokeWithMethodAndArg() {
199
- return new PromiseImpl(function (resolve, reject) {
200
- invoke(method, arg, resolve, reject);
201
- });
169
+ defineProperty(this, "_invoke", {
170
+ value: function value(method, arg) {
171
+ function callInvokeWithMethodAndArg() {
172
+ return new PromiseImpl(function (resolve, reject) {
173
+ invoke(method, arg, resolve, reject);
174
+ });
175
+ }
176
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
177
+ }
178
+ });
179
+ }
180
+ function makeInvokeMethod(innerFn, self, context) {
181
+ var state = "suspendedStart";
182
+ return function (method, arg) {
183
+ if ("executing" === state) throw new Error("Generator is already running");
184
+ if ("completed" === state) {
185
+ if ("throw" === method) throw arg;
186
+ return doneResult();
187
+ }
188
+ for (context.method = method, context.arg = arg;;) {
189
+ var delegate = context.delegate;
190
+ if (delegate) {
191
+ var delegateResult = maybeInvokeDelegate(delegate, context);
192
+ if (delegateResult) {
193
+ if (delegateResult === ContinueSentinel) continue;
194
+ return delegateResult;
195
+ }
196
+ }
197
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
198
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
199
+ context.dispatchException(context.arg);
200
+ } else "return" === context.method && context.abrupt("return", context.arg);
201
+ state = "executing";
202
+ var record = tryCatch(innerFn, self, context);
203
+ if ("normal" === record.type) {
204
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
205
+ return {
206
+ value: record.arg,
207
+ done: context.done
208
+ };
209
+ }
210
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
202
211
  }
203
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
204
212
  };
205
213
  }
206
214
  function maybeInvokeDelegate(delegate, context) {
@@ -258,7 +266,13 @@ function _regeneratorRuntime() {
258
266
  done: !0
259
267
  };
260
268
  }
261
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
269
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
270
+ value: GeneratorFunctionPrototype,
271
+ configurable: !0
272
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
273
+ value: GeneratorFunction,
274
+ configurable: !0
275
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
262
276
  var ctor = "function" == typeof genFun && genFun.constructor;
263
277
  return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
264
278
  }, exports.mark = function (genFun) {
@@ -279,8 +293,9 @@ function _regeneratorRuntime() {
279
293
  return this;
280
294
  }), define(Gp, "toString", function () {
281
295
  return "[object Generator]";
282
- }), exports.keys = function (object) {
283
- var keys = [];
296
+ }), exports.keys = function (val) {
297
+ var object = Object(val),
298
+ keys = [];
284
299
  for (var key in object) {
285
300
  keys.push(key);
286
301
  }
@@ -984,7 +999,7 @@ function ReactDialogStyle (styles) {
984
999
  `
985
1000
  }
986
1001
 
987
- const _jsxFileName$1 = "/home/runner/work/react-dialog/react-dialog/src/components/Dialog.jsx";
1002
+ const _jsxFileName$1 = "/Users/sebastian/Work/DePay/react-dialog/src/components/Dialog.jsx";
988
1003
  class Dialog extends React.Component {
989
1004
  constructor(props) {
990
1005
  super(props);
@@ -1046,7 +1061,7 @@ class Dialog extends React.Component {
1046
1061
  }
1047
1062
  }
1048
1063
 
1049
- const _jsxFileName = "/home/runner/work/react-dialog/react-dialog/src/index.jsx";
1064
+ const _jsxFileName = "/Users/sebastian/Work/DePay/react-dialog/src/index.jsx";
1050
1065
  class ReactDialog extends React.Component {
1051
1066
  constructor(props) {
1052
1067
  super(props);
@@ -20592,6 +20607,12 @@ var PaymentTrackingProvider = (function (props) {
20592
20607
  'Content-Type': 'application/json'
20593
20608
  },
20594
20609
  body: JSON.stringify(payment)
20610
+ }).then(function (response) {
20611
+ if (response.status == 200 || response.status == 201) {
20612
+ return response;
20613
+ } else {
20614
+ throw response;
20615
+ }
20595
20616
  });
20596
20617
  } else if (track.method) {
20597
20618
  return track.method(payment);
@@ -20615,9 +20636,7 @@ var PaymentTrackingProvider = (function (props) {
20615
20636
  to_decimals: paymentRoute.toDecimals,
20616
20637
  fee_amount: paymentRoute === null || paymentRoute === void 0 ? void 0 : (_paymentRoute$feeAmou = paymentRoute.feeAmount) === null || _paymentRoute$feeAmou === void 0 ? void 0 : _paymentRoute$feeAmou.toString()
20617
20638
  }).then(function (response) {
20618
- if (response.status != 200 && response.status != 201) {
20619
- retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
20620
- }
20639
+ console.log('PAYMENT TRACKING INITIALIZED');
20621
20640
  })["catch"](function (error) {
20622
20641
  console.log('PAYMENT TRACKING FAILED', error);
20623
20642
  retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
@@ -20635,20 +20654,16 @@ var PaymentTrackingProvider = (function (props) {
20635
20654
  after_block: afterBlock,
20636
20655
  to_token: paymentRoute.toToken.address
20637
20656
  };
20638
- var handleResponse = function handleResponse(response) {
20639
- if (response.status == 200 || response.status == 201) {
20640
- response.json().then(function (data) {
20641
- if (data && data.forward_to) {
20642
- setForwardTo(data.forward_to);
20643
- setTimeout(function () {
20644
- props.document.location.href = data.forward_to;
20645
- }, 100);
20646
- } else {
20647
- setClosable(true);
20648
- }
20649
- })["catch"](function () {
20657
+ var handlePollingResponse = function handlePollingResponse(data) {
20658
+ if (data) {
20659
+ if (data && data.forward_to) {
20660
+ setForwardTo(data.forward_to);
20661
+ setTimeout(function () {
20662
+ props.document.location.href = data.forward_to;
20663
+ }, 100);
20664
+ } else {
20650
20665
  setClosable(true);
20651
- });
20666
+ }
20652
20667
  clearInterval(pollingInterval);
20653
20668
  setRelease(true);
20654
20669
  }
@@ -20660,9 +20675,17 @@ var PaymentTrackingProvider = (function (props) {
20660
20675
  'Content-Type': 'application/json'
20661
20676
  },
20662
20677
  body: JSON.stringify(payment)
20663
- }).then(handleResponse);
20678
+ }).then(function (response) {
20679
+ if (response.status == 200 || response.status == 201) {
20680
+ return response.json()["catch"](function () {
20681
+ setClosable(true);
20682
+ });
20683
+ } else {
20684
+ return undefined;
20685
+ }
20686
+ }).then(handlePollingResponse);
20664
20687
  } else if (track.poll.method) {
20665
- track.poll.method(payment).then(handleResponse);
20688
+ track.poll.method(payment).then(handlePollingResponse);
20666
20689
  }
20667
20690
  };
20668
20691
  useEffect(function () {