react-twitter-widgets
Advanced tools
Comparing version 1.9.4 to 1.9.5
@@ -8,4 +8,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
import React, { useRef, useEffect, useState } from "react"; | ||
import cloneDeep from "lodash.clonedeep"; | ||
import { canUseDOM, twLoad, useDeepCompareMemoize, removeChildrenWithAttribute, twWidgetFactory } from "./utils"; | ||
import { canUseDOM, twLoad, useShallowCompareMemoize, removeChildrenWithAttribute, twWidgetFactory, cloneShallow } from "./utils"; | ||
@@ -30,3 +29,6 @@ if (canUseDOM) { | ||
}; | ||
} // Make deps for useEffect. options, and possibly primaryArg must be compared deep. | ||
} // Make deps for useEffect. | ||
// options, and possibly primaryArg, are objects that should be compared (shallow). | ||
// There currently aren't any nested arrays or objects, so they | ||
// can be cloned in a shallow manner. | ||
// NOTE onLoad is used in useCallback, but it is not listed as a dependency. | ||
@@ -38,3 +40,3 @@ // Listing it would likely cause unnecessary loads. The latest onLoad should be | ||
var deps = useDeepCompareMemoize([factoryFunctionName, primaryArg, options]); | ||
var deps = [factoryFunctionName, useShallowCompareMemoize(primaryArg), useShallowCompareMemoize(options)]; | ||
useEffect(function () { | ||
@@ -74,3 +76,3 @@ // Reset error | ||
_context.next = 11; | ||
return wf[factoryFunctionName](cloneDeep(primaryArg), childEl, cloneDeep(options)); | ||
return wf[factoryFunctionName](cloneShallow(primaryArg), childEl, cloneShallow(options)); | ||
@@ -80,3 +82,3 @@ case 11: | ||
if (resultMaybe) { | ||
if (!(!resultMaybe && !isCanceled)) { | ||
_context.next = 14; | ||
@@ -83,0 +85,0 @@ break; |
@@ -0,4 +1,5 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
import loadjs from "loadjs"; | ||
import { useRef } from "react"; | ||
import isEqual from "lodash.isequal"; | ||
var twScriptUrl = "https://platform.twitter.com/widgets.js"; | ||
@@ -41,6 +42,40 @@ var twScriptWindowFieldName = "twttr"; | ||
} | ||
export function useDeepCompareMemoize(value) { | ||
function is(x, y) { | ||
if (x === y) { | ||
return x !== 0 || y !== 0 || 1 / x === 1 / y; | ||
} else { | ||
return x !== x && y !== y; | ||
} | ||
} | ||
function isShallowEqual(objA, objB) { | ||
if (is(objA, objB)) { | ||
return true; | ||
} | ||
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { | ||
return false; | ||
} | ||
var keysA = Object.keys(objA); | ||
var keysB = Object.keys(objB); | ||
if (keysA.length !== keysB.length) { | ||
return false; | ||
} | ||
for (var i = 0; i < keysA.length; i++) { | ||
if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
export function useShallowCompareMemoize(value) { | ||
var ref = useRef(); | ||
if (!isEqual(value, ref.current)) { | ||
if (!isShallowEqual(value, ref.current)) { | ||
ref.current = value; | ||
@@ -50,2 +85,5 @@ } | ||
return ref.current; | ||
} | ||
export function cloneShallow(value) { | ||
return typeof value === "object" ? _extends({}, value) : value; | ||
} |
@@ -10,4 +10,2 @@ "use strict"; | ||
var _lodash = _interopRequireDefault(require("lodash.clonedeep")); | ||
var _utils = require("./utils"); | ||
@@ -43,3 +41,6 @@ | ||
}; | ||
} // Make deps for useEffect. options, and possibly primaryArg must be compared deep. | ||
} // Make deps for useEffect. | ||
// options, and possibly primaryArg, are objects that should be compared (shallow). | ||
// There currently aren't any nested arrays or objects, so they | ||
// can be cloned in a shallow manner. | ||
// NOTE onLoad is used in useCallback, but it is not listed as a dependency. | ||
@@ -51,3 +52,3 @@ // Listing it would likely cause unnecessary loads. The latest onLoad should be | ||
var deps = (0, _utils.useDeepCompareMemoize)([factoryFunctionName, primaryArg, options]); | ||
var deps = [factoryFunctionName, (0, _utils.useShallowCompareMemoize)(primaryArg), (0, _utils.useShallowCompareMemoize)(options)]; | ||
(0, _react.useEffect)(function () { | ||
@@ -87,3 +88,3 @@ // Reset error | ||
_context.next = 11; | ||
return wf[factoryFunctionName]((0, _lodash["default"])(primaryArg), childEl, (0, _lodash["default"])(options)); | ||
return wf[factoryFunctionName]((0, _utils.cloneShallow)(primaryArg), childEl, (0, _utils.cloneShallow)(options)); | ||
@@ -93,3 +94,3 @@ case 11: | ||
if (resultMaybe) { | ||
if (!(!resultMaybe && !isCanceled)) { | ||
_context.next = 14; | ||
@@ -96,0 +97,0 @@ break; |
@@ -7,3 +7,4 @@ "use strict"; | ||
exports.removeChildrenWithAttribute = removeChildrenWithAttribute; | ||
exports.useDeepCompareMemoize = useDeepCompareMemoize; | ||
exports.useShallowCompareMemoize = useShallowCompareMemoize; | ||
exports.cloneShallow = cloneShallow; | ||
exports.canUseDOM = void 0; | ||
@@ -15,6 +16,6 @@ | ||
var _lodash = _interopRequireDefault(require("lodash.isequal")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var twScriptUrl = "https://platform.twitter.com/widgets.js"; | ||
@@ -62,6 +63,39 @@ var twScriptWindowFieldName = "twttr"; | ||
function useDeepCompareMemoize(value) { | ||
function is(x, y) { | ||
if (x === y) { | ||
return x !== 0 || y !== 0 || 1 / x === 1 / y; | ||
} else { | ||
return x !== x && y !== y; | ||
} | ||
} | ||
function isShallowEqual(objA, objB) { | ||
if (is(objA, objB)) { | ||
return true; | ||
} | ||
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { | ||
return false; | ||
} | ||
var keysA = Object.keys(objA); | ||
var keysB = Object.keys(objB); | ||
if (keysA.length !== keysB.length) { | ||
return false; | ||
} | ||
for (var i = 0; i < keysA.length; i++) { | ||
if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
function useShallowCompareMemoize(value) { | ||
var ref = (0, _react.useRef)(); | ||
if (!(0, _lodash["default"])(value, ref.current)) { | ||
if (!isShallowEqual(value, ref.current)) { | ||
ref.current = value; | ||
@@ -71,2 +105,6 @@ } | ||
return ref.current; | ||
} | ||
function cloneShallow(value) { | ||
return typeof value === "object" ? _extends({}, value) : value; | ||
} |
{ | ||
"name": "react-twitter-widgets", | ||
"version": "1.9.4", | ||
"version": "1.9.5", | ||
"description": "Twitter widgets as React components", | ||
@@ -21,5 +21,3 @@ "author": "Andrew Suzuki", | ||
"dependencies": { | ||
"loadjs": "^4.2.0", | ||
"lodash.clonedeep": "^4.5.0", | ||
"lodash.isequal": "^4.5.0" | ||
"loadjs": "^4.2.0" | ||
}, | ||
@@ -26,0 +24,0 @@ "devDependencies": { |
@@ -15,3 +15,3 @@ # react-twitter-widgets | ||
**[Storybook / Live Demo](https://andrewsuzuki.github.io/react-twitter-widgets/?)** | ||
**[Storybook / Live Demo](https://andrewsuzuki.github.io/react-twitter-widgets/)** | ||
@@ -38,4 +38,2 @@ ## Installation | ||
}} | ||
// Optional | ||
// onLoad={() => console.log('Timeline is loaded!')} | ||
/> | ||
@@ -49,3 +47,3 @@ | ||
[**Official Twitter Documentation**](https://developer.twitter.com/en/docs/twitter-for-websites/javascript-api/guides/scripting-factory-functions) | ||
[**🔗 Official Twitter Documentation**](https://developer.twitter.com/en/docs/twitter-for-websites/javascript-api/guides/scripting-factory-functions) | ||
@@ -72,3 +70,3 @@ Available widgets: `Timeline`, `Share`, `Follow`, `Hashtag`, `Mention`, `Tweet` | ||
- `options` (object) | ||
- To learn more about the available options (height, width, align, count, etc), refer to the Twitter documentation. | ||
- To learn more about the available options, refer to the Twitter documentation. There are four options that are common to all widgets (`lang`, `dnt`, `related`, and `via`). There are further options for button widgets, tweet buttons, Timeline, and Tweet. | ||
- `onLoad` (function) | ||
@@ -75,0 +73,0 @@ - Called every time the widget is loaded. A widget will reload if its props change. |
/*! | ||
* react-twitter-widgets v1.9.4 - https://github.com/andrewsuzuki/react-twitter-widgets | ||
* react-twitter-widgets v1.9.5 - https://github.com/andrewsuzuki/react-twitter-widgets | ||
* MIT Licensed | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactTwitterWidgets=e(require("react")):t.ReactTwitterWidgets=e(t.React)}(window,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(e,r){e.exports=t},function(t,e,r){t.exports=r(8)},function(t,e,r){(function(t,r){var n="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",a="[object Map]",c="[object Set]",u=/\w*$/,f=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,l={};l[n]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object DataView]"]=l["[object Boolean]"]=l["[object Date]"]=l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l[a]=l["[object Number]"]=l["[object Object]"]=l["[object RegExp]"]=l[c]=l["[object String]"]=l["[object Symbol]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l["[object Error]"]=l[o]=l["[object WeakMap]"]=!1;var h="object"==typeof t&&t&&t.Object===Object&&t,p="object"==typeof self&&self&&self.Object===Object&&self,d=h||p||Function("return this")(),v=e&&!e.nodeType&&e,y=v&&"object"==typeof r&&r&&!r.nodeType&&r,_=y&&y.exports===v;function b(t,e){return t.set(e[0],e[1]),t}function g(t,e){return t.add(e),t}function j(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function w(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function m(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function O(t,e){return function(r){return t(e(r))}}function x(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var A,E=Array.prototype,L=Function.prototype,S=Object.prototype,P=d["__core-js_shared__"],k=(A=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",z=L.toString,F=S.hasOwnProperty,T=S.toString,I=RegExp("^"+z.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),B=_?d.Buffer:void 0,M=d.Symbol,$=d.Uint8Array,R=O(Object.getPrototypeOf,Object),D=Object.create,U=S.propertyIsEnumerable,N=E.splice,G=Object.getOwnPropertySymbols,V=B?B.isBuffer:void 0,W=O(Object.keys,Object),C=yt(d,"DataView"),q=yt(d,"Map"),H=yt(d,"Promise"),Y=yt(d,"Set"),J=yt(d,"WeakMap"),K=yt(Object,"create"),Q=wt(C),X=wt(q),Z=wt(H),tt=wt(Y),et=wt(J),rt=M?M.prototype:void 0,nt=rt?rt.valueOf:void 0;function ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function it(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function at(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ct(t){this.__data__=new it(t)}function ut(t,e){var r=Ot(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&xt(t)}(t)&&F.call(t,"callee")&&(!U.call(t,"callee")||T.call(t)==n)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],o=r.length,i=!!o;for(var a in t)!e&&!F.call(t,a)||i&&("length"==a||gt(a,o))||r.push(a);return r}function ft(t,e,r){var n=t[e];F.call(t,e)&&mt(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function st(t,e){for(var r=t.length;r--;)if(mt(t[r][0],e))return r;return-1}function lt(t,e,r,f,s,h,p){var d;if(f&&(d=h?f(t,s,h,p):f(t)),void 0!==d)return d;if(!Lt(t))return t;var v=Ot(t);if(v){if(d=function(t){var e=t.length,r=t.constructor(e);e&&"string"==typeof t[0]&&F.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!e)return function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(t,d)}else{var y=bt(t),_=y==o||y==i;if(At(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if("[object Object]"==y||y==n||_&&!h){if(w(t))return h?t:{};if(d=function(t){return"function"!=typeof t.constructor||jt(t)?{}:(e=R(t),Lt(e)?D(e):{});var e}(_?{}:t),!e)return function(t,e){return dt(t,_t(t),e)}(t,function(t,e){return t&&dt(e,St(e),t)}(d,t))}else{if(!l[y])return h?t:{};d=function(t,e,r,n){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return pt(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return function(t,e){var r=e?pt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t,e){var r=e?pt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case a:return function(t,e,r){return j(e?r(m(t),!0):m(t),b,new t.constructor)}(t,n,r);case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,u.exec(t));return e.lastIndex=t.lastIndex,e}(t);case c:return function(t,e,r){return j(e?r(x(t),!0):x(t),g,new t.constructor)}(t,n,r);case"[object Symbol]":return i=t,nt?Object(nt.call(i)):{}}var i}(t,y,lt,e)}}p||(p=new ct);var O=p.get(t);if(O)return O;if(p.set(t,d),!v)var A=r?function(t){return function(t,e,r){var n=e(t);return Ot(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,St,_t)}(t):St(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r,t););}(A||t,(function(n,o){A&&(n=t[o=n]),ft(d,o,lt(n,e,r,f,o,t,p))})),d}function ht(t){return!(!Lt(t)||(e=t,k&&k in e))&&(Et(t)||w(t)?I:f).test(wt(t));var e}function pt(t){var e=new t.constructor(t.byteLength);return new $(e).set(new $(t)),e}function dt(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var a=e[o],c=n?n(r[a],t[a],a,r,t):void 0;ft(r,a,void 0===c?t[a]:c)}return r}function vt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function yt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return ht(r)?r:void 0}ot.prototype.clear=function(){this.__data__=K?K(null):{}},ot.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},ot.prototype.get=function(t){var e=this.__data__;if(K){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return F.call(e,t)?e[t]:void 0},ot.prototype.has=function(t){var e=this.__data__;return K?void 0!==e[t]:F.call(e,t)},ot.prototype.set=function(t,e){return this.__data__[t]=K&&void 0===e?"__lodash_hash_undefined__":e,this},it.prototype.clear=function(){this.__data__=[]},it.prototype.delete=function(t){var e=this.__data__,r=st(e,t);return!(r<0)&&(r==e.length-1?e.pop():N.call(e,r,1),!0)},it.prototype.get=function(t){var e=this.__data__,r=st(e,t);return r<0?void 0:e[r][1]},it.prototype.has=function(t){return st(this.__data__,t)>-1},it.prototype.set=function(t,e){var r=this.__data__,n=st(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},at.prototype.clear=function(){this.__data__={hash:new ot,map:new(q||it),string:new ot}},at.prototype.delete=function(t){return vt(this,t).delete(t)},at.prototype.get=function(t){return vt(this,t).get(t)},at.prototype.has=function(t){return vt(this,t).has(t)},at.prototype.set=function(t,e){return vt(this,t).set(t,e),this},ct.prototype.clear=function(){this.__data__=new it},ct.prototype.delete=function(t){return this.__data__.delete(t)},ct.prototype.get=function(t){return this.__data__.get(t)},ct.prototype.has=function(t){return this.__data__.has(t)},ct.prototype.set=function(t,e){var r=this.__data__;if(r instanceof it){var n=r.__data__;if(!q||n.length<199)return n.push([t,e]),this;r=this.__data__=new at(n)}return r.set(t,e),this};var _t=G?O(G,Object):function(){return[]},bt=function(t){return T.call(t)};function gt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||s.test(t))&&t>-1&&t%1==0&&t<e}function jt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||S)}function wt(t){if(null!=t){try{return z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function mt(t,e){return t===e||t!=t&&e!=e}(C&&"[object DataView]"!=bt(new C(new ArrayBuffer(1)))||q&&bt(new q)!=a||H&&"[object Promise]"!=bt(H.resolve())||Y&&bt(new Y)!=c||J&&"[object WeakMap]"!=bt(new J))&&(bt=function(t){var e=T.call(t),r="[object Object]"==e?t.constructor:void 0,n=r?wt(r):void 0;if(n)switch(n){case Q:return"[object DataView]";case X:return a;case Z:return"[object Promise]";case tt:return c;case et:return"[object WeakMap]"}return e});var Ot=Array.isArray;function xt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!Et(t)}var At=V||function(){return!1};function Et(t){var e=Lt(t)?T.call(t):"";return e==o||e==i}function Lt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function St(t){return xt(t)?ut(t):function(t){if(!jt(t))return W(t);var e=[];for(var r in Object(t))F.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}r.exports=function(t){return lt(t,!0,!0)}}).call(this,r(4),r(5)(t))},function(t,e,r){var n,o,i;o=[],void 0===(i="function"==typeof(n=function(){var t=function(){},e={},r={},n={};function o(t,e){if(t){var o=n[t];if(r[t]=e,o)for(;o.length;)o[0](t,e),o.splice(0,1)}}function i(e,r){e.call&&(e={success:e}),r.length?(e.error||t)(r):(e.success||t)(e)}function a(e,r,n,o){var i,c,u=document,f=n.async,s=(n.numRetries||0)+1,l=n.before||t,h=e.replace(/[\?|#].*$/,""),p=e.replace(/^(css|img)!/,"");o=o||0,/(^css!|\.css$)/.test(h)?((c=u.createElement("link")).rel="stylesheet",c.href=p,(i="hideFocus"in c)&&c.relList&&(i=0,c.rel="preload",c.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(h)?(c=u.createElement("img")).src=p:((c=u.createElement("script")).src=e,c.async=void 0===f||f),c.onload=c.onerror=c.onbeforeload=function(t){var u=t.type[0];if(i)try{c.sheet.cssText.length||(u="e")}catch(t){18!=t.code&&(u="e")}if("e"==u){if((o+=1)<s)return a(e,r,n,o)}else if("preload"==c.rel&&"style"==c.as)return c.rel="stylesheet";r(e,u,t.defaultPrevented)},!1!==l(e,c)&&u.head.appendChild(c)}function c(t,r,n){var c,u;if(r&&r.trim&&(c=r),u=(c?n:r)||{},c){if(c in e)throw"LoadJS";e[c]=!0}function f(e,r){!function(t,e,r){var n,o,i=(t=t.push?t:[t]).length,c=i,u=[];for(n=function(t,r,n){if("e"==r&&u.push(t),"b"==r){if(!n)return;u.push(t)}--i||e(u)},o=0;o<c;o++)a(t[o],n,r)}(t,(function(t){i(u,t),e&&i({success:e,error:r},t),o(c,t)}),u)}if(u.returnPromise)return new Promise(f);f()}return c.ready=function(t,e){return function(t,e){t=t.push?t:[t];var o,i,a,c=[],u=t.length,f=u;for(o=function(t,r){r.length&&c.push(t),--f||e(c)};u--;)i=t[u],(a=r[i])?o(i,a):(n[i]=n[i]||[]).push(o)}(t,(function(t){i(e,t)})),c},c.done=function(t){o(t,[])},c.reset=function(){e={},r={},n={}},c.isDefined=function(t){return t in e},c})?n.apply(e,o):n)||(t.exports=i)},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){(function(t,r){var n="[object Arguments]",o="[object Map]",i="[object Object]",a="[object Set]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f[n]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f["[object Function]"]=f[o]=f["[object Number]"]=f[i]=f["[object RegExp]"]=f[a]=f["[object String]"]=f["[object WeakMap]"]=!1;var s="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,h=s||l||Function("return this")(),p=e&&!e.nodeType&&e,d=p&&"object"==typeof r&&r&&!r.nodeType&&r,v=d&&d.exports===p,y=v&&s.process,_=function(){try{return y&&y.binding&&y.binding("util")}catch(t){}}(),b=_&&_.isTypedArray;function g(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function j(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function w(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var m,O,x,A=Array.prototype,E=Function.prototype,L=Object.prototype,S=h["__core-js_shared__"],P=E.toString,k=L.hasOwnProperty,z=(m=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+m:"",F=L.toString,T=RegExp("^"+P.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=v?h.Buffer:void 0,B=h.Symbol,M=h.Uint8Array,$=L.propertyIsEnumerable,R=A.splice,D=B?B.toStringTag:void 0,U=Object.getOwnPropertySymbols,N=I?I.isBuffer:void 0,G=(O=Object.keys,x=Object,function(t){return O(x(t))}),V=_t(h,"DataView"),W=_t(h,"Map"),C=_t(h,"Promise"),q=_t(h,"Set"),H=_t(h,"WeakMap"),Y=_t(Object,"create"),J=wt(V),K=wt(W),Q=wt(C),X=wt(q),Z=wt(H),tt=B?B.prototype:void 0,et=tt?tt.valueOf:void 0;function rt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function nt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ot(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function it(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ot;++e<r;)this.add(t[e])}function at(t){var e=this.__data__=new nt(t);this.size=e.size}function ct(t,e){var r=xt(t),n=!r&&Ot(t),o=!r&&!n&&At(t),i=!r&&!n&&!o&&kt(t),a=r||n||o||i,c=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],u=c.length;for(var f in t)!e&&!k.call(t,f)||a&&("length"==f||o&&("offset"==f||"parent"==f)||i&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||jt(f,u))||c.push(f);return c}function ut(t,e){for(var r=t.length;r--;)if(mt(t[r][0],e))return r;return-1}function ft(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":D&&D in Object(t)?function(t){var e=k.call(t,D),r=t[D];try{t[D]=void 0;var n=!0}catch(t){}var o=F.call(t);n&&(e?t[D]=r:delete t[D]);return o}(t):function(t){return F.call(t)}(t)}function st(t){return Pt(t)&&ft(t)==n}function lt(t,e,r,c,u){return t===e||(null==t||null==e||!Pt(t)&&!Pt(e)?t!=t&&e!=e:function(t,e,r,c,u,f){var s=xt(t),l=xt(e),h=s?"[object Array]":gt(t),p=l?"[object Array]":gt(e),d=(h=h==n?i:h)==i,v=(p=p==n?i:p)==i,y=h==p;if(y&&At(t)){if(!At(e))return!1;s=!0,d=!1}if(y&&!d)return f||(f=new at),s||kt(t)?dt(t,e,r,c,u,f):function(t,e,r,n,i,c,u){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!c(new M(t),new M(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return mt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case o:var f=j;case a:var s=1&n;if(f||(f=w),t.size!=e.size&&!s)return!1;var l=u.get(t);if(l)return l==e;n|=2,u.set(t,e);var h=dt(f(t),f(e),n,i,c,u);return u.delete(t),h;case"[object Symbol]":if(et)return et.call(t)==et.call(e)}return!1}(t,e,h,r,c,u,f);if(!(1&r)){var _=d&&k.call(t,"__wrapped__"),b=v&&k.call(e,"__wrapped__");if(_||b){var g=_?t.value():t,m=b?e.value():e;return f||(f=new at),u(g,m,r,c,f)}}if(!y)return!1;return f||(f=new at),function(t,e,r,n,o,i){var a=1&r,c=vt(t),u=c.length,f=vt(e).length;if(u!=f&&!a)return!1;var s=u;for(;s--;){var l=c[s];if(!(a?l in e:k.call(e,l)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var p=!0;i.set(t,e),i.set(e,t);var d=a;for(;++s<u;){l=c[s];var v=t[l],y=e[l];if(n)var _=a?n(y,v,l,e,t,i):n(v,y,l,t,e,i);if(!(void 0===_?v===y||o(v,y,r,n,i):_)){p=!1;break}d||(d="constructor"==l)}if(p&&!d){var b=t.constructor,g=e.constructor;b==g||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof g&&g instanceof g||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,r,c,u,f)}(t,e,r,c,lt,u))}function ht(t){return!(!St(t)||function(t){return!!z&&z in t}(t))&&(Et(t)?T:c).test(wt(t))}function pt(t){if(r=(e=t)&&e.constructor,n="function"==typeof r&&r.prototype||L,e!==n)return G(t);var e,r,n,o=[];for(var i in Object(t))k.call(t,i)&&"constructor"!=i&&o.push(i);return o}function dt(t,e,r,n,o,i){var a=1&r,c=t.length,u=e.length;if(c!=u&&!(a&&u>c))return!1;var f=i.get(t);if(f&&i.get(e))return f==e;var s=-1,l=!0,h=2&r?new it:void 0;for(i.set(t,e),i.set(e,t);++s<c;){var p=t[s],d=e[s];if(n)var v=a?n(d,p,s,e,t,i):n(p,d,s,t,e,i);if(void 0!==v){if(v)continue;l=!1;break}if(h){if(!g(e,(function(t,e){if(a=e,!h.has(a)&&(p===t||o(p,t,r,n,i)))return h.push(e);var a}))){l=!1;break}}else if(p!==d&&!o(p,d,r,n,i)){l=!1;break}}return i.delete(t),i.delete(e),l}function vt(t){return function(t,e,r){var n=e(t);return xt(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,zt,bt)}function yt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function _t(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return ht(r)?r:void 0}rt.prototype.clear=function(){this.__data__=Y?Y(null):{},this.size=0},rt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},rt.prototype.get=function(t){var e=this.__data__;if(Y){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return k.call(e,t)?e[t]:void 0},rt.prototype.has=function(t){var e=this.__data__;return Y?void 0!==e[t]:k.call(e,t)},rt.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Y&&void 0===e?"__lodash_hash_undefined__":e,this},nt.prototype.clear=function(){this.__data__=[],this.size=0},nt.prototype.delete=function(t){var e=this.__data__,r=ut(e,t);return!(r<0)&&(r==e.length-1?e.pop():R.call(e,r,1),--this.size,!0)},nt.prototype.get=function(t){var e=this.__data__,r=ut(e,t);return r<0?void 0:e[r][1]},nt.prototype.has=function(t){return ut(this.__data__,t)>-1},nt.prototype.set=function(t,e){var r=this.__data__,n=ut(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},ot.prototype.clear=function(){this.size=0,this.__data__={hash:new rt,map:new(W||nt),string:new rt}},ot.prototype.delete=function(t){var e=yt(this,t).delete(t);return this.size-=e?1:0,e},ot.prototype.get=function(t){return yt(this,t).get(t)},ot.prototype.has=function(t){return yt(this,t).has(t)},ot.prototype.set=function(t,e){var r=yt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},it.prototype.add=it.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},it.prototype.has=function(t){return this.__data__.has(t)},at.prototype.clear=function(){this.__data__=new nt,this.size=0},at.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},at.prototype.get=function(t){return this.__data__.get(t)},at.prototype.has=function(t){return this.__data__.has(t)},at.prototype.set=function(t,e){var r=this.__data__;if(r instanceof nt){var n=r.__data__;if(!W||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ot(n)}return r.set(t,e),this.size=r.size,this};var bt=U?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i}(U(t),(function(e){return $.call(t,e)})))}:function(){return[]},gt=ft;function jt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||u.test(t))&&t>-1&&t%1==0&&t<e}function wt(t){if(null!=t){try{return P.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function mt(t,e){return t===e||t!=t&&e!=e}(V&&"[object DataView]"!=gt(new V(new ArrayBuffer(1)))||W&>(new W)!=o||C&&"[object Promise]"!=gt(C.resolve())||q&>(new q)!=a||H&&"[object WeakMap]"!=gt(new H))&&(gt=function(t){var e=ft(t),r=e==i?t.constructor:void 0,n=r?wt(r):"";if(n)switch(n){case J:return"[object DataView]";case K:return o;case Q:return"[object Promise]";case X:return a;case Z:return"[object WeakMap]"}return e});var Ot=st(function(){return arguments}())?st:function(t){return Pt(t)&&k.call(t,"callee")&&!$.call(t,"callee")},xt=Array.isArray;var At=N||function(){return!1};function Et(t){if(!St(t))return!1;var e=ft(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function St(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var kt=b?function(t){return function(e){return t(e)}}(b):function(t){return Pt(t)&&Lt(t.length)&&!!f[ft(t)]};function zt(t){return null!=(e=t)&&Lt(e.length)&&!Et(e)?ct(t):pt(t);var e}r.exports=function(t,e){return lt(t,e)}}).call(this,r(4),r(5)(t))},function(t,e,r){t.exports=r(9)},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=e&&e.prototype instanceof s?e:s,i=Object.create(o.prototype),a=new m(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return x()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=g(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function s(){}function l(){}function h(){}var p={};p[o]=function(){return this};var d=Object.getPrototypeOf,v=d&&d(d(O([])));v&&v!==e&&r.call(v,o)&&(p=v);var y=h.prototype=s.prototype=Object.create(p);function _(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function b(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,c){var f=u(t[o],t,i);if("throw"!==f.type){var s=f.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(f.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function g(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,g(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function m(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:x}}function x(){return{value:void 0,done:!0}}return l.prototype=y.constructor=h,h.constructor=l,h[a]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},_(b.prototype),b.prototype[i]=function(){return this},t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(y),y[a]="Generator",y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,m.prototype={constructor:m,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e),r.d(e,"Follow",(function(){return y})),r.d(e,"Hashtag",(function(){return _})),r.d(e,"Mention",(function(){return b})),r.d(e,"Share",(function(){return g})),r.d(e,"Timeline",(function(){return j})),r.d(e,"Tweet",(function(){return w}));var n=r(1),o=r.n(n),i=r(0),a=r.n(i),c=r(2),u=r.n(c),f=r(3),s=r.n(f),l=r(6),h=r.n(l),p=!("undefined"==typeof window||!window.document||!window.document.createElement);function d(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}p&&s()("https://platform.twitter.com/widgets.js","twttr");function v(t,e,r,n){var a=Object(i.useState)(null),c=a[0],f=a[1],l=Object(i.useRef)(null);if(!p)return{ref:l,error:c};var v=function(t){var e=Object(i.useRef)();return h()(t,e.current)||(e.current=t),e.current}([t,e,r]);return Object(i.useEffect)((function(){f(null);var i,a,c=!1;if(l.current){var h=function(){var i,a=(i=o.a.mark((function i(){var a,h;return o.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(l&&l.current){o.next=2;break}return o.abrupt("return");case 2:return(a=document.createElement("div")).setAttribute("twdiv","yes"),l.current.appendChild(a),o.prev=5,o.next=8,new Promise((function(t,e){var r=function(){return e(new Error("Could not load remote twitter widgets js"))};s.a.ready("twttr",{success:function(){var e=window.twttr;e&&e.widgets||r(),t(e.widgets)},error:r})}));case 8:return h=o.sent,o.next=11,h[t](u()(e),a,u()(r));case 11:if(o.sent){o.next=14;break}throw new Error("Twitter could not create widget. If it is a Timeline or Tweet, ensure the screenName/tweetId exists.");case 14:o.next=21;break;case 16:return o.prev=16,o.t0=o.catch(5),console.error(o.t0),f(o.t0),o.abrupt("return");case 21:if(l&&l.current){o.next=23;break}return o.abrupt("return");case 23:if(!c){o.next=26;break}return a&&a.remove(),o.abrupt("return");case 26:n&&n();case 27:case"end":return o.stop()}}),i,null,[[5,16]])})),function(){var t=this,e=arguments;return new Promise((function(r,n){var o=i.apply(t,e);function a(t){d(o,r,n,a,c,"next",t)}function c(t){d(o,r,n,a,c,"throw",t)}a(void 0)}))});return function(){return a.apply(this,arguments)}}();i=l.current,a="twdiv",i&&i.querySelectorAll("*").forEach((function(t){t.hasAttribute(a)&&t.remove()})),h()}return function(){c=!0}}),v),{ref:l,error:c}}var y=function(t){var e=t.username,r=t.options,n=t.onLoad,o=t.renderError,i=v("createFollowButton",e,r,n),c=i.ref,u=i.error;return a.a.createElement("div",{ref:c},u&&o&&o(u))},_=function(t){var e=t.hashtag,r=t.options,n=t.onLoad,o=t.renderError,i=v("createHashtagButton",e,r,n),c=i.ref,u=i.error;return a.a.createElement("div",{ref:c},u&&o&&o(u))},b=function(t){var e=t.username,r=t.options,n=t.onLoad,o=t.renderError,i=v("createMentionButton",e,r,n),c=i.ref,u=i.error;return a.a.createElement("div",{ref:c},u&&o&&o(u))},g=function(t){var e=t.url,r=t.options,n=t.onLoad,o=t.renderError,i=v("createShareButton",e,r,n),c=i.ref,u=i.error;return a.a.createElement("div",{ref:c},u&&o&&o(u))},j=function(t){var e=t.dataSource,r=t.options,n=t.onLoad,o=t.renderError,i=v("createTimeline",e,r,n),c=i.ref,u=i.error;return a.a.createElement("div",{ref:c},u&&o&&o(u))},w=function(t){var e=t.tweetId,r=t.options,n=t.onLoad,o=t.renderError,i=v("createTweet",e,r,n),c=i.ref,u=i.error;return a.a.createElement("div",{ref:c},u&&o&&o(u))}}]).default})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactTwitterWidgets=e(require("react")):t.ReactTwitterWidgets=e(t.React)}(window,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=3)}([function(e,r){e.exports=t},function(t,e,r){t.exports=r(4)},function(t,e,r){var n,o,i;o=[],void 0===(i="function"==typeof(n=function(){var t=function(){},e={},r={},n={};function o(t,e){if(t){var o=n[t];if(r[t]=e,o)for(;o.length;)o[0](t,e),o.splice(0,1)}}function i(e,r){e.call&&(e={success:e}),r.length?(e.error||t)(r):(e.success||t)(e)}function a(e,r,n,o){var i,u,c=document,f=n.async,s=(n.numRetries||0)+1,l=n.before||t,h=e.replace(/[\?|#].*$/,""),p=e.replace(/^(css|img)!/,"");o=o||0,/(^css!|\.css$)/.test(h)?((u=c.createElement("link")).rel="stylesheet",u.href=p,(i="hideFocus"in u)&&u.relList&&(i=0,u.rel="preload",u.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(h)?(u=c.createElement("img")).src=p:((u=c.createElement("script")).src=e,u.async=void 0===f||f),u.onload=u.onerror=u.onbeforeload=function(t){var c=t.type[0];if(i)try{u.sheet.cssText.length||(c="e")}catch(t){18!=t.code&&(c="e")}if("e"==c){if((o+=1)<s)return a(e,r,n,o)}else if("preload"==u.rel&&"style"==u.as)return u.rel="stylesheet";r(e,c,t.defaultPrevented)},!1!==l(e,u)&&c.head.appendChild(u)}function u(t,r,n){var u,c;if(r&&r.trim&&(u=r),c=(u?n:r)||{},u){if(u in e)throw"LoadJS";e[u]=!0}function f(e,r){!function(t,e,r){var n,o,i=(t=t.push?t:[t]).length,u=i,c=[];for(n=function(t,r,n){if("e"==r&&c.push(t),"b"==r){if(!n)return;c.push(t)}--i||e(c)},o=0;o<u;o++)a(t[o],n,r)}(t,(function(t){i(c,t),e&&i({success:e,error:r},t),o(u,t)}),c)}if(c.returnPromise)return new Promise(f);f()}return u.ready=function(t,e){return function(t,e){t=t.push?t:[t];var o,i,a,u=[],c=t.length,f=c;for(o=function(t,r){r.length&&u.push(t),--f||e(u)};c--;)i=t[c],(a=r[i])?o(i,a):(n[i]=n[i]||[]).push(o)}(t,(function(t){i(e,t)})),u},u.done=function(t){o(t,[])},u.reset=function(){e={},r={},n={}},u.isDefined=function(t){return t in e},u})?n.apply(e,o):n)||(t.exports=i)},function(t,e,r){t.exports=r(5)},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(t,e,r,n){var o=e&&e.prototype instanceof s?e:s,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=w(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,a),i}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function s(){}function l(){}function h(){}var p={};p[o]=function(){return this};var d=Object.getPrototypeOf,v=d&&d(d(L([])));v&&v!==e&&r.call(v,o)&&(p=v);var y=h.prototype=s.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,u){var f=c(t[o],t,i);if("throw"!==f.type){var s=f.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,u)}))}u(f.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:j}}function j(){return{value:void 0,done:!0}}return l.prototype=y.constructor=h,h.constructor=l,h[a]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},m(g.prototype),g.prototype[i]=function(){return this},t.AsyncIterator=g,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new g(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(y),y[a]="Generator",y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=L,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e),r.d(e,"Follow",(function(){return y})),r.d(e,"Hashtag",(function(){return m})),r.d(e,"Mention",(function(){return g})),r.d(e,"Share",(function(){return w})),r.d(e,"Timeline",(function(){return b})),r.d(e,"Tweet",(function(){return x}));var n=r(1),o=r.n(n),i=r(0),a=r.n(i),u=r(2),c=r.n(u);function f(){return(f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}var s=!("undefined"==typeof window||!window.document||!window.document.createElement);function l(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function h(t){var e=Object(i.useRef)();return function(t,e){if(l(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=0;o<r.length;o++)if(!Object.prototype.hasOwnProperty.call(e,r[o])||!l(t[r[o]],e[r[o]]))return!1;return!0}(t,e.current)||(e.current=t),e.current}function p(t){return"object"==typeof t?f({},t):t}function d(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}s&&c()("https://platform.twitter.com/widgets.js","twttr");function v(t,e,r,n){var a=Object(i.useState)(null),u=a[0],f=a[1],l=Object(i.useRef)(null);if(!s)return{ref:l,error:u};var v=[t,h(e),h(r)];return Object(i.useEffect)((function(){f(null);var i,a,u=!1;if(l.current){var s=function(){var i,a=(i=o.a.mark((function i(){var a,s;return o.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(l&&l.current){o.next=2;break}return o.abrupt("return");case 2:return(a=document.createElement("div")).setAttribute("twdiv","yes"),l.current.appendChild(a),o.prev=5,o.next=8,new Promise((function(t,e){var r=function(){return e(new Error("Could not load remote twitter widgets js"))};c.a.ready("twttr",{success:function(){var e=window.twttr;e&&e.widgets||r(),t(e.widgets)},error:r})}));case 8:return s=o.sent,o.next=11,s[t](p(e),a,p(r));case 11:if(o.sent||u){o.next=14;break}throw new Error("Twitter could not create widget. If it is a Timeline or Tweet, ensure the screenName/tweetId exists.");case 14:o.next=21;break;case 16:return o.prev=16,o.t0=o.catch(5),console.error(o.t0),f(o.t0),o.abrupt("return");case 21:if(l&&l.current){o.next=23;break}return o.abrupt("return");case 23:if(!u){o.next=26;break}return a&&a.remove(),o.abrupt("return");case 26:n&&n();case 27:case"end":return o.stop()}}),i,null,[[5,16]])})),function(){var t=this,e=arguments;return new Promise((function(r,n){var o=i.apply(t,e);function a(t){d(o,r,n,a,u,"next",t)}function u(t){d(o,r,n,a,u,"throw",t)}a(void 0)}))});return function(){return a.apply(this,arguments)}}();i=l.current,a="twdiv",i&&i.querySelectorAll("*").forEach((function(t){t.hasAttribute(a)&&t.remove()})),s()}return function(){u=!0}}),v),{ref:l,error:u}}var y=function(t){var e=t.username,r=t.options,n=t.onLoad,o=t.renderError,i=v("createFollowButton",e,r,n),u=i.ref,c=i.error;return a.a.createElement("div",{ref:u},c&&o&&o(c))},m=function(t){var e=t.hashtag,r=t.options,n=t.onLoad,o=t.renderError,i=v("createHashtagButton",e,r,n),u=i.ref,c=i.error;return a.a.createElement("div",{ref:u},c&&o&&o(c))},g=function(t){var e=t.username,r=t.options,n=t.onLoad,o=t.renderError,i=v("createMentionButton",e,r,n),u=i.ref,c=i.error;return a.a.createElement("div",{ref:u},c&&o&&o(c))},w=function(t){var e=t.url,r=t.options,n=t.onLoad,o=t.renderError,i=v("createShareButton",e,r,n),u=i.ref,c=i.error;return a.a.createElement("div",{ref:u},c&&o&&o(c))},b=function(t){var e=t.dataSource,r=t.options,n=t.onLoad,o=t.renderError,i=v("createTimeline",e,r,n),u=i.ref,c=i.error;return a.a.createElement("div",{ref:u},c&&o&&o(c))},x=function(t){var e=t.tweetId,r=t.options,n=t.onLoad,o=t.renderError,i=v("createTweet",e,r,n),u=i.ref,c=i.error;return a.a.createElement("div",{ref:u},c&&o&&o(c))}}]).default})); | ||
//# sourceMappingURL=react-twitter-widgets.min.js.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
2
3
153687
1924
94
- Removedlodash.clonedeep@^4.5.0
- Removedlodash.isequal@^4.5.0
- Removedlodash.clonedeep@4.5.0(transitive)
- Removedlodash.isequal@4.5.0(transitive)