@widergy/react-social-auth 1.3.0 → 2.0.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.
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.classesType = void 0;
7
-
8
7
  var _propTypes = require("prop-types");
9
-
10
8
  var classesType = (0, _propTypes.shape)({
11
9
  root: _propTypes.string,
12
10
  smallIcon: _propTypes.string,
@@ -1,49 +1,41 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.initAppleAuth = void 0;
7
-
8
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
8
9
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
-
10
10
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
11
-
12
11
  var initAppleAuth = /*#__PURE__*/function () {
13
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(clientId, scope, redirectUrl) {
12
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(clientId, scope, redirectUrl) {
14
13
  var head, script;
15
- return regeneratorRuntime.wrap(function _callee$(_context) {
16
- while (1) {
17
- switch (_context.prev = _context.next) {
18
- case 0:
19
- head = document.getElementsByTagName('head')[0];
20
- script = document.createElement('script');
21
- script.type = 'text/javascript';
22
- script.src = 'https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js';
23
-
24
- script.onload = function () {
25
- return window.AppleID.auth.init({
26
- clientId: clientId,
27
- scope: scope,
28
- usePopup: true,
29
- redirectURI: redirectUrl
30
- });
31
- };
32
-
33
- _context.next = 7;
34
- return head.appendChild(script);
35
-
36
- case 7:
37
- case "end":
38
- return _context.stop();
39
- }
14
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
15
+ while (1) switch (_context.prev = _context.next) {
16
+ case 0:
17
+ head = document.getElementsByTagName('head')[0];
18
+ script = document.createElement('script');
19
+ script.type = 'text/javascript';
20
+ script.src = 'https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js';
21
+ script.onload = function () {
22
+ return window.AppleID.auth.init({
23
+ clientId: clientId,
24
+ scope: scope,
25
+ usePopup: true,
26
+ redirectURI: redirectUrl
27
+ });
28
+ };
29
+ _context.next = 7;
30
+ return head.appendChild(script);
31
+ case 7:
32
+ case "end":
33
+ return _context.stop();
40
34
  }
41
35
  }, _callee);
42
36
  }));
43
-
44
37
  return function initAppleAuth(_x, _x2, _x3) {
45
38
  return _ref.apply(this, arguments);
46
39
  };
47
40
  }();
48
-
49
41
  exports.initAppleAuth = initAppleAuth;
@@ -1 +1,6 @@
1
- <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><defs><style>.cls-1{fill:#1ea0f2;}</style></defs><title>Artboard 1 copy 3</title><path class="cls-1" d="M256,27.33C129.72,27.33,27.33,129.71,27.33,256S129.72,484.67,256,484.67,484.67,382.3,484.67,256,382.29,27.33,256,27.33Zm90.93,182.05c.09,2,.13,4,.13,6.06,0,62-47.19,133.48-133.47,133.48a132.74,132.74,0,0,1-71.94-21.07,101.29,101.29,0,0,0,11.2.64,94.07,94.07,0,0,0,58.26-20.07,47,47,0,0,1-43.81-32.58,46.91,46.91,0,0,0,21.17-.81,47,47,0,0,1-37.63-46v-.59a46.69,46.69,0,0,0,21.26,5.86,47,47,0,0,1-14.53-62.63,133.21,133.21,0,0,0,96.71,49,47,47,0,0,1,79.94-42.8A93.44,93.44,0,0,0,364,166.5a47.11,47.11,0,0,1-20.62,26,94,94,0,0,0,26.94-7.37A95.36,95.36,0,0,1,346.94,209.38Z"/></svg>
1
+ <?xml version="1.0"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve" width="512px" height="512px" class=""><g><g>
3
+ <g>
4
+ <path d="M512,97.248c-19.04,8.352-39.328,13.888-60.48,16.576c21.76-12.992,38.368-33.408,46.176-58.016 c-20.288,12.096-42.688,20.64-66.56,25.408C411.872,60.704,384.416,48,354.464,48c-58.112,0-104.896,47.168-104.896,104.992 c0,8.32,0.704,16.32,2.432,23.936c-87.264-4.256-164.48-46.08-216.352-109.792c-9.056,15.712-14.368,33.696-14.368,53.056 c0,36.352,18.72,68.576,46.624,87.232c-16.864-0.32-33.408-5.216-47.424-12.928c0,0.32,0,0.736,0,1.152 c0,51.008,36.384,93.376,84.096,103.136c-8.544,2.336-17.856,3.456-27.52,3.456c-6.72,0-13.504-0.384-19.872-1.792 c13.6,41.568,52.192,72.128,98.08,73.12c-35.712,27.936-81.056,44.768-130.144,44.768c-8.608,0-16.864-0.384-25.12-1.44 C46.496,446.88,101.6,464,161.024,464c193.152,0,298.752-160,298.752-298.688c0-4.64-0.16-9.12-0.384-13.568 C480.224,136.96,497.728,118.496,512,97.248z" data-original="#000000" class="active-path" data-old_color="#000000" fill="#FFFFFF"/>
5
+ </g>
6
+ </g></g> </svg>
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _energyUi = require("@widergy/energy-ui");
9
+ var _propTypes = require("prop-types");
10
+ var _twitter = _interopRequireDefault(require("../../assets/twitter.svg"));
11
+ var _types = require("../../types");
12
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ var LargeButton = function LargeButton(_ref) {
15
+ var onClick = _ref.onClick,
16
+ label = _ref.label,
17
+ _ref$classes = _ref.classes,
18
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
19
+ icon = _ref.icon;
20
+ return /*#__PURE__*/_react.default.createElement(_energyUi.UTButton, {
21
+ classNames: {
22
+ childrenContainer: _stylesModule.default.childrenContainer,
23
+ root: "".concat(_stylesModule.default.button, " ").concat(classes.root),
24
+ text: "".concat(_stylesModule.default.label, " ").concat(classes.label)
25
+ },
26
+ Icon: function Icon(_ref2) {
27
+ var className = _ref2.className;
28
+ return /*#__PURE__*/_react.default.createElement("img", {
29
+ src: icon || _twitter.default,
30
+ alt: "",
31
+ className: "".concat(_stylesModule.default.icon, " ").concat(classes.largeIcon, " ").concat(className)
32
+ });
33
+ },
34
+ onClick: onClick
35
+ }, label);
36
+ };
37
+ LargeButton.propTypes = {
38
+ classes: _types.classesType,
39
+ icon: _propTypes.string,
40
+ label: _propTypes.string,
41
+ onClick: _propTypes.func
42
+ };
43
+ var _default = LargeButton;
44
+ exports.default = _default;
@@ -0,0 +1,35 @@
1
+ @import '../../../../scss/variables/colors';
2
+
3
+ .button {
4
+ align-items: center;
5
+ background-color: $twitter;
6
+ box-sizing: border-box;
7
+ height: 40px;
8
+ justify-content: flex-start;
9
+ margin: 10px 0;
10
+ padding: 8px 12px;
11
+ width: 100%;
12
+
13
+ &:hover {
14
+ background-color: $twitter;
15
+ }
16
+ }
17
+
18
+ .childrenContainer {
19
+ width: 100%;
20
+ }
21
+
22
+ .icon {
23
+ height: 24px;
24
+ margin-right: 12px;
25
+ position: absolute;
26
+ top: 50%;
27
+ transform: translateY(-50%);
28
+ width: 24px;
29
+ }
30
+
31
+ .label {
32
+ font-size: 0.875rem;
33
+ font-weight: 700;
34
+ margin: 0 auto -2px;
35
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _energyUi = require("@widergy/energy-ui");
9
+ var _propTypes = require("prop-types");
10
+ var _twitter = _interopRequireDefault(require("../../assets/twitter.svg"));
11
+ var _types = require("../../types");
12
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ var SmallButton = function SmallButton(_ref) {
15
+ var onClick = _ref.onClick,
16
+ _ref$classes = _ref.classes,
17
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
18
+ icon = _ref.icon;
19
+ return /*#__PURE__*/_react.default.createElement(_energyUi.UTButton, {
20
+ classNames: {
21
+ root: "".concat(_stylesModule.default.button, " ").concat(classes.root)
22
+ },
23
+ Icon: function Icon(_ref2) {
24
+ var className = _ref2.className;
25
+ return /*#__PURE__*/_react.default.createElement("img", {
26
+ src: icon || _twitter.default,
27
+ alt: "",
28
+ className: "".concat(classes.smallIcon, " ").concat(className)
29
+ });
30
+ },
31
+ onClick: onClick
32
+ });
33
+ };
34
+ SmallButton.propTypes = {
35
+ onClick: _propTypes.func,
36
+ classes: _types.classesType,
37
+ icon: _propTypes.string
38
+ };
39
+ var _default = SmallButton;
40
+ exports.default = _default;
@@ -0,0 +1,10 @@
1
+ @import '../../../../scss/variables/colors';
2
+
3
+ .button {
4
+ background-color: $twitter;
5
+ border-radius: 50%;
6
+
7
+ &:hover {
8
+ background-color: $twitter;
9
+ }
10
+ }
@@ -1,48 +1,31 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.RequestTokenParseError = exports.RequestTokenError = exports.PopupClosedByUserError = exports.NoHashOrQueryParamsError = exports.GetAuthTokenFailure = void 0;
9
-
10
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
11
-
8
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
-
10
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
-
16
13
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
17
-
18
14
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
19
-
20
15
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
21
-
22
16
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
23
-
24
17
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
25
-
26
- function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
27
-
18
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
28
19
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
29
-
30
20
  function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
31
-
32
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
-
34
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
35
-
21
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
36
23
  var RequestTokenError = /*#__PURE__*/function (_Error) {
37
24
  _inherits(RequestTokenError, _Error);
38
-
39
25
  var _super = _createSuper(RequestTokenError);
40
-
41
26
  function RequestTokenError(error) {
42
27
  var _this;
43
-
44
28
  _classCallCheck(this, RequestTokenError);
45
-
46
29
  _this = _super.call(this);
47
30
  _this.message = 'Unable to retrieve OAuth Token';
48
31
  _this.name = 'Fatal Error';
@@ -50,22 +33,15 @@ var RequestTokenError = /*#__PURE__*/function (_Error) {
50
33
  _this.error = error;
51
34
  return _this;
52
35
  }
53
-
54
36
  return _createClass(RequestTokenError);
55
37
  }( /*#__PURE__*/_wrapNativeSuper(Error));
56
-
57
38
  exports.RequestTokenError = RequestTokenError;
58
-
59
39
  var RequestTokenParseError = /*#__PURE__*/function (_Error2) {
60
40
  _inherits(RequestTokenParseError, _Error2);
61
-
62
41
  var _super2 = _createSuper(RequestTokenParseError);
63
-
64
42
  function RequestTokenParseError(error) {
65
43
  var _this2;
66
-
67
44
  _classCallCheck(this, RequestTokenParseError);
68
-
69
45
  _this2 = _super2.call(this);
70
46
  _this2.message = 'Unable to parse JSON from response';
71
47
  _this2.name = 'Fatal Error';
@@ -73,44 +49,30 @@ var RequestTokenParseError = /*#__PURE__*/function (_Error2) {
73
49
  _this2.error = error;
74
50
  return _this2;
75
51
  }
76
-
77
52
  return _createClass(RequestTokenParseError);
78
53
  }( /*#__PURE__*/_wrapNativeSuper(Error));
79
-
80
54
  exports.RequestTokenParseError = RequestTokenParseError;
81
-
82
55
  var PopupClosedByUserError = /*#__PURE__*/function (_Error3) {
83
56
  _inherits(PopupClosedByUserError, _Error3);
84
-
85
57
  var _super3 = _createSuper(PopupClosedByUserError);
86
-
87
58
  function PopupClosedByUserError() {
88
59
  var _this3;
89
-
90
60
  _classCallCheck(this, PopupClosedByUserError);
91
-
92
61
  _this3 = _super3.call(this);
93
62
  _this3.message = 'Popup has been closed by user';
94
63
  _this3.name = 'Info';
95
64
  _this3.stack = '';
96
65
  return _this3;
97
66
  }
98
-
99
67
  return _createClass(PopupClosedByUserError);
100
68
  }( /*#__PURE__*/_wrapNativeSuper(Error));
101
-
102
69
  exports.PopupClosedByUserError = PopupClosedByUserError;
103
-
104
70
  var GetAuthTokenFailure = /*#__PURE__*/function (_Error4) {
105
71
  _inherits(GetAuthTokenFailure, _Error4);
106
-
107
72
  var _super4 = _createSuper(GetAuthTokenFailure);
108
-
109
73
  function GetAuthTokenFailure(error, url, verifier, token) {
110
74
  var _this4;
111
-
112
75
  _classCallCheck(this, GetAuthTokenFailure);
113
-
114
76
  _this4 = _super4.call(this);
115
77
  _this4.message = "Unable to retrieve Authorization Token from ".concat(url, "\n OAuth Verifier: ").concat(verifier, " \n OAuth Token: ").concat(token, " ");
116
78
  _this4.name = 'Fatal Error';
@@ -118,30 +80,21 @@ var GetAuthTokenFailure = /*#__PURE__*/function (_Error4) {
118
80
  _this4.error = error;
119
81
  return _this4;
120
82
  }
121
-
122
83
  return _createClass(GetAuthTokenFailure);
123
84
  }( /*#__PURE__*/_wrapNativeSuper(Error));
124
-
125
85
  exports.GetAuthTokenFailure = GetAuthTokenFailure;
126
-
127
86
  var NoHashOrQueryParamsError = /*#__PURE__*/function (_Error5) {
128
87
  _inherits(NoHashOrQueryParamsError, _Error5);
129
-
130
88
  var _super5 = _createSuper(NoHashOrQueryParamsError);
131
-
132
89
  function NoHashOrQueryParamsError() {
133
90
  var _this5;
134
-
135
91
  _classCallCheck(this, NoHashOrQueryParamsError);
136
-
137
92
  _this5 = _super5.call(this);
138
93
  _this5.message = "OAuth redirect has occurred but no query or hash parameters were found.\n They were either not set during the redirect, or were removed\u2014typically by a\n routing library\u2014before Twitter react component could read it.";
139
94
  _this5.name = 'Fatal Error';
140
95
  _this5.stack = '';
141
96
  return _this5;
142
97
  }
143
-
144
98
  return _createClass(NoHashOrQueryParamsError);
145
99
  }( /*#__PURE__*/_wrapNativeSuper(Error));
146
-
147
100
  exports.NoHashOrQueryParamsError = NoHashOrQueryParamsError;