@hot-loader/react-dom
Advanced tools
Comparing version 16.12.0 to 16.13.0
{ | ||
"branch": "master", | ||
"buildNumber": "59518", | ||
"checksum": "6f449c4", | ||
"commit": "b53ea6ca0", | ||
"buildNumber": "91354", | ||
"checksum": "b0ed8f5", | ||
"commit": "d28bd2994", | ||
"environment": "ci", | ||
"reactVersion": "16.11.0-b53ea6ca0" | ||
"reactVersion": "16.12.0-d28bd2994" | ||
} |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-server.browser.production.min.js | ||
@@ -11,10 +11,10 @@ * | ||
'use strict';var k=require("object-assign"),l=require("react");function q(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."} | ||
var t="function"===typeof Symbol&&Symbol.for,aa=t?Symbol.for("react.portal"):60106,u=t?Symbol.for("react.fragment"):60107,ba=t?Symbol.for("react.strict_mode"):60108,ca=t?Symbol.for("react.profiler"):60114,w=t?Symbol.for("react.provider"):60109,da=t?Symbol.for("react.context"):60110,ea=t?Symbol.for("react.concurrent_mode"):60111,fa=t?Symbol.for("react.forward_ref"):60112,B=t?Symbol.for("react.suspense"):60113,ha=t?Symbol.for("react.suspense_list"):60120,ia=t?Symbol.for("react.memo"):60115,ja=t?Symbol.for("react.lazy"): | ||
60116,ka=t?Symbol.for("react.fundamental"):60117,la=t?Symbol.for("react.scope"):60119,C=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;C.hasOwnProperty("ReactCurrentDispatcher")||(C.ReactCurrentDispatcher={current:null});C.hasOwnProperty("ReactCurrentBatchConfig")||(C.ReactCurrentBatchConfig={suspense:null}); | ||
function ma(a){if(-1===a._status){a._status=0;var b=a._ctor;b=b();a._result=b;b.then(function(c){0===a._status&&(c=c.default,a._status=1,a._result=c)},function(c){0===a._status&&(a._status=2,a._result=c)})}} | ||
function D(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case u:return"Fragment";case aa:return"Portal";case ca:return"Profiler";case ba:return"StrictMode";case B:return"Suspense";case ha:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case da:return"Context.Consumer";case w:return"Context.Provider";case fa:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef"); | ||
case ia:return D(a.type);case ja:if(a=1===a._status?a._result:null)return D(a)}return null}var na={};function E(a,b){for(var c=a._threadCount|0;c<=b;c++)a[c]=a._currentValue2,a._threadCount=c+1}function oa(a,b,c,d){if(d&&(d=a.contextType,"object"===typeof d&&null!==d))return E(d,c),d[c];if(a=a.contextTypes){c={};for(var f in a)c[f]=b[f];b=c}else b=na;return b}for(var F=new Uint16Array(16),H=0;15>H;H++)F[H]=H+1;F[15]=0; | ||
var pa=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,qa=Object.prototype.hasOwnProperty,ra={},sa={}; | ||
function ta(a){if(qa.call(sa,a))return!0;if(qa.call(ra,a))return!1;if(pa.test(a))return sa[a]=!0;ra[a]=!0;return!1}function ua(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} | ||
function va(a,b,c,d){if(null===b||"undefined"===typeof b||ua(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function J(a,b,c,d,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=f;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=g}var K={}; | ||
var t="function"===typeof Symbol&&Symbol.for,aa=t?Symbol.for("react.portal"):60106,u=t?Symbol.for("react.fragment"):60107,ba=t?Symbol.for("react.strict_mode"):60108,ca=t?Symbol.for("react.profiler"):60114,v=t?Symbol.for("react.provider"):60109,da=t?Symbol.for("react.context"):60110,ea=t?Symbol.for("react.concurrent_mode"):60111,fa=t?Symbol.for("react.forward_ref"):60112,B=t?Symbol.for("react.suspense"):60113,ha=t?Symbol.for("react.suspense_list"):60120,ia=t?Symbol.for("react.memo"):60115,ja=t?Symbol.for("react.lazy"): | ||
60116,ka=t?Symbol.for("react.block"):60121,la=t?Symbol.for("react.fundamental"):60117,ma=t?Symbol.for("react.scope"):60119;function na(a){if(-1===a._status){a._status=0;var b=a._ctor;b=b();a._result=b;b.then(function(c){0===a._status&&(c=c.default,a._status=1,a._result=c)},function(c){0===a._status&&(a._status=2,a._result=c)})}} | ||
function C(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case u:return"Fragment";case aa:return"Portal";case ca:return"Profiler";case ba:return"StrictMode";case B:return"Suspense";case ha:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case da:return"Context.Consumer";case v:return"Context.Provider";case fa:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef"); | ||
case ia:return C(a.type);case ka:return C(a.render);case ja:if(a=1===a._status?a._result:null)return C(a)}return null}var D=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;D.hasOwnProperty("ReactCurrentDispatcher")||(D.ReactCurrentDispatcher={current:null});D.hasOwnProperty("ReactCurrentBatchConfig")||(D.ReactCurrentBatchConfig={suspense:null});var oa={};function E(a,b){for(var c=a._threadCount|0;c<=b;c++)a[c]=a._currentValue2,a._threadCount=c+1} | ||
function pa(a,b,c,d){if(d&&(d=a.contextType,"object"===typeof d&&null!==d))return E(d,c),d[c];if(a=a.contextTypes){c={};for(var f in a)c[f]=b[f];b=c}else b=oa;return b}for(var F=new Uint16Array(16),H=0;15>H;H++)F[H]=H+1;F[15]=0; | ||
var qa=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ra=Object.prototype.hasOwnProperty,sa={},ta={}; | ||
function ua(a){if(ra.call(ta,a))return!0;if(ra.call(sa,a))return!1;if(qa.test(a))return ta[a]=!0;sa[a]=!0;return!1}function va(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} | ||
function wa(a,b,c,d){if(null===b||"undefined"===typeof b||va(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function J(a,b,c,d,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=f;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=g}var K={}; | ||
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){K[a]=new J(a,0,!1,a,null,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];K[b]=new J(b,1,!1,a[1],null,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){K[a]=new J(a,2,!1,a.toLowerCase(),null,!1)}); | ||
@@ -25,32 +25,32 @@ ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){K[a]=new J(a,2,!1,a,null,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){K[a]=new J(a,3,!1,a.toLowerCase(),null,!1)}); | ||
M);K[b]=new J(b,1,!1,a,null,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(L,M);K[b]=new J(b,1,!1,a,"http://www.w3.org/1999/xlink",!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(L,M);K[b]=new J(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1)});["tabIndex","crossOrigin"].forEach(function(a){K[a]=new J(a,1,!1,a.toLowerCase(),null,!1)}); | ||
K.xlinkHref=new J("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){K[a]=new J(a,1,!1,a.toLowerCase(),null,!0)});var wa=/["'&<>]/; | ||
function N(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=wa.exec(a);if(b){var c="",d,f=0;for(d=b.index;d<a.length;d++){switch(a.charCodeAt(d)){case 34:b=""";break;case 38:b="&";break;case 39:b="'";break;case 60:b="<";break;case 62:b=">";break;default:continue}f!==d&&(c+=a.substring(f,d));f=d+1;c+=b}a=f!==d?c+a.substring(f,d):c}return a} | ||
function xa(a,b){var c=K.hasOwnProperty(a)?K[a]:null;var d;if(d="style"!==a)d=null!==c?0===c.type:!(2<a.length)||"o"!==a[0]&&"O"!==a[0]||"n"!==a[1]&&"N"!==a[1]?!1:!0;if(d||va(a,b,c,!1))return"";if(null!==c){a=c.attributeName;d=c.type;if(3===d||4===d&&!0===b)return a+'=""';c.sanitizeURL&&(b=""+b);return a+"="+('"'+N(b)+'"')}return ta(a)?a+"="+('"'+N(b)+'"'):""}function ya(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b} | ||
var za="function"===typeof Object.is?Object.is:ya,O=null,P=null,Q=null,R=!1,S=!1,U=null,V=0;function W(){if(null===O)throw Error(q(321));return O}function Aa(){if(0<V)throw Error(q(312));return{memoizedState:null,queue:null,next:null}}function Ba(){null===Q?null===P?(R=!1,P=Q=Aa()):(R=!0,Q=P):null===Q.next?(R=!1,Q=Q.next=Aa()):(R=!0,Q=Q.next);return Q}function Ca(a,b,c,d){for(;S;)S=!1,V+=1,Q=null,c=a(b,d);P=O=null;V=0;Q=U=null;return c}function Da(a,b){return"function"===typeof b?b(a):b} | ||
function Ea(a,b,c){O=W();Q=Ba();if(R){var d=Q.queue;b=d.dispatch;if(null!==U&&(c=U.get(d),void 0!==c)){U.delete(d);d=Q.memoizedState;do d=a(d,c.action),c=c.next;while(null!==c);Q.memoizedState=d;return[d,b]}return[Q.memoizedState,b]}a=a===Da?"function"===typeof b?b():b:void 0!==c?c(b):b;Q.memoizedState=a;a=Q.queue={last:null,dispatch:null};a=a.dispatch=Fa.bind(null,O,a);return[Q.memoizedState,a]} | ||
function Fa(a,b,c){if(!(25>V))throw Error(q(301));if(a===O)if(S=!0,a={action:c,next:null},null===U&&(U=new Map),c=U.get(b),void 0===c)U.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}}function Ga(){} | ||
var X=0,Ha={readContext:function(a){var b=X;E(a,b);return a[b]},useContext:function(a){W();var b=X;E(a,b);return a[b]},useMemo:function(a,b){O=W();Q=Ba();b=void 0===b?null:b;if(null!==Q){var c=Q.memoizedState;if(null!==c&&null!==b){a:{var d=c[1];if(null===d)d=!1;else{for(var f=0;f<d.length&&f<b.length;f++)if(!za(b[f],d[f])){d=!1;break a}d=!0}}if(d)return c[0]}}a=a();Q.memoizedState=[a,b];return a},useReducer:Ea,useRef:function(a){O=W();Q=Ba();var b=Q.memoizedState;return null===b?(a={current:a},Q.memoizedState= | ||
a):b},useState:function(a){return Ea(Da,a)},useLayoutEffect:function(){},useCallback:function(a){return a},useImperativeHandle:Ga,useEffect:Ga,useDebugValue:Ga,useResponder:function(a,b){return{props:b,responder:a}},useDeferredValue:function(a){W();return a},useTransition:function(){W();return[function(a){a()},!1]}},Ia={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; | ||
function Ja(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}} | ||
var Ka={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},La=k({menuitem:!0},Ka),Y={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0, | ||
gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ma=["Webkit","ms","Moz","O"];Object.keys(Y).forEach(function(a){Ma.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);Y[b]=Y[a]})}); | ||
var Na=/([A-Z])/g,Oa=/^ms-/,Z=l.Children.toArray,Pa=C.ReactCurrentDispatcher,Qa={listing:!0,pre:!0,textarea:!0},Ra=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Sa={},Ta={};function Ua(a){if(void 0===a||null===a)return a;var b="";l.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}var Va=Object.prototype.hasOwnProperty,Wa={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function Xa(a,b){if(void 0===a)throw Error(q(152,D(b)||"Component"));} | ||
function Ya(a,b,c){function d(d,g){var e=g.prototype&&g.prototype.isReactComponent,f=oa(g,b,c,e),x=[],h=!1,m={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===x)return null},enqueueReplaceState:function(a,c){h=!0;x=[c]},enqueueSetState:function(a,c){if(null===x)return null;x.push(c)}};if(e){if(e=new g(d.props,f,m),"function"===typeof g.getDerivedStateFromProps){var v=g.getDerivedStateFromProps.call(null,d.props,e.state);null!=v&&(e.state=k({},e.state,v))}}else if(O={},e=g(d.props, | ||
f,m),e=Ca(g,d.props,e,f),null==e||null==e.render){a=e;Xa(a,g);return}e.props=d.props;e.context=f;e.updater=m;m=e.state;void 0===m&&(e.state=m=null);if("function"===typeof e.UNSAFE_componentWillMount||"function"===typeof e.componentWillMount)if("function"===typeof e.componentWillMount&&"function"!==typeof g.getDerivedStateFromProps&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&"function"!==typeof g.getDerivedStateFromProps&&e.UNSAFE_componentWillMount(),x.length){m=x;var r= | ||
h;x=null;h=!1;if(r&&1===m.length)e.state=m[0];else{v=r?m[0]:e.state;var y=!0;for(r=r?1:0;r<m.length;r++){var p=m[r];p="function"===typeof p?p.call(e,v,d.props,f):p;null!=p&&(y?(y=!1,v=k({},v,p)):k(v,p))}e.state=v}}else x=null;a=e.render();Xa(a,g);if("function"===typeof e.getChildContext&&(d=g.childContextTypes,"object"===typeof d)){var A=e.getChildContext();for(var T in A)if(!(T in d))throw Error(q(108,D(g)||"Unknown",T));}A&&(b=k({},b,A))}for(;l.isValidElement(a);){var f=a,g=f.type;if("function"!== | ||
K.xlinkHref=new J("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){K[a]=new J(a,1,!1,a.toLowerCase(),null,!0)});var xa=/["'&<>]/; | ||
function N(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=xa.exec(a);if(b){var c="",d,f=0;for(d=b.index;d<a.length;d++){switch(a.charCodeAt(d)){case 34:b=""";break;case 38:b="&";break;case 39:b="'";break;case 60:b="<";break;case 62:b=">";break;default:continue}f!==d&&(c+=a.substring(f,d));f=d+1;c+=b}a=f!==d?c+a.substring(f,d):c}return a} | ||
function ya(a,b){var c=K.hasOwnProperty(a)?K[a]:null;var d;if(d="style"!==a)d=null!==c?0===c.type:!(2<a.length)||"o"!==a[0]&&"O"!==a[0]||"n"!==a[1]&&"N"!==a[1]?!1:!0;if(d||wa(a,b,c,!1))return"";if(null!==c){a=c.attributeName;d=c.type;if(3===d||4===d&&!0===b)return a+'=""';c.sanitizeURL&&(b=""+b);return a+'="'+(N(b)+'"')}return ua(a)?a+'="'+(N(b)+'"'):""}function za(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b} | ||
var Aa="function"===typeof Object.is?Object.is:za,O=null,P=null,Q=null,R=!1,S=!1,U=null,V=0;function W(){if(null===O)throw Error(q(321));return O}function Ba(){if(0<V)throw Error(q(312));return{memoizedState:null,queue:null,next:null}}function Ca(){null===Q?null===P?(R=!1,P=Q=Ba()):(R=!0,Q=P):null===Q.next?(R=!1,Q=Q.next=Ba()):(R=!0,Q=Q.next);return Q}function Da(a,b,c,d){for(;S;)S=!1,V+=1,Q=null,c=a(b,d);P=O=null;V=0;Q=U=null;return c}function Ea(a,b){return"function"===typeof b?b(a):b} | ||
function Fa(a,b,c){O=W();Q=Ca();if(R){var d=Q.queue;b=d.dispatch;if(null!==U&&(c=U.get(d),void 0!==c)){U.delete(d);d=Q.memoizedState;do d=a(d,c.action),c=c.next;while(null!==c);Q.memoizedState=d;return[d,b]}return[Q.memoizedState,b]}a=a===Ea?"function"===typeof b?b():b:void 0!==c?c(b):b;Q.memoizedState=a;a=Q.queue={last:null,dispatch:null};a=a.dispatch=Ga.bind(null,O,a);return[Q.memoizedState,a]} | ||
function Ga(a,b,c){if(!(25>V))throw Error(q(301));if(a===O)if(S=!0,a={action:c,next:null},null===U&&(U=new Map),c=U.get(b),void 0===c)U.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}}function Ha(){} | ||
var X=0,Ia={readContext:function(a){var b=X;E(a,b);return a[b]},useContext:function(a){W();var b=X;E(a,b);return a[b]},useMemo:function(a,b){O=W();Q=Ca();b=void 0===b?null:b;if(null!==Q){var c=Q.memoizedState;if(null!==c&&null!==b){a:{var d=c[1];if(null===d)d=!1;else{for(var f=0;f<d.length&&f<b.length;f++)if(!Aa(b[f],d[f])){d=!1;break a}d=!0}}if(d)return c[0]}}a=a();Q.memoizedState=[a,b];return a},useReducer:Fa,useRef:function(a){O=W();Q=Ca();var b=Q.memoizedState;return null===b?(a={current:a},Q.memoizedState= | ||
a):b},useState:function(a){return Fa(Ea,a)},useLayoutEffect:function(){},useCallback:function(a){return a},useImperativeHandle:Ha,useEffect:Ha,useDebugValue:Ha,useResponder:function(a,b){return{props:b,responder:a}},useDeferredValue:function(a){W();return a},useTransition:function(){W();return[function(a){a()},!1]}},Ja={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; | ||
function Ka(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}} | ||
var La={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Ma=k({menuitem:!0},La),Y={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0, | ||
gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Na=["Webkit","ms","Moz","O"];Object.keys(Y).forEach(function(a){Na.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);Y[b]=Y[a]})}); | ||
var Oa=/([A-Z])/g,Pa=/^ms-/,Z=l.Children.toArray,Qa=D.ReactCurrentDispatcher,Ra={listing:!0,pre:!0,textarea:!0},Sa=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Ta={},Ua={};function Va(a){if(void 0===a||null===a)return a;var b="";l.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}var Wa=Object.prototype.hasOwnProperty,Xa={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function Ya(a,b){if(void 0===a)throw Error(q(152,C(b)||"Component"));} | ||
function Za(a,b,c){function d(d,g){var e=g.prototype&&g.prototype.isReactComponent,f=pa(g,b,c,e),x=[],h=!1,m={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===x)return null},enqueueReplaceState:function(a,c){h=!0;x=[c]},enqueueSetState:function(a,c){if(null===x)return null;x.push(c)}};if(e){if(e=new g(d.props,f,m),"function"===typeof g.getDerivedStateFromProps){var w=g.getDerivedStateFromProps.call(null,d.props,e.state);null!=w&&(e.state=k({},e.state,w))}}else if(O={},e=g(d.props, | ||
f,m),e=Da(g,d.props,e,f),null==e||null==e.render){a=e;Ya(a,g);return}e.props=d.props;e.context=f;e.updater=m;m=e.state;void 0===m&&(e.state=m=null);if("function"===typeof e.UNSAFE_componentWillMount||"function"===typeof e.componentWillMount)if("function"===typeof e.componentWillMount&&"function"!==typeof g.getDerivedStateFromProps&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&"function"!==typeof g.getDerivedStateFromProps&&e.UNSAFE_componentWillMount(),x.length){m=x;var r= | ||
h;x=null;h=!1;if(r&&1===m.length)e.state=m[0];else{w=r?m[0]:e.state;var y=!0;for(r=r?1:0;r<m.length;r++){var p=m[r];p="function"===typeof p?p.call(e,w,d.props,f):p;null!=p&&(y?(y=!1,w=k({},w,p)):k(w,p))}e.state=w}}else x=null;a=e.render();Ya(a,g);if("function"===typeof e.getChildContext&&(d=g.childContextTypes,"object"===typeof d)){var A=e.getChildContext();for(var T in A)if(!(T in d))throw Error(q(108,C(g)||"Unknown",T));}A&&(b=k({},b,A))}for(;l.isValidElement(a);){var f=a,g=f.type;if("function"!== | ||
typeof g)break;d(f,g)}return{child:a,context:b}} | ||
var Za=function(){function a(a,b){l.isValidElement(a)?a.type!==u?a=[a]:(a=a.props.children,a=l.isValidElement(a)?[a]:Z(a)):a=Z(a);a={type:null,domNamespace:Ia.html,children:a,childIndex:0,context:na,footer:""};var c=F[0];if(0===c){var g=F;c=g.length;var d=2*c;if(!(65536>=d))throw Error(q(304));var h=new Uint16Array(d);h.set(g);F=h;F[0]=c+1;for(g=c;g<d-1;g++)F[g]=g+1;F[d-1]=0}else F[0]=F[c];this.threadID=c;this.stack=[a];this.exhausted=!1;this.currentSelectValue=null;this.previousWasTextNode=!1;this.makeStaticMarkup= | ||
var $a=function(){function a(a,b){l.isValidElement(a)?a.type!==u?a=[a]:(a=a.props.children,a=l.isValidElement(a)?[a]:Z(a)):a=Z(a);a={type:null,domNamespace:Ja.html,children:a,childIndex:0,context:oa,footer:""};var c=F[0];if(0===c){var g=F;c=g.length;var d=2*c;if(!(65536>=d))throw Error(q(304));var h=new Uint16Array(d);h.set(g);F=h;F[0]=c+1;for(g=c;g<d-1;g++)F[g]=g+1;F[d-1]=0}else F[0]=F[c];this.threadID=c;this.stack=[a];this.exhausted=!1;this.currentSelectValue=null;this.previousWasTextNode=!1;this.makeStaticMarkup= | ||
b;this.suspenseDepth=0;this.contextIndex=-1;this.contextStack=[];this.contextValueStack=[]}var b=a.prototype;b.destroy=function(){if(!this.exhausted){this.exhausted=!0;this.clearProviders();var a=this.threadID;F[a]=F[0];F[0]=a}};b.pushProvider=function(a){var c=++this.contextIndex,b=a.type._context,g=this.threadID;E(b,g);var x=b[g];this.contextStack[c]=b;this.contextValueStack[c]=x;b[g]=a.props.value};b.popProvider=function(){var a=this.contextIndex,b=this.contextStack[a],f=this.contextValueStack[a]; | ||
this.contextStack[a]=null;this.contextValueStack[a]=null;this.contextIndex--;b[this.threadID]=f};b.clearProviders=function(){for(var a=this.contextIndex;0<=a;a--)this.contextStack[a][this.threadID]=this.contextValueStack[a]};b.read=function(a){if(this.exhausted)return null;var b=X;X=this.threadID;var c=Pa.current;Pa.current=Ha;try{for(var g=[""],x=!1;g[0].length<a;){if(0===this.stack.length){this.exhausted=!0;var h=this.threadID;F[h]=F[0];F[0]=h;break}var e=this.stack[this.stack.length-1];if(x||e.childIndex>= | ||
e.children.length){var I=e.footer;""!==I&&(this.previousWasTextNode=!1);this.stack.pop();if("select"===e.type)this.currentSelectValue=null;else if(null!=e.type&&null!=e.type.type&&e.type.type.$$typeof===w)this.popProvider(e.type);else if(e.type===B){this.suspenseDepth--;var G=g.pop();if(x){x=!1;var n=e.fallbackFrame;if(!n)throw Error(q(303));this.stack.push(n);g[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}else g[this.suspenseDepth]+=G}g[this.suspenseDepth]+=I}else{var m=e.children[e.childIndex++], | ||
v="";try{v+=this.render(m,e.context,e.domNamespace)}catch(r){if(null!=r&&"function"===typeof r.then)throw Error(q(294));throw r;}finally{}g.length<=this.suspenseDepth&&g.push("");g[this.suspenseDepth]+=v}}return g[0]}finally{Pa.current=c,X=b}};b.render=function(a,b,f){if("string"===typeof a||"number"===typeof a){f=""+a;if(""===f)return"";if(this.makeStaticMarkup)return N(f);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+N(f);this.previousWasTextNode=!0;return N(f)}b=Ya(a,b,this.threadID);a=b.child; | ||
this.contextStack[a]=null;this.contextValueStack[a]=null;this.contextIndex--;b[this.threadID]=f};b.clearProviders=function(){for(var a=this.contextIndex;0<=a;a--)this.contextStack[a][this.threadID]=this.contextValueStack[a]};b.read=function(a){if(this.exhausted)return null;var b=X;X=this.threadID;var c=Qa.current;Qa.current=Ia;try{for(var g=[""],x=!1;g[0].length<a;){if(0===this.stack.length){this.exhausted=!0;var h=this.threadID;F[h]=F[0];F[0]=h;break}var e=this.stack[this.stack.length-1];if(x||e.childIndex>= | ||
e.children.length){var I=e.footer;""!==I&&(this.previousWasTextNode=!1);this.stack.pop();if("select"===e.type)this.currentSelectValue=null;else if(null!=e.type&&null!=e.type.type&&e.type.type.$$typeof===v)this.popProvider(e.type);else if(e.type===B){this.suspenseDepth--;var G=g.pop();if(x){x=!1;var n=e.fallbackFrame;if(!n)throw Error(q(303));this.stack.push(n);g[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}else g[this.suspenseDepth]+=G}g[this.suspenseDepth]+=I}else{var m=e.children[e.childIndex++], | ||
w="";try{w+=this.render(m,e.context,e.domNamespace)}catch(r){if(null!=r&&"function"===typeof r.then)throw Error(q(294));throw r;}finally{}g.length<=this.suspenseDepth&&g.push("");g[this.suspenseDepth]+=w}}return g[0]}finally{Qa.current=c,X=b}};b.render=function(a,b,f){if("string"===typeof a||"number"===typeof a){f=""+a;if(""===f)return"";if(this.makeStaticMarkup)return N(f);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+N(f);this.previousWasTextNode=!0;return N(f)}b=Za(a,b,this.threadID);a=b.child; | ||
b=b.context;if(null===a||!1===a)return"";if(!l.isValidElement(a)){if(null!=a&&null!=a.$$typeof){f=a.$$typeof;if(f===aa)throw Error(q(257));throw Error(q(258,f.toString()));}a=Z(a);this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""});return""}var c=a.type;if("string"===typeof c)return this.renderDOM(a,b,f);switch(c){case ba:case ea:case ca:case ha:case u:return a=Z(a.props.children),this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}), | ||
"";case B:throw Error(q(294));}if("object"===typeof c&&null!==c)switch(c.$$typeof){case fa:O={};var d=c.render(a.props,a.ref);d=Ca(c.render,a.props,d,a.ref);d=Z(d);this.stack.push({type:null,domNamespace:f,children:d,childIndex:0,context:b,footer:""});return"";case ia:return a=[l.createElement(c.type,k({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}),"";case w:return c=Z(a.props.children),f={type:a,domNamespace:f,children:c,childIndex:0, | ||
context:b,footer:""},this.pushProvider(a),this.stack.push(f),"";case da:c=a.type;d=a.props;var h=this.threadID;E(c,h);c=Z(d.children(c[h]));this.stack.push({type:a,domNamespace:f,children:c,childIndex:0,context:b,footer:""});return"";case ka:throw Error(q(338));case ja:switch(c=a.type,ma(c),c._status){case 1:return a=[l.createElement(c._result,k({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}),"";case 2:throw c._result;default:throw Error(q(295)); | ||
}case la:throw Error(q(343));}throw Error(q(130,null==c?c:typeof c,""));};b.renderDOM=function(a,b,f){var c=a.type.toLowerCase();f===Ia.html&&Ja(c);if(!Sa.hasOwnProperty(c)){if(!Ra.test(c))throw Error(q(65,c));Sa[c]=!0}var d=a.props;if("input"===c)d=k({type:void 0},d,{defaultChecked:void 0,defaultValue:void 0,value:null!=d.value?d.value:d.defaultValue,checked:null!=d.checked?d.checked:d.defaultChecked});else if("textarea"===c){var h=d.value;if(null==h){h=d.defaultValue;var e=d.children;if(null!=e){if(null!= | ||
h)throw Error(q(92));if(Array.isArray(e)){if(!(1>=e.length))throw Error(q(93));e=e[0]}h=""+e}null==h&&(h="")}d=k({},d,{value:void 0,children:""+h})}else if("select"===c)this.currentSelectValue=null!=d.value?d.value:d.defaultValue,d=k({},d,{value:void 0});else if("option"===c){e=this.currentSelectValue;var I=Ua(d.children);if(null!=e){var G=null!=d.value?d.value+"":I;h=!1;if(Array.isArray(e))for(var n=0;n<e.length;n++){if(""+e[n]===G){h=!0;break}}else h=""+e===G;d=k({selected:void 0,children:void 0}, | ||
d,{selected:h,children:I})}}if(h=d){if(La[c]&&(null!=h.children||null!=h.dangerouslySetInnerHTML))throw Error(q(137,c,""));if(null!=h.dangerouslySetInnerHTML){if(null!=h.children)throw Error(q(60));if(!("object"===typeof h.dangerouslySetInnerHTML&&"__html"in h.dangerouslySetInnerHTML))throw Error(q(61));}if(null!=h.style&&"object"!==typeof h.style)throw Error(q(62,""));}h=d;e=this.makeStaticMarkup;I=1===this.stack.length;G="<"+a.type;for(z in h)if(Va.call(h,z)){var m=h[z];if(null!=m){if("style"=== | ||
z){n=void 0;var v="",r="";for(n in m)if(m.hasOwnProperty(n)){var y=0===n.indexOf("--"),p=m[n];if(null!=p){if(y)var A=n;else if(A=n,Ta.hasOwnProperty(A))A=Ta[A];else{var T=A.replace(Na,"-$1").toLowerCase().replace(Oa,"-ms-");A=Ta[A]=T}v+=r+A+":";r=n;y=null==p||"boolean"===typeof p||""===p?"":y||"number"!==typeof p||0===p||Y.hasOwnProperty(r)&&Y[r]?(""+p).trim():p+"px";v+=y;r=";"}}m=v||null}n=null;b:if(y=c,p=h,-1===y.indexOf("-"))y="string"===typeof p.is;else switch(y){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":y= | ||
!1;break b;default:y=!0}y?Wa.hasOwnProperty(z)||(n=z,n=ta(n)&&null!=m?n+"="+('"'+N(m)+'"'):""):n=xa(z,m);n&&(G+=" "+n)}}e||I&&(G+=' data-reactroot=""');var z=G;h="";Ka.hasOwnProperty(c)?z+="/>":(z+=">",h="</"+a.type+">");a:{e=d.dangerouslySetInnerHTML;if(null!=e){if(null!=e.__html){e=e.__html;break a}}else if(e=d.children,"string"===typeof e||"number"===typeof e){e=N(e);break a}e=null}null!=e?(d=[],Qa[c]&&"\n"===e.charAt(0)&&(z+="\n"),z+=e):d=Z(d.children);a=a.type;f=null==f||"http://www.w3.org/1999/xhtml"=== | ||
f?Ja(a):"http://www.w3.org/2000/svg"===f&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":f;this.stack.push({domNamespace:f,type:c,children:d,childIndex:0,context:b,footer:h});this.previousWasTextNode=!1;return z};return a}(),$a={renderToString:function(a){a=new Za(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new Za(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){throw Error(q(207));},renderToStaticNodeStream:function(){throw Error(q(208)); | ||
},version:"16.12.0"},ab={default:$a},bb=ab&&$a||ab;module.exports=bb.default||bb; | ||
"";case B:throw Error(q(294));}if("object"===typeof c&&null!==c)switch(c.$$typeof){case fa:O={};var d=c.render(a.props,a.ref);d=Da(c.render,a.props,d,a.ref);d=Z(d);this.stack.push({type:null,domNamespace:f,children:d,childIndex:0,context:b,footer:""});return"";case ia:return a=[l.createElement(c.type,k({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}),"";case v:return c=Z(a.props.children),f={type:a,domNamespace:f,children:c,childIndex:0, | ||
context:b,footer:""},this.pushProvider(a),this.stack.push(f),"";case da:c=a.type;d=a.props;var h=this.threadID;E(c,h);c=Z(d.children(c[h]));this.stack.push({type:a,domNamespace:f,children:c,childIndex:0,context:b,footer:""});return"";case la:throw Error(q(338));case ja:switch(c=a.type,na(c),c._status){case 1:return a=[l.createElement(c._result,k({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}),"";case 2:throw c._result;default:throw Error(q(295)); | ||
}case ma:throw Error(q(343));}throw Error(q(130,null==c?c:typeof c,""));};b.renderDOM=function(a,b,f){var c=a.type.toLowerCase();f===Ja.html&&Ka(c);if(!Ta.hasOwnProperty(c)){if(!Sa.test(c))throw Error(q(65,c));Ta[c]=!0}var d=a.props;if("input"===c)d=k({type:void 0},d,{defaultChecked:void 0,defaultValue:void 0,value:null!=d.value?d.value:d.defaultValue,checked:null!=d.checked?d.checked:d.defaultChecked});else if("textarea"===c){var h=d.value;if(null==h){h=d.defaultValue;var e=d.children;if(null!=e){if(null!= | ||
h)throw Error(q(92));if(Array.isArray(e)){if(!(1>=e.length))throw Error(q(93));e=e[0]}h=""+e}null==h&&(h="")}d=k({},d,{value:void 0,children:""+h})}else if("select"===c)this.currentSelectValue=null!=d.value?d.value:d.defaultValue,d=k({},d,{value:void 0});else if("option"===c){e=this.currentSelectValue;var I=Va(d.children);if(null!=e){var G=null!=d.value?d.value+"":I;h=!1;if(Array.isArray(e))for(var n=0;n<e.length;n++){if(""+e[n]===G){h=!0;break}}else h=""+e===G;d=k({selected:void 0,children:void 0}, | ||
d,{selected:h,children:I})}}if(h=d){if(Ma[c]&&(null!=h.children||null!=h.dangerouslySetInnerHTML))throw Error(q(137,c,""));if(null!=h.dangerouslySetInnerHTML){if(null!=h.children)throw Error(q(60));if(!("object"===typeof h.dangerouslySetInnerHTML&&"__html"in h.dangerouslySetInnerHTML))throw Error(q(61));}if(null!=h.style&&"object"!==typeof h.style)throw Error(q(62,""));}h=d;e=this.makeStaticMarkup;I=1===this.stack.length;G="<"+a.type;for(z in h)if(Wa.call(h,z)){var m=h[z];if(null!=m){if("style"=== | ||
z){n=void 0;var w="",r="";for(n in m)if(m.hasOwnProperty(n)){var y=0===n.indexOf("--"),p=m[n];if(null!=p){if(y)var A=n;else if(A=n,Ua.hasOwnProperty(A))A=Ua[A];else{var T=A.replace(Oa,"-$1").toLowerCase().replace(Pa,"-ms-");A=Ua[A]=T}w+=r+A+":";r=n;y=null==p||"boolean"===typeof p||""===p?"":y||"number"!==typeof p||0===p||Y.hasOwnProperty(r)&&Y[r]?(""+p).trim():p+"px";w+=y;r=";"}}m=w||null}n=null;b:if(y=c,p=h,-1===y.indexOf("-"))y="string"===typeof p.is;else switch(y){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":y= | ||
!1;break b;default:y=!0}y?Xa.hasOwnProperty(z)||(n=z,n=ua(n)&&null!=m?n+'="'+(N(m)+'"'):""):n=ya(z,m);n&&(G+=" "+n)}}e||I&&(G+=' data-reactroot=""');var z=G;h="";La.hasOwnProperty(c)?z+="/>":(z+=">",h="</"+a.type+">");a:{e=d.dangerouslySetInnerHTML;if(null!=e){if(null!=e.__html){e=e.__html;break a}}else if(e=d.children,"string"===typeof e||"number"===typeof e){e=N(e);break a}e=null}null!=e?(d=[],Ra.hasOwnProperty(c)&&"\n"===e.charAt(0)&&(z+="\n"),z+=e):d=Z(d.children);a=a.type;f=null==f||"http://www.w3.org/1999/xhtml"=== | ||
f?Ka(a):"http://www.w3.org/2000/svg"===f&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":f;this.stack.push({domNamespace:f,type:c,children:d,childIndex:0,context:b,footer:h});this.previousWasTextNode=!1;return z};return a}(),ab={renderToString:function(a){a=new $a(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new $a(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){throw Error(q(207));},renderToStaticNodeStream:function(){throw Error(q(208)); | ||
},version:"16.13.0"};module.exports=ab.default||ab; |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-server.node.production.min.js | ||
@@ -11,10 +11,10 @@ * | ||
'use strict';var k=require("object-assign"),m=require("react"),aa=require("stream");function r(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."} | ||
var u="function"===typeof Symbol&&Symbol.for,ba=u?Symbol.for("react.portal"):60106,v=u?Symbol.for("react.fragment"):60107,ca=u?Symbol.for("react.strict_mode"):60108,da=u?Symbol.for("react.profiler"):60114,x=u?Symbol.for("react.provider"):60109,ea=u?Symbol.for("react.context"):60110,fa=u?Symbol.for("react.concurrent_mode"):60111,ha=u?Symbol.for("react.forward_ref"):60112,B=u?Symbol.for("react.suspense"):60113,ia=u?Symbol.for("react.suspense_list"):60120,ja=u?Symbol.for("react.memo"):60115,ka=u?Symbol.for("react.lazy"): | ||
60116,la=u?Symbol.for("react.fundamental"):60117,ma=u?Symbol.for("react.scope"):60119,C=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;C.hasOwnProperty("ReactCurrentDispatcher")||(C.ReactCurrentDispatcher={current:null});C.hasOwnProperty("ReactCurrentBatchConfig")||(C.ReactCurrentBatchConfig={suspense:null}); | ||
function na(a){if(-1===a._status){a._status=0;var b=a._ctor;b=b();a._result=b;b.then(function(c){0===a._status&&(c=c.default,a._status=1,a._result=c)},function(c){0===a._status&&(a._status=2,a._result=c)})}} | ||
function D(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case v:return"Fragment";case ba:return"Portal";case da:return"Profiler";case ca:return"StrictMode";case B:return"Suspense";case ia:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case ea:return"Context.Consumer";case x:return"Context.Provider";case ha:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef"); | ||
case ja:return D(a.type);case ka:if(a=1===a._status?a._result:null)return D(a)}return null}var oa={};function E(a,b){for(var c=a._threadCount|0;c<=b;c++)a[c]=a._currentValue2,a._threadCount=c+1}function pa(a,b,c,d){if(d&&(d=a.contextType,"object"===typeof d&&null!==d))return E(d,c),d[c];if(a=a.contextTypes){c={};for(var f in a)c[f]=b[f];b=c}else b=oa;return b}for(var F=new Uint16Array(16),H=0;15>H;H++)F[H]=H+1;F[15]=0; | ||
var qa=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ra=Object.prototype.hasOwnProperty,sa={},ta={}; | ||
function ua(a){if(ra.call(ta,a))return!0;if(ra.call(sa,a))return!1;if(qa.test(a))return ta[a]=!0;sa[a]=!0;return!1}function va(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} | ||
function wa(a,b,c,d){if(null===b||"undefined"===typeof b||va(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function J(a,b,c,d,f,h){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=f;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=h}var K={}; | ||
var u="function"===typeof Symbol&&Symbol.for,ba=u?Symbol.for("react.portal"):60106,v=u?Symbol.for("react.fragment"):60107,ca=u?Symbol.for("react.strict_mode"):60108,da=u?Symbol.for("react.profiler"):60114,w=u?Symbol.for("react.provider"):60109,ea=u?Symbol.for("react.context"):60110,fa=u?Symbol.for("react.concurrent_mode"):60111,ha=u?Symbol.for("react.forward_ref"):60112,B=u?Symbol.for("react.suspense"):60113,ia=u?Symbol.for("react.suspense_list"):60120,ja=u?Symbol.for("react.memo"):60115,ka=u?Symbol.for("react.lazy"): | ||
60116,la=u?Symbol.for("react.block"):60121,ma=u?Symbol.for("react.fundamental"):60117,na=u?Symbol.for("react.scope"):60119;function oa(a){if(-1===a._status){a._status=0;var b=a._ctor;b=b();a._result=b;b.then(function(c){0===a._status&&(c=c.default,a._status=1,a._result=c)},function(c){0===a._status&&(a._status=2,a._result=c)})}} | ||
function C(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case v:return"Fragment";case ba:return"Portal";case da:return"Profiler";case ca:return"StrictMode";case B:return"Suspense";case ia:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case ea:return"Context.Consumer";case w:return"Context.Provider";case ha:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef"); | ||
case ja:return C(a.type);case la:return C(a.render);case ka:if(a=1===a._status?a._result:null)return C(a)}return null}var D=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;D.hasOwnProperty("ReactCurrentDispatcher")||(D.ReactCurrentDispatcher={current:null});D.hasOwnProperty("ReactCurrentBatchConfig")||(D.ReactCurrentBatchConfig={suspense:null});var pa={};function E(a,b){for(var c=a._threadCount|0;c<=b;c++)a[c]=a._currentValue2,a._threadCount=c+1} | ||
function qa(a,b,c,d){if(d&&(d=a.contextType,"object"===typeof d&&null!==d))return E(d,c),d[c];if(a=a.contextTypes){c={};for(var f in a)c[f]=b[f];b=c}else b=pa;return b}for(var F=new Uint16Array(16),H=0;15>H;H++)F[H]=H+1;F[15]=0; | ||
var ra=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,sa=Object.prototype.hasOwnProperty,ta={},ua={}; | ||
function va(a){if(sa.call(ua,a))return!0;if(sa.call(ta,a))return!1;if(ra.test(a))return ua[a]=!0;ta[a]=!0;return!1}function wa(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} | ||
function xa(a,b,c,d){if(null===b||"undefined"===typeof b||wa(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function J(a,b,c,d,f,h){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=f;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=h}var K={}; | ||
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){K[a]=new J(a,0,!1,a,null,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];K[b]=new J(b,1,!1,a[1],null,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){K[a]=new J(a,2,!1,a.toLowerCase(),null,!1)}); | ||
@@ -25,33 +25,33 @@ ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){K[a]=new J(a,2,!1,a,null,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){K[a]=new J(a,3,!1,a.toLowerCase(),null,!1)}); | ||
M);K[b]=new J(b,1,!1,a,null,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(L,M);K[b]=new J(b,1,!1,a,"http://www.w3.org/1999/xlink",!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(L,M);K[b]=new J(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1)});["tabIndex","crossOrigin"].forEach(function(a){K[a]=new J(a,1,!1,a.toLowerCase(),null,!1)}); | ||
K.xlinkHref=new J("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){K[a]=new J(a,1,!1,a.toLowerCase(),null,!0)});var xa=/["'&<>]/; | ||
function N(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=xa.exec(a);if(b){var c="",d,f=0;for(d=b.index;d<a.length;d++){switch(a.charCodeAt(d)){case 34:b=""";break;case 38:b="&";break;case 39:b="'";break;case 60:b="<";break;case 62:b=">";break;default:continue}f!==d&&(c+=a.substring(f,d));f=d+1;c+=b}a=f!==d?c+a.substring(f,d):c}return a} | ||
function ya(a,b){var c=K.hasOwnProperty(a)?K[a]:null;var d;if(d="style"!==a)d=null!==c?0===c.type:!(2<a.length)||"o"!==a[0]&&"O"!==a[0]||"n"!==a[1]&&"N"!==a[1]?!1:!0;if(d||wa(a,b,c,!1))return"";if(null!==c){a=c.attributeName;d=c.type;if(3===d||4===d&&!0===b)return a+'=""';c.sanitizeURL&&(b=""+b);return a+"="+('"'+N(b)+'"')}return ua(a)?a+"="+('"'+N(b)+'"'):""}function za(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b} | ||
var Aa="function"===typeof Object.is?Object.is:za,O=null,P=null,Q=null,R=!1,S=!1,U=null,V=0;function W(){if(null===O)throw Error(r(321));return O}function Ba(){if(0<V)throw Error(r(312));return{memoizedState:null,queue:null,next:null}}function Ca(){null===Q?null===P?(R=!1,P=Q=Ba()):(R=!0,Q=P):null===Q.next?(R=!1,Q=Q.next=Ba()):(R=!0,Q=Q.next);return Q}function Da(a,b,c,d){for(;S;)S=!1,V+=1,Q=null,c=a(b,d);P=O=null;V=0;Q=U=null;return c}function Ea(a,b){return"function"===typeof b?b(a):b} | ||
function Fa(a,b,c){O=W();Q=Ca();if(R){var d=Q.queue;b=d.dispatch;if(null!==U&&(c=U.get(d),void 0!==c)){U.delete(d);d=Q.memoizedState;do d=a(d,c.action),c=c.next;while(null!==c);Q.memoizedState=d;return[d,b]}return[Q.memoizedState,b]}a=a===Ea?"function"===typeof b?b():b:void 0!==c?c(b):b;Q.memoizedState=a;a=Q.queue={last:null,dispatch:null};a=a.dispatch=Ga.bind(null,O,a);return[Q.memoizedState,a]} | ||
function Ga(a,b,c){if(!(25>V))throw Error(r(301));if(a===O)if(S=!0,a={action:c,next:null},null===U&&(U=new Map),c=U.get(b),void 0===c)U.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}}function Ha(){} | ||
var X=0,Ia={readContext:function(a){var b=X;E(a,b);return a[b]},useContext:function(a){W();var b=X;E(a,b);return a[b]},useMemo:function(a,b){O=W();Q=Ca();b=void 0===b?null:b;if(null!==Q){var c=Q.memoizedState;if(null!==c&&null!==b){a:{var d=c[1];if(null===d)d=!1;else{for(var f=0;f<d.length&&f<b.length;f++)if(!Aa(b[f],d[f])){d=!1;break a}d=!0}}if(d)return c[0]}}a=a();Q.memoizedState=[a,b];return a},useReducer:Fa,useRef:function(a){O=W();Q=Ca();var b=Q.memoizedState;return null===b?(a={current:a},Q.memoizedState= | ||
a):b},useState:function(a){return Fa(Ea,a)},useLayoutEffect:function(){},useCallback:function(a){return a},useImperativeHandle:Ha,useEffect:Ha,useDebugValue:Ha,useResponder:function(a,b){return{props:b,responder:a}},useDeferredValue:function(a){W();return a},useTransition:function(){W();return[function(a){a()},!1]}},Ja={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; | ||
function Ka(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}} | ||
var La={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Ma=k({menuitem:!0},La),Y={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0, | ||
gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Na=["Webkit","ms","Moz","O"];Object.keys(Y).forEach(function(a){Na.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);Y[b]=Y[a]})}); | ||
var Oa=/([A-Z])/g,Pa=/^ms-/,Z=m.Children.toArray,Qa=C.ReactCurrentDispatcher,Ra={listing:!0,pre:!0,textarea:!0},Sa=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Ta={},Ua={};function Va(a){if(void 0===a||null===a)return a;var b="";m.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}var Wa=Object.prototype.hasOwnProperty,Xa={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function Ya(a,b){if(void 0===a)throw Error(r(152,D(b)||"Component"));} | ||
function Za(a,b,c){function d(d,h){var e=h.prototype&&h.prototype.isReactComponent,f=pa(h,b,c,e),p=[],g=!1,l={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===p)return null},enqueueReplaceState:function(a,c){g=!0;p=[c]},enqueueSetState:function(a,c){if(null===p)return null;p.push(c)}};if(e){if(e=new h(d.props,f,l),"function"===typeof h.getDerivedStateFromProps){var w=h.getDerivedStateFromProps.call(null,d.props,e.state);null!=w&&(e.state=k({},e.state,w))}}else if(O={},e=h(d.props, | ||
f,l),e=Da(h,d.props,e,f),null==e||null==e.render){a=e;Ya(a,h);return}e.props=d.props;e.context=f;e.updater=l;l=e.state;void 0===l&&(e.state=l=null);if("function"===typeof e.UNSAFE_componentWillMount||"function"===typeof e.componentWillMount)if("function"===typeof e.componentWillMount&&"function"!==typeof h.getDerivedStateFromProps&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&"function"!==typeof h.getDerivedStateFromProps&&e.UNSAFE_componentWillMount(),p.length){l=p;var t= | ||
g;p=null;g=!1;if(t&&1===l.length)e.state=l[0];else{w=t?l[0]:e.state;var y=!0;for(t=t?1:0;t<l.length;t++){var q=l[t];q="function"===typeof q?q.call(e,w,d.props,f):q;null!=q&&(y?(y=!1,w=k({},w,q)):k(w,q))}e.state=w}}else p=null;a=e.render();Ya(a,h);if("function"===typeof e.getChildContext&&(d=h.childContextTypes,"object"===typeof d)){var A=e.getChildContext();for(var T in A)if(!(T in d))throw Error(r(108,D(h)||"Unknown",T));}A&&(b=k({},b,A))}for(;m.isValidElement(a);){var f=a,h=f.type;if("function"!== | ||
K.xlinkHref=new J("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){K[a]=new J(a,1,!1,a.toLowerCase(),null,!0)});var ya=/["'&<>]/; | ||
function N(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=ya.exec(a);if(b){var c="",d,f=0;for(d=b.index;d<a.length;d++){switch(a.charCodeAt(d)){case 34:b=""";break;case 38:b="&";break;case 39:b="'";break;case 60:b="<";break;case 62:b=">";break;default:continue}f!==d&&(c+=a.substring(f,d));f=d+1;c+=b}a=f!==d?c+a.substring(f,d):c}return a} | ||
function za(a,b){var c=K.hasOwnProperty(a)?K[a]:null;var d;if(d="style"!==a)d=null!==c?0===c.type:!(2<a.length)||"o"!==a[0]&&"O"!==a[0]||"n"!==a[1]&&"N"!==a[1]?!1:!0;if(d||xa(a,b,c,!1))return"";if(null!==c){a=c.attributeName;d=c.type;if(3===d||4===d&&!0===b)return a+'=""';c.sanitizeURL&&(b=""+b);return a+'="'+(N(b)+'"')}return va(a)?a+'="'+(N(b)+'"'):""}function Aa(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b} | ||
var Ba="function"===typeof Object.is?Object.is:Aa,O=null,P=null,Q=null,R=!1,S=!1,U=null,V=0;function W(){if(null===O)throw Error(r(321));return O}function Ca(){if(0<V)throw Error(r(312));return{memoizedState:null,queue:null,next:null}}function Da(){null===Q?null===P?(R=!1,P=Q=Ca()):(R=!0,Q=P):null===Q.next?(R=!1,Q=Q.next=Ca()):(R=!0,Q=Q.next);return Q}function Ea(a,b,c,d){for(;S;)S=!1,V+=1,Q=null,c=a(b,d);P=O=null;V=0;Q=U=null;return c}function Fa(a,b){return"function"===typeof b?b(a):b} | ||
function Ga(a,b,c){O=W();Q=Da();if(R){var d=Q.queue;b=d.dispatch;if(null!==U&&(c=U.get(d),void 0!==c)){U.delete(d);d=Q.memoizedState;do d=a(d,c.action),c=c.next;while(null!==c);Q.memoizedState=d;return[d,b]}return[Q.memoizedState,b]}a=a===Fa?"function"===typeof b?b():b:void 0!==c?c(b):b;Q.memoizedState=a;a=Q.queue={last:null,dispatch:null};a=a.dispatch=Ha.bind(null,O,a);return[Q.memoizedState,a]} | ||
function Ha(a,b,c){if(!(25>V))throw Error(r(301));if(a===O)if(S=!0,a={action:c,next:null},null===U&&(U=new Map),c=U.get(b),void 0===c)U.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}}function Ia(){} | ||
var X=0,Ja={readContext:function(a){var b=X;E(a,b);return a[b]},useContext:function(a){W();var b=X;E(a,b);return a[b]},useMemo:function(a,b){O=W();Q=Da();b=void 0===b?null:b;if(null!==Q){var c=Q.memoizedState;if(null!==c&&null!==b){a:{var d=c[1];if(null===d)d=!1;else{for(var f=0;f<d.length&&f<b.length;f++)if(!Ba(b[f],d[f])){d=!1;break a}d=!0}}if(d)return c[0]}}a=a();Q.memoizedState=[a,b];return a},useReducer:Ga,useRef:function(a){O=W();Q=Da();var b=Q.memoizedState;return null===b?(a={current:a},Q.memoizedState= | ||
a):b},useState:function(a){return Ga(Fa,a)},useLayoutEffect:function(){},useCallback:function(a){return a},useImperativeHandle:Ia,useEffect:Ia,useDebugValue:Ia,useResponder:function(a,b){return{props:b,responder:a}},useDeferredValue:function(a){W();return a},useTransition:function(){W();return[function(a){a()},!1]}},Ka={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; | ||
function La(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}} | ||
var Ma={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Na=k({menuitem:!0},Ma),Y={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0, | ||
gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Oa=["Webkit","ms","Moz","O"];Object.keys(Y).forEach(function(a){Oa.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);Y[b]=Y[a]})}); | ||
var Pa=/([A-Z])/g,Qa=/^ms-/,Z=m.Children.toArray,Ra=D.ReactCurrentDispatcher,Sa={listing:!0,pre:!0,textarea:!0},Ta=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Ua={},Va={};function Wa(a){if(void 0===a||null===a)return a;var b="";m.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}var Xa=Object.prototype.hasOwnProperty,Ya={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function Za(a,b){if(void 0===a)throw Error(r(152,C(b)||"Component"));} | ||
function $a(a,b,c){function d(d,h){var e=h.prototype&&h.prototype.isReactComponent,f=qa(h,b,c,e),p=[],g=!1,l={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===p)return null},enqueueReplaceState:function(a,c){g=!0;p=[c]},enqueueSetState:function(a,c){if(null===p)return null;p.push(c)}};if(e){if(e=new h(d.props,f,l),"function"===typeof h.getDerivedStateFromProps){var x=h.getDerivedStateFromProps.call(null,d.props,e.state);null!=x&&(e.state=k({},e.state,x))}}else if(O={},e=h(d.props, | ||
f,l),e=Ea(h,d.props,e,f),null==e||null==e.render){a=e;Za(a,h);return}e.props=d.props;e.context=f;e.updater=l;l=e.state;void 0===l&&(e.state=l=null);if("function"===typeof e.UNSAFE_componentWillMount||"function"===typeof e.componentWillMount)if("function"===typeof e.componentWillMount&&"function"!==typeof h.getDerivedStateFromProps&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&"function"!==typeof h.getDerivedStateFromProps&&e.UNSAFE_componentWillMount(),p.length){l=p;var t= | ||
g;p=null;g=!1;if(t&&1===l.length)e.state=l[0];else{x=t?l[0]:e.state;var y=!0;for(t=t?1:0;t<l.length;t++){var q=l[t];q="function"===typeof q?q.call(e,x,d.props,f):q;null!=q&&(y?(y=!1,x=k({},x,q)):k(x,q))}e.state=x}}else p=null;a=e.render();Za(a,h);if("function"===typeof e.getChildContext&&(d=h.childContextTypes,"object"===typeof d)){var A=e.getChildContext();for(var T in A)if(!(T in d))throw Error(r(108,C(h)||"Unknown",T));}A&&(b=k({},b,A))}for(;m.isValidElement(a);){var f=a,h=f.type;if("function"!== | ||
typeof h)break;d(f,h)}return{child:a,context:b}} | ||
var $a=function(){function a(a,b){m.isValidElement(a)?a.type!==v?a=[a]:(a=a.props.children,a=m.isValidElement(a)?[a]:Z(a)):a=Z(a);a={type:null,domNamespace:Ja.html,children:a,childIndex:0,context:oa,footer:""};var c=F[0];if(0===c){var d=F;c=d.length;var p=2*c;if(!(65536>=p))throw Error(r(304));var g=new Uint16Array(p);g.set(d);F=g;F[0]=c+1;for(d=c;d<p-1;d++)F[d]=d+1;F[p-1]=0}else F[0]=F[c];this.threadID=c;this.stack=[a];this.exhausted=!1;this.currentSelectValue=null;this.previousWasTextNode=!1;this.makeStaticMarkup= | ||
var ab=function(){function a(a,b){m.isValidElement(a)?a.type!==v?a=[a]:(a=a.props.children,a=m.isValidElement(a)?[a]:Z(a)):a=Z(a);a={type:null,domNamespace:Ka.html,children:a,childIndex:0,context:pa,footer:""};var c=F[0];if(0===c){var d=F;c=d.length;var p=2*c;if(!(65536>=p))throw Error(r(304));var g=new Uint16Array(p);g.set(d);F=g;F[0]=c+1;for(d=c;d<p-1;d++)F[d]=d+1;F[p-1]=0}else F[0]=F[c];this.threadID=c;this.stack=[a];this.exhausted=!1;this.currentSelectValue=null;this.previousWasTextNode=!1;this.makeStaticMarkup= | ||
b;this.suspenseDepth=0;this.contextIndex=-1;this.contextStack=[];this.contextValueStack=[]}var b=a.prototype;b.destroy=function(){if(!this.exhausted){this.exhausted=!0;this.clearProviders();var a=this.threadID;F[a]=F[0];F[0]=a}};b.pushProvider=function(a){var b=++this.contextIndex,c=a.type._context,h=this.threadID;E(c,h);var p=c[h];this.contextStack[b]=c;this.contextValueStack[b]=p;c[h]=a.props.value};b.popProvider=function(){var a=this.contextIndex,b=this.contextStack[a],f=this.contextValueStack[a]; | ||
this.contextStack[a]=null;this.contextValueStack[a]=null;this.contextIndex--;b[this.threadID]=f};b.clearProviders=function(){for(var a=this.contextIndex;0<=a;a--)this.contextStack[a][this.threadID]=this.contextValueStack[a]};b.read=function(a){if(this.exhausted)return null;var b=X;X=this.threadID;var c=Qa.current;Qa.current=Ia;try{for(var h=[""],p=!1;h[0].length<a;){if(0===this.stack.length){this.exhausted=!0;var g=this.threadID;F[g]=F[0];F[0]=g;break}var e=this.stack[this.stack.length-1];if(p||e.childIndex>= | ||
e.children.length){var I=e.footer;""!==I&&(this.previousWasTextNode=!1);this.stack.pop();if("select"===e.type)this.currentSelectValue=null;else if(null!=e.type&&null!=e.type.type&&e.type.type.$$typeof===x)this.popProvider(e.type);else if(e.type===B){this.suspenseDepth--;var G=h.pop();if(p){p=!1;var n=e.fallbackFrame;if(!n)throw Error(r(303));this.stack.push(n);h[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}else h[this.suspenseDepth]+=G}h[this.suspenseDepth]+=I}else{var l=e.children[e.childIndex++], | ||
w="";try{w+=this.render(l,e.context,e.domNamespace)}catch(t){if(null!=t&&"function"===typeof t.then)throw Error(r(294));throw t;}finally{}h.length<=this.suspenseDepth&&h.push("");h[this.suspenseDepth]+=w}}return h[0]}finally{Qa.current=c,X=b}};b.render=function(a,b,f){if("string"===typeof a||"number"===typeof a){f=""+a;if(""===f)return"";if(this.makeStaticMarkup)return N(f);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+N(f);this.previousWasTextNode=!0;return N(f)}b=Za(a,b,this.threadID);a=b.child; | ||
this.contextStack[a]=null;this.contextValueStack[a]=null;this.contextIndex--;b[this.threadID]=f};b.clearProviders=function(){for(var a=this.contextIndex;0<=a;a--)this.contextStack[a][this.threadID]=this.contextValueStack[a]};b.read=function(a){if(this.exhausted)return null;var b=X;X=this.threadID;var c=Ra.current;Ra.current=Ja;try{for(var h=[""],p=!1;h[0].length<a;){if(0===this.stack.length){this.exhausted=!0;var g=this.threadID;F[g]=F[0];F[0]=g;break}var e=this.stack[this.stack.length-1];if(p||e.childIndex>= | ||
e.children.length){var I=e.footer;""!==I&&(this.previousWasTextNode=!1);this.stack.pop();if("select"===e.type)this.currentSelectValue=null;else if(null!=e.type&&null!=e.type.type&&e.type.type.$$typeof===w)this.popProvider(e.type);else if(e.type===B){this.suspenseDepth--;var G=h.pop();if(p){p=!1;var n=e.fallbackFrame;if(!n)throw Error(r(303));this.stack.push(n);h[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}else h[this.suspenseDepth]+=G}h[this.suspenseDepth]+=I}else{var l=e.children[e.childIndex++], | ||
x="";try{x+=this.render(l,e.context,e.domNamespace)}catch(t){if(null!=t&&"function"===typeof t.then)throw Error(r(294));throw t;}finally{}h.length<=this.suspenseDepth&&h.push("");h[this.suspenseDepth]+=x}}return h[0]}finally{Ra.current=c,X=b}};b.render=function(a,b,f){if("string"===typeof a||"number"===typeof a){f=""+a;if(""===f)return"";if(this.makeStaticMarkup)return N(f);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+N(f);this.previousWasTextNode=!0;return N(f)}b=$a(a,b,this.threadID);a=b.child; | ||
b=b.context;if(null===a||!1===a)return"";if(!m.isValidElement(a)){if(null!=a&&null!=a.$$typeof){f=a.$$typeof;if(f===ba)throw Error(r(257));throw Error(r(258,f.toString()));}a=Z(a);this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""});return""}var c=a.type;if("string"===typeof c)return this.renderDOM(a,b,f);switch(c){case ca:case fa:case da:case ia:case v:return a=Z(a.props.children),this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}), | ||
"";case B:throw Error(r(294));}if("object"===typeof c&&null!==c)switch(c.$$typeof){case ha:O={};var d=c.render(a.props,a.ref);d=Da(c.render,a.props,d,a.ref);d=Z(d);this.stack.push({type:null,domNamespace:f,children:d,childIndex:0,context:b,footer:""});return"";case ja:return a=[m.createElement(c.type,k({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}),"";case x:return c=Z(a.props.children),f={type:a,domNamespace:f,children:c,childIndex:0, | ||
context:b,footer:""},this.pushProvider(a),this.stack.push(f),"";case ea:c=a.type;d=a.props;var g=this.threadID;E(c,g);c=Z(d.children(c[g]));this.stack.push({type:a,domNamespace:f,children:c,childIndex:0,context:b,footer:""});return"";case la:throw Error(r(338));case ka:switch(c=a.type,na(c),c._status){case 1:return a=[m.createElement(c._result,k({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}),"";case 2:throw c._result;default:throw Error(r(295)); | ||
}case ma:throw Error(r(343));}throw Error(r(130,null==c?c:typeof c,""));};b.renderDOM=function(a,b,f){var c=a.type.toLowerCase();f===Ja.html&&Ka(c);if(!Ta.hasOwnProperty(c)){if(!Sa.test(c))throw Error(r(65,c));Ta[c]=!0}var d=a.props;if("input"===c)d=k({type:void 0},d,{defaultChecked:void 0,defaultValue:void 0,value:null!=d.value?d.value:d.defaultValue,checked:null!=d.checked?d.checked:d.defaultChecked});else if("textarea"===c){var g=d.value;if(null==g){g=d.defaultValue;var e=d.children;if(null!=e){if(null!= | ||
g)throw Error(r(92));if(Array.isArray(e)){if(!(1>=e.length))throw Error(r(93));e=e[0]}g=""+e}null==g&&(g="")}d=k({},d,{value:void 0,children:""+g})}else if("select"===c)this.currentSelectValue=null!=d.value?d.value:d.defaultValue,d=k({},d,{value:void 0});else if("option"===c){e=this.currentSelectValue;var I=Va(d.children);if(null!=e){var G=null!=d.value?d.value+"":I;g=!1;if(Array.isArray(e))for(var n=0;n<e.length;n++){if(""+e[n]===G){g=!0;break}}else g=""+e===G;d=k({selected:void 0,children:void 0}, | ||
d,{selected:g,children:I})}}if(g=d){if(Ma[c]&&(null!=g.children||null!=g.dangerouslySetInnerHTML))throw Error(r(137,c,""));if(null!=g.dangerouslySetInnerHTML){if(null!=g.children)throw Error(r(60));if(!("object"===typeof g.dangerouslySetInnerHTML&&"__html"in g.dangerouslySetInnerHTML))throw Error(r(61));}if(null!=g.style&&"object"!==typeof g.style)throw Error(r(62,""));}g=d;e=this.makeStaticMarkup;I=1===this.stack.length;G="<"+a.type;for(z in g)if(Wa.call(g,z)){var l=g[z];if(null!=l){if("style"=== | ||
z){n=void 0;var w="",t="";for(n in l)if(l.hasOwnProperty(n)){var y=0===n.indexOf("--"),q=l[n];if(null!=q){if(y)var A=n;else if(A=n,Ua.hasOwnProperty(A))A=Ua[A];else{var T=A.replace(Oa,"-$1").toLowerCase().replace(Pa,"-ms-");A=Ua[A]=T}w+=t+A+":";t=n;y=null==q||"boolean"===typeof q||""===q?"":y||"number"!==typeof q||0===q||Y.hasOwnProperty(t)&&Y[t]?(""+q).trim():q+"px";w+=y;t=";"}}l=w||null}n=null;b:if(y=c,q=g,-1===y.indexOf("-"))y="string"===typeof q.is;else switch(y){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":y= | ||
!1;break b;default:y=!0}y?Xa.hasOwnProperty(z)||(n=z,n=ua(n)&&null!=l?n+"="+('"'+N(l)+'"'):""):n=ya(z,l);n&&(G+=" "+n)}}e||I&&(G+=' data-reactroot=""');var z=G;g="";La.hasOwnProperty(c)?z+="/>":(z+=">",g="</"+a.type+">");a:{e=d.dangerouslySetInnerHTML;if(null!=e){if(null!=e.__html){e=e.__html;break a}}else if(e=d.children,"string"===typeof e||"number"===typeof e){e=N(e);break a}e=null}null!=e?(d=[],Ra[c]&&"\n"===e.charAt(0)&&(z+="\n"),z+=e):d=Z(d.children);a=a.type;f=null==f||"http://www.w3.org/1999/xhtml"=== | ||
f?Ka(a):"http://www.w3.org/2000/svg"===f&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":f;this.stack.push({domNamespace:f,type:c,children:d,childIndex:0,context:b,footer:g});this.previousWasTextNode=!1;return z};return a}();function ab(a,b){a.prototype=Object.create(b.prototype);a.prototype.constructor=a;a.__proto__=b} | ||
var bb=function(a){function b(b,c){var d=a.call(this,{})||this;d.partialRenderer=new $a(b,c);return d}ab(b,a);var c=b.prototype;c._destroy=function(a,b){this.partialRenderer.destroy();b(a)};c._read=function(a){try{this.push(this.partialRenderer.read(a))}catch(f){this.destroy(f)}};return b}(aa.Readable),cb={renderToString:function(a){a=new $a(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new $a(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(a){return new bb(a, | ||
!1)},renderToStaticNodeStream:function(a){return new bb(a,!0)},version:"16.12.0"},db={default:cb},eb=db&&cb||db;module.exports=eb.default||eb; | ||
"";case B:throw Error(r(294));}if("object"===typeof c&&null!==c)switch(c.$$typeof){case ha:O={};var d=c.render(a.props,a.ref);d=Ea(c.render,a.props,d,a.ref);d=Z(d);this.stack.push({type:null,domNamespace:f,children:d,childIndex:0,context:b,footer:""});return"";case ja:return a=[m.createElement(c.type,k({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}),"";case w:return c=Z(a.props.children),f={type:a,domNamespace:f,children:c,childIndex:0, | ||
context:b,footer:""},this.pushProvider(a),this.stack.push(f),"";case ea:c=a.type;d=a.props;var g=this.threadID;E(c,g);c=Z(d.children(c[g]));this.stack.push({type:a,domNamespace:f,children:c,childIndex:0,context:b,footer:""});return"";case ma:throw Error(r(338));case ka:switch(c=a.type,oa(c),c._status){case 1:return a=[m.createElement(c._result,k({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}),"";case 2:throw c._result;default:throw Error(r(295)); | ||
}case na:throw Error(r(343));}throw Error(r(130,null==c?c:typeof c,""));};b.renderDOM=function(a,b,f){var c=a.type.toLowerCase();f===Ka.html&&La(c);if(!Ua.hasOwnProperty(c)){if(!Ta.test(c))throw Error(r(65,c));Ua[c]=!0}var d=a.props;if("input"===c)d=k({type:void 0},d,{defaultChecked:void 0,defaultValue:void 0,value:null!=d.value?d.value:d.defaultValue,checked:null!=d.checked?d.checked:d.defaultChecked});else if("textarea"===c){var g=d.value;if(null==g){g=d.defaultValue;var e=d.children;if(null!=e){if(null!= | ||
g)throw Error(r(92));if(Array.isArray(e)){if(!(1>=e.length))throw Error(r(93));e=e[0]}g=""+e}null==g&&(g="")}d=k({},d,{value:void 0,children:""+g})}else if("select"===c)this.currentSelectValue=null!=d.value?d.value:d.defaultValue,d=k({},d,{value:void 0});else if("option"===c){e=this.currentSelectValue;var I=Wa(d.children);if(null!=e){var G=null!=d.value?d.value+"":I;g=!1;if(Array.isArray(e))for(var n=0;n<e.length;n++){if(""+e[n]===G){g=!0;break}}else g=""+e===G;d=k({selected:void 0,children:void 0}, | ||
d,{selected:g,children:I})}}if(g=d){if(Na[c]&&(null!=g.children||null!=g.dangerouslySetInnerHTML))throw Error(r(137,c,""));if(null!=g.dangerouslySetInnerHTML){if(null!=g.children)throw Error(r(60));if(!("object"===typeof g.dangerouslySetInnerHTML&&"__html"in g.dangerouslySetInnerHTML))throw Error(r(61));}if(null!=g.style&&"object"!==typeof g.style)throw Error(r(62,""));}g=d;e=this.makeStaticMarkup;I=1===this.stack.length;G="<"+a.type;for(z in g)if(Xa.call(g,z)){var l=g[z];if(null!=l){if("style"=== | ||
z){n=void 0;var x="",t="";for(n in l)if(l.hasOwnProperty(n)){var y=0===n.indexOf("--"),q=l[n];if(null!=q){if(y)var A=n;else if(A=n,Va.hasOwnProperty(A))A=Va[A];else{var T=A.replace(Pa,"-$1").toLowerCase().replace(Qa,"-ms-");A=Va[A]=T}x+=t+A+":";t=n;y=null==q||"boolean"===typeof q||""===q?"":y||"number"!==typeof q||0===q||Y.hasOwnProperty(t)&&Y[t]?(""+q).trim():q+"px";x+=y;t=";"}}l=x||null}n=null;b:if(y=c,q=g,-1===y.indexOf("-"))y="string"===typeof q.is;else switch(y){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":y= | ||
!1;break b;default:y=!0}y?Ya.hasOwnProperty(z)||(n=z,n=va(n)&&null!=l?n+'="'+(N(l)+'"'):""):n=za(z,l);n&&(G+=" "+n)}}e||I&&(G+=' data-reactroot=""');var z=G;g="";Ma.hasOwnProperty(c)?z+="/>":(z+=">",g="</"+a.type+">");a:{e=d.dangerouslySetInnerHTML;if(null!=e){if(null!=e.__html){e=e.__html;break a}}else if(e=d.children,"string"===typeof e||"number"===typeof e){e=N(e);break a}e=null}null!=e?(d=[],Sa.hasOwnProperty(c)&&"\n"===e.charAt(0)&&(z+="\n"),z+=e):d=Z(d.children);a=a.type;f=null==f||"http://www.w3.org/1999/xhtml"=== | ||
f?La(a):"http://www.w3.org/2000/svg"===f&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":f;this.stack.push({domNamespace:f,type:c,children:d,childIndex:0,context:b,footer:g});this.previousWasTextNode=!1;return z};return a}();function bb(a,b){a.prototype=Object.create(b.prototype);a.prototype.constructor=a;a.__proto__=b} | ||
var cb=function(a){function b(b,c){var d=a.call(this,{})||this;d.partialRenderer=new ab(b,c);return d}bb(b,a);var c=b.prototype;c._destroy=function(a,b){this.partialRenderer.destroy();b(a)};c._read=function(a){try{this.push(this.partialRenderer.read(a))}catch(f){this.destroy(f)}};return b}(aa.Readable),db={renderToString:function(a){a=new ab(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new ab(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(a){return new cb(a, | ||
!1)},renderToStaticNodeStream:function(a){return new cb(a,!0)},version:"16.13.0"};module.exports=db.default||db; |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-test-utils.development.js | ||
@@ -23,54 +23,68 @@ * | ||
// Do not require this module directly! Use normal `invariant` calls with | ||
// template literal strings. The messages will be replaced with error codes | ||
// during build. | ||
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. | ||
// Current owner and dispatcher used to share the same ref, | ||
// but PR #14548 split them out to better support the react-debug-tools package. | ||
/** | ||
* Use invariant() to assert state which your program assumes to be true. | ||
* | ||
* Provide sprintf-style format (only %s is supported) and arguments | ||
* to provide information about what broke and what you were | ||
* expecting. | ||
* | ||
* The invariant message will be stripped in production, but the invariant | ||
* will remain to ensure logic does not differ in production. | ||
*/ | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { | ||
ReactSharedInternals.ReactCurrentDispatcher = { | ||
current: null | ||
}; | ||
} | ||
/** | ||
* Similar to invariant but only logs a warning if the condition is not met. | ||
* This can be used to log issues in development environments in critical | ||
* paths. Removing the logging code for production environments will keep the | ||
* same logic and follow the same code paths. | ||
*/ | ||
var warningWithoutStack = function () {}; | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { | ||
ReactSharedInternals.ReactCurrentBatchConfig = { | ||
suspense: null | ||
}; | ||
} | ||
{ | ||
warningWithoutStack = function (condition, format) { | ||
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
// by calls to these methods by a Babel plugin. | ||
// | ||
// In PROD (or in packages without access to React internals), | ||
// they are left as they are instead. | ||
if (format === undefined) { | ||
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); | ||
function warn(format) { | ||
{ | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
if (args.length > 8) { | ||
// Check before the condition to catch violations early. | ||
throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); | ||
printWarning('warn', format, args); | ||
} | ||
} | ||
function error(format) { | ||
{ | ||
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
args[_key2 - 1] = arguments[_key2]; | ||
} | ||
if (condition) { | ||
return; | ||
} | ||
printWarning('error', format, args); | ||
} | ||
} | ||
if (typeof console !== 'undefined') { | ||
var argsWithFormat = args.map(function (item) { | ||
return '' + item; | ||
}); | ||
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it | ||
// breaks IE9: https://github.com/facebook/react/issues/13610 | ||
function printWarning(level, format, args) { | ||
// When changing this logic, you might want to also | ||
// update consoleWithStackDev.www.js as well. | ||
{ | ||
var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; | ||
Function.prototype.apply.call(console.error, console, argsWithFormat); | ||
if (!hasExistingStack) { | ||
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; | ||
var stack = ReactDebugCurrentFrame.getStackAddendum(); | ||
if (stack !== '') { | ||
format += '%s'; | ||
args = args.concat([stack]); | ||
} | ||
} | ||
var argsWithFormat = args.map(function (item) { | ||
return '' + item; | ||
}); // Careful: RN currently depends on this prefix | ||
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it | ||
// breaks IE9: https://github.com/facebook/react/issues/13610 | ||
// eslint-disable-next-line react-internal/no-production-logging | ||
Function.prototype.apply.call(console[level], console, argsWithFormat); | ||
try { | ||
@@ -86,7 +100,5 @@ // --- Welcome to debugging React --- | ||
} catch (x) {} | ||
}; | ||
} | ||
} | ||
var warningWithoutStack$1 = warningWithoutStack; | ||
/** | ||
@@ -101,9 +113,2 @@ * `ReactInstanceMap` maintains a mapping from a public facing stateful | ||
*/ | ||
/** | ||
* This API should be called `delete` but we'd have to make sure to always | ||
* transform these to strings for IE support. When this transform is fully | ||
* supported we can rename it. | ||
*/ | ||
function get(key) { | ||
@@ -113,41 +118,7 @@ return key._reactInternalFiber; | ||
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. | ||
// Current owner and dispatcher used to share the same ref, | ||
// but PR #14548 split them out to better support the react-debug-tools package. | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { | ||
ReactSharedInternals.ReactCurrentDispatcher = { | ||
current: null | ||
}; | ||
} | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { | ||
ReactSharedInternals.ReactCurrentBatchConfig = { | ||
suspense: null | ||
}; | ||
} | ||
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | ||
// nor polyfill, then a plain number is used for performance. | ||
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary | ||
// (unstable) APIs that have been removed. Can we remove the symbols? | ||
{ | ||
} | ||
var FunctionComponent = 0; | ||
var ClassComponent = 1; | ||
// Before we know whether it is function or class | ||
var HostRoot = 3; // Root of a host tree. Could be nested inside another node. | ||
// A subtree. Could be an entry point to a different renderer. | ||
var HostComponent = 5; | ||
@@ -160,3 +131,2 @@ var HostText = 6; | ||
0; | ||
// You can change the rest (and add more). | ||
@@ -166,76 +136,6 @@ var Placement = | ||
2; | ||
var Hydrating = | ||
/* */ | ||
1024; | ||
// Passive & Update & Callback & Ref & Snapshot | ||
// Union of all host effects | ||
// Helps identify side effects in render-phase lifecycle hooks and setState | ||
// reducers by double invoking them in Strict Mode. | ||
// To preserve the "Pause on caught exceptions" behavior of the debugger, we | ||
// replay the begin phase of a failed component inside invokeGuardedCallback. | ||
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: | ||
// Gather advanced timing metrics for Profiler subtrees. | ||
// Trace which interactions trigger each commit. | ||
// SSR experiments | ||
// Only used in www builds. | ||
// Only used in www builds. | ||
// Disable javascript: URL strings in href for XSS protection. | ||
// React Fire: prevent the value and checked attributes from syncing | ||
// with their related DOM properties | ||
// These APIs will no longer be "unstable" in the upcoming 16.7 release, | ||
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile. | ||
// Experimental React Flare event system and event components support. | ||
// Experimental Host Component support. | ||
// Experimental Scope support. | ||
// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107 | ||
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?) | ||
// Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version | ||
// For tests, we flush suspense fallbacks in an act scope; | ||
// *except* in some of our own tests, where we test incremental loading states. | ||
// Add a callback property to suspense to notify which promises are currently | ||
// in the update queue. This allows reporting and tracing of what is causing | ||
// the user to see a loading state. | ||
// Also allows hydration callbacks to fire when a dehydrated boundary gets | ||
// hydrated or deleted. | ||
// Part of the simplification of React.createElement so we can eventually move | ||
// from React.createElement to React.jsx | ||
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md | ||
// Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance | ||
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; | ||
@@ -280,10 +180,6 @@ function getNearestMountedFiber(fiber) { | ||
function assertIsMounted(fiber) { | ||
if (!(getNearestMountedFiber(fiber) === fiber)) { | ||
{ | ||
throw Error("Unable to find node on an unmounted component."); | ||
throw Error( "Unable to find node on an unmounted component." ); | ||
} | ||
@@ -302,3 +198,3 @@ } | ||
{ | ||
throw Error("Unable to find node on an unmounted component."); | ||
throw Error( "Unable to find node on an unmounted component." ); | ||
} | ||
@@ -372,3 +268,3 @@ } | ||
{ | ||
throw Error("Unable to find node on an unmounted component."); | ||
throw Error( "Unable to find node on an unmounted component." ); | ||
} | ||
@@ -436,3 +332,3 @@ } | ||
{ | ||
throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."); | ||
throw Error( "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." ); | ||
} | ||
@@ -445,3 +341,3 @@ } | ||
{ | ||
throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."); | ||
throw Error( "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." ); | ||
} | ||
@@ -455,3 +351,3 @@ } | ||
{ | ||
throw Error("Unable to find node on an unmounted component."); | ||
throw Error( "Unable to find node on an unmounted component." ); | ||
} | ||
@@ -469,3 +365,2 @@ } | ||
/* eslint valid-typeof: 0 */ | ||
var EVENT_POOL_SIZE = 10; | ||
@@ -712,4 +607,5 @@ /** | ||
function warn(action, result) { | ||
var warningCondition = false; | ||
!warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0; | ||
{ | ||
error("This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result); | ||
} | ||
} | ||
@@ -735,3 +631,3 @@ } | ||
{ | ||
throw Error("Trying to release an event instance into a pool of a different type."); | ||
throw Error( "Trying to release an event instance into a pool of a different type." ); | ||
} | ||
@@ -754,57 +650,2 @@ } | ||
/** | ||
* Forked from fbjs/warning: | ||
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js | ||
* | ||
* Only change is we use console.warn instead of console.error, | ||
* and do nothing when 'console' is not supported. | ||
* This really simplifies the code. | ||
* --- | ||
* Similar to invariant but only logs a warning if the condition is not met. | ||
* This can be used to log issues in development environments in critical | ||
* paths. Removing the logging code for production environments will keep the | ||
* same logic and follow the same code paths. | ||
*/ | ||
var lowPriorityWarningWithoutStack = function () {}; | ||
{ | ||
var printWarning = function (format) { | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
if (typeof console !== 'undefined') { | ||
console.warn(message); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
lowPriorityWarningWithoutStack = function (condition, format) { | ||
if (format === undefined) { | ||
throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); | ||
} | ||
if (!condition) { | ||
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | ||
args[_key2 - 2] = arguments[_key2]; | ||
} | ||
printWarning.apply(void 0, [format].concat(args)); | ||
} | ||
}; | ||
} | ||
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack; | ||
/** | ||
* HTML nodeType values that represent the type of the node | ||
@@ -932,3 +773,2 @@ */ | ||
var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick'); | ||
var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag'); | ||
@@ -948,5 +788,3 @@ var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend'); | ||
var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus'); | ||
var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input'); | ||
var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown'); | ||
@@ -959,3 +797,2 @@ var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress'); | ||
var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata'); | ||
var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown'); | ||
@@ -970,13 +807,4 @@ var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove'); | ||
var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing'); | ||
var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress'); | ||
var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange'); | ||
var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll'); | ||
@@ -987,3 +815,2 @@ var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked'); | ||
var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled'); | ||
var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend'); | ||
@@ -1001,4 +828,2 @@ var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput'); | ||
var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements. | ||
// Note that events in this list will *not* be listened to at the top level | ||
// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`. | ||
@@ -1008,48 +833,58 @@ var PLUGIN_EVENT_SYSTEM = 1; | ||
var didWarnAboutMessageChannel = false; | ||
var enqueueTask; | ||
var enqueueTaskImpl = null; | ||
function enqueueTask(task) { | ||
if (enqueueTaskImpl === null) { | ||
try { | ||
// read require off the module object to get around the bundlers. | ||
// we don't want them to detect a require and bundle a Node polyfill. | ||
var requireString = ('require' + Math.random()).slice(0, 7); | ||
var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's | ||
// version of setImmediate, bypassing fake timers if any. | ||
try { | ||
// read require off the module object to get around the bundlers. | ||
// we don't want them to detect a require and bundle a Node polyfill. | ||
var requireString = ('require' + Math.random()).slice(0, 7); | ||
var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's | ||
// version of setImmediate, bypassing fake timers if any. | ||
enqueueTaskImpl = nodeRequire('timers').setImmediate; | ||
} catch (_err) { | ||
// we're in a browser | ||
// we can't use regular timers because they may still be faked | ||
// so we try MessageChannel+postMessage instead | ||
enqueueTaskImpl = function (callback) { | ||
{ | ||
if (didWarnAboutMessageChannel === false) { | ||
didWarnAboutMessageChannel = true; | ||
enqueueTask = nodeRequire('timers').setImmediate; | ||
} catch (_err) { | ||
// we're in a browser | ||
// we can't use regular timers because they may still be faked | ||
// so we try MessageChannel+postMessage instead | ||
enqueueTask = function (callback) { | ||
{ | ||
if (didWarnAboutMessageChannel === false) { | ||
didWarnAboutMessageChannel = true; | ||
!(typeof MessageChannel !== 'undefined') ? warningWithoutStack$1(false, 'This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.') : void 0; | ||
} | ||
if (typeof MessageChannel === 'undefined') { | ||
error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.'); | ||
} | ||
} | ||
} | ||
var channel = new MessageChannel(); | ||
channel.port1.onmessage = callback; | ||
channel.port2.postMessage(undefined); | ||
}; | ||
} | ||
} | ||
var channel = new MessageChannel(); | ||
channel.port1.onmessage = callback; | ||
channel.port2.postMessage(undefined); | ||
}; | ||
return enqueueTaskImpl(task); | ||
} | ||
var enqueueTask$1 = enqueueTask; | ||
// ReactDOM.js, and ReactTestUtils.js: | ||
var _ReactDOM$__SECRET_IN$1 = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events; | ||
var getInstanceFromNode$1 = _ReactDOM$__SECRET_IN$1[0]; | ||
var getNodeFromInstance$1 = _ReactDOM$__SECRET_IN$1[1]; | ||
var getFiberCurrentPropsFromNode$1 = _ReactDOM$__SECRET_IN$1[2]; | ||
var injectEventPluginsByName$1 = _ReactDOM$__SECRET_IN$1[3]; | ||
var eventNameDispatchConfigs$1 = _ReactDOM$__SECRET_IN$1[4]; | ||
var accumulateTwoPhaseDispatches$1 = _ReactDOM$__SECRET_IN$1[5]; | ||
var accumulateDirectDispatches$1 = _ReactDOM$__SECRET_IN$1[6]; | ||
var enqueueStateRestore$1 = _ReactDOM$__SECRET_IN$1[7]; | ||
var restoreStateIfNeeded$1 = _ReactDOM$__SECRET_IN$1[8]; | ||
var dispatchEvent$1 = _ReactDOM$__SECRET_IN$1[9]; | ||
var runEventsInBatch$1 = _ReactDOM$__SECRET_IN$1[10]; | ||
var flushPassiveEffects$1 = _ReactDOM$__SECRET_IN$1[11]; | ||
var IsThisRendererActing$1 = _ReactDOM$__SECRET_IN$1[12]; | ||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events, | ||
/* eslint-disable no-unused-vars */ | ||
getInstanceFromNode = _ReactDOM$__SECRET_IN[0], | ||
getNodeFromInstance = _ReactDOM$__SECRET_IN[1], | ||
getFiberCurrentPropsFromNode = _ReactDOM$__SECRET_IN[2], | ||
injectEventPluginsByName = _ReactDOM$__SECRET_IN[3], | ||
eventNameDispatchConfigs = _ReactDOM$__SECRET_IN[4], | ||
accumulateTwoPhaseDispatches = _ReactDOM$__SECRET_IN[5], | ||
accumulateDirectDispatches = _ReactDOM$__SECRET_IN[6], | ||
enqueueStateRestore = _ReactDOM$__SECRET_IN[7], | ||
restoreStateIfNeeded = _ReactDOM$__SECRET_IN[8], | ||
dispatchEvent = _ReactDOM$__SECRET_IN[9], | ||
runEventsInBatch = _ReactDOM$__SECRET_IN[10], | ||
/* eslint-enable no-unused-vars */ | ||
flushPassiveEffects = _ReactDOM$__SECRET_IN[11], | ||
IsThisRendererActing = _ReactDOM$__SECRET_IN[12]; | ||
var batchedUpdates = ReactDOM.unstable_batchedUpdates; | ||
@@ -1064,3 +899,3 @@ var IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing; // this implementation should be exactly the same in | ||
while (flushPassiveEffects$1()) { | ||
while (flushPassiveEffects()) { | ||
didFlushWork = true; | ||
@@ -1075,3 +910,3 @@ } | ||
flushWork(); | ||
enqueueTask$1(function () { | ||
enqueueTask(function () { | ||
if (flushWork()) { | ||
@@ -1091,3 +926,5 @@ flushWorkAndMicroTasks(onDone); | ||
var actingUpdatesScopeDepth = 0; | ||
function act(callback) { | ||
var previousActingUpdatesScopeDepth = actingUpdatesScopeDepth; | ||
@@ -1098,5 +935,5 @@ var previousIsSomeRendererActing; | ||
previousIsSomeRendererActing = IsSomeRendererActing.current; | ||
previousIsThisRendererActing = IsThisRendererActing$1.current; | ||
previousIsThisRendererActing = IsThisRendererActing.current; | ||
IsSomeRendererActing.current = true; | ||
IsThisRendererActing$1.current = true; | ||
IsThisRendererActing.current = true; | ||
@@ -1106,3 +943,3 @@ function onDone() { | ||
IsSomeRendererActing.current = previousIsSomeRendererActing; | ||
IsThisRendererActing$1.current = previousIsThisRendererActing; | ||
IsThisRendererActing.current = previousIsThisRendererActing; | ||
@@ -1112,3 +949,3 @@ { | ||
// if it's _less than_ previousActingUpdatesScopeDepth, then we can assume the 'other' one has warned | ||
warningWithoutStack$1(false, 'You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. '); | ||
error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. '); | ||
} | ||
@@ -1138,3 +975,3 @@ } | ||
if (called === false) { | ||
warningWithoutStack$1(false, 'You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, interleaving multiple act ' + 'calls and mixing their scopes. You should - await act(async () => ...);'); | ||
error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, interleaving multiple act ' + 'calls and mixing their scopes. You should - await act(async () => ...);'); | ||
} | ||
@@ -1177,3 +1014,5 @@ }); | ||
{ | ||
!(result === undefined) ? warningWithoutStack$1(false, 'The callback passed to act(...) function ' + 'must return undefined, or a Promise. You returned %s', result) : void 0; | ||
if (result !== undefined) { | ||
error('The callback passed to act(...) function ' + 'must return undefined, or a Promise. You returned %s', result); | ||
} | ||
} // flush effects until none remain, and cleanup | ||
@@ -1199,3 +1038,3 @@ | ||
{ | ||
warningWithoutStack$1(false, 'Do not await the result of calling act(...) with sync logic, it is not a Promise.'); | ||
error('Do not await the result of calling act(...) with sync logic, it is not a Promise.'); | ||
} | ||
@@ -1212,17 +1051,25 @@ | ||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events; | ||
var getInstanceFromNode = _ReactDOM$__SECRET_IN[0]; | ||
var getNodeFromInstance = _ReactDOM$__SECRET_IN[1]; | ||
var getFiberCurrentPropsFromNode = _ReactDOM$__SECRET_IN[2]; | ||
var injectEventPluginsByName = _ReactDOM$__SECRET_IN[3]; | ||
var eventNameDispatchConfigs = _ReactDOM$__SECRET_IN[4]; | ||
var accumulateTwoPhaseDispatches = _ReactDOM$__SECRET_IN[5]; | ||
var accumulateDirectDispatches = _ReactDOM$__SECRET_IN[6]; | ||
var enqueueStateRestore = _ReactDOM$__SECRET_IN[7]; | ||
var restoreStateIfNeeded = _ReactDOM$__SECRET_IN[8]; | ||
var dispatchEvent = _ReactDOM$__SECRET_IN[9]; | ||
var runEventsInBatch = _ReactDOM$__SECRET_IN[10]; | ||
var flushPassiveEffects = _ReactDOM$__SECRET_IN[11]; | ||
var IsThisRendererActing = _ReactDOM$__SECRET_IN[12]; | ||
var _ReactDOM$__SECRET_IN$1 = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events, | ||
getInstanceFromNode$1 = _ReactDOM$__SECRET_IN$1[0], | ||
/* eslint-disable no-unused-vars */ | ||
getNodeFromInstance$1 = _ReactDOM$__SECRET_IN$1[1], | ||
getFiberCurrentPropsFromNode$1 = _ReactDOM$__SECRET_IN$1[2], | ||
injectEventPluginsByName$1 = _ReactDOM$__SECRET_IN$1[3], | ||
/* eslint-enable no-unused-vars */ | ||
eventNameDispatchConfigs$1 = _ReactDOM$__SECRET_IN$1[4], | ||
accumulateTwoPhaseDispatches$1 = _ReactDOM$__SECRET_IN$1[5], | ||
accumulateDirectDispatches$1 = _ReactDOM$__SECRET_IN$1[6], | ||
enqueueStateRestore$1 = _ReactDOM$__SECRET_IN$1[7], | ||
restoreStateIfNeeded$1 = _ReactDOM$__SECRET_IN$1[8], | ||
dispatchEvent$1 = _ReactDOM$__SECRET_IN$1[9], | ||
runEventsInBatch$1 = _ReactDOM$__SECRET_IN$1[10], | ||
/* eslint-disable no-unused-vars */ | ||
flushPassiveEffects$1 = _ReactDOM$__SECRET_IN$1[11], | ||
IsThisRendererActing$1 | ||
/* eslint-enable no-unused-vars */ | ||
= _ReactDOM$__SECRET_IN$1[12]; | ||
function Event(suffix) {} | ||
@@ -1245,3 +1092,3 @@ | ||
fakeNativeEvent.target = node; | ||
dispatchEvent(topLevelType, PLUGIN_EVENT_SYSTEM, fakeNativeEvent); | ||
dispatchEvent$1(topLevelType, PLUGIN_EVENT_SYSTEM, document, fakeNativeEvent); | ||
} | ||
@@ -1333,3 +1180,3 @@ /** | ||
{ | ||
throw Error(methodName + "(...): the first argument must be a React class instance. Instead received: " + received + "."); | ||
throw Error( methodName + "(...): the first argument must be a React class instance. Instead received: " + received + "." ); | ||
} | ||
@@ -1421,3 +1268,3 @@ } | ||
{ | ||
throw Error("TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument."); | ||
throw Error( "TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument." ); | ||
} | ||
@@ -1526,5 +1373,8 @@ } | ||
mockComponent: function (module, mockTagName) { | ||
if (!hasWarnedAboutDeprecatedMockComponent) { | ||
hasWarnedAboutDeprecatedMockComponent = true; | ||
lowPriorityWarningWithoutStack$1(false, 'ReactTestUtils.mockComponent() is deprecated. ' + 'Use shallow rendering or jest.mock() instead.\n\n' + 'See https://fb.me/test-utils-mock-component for more information.'); | ||
{ | ||
if (!hasWarnedAboutDeprecatedMockComponent) { | ||
hasWarnedAboutDeprecatedMockComponent = true; | ||
warn('ReactTestUtils.mockComponent() is deprecated. ' + 'Use shallow rendering or jest.mock() instead.\n\n' + 'See https://fb.me/test-utils-mock-component for more information.'); | ||
} | ||
} | ||
@@ -1563,3 +1413,3 @@ | ||
{ | ||
throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering."); | ||
throw Error( "TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering." ); | ||
} | ||
@@ -1570,7 +1420,7 @@ } | ||
{ | ||
throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead."); | ||
throw Error( "TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead." ); | ||
} | ||
} | ||
var dispatchConfig = eventNameDispatchConfigs[eventType]; | ||
var dispatchConfig = eventNameDispatchConfigs$1[eventType]; | ||
var fakeNativeEvent = new Event(); | ||
@@ -1581,3 +1431,3 @@ fakeNativeEvent.target = domNode; | ||
var targetInst = getInstanceFromNode(domNode); | ||
var targetInst = getInstanceFromNode$1(domNode); | ||
var event = new SyntheticEvent(dispatchConfig, targetInst, fakeNativeEvent, domNode); // Since we aren't using pooling, always persist the event. This will make | ||
@@ -1591,5 +1441,5 @@ // sure it's marked and won't warn when setting additional properties. | ||
if (dispatchConfig.phasedRegistrationNames) { | ||
accumulateTwoPhaseDispatches(event); | ||
accumulateTwoPhaseDispatches$1(event); | ||
} else { | ||
accumulateDirectDispatches(event); | ||
accumulateDirectDispatches$1(event); | ||
} | ||
@@ -1600,6 +1450,6 @@ | ||
// do that since we're by-passing it here. | ||
enqueueStateRestore(domNode); | ||
runEventsInBatch(event); | ||
enqueueStateRestore$1(domNode); | ||
runEventsInBatch$1(event); | ||
}); | ||
restoreStateIfNeeded(); | ||
restoreStateIfNeeded$1(); | ||
}; | ||
@@ -1612,3 +1462,3 @@ } | ||
for (eventType in eventNameDispatchConfigs) { | ||
for (eventType in eventNameDispatchConfigs$1) { | ||
/** | ||
@@ -1665,9 +1515,2 @@ * @param {!Element|ReactDOMComponent} domComponentOrNode | ||
var ReactTestUtils$2 = Object.freeze({ | ||
default: ReactTestUtils | ||
}); | ||
var ReactTestUtils$3 = ( ReactTestUtils$2 && ReactTestUtils ) || ReactTestUtils$2; | ||
// TODO: decide on the top-level export form. | ||
@@ -1677,3 +1520,3 @@ // This is hacky but makes it work with both Rollup and Jest. | ||
var testUtils = ReactTestUtils$3.default || ReactTestUtils$3; | ||
var testUtils = ReactTestUtils.default || ReactTestUtils; | ||
@@ -1680,0 +1523,0 @@ module.exports = testUtils; |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-test-utils.production.min.js | ||
@@ -20,17 +20,17 @@ * | ||
var D={animationend:C("Animation","AnimationEnd"),animationiteration:C("Animation","AnimationIteration"),animationstart:C("Animation","AnimationStart"),transitionend:C("Transition","TransitionEnd")},E={},F={};B&&(F=document.createElement("div").style,"AnimationEvent"in window||(delete D.animationend.animation,delete D.animationiteration.animation,delete D.animationstart.animation),"TransitionEvent"in window||delete D.transitionend.transition); | ||
function G(a){if(E[a])return E[a];if(!D[a])return a;var b=D[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in F)return E[a]=b[c];return a}var H=G("animationend"),aa=G("animationiteration"),ba=G("animationstart"),ca=G("transitionend"),I;try{var da=("require"+Math.random()).slice(0,7);I=(module&&module[da])("timers").setImmediate}catch(a){I=function(b){var c=new MessageChannel;c.port1.onmessage=b;c.port2.postMessage(void 0)}} | ||
var ea=I,J=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,fa=J[11],K=J[12],ha=m.unstable_batchedUpdates,L=q.IsSomeRendererActing,M="function"===typeof n.unstable_flushAllWithoutAsserting,N=n.unstable_flushAllWithoutAsserting||function(){for(var a=!1;fa();)a=!0;return a};function O(a){try{N(),ea(function(){N()?O(a):a()})}catch(b){a(b)}}var P=0,Q=!1,ia=m.findDOMNode,R=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,ja=R[0],S=R[4],ka=R[5],la=R[6],ma=R[7],na=R[8],T=R[9],oa=R[10]; | ||
function U(){}function pa(a,b){if(!a)return[];a=u(a);if(!a)return[];for(var c=a,e=[];;){if(5===c.tag||6===c.tag||1===c.tag||0===c.tag){var d=c.stateNode;b(d)&&e.push(d)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return e;for(;!c.sibling;){if(!c.return||c.return===a)return e;c=c.return}c.sibling.return=c.return;c=c.sibling}}} | ||
function V(a,b){if(a&&!a._reactInternalFiber){var c=""+a;a=Array.isArray(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c;throw Error(p(286,b,a));}} | ||
var W={renderIntoDocument:function(a){var b=document.createElement("div");return m.render(a,b)},isElement:function(a){return k.isValidElement(a)},isElementOfType:function(a,b){return k.isValidElement(a)&&a.type===b},isDOMComponent:function(a){return!(!a||1!==a.nodeType||!a.tagName)},isDOMComponentElement:function(a){return!!(a&&k.isValidElement(a)&&a.tagName)},isCompositeComponent:function(a){return W.isDOMComponent(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState},isCompositeComponentWithType:function(a, | ||
b){return W.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){V(a,"findAllInRenderedTree");return a?pa(a._reactInternalFiber,b):[]},scryRenderedDOMComponentsWithClass:function(a,b){V(a,"scryRenderedDOMComponentsWithClass");return W.findAllInRenderedTree(a,function(a){if(W.isDOMComponent(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var d=c.split(/\s+/);if(!Array.isArray(b)){if(void 0===b)throw Error(p(11));b=b.split(/\s+/)}return b.every(function(a){return-1!== | ||
d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){V(a,"findRenderedDOMComponentWithClass");a=W.scryRenderedDOMComponentsWithClass(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]},scryRenderedDOMComponentsWithTag:function(a,b){V(a,"scryRenderedDOMComponentsWithTag");return W.findAllInRenderedTree(a,function(a){return W.isDOMComponent(a)&&a.tagName.toUpperCase()===b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a, | ||
b){V(a,"findRenderedDOMComponentWithTag");a=W.scryRenderedDOMComponentsWithTag(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]},scryRenderedComponentsWithType:function(a,b){V(a,"scryRenderedComponentsWithType");return W.findAllInRenderedTree(a,function(a){return W.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a,b){V(a,"findRenderedComponentWithType");a=W.scryRenderedComponentsWithType(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+ | ||
a.length+") for componentType:"+b);return a[0]},mockComponent:function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return k.createElement(b,null,this.props.children)});return this},nativeTouchData:function(a,b){return{touches:[{pageX:a,pageY:b}]}},Simulate:null,SimulateNative:{},act:function(a){function b(){P--;L.current=c;K.current=e}!1===Q&&(Q=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected."));P++;var c= | ||
L.current;var e=K.current;L.current=!0;K.current=!0;try{var d=ha(a)}catch(f){throw b(),f;}if(null!==d&&"object"===typeof d&&"function"===typeof d.then)return{then:function(a,e){d.then(function(){1<P||!0===M&&!0===c?(b(),a()):O(function(c){b();c?e(c):a()})},function(a){b();e(a)})}};try{1!==P||!1!==M&&!1!==c||N(),b()}catch(f){throw b(),f;}return{then:function(a){a()}}}}; | ||
function qa(a){return function(b,c){if(k.isValidElement(b))throw Error(p(228));if(W.isCompositeComponent(b))throw Error(p(229));var e=S[a],d=new U;d.target=b;d.type=a.toLowerCase();var f=ja(b),h=new x(e,f,d,b);h.persist();g(h,c);e.phasedRegistrationNames?ka(h):la(h);m.unstable_batchedUpdates(function(){ma(b);oa(h)});na()}}W.Simulate={};for(var X in S)W.Simulate[X]=qa(X); | ||
function ra(a,b){return function(c,e){var d=new U(a);g(d,e);W.isDOMComponent(c)?(c=ia(c),d.target=c,T(b,1,d)):c.tagName&&(d.target=c,T(b,1,d))}} | ||
[["abort","abort"],[H,"animationEnd"],[aa,"animationIteration"],[ba,"animationStart"],["blur","blur"],["canplaythrough","canPlayThrough"],["canplay","canPlay"],["cancel","cancel"],["change","change"],["click","click"],["close","close"],["compositionend","compositionEnd"],["compositionstart","compositionStart"],["compositionupdate","compositionUpdate"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragenter","dragEnter"],["dragexit", | ||
"dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["dragstart","dragStart"],["drag","drag"],["drop","drop"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["focus","focus"],["input","input"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["loadstart","loadStart"],["loadstart","loadStart"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["mousedown","mouseDown"],["mousemove", | ||
"mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["playing","playing"],["progress","progress"],["ratechange","rateChange"],["scroll","scroll"],["seeked","seeked"],["seeking","seeking"],["selectionchange","selectionChange"],["stalled","stalled"],["suspend","suspend"],["textInput","textInput"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchmove","touchMove"], | ||
["touchstart","touchStart"],[ca,"transitionEnd"],["volumechange","volumeChange"],["waiting","waiting"],["wheel","wheel"]].forEach(function(a){var b=a[1];W.SimulateNative[b]=ra(b,a[0])});var Y={default:W},Z=Y&&W||Y;module.exports=Z.default||Z; | ||
function G(a){if(E[a])return E[a];if(!D[a])return a;var b=D[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in F)return E[a]=b[c];return a}var H=G("animationend"),I=G("animationiteration"),J=G("animationstart"),aa=G("transitionend"),K=null;function ba(a){if(null===K)try{var b=("require"+Math.random()).slice(0,7);K=(module&&module[b])("timers").setImmediate}catch(c){K=function(a){var b=new MessageChannel;b.port1.onmessage=a;b.port2.postMessage(void 0)}}return K(a)} | ||
var L=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,ca=L[11],M=L[12],da=m.unstable_batchedUpdates,N=q.IsSomeRendererActing,O="function"===typeof n.unstable_flushAllWithoutAsserting,P=n.unstable_flushAllWithoutAsserting||function(){for(var a=!1;ca();)a=!0;return a};function Q(a){try{P(),ba(function(){P()?Q(a):a()})}catch(b){a(b)}}var R=0,S=!1,ea=m.findDOMNode,T=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,fa=T[0],U=T[4],ha=T[5],ia=T[6],ja=T[7],ka=T[8],V=T[9],la=T[10]; | ||
function W(){}function ma(a,b){if(!a)return[];a=u(a);if(!a)return[];for(var c=a,e=[];;){if(5===c.tag||6===c.tag||1===c.tag||0===c.tag){var d=c.stateNode;b(d)&&e.push(d)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return e;for(;!c.sibling;){if(!c.return||c.return===a)return e;c=c.return}c.sibling.return=c.return;c=c.sibling}}} | ||
function X(a,b){if(a&&!a._reactInternalFiber){var c=""+a;a=Array.isArray(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c;throw Error(p(286,b,a));}} | ||
var Y={renderIntoDocument:function(a){var b=document.createElement("div");return m.render(a,b)},isElement:function(a){return k.isValidElement(a)},isElementOfType:function(a,b){return k.isValidElement(a)&&a.type===b},isDOMComponent:function(a){return!(!a||1!==a.nodeType||!a.tagName)},isDOMComponentElement:function(a){return!!(a&&k.isValidElement(a)&&a.tagName)},isCompositeComponent:function(a){return Y.isDOMComponent(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState},isCompositeComponentWithType:function(a, | ||
b){return Y.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){X(a,"findAllInRenderedTree");return a?ma(a._reactInternalFiber,b):[]},scryRenderedDOMComponentsWithClass:function(a,b){X(a,"scryRenderedDOMComponentsWithClass");return Y.findAllInRenderedTree(a,function(a){if(Y.isDOMComponent(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var d=c.split(/\s+/);if(!Array.isArray(b)){if(void 0===b)throw Error(p(11));b=b.split(/\s+/)}return b.every(function(a){return-1!== | ||
d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){X(a,"findRenderedDOMComponentWithClass");a=Y.scryRenderedDOMComponentsWithClass(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]},scryRenderedDOMComponentsWithTag:function(a,b){X(a,"scryRenderedDOMComponentsWithTag");return Y.findAllInRenderedTree(a,function(a){return Y.isDOMComponent(a)&&a.tagName.toUpperCase()===b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a, | ||
b){X(a,"findRenderedDOMComponentWithTag");a=Y.scryRenderedDOMComponentsWithTag(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]},scryRenderedComponentsWithType:function(a,b){X(a,"scryRenderedComponentsWithType");return Y.findAllInRenderedTree(a,function(a){return Y.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a,b){X(a,"findRenderedComponentWithType");a=Y.scryRenderedComponentsWithType(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+ | ||
a.length+") for componentType:"+b);return a[0]},mockComponent:function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return k.createElement(b,null,this.props.children)});return this},nativeTouchData:function(a,b){return{touches:[{pageX:a,pageY:b}]}},Simulate:null,SimulateNative:{},act:function(a){function b(){R--;N.current=c;M.current=e}!1===S&&(S=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected."));R++;var c= | ||
N.current;var e=M.current;N.current=!0;M.current=!0;try{var d=da(a)}catch(f){throw b(),f;}if(null!==d&&"object"===typeof d&&"function"===typeof d.then)return{then:function(a,e){d.then(function(){1<R||!0===O&&!0===c?(b(),a()):Q(function(c){b();c?e(c):a()})},function(a){b();e(a)})}};try{1!==R||!1!==O&&!1!==c||P(),b()}catch(f){throw b(),f;}return{then:function(a){a()}}}}; | ||
function na(a){return function(b,c){if(k.isValidElement(b))throw Error(p(228));if(Y.isCompositeComponent(b))throw Error(p(229));var e=U[a],d=new W;d.target=b;d.type=a.toLowerCase();var f=fa(b),h=new x(e,f,d,b);h.persist();g(h,c);e.phasedRegistrationNames?ha(h):ia(h);m.unstable_batchedUpdates(function(){ja(b);la(h)});ka()}}Y.Simulate={};for(var Z in U)Y.Simulate[Z]=na(Z); | ||
function oa(a,b){return function(c,e){var d=new W(a);g(d,e);Y.isDOMComponent(c)?(c=ea(c),d.target=c,V(b,1,document,d)):c.tagName&&(d.target=c,V(b,1,document,d))}} | ||
[["abort","abort"],[H,"animationEnd"],[I,"animationIteration"],[J,"animationStart"],["blur","blur"],["canplaythrough","canPlayThrough"],["canplay","canPlay"],["cancel","cancel"],["change","change"],["click","click"],["close","close"],["compositionend","compositionEnd"],["compositionstart","compositionStart"],["compositionupdate","compositionUpdate"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragenter","dragEnter"],["dragexit","dragExit"], | ||
["dragleave","dragLeave"],["dragover","dragOver"],["dragstart","dragStart"],["drag","drag"],["drop","drop"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["focus","focus"],["input","input"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["loadstart","loadStart"],["loadstart","loadStart"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["mousedown","mouseDown"],["mousemove","mouseMove"], | ||
["mouseout","mouseOut"],["mouseover","mouseOver"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["playing","playing"],["progress","progress"],["ratechange","rateChange"],["scroll","scroll"],["seeked","seeked"],["seeking","seeking"],["selectionchange","selectionChange"],["stalled","stalled"],["suspend","suspend"],["textInput","textInput"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchmove","touchMove"],["touchstart", | ||
"touchStart"],[aa,"transitionEnd"],["volumechange","volumeChange"],["waiting","waiting"],["wheel","wheel"]].forEach(function(a){var b=a[1];Y.SimulateNative[b]=oa(b,a[0])});module.exports=Y.default||Y; |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-unstable-fizz.browser.development.js | ||
@@ -24,3 +24,2 @@ * | ||
} | ||
function writeChunk(destination, buffer) { | ||
@@ -30,3 +29,2 @@ destination.enqueue(buffer); | ||
} | ||
function close(destination) { | ||
@@ -59,9 +57,2 @@ destination.close(); | ||
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary | ||
// (unstable) APIs that have been removed. Can we remove the symbols? | ||
function createRequest(children, destination) { | ||
@@ -104,2 +95,3 @@ return { | ||
request.completedChunks = []; | ||
try { | ||
@@ -111,3 +103,2 @@ for (var i = 0; i < chunks.length; i++) { | ||
} finally { | ||
} | ||
@@ -129,5 +120,2 @@ | ||
// This file intentionally does *not* have the Flow annotation. | ||
// Don't add it. See `./inline-typed.js` for an explanation. | ||
function renderToReadableStream(children) { | ||
@@ -151,8 +139,2 @@ var request; | ||
var ReactDOMFizzServerBrowser$1 = Object.freeze({ | ||
default: ReactDOMFizzServerBrowser | ||
}); | ||
var ReactDOMFizzServerBrowser$2 = ( ReactDOMFizzServerBrowser$1 && ReactDOMFizzServerBrowser ) || ReactDOMFizzServerBrowser$1; | ||
// TODO: decide on the top-level export form. | ||
@@ -162,3 +144,3 @@ // This is hacky but makes it work with both Rollup and Jest | ||
var unstableFizz_browser = ReactDOMFizzServerBrowser$2.default || ReactDOMFizzServerBrowser$2; | ||
var unstableFizz_browser = ReactDOMFizzServerBrowser.default || ReactDOMFizzServerBrowser; | ||
@@ -165,0 +147,0 @@ module.exports = unstableFizz_browser; |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-unstable-fizz.browser.production.min.js | ||
@@ -11,2 +11,2 @@ * | ||
'use strict';var e=new TextEncoder;function g(b,c){var a="<"+b+">";"string"===typeof c.children&&(a+=c.children);return a+("</"+b+">")}var h="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function k(b){var c=b.destination,a=b.completedChunks;b.completedChunks=[];for(b=0;b<a.length;b++)c.enqueue(a[b]);c.close()} | ||
var l={renderToReadableStream:function(b){var c;return new ReadableStream({start:function(a){a=c={destination:a,children:b,completedChunks:[],flowing:!1};a.flowing=!0;var d=a.children;a.children=null;if(!d||d.$$typeof===h){var f=d.type;d=d.props;"string"===typeof f&&(a.completedChunks.push(e.encode(g(f,d))),a.flowing&&k(a))}},pull:function(){var a=c;a.flowing=!1;k(a)},cancel:function(){}})}},m={default:l},n=m&&l||m;module.exports=n.default||n; | ||
var l={renderToReadableStream:function(b){var c;return new ReadableStream({start:function(a){a=c={destination:a,children:b,completedChunks:[],flowing:!1};a.flowing=!0;var d=a.children;a.children=null;if(!d||d.$$typeof===h){var f=d.type;d=d.props;"string"===typeof f&&(a.completedChunks.push(e.encode(g(f,d))),a.flowing&&k(a))}},pull:function(){var a=c;a.flowing=!1;k(a)},cancel:function(){}})}};module.exports=l.default||l; |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-unstable-fizz.node.development.js | ||
@@ -76,9 +76,2 @@ * | ||
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary | ||
// (unstable) APIs that have been removed. Can we remove the symbols? | ||
function createRequest(children, destination) { | ||
@@ -146,5 +139,2 @@ return { | ||
// This file intentionally does *not* have the Flow annotation. | ||
// Don't add it. See `./inline-typed.js` for an explanation. | ||
function createDrainHandler(destination, request) { | ||
@@ -166,8 +156,2 @@ return function () { | ||
var ReactDOMFizzServerNode$1 = Object.freeze({ | ||
default: ReactDOMFizzServerNode | ||
}); | ||
var ReactDOMFizzServerNode$2 = ( ReactDOMFizzServerNode$1 && ReactDOMFizzServerNode ) || ReactDOMFizzServerNode$1; | ||
// TODO: decide on the top-level export form. | ||
@@ -177,3 +161,3 @@ // This is hacky but makes it work with both Rollup and Jest | ||
var unstableFizz_node = ReactDOMFizzServerNode$2.default || ReactDOMFizzServerNode$2; | ||
var unstableFizz_node = ReactDOMFizzServerNode.default || ReactDOMFizzServerNode; | ||
@@ -180,0 +164,0 @@ module.exports = unstableFizz_node; |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-unstable-fizz.node.production.min.js | ||
@@ -11,3 +11,3 @@ * | ||
'use strict';function d(a,b){var c="<"+a+">";"string"===typeof b.children&&(c+=b.children);return c+("</"+a+">")}var e="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function f(a){var b=a.destination,c=a.completedChunks;a.completedChunks=[];"function"===typeof b.cork&&b.cork();try{for(a=0;a<c.length;a++)b.write(c[a])}finally{"function"===typeof b.uncork&&b.uncork()}b.end()} | ||
function g(a){a.flowing=!0;setImmediate(function(){var b=a.children;a.children=null;if(!b||b.$$typeof===e){var c=b.type;b=b.props;"string"===typeof c&&(a.completedChunks.push(Buffer.from(d(c,b),"utf8")),a.flowing&&f(a),c=a.destination,"function"===typeof c.flush&&"function"!==typeof c.flushHeaders&&c.flush())}})}function h(a,b){return function(){b.flowing=!1;f(b)}} | ||
var k={pipeToNodeWritable:function(a,b){a={destination:b,children:a,completedChunks:[],flowing:!1};b.on("drain",h(b,a));g(a)}},l={default:k},m=l&&k||l;module.exports=m.default||m; | ||
function g(a){a.flowing=!0;setImmediate(function(){var b=a.children;a.children=null;if(!b||b.$$typeof===e){var c=b.type;b=b.props;"string"===typeof c&&(a.completedChunks.push(Buffer.from(d(c,b),"utf8")),a.flowing&&f(a),c=a.destination,"function"===typeof c.flush&&"function"!==typeof c.flushHeaders&&c.flush())}})}function h(a,b){return function(){b.flowing=!1;f(b)}}var k={pipeToNodeWritable:function(a,b){a={destination:b,children:a,completedChunks:[],flowing:!1};b.on("drain",h(b,a));g(a)}}; | ||
module.exports=k.default||k; |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-unstable-native-dependencies.development.js | ||
@@ -19,19 +19,84 @@ * | ||
var ReactDOM = require('react-dom'); | ||
var React = require('react'); | ||
var _assign = require('object-assign'); | ||
// Do not require this module directly! Use normal `invariant` calls with | ||
// template literal strings. The messages will be replaced with error codes | ||
// during build. | ||
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. | ||
// Current owner and dispatcher used to share the same ref, | ||
// but PR #14548 split them out to better support the react-debug-tools package. | ||
/** | ||
* Use invariant() to assert state which your program assumes to be true. | ||
* | ||
* Provide sprintf-style format (only %s is supported) and arguments | ||
* to provide information about what broke and what you were | ||
* expecting. | ||
* | ||
* The invariant message will be stripped in production, but the invariant | ||
* will remain to ensure logic does not differ in production. | ||
*/ | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { | ||
ReactSharedInternals.ReactCurrentDispatcher = { | ||
current: null | ||
}; | ||
} | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { | ||
ReactSharedInternals.ReactCurrentBatchConfig = { | ||
suspense: null | ||
}; | ||
} | ||
// by calls to these methods by a Babel plugin. | ||
// | ||
// In PROD (or in packages without access to React internals), | ||
// they are left as they are instead. | ||
function warn(format) { | ||
{ | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
printWarning('warn', format, args); | ||
} | ||
} | ||
function error(format) { | ||
{ | ||
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
args[_key2 - 1] = arguments[_key2]; | ||
} | ||
printWarning('error', format, args); | ||
} | ||
} | ||
function printWarning(level, format, args) { | ||
// When changing this logic, you might want to also | ||
// update consoleWithStackDev.www.js as well. | ||
{ | ||
var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; | ||
if (!hasExistingStack) { | ||
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; | ||
var stack = ReactDebugCurrentFrame.getStackAddendum(); | ||
if (stack !== '') { | ||
format += '%s'; | ||
args = args.concat([stack]); | ||
} | ||
} | ||
var argsWithFormat = args.map(function (item) { | ||
return '' + item; | ||
}); // Careful: RN currently depends on this prefix | ||
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it | ||
// breaks IE9: https://github.com/facebook/react/issues/13610 | ||
// eslint-disable-next-line react-internal/no-production-logging | ||
Function.prototype.apply.call(console[level], console, argsWithFormat); | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
throw new Error(message); | ||
} catch (x) {} | ||
} | ||
} | ||
{ | ||
@@ -60,101 +125,17 @@ // In DEV mode, we swap out invokeGuardedCallback for a special version | ||
var fakeNode = document.createElement('react'); | ||
} | ||
} | ||
/** | ||
* Call a function while guarding against errors that happens within it. | ||
* Returns an error if it throws, otherwise null. | ||
* | ||
* In production, this is implemented using a try-catch. The reason we don't | ||
* use a try-catch directly is so that we can swap out a different | ||
* implementation in DEV mode. | ||
* | ||
* @param {String} name of the guard to use for logging or debugging | ||
* @param {Function} func The function to invoke | ||
* @param {*} context The context to use when calling the function | ||
* @param {...*} args Arguments for function | ||
*/ | ||
/** | ||
* Same as invokeGuardedCallback, but instead of returning an error, it stores | ||
* it in a global so it can be rethrown by `rethrowCaughtError` later. | ||
* TODO: See if caughtError and rethrowError can be unified. | ||
* | ||
* @param {String} name of the guard to use for logging or debugging | ||
* @param {Function} func The function to invoke | ||
* @param {*} context The context to use when calling the function | ||
* @param {...*} args Arguments for function | ||
*/ | ||
/** | ||
* During execution of guarded functions we will capture the first error which | ||
* we will rethrow to be handled by the top level error handler. | ||
*/ | ||
/** | ||
* Similar to invariant but only logs a warning if the condition is not met. | ||
* This can be used to log issues in development environments in critical | ||
* paths. Removing the logging code for production environments will keep the | ||
* same logic and follow the same code paths. | ||
*/ | ||
var warningWithoutStack = function () {}; | ||
{ | ||
warningWithoutStack = function (condition, format) { | ||
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
if (format === undefined) { | ||
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); | ||
} | ||
if (args.length > 8) { | ||
// Check before the condition to catch violations early. | ||
throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); | ||
} | ||
if (condition) { | ||
return; | ||
} | ||
if (typeof console !== 'undefined') { | ||
var argsWithFormat = args.map(function (item) { | ||
return '' + item; | ||
}); | ||
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it | ||
// breaks IE9: https://github.com/facebook/react/issues/13610 | ||
Function.prototype.apply.call(console.error, console, argsWithFormat); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
} | ||
var warningWithoutStack$1 = warningWithoutStack; | ||
var getFiberCurrentPropsFromNode$1 = null; | ||
var getInstanceFromNode$1 = null; | ||
var getNodeFromInstance$1 = null; | ||
var getFiberCurrentPropsFromNode = null; | ||
var getInstanceFromNode = null; | ||
var getNodeFromInstance = null; | ||
function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { | ||
getFiberCurrentPropsFromNode$1 = getFiberCurrentPropsFromNodeImpl; | ||
getInstanceFromNode$1 = getInstanceFromNodeImpl; | ||
getNodeFromInstance$1 = getNodeFromInstanceImpl; | ||
getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; | ||
getInstanceFromNode = getInstanceFromNodeImpl; | ||
getNodeFromInstance = getNodeFromInstanceImpl; | ||
{ | ||
!(getNodeFromInstance$1 && getInstanceFromNode$1) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; | ||
if (!getNodeFromInstance || !getInstanceFromNode) { | ||
error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.'); | ||
} | ||
} | ||
@@ -172,20 +153,9 @@ } | ||
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; | ||
!(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0; | ||
if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) { | ||
error('EventPluginUtils: Invalid `event`.'); | ||
} | ||
}; | ||
} | ||
/** | ||
* Dispatch the event to the listener. | ||
* @param {SyntheticEvent} event SyntheticEvent to handle | ||
* @param {function} listener Application-level callback | ||
* @param {*} inst Internal component instance | ||
*/ | ||
/** | ||
* Standard/simple iteration through an event's collected dispatches. | ||
*/ | ||
/** | ||
* Standard/simple iteration through an event's collected dispatches, but stops | ||
@@ -256,7 +226,7 @@ * at the first dispatch execution returning true, and returns that id. | ||
{ | ||
throw Error("executeDirectDispatch(...): Invalid `event`."); | ||
throw Error( "executeDirectDispatch(...): Invalid `event`." ); | ||
} | ||
} | ||
event.currentTarget = dispatchListener ? getNodeFromInstance$1(dispatchInstance) : null; | ||
event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) : null; | ||
var res = dispatchListener ? dispatchListener(event) : null; | ||
@@ -277,8 +247,2 @@ event.currentTarget = null; | ||
// Before we know whether it is function or class | ||
// Root of a host tree. Could be nested inside another node. | ||
// A subtree. Could be an entry point to a different renderer. | ||
var HostComponent = 5; | ||
@@ -390,67 +354,65 @@ | ||
} | ||
/** | ||
* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that | ||
* should would receive a `mouseEnter` or `mouseLeave` event. | ||
* | ||
* Does not invoke the callback on the nearest common ancestor because nothing | ||
* "entered" or "left" that element. | ||
*/ | ||
/** | ||
* Registers plugins so that they can extract and dispatch events. | ||
* | ||
* @see {EventPluginHub} | ||
*/ | ||
function isInteractive(tag) { | ||
return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; | ||
} | ||
/** | ||
* Ordered list of injected plugins. | ||
*/ | ||
function shouldPreventMouseEvent(name, type, props) { | ||
switch (name) { | ||
case 'onClick': | ||
case 'onClickCapture': | ||
case 'onDoubleClick': | ||
case 'onDoubleClickCapture': | ||
case 'onMouseDown': | ||
case 'onMouseDownCapture': | ||
case 'onMouseMove': | ||
case 'onMouseMoveCapture': | ||
case 'onMouseUp': | ||
case 'onMouseUpCapture': | ||
case 'onMouseEnter': | ||
return !!(props.disabled && isInteractive(type)); | ||
default: | ||
return false; | ||
} | ||
} | ||
/** | ||
* Mapping from event name to dispatch config | ||
* @param {object} inst The instance, which is the source of events. | ||
* @param {string} registrationName Name of listener (e.g. `onClick`). | ||
* @return {?function} The stored callback. | ||
*/ | ||
/** | ||
* Mapping from registration name to plugin module | ||
*/ | ||
function getListener(inst, registrationName) { | ||
var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not | ||
// live here; needs to be moved to a better place soon | ||
var stateNode = inst.stateNode; | ||
/** | ||
* Mapping from registration name to event name | ||
*/ | ||
if (!stateNode) { | ||
// Work in progress (ex: onload events in incremental mode). | ||
return null; | ||
} | ||
var props = getFiberCurrentPropsFromNode(stateNode); | ||
/** | ||
* Mapping from lowercase registration names to the properly cased version, | ||
* used to warn in the case of missing event handlers. Available | ||
* only in true. | ||
* @type {Object} | ||
*/ | ||
if (!props) { | ||
// Work in progress. | ||
return null; | ||
} | ||
// Trust the developer to only use possibleRegistrationNames in true | ||
listener = props[registrationName]; | ||
/** | ||
* Injects an ordering of plugins (by plugin name). This allows the ordering | ||
* to be decoupled from injection of the actual plugins so that ordering is | ||
* always deterministic regardless of packaging, on-the-fly injection, etc. | ||
* | ||
* @param {array} InjectedEventPluginOrder | ||
* @internal | ||
* @see {EventPluginHub.injection.injectEventPluginOrder} | ||
*/ | ||
if (shouldPreventMouseEvent(registrationName, inst.type, props)) { | ||
return null; | ||
} | ||
if (!(!listener || typeof listener === 'function')) { | ||
{ | ||
throw Error( "Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type." ); | ||
} | ||
} | ||
/** | ||
* Injects plugins to be used by `EventPluginHub`. The plugin names must be | ||
* in the ordering injected by `injectEventPluginOrder`. | ||
* | ||
* Plugins can be injected as part of page initialization or on-the-fly. | ||
* | ||
* @param {object} injectedNamesToPlugins Map from names to plugin modules. | ||
* @internal | ||
* @see {EventPluginHub.injection.injectEventPluginsByName} | ||
*/ | ||
return listener; | ||
} | ||
@@ -473,3 +435,3 @@ /** | ||
{ | ||
throw Error("accumulateInto(...): Accumulated items must not be null or undefined."); | ||
throw Error( "accumulateInto(...): Accumulated items must not be null or undefined." ); | ||
} | ||
@@ -519,93 +481,3 @@ } | ||
function isInteractive(tag) { | ||
return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; | ||
} | ||
function shouldPreventMouseEvent(name, type, props) { | ||
switch (name) { | ||
case 'onClick': | ||
case 'onClickCapture': | ||
case 'onDoubleClick': | ||
case 'onDoubleClickCapture': | ||
case 'onMouseDown': | ||
case 'onMouseDownCapture': | ||
case 'onMouseMove': | ||
case 'onMouseMoveCapture': | ||
case 'onMouseUp': | ||
case 'onMouseUpCapture': | ||
return !!(props.disabled && isInteractive(type)); | ||
default: | ||
return false; | ||
} | ||
} | ||
/** | ||
* This is a unified interface for event plugins to be installed and configured. | ||
* | ||
* Event plugins can implement the following properties: | ||
* | ||
* `extractEvents` {function(string, DOMEventTarget, string, object): *} | ||
* Required. When a top-level event is fired, this method is expected to | ||
* extract synthetic events that will in turn be queued and dispatched. | ||
* | ||
* `eventTypes` {object} | ||
* Optional, plugins that fire events must publish a mapping of registration | ||
* names that are used to register listeners. Values of this mapping must | ||
* be objects that contain `registrationName` or `phasedRegistrationNames`. | ||
* | ||
* `executeDispatch` {function(object, function, string)} | ||
* Optional, allows plugins to override how an event gets dispatched. By | ||
* default, the listener is simply invoked. | ||
* | ||
* Each plugin that is injected into `EventsPluginHub` is immediately operable. | ||
* | ||
* @public | ||
*/ | ||
/** | ||
* Methods for injecting dependencies. | ||
*/ | ||
/** | ||
* @param {object} inst The instance, which is the source of events. | ||
* @param {string} registrationName Name of listener (e.g. `onClick`). | ||
* @return {?function} The stored callback. | ||
*/ | ||
function getListener(inst, registrationName) { | ||
var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not | ||
// live here; needs to be moved to a better place soon | ||
var stateNode = inst.stateNode; | ||
if (!stateNode) { | ||
// Work in progress (ex: onload events in incremental mode). | ||
return null; | ||
} | ||
var props = getFiberCurrentPropsFromNode$1(stateNode); | ||
if (!props) { | ||
// Work in progress. | ||
return null; | ||
} | ||
listener = props[registrationName]; | ||
if (shouldPreventMouseEvent(registrationName, inst.type, props)) { | ||
return null; | ||
} | ||
if (!(!listener || typeof listener === 'function')) { | ||
{ | ||
throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type."); | ||
} | ||
} | ||
return listener; | ||
} | ||
/** | ||
* Some event types have a notion of different registration names for different | ||
@@ -638,3 +510,5 @@ * "phases" of propagation. This finds listeners by a given phase. | ||
{ | ||
!inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0; | ||
if (!inst) { | ||
error('Dispatching inst must not be null'); | ||
} | ||
} | ||
@@ -712,3 +586,2 @@ | ||
} | ||
function accumulateDirectDispatches(events) { | ||
@@ -718,3 +591,2 @@ forEachAccumulated(events, accumulateDirectDispatchesSingle); | ||
/* eslint valid-typeof: 0 */ | ||
var EVENT_POOL_SIZE = 10; | ||
@@ -961,4 +833,5 @@ /** | ||
function warn(action, result) { | ||
var warningCondition = false; | ||
!warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0; | ||
{ | ||
error("This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result); | ||
} | ||
} | ||
@@ -984,3 +857,3 @@ } | ||
{ | ||
throw Error("Trying to release an event instance into a pool of a different type."); | ||
throw Error( "Trying to release an event instance into a pool of a different type." ); | ||
} | ||
@@ -1101,3 +974,3 @@ } | ||
{ | ||
throw Error("Touch object is missing identifier."); | ||
throw Error( "Touch object is missing identifier." ); | ||
} | ||
@@ -1107,3 +980,5 @@ } | ||
{ | ||
!(identifier <= MAX_TOUCH_BANK) ? warningWithoutStack$1(false, 'Touch identifier %s is greater than maximum supported %s which causes ' + 'performance issues backfilling array locations for all of the indices.', identifier, MAX_TOUCH_BANK) : void 0; | ||
if (identifier > MAX_TOUCH_BANK) { | ||
error('Touch identifier %s is greater than maximum supported %s which causes ' + 'performance issues backfilling array locations for all of the indices.', identifier, MAX_TOUCH_BANK); | ||
} | ||
} | ||
@@ -1140,3 +1015,5 @@ | ||
} else { | ||
console.warn('Cannot record touch move without a touch start.\n' + 'Touch Move: %s\n', 'Touch Bank: %s', printTouch(touch), printTouchBank()); | ||
{ | ||
warn('Cannot record touch move without a touch start.\n' + 'Touch Move: %s\n' + 'Touch Bank: %s', printTouch(touch), printTouchBank()); | ||
} | ||
} | ||
@@ -1158,3 +1035,5 @@ } | ||
} else { | ||
console.warn('Cannot record touch end without a touch start.\n' + 'Touch End: %s\n', 'Touch Bank: %s', printTouch(touch), printTouchBank()); | ||
{ | ||
warn('Cannot record touch end without a touch start.\n' + 'Touch End: %s\n' + 'Touch Bank: %s', printTouch(touch), printTouchBank()); | ||
} | ||
} | ||
@@ -1209,3 +1088,6 @@ } | ||
var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]; | ||
!(activeRecord != null && activeRecord.touchActive) ? warningWithoutStack$1(false, 'Cannot find single active touch.') : void 0; | ||
if (activeRecord == null || !activeRecord.touchActive) { | ||
error('Cannot find single active touch.'); | ||
} | ||
} | ||
@@ -1229,3 +1111,3 @@ } | ||
{ | ||
throw Error("accumulate(...): Accumulated items must not be null or undefined."); | ||
throw Error( "accumulate(...): Accumulated items must not be null or undefined." ); | ||
} | ||
@@ -1497,3 +1379,3 @@ } | ||
/** | ||
* A note about event ordering in the `EventPluginHub`. | ||
* A note about event ordering in the `EventPluginRegistry`. | ||
* | ||
@@ -1517,3 +1399,3 @@ * Suppose plugins are injected in the following order: | ||
* - These deferred dispatches are accumulated/collected before they are | ||
* returned, but processed at a later time by the `EventPluginHub` (hence the | ||
* returned, but processed at a later time by the `EventPluginRegistry` (hence the | ||
* name deferred). | ||
@@ -1542,5 +1424,5 @@ * | ||
* - `C`s on-demand events (if any) (dispatched by `C` on-demand) | ||
* - `R`s extracted events (if any) (dispatched by `EventPluginHub`) | ||
* - `S`s extracted events (if any) (dispatched by `EventPluginHub`) | ||
* - `C`s extracted events (if any) (dispatched by `EventPluginHub`) | ||
* - `R`s extracted events (if any) (dispatched by `EventPluginRegistry`) | ||
* - `S`s extracted events (if any) (dispatched by `EventPluginRegistry`) | ||
* - `C`s extracted events (if any) (dispatched by `EventPluginRegistry`) | ||
* | ||
@@ -1554,5 +1436,5 @@ * In the case of `ResponderEventPlugin`: If the `startShouldSetResponder` | ||
* - `startShouldSetResponder` (`ResponderEventPlugin` dispatches on-demand) | ||
* - `touchStartCapture` (`EventPluginHub` dispatches as usual) | ||
* - `touchStart` (`EventPluginHub` dispatches as usual) | ||
* - `responderGrant/Reject` (`EventPluginHub` dispatches as usual) | ||
* - `touchStartCapture` (`EventPluginRegistry` dispatches as usual) | ||
* - `touchStart` (`EventPluginRegistry` dispatches as usual) | ||
* - `responderGrant/Reject` (`EventPluginRegistry` dispatches as usual) | ||
*/ | ||
@@ -1661,3 +1543,3 @@ | ||
// Is the original touch location inside of the current responder? | ||
var targetInst = getInstanceFromNode$1(target); | ||
var targetInst = getInstanceFromNode(target); | ||
@@ -1692,3 +1574,6 @@ if (isAncestor(responderInst, targetInst)) { | ||
} else { | ||
console.warn('Ended a touch event which was not counted in `trackedTouchCount`.'); | ||
{ | ||
warn('Ended a touch event which was not counted in `trackedTouchCount`.'); | ||
} | ||
return null; | ||
@@ -1751,14 +1636,14 @@ } | ||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events; | ||
var getInstanceFromNode = _ReactDOM$__SECRET_IN[0]; | ||
var getNodeFromInstance = _ReactDOM$__SECRET_IN[1]; | ||
var getFiberCurrentPropsFromNode = _ReactDOM$__SECRET_IN[2]; | ||
var injectEventPluginsByName = _ReactDOM$__SECRET_IN[3]; | ||
setComponentTree(getFiberCurrentPropsFromNode, getInstanceFromNode, getNodeFromInstance); | ||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events, | ||
getInstanceFromNode$1 = _ReactDOM$__SECRET_IN[0], | ||
getNodeFromInstance$1 = _ReactDOM$__SECRET_IN[1], | ||
getFiberCurrentPropsFromNode$1 = _ReactDOM$__SECRET_IN[2], | ||
injectEventPluginsByName = _ReactDOM$__SECRET_IN[3]; | ||
setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1); | ||
var ReactDOMUnstableNativeDependencies = Object.freeze({ | ||
ResponderEventPlugin: ResponderEventPlugin, | ||
ResponderTouchHistoryStore: ResponderTouchHistoryStore, | ||
injectEventPluginsByName: injectEventPluginsByName | ||
var ReactDOMUnstableNativeDependencies = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
ResponderEventPlugin: ResponderEventPlugin, | ||
ResponderTouchHistoryStore: ResponderTouchHistoryStore, | ||
injectEventPluginsByName: injectEventPluginsByName | ||
}); | ||
@@ -1765,0 +1650,0 @@ |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-unstable-native-dependencies.production.min.js | ||
@@ -10,27 +10,23 @@ * | ||
'use strict';var aa=require("react-dom"),h=require("object-assign");function k(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=null,n=null,p=null; | ||
function r(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))throw Error(k(103));a.currentTarget=b?p(c):null;b=b?b(a):null;a.currentTarget=null;a._dispatchListeners=null;a._dispatchInstances=null;return b}function t(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}function u(a,b,c){for(var f=[];a;)f.push(a),a=t(a);for(a=f.length;0<a--;)b(f[a],"captured",c);for(a=0;a<f.length;a++)b(f[a],"bubbled",c)} | ||
function v(a,b){if(null==b)throw Error(k(30));if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}function w(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)} | ||
function x(a,b){var c=a.stateNode;if(!c)return null;var f=l(c);if(!f)return null;c=f[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":(f=!f.disabled)||(a=a.type,f=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!f;break a;default:a=!1}if(a)return null;if(c&&"function"!==typeof c)throw Error(k(231,b,typeof c)); | ||
return c}function y(a,b,c){if(b=x(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=v(c._dispatchListeners,b),c._dispatchInstances=v(c._dispatchInstances,a)}function ba(a){a&&a.dispatchConfig.phasedRegistrationNames&&u(a._targetInst,y,a)}function ca(a){if(a&&a.dispatchConfig.phasedRegistrationNames){var b=a._targetInst;b=b?t(b):null;u(b,y,a)}} | ||
function z(a){if(a&&a.dispatchConfig.registrationName){var b=a._targetInst;if(b&&a&&a.dispatchConfig.registrationName){var c=x(b,a.dispatchConfig.registrationName);c&&(a._dispatchListeners=v(a._dispatchListeners,c),a._dispatchInstances=v(a._dispatchInstances,b))}}}function A(){return!0}function B(){return!1} | ||
function C(a,b,c,f){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var d in a)a.hasOwnProperty(d)&&((b=a[d])?this[d]=b(c):"target"===d?this.target=f:this[d]=c[d]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?A:B;this.isPropagationStopped=B;return this} | ||
h(C.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=A)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=A)},persist:function(){this.isPersistent=A},isPersistent:B,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]= | ||
null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=B;this._dispatchInstances=this._dispatchListeners=null}});C.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null}; | ||
C.extend=function(a){function b(){}function c(){return f.apply(this,arguments)}var f=this;b.prototype=f.prototype;var d=new b;h(d,c.prototype);c.prototype=d;c.prototype.constructor=c;c.Interface=h({},f.Interface,a);c.extend=f.extend;D(c);return c};D(C);function da(a,b,c,f){if(this.eventPool.length){var d=this.eventPool.pop();this.call(d,a,b,c,f);return d}return new this(a,b,c,f)} | ||
function ea(a){if(!(a instanceof this))throw Error(k(279));a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}function D(a){a.eventPool=[];a.getPooled=da;a.release=ea}var E=C.extend({touchHistory:function(){return null}});function F(a){return"touchstart"===a||"mousedown"===a}function G(a){return"touchmove"===a||"mousemove"===a}function H(a){return"touchend"===a||"touchcancel"===a||"mouseup"===a} | ||
var I=["touchstart","mousedown"],J=["touchmove","mousemove"],K=["touchcancel","touchend","mouseup"],L=[],N={touchBank:L,numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0};function O(a){return a.timeStamp||a.timestamp}function P(a){a=a.identifier;if(null==a)throw Error(k(138));return a} | ||
function fa(a){var b=P(a),c=L[b];c?(c.touchActive=!0,c.startPageX=a.pageX,c.startPageY=a.pageY,c.startTimeStamp=O(a),c.currentPageX=a.pageX,c.currentPageY=a.pageY,c.currentTimeStamp=O(a),c.previousPageX=a.pageX,c.previousPageY=a.pageY,c.previousTimeStamp=O(a)):(c={touchActive:!0,startPageX:a.pageX,startPageY:a.pageY,startTimeStamp:O(a),currentPageX:a.pageX,currentPageY:a.pageY,currentTimeStamp:O(a),previousPageX:a.pageX,previousPageY:a.pageY,previousTimeStamp:O(a)},L[b]=c);N.mostRecentTimeStamp=O(a)} | ||
function ha(a){var b=L[P(a)];b?(b.touchActive=!0,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=O(a),N.mostRecentTimeStamp=O(a)):console.warn("Cannot record touch move without a touch start.\nTouch Move: %s\n","Touch Bank: %s",Q(a),R())} | ||
function ia(a){var b=L[P(a)];b?(b.touchActive=!1,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=O(a),N.mostRecentTimeStamp=O(a)):console.warn("Cannot record touch end without a touch start.\nTouch End: %s\n","Touch Bank: %s",Q(a),R())}function Q(a){return JSON.stringify({identifier:a.identifier,pageX:a.pageX,pageY:a.pageY,timestamp:O(a)})} | ||
function R(){var a=JSON.stringify(L.slice(0,20));20<L.length&&(a+=" (original size: "+L.length+")");return a} | ||
var S={recordTouchTrack:function(a,b){if(G(a))b.changedTouches.forEach(ha);else if(F(a))b.changedTouches.forEach(fa),N.numberActiveTouches=b.touches.length,1===N.numberActiveTouches&&(N.indexOfSingleActiveTouch=b.touches[0].identifier);else if(H(a)&&(b.changedTouches.forEach(ia),N.numberActiveTouches=b.touches.length,1===N.numberActiveTouches))for(a=0;a<L.length;a++)if(b=L[a],null!=b&&b.touchActive){N.indexOfSingleActiveTouch=a;break}},touchHistory:N}; | ||
function T(a,b){if(null==b)throw Error(k(334));return null==a?b:Array.isArray(a)?a.concat(b):Array.isArray(b)?[a].concat(b):[a,b]}var U=null,V=0;function W(a,b){var c=U;U=a;if(null!==X.GlobalResponderHandler)X.GlobalResponderHandler.onChange(c,a,b)} | ||
var Y={startShouldSetResponder:{phasedRegistrationNames:{bubbled:"onStartShouldSetResponder",captured:"onStartShouldSetResponderCapture"},dependencies:I},scrollShouldSetResponder:{phasedRegistrationNames:{bubbled:"onScrollShouldSetResponder",captured:"onScrollShouldSetResponderCapture"},dependencies:["scroll"]},selectionChangeShouldSetResponder:{phasedRegistrationNames:{bubbled:"onSelectionChangeShouldSetResponder",captured:"onSelectionChangeShouldSetResponderCapture"},dependencies:["selectionchange"]}, | ||
moveShouldSetResponder:{phasedRegistrationNames:{bubbled:"onMoveShouldSetResponder",captured:"onMoveShouldSetResponderCapture"},dependencies:J},responderStart:{registrationName:"onResponderStart",dependencies:I},responderMove:{registrationName:"onResponderMove",dependencies:J},responderEnd:{registrationName:"onResponderEnd",dependencies:K},responderRelease:{registrationName:"onResponderRelease",dependencies:K},responderTerminationRequest:{registrationName:"onResponderTerminationRequest",dependencies:[]}, | ||
responderGrant:{registrationName:"onResponderGrant",dependencies:[]},responderReject:{registrationName:"onResponderReject",dependencies:[]},responderTerminate:{registrationName:"onResponderTerminate",dependencies:[]}},X={_getResponder:function(){return U},eventTypes:Y,extractEvents:function(a,b,c,f){if(F(a))V+=1;else if(H(a))if(0<=V)--V;else return console.warn("Ended a touch event which was not counted in `trackedTouchCount`."),null;S.recordTouchTrack(a,c);if(b&&("scroll"===a&&!c.responderIgnoreScroll|| | ||
0<V&&"selectionchange"===a||F(a)||G(a))){var d=F(a)?Y.startShouldSetResponder:G(a)?Y.moveShouldSetResponder:"selectionchange"===a?Y.selectionChangeShouldSetResponder:Y.scrollShouldSetResponder;if(U)b:{var e=U;for(var g=0,q=e;q;q=t(q))g++;q=0;for(var M=b;M;M=t(M))q++;for(;0<g-q;)e=t(e),g--;for(;0<q-g;)b=t(b),q--;for(;g--;){if(e===b||e===b.alternate)break b;e=t(e);b=t(b)}e=null}else e=b;b=e===U;e=E.getPooled(d,e,c,f);e.touchHistory=S.touchHistory;b?w(e,ca):w(e,ba);b:{d=e._dispatchListeners;b=e._dispatchInstances; | ||
if(Array.isArray(d))for(g=0;g<d.length&&!e.isPropagationStopped();g++){if(d[g](e,b[g])){d=b[g];break b}}else if(d&&d(e,b)){d=b;break b}d=null}e._dispatchInstances=null;e._dispatchListeners=null;e.isPersistent()||e.constructor.release(e);if(d&&d!==U)if(e=E.getPooled(Y.responderGrant,d,c,f),e.touchHistory=S.touchHistory,w(e,z),b=!0===r(e),U)if(g=E.getPooled(Y.responderTerminationRequest,U,c,f),g.touchHistory=S.touchHistory,w(g,z),q=!g._dispatchListeners||r(g),g.isPersistent()||g.constructor.release(g), | ||
q){g=E.getPooled(Y.responderTerminate,U,c,f);g.touchHistory=S.touchHistory;w(g,z);var m=T(m,[e,g]);W(d,b)}else d=E.getPooled(Y.responderReject,d,c,f),d.touchHistory=S.touchHistory,w(d,z),m=T(m,d);else m=T(m,e),W(d,b);else m=null}else m=null;d=U&&F(a);e=U&&G(a);b=U&&H(a);if(d=d?Y.responderStart:e?Y.responderMove:b?Y.responderEnd:null)d=E.getPooled(d,U,c,f),d.touchHistory=S.touchHistory,w(d,z),m=T(m,d);d=U&&"touchcancel"===a;if(a=U&&!d&&H(a))a:{if((a=c.touches)&&0!==a.length)for(e=0;e<a.length;e++)if(b= | ||
a[e].target,null!==b&&void 0!==b&&0!==b){g=n(b);b:{for(b=U;g;){if(b===g||b===g.alternate){b=!0;break b}g=t(g)}b=!1}if(b){a=!1;break a}}a=!0}if(a=d?Y.responderTerminate:a?Y.responderRelease:null)c=E.getPooled(a,U,c,f),c.touchHistory=S.touchHistory,w(c,z),m=T(m,c),W(null);return m},GlobalResponderHandler:null,injection:{injectGlobalResponderHandler:function(a){X.GlobalResponderHandler=a}}},Z=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,ja=Z[3],ka=Z[0],la=Z[1];l=Z[2];n=ka;p=la; | ||
module.exports={ResponderEventPlugin:X,ResponderTouchHistoryStore:S,injectEventPluginsByName:ja}; | ||
'use strict';var h=require("react-dom"),k=require("object-assign");function m(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=null,q=null,r=null; | ||
function t(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))throw Error(m(103));a.currentTarget=b?r(c):null;b=b?b(a):null;a.currentTarget=null;a._dispatchListeners=null;a._dispatchInstances=null;return b}function u(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}function v(a,b,c){for(var f=[];a;)f.push(a),a=u(a);for(a=f.length;0<a--;)b(f[a],"captured",c);for(a=0;a<f.length;a++)b(f[a],"bubbled",c)} | ||
function w(a,b){var c=a.stateNode;if(!c)return null;var f=n(c);if(!f)return null;c=f[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(f=!f.disabled)||(a=a.type,f=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!f;break a;default:a=!1}if(a)return null;if(c&&"function"!==typeof c)throw Error(m(231, | ||
b,typeof c));return c}function x(a,b){if(null==b)throw Error(m(30));if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}function y(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}function z(a,b,c){if(b=w(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=x(c._dispatchListeners,b),c._dispatchInstances=x(c._dispatchInstances,a)} | ||
function A(a){a&&a.dispatchConfig.phasedRegistrationNames&&v(a._targetInst,z,a)}function aa(a){if(a&&a.dispatchConfig.phasedRegistrationNames){var b=a._targetInst;b=b?u(b):null;v(b,z,a)}}function B(a){if(a&&a.dispatchConfig.registrationName){var b=a._targetInst;if(b&&a&&a.dispatchConfig.registrationName){var c=w(b,a.dispatchConfig.registrationName);c&&(a._dispatchListeners=x(a._dispatchListeners,c),a._dispatchInstances=x(a._dispatchInstances,b))}}}function C(){return!0}function D(){return!1} | ||
function E(a,b,c,f){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var d in a)a.hasOwnProperty(d)&&((b=a[d])?this[d]=b(c):"target"===d?this.target=f:this[d]=c[d]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?C:D;this.isPropagationStopped=D;return this} | ||
k(E.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=C)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=C)},persist:function(){this.isPersistent=C},isPersistent:D,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]= | ||
null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=D;this._dispatchInstances=this._dispatchListeners=null}});E.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null}; | ||
E.extend=function(a){function b(){}function c(){return f.apply(this,arguments)}var f=this;b.prototype=f.prototype;var d=new b;k(d,c.prototype);c.prototype=d;c.prototype.constructor=c;c.Interface=k({},f.Interface,a);c.extend=f.extend;F(c);return c};F(E);function ba(a,b,c,f){if(this.eventPool.length){var d=this.eventPool.pop();this.call(d,a,b,c,f);return d}return new this(a,b,c,f)} | ||
function ca(a){if(!(a instanceof this))throw Error(m(279));a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}function F(a){a.eventPool=[];a.getPooled=ba;a.release=ca}var G=E.extend({touchHistory:function(){return null}});function H(a){return"touchstart"===a||"mousedown"===a}function I(a){return"touchmove"===a||"mousemove"===a}function J(a){return"touchend"===a||"touchcancel"===a||"mouseup"===a} | ||
var K=["touchstart","mousedown"],L=["touchmove","mousemove"],N=["touchcancel","touchend","mouseup"],O=[],P={touchBank:O,numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0};function Q(a){return a.timeStamp||a.timestamp}function R(a){a=a.identifier;if(null==a)throw Error(m(138));return a} | ||
function da(a){var b=R(a),c=O[b];c?(c.touchActive=!0,c.startPageX=a.pageX,c.startPageY=a.pageY,c.startTimeStamp=Q(a),c.currentPageX=a.pageX,c.currentPageY=a.pageY,c.currentTimeStamp=Q(a),c.previousPageX=a.pageX,c.previousPageY=a.pageY,c.previousTimeStamp=Q(a)):(c={touchActive:!0,startPageX:a.pageX,startPageY:a.pageY,startTimeStamp:Q(a),currentPageX:a.pageX,currentPageY:a.pageY,currentTimeStamp:Q(a),previousPageX:a.pageX,previousPageY:a.pageY,previousTimeStamp:Q(a)},O[b]=c);P.mostRecentTimeStamp=Q(a)} | ||
function ea(a){var b=O[R(a)];b&&(b.touchActive=!0,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=Q(a),P.mostRecentTimeStamp=Q(a))}function fa(a){var b=O[R(a)];b&&(b.touchActive=!1,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=Q(a),P.mostRecentTimeStamp=Q(a))} | ||
var S={recordTouchTrack:function(a,b){if(I(a))b.changedTouches.forEach(ea);else if(H(a))b.changedTouches.forEach(da),P.numberActiveTouches=b.touches.length,1===P.numberActiveTouches&&(P.indexOfSingleActiveTouch=b.touches[0].identifier);else if(J(a)&&(b.changedTouches.forEach(fa),P.numberActiveTouches=b.touches.length,1===P.numberActiveTouches))for(a=0;a<O.length;a++)if(b=O[a],null!=b&&b.touchActive){P.indexOfSingleActiveTouch=a;break}},touchHistory:P}; | ||
function T(a,b){if(null==b)throw Error(m(334));return null==a?b:Array.isArray(a)?a.concat(b):Array.isArray(b)?[a].concat(b):[a,b]}var U=null,V=0;function W(a,b){var c=U;U=a;if(null!==X.GlobalResponderHandler)X.GlobalResponderHandler.onChange(c,a,b)} | ||
var Y={startShouldSetResponder:{phasedRegistrationNames:{bubbled:"onStartShouldSetResponder",captured:"onStartShouldSetResponderCapture"},dependencies:K},scrollShouldSetResponder:{phasedRegistrationNames:{bubbled:"onScrollShouldSetResponder",captured:"onScrollShouldSetResponderCapture"},dependencies:["scroll"]},selectionChangeShouldSetResponder:{phasedRegistrationNames:{bubbled:"onSelectionChangeShouldSetResponder",captured:"onSelectionChangeShouldSetResponderCapture"},dependencies:["selectionchange"]}, | ||
moveShouldSetResponder:{phasedRegistrationNames:{bubbled:"onMoveShouldSetResponder",captured:"onMoveShouldSetResponderCapture"},dependencies:L},responderStart:{registrationName:"onResponderStart",dependencies:K},responderMove:{registrationName:"onResponderMove",dependencies:L},responderEnd:{registrationName:"onResponderEnd",dependencies:N},responderRelease:{registrationName:"onResponderRelease",dependencies:N},responderTerminationRequest:{registrationName:"onResponderTerminationRequest",dependencies:[]}, | ||
responderGrant:{registrationName:"onResponderGrant",dependencies:[]},responderReject:{registrationName:"onResponderReject",dependencies:[]},responderTerminate:{registrationName:"onResponderTerminate",dependencies:[]}},X={_getResponder:function(){return U},eventTypes:Y,extractEvents:function(a,b,c,f){if(H(a))V+=1;else if(J(a))if(0<=V)--V;else return null;S.recordTouchTrack(a,c);if(b&&("scroll"===a&&!c.responderIgnoreScroll||0<V&&"selectionchange"===a||H(a)||I(a))){var d=H(a)?Y.startShouldSetResponder: | ||
I(a)?Y.moveShouldSetResponder:"selectionchange"===a?Y.selectionChangeShouldSetResponder:Y.scrollShouldSetResponder;if(U)b:{var e=U;for(var g=0,p=e;p;p=u(p))g++;p=0;for(var M=b;M;M=u(M))p++;for(;0<g-p;)e=u(e),g--;for(;0<p-g;)b=u(b),p--;for(;g--;){if(e===b||e===b.alternate)break b;e=u(e);b=u(b)}e=null}else e=b;b=e===U;e=G.getPooled(d,e,c,f);e.touchHistory=S.touchHistory;b?y(e,aa):y(e,A);b:{d=e._dispatchListeners;b=e._dispatchInstances;if(Array.isArray(d))for(g=0;g<d.length&&!e.isPropagationStopped();g++){if(d[g](e, | ||
b[g])){d=b[g];break b}}else if(d&&d(e,b)){d=b;break b}d=null}e._dispatchInstances=null;e._dispatchListeners=null;e.isPersistent()||e.constructor.release(e);if(d&&d!==U)if(e=G.getPooled(Y.responderGrant,d,c,f),e.touchHistory=S.touchHistory,y(e,B),b=!0===t(e),U)if(g=G.getPooled(Y.responderTerminationRequest,U,c,f),g.touchHistory=S.touchHistory,y(g,B),p=!g._dispatchListeners||t(g),g.isPersistent()||g.constructor.release(g),p){g=G.getPooled(Y.responderTerminate,U,c,f);g.touchHistory=S.touchHistory;y(g, | ||
B);var l=T(l,[e,g]);W(d,b)}else d=G.getPooled(Y.responderReject,d,c,f),d.touchHistory=S.touchHistory,y(d,B),l=T(l,d);else l=T(l,e),W(d,b);else l=null}else l=null;d=U&&H(a);e=U&&I(a);b=U&&J(a);if(d=d?Y.responderStart:e?Y.responderMove:b?Y.responderEnd:null)d=G.getPooled(d,U,c,f),d.touchHistory=S.touchHistory,y(d,B),l=T(l,d);d=U&&"touchcancel"===a;if(a=U&&!d&&J(a))a:{if((a=c.touches)&&0!==a.length)for(e=0;e<a.length;e++)if(b=a[e].target,null!==b&&void 0!==b&&0!==b){g=q(b);b:{for(b=U;g;){if(b===g||b=== | ||
g.alternate){b=!0;break b}g=u(g)}b=!1}if(b){a=!1;break a}}a=!0}if(a=d?Y.responderTerminate:a?Y.responderRelease:null)c=G.getPooled(a,U,c,f),c.touchHistory=S.touchHistory,y(c,B),l=T(l,c),W(null);return l},GlobalResponderHandler:null,injection:{injectGlobalResponderHandler:function(a){X.GlobalResponderHandler=a}}},Z=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,ha=Z[3],ia=Z[0],ja=Z[1];n=Z[2];q=ia;r=ja;module.exports={__proto__:null,ResponderEventPlugin:X,ResponderTouchHistoryStore:S,injectEventPluginsByName:ha}; |
{ | ||
"name": "@hot-loader/react-dom", | ||
"version": "16.12.0+4.12.19", | ||
"version": "16.13.0+4.12.20", | ||
"description": "The Hot version of React-DOM", | ||
@@ -24,3 +24,3 @@ "main": "index.js", | ||
"prop-types": "^15.6.2", | ||
"scheduler": "^0.18.0" | ||
"scheduler": "^0.19.0" | ||
}, | ||
@@ -44,6 +44,2 @@ "peerDependencies": { | ||
"unstable-fizz.node.js", | ||
"unstable-flight-client.js", | ||
"unstable-flight-server.js", | ||
"unstable-flight-server.browser.js", | ||
"unstable-flight-server.node.js", | ||
"unstable-native-dependencies.js", | ||
@@ -55,4 +51,3 @@ "cjs/", | ||
"./server.js": "./server.browser.js", | ||
"./unstable-fizz.js": "./unstable-fizz.browser.js", | ||
"./unstable-flight-server.js": "./unstable-flight-server.browser.js" | ||
"./unstable-fizz.js": "./unstable-fizz.browser.js" | ||
}, | ||
@@ -59,0 +54,0 @@ "browserify": { |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-server.browser.production.min.js | ||
@@ -9,38 +9,38 @@ * | ||
*/ | ||
'use strict';(function(n,p){"object"===typeof exports&&"undefined"!==typeof module?module.exports=p(require("react")):"function"===typeof define&&define.amd?define(["react"],p):n.ReactDOMServer=p(n.React)})(this,function(n){function p(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."} | ||
function ta(a){if(-1===a._status){a._status=0;var b=a._ctor;b=b();a._result=b;b.then(function(c){0===a._status&&(c=c.default,a._status=1,a._result=c)},function(c){0===a._status&&(a._status=2,a._result=c)})}}function I(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case L:return"Fragment";case W:return"Portal";case X:return"Profiler";case Y:return"StrictMode";case M:return"Suspense";case Z:return"SuspenseList"}if("object"=== | ||
typeof a)switch(a.$$typeof){case aa:return"Context.Consumer";case N:return"Context.Provider";case ba:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");case ca:return I(a.type);case da:if(a=1===a._status?a._result:null)return I(a)}return null}function E(a,b){for(var c=a._threadCount|0;c<=b;c++)a[c]=a._currentValue2,a._threadCount=c+1}function ua(a,b,c,d){if(d&&(d=a.contextType,"object"===typeof d&&null!==d))return E(d,c),d[c];if(a=a.contextTypes){c= | ||
{};for(var g in a)c[g]=b[g];b=c}else b=ea;return b}function fa(a){if(ha.call(ia,a))return!0;if(ha.call(ja,a))return!1;if(va.test(a))return ia[a]=!0;ja[a]=!0;return!1}function wa(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}}function xa(a,b,c,d){if(null===b||"undefined"===typeof b||wa(a,b,c,d))return!0;if(d)return!1; | ||
if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function l(a,b,c,d,g,h){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=g;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=h}function C(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=ya.exec(a);if(b){var c="",d,g=0;for(d=b.index;d<a.length;d++){switch(a.charCodeAt(d)){case 34:b=""";break; | ||
case 38:b="&";break;case 39:b="'";break;case 60:b="<";break;case 62:b=">";break;default:continue}g!==d&&(c+=a.substring(g,d));g=d+1;c+=b}a=g!==d?c+a.substring(g,d):c}return a}function za(a,b){var c=m.hasOwnProperty(a)?m[a]:null;var d;if(d="style"!==a)d=null!==c?0===c.type:!(2<a.length)||"o"!==a[0]&&"O"!==a[0]||"n"!==a[1]&&"N"!==a[1]?!1:!0;if(d||xa(a,b,c,!1))return"";if(null!==c){a=c.attributeName;d=c.type;if(3===d||4===d&&!0===b)return a+'=""';c.sanitizeURL&&(b=""+b);return a+"="+('"'+ | ||
C(b)+'"')}return fa(a)?a+"="+('"'+C(b)+'"'):""}function Aa(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}function A(){if(null===u)throw Error(p(321));return u}function ka(){if(0<J)throw Error(p(312));return{memoizedState:null,queue:null,next:null}}function O(){null===e?null===K?(F=!1,K=e=ka()):(F=!0,e=K):null===e.next?(F=!1,e=e.next=ka()):(F=!0,e=e.next);return e}function la(a,b,c,d){for(;P;)P=!1,J+=1,e=null,c=a(b,d);K=u=null;J=0;e=t=null;return c}function ma(a,b){return"function"===typeof b? | ||
b(a):b}function na(a,b,c){u=A();e=O();if(F){var d=e.queue;b=d.dispatch;if(null!==t&&(c=t.get(d),void 0!==c)){t.delete(d);d=e.memoizedState;do d=a(d,c.action),c=c.next;while(null!==c);e.memoizedState=d;return[d,b]}return[e.memoizedState,b]}a=a===ma?"function"===typeof b?b():b:void 0!==c?c(b):b;e.memoizedState=a;a=e.queue={last:null,dispatch:null};a=a.dispatch=Ba.bind(null,u,a);return[e.memoizedState,a]}function Ba(a,b,c){if(!(25>J))throw Error(p(301));if(a===u)if(P=!0,a={action:c,next:null},null=== | ||
t&&(t=new Map),c=t.get(b),void 0===c)t.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}}function Q(){}function oa(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ca(a){if(void 0===a||null===a)return a;var b="";n.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}function pa(a,b){if(void 0===a)throw Error(p(152,I(b)||"Component"));}function Da(a,b,c){function d(d,h){var f= | ||
h.prototype&&h.prototype.isReactComponent,g=ua(h,b,c,f),v=[],z=!1,e={isMounted:function(a){return!1},enqueueForceUpdate:function(a){if(null===v)return null},enqueueReplaceState:function(a,c){z=!0;v=[c]},enqueueSetState:function(a,c){if(null===v)return null;v.push(c)}};if(f){if(f=new h(d.props,g,e),"function"===typeof h.getDerivedStateFromProps){var k=h.getDerivedStateFromProps.call(null,d.props,f.state);null!=k&&(f.state=x({},f.state,k))}}else if(u={},f=h(d.props,g,e),f=la(h,d.props,f,g),null==f|| | ||
null==f.render){a=f;pa(a,h);return}f.props=d.props;f.context=g;f.updater=e;e=f.state;void 0===e&&(f.state=e=null);if("function"===typeof f.UNSAFE_componentWillMount||"function"===typeof f.componentWillMount)if("function"===typeof f.componentWillMount&&"function"!==typeof h.getDerivedStateFromProps&&f.componentWillMount(),"function"===typeof f.UNSAFE_componentWillMount&&"function"!==typeof h.getDerivedStateFromProps&&f.UNSAFE_componentWillMount(),v.length){e=v;var m=z;v=null;z=!1;if(m&&1===e.length)f.state= | ||
e[0];else{k=m?e[0]:f.state;var q=!0;for(m=m?1:0;m<e.length;m++){var r=e[m];r="function"===typeof r?r.call(f,k,d.props,g):r;null!=r&&(q?(q=!1,k=x({},k,r)):x(k,r))}f.state=k}}else v=null;a=f.render();pa(a,h);if("function"===typeof f.getChildContext&&(d=h.childContextTypes,"object"===typeof d)){var l=f.getChildContext();for(var n in l)if(!(n in d))throw Error(p(108,I(h)||"Unknown",n));}l&&(b=x({},b,l))}for(;n.isValidElement(a);){var g=a,h=g.type;if("function"!==typeof h)break;d(g,h)}return{child:a,context:b}} | ||
var x=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,k="function"===typeof Symbol&&Symbol.for,W=k?Symbol.for("react.portal"):60106,L=k?Symbol.for("react.fragment"):60107,Y=k?Symbol.for("react.strict_mode"):60108,X=k?Symbol.for("react.profiler"):60114,N=k?Symbol.for("react.provider"):60109,aa=k?Symbol.for("react.context"):60110,Ea=k?Symbol.for("react.concurrent_mode"):60111,ba=k?Symbol.for("react.forward_ref"):60112,M=k?Symbol.for("react.suspense"):60113,Z=k?Symbol.for("react.suspense_list"): | ||
60120,ca=k?Symbol.for("react.memo"):60115,da=k?Symbol.for("react.lazy"):60116,Fa=k?Symbol.for("react.fundamental"):60117,Ga=k?Symbol.for("react.scope"):60119;k=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;k.hasOwnProperty("ReactCurrentDispatcher")||(k.ReactCurrentDispatcher={current:null});k.hasOwnProperty("ReactCurrentBatchConfig")||(k.ReactCurrentBatchConfig={suspense:null});for(var ea={},q=new Uint16Array(16),D=0;15>D;D++)q[D]=D+1;q[15]=0;var va=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, | ||
ha=Object.prototype.hasOwnProperty,ja={},ia={},m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){m[a]=new l(a,0,!1,a,null,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];m[b]=new l(b,1,!1,a[1],null,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){m[a]=new l(a, | ||
2,!1,a.toLowerCase(),null,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){m[a]=new l(a,2,!1,a,null,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){m[a]=new l(a,3,!1,a.toLowerCase(),null,!1)});["checked","multiple","muted","selected"].forEach(function(a){m[a]= | ||
new l(a,3,!0,a,null,!1)});["capture","download"].forEach(function(a){m[a]=new l(a,4,!1,a,null,!1)});["cols","rows","size","span"].forEach(function(a){m[a]=new l(a,6,!1,a,null,!1)});["rowSpan","start"].forEach(function(a){m[a]=new l(a,5,!1,a.toLowerCase(),null,!1)});var S=/[\-:]([a-z])/g,T=function(a){return a[1].toUpperCase()};"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b= | ||
a.replace(S,T);m[b]=new l(b,1,!1,a,null,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(S,T);m[b]=new l(b,1,!1,a,"http://www.w3.org/1999/xlink",!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(S,T);m[b]=new l(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1)});["tabIndex","crossOrigin"].forEach(function(a){m[a]=new l(a,1,!1,a.toLowerCase(),null,!1)});m.xlinkHref=new l("xlinkHref",1,!1,"xlink:href", | ||
"http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){m[a]=new l(a,1,!1,a.toLowerCase(),null,!0)});var ya=/["'&<>]/,Ha="function"===typeof Object.is?Object.is:Aa,u=null,K=null,e=null,F=!1,P=!1,t=null,J=0,G=0,Ia={readContext:function(a,b){b=G;E(a,b);return a[b]},useContext:function(a,b){A();b=G;E(a,b);return a[b]},useMemo:function(a,b){u=A();e=O();b=void 0===b?null:b;if(null!==e){var c=e.memoizedState;if(null!==c&&null!==b){a:{var d=c[1];if(null===d)d=!1;else{for(var g= | ||
0;g<d.length&&g<b.length;g++)if(!Ha(b[g],d[g])){d=!1;break a}d=!0}}if(d)return c[0]}}a=a();e.memoizedState=[a,b];return a},useReducer:na,useRef:function(a){u=A();e=O();var b=e.memoizedState;return null===b?(a={current:a},e.memoizedState=a):b},useState:function(a){return na(ma,a)},useLayoutEffect:function(a,b){},useCallback:function(a,b){return a},useImperativeHandle:Q,useEffect:Q,useDebugValue:Q,useResponder:function(a,b){return{props:b,responder:a}},useDeferredValue:function(a,b){A();return a},useTransition:function(a){A(); | ||
return[function(a){a()},!1]}},qa={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Ja=x({menuitem:!0},qa),H={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0, | ||
gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ka=["Webkit","ms","Moz","O"];Object.keys(H).forEach(function(a){Ka.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);H[b]=H[a]})});var La=/([A-Z])/g,Ma=/^ms-/,B=n.Children.toArray,U=k.ReactCurrentDispatcher, | ||
Na={listing:!0,pre:!0,textarea:!0},Oa=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ra={},V={},Pa=Object.prototype.hasOwnProperty,Qa={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null},sa=function(){function a(a,b){n.isValidElement(a)?a.type!==L?a=[a]:(a=a.props.children,a=n.isValidElement(a)?[a]:B(a)):a=B(a);a={type:null,domNamespace:"http://www.w3.org/1999/xhtml",children:a,childIndex:0,context:ea,footer:""};var c=q[0];if(0===c){var h=q;c=h.length;var d= | ||
'use strict';(function(k,p){"object"===typeof exports&&"undefined"!==typeof module?module.exports=p(require("react")):"function"===typeof define&&define.amd?define(["react"],p):(k=k||self,k.ReactDOMServer=p(k.React))})(this,function(k){function p(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."} | ||
function ta(a){if(-1===a._status){a._status=0;var b=a._ctor;b=b();a._result=b;b.then(function(c){0===a._status&&(c=c.default,a._status=1,a._result=c)},function(c){0===a._status&&(a._status=2,a._result=c)})}}function D(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case L:return"Fragment";case W:return"Portal";case X:return"Profiler";case Y:return"StrictMode";case M:return"Suspense";case Z:return"SuspenseList"}if("object"=== | ||
typeof a)switch(a.$$typeof){case aa:return"Context.Consumer";case N:return"Context.Provider";case ba:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");case ca:return D(a.type);case ua:return D(a.render);case da:if(a=1===a._status?a._result:null)return D(a)}return null}function E(a,b){for(var c=a._threadCount|0;c<=b;c++)a[c]=a._currentValue2,a._threadCount=c+1}function va(a,b,c,d){if(d&&(d=a.contextType,"object"===typeof d&&null!==d))return E(d, | ||
c),d[c];if(a=a.contextTypes){c={};for(var g in a)c[g]=b[g];b=c}else b=ea;return b}function fa(a){if(ha.call(ia,a))return!0;if(ha.call(ja,a))return!1;if(wa.test(a))return ia[a]=!0;ja[a]=!0;return!1}function xa(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}}function ya(a,b,c,d){if(null===b||"undefined"===typeof b|| | ||
xa(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function n(a,b,c,d,g,h){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=g;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=h}function C(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=za.exec(a);if(b){var c="",d,g=0;for(d=b.index;d<a.length;d++){switch(a.charCodeAt(d)){case 34:b= | ||
""";break;case 38:b="&";break;case 39:b="'";break;case 60:b="<";break;case 62:b=">";break;default:continue}g!==d&&(c+=a.substring(g,d));g=d+1;c+=b}a=g!==d?c+a.substring(g,d):c}return a}function Aa(a,b){var c=m.hasOwnProperty(a)?m[a]:null;var d;if(d="style"!==a)d=null!==c?0===c.type:!(2<a.length)||"o"!==a[0]&&"O"!==a[0]||"n"!==a[1]&&"N"!==a[1]?!1:!0;if(d||ya(a,b,c,!1))return"";if(null!==c){a=c.attributeName;d=c.type;if(3===d||4===d&&!0===b)return a+'=""';c.sanitizeURL&&(b=""+b); | ||
return a+'="'+(C(b)+'"')}return fa(a)?a+'="'+(C(b)+'"'):""}function Ba(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}function A(){if(null===u)throw Error(p(321));return u}function ka(){if(0<I)throw Error(p(312));return{memoizedState:null,queue:null,next:null}}function O(){null===e?null===J?(F=!1,J=e=ka()):(F=!0,e=J):null===e.next?(F=!1,e=e.next=ka()):(F=!0,e=e.next);return e}function la(a,b,c,d){for(;P;)P=!1,I+=1,e=null,c=a(b,d);J=u=null;I=0;e=t=null;return c}function ma(a,b){return"function"=== | ||
typeof b?b(a):b}function na(a,b,c){u=A();e=O();if(F){var d=e.queue;b=d.dispatch;if(null!==t&&(c=t.get(d),void 0!==c)){t.delete(d);d=e.memoizedState;do d=a(d,c.action),c=c.next;while(null!==c);e.memoizedState=d;return[d,b]}return[e.memoizedState,b]}a=a===ma?"function"===typeof b?b():b:void 0!==c?c(b):b;e.memoizedState=a;a=e.queue={last:null,dispatch:null};a=a.dispatch=Ca.bind(null,u,a);return[e.memoizedState,a]}function Ca(a,b,c){if(!(25>I))throw Error(p(301));if(a===u)if(P=!0,a={action:c,next:null}, | ||
null===t&&(t=new Map),c=t.get(b),void 0===c)t.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}}function Q(){}function oa(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Da(a){if(void 0===a||null===a)return a;var b="";k.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}function pa(a,b){if(void 0===a)throw Error(p(152,D(b)||"Component"));}function Ea(a,b,c){function d(d, | ||
h){var f=h.prototype&&h.prototype.isReactComponent,g=va(h,b,c,f),v=[],z=!1,e={isMounted:function(a){return!1},enqueueForceUpdate:function(a){if(null===v)return null},enqueueReplaceState:function(a,c){z=!0;v=[c]},enqueueSetState:function(a,c){if(null===v)return null;v.push(c)}};if(f){if(f=new h(d.props,g,e),"function"===typeof h.getDerivedStateFromProps){var l=h.getDerivedStateFromProps.call(null,d.props,f.state);null!=l&&(f.state=x({},f.state,l))}}else if(u={},f=h(d.props,g,e),f=la(h,d.props,f,g), | ||
null==f||null==f.render){a=f;pa(a,h);return}f.props=d.props;f.context=g;f.updater=e;e=f.state;void 0===e&&(f.state=e=null);if("function"===typeof f.UNSAFE_componentWillMount||"function"===typeof f.componentWillMount)if("function"===typeof f.componentWillMount&&"function"!==typeof h.getDerivedStateFromProps&&f.componentWillMount(),"function"===typeof f.UNSAFE_componentWillMount&&"function"!==typeof h.getDerivedStateFromProps&&f.UNSAFE_componentWillMount(),v.length){e=v;var m=z;v=null;z=!1;if(m&&1=== | ||
e.length)f.state=e[0];else{l=m?e[0]:f.state;var q=!0;for(m=m?1:0;m<e.length;m++){var r=e[m];r="function"===typeof r?r.call(f,l,d.props,g):r;null!=r&&(q?(q=!1,l=x({},l,r)):x(l,r))}f.state=l}}else v=null;a=f.render();pa(a,h);if("function"===typeof f.getChildContext&&(d=h.childContextTypes,"object"===typeof d)){var k=f.getChildContext();for(var n in k)if(!(n in d))throw Error(p(108,D(h)||"Unknown",n));}k&&(b=x({},b,k))}for(;k.isValidElement(a);){var g=a,h=g.type;if("function"!==typeof h)break;d(g,h)}return{child:a, | ||
context:b}}var x=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,l="function"===typeof Symbol&&Symbol.for,W=l?Symbol.for("react.portal"):60106,L=l?Symbol.for("react.fragment"):60107,Y=l?Symbol.for("react.strict_mode"):60108,X=l?Symbol.for("react.profiler"):60114,N=l?Symbol.for("react.provider"):60109,aa=l?Symbol.for("react.context"):60110,Fa=l?Symbol.for("react.concurrent_mode"):60111,ba=l?Symbol.for("react.forward_ref"):60112,M=l?Symbol.for("react.suspense"):60113,Z=l?Symbol.for("react.suspense_list"): | ||
60120,ca=l?Symbol.for("react.memo"):60115,da=l?Symbol.for("react.lazy"):60116,ua=l?Symbol.for("react.block"):60121,Ga=l?Symbol.for("react.fundamental"):60117,Ha=l?Symbol.for("react.scope"):60119;l=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;l.hasOwnProperty("ReactCurrentDispatcher")||(l.ReactCurrentDispatcher={current:null});l.hasOwnProperty("ReactCurrentBatchConfig")||(l.ReactCurrentBatchConfig={suspense:null});for(var ea={},q=new Uint16Array(16),K=0;15>K;K++)q[K]=K+1;q[15]=0;var wa=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, | ||
ha=Object.prototype.hasOwnProperty,ja={},ia={},m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){m[a]=new n(a,0,!1,a,null,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];m[b]=new n(b,1,!1,a[1],null,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){m[a]=new n(a, | ||
2,!1,a.toLowerCase(),null,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){m[a]=new n(a,2,!1,a,null,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){m[a]=new n(a,3,!1,a.toLowerCase(),null,!1)});["checked","multiple","muted","selected"].forEach(function(a){m[a]= | ||
new n(a,3,!0,a,null,!1)});["capture","download"].forEach(function(a){m[a]=new n(a,4,!1,a,null,!1)});["cols","rows","size","span"].forEach(function(a){m[a]=new n(a,6,!1,a,null,!1)});["rowSpan","start"].forEach(function(a){m[a]=new n(a,5,!1,a.toLowerCase(),null,!1)});var S=/[\-:]([a-z])/g,T=function(a){return a[1].toUpperCase()};"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b= | ||
a.replace(S,T);m[b]=new n(b,1,!1,a,null,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(S,T);m[b]=new n(b,1,!1,a,"http://www.w3.org/1999/xlink",!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(S,T);m[b]=new n(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1)});["tabIndex","crossOrigin"].forEach(function(a){m[a]=new n(a,1,!1,a.toLowerCase(),null,!1)});m.xlinkHref=new n("xlinkHref",1,!1,"xlink:href", | ||
"http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){m[a]=new n(a,1,!1,a.toLowerCase(),null,!0)});var za=/["'&<>]/,Ia="function"===typeof Object.is?Object.is:Ba,u=null,J=null,e=null,F=!1,P=!1,t=null,I=0,G=0,Ja={readContext:function(a,b){b=G;E(a,b);return a[b]},useContext:function(a,b){A();b=G;E(a,b);return a[b]},useMemo:function(a,b){u=A();e=O();b=void 0===b?null:b;if(null!==e){var c=e.memoizedState;if(null!==c&&null!==b){a:{var d=c[1];if(null===d)d=!1;else{for(var g= | ||
0;g<d.length&&g<b.length;g++)if(!Ia(b[g],d[g])){d=!1;break a}d=!0}}if(d)return c[0]}}a=a();e.memoizedState=[a,b];return a},useReducer:na,useRef:function(a){u=A();e=O();var b=e.memoizedState;return null===b?(a={current:a},e.memoizedState=a):b},useState:function(a){return na(ma,a)},useLayoutEffect:function(a,b){},useCallback:function(a,b){return a},useImperativeHandle:Q,useEffect:Q,useDebugValue:Q,useResponder:function(a,b){return{props:b,responder:a}},useDeferredValue:function(a,b){A();return a},useTransition:function(a){A(); | ||
return[function(a){a()},!1]}},qa={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Ka=x({menuitem:!0},qa),H={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0, | ||
gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},La=["Webkit","ms","Moz","O"];Object.keys(H).forEach(function(a){La.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);H[b]=H[a]})});var Ma=/([A-Z])/g,Na=/^ms-/,B=k.Children.toArray,U=l.ReactCurrentDispatcher, | ||
Oa={listing:!0,pre:!0,textarea:!0},Pa=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ra={},V={},Qa=Object.prototype.hasOwnProperty,Ra={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null},sa=function(){function a(a,b){k.isValidElement(a)?a.type!==L?a=[a]:(a=a.props.children,a=k.isValidElement(a)?[a]:B(a)):a=B(a);a={type:null,domNamespace:"http://www.w3.org/1999/xhtml",children:a,childIndex:0,context:ea,footer:""};var c=q[0];if(0===c){var h=q;c=h.length;var d= | ||
2*c;if(!(65536>=d))throw Error(p(304));var z=new Uint16Array(d);z.set(h);q=z;q[0]=c+1;for(h=c;h<d-1;h++)q[h]=h+1;q[d-1]=0}else q[0]=q[c];this.threadID=c;this.stack=[a];this.exhausted=!1;this.currentSelectValue=null;this.previousWasTextNode=!1;this.makeStaticMarkup=b;this.suspenseDepth=0;this.contextIndex=-1;this.contextStack=[];this.contextValueStack=[]}var b=a.prototype;b.destroy=function(){if(!this.exhausted){this.exhausted=!0;this.clearProviders();var a=this.threadID;q[a]=q[0];q[0]=a}};b.pushProvider= | ||
function(a){var b=++this.contextIndex,c=a.type._context,h=this.threadID;E(c,h);var v=c[h];this.contextStack[b]=c;this.contextValueStack[b]=v;c[h]=a.props.value};b.popProvider=function(a){a=this.contextIndex;var b=this.contextStack[a],c=this.contextValueStack[a];this.contextStack[a]=null;this.contextValueStack[a]=null;this.contextIndex--;b[this.threadID]=c};b.clearProviders=function(){for(var a=this.contextIndex;0<=a;a--)this.contextStack[a][this.threadID]=this.contextValueStack[a]};b.read=function(a){if(this.exhausted)return null; | ||
var b=G;G=this.threadID;var c=U.current;U.current=Ia;try{for(var h=[""],v=!1;h[0].length<a;){if(0===this.stack.length){this.exhausted=!0;var z=this.threadID;q[z]=q[0];q[0]=z;break}var f=this.stack[this.stack.length-1];if(v||f.childIndex>=f.children.length){var e=f.footer;""!==e&&(this.previousWasTextNode=!1);this.stack.pop();if("select"===f.type)this.currentSelectValue=null;else if(null!=f.type&&null!=f.type.type&&f.type.type.$$typeof===N)this.popProvider(f.type);else if(f.type===M){this.suspenseDepth--; | ||
var k=h.pop();if(v){v=!1;var m=f.fallbackFrame;if(!m)throw Error(p(303));this.stack.push(m);h[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}else h[this.suspenseDepth]+=k}h[this.suspenseDepth]+=e}else{var l=f.children[f.childIndex++],n="";try{n+=this.render(l,f.context,f.domNamespace)}catch(R){if(null!=R&&"function"===typeof R.then)throw Error(p(294));throw R;}finally{}h.length<=this.suspenseDepth&&h.push("");h[this.suspenseDepth]+=n}}return h[0]}finally{U.current=c,G=b}};b.render=function(a,b,g){if("string"=== | ||
typeof a||"number"===typeof a){g=""+a;if(""===g)return"";if(this.makeStaticMarkup)return C(g);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+C(g);this.previousWasTextNode=!0;return C(g)}b=Da(a,b,this.threadID);a=b.child;b=b.context;if(null===a||!1===a)return"";if(!n.isValidElement(a)){if(null!=a&&null!=a.$$typeof){g=a.$$typeof;if(g===W)throw Error(p(257));throw Error(p(258,g.toString()));}a=B(a);this.stack.push({type:null,domNamespace:g,children:a,childIndex:0,context:b,footer:""});return""}var c= | ||
a.type;if("string"===typeof c)return this.renderDOM(a,b,g);switch(c){case Y:case Ea:case X:case Z:case L:return a=B(a.props.children),this.stack.push({type:null,domNamespace:g,children:a,childIndex:0,context:b,footer:""}),"";case M:throw Error(p(294));}if("object"===typeof c&&null!==c)switch(c.$$typeof){case ba:u={};var d=c.render(a.props,a.ref);d=la(c.render,a.props,d,a.ref);d=B(d);this.stack.push({type:null,domNamespace:g,children:d,childIndex:0,context:b,footer:""});return"";case ca:return a=[n.createElement(c.type, | ||
x({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:g,children:a,childIndex:0,context:b,footer:""}),"";case N:return c=B(a.props.children),g={type:a,domNamespace:g,children:c,childIndex:0,context:b,footer:""},this.pushProvider(a),this.stack.push(g),"";case aa:c=a.type;d=a.props;var e=this.threadID;E(c,e);c=B(d.children(c[e]));this.stack.push({type:a,domNamespace:g,children:c,childIndex:0,context:b,footer:""});return"";case Fa:throw Error(p(338));case da:switch(c=a.type,ta(c),c._status){case 1:return a= | ||
[n.createElement(c._result,x({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:g,children:a,childIndex:0,context:b,footer:""}),"";case 2:throw c._result;default:throw Error(p(295));}case Ga:throw Error(p(343));}throw Error(p(130,null==c?c:typeof c,""));};b.renderDOM=function(a,b,g){var c=a.type.toLowerCase();"http://www.w3.org/1999/xhtml"===g&&oa(c);if(!ra.hasOwnProperty(c)){if(!Oa.test(c))throw Error(p(65,c));ra[c]=!0}var d=a.props;if("input"===c)d=x({type:void 0},d,{defaultChecked:void 0, | ||
var b=G;G=this.threadID;var c=U.current;U.current=Ja;try{for(var h=[""],v=!1;h[0].length<a;){if(0===this.stack.length){this.exhausted=!0;var z=this.threadID;q[z]=q[0];q[0]=z;break}var f=this.stack[this.stack.length-1];if(v||f.childIndex>=f.children.length){var e=f.footer;""!==e&&(this.previousWasTextNode=!1);this.stack.pop();if("select"===f.type)this.currentSelectValue=null;else if(null!=f.type&&null!=f.type.type&&f.type.type.$$typeof===N)this.popProvider(f.type);else if(f.type===M){this.suspenseDepth--; | ||
var l=h.pop();if(v){v=!1;var m=f.fallbackFrame;if(!m)throw Error(p(303));this.stack.push(m);h[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}else h[this.suspenseDepth]+=l}h[this.suspenseDepth]+=e}else{var k=f.children[f.childIndex++],n="";try{n+=this.render(k,f.context,f.domNamespace)}catch(R){if(null!=R&&"function"===typeof R.then)throw Error(p(294));throw R;}finally{}h.length<=this.suspenseDepth&&h.push("");h[this.suspenseDepth]+=n}}return h[0]}finally{U.current=c,G=b}};b.render=function(a,b,g){if("string"=== | ||
typeof a||"number"===typeof a){g=""+a;if(""===g)return"";if(this.makeStaticMarkup)return C(g);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+C(g);this.previousWasTextNode=!0;return C(g)}b=Ea(a,b,this.threadID);a=b.child;b=b.context;if(null===a||!1===a)return"";if(!k.isValidElement(a)){if(null!=a&&null!=a.$$typeof){g=a.$$typeof;if(g===W)throw Error(p(257));throw Error(p(258,g.toString()));}a=B(a);this.stack.push({type:null,domNamespace:g,children:a,childIndex:0,context:b,footer:""});return""}var c= | ||
a.type;if("string"===typeof c)return this.renderDOM(a,b,g);switch(c){case Y:case Fa:case X:case Z:case L:return a=B(a.props.children),this.stack.push({type:null,domNamespace:g,children:a,childIndex:0,context:b,footer:""}),"";case M:throw Error(p(294));}if("object"===typeof c&&null!==c)switch(c.$$typeof){case ba:u={};var d=c.render(a.props,a.ref);d=la(c.render,a.props,d,a.ref);d=B(d);this.stack.push({type:null,domNamespace:g,children:d,childIndex:0,context:b,footer:""});return"";case ca:return a=[k.createElement(c.type, | ||
x({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:g,children:a,childIndex:0,context:b,footer:""}),"";case N:return c=B(a.props.children),g={type:a,domNamespace:g,children:c,childIndex:0,context:b,footer:""},this.pushProvider(a),this.stack.push(g),"";case aa:c=a.type;d=a.props;var e=this.threadID;E(c,e);c=B(d.children(c[e]));this.stack.push({type:a,domNamespace:g,children:c,childIndex:0,context:b,footer:""});return"";case Ga:throw Error(p(338));case da:switch(c=a.type,ta(c),c._status){case 1:return a= | ||
[k.createElement(c._result,x({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:g,children:a,childIndex:0,context:b,footer:""}),"";case 2:throw c._result;default:throw Error(p(295));}case Ha:throw Error(p(343));}throw Error(p(130,null==c?c:typeof c,""));};b.renderDOM=function(a,b,g){var c=a.type.toLowerCase();"http://www.w3.org/1999/xhtml"===g&&oa(c);if(!ra.hasOwnProperty(c)){if(!Pa.test(c))throw Error(p(65,c));ra[c]=!0}var d=a.props;if("input"===c)d=x({type:void 0},d,{defaultChecked:void 0, | ||
defaultValue:void 0,value:null!=d.value?d.value:d.defaultValue,checked:null!=d.checked?d.checked:d.defaultChecked});else if("textarea"===c){var e=d.value;if(null==e){e=d.defaultValue;var f=d.children;if(null!=f){if(null!=e)throw Error(p(92));if(Array.isArray(f)){if(!(1>=f.length))throw Error(p(93));f=f[0]}e=""+f}null==e&&(e="")}d=x({},d,{value:void 0,children:""+e})}else if("select"===c)this.currentSelectValue=null!=d.value?d.value:d.defaultValue,d=x({},d,{value:void 0});else if("option"===c){f=this.currentSelectValue; | ||
var k=Ca(d.children);if(null!=f){var m=null!=d.value?d.value+"":k;e=!1;if(Array.isArray(f))for(var l=0;l<f.length;l++){if(""+f[l]===m){e=!0;break}}else e=""+f===m;d=x({selected:void 0,children:void 0},d,{selected:e,children:k})}}if(e=d){if(Ja[c]&&(null!=e.children||null!=e.dangerouslySetInnerHTML))throw Error(p(137,c,""));if(null!=e.dangerouslySetInnerHTML){if(null!=e.children)throw Error(p(60));if(!("object"===typeof e.dangerouslySetInnerHTML&&"__html"in e.dangerouslySetInnerHTML))throw Error(p(61)); | ||
}if(null!=e.style&&"object"!==typeof e.style)throw Error(p(62,""));}e=d;f=this.makeStaticMarkup;k=1===this.stack.length;m="<"+a.type;for(w in e)if(Pa.call(e,w)){var n=e[w];if(null!=n){if("style"===w){l=void 0;var q="",u="";for(l in n)if(n.hasOwnProperty(l)){var y=0===l.indexOf("--"),r=n[l];if(null!=r){if(y)var t=l;else if(t=l,V.hasOwnProperty(t))t=V[t];else{var A=t.replace(La,"-$1").toLowerCase().replace(Ma,"-ms-");t=V[t]=A}q+=u+t+":";u=l;y=null==r||"boolean"===typeof r||""===r?"":y||"number"!==typeof r|| | ||
0===r||H.hasOwnProperty(u)&&H[u]?(""+r).trim():r+"px";q+=y;u=";"}}n=q||null}l=null;b:if(y=c,r=e,-1===y.indexOf("-"))y="string"===typeof r.is;else switch(y){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":y=!1;break b;default:y=!0}y?Qa.hasOwnProperty(w)||(l=w,l=fa(l)&&null!=n?l+"="+('"'+C(n)+'"'):""):l=za(w,n);l&&(m+=" "+l)}}f||k&&(m+=' data-reactroot=""');var w=m;e="";qa.hasOwnProperty(c)? | ||
w+="/>":(w+=">",e="</"+a.type+">");a:{f=d.dangerouslySetInnerHTML;if(null!=f){if(null!=f.__html){f=f.__html;break a}}else if(f=d.children,"string"===typeof f||"number"===typeof f){f=C(f);break a}f=null}null!=f?(d=[],Na[c]&&"\n"===f.charAt(0)&&(w+="\n"),w+=f):d=B(d.children);a=a.type;g=null==g||"http://www.w3.org/1999/xhtml"===g?oa(a):"http://www.w3.org/2000/svg"===g&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":g;this.stack.push({domNamespace:g,type:c,children:d,childIndex:0,context:b,footer:e}); | ||
this.previousWasTextNode=!1;return w};return a}();k={renderToString:function(a){a=new sa(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new sa(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){throw Error(p(207));},renderToStaticNodeStream:function(){throw Error(p(208));},version:"16.12.0"};k=(D={default:k},k)||D;return k.default||k}); | ||
var l=Da(d.children);if(null!=f){var m=null!=d.value?d.value+"":l;e=!1;if(Array.isArray(f))for(var k=0;k<f.length;k++){if(""+f[k]===m){e=!0;break}}else e=""+f===m;d=x({selected:void 0,children:void 0},d,{selected:e,children:l})}}if(e=d){if(Ka[c]&&(null!=e.children||null!=e.dangerouslySetInnerHTML))throw Error(p(137,c,""));if(null!=e.dangerouslySetInnerHTML){if(null!=e.children)throw Error(p(60));if(!("object"===typeof e.dangerouslySetInnerHTML&&"__html"in e.dangerouslySetInnerHTML))throw Error(p(61)); | ||
}if(null!=e.style&&"object"!==typeof e.style)throw Error(p(62,""));}e=d;f=this.makeStaticMarkup;l=1===this.stack.length;m="<"+a.type;for(w in e)if(Qa.call(e,w)){var n=e[w];if(null!=n){if("style"===w){k=void 0;var q="",u="";for(k in n)if(n.hasOwnProperty(k)){var y=0===k.indexOf("--"),r=n[k];if(null!=r){if(y)var t=k;else if(t=k,V.hasOwnProperty(t))t=V[t];else{var A=t.replace(Ma,"-$1").toLowerCase().replace(Na,"-ms-");t=V[t]=A}q+=u+t+":";u=k;y=null==r||"boolean"===typeof r||""===r?"":y||"number"!==typeof r|| | ||
0===r||H.hasOwnProperty(u)&&H[u]?(""+r).trim():r+"px";q+=y;u=";"}}n=q||null}k=null;b:if(y=c,r=e,-1===y.indexOf("-"))y="string"===typeof r.is;else switch(y){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":y=!1;break b;default:y=!0}y?Ra.hasOwnProperty(w)||(k=w,k=fa(k)&&null!=n?k+'="'+(C(n)+'"'):""):k=Aa(w,n);k&&(m+=" "+k)}}f||l&&(m+=' data-reactroot=""');var w=m;e="";qa.hasOwnProperty(c)? | ||
w+="/>":(w+=">",e="</"+a.type+">");a:{f=d.dangerouslySetInnerHTML;if(null!=f){if(null!=f.__html){f=f.__html;break a}}else if(f=d.children,"string"===typeof f||"number"===typeof f){f=C(f);break a}f=null}null!=f?(d=[],Oa.hasOwnProperty(c)&&"\n"===f.charAt(0)&&(w+="\n"),w+=f):d=B(d.children);a=a.type;g=null==g||"http://www.w3.org/1999/xhtml"===g?oa(a):"http://www.w3.org/2000/svg"===g&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":g;this.stack.push({domNamespace:g,type:c,children:d,childIndex:0, | ||
context:b,footer:e});this.previousWasTextNode=!1;return w};return a}();l={renderToString:function(a){a=new sa(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new sa(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){throw Error(p(207));},renderToStaticNodeStream:function(){throw Error(p(208));},version:"16.13.0"};return l.default||l}); |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-test-utils.development.js | ||
@@ -13,399 +13,273 @@ * | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('react-dom')) : | ||
typeof define === 'function' && define.amd ? define(['react', 'react-dom'], factory) : | ||
(global.ReactTestUtils = factory(global.React,global.ReactDOM)); | ||
}(this, (function (React,ReactDOM) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('react-dom')) : | ||
typeof define === 'function' && define.amd ? define(['react', 'react-dom'], factory) : | ||
(global = global || self, global.ReactTestUtils = factory(global.React, global.ReactDOM)); | ||
}(this, (function (React, ReactDOM) { 'use strict'; | ||
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
var _assign = ReactInternals.assign; | ||
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
var _assign = ReactInternals.assign; | ||
// Do not require this module directly! Use normal `invariant` calls with | ||
// template literal strings. The messages will be replaced with error codes | ||
// during build. | ||
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. | ||
// Current owner and dispatcher used to share the same ref, | ||
// but PR #14548 split them out to better support the react-debug-tools package. | ||
/** | ||
* Use invariant() to assert state which your program assumes to be true. | ||
* | ||
* Provide sprintf-style format (only %s is supported) and arguments | ||
* to provide information about what broke and what you were | ||
* expecting. | ||
* | ||
* The invariant message will be stripped in production, but the invariant | ||
* will remain to ensure logic does not differ in production. | ||
*/ | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { | ||
ReactSharedInternals.ReactCurrentDispatcher = { | ||
current: null | ||
}; | ||
} | ||
/** | ||
* Similar to invariant but only logs a warning if the condition is not met. | ||
* This can be used to log issues in development environments in critical | ||
* paths. Removing the logging code for production environments will keep the | ||
* same logic and follow the same code paths. | ||
*/ | ||
var warningWithoutStack = function () {}; | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { | ||
ReactSharedInternals.ReactCurrentBatchConfig = { | ||
suspense: null | ||
}; | ||
} | ||
{ | ||
warningWithoutStack = function (condition, format) { | ||
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
// by calls to these methods by a Babel plugin. | ||
// | ||
// In PROD (or in packages without access to React internals), | ||
// they are left as they are instead. | ||
if (format === undefined) { | ||
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); | ||
} | ||
function warn(format) { | ||
{ | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
if (args.length > 8) { | ||
// Check before the condition to catch violations early. | ||
throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); | ||
printWarning('warn', format, args); | ||
} | ||
} | ||
function error(format) { | ||
{ | ||
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
args[_key2 - 1] = arguments[_key2]; | ||
} | ||
if (condition) { | ||
return; | ||
printWarning('error', format, args); | ||
} | ||
} | ||
if (typeof console !== 'undefined') { | ||
function printWarning(level, format, args) { | ||
// When changing this logic, you might want to also | ||
// update consoleWithStackDev.www.js as well. | ||
{ | ||
var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; | ||
if (!hasExistingStack) { | ||
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; | ||
var stack = ReactDebugCurrentFrame.getStackAddendum(); | ||
if (stack !== '') { | ||
format += '%s'; | ||
args = args.concat([stack]); | ||
} | ||
} | ||
var argsWithFormat = args.map(function (item) { | ||
return '' + item; | ||
}); | ||
}); // Careful: RN currently depends on this prefix | ||
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it | ||
// breaks IE9: https://github.com/facebook/react/issues/13610 | ||
// eslint-disable-next-line react-internal/no-production-logging | ||
Function.prototype.apply.call(console.error, console, argsWithFormat); | ||
Function.prototype.apply.call(console[level], console, argsWithFormat); | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
throw new Error(message); | ||
} catch (x) {} | ||
} | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
} | ||
/** | ||
* `ReactInstanceMap` maintains a mapping from a public facing stateful | ||
* instance (key) and the internal representation (value). This allows public | ||
* methods to accept the user facing instance as an argument and map them back | ||
* to internal methods. | ||
* | ||
* Note that this module is currently shared and assumed to be stateless. | ||
* If this becomes an actual Map, that will break. | ||
*/ | ||
function get(key) { | ||
return key._reactInternalFiber; | ||
} | ||
var warningWithoutStack$1 = warningWithoutStack; | ||
var FunctionComponent = 0; | ||
var ClassComponent = 1; | ||
/** | ||
* `ReactInstanceMap` maintains a mapping from a public facing stateful | ||
* instance (key) and the internal representation (value). This allows public | ||
* methods to accept the user facing instance as an argument and map them back | ||
* to internal methods. | ||
* | ||
* Note that this module is currently shared and assumed to be stateless. | ||
* If this becomes an actual Map, that will break. | ||
*/ | ||
var HostRoot = 3; // Root of a host tree. Could be nested inside another node. | ||
/** | ||
* This API should be called `delete` but we'd have to make sure to always | ||
* transform these to strings for IE support. When this transform is fully | ||
* supported we can rename it. | ||
*/ | ||
var HostComponent = 5; | ||
var HostText = 6; | ||
function get(key) { | ||
return key._reactInternalFiber; | ||
} | ||
// Don't change these two values. They're used by React Dev Tools. | ||
var NoEffect = | ||
/* */ | ||
0; | ||
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. | ||
// Current owner and dispatcher used to share the same ref, | ||
// but PR #14548 split them out to better support the react-debug-tools package. | ||
var Placement = | ||
/* */ | ||
2; | ||
var Hydrating = | ||
/* */ | ||
1024; | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { | ||
ReactSharedInternals.ReactCurrentDispatcher = { | ||
current: null | ||
}; | ||
} | ||
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; | ||
function getNearestMountedFiber(fiber) { | ||
var node = fiber; | ||
var nearestMounted = fiber; | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { | ||
ReactSharedInternals.ReactCurrentBatchConfig = { | ||
suspense: null | ||
}; | ||
} | ||
if (!fiber.alternate) { | ||
// If there is no alternate, this might be a new tree that isn't inserted | ||
// yet. If it is, then it will have a pending insertion effect on it. | ||
var nextNode = node; | ||
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | ||
// nor polyfill, then a plain number is used for performance. | ||
do { | ||
node = nextNode; | ||
if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) { | ||
// This is an insertion or in-progress hydration. The nearest possible | ||
// mounted fiber is the parent but we need to continue to figure out | ||
// if that one is still mounted. | ||
nearestMounted = node.return; | ||
} | ||
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary | ||
// (unstable) APIs that have been removed. Can we remove the symbols? | ||
{ | ||
} | ||
var FunctionComponent = 0; | ||
var ClassComponent = 1; | ||
// Before we know whether it is function or class | ||
var HostRoot = 3; // Root of a host tree. Could be nested inside another node. | ||
// A subtree. Could be an entry point to a different renderer. | ||
var HostComponent = 5; | ||
var HostText = 6; | ||
// Don't change these two values. They're used by React Dev Tools. | ||
var NoEffect = | ||
/* */ | ||
0; | ||
// You can change the rest (and add more). | ||
var Placement = | ||
/* */ | ||
2; | ||
var Hydrating = | ||
/* */ | ||
1024; | ||
// Passive & Update & Callback & Ref & Snapshot | ||
// Union of all host effects | ||
// Helps identify side effects in render-phase lifecycle hooks and setState | ||
// reducers by double invoking them in Strict Mode. | ||
// To preserve the "Pause on caught exceptions" behavior of the debugger, we | ||
// replay the begin phase of a failed component inside invokeGuardedCallback. | ||
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: | ||
// Gather advanced timing metrics for Profiler subtrees. | ||
// Trace which interactions trigger each commit. | ||
// SSR experiments | ||
// Only used in www builds. | ||
// Only used in www builds. | ||
// Disable javascript: URL strings in href for XSS protection. | ||
// React Fire: prevent the value and checked attributes from syncing | ||
// with their related DOM properties | ||
// These APIs will no longer be "unstable" in the upcoming 16.7 release, | ||
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile. | ||
// Experimental React Flare event system and event components support. | ||
// Experimental Host Component support. | ||
// Experimental Scope support. | ||
// New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107 | ||
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?) | ||
// Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version | ||
// For tests, we flush suspense fallbacks in an act scope; | ||
// *except* in some of our own tests, where we test incremental loading states. | ||
// Add a callback property to suspense to notify which promises are currently | ||
// in the update queue. This allows reporting and tracing of what is causing | ||
// the user to see a loading state. | ||
// Also allows hydration callbacks to fire when a dehydrated boundary gets | ||
// hydrated or deleted. | ||
// Part of the simplification of React.createElement so we can eventually move | ||
// from React.createElement to React.jsx | ||
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md | ||
// Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance | ||
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; | ||
function getNearestMountedFiber(fiber) { | ||
var node = fiber; | ||
var nearestMounted = fiber; | ||
if (!fiber.alternate) { | ||
// If there is no alternate, this might be a new tree that isn't inserted | ||
// yet. If it is, then it will have a pending insertion effect on it. | ||
var nextNode = node; | ||
do { | ||
node = nextNode; | ||
if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) { | ||
// This is an insertion or in-progress hydration. The nearest possible | ||
// mounted fiber is the parent but we need to continue to figure out | ||
// if that one is still mounted. | ||
nearestMounted = node.return; | ||
nextNode = node.return; | ||
} while (nextNode); | ||
} else { | ||
while (node.return) { | ||
node = node.return; | ||
} | ||
nextNode = node.return; | ||
} while (nextNode); | ||
} else { | ||
while (node.return) { | ||
node = node.return; | ||
} | ||
} | ||
if (node.tag === HostRoot) { | ||
// TODO: Check if this was a nested HostRoot when used with | ||
// renderContainerIntoSubtree. | ||
return nearestMounted; | ||
} // If we didn't hit the root, that means that we're in an disconnected tree | ||
// that has been unmounted. | ||
if (node.tag === HostRoot) { | ||
// TODO: Check if this was a nested HostRoot when used with | ||
// renderContainerIntoSubtree. | ||
return nearestMounted; | ||
} // If we didn't hit the root, that means that we're in an disconnected tree | ||
// that has been unmounted. | ||
return null; | ||
} | ||
return null; | ||
} | ||
function assertIsMounted(fiber) { | ||
if (!(getNearestMountedFiber(fiber) === fiber)) { | ||
{ | ||
throw Error("Unable to find node on an unmounted component."); | ||
function assertIsMounted(fiber) { | ||
if (!(getNearestMountedFiber(fiber) === fiber)) { | ||
{ | ||
throw Error( "Unable to find node on an unmounted component." ); | ||
} | ||
} | ||
} | ||
} | ||
function findCurrentFiberUsingSlowPath(fiber) { | ||
var alternate = fiber.alternate; | ||
function findCurrentFiberUsingSlowPath(fiber) { | ||
var alternate = fiber.alternate; | ||
if (!alternate) { | ||
// If there is no alternate, then we only need to check if it is mounted. | ||
var nearestMounted = getNearestMountedFiber(fiber); | ||
if (!alternate) { | ||
// If there is no alternate, then we only need to check if it is mounted. | ||
var nearestMounted = getNearestMountedFiber(fiber); | ||
if (!(nearestMounted !== null)) { | ||
{ | ||
throw Error("Unable to find node on an unmounted component."); | ||
if (!(nearestMounted !== null)) { | ||
{ | ||
throw Error( "Unable to find node on an unmounted component." ); | ||
} | ||
} | ||
} | ||
if (nearestMounted !== fiber) { | ||
return null; | ||
} | ||
if (nearestMounted !== fiber) { | ||
return null; | ||
} | ||
return fiber; | ||
} // If we have two possible branches, we'll walk backwards up to the root | ||
// to see what path the root points to. On the way we may hit one of the | ||
// special cases and we'll deal with them. | ||
return fiber; | ||
} // If we have two possible branches, we'll walk backwards up to the root | ||
// to see what path the root points to. On the way we may hit one of the | ||
// special cases and we'll deal with them. | ||
var a = fiber; | ||
var b = alternate; | ||
var a = fiber; | ||
var b = alternate; | ||
while (true) { | ||
var parentA = a.return; | ||
while (true) { | ||
var parentA = a.return; | ||
if (parentA === null) { | ||
// We're at the root. | ||
break; | ||
} | ||
if (parentA === null) { | ||
// We're at the root. | ||
break; | ||
} | ||
var parentB = parentA.alternate; | ||
var parentB = parentA.alternate; | ||
if (parentB === null) { | ||
// There is no alternate. This is an unusual case. Currently, it only | ||
// happens when a Suspense component is hidden. An extra fragment fiber | ||
// is inserted in between the Suspense fiber and its children. Skip | ||
// over this extra fragment fiber and proceed to the next parent. | ||
var nextParent = parentA.return; | ||
if (parentB === null) { | ||
// There is no alternate. This is an unusual case. Currently, it only | ||
// happens when a Suspense component is hidden. An extra fragment fiber | ||
// is inserted in between the Suspense fiber and its children. Skip | ||
// over this extra fragment fiber and proceed to the next parent. | ||
var nextParent = parentA.return; | ||
if (nextParent !== null) { | ||
a = b = nextParent; | ||
continue; | ||
} // If there's no parent, we're at the root. | ||
if (nextParent !== null) { | ||
a = b = nextParent; | ||
continue; | ||
} // If there's no parent, we're at the root. | ||
break; | ||
} // If both copies of the parent fiber point to the same child, we can | ||
// assume that the child is current. This happens when we bailout on low | ||
// priority: the bailed out fiber's child reuses the current child. | ||
break; | ||
} // If both copies of the parent fiber point to the same child, we can | ||
// assume that the child is current. This happens when we bailout on low | ||
// priority: the bailed out fiber's child reuses the current child. | ||
if (parentA.child === parentB.child) { | ||
var child = parentA.child; | ||
if (parentA.child === parentB.child) { | ||
var child = parentA.child; | ||
while (child) { | ||
if (child === a) { | ||
// We've determined that A is the current branch. | ||
assertIsMounted(parentA); | ||
return fiber; | ||
} | ||
while (child) { | ||
if (child === a) { | ||
// We've determined that A is the current branch. | ||
assertIsMounted(parentA); | ||
return fiber; | ||
} | ||
if (child === b) { | ||
// We've determined that B is the current branch. | ||
assertIsMounted(parentA); | ||
return alternate; | ||
} | ||
if (child === b) { | ||
// We've determined that B is the current branch. | ||
assertIsMounted(parentA); | ||
return alternate; | ||
} | ||
child = child.sibling; | ||
} // We should never have an alternate for any mounting node. So the only | ||
// way this could possibly happen is if this was unmounted, if at all. | ||
child = child.sibling; | ||
} // We should never have an alternate for any mounting node. So the only | ||
// way this could possibly happen is if this was unmounted, if at all. | ||
{ | ||
{ | ||
throw Error("Unable to find node on an unmounted component."); | ||
{ | ||
throw Error( "Unable to find node on an unmounted component." ); | ||
} | ||
} | ||
} | ||
} | ||
if (a.return !== b.return) { | ||
// The return pointer of A and the return pointer of B point to different | ||
// fibers. We assume that return pointers never criss-cross, so A must | ||
// belong to the child set of A.return, and B must belong to the child | ||
// set of B.return. | ||
a = parentA; | ||
b = parentB; | ||
} else { | ||
// The return pointers point to the same fiber. We'll have to use the | ||
// default, slow path: scan the child sets of each parent alternate to see | ||
// which child belongs to which set. | ||
// | ||
// Search parent A's child set | ||
var didFindChild = false; | ||
var _child = parentA.child; | ||
if (a.return !== b.return) { | ||
// The return pointer of A and the return pointer of B point to different | ||
// fibers. We assume that return pointers never criss-cross, so A must | ||
// belong to the child set of A.return, and B must belong to the child | ||
// set of B.return. | ||
a = parentA; | ||
b = parentB; | ||
} else { | ||
// The return pointers point to the same fiber. We'll have to use the | ||
// default, slow path: scan the child sets of each parent alternate to see | ||
// which child belongs to which set. | ||
// | ||
// Search parent A's child set | ||
var didFindChild = false; | ||
var _child = parentA.child; | ||
while (_child) { | ||
if (_child === a) { | ||
didFindChild = true; | ||
a = parentA; | ||
b = parentB; | ||
break; | ||
} | ||
if (_child === b) { | ||
didFindChild = true; | ||
b = parentA; | ||
a = parentB; | ||
break; | ||
} | ||
_child = _child.sibling; | ||
} | ||
if (!didFindChild) { | ||
// Search parent B's child set | ||
_child = parentB.child; | ||
while (_child) { | ||
if (_child === a) { | ||
didFindChild = true; | ||
a = parentB; | ||
b = parentA; | ||
a = parentA; | ||
b = parentB; | ||
break; | ||
@@ -416,4 +290,4 @@ } | ||
didFindChild = true; | ||
b = parentB; | ||
a = parentA; | ||
b = parentA; | ||
a = parentB; | ||
break; | ||
@@ -426,1234 +300,1203 @@ } | ||
if (!didFindChild) { | ||
{ | ||
throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."); | ||
// Search parent B's child set | ||
_child = parentB.child; | ||
while (_child) { | ||
if (_child === a) { | ||
didFindChild = true; | ||
a = parentB; | ||
b = parentA; | ||
break; | ||
} | ||
if (_child === b) { | ||
didFindChild = true; | ||
b = parentB; | ||
a = parentA; | ||
break; | ||
} | ||
_child = _child.sibling; | ||
} | ||
if (!didFindChild) { | ||
{ | ||
throw Error( "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." ); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
if (!(a.alternate === b)) { | ||
{ | ||
throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."); | ||
if (!(a.alternate === b)) { | ||
{ | ||
throw Error( "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." ); | ||
} | ||
} | ||
} | ||
} // If the root is not a host container, we're in a disconnected tree. I.e. | ||
// unmounted. | ||
} // If the root is not a host container, we're in a disconnected tree. I.e. | ||
// unmounted. | ||
if (!(a.tag === HostRoot)) { | ||
{ | ||
throw Error("Unable to find node on an unmounted component."); | ||
if (!(a.tag === HostRoot)) { | ||
{ | ||
throw Error( "Unable to find node on an unmounted component." ); | ||
} | ||
} | ||
} | ||
if (a.stateNode.current === a) { | ||
// We've determined that A is the current branch. | ||
return fiber; | ||
} // Otherwise B has to be current branch. | ||
if (a.stateNode.current === a) { | ||
// We've determined that A is the current branch. | ||
return fiber; | ||
} // Otherwise B has to be current branch. | ||
return alternate; | ||
} | ||
return alternate; | ||
} | ||
/* eslint valid-typeof: 0 */ | ||
var EVENT_POOL_SIZE = 10; | ||
/** | ||
* @interface Event | ||
* @see http://www.w3.org/TR/DOM-Level-3-Events/ | ||
*/ | ||
var EVENT_POOL_SIZE = 10; | ||
/** | ||
* @interface Event | ||
* @see http://www.w3.org/TR/DOM-Level-3-Events/ | ||
*/ | ||
var EventInterface = { | ||
type: null, | ||
target: null, | ||
// currentTarget is set when dispatching; no use in copying it here | ||
currentTarget: function () { | ||
return null; | ||
}, | ||
eventPhase: null, | ||
bubbles: null, | ||
cancelable: null, | ||
timeStamp: function (event) { | ||
return event.timeStamp || Date.now(); | ||
}, | ||
defaultPrevented: null, | ||
isTrusted: null | ||
}; | ||
var EventInterface = { | ||
type: null, | ||
target: null, | ||
// currentTarget is set when dispatching; no use in copying it here | ||
currentTarget: function () { | ||
return null; | ||
}, | ||
eventPhase: null, | ||
bubbles: null, | ||
cancelable: null, | ||
timeStamp: function (event) { | ||
return event.timeStamp || Date.now(); | ||
}, | ||
defaultPrevented: null, | ||
isTrusted: null | ||
}; | ||
function functionThatReturnsTrue() { | ||
return true; | ||
} | ||
function functionThatReturnsTrue() { | ||
return true; | ||
} | ||
function functionThatReturnsFalse() { | ||
return false; | ||
} | ||
/** | ||
* Synthetic events are dispatched by event plugins, typically in response to a | ||
* top-level event delegation handler. | ||
* | ||
* These systems should generally use pooling to reduce the frequency of garbage | ||
* collection. The system should check `isPersistent` to determine whether the | ||
* event should be released into the pool after being dispatched. Users that | ||
* need a persisted event should invoke `persist`. | ||
* | ||
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by | ||
* normalizing browser quirks. Subclasses do not necessarily have to implement a | ||
* DOM interface; custom application-specific events can also subclass this. | ||
* | ||
* @param {object} dispatchConfig Configuration used to dispatch this event. | ||
* @param {*} targetInst Marker identifying the event target. | ||
* @param {object} nativeEvent Native browser event. | ||
* @param {DOMEventTarget} nativeEventTarget Target node. | ||
*/ | ||
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { | ||
{ | ||
// these have a getter/setter for warnings | ||
delete this.nativeEvent; | ||
delete this.preventDefault; | ||
delete this.stopPropagation; | ||
delete this.isDefaultPrevented; | ||
delete this.isPropagationStopped; | ||
function functionThatReturnsFalse() { | ||
return false; | ||
} | ||
/** | ||
* Synthetic events are dispatched by event plugins, typically in response to a | ||
* top-level event delegation handler. | ||
* | ||
* These systems should generally use pooling to reduce the frequency of garbage | ||
* collection. The system should check `isPersistent` to determine whether the | ||
* event should be released into the pool after being dispatched. Users that | ||
* need a persisted event should invoke `persist`. | ||
* | ||
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by | ||
* normalizing browser quirks. Subclasses do not necessarily have to implement a | ||
* DOM interface; custom application-specific events can also subclass this. | ||
* | ||
* @param {object} dispatchConfig Configuration used to dispatch this event. | ||
* @param {*} targetInst Marker identifying the event target. | ||
* @param {object} nativeEvent Native browser event. | ||
* @param {DOMEventTarget} nativeEventTarget Target node. | ||
*/ | ||
this.dispatchConfig = dispatchConfig; | ||
this._targetInst = targetInst; | ||
this.nativeEvent = nativeEvent; | ||
var Interface = this.constructor.Interface; | ||
for (var propName in Interface) { | ||
if (!Interface.hasOwnProperty(propName)) { | ||
continue; | ||
} | ||
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { | ||
{ | ||
delete this[propName]; // this has a getter/setter for warnings | ||
// these have a getter/setter for warnings | ||
delete this.nativeEvent; | ||
delete this.preventDefault; | ||
delete this.stopPropagation; | ||
delete this.isDefaultPrevented; | ||
delete this.isPropagationStopped; | ||
} | ||
var normalize = Interface[propName]; | ||
this.dispatchConfig = dispatchConfig; | ||
this._targetInst = targetInst; | ||
this.nativeEvent = nativeEvent; | ||
var Interface = this.constructor.Interface; | ||
if (normalize) { | ||
this[propName] = normalize(nativeEvent); | ||
} else { | ||
if (propName === 'target') { | ||
this.target = nativeEventTarget; | ||
} else { | ||
this[propName] = nativeEvent[propName]; | ||
for (var propName in Interface) { | ||
if (!Interface.hasOwnProperty(propName)) { | ||
continue; | ||
} | ||
} | ||
} | ||
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; | ||
{ | ||
delete this[propName]; // this has a getter/setter for warnings | ||
} | ||
if (defaultPrevented) { | ||
this.isDefaultPrevented = functionThatReturnsTrue; | ||
} else { | ||
this.isDefaultPrevented = functionThatReturnsFalse; | ||
} | ||
var normalize = Interface[propName]; | ||
this.isPropagationStopped = functionThatReturnsFalse; | ||
return this; | ||
} | ||
_assign(SyntheticEvent.prototype, { | ||
preventDefault: function () { | ||
this.defaultPrevented = true; | ||
var event = this.nativeEvent; | ||
if (!event) { | ||
return; | ||
if (normalize) { | ||
this[propName] = normalize(nativeEvent); | ||
} else { | ||
if (propName === 'target') { | ||
this.target = nativeEventTarget; | ||
} else { | ||
this[propName] = nativeEvent[propName]; | ||
} | ||
} | ||
} | ||
if (event.preventDefault) { | ||
event.preventDefault(); | ||
} else if (typeof event.returnValue !== 'unknown') { | ||
event.returnValue = false; | ||
} | ||
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; | ||
this.isDefaultPrevented = functionThatReturnsTrue; | ||
}, | ||
stopPropagation: function () { | ||
var event = this.nativeEvent; | ||
if (!event) { | ||
return; | ||
if (defaultPrevented) { | ||
this.isDefaultPrevented = functionThatReturnsTrue; | ||
} else { | ||
this.isDefaultPrevented = functionThatReturnsFalse; | ||
} | ||
if (event.stopPropagation) { | ||
event.stopPropagation(); | ||
} else if (typeof event.cancelBubble !== 'unknown') { | ||
// The ChangeEventPlugin registers a "propertychange" event for | ||
// IE. This event does not support bubbling or cancelling, and | ||
// any references to cancelBubble throw "Member not found". A | ||
// typeof check of "unknown" circumvents this issue (and is also | ||
// IE specific). | ||
event.cancelBubble = true; | ||
} | ||
this.isPropagationStopped = functionThatReturnsFalse; | ||
return this; | ||
} | ||
this.isPropagationStopped = functionThatReturnsTrue; | ||
}, | ||
_assign(SyntheticEvent.prototype, { | ||
preventDefault: function () { | ||
this.defaultPrevented = true; | ||
var event = this.nativeEvent; | ||
/** | ||
* We release all dispatched `SyntheticEvent`s after each event loop, adding | ||
* them back into the pool. This allows a way to hold onto a reference that | ||
* won't be added back into the pool. | ||
*/ | ||
persist: function () { | ||
this.isPersistent = functionThatReturnsTrue; | ||
}, | ||
if (!event) { | ||
return; | ||
} | ||
/** | ||
* Checks if this event should be released back into the pool. | ||
* | ||
* @return {boolean} True if this should not be released, false otherwise. | ||
*/ | ||
isPersistent: functionThatReturnsFalse, | ||
if (event.preventDefault) { | ||
event.preventDefault(); | ||
} else if (typeof event.returnValue !== 'unknown') { | ||
event.returnValue = false; | ||
} | ||
/** | ||
* `PooledClass` looks for `destructor` on each instance it releases. | ||
*/ | ||
destructor: function () { | ||
var Interface = this.constructor.Interface; | ||
this.isDefaultPrevented = functionThatReturnsTrue; | ||
}, | ||
stopPropagation: function () { | ||
var event = this.nativeEvent; | ||
for (var propName in Interface) { | ||
{ | ||
Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); | ||
if (!event) { | ||
return; | ||
} | ||
} | ||
this.dispatchConfig = null; | ||
this._targetInst = null; | ||
this.nativeEvent = null; | ||
this.isDefaultPrevented = functionThatReturnsFalse; | ||
this.isPropagationStopped = functionThatReturnsFalse; | ||
this._dispatchListeners = null; | ||
this._dispatchInstances = null; | ||
if (event.stopPropagation) { | ||
event.stopPropagation(); | ||
} else if (typeof event.cancelBubble !== 'unknown') { | ||
// The ChangeEventPlugin registers a "propertychange" event for | ||
// IE. This event does not support bubbling or cancelling, and | ||
// any references to cancelBubble throw "Member not found". A | ||
// typeof check of "unknown" circumvents this issue (and is also | ||
// IE specific). | ||
event.cancelBubble = true; | ||
} | ||
{ | ||
Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null)); | ||
Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse)); | ||
Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse)); | ||
Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {})); | ||
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {})); | ||
} | ||
} | ||
}); | ||
this.isPropagationStopped = functionThatReturnsTrue; | ||
}, | ||
SyntheticEvent.Interface = EventInterface; | ||
/** | ||
* Helper to reduce boilerplate when creating subclasses. | ||
*/ | ||
/** | ||
* We release all dispatched `SyntheticEvent`s after each event loop, adding | ||
* them back into the pool. This allows a way to hold onto a reference that | ||
* won't be added back into the pool. | ||
*/ | ||
persist: function () { | ||
this.isPersistent = functionThatReturnsTrue; | ||
}, | ||
SyntheticEvent.extend = function (Interface) { | ||
var Super = this; | ||
/** | ||
* Checks if this event should be released back into the pool. | ||
* | ||
* @return {boolean} True if this should not be released, false otherwise. | ||
*/ | ||
isPersistent: functionThatReturnsFalse, | ||
var E = function () {}; | ||
/** | ||
* `PooledClass` looks for `destructor` on each instance it releases. | ||
*/ | ||
destructor: function () { | ||
var Interface = this.constructor.Interface; | ||
E.prototype = Super.prototype; | ||
var prototype = new E(); | ||
for (var propName in Interface) { | ||
{ | ||
Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); | ||
} | ||
} | ||
function Class() { | ||
return Super.apply(this, arguments); | ||
} | ||
this.dispatchConfig = null; | ||
this._targetInst = null; | ||
this.nativeEvent = null; | ||
this.isDefaultPrevented = functionThatReturnsFalse; | ||
this.isPropagationStopped = functionThatReturnsFalse; | ||
this._dispatchListeners = null; | ||
this._dispatchInstances = null; | ||
_assign(prototype, Class.prototype); | ||
{ | ||
Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null)); | ||
Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse)); | ||
Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse)); | ||
Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {})); | ||
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {})); | ||
} | ||
} | ||
}); | ||
Class.prototype = prototype; | ||
Class.prototype.constructor = Class; | ||
Class.Interface = _assign({}, Super.Interface, Interface); | ||
Class.extend = Super.extend; | ||
addEventPoolingTo(Class); | ||
return Class; | ||
}; | ||
SyntheticEvent.Interface = EventInterface; | ||
/** | ||
* Helper to reduce boilerplate when creating subclasses. | ||
*/ | ||
addEventPoolingTo(SyntheticEvent); | ||
/** | ||
* Helper to nullify syntheticEvent instance properties when destructing | ||
* | ||
* @param {String} propName | ||
* @param {?object} getVal | ||
* @return {object} defineProperty object | ||
*/ | ||
SyntheticEvent.extend = function (Interface) { | ||
var Super = this; | ||
function getPooledWarningPropertyDefinition(propName, getVal) { | ||
var isFunction = typeof getVal === 'function'; | ||
return { | ||
configurable: true, | ||
set: set, | ||
get: get | ||
}; | ||
var E = function () {}; | ||
function set(val) { | ||
var action = isFunction ? 'setting the method' : 'setting the property'; | ||
warn(action, 'This is effectively a no-op'); | ||
return val; | ||
} | ||
E.prototype = Super.prototype; | ||
var prototype = new E(); | ||
function get() { | ||
var action = isFunction ? 'accessing the method' : 'accessing the property'; | ||
var result = isFunction ? 'This is a no-op function' : 'This is set to null'; | ||
warn(action, result); | ||
return getVal; | ||
} | ||
function Class() { | ||
return Super.apply(this, arguments); | ||
} | ||
function warn(action, result) { | ||
var warningCondition = false; | ||
!warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0; | ||
} | ||
} | ||
_assign(prototype, Class.prototype); | ||
function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { | ||
var EventConstructor = this; | ||
Class.prototype = prototype; | ||
Class.prototype.constructor = Class; | ||
Class.Interface = _assign({}, Super.Interface, Interface); | ||
Class.extend = Super.extend; | ||
addEventPoolingTo(Class); | ||
return Class; | ||
}; | ||
if (EventConstructor.eventPool.length) { | ||
var instance = EventConstructor.eventPool.pop(); | ||
EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); | ||
return instance; | ||
} | ||
addEventPoolingTo(SyntheticEvent); | ||
/** | ||
* Helper to nullify syntheticEvent instance properties when destructing | ||
* | ||
* @param {String} propName | ||
* @param {?object} getVal | ||
* @return {object} defineProperty object | ||
*/ | ||
return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst); | ||
} | ||
function getPooledWarningPropertyDefinition(propName, getVal) { | ||
var isFunction = typeof getVal === 'function'; | ||
return { | ||
configurable: true, | ||
set: set, | ||
get: get | ||
}; | ||
function releasePooledEvent(event) { | ||
var EventConstructor = this; | ||
function set(val) { | ||
var action = isFunction ? 'setting the method' : 'setting the property'; | ||
warn(action, 'This is effectively a no-op'); | ||
return val; | ||
} | ||
if (!(event instanceof EventConstructor)) { | ||
{ | ||
throw Error("Trying to release an event instance into a pool of a different type."); | ||
function get() { | ||
var action = isFunction ? 'accessing the method' : 'accessing the property'; | ||
var result = isFunction ? 'This is a no-op function' : 'This is set to null'; | ||
warn(action, result); | ||
return getVal; | ||
} | ||
} | ||
event.destructor(); | ||
if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) { | ||
EventConstructor.eventPool.push(event); | ||
function warn(action, result) { | ||
{ | ||
error("This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result); | ||
} | ||
} | ||
} | ||
} | ||
function addEventPoolingTo(EventConstructor) { | ||
EventConstructor.eventPool = []; | ||
EventConstructor.getPooled = getPooledEvent; | ||
EventConstructor.release = releasePooledEvent; | ||
} | ||
function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { | ||
var EventConstructor = this; | ||
/** | ||
* Forked from fbjs/warning: | ||
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js | ||
* | ||
* Only change is we use console.warn instead of console.error, | ||
* and do nothing when 'console' is not supported. | ||
* This really simplifies the code. | ||
* --- | ||
* Similar to invariant but only logs a warning if the condition is not met. | ||
* This can be used to log issues in development environments in critical | ||
* paths. Removing the logging code for production environments will keep the | ||
* same logic and follow the same code paths. | ||
*/ | ||
var lowPriorityWarningWithoutStack = function () {}; | ||
{ | ||
var printWarning = function (format) { | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
if (EventConstructor.eventPool.length) { | ||
var instance = EventConstructor.eventPool.pop(); | ||
EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); | ||
return instance; | ||
} | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst); | ||
} | ||
if (typeof console !== 'undefined') { | ||
console.warn(message); | ||
} | ||
function releasePooledEvent(event) { | ||
var EventConstructor = this; | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
lowPriorityWarningWithoutStack = function (condition, format) { | ||
if (format === undefined) { | ||
throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); | ||
if (!(event instanceof EventConstructor)) { | ||
{ | ||
throw Error( "Trying to release an event instance into a pool of a different type." ); | ||
} | ||
} | ||
if (!condition) { | ||
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | ||
args[_key2 - 2] = arguments[_key2]; | ||
} | ||
event.destructor(); | ||
printWarning.apply(void 0, [format].concat(args)); | ||
if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) { | ||
EventConstructor.eventPool.push(event); | ||
} | ||
}; | ||
} | ||
} | ||
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack; | ||
function addEventPoolingTo(EventConstructor) { | ||
EventConstructor.eventPool = []; | ||
EventConstructor.getPooled = getPooledEvent; | ||
EventConstructor.release = releasePooledEvent; | ||
} | ||
/** | ||
* HTML nodeType values that represent the type of the node | ||
*/ | ||
var ELEMENT_NODE = 1; | ||
/** | ||
* HTML nodeType values that represent the type of the node | ||
*/ | ||
var ELEMENT_NODE = 1; | ||
// Do not use the below two methods directly! | ||
// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM. | ||
// (It is the only module that is allowed to access these methods.) | ||
function unsafeCastStringToDOMTopLevelType(topLevelType) { | ||
return topLevelType; | ||
} | ||
// Do not use the below two methods directly! | ||
// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM. | ||
// (It is the only module that is allowed to access these methods.) | ||
function unsafeCastStringToDOMTopLevelType(topLevelType) { | ||
return topLevelType; | ||
} | ||
var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); | ||
var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); | ||
/** | ||
* Generate a mapping of standard vendor prefixes using the defined style property and event name. | ||
* | ||
* @param {string} styleProp | ||
* @param {string} eventName | ||
* @returns {object} | ||
*/ | ||
/** | ||
* Generate a mapping of standard vendor prefixes using the defined style property and event name. | ||
* | ||
* @param {string} styleProp | ||
* @param {string} eventName | ||
* @returns {object} | ||
*/ | ||
function makePrefixMap(styleProp, eventName) { | ||
var prefixes = {}; | ||
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); | ||
prefixes['Webkit' + styleProp] = 'webkit' + eventName; | ||
prefixes['Moz' + styleProp] = 'moz' + eventName; | ||
return prefixes; | ||
} | ||
/** | ||
* A list of event names to a configurable list of vendor prefixes. | ||
*/ | ||
function makePrefixMap(styleProp, eventName) { | ||
var prefixes = {}; | ||
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); | ||
prefixes['Webkit' + styleProp] = 'webkit' + eventName; | ||
prefixes['Moz' + styleProp] = 'moz' + eventName; | ||
return prefixes; | ||
} | ||
/** | ||
* A list of event names to a configurable list of vendor prefixes. | ||
*/ | ||
var vendorPrefixes = { | ||
animationend: makePrefixMap('Animation', 'AnimationEnd'), | ||
animationiteration: makePrefixMap('Animation', 'AnimationIteration'), | ||
animationstart: makePrefixMap('Animation', 'AnimationStart'), | ||
transitionend: makePrefixMap('Transition', 'TransitionEnd') | ||
}; | ||
/** | ||
* Event names that have already been detected and prefixed (if applicable). | ||
*/ | ||
var vendorPrefixes = { | ||
animationend: makePrefixMap('Animation', 'AnimationEnd'), | ||
animationiteration: makePrefixMap('Animation', 'AnimationIteration'), | ||
animationstart: makePrefixMap('Animation', 'AnimationStart'), | ||
transitionend: makePrefixMap('Transition', 'TransitionEnd') | ||
}; | ||
/** | ||
* Event names that have already been detected and prefixed (if applicable). | ||
*/ | ||
var prefixedEventNames = {}; | ||
/** | ||
* Element to check for prefixes on. | ||
*/ | ||
var prefixedEventNames = {}; | ||
/** | ||
* Element to check for prefixes on. | ||
*/ | ||
var style = {}; | ||
/** | ||
* Bootstrap if a DOM exists. | ||
*/ | ||
var style = {}; | ||
/** | ||
* Bootstrap if a DOM exists. | ||
*/ | ||
if (canUseDOM) { | ||
style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x, | ||
// the un-prefixed "animation" and "transition" properties are defined on the | ||
// style object but the events that fire will still be prefixed, so we need | ||
// to check if the un-prefixed events are usable, and if not remove them from the map. | ||
if (canUseDOM) { | ||
style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x, | ||
// the un-prefixed "animation" and "transition" properties are defined on the | ||
// style object but the events that fire will still be prefixed, so we need | ||
// to check if the un-prefixed events are usable, and if not remove them from the map. | ||
if (!('AnimationEvent' in window)) { | ||
delete vendorPrefixes.animationend.animation; | ||
delete vendorPrefixes.animationiteration.animation; | ||
delete vendorPrefixes.animationstart.animation; | ||
} // Same as above | ||
if (!('AnimationEvent' in window)) { | ||
delete vendorPrefixes.animationend.animation; | ||
delete vendorPrefixes.animationiteration.animation; | ||
delete vendorPrefixes.animationstart.animation; | ||
} // Same as above | ||
if (!('TransitionEvent' in window)) { | ||
delete vendorPrefixes.transitionend.transition; | ||
if (!('TransitionEvent' in window)) { | ||
delete vendorPrefixes.transitionend.transition; | ||
} | ||
} | ||
} | ||
/** | ||
* Attempts to determine the correct vendor prefixed event name. | ||
* | ||
* @param {string} eventName | ||
* @returns {string} | ||
*/ | ||
/** | ||
* Attempts to determine the correct vendor prefixed event name. | ||
* | ||
* @param {string} eventName | ||
* @returns {string} | ||
*/ | ||
function getVendorPrefixedEventName(eventName) { | ||
if (prefixedEventNames[eventName]) { | ||
return prefixedEventNames[eventName]; | ||
} else if (!vendorPrefixes[eventName]) { | ||
return eventName; | ||
} | ||
function getVendorPrefixedEventName(eventName) { | ||
if (prefixedEventNames[eventName]) { | ||
return prefixedEventNames[eventName]; | ||
} else if (!vendorPrefixes[eventName]) { | ||
return eventName; | ||
} | ||
var prefixMap = vendorPrefixes[eventName]; | ||
var prefixMap = vendorPrefixes[eventName]; | ||
for (var styleProp in prefixMap) { | ||
if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) { | ||
return prefixedEventNames[eventName] = prefixMap[styleProp]; | ||
for (var styleProp in prefixMap) { | ||
if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) { | ||
return prefixedEventNames[eventName] = prefixMap[styleProp]; | ||
} | ||
} | ||
return eventName; | ||
} | ||
return eventName; | ||
} | ||
/** | ||
* To identify top level events in ReactDOM, we use constants defined by this | ||
* module. This is the only module that uses the unsafe* methods to express | ||
* that the constants actually correspond to the browser event names. This lets | ||
* us save some bundle size by avoiding a top level type -> event name map. | ||
* The rest of ReactDOM code should import top level types from this file. | ||
*/ | ||
/** | ||
* To identify top level events in ReactDOM, we use constants defined by this | ||
* module. This is the only module that uses the unsafe* methods to express | ||
* that the constants actually correspond to the browser event names. This lets | ||
* us save some bundle size by avoiding a top level type -> event name map. | ||
* The rest of ReactDOM code should import top level types from this file. | ||
*/ | ||
var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort'); | ||
var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend')); | ||
var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration')); | ||
var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart')); | ||
var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur'); | ||
var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay'); | ||
var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough'); | ||
var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel'); | ||
var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change'); | ||
var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click'); | ||
var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close'); | ||
var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend'); | ||
var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart'); | ||
var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate'); | ||
var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu'); | ||
var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy'); | ||
var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut'); | ||
var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick'); | ||
var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag'); | ||
var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend'); | ||
var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter'); | ||
var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit'); | ||
var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave'); | ||
var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover'); | ||
var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart'); | ||
var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop'); | ||
var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange'); | ||
var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied'); | ||
var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted'); | ||
var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended'); | ||
var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error'); | ||
var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus'); | ||
var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input'); | ||
var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown'); | ||
var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress'); | ||
var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup'); | ||
var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load'); | ||
var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart'); | ||
var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata'); | ||
var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata'); | ||
var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown'); | ||
var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove'); | ||
var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout'); | ||
var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover'); | ||
var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup'); | ||
var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste'); | ||
var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause'); | ||
var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play'); | ||
var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing'); | ||
var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress'); | ||
var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange'); | ||
var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll'); | ||
var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked'); | ||
var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking'); | ||
var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange'); | ||
var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled'); | ||
var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend'); | ||
var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput'); | ||
var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate'); | ||
var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle'); | ||
var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel'); | ||
var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend'); | ||
var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove'); | ||
var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart'); | ||
var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend')); | ||
var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange'); | ||
var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting'); | ||
var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements. | ||
var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort'); | ||
var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend')); | ||
var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration')); | ||
var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart')); | ||
var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur'); | ||
var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay'); | ||
var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough'); | ||
var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel'); | ||
var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change'); | ||
var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click'); | ||
var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close'); | ||
var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend'); | ||
var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart'); | ||
var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate'); | ||
var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu'); | ||
var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy'); | ||
var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut'); | ||
var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick'); | ||
var PLUGIN_EVENT_SYSTEM = 1; | ||
var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag'); | ||
var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend'); | ||
var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter'); | ||
var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit'); | ||
var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave'); | ||
var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover'); | ||
var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart'); | ||
var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop'); | ||
var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange'); | ||
var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied'); | ||
var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted'); | ||
var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended'); | ||
var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error'); | ||
var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus'); | ||
var didWarnAboutMessageChannel = false; | ||
var enqueueTaskImpl = null; | ||
function enqueueTask(task) { | ||
if (enqueueTaskImpl === null) { | ||
try { | ||
// read require off the module object to get around the bundlers. | ||
// we don't want them to detect a require and bundle a Node polyfill. | ||
var requireString = ('require' + Math.random()).slice(0, 7); | ||
var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's | ||
// version of setImmediate, bypassing fake timers if any. | ||
var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input'); | ||
enqueueTaskImpl = nodeRequire('timers').setImmediate; | ||
} catch (_err) { | ||
// we're in a browser | ||
// we can't use regular timers because they may still be faked | ||
// so we try MessageChannel+postMessage instead | ||
enqueueTaskImpl = function (callback) { | ||
{ | ||
if (didWarnAboutMessageChannel === false) { | ||
didWarnAboutMessageChannel = true; | ||
var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown'); | ||
var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress'); | ||
var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup'); | ||
var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load'); | ||
var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart'); | ||
var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata'); | ||
var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata'); | ||
if (typeof MessageChannel === 'undefined') { | ||
error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.'); | ||
} | ||
} | ||
} | ||
var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown'); | ||
var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove'); | ||
var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout'); | ||
var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover'); | ||
var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup'); | ||
var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste'); | ||
var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause'); | ||
var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play'); | ||
var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing'); | ||
var channel = new MessageChannel(); | ||
channel.port1.onmessage = callback; | ||
channel.port2.postMessage(undefined); | ||
}; | ||
} | ||
} | ||
return enqueueTaskImpl(task); | ||
} | ||
var ReactInternals$1 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
var _ReactInternals$Sched = ReactInternals$1.Scheduler, | ||
unstable_cancelCallback = _ReactInternals$Sched.unstable_cancelCallback, | ||
unstable_now = _ReactInternals$Sched.unstable_now, | ||
unstable_scheduleCallback = _ReactInternals$Sched.unstable_scheduleCallback, | ||
unstable_shouldYield = _ReactInternals$Sched.unstable_shouldYield, | ||
unstable_requestPaint = _ReactInternals$Sched.unstable_requestPaint, | ||
unstable_getFirstCallbackNode = _ReactInternals$Sched.unstable_getFirstCallbackNode, | ||
unstable_runWithPriority = _ReactInternals$Sched.unstable_runWithPriority, | ||
unstable_next = _ReactInternals$Sched.unstable_next, | ||
unstable_continueExecution = _ReactInternals$Sched.unstable_continueExecution, | ||
unstable_pauseExecution = _ReactInternals$Sched.unstable_pauseExecution, | ||
unstable_getCurrentPriorityLevel = _ReactInternals$Sched.unstable_getCurrentPriorityLevel, | ||
unstable_ImmediatePriority = _ReactInternals$Sched.unstable_ImmediatePriority, | ||
unstable_UserBlockingPriority = _ReactInternals$Sched.unstable_UserBlockingPriority, | ||
unstable_NormalPriority = _ReactInternals$Sched.unstable_NormalPriority, | ||
unstable_LowPriority = _ReactInternals$Sched.unstable_LowPriority, | ||
unstable_IdlePriority = _ReactInternals$Sched.unstable_IdlePriority, | ||
unstable_forceFrameRate = _ReactInternals$Sched.unstable_forceFrameRate, | ||
unstable_flushAllWithoutAsserting = _ReactInternals$Sched.unstable_flushAllWithoutAsserting; | ||
// ReactDOM.js, and ReactTestUtils.js: | ||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events, | ||
/* eslint-disable no-unused-vars */ | ||
getInstanceFromNode = _ReactDOM$__SECRET_IN[0], | ||
getNodeFromInstance = _ReactDOM$__SECRET_IN[1], | ||
getFiberCurrentPropsFromNode = _ReactDOM$__SECRET_IN[2], | ||
injectEventPluginsByName = _ReactDOM$__SECRET_IN[3], | ||
eventNameDispatchConfigs = _ReactDOM$__SECRET_IN[4], | ||
accumulateTwoPhaseDispatches = _ReactDOM$__SECRET_IN[5], | ||
accumulateDirectDispatches = _ReactDOM$__SECRET_IN[6], | ||
enqueueStateRestore = _ReactDOM$__SECRET_IN[7], | ||
restoreStateIfNeeded = _ReactDOM$__SECRET_IN[8], | ||
dispatchEvent = _ReactDOM$__SECRET_IN[9], | ||
runEventsInBatch = _ReactDOM$__SECRET_IN[10], | ||
/* eslint-enable no-unused-vars */ | ||
flushPassiveEffects = _ReactDOM$__SECRET_IN[11], | ||
IsThisRendererActing = _ReactDOM$__SECRET_IN[12]; | ||
var batchedUpdates = ReactDOM.unstable_batchedUpdates; | ||
var IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing; // this implementation should be exactly the same in | ||
// ReactTestUtilsAct.js, ReactTestRendererAct.js, createReactNoop.js | ||
var isSchedulerMocked = typeof unstable_flushAllWithoutAsserting === 'function'; | ||
var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress'); | ||
var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange'); | ||
var flushWork = unstable_flushAllWithoutAsserting || function () { | ||
var didFlushWork = false; | ||
var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll'); | ||
var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked'); | ||
var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking'); | ||
var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange'); | ||
var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled'); | ||
var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend'); | ||
var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput'); | ||
var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate'); | ||
var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle'); | ||
var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel'); | ||
var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend'); | ||
var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove'); | ||
var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart'); | ||
var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend')); | ||
var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange'); | ||
var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting'); | ||
var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements. | ||
// Note that events in this list will *not* be listened to at the top level | ||
// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`. | ||
var PLUGIN_EVENT_SYSTEM = 1; | ||
var didWarnAboutMessageChannel = false; | ||
var enqueueTask; | ||
try { | ||
// read require off the module object to get around the bundlers. | ||
// we don't want them to detect a require and bundle a Node polyfill. | ||
var requireString = ('require' + Math.random()).slice(0, 7); | ||
var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's | ||
// version of setImmediate, bypassing fake timers if any. | ||
enqueueTask = nodeRequire('timers').setImmediate; | ||
} catch (_err) { | ||
// we're in a browser | ||
// we can't use regular timers because they may still be faked | ||
// so we try MessageChannel+postMessage instead | ||
enqueueTask = function (callback) { | ||
{ | ||
if (didWarnAboutMessageChannel === false) { | ||
didWarnAboutMessageChannel = true; | ||
!(typeof MessageChannel !== 'undefined') ? warningWithoutStack$1(false, 'This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.') : void 0; | ||
} | ||
while (flushPassiveEffects()) { | ||
didFlushWork = true; | ||
} | ||
var channel = new MessageChannel(); | ||
channel.port1.onmessage = callback; | ||
channel.port2.postMessage(undefined); | ||
return didFlushWork; | ||
}; | ||
} | ||
var enqueueTask$1 = enqueueTask; | ||
function flushWorkAndMicroTasks(onDone) { | ||
try { | ||
flushWork(); | ||
enqueueTask(function () { | ||
if (flushWork()) { | ||
flushWorkAndMicroTasks(onDone); | ||
} else { | ||
onDone(); | ||
} | ||
}); | ||
} catch (err) { | ||
onDone(err); | ||
} | ||
} // we track the 'depth' of the act() calls with this counter, | ||
// so we can tell if any async act() calls try to run in parallel. | ||
var ReactInternals$1 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
var _ReactInternals$Sched = ReactInternals$1.Scheduler; | ||
var unstable_cancelCallback = _ReactInternals$Sched.unstable_cancelCallback; | ||
var unstable_now = _ReactInternals$Sched.unstable_now; | ||
var unstable_scheduleCallback = _ReactInternals$Sched.unstable_scheduleCallback; | ||
var unstable_shouldYield = _ReactInternals$Sched.unstable_shouldYield; | ||
var unstable_requestPaint = _ReactInternals$Sched.unstable_requestPaint; | ||
var unstable_getFirstCallbackNode = _ReactInternals$Sched.unstable_getFirstCallbackNode; | ||
var unstable_runWithPriority = _ReactInternals$Sched.unstable_runWithPriority; | ||
var unstable_next = _ReactInternals$Sched.unstable_next; | ||
var unstable_continueExecution = _ReactInternals$Sched.unstable_continueExecution; | ||
var unstable_pauseExecution = _ReactInternals$Sched.unstable_pauseExecution; | ||
var unstable_getCurrentPriorityLevel = _ReactInternals$Sched.unstable_getCurrentPriorityLevel; | ||
var unstable_ImmediatePriority = _ReactInternals$Sched.unstable_ImmediatePriority; | ||
var unstable_UserBlockingPriority = _ReactInternals$Sched.unstable_UserBlockingPriority; | ||
var unstable_NormalPriority = _ReactInternals$Sched.unstable_NormalPriority; | ||
var unstable_LowPriority = _ReactInternals$Sched.unstable_LowPriority; | ||
var unstable_IdlePriority = _ReactInternals$Sched.unstable_IdlePriority; | ||
var unstable_forceFrameRate = _ReactInternals$Sched.unstable_forceFrameRate; | ||
var unstable_flushAllWithoutAsserting = _ReactInternals$Sched.unstable_flushAllWithoutAsserting; | ||
// ReactDOM.js, and ReactTestUtils.js: | ||
var actingUpdatesScopeDepth = 0; | ||
var _ReactDOM$__SECRET_IN$1 = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events; | ||
var getInstanceFromNode$1 = _ReactDOM$__SECRET_IN$1[0]; | ||
var getNodeFromInstance$1 = _ReactDOM$__SECRET_IN$1[1]; | ||
var getFiberCurrentPropsFromNode$1 = _ReactDOM$__SECRET_IN$1[2]; | ||
var injectEventPluginsByName$1 = _ReactDOM$__SECRET_IN$1[3]; | ||
var eventNameDispatchConfigs$1 = _ReactDOM$__SECRET_IN$1[4]; | ||
var accumulateTwoPhaseDispatches$1 = _ReactDOM$__SECRET_IN$1[5]; | ||
var accumulateDirectDispatches$1 = _ReactDOM$__SECRET_IN$1[6]; | ||
var enqueueStateRestore$1 = _ReactDOM$__SECRET_IN$1[7]; | ||
var restoreStateIfNeeded$1 = _ReactDOM$__SECRET_IN$1[8]; | ||
var dispatchEvent$1 = _ReactDOM$__SECRET_IN$1[9]; | ||
var runEventsInBatch$1 = _ReactDOM$__SECRET_IN$1[10]; | ||
var flushPassiveEffects$1 = _ReactDOM$__SECRET_IN$1[11]; | ||
var IsThisRendererActing$1 = _ReactDOM$__SECRET_IN$1[12]; | ||
var batchedUpdates = ReactDOM.unstable_batchedUpdates; | ||
var IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing; // this implementation should be exactly the same in | ||
// ReactTestUtilsAct.js, ReactTestRendererAct.js, createReactNoop.js | ||
function act(callback) { | ||
var isSchedulerMocked = typeof unstable_flushAllWithoutAsserting === 'function'; | ||
var previousActingUpdatesScopeDepth = actingUpdatesScopeDepth; | ||
var previousIsSomeRendererActing; | ||
var previousIsThisRendererActing; | ||
actingUpdatesScopeDepth++; | ||
previousIsSomeRendererActing = IsSomeRendererActing.current; | ||
previousIsThisRendererActing = IsThisRendererActing.current; | ||
IsSomeRendererActing.current = true; | ||
IsThisRendererActing.current = true; | ||
var flushWork = unstable_flushAllWithoutAsserting || function () { | ||
var didFlushWork = false; | ||
function onDone() { | ||
actingUpdatesScopeDepth--; | ||
IsSomeRendererActing.current = previousIsSomeRendererActing; | ||
IsThisRendererActing.current = previousIsThisRendererActing; | ||
while (flushPassiveEffects$1()) { | ||
didFlushWork = true; | ||
} | ||
return didFlushWork; | ||
}; | ||
function flushWorkAndMicroTasks(onDone) { | ||
try { | ||
flushWork(); | ||
enqueueTask$1(function () { | ||
if (flushWork()) { | ||
flushWorkAndMicroTasks(onDone); | ||
} else { | ||
onDone(); | ||
{ | ||
if (actingUpdatesScopeDepth > previousActingUpdatesScopeDepth) { | ||
// if it's _less than_ previousActingUpdatesScopeDepth, then we can assume the 'other' one has warned | ||
error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. '); | ||
} | ||
} | ||
}); | ||
} catch (err) { | ||
onDone(err); | ||
} | ||
} // we track the 'depth' of the act() calls with this counter, | ||
// so we can tell if any async act() calls try to run in parallel. | ||
} | ||
var result; | ||
var actingUpdatesScopeDepth = 0; | ||
function act(callback) { | ||
var previousActingUpdatesScopeDepth = actingUpdatesScopeDepth; | ||
var previousIsSomeRendererActing; | ||
var previousIsThisRendererActing; | ||
actingUpdatesScopeDepth++; | ||
previousIsSomeRendererActing = IsSomeRendererActing.current; | ||
previousIsThisRendererActing = IsThisRendererActing$1.current; | ||
IsSomeRendererActing.current = true; | ||
IsThisRendererActing$1.current = true; | ||
function onDone() { | ||
actingUpdatesScopeDepth--; | ||
IsSomeRendererActing.current = previousIsSomeRendererActing; | ||
IsThisRendererActing$1.current = previousIsThisRendererActing; | ||
{ | ||
if (actingUpdatesScopeDepth > previousActingUpdatesScopeDepth) { | ||
// if it's _less than_ previousActingUpdatesScopeDepth, then we can assume the 'other' one has warned | ||
warningWithoutStack$1(false, 'You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. '); | ||
} | ||
try { | ||
result = batchedUpdates(callback); | ||
} catch (error) { | ||
// on sync errors, we still want to 'cleanup' and decrement actingUpdatesScopeDepth | ||
onDone(); | ||
throw error; | ||
} | ||
} | ||
var result; | ||
if (result !== null && typeof result === 'object' && typeof result.then === 'function') { | ||
// setup a boolean that gets set to true only | ||
// once this act() call is await-ed | ||
var called = false; | ||
try { | ||
result = batchedUpdates(callback); | ||
} catch (error) { | ||
// on sync errors, we still want to 'cleanup' and decrement actingUpdatesScopeDepth | ||
onDone(); | ||
throw error; | ||
} | ||
{ | ||
if (typeof Promise !== 'undefined') { | ||
//eslint-disable-next-line no-undef | ||
Promise.resolve().then(function () {}).then(function () { | ||
if (called === false) { | ||
error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, interleaving multiple act ' + 'calls and mixing their scopes. You should - await act(async () => ...);'); | ||
} | ||
}); | ||
} | ||
} // in the async case, the returned thenable runs the callback, flushes | ||
// effects and microtasks in a loop until flushPassiveEffects() === false, | ||
// and cleans up | ||
if (result !== null && typeof result === 'object' && typeof result.then === 'function') { | ||
// setup a boolean that gets set to true only | ||
// once this act() call is await-ed | ||
var called = false; | ||
{ | ||
if (typeof Promise !== 'undefined') { | ||
//eslint-disable-next-line no-undef | ||
Promise.resolve().then(function () {}).then(function () { | ||
if (called === false) { | ||
warningWithoutStack$1(false, 'You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, interleaving multiple act ' + 'calls and mixing their scopes. You should - await act(async () => ...);'); | ||
} | ||
}); | ||
} | ||
} // in the async case, the returned thenable runs the callback, flushes | ||
// effects and microtasks in a loop until flushPassiveEffects() === false, | ||
// and cleans up | ||
return { | ||
then: function (resolve, reject) { | ||
called = true; | ||
result.then(function () { | ||
if (actingUpdatesScopeDepth > 1 || isSchedulerMocked === true && previousIsSomeRendererActing === true) { | ||
onDone(); | ||
resolve(); | ||
return; | ||
} // we're about to exit the act() scope, | ||
// now's the time to flush tasks/effects | ||
return { | ||
then: function (resolve, reject) { | ||
called = true; | ||
result.then(function () { | ||
if (actingUpdatesScopeDepth > 1 || isSchedulerMocked === true && previousIsSomeRendererActing === true) { | ||
onDone(); | ||
resolve(); | ||
return; | ||
} // we're about to exit the act() scope, | ||
// now's the time to flush tasks/effects | ||
flushWorkAndMicroTasks(function (err) { | ||
onDone(); | ||
flushWorkAndMicroTasks(function (err) { | ||
if (err) { | ||
reject(err); | ||
} else { | ||
resolve(); | ||
} | ||
}); | ||
}, function (err) { | ||
onDone(); | ||
if (err) { | ||
reject(err); | ||
} else { | ||
resolve(); | ||
} | ||
reject(err); | ||
}); | ||
}, function (err) { | ||
onDone(); | ||
reject(err); | ||
}); | ||
} | ||
}; | ||
} else { | ||
{ | ||
!(result === undefined) ? warningWithoutStack$1(false, 'The callback passed to act(...) function ' + 'must return undefined, or a Promise. You returned %s', result) : void 0; | ||
} // flush effects until none remain, and cleanup | ||
} | ||
}; | ||
} else { | ||
{ | ||
if (result !== undefined) { | ||
error('The callback passed to act(...) function ' + 'must return undefined, or a Promise. You returned %s', result); | ||
} | ||
} // flush effects until none remain, and cleanup | ||
try { | ||
if (actingUpdatesScopeDepth === 1 && (isSchedulerMocked === false || previousIsSomeRendererActing === false)) { | ||
// we're about to exit the act() scope, | ||
// now's the time to flush effects | ||
flushWork(); | ||
} | ||
try { | ||
if (actingUpdatesScopeDepth === 1 && (isSchedulerMocked === false || previousIsSomeRendererActing === false)) { | ||
// we're about to exit the act() scope, | ||
// now's the time to flush effects | ||
flushWork(); | ||
} | ||
onDone(); | ||
} catch (err) { | ||
onDone(); | ||
throw err; | ||
} // in the sync case, the returned thenable only warns *if* await-ed | ||
onDone(); | ||
} catch (err) { | ||
onDone(); | ||
throw err; | ||
} // in the sync case, the returned thenable only warns *if* await-ed | ||
return { | ||
then: function (resolve) { | ||
{ | ||
warningWithoutStack$1(false, 'Do not await the result of calling act(...) with sync logic, it is not a Promise.'); | ||
return { | ||
then: function (resolve) { | ||
{ | ||
error('Do not await the result of calling act(...) with sync logic, it is not a Promise.'); | ||
} | ||
resolve(); | ||
} | ||
resolve(); | ||
} | ||
}; | ||
}; | ||
} | ||
} | ||
} | ||
var findDOMNode = ReactDOM.findDOMNode; // Keep in sync with ReactDOMUnstableNativeDependencies.js | ||
// ReactDOM.js, and ReactTestUtilsAct.js: | ||
var findDOMNode = ReactDOM.findDOMNode; // Keep in sync with ReactDOMUnstableNativeDependencies.js | ||
// ReactDOM.js, and ReactTestUtilsAct.js: | ||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events; | ||
var getInstanceFromNode = _ReactDOM$__SECRET_IN[0]; | ||
var getNodeFromInstance = _ReactDOM$__SECRET_IN[1]; | ||
var getFiberCurrentPropsFromNode = _ReactDOM$__SECRET_IN[2]; | ||
var injectEventPluginsByName = _ReactDOM$__SECRET_IN[3]; | ||
var eventNameDispatchConfigs = _ReactDOM$__SECRET_IN[4]; | ||
var accumulateTwoPhaseDispatches = _ReactDOM$__SECRET_IN[5]; | ||
var accumulateDirectDispatches = _ReactDOM$__SECRET_IN[6]; | ||
var enqueueStateRestore = _ReactDOM$__SECRET_IN[7]; | ||
var restoreStateIfNeeded = _ReactDOM$__SECRET_IN[8]; | ||
var dispatchEvent = _ReactDOM$__SECRET_IN[9]; | ||
var runEventsInBatch = _ReactDOM$__SECRET_IN[10]; | ||
var flushPassiveEffects = _ReactDOM$__SECRET_IN[11]; | ||
var IsThisRendererActing = _ReactDOM$__SECRET_IN[12]; | ||
var _ReactDOM$__SECRET_IN$1 = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events, | ||
getInstanceFromNode$1 = _ReactDOM$__SECRET_IN$1[0], | ||
function Event(suffix) {} | ||
/* eslint-disable no-unused-vars */ | ||
getNodeFromInstance$1 = _ReactDOM$__SECRET_IN$1[1], | ||
getFiberCurrentPropsFromNode$1 = _ReactDOM$__SECRET_IN$1[2], | ||
injectEventPluginsByName$1 = _ReactDOM$__SECRET_IN$1[3], | ||
var hasWarnedAboutDeprecatedMockComponent = false; | ||
/** | ||
* @class ReactTestUtils | ||
*/ | ||
/* eslint-enable no-unused-vars */ | ||
eventNameDispatchConfigs$1 = _ReactDOM$__SECRET_IN$1[4], | ||
accumulateTwoPhaseDispatches$1 = _ReactDOM$__SECRET_IN$1[5], | ||
accumulateDirectDispatches$1 = _ReactDOM$__SECRET_IN$1[6], | ||
enqueueStateRestore$1 = _ReactDOM$__SECRET_IN$1[7], | ||
restoreStateIfNeeded$1 = _ReactDOM$__SECRET_IN$1[8], | ||
dispatchEvent$1 = _ReactDOM$__SECRET_IN$1[9], | ||
runEventsInBatch$1 = _ReactDOM$__SECRET_IN$1[10], | ||
/** | ||
* Simulates a top level event being dispatched from a raw event that occurred | ||
* on an `Element` node. | ||
* @param {number} topLevelType A number from `TopLevelEventTypes` | ||
* @param {!Element} node The dom to simulate an event occurring on. | ||
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent. | ||
*/ | ||
/* eslint-disable no-unused-vars */ | ||
flushPassiveEffects$1 = _ReactDOM$__SECRET_IN$1[11], | ||
IsThisRendererActing$1 | ||
/* eslint-enable no-unused-vars */ | ||
= _ReactDOM$__SECRET_IN$1[12]; | ||
function simulateNativeEventOnNode(topLevelType, node, fakeNativeEvent) { | ||
fakeNativeEvent.target = node; | ||
dispatchEvent(topLevelType, PLUGIN_EVENT_SYSTEM, fakeNativeEvent); | ||
} | ||
/** | ||
* Simulates a top level event being dispatched from a raw event that occurred | ||
* on the `ReactDOMComponent` `comp`. | ||
* @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`. | ||
* @param {!ReactDOMComponent} comp | ||
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent. | ||
*/ | ||
function Event(suffix) {} | ||
var hasWarnedAboutDeprecatedMockComponent = false; | ||
/** | ||
* @class ReactTestUtils | ||
*/ | ||
function simulateNativeEventOnDOMComponent(topLevelType, comp, fakeNativeEvent) { | ||
simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent); | ||
} | ||
/** | ||
* Simulates a top level event being dispatched from a raw event that occurred | ||
* on an `Element` node. | ||
* @param {number} topLevelType A number from `TopLevelEventTypes` | ||
* @param {!Element} node The dom to simulate an event occurring on. | ||
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent. | ||
*/ | ||
function findAllInRenderedFiberTreeInternal(fiber, test) { | ||
if (!fiber) { | ||
return []; | ||
function simulateNativeEventOnNode(topLevelType, node, fakeNativeEvent) { | ||
fakeNativeEvent.target = node; | ||
dispatchEvent$1(topLevelType, PLUGIN_EVENT_SYSTEM, document, fakeNativeEvent); | ||
} | ||
/** | ||
* Simulates a top level event being dispatched from a raw event that occurred | ||
* on the `ReactDOMComponent` `comp`. | ||
* @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`. | ||
* @param {!ReactDOMComponent} comp | ||
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent. | ||
*/ | ||
var currentParent = findCurrentFiberUsingSlowPath(fiber); | ||
if (!currentParent) { | ||
return []; | ||
function simulateNativeEventOnDOMComponent(topLevelType, comp, fakeNativeEvent) { | ||
simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent); | ||
} | ||
var node = currentParent; | ||
var ret = []; | ||
function findAllInRenderedFiberTreeInternal(fiber, test) { | ||
if (!fiber) { | ||
return []; | ||
} | ||
while (true) { | ||
if (node.tag === HostComponent || node.tag === HostText || node.tag === ClassComponent || node.tag === FunctionComponent) { | ||
var publicInst = node.stateNode; | ||
var currentParent = findCurrentFiberUsingSlowPath(fiber); | ||
if (test(publicInst)) { | ||
ret.push(publicInst); | ||
} | ||
if (!currentParent) { | ||
return []; | ||
} | ||
if (node.child) { | ||
node.child.return = node; | ||
node = node.child; | ||
continue; | ||
} | ||
var node = currentParent; | ||
var ret = []; | ||
if (node === currentParent) { | ||
return ret; | ||
} | ||
while (true) { | ||
if (node.tag === HostComponent || node.tag === HostText || node.tag === ClassComponent || node.tag === FunctionComponent) { | ||
var publicInst = node.stateNode; | ||
while (!node.sibling) { | ||
if (!node.return || node.return === currentParent) { | ||
if (test(publicInst)) { | ||
ret.push(publicInst); | ||
} | ||
} | ||
if (node.child) { | ||
node.child.return = node; | ||
node = node.child; | ||
continue; | ||
} | ||
if (node === currentParent) { | ||
return ret; | ||
} | ||
node = node.return; | ||
} | ||
while (!node.sibling) { | ||
if (!node.return || node.return === currentParent) { | ||
return ret; | ||
} | ||
node.sibling.return = node.return; | ||
node = node.sibling; | ||
} | ||
} | ||
node = node.return; | ||
} | ||
function validateClassInstance(inst, methodName) { | ||
if (!inst) { | ||
// This is probably too relaxed but it's existing behavior. | ||
return; | ||
node.sibling.return = node.return; | ||
node = node.sibling; | ||
} | ||
} | ||
if (get(inst)) { | ||
// This is a public instance indeed. | ||
return; | ||
} | ||
function validateClassInstance(inst, methodName) { | ||
if (!inst) { | ||
// This is probably too relaxed but it's existing behavior. | ||
return; | ||
} | ||
var received; | ||
var stringified = '' + inst; | ||
if (get(inst)) { | ||
// This is a public instance indeed. | ||
return; | ||
} | ||
if (Array.isArray(inst)) { | ||
received = 'an array'; | ||
} else if (inst && inst.nodeType === ELEMENT_NODE && inst.tagName) { | ||
received = 'a DOM node'; | ||
} else if (stringified === '[object Object]') { | ||
received = 'object with keys {' + Object.keys(inst).join(', ') + '}'; | ||
} else { | ||
received = stringified; | ||
} | ||
var received; | ||
var stringified = '' + inst; | ||
{ | ||
if (Array.isArray(inst)) { | ||
received = 'an array'; | ||
} else if (inst && inst.nodeType === ELEMENT_NODE && inst.tagName) { | ||
received = 'a DOM node'; | ||
} else if (stringified === '[object Object]') { | ||
received = 'object with keys {' + Object.keys(inst).join(', ') + '}'; | ||
} else { | ||
received = stringified; | ||
} | ||
{ | ||
throw Error(methodName + "(...): the first argument must be a React class instance. Instead received: " + received + "."); | ||
{ | ||
throw Error( methodName + "(...): the first argument must be a React class instance. Instead received: " + received + "." ); | ||
} | ||
} | ||
} | ||
} | ||
/** | ||
* Utilities for making it easy to test React components. | ||
* | ||
* See https://reactjs.org/docs/test-utils.html | ||
* | ||
* Todo: Support the entire DOM.scry query syntax. For now, these simple | ||
* utilities will suffice for testing purposes. | ||
* @lends ReactTestUtils | ||
*/ | ||
/** | ||
* Utilities for making it easy to test React components. | ||
* | ||
* See https://reactjs.org/docs/test-utils.html | ||
* | ||
* Todo: Support the entire DOM.scry query syntax. For now, these simple | ||
* utilities will suffice for testing purposes. | ||
* @lends ReactTestUtils | ||
*/ | ||
var ReactTestUtils = { | ||
renderIntoDocument: function (element) { | ||
var div = document.createElement('div'); // None of our tests actually require attaching the container to the | ||
// DOM, and doing so creates a mess that we rely on test isolation to | ||
// clean up, so we're going to stop honoring the name of this method | ||
// (and probably rename it eventually) if no problems arise. | ||
// document.documentElement.appendChild(div); | ||
var ReactTestUtils = { | ||
renderIntoDocument: function (element) { | ||
var div = document.createElement('div'); // None of our tests actually require attaching the container to the | ||
// DOM, and doing so creates a mess that we rely on test isolation to | ||
// clean up, so we're going to stop honoring the name of this method | ||
// (and probably rename it eventually) if no problems arise. | ||
// document.documentElement.appendChild(div); | ||
return ReactDOM.render(element, div); | ||
}, | ||
isElement: function (element) { | ||
return React.isValidElement(element); | ||
}, | ||
isElementOfType: function (inst, convenienceConstructor) { | ||
return React.isValidElement(inst) && inst.type === convenienceConstructor; | ||
}, | ||
isDOMComponent: function (inst) { | ||
return !!(inst && inst.nodeType === ELEMENT_NODE && inst.tagName); | ||
}, | ||
isDOMComponentElement: function (inst) { | ||
return !!(inst && React.isValidElement(inst) && !!inst.tagName); | ||
}, | ||
isCompositeComponent: function (inst) { | ||
if (ReactTestUtils.isDOMComponent(inst)) { | ||
// Accessing inst.setState warns; just return false as that'll be what | ||
// this returns when we have DOM nodes as refs directly | ||
return false; | ||
} | ||
return ReactDOM.render(element, div); | ||
}, | ||
isElement: function (element) { | ||
return React.isValidElement(element); | ||
}, | ||
isElementOfType: function (inst, convenienceConstructor) { | ||
return React.isValidElement(inst) && inst.type === convenienceConstructor; | ||
}, | ||
isDOMComponent: function (inst) { | ||
return !!(inst && inst.nodeType === ELEMENT_NODE && inst.tagName); | ||
}, | ||
isDOMComponentElement: function (inst) { | ||
return !!(inst && React.isValidElement(inst) && !!inst.tagName); | ||
}, | ||
isCompositeComponent: function (inst) { | ||
if (ReactTestUtils.isDOMComponent(inst)) { | ||
// Accessing inst.setState warns; just return false as that'll be what | ||
// this returns when we have DOM nodes as refs directly | ||
return false; | ||
} | ||
return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function'; | ||
}, | ||
isCompositeComponentWithType: function (inst, type) { | ||
if (!ReactTestUtils.isCompositeComponent(inst)) { | ||
return false; | ||
} | ||
return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function'; | ||
}, | ||
isCompositeComponentWithType: function (inst, type) { | ||
if (!ReactTestUtils.isCompositeComponent(inst)) { | ||
return false; | ||
} | ||
var internalInstance = get(inst); | ||
var constructor = internalInstance.type; | ||
return constructor === type; | ||
}, | ||
findAllInRenderedTree: function (inst, test) { | ||
validateClassInstance(inst, 'findAllInRenderedTree'); | ||
var internalInstance = get(inst); | ||
var constructor = internalInstance.type; | ||
return constructor === type; | ||
}, | ||
findAllInRenderedTree: function (inst, test) { | ||
validateClassInstance(inst, 'findAllInRenderedTree'); | ||
if (!inst) { | ||
return []; | ||
} | ||
if (!inst) { | ||
return []; | ||
} | ||
var internalInstance = get(inst); | ||
return findAllInRenderedFiberTreeInternal(internalInstance, test); | ||
}, | ||
var internalInstance = get(inst); | ||
return findAllInRenderedFiberTreeInternal(internalInstance, test); | ||
}, | ||
/** | ||
* Finds all instance of components in the rendered tree that are DOM | ||
* components with the class name matching `className`. | ||
* @return {array} an array of all the matches. | ||
*/ | ||
scryRenderedDOMComponentsWithClass: function (root, classNames) { | ||
validateClassInstance(root, 'scryRenderedDOMComponentsWithClass'); | ||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) { | ||
if (ReactTestUtils.isDOMComponent(inst)) { | ||
var className = inst.className; | ||
/** | ||
* Finds all instance of components in the rendered tree that are DOM | ||
* components with the class name matching `className`. | ||
* @return {array} an array of all the matches. | ||
*/ | ||
scryRenderedDOMComponentsWithClass: function (root, classNames) { | ||
validateClassInstance(root, 'scryRenderedDOMComponentsWithClass'); | ||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) { | ||
if (ReactTestUtils.isDOMComponent(inst)) { | ||
var className = inst.className; | ||
if (typeof className !== 'string') { | ||
// SVG, probably. | ||
className = inst.getAttribute('class') || ''; | ||
} | ||
if (typeof className !== 'string') { | ||
// SVG, probably. | ||
className = inst.getAttribute('class') || ''; | ||
} | ||
var classList = className.split(/\s+/); | ||
var classList = className.split(/\s+/); | ||
if (!Array.isArray(classNames)) { | ||
if (!(classNames !== undefined)) { | ||
{ | ||
throw Error("TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument."); | ||
if (!Array.isArray(classNames)) { | ||
if (!(classNames !== undefined)) { | ||
{ | ||
throw Error( "TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument." ); | ||
} | ||
} | ||
classNames = classNames.split(/\s+/); | ||
} | ||
classNames = classNames.split(/\s+/); | ||
return classNames.every(function (name) { | ||
return classList.indexOf(name) !== -1; | ||
}); | ||
} | ||
return classNames.every(function (name) { | ||
return classList.indexOf(name) !== -1; | ||
}); | ||
return false; | ||
}); | ||
}, | ||
/** | ||
* Like scryRenderedDOMComponentsWithClass but expects there to be one result, | ||
* and returns that one result, or throws exception if there is any other | ||
* number of matches besides one. | ||
* @return {!ReactDOMComponent} The one match. | ||
*/ | ||
findRenderedDOMComponentWithClass: function (root, className) { | ||
validateClassInstance(root, 'findRenderedDOMComponentWithClass'); | ||
var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className); | ||
if (all.length !== 1) { | ||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className); | ||
} | ||
return false; | ||
}); | ||
}, | ||
return all[0]; | ||
}, | ||
/** | ||
* Like scryRenderedDOMComponentsWithClass but expects there to be one result, | ||
* and returns that one result, or throws exception if there is any other | ||
* number of matches besides one. | ||
* @return {!ReactDOMComponent} The one match. | ||
*/ | ||
findRenderedDOMComponentWithClass: function (root, className) { | ||
validateClassInstance(root, 'findRenderedDOMComponentWithClass'); | ||
var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className); | ||
/** | ||
* Finds all instance of components in the rendered tree that are DOM | ||
* components with the tag name matching `tagName`. | ||
* @return {array} an array of all the matches. | ||
*/ | ||
scryRenderedDOMComponentsWithTag: function (root, tagName) { | ||
validateClassInstance(root, 'scryRenderedDOMComponentsWithTag'); | ||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) { | ||
return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase(); | ||
}); | ||
}, | ||
if (all.length !== 1) { | ||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className); | ||
} | ||
/** | ||
* Like scryRenderedDOMComponentsWithTag but expects there to be one result, | ||
* and returns that one result, or throws exception if there is any other | ||
* number of matches besides one. | ||
* @return {!ReactDOMComponent} The one match. | ||
*/ | ||
findRenderedDOMComponentWithTag: function (root, tagName) { | ||
validateClassInstance(root, 'findRenderedDOMComponentWithTag'); | ||
var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName); | ||
return all[0]; | ||
}, | ||
if (all.length !== 1) { | ||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName); | ||
} | ||
/** | ||
* Finds all instance of components in the rendered tree that are DOM | ||
* components with the tag name matching `tagName`. | ||
* @return {array} an array of all the matches. | ||
*/ | ||
scryRenderedDOMComponentsWithTag: function (root, tagName) { | ||
validateClassInstance(root, 'scryRenderedDOMComponentsWithTag'); | ||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) { | ||
return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase(); | ||
}); | ||
}, | ||
return all[0]; | ||
}, | ||
/** | ||
* Like scryRenderedDOMComponentsWithTag but expects there to be one result, | ||
* and returns that one result, or throws exception if there is any other | ||
* number of matches besides one. | ||
* @return {!ReactDOMComponent} The one match. | ||
*/ | ||
findRenderedDOMComponentWithTag: function (root, tagName) { | ||
validateClassInstance(root, 'findRenderedDOMComponentWithTag'); | ||
var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName); | ||
/** | ||
* Finds all instances of components with type equal to `componentType`. | ||
* @return {array} an array of all the matches. | ||
*/ | ||
scryRenderedComponentsWithType: function (root, componentType) { | ||
validateClassInstance(root, 'scryRenderedComponentsWithType'); | ||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) { | ||
return ReactTestUtils.isCompositeComponentWithType(inst, componentType); | ||
}); | ||
}, | ||
if (all.length !== 1) { | ||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName); | ||
} | ||
/** | ||
* Same as `scryRenderedComponentsWithType` but expects there to be one result | ||
* and returns that one result, or throws exception if there is any other | ||
* number of matches besides one. | ||
* @return {!ReactComponent} The one match. | ||
*/ | ||
findRenderedComponentWithType: function (root, componentType) { | ||
validateClassInstance(root, 'findRenderedComponentWithType'); | ||
var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType); | ||
return all[0]; | ||
}, | ||
if (all.length !== 1) { | ||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType); | ||
} | ||
/** | ||
* Finds all instances of components with type equal to `componentType`. | ||
* @return {array} an array of all the matches. | ||
*/ | ||
scryRenderedComponentsWithType: function (root, componentType) { | ||
validateClassInstance(root, 'scryRenderedComponentsWithType'); | ||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) { | ||
return ReactTestUtils.isCompositeComponentWithType(inst, componentType); | ||
}); | ||
}, | ||
return all[0]; | ||
}, | ||
/** | ||
* Same as `scryRenderedComponentsWithType` but expects there to be one result | ||
* and returns that one result, or throws exception if there is any other | ||
* number of matches besides one. | ||
* @return {!ReactComponent} The one match. | ||
*/ | ||
findRenderedComponentWithType: function (root, componentType) { | ||
validateClassInstance(root, 'findRenderedComponentWithType'); | ||
var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType); | ||
/** | ||
* Pass a mocked component module to this method to augment it with | ||
* useful methods that allow it to be used as a dummy React component. | ||
* Instead of rendering as usual, the component will become a simple | ||
* <div> containing any provided children. | ||
* | ||
* @param {object} module the mock function object exported from a | ||
* module that defines the component to be mocked | ||
* @param {?string} mockTagName optional dummy root tag name to return | ||
* from render method (overrides | ||
* module.mockTagName if provided) | ||
* @return {object} the ReactTestUtils object (for chaining) | ||
*/ | ||
mockComponent: function (module, mockTagName) { | ||
{ | ||
if (!hasWarnedAboutDeprecatedMockComponent) { | ||
hasWarnedAboutDeprecatedMockComponent = true; | ||
if (all.length !== 1) { | ||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType); | ||
} | ||
warn('ReactTestUtils.mockComponent() is deprecated. ' + 'Use shallow rendering or jest.mock() instead.\n\n' + 'See https://fb.me/test-utils-mock-component for more information.'); | ||
} | ||
} | ||
return all[0]; | ||
}, | ||
mockTagName = mockTagName || module.mockTagName || 'div'; | ||
module.prototype.render.mockImplementation(function () { | ||
return React.createElement(mockTagName, null, this.props.children); | ||
}); | ||
return this; | ||
}, | ||
nativeTouchData: function (x, y) { | ||
return { | ||
touches: [{ | ||
pageX: x, | ||
pageY: y | ||
}] | ||
}; | ||
}, | ||
Simulate: null, | ||
SimulateNative: {}, | ||
act: act | ||
}; | ||
/** | ||
* Pass a mocked component module to this method to augment it with | ||
* useful methods that allow it to be used as a dummy React component. | ||
* Instead of rendering as usual, the component will become a simple | ||
* <div> containing any provided children. | ||
* Exports: | ||
* | ||
* @param {object} module the mock function object exported from a | ||
* module that defines the component to be mocked | ||
* @param {?string} mockTagName optional dummy root tag name to return | ||
* from render method (overrides | ||
* module.mockTagName if provided) | ||
* @return {object} the ReactTestUtils object (for chaining) | ||
* - `ReactTestUtils.Simulate.click(Element)` | ||
* - `ReactTestUtils.Simulate.mouseMove(Element)` | ||
* - `ReactTestUtils.Simulate.change(Element)` | ||
* - ... (All keys from event plugin `eventTypes` objects) | ||
*/ | ||
mockComponent: function (module, mockTagName) { | ||
if (!hasWarnedAboutDeprecatedMockComponent) { | ||
hasWarnedAboutDeprecatedMockComponent = true; | ||
lowPriorityWarningWithoutStack$1(false, 'ReactTestUtils.mockComponent() is deprecated. ' + 'Use shallow rendering or jest.mock() instead.\n\n' + 'See https://fb.me/test-utils-mock-component for more information.'); | ||
} | ||
mockTagName = mockTagName || module.mockTagName || 'div'; | ||
module.prototype.render.mockImplementation(function () { | ||
return React.createElement(mockTagName, null, this.props.children); | ||
}); | ||
return this; | ||
}, | ||
nativeTouchData: function (x, y) { | ||
return { | ||
touches: [{ | ||
pageX: x, | ||
pageY: y | ||
}] | ||
}; | ||
}, | ||
Simulate: null, | ||
SimulateNative: {}, | ||
act: act | ||
}; | ||
/** | ||
* Exports: | ||
* | ||
* - `ReactTestUtils.Simulate.click(Element)` | ||
* - `ReactTestUtils.Simulate.mouseMove(Element)` | ||
* - `ReactTestUtils.Simulate.change(Element)` | ||
* - ... (All keys from event plugin `eventTypes` objects) | ||
*/ | ||
function makeSimulator(eventType) { | ||
return function (domNode, eventData) { | ||
if (!!React.isValidElement(domNode)) { | ||
{ | ||
throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering."); | ||
function makeSimulator(eventType) { | ||
return function (domNode, eventData) { | ||
if (!!React.isValidElement(domNode)) { | ||
{ | ||
throw Error( "TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering." ); | ||
} | ||
} | ||
} | ||
if (!!ReactTestUtils.isCompositeComponent(domNode)) { | ||
{ | ||
throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead."); | ||
if (!!ReactTestUtils.isCompositeComponent(domNode)) { | ||
{ | ||
throw Error( "TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead." ); | ||
} | ||
} | ||
} | ||
var dispatchConfig = eventNameDispatchConfigs[eventType]; | ||
var fakeNativeEvent = new Event(); | ||
fakeNativeEvent.target = domNode; | ||
fakeNativeEvent.type = eventType.toLowerCase(); // We don't use SyntheticEvent.getPooled in order to not have to worry about | ||
// properly destroying any properties assigned from `eventData` upon release | ||
var dispatchConfig = eventNameDispatchConfigs$1[eventType]; | ||
var fakeNativeEvent = new Event(); | ||
fakeNativeEvent.target = domNode; | ||
fakeNativeEvent.type = eventType.toLowerCase(); // We don't use SyntheticEvent.getPooled in order to not have to worry about | ||
// properly destroying any properties assigned from `eventData` upon release | ||
var targetInst = getInstanceFromNode(domNode); | ||
var event = new SyntheticEvent(dispatchConfig, targetInst, fakeNativeEvent, domNode); // Since we aren't using pooling, always persist the event. This will make | ||
// sure it's marked and won't warn when setting additional properties. | ||
var targetInst = getInstanceFromNode$1(domNode); | ||
var event = new SyntheticEvent(dispatchConfig, targetInst, fakeNativeEvent, domNode); // Since we aren't using pooling, always persist the event. This will make | ||
// sure it's marked and won't warn when setting additional properties. | ||
event.persist(); | ||
event.persist(); | ||
_assign(event, eventData); | ||
_assign(event, eventData); | ||
if (dispatchConfig.phasedRegistrationNames) { | ||
accumulateTwoPhaseDispatches(event); | ||
} else { | ||
accumulateDirectDispatches(event); | ||
} | ||
if (dispatchConfig.phasedRegistrationNames) { | ||
accumulateTwoPhaseDispatches$1(event); | ||
} else { | ||
accumulateDirectDispatches$1(event); | ||
} | ||
ReactDOM.unstable_batchedUpdates(function () { | ||
// Normally extractEvent enqueues a state restore, but we'll just always | ||
// do that since we're by-passing it here. | ||
enqueueStateRestore(domNode); | ||
runEventsInBatch(event); | ||
}); | ||
restoreStateIfNeeded(); | ||
}; | ||
} | ||
function buildSimulators() { | ||
ReactTestUtils.Simulate = {}; | ||
var eventType; | ||
for (eventType in eventNameDispatchConfigs) { | ||
/** | ||
* @param {!Element|ReactDOMComponent} domComponentOrNode | ||
* @param {?object} eventData Fake event data to use in SyntheticEvent. | ||
*/ | ||
ReactTestUtils.Simulate[eventType] = makeSimulator(eventType); | ||
ReactDOM.unstable_batchedUpdates(function () { | ||
// Normally extractEvent enqueues a state restore, but we'll just always | ||
// do that since we're by-passing it here. | ||
enqueueStateRestore$1(domNode); | ||
runEventsInBatch$1(event); | ||
}); | ||
restoreStateIfNeeded$1(); | ||
}; | ||
} | ||
} | ||
buildSimulators(); | ||
/** | ||
* Exports: | ||
* | ||
* - `ReactTestUtils.SimulateNative.click(Element/ReactDOMComponent)` | ||
* - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)` | ||
* - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)` | ||
* - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)` | ||
* - ... (All keys from `BrowserEventConstants.topLevelTypes`) | ||
* | ||
* Note: Top level event types are a subset of the entire set of handler types | ||
* (which include a broader set of "synthetic" events). For example, onDragDone | ||
* is a synthetic event. Except when testing an event plugin or React's event | ||
* handling code specifically, you probably want to use ReactTestUtils.Simulate | ||
* to dispatch synthetic events. | ||
*/ | ||
function buildSimulators() { | ||
ReactTestUtils.Simulate = {}; | ||
var eventType; | ||
function makeNativeSimulator(eventType, topLevelType) { | ||
return function (domComponentOrNode, nativeEventData) { | ||
var fakeNativeEvent = new Event(eventType); | ||
_assign(fakeNativeEvent, nativeEventData); | ||
if (ReactTestUtils.isDOMComponent(domComponentOrNode)) { | ||
simulateNativeEventOnDOMComponent(topLevelType, domComponentOrNode, fakeNativeEvent); | ||
} else if (domComponentOrNode.tagName) { | ||
// Will allow on actual dom nodes. | ||
simulateNativeEventOnNode(topLevelType, domComponentOrNode, fakeNativeEvent); | ||
for (eventType in eventNameDispatchConfigs$1) { | ||
/** | ||
* @param {!Element|ReactDOMComponent} domComponentOrNode | ||
* @param {?object} eventData Fake event data to use in SyntheticEvent. | ||
*/ | ||
ReactTestUtils.Simulate[eventType] = makeSimulator(eventType); | ||
} | ||
}; | ||
} | ||
} | ||
[[TOP_ABORT, 'abort'], [TOP_ANIMATION_END, 'animationEnd'], [TOP_ANIMATION_ITERATION, 'animationIteration'], [TOP_ANIMATION_START, 'animationStart'], [TOP_BLUR, 'blur'], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough'], [TOP_CAN_PLAY, 'canPlay'], [TOP_CANCEL, 'cancel'], [TOP_CHANGE, 'change'], [TOP_CLICK, 'click'], [TOP_CLOSE, 'close'], [TOP_COMPOSITION_END, 'compositionEnd'], [TOP_COMPOSITION_START, 'compositionStart'], [TOP_COMPOSITION_UPDATE, 'compositionUpdate'], [TOP_CONTEXT_MENU, 'contextMenu'], [TOP_COPY, 'copy'], [TOP_CUT, 'cut'], [TOP_DOUBLE_CLICK, 'doubleClick'], [TOP_DRAG_END, 'dragEnd'], [TOP_DRAG_ENTER, 'dragEnter'], [TOP_DRAG_EXIT, 'dragExit'], [TOP_DRAG_LEAVE, 'dragLeave'], [TOP_DRAG_OVER, 'dragOver'], [TOP_DRAG_START, 'dragStart'], [TOP_DRAG, 'drag'], [TOP_DROP, 'drop'], [TOP_DURATION_CHANGE, 'durationChange'], [TOP_EMPTIED, 'emptied'], [TOP_ENCRYPTED, 'encrypted'], [TOP_ENDED, 'ended'], [TOP_ERROR, 'error'], [TOP_FOCUS, 'focus'], [TOP_INPUT, 'input'], [TOP_KEY_DOWN, 'keyDown'], [TOP_KEY_PRESS, 'keyPress'], [TOP_KEY_UP, 'keyUp'], [TOP_LOAD_START, 'loadStart'], [TOP_LOAD_START, 'loadStart'], [TOP_LOAD, 'load'], [TOP_LOADED_DATA, 'loadedData'], [TOP_LOADED_METADATA, 'loadedMetadata'], [TOP_MOUSE_DOWN, 'mouseDown'], [TOP_MOUSE_MOVE, 'mouseMove'], [TOP_MOUSE_OUT, 'mouseOut'], [TOP_MOUSE_OVER, 'mouseOver'], [TOP_MOUSE_UP, 'mouseUp'], [TOP_PASTE, 'paste'], [TOP_PAUSE, 'pause'], [TOP_PLAY, 'play'], [TOP_PLAYING, 'playing'], [TOP_PROGRESS, 'progress'], [TOP_RATE_CHANGE, 'rateChange'], [TOP_SCROLL, 'scroll'], [TOP_SEEKED, 'seeked'], [TOP_SEEKING, 'seeking'], [TOP_SELECTION_CHANGE, 'selectionChange'], [TOP_STALLED, 'stalled'], [TOP_SUSPEND, 'suspend'], [TOP_TEXT_INPUT, 'textInput'], [TOP_TIME_UPDATE, 'timeUpdate'], [TOP_TOGGLE, 'toggle'], [TOP_TOUCH_CANCEL, 'touchCancel'], [TOP_TOUCH_END, 'touchEnd'], [TOP_TOUCH_MOVE, 'touchMove'], [TOP_TOUCH_START, 'touchStart'], [TOP_TRANSITION_END, 'transitionEnd'], [TOP_VOLUME_CHANGE, 'volumeChange'], [TOP_WAITING, 'waiting'], [TOP_WHEEL, 'wheel']].forEach(function (_ref) { | ||
var topLevelType = _ref[0], | ||
eventType = _ref[1]; | ||
buildSimulators(); | ||
/** | ||
* @param {!Element|ReactDOMComponent} domComponentOrNode | ||
* @param {?Event} nativeEventData Fake native event to use in SyntheticEvent. | ||
* Exports: | ||
* | ||
* - `ReactTestUtils.SimulateNative.click(Element/ReactDOMComponent)` | ||
* - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)` | ||
* - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)` | ||
* - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)` | ||
* - ... (All keys from `BrowserEventConstants.topLevelTypes`) | ||
* | ||
* Note: Top level event types are a subset of the entire set of handler types | ||
* (which include a broader set of "synthetic" events). For example, onDragDone | ||
* is a synthetic event. Except when testing an event plugin or React's event | ||
* handling code specifically, you probably want to use ReactTestUtils.Simulate | ||
* to dispatch synthetic events. | ||
*/ | ||
ReactTestUtils.SimulateNative[eventType] = makeNativeSimulator(eventType, topLevelType); | ||
}); | ||
function makeNativeSimulator(eventType, topLevelType) { | ||
return function (domComponentOrNode, nativeEventData) { | ||
var fakeNativeEvent = new Event(eventType); | ||
var ReactTestUtils$2 = Object.freeze({ | ||
default: ReactTestUtils | ||
}); | ||
_assign(fakeNativeEvent, nativeEventData); | ||
var ReactTestUtils$3 = ( ReactTestUtils$2 && ReactTestUtils ) || ReactTestUtils$2; | ||
if (ReactTestUtils.isDOMComponent(domComponentOrNode)) { | ||
simulateNativeEventOnDOMComponent(topLevelType, domComponentOrNode, fakeNativeEvent); | ||
} else if (domComponentOrNode.tagName) { | ||
// Will allow on actual dom nodes. | ||
simulateNativeEventOnNode(topLevelType, domComponentOrNode, fakeNativeEvent); | ||
} | ||
}; | ||
} | ||
// TODO: decide on the top-level export form. | ||
// This is hacky but makes it work with both Rollup and Jest. | ||
[[TOP_ABORT, 'abort'], [TOP_ANIMATION_END, 'animationEnd'], [TOP_ANIMATION_ITERATION, 'animationIteration'], [TOP_ANIMATION_START, 'animationStart'], [TOP_BLUR, 'blur'], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough'], [TOP_CAN_PLAY, 'canPlay'], [TOP_CANCEL, 'cancel'], [TOP_CHANGE, 'change'], [TOP_CLICK, 'click'], [TOP_CLOSE, 'close'], [TOP_COMPOSITION_END, 'compositionEnd'], [TOP_COMPOSITION_START, 'compositionStart'], [TOP_COMPOSITION_UPDATE, 'compositionUpdate'], [TOP_CONTEXT_MENU, 'contextMenu'], [TOP_COPY, 'copy'], [TOP_CUT, 'cut'], [TOP_DOUBLE_CLICK, 'doubleClick'], [TOP_DRAG_END, 'dragEnd'], [TOP_DRAG_ENTER, 'dragEnter'], [TOP_DRAG_EXIT, 'dragExit'], [TOP_DRAG_LEAVE, 'dragLeave'], [TOP_DRAG_OVER, 'dragOver'], [TOP_DRAG_START, 'dragStart'], [TOP_DRAG, 'drag'], [TOP_DROP, 'drop'], [TOP_DURATION_CHANGE, 'durationChange'], [TOP_EMPTIED, 'emptied'], [TOP_ENCRYPTED, 'encrypted'], [TOP_ENDED, 'ended'], [TOP_ERROR, 'error'], [TOP_FOCUS, 'focus'], [TOP_INPUT, 'input'], [TOP_KEY_DOWN, 'keyDown'], [TOP_KEY_PRESS, 'keyPress'], [TOP_KEY_UP, 'keyUp'], [TOP_LOAD_START, 'loadStart'], [TOP_LOAD_START, 'loadStart'], [TOP_LOAD, 'load'], [TOP_LOADED_DATA, 'loadedData'], [TOP_LOADED_METADATA, 'loadedMetadata'], [TOP_MOUSE_DOWN, 'mouseDown'], [TOP_MOUSE_MOVE, 'mouseMove'], [TOP_MOUSE_OUT, 'mouseOut'], [TOP_MOUSE_OVER, 'mouseOver'], [TOP_MOUSE_UP, 'mouseUp'], [TOP_PASTE, 'paste'], [TOP_PAUSE, 'pause'], [TOP_PLAY, 'play'], [TOP_PLAYING, 'playing'], [TOP_PROGRESS, 'progress'], [TOP_RATE_CHANGE, 'rateChange'], [TOP_SCROLL, 'scroll'], [TOP_SEEKED, 'seeked'], [TOP_SEEKING, 'seeking'], [TOP_SELECTION_CHANGE, 'selectionChange'], [TOP_STALLED, 'stalled'], [TOP_SUSPEND, 'suspend'], [TOP_TEXT_INPUT, 'textInput'], [TOP_TIME_UPDATE, 'timeUpdate'], [TOP_TOGGLE, 'toggle'], [TOP_TOUCH_CANCEL, 'touchCancel'], [TOP_TOUCH_END, 'touchEnd'], [TOP_TOUCH_MOVE, 'touchMove'], [TOP_TOUCH_START, 'touchStart'], [TOP_TRANSITION_END, 'transitionEnd'], [TOP_VOLUME_CHANGE, 'volumeChange'], [TOP_WAITING, 'waiting'], [TOP_WHEEL, 'wheel']].forEach(function (_ref) { | ||
var topLevelType = _ref[0], | ||
eventType = _ref[1]; | ||
/** | ||
* @param {!Element|ReactDOMComponent} domComponentOrNode | ||
* @param {?Event} nativeEventData Fake native event to use in SyntheticEvent. | ||
*/ | ||
ReactTestUtils.SimulateNative[eventType] = makeNativeSimulator(eventType, topLevelType); | ||
}); | ||
var testUtils = ReactTestUtils$3.default || ReactTestUtils$3; | ||
// TODO: decide on the top-level export form. | ||
// This is hacky but makes it work with both Rollup and Jest. | ||
return testUtils; | ||
var testUtils = ReactTestUtils.default || ReactTestUtils; | ||
return testUtils; | ||
}))); |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-test-utils.production.min.js | ||
@@ -9,23 +9,23 @@ * | ||
*/ | ||
'use strict';(function(k,m){"object"===typeof exports&&"undefined"!==typeof module?module.exports=m(require("react"),require("react-dom")):"function"===typeof define&&define.amd?define(["react","react-dom"],m):k.ReactTestUtils=m(k.React,k.ReactDOM)})(this,function(k,m){function l(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."} | ||
function F(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.effectTag&1026)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function G(a){if(F(a)!==a)throw Error(l(188));}function P(a){var b=a.alternate;if(!b){b=F(a);if(null===b)throw Error(l(188));return b!==a?null:a}for(var c=a,e=b;;){var d=c.return;if(null===d)break;var h=d.alternate;if(null===h){e=d.return;if(null!==e){c=e;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===c)return G(d),a;if(h=== | ||
e)return G(d),b;h=h.sibling}throw Error(l(188));}if(c.return!==e.return)c=d,e=h;else{for(var f=!1,g=d.child;g;){if(g===c){f=!0;c=d;e=h;break}if(g===e){f=!0;e=d;c=h;break}g=g.sibling}if(!f){for(g=h.child;g;){if(g===c){f=!0;c=h;e=d;break}if(g===e){f=!0;e=h;c=d;break}g=g.sibling}if(!f)throw Error(l(189));}}if(c.alternate!==e)throw Error(l(190));}if(3!==c.tag)throw Error(l(188));return c.stateNode.current===c?a:b}function u(){return!0}function v(){return!1}function q(a,b,c,e){this.dispatchConfig=a;this._targetInst= | ||
b;this.nativeEvent=c;a=this.constructor.Interface;for(var d in a)a.hasOwnProperty(d)&&((b=a[d])?this[d]=b(c):"target"===d?this.target=e:this[d]=c[d]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?u:v;this.isPropagationStopped=v;return this}function Q(a,b,c,e){if(this.eventPool.length){var d=this.eventPool.pop();this.call(d,a,b,c,e);return d}return new this(a,b,c,e)}function R(a){if(!(a instanceof this))throw Error(l(279));a.destructor();10>this.eventPool.length&& | ||
this.eventPool.push(a)}function H(a){a.eventPool=[];a.getPooled=Q;a.release=R}function w(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}function x(a){if(A[a])return A[a];if(!p[a])return a;var b=p[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in I)return A[a]=b[c];return a}function J(a){try{B(),S(function(){B()?J(a):a()})}catch(b){a(b)}}function K(a){}function T(a,b){if(!a)return[];a=P(a);if(!a)return[];for(var c=a,e=[];;){if(5===c.tag||6===c.tag|| | ||
1===c.tag||0===c.tag){var d=c.stateNode;b(d)&&e.push(d)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return e;for(;!c.sibling;){if(!c.return||c.return===a)return e;c=c.return}c.sibling.return=c.return;c=c.sibling}}}function n(a,b){if(a&&!a._reactInternalFiber){var c=""+a;a=Array.isArray(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c;throw Error(l(286,b,a));}}function U(a){return function(b,c){if(k.isValidElement(b))throw Error(l(228)); | ||
if(g.isCompositeComponent(b))throw Error(l(229));var e=L[a],d=new K;d.target=b;d.type=a.toLowerCase();var h=V(b),f=new q(e,h,d,b);f.persist();r(f,c);e.phasedRegistrationNames?W(f):X(f);m.unstable_batchedUpdates(function(){Y(b);Z(f)});aa()}}function ba(a,b){return function(c,e){var d=new K(a);r(d,e);g.isDOMComponent(c)?(c=ca(c),d.target=c,M(b,1,d)):c.tagName&&(d.target=c,M(b,1,d))}}var r=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,f=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
f.hasOwnProperty("ReactCurrentDispatcher")||(f.ReactCurrentDispatcher={current:null});f.hasOwnProperty("ReactCurrentBatchConfig")||(f.ReactCurrentBatchConfig={suspense:null});r(q.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=u)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&& | ||
(a.cancelBubble=!0),this.isPropagationStopped=u)},persist:function(){this.isPersistent=u},isPersistent:v,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=v;this._dispatchInstances=this._dispatchListeners=null}});q.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp|| | ||
Date.now()},defaultPrevented:null,isTrusted:null};q.extend=function(a){function b(){return c.apply(this,arguments)}var c=this,e=function(){};e.prototype=c.prototype;e=new e;r(e,b.prototype);b.prototype=e;b.prototype.constructor=b;b.Interface=r({},c.Interface,a);b.extend=c.extend;H(b);return b};H(q);var C=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),p={animationend:w("Animation","AnimationEnd"),animationiteration:w("Animation", | ||
"AnimationIteration"),animationstart:w("Animation","AnimationStart"),transitionend:w("Transition","TransitionEnd")},A={},I={};C&&(I=document.createElement("div").style,"AnimationEvent"in window||(delete p.animationend.animation,delete p.animationiteration.animation,delete p.animationstart.animation),"TransitionEvent"in window||delete p.transitionend.transition);C=x("animationend");var da=x("animationiteration"),ea=x("animationstart"),fa=x("transitionend");try{var y=("require"+Math.random()).slice(0, | ||
7);var t=(module&&module[y])("timers").setImmediate}catch(a){t=function(a){var b=new MessageChannel;b.port1.onmessage=a;b.port2.postMessage(void 0)}}var S=t;t=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_flushAllWithoutAsserting;y=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events;var ha=y[11],D=y[12],ia=m.unstable_batchedUpdates,E=f.IsSomeRendererActing,N="function"===typeof t,B=t||function(){for(var a=!1;ha();)a=!0;return a},z=0,O=!1,ca=m.findDOMNode;f=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events; | ||
var V=f[0],L=f[4],W=f[5],X=f[6],Y=f[7],aa=f[8],M=f[9],Z=f[10],g={renderIntoDocument:function(a){var b=document.createElement("div");return m.render(a,b)},isElement:function(a){return k.isValidElement(a)},isElementOfType:function(a,b){return k.isValidElement(a)&&a.type===b},isDOMComponent:function(a){return!(!a||1!==a.nodeType||!a.tagName)},isDOMComponentElement:function(a){return!!(a&&k.isValidElement(a)&&a.tagName)},isCompositeComponent:function(a){return g.isDOMComponent(a)?!1:null!=a&&"function"=== | ||
typeof a.render&&"function"===typeof a.setState},isCompositeComponentWithType:function(a,b){return g.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){n(a,"findAllInRenderedTree");return a?T(a._reactInternalFiber,b):[]},scryRenderedDOMComponentsWithClass:function(a,b){n(a,"scryRenderedDOMComponentsWithClass");return g.findAllInRenderedTree(a,function(a){if(g.isDOMComponent(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var d= | ||
c.split(/\s+/);if(!Array.isArray(b)){if(void 0===b)throw Error(l(11));b=b.split(/\s+/)}return b.every(function(a){return-1!==d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){n(a,"findRenderedDOMComponentWithClass");a=g.scryRenderedDOMComponentsWithClass(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]},scryRenderedDOMComponentsWithTag:function(a,b){n(a,"scryRenderedDOMComponentsWithTag");return g.findAllInRenderedTree(a, | ||
function(a){return g.isDOMComponent(a)&&a.tagName.toUpperCase()===b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a,b){n(a,"findRenderedDOMComponentWithTag");a=g.scryRenderedDOMComponentsWithTag(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]},scryRenderedComponentsWithType:function(a,b){n(a,"scryRenderedComponentsWithType");return g.findAllInRenderedTree(a,function(a){return g.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a, | ||
b){n(a,"findRenderedComponentWithType");a=g.scryRenderedComponentsWithType(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+b);return a[0]},mockComponent:function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return k.createElement(b,null,this.props.children)});return this},nativeTouchData:function(a,b){return{touches:[{pageX:a,pageY:b}]}},Simulate:null,SimulateNative:{},act:function(a){function b(){z--;E.current= | ||
c;D.current=e}!1===O&&(O=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected."));z++;var c=E.current;var e=D.current;E.current=!0;D.current=!0;try{var d=ia(a)}catch(h){throw b(),h;}if(null!==d&&"object"===typeof d&&"function"===typeof d.then)return{then:function(a,e){d.then(function(){1<z||!0===N&&!0===c?(b(),a()):J(function(c){b();c?e(c):a()})},function(a){b();e(a)})}};try{1!==z||!1!==N&&!1!==c||B(),b()}catch(h){throw b(),h;}return{then:function(a){a()}}}}; | ||
(function(){g.Simulate={};for(var a in L)g.Simulate[a]=U(a)})();[["abort","abort"],[C,"animationEnd"],[da,"animationIteration"],[ea,"animationStart"],["blur","blur"],["canplaythrough","canPlayThrough"],["canplay","canPlay"],["cancel","cancel"],["change","change"],["click","click"],["close","close"],["compositionend","compositionEnd"],["compositionstart","compositionStart"],["compositionupdate","compositionUpdate"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["dblclick","doubleClick"], | ||
["dragend","dragEnd"],["dragenter","dragEnter"],["dragexit","dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["dragstart","dragStart"],["drag","drag"],["drop","drop"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["focus","focus"],["input","input"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["loadstart","loadStart"],["loadstart","loadStart"],["load","load"],["loadeddata","loadedData"],["loadedmetadata", | ||
"loadedMetadata"],["mousedown","mouseDown"],["mousemove","mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["playing","playing"],["progress","progress"],["ratechange","rateChange"],["scroll","scroll"],["seeked","seeked"],["seeking","seeking"],["selectionchange","selectionChange"],["stalled","stalled"],["suspend","suspend"],["textInput","textInput"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchcancel", | ||
"touchCancel"],["touchend","touchEnd"],["touchmove","touchMove"],["touchstart","touchStart"],[fa,"transitionEnd"],["volumechange","volumeChange"],["waiting","waiting"],["wheel","wheel"]].forEach(function(a){var b=a[1];g.SimulateNative[b]=ba(b,a[0])});f=(f={default:g},g)||f;return f.default||f}); | ||
'use strict';(function(k,n){"object"===typeof exports&&"undefined"!==typeof module?module.exports=n(require("react"),require("react-dom")):"function"===typeof define&&define.amd?define(["react","react-dom"],n):(k=k||self,k.ReactTestUtils=n(k.React,k.ReactDOM))})(this,function(k,n){function l(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."} | ||
function F(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.effectTag&1026)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function G(a){if(F(a)!==a)throw Error(l(188));}function R(a){var b=a.alternate;if(!b){b=F(a);if(null===b)throw Error(l(188));return b!==a?null:a}for(var c=a,e=b;;){var d=c.return;if(null===d)break;var g=d.alternate;if(null===g){e=d.return;if(null!==e){c=e;continue}break}if(d.child===g.child){for(g=d.child;g;){if(g===c)return G(d),a;if(g=== | ||
e)return G(d),b;g=g.sibling}throw Error(l(188));}if(c.return!==e.return)c=d,e=g;else{for(var f=!1,m=d.child;m;){if(m===c){f=!0;c=d;e=g;break}if(m===e){f=!0;e=d;c=g;break}m=m.sibling}if(!f){for(m=g.child;m;){if(m===c){f=!0;c=g;e=d;break}if(m===e){f=!0;e=g;c=d;break}m=m.sibling}if(!f)throw Error(l(189));}}if(c.alternate!==e)throw Error(l(190));}if(3!==c.tag)throw Error(l(188));return c.stateNode.current===c?a:b}function u(){return!0}function v(){return!1}function r(a,b,c,e){this.dispatchConfig=a;this._targetInst= | ||
b;this.nativeEvent=c;a=this.constructor.Interface;for(var d in a)a.hasOwnProperty(d)&&((b=a[d])?this[d]=b(c):"target"===d?this.target=e:this[d]=c[d]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?u:v;this.isPropagationStopped=v;return this}function S(a,b,c,e){if(this.eventPool.length){var d=this.eventPool.pop();this.call(d,a,b,c,e);return d}return new this(a,b,c,e)}function T(a){if(!(a instanceof this))throw Error(l(279));a.destructor();10>this.eventPool.length&& | ||
this.eventPool.push(a)}function H(a){a.eventPool=[];a.getPooled=S;a.release=T}function w(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}function x(a){if(A[a])return A[a];if(!q[a])return a;var b=q[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in I)return A[a]=b[c];return a}function U(a){if(null===y)try{var b=("require"+Math.random()).slice(0,7);y=(module&&module[b])("timers").setImmediate}catch(c){y=function(a){var b=new MessageChannel;b.port1.onmessage= | ||
a;b.port2.postMessage(void 0)}}return y(a)}function J(a){try{B(),U(function(){B()?J(a):a()})}catch(b){a(b)}}function K(a){}function V(a,b){if(!a)return[];a=R(a);if(!a)return[];for(var c=a,e=[];;){if(5===c.tag||6===c.tag||1===c.tag||0===c.tag){var d=c.stateNode;b(d)&&e.push(d)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return e;for(;!c.sibling;){if(!c.return||c.return===a)return e;c=c.return}c.sibling.return=c.return;c=c.sibling}}}function p(a,b){if(a&&!a._reactInternalFiber){var c=""+a;a= | ||
Array.isArray(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c;throw Error(l(286,b,a));}}function W(a){return function(b,c){if(k.isValidElement(b))throw Error(l(228));if(f.isCompositeComponent(b))throw Error(l(229));var e=L[a],d=new K;d.target=b;d.type=a.toLowerCase();var g=X(b),h=new r(e,g,d,b);h.persist();t(h,c);e.phasedRegistrationNames?Y(h):Z(h);n.unstable_batchedUpdates(function(){aa(b);ba(h)});ca()}}function da(a, | ||
b){return function(c,e){var d=new K(a);t(d,e);f.isDOMComponent(c)?(c=ea(c),d.target=c,M(b,1,document,d)):c.tagName&&(d.target=c,M(b,1,document,d))}}var t=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,h=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;h.hasOwnProperty("ReactCurrentDispatcher")||(h.ReactCurrentDispatcher={current:null});h.hasOwnProperty("ReactCurrentBatchConfig")||(h.ReactCurrentBatchConfig={suspense:null});t(r.prototype,{preventDefault:function(){this.defaultPrevented= | ||
!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=u)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=u)},persist:function(){this.isPersistent=u},isPersistent:v,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig= | ||
null;this.isPropagationStopped=this.isDefaultPrevented=v;this._dispatchInstances=this._dispatchListeners=null}});r.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};r.extend=function(a){function b(){return c.apply(this,arguments)}var c=this,e=function(){};e.prototype=c.prototype;e=new e;t(e,b.prototype);b.prototype=e;b.prototype.constructor= | ||
b;b.Interface=t({},c.Interface,a);b.extend=c.extend;H(b);return b};H(r);var C=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),q={animationend:w("Animation","AnimationEnd"),animationiteration:w("Animation","AnimationIteration"),animationstart:w("Animation","AnimationStart"),transitionend:w("Transition","TransitionEnd")},A={},I={};C&&(I=document.createElement("div").style,"AnimationEvent"in window||(delete q.animationend.animation, | ||
delete q.animationiteration.animation,delete q.animationstart.animation),"TransitionEvent"in window||delete q.transitionend.transition);C=x("animationend");var fa=x("animationiteration"),ha=x("animationstart"),ia=x("transitionend"),y=null,N=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_flushAllWithoutAsserting,O=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,ja=O[11],D=O[12],ka=n.unstable_batchedUpdates,E=h.IsSomeRendererActing,P="function"===typeof N,B=N||function(){for(var a= | ||
!1;ja();)a=!0;return a},z=0,Q=!1,ea=n.findDOMNode;h=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events;var X=h[0],L=h[4],Y=h[5],Z=h[6],aa=h[7],ca=h[8],M=h[9],ba=h[10],f={renderIntoDocument:function(a){var b=document.createElement("div");return n.render(a,b)},isElement:function(a){return k.isValidElement(a)},isElementOfType:function(a,b){return k.isValidElement(a)&&a.type===b},isDOMComponent:function(a){return!(!a||1!==a.nodeType||!a.tagName)},isDOMComponentElement:function(a){return!!(a&& | ||
k.isValidElement(a)&&a.tagName)},isCompositeComponent:function(a){return f.isDOMComponent(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState},isCompositeComponentWithType:function(a,b){return f.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){p(a,"findAllInRenderedTree");return a?V(a._reactInternalFiber,b):[]},scryRenderedDOMComponentsWithClass:function(a,b){p(a,"scryRenderedDOMComponentsWithClass");return f.findAllInRenderedTree(a, | ||
function(a){if(f.isDOMComponent(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var d=c.split(/\s+/);if(!Array.isArray(b)){if(void 0===b)throw Error(l(11));b=b.split(/\s+/)}return b.every(function(a){return-1!==d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){p(a,"findRenderedDOMComponentWithClass");a=f.scryRenderedDOMComponentsWithClass(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]}, | ||
scryRenderedDOMComponentsWithTag:function(a,b){p(a,"scryRenderedDOMComponentsWithTag");return f.findAllInRenderedTree(a,function(a){return f.isDOMComponent(a)&&a.tagName.toUpperCase()===b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a,b){p(a,"findRenderedDOMComponentWithTag");a=f.scryRenderedDOMComponentsWithTag(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]},scryRenderedComponentsWithType:function(a,b){p(a,"scryRenderedComponentsWithType"); | ||
return f.findAllInRenderedTree(a,function(a){return f.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a,b){p(a,"findRenderedComponentWithType");a=f.scryRenderedComponentsWithType(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+b);return a[0]},mockComponent:function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return k.createElement(b,null,this.props.children)});return this},nativeTouchData:function(a, | ||
b){return{touches:[{pageX:a,pageY:b}]}},Simulate:null,SimulateNative:{},act:function(a){function b(){z--;E.current=c;D.current=e}!1===Q&&(Q=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected."));z++;var c=E.current;var e=D.current;E.current=!0;D.current=!0;try{var d=ka(a)}catch(g){throw b(),g;}if(null!==d&&"object"===typeof d&&"function"===typeof d.then)return{then:function(a,e){d.then(function(){1<z||!0===P&&!0===c?(b(),a()):J(function(c){b(); | ||
c?e(c):a()})},function(a){b();e(a)})}};try{1!==z||!1!==P&&!1!==c||B(),b()}catch(g){throw b(),g;}return{then:function(a){a()}}}};(function(){f.Simulate={};for(var a in L)f.Simulate[a]=W(a)})();[["abort","abort"],[C,"animationEnd"],[fa,"animationIteration"],[ha,"animationStart"],["blur","blur"],["canplaythrough","canPlayThrough"],["canplay","canPlay"],["cancel","cancel"],["change","change"],["click","click"],["close","close"],["compositionend","compositionEnd"],["compositionstart","compositionStart"], | ||
["compositionupdate","compositionUpdate"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragenter","dragEnter"],["dragexit","dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["dragstart","dragStart"],["drag","drag"],["drop","drop"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["focus","focus"],["input","input"],["keydown","keyDown"],["keypress","keyPress"], | ||
["keyup","keyUp"],["loadstart","loadStart"],["loadstart","loadStart"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["mousedown","mouseDown"],["mousemove","mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["playing","playing"],["progress","progress"],["ratechange","rateChange"],["scroll","scroll"],["seeked","seeked"],["seeking","seeking"],["selectionchange","selectionChange"],["stalled", | ||
"stalled"],["suspend","suspend"],["textInput","textInput"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchmove","touchMove"],["touchstart","touchStart"],[ia,"transitionEnd"],["volumechange","volumeChange"],["waiting","waiting"],["wheel","wheel"]].forEach(function(a){var b=a[1];f.SimulateNative[b]=da(b,a[0])});return f.default||f}); |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-unstable-fizz.browser.development.js | ||
@@ -13,148 +13,130 @@ * | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global.ReactDOMFizzServer = factory()); | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, global.ReactDOMFizzServer = factory()); | ||
}(this, (function () { 'use strict'; | ||
function scheduleWork(callback) { | ||
callback(); | ||
} | ||
function flushBuffered(destination) {// WHATWG Streams do not yet have a way to flush the underlying | ||
// transform streams. https://github.com/whatwg/streams/issues/960 | ||
} | ||
function scheduleWork(callback) { | ||
callback(); | ||
} | ||
function flushBuffered(destination) {// WHATWG Streams do not yet have a way to flush the underlying | ||
// transform streams. https://github.com/whatwg/streams/issues/960 | ||
} | ||
function writeChunk(destination, buffer) { | ||
destination.enqueue(buffer); | ||
return destination.desiredSize > 0; | ||
} | ||
function close(destination) { | ||
destination.close(); | ||
} | ||
var textEncoder = new TextEncoder(); | ||
function convertStringToBuffer(content) { | ||
return textEncoder.encode(content); | ||
} | ||
function writeChunk(destination, buffer) { | ||
destination.enqueue(buffer); | ||
return destination.desiredSize > 0; | ||
} | ||
function formatChunkAsString(type, props) { | ||
var str = '<' + type + '>'; | ||
function close(destination) { | ||
destination.close(); | ||
} | ||
var textEncoder = new TextEncoder(); | ||
function convertStringToBuffer(content) { | ||
return textEncoder.encode(content); | ||
} | ||
if (typeof props.children === 'string') { | ||
str += props.children; | ||
} | ||
function formatChunkAsString(type, props) { | ||
var str = '<' + type + '>'; | ||
str += '</' + type + '>'; | ||
return str; | ||
} | ||
function formatChunk(type, props) { | ||
return convertStringToBuffer(formatChunkAsString(type, props)); | ||
} | ||
if (typeof props.children === 'string') { | ||
str += props.children; | ||
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | ||
// nor polyfill, then a plain number is used for performance. | ||
var hasSymbol = typeof Symbol === 'function' && Symbol.for; | ||
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; | ||
function createRequest(children, destination) { | ||
return { | ||
destination: destination, | ||
children: children, | ||
completedChunks: [], | ||
flowing: false | ||
}; | ||
} | ||
str += '</' + type + '>'; | ||
return str; | ||
} | ||
function formatChunk(type, props) { | ||
return convertStringToBuffer(formatChunkAsString(type, props)); | ||
} | ||
function performWork(request) { | ||
var element = request.children; | ||
request.children = null; | ||
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | ||
// nor polyfill, then a plain number is used for performance. | ||
var hasSymbol = typeof Symbol === 'function' && Symbol.for; | ||
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; | ||
if (element && element.$$typeof !== REACT_ELEMENT_TYPE) { | ||
return; | ||
} | ||
var type = element.type; | ||
var props = element.props; | ||
if (typeof type !== 'string') { | ||
return; | ||
} | ||
request.completedChunks.push(formatChunk(type, props)); | ||
if (request.flowing) { | ||
flushCompletedChunks(request); | ||
} | ||
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary | ||
// (unstable) APIs that have been removed. Can we remove the symbols? | ||
flushBuffered(request.destination); | ||
} | ||
function createRequest(children, destination) { | ||
return { | ||
destination: destination, | ||
children: children, | ||
completedChunks: [], | ||
flowing: false | ||
}; | ||
} | ||
function flushCompletedChunks(request) { | ||
var destination = request.destination; | ||
var chunks = request.completedChunks; | ||
request.completedChunks = []; | ||
function performWork(request) { | ||
var element = request.children; | ||
request.children = null; | ||
try { | ||
for (var i = 0; i < chunks.length; i++) { | ||
var chunk = chunks[i]; | ||
writeChunk(destination, chunk); | ||
} | ||
} finally { | ||
} | ||
if (element && element.$$typeof !== REACT_ELEMENT_TYPE) { | ||
return; | ||
close(destination); | ||
} | ||
var type = element.type; | ||
var props = element.props; | ||
if (typeof type !== 'string') { | ||
return; | ||
function startWork(request) { | ||
request.flowing = true; | ||
scheduleWork(function () { | ||
return performWork(request); | ||
}); | ||
} | ||
request.completedChunks.push(formatChunk(type, props)); | ||
if (request.flowing) { | ||
function startFlowing(request) { | ||
request.flowing = false; | ||
flushCompletedChunks(request); | ||
} | ||
flushBuffered(request.destination); | ||
} | ||
function flushCompletedChunks(request) { | ||
var destination = request.destination; | ||
var chunks = request.completedChunks; | ||
request.completedChunks = []; | ||
try { | ||
for (var i = 0; i < chunks.length; i++) { | ||
var chunk = chunks[i]; | ||
writeChunk(destination, chunk); | ||
} | ||
} finally { | ||
function renderToReadableStream(children) { | ||
var request; | ||
return new ReadableStream({ | ||
start: function (controller) { | ||
request = createRequest(children, controller); | ||
startWork(request); | ||
}, | ||
pull: function (controller) { | ||
startFlowing(request); | ||
}, | ||
cancel: function (reason) {} | ||
}); | ||
} | ||
close(destination); | ||
} | ||
var ReactDOMFizzServerBrowser = { | ||
renderToReadableStream: renderToReadableStream | ||
}; | ||
function startWork(request) { | ||
request.flowing = true; | ||
scheduleWork(function () { | ||
return performWork(request); | ||
}); | ||
} | ||
function startFlowing(request) { | ||
request.flowing = false; | ||
flushCompletedChunks(request); | ||
} | ||
// TODO: decide on the top-level export form. | ||
// This is hacky but makes it work with both Rollup and Jest | ||
// This file intentionally does *not* have the Flow annotation. | ||
// Don't add it. See `./inline-typed.js` for an explanation. | ||
function renderToReadableStream(children) { | ||
var request; | ||
return new ReadableStream({ | ||
start: function (controller) { | ||
request = createRequest(children, controller); | ||
startWork(request); | ||
}, | ||
pull: function (controller) { | ||
startFlowing(request); | ||
}, | ||
cancel: function (reason) {} | ||
}); | ||
} | ||
var unstableFizz_browser = ReactDOMFizzServerBrowser.default || ReactDOMFizzServerBrowser; | ||
var ReactDOMFizzServerBrowser = { | ||
renderToReadableStream: renderToReadableStream | ||
}; | ||
return unstableFizz_browser; | ||
var ReactDOMFizzServerBrowser$1 = Object.freeze({ | ||
default: ReactDOMFizzServerBrowser | ||
}); | ||
var ReactDOMFizzServerBrowser$2 = ( ReactDOMFizzServerBrowser$1 && ReactDOMFizzServerBrowser ) || ReactDOMFizzServerBrowser$1; | ||
// TODO: decide on the top-level export form. | ||
// This is hacky but makes it work with both Rollup and Jest | ||
var unstableFizz_browser = ReactDOMFizzServerBrowser$2.default || ReactDOMFizzServerBrowser$2; | ||
return unstableFizz_browser; | ||
}))); |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-unstable-fizz.browser.production.min.js | ||
@@ -9,3 +9,3 @@ * | ||
*/ | ||
'use strict';(function(g,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"===typeof define&&define.amd?define(e):g.ReactDOMFizzServer=e()})(this,function(){function g(b,c){var a="<"+b+">";"string"===typeof c.children&&(a+=c.children);return a+("</"+b+">")}function e(b){var c=b.destination,a=b.completedChunks;b.completedChunks=[];for(b=0;b<a.length;b++)c.enqueue(a[b]);c.close()}var k=new TextEncoder,l="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"): | ||
60103,d={renderToReadableStream:function(b){var c;return new ReadableStream({start:function(a){a=c={destination:a,children:b,completedChunks:[],flowing:!1};a.flowing=!0;var f=a.children;a.children=null;if(!f||f.$$typeof===l){var d=f.type;f=f.props;"string"===typeof d&&(a.completedChunks.push(k.encode(g(d,f))),a.flowing&&e(a))}},pull:function(a){a=c;a.flowing=!1;e(a)},cancel:function(a){}})}},h={default:d};d=h&&d||h;return d.default||d}); | ||
'use strict';(function(f,d){"object"===typeof exports&&"undefined"!==typeof module?module.exports=d():"function"===typeof define&&define.amd?define(d):(f=f||self,f.ReactDOMFizzServer=d())})(this,function(){function f(b,c){var a="<"+b+">";"string"===typeof c.children&&(a+=c.children);return a+("</"+b+">")}function d(b){var c=b.destination,a=b.completedChunks;b.completedChunks=[];for(b=0;b<a.length;b++)c.enqueue(a[b]);c.close()}var h=new TextEncoder,k="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"): | ||
60103,g={renderToReadableStream:function(b){var c;return new ReadableStream({start:function(a){a=c={destination:a,children:b,completedChunks:[],flowing:!1};a.flowing=!0;var e=a.children;a.children=null;if(!e||e.$$typeof===k){var g=e.type;e=e.props;"string"===typeof g&&(a.completedChunks.push(h.encode(f(g,e))),a.flowing&&d(a))}},pull:function(a){a=c;a.flowing=!1;d(a)},cancel:function(a){}})}};return g.default||g}); |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-unstable-native-dependencies.development.js | ||
@@ -13,1733 +13,1617 @@ * | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react-dom'), require('react')) : | ||
typeof define === 'function' && define.amd ? define(['react-dom', 'react'], factory) : | ||
(global.ReactDOMUnstableNativeDependencies = factory(global.ReactDOM,global.React)); | ||
}(this, (function (ReactDOM,React) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react-dom'), require('react')) : | ||
typeof define === 'function' && define.amd ? define(['react-dom', 'react'], factory) : | ||
(global = global || self, global.ReactDOMUnstableNativeDependencies = factory(global.ReactDOM, global.React)); | ||
}(this, (function (ReactDOM, React) { 'use strict'; | ||
// Do not require this module directly! Use normal `invariant` calls with | ||
// template literal strings. The messages will be replaced with error codes | ||
// during build. | ||
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions. | ||
// Current owner and dispatcher used to share the same ref, | ||
// but PR #14548 split them out to better support the react-debug-tools package. | ||
/** | ||
* Use invariant() to assert state which your program assumes to be true. | ||
* | ||
* Provide sprintf-style format (only %s is supported) and arguments | ||
* to provide information about what broke and what you were | ||
* expecting. | ||
* | ||
* The invariant message will be stripped in production, but the invariant | ||
* will remain to ensure logic does not differ in production. | ||
*/ | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { | ||
ReactSharedInternals.ReactCurrentDispatcher = { | ||
current: null | ||
}; | ||
} | ||
{ | ||
// In DEV mode, we swap out invokeGuardedCallback for a special version | ||
// that plays more nicely with the browser's DevTools. The idea is to preserve | ||
// "Pause on exceptions" behavior. Because React wraps all user-provided | ||
// functions in invokeGuardedCallback, and the production version of | ||
// invokeGuardedCallback uses a try-catch, all user exceptions are treated | ||
// like caught exceptions, and the DevTools won't pause unless the developer | ||
// takes the extra step of enabling pause on caught exceptions. This is | ||
// unintuitive, though, because even though React has caught the error, from | ||
// the developer's perspective, the error is uncaught. | ||
// | ||
// To preserve the expected "Pause on exceptions" behavior, we don't use a | ||
// try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake | ||
// DOM node, and call the user-provided callback from inside an event handler | ||
// for that fake event. If the callback throws, the error is "captured" using | ||
// a global event handler. But because the error happens in a different | ||
// event loop context, it does not interrupt the normal program flow. | ||
// Effectively, this gives us try-catch behavior without actually using | ||
// try-catch. Neat! | ||
// Check that the browser supports the APIs we need to implement our special | ||
// DEV version of invokeGuardedCallback | ||
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { | ||
var fakeNode = document.createElement('react'); | ||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { | ||
ReactSharedInternals.ReactCurrentBatchConfig = { | ||
suspense: null | ||
}; | ||
} | ||
} | ||
/** | ||
* Call a function while guarding against errors that happens within it. | ||
* Returns an error if it throws, otherwise null. | ||
* | ||
* In production, this is implemented using a try-catch. The reason we don't | ||
* use a try-catch directly is so that we can swap out a different | ||
* implementation in DEV mode. | ||
* | ||
* @param {String} name of the guard to use for logging or debugging | ||
* @param {Function} func The function to invoke | ||
* @param {*} context The context to use when calling the function | ||
* @param {...*} args Arguments for function | ||
*/ | ||
// by calls to these methods by a Babel plugin. | ||
// | ||
// In PROD (or in packages without access to React internals), | ||
// they are left as they are instead. | ||
function warn(format) { | ||
{ | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
/** | ||
* Same as invokeGuardedCallback, but instead of returning an error, it stores | ||
* it in a global so it can be rethrown by `rethrowCaughtError` later. | ||
* TODO: See if caughtError and rethrowError can be unified. | ||
* | ||
* @param {String} name of the guard to use for logging or debugging | ||
* @param {Function} func The function to invoke | ||
* @param {*} context The context to use when calling the function | ||
* @param {...*} args Arguments for function | ||
*/ | ||
/** | ||
* During execution of guarded functions we will capture the first error which | ||
* we will rethrow to be handled by the top level error handler. | ||
*/ | ||
/** | ||
* Similar to invariant but only logs a warning if the condition is not met. | ||
* This can be used to log issues in development environments in critical | ||
* paths. Removing the logging code for production environments will keep the | ||
* same logic and follow the same code paths. | ||
*/ | ||
var warningWithoutStack = function () {}; | ||
{ | ||
warningWithoutStack = function (condition, format) { | ||
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
printWarning('warn', format, args); | ||
} | ||
} | ||
function error(format) { | ||
{ | ||
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
args[_key2 - 1] = arguments[_key2]; | ||
} | ||
if (format === undefined) { | ||
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); | ||
printWarning('error', format, args); | ||
} | ||
} | ||
if (args.length > 8) { | ||
// Check before the condition to catch violations early. | ||
throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); | ||
} | ||
function printWarning(level, format, args) { | ||
// When changing this logic, you might want to also | ||
// update consoleWithStackDev.www.js as well. | ||
{ | ||
var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; | ||
if (condition) { | ||
return; | ||
} | ||
if (!hasExistingStack) { | ||
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; | ||
var stack = ReactDebugCurrentFrame.getStackAddendum(); | ||
if (typeof console !== 'undefined') { | ||
if (stack !== '') { | ||
format += '%s'; | ||
args = args.concat([stack]); | ||
} | ||
} | ||
var argsWithFormat = args.map(function (item) { | ||
return '' + item; | ||
}); | ||
}); // Careful: RN currently depends on this prefix | ||
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it | ||
// breaks IE9: https://github.com/facebook/react/issues/13610 | ||
// eslint-disable-next-line react-internal/no-production-logging | ||
Function.prototype.apply.call(console.error, console, argsWithFormat); | ||
Function.prototype.apply.call(console[level], console, argsWithFormat); | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
throw new Error(message); | ||
} catch (x) {} | ||
} | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
} | ||
{ | ||
// In DEV mode, we swap out invokeGuardedCallback for a special version | ||
// that plays more nicely with the browser's DevTools. The idea is to preserve | ||
// "Pause on exceptions" behavior. Because React wraps all user-provided | ||
// functions in invokeGuardedCallback, and the production version of | ||
// invokeGuardedCallback uses a try-catch, all user exceptions are treated | ||
// like caught exceptions, and the DevTools won't pause unless the developer | ||
// takes the extra step of enabling pause on caught exceptions. This is | ||
// unintuitive, though, because even though React has caught the error, from | ||
// the developer's perspective, the error is uncaught. | ||
// | ||
// To preserve the expected "Pause on exceptions" behavior, we don't use a | ||
// try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake | ||
// DOM node, and call the user-provided callback from inside an event handler | ||
// for that fake event. If the callback throws, the error is "captured" using | ||
// a global event handler. But because the error happens in a different | ||
// event loop context, it does not interrupt the normal program flow. | ||
// Effectively, this gives us try-catch behavior without actually using | ||
// try-catch. Neat! | ||
// Check that the browser supports the APIs we need to implement our special | ||
// DEV version of invokeGuardedCallback | ||
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { | ||
var fakeNode = document.createElement('react'); | ||
} | ||
} | ||
var warningWithoutStack$1 = warningWithoutStack; | ||
var getFiberCurrentPropsFromNode = null; | ||
var getInstanceFromNode = null; | ||
var getNodeFromInstance = null; | ||
function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { | ||
getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; | ||
getInstanceFromNode = getInstanceFromNodeImpl; | ||
getNodeFromInstance = getNodeFromInstanceImpl; | ||
var getFiberCurrentPropsFromNode$1 = null; | ||
var getInstanceFromNode$1 = null; | ||
var getNodeFromInstance$1 = null; | ||
function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { | ||
getFiberCurrentPropsFromNode$1 = getFiberCurrentPropsFromNodeImpl; | ||
getInstanceFromNode$1 = getInstanceFromNodeImpl; | ||
getNodeFromInstance$1 = getNodeFromInstanceImpl; | ||
{ | ||
if (!getNodeFromInstance || !getInstanceFromNode) { | ||
error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.'); | ||
} | ||
} | ||
} | ||
var validateEventDispatches; | ||
{ | ||
!(getNodeFromInstance$1 && getInstanceFromNode$1) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; | ||
validateEventDispatches = function (event) { | ||
var dispatchListeners = event._dispatchListeners; | ||
var dispatchInstances = event._dispatchInstances; | ||
var listenersIsArr = Array.isArray(dispatchListeners); | ||
var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; | ||
var instancesIsArr = Array.isArray(dispatchInstances); | ||
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; | ||
if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) { | ||
error('EventPluginUtils: Invalid `event`.'); | ||
} | ||
}; | ||
} | ||
} | ||
var validateEventDispatches; | ||
/** | ||
* Standard/simple iteration through an event's collected dispatches, but stops | ||
* at the first dispatch execution returning true, and returns that id. | ||
* | ||
* @return {?string} id of the first dispatch execution who's listener returns | ||
* true, or null if no listener returned true. | ||
*/ | ||
{ | ||
validateEventDispatches = function (event) { | ||
function executeDispatchesInOrderStopAtTrueImpl(event) { | ||
var dispatchListeners = event._dispatchListeners; | ||
var dispatchInstances = event._dispatchInstances; | ||
var listenersIsArr = Array.isArray(dispatchListeners); | ||
var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0; | ||
var instancesIsArr = Array.isArray(dispatchInstances); | ||
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; | ||
!(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0; | ||
}; | ||
} | ||
/** | ||
* Dispatch the event to the listener. | ||
* @param {SyntheticEvent} event SyntheticEvent to handle | ||
* @param {function} listener Application-level callback | ||
* @param {*} inst Internal component instance | ||
*/ | ||
{ | ||
validateEventDispatches(event); | ||
} | ||
if (Array.isArray(dispatchListeners)) { | ||
for (var i = 0; i < dispatchListeners.length; i++) { | ||
if (event.isPropagationStopped()) { | ||
break; | ||
} // Listeners and Instances are two parallel arrays that are always in sync. | ||
/** | ||
* Standard/simple iteration through an event's collected dispatches. | ||
*/ | ||
if (dispatchListeners[i](event, dispatchInstances[i])) { | ||
return dispatchInstances[i]; | ||
} | ||
} | ||
} else if (dispatchListeners) { | ||
if (dispatchListeners(event, dispatchInstances)) { | ||
return dispatchInstances; | ||
} | ||
} | ||
/** | ||
* Standard/simple iteration through an event's collected dispatches, but stops | ||
* at the first dispatch execution returning true, and returns that id. | ||
* | ||
* @return {?string} id of the first dispatch execution who's listener returns | ||
* true, or null if no listener returned true. | ||
*/ | ||
return null; | ||
} | ||
/** | ||
* @see executeDispatchesInOrderStopAtTrueImpl | ||
*/ | ||
function executeDispatchesInOrderStopAtTrueImpl(event) { | ||
var dispatchListeners = event._dispatchListeners; | ||
var dispatchInstances = event._dispatchInstances; | ||
{ | ||
validateEventDispatches(event); | ||
function executeDispatchesInOrderStopAtTrue(event) { | ||
var ret = executeDispatchesInOrderStopAtTrueImpl(event); | ||
event._dispatchInstances = null; | ||
event._dispatchListeners = null; | ||
return ret; | ||
} | ||
/** | ||
* Execution of a "direct" dispatch - there must be at most one dispatch | ||
* accumulated on the event or it is considered an error. It doesn't really make | ||
* sense for an event with multiple dispatches (bubbled) to keep track of the | ||
* return values at each dispatch execution, but it does tend to make sense when | ||
* dealing with "direct" dispatches. | ||
* | ||
* @return {*} The return value of executing the single dispatch. | ||
*/ | ||
if (Array.isArray(dispatchListeners)) { | ||
for (var i = 0; i < dispatchListeners.length; i++) { | ||
if (event.isPropagationStopped()) { | ||
break; | ||
} // Listeners and Instances are two parallel arrays that are always in sync. | ||
function executeDirectDispatch(event) { | ||
{ | ||
validateEventDispatches(event); | ||
} | ||
var dispatchListener = event._dispatchListeners; | ||
var dispatchInstance = event._dispatchInstances; | ||
if (dispatchListeners[i](event, dispatchInstances[i])) { | ||
return dispatchInstances[i]; | ||
if (!!Array.isArray(dispatchListener)) { | ||
{ | ||
throw Error( "executeDirectDispatch(...): Invalid `event`." ); | ||
} | ||
} | ||
} else if (dispatchListeners) { | ||
if (dispatchListeners(event, dispatchInstances)) { | ||
return dispatchInstances; | ||
} | ||
} | ||
return null; | ||
} | ||
/** | ||
* @see executeDispatchesInOrderStopAtTrueImpl | ||
*/ | ||
function executeDispatchesInOrderStopAtTrue(event) { | ||
var ret = executeDispatchesInOrderStopAtTrueImpl(event); | ||
event._dispatchInstances = null; | ||
event._dispatchListeners = null; | ||
return ret; | ||
} | ||
/** | ||
* Execution of a "direct" dispatch - there must be at most one dispatch | ||
* accumulated on the event or it is considered an error. It doesn't really make | ||
* sense for an event with multiple dispatches (bubbled) to keep track of the | ||
* return values at each dispatch execution, but it does tend to make sense when | ||
* dealing with "direct" dispatches. | ||
* | ||
* @return {*} The return value of executing the single dispatch. | ||
*/ | ||
function executeDirectDispatch(event) { | ||
{ | ||
validateEventDispatches(event); | ||
event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) : null; | ||
var res = dispatchListener ? dispatchListener(event) : null; | ||
event.currentTarget = null; | ||
event._dispatchListeners = null; | ||
event._dispatchInstances = null; | ||
return res; | ||
} | ||
/** | ||
* @param {SyntheticEvent} event | ||
* @return {boolean} True iff number of dispatches accumulated is greater than 0. | ||
*/ | ||
var dispatchListener = event._dispatchListeners; | ||
var dispatchInstance = event._dispatchInstances; | ||
if (!!Array.isArray(dispatchListener)) { | ||
{ | ||
throw Error("executeDirectDispatch(...): Invalid `event`."); | ||
} | ||
function hasDispatches(event) { | ||
return !!event._dispatchListeners; | ||
} | ||
event.currentTarget = dispatchListener ? getNodeFromInstance$1(dispatchInstance) : null; | ||
var res = dispatchListener ? dispatchListener(event) : null; | ||
event.currentTarget = null; | ||
event._dispatchListeners = null; | ||
event._dispatchInstances = null; | ||
return res; | ||
} | ||
/** | ||
* @param {SyntheticEvent} event | ||
* @return {boolean} True iff number of dispatches accumulated is greater than 0. | ||
*/ | ||
var HostComponent = 5; | ||
function hasDispatches(event) { | ||
return !!event._dispatchListeners; | ||
} | ||
function getParent(inst) { | ||
do { | ||
inst = inst.return; // TODO: If this is a HostRoot we might want to bail out. | ||
// That is depending on if we want nested subtrees (layers) to bubble | ||
// events to their parent. We could also go through parentNode on the | ||
// host node but that wouldn't work for React Native and doesn't let us | ||
// do the portal feature. | ||
} while (inst && inst.tag !== HostComponent); | ||
// Before we know whether it is function or class | ||
if (inst) { | ||
return inst; | ||
} | ||
// Root of a host tree. Could be nested inside another node. | ||
// A subtree. Could be an entry point to a different renderer. | ||
var HostComponent = 5; | ||
function getParent(inst) { | ||
do { | ||
inst = inst.return; // TODO: If this is a HostRoot we might want to bail out. | ||
// That is depending on if we want nested subtrees (layers) to bubble | ||
// events to their parent. We could also go through parentNode on the | ||
// host node but that wouldn't work for React Native and doesn't let us | ||
// do the portal feature. | ||
} while (inst && inst.tag !== HostComponent); | ||
if (inst) { | ||
return inst; | ||
return null; | ||
} | ||
/** | ||
* Return the lowest common ancestor of A and B, or null if they are in | ||
* different trees. | ||
*/ | ||
return null; | ||
} | ||
/** | ||
* Return the lowest common ancestor of A and B, or null if they are in | ||
* different trees. | ||
*/ | ||
function getLowestCommonAncestor(instA, instB) { | ||
var depthA = 0; | ||
function getLowestCommonAncestor(instA, instB) { | ||
var depthA = 0; | ||
for (var tempA = instA; tempA; tempA = getParent(tempA)) { | ||
depthA++; | ||
} | ||
for (var tempA = instA; tempA; tempA = getParent(tempA)) { | ||
depthA++; | ||
} | ||
var depthB = 0; | ||
var depthB = 0; | ||
for (var tempB = instB; tempB; tempB = getParent(tempB)) { | ||
depthB++; | ||
} // If A is deeper, crawl up. | ||
for (var tempB = instB; tempB; tempB = getParent(tempB)) { | ||
depthB++; | ||
} // If A is deeper, crawl up. | ||
while (depthA - depthB > 0) { | ||
instA = getParent(instA); | ||
depthA--; | ||
} // If B is deeper, crawl up. | ||
while (depthA - depthB > 0) { | ||
instA = getParent(instA); | ||
depthA--; | ||
} // If B is deeper, crawl up. | ||
while (depthB - depthA > 0) { | ||
instB = getParent(instB); | ||
depthB--; | ||
} // Walk in lockstep until we find a match. | ||
while (depthB - depthA > 0) { | ||
instB = getParent(instB); | ||
depthB--; | ||
} // Walk in lockstep until we find a match. | ||
var depth = depthA; | ||
var depth = depthA; | ||
while (depth--) { | ||
if (instA === instB || instA === instB.alternate) { | ||
return instA; | ||
} | ||
while (depth--) { | ||
if (instA === instB || instA === instB.alternate) { | ||
return instA; | ||
instA = getParent(instA); | ||
instB = getParent(instB); | ||
} | ||
instA = getParent(instA); | ||
instB = getParent(instB); | ||
return null; | ||
} | ||
/** | ||
* Return if A is an ancestor of B. | ||
*/ | ||
return null; | ||
} | ||
/** | ||
* Return if A is an ancestor of B. | ||
*/ | ||
function isAncestor(instA, instB) { | ||
while (instB) { | ||
if (instA === instB || instA === instB.alternate) { | ||
return true; | ||
} | ||
function isAncestor(instA, instB) { | ||
while (instB) { | ||
if (instA === instB || instA === instB.alternate) { | ||
return true; | ||
instB = getParent(instB); | ||
} | ||
instB = getParent(instB); | ||
return false; | ||
} | ||
/** | ||
* Return the parent instance of the passed-in instance. | ||
*/ | ||
return false; | ||
} | ||
/** | ||
* Return the parent instance of the passed-in instance. | ||
*/ | ||
function getParentInstance(inst) { | ||
return getParent(inst); | ||
} | ||
/** | ||
* Simulates the traversal of a two-phase, capture/bubble event dispatch. | ||
*/ | ||
function getParentInstance(inst) { | ||
return getParent(inst); | ||
} | ||
/** | ||
* Simulates the traversal of a two-phase, capture/bubble event dispatch. | ||
*/ | ||
function traverseTwoPhase(inst, fn, arg) { | ||
var path = []; | ||
function traverseTwoPhase(inst, fn, arg) { | ||
var path = []; | ||
while (inst) { | ||
path.push(inst); | ||
inst = getParent(inst); | ||
} | ||
while (inst) { | ||
path.push(inst); | ||
inst = getParent(inst); | ||
} | ||
var i; | ||
var i; | ||
for (i = path.length; i-- > 0;) { | ||
fn(path[i], 'captured', arg); | ||
} | ||
for (i = path.length; i-- > 0;) { | ||
fn(path[i], 'captured', arg); | ||
for (i = 0; i < path.length; i++) { | ||
fn(path[i], 'bubbled', arg); | ||
} | ||
} | ||
for (i = 0; i < path.length; i++) { | ||
fn(path[i], 'bubbled', arg); | ||
function isInteractive(tag) { | ||
return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; | ||
} | ||
} | ||
/** | ||
* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that | ||
* should would receive a `mouseEnter` or `mouseLeave` event. | ||
* | ||
* Does not invoke the callback on the nearest common ancestor because nothing | ||
* "entered" or "left" that element. | ||
*/ | ||
/** | ||
* Registers plugins so that they can extract and dispatch events. | ||
* | ||
* @see {EventPluginHub} | ||
*/ | ||
function shouldPreventMouseEvent(name, type, props) { | ||
switch (name) { | ||
case 'onClick': | ||
case 'onClickCapture': | ||
case 'onDoubleClick': | ||
case 'onDoubleClickCapture': | ||
case 'onMouseDown': | ||
case 'onMouseDownCapture': | ||
case 'onMouseMove': | ||
case 'onMouseMoveCapture': | ||
case 'onMouseUp': | ||
case 'onMouseUpCapture': | ||
case 'onMouseEnter': | ||
return !!(props.disabled && isInteractive(type)); | ||
/** | ||
* Ordered list of injected plugins. | ||
*/ | ||
default: | ||
return false; | ||
} | ||
} | ||
/** | ||
* @param {object} inst The instance, which is the source of events. | ||
* @param {string} registrationName Name of listener (e.g. `onClick`). | ||
* @return {?function} The stored callback. | ||
*/ | ||
function getListener(inst, registrationName) { | ||
var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not | ||
// live here; needs to be moved to a better place soon | ||
/** | ||
* Mapping from event name to dispatch config | ||
*/ | ||
var stateNode = inst.stateNode; | ||
if (!stateNode) { | ||
// Work in progress (ex: onload events in incremental mode). | ||
return null; | ||
} | ||
/** | ||
* Mapping from registration name to plugin module | ||
*/ | ||
var props = getFiberCurrentPropsFromNode(stateNode); | ||
if (!props) { | ||
// Work in progress. | ||
return null; | ||
} | ||
/** | ||
* Mapping from registration name to event name | ||
*/ | ||
listener = props[registrationName]; | ||
if (shouldPreventMouseEvent(registrationName, inst.type, props)) { | ||
return null; | ||
} | ||
/** | ||
* Mapping from lowercase registration names to the properly cased version, | ||
* used to warn in the case of missing event handlers. Available | ||
* only in true. | ||
* @type {Object} | ||
*/ | ||
if (!(!listener || typeof listener === 'function')) { | ||
{ | ||
throw Error( "Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type." ); | ||
} | ||
} | ||
// Trust the developer to only use possibleRegistrationNames in true | ||
return listener; | ||
} | ||
/** | ||
* Injects an ordering of plugins (by plugin name). This allows the ordering | ||
* to be decoupled from injection of the actual plugins so that ordering is | ||
* always deterministic regardless of packaging, on-the-fly injection, etc. | ||
* | ||
* @param {array} InjectedEventPluginOrder | ||
* @internal | ||
* @see {EventPluginHub.injection.injectEventPluginOrder} | ||
*/ | ||
/** | ||
* Accumulates items that must not be null or undefined into the first one. This | ||
* is used to conserve memory by avoiding array allocations, and thus sacrifices | ||
* API cleanness. Since `current` can be null before being passed in and not | ||
* null after this function, make sure to assign it back to `current`: | ||
* | ||
* `a = accumulateInto(a, b);` | ||
* | ||
* This API should be sparingly used. Try `accumulate` for something cleaner. | ||
* | ||
* @return {*|array<*>} An accumulation of items. | ||
*/ | ||
function accumulateInto(current, next) { | ||
if (!(next != null)) { | ||
{ | ||
throw Error( "accumulateInto(...): Accumulated items must not be null or undefined." ); | ||
} | ||
} | ||
/** | ||
* Injects plugins to be used by `EventPluginHub`. The plugin names must be | ||
* in the ordering injected by `injectEventPluginOrder`. | ||
* | ||
* Plugins can be injected as part of page initialization or on-the-fly. | ||
* | ||
* @param {object} injectedNamesToPlugins Map from names to plugin modules. | ||
* @internal | ||
* @see {EventPluginHub.injection.injectEventPluginsByName} | ||
*/ | ||
if (current == null) { | ||
return next; | ||
} // Both are not empty. Warning: Never call x.concat(y) when you are not | ||
// certain that x is an Array (x could be a string with concat method). | ||
/** | ||
* Accumulates items that must not be null or undefined into the first one. This | ||
* is used to conserve memory by avoiding array allocations, and thus sacrifices | ||
* API cleanness. Since `current` can be null before being passed in and not | ||
* null after this function, make sure to assign it back to `current`: | ||
* | ||
* `a = accumulateInto(a, b);` | ||
* | ||
* This API should be sparingly used. Try `accumulate` for something cleaner. | ||
* | ||
* @return {*|array<*>} An accumulation of items. | ||
*/ | ||
function accumulateInto(current, next) { | ||
if (!(next != null)) { | ||
{ | ||
throw Error("accumulateInto(...): Accumulated items must not be null or undefined."); | ||
if (Array.isArray(current)) { | ||
if (Array.isArray(next)) { | ||
current.push.apply(current, next); | ||
return current; | ||
} | ||
current.push(next); | ||
return current; | ||
} | ||
} | ||
if (current == null) { | ||
return next; | ||
} // Both are not empty. Warning: Never call x.concat(y) when you are not | ||
// certain that x is an Array (x could be a string with concat method). | ||
if (Array.isArray(current)) { | ||
if (Array.isArray(next)) { | ||
current.push.apply(current, next); | ||
return current; | ||
// A bit too dangerous to mutate `next`. | ||
return [current].concat(next); | ||
} | ||
current.push(next); | ||
return current; | ||
return [current, next]; | ||
} | ||
if (Array.isArray(next)) { | ||
// A bit too dangerous to mutate `next`. | ||
return [current].concat(next); | ||
/** | ||
* @param {array} arr an "accumulation" of items which is either an Array or | ||
* a single item. Useful when paired with the `accumulate` module. This is a | ||
* simple utility that allows us to reason about a collection of items, but | ||
* handling the case when there is exactly one item (and we do not need to | ||
* allocate an array). | ||
* @param {function} cb Callback invoked with each element or a collection. | ||
* @param {?} [scope] Scope used as `this` in a callback. | ||
*/ | ||
function forEachAccumulated(arr, cb, scope) { | ||
if (Array.isArray(arr)) { | ||
arr.forEach(cb, scope); | ||
} else if (arr) { | ||
cb.call(scope, arr); | ||
} | ||
} | ||
return [current, next]; | ||
} | ||
/** | ||
* @param {array} arr an "accumulation" of items which is either an Array or | ||
* a single item. Useful when paired with the `accumulate` module. This is a | ||
* simple utility that allows us to reason about a collection of items, but | ||
* handling the case when there is exactly one item (and we do not need to | ||
* allocate an array). | ||
* @param {function} cb Callback invoked with each element or a collection. | ||
* @param {?} [scope] Scope used as `this` in a callback. | ||
*/ | ||
function forEachAccumulated(arr, cb, scope) { | ||
if (Array.isArray(arr)) { | ||
arr.forEach(cb, scope); | ||
} else if (arr) { | ||
cb.call(scope, arr); | ||
/** | ||
* Some event types have a notion of different registration names for different | ||
* "phases" of propagation. This finds listeners by a given phase. | ||
*/ | ||
function listenerAtPhase(inst, event, propagationPhase) { | ||
var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; | ||
return getListener(inst, registrationName); | ||
} | ||
} | ||
/** | ||
* A small set of propagation patterns, each of which will accept a small amount | ||
* of information, and generate a set of "dispatch ready event objects" - which | ||
* are sets of events that have already been annotated with a set of dispatched | ||
* listener functions/ids. The API is designed this way to discourage these | ||
* propagation strategies from actually executing the dispatches, since we | ||
* always want to collect the entire set of dispatches before executing even a | ||
* single one. | ||
*/ | ||
function isInteractive(tag) { | ||
return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; | ||
} | ||
/** | ||
* Tags a `SyntheticEvent` with dispatched listeners. Creating this function | ||
* here, allows us to not have to bind or create functions for each event. | ||
* Mutating the event's members allows us to not have to create a wrapping | ||
* "dispatch" object that pairs the event with the listener. | ||
*/ | ||
function shouldPreventMouseEvent(name, type, props) { | ||
switch (name) { | ||
case 'onClick': | ||
case 'onClickCapture': | ||
case 'onDoubleClick': | ||
case 'onDoubleClickCapture': | ||
case 'onMouseDown': | ||
case 'onMouseDownCapture': | ||
case 'onMouseMove': | ||
case 'onMouseMoveCapture': | ||
case 'onMouseUp': | ||
case 'onMouseUpCapture': | ||
return !!(props.disabled && isInteractive(type)); | ||
default: | ||
return false; | ||
} | ||
} | ||
/** | ||
* This is a unified interface for event plugins to be installed and configured. | ||
* | ||
* Event plugins can implement the following properties: | ||
* | ||
* `extractEvents` {function(string, DOMEventTarget, string, object): *} | ||
* Required. When a top-level event is fired, this method is expected to | ||
* extract synthetic events that will in turn be queued and dispatched. | ||
* | ||
* `eventTypes` {object} | ||
* Optional, plugins that fire events must publish a mapping of registration | ||
* names that are used to register listeners. Values of this mapping must | ||
* be objects that contain `registrationName` or `phasedRegistrationNames`. | ||
* | ||
* `executeDispatch` {function(object, function, string)} | ||
* Optional, allows plugins to override how an event gets dispatched. By | ||
* default, the listener is simply invoked. | ||
* | ||
* Each plugin that is injected into `EventsPluginHub` is immediately operable. | ||
* | ||
* @public | ||
*/ | ||
function accumulateDirectionalDispatches(inst, phase, event) { | ||
{ | ||
if (!inst) { | ||
error('Dispatching inst must not be null'); | ||
} | ||
} | ||
/** | ||
* Methods for injecting dependencies. | ||
*/ | ||
var listener = listenerAtPhase(inst, event, phase); | ||
if (listener) { | ||
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); | ||
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); | ||
} | ||
} | ||
/** | ||
* Collect dispatches (must be entirely collected before dispatching - see unit | ||
* tests). Lazily allocate the array to conserve memory. We must loop through | ||
* each event and perform the traversal for each one. We cannot perform a | ||
* single traversal for the entire collection of events because each event may | ||
* have a different target. | ||
*/ | ||
/** | ||
* @param {object} inst The instance, which is the source of events. | ||
* @param {string} registrationName Name of listener (e.g. `onClick`). | ||
* @return {?function} The stored callback. | ||
*/ | ||
function accumulateTwoPhaseDispatchesSingle(event) { | ||
if (event && event.dispatchConfig.phasedRegistrationNames) { | ||
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); | ||
} | ||
} | ||
/** | ||
* Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID. | ||
*/ | ||
function getListener(inst, registrationName) { | ||
var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not | ||
// live here; needs to be moved to a better place soon | ||
var stateNode = inst.stateNode; | ||
if (!stateNode) { | ||
// Work in progress (ex: onload events in incremental mode). | ||
return null; | ||
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { | ||
if (event && event.dispatchConfig.phasedRegistrationNames) { | ||
var targetInst = event._targetInst; | ||
var parentInst = targetInst ? getParentInstance(targetInst) : null; | ||
traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); | ||
} | ||
} | ||
/** | ||
* Accumulates without regard to direction, does not look for phased | ||
* registration names. Same as `accumulateDirectDispatchesSingle` but without | ||
* requiring that the `dispatchMarker` be the same as the dispatched ID. | ||
*/ | ||
var props = getFiberCurrentPropsFromNode$1(stateNode); | ||
if (!props) { | ||
// Work in progress. | ||
return null; | ||
function accumulateDispatches(inst, ignoredDirection, event) { | ||
if (inst && event && event.dispatchConfig.registrationName) { | ||
var registrationName = event.dispatchConfig.registrationName; | ||
var listener = getListener(inst, registrationName); | ||
if (listener) { | ||
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); | ||
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); | ||
} | ||
} | ||
} | ||
/** | ||
* Accumulates dispatches on an `SyntheticEvent`, but only for the | ||
* `dispatchMarker`. | ||
* @param {SyntheticEvent} event | ||
*/ | ||
listener = props[registrationName]; | ||
if (shouldPreventMouseEvent(registrationName, inst.type, props)) { | ||
return null; | ||
function accumulateDirectDispatchesSingle(event) { | ||
if (event && event.dispatchConfig.registrationName) { | ||
accumulateDispatches(event._targetInst, null, event); | ||
} | ||
} | ||
if (!(!listener || typeof listener === 'function')) { | ||
{ | ||
throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type."); | ||
} | ||
function accumulateTwoPhaseDispatches(events) { | ||
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); | ||
} | ||
function accumulateTwoPhaseDispatchesSkipTarget(events) { | ||
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget); | ||
} | ||
function accumulateDirectDispatches(events) { | ||
forEachAccumulated(events, accumulateDirectDispatchesSingle); | ||
} | ||
return listener; | ||
} | ||
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
var _assign = ReactInternals.assign; | ||
/** | ||
* Some event types have a notion of different registration names for different | ||
* "phases" of propagation. This finds listeners by a given phase. | ||
*/ | ||
function listenerAtPhase(inst, event, propagationPhase) { | ||
var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; | ||
return getListener(inst, registrationName); | ||
} | ||
/** | ||
* A small set of propagation patterns, each of which will accept a small amount | ||
* of information, and generate a set of "dispatch ready event objects" - which | ||
* are sets of events that have already been annotated with a set of dispatched | ||
* listener functions/ids. The API is designed this way to discourage these | ||
* propagation strategies from actually executing the dispatches, since we | ||
* always want to collect the entire set of dispatches before executing even a | ||
* single one. | ||
*/ | ||
var EVENT_POOL_SIZE = 10; | ||
/** | ||
* @interface Event | ||
* @see http://www.w3.org/TR/DOM-Level-3-Events/ | ||
*/ | ||
/** | ||
* Tags a `SyntheticEvent` with dispatched listeners. Creating this function | ||
* here, allows us to not have to bind or create functions for each event. | ||
* Mutating the event's members allows us to not have to create a wrapping | ||
* "dispatch" object that pairs the event with the listener. | ||
*/ | ||
var EventInterface = { | ||
type: null, | ||
target: null, | ||
// currentTarget is set when dispatching; no use in copying it here | ||
currentTarget: function () { | ||
return null; | ||
}, | ||
eventPhase: null, | ||
bubbles: null, | ||
cancelable: null, | ||
timeStamp: function (event) { | ||
return event.timeStamp || Date.now(); | ||
}, | ||
defaultPrevented: null, | ||
isTrusted: null | ||
}; | ||
function functionThatReturnsTrue() { | ||
return true; | ||
} | ||
function accumulateDirectionalDispatches(inst, phase, event) { | ||
{ | ||
!inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0; | ||
function functionThatReturnsFalse() { | ||
return false; | ||
} | ||
/** | ||
* Synthetic events are dispatched by event plugins, typically in response to a | ||
* top-level event delegation handler. | ||
* | ||
* These systems should generally use pooling to reduce the frequency of garbage | ||
* collection. The system should check `isPersistent` to determine whether the | ||
* event should be released into the pool after being dispatched. Users that | ||
* need a persisted event should invoke `persist`. | ||
* | ||
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by | ||
* normalizing browser quirks. Subclasses do not necessarily have to implement a | ||
* DOM interface; custom application-specific events can also subclass this. | ||
* | ||
* @param {object} dispatchConfig Configuration used to dispatch this event. | ||
* @param {*} targetInst Marker identifying the event target. | ||
* @param {object} nativeEvent Native browser event. | ||
* @param {DOMEventTarget} nativeEventTarget Target node. | ||
*/ | ||
var listener = listenerAtPhase(inst, event, phase); | ||
if (listener) { | ||
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); | ||
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); | ||
} | ||
} | ||
/** | ||
* Collect dispatches (must be entirely collected before dispatching - see unit | ||
* tests). Lazily allocate the array to conserve memory. We must loop through | ||
* each event and perform the traversal for each one. We cannot perform a | ||
* single traversal for the entire collection of events because each event may | ||
* have a different target. | ||
*/ | ||
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { | ||
{ | ||
// these have a getter/setter for warnings | ||
delete this.nativeEvent; | ||
delete this.preventDefault; | ||
delete this.stopPropagation; | ||
delete this.isDefaultPrevented; | ||
delete this.isPropagationStopped; | ||
} | ||
this.dispatchConfig = dispatchConfig; | ||
this._targetInst = targetInst; | ||
this.nativeEvent = nativeEvent; | ||
var Interface = this.constructor.Interface; | ||
function accumulateTwoPhaseDispatchesSingle(event) { | ||
if (event && event.dispatchConfig.phasedRegistrationNames) { | ||
traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); | ||
} | ||
} | ||
/** | ||
* Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID. | ||
*/ | ||
for (var propName in Interface) { | ||
if (!Interface.hasOwnProperty(propName)) { | ||
continue; | ||
} | ||
{ | ||
delete this[propName]; // this has a getter/setter for warnings | ||
} | ||
function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { | ||
if (event && event.dispatchConfig.phasedRegistrationNames) { | ||
var targetInst = event._targetInst; | ||
var parentInst = targetInst ? getParentInstance(targetInst) : null; | ||
traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); | ||
} | ||
} | ||
/** | ||
* Accumulates without regard to direction, does not look for phased | ||
* registration names. Same as `accumulateDirectDispatchesSingle` but without | ||
* requiring that the `dispatchMarker` be the same as the dispatched ID. | ||
*/ | ||
var normalize = Interface[propName]; | ||
if (normalize) { | ||
this[propName] = normalize(nativeEvent); | ||
} else { | ||
if (propName === 'target') { | ||
this.target = nativeEventTarget; | ||
} else { | ||
this[propName] = nativeEvent[propName]; | ||
} | ||
} | ||
} | ||
function accumulateDispatches(inst, ignoredDirection, event) { | ||
if (inst && event && event.dispatchConfig.registrationName) { | ||
var registrationName = event.dispatchConfig.registrationName; | ||
var listener = getListener(inst, registrationName); | ||
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; | ||
if (listener) { | ||
event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); | ||
event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); | ||
if (defaultPrevented) { | ||
this.isDefaultPrevented = functionThatReturnsTrue; | ||
} else { | ||
this.isDefaultPrevented = functionThatReturnsFalse; | ||
} | ||
} | ||
} | ||
/** | ||
* Accumulates dispatches on an `SyntheticEvent`, but only for the | ||
* `dispatchMarker`. | ||
* @param {SyntheticEvent} event | ||
*/ | ||
function accumulateDirectDispatchesSingle(event) { | ||
if (event && event.dispatchConfig.registrationName) { | ||
accumulateDispatches(event._targetInst, null, event); | ||
this.isPropagationStopped = functionThatReturnsFalse; | ||
return this; | ||
} | ||
} | ||
function accumulateTwoPhaseDispatches(events) { | ||
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); | ||
} | ||
function accumulateTwoPhaseDispatchesSkipTarget(events) { | ||
forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget); | ||
} | ||
_assign(SyntheticEvent.prototype, { | ||
preventDefault: function () { | ||
this.defaultPrevented = true; | ||
var event = this.nativeEvent; | ||
function accumulateDirectDispatches(events) { | ||
forEachAccumulated(events, accumulateDirectDispatchesSingle); | ||
} | ||
if (!event) { | ||
return; | ||
} | ||
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
var _assign = ReactInternals.assign; | ||
if (event.preventDefault) { | ||
event.preventDefault(); | ||
} else if (typeof event.returnValue !== 'unknown') { | ||
event.returnValue = false; | ||
} | ||
/* eslint valid-typeof: 0 */ | ||
var EVENT_POOL_SIZE = 10; | ||
/** | ||
* @interface Event | ||
* @see http://www.w3.org/TR/DOM-Level-3-Events/ | ||
*/ | ||
this.isDefaultPrevented = functionThatReturnsTrue; | ||
}, | ||
stopPropagation: function () { | ||
var event = this.nativeEvent; | ||
var EventInterface = { | ||
type: null, | ||
target: null, | ||
// currentTarget is set when dispatching; no use in copying it here | ||
currentTarget: function () { | ||
return null; | ||
}, | ||
eventPhase: null, | ||
bubbles: null, | ||
cancelable: null, | ||
timeStamp: function (event) { | ||
return event.timeStamp || Date.now(); | ||
}, | ||
defaultPrevented: null, | ||
isTrusted: null | ||
}; | ||
if (!event) { | ||
return; | ||
} | ||
function functionThatReturnsTrue() { | ||
return true; | ||
} | ||
if (event.stopPropagation) { | ||
event.stopPropagation(); | ||
} else if (typeof event.cancelBubble !== 'unknown') { | ||
// The ChangeEventPlugin registers a "propertychange" event for | ||
// IE. This event does not support bubbling or cancelling, and | ||
// any references to cancelBubble throw "Member not found". A | ||
// typeof check of "unknown" circumvents this issue (and is also | ||
// IE specific). | ||
event.cancelBubble = true; | ||
} | ||
function functionThatReturnsFalse() { | ||
return false; | ||
} | ||
/** | ||
* Synthetic events are dispatched by event plugins, typically in response to a | ||
* top-level event delegation handler. | ||
* | ||
* These systems should generally use pooling to reduce the frequency of garbage | ||
* collection. The system should check `isPersistent` to determine whether the | ||
* event should be released into the pool after being dispatched. Users that | ||
* need a persisted event should invoke `persist`. | ||
* | ||
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by | ||
* normalizing browser quirks. Subclasses do not necessarily have to implement a | ||
* DOM interface; custom application-specific events can also subclass this. | ||
* | ||
* @param {object} dispatchConfig Configuration used to dispatch this event. | ||
* @param {*} targetInst Marker identifying the event target. | ||
* @param {object} nativeEvent Native browser event. | ||
* @param {DOMEventTarget} nativeEventTarget Target node. | ||
*/ | ||
this.isPropagationStopped = functionThatReturnsTrue; | ||
}, | ||
/** | ||
* We release all dispatched `SyntheticEvent`s after each event loop, adding | ||
* them back into the pool. This allows a way to hold onto a reference that | ||
* won't be added back into the pool. | ||
*/ | ||
persist: function () { | ||
this.isPersistent = functionThatReturnsTrue; | ||
}, | ||
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { | ||
{ | ||
// these have a getter/setter for warnings | ||
delete this.nativeEvent; | ||
delete this.preventDefault; | ||
delete this.stopPropagation; | ||
delete this.isDefaultPrevented; | ||
delete this.isPropagationStopped; | ||
} | ||
/** | ||
* Checks if this event should be released back into the pool. | ||
* | ||
* @return {boolean} True if this should not be released, false otherwise. | ||
*/ | ||
isPersistent: functionThatReturnsFalse, | ||
this.dispatchConfig = dispatchConfig; | ||
this._targetInst = targetInst; | ||
this.nativeEvent = nativeEvent; | ||
var Interface = this.constructor.Interface; | ||
/** | ||
* `PooledClass` looks for `destructor` on each instance it releases. | ||
*/ | ||
destructor: function () { | ||
var Interface = this.constructor.Interface; | ||
for (var propName in Interface) { | ||
if (!Interface.hasOwnProperty(propName)) { | ||
continue; | ||
} | ||
for (var propName in Interface) { | ||
{ | ||
Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); | ||
} | ||
} | ||
{ | ||
delete this[propName]; // this has a getter/setter for warnings | ||
} | ||
this.dispatchConfig = null; | ||
this._targetInst = null; | ||
this.nativeEvent = null; | ||
this.isDefaultPrevented = functionThatReturnsFalse; | ||
this.isPropagationStopped = functionThatReturnsFalse; | ||
this._dispatchListeners = null; | ||
this._dispatchInstances = null; | ||
var normalize = Interface[propName]; | ||
if (normalize) { | ||
this[propName] = normalize(nativeEvent); | ||
} else { | ||
if (propName === 'target') { | ||
this.target = nativeEventTarget; | ||
} else { | ||
this[propName] = nativeEvent[propName]; | ||
{ | ||
Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null)); | ||
Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse)); | ||
Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse)); | ||
Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {})); | ||
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {})); | ||
} | ||
} | ||
} | ||
}); | ||
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; | ||
SyntheticEvent.Interface = EventInterface; | ||
/** | ||
* Helper to reduce boilerplate when creating subclasses. | ||
*/ | ||
if (defaultPrevented) { | ||
this.isDefaultPrevented = functionThatReturnsTrue; | ||
} else { | ||
this.isDefaultPrevented = functionThatReturnsFalse; | ||
} | ||
SyntheticEvent.extend = function (Interface) { | ||
var Super = this; | ||
this.isPropagationStopped = functionThatReturnsFalse; | ||
return this; | ||
} | ||
var E = function () {}; | ||
_assign(SyntheticEvent.prototype, { | ||
preventDefault: function () { | ||
this.defaultPrevented = true; | ||
var event = this.nativeEvent; | ||
E.prototype = Super.prototype; | ||
var prototype = new E(); | ||
if (!event) { | ||
return; | ||
function Class() { | ||
return Super.apply(this, arguments); | ||
} | ||
if (event.preventDefault) { | ||
event.preventDefault(); | ||
} else if (typeof event.returnValue !== 'unknown') { | ||
event.returnValue = false; | ||
} | ||
_assign(prototype, Class.prototype); | ||
this.isDefaultPrevented = functionThatReturnsTrue; | ||
}, | ||
stopPropagation: function () { | ||
var event = this.nativeEvent; | ||
Class.prototype = prototype; | ||
Class.prototype.constructor = Class; | ||
Class.Interface = _assign({}, Super.Interface, Interface); | ||
Class.extend = Super.extend; | ||
addEventPoolingTo(Class); | ||
return Class; | ||
}; | ||
if (!event) { | ||
return; | ||
} | ||
if (event.stopPropagation) { | ||
event.stopPropagation(); | ||
} else if (typeof event.cancelBubble !== 'unknown') { | ||
// The ChangeEventPlugin registers a "propertychange" event for | ||
// IE. This event does not support bubbling or cancelling, and | ||
// any references to cancelBubble throw "Member not found". A | ||
// typeof check of "unknown" circumvents this issue (and is also | ||
// IE specific). | ||
event.cancelBubble = true; | ||
} | ||
this.isPropagationStopped = functionThatReturnsTrue; | ||
}, | ||
addEventPoolingTo(SyntheticEvent); | ||
/** | ||
* We release all dispatched `SyntheticEvent`s after each event loop, adding | ||
* them back into the pool. This allows a way to hold onto a reference that | ||
* won't be added back into the pool. | ||
*/ | ||
persist: function () { | ||
this.isPersistent = functionThatReturnsTrue; | ||
}, | ||
/** | ||
* Checks if this event should be released back into the pool. | ||
* Helper to nullify syntheticEvent instance properties when destructing | ||
* | ||
* @return {boolean} True if this should not be released, false otherwise. | ||
* @param {String} propName | ||
* @param {?object} getVal | ||
* @return {object} defineProperty object | ||
*/ | ||
isPersistent: functionThatReturnsFalse, | ||
/** | ||
* `PooledClass` looks for `destructor` on each instance it releases. | ||
*/ | ||
destructor: function () { | ||
var Interface = this.constructor.Interface; | ||
function getPooledWarningPropertyDefinition(propName, getVal) { | ||
var isFunction = typeof getVal === 'function'; | ||
return { | ||
configurable: true, | ||
set: set, | ||
get: get | ||
}; | ||
for (var propName in Interface) { | ||
{ | ||
Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); | ||
} | ||
function set(val) { | ||
var action = isFunction ? 'setting the method' : 'setting the property'; | ||
warn(action, 'This is effectively a no-op'); | ||
return val; | ||
} | ||
this.dispatchConfig = null; | ||
this._targetInst = null; | ||
this.nativeEvent = null; | ||
this.isDefaultPrevented = functionThatReturnsFalse; | ||
this.isPropagationStopped = functionThatReturnsFalse; | ||
this._dispatchListeners = null; | ||
this._dispatchInstances = null; | ||
function get() { | ||
var action = isFunction ? 'accessing the method' : 'accessing the property'; | ||
var result = isFunction ? 'This is a no-op function' : 'This is set to null'; | ||
warn(action, result); | ||
return getVal; | ||
} | ||
{ | ||
Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null)); | ||
Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse)); | ||
Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse)); | ||
Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {})); | ||
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {})); | ||
function warn(action, result) { | ||
{ | ||
error("This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result); | ||
} | ||
} | ||
} | ||
}); | ||
SyntheticEvent.Interface = EventInterface; | ||
/** | ||
* Helper to reduce boilerplate when creating subclasses. | ||
*/ | ||
function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { | ||
var EventConstructor = this; | ||
SyntheticEvent.extend = function (Interface) { | ||
var Super = this; | ||
if (EventConstructor.eventPool.length) { | ||
var instance = EventConstructor.eventPool.pop(); | ||
EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); | ||
return instance; | ||
} | ||
var E = function () {}; | ||
E.prototype = Super.prototype; | ||
var prototype = new E(); | ||
function Class() { | ||
return Super.apply(this, arguments); | ||
return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst); | ||
} | ||
_assign(prototype, Class.prototype); | ||
function releasePooledEvent(event) { | ||
var EventConstructor = this; | ||
Class.prototype = prototype; | ||
Class.prototype.constructor = Class; | ||
Class.Interface = _assign({}, Super.Interface, Interface); | ||
Class.extend = Super.extend; | ||
addEventPoolingTo(Class); | ||
return Class; | ||
}; | ||
if (!(event instanceof EventConstructor)) { | ||
{ | ||
throw Error( "Trying to release an event instance into a pool of a different type." ); | ||
} | ||
} | ||
addEventPoolingTo(SyntheticEvent); | ||
/** | ||
* Helper to nullify syntheticEvent instance properties when destructing | ||
* | ||
* @param {String} propName | ||
* @param {?object} getVal | ||
* @return {object} defineProperty object | ||
*/ | ||
event.destructor(); | ||
function getPooledWarningPropertyDefinition(propName, getVal) { | ||
var isFunction = typeof getVal === 'function'; | ||
return { | ||
configurable: true, | ||
set: set, | ||
get: get | ||
}; | ||
function set(val) { | ||
var action = isFunction ? 'setting the method' : 'setting the property'; | ||
warn(action, 'This is effectively a no-op'); | ||
return val; | ||
if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) { | ||
EventConstructor.eventPool.push(event); | ||
} | ||
} | ||
function get() { | ||
var action = isFunction ? 'accessing the method' : 'accessing the property'; | ||
var result = isFunction ? 'This is a no-op function' : 'This is set to null'; | ||
warn(action, result); | ||
return getVal; | ||
function addEventPoolingTo(EventConstructor) { | ||
EventConstructor.eventPool = []; | ||
EventConstructor.getPooled = getPooledEvent; | ||
EventConstructor.release = releasePooledEvent; | ||
} | ||
function warn(action, result) { | ||
var warningCondition = false; | ||
!warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0; | ||
} | ||
} | ||
/** | ||
* `touchHistory` isn't actually on the native event, but putting it in the | ||
* interface will ensure that it is cleaned up when pooled/destroyed. The | ||
* `ResponderEventPlugin` will populate it appropriately. | ||
*/ | ||
function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { | ||
var EventConstructor = this; | ||
var ResponderSyntheticEvent = SyntheticEvent.extend({ | ||
touchHistory: function (nativeEvent) { | ||
return null; // Actually doesn't even look at the native event. | ||
} | ||
}); | ||
if (EventConstructor.eventPool.length) { | ||
var instance = EventConstructor.eventPool.pop(); | ||
EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); | ||
return instance; | ||
// Note: ideally these would be imported from DOMTopLevelEventTypes, | ||
// but our build system currently doesn't let us do that from a fork. | ||
var TOP_TOUCH_START = 'touchstart'; | ||
var TOP_TOUCH_MOVE = 'touchmove'; | ||
var TOP_TOUCH_END = 'touchend'; | ||
var TOP_TOUCH_CANCEL = 'touchcancel'; | ||
var TOP_SCROLL = 'scroll'; | ||
var TOP_SELECTION_CHANGE = 'selectionchange'; | ||
var TOP_MOUSE_DOWN = 'mousedown'; | ||
var TOP_MOUSE_MOVE = 'mousemove'; | ||
var TOP_MOUSE_UP = 'mouseup'; | ||
function isStartish(topLevelType) { | ||
return topLevelType === TOP_TOUCH_START || topLevelType === TOP_MOUSE_DOWN; | ||
} | ||
function isMoveish(topLevelType) { | ||
return topLevelType === TOP_TOUCH_MOVE || topLevelType === TOP_MOUSE_MOVE; | ||
} | ||
function isEndish(topLevelType) { | ||
return topLevelType === TOP_TOUCH_END || topLevelType === TOP_TOUCH_CANCEL || topLevelType === TOP_MOUSE_UP; | ||
} | ||
var startDependencies = [TOP_TOUCH_START, TOP_MOUSE_DOWN]; | ||
var moveDependencies = [TOP_TOUCH_MOVE, TOP_MOUSE_MOVE]; | ||
var endDependencies = [TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_MOUSE_UP]; | ||
return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst); | ||
} | ||
/** | ||
* Tracks the position and time of each active touch by `touch.identifier`. We | ||
* should typically only see IDs in the range of 1-20 because IDs get recycled | ||
* when touches end and start again. | ||
*/ | ||
function releasePooledEvent(event) { | ||
var EventConstructor = this; | ||
var MAX_TOUCH_BANK = 20; | ||
var touchBank = []; | ||
var touchHistory = { | ||
touchBank: touchBank, | ||
numberActiveTouches: 0, | ||
// If there is only one active touch, we remember its location. This prevents | ||
// us having to loop through all of the touches all the time in the most | ||
// common case. | ||
indexOfSingleActiveTouch: -1, | ||
mostRecentTimeStamp: 0 | ||
}; | ||
if (!(event instanceof EventConstructor)) { | ||
{ | ||
throw Error("Trying to release an event instance into a pool of a different type."); | ||
} | ||
function timestampForTouch(touch) { | ||
// The legacy internal implementation provides "timeStamp", which has been | ||
// renamed to "timestamp". Let both work for now while we iron it out | ||
// TODO (evv): rename timeStamp to timestamp in internal code | ||
return touch.timeStamp || touch.timestamp; | ||
} | ||
/** | ||
* TODO: Instead of making gestures recompute filtered velocity, we could | ||
* include a built in velocity computation that can be reused globally. | ||
*/ | ||
event.destructor(); | ||
if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) { | ||
EventConstructor.eventPool.push(event); | ||
function createTouchRecord(touch) { | ||
return { | ||
touchActive: true, | ||
startPageX: touch.pageX, | ||
startPageY: touch.pageY, | ||
startTimeStamp: timestampForTouch(touch), | ||
currentPageX: touch.pageX, | ||
currentPageY: touch.pageY, | ||
currentTimeStamp: timestampForTouch(touch), | ||
previousPageX: touch.pageX, | ||
previousPageY: touch.pageY, | ||
previousTimeStamp: timestampForTouch(touch) | ||
}; | ||
} | ||
} | ||
function addEventPoolingTo(EventConstructor) { | ||
EventConstructor.eventPool = []; | ||
EventConstructor.getPooled = getPooledEvent; | ||
EventConstructor.release = releasePooledEvent; | ||
} | ||
/** | ||
* `touchHistory` isn't actually on the native event, but putting it in the | ||
* interface will ensure that it is cleaned up when pooled/destroyed. The | ||
* `ResponderEventPlugin` will populate it appropriately. | ||
*/ | ||
var ResponderSyntheticEvent = SyntheticEvent.extend({ | ||
touchHistory: function (nativeEvent) { | ||
return null; // Actually doesn't even look at the native event. | ||
function resetTouchRecord(touchRecord, touch) { | ||
touchRecord.touchActive = true; | ||
touchRecord.startPageX = touch.pageX; | ||
touchRecord.startPageY = touch.pageY; | ||
touchRecord.startTimeStamp = timestampForTouch(touch); | ||
touchRecord.currentPageX = touch.pageX; | ||
touchRecord.currentPageY = touch.pageY; | ||
touchRecord.currentTimeStamp = timestampForTouch(touch); | ||
touchRecord.previousPageX = touch.pageX; | ||
touchRecord.previousPageY = touch.pageY; | ||
touchRecord.previousTimeStamp = timestampForTouch(touch); | ||
} | ||
}); | ||
// Note: ideally these would be imported from DOMTopLevelEventTypes, | ||
// but our build system currently doesn't let us do that from a fork. | ||
var TOP_TOUCH_START = 'touchstart'; | ||
var TOP_TOUCH_MOVE = 'touchmove'; | ||
var TOP_TOUCH_END = 'touchend'; | ||
var TOP_TOUCH_CANCEL = 'touchcancel'; | ||
var TOP_SCROLL = 'scroll'; | ||
var TOP_SELECTION_CHANGE = 'selectionchange'; | ||
var TOP_MOUSE_DOWN = 'mousedown'; | ||
var TOP_MOUSE_MOVE = 'mousemove'; | ||
var TOP_MOUSE_UP = 'mouseup'; | ||
function isStartish(topLevelType) { | ||
return topLevelType === TOP_TOUCH_START || topLevelType === TOP_MOUSE_DOWN; | ||
} | ||
function isMoveish(topLevelType) { | ||
return topLevelType === TOP_TOUCH_MOVE || topLevelType === TOP_MOUSE_MOVE; | ||
} | ||
function isEndish(topLevelType) { | ||
return topLevelType === TOP_TOUCH_END || topLevelType === TOP_TOUCH_CANCEL || topLevelType === TOP_MOUSE_UP; | ||
} | ||
var startDependencies = [TOP_TOUCH_START, TOP_MOUSE_DOWN]; | ||
var moveDependencies = [TOP_TOUCH_MOVE, TOP_MOUSE_MOVE]; | ||
var endDependencies = [TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_MOUSE_UP]; | ||
function getTouchIdentifier(_ref) { | ||
var identifier = _ref.identifier; | ||
/** | ||
* Tracks the position and time of each active touch by `touch.identifier`. We | ||
* should typically only see IDs in the range of 1-20 because IDs get recycled | ||
* when touches end and start again. | ||
*/ | ||
if (!(identifier != null)) { | ||
{ | ||
throw Error( "Touch object is missing identifier." ); | ||
} | ||
} | ||
var MAX_TOUCH_BANK = 20; | ||
var touchBank = []; | ||
var touchHistory = { | ||
touchBank: touchBank, | ||
numberActiveTouches: 0, | ||
// If there is only one active touch, we remember its location. This prevents | ||
// us having to loop through all of the touches all the time in the most | ||
// common case. | ||
indexOfSingleActiveTouch: -1, | ||
mostRecentTimeStamp: 0 | ||
}; | ||
function timestampForTouch(touch) { | ||
// The legacy internal implementation provides "timeStamp", which has been | ||
// renamed to "timestamp". Let both work for now while we iron it out | ||
// TODO (evv): rename timeStamp to timestamp in internal code | ||
return touch.timeStamp || touch.timestamp; | ||
} | ||
/** | ||
* TODO: Instead of making gestures recompute filtered velocity, we could | ||
* include a built in velocity computation that can be reused globally. | ||
*/ | ||
function createTouchRecord(touch) { | ||
return { | ||
touchActive: true, | ||
startPageX: touch.pageX, | ||
startPageY: touch.pageY, | ||
startTimeStamp: timestampForTouch(touch), | ||
currentPageX: touch.pageX, | ||
currentPageY: touch.pageY, | ||
currentTimeStamp: timestampForTouch(touch), | ||
previousPageX: touch.pageX, | ||
previousPageY: touch.pageY, | ||
previousTimeStamp: timestampForTouch(touch) | ||
}; | ||
} | ||
function resetTouchRecord(touchRecord, touch) { | ||
touchRecord.touchActive = true; | ||
touchRecord.startPageX = touch.pageX; | ||
touchRecord.startPageY = touch.pageY; | ||
touchRecord.startTimeStamp = timestampForTouch(touch); | ||
touchRecord.currentPageX = touch.pageX; | ||
touchRecord.currentPageY = touch.pageY; | ||
touchRecord.currentTimeStamp = timestampForTouch(touch); | ||
touchRecord.previousPageX = touch.pageX; | ||
touchRecord.previousPageY = touch.pageY; | ||
touchRecord.previousTimeStamp = timestampForTouch(touch); | ||
} | ||
function getTouchIdentifier(_ref) { | ||
var identifier = _ref.identifier; | ||
if (!(identifier != null)) { | ||
{ | ||
throw Error("Touch object is missing identifier."); | ||
if (identifier > MAX_TOUCH_BANK) { | ||
error('Touch identifier %s is greater than maximum supported %s which causes ' + 'performance issues backfilling array locations for all of the indices.', identifier, MAX_TOUCH_BANK); | ||
} | ||
} | ||
} | ||
{ | ||
!(identifier <= MAX_TOUCH_BANK) ? warningWithoutStack$1(false, 'Touch identifier %s is greater than maximum supported %s which causes ' + 'performance issues backfilling array locations for all of the indices.', identifier, MAX_TOUCH_BANK) : void 0; | ||
return identifier; | ||
} | ||
return identifier; | ||
} | ||
function recordTouchStart(touch) { | ||
var identifier = getTouchIdentifier(touch); | ||
var touchRecord = touchBank[identifier]; | ||
function recordTouchStart(touch) { | ||
var identifier = getTouchIdentifier(touch); | ||
var touchRecord = touchBank[identifier]; | ||
if (touchRecord) { | ||
resetTouchRecord(touchRecord, touch); | ||
} else { | ||
touchBank[identifier] = createTouchRecord(touch); | ||
} | ||
if (touchRecord) { | ||
resetTouchRecord(touchRecord, touch); | ||
} else { | ||
touchBank[identifier] = createTouchRecord(touch); | ||
touchHistory.mostRecentTimeStamp = timestampForTouch(touch); | ||
} | ||
touchHistory.mostRecentTimeStamp = timestampForTouch(touch); | ||
} | ||
function recordTouchMove(touch) { | ||
var touchRecord = touchBank[getTouchIdentifier(touch)]; | ||
function recordTouchMove(touch) { | ||
var touchRecord = touchBank[getTouchIdentifier(touch)]; | ||
if (touchRecord) { | ||
touchRecord.touchActive = true; | ||
touchRecord.previousPageX = touchRecord.currentPageX; | ||
touchRecord.previousPageY = touchRecord.currentPageY; | ||
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp; | ||
touchRecord.currentPageX = touch.pageX; | ||
touchRecord.currentPageY = touch.pageY; | ||
touchRecord.currentTimeStamp = timestampForTouch(touch); | ||
touchHistory.mostRecentTimeStamp = timestampForTouch(touch); | ||
} else { | ||
console.warn('Cannot record touch move without a touch start.\n' + 'Touch Move: %s\n', 'Touch Bank: %s', printTouch(touch), printTouchBank()); | ||
if (touchRecord) { | ||
touchRecord.touchActive = true; | ||
touchRecord.previousPageX = touchRecord.currentPageX; | ||
touchRecord.previousPageY = touchRecord.currentPageY; | ||
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp; | ||
touchRecord.currentPageX = touch.pageX; | ||
touchRecord.currentPageY = touch.pageY; | ||
touchRecord.currentTimeStamp = timestampForTouch(touch); | ||
touchHistory.mostRecentTimeStamp = timestampForTouch(touch); | ||
} else { | ||
{ | ||
warn('Cannot record touch move without a touch start.\n' + 'Touch Move: %s\n' + 'Touch Bank: %s', printTouch(touch), printTouchBank()); | ||
} | ||
} | ||
} | ||
} | ||
function recordTouchEnd(touch) { | ||
var touchRecord = touchBank[getTouchIdentifier(touch)]; | ||
function recordTouchEnd(touch) { | ||
var touchRecord = touchBank[getTouchIdentifier(touch)]; | ||
if (touchRecord) { | ||
touchRecord.touchActive = false; | ||
touchRecord.previousPageX = touchRecord.currentPageX; | ||
touchRecord.previousPageY = touchRecord.currentPageY; | ||
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp; | ||
touchRecord.currentPageX = touch.pageX; | ||
touchRecord.currentPageY = touch.pageY; | ||
touchRecord.currentTimeStamp = timestampForTouch(touch); | ||
touchHistory.mostRecentTimeStamp = timestampForTouch(touch); | ||
} else { | ||
console.warn('Cannot record touch end without a touch start.\n' + 'Touch End: %s\n', 'Touch Bank: %s', printTouch(touch), printTouchBank()); | ||
if (touchRecord) { | ||
touchRecord.touchActive = false; | ||
touchRecord.previousPageX = touchRecord.currentPageX; | ||
touchRecord.previousPageY = touchRecord.currentPageY; | ||
touchRecord.previousTimeStamp = touchRecord.currentTimeStamp; | ||
touchRecord.currentPageX = touch.pageX; | ||
touchRecord.currentPageY = touch.pageY; | ||
touchRecord.currentTimeStamp = timestampForTouch(touch); | ||
touchHistory.mostRecentTimeStamp = timestampForTouch(touch); | ||
} else { | ||
{ | ||
warn('Cannot record touch end without a touch start.\n' + 'Touch End: %s\n' + 'Touch Bank: %s', printTouch(touch), printTouchBank()); | ||
} | ||
} | ||
} | ||
} | ||
function printTouch(touch) { | ||
return JSON.stringify({ | ||
identifier: touch.identifier, | ||
pageX: touch.pageX, | ||
pageY: touch.pageY, | ||
timestamp: timestampForTouch(touch) | ||
}); | ||
} | ||
function printTouch(touch) { | ||
return JSON.stringify({ | ||
identifier: touch.identifier, | ||
pageX: touch.pageX, | ||
pageY: touch.pageY, | ||
timestamp: timestampForTouch(touch) | ||
}); | ||
} | ||
function printTouchBank() { | ||
var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); | ||
function printTouchBank() { | ||
var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); | ||
if (touchBank.length > MAX_TOUCH_BANK) { | ||
printed += ' (original size: ' + touchBank.length + ')'; | ||
if (touchBank.length > MAX_TOUCH_BANK) { | ||
printed += ' (original size: ' + touchBank.length + ')'; | ||
} | ||
return printed; | ||
} | ||
return printed; | ||
} | ||
var ResponderTouchHistoryStore = { | ||
recordTouchTrack: function (topLevelType, nativeEvent) { | ||
if (isMoveish(topLevelType)) { | ||
nativeEvent.changedTouches.forEach(recordTouchMove); | ||
} else if (isStartish(topLevelType)) { | ||
nativeEvent.changedTouches.forEach(recordTouchStart); | ||
touchHistory.numberActiveTouches = nativeEvent.touches.length; | ||
var ResponderTouchHistoryStore = { | ||
recordTouchTrack: function (topLevelType, nativeEvent) { | ||
if (isMoveish(topLevelType)) { | ||
nativeEvent.changedTouches.forEach(recordTouchMove); | ||
} else if (isStartish(topLevelType)) { | ||
nativeEvent.changedTouches.forEach(recordTouchStart); | ||
touchHistory.numberActiveTouches = nativeEvent.touches.length; | ||
if (touchHistory.numberActiveTouches === 1) { | ||
touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier; | ||
} | ||
} else if (isEndish(topLevelType)) { | ||
nativeEvent.changedTouches.forEach(recordTouchEnd); | ||
touchHistory.numberActiveTouches = nativeEvent.touches.length; | ||
if (touchHistory.numberActiveTouches === 1) { | ||
touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier; | ||
} | ||
} else if (isEndish(topLevelType)) { | ||
nativeEvent.changedTouches.forEach(recordTouchEnd); | ||
touchHistory.numberActiveTouches = nativeEvent.touches.length; | ||
if (touchHistory.numberActiveTouches === 1) { | ||
for (var i = 0; i < touchBank.length; i++) { | ||
var touchTrackToCheck = touchBank[i]; | ||
if (touchHistory.numberActiveTouches === 1) { | ||
for (var i = 0; i < touchBank.length; i++) { | ||
var touchTrackToCheck = touchBank[i]; | ||
if (touchTrackToCheck != null && touchTrackToCheck.touchActive) { | ||
touchHistory.indexOfSingleActiveTouch = i; | ||
break; | ||
} | ||
} | ||
if (touchTrackToCheck != null && touchTrackToCheck.touchActive) { | ||
touchHistory.indexOfSingleActiveTouch = i; | ||
break; | ||
{ | ||
var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]; | ||
if (activeRecord == null || !activeRecord.touchActive) { | ||
error('Cannot find single active touch.'); | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
touchHistory: touchHistory | ||
}; | ||
{ | ||
var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]; | ||
!(activeRecord != null && activeRecord.touchActive) ? warningWithoutStack$1(false, 'Cannot find single active touch.') : void 0; | ||
} | ||
/** | ||
* Accumulates items that must not be null or undefined. | ||
* | ||
* This is used to conserve memory by avoiding array allocations. | ||
* | ||
* @return {*|array<*>} An accumulation of items. | ||
*/ | ||
function accumulate(current, next) { | ||
if (!(next != null)) { | ||
{ | ||
throw Error( "accumulate(...): Accumulated items must not be null or undefined." ); | ||
} | ||
} | ||
}, | ||
touchHistory: touchHistory | ||
}; | ||
/** | ||
* Accumulates items that must not be null or undefined. | ||
* | ||
* This is used to conserve memory by avoiding array allocations. | ||
* | ||
* @return {*|array<*>} An accumulation of items. | ||
*/ | ||
if (current == null) { | ||
return next; | ||
} // Both are not empty. Warning: Never call x.concat(y) when you are not | ||
// certain that x is an Array (x could be a string with concat method). | ||
function accumulate(current, next) { | ||
if (!(next != null)) { | ||
{ | ||
throw Error("accumulate(...): Accumulated items must not be null or undefined."); | ||
if (Array.isArray(current)) { | ||
return current.concat(next); | ||
} | ||
} | ||
if (current == null) { | ||
return next; | ||
} // Both are not empty. Warning: Never call x.concat(y) when you are not | ||
// certain that x is an Array (x could be a string with concat method). | ||
if (Array.isArray(next)) { | ||
return [current].concat(next); | ||
} | ||
if (Array.isArray(current)) { | ||
return current.concat(next); | ||
return [current, next]; | ||
} | ||
if (Array.isArray(next)) { | ||
return [current].concat(next); | ||
} | ||
/** | ||
* Instance of element that should respond to touch/move types of interactions, | ||
* as indicated explicitly by relevant callbacks. | ||
*/ | ||
return [current, next]; | ||
} | ||
var responderInst = null; | ||
/** | ||
* Count of current touches. A textInput should become responder iff the | ||
* selection changes while there is a touch on the screen. | ||
*/ | ||
/** | ||
* Instance of element that should respond to touch/move types of interactions, | ||
* as indicated explicitly by relevant callbacks. | ||
*/ | ||
var trackedTouchCount = 0; | ||
var responderInst = null; | ||
/** | ||
* Count of current touches. A textInput should become responder iff the | ||
* selection changes while there is a touch on the screen. | ||
*/ | ||
var changeResponder = function (nextResponderInst, blockHostResponder) { | ||
var oldResponderInst = responderInst; | ||
responderInst = nextResponderInst; | ||
var trackedTouchCount = 0; | ||
if (ResponderEventPlugin.GlobalResponderHandler !== null) { | ||
ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder); | ||
} | ||
}; | ||
var changeResponder = function (nextResponderInst, blockHostResponder) { | ||
var oldResponderInst = responderInst; | ||
responderInst = nextResponderInst; | ||
var eventTypes = { | ||
/** | ||
* On a `touchStart`/`mouseDown`, is it desired that this element become the | ||
* responder? | ||
*/ | ||
startShouldSetResponder: { | ||
phasedRegistrationNames: { | ||
bubbled: 'onStartShouldSetResponder', | ||
captured: 'onStartShouldSetResponderCapture' | ||
}, | ||
dependencies: startDependencies | ||
}, | ||
if (ResponderEventPlugin.GlobalResponderHandler !== null) { | ||
ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder); | ||
} | ||
}; | ||
/** | ||
* On a `scroll`, is it desired that this element become the responder? This | ||
* is usually not needed, but should be used to retroactively infer that a | ||
* `touchStart` had occurred during momentum scroll. During a momentum scroll, | ||
* a touch start will be immediately followed by a scroll event if the view is | ||
* currently scrolling. | ||
* | ||
* TODO: This shouldn't bubble. | ||
*/ | ||
scrollShouldSetResponder: { | ||
phasedRegistrationNames: { | ||
bubbled: 'onScrollShouldSetResponder', | ||
captured: 'onScrollShouldSetResponderCapture' | ||
}, | ||
dependencies: [TOP_SCROLL] | ||
}, | ||
var eventTypes = { | ||
/** | ||
* On a `touchStart`/`mouseDown`, is it desired that this element become the | ||
* responder? | ||
*/ | ||
startShouldSetResponder: { | ||
phasedRegistrationNames: { | ||
bubbled: 'onStartShouldSetResponder', | ||
captured: 'onStartShouldSetResponderCapture' | ||
/** | ||
* On text selection change, should this element become the responder? This | ||
* is needed for text inputs or other views with native selection, so the | ||
* JS view can claim the responder. | ||
* | ||
* TODO: This shouldn't bubble. | ||
*/ | ||
selectionChangeShouldSetResponder: { | ||
phasedRegistrationNames: { | ||
bubbled: 'onSelectionChangeShouldSetResponder', | ||
captured: 'onSelectionChangeShouldSetResponderCapture' | ||
}, | ||
dependencies: [TOP_SELECTION_CHANGE] | ||
}, | ||
dependencies: startDependencies | ||
}, | ||
/** | ||
* On a `scroll`, is it desired that this element become the responder? This | ||
* is usually not needed, but should be used to retroactively infer that a | ||
* `touchStart` had occurred during momentum scroll. During a momentum scroll, | ||
* a touch start will be immediately followed by a scroll event if the view is | ||
* currently scrolling. | ||
* | ||
* TODO: This shouldn't bubble. | ||
*/ | ||
scrollShouldSetResponder: { | ||
phasedRegistrationNames: { | ||
bubbled: 'onScrollShouldSetResponder', | ||
captured: 'onScrollShouldSetResponderCapture' | ||
/** | ||
* On a `touchMove`/`mouseMove`, is it desired that this element become the | ||
* responder? | ||
*/ | ||
moveShouldSetResponder: { | ||
phasedRegistrationNames: { | ||
bubbled: 'onMoveShouldSetResponder', | ||
captured: 'onMoveShouldSetResponderCapture' | ||
}, | ||
dependencies: moveDependencies | ||
}, | ||
dependencies: [TOP_SCROLL] | ||
}, | ||
/** | ||
* Direct responder events dispatched directly to responder. Do not bubble. | ||
*/ | ||
responderStart: { | ||
registrationName: 'onResponderStart', | ||
dependencies: startDependencies | ||
}, | ||
responderMove: { | ||
registrationName: 'onResponderMove', | ||
dependencies: moveDependencies | ||
}, | ||
responderEnd: { | ||
registrationName: 'onResponderEnd', | ||
dependencies: endDependencies | ||
}, | ||
responderRelease: { | ||
registrationName: 'onResponderRelease', | ||
dependencies: endDependencies | ||
}, | ||
responderTerminationRequest: { | ||
registrationName: 'onResponderTerminationRequest', | ||
dependencies: [] | ||
}, | ||
responderGrant: { | ||
registrationName: 'onResponderGrant', | ||
dependencies: [] | ||
}, | ||
responderReject: { | ||
registrationName: 'onResponderReject', | ||
dependencies: [] | ||
}, | ||
responderTerminate: { | ||
registrationName: 'onResponderTerminate', | ||
dependencies: [] | ||
} | ||
}; | ||
/** | ||
* On text selection change, should this element become the responder? This | ||
* is needed for text inputs or other views with native selection, so the | ||
* JS view can claim the responder. | ||
* | ||
* TODO: This shouldn't bubble. | ||
* Responder System: | ||
* ---------------- | ||
* | ||
* - A global, solitary "interaction lock" on a view. | ||
* - If a node becomes the responder, it should convey visual feedback | ||
* immediately to indicate so, either by highlighting or moving accordingly. | ||
* - To be the responder means, that touches are exclusively important to that | ||
* responder view, and no other view. | ||
* - While touches are still occurring, the responder lock can be transferred to | ||
* a new view, but only to increasingly "higher" views (meaning ancestors of | ||
* the current responder). | ||
* | ||
* Responder being granted: | ||
* ------------------------ | ||
* | ||
* - Touch starts, moves, and scrolls can cause an ID to become the responder. | ||
* - We capture/bubble `startShouldSetResponder`/`moveShouldSetResponder` to | ||
* the "appropriate place". | ||
* - If nothing is currently the responder, the "appropriate place" is the | ||
* initiating event's `targetID`. | ||
* - If something *is* already the responder, the "appropriate place" is the | ||
* first common ancestor of the event target and the current `responderInst`. | ||
* - Some negotiation happens: See the timing diagram below. | ||
* - Scrolled views automatically become responder. The reasoning is that a | ||
* platform scroll view that isn't built on top of the responder system has | ||
* began scrolling, and the active responder must now be notified that the | ||
* interaction is no longer locked to it - the system has taken over. | ||
* | ||
* - Responder being released: | ||
* As soon as no more touches that *started* inside of descendants of the | ||
* *current* responderInst, an `onResponderRelease` event is dispatched to the | ||
* current responder, and the responder lock is released. | ||
* | ||
* TODO: | ||
* - on "end", a callback hook for `onResponderEndShouldRemainResponder` that | ||
* determines if the responder lock should remain. | ||
* - If a view shouldn't "remain" the responder, any active touches should by | ||
* default be considered "dead" and do not influence future negotiations or | ||
* bubble paths. It should be as if those touches do not exist. | ||
* -- For multitouch: Usually a translate-z will choose to "remain" responder | ||
* after one out of many touches ended. For translate-y, usually the view | ||
* doesn't wish to "remain" responder after one of many touches end. | ||
* - Consider building this on top of a `stopPropagation` model similar to | ||
* `W3C` events. | ||
* - Ensure that `onResponderTerminate` is called on touch cancels, whether or | ||
* not `onResponderTerminationRequest` returns `true` or `false`. | ||
* | ||
*/ | ||
selectionChangeShouldSetResponder: { | ||
phasedRegistrationNames: { | ||
bubbled: 'onSelectionChangeShouldSetResponder', | ||
captured: 'onSelectionChangeShouldSetResponderCapture' | ||
}, | ||
dependencies: [TOP_SELECTION_CHANGE] | ||
}, | ||
/** | ||
* On a `touchMove`/`mouseMove`, is it desired that this element become the | ||
* responder? | ||
*/ | ||
moveShouldSetResponder: { | ||
phasedRegistrationNames: { | ||
bubbled: 'onMoveShouldSetResponder', | ||
captured: 'onMoveShouldSetResponderCapture' | ||
}, | ||
dependencies: moveDependencies | ||
}, | ||
/* Negotiation Performed | ||
+-----------------------+ | ||
/ \ | ||
Process low level events to + Current Responder + wantsResponderID | ||
determine who to perform negot-| (if any exists at all) | | ||
iation/transition | Otherwise just pass through| | ||
-------------------------------+----------------------------+------------------+ | ||
Bubble to find first ID | | | ||
to return true:wantsResponderID| | | ||
| | | ||
+-------------+ | | | ||
| onTouchStart| | | | ||
+------+------+ none | | | ||
| return| | | ||
+-----------v-------------+true| +------------------------+ | | ||
|onStartShouldSetResponder|----->|onResponderStart (cur) |<-----------+ | ||
+-----------+-------------+ | +------------------------+ | | | ||
| | | +--------+-------+ | ||
| returned true for| false:REJECT +-------->|onResponderReject | ||
| wantsResponderID | | | +----------------+ | ||
| (now attempt | +------------------+-----+ | | ||
| handoff) | | onResponder | | | ||
+------------------->| TerminationRequest| | | ||
| +------------------+-----+ | | ||
| | | +----------------+ | ||
| true:GRANT +-------->|onResponderGrant| | ||
| | +--------+-------+ | ||
| +------------------------+ | | | ||
| | onResponderTerminate |<-----------+ | ||
| +------------------+-----+ | | ||
| | | +----------------+ | ||
| +-------->|onResponderStart| | ||
| | +----------------+ | ||
Bubble to find first ID | | | ||
to return true:wantsResponderID| | | ||
| | | ||
+-------------+ | | | ||
| onTouchMove | | | | ||
+------+------+ none | | | ||
| return| | | ||
+-----------v-------------+true| +------------------------+ | | ||
|onMoveShouldSetResponder |----->|onResponderMove (cur) |<-----------+ | ||
+-----------+-------------+ | +------------------------+ | | | ||
| | | +--------+-------+ | ||
| returned true for| false:REJECT +-------->|onResponderRejec| | ||
| wantsResponderID | | | +----------------+ | ||
| (now attempt | +------------------+-----+ | | ||
| handoff) | | onResponder | | | ||
+------------------->| TerminationRequest| | | ||
| +------------------+-----+ | | ||
| | | +----------------+ | ||
| true:GRANT +-------->|onResponderGrant| | ||
| | +--------+-------+ | ||
| +------------------------+ | | | ||
| | onResponderTerminate |<-----------+ | ||
| +------------------+-----+ | | ||
| | | +----------------+ | ||
| +-------->|onResponderMove | | ||
| | +----------------+ | ||
| | | ||
| | | ||
Some active touch started| | | ||
inside current responder | +------------------------+ | | ||
+------------------------->| onResponderEnd | | | ||
| | +------------------------+ | | ||
+---+---------+ | | | ||
| onTouchEnd | | | | ||
+---+---------+ | | | ||
| | +------------------------+ | | ||
+------------------------->| onResponderEnd | | | ||
No active touches started| +-----------+------------+ | | ||
inside current responder | | | | ||
| v | | ||
| +------------------------+ | | ||
| | onResponderRelease | | | ||
| +------------------------+ | | ||
| | | ||
+ + */ | ||
/** | ||
* Direct responder events dispatched directly to responder. Do not bubble. | ||
* A note about event ordering in the `EventPluginRegistry`. | ||
* | ||
* Suppose plugins are injected in the following order: | ||
* | ||
* `[R, S, C]` | ||
* | ||
* To help illustrate the example, assume `S` is `SimpleEventPlugin` (for | ||
* `onClick` etc) and `R` is `ResponderEventPlugin`. | ||
* | ||
* "Deferred-Dispatched Events": | ||
* | ||
* - The current event plugin system will traverse the list of injected plugins, | ||
* in order, and extract events by collecting the plugin's return value of | ||
* `extractEvents()`. | ||
* - These events that are returned from `extractEvents` are "deferred | ||
* dispatched events". | ||
* - When returned from `extractEvents`, deferred-dispatched events contain an | ||
* "accumulation" of deferred dispatches. | ||
* - These deferred dispatches are accumulated/collected before they are | ||
* returned, but processed at a later time by the `EventPluginRegistry` (hence the | ||
* name deferred). | ||
* | ||
* In the process of returning their deferred-dispatched events, event plugins | ||
* themselves can dispatch events on-demand without returning them from | ||
* `extractEvents`. Plugins might want to do this, so that they can use event | ||
* dispatching as a tool that helps them decide which events should be extracted | ||
* in the first place. | ||
* | ||
* "On-Demand-Dispatched Events": | ||
* | ||
* - On-demand-dispatched events are not returned from `extractEvents`. | ||
* - On-demand-dispatched events are dispatched during the process of returning | ||
* the deferred-dispatched events. | ||
* - They should not have side effects. | ||
* - They should be avoided, and/or eventually be replaced with another | ||
* abstraction that allows event plugins to perform multiple "rounds" of event | ||
* extraction. | ||
* | ||
* Therefore, the sequence of event dispatches becomes: | ||
* | ||
* - `R`s on-demand events (if any) (dispatched by `R` on-demand) | ||
* - `S`s on-demand events (if any) (dispatched by `S` on-demand) | ||
* - `C`s on-demand events (if any) (dispatched by `C` on-demand) | ||
* - `R`s extracted events (if any) (dispatched by `EventPluginRegistry`) | ||
* - `S`s extracted events (if any) (dispatched by `EventPluginRegistry`) | ||
* - `C`s extracted events (if any) (dispatched by `EventPluginRegistry`) | ||
* | ||
* In the case of `ResponderEventPlugin`: If the `startShouldSetResponder` | ||
* on-demand dispatch returns `true` (and some other details are satisfied) the | ||
* `onResponderGrant` deferred dispatched event is returned from | ||
* `extractEvents`. The sequence of dispatch executions in this case | ||
* will appear as follows: | ||
* | ||
* - `startShouldSetResponder` (`ResponderEventPlugin` dispatches on-demand) | ||
* - `touchStartCapture` (`EventPluginRegistry` dispatches as usual) | ||
* - `touchStart` (`EventPluginRegistry` dispatches as usual) | ||
* - `responderGrant/Reject` (`EventPluginRegistry` dispatches as usual) | ||
*/ | ||
responderStart: { | ||
registrationName: 'onResponderStart', | ||
dependencies: startDependencies | ||
}, | ||
responderMove: { | ||
registrationName: 'onResponderMove', | ||
dependencies: moveDependencies | ||
}, | ||
responderEnd: { | ||
registrationName: 'onResponderEnd', | ||
dependencies: endDependencies | ||
}, | ||
responderRelease: { | ||
registrationName: 'onResponderRelease', | ||
dependencies: endDependencies | ||
}, | ||
responderTerminationRequest: { | ||
registrationName: 'onResponderTerminationRequest', | ||
dependencies: [] | ||
}, | ||
responderGrant: { | ||
registrationName: 'onResponderGrant', | ||
dependencies: [] | ||
}, | ||
responderReject: { | ||
registrationName: 'onResponderReject', | ||
dependencies: [] | ||
}, | ||
responderTerminate: { | ||
registrationName: 'onResponderTerminate', | ||
dependencies: [] | ||
} | ||
}; | ||
/** | ||
* | ||
* Responder System: | ||
* ---------------- | ||
* | ||
* - A global, solitary "interaction lock" on a view. | ||
* - If a node becomes the responder, it should convey visual feedback | ||
* immediately to indicate so, either by highlighting or moving accordingly. | ||
* - To be the responder means, that touches are exclusively important to that | ||
* responder view, and no other view. | ||
* - While touches are still occurring, the responder lock can be transferred to | ||
* a new view, but only to increasingly "higher" views (meaning ancestors of | ||
* the current responder). | ||
* | ||
* Responder being granted: | ||
* ------------------------ | ||
* | ||
* - Touch starts, moves, and scrolls can cause an ID to become the responder. | ||
* - We capture/bubble `startShouldSetResponder`/`moveShouldSetResponder` to | ||
* the "appropriate place". | ||
* - If nothing is currently the responder, the "appropriate place" is the | ||
* initiating event's `targetID`. | ||
* - If something *is* already the responder, the "appropriate place" is the | ||
* first common ancestor of the event target and the current `responderInst`. | ||
* - Some negotiation happens: See the timing diagram below. | ||
* - Scrolled views automatically become responder. The reasoning is that a | ||
* platform scroll view that isn't built on top of the responder system has | ||
* began scrolling, and the active responder must now be notified that the | ||
* interaction is no longer locked to it - the system has taken over. | ||
* | ||
* - Responder being released: | ||
* As soon as no more touches that *started* inside of descendants of the | ||
* *current* responderInst, an `onResponderRelease` event is dispatched to the | ||
* current responder, and the responder lock is released. | ||
* | ||
* TODO: | ||
* - on "end", a callback hook for `onResponderEndShouldRemainResponder` that | ||
* determines if the responder lock should remain. | ||
* - If a view shouldn't "remain" the responder, any active touches should by | ||
* default be considered "dead" and do not influence future negotiations or | ||
* bubble paths. It should be as if those touches do not exist. | ||
* -- For multitouch: Usually a translate-z will choose to "remain" responder | ||
* after one out of many touches ended. For translate-y, usually the view | ||
* doesn't wish to "remain" responder after one of many touches end. | ||
* - Consider building this on top of a `stopPropagation` model similar to | ||
* `W3C` events. | ||
* - Ensure that `onResponderTerminate` is called on touch cancels, whether or | ||
* not `onResponderTerminationRequest` returns `true` or `false`. | ||
* | ||
*/ | ||
/* Negotiation Performed | ||
+-----------------------+ | ||
/ \ | ||
Process low level events to + Current Responder + wantsResponderID | ||
determine who to perform negot-| (if any exists at all) | | ||
iation/transition | Otherwise just pass through| | ||
-------------------------------+----------------------------+------------------+ | ||
Bubble to find first ID | | | ||
to return true:wantsResponderID| | | ||
| | | ||
+-------------+ | | | ||
| onTouchStart| | | | ||
+------+------+ none | | | ||
| return| | | ||
+-----------v-------------+true| +------------------------+ | | ||
|onStartShouldSetResponder|----->|onResponderStart (cur) |<-----------+ | ||
+-----------+-------------+ | +------------------------+ | | | ||
| | | +--------+-------+ | ||
| returned true for| false:REJECT +-------->|onResponderReject | ||
| wantsResponderID | | | +----------------+ | ||
| (now attempt | +------------------+-----+ | | ||
| handoff) | | onResponder | | | ||
+------------------->| TerminationRequest| | | ||
| +------------------+-----+ | | ||
| | | +----------------+ | ||
| true:GRANT +-------->|onResponderGrant| | ||
| | +--------+-------+ | ||
| +------------------------+ | | | ||
| | onResponderTerminate |<-----------+ | ||
| +------------------+-----+ | | ||
| | | +----------------+ | ||
| +-------->|onResponderStart| | ||
| | +----------------+ | ||
Bubble to find first ID | | | ||
to return true:wantsResponderID| | | ||
| | | ||
+-------------+ | | | ||
| onTouchMove | | | | ||
+------+------+ none | | | ||
| return| | | ||
+-----------v-------------+true| +------------------------+ | | ||
|onMoveShouldSetResponder |----->|onResponderMove (cur) |<-----------+ | ||
+-----------+-------------+ | +------------------------+ | | | ||
| | | +--------+-------+ | ||
| returned true for| false:REJECT +-------->|onResponderRejec| | ||
| wantsResponderID | | | +----------------+ | ||
| (now attempt | +------------------+-----+ | | ||
| handoff) | | onResponder | | | ||
+------------------->| TerminationRequest| | | ||
| +------------------+-----+ | | ||
| | | +----------------+ | ||
| true:GRANT +-------->|onResponderGrant| | ||
| | +--------+-------+ | ||
| +------------------------+ | | | ||
| | onResponderTerminate |<-----------+ | ||
| +------------------+-----+ | | ||
| | | +----------------+ | ||
| +-------->|onResponderMove | | ||
| | +----------------+ | ||
| | | ||
| | | ||
Some active touch started| | | ||
inside current responder | +------------------------+ | | ||
+------------------------->| onResponderEnd | | | ||
| | +------------------------+ | | ||
+---+---------+ | | | ||
| onTouchEnd | | | | ||
+---+---------+ | | | ||
| | +------------------------+ | | ||
+------------------------->| onResponderEnd | | | ||
No active touches started| +-----------+------------+ | | ||
inside current responder | | | | ||
| v | | ||
| +------------------------+ | | ||
| | onResponderRelease | | | ||
| +------------------------+ | | ||
| | | ||
+ + */ | ||
function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) { | ||
var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder : topLevelType === TOP_SELECTION_CHANGE ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder; // TODO: stop one short of the current responder. | ||
/** | ||
* A note about event ordering in the `EventPluginHub`. | ||
* | ||
* Suppose plugins are injected in the following order: | ||
* | ||
* `[R, S, C]` | ||
* | ||
* To help illustrate the example, assume `S` is `SimpleEventPlugin` (for | ||
* `onClick` etc) and `R` is `ResponderEventPlugin`. | ||
* | ||
* "Deferred-Dispatched Events": | ||
* | ||
* - The current event plugin system will traverse the list of injected plugins, | ||
* in order, and extract events by collecting the plugin's return value of | ||
* `extractEvents()`. | ||
* - These events that are returned from `extractEvents` are "deferred | ||
* dispatched events". | ||
* - When returned from `extractEvents`, deferred-dispatched events contain an | ||
* "accumulation" of deferred dispatches. | ||
* - These deferred dispatches are accumulated/collected before they are | ||
* returned, but processed at a later time by the `EventPluginHub` (hence the | ||
* name deferred). | ||
* | ||
* In the process of returning their deferred-dispatched events, event plugins | ||
* themselves can dispatch events on-demand without returning them from | ||
* `extractEvents`. Plugins might want to do this, so that they can use event | ||
* dispatching as a tool that helps them decide which events should be extracted | ||
* in the first place. | ||
* | ||
* "On-Demand-Dispatched Events": | ||
* | ||
* - On-demand-dispatched events are not returned from `extractEvents`. | ||
* - On-demand-dispatched events are dispatched during the process of returning | ||
* the deferred-dispatched events. | ||
* - They should not have side effects. | ||
* - They should be avoided, and/or eventually be replaced with another | ||
* abstraction that allows event plugins to perform multiple "rounds" of event | ||
* extraction. | ||
* | ||
* Therefore, the sequence of event dispatches becomes: | ||
* | ||
* - `R`s on-demand events (if any) (dispatched by `R` on-demand) | ||
* - `S`s on-demand events (if any) (dispatched by `S` on-demand) | ||
* - `C`s on-demand events (if any) (dispatched by `C` on-demand) | ||
* - `R`s extracted events (if any) (dispatched by `EventPluginHub`) | ||
* - `S`s extracted events (if any) (dispatched by `EventPluginHub`) | ||
* - `C`s extracted events (if any) (dispatched by `EventPluginHub`) | ||
* | ||
* In the case of `ResponderEventPlugin`: If the `startShouldSetResponder` | ||
* on-demand dispatch returns `true` (and some other details are satisfied) the | ||
* `onResponderGrant` deferred dispatched event is returned from | ||
* `extractEvents`. The sequence of dispatch executions in this case | ||
* will appear as follows: | ||
* | ||
* - `startShouldSetResponder` (`ResponderEventPlugin` dispatches on-demand) | ||
* - `touchStartCapture` (`EventPluginHub` dispatches as usual) | ||
* - `touchStart` (`EventPluginHub` dispatches as usual) | ||
* - `responderGrant/Reject` (`EventPluginHub` dispatches as usual) | ||
*/ | ||
var bubbleShouldSetFrom = !responderInst ? targetInst : getLowestCommonAncestor(responderInst, targetInst); // When capturing/bubbling the "shouldSet" event, we want to skip the target | ||
// (deepest ID) if it happens to be the current responder. The reasoning: | ||
// It's strange to get an `onMoveShouldSetResponder` when you're *already* | ||
// the responder. | ||
function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) { | ||
var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder : topLevelType === TOP_SELECTION_CHANGE ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder; // TODO: stop one short of the current responder. | ||
var skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst; | ||
var shouldSetEvent = ResponderSyntheticEvent.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); | ||
shouldSetEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
var bubbleShouldSetFrom = !responderInst ? targetInst : getLowestCommonAncestor(responderInst, targetInst); // When capturing/bubbling the "shouldSet" event, we want to skip the target | ||
// (deepest ID) if it happens to be the current responder. The reasoning: | ||
// It's strange to get an `onMoveShouldSetResponder` when you're *already* | ||
// the responder. | ||
if (skipOverBubbleShouldSetFrom) { | ||
accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent); | ||
} else { | ||
accumulateTwoPhaseDispatches(shouldSetEvent); | ||
} | ||
var skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst; | ||
var shouldSetEvent = ResponderSyntheticEvent.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); | ||
shouldSetEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
var wantsResponderInst = executeDispatchesInOrderStopAtTrue(shouldSetEvent); | ||
if (skipOverBubbleShouldSetFrom) { | ||
accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent); | ||
} else { | ||
accumulateTwoPhaseDispatches(shouldSetEvent); | ||
} | ||
if (!shouldSetEvent.isPersistent()) { | ||
shouldSetEvent.constructor.release(shouldSetEvent); | ||
} | ||
var wantsResponderInst = executeDispatchesInOrderStopAtTrue(shouldSetEvent); | ||
if (!wantsResponderInst || wantsResponderInst === responderInst) { | ||
return null; | ||
} | ||
if (!shouldSetEvent.isPersistent()) { | ||
shouldSetEvent.constructor.release(shouldSetEvent); | ||
} | ||
var extracted; | ||
var grantEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); | ||
grantEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(grantEvent); | ||
var blockHostResponder = executeDirectDispatch(grantEvent) === true; | ||
if (!wantsResponderInst || wantsResponderInst === responderInst) { | ||
return null; | ||
} | ||
if (responderInst) { | ||
var terminationRequestEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); | ||
terminationRequestEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(terminationRequestEvent); | ||
var shouldSwitch = !hasDispatches(terminationRequestEvent) || executeDirectDispatch(terminationRequestEvent); | ||
var extracted; | ||
var grantEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); | ||
grantEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(grantEvent); | ||
var blockHostResponder = executeDirectDispatch(grantEvent) === true; | ||
if (!terminationRequestEvent.isPersistent()) { | ||
terminationRequestEvent.constructor.release(terminationRequestEvent); | ||
} | ||
if (responderInst) { | ||
var terminationRequestEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); | ||
terminationRequestEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(terminationRequestEvent); | ||
var shouldSwitch = !hasDispatches(terminationRequestEvent) || executeDirectDispatch(terminationRequestEvent); | ||
if (!terminationRequestEvent.isPersistent()) { | ||
terminationRequestEvent.constructor.release(terminationRequestEvent); | ||
if (shouldSwitch) { | ||
var terminateEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); | ||
terminateEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(terminateEvent); | ||
extracted = accumulate(extracted, [grantEvent, terminateEvent]); | ||
changeResponder(wantsResponderInst, blockHostResponder); | ||
} else { | ||
var rejectEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); | ||
rejectEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(rejectEvent); | ||
extracted = accumulate(extracted, rejectEvent); | ||
} | ||
} else { | ||
extracted = accumulate(extracted, grantEvent); | ||
changeResponder(wantsResponderInst, blockHostResponder); | ||
} | ||
if (shouldSwitch) { | ||
var terminateEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); | ||
terminateEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(terminateEvent); | ||
extracted = accumulate(extracted, [grantEvent, terminateEvent]); | ||
changeResponder(wantsResponderInst, blockHostResponder); | ||
} else { | ||
var rejectEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); | ||
rejectEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(rejectEvent); | ||
extracted = accumulate(extracted, rejectEvent); | ||
} | ||
} else { | ||
extracted = accumulate(extracted, grantEvent); | ||
changeResponder(wantsResponderInst, blockHostResponder); | ||
return extracted; | ||
} | ||
/** | ||
* A transfer is a negotiation between a currently set responder and the next | ||
* element to claim responder status. Any start event could trigger a transfer | ||
* of responderInst. Any move event could trigger a transfer. | ||
* | ||
* @param {string} topLevelType Record from `BrowserEventConstants`. | ||
* @return {boolean} True if a transfer of responder could possibly occur. | ||
*/ | ||
return extracted; | ||
} | ||
/** | ||
* A transfer is a negotiation between a currently set responder and the next | ||
* element to claim responder status. Any start event could trigger a transfer | ||
* of responderInst. Any move event could trigger a transfer. | ||
* | ||
* @param {string} topLevelType Record from `BrowserEventConstants`. | ||
* @return {boolean} True if a transfer of responder could possibly occur. | ||
*/ | ||
function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) { | ||
return topLevelInst && ( // responderIgnoreScroll: We are trying to migrate away from specifically | ||
// tracking native scroll events here and responderIgnoreScroll indicates we | ||
// will send topTouchCancel to handle canceling touch events instead | ||
topLevelType === TOP_SCROLL && !nativeEvent.responderIgnoreScroll || trackedTouchCount > 0 && topLevelType === TOP_SELECTION_CHANGE || isStartish(topLevelType) || isMoveish(topLevelType)); | ||
} | ||
/** | ||
* Returns whether or not this touch end event makes it such that there are no | ||
* longer any touches that started inside of the current `responderInst`. | ||
* | ||
* @param {NativeEvent} nativeEvent Native touch end event. | ||
* @return {boolean} Whether or not this touch end event ends the responder. | ||
*/ | ||
function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) { | ||
return topLevelInst && ( // responderIgnoreScroll: We are trying to migrate away from specifically | ||
// tracking native scroll events here and responderIgnoreScroll indicates we | ||
// will send topTouchCancel to handle canceling touch events instead | ||
topLevelType === TOP_SCROLL && !nativeEvent.responderIgnoreScroll || trackedTouchCount > 0 && topLevelType === TOP_SELECTION_CHANGE || isStartish(topLevelType) || isMoveish(topLevelType)); | ||
} | ||
/** | ||
* Returns whether or not this touch end event makes it such that there are no | ||
* longer any touches that started inside of the current `responderInst`. | ||
* | ||
* @param {NativeEvent} nativeEvent Native touch end event. | ||
* @return {boolean} Whether or not this touch end event ends the responder. | ||
*/ | ||
function noResponderTouches(nativeEvent) { | ||
var touches = nativeEvent.touches; | ||
function noResponderTouches(nativeEvent) { | ||
var touches = nativeEvent.touches; | ||
if (!touches || touches.length === 0) { | ||
return true; | ||
} | ||
if (!touches || touches.length === 0) { | ||
return true; | ||
} | ||
for (var i = 0; i < touches.length; i++) { | ||
var activeTouch = touches[i]; | ||
var target = activeTouch.target; | ||
for (var i = 0; i < touches.length; i++) { | ||
var activeTouch = touches[i]; | ||
var target = activeTouch.target; | ||
if (target !== null && target !== undefined && target !== 0) { | ||
// Is the original touch location inside of the current responder? | ||
var targetInst = getInstanceFromNode(target); | ||
if (target !== null && target !== undefined && target !== 0) { | ||
// Is the original touch location inside of the current responder? | ||
var targetInst = getInstanceFromNode$1(target); | ||
if (isAncestor(responderInst, targetInst)) { | ||
return false; | ||
if (isAncestor(responderInst, targetInst)) { | ||
return false; | ||
} | ||
} | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
var ResponderEventPlugin = { | ||
/* For unit testing only */ | ||
_getResponder: function () { | ||
return responderInst; | ||
}, | ||
eventTypes: eventTypes, | ||
var ResponderEventPlugin = { | ||
/* For unit testing only */ | ||
_getResponder: function () { | ||
return responderInst; | ||
}, | ||
eventTypes: eventTypes, | ||
/** | ||
* We must be resilient to `targetInst` being `null` on `touchMove` or | ||
* `touchEnd`. On certain platforms, this means that a native scroll has | ||
* assumed control and the original touch targets are destroyed. | ||
*/ | ||
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { | ||
if (isStartish(topLevelType)) { | ||
trackedTouchCount += 1; | ||
} else if (isEndish(topLevelType)) { | ||
if (trackedTouchCount >= 0) { | ||
trackedTouchCount -= 1; | ||
} else { | ||
{ | ||
warn('Ended a touch event which was not counted in `trackedTouchCount`.'); | ||
} | ||
/** | ||
* We must be resilient to `targetInst` being `null` on `touchMove` or | ||
* `touchEnd`. On certain platforms, this means that a native scroll has | ||
* assumed control and the original touch targets are destroyed. | ||
*/ | ||
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { | ||
if (isStartish(topLevelType)) { | ||
trackedTouchCount += 1; | ||
} else if (isEndish(topLevelType)) { | ||
if (trackedTouchCount >= 0) { | ||
trackedTouchCount -= 1; | ||
} else { | ||
console.warn('Ended a touch event which was not counted in `trackedTouchCount`.'); | ||
return null; | ||
return null; | ||
} | ||
} | ||
} | ||
ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent); | ||
var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null; // Responder may or may not have transferred on a new touch start/move. | ||
// Regardless, whoever is the responder after any potential transfer, we | ||
// direct all touch start/move/ends to them in the form of | ||
// `onResponderMove/Start/End`. These will be called for *every* additional | ||
// finger that move/start/end, dispatched directly to whoever is the | ||
// current responder at that moment, until the responder is "released". | ||
// | ||
// These multiple individual change touch events are are always bookended | ||
// by `onResponderGrant`, and one of | ||
// (`onResponderRelease/onResponderTerminate`). | ||
ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent); | ||
var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null; // Responder may or may not have transferred on a new touch start/move. | ||
// Regardless, whoever is the responder after any potential transfer, we | ||
// direct all touch start/move/ends to them in the form of | ||
// `onResponderMove/Start/End`. These will be called for *every* additional | ||
// finger that move/start/end, dispatched directly to whoever is the | ||
// current responder at that moment, until the responder is "released". | ||
// | ||
// These multiple individual change touch events are are always bookended | ||
// by `onResponderGrant`, and one of | ||
// (`onResponderRelease/onResponderTerminate`). | ||
var isResponderTouchStart = responderInst && isStartish(topLevelType); | ||
var isResponderTouchMove = responderInst && isMoveish(topLevelType); | ||
var isResponderTouchEnd = responderInst && isEndish(topLevelType); | ||
var incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; | ||
var isResponderTouchStart = responderInst && isStartish(topLevelType); | ||
var isResponderTouchMove = responderInst && isMoveish(topLevelType); | ||
var isResponderTouchEnd = responderInst && isEndish(topLevelType); | ||
var incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; | ||
if (incrementalTouch) { | ||
var gesture = ResponderSyntheticEvent.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); | ||
gesture.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(gesture); | ||
extracted = accumulate(extracted, gesture); | ||
} | ||
if (incrementalTouch) { | ||
var gesture = ResponderSyntheticEvent.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); | ||
gesture.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(gesture); | ||
extracted = accumulate(extracted, gesture); | ||
} | ||
var isResponderTerminate = responderInst && topLevelType === TOP_TOUCH_CANCEL; | ||
var isResponderRelease = responderInst && !isResponderTerminate && isEndish(topLevelType) && noResponderTouches(nativeEvent); | ||
var finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; | ||
var isResponderTerminate = responderInst && topLevelType === TOP_TOUCH_CANCEL; | ||
var isResponderRelease = responderInst && !isResponderTerminate && isEndish(topLevelType) && noResponderTouches(nativeEvent); | ||
var finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; | ||
if (finalTouch) { | ||
var finalEvent = ResponderSyntheticEvent.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); | ||
finalEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(finalEvent); | ||
extracted = accumulate(extracted, finalEvent); | ||
changeResponder(null); | ||
} | ||
if (finalTouch) { | ||
var finalEvent = ResponderSyntheticEvent.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); | ||
finalEvent.touchHistory = ResponderTouchHistoryStore.touchHistory; | ||
accumulateDirectDispatches(finalEvent); | ||
extracted = accumulate(extracted, finalEvent); | ||
changeResponder(null); | ||
} | ||
return extracted; | ||
}, | ||
GlobalResponderHandler: null, | ||
injection: { | ||
/** | ||
* @param {{onChange: (ReactID, ReactID) => void} GlobalResponderHandler | ||
* Object that handles any change in responder. Use this to inject | ||
* integration with an existing touch handling system etc. | ||
*/ | ||
injectGlobalResponderHandler: function (GlobalResponderHandler) { | ||
ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; | ||
return extracted; | ||
}, | ||
GlobalResponderHandler: null, | ||
injection: { | ||
/** | ||
* @param {{onChange: (ReactID, ReactID) => void} GlobalResponderHandler | ||
* Object that handles any change in responder. Use this to inject | ||
* integration with an existing touch handling system etc. | ||
*/ | ||
injectGlobalResponderHandler: function (GlobalResponderHandler) { | ||
ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; | ||
} | ||
} | ||
} | ||
}; | ||
}; | ||
// Keep in sync with ReactDOM.js, ReactTestUtils.js, and ReactTestUtilsAct.js: | ||
// Keep in sync with ReactDOM.js, ReactTestUtils.js, and ReactTestUtilsAct.js: | ||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events; | ||
var getInstanceFromNode = _ReactDOM$__SECRET_IN[0]; | ||
var getNodeFromInstance = _ReactDOM$__SECRET_IN[1]; | ||
var getFiberCurrentPropsFromNode = _ReactDOM$__SECRET_IN[2]; | ||
var injectEventPluginsByName = _ReactDOM$__SECRET_IN[3]; | ||
setComponentTree(getFiberCurrentPropsFromNode, getInstanceFromNode, getNodeFromInstance); | ||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events, | ||
getInstanceFromNode$1 = _ReactDOM$__SECRET_IN[0], | ||
getNodeFromInstance$1 = _ReactDOM$__SECRET_IN[1], | ||
getFiberCurrentPropsFromNode$1 = _ReactDOM$__SECRET_IN[2], | ||
injectEventPluginsByName = _ReactDOM$__SECRET_IN[3]; | ||
setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1); | ||
var ReactDOMUnstableNativeDependencies = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
ResponderEventPlugin: ResponderEventPlugin, | ||
ResponderTouchHistoryStore: ResponderTouchHistoryStore, | ||
injectEventPluginsByName: injectEventPluginsByName | ||
}); | ||
var ReactDOMUnstableNativeDependencies = Object.freeze({ | ||
ResponderEventPlugin: ResponderEventPlugin, | ||
ResponderTouchHistoryStore: ResponderTouchHistoryStore, | ||
injectEventPluginsByName: injectEventPluginsByName | ||
}); | ||
var unstableNativeDependencies = ReactDOMUnstableNativeDependencies; | ||
var unstableNativeDependencies = ReactDOMUnstableNativeDependencies; | ||
return unstableNativeDependencies; | ||
return unstableNativeDependencies; | ||
}))); |
@@ -1,2 +0,2 @@ | ||
/** @license React v16.12.0 | ||
/** @license React v16.13.0 | ||
* react-dom-unstable-native-dependencies.production.min.js | ||
@@ -9,22 +9,21 @@ * | ||
*/ | ||
'use strict';(function(l,p){"object"===typeof exports&&"undefined"!==typeof module?module.exports=p(require("react-dom"),require("react")):"function"===typeof define&&define.amd?define(["react-dom","react"],p):l.ReactDOMUnstableNativeDependencies=p(l.ReactDOM,l.React)})(this,function(l,p){function x(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."} | ||
function M(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))throw Error(x(103));a.currentTarget=b?N(c):null;b=b?b(a):null;a.currentTarget=null;a._dispatchListeners=null;a._dispatchInstances=null;return b}function t(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}function O(a,b,c){for(var f=[];a;)f.push(a),a=t(a);for(a=f.length;0<a--;)b(f[a],"captured",c);for(a=0;a<f.length;a++)b(f[a],"bubbled",c)}function C(a,b){if(null==b)throw Error(x(30));if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a, | ||
b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}function v(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}function P(a,b){var c=a.stateNode;if(!c)return null;var f=Q(c);if(!f)return null;c=f[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":(f=!f.disabled)||(a=a.type,f=!("button"===a||"input"=== | ||
a||"select"===a||"textarea"===a));a=!f;break a;default:a=!1}if(a)return null;if(c&&"function"!==typeof c)throw Error(x(231,b,typeof c));return c}function R(a,b,c){if(b=P(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=C(c._dispatchListeners,b),c._dispatchInstances=C(c._dispatchInstances,a)}function Y(a){a&&a.dispatchConfig.phasedRegistrationNames&&O(a._targetInst,R,a)}function Z(a){if(a&&a.dispatchConfig.phasedRegistrationNames){var b=a._targetInst;b=b?t(b):null;O(b,R,a)}}function y(a){if(a&& | ||
a.dispatchConfig.registrationName){var b=a._targetInst;if(b&&a&&a.dispatchConfig.registrationName){var c=P(b,a.dispatchConfig.registrationName);c&&(a._dispatchListeners=C(a._dispatchListeners,c),a._dispatchInstances=C(a._dispatchInstances,b))}}}function D(){return!0}function E(){return!1}function z(a,b,c,f){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var d in a)a.hasOwnProperty(d)&&((b=a[d])?this[d]=b(c):"target"===d?this.target=f:this[d]=c[d]);this.isDefaultPrevented= | ||
(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?D:E;this.isPropagationStopped=E;return this}function aa(a,b,c,f){if(this.eventPool.length){var d=this.eventPool.pop();this.call(d,a,b,c,f);return d}return new this(a,b,c,f)}function ba(a){if(!(a instanceof this))throw Error(x(279));a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}function S(a){a.eventPool=[];a.getPooled=aa;a.release=ba}function A(a){return"touchstart"===a||"mousedown"===a}function F(a){return"touchmove"=== | ||
a||"mousemove"===a}function G(a){return"touchend"===a||"touchcancel"===a||"mouseup"===a}function h(a){return a.timeStamp||a.timestamp}function J(a){a=a.identifier;if(null==a)throw Error(x(138));return a}function ca(a){var b=J(a),c=q[b];c?(c.touchActive=!0,c.startPageX=a.pageX,c.startPageY=a.pageY,c.startTimeStamp=h(a),c.currentPageX=a.pageX,c.currentPageY=a.pageY,c.currentTimeStamp=h(a),c.previousPageX=a.pageX,c.previousPageY=a.pageY,c.previousTimeStamp=h(a)):(c={touchActive:!0,startPageX:a.pageX, | ||
startPageY:a.pageY,startTimeStamp:h(a),currentPageX:a.pageX,currentPageY:a.pageY,currentTimeStamp:h(a),previousPageX:a.pageX,previousPageY:a.pageY,previousTimeStamp:h(a)},q[b]=c);r.mostRecentTimeStamp=h(a)}function da(a){var b=q[J(a)];b?(b.touchActive=!0,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=h(a),r.mostRecentTimeStamp=h(a)):console.warn("Cannot record touch move without a touch start.\nTouch Move: %s\n", | ||
"Touch Bank: %s",T(a),U())}function ea(a){var b=q[J(a)];b?(b.touchActive=!1,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=h(a),r.mostRecentTimeStamp=h(a)):console.warn("Cannot record touch end without a touch start.\nTouch End: %s\n","Touch Bank: %s",T(a),U())}function T(a){return JSON.stringify({identifier:a.identifier,pageX:a.pageX,pageY:a.pageY,timestamp:h(a)})}function U(){var a= | ||
JSON.stringify(q.slice(0,20));20<q.length&&(a+=" (original size: "+q.length+")");return a}function B(a,b){if(null==b)throw Error(x(334));return null==a?b:Array.isArray(a)?a.concat(b):Array.isArray(b)?[a].concat(b):[a,b]}var Q=null,V=null,N=null,K=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign;K(z.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented= | ||
D)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=D)},persist:function(){this.isPersistent=D},isPersistent:E,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=E;this._dispatchInstances=this._dispatchListeners=null}});z.Interface={type:null, | ||
target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};z.extend=function(a){function b(){return c.apply(this,arguments)}var c=this,f=function(){};f.prototype=c.prototype;f=new f;K(f,b.prototype);b.prototype=f;b.prototype.constructor=b;b.Interface=K({},c.Interface,a);b.extend=c.extend;S(b);return b};S(z);var w=z.extend({touchHistory:function(a){return null}});p=["touchstart", | ||
"mousedown"];var W=["touchmove","mousemove"],X=["touchcancel","touchend","mouseup"],q=[],r={touchBank:q,numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0},u={recordTouchTrack:function(a,b){if(F(a))b.changedTouches.forEach(da);else if(A(a))b.changedTouches.forEach(ca),r.numberActiveTouches=b.touches.length,1===r.numberActiveTouches&&(r.indexOfSingleActiveTouch=b.touches[0].identifier);else if(G(a)&&(b.changedTouches.forEach(ea),r.numberActiveTouches=b.touches.length,1===r.numberActiveTouches))for(a= | ||
0;a<q.length;a++)if(b=q[a],null!=b&&b.touchActive){r.indexOfSingleActiveTouch=a;break}},touchHistory:r},k=null,H=0,L=function(a,b){var c=k;k=a;if(null!==I.GlobalResponderHandler)I.GlobalResponderHandler.onChange(c,a,b)},m={startShouldSetResponder:{phasedRegistrationNames:{bubbled:"onStartShouldSetResponder",captured:"onStartShouldSetResponderCapture"},dependencies:p},scrollShouldSetResponder:{phasedRegistrationNames:{bubbled:"onScrollShouldSetResponder",captured:"onScrollShouldSetResponderCapture"}, | ||
dependencies:["scroll"]},selectionChangeShouldSetResponder:{phasedRegistrationNames:{bubbled:"onSelectionChangeShouldSetResponder",captured:"onSelectionChangeShouldSetResponderCapture"},dependencies:["selectionchange"]},moveShouldSetResponder:{phasedRegistrationNames:{bubbled:"onMoveShouldSetResponder",captured:"onMoveShouldSetResponderCapture"},dependencies:W},responderStart:{registrationName:"onResponderStart",dependencies:p},responderMove:{registrationName:"onResponderMove",dependencies:W},responderEnd:{registrationName:"onResponderEnd", | ||
dependencies:X},responderRelease:{registrationName:"onResponderRelease",dependencies:X},responderTerminationRequest:{registrationName:"onResponderTerminationRequest",dependencies:[]},responderGrant:{registrationName:"onResponderGrant",dependencies:[]},responderReject:{registrationName:"onResponderReject",dependencies:[]},responderTerminate:{registrationName:"onResponderTerminate",dependencies:[]}},I={_getResponder:function(){return k},eventTypes:m,extractEvents:function(a,b,c,f,d){if(A(a))H+=1;else if(G(a))if(0<= | ||
H)--H;else return console.warn("Ended a touch event which was not counted in `trackedTouchCount`."),null;u.recordTouchTrack(a,c);if(b&&("scroll"===a&&!c.responderIgnoreScroll||0<H&&"selectionchange"===a||A(a)||F(a))){d=A(a)?m.startShouldSetResponder:F(a)?m.moveShouldSetResponder:"selectionchange"===a?m.selectionChangeShouldSetResponder:m.scrollShouldSetResponder;if(k)b:{var e=k;for(var g=0,h=e;h;h=t(h))g++;h=0;for(var l=b;l;l=t(l))h++;for(;0<g-h;)e=t(e),g--;for(;0<h-g;)b=t(b),h--;for(;g--;){if(e=== | ||
b||e===b.alternate)break b;e=t(e);b=t(b)}e=null}else e=b;b=e===k;e=w.getPooled(d,e,c,f);e.touchHistory=u.touchHistory;b?v(e,Z):v(e,Y);b:{d=e._dispatchListeners;b=e._dispatchInstances;if(Array.isArray(d))for(g=0;g<d.length&&!e.isPropagationStopped();g++){if(d[g](e,b[g])){d=b[g];break b}}else if(d&&d(e,b)){d=b;break b}d=null}e._dispatchInstances=null;e._dispatchListeners=null;e.isPersistent()||e.constructor.release(e);if(d&&d!==k)if(e=w.getPooled(m.responderGrant,d,c,f),e.touchHistory=u.touchHistory, | ||
v(e,y),b=!0===M(e),k)if(g=w.getPooled(m.responderTerminationRequest,k,c,f),g.touchHistory=u.touchHistory,v(g,y),h=!g._dispatchListeners||M(g),g.isPersistent()||g.constructor.release(g),h){g=w.getPooled(m.responderTerminate,k,c,f);g.touchHistory=u.touchHistory;v(g,y);var n=B(n,[e,g]);L(d,b)}else d=w.getPooled(m.responderReject,d,c,f),d.touchHistory=u.touchHistory,v(d,y),n=B(n,d);else n=B(n,e),L(d,b);else n=null}else n=null;d=k&&A(a);e=k&&F(a);b=k&&G(a);if(d=d?m.responderStart:e?m.responderMove:b?m.responderEnd: | ||
null)d=w.getPooled(d,k,c,f),d.touchHistory=u.touchHistory,v(d,y),n=B(n,d);d=k&&"touchcancel"===a;if(a=k&&!d&&G(a))a:{if((a=c.touches)&&0!==a.length)for(e=0;e<a.length;e++)if(b=a[e].target,null!==b&&void 0!==b&&0!==b){g=V(b);b:{for(b=k;g;){if(b===g||b===g.alternate){b=!0;break b}g=t(g)}b=!1}if(b){a=!1;break a}}a=!0}if(a=d?m.responderTerminate:a?m.responderRelease:null)c=w.getPooled(a,k,c,f),c.touchHistory=u.touchHistory,v(c,y),n=B(n,c),L(null);return n},GlobalResponderHandler:null,injection:{injectGlobalResponderHandler:function(a){I.GlobalResponderHandler= | ||
a}}};l=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events;p=l[3];(function(a,b,c){Q=a;V=b;N=c})(l[2],l[0],l[1]);return{ResponderEventPlugin:I,ResponderTouchHistoryStore:u,injectEventPluginsByName:p}}); | ||
'use strict';(function(h,p){"object"===typeof exports&&"undefined"!==typeof module?module.exports=p(require("react-dom"),require("react")):"function"===typeof define&&define.amd?define(["react-dom","react"],p):(h=h||self,h.ReactDOMUnstableNativeDependencies=p(h.ReactDOM,h.React))})(this,function(h,p){function x(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+ | ||
b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function M(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))throw Error(x(103));a.currentTarget=b?N(c):null;b=b?b(a):null;a.currentTarget=null;a._dispatchListeners=null;a._dispatchInstances=null;return b}function r(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}function O(a,b,c){for(var f=[];a;)f.push(a),a=r(a);for(a=f.length;0<a--;)b(f[a],"captured",c); | ||
for(a=0;a<f.length;a++)b(f[a],"bubbled",c)}function P(a,b){var c=a.stateNode;if(!c)return null;var f=Q(c);if(!f)return null;c=f[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(f=!f.disabled)||(a=a.type,f=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!f;break a;default:a=!1}if(a)return null; | ||
if(c&&"function"!==typeof c)throw Error(x(231,b,typeof c));return c}function C(a,b){if(null==b)throw Error(x(30));if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}function u(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}function R(a,b,c){if(b=P(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=C(c._dispatchListeners,b),c._dispatchInstances=C(c._dispatchInstances,a)}function W(a){a&& | ||
a.dispatchConfig.phasedRegistrationNames&&O(a._targetInst,R,a)}function X(a){if(a&&a.dispatchConfig.phasedRegistrationNames){var b=a._targetInst;b=b?r(b):null;O(b,R,a)}}function y(a){if(a&&a.dispatchConfig.registrationName){var b=a._targetInst;if(b&&a&&a.dispatchConfig.registrationName){var c=P(b,a.dispatchConfig.registrationName);c&&(a._dispatchListeners=C(a._dispatchListeners,c),a._dispatchInstances=C(a._dispatchInstances,b))}}}function D(){return!0}function E(){return!1}function z(a,b,c,f){this.dispatchConfig= | ||
a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var d in a)a.hasOwnProperty(d)&&((b=a[d])?this[d]=b(c):"target"===d?this.target=f:this[d]=c[d]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?D:E;this.isPropagationStopped=E;return this}function Y(a,b,c,f){if(this.eventPool.length){var d=this.eventPool.pop();this.call(d,a,b,c,f);return d}return new this(a,b,c,f)}function Z(a){if(!(a instanceof this))throw Error(x(279));a.destructor(); | ||
10>this.eventPool.length&&this.eventPool.push(a)}function S(a){a.eventPool=[];a.getPooled=Y;a.release=Z}function A(a){return"touchstart"===a||"mousedown"===a}function F(a){return"touchmove"===a||"mousemove"===a}function G(a){return"touchend"===a||"touchcancel"===a||"mouseup"===a}function l(a){return a.timeStamp||a.timestamp}function J(a){a=a.identifier;if(null==a)throw Error(x(138));return a}function aa(a){var b=J(a),c=v[b];c?(c.touchActive=!0,c.startPageX=a.pageX,c.startPageY=a.pageY,c.startTimeStamp= | ||
l(a),c.currentPageX=a.pageX,c.currentPageY=a.pageY,c.currentTimeStamp=l(a),c.previousPageX=a.pageX,c.previousPageY=a.pageY,c.previousTimeStamp=l(a)):(c={touchActive:!0,startPageX:a.pageX,startPageY:a.pageY,startTimeStamp:l(a),currentPageX:a.pageX,currentPageY:a.pageY,currentTimeStamp:l(a),previousPageX:a.pageX,previousPageY:a.pageY,previousTimeStamp:l(a)},v[b]=c);q.mostRecentTimeStamp=l(a)}function ba(a){var b=v[J(a)];b&&(b.touchActive=!0,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY, | ||
b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=l(a),q.mostRecentTimeStamp=l(a))}function ca(a){var b=v[J(a)];b&&(b.touchActive=!1,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=l(a),q.mostRecentTimeStamp=l(a))}function B(a,b){if(null==b)throw Error(x(334));return null==a?b:Array.isArray(a)?a.concat(b):Array.isArray(b)?[a].concat(b): | ||
[a,b]}var Q=null,T=null,N=null,K=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign;K(z.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=D)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=D)},persist:function(){this.isPersistent= | ||
D},isPersistent:E,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=E;this._dispatchInstances=this._dispatchListeners=null}});z.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};z.extend=function(a){function b(){return c.apply(this, | ||
arguments)}var c=this,f=function(){};f.prototype=c.prototype;f=new f;K(f,b.prototype);b.prototype=f;b.prototype.constructor=b;b.Interface=K({},c.Interface,a);b.extend=c.extend;S(b);return b};S(z);var w=z.extend({touchHistory:function(a){return null}});p=["touchstart","mousedown"];var U=["touchmove","mousemove"],V=["touchcancel","touchend","mouseup"],v=[],q={touchBank:v,numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0},t={recordTouchTrack:function(a,b){if(F(a))b.changedTouches.forEach(ba); | ||
else if(A(a))b.changedTouches.forEach(aa),q.numberActiveTouches=b.touches.length,1===q.numberActiveTouches&&(q.indexOfSingleActiveTouch=b.touches[0].identifier);else if(G(a)&&(b.changedTouches.forEach(ca),q.numberActiveTouches=b.touches.length,1===q.numberActiveTouches))for(a=0;a<v.length;a++)if(b=v[a],null!=b&&b.touchActive){q.indexOfSingleActiveTouch=a;break}},touchHistory:q},k=null,H=0,L=function(a,b){var c=k;k=a;if(null!==I.GlobalResponderHandler)I.GlobalResponderHandler.onChange(c,a,b)},m={startShouldSetResponder:{phasedRegistrationNames:{bubbled:"onStartShouldSetResponder", | ||
captured:"onStartShouldSetResponderCapture"},dependencies:p},scrollShouldSetResponder:{phasedRegistrationNames:{bubbled:"onScrollShouldSetResponder",captured:"onScrollShouldSetResponderCapture"},dependencies:["scroll"]},selectionChangeShouldSetResponder:{phasedRegistrationNames:{bubbled:"onSelectionChangeShouldSetResponder",captured:"onSelectionChangeShouldSetResponderCapture"},dependencies:["selectionchange"]},moveShouldSetResponder:{phasedRegistrationNames:{bubbled:"onMoveShouldSetResponder",captured:"onMoveShouldSetResponderCapture"}, | ||
dependencies:U},responderStart:{registrationName:"onResponderStart",dependencies:p},responderMove:{registrationName:"onResponderMove",dependencies:U},responderEnd:{registrationName:"onResponderEnd",dependencies:V},responderRelease:{registrationName:"onResponderRelease",dependencies:V},responderTerminationRequest:{registrationName:"onResponderTerminationRequest",dependencies:[]},responderGrant:{registrationName:"onResponderGrant",dependencies:[]},responderReject:{registrationName:"onResponderReject", | ||
dependencies:[]},responderTerminate:{registrationName:"onResponderTerminate",dependencies:[]}},I={_getResponder:function(){return k},eventTypes:m,extractEvents:function(a,b,c,f,d){if(A(a))H+=1;else if(G(a))if(0<=H)--H;else return null;t.recordTouchTrack(a,c);if(b&&("scroll"===a&&!c.responderIgnoreScroll||0<H&&"selectionchange"===a||A(a)||F(a))){d=A(a)?m.startShouldSetResponder:F(a)?m.moveShouldSetResponder:"selectionchange"===a?m.selectionChangeShouldSetResponder:m.scrollShouldSetResponder;if(k)b:{var e= | ||
k;for(var g=0,h=e;h;h=r(h))g++;h=0;for(var l=b;l;l=r(l))h++;for(;0<g-h;)e=r(e),g--;for(;0<h-g;)b=r(b),h--;for(;g--;){if(e===b||e===b.alternate)break b;e=r(e);b=r(b)}e=null}else e=b;b=e===k;e=w.getPooled(d,e,c,f);e.touchHistory=t.touchHistory;b?u(e,X):u(e,W);b:{d=e._dispatchListeners;b=e._dispatchInstances;if(Array.isArray(d))for(g=0;g<d.length&&!e.isPropagationStopped();g++){if(d[g](e,b[g])){d=b[g];break b}}else if(d&&d(e,b)){d=b;break b}d=null}e._dispatchInstances=null;e._dispatchListeners=null; | ||
e.isPersistent()||e.constructor.release(e);if(d&&d!==k)if(e=w.getPooled(m.responderGrant,d,c,f),e.touchHistory=t.touchHistory,u(e,y),b=!0===M(e),k)if(g=w.getPooled(m.responderTerminationRequest,k,c,f),g.touchHistory=t.touchHistory,u(g,y),h=!g._dispatchListeners||M(g),g.isPersistent()||g.constructor.release(g),h){g=w.getPooled(m.responderTerminate,k,c,f);g.touchHistory=t.touchHistory;u(g,y);var n=B(n,[e,g]);L(d,b)}else d=w.getPooled(m.responderReject,d,c,f),d.touchHistory=t.touchHistory,u(d,y),n=B(n, | ||
d);else n=B(n,e),L(d,b);else n=null}else n=null;d=k&&A(a);e=k&&F(a);b=k&&G(a);if(d=d?m.responderStart:e?m.responderMove:b?m.responderEnd:null)d=w.getPooled(d,k,c,f),d.touchHistory=t.touchHistory,u(d,y),n=B(n,d);d=k&&"touchcancel"===a;if(a=k&&!d&&G(a))a:{if((a=c.touches)&&0!==a.length)for(e=0;e<a.length;e++)if(b=a[e].target,null!==b&&void 0!==b&&0!==b){g=T(b);b:{for(b=k;g;){if(b===g||b===g.alternate){b=!0;break b}g=r(g)}b=!1}if(b){a=!1;break a}}a=!0}if(a=d?m.responderTerminate:a?m.responderRelease: | ||
null)c=w.getPooled(a,k,c,f),c.touchHistory=t.touchHistory,u(c,y),n=B(n,c),L(null);return n},GlobalResponderHandler:null,injection:{injectGlobalResponderHandler:function(a){I.GlobalResponderHandler=a}}};h=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events;p=h[3];(function(a,b,c){Q=a;T=b;N=c})(h[2],h[0],h[1]);return{__proto__:null,ResponderEventPlugin:I,ResponderTouchHistoryStore:t,injectEventPluginsByName:p}}); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
11
22
3000758
40
60396
+ Addedscheduler@0.19.1(transitive)
- Removedscheduler@0.18.0(transitive)
Updatedscheduler@^0.19.0