From dbfeb4d604785c58fe73bb15fe9ca9a85e7ca5d5 Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 7 Oct 2019 18:20:25 +0200 Subject: [PATCH] chore(build): update --- dist/ReactGraph.js | 18583 ++++++++++++++++++++++++------------------- 1 file changed, 10375 insertions(+), 8208 deletions(-) diff --git a/dist/ReactGraph.js b/dist/ReactGraph.js index aefd01ab..beb2dbb3 100644 --- a/dist/ReactGraph.js +++ b/dist/ReactGraph.js @@ -1864,6 +1864,7 @@ var store = React.useContext(Context); var mapStateRef = React.useRef(mapState); var stateRef = React.useRef(); + var mountedRef = React.useRef(true); var subscriptionMapStateError = React.useRef(); var _useReducer = React.useReducer(function (s) { @@ -1907,12 +1908,17 @@ subscriptionMapStateError.current = err; } - forceRender({}); + if (mountedRef.current) { + forceRender({}); + } }; var unsubscribe = store.subscribe(checkMapState); checkMapState(); - return unsubscribe; + return function () { + mountedRef.current = false; + unsubscribe(); + }; }, []); return stateRef.current; }; @@ -2582,12 +2588,13 @@ var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { - keys.push.apply(keys, Object.getOwnPropertySymbols(object)); + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); } - if (enumerableOnly) keys = keys.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); return keys; } @@ -2672,6 +2679,10 @@ } function _iterableToArrayLimit(arr, i) { + if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { + return; + } + var _arr = []; var _n = true; var _d = false; @@ -3748,8 +3759,7 @@ var reI = "\\s*([+-]?\\d+)\\s*", reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", - reHex3 = /^#([0-9a-f]{3})$/, - reHex6 = /^#([0-9a-f]{6})$/, + reHex = /^#([0-9a-f]{3,8})$/, reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), @@ -3909,29 +3919,46 @@ }; define(Color, color, { + copy: function(channels) { + return Object.assign(new this.constructor, this, channels); + }, displayable: function() { return this.rgb().displayable(); }, - hex: function() { - return this.rgb().hex(); - }, - toString: function() { - return this.rgb() + ""; - } + hex: color_formatHex, // Deprecated! Use color.formatHex. + formatHex: color_formatHex, + formatHsl: color_formatHsl, + formatRgb: color_formatRgb, + toString: color_formatRgb }); + function color_formatHex() { + return this.rgb().formatHex(); + } + + function color_formatHsl() { + return hslConvert(this).formatHsl(); + } + + function color_formatRgb() { + return this.rgb().formatRgb(); + } + function color(format) { - var m; + var m, l; format = (format + "").trim().toLowerCase(); - return (m = reHex3.exec(format)) ? (m = parseInt(m[1], 16), new Rgb((m >> 8 & 0xf) | (m >> 4 & 0x0f0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1)) // #f00 - : (m = reHex6.exec(format)) ? rgbn(parseInt(m[1], 16)) // #ff0000 + return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000 + : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00 + : l === 8 ? new Rgb(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 + : l === 4 ? new Rgb((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000 + : null) // invalid hex : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) - : named.hasOwnProperty(format) ? rgbn(named[format]) + : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null; } @@ -3981,19 +4008,25 @@ && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1); }, - hex: function() { - return "#" + hex(this.r) + hex(this.g) + hex(this.b); - }, - toString: function() { - var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "rgb(" : "rgba(") - + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " - + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " - + Math.max(0, Math.min(255, Math.round(this.b) || 0)) - + (a === 1 ? ")" : ", " + a + ")"); - } + hex: rgb_formatHex, // Deprecated! Use color.formatHex. + formatHex: rgb_formatHex, + formatRgb: rgb_formatRgb, + toString: rgb_formatRgb })); + function rgb_formatHex() { + return "#" + hex(this.r) + hex(this.g) + hex(this.b); + } + + function rgb_formatRgb() { + var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); + return (a === 1 ? "rgb(" : "rgba(") + + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + + (a === 1 ? ")" : ", " + a + ")"); + } + function hex(value) { value = Math.max(0, Math.min(255, Math.round(value) || 0)); return (value < 16 ? "0" : "") + value.toString(16); @@ -4069,6 +4102,14 @@ return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1); + }, + formatHsl: function() { + var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); + return (a === 1 ? "hsl(" : "hsla(") + + (this.h || 0) + ", " + + (this.s || 0) * 100 + "%, " + + (this.l || 0) * 100 + "%" + + (a === 1 ? ")" : ", " + a + ")"); } })); @@ -4080,179 +4121,6 @@ : m1) * 255; } - var deg2rad = Math.PI / 180; - var rad2deg = 180 / Math.PI; - - // https://observablehq.com/@mbostock/lab-and-rgb - var K = 18, - Xn = 0.96422, - Yn = 1, - Zn = 0.82521, - t0 = 4 / 29, - t1 = 6 / 29, - t2 = 3 * t1 * t1, - t3 = t1 * t1 * t1; - - function labConvert(o) { - if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity); - if (o instanceof Hcl) return hcl2lab(o); - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = rgb2lrgb(o.r), - g = rgb2lrgb(o.g), - b = rgb2lrgb(o.b), - y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z; - if (r === g && g === b) x = z = y; else { - x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn); - z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn); - } - return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity); - } - - function lab(l, a, b, opacity) { - return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity); - } - - function Lab(l, a, b, opacity) { - this.l = +l; - this.a = +a; - this.b = +b; - this.opacity = +opacity; - } - - define(Lab, lab, extend(Color, { - brighter: function(k) { - return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity); - }, - darker: function(k) { - return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity); - }, - rgb: function() { - var y = (this.l + 16) / 116, - x = isNaN(this.a) ? y : y + this.a / 500, - z = isNaN(this.b) ? y : y - this.b / 200; - x = Xn * lab2xyz(x); - y = Yn * lab2xyz(y); - z = Zn * lab2xyz(z); - return new Rgb( - lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z), - lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z), - lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z), - this.opacity - ); - } - })); - - function xyz2lab(t) { - return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0; - } - - function lab2xyz(t) { - return t > t1 ? t * t * t : t2 * (t - t0); - } - - function lrgb2rgb(x) { - return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055); - } - - function rgb2lrgb(x) { - return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); - } - - function hclConvert(o) { - if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity); - if (!(o instanceof Lab)) o = labConvert(o); - if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity); - var h = Math.atan2(o.b, o.a) * rad2deg; - return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity); - } - - function hcl(h, c, l, opacity) { - return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity); - } - - function Hcl(h, c, l, opacity) { - this.h = +h; - this.c = +c; - this.l = +l; - this.opacity = +opacity; - } - - function hcl2lab(o) { - if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity); - var h = o.h * deg2rad; - return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity); - } - - define(Hcl, hcl, extend(Color, { - brighter: function(k) { - return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity); - }, - darker: function(k) { - return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity); - }, - rgb: function() { - return hcl2lab(this).rgb(); - } - })); - - var A = -0.14861, - B = +1.78277, - C = -0.29227, - D = -0.90649, - E = +1.97294, - ED = E * D, - EB = E * B, - BC_DA = B * C - D * A; - - function cubehelixConvert(o) { - if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Rgb)) o = rgbConvert(o); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), - bl = b - l, - k = (E * (g - l) - C * bl) / D, - s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1 - h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN; - return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity); - } - - function cubehelix(h, s, l, opacity) { - return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity); - } - - function Cubehelix(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; - } - - define(Cubehelix, cubehelix, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Cubehelix(this.h, this.s, this.l * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Cubehelix(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function() { - var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad, - l = +this.l, - a = isNaN(this.s) ? 0 : this.s * l * (1 - l), - cosh = Math.cos(h), - sinh = Math.sin(h); - return new Rgb( - 255 * (l + a * (A * cosh + B * sinh)), - 255 * (l + a * (C * cosh + D * sinh)), - 255 * (l + a * (E * cosh)), - this.opacity - ); - } - })); - function constant$1(x) { return function() { return x; @@ -5455,10 +5323,6 @@ return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } - var pi = Math.PI; - - var tau = 2 * Math.PI; - var defaultTiming = { time: null, // Set on use. delay: 0, @@ -5568,20 +5432,20 @@ // Ignore right-click, since that should open the context menu. function defaultFilter() { - return !event.button; + return !event.ctrlKey && !event.button; } function defaultExtent() { - var e = this, w, h; + var e = this; if (e instanceof SVGElement) { e = e.ownerSVGElement || e; - w = e.width.baseVal.value; - h = e.height.baseVal.value; - } else { - w = e.clientWidth; - h = e.clientHeight; + if (e.hasAttribute("viewBox")) { + e = e.viewBox.baseVal; + return [[e.x, e.y], [e.x + e.width, e.y + e.height]]; + } + return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]; } - return [[0, 0], [w, h]]; + return [[0, 0], [e.clientWidth, e.clientHeight]]; } function defaultTransform() { @@ -5589,11 +5453,11 @@ } function defaultWheelDelta() { - return -event.deltaY * (event.deltaMode ? 120 : 1) / 500; + return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002); } function defaultTouchable() { - return "ontouchstart" in this; + return navigator.maxTouchPoints || ("ontouchstart" in this); } function defaultConstrain(transform, extent, translateExtent) { @@ -5617,7 +5481,6 @@ translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], duration = 250, interpolate = interpolateZoom, - gestures = [], listeners = dispatch("start", "zoom", "end"), touchstarting, touchending, @@ -5639,11 +5502,11 @@ .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); } - zoom.transform = function(collection, transform) { + zoom.transform = function(collection, transform, point) { var selection = collection.selection ? collection.selection() : collection; selection.property("__zoom", defaultTransform); if (collection !== selection) { - schedule(collection, transform); + schedule(collection, transform, point); } else { selection.interrupt().each(function() { gesture(this, arguments) @@ -5654,23 +5517,23 @@ } }; - zoom.scaleBy = function(selection, k) { + zoom.scaleBy = function(selection, k, p) { zoom.scaleTo(selection, function() { var k0 = this.__zoom.k, k1 = typeof k === "function" ? k.apply(this, arguments) : k; return k0 * k1; - }); + }, p); }; - zoom.scaleTo = function(selection, k) { + zoom.scaleTo = function(selection, k, p) { zoom.transform(selection, function() { var e = extent.apply(this, arguments), t0 = this.__zoom, - p0 = centroid(e), + p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p, p1 = t0.invert(p0), k1 = typeof k === "function" ? k.apply(this, arguments) : k; return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent); - }); + }, p); }; zoom.translateBy = function(selection, x, y) { @@ -5682,16 +5545,16 @@ }); }; - zoom.translateTo = function(selection, x, y) { + zoom.translateTo = function(selection, x, y, p) { zoom.transform(selection, function() { var e = extent.apply(this, arguments), t = this.__zoom, - p = centroid(e); - return constrain(identity$1.translate(p[0], p[1]).scale(t.k).translate( + p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p; + return constrain(identity$1.translate(p0[0], p0[1]).scale(t.k).translate( typeof x === "function" ? -x.apply(this, arguments) : -x, typeof y === "function" ? -y.apply(this, arguments) : -y ), e, translateExtent); - }); + }, p); }; function scale(transform, k) { @@ -5708,7 +5571,7 @@ return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2]; } - function schedule(transition, transform, center) { + function schedule(transition, transform, point) { transition .on("start.zoom", function() { gesture(this, arguments).start(); }) .on("interrupt.zoom end.zoom", function() { gesture(this, arguments).end(); }) @@ -5717,7 +5580,7 @@ args = arguments, g = gesture(that, args), e = extent.apply(that, args), - p = center || centroid(e), + p = point == null ? centroid(e) : typeof point === "function" ? point.apply(that, args) : point, w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]), a = that.__zoom, b = typeof transform === "function" ? transform.apply(that, args) : transform, @@ -5730,27 +5593,22 @@ }); } - function gesture(that, args) { - for (var i = 0, n = gestures.length, g; i < n; ++i) { - if ((g = gestures[i]).that === that) { - return g; - } - } - return new Gesture(that, args); + function gesture(that, args, clean) { + return (!clean && that.__zooming) || new Gesture(that, args); } function Gesture(that, args) { this.that = that; this.args = args; - this.index = -1; this.active = 0; this.extent = extent.apply(that, args); + this.taps = 0; } Gesture.prototype = { start: function() { if (++this.active === 1) { - this.index = gestures.push(this) - 1; + this.that.__zooming = this; this.emit("start"); } return this; @@ -5765,8 +5623,7 @@ }, end: function() { if (--this.active === 0) { - gestures.splice(this.index, 1); - this.index = -1; + delete this.that.__zooming; this.emit("end"); } return this; @@ -5814,7 +5671,7 @@ function mousedowned() { if (touchending || !filter.apply(this, arguments)) return; - var g = gesture(this, arguments), + var g = gesture(this, arguments, true), v = select(event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), p = mouse(this), x0 = event.clientX, @@ -5858,44 +5715,37 @@ function touchstarted() { if (!filter.apply(this, arguments)) return; - var g = gesture(this, arguments), - touches = event.changedTouches, - started, - n = touches.length, i, t, p; + var touches = event.touches, + n = touches.length, + g = gesture(this, arguments, event.changedTouches.length === n), + started, i, t, p; nopropagation(); for (i = 0; i < n; ++i) { t = touches[i], p = touch(this, touches, t.identifier); p = [p, this.__zoom.invert(p), t.identifier]; - if (!g.touch0) g.touch0 = p, started = true; - else if (!g.touch1) g.touch1 = p; + if (!g.touch0) g.touch0 = p, started = true, g.taps = 1 + !!touchstarting; + else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0; } - // If this is a dbltap, reroute to the (optional) dblclick.zoom handler. - if (touchstarting) { - touchstarting = clearTimeout(touchstarting); - if (!g.touch1) { - g.end(); - p = select(this).on("dblclick.zoom"); - if (p) p.apply(this, arguments); - return; - } - } + if (touchstarting) touchstarting = clearTimeout(touchstarting); if (started) { - touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay); + if (g.taps < 2) touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay); interrupt(this); g.start(); } } function touchmoved() { + if (!this.__zooming) return; var g = gesture(this, arguments), touches = event.changedTouches, n = touches.length, i, t, p, l; noevent$1(); if (touchstarting) touchstarting = clearTimeout(touchstarting); + g.taps = 0; for (i = 0; i < n; ++i) { t = touches[i], p = touch(this, touches, t.identifier); if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p; @@ -5917,6 +5767,7 @@ } function touchended() { + if (!this.__zooming) return; var g = gesture(this, arguments), touches = event.changedTouches, n = touches.length, i, t; @@ -5931,7 +5782,14 @@ } if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1; if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]); - else g.end(); + else { + g.end(); + // If this was a dbltap, reroute to the (optional) dblclick.zoom handler. + if (g.taps === 2) { + var p = select(this).on("dblclick.zoom"); + if (p) p.apply(this, arguments); + } + } } zoom.wheelDelta = function(_) { @@ -5984,13 +5842,15 @@ // do not edit .js files directly - edit src/index.jst + + var fastDeepEqual = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; - var length, i, key, keys; + var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; @@ -6013,7 +5873,7 @@ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { - key = keys[i]; + var key = keys[i]; if (!equal(a[key], b[key])) return false; } @@ -6159,7 +6019,7 @@ }); }; var removeElements = function removeElements(elements, elementsToRemove) { - var nodeIdsToRemove = elementsToRemove.filter(isNode).map(function (n) { + var nodeIdsToRemove = elementsToRemove.map(function (n) { return n.id; }); return elements.filter(function (e) { @@ -6263,7 +6123,11 @@ return n.id; }); return edges.filter(function (e) { - return nodeIds.includes(e.source) || nodeIds.includes(e.target); + var hasSourceHandleId = e.source.includes('__'); + var hasTargetHandleId = e.target.includes('__'); + var sourceId = hasSourceHandleId ? e.source.split('__')[0] : e.source; + var targetId = hasTargetHandleId ? e.target.split('__')[0] : e.target; + return nodeIds.includes(sourceId) || nodeIds.includes(targetId); }); }; var fitView = function fitView() { @@ -6427,8 +6291,8 @@ var sourceHandleY = sourceHandle ? sourceHandle.y + sourceHandle.height / 2 : sourceNode.__rg.height; var sourceX = sourceNode.__rg.position.x + sourceHandleX; var sourceY = sourceNode.__rg.position.y + sourceHandleY; - var targetX = props.connectionPositionX * (1 / props.transform[2]) - props.transform[0] * (1 / props.transform[2]); - var targetY = props.connectionPositionY * (1 / props.transform[2]) - props.transform[1] * (1 / props.transform[2]); + var targetX = (props.connectionPositionX - props.transform[0]) * (1 / props.transform[2]); + var targetY = (props.connectionPositionY - props.transform[1]) * (1 / props.transform[2]); var dAttr = ''; if (props.connectionLineType === 'bezier') { @@ -6854,20 +6718,19 @@ }; var scheduler_production_min = createCommonjsModule(function (module, exports) { - Object.defineProperty(exports,"__esModule",{value:!0});var d=void 0,e=void 0,g=void 0,m=void 0,n=void 0;exports.unstable_now=void 0;exports.unstable_forceFrameRate=void 0; - if("undefined"===typeof window||"function"!==typeof MessageChannel){var p=null,q=null,r=function(){if(null!==p)try{var a=exports.unstable_now();p(!0,a);p=null;}catch(b){throw setTimeout(r,0),b;}};exports.unstable_now=function(){return Date.now()};d=function(a){null!==p?setTimeout(d,0,a):(p=a,setTimeout(r,0));};e=function(a,b){q=setTimeout(a,b);};g=function(){clearTimeout(q);};m=function(){return !1};n=exports.unstable_forceFrameRate=function(){};}else{var t=window.performance,u=window.Date,v=window.setTimeout, - w=window.clearTimeout,x=window.requestAnimationFrame,y=window.cancelAnimationFrame;"undefined"!==typeof console&&("function"!==typeof x&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));exports.unstable_now="object"===typeof t&& - "function"===typeof t.now?function(){return t.now()}:function(){return u.now()};var z=!1,A=null,B=-1,C=-1,D=33.33,E=-1,F=-1,G=0,H=!1;m=function(){return exports.unstable_now()>=G};n=function(){};exports.unstable_forceFrameRate=function(a){0>a||125D&&(D=8.33));F=c;}E=a;G=a+D;I.postMessage(null);}};d=function(a){A=a;z||(z=!0,x(function(a){L(a);}));};e=function(a,b){C=v(function(){a(exports.unstable_now());},b);};g=function(){w(C); - C=-1;};}var M=null,N=null,O=null,P=3,Q=!1,R=!1,S=!1; - function T(a,b){var c=a.next;if(c===a)M=null;else{a===M&&(M=c);var f=a.previous;f.next=c;c.previous=f;}a.next=a.previous=null;c=a.callback;f=P;var l=O;P=a.priorityLevel;O=a;try{var h=a.expirationTime<=b;switch(P){case 1:var k=c(h);break;case 2:k=c(h);break;case 3:k=c(h);break;case 4:k=c(h);break;case 5:k=c(h);}}catch(Z){throw Z;}finally{P=f,O=l;}if("function"===typeof k)if(b=a.expirationTime,a.callback=k,null===M)M=a.next=a.previous=a;else{k=null;h=M;do{if(b<=h.expirationTime){k=h;break}h=h.next;}while(h!== - M);null===k?k=M:k===M&&(M=a);b=k.previous;b.next=k.previous=a;a.next=k;a.previous=b;}}function U(a){if(null!==N&&N.startTime<=a){do{var b=N,c=b.next;if(b===c)N=null;else{N=c;var f=b.previous;f.next=c;c.previous=f;}b.next=b.previous=null;V(b,b.expirationTime);}while(null!==N&&N.startTime<=a)}}function W(a){S=!1;U(a);R||(null!==M?(R=!0,d(X)):null!==N&&e(W,N.startTime-a));} - function X(a,b){R=!1;S&&(S=!1,g());U(b);Q=!0;try{if(!a)for(;null!==M&&M.expirationTime<=b;)T(M,b),b=exports.unstable_now(),U(b);else if(null!==M){do T(M,b),b=exports.unstable_now(),U(b);while(null!==M&&!m())}if(null!==M)return !0;null!==N&&e(W,N.startTime-b);return !1}finally{Q=!1;}}function Y(a){switch(a){case 1:return -1;case 2:return 250;case 5:return 1073741823;case 4:return 1E4;default:return 5E3}} - function V(a,b){if(null===M)M=a.next=a.previous=a;else{var c=null,f=M;do{if(bf){c=l;if(null===N)N=a.next=a.previous=a;else{b=null;var h=N;do{if(c=H};l=function(){};exports.unstable_forceFrameRate=function(a){0>a||125L(n,c))void 0!==r&&0>L(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>L(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function L(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var O=[],P=[],Q=1,R=null,S=3,T=!1,U=!1,V=!1; + function W(a){for(var b=M(P);null!==b;){if(null===b.callback)N(P);else if(b.startTime<=a)N(P),b.sortIndex=b.expirationTime,K(O,b);else break;b=M(P);}}function X(a){V=!1;W(a);if(!U)if(null!==M(O))U=!0,f(Y);else{var b=M(P);null!==b&&g(X,b.startTime-a);}} + function Y(a,b){U=!1;V&&(V=!1,h());T=!0;var c=S;try{W(b);for(R=M(O);null!==R&&(!(R.expirationTime>b)||a&&!k());){var d=R.callback;if(null!==d){R.callback=null;S=R.priorityLevel;var e=d(R.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?R.callback=e:R===M(O)&&N(O);W(b);}else N(O);R=M(O);}if(null!==R)var m=!0;else{var n=M(P);null!==n&&g(X,n.startTime-b);m=!1;}return m}finally{R=null,S=c,T=!1;}} + function Z(a){switch(a){case 1:return -1;case 2:return 250;case 5:return 1073741823;case 4:return 1E4;default:return 5E3}}var aa=l;exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3;}var c=S;S=a;try{return b()}finally{S=c;}}; + exports.unstable_next=function(a){switch(S){case 1:case 2:case 3:var b=3;break;default:b=S;}var c=S;S=b;try{return a()}finally{S=c;}}; + exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();if("object"===typeof c&&null!==c){var e=c.delay;e="number"===typeof e&&0d?(a.sortIndex=e,K(P,a),null===M(O)&&a===M(P)&&(V?h():V=!0,g(X,e-d))):(a.sortIndex=c,K(O,a),U||T||(U=!0,f(Y)));return a};exports.unstable_cancelCallback=function(a){a.callback=null;}; + exports.unstable_wrapCallback=function(a){var b=S;return function(){var c=S;S=b;try{return a.apply(this,arguments)}finally{S=c;}}};exports.unstable_getCurrentPriorityLevel=function(){return S};exports.unstable_shouldYield=function(){var a=exports.unstable_now();W(a);var b=M(O);return b!==R&&null!==R&&null!==b&&null!==b.callback&&b.startTime<=a&&b.expirationTime 120. + 5 ; var frameDeadline = 0; - var fpsLocked = false; - { // `isInputPending` is not available. Since we have no way of knowing if // there's pending input, always yield at the end of the frame. shouldYieldToHost = function () { return exports.unstable_now() >= frameDeadline; - }; + }; // Since we yield every frame regardless, `requestPaint` has no effect. + - // Since we yield every frame regardless, `requestPaint` has no effect. requestPaint = function () {}; } @@ -7025,34 +6892,45 @@ console.error('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported'); return; } + if (fps > 0) { frameLength = Math.floor(1000 / fps); - fpsLocked = true; } else { // reset the framerate frameLength = 33.33; - fpsLocked = false; } }; var performWorkUntilDeadline = function () { { if (scheduledHostCallback !== null) { - var _currentTime = exports.unstable_now(); - var _hasTimeRemaining = frameDeadline - _currentTime > 0; + var currentTime = exports.unstable_now(); // Yield after `frameLength` ms, regardless of where we are in the vsync + // cycle. This means there's always time remaining at the beginning of + // the message event. + + frameDeadline = currentTime + frameLength; + var hasTimeRemaining = true; + try { - var _hasMoreWork = scheduledHostCallback(_hasTimeRemaining, _currentTime); - if (!_hasMoreWork) { + var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); + + if (!hasMoreWork) { + isMessageLoopRunning = false; scheduledHostCallback = null; + } else { + // If there's more work, schedule the next message event at the end + // of the preceding one. + port.postMessage(null); } } catch (error) { // If a scheduler task throws, exit the current browser task so the - // error can be observed, and post a new task as soon as possible - // so we can continue where we left off. + // error can be observed. port.postMessage(null); throw error; } - } + } else { + isMessageLoopRunning = false; + } // Yielding to the browser will give it a chance to paint, so we can } }; @@ -7060,101 +6938,13 @@ var port = channel.port2; channel.port1.onmessage = performWorkUntilDeadline; - var onAnimationFrame = function (rAFTime) { - if (scheduledHostCallback === null) { - // No scheduled work. Exit. - prevRAFTime = -1; - prevRAFInterval = -1; - isRAFLoopRunning = false; - return; - } - - // Eagerly schedule the next animation callback at the beginning of the - // frame. If the scheduler queue is not empty at the end of the frame, it - // will continue flushing inside that callback. If the queue *is* empty, - // then it will exit immediately. Posting the callback at the start of the - // frame ensures it's fired within the earliest possible frame. If we - // waited until the end of the frame to post the callback, we risk the - // browser skipping a frame and not firing the callback until the frame - // after that. - isRAFLoopRunning = true; - requestAnimationFrame(function (nextRAFTime) { - _clearTimeout(rAFTimeoutID); - onAnimationFrame(nextRAFTime); - }); - - // requestAnimationFrame is throttled when the tab is backgrounded. We - // don't want to stop working entirely. So we'll fallback to a timeout loop. - // TODO: Need a better heuristic for backgrounded work. - var onTimeout = function () { - frameDeadline = exports.unstable_now() + frameLength / 2; - performWorkUntilDeadline(); - rAFTimeoutID = _setTimeout(onTimeout, frameLength * 3); - }; - rAFTimeoutID = _setTimeout(onTimeout, frameLength * 3); - - if (prevRAFTime !== -1 && - // Make sure this rAF time is different from the previous one. This check - // could fail if two rAFs fire in the same frame. - rAFTime - prevRAFTime > 0.1) { - var rAFInterval = rAFTime - prevRAFTime; - if (!fpsLocked && prevRAFInterval !== -1) { - // We've observed two consecutive frame intervals. We'll use this to - // dynamically adjust the frame rate. - // - // If one frame goes long, then the next one can be short to catch up. - // If two frames are short in a row, then that's an indication that we - // actually have a higher frame rate than what we're currently - // optimizing. For example, if we're running on 120hz display or 90hz VR - // display. Take the max of the two in case one of them was an anomaly - // due to missed frame deadlines. - if (rAFInterval < frameLength && prevRAFInterval < frameLength) { - frameLength = rAFInterval < prevRAFInterval ? prevRAFInterval : rAFInterval; - if (frameLength < 8.33) { - // Defensive coding. We don't support higher frame rates than 120hz. - // If the calculated frame length gets lower than 8, it is probably - // a bug. - frameLength = 8.33; - } - } - } - prevRAFInterval = rAFInterval; - } - prevRAFTime = rAFTime; - frameDeadline = rAFTime + frameLength; - - // We use the postMessage trick to defer idle work until after the repaint. - port.postMessage(null); - }; - requestHostCallback = function (callback) { scheduledHostCallback = callback; - { - if (!isRAFLoopRunning) { - // Start a rAF loop. - isRAFLoopRunning = true; - requestAnimationFrame(function (rAFTime) { - if (requestIdleCallbackBeforeFirstFrame$1) { - cancelIdleCallback(idleCallbackID); - } - onAnimationFrame(rAFTime); - }); - // If we just missed the last vsync, the next rAF might not happen for - // another frame. To claim as much idle time as possible, post a - // callback with `requestIdleCallback`, which should fire if there's - // idle time left in the frame. - // - // This should only be an issue for the first rAF in the loop; - // subsequent rAFs are scheduled at the beginning of the - // preceding frame. - var idleCallbackID = void 0; - if (requestIdleCallbackBeforeFirstFrame$1) { - idleCallbackID = requestIdleCallback(function onIdleCallbackBeforeFirstFrame() { - frameDeadline = exports.unstable_now() + frameLength; - performWorkUntilDeadline(); - }); - } + { + if (!isMessageLoopRunning) { + isMessageLoopRunning = true; + port.postMessage(null); } } }; @@ -7167,178 +6957,307 @@ cancelHostTimeout = function () { _clearTimeout(taskTimeoutID); + taskTimeoutID = -1; }; } - /* eslint-disable no-var */ + function push(heap, node) { + var index = heap.length; + heap.push(node); + siftUp(heap, node, index); + } + function peek(heap) { + var first = heap[0]; + return first === undefined ? null : first; + } + function pop(heap) { + var first = heap[0]; + + if (first !== undefined) { + var last = heap.pop(); + + if (last !== first) { + heap[0] = last; + siftDown(heap, last, 0); + } + + return first; + } else { + return null; + } + } + + function siftUp(heap, node, i) { + var index = i; + + while (true) { + var parentIndex = Math.floor((index - 1) / 2); + var parent = heap[parentIndex]; + + if (parent !== undefined && compare(parent, node) > 0) { + // The parent is larger. Swap positions. + heap[parentIndex] = node; + heap[index] = parent; + index = parentIndex; + } else { + // The parent is smaller. Exit. + return; + } + } + } + + function siftDown(heap, node, i) { + var index = i; + var length = heap.length; + + while (index < length) { + var leftIndex = (index + 1) * 2 - 1; + var left = heap[leftIndex]; + var rightIndex = leftIndex + 1; + var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those. + + if (left !== undefined && compare(left, node) < 0) { + if (right !== undefined && compare(right, left) < 0) { + heap[index] = right; + heap[rightIndex] = node; + index = rightIndex; + } else { + heap[index] = left; + heap[leftIndex] = node; + index = leftIndex; + } + } else if (right !== undefined && compare(right, node) < 0) { + heap[index] = right; + heap[rightIndex] = node; + index = rightIndex; + } else { + // Neither child is smaller. Exit. + return; + } + } + } + + function compare(a, b) { + // Compare sort index first, then task id. + var diff = a.sortIndex - b.sortIndex; + return diff !== 0 ? diff : a.id - b.id; + } // TODO: Use symbols? + var NoPriority = 0; var ImmediatePriority = 1; var UserBlockingPriority = 2; var NormalPriority = 3; var LowPriority = 4; var IdlePriority = 5; - // Max 31 bit integer. The max integer size in V8 for 32-bit systems. + var runIdCounter = 0; + var mainThreadIdCounter = 0; + var profilingStateSize = 4; + var sharedProfilingBuffer = // $FlowFixMe Flow doesn't know about SharedArrayBuffer + typeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer + typeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9 + ; + var profilingState = sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks + + var PRIORITY = 0; + var CURRENT_TASK_ID = 1; + var CURRENT_RUN_ID = 2; + var QUEUE_SIZE = 3; + + { + profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue + // array might include canceled tasks. + + profilingState[QUEUE_SIZE] = 0; + profilingState[CURRENT_TASK_ID] = 0; + } // Bytes per element is 4 + + + var INITIAL_EVENT_LOG_SIZE = 131072; + var MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes + + var eventLogSize = 0; + var eventLogBuffer = null; + var eventLog = null; + var eventLogIndex = 0; + var TaskStartEvent = 1; + var TaskCompleteEvent = 2; + var TaskErrorEvent = 3; + var TaskCancelEvent = 4; + var TaskRunEvent = 5; + var TaskYieldEvent = 6; + var SchedulerSuspendEvent = 7; + var SchedulerResumeEvent = 8; + + function logEvent(entries) { + if (eventLog !== null) { + var offset = eventLogIndex; + eventLogIndex += entries.length; + + if (eventLogIndex + 1 > eventLogSize) { + eventLogSize *= 2; + + if (eventLogSize > MAX_EVENT_LOG_SIZE) { + console.error("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.'); + stopLoggingProfilingEvents(); + return; + } + + var newEventLog = new Int32Array(eventLogSize * 4); + newEventLog.set(eventLog); + eventLogBuffer = newEventLog.buffer; + eventLog = newEventLog; + } + + eventLog.set(entries, offset); + } + } + + function startLoggingProfilingEvents() { + eventLogSize = INITIAL_EVENT_LOG_SIZE; + eventLogBuffer = new ArrayBuffer(eventLogSize * 4); + eventLog = new Int32Array(eventLogBuffer); + eventLogIndex = 0; + } + function stopLoggingProfilingEvents() { + var buffer = eventLogBuffer; + eventLogSize = 0; + eventLogBuffer = null; + eventLog = null; + eventLogIndex = 0; + return buffer; + } + function markTaskStart(task, time) { + { + profilingState[QUEUE_SIZE]++; + + if (eventLog !== null) { + logEvent([TaskStartEvent, time, task.id, task.priorityLevel]); + } + } + } + function markTaskCompleted(task, time) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskCompleteEvent, time, task.id]); + } + } + } + function markTaskCanceled(task, time) { + { + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskCancelEvent, time, task.id]); + } + } + } + function markTaskErrored(task, time) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskErrorEvent, time, task.id]); + } + } + } + function markTaskRun(task, time) { + { + runIdCounter++; + profilingState[PRIORITY] = task.priorityLevel; + profilingState[CURRENT_TASK_ID] = task.id; + profilingState[CURRENT_RUN_ID] = runIdCounter; + + if (eventLog !== null) { + logEvent([TaskRunEvent, time, task.id, runIdCounter]); + } + } + } + function markTaskYield(task, time) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[CURRENT_RUN_ID] = 0; + + if (eventLog !== null) { + logEvent([TaskYieldEvent, time, task.id, runIdCounter]); + } + } + } + function markSchedulerSuspended(time) { + { + mainThreadIdCounter++; + + if (eventLog !== null) { + logEvent([SchedulerSuspendEvent, time, mainThreadIdCounter]); + } + } + } + function markSchedulerUnsuspended(time) { + { + if (eventLog !== null) { + logEvent([SchedulerResumeEvent, time, mainThreadIdCounter]); + } + } + } + + /* eslint-disable no-var */ // Math.pow(2, 30) - 1 // 0b111111111111111111111111111111 - var maxSigned31BitInt = 1073741823; - // Times out immediately - var IMMEDIATE_PRIORITY_TIMEOUT = -1; - // Eventually times out + var maxSigned31BitInt = 1073741823; // Times out immediately + + var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out + var USER_BLOCKING_PRIORITY = 250; var NORMAL_PRIORITY_TIMEOUT = 5000; - var LOW_PRIORITY_TIMEOUT = 10000; - // Never times out - var IDLE_PRIORITY = maxSigned31BitInt; + var LOW_PRIORITY_TIMEOUT = 10000; // Never times out - // Tasks are stored as a circular, doubly linked list. - var firstTask = null; - var firstDelayedTask = null; + var IDLE_PRIORITY = maxSigned31BitInt; // Tasks are stored on a min heap - // Pausing the scheduler is useful for debugging. - var isSchedulerPaused = false; + var taskQueue = []; + var timerQueue = []; // Incrementing id counter. Used to maintain insertion order. + var taskIdCounter = 1; // Pausing the scheduler is useful for debugging. var currentTask = null; - var currentPriorityLevel = NormalPriority; + var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy. - // This is set while performing work, to prevent re-entrancy. var isPerformingWork = false; - var isHostCallbackScheduled = false; var isHostTimeoutScheduled = false; - function scheduler_flushTaskAtPriority_Immediate(callback, didTimeout) { - return callback(didTimeout); - } - function scheduler_flushTaskAtPriority_UserBlocking(callback, didTimeout) { - return callback(didTimeout); - } - function scheduler_flushTaskAtPriority_Normal(callback, didTimeout) { - return callback(didTimeout); - } - function scheduler_flushTaskAtPriority_Low(callback, didTimeout) { - return callback(didTimeout); - } - function scheduler_flushTaskAtPriority_Idle(callback, didTimeout) { - return callback(didTimeout); - } - - function flushTask(task, currentTime) { - // Remove the task from the list before calling the callback. That way the - // list is in a consistent state even if the callback throws. - var next = task.next; - if (next === task) { - // This is the only scheduled task. Clear the list. - firstTask = null; - } else { - // Remove the task from its position in the list. - if (task === firstTask) { - firstTask = next; - } - var previous = task.previous; - previous.next = next; - next.previous = previous; - } - task.next = task.previous = null; - - // Now it's safe to execute the task. - var callback = task.callback; - var previousPriorityLevel = currentPriorityLevel; - var previousTask = currentTask; - currentPriorityLevel = task.priorityLevel; - currentTask = task; - var continuationCallback; - try { - var didUserCallbackTimeout = task.expirationTime <= currentTime; - // Add an extra function to the callstack. Profiling tools can use this - // to infer the priority of work that appears higher in the stack. - switch (currentPriorityLevel) { - case ImmediatePriority: - continuationCallback = scheduler_flushTaskAtPriority_Immediate(callback, didUserCallbackTimeout); - break; - case UserBlockingPriority: - continuationCallback = scheduler_flushTaskAtPriority_UserBlocking(callback, didUserCallbackTimeout); - break; - case NormalPriority: - continuationCallback = scheduler_flushTaskAtPriority_Normal(callback, didUserCallbackTimeout); - break; - case LowPriority: - continuationCallback = scheduler_flushTaskAtPriority_Low(callback, didUserCallbackTimeout); - break; - case IdlePriority: - continuationCallback = scheduler_flushTaskAtPriority_Idle(callback, didUserCallbackTimeout); - break; - } - } catch (error) { - throw error; - } finally { - currentPriorityLevel = previousPriorityLevel; - currentTask = previousTask; - } - - // A callback may return a continuation. The continuation should be scheduled - // with the same priority and expiration as the just-finished callback. - if (typeof continuationCallback === 'function') { - var expirationTime = task.expirationTime; - var continuationTask = task; - continuationTask.callback = continuationCallback; - - // Insert the new callback into the list, sorted by its timeout. This is - // almost the same as the code in `scheduleCallback`, except the callback - // is inserted into the list *before* callbacks of equal timeout instead - // of after. - if (firstTask === null) { - // This is the first callback in the list. - firstTask = continuationTask.next = continuationTask.previous = continuationTask; - } else { - var nextAfterContinuation = null; - var t = firstTask; - do { - if (expirationTime <= t.expirationTime) { - // This task times out at or after the continuation. We will insert - // the continuation *before* this task. - nextAfterContinuation = t; - break; - } - t = t.next; - } while (t !== firstTask); - if (nextAfterContinuation === null) { - // No equal or lower priority task was found, which means the new task - // is the lowest priority task in the list. - nextAfterContinuation = firstTask; - } else if (nextAfterContinuation === firstTask) { - // The new task is the highest priority task in the list. - firstTask = continuationTask; - } - - var _previous = nextAfterContinuation.previous; - _previous.next = nextAfterContinuation.previous = continuationTask; - continuationTask.next = nextAfterContinuation; - continuationTask.previous = _previous; - } - } - } - function advanceTimers(currentTime) { // Check for tasks that are no longer delayed and add them to the queue. - if (firstDelayedTask !== null && firstDelayedTask.startTime <= currentTime) { - do { - var task = firstDelayedTask; - var next = task.next; - if (task === next) { - firstDelayedTask = null; - } else { - firstDelayedTask = next; - var previous = task.previous; - previous.next = next; - next.previous = previous; + var timer = peek(timerQueue); + + while (timer !== null) { + if (timer.callback === null) { + // Timer was cancelled. + pop(timerQueue); + } else if (timer.startTime <= currentTime) { + // Timer fired. Transfer to the task queue. + pop(timerQueue); + timer.sortIndex = timer.expirationTime; + push(taskQueue, timer); + + { + markTaskStart(timer, currentTime); + timer.isQueued = true; } - task.next = task.previous = null; - insertScheduledTask(task, task.expirationTime); - } while (firstDelayedTask !== null && firstDelayedTask.startTime <= currentTime); + } else { + // Remaining timers are pending. + return; + } + + timer = peek(timerQueue); } } @@ -7347,60 +7266,120 @@ advanceTimers(currentTime); if (!isHostCallbackScheduled) { - if (firstTask !== null) { + if (peek(taskQueue) !== null) { isHostCallbackScheduled = true; requestHostCallback(flushWork); - } else if (firstDelayedTask !== null) { - requestHostTimeout(handleTimeout, firstDelayedTask.startTime - currentTime); + } else { + var firstTimer = peek(timerQueue); + + if (firstTimer !== null) { + requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); + } } } } function flushWork(hasTimeRemaining, initialTime) { + { + markSchedulerUnsuspended(initialTime); + } // We'll need a host callback the next time work is scheduled. + - // We'll need a host callback the next time work is scheduled. isHostCallbackScheduled = false; + if (isHostTimeoutScheduled) { // We scheduled a timeout but it's no longer needed. Cancel it. isHostTimeoutScheduled = false; cancelHostTimeout(); } - var currentTime = initialTime; - advanceTimers(currentTime); - isPerformingWork = true; + var previousPriorityLevel = currentPriorityLevel; + try { - if (!hasTimeRemaining) { - // Flush all the expired callbacks without yielding. - // TODO: Split flushWork into two separate functions instead of using - // a boolean argument? - while (firstTask !== null && firstTask.expirationTime <= currentTime && !(enableSchedulerDebugging && isSchedulerPaused)) { - flushTask(firstTask, currentTime); - currentTime = exports.unstable_now(); - advanceTimers(currentTime); + if (enableProfiling) { + try { + return workLoop(hasTimeRemaining, initialTime); + } catch (error) { + if (currentTask !== null) { + var currentTime = exports.unstable_now(); + markTaskErrored(currentTask, currentTime); + currentTask.isQueued = false; + } + + throw error; } } else { - // Keep flushing callbacks until we run out of time in the frame. - if (firstTask !== null) { - do { - flushTask(firstTask, currentTime); - currentTime = exports.unstable_now(); - advanceTimers(currentTime); - } while (firstTask !== null && !shouldYieldToHost() && !(enableSchedulerDebugging && isSchedulerPaused)); - } - } - // Return whether there's additional work - if (firstTask !== null) { - return true; - } else { - if (firstDelayedTask !== null) { - requestHostTimeout(handleTimeout, firstDelayedTask.startTime - currentTime); - } - return false; + // No catch in prod codepath. + return workLoop(hasTimeRemaining, initialTime); } } finally { + currentTask = null; + currentPriorityLevel = previousPriorityLevel; isPerformingWork = false; + + { + var _currentTime = exports.unstable_now(); + + markSchedulerSuspended(_currentTime); + } + } + } + + function workLoop(hasTimeRemaining, initialTime) { + var currentTime = initialTime; + advanceTimers(currentTime); + currentTask = peek(taskQueue); + + while (currentTask !== null && !(enableSchedulerDebugging )) { + if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { + // This currentTask hasn't expired, and we've reached the deadline. + break; + } + + var callback = currentTask.callback; + + if (callback !== null) { + currentTask.callback = null; + currentPriorityLevel = currentTask.priorityLevel; + var didUserCallbackTimeout = currentTask.expirationTime <= currentTime; + markTaskRun(currentTask, currentTime); + var continuationCallback = callback(didUserCallbackTimeout); + currentTime = exports.unstable_now(); + + if (typeof continuationCallback === 'function') { + currentTask.callback = continuationCallback; + markTaskYield(currentTask, currentTime); + } else { + { + markTaskCompleted(currentTask, currentTime); + currentTask.isQueued = false; + } + + if (currentTask === peek(taskQueue)) { + pop(taskQueue); + } + } + + advanceTimers(currentTime); + } else { + pop(taskQueue); + } + + currentTask = peek(taskQueue); + } // Return whether there's additional work + + + if (currentTask !== null) { + return true; + } else { + var firstTimer = peek(timerQueue); + + if (firstTimer !== null) { + requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); + } + + return false; } } @@ -7412,6 +7391,7 @@ case LowPriority: case IdlePriority: break; + default: priorityLevel = NormalPriority; } @@ -7428,6 +7408,7 @@ function unstable_next(eventHandler) { var priorityLevel; + switch (currentPriorityLevel) { case ImmediatePriority: case UserBlockingPriority: @@ -7435,6 +7416,7 @@ // Shift down to normal priority priorityLevel = NormalPriority; break; + default: // Anything lower than normal priority should remain at the current level. priorityLevel = currentPriorityLevel; @@ -7470,12 +7452,16 @@ switch (priorityLevel) { case ImmediatePriority: return IMMEDIATE_PRIORITY_TIMEOUT; + case UserBlockingPriority: return USER_BLOCKING_PRIORITY; + case IdlePriority: return IDLE_PRIORITY; + case LowPriority: return LOW_PRIORITY_TIMEOUT; + case NormalPriority: default: return NORMAL_PRIORITY_TIMEOUT; @@ -7484,16 +7470,18 @@ function unstable_scheduleCallback(priorityLevel, callback, options) { var currentTime = exports.unstable_now(); - var startTime; var timeout; + if (typeof options === 'object' && options !== null) { var delay = options.delay; + if (typeof delay === 'number' && delay > 0) { startTime = currentTime + delay; } else { startTime = currentTime; } + timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel); } else { timeout = timeoutForPriorityLevel(priorityLevel); @@ -7501,34 +7489,47 @@ } var expirationTime = startTime + timeout; - var newTask = { + id: taskIdCounter++, callback: callback, priorityLevel: priorityLevel, startTime: startTime, expirationTime: expirationTime, - next: null, - previous: null + sortIndex: -1 }; + { + newTask.isQueued = false; + } + if (startTime > currentTime) { // This is a delayed task. - insertDelayedTask(newTask, startTime); - if (firstTask === null && firstDelayedTask === newTask) { + newTask.sortIndex = startTime; + push(timerQueue, newTask); + + if (peek(taskQueue) === null && newTask === peek(timerQueue)) { // All tasks are delayed, and this is the task with the earliest delay. if (isHostTimeoutScheduled) { // Cancel an existing timeout. cancelHostTimeout(); } else { isHostTimeoutScheduled = true; - } - // Schedule a timeout. + } // Schedule a timeout. + + requestHostTimeout(handleTimeout, startTime - currentTime); } } else { - insertScheduledTask(newTask, expirationTime); - // Schedule a host callback, if needed. If we're already performing work, + newTask.sortIndex = expirationTime; + push(taskQueue, newTask); + + { + markTaskStart(newTask, currentTime); + newTask.isQueued = true; + } // Schedule a host callback, if needed. If we're already performing work, // wait until the next time we yield. + + if (!isHostCallbackScheduled && !isPerformingWork) { isHostCallbackScheduled = true; requestHostCallback(flushWork); @@ -7538,80 +7539,11 @@ return newTask; } - function insertScheduledTask(newTask, expirationTime) { - // Insert the new task into the list, ordered first by its timeout, then by - // insertion. So the new task is inserted after any other task the - // same timeout - if (firstTask === null) { - // This is the first task in the list. - firstTask = newTask.next = newTask.previous = newTask; - } else { - var next = null; - var task = firstTask; - do { - if (expirationTime < task.expirationTime) { - // The new task times out before this one. - next = task; - break; - } - task = task.next; - } while (task !== firstTask); - - if (next === null) { - // No task with a later timeout was found, which means the new task has - // the latest timeout in the list. - next = firstTask; - } else if (next === firstTask) { - // The new task has the earliest expiration in the entire list. - firstTask = newTask; - } - - var previous = next.previous; - previous.next = next.previous = newTask; - newTask.next = next; - newTask.previous = previous; - } - } - - function insertDelayedTask(newTask, startTime) { - // Insert the new task into the list, ordered by its start time. - if (firstDelayedTask === null) { - // This is the first task in the list. - firstDelayedTask = newTask.next = newTask.previous = newTask; - } else { - var next = null; - var task = firstDelayedTask; - do { - if (startTime < task.startTime) { - // The new task times out before this one. - next = task; - break; - } - task = task.next; - } while (task !== firstDelayedTask); - - if (next === null) { - // No task with a later timeout was found, which means the new task has - // the latest timeout in the list. - next = firstDelayedTask; - } else if (next === firstDelayedTask) { - // The new task has the earliest expiration in the entire list. - firstDelayedTask = newTask; - } - - var previous = next.previous; - previous.next = next.previous = newTask; - newTask.next = next; - newTask.previous = previous; - } - } - function unstable_pauseExecution() { - isSchedulerPaused = true; } function unstable_continueExecution() { - isSchedulerPaused = false; + if (!isHostCallbackScheduled && !isPerformingWork) { isHostCallbackScheduled = true; requestHostCallback(flushWork); @@ -7619,34 +7551,22 @@ } function unstable_getFirstCallbackNode() { - return firstTask; + return peek(taskQueue); } function unstable_cancelCallback(task) { - var next = task.next; - if (next === null) { - // Already cancelled. - return; - } - - if (task === next) { - if (task === firstTask) { - firstTask = null; - } else if (task === firstDelayedTask) { - firstDelayedTask = null; + { + if (task.isQueued) { + var currentTime = exports.unstable_now(); + markTaskCanceled(task, currentTime); + task.isQueued = false; } - } else { - if (task === firstTask) { - firstTask = next; - } else if (task === firstDelayedTask) { - firstDelayedTask = next; - } - var previous = task.previous; - previous.next = next; - next.previous = previous; - } + } // Null out the callback to indicate the task has been canceled. (Can't + // remove from the queue because you can't remove arbitrary nodes from an + // array based heap, only the first one.) - task.next = task.previous = null; + + task.callback = null; } function unstable_getCurrentPriorityLevel() { @@ -7656,10 +7576,16 @@ function unstable_shouldYield() { var currentTime = exports.unstable_now(); advanceTimers(currentTime); - return currentTask !== null && firstTask !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost(); + var firstTask = peek(taskQueue); + return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost(); } var unstable_requestPaint = requestPaint; + var unstable_Profiling = { + startLoggingProfilingEvents: startLoggingProfilingEvents, + stopLoggingProfilingEvents: stopLoggingProfilingEvents, + sharedProfilingBuffer: sharedProfilingBuffer + } ; exports.unstable_ImmediatePriority = ImmediatePriority; exports.unstable_UserBlockingPriority = UserBlockingPriority; @@ -7677,6 +7603,7 @@ exports.unstable_continueExecution = unstable_continueExecution; exports.unstable_pauseExecution = unstable_pauseExecution; exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode; + exports.unstable_Profiling = unstable_Profiling; })(); } }); @@ -7700,6 +7627,7 @@ var scheduler_development_16 = scheduler_development.unstable_continueExecution; var scheduler_development_17 = scheduler_development.unstable_pauseExecution; var scheduler_development_18 = scheduler_development.unstable_getFirstCallbackNode; + var scheduler_development_19 = scheduler_development.unstable_Profiling; var scheduler = createCommonjsModule(function (module) { @@ -7711,270 +7639,286 @@ }); function t(a){for(var b=a.message,c="https://reactjs.org/docs/error-decoder.html?invariant="+b,d=1;dthis.eventPool.length&&this.eventPool.push(a);}function ib(a){a.eventPool=[];a.getPooled=jb;a.release=kb;}var lb=y.extend({data:null}),mb=y.extend({data:null}),nb=[9,13,27,32],ob=Ra&&"CompositionEvent"in window,pb=null;Ra&&"documentMode"in document&&(pb=document.documentMode); - var qb=Ra&&"TextEvent"in window&&!pb,sb=Ra&&(!ob||pb&&8=pb),tb=String.fromCharCode(32),ub={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart", - captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},vb=!1; - function wb(a,b){switch(a){case "keyup":return -1!==nb.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return !0;default:return !1}}function xb(a){a=a.detail;return "object"===typeof a&&"data"in a?a.data:null}var yb=!1;function Ab(a,b){switch(a){case "compositionend":return xb(b);case "keypress":if(32!==b.which)return null;vb=!0;return tb;case "textInput":return a=b.data,a===tb&&vb?null:a;default:return null}} - function Bb(a,b){if(yb)return "compositionend"===a||!ob&&wb(a,b)?(a=fb(),eb=db=cb=null,yb=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1b}return !1}function D$1(a,b,c,d,e,f){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;}var F={}; - "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){F[a]=new D$1(a,0,!1,a,null,!1);});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];F[b]=new D$1(b,1,!1,a[1],null,!1);});["contentEditable","draggable","spellCheck","value"].forEach(function(a){F[a]=new D$1(a,2,!1,a.toLowerCase(),null,!1);}); - ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){F[a]=new D$1(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){F[a]=new D$1(a,3,!1,a.toLowerCase(),null,!1);}); - ["checked","multiple","muted","selected"].forEach(function(a){F[a]=new D$1(a,3,!0,a,null,!1);});["capture","download"].forEach(function(a){F[a]=new D$1(a,4,!1,a,null,!1);});["cols","rows","size","span"].forEach(function(a){F[a]=new D$1(a,6,!1,a,null,!1);});["rowSpan","start"].forEach(function(a){F[a]=new D$1(a,5,!1,a.toLowerCase(),null,!1);});var xc=/[\-:]([a-z])/g;function yc(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(xc, - yc);F[b]=new D$1(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(xc,yc);F[b]=new D$1(b,1,!1,a,"http://www.w3.org/1999/xlink",!1);});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(xc,yc);F[b]=new D$1(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1);});["tabIndex","crossOrigin"].forEach(function(a){F[a]=new D$1(a,1,!1,a.toLowerCase(),null,!1);}); - F.xlinkHref=new D$1("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){F[a]=new D$1(a,1,!1,a.toLowerCase(),null,!0);}); - function zc(a,b,c,d){var e=F.hasOwnProperty(b)?F[b]:null;var f=null!==e?0===e.type:d?!1:!(2Od.length&&Od.push(a);}}}var Vd=new ("function"===typeof WeakMap?WeakMap:Map); - function Wd(a){var b=Vd.get(a);void 0===b&&(b=new Set,Vd.set(a,b));return b}function Xd(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Yd(a){for(;a&&a.firstChild;)a=a.firstChild;return a} - function Zd(a,b){var c=Yd(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return {node:c,offset:b-a};a=d;}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode;}c=void 0;}c=Yd(c);}}function $d(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?$d(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1} - function ae(){for(var a=window,b=Xd();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href;}catch(d){c=!1;}if(c)a=b.contentWindow;else break;b=Xd(a.document);}return b}function be(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)} - var ce=Ra&&"documentMode"in document&&11>=document.documentMode,de={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},ee=null,fe=null,ge=null,he=!1; - function ie(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(he||null==ee||ee!==Xd(c))return null;c=ee;"selectionStart"in c&&be(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return ge&&jd(ge,c)?null:(ge=c,a=y.getPooled(de.select,fe,a,b),a.type="select",a.target=ee,Qa(a),a)} - var je={eventTypes:de,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Wd(e);f=ja.onSelect;for(var h=0;h=b.length))throw t(Error(93));b=b[0];}c=b;}null==c&&(c="");}a._wrapperState={initialValue:Ac(c)};} - function pe(a,b){var c=Ac(b.value),d=Ac(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d);}function qe(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b);}var re={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; - function se(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 te(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?se(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a} - var ue=void 0,ve=function(a){return "undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)});}:a}(function(a,b){if(a.namespaceURI!==re.svg||"innerHTML"in a)a.innerHTML=b;else{ue=ue||document.createElement("div");ue.innerHTML=""+b+"";for(b=ue.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild);}}); - function we(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b;} - var xe={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},ye=["Webkit","ms","Moz","O"];Object.keys(xe).forEach(function(a){ye.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);xe[b]=xe[a];});});function ze(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||xe.hasOwnProperty(a)&&xe[a]?(""+b).trim():b+"px"} - function Ae(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=ze(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e;}}var Ce=objectAssign({menuitem:!0},{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}); - function De(a,b){if(b){if(Ce[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw t(Error(137),a,"");if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw t(Error(60));if(!("object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML))throw t(Error(61));}if(null!=b.style&&"object"!==typeof b.style)throw t(Error(62),"");}} - function Ee(a,b){if(-1===a.indexOf("-"))return "string"===typeof b.is;switch(a){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":return !1;default:return !0}} - function Fe(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Wd(a);b=ja[b];for(var d=0;dPe||(a.current=Oe[Pe],Oe[Pe]=null,Pe--);}function J(a,b){Pe++;Oe[Pe]=a.current;a.current=b;}var Qe={},L={current:Qe},M={current:!1},Re=Qe; - function Se(a,b){var c=a.type.contextTypes;if(!c)return Qe;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function N(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Te(a){H(M);H(L);}function Ue(a){H(M);H(L);} - function Ve(a,b,c){if(L.current!==Qe)throw t(Error(168));J(L,b);J(M,c);}function We(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw t(Error(108),oc(b)||"Unknown",e);return objectAssign({},c,d)}function Xe(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||Qe;Re=L.current;J(L,b);J(M,M.current);return !0} - function Ye(a,b,c){var d=a.stateNode;if(!d)throw t(Error(169));c?(b=We(a,b,Re),d.__reactInternalMemoizedMergedChildContext=b,H(M),H(L),J(L,b)):H(M);J(M,c);} - var Ze=scheduler.unstable_runWithPriority,$e=scheduler.unstable_scheduleCallback,af=scheduler.unstable_cancelCallback,bf=scheduler.unstable_shouldYield,cf=scheduler.unstable_requestPaint,df=scheduler.unstable_now,ef=scheduler.unstable_getCurrentPriorityLevel,ff=scheduler.unstable_ImmediatePriority,hf=scheduler.unstable_UserBlockingPriority,jf=scheduler.unstable_NormalPriority,kf=scheduler.unstable_LowPriority,lf=scheduler.unstable_IdlePriority,mf={},nf=void 0!==cf?cf:function(){},of=null,pf=null,qf=!1,rf=df(),sf=1E4>rf?df:function(){return df()-rf}; - function tf(){switch(ef()){case ff:return 99;case hf:return 98;case jf:return 97;case kf:return 96;case lf:return 95;default:throw t(Error(332));}}function uf(a){switch(a){case 99:return ff;case 98:return hf;case 97:return jf;case 96:return kf;case 95:return lf;default:throw t(Error(332));}}function vf(a,b){a=uf(a);return Ze(a,b)}function wf(a,b,c){a=uf(a);return $e(a,b,c)}function xf(a){null===of?(of=[a],pf=$e(ff,yf)):of.push(a);return mf}function O(){null!==pf&&af(pf);yf();} - function yf(){if(!qf&&null!==of){qf=!0;var a=0;try{var b=of;vf(99,function(){for(;a=a?99:250>=a?98:5250>=a?97:95}function Af(a,b){if(a&&a.defaultProps){b=objectAssign({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);}return b} - function Bf(a){var b=a._result;switch(a._status){case 1:return b;case 2:throw b;case 0:throw b;default:a._status=0;b=a._ctor;b=b();b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b);},function(b){0===a._status&&(a._status=2,a._result=b);});switch(a._status){case 1:return a._result;case 2:throw a._result;}a._result=b;throw b;}}var Cf={current:null},Df=null,Ef=null,Ff=null;function Gf(){Ff=Ef=Df=null;} - function Hf(a,b){var c=a.type._context;J(Cf,c._currentValue);c._currentValue=b;}function If(a){var b=Cf.current;H(Cf);a.type._context._currentValue=b;}function Jf(a,b){for(;null!==a;){var c=a.alternate;if(a.childExpirationTime=b&&(Lf=!0),a.firstContext=null);}function Mf(a,b){if(Ff!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)Ff=a,b=1073741823;b={context:a,observedBits:b,next:null};if(null===Ef){if(null===Df)throw t(Error(308));Ef=b;Df.dependencies={expirationTime:0,firstContext:b,responders:null};}else Ef=Ef.next=b;}return a._currentValue}var Nf=!1; - function Of(a){return {baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Pf(a){return {baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}} - function Qf(a,b){return {expirationTime:a,suspenseConfig:b,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Rf(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b);} - function Sf(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=Of(a.memoizedState));}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=Of(a.memoizedState),e=c.updateQueue=Of(c.memoizedState)):d=a.updateQueue=Pf(e):null===e&&(e=c.updateQueue=Pf(d));null===e||d===e?Rf(d,b):null===d.lastUpdate||null===e.lastUpdate?(Rf(d,b),Rf(e,b)):(Rf(d,b),e.lastUpdate=b);} - function Tf(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=Of(a.memoizedState):Uf(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b);}function Uf(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=Pf(b));return b} - function Vf(a,b,c,d,e,f){switch(c.tag){case 1:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case 3:a.effectTag=a.effectTag&-2049|64;case 0:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return objectAssign({},d,e);case 2:Nf=!0;}return d} - function Wf(a,b,c,d,e){Nf=!1;b=Uf(a,b);for(var f=b.baseState,h=null,g=0,k=b.firstUpdate,l=f;null!==k;){var n=k.expirationTime;nw?(C=n,n=null):C=n.sibling;var p=x(e,n,g[w],k);if(null===p){null===n&&(n=C);break}a&& - n&&null===p.alternate&&b(e,n);h=f(p,h,w);null===u?l=p:u.sibling=p;u=p;n=C;}if(w===g.length)return c(e,n),l;if(null===n){for(;ww?(C=u,u=null):C=u.sibling;var r=x(e,u,p.value,k);if(null===r){null===u&&(u=C);break}a&&u&&null===r.alternate&&b(e,u);h=f(r,h,w);null===n?l=r:n.sibling=r;n=r;u=C;}if(p.done)return c(e,u),l;if(null===u){for(;!p.done;w++,p=g.next())p=z(e,p.value,k),null!==p&&(h=f(p,h,w),null===n?l=p:n.sibling=p,n=p);return l}for(u=d(e,u);!p.done;w++,p=g.next())p=v(u,e,w,p.value,k),null!==p&&(a&&null!== - p.alternate&&u.delete(null===p.key?w:p.key),h=f(p,h,w),null===n?l=p:n.sibling=p,n=p);a&&u.forEach(function(a){return b(e,a)});return l}return function(a,d,f,g){var k="object"===typeof f&&null!==f&&f.type===ac&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Zb:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){if(7===k.tag?f.type===ac:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===ac?f.props.children:f.props);d.ref=lg(a,k,f);d.return=a;a=d;break a}c(a, - k);break}else b(a,k);k=k.sibling;}f.type===ac?(d=sg(f.props.children,a.mode,g,f.key),d.return=a,a=d):(g=qg(f.type,f.key,f.props,null,a.mode,g),g.ref=lg(a,d,f),g.return=a,a=g);}return h(a);case $b:a:{for(k=f.key;null!==d;){if(d.key===k){if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}c(a,d);break}else b(a,d);d=d.sibling;}d=rg(f,a.mode,g);d.return=a;a=d;}return h(a)}if("string"===typeof f|| - "number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=pg(f,a.mode,g),d.return=a,a=d),h(a);if(kg(f))return rb(a,d,f,g);if(mc(f))return Be(a,d,f,g);l&&mg(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:throw a=a.type,t(Error(152),a.displayName||a.name||"Component");}return c(a,d)}}var tg=ng(!0),ug=ng(!1),vg={},wg={current:vg},xg={current:vg},yg={current:vg};function zg(a){if(a===vg)throw t(Error(174));return a} - function Ag(a,b){J(yg,b);J(xg,a);J(wg,vg);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:te(null,"");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=te(b,c);}H(wg);J(wg,b);}function Bg(a){H(wg);H(xg);H(yg);}function Cg(a){zg(yg.current);var b=zg(wg.current);var c=te(b,a.type);b!==c&&(J(xg,a),J(wg,c));}function Dg(a){xg.current===a&&(H(wg),H(xg));}var Eg=1,Fg=1,Gg=2,P={current:0}; - function Hg(a){for(var b=a;null!==b;){if(13===b.tag){if(null!==b.memoizedState)return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.effectTag&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return;}b.sibling.return=b.return;b=b.sibling;}return null} - var Ig=0,Jg=2,Kg=4,Lg=8,Mg=16,Ng=32,Og=64,Pg=128,Qg=Xb.ReactCurrentDispatcher,Rg=0,Sg=null,Q=null,Tg=null,Ug=null,R=null,Vg=null,Wg=0,Xg=null,Yg=0,Zg=!1,$g=null,ah=0;function bh(){throw t(Error(321));}function ch(a,b){if(null===b)return !1;for(var c=0;cWg&&(Wg=n)):(Xf(n,k.suspenseConfig),f=k.eagerReducer===a?k.eagerState:a(f,k.action));h=k;k=k.next;}while(null!==k&&k!==d);l||(g=h,e=f);hd(f,b.memoizedState)||(Lf=!0);b.memoizedState=f;b.baseUpdate=g;b.baseState=e;c.lastRenderedState=f;}return [b.memoizedState,c.dispatch]} - function nh(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===Xg?(Xg={lastEffect:null},Xg.lastEffect=a.next=a):(b=Xg.lastEffect,null===b?Xg.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,Xg.lastEffect=a));return a}function oh(a,b,c,d){var e=jh();Yg|=a;e.memoizedState=nh(b,c,void 0,void 0===d?null:d);} - function ph(a,b,c,d){var e=kh();d=void 0===d?null:d;var f=void 0;if(null!==Q){var h=Q.memoizedState;f=h.destroy;if(null!==d&&ch(d,h.deps)){nh(Ig,c,f,d);return}}Yg|=a;e.memoizedState=nh(b,c,f,d);}function qh(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null);};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null;}}function rh(){} - function sh(a,b,c){if(!(25>ah))throw t(Error(301));var d=a.alternate;if(a===Sg||null!==d&&d===Sg)if(Zg=!0,a={expirationTime:Rg,suspenseConfig:null,action:c,eagerReducer:null,eagerState:null,next:null},null===$g&&($g=new Map),c=$g.get(b),void 0===c)$g.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a;}else{var e=cg(),f=$f.suspense;e=dg(e,a,f);f={expirationTime:e,suspenseConfig:f,action:c,eagerReducer:null,eagerState:null,next:null};var h=b.last;if(null===h)f.next=f;else{var g=h.next;null!==g&& - (f.next=g);h.next=f;}b.last=f;if(0===a.expirationTime&&(null===d||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var k=b.lastRenderedState,l=d(k,c);f.eagerReducer=d;f.eagerState=l;if(hd(l,k))return}catch(n){}finally{}eg(a,e);}} - var hh={readContext:Mf,useCallback:bh,useContext:bh,useEffect:bh,useImperativeHandle:bh,useLayoutEffect:bh,useMemo:bh,useReducer:bh,useRef:bh,useState:bh,useDebugValue:bh,useResponder:bh},eh={readContext:Mf,useCallback:function(a,b){jh().memoizedState=[a,void 0===b?null:b];return a},useContext:Mf,useEffect:function(a,b){return oh(516,Pg|Og,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return oh(4,Kg|Ng,qh.bind(null,b,a),c)},useLayoutEffect:function(a,b){return oh(4, - Kg|Ng,a,b)},useMemo:function(a,b){var c=jh();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=jh();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=sh.bind(null,Sg,a);return [d.memoizedState,a]},useRef:function(a){var b=jh();a={current:a};return b.memoizedState=a},useState:function(a){var b=jh();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue= - {last:null,dispatch:null,lastRenderedReducer:lh,lastRenderedState:a};a=a.dispatch=sh.bind(null,Sg,a);return [b.memoizedState,a]},useDebugValue:rh,useResponder:kd},fh={readContext:Mf,useCallback:function(a,b){var c=kh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&ch(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:Mf,useEffect:function(a,b){return ph(516,Pg|Og,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ph(4,Kg|Ng,qh.bind(null, - b,a),c)},useLayoutEffect:function(a,b){return ph(4,Kg|Ng,a,b)},useMemo:function(a,b){var c=kh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&ch(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:mh,useRef:function(){return kh().memoizedState},useState:function(a){return mh(lh)},useDebugValue:rh,useResponder:kd},th=null,uh=null,vh=!1; - function wh(a,b){var c=xh(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c;}function yh(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return !1;default:return !1}} - function zh(a){if(vh){var b=uh;if(b){var c=b;if(!yh(a,b)){b=Ne(c.nextSibling);if(!b||!yh(a,b)){a.effectTag|=2;vh=!1;th=a;return}wh(th,c);}th=a;uh=Ne(b.firstChild);}else a.effectTag|=2,vh=!1,th=a;}}function Ah(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&18!==a.tag;)a=a.return;th=a;} - function Bh(a){if(a!==th)return !1;if(!vh)return Ah(a),vh=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!Ke(b,a.memoizedProps))for(b=uh;b;)wh(a,b),b=Ne(b.nextSibling);Ah(a);uh=th?Ne(a.stateNode.nextSibling):null;return !0}function Ch(){uh=th=null;vh=!1;}var Dh=Xb.ReactCurrentOwner,Lf=!1;function S(a,b,c,d){b.child=null===a?ug(b,null,c,d):tg(b,a.child,c,d);} - function Eh(a,b,c,d,e){c=c.render;var f=b.ref;Kf(b,e);d=dh(a,b,c,d,f,e);if(null!==a&&!Lf)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),Fh(a,b,e);b.effectTag|=1;S(a,b,d,e);return b.child} - function Gh(a,b,c,d,e,f){if(null===a){var h=c.type;if("function"===typeof h&&!Hh(h)&&void 0===h.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=h,Ih(a,b,h,d,e,f);a=qg(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}h=a.child;if(eb)&&Ti.set(a,b)));}} - function Yi(a,b){a.expirationTimee.firstPendingTime&&(e.firstPendingTime=b),a=e.lastPendingTime,0===a||b=b?(wf(97,function(){c._onComplete();return null}),!0):!1}function bj(){if(null!==Ti){var a=Ti;Ti=null;a.forEach(function(a,c){xf(Z.bind(null,c,a));});O();}}function ej(a,b){var c=U;U|=1;try{return a(b)}finally{U=c,U===T&&O();}}function fj(a,b,c,d){var e=U;U|=4;try{return vf(98,a.bind(null,b,c,d))}finally{U=e,U===T&&O();}} - function gj(a,b){var c=U;U&=-2;U|=Bi;try{return a(b)}finally{U=c,U===T&&O();}} - function hj(a,b){a.finishedWork=null;a.finishedExpirationTime=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,Me(c));if(null!==V)for(c=V.return;null!==c;){var d=c;switch(d.tag){case 1:var e=d.type.childContextTypes;null!==e&&void 0!==e&&Te();break;case 3:Bg();Ue();break;case 5:Dg(d);break;case 4:Bg();break;case 13:H(P);break;case 19:H(P);break;case 10:If(d);}c=c.return;}Ji=a;V=og(a.current,null);W=b;X=Ei;Li=Ki=1073741823;Mi=null;Ni=!1;} - function Z(a,b,c){if((U&(Ci|Di))!==T)throw t(Error(327));if(a.firstPendingTime component higher in the tree to provide a loading indicator or placeholder to display."+ - pc(k));}X!==Ii&&(X=Fi);l=bi(l,k);k=g;do{switch(k.tag){case 3:k.effectTag|=2048;k.expirationTime=n;n=ti(k,l,n);Tf(k,n);break a;case 1:if(z=l,h=k.type,g=k.stateNode,0===(k.effectTag&64)&&("function"===typeof h.getDerivedStateFromError||null!==g&&"function"===typeof g.componentDidCatch&&(null===xi||!xi.has(g)))){k.effectTag|=2048;k.expirationTime=n;n=wi(k,z,n);Tf(k,n);break a}}k=k.return;}while(null!==k)}V=lj(f);}while(1);U=d;Gf();zi.current=e;if(null!==V)return Z.bind(null,a,b)}a.finishedWork=a.current.alternate; - a.finishedExpirationTime=b;if(dj(a,b))return null;Ji=null;switch(X){case Ei:throw t(Error(328));case Fi:return d=a.lastPendingTime,dc&&(c=0),c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3E3>c?3E3:4320>c?4320:1960*yi(c/1960))-c,b=b?b=0:(c=e.busyDelayMs|0,d=sf()-(10*(1073741821-d)-(e.timeoutMs|0||5E3)),b=d<=c?0:c+b-d),10\x3c/script>",l=k.removeChild(k.firstChild)):"string"===typeof c.is?l=l.createElement(k,{is:c.is}):(l=l.createElement(k),"select"===k&&(k=l,c.multiple?k.multiple=!0:c.size&&(k.size=c.size))):l=l.createElementNS(h,k);k=l;k[Fa]=g;k[Ga]=c;c=k;Th(c,b,!1,!1);g=c;var n=d,z=Ee(f,e);switch(f){case "iframe":case "object":case "embed":G("load", - g);d=e;break;case "video":case "audio":for(d=0;de.tailExpiration&&1c&&(c=f),g>c&&(c=g),e=e.sibling;d.childExpirationTime=c;}if(null!==b)return b;null!==a&&0===(a.effectTag&1024)&&(null===a.firstEffect&&(a.firstEffect=V.firstEffect),null!==V.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=V.firstEffect),a.lastEffect=V.lastEffect),1e?f:e;a.firstPendingTime=e;eI&&(E=I,I=K,K=E),E=Zd(A,K),ua=Zd(A,I),E&&ua&&(1!==r.rangeCount||r.anchorNode!==E.node||r.anchorOffset!== - E.offset||r.focusNode!==ua.node||r.focusOffset!==ua.offset)&&(p=p.createRange(),p.setStart(E.node,E.offset),r.removeAllRanges(),K>I?(r.addRange(p),r.extend(ua.node,ua.offset)):(p.setEnd(ua.node,ua.offset),r.addRange(p))))));p=[];for(r=A;r=r.parentNode;)1===r.nodeType&&p.push({element:r,left:r.scrollLeft,top:r.scrollTop});"function"===typeof A.focus&&A.focus();for(A=0;A=c)return Ph(a,b,c);J(P,P.current& - Eg);b=Fh(a,b,c);return null!==b?b.sibling:null}J(P,P.current&Eg);break;case 19:d=b.childExpirationTime>=c;if(0!==(a.effectTag&64)){if(d)return Rh(a,b,c);b.effectTag|=64;}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null);J(P,P.current);if(!d)return null}return Fh(a,b,c)}}else Lf=!1;b.expirationTime=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;e=Se(b,L.current);Kf(b,c);e=dh(null,b,d,a,e,c);b.effectTag|=1;if("object"===typeof e&& - null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;ih();if(N(d)){var f=!0;Xe(b);}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var h=d.getDerivedStateFromProps;"function"===typeof h&&bg(b,d,h,a);e.updater=fg;b.stateNode=e;e._reactInternalFiber=b;jg(b,d,a,c);b=Mh(null,b,d,!0,f,c);}else b.tag=0,S(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;e=Bf(e);b.type=e;f=b.tag=sj(e); - a=Af(e,a);switch(f){case 0:b=Jh(null,b,e,a,c);break;case 1:b=Lh(null,b,e,a,c);break;case 11:b=Eh(null,b,e,a,c);break;case 14:b=Gh(null,b,e,Af(e.type,a),d,c);break;default:throw t(Error(306),e,"");}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Af(d,e),Jh(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Af(d,e),Lh(a,b,d,e,c);case 3:Nh(b);d=b.updateQueue;if(null===d)throw t(Error(282));e=b.memoizedState;e=null!==e?e.element:null;Wf(b,d,b.pendingProps, - null,c);d=b.memoizedState.element;if(d===e)Ch(),b=Fh(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)uh=Ne(b.stateNode.containerInfo.firstChild),th=b,e=vh=!0;e?(b.effectTag|=2,b.child=ug(b,null,d,c)):(S(a,b,d,c),Ch());b=b.child;}return b;case 5:return Cg(b),null===a&&zh(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,h=e.children,Ke(d,e)?h=null:null!==f&&Ke(d,f)&&(b.effectTag|=16),Kh(a,b),b.mode&4&&1!==c&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null): - (S(a,b,h,c),b=b.child),b;case 6:return null===a&&zh(b),null;case 13:return Ph(a,b,c);case 4:return Ag(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=tg(b,null,d,c):S(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Af(d,e),Eh(a,b,d,e,c);case 7:return S(a,b,b.pendingProps,c),b.child;case 8:return S(a,b,b.pendingProps.children,c),b.child;case 12:return S(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;h=b.memoizedProps; - f=e.value;Hf(b,f);if(null!==h){var g=h.value;f=hd(g,f)?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(g,f):1073741823)|0;if(0===f){if(h.children===e.children&&!M.current){b=Fh(a,b,c);break a}}else for(g=b.child,null!==g&&(g.return=b);null!==g;){var k=g.dependencies;if(null!==k){h=g.child;for(var l=k.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===g.tag&&(l=Qf(c,null),l.tag=2,Sf(g,l));g.expirationTimeb}return !1}function B(a,b,c,d,e,f){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;}var C={}; + "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){C[a]=new B(a,0,!1,a,null,!1);});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];C[b]=new B(b,1,!1,a[1],null,!1);});["contentEditable","draggable","spellCheck","value"].forEach(function(a){C[a]=new B(a,2,!1,a.toLowerCase(),null,!1);}); + ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){C[a]=new B(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){C[a]=new B(a,3,!1,a.toLowerCase(),null,!1);}); + ["checked","multiple","muted","selected"].forEach(function(a){C[a]=new B(a,3,!0,a,null,!1);});["capture","download"].forEach(function(a){C[a]=new B(a,4,!1,a,null,!1);});["cols","rows","size","span"].forEach(function(a){C[a]=new B(a,6,!1,a,null,!1);});["rowSpan","start"].forEach(function(a){C[a]=new B(a,5,!1,a.toLowerCase(),null,!1);});var rb=/[\-:]([a-z])/g;function sb(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(rb, + sb);C[b]=new B(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(rb,sb);C[b]=new B(b,1,!1,a,"http://www.w3.org/1999/xlink",!1);});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(rb,sb);C[b]=new B(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1);});["tabIndex","crossOrigin"].forEach(function(a){C[a]=new B(a,1,!1,a.toLowerCase(),null,!1);}); + C.xlinkHref=new B("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){C[a]=new B(a,1,!1,a.toLowerCase(),null,!0);});function tb(a){switch(typeof a){case "boolean":case "number":case "object":case "string":case "undefined":return a;default:return ""}} + function ub(a,b,c,d){var e=C.hasOwnProperty(b)?C[b]:null;var f=null!==e?0===e.type:d?!1:!(2=b.length))throw t(Error(93));b=b[0];}c=b;}null==c&&(c="");}a._wrapperState={initialValue:tb(c)};} + function Mb(a,b){var c=tb(b.value),d=tb(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d);}function Nb(a){var b=a.textContent;b===a._wrapperState.initialValue&&""!==b&&null!==b&&(a.value=b);}var Ob={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; + function Pb(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 Qb(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?Pb(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a} + var Rb,Sb=function(a){return "undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)});}:a}(function(a,b){if(a.namespaceURI!==Ob.svg||"innerHTML"in a)a.innerHTML=b;else{Rb=Rb||document.createElement("div");Rb.innerHTML=""+b.valueOf().toString()+"";for(b=Rb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild);}}); + function Tb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b;}function Ub(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var Vb={animationend:Ub("Animation","AnimationEnd"),animationiteration:Ub("Animation","AnimationIteration"),animationstart:Ub("Animation","AnimationStart"),transitionend:Ub("Transition","TransitionEnd")},Wb={},Xb={}; + Xa&&(Xb=document.createElement("div").style,"AnimationEvent"in window||(delete Vb.animationend.animation,delete Vb.animationiteration.animation,delete Vb.animationstart.animation),"TransitionEvent"in window||delete Vb.transitionend.transition);function Yb(a){if(Wb[a])return Wb[a];if(!Vb[a])return a;var b=Vb[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Xb)return Wb[a]=b[c];return a} + var Zb=Yb("animationend"),$b=Yb("animationiteration"),ac=Yb("animationstart"),bc=Yb("transitionend"),dc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ec=!1,fc=[],gc=null,hc=null,ic=null,jc=new Map,kc=new Map,lc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "), + mc="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function nc(a){var b=oc(a);lc.forEach(function(c){pc(c,a,b);});mc.forEach(function(c){pc(c,a,b);});}function qc(a,b,c,d){return {blockedOn:a,topLevelType:b,eventSystemFlags:c|32,nativeEvent:d}} + function rc(a,b){switch(a){case "focus":case "blur":gc=null;break;case "dragenter":case "dragleave":hc=null;break;case "mouseover":case "mouseout":ic=null;break;case "pointerover":case "pointerout":jc.delete(b.pointerId);break;case "gotpointercapture":case "lostpointercapture":kc.delete(b.pointerId);}}function sc(a,b,c,d,e){if(null===a||a.nativeEvent!==e)return qc(b,c,d,e);a.eventSystemFlags|=d;return a} + function tc(a,b,c,d){switch(b){case "focus":return gc=sc(gc,a,b,c,d),!0;case "dragenter":return hc=sc(hc,a,b,c,d),!0;case "mouseover":return ic=sc(ic,a,b,c,d),!0;case "pointerover":var e=d.pointerId;jc.set(e,sc(jc.get(e)||null,a,b,c,d));return !0;case "gotpointercapture":return e=d.pointerId,kc.set(e,sc(kc.get(e)||null,a,b,c,d)),!0}return !1}function uc(a){if(null!==a.blockedOn)return !1;var b=vc(a.topLevelType,a.eventSystemFlags,a.nativeEvent);return null!==b?(a.blockedOn=b,!1):!0} + function wc(a,b,c){uc(a)&&c.delete(b);}function xc(){for(ec=!1;0this.eventPool.length&&this.eventPool.push(a);}function Oc(a){a.eventPool=[];a.getPooled=Pc;a.release=Qc;}var Rc=F.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Sc=F.extend({clipboardData:function(a){return "clipboardData"in a?a.clipboardData:window.clipboardData}}),Tc=F.extend({view:null,detail:null}),Uc=Tc.extend({relatedTarget:null}); + function Vc(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0} + var Wc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xc={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4", + 116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Yc={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zc(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Yc[a])?!!b[a]:!1}function $c(){return Zc} + var ad=Tc.extend({key:function(a){if(a.key){var b=Wc[a.key]||a.key;if("Unidentified"!==b)return b}return "keypress"===a.type?(a=Vc(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?Xc[a.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:$c,charCode:function(a){return "keypress"===a.type?Vc(a):0},keyCode:function(a){return "keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return "keypress"=== + a.type?Vc(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),bd=0,cd=0,dd=!1,fd=!1,gd=Tc.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:$c,button:null,buttons:null,relatedTarget:function(a){return a.relatedTarget||(a.fromElement===a.srcElement?a.toElement:a.fromElement)},movementX:function(a){if("movementX"in a)return a.movementX;var b=bd;bd=a.screenX;return dd?"mousemove"===a.type?a.screenX- + b:0:(dd=!0,0)},movementY:function(a){if("movementY"in a)return a.movementY;var b=cd;cd=a.screenY;return fd?"mousemove"===a.type?a.screenY-b:0:(fd=!0,0)}}),hd=gd.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),id$1=gd.extend({dataTransfer:null}),jd=Tc.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:$c}),kd=F.extend({propertyName:null, + elapsedTime:null,pseudoElement:null}),ld=gd.extend({deltaX:function(a){return "deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return "deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:null,deltaMode:null}),md=[["blur","blur",0],["cancel","cancel",0],["click","click",0],["close","close",0],["contextmenu","contextMenu",0],["copy","copy",0],["cut","cut",0],["auxclick","auxClick",0],["dblclick","doubleClick",0],["dragend","dragEnd", + 0],["dragstart","dragStart",0],["drop","drop",0],["focus","focus",0],["input","input",0],["invalid","invalid",0],["keydown","keyDown",0],["keypress","keyPress",0],["keyup","keyUp",0],["mousedown","mouseDown",0],["mouseup","mouseUp",0],["paste","paste",0],["pause","pause",0],["play","play",0],["pointercancel","pointerCancel",0],["pointerdown","pointerDown",0],["pointerup","pointerUp",0],["ratechange","rateChange",0],["reset","reset",0],["seeked","seeked",0],["submit","submit",0],["touchcancel","touchCancel", + 0],["touchend","touchEnd",0],["touchstart","touchStart",0],["volumechange","volumeChange",0],["drag","drag",1],["dragenter","dragEnter",1],["dragexit","dragExit",1],["dragleave","dragLeave",1],["dragover","dragOver",1],["mousemove","mouseMove",1],["mouseout","mouseOut",1],["mouseover","mouseOver",1],["pointermove","pointerMove",1],["pointerout","pointerOut",1],["pointerover","pointerOver",1],["scroll","scroll",1],["toggle","toggle",1],["touchmove","touchMove",1],["wheel","wheel",1],["abort","abort", + 2],[Zb,"animationEnd",2],[$b,"animationIteration",2],[ac,"animationStart",2],["canplay","canPlay",2],["canplaythrough","canPlayThrough",2],["durationchange","durationChange",2],["emptied","emptied",2],["encrypted","encrypted",2],["ended","ended",2],["error","error",2],["gotpointercapture","gotPointerCapture",2],["load","load",2],["loadeddata","loadedData",2],["loadedmetadata","loadedMetadata",2],["loadstart","loadStart",2],["lostpointercapture","lostPointerCapture",2],["playing","playing",2],["progress", + "progress",2],["seeking","seeking",2],["stalled","stalled",2],["suspend","suspend",2],["timeupdate","timeUpdate",2],[bc,"transitionEnd",2],["waiting","waiting",2]],nd={},od={},pd=0;for(;pd=b)return {node:c,offset:b-a};a=d;}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode;}c=void 0;}c=Vd(c);}} + function Xd(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Xd(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function Yd(){for(var a=window,b=Ud();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href;}catch(d){c=!1;}if(c)a=b.contentWindow;else break;b=Ud(a.document);}return b} + function Zd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}var $d="$",ae="/$",be="$?",ce="$!",de=null,ee=null;function fe(a,b){switch(a){case "button":case "input":case "select":case "textarea":return !!b.autoFocus}return !1} + function ge(a,b){return "textarea"===a||"option"===a||"noscript"===a||"string"===typeof b.children||"number"===typeof b.children||"object"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var he="function"===typeof setTimeout?setTimeout:void 0,ie="function"===typeof clearTimeout?clearTimeout:void 0;function je(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a} + function ke(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if(c===$d||c===ce||c===be){if(0===b)return a;b--;}else c===ae&&b++;}a=a.previousSibling;}return null}var le=Math.random().toString(36).slice(2),me="__reactInternalInstance$"+le,ne="__reactEventHandlers$"+le,oe="__reactContainere$"+le; + function Cd(a){var b=a[me];if(b)return b;for(var c=a.parentNode;c;){if(b=c[oe]||c[me]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=ke(a);null!==a;){if(c=a[me])return c;a=ke(a);}return b}a=c;c=a.parentNode;}return null}function pe(a){a=a[me]||a[oe];return !a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function qe(a){if(5===a.tag||6===a.tag)return a.stateNode;throw t(Error(33));}function re(a){return a[ne]||null}var se=null,te=null,ue=null; + function ve(){if(ue)return ue;var a,b=te,c=b.length,d,e="value"in se?se.value:se.textContent,f=e.length;for(a=0;a=Ae),De=String.fromCharCode(32),Ee={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart", + captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Fe=!1; + function Ge(a,b){switch(a){case "keyup":return -1!==ye.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return !0;default:return !1}}function He(a){a=a.detail;return "object"===typeof a&&"data"in a?a.data:null}var Ie=!1;function Je(a,b){switch(a){case "compositionend":return He(b);case "keypress":if(32!==b.which)return null;Fe=!0;return De;case "textInput":return a=b.data,a===De&&Fe?null:a;default:return null}} + function Ke(a,b){if(Ie)return "compositionend"===a||!ze&&Ge(a,b)?(a=ve(),ue=te=se=null,Ie=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=document.documentMode,kf={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},lf=null,mf=null,nf=null,of=!1; + function pf(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(of||null==lf||lf!==Ud(c))return null;c=lf;"selectionStart"in c&&Zd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return nf&&hf(nf,c)?null:(nf=c,a=F.getPooled(kf.select,mf,a,b),a.type="select",a.target=lf,Lc(a),a)} + var qf={eventTypes:kf,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=oc(e);f=ja.onSelect;for(var g=0;gsf||(a.current=rf[sf],rf[sf]=null,sf--);} + function I(a,b){sf++;rf[sf]=a.current;a.current=b;}var tf={},J={current:tf},K={current:!1},uf=tf;function vf(a,b){var c=a.type.contextTypes;if(!c)return tf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function N(a){a=a.childContextTypes;return null!==a&&void 0!==a} + function wf(a){H(K);H(J);}function xf(a){H(K);H(J);}function zf(a,b,c){if(J.current!==tf)throw t(Error(168));I(J,b);I(K,c);}function Af(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw t(Error(108),Va(b)||"Unknown",e);return objectAssign({},c,{},d)}function Bf(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||tf;uf=J.current;I(J,b);I(K,K.current);return !0} + function Cf(a,b,c){var d=a.stateNode;if(!d)throw t(Error(169));c?(b=Af(a,b,uf),d.__reactInternalMemoizedMergedChildContext=b,H(K),H(J),I(J,b)):H(K);I(K,c);} + var Df=scheduler.unstable_runWithPriority,Ef=scheduler.unstable_scheduleCallback,Ff=scheduler.unstable_cancelCallback,Gf=scheduler.unstable_shouldYield,Hf=scheduler.unstable_requestPaint,If=scheduler.unstable_now,Jf=scheduler.unstable_getCurrentPriorityLevel,Kf=scheduler.unstable_ImmediatePriority,Lf=scheduler.unstable_UserBlockingPriority,Mf=scheduler.unstable_NormalPriority,Nf=scheduler.unstable_LowPriority,Of=scheduler.unstable_IdlePriority,Pf={},Qf=void 0!==Hf?Hf:function(){},Rf=null,Sf=null,Tf=!1,Uf=If(),Vf=1E4>Uf?If:function(){return If()-Uf}; + function Wf(){switch(Jf()){case Kf:return 99;case Lf:return 98;case Mf:return 97;case Nf:return 96;case Of:return 95;default:throw t(Error(332));}}function Xf(a){switch(a){case 99:return Kf;case 98:return Lf;case 97:return Mf;case 96:return Nf;case 95:return Of;default:throw t(Error(332));}}function Yf(a,b){a=Xf(a);return Df(a,b)}function Zf(a,b,c){a=Xf(a);return Ef(a,b,c)}function $f(a){null===Rf?(Rf=[a],Sf=Ef(Kf,ag)):Rf.push(a);return Pf}function bg(){if(null!==Sf){var a=Sf;Sf=null;Ff(a);}ag();} + function ag(){if(!Tf&&null!==Rf){Tf=!0;var a=0;try{var b=Rf;Yf(99,function(){for(;a=b&&(mg=!0),a.firstContext=null);} + function ng(a,b){if(gg!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)gg=a,b=1073741823;b={context:a,observedBits:b,next:null};if(null===fg){if(null===eg)throw t(Error(308));fg=b;eg.dependencies={expirationTime:0,firstContext:b,responders:null};}else fg=fg.next=b;}return a._currentValue}var og=!1; + function pg(a){return {baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function qg(a){return {baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}} + function rg(a,b){return {expirationTime:a,suspenseConfig:b,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function sg(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b);} + function tg(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=pg(a.memoizedState));}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=pg(a.memoizedState),e=c.updateQueue=pg(c.memoizedState)):d=a.updateQueue=qg(e):null===e&&(e=c.updateQueue=qg(d));null===e||d===e?sg(d,b):null===d.lastUpdate||null===e.lastUpdate?(sg(d,b),sg(e,b)):(sg(d,b),e.lastUpdate=b);} + function ug(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=pg(a.memoizedState):vg(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b);}function vg(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=qg(b));return b} + function wg(a,b,c,d,e,f){switch(c.tag){case 1:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case 3:a.effectTag=a.effectTag&-4097|64;case 0:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return objectAssign({},d,e);case 2:og=!0;}return d} + function xg(a,b,c,d,e){og=!1;b=vg(a,b);for(var f=b.baseState,g=null,h=0,k=b.firstUpdate,l=f;null!==k;){var m=k.expirationTime;my?(z=q,q=null):z=q.sibling;var p=w(e,q,h[y],k);if(null===p){null===q&&(q=z);break}a&& + q&&null===p.alternate&&b(e,q);g=f(p,g,y);null===m?l=p:m.sibling=p;m=p;q=z;}if(y===h.length)return c(e,q),l;if(null===q){for(;yy?(z=q,q=null):z=q.sibling;var M=w(e,q,p.value,k);if(null===M){null===q&&(q=z);break}a&&q&&null===M.alternate&&b(e,q);g=f(M,g,y);null===m?l=M:m.sibling=M;m=M;q=z;}if(p.done)return c(e,q),l;if(null===q){for(;!p.done;y++,p=h.next())p=A(e,p.value,k),null!==p&&(g=f(p,g,y),null===m?l=p:m.sibling=p,m=p);return l}for(q=d(e,q);!p.done;y++,p=h.next())p=L(q,e,y,p.value,k),null!==p&&(a&&null!== + p.alternate&&q.delete(null===p.key?y:p.key),g=f(p,g,y),null===m?l=p:m.sibling=p,m=p);a&&q.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===Ha&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Fa:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){if(7===k.tag?f.type===Ha:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===Ha?f.props.children:f.props);d.ref=Og(a,k,f);d.return=a;a=d;break a}c(a, + k);break}else b(a,k);k=k.sibling;}f.type===Ha?(d=Vg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Tg(f.type,f.key,f.props,null,a.mode,h),h.ref=Og(a,d,f),h.return=a,a=h);}return g(a);case Ga:a:{for(k=f.key;null!==d;){if(d.key===k){if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}c(a,d);break}else b(a,d);d=d.sibling;}d=Ug(f,a.mode,h);d.return=a;a=d;}return g(a)}if("string"===typeof f|| + "number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Sg(f,a.mode,h),d.return=a,a=d),g(a);if(Ng(f))return wb(a,d,f,h);if(Ta(f))return M(a,d,f,h);l&&Pg(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:throw a=a.type,t(Error(152),a.displayName||a.name||"Component");}return c(a,d)}}var Wg=Qg(!0),Xg=Qg(!1),Yg={},Zg={current:Yg},$g={current:Yg},ah={current:Yg};function bh(a){if(a===Yg)throw t(Error(174));return a} + function ch(a,b){I(ah,b);I($g,a);I(Zg,Yg);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:Qb(null,"");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=Qb(b,c);}H(Zg);I(Zg,b);}function dh(a){H(Zg);H($g);H(ah);}function eh(a){bh(ah.current);var b=bh(Zg.current);var c=Qb(b,a.type);b!==c&&(I($g,a),I(Zg,c));}function fh(a){$g.current===a&&(H(Zg),H($g));}var O={current:0}; + function gh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||c.data===be||c.data===ce))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if((b.effectTag&64)!==D)return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return;}b.sibling.return=b.return;b=b.sibling;}return null}function hh(a,b){return {responder:a,props:b}} + var ih=Da.ReactCurrentDispatcher,jh=0,kh=null,P=null,lh=null,mh=null,Q=null,nh=null,oh=0,ph=null,qh=0,rh=!1,sh=null,th=0;function uh(){throw t(Error(321));}function vh(a,b){if(null===b)return !1;for(var c=0;coh&&(oh=m,zg(oh))):(yg(m,k.suspenseConfig),f=k.eagerReducer===a?k.eagerState:a(f,k.action));g=k;k=k.next;}while(null!==k&&k!==d);l||(h=g,e=f);ff(f,b.memoizedState)||(mg=!0);b.memoizedState=f;b.baseUpdate=h;b.baseState=e;c.lastRenderedState=f;}return [b.memoizedState,c.dispatch]} + function Ih(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===ph?(ph={lastEffect:null},ph.lastEffect=a.next=a):(b=ph.lastEffect,null===b?ph.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,ph.lastEffect=a));return a}function Jh(a,b,c,d){var e=Eh();qh|=a;e.memoizedState=Ih(b,c,void 0,void 0===d?null:d);} + function Kh(a,b,c,d){var e=Fh();d=void 0===d?null:d;var f=void 0;if(null!==P){var g=P.memoizedState;f=g.destroy;if(null!==d&&vh(d,g.deps)){Ih(0,c,f,d);return}}qh|=a;e.memoizedState=Ih(b,c,f,d);}function Lh(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null);};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null;}}function Mh(){} + function Nh(a,b,c){if(!(25>th))throw t(Error(301));var d=a.alternate;if(a===kh||null!==d&&d===kh)if(rh=!0,a={expirationTime:jh,suspenseConfig:null,action:c,eagerReducer:null,eagerState:null,next:null},null===sh&&(sh=new Map),c=sh.get(b),void 0===c)sh.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a;}else{var e=Fg(),f=Cg.suspense;e=Gg(e,a,f);f={expirationTime:e,suspenseConfig:f,action:c,eagerReducer:null,eagerState:null,next:null};var g=b.last;if(null===g)f.next=f;else{var h=g.next;null!==h&& + (f.next=h);g.next=f;}b.last=f;if(0===a.expirationTime&&(null===d||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var k=b.lastRenderedState,l=d(k,c);f.eagerReducer=d;f.eagerState=l;if(ff(l,k))return}catch(m){}finally{}Hg(a,e);}} + var zh={readContext:ng,useCallback:uh,useContext:uh,useEffect:uh,useImperativeHandle:uh,useLayoutEffect:uh,useMemo:uh,useReducer:uh,useRef:uh,useState:uh,useDebugValue:uh,useResponder:uh},xh={readContext:ng,useCallback:function(a,b){Eh().memoizedState=[a,void 0===b?null:b];return a},useContext:ng,useEffect:function(a,b){return Jh(516,192,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Jh(4,36,Lh.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Jh(4, + 36,a,b)},useMemo:function(a,b){var c=Eh();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Eh();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=Nh.bind(null,kh,a);return [d.memoizedState,a]},useRef:function(a){var b=Eh();a={current:a};return b.memoizedState=a},useState:function(a){var b=Eh();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={last:null, + dispatch:null,lastRenderedReducer:Gh,lastRenderedState:a};a=a.dispatch=Nh.bind(null,kh,a);return [b.memoizedState,a]},useDebugValue:Mh,useResponder:hh},yh={readContext:ng,useCallback:function(a,b){var c=Fh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&vh(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:ng,useEffect:function(a,b){return Kh(516,192,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Kh(4,36,Lh.bind(null,b,a),c)}, + useLayoutEffect:function(a,b){return Kh(4,36,a,b)},useMemo:function(a,b){var c=Fh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&vh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:Hh,useRef:function(){return Fh().memoizedState},useState:function(a){return Hh(Gh)},useDebugValue:Mh,useResponder:hh},Oh=null,Ph=null,Qh=!1; + function Rh(a,b){var c=Sh(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c;}function Th(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return !1;default:return !1}} + function Uh(a){if(Qh){var b=Ph;if(b){var c=b;if(!Th(a,b)){b=je(c.nextSibling);if(!b||!Th(a,b)){a.effectTag=a.effectTag&~Ac|E;Qh=!1;Oh=a;return}Rh(Oh,c);}Oh=a;Ph=je(b.firstChild);}else a.effectTag=a.effectTag&~Ac|E,Qh=!1,Oh=a;}}function Vh(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;Oh=a;} + function Wh(a){if(a!==Oh)return !1;if(!Qh)return Vh(a),Qh=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!ge(b,a.memoizedProps))for(b=Ph;b;)Rh(a,b),b=je(b.nextSibling);Vh(a);if(13===a.tag)if(a=a.memoizedState,a=null!==a?a.dehydrated:null,null===a)a=Ph;else a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if(c===ae){if(0===b){a=je(a.nextSibling);break a}b--;}else c!==$d&&c!==ce&&c!==be||b++;}a=a.nextSibling;}a=null;}else a=Oh?je(a.stateNode.nextSibling):null;Ph=a;return !0} + function Xh(){Ph=Oh=null;Qh=!1;}var Yh=Da.ReactCurrentOwner,mg=!1;function R(a,b,c,d){b.child=null===a?Xg(b,null,c,d):Wg(b,a.child,c,d);}function Zh(a,b,c,d,e){c=c.render;var f=b.ref;lg(b,e);d=wh(a,b,c,d,f,e);if(null!==a&&!mg)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),$h(a,b,e);b.effectTag|=1;R(a,b,d,e);return b.child} + function ai(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!bi(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,ci(a,b,g,d,e,f);a=Tg(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(eb)&&rj.set(a,b)));}} + function wj(a,b){a.expirationTimea?b:a} + function Z(a){if(0!==a.lastExpiredTime)a.callbackExpirationTime=1073741823,a.callbackPriority=99,a.callbackNode=$f(xj.bind(null,a));else{var b=Aj(a),c=a.callbackNode;if(0===b)null!==c&&(a.callbackNode=null,a.callbackExpirationTime=0,a.callbackPriority=90);else{var d=Fg();1073741823===b?d=99:1===b||2===b?d=95:(d=10*(1073741821-b)-10*(1073741821-d),d=0>=d?99:250>=d?98:5250>=d?97:95);if(null!==c){var e=a.callbackPriority;if(a.callbackExpirationTime===b&&e>=d)return;c!==Pf&&Ff(c);}a.callbackExpirationTime= + b;a.callbackPriority=d;b=1073741823===b?$f(xj.bind(null,a)):Zf(d,Cj.bind(null,a),{timeout:10*(1073741821-b)-Vf()});a.callbackNode=b;}}} + function Cj(a,b){uj=0;if(b)return b=Fg(),Dj(a,b),Z(a),null;var c=Aj(a);if(0!==c){b=a.callbackNode;if((T&(Zi|$i))!==S)throw t(Error(327));Ej();a===U&&c===W||Fj(a,c);if(null!==V){var d=T;T|=Zi;var e=Gj();do try{Hj();break}catch(h){Ij(a,h);}while(1);hg();T=d;Wi.current=e;if(X===bj)throw b=hj,Fj(a,c),yj(a,c),Z(a),b;if(null===V)switch(e=a.finishedWork=a.current.alternate,a.finishedExpirationTime=c,Jj(a,c),d=X,U=null,d){case aj:case bj:throw t(Error(345));case cj:if(2!==c){Dj(a,2);break}Kj(a);break;case dj:yj(a, + c);d=a.lastSuspendedTime;c===d&&(a.nextKnownPendingLevel=Lj(e));if(1073741823===ij&&(e=Mi+nj-Vf(),10=c){a.lastPingedTime=c;Fj(a,c);break}}f=Aj(a);if(0!==f&&f!==c)break;if(0!==d&&d!==c){a.lastPingedTime=d;break}a.timeoutHandle=he(Kj.bind(null,a),e);break}Kj(a);break;case ej:yj(a,c);d=a.lastSuspendedTime;c===d&&(a.nextKnownPendingLevel=Lj(e));if(mj&&(e=a.lastPingedTime,0===e||e>=c)){a.lastPingedTime=c;Fj(a,c);break}e=Aj(a);if(0!==e&&e!==c)break;if(0!== + d&&d!==c){a.lastPingedTime=d;break}1073741823!==jj?d=10*(1073741821-jj)-Vf():1073741823===ij?d=0:(d=10*(1073741821-ij)-5E3,e=Vf(),c=10*(1073741821-c)-e,d=e-d,0>d&&(d=0),d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*Vi(d/1960))-d,c=d?d=0:(e=g.busyDelayMs|0,f=Vf()-(10*(1073741821-f)-(g.timeoutMs|0||5E3)),d=f<=e?0:e+d-f); + if(10=b&&(Zf(97,function(){c._onComplete();return null}),X=gj);}function Oj(){if(null!==rj){var a=rj;rj=null;a.forEach(function(a,c){Dj(c,a);Z(c);});bg();}}function Pj(a,b){var c=T;T|=1;try{return a(b)}finally{T=c,T===S&&bg();}}function Qj(a,b,c,d){var e=T;T|=4;try{return Yf(98,a.bind(null,b,c,d))}finally{T=e,T===S&&bg();}} + function Rj(a,b){var c=T;T&=-2;T|=Yi;try{return a(b)}finally{T=c,T===S&&bg();}} + function Fj(a,b){a.finishedWork=null;a.finishedExpirationTime=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,ie(c));if(null!==V)for(c=V.return;null!==c;){var d=c;switch(d.tag){case 1:var e=d.type.childContextTypes;null!==e&&void 0!==e&&wf();break;case 3:dh();xf();break;case 5:fh(d);break;case 4:dh();break;case 13:H(O);break;case 19:H(O);break;case 10:jg(d);}c=c.return;}U=a;V=Rg(a.current,null);W=b;X=aj;hj=null;jj=ij=1073741823;kj=null;lj=0;mj=!1;} + function Ij(a,b){do{try{hg();Ah();if(null===V||null===V.return)return X=bj,hj=b,null;a:{var c=a,d=V.return,e=V,f=b;b=W;e.effectTag|=2048;e.firstEffect=e.lastEffect=null;if(null!==f&&"object"===typeof f&&"function"===typeof f.then){var g=f,h=0!==(O.current&1),k=d;do{var l;if(l=13===k.tag){var m=k.memoizedState;if(null!==m)l=null!==m.dehydrated?!0:!1;else{var A=k.memoizedProps;l=void 0===A.fallback?!1:!0!==A.unstable_avoidThisFallback?!0:h?!1:!0;}}if(l){var w=k.updateQueue;if(null===w){var L=new Set; + L.add(g);k.updateQueue=L;}else w.add(g);if(0===(k.mode&2)){k.effectTag|=64;e.effectTag&=-2981;if(1===e.tag)if(null===e.alternate)e.tag=17;else{var wb=rg(1073741823,null);wb.tag=2;tg(e,wb);}e.expirationTime=1073741823;break a}f=void 0;e=b;var M=c.pingCache;null===M?(M=c.pingCache=new Pi,f=new Set,M.set(g,f)):(f=M.get(g),void 0===f&&(f=new Set,M.set(g,f)));if(!f.has(e)){f.add(e);var q=Sj.bind(null,c,g,e);g.then(q,q);}k.effectTag|=4096;k.expirationTime=b;break a}k=k.return;}while(null!==k);f=Error((Va(e.type)|| + "A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display."+Wa(e));}X!==fj&&(X=cj);f=ti(f,e);k=d;do{switch(k.tag){case 3:g=f;k.effectTag|=4096;k.expirationTime=b;var y=Qi(k,g,b);ug(k,y);break a;case 1:g=f;var z=k.type,p=k.stateNode;if((k.effectTag&64)===D&&("function"===typeof z.getDerivedStateFromError||null!==p&&"function"===typeof p.componentDidCatch&& + (null===Ui||!Ui.has(p)))){k.effectTag|=4096;k.expirationTime=b;var u=Ti(k,g,b);ug(k,u);break a}}k=k.return;}while(null!==k)}V=Tj(V);}catch(v){b=v;continue}break}while(1)}function Gj(){var a=Wi.current;Wi.current=zh;return null===a?zh:a}function yg(a,b){alj&&(lj=a);}function Mj(){for(;null!==V;)V=Uj(V);}function Hj(){for(;null!==V&&!Gf();)V=Uj(V);} + function Uj(a){var b=Vj(a.alternate,a,W);a.memoizedProps=a.pendingProps;null===b&&(b=Tj(a));Xi.current=null;return b} + function Tj(a){V=a;do{var b=V.alternate;a=V.return;if((V.effectTag&2048)===D){a:{var c=b;b=V;var d=W,e=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:N(b.type)&&wf();break;case 3:dh();xf();d=b.stateNode;d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);(null===c||null===c.child)&&Wh(b)&&mi(b);oi(b);break;case 5:fh(b);d=bh(ah.current);var f=b.type;if(null!==c&&null!=b.stateNode)pi(c,b,f,e,d),c.ref!==b.ref&&(b.effectTag|=128);else if(e){var g= + bh(Zg.current);if(Wh(b)){e=b;f=void 0;c=e.stateNode;var h=e.type,k=e.memoizedProps;c[me]=e;c[ne]=k;switch(h){case "iframe":case "object":case "embed":G("load",c);break;case "video":case "audio":for(var l=0;l\x3c/script>",l=k.removeChild(k.firstChild)):"string"===typeof c.is?l=l.createElement(k,{is:c.is}):(l=l.createElement(k),"select"===k&&(k=l,c.multiple?k.multiple=!0:c.size&&(k.size=c.size))):l=l.createElementNS(g,k);k=l;k[me]=h;k[ne]=c;c=k;ni(c,b,!1,!1);b.stateNode=c;g=d;var m=Rd(f,e);switch(f){case "iframe":case "object":case "embed":G("load", + c);d=e;break;case "video":case "audio":for(d=0;de.tailExpiration&&1e&&(e=c),h>e&&(e=h),f=f.sibling;d.childExpirationTime=e;}if(null!==b)return b;null!==a&&(a.effectTag&2048)===D&&(null===a.firstEffect&&(a.firstEffect=V.firstEffect),null!==V.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=V.firstEffect),a.lastEffect=V.lastEffect),1a?b:a}function Kj(a){var b=Wf();Yf(99,Wj.bind(null,a,b));return null} + function Wj(a,b){Ej();if((T&(Zi|$i))!==S)throw t(Error(327));var c=a.finishedWork,d=a.finishedExpirationTime;if(null===c)return null;a.finishedWork=null;a.finishedExpirationTime=0;if(c===a.current)throw t(Error(177));a.callbackNode=null;a.callbackExpirationTime=0;a.callbackPriority=90;a.nextKnownPendingLevel=0;var e=Lj(c);a.firstPendingTime=e;d<=a.lastSuspendedTime?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:d<=a.firstSuspendedTime&&(a.firstSuspendedTime=d-1);d<=a.lastPingedTime&& + (a.lastPingedTime=0);d<=a.lastExpiredTime&&(a.lastExpiredTime=0);a===U&&(V=U=null,W=0);1h&&(l=h,h=g,g=l),l=Wd(p,g),m=Wd(p,h),l&&m&&(1!==v.rangeCount||v.anchorNode!==l.node||v.anchorOffset!==l.offset||v.focusNode!==m.node||v.focusOffset!==m.offset)&&(u=u.createRange(),u.setStart(l.node,l.offset),v.removeAllRanges(),g>h?(v.addRange(u),v.extend(m.node,m.offset)):(u.setEnd(m.node,m.offset),v.addRange(u))))));u=[];for(v=p;v=v.parentNode;)1===v.nodeType&&u.push({element:v,left:v.scrollLeft,top:v.scrollTop});"function"=== + typeof p.focus&&p.focus();for(p=0;p=c)return ji(a,b,c);I(O,O.current& + 1);b=$h(a,b,c);return null!==b?b.sibling:null}I(O,O.current&1);break;case 19:d=b.childExpirationTime>=c;if((a.effectTag&64)!==D){if(d)return li(a,b,c);b.effectTag|=64;}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null);I(O,O.current);if(!d)return null}return $h(a,b,c)}mg=!1;}}else mg=!1;b.expirationTime=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=E);a=b.pendingProps;e=vf(b,J.current);lg(b,c);e=wh(null,b,d,a,e,c);b.effectTag|=1;if("object"=== + typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;Ah();if(N(d)){var f=!0;Bf(b);}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&Eg(b,d,g,a);e.updater=Ig;b.stateNode=e;e._reactInternalFiber=b;Mg(b,d,a,c);b=gi(null,b,d,!0,f,c);}else b.tag=0,R(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=E);a=b.pendingProps;Ua(e);if(1!==e._status)throw e._result; + e=e._result;b.type=e;f=b.tag=ck(e);a=cg(e,a);switch(f){case 0:b=di(null,b,e,a,c);break;case 1:b=fi(null,b,e,a,c);break;case 11:b=Zh(null,b,e,a,c);break;case 14:b=ai(null,b,e,cg(e.type,a),d,c);break;default:throw t(Error(306),e,"");}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:cg(d,e),di(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:cg(d,e),fi(a,b,d,e,c);case 3:hi(b);d=b.updateQueue;if(null===d)throw t(Error(282));e=b.memoizedState;e=null!==e?e.element: + null;xg(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)Xh(),b=$h(a,b,c);else{if(e=b.stateNode.hydrate)Ph=je(b.stateNode.containerInfo.firstChild),Oh=b,e=Qh=!0;if(e)for(c=Xg(b,null,d,c),b.child=c;c;)c.effectTag=c.effectTag&~E|Ac,c=c.sibling;else R(a,b,d,c),Xh();b=b.child;}return b;case 5:return eh(b),null===a&&Uh(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,ge(d,e)?g=null:null!==f&&ge(d,f)&&(b.effectTag|=16),ei(a,b),b.mode&4&&1!==c&&e.hidden?(b.expirationTime= + b.childExpirationTime=1,b=null):(R(a,b,g,c),b=b.child),b;case 6:return null===a&&Uh(b),null;case 13:return ji(a,b,c);case 4:return ch(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Wg(b,null,d,c):R(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:cg(d,e),Zh(a,b,d,e,c);case 7:return R(a,b,b.pendingProps,c),b.child;case 8:return R(a,b,b.pendingProps.children,c),b.child;case 12:return R(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context; + e=b.pendingProps;g=b.memoizedProps;f=e.value;ig(b,f);if(null!==g){var h=g.value;f=ff(h,f)?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!K.current){b=$h(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.dependencies;if(null!==k){g=h.child;for(var l=k.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=rg(c,null),l.tag=2,tg(h,l));h.expirationTime=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a);}return a}; - function Hj(a){return !(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}Jb=ej;Kb=fj;Lb=aj;Mb=function(a,b){var c=U;U|=2;try{return a(b)}finally{U=c,U===T&&O();}};function Ij(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new Dj(a,0,b)} - function Jj(a,b,c,d,e){var f=c._reactRootContainer,h=void 0;if(f){h=f._internalRoot;if("function"===typeof e){var g=e;e=function(){var a=zj(h);g.call(a);};}yj(b,h,a,e);}else{f=c._reactRootContainer=Ij(c,d);h=f._internalRoot;if("function"===typeof e){var k=e;e=function(){var a=zj(h);k.call(a);};}gj(function(){yj(b,h,a,e);});}return zj(h)}function Kj(a,b){var c=2=b&&a<=b}function yj(a,b){var c=a.firstSuspendedTime,d=a.lastSuspendedTime;cb||0===c)a.lastSuspendedTime=b;b<=a.lastPingedTime&&(a.lastPingedTime=0);b<=a.lastExpiredTime&&(a.lastExpiredTime=0);} + function zj(a,b){b>a.firstPendingTime&&(a.firstPendingTime=b);var c=a.firstSuspendedTime;0!==c&&(b>=c?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:b>=a.lastSuspendedTime&&(a.lastSuspendedTime=b+1),b>a.nextKnownPendingLevel&&(a.nextKnownPendingLevel=b));}function Dj(a,b){var c=a.lastExpiredTime;if(0===c||c>b)a.lastExpiredTime=b;} + function gk(a,b,c,d,e,f){var g=b.current;a:if(c){c=c._reactInternalFiber;b:{if(Bc(c)!==c||1!==c.tag)throw t(Error(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break b;case 1:if(N(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}}h=h.return;}while(null!==h);throw t(Error(171));}if(1===c.tag){var k=c.type;if(N(k)){c=Af(c,k,h);break a}}c=h;}else c=tf;null===b.context?b.context=c:b.pendingContext=c;b=f;e=rg(d,e);e.payload={element:a};b=void 0===b?null:b;null!==b&& + (e.callback=b);tg(g,e);Hg(g,d);return d}function hk(a,b,c,d){var e=b.current,f=Fg(),g=Cg.suspense;e=Gg(f,e,g);return gk(a,b,c,e,g,d)}function ik(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function jk(a,b,c){var d=3=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a);}return a};function qk(a){return !(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}db=Pj;eb=Qj;fb=Nj;gb=function(a,b){var c=T;T|=2;try{return a(b)}finally{T=c,T===S&&bg();}}; + function rk(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new nk(a,0,b?{hydrate:!0}:void 0)} + function sk(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f._internalRoot;if("function"===typeof e){var h=e;e=function(){var a=ik(g);h.call(a);};}hk(b,g,a,e);}else{f=c._reactRootContainer=rk(c,d);g=f._internalRoot;if("function"===typeof e){var k=e;e=function(){var a=ik(g);k.call(a);};}Rj(function(){hk(b,g,a,e);});}return ik(g)}function tk(a,b){var c=2 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID; @@ -8219,18 +8144,15 @@ name: name, timestamp: timestamp }; - - var prevInteractions = exports.__interactionsRef.current; - - // Traced interactions should stack/accumulate. + var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate. // To do that, clone the current interactions. // The previous set will be restored upon completion. + var interactions = new Set(prevInteractions); interactions.add(interaction); exports.__interactionsRef.current = interactions; - var subscriber = exports.__subscriberRef.current; - var returnValue = void 0; + var returnValue; try { if (subscriber !== null) { @@ -8252,10 +8174,9 @@ subscriber.onWorkStopped(interactions, threadID); } } finally { - interaction.__count--; - - // If no async work was scheduled for this interaction, + interaction.__count--; // If no async work was scheduled for this interaction, // Notify subscribers that it's completed. + if (subscriber !== null && interaction.__count === 0) { subscriber.onInteractionScheduledWorkCompleted(interaction); } @@ -8266,33 +8187,30 @@ return returnValue; } - function unstable_wrap(callback) { var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID; var wrappedInteractions = exports.__interactionsRef.current; - var subscriber = exports.__subscriberRef.current; + if (subscriber !== null) { subscriber.onWorkScheduled(wrappedInteractions, threadID); - } - - // Update the pending async work count for the current interactions. + } // Update the pending async work count for the current interactions. // Update after calling subscribers in case of error. + + wrappedInteractions.forEach(function (interaction) { interaction.__count++; }); - var hasRun = false; function wrapped() { var prevInteractions = exports.__interactionsRef.current; exports.__interactionsRef.current = wrappedInteractions; - subscriber = exports.__subscriberRef.current; try { - var returnValue = void 0; + var returnValue; try { if (subscriber !== null) { @@ -8316,11 +8234,10 @@ // We only expect a wrapped function to be executed once, // But in the event that it's executed more than once– // Only decrement the outstanding interaction counts once. - hasRun = true; - - // Update pending async counts for all wrapped interactions. + hasRun = true; // Update pending async counts for all wrapped interactions. // If this was the last scheduled async work for any of them, // Mark them as completed. + wrappedInteractions.forEach(function (interaction) { interaction.__count--; @@ -8357,6 +8274,7 @@ } var subscribers = null; + { subscribers = new Set(); } @@ -8377,7 +8295,6 @@ } } } - function unstable_unsubscribe(subscriber) { { subscribers.delete(subscriber); @@ -8391,7 +8308,6 @@ function onInteractionTraced(interaction) { var didCatchError = false; var caughtError = null; - subscribers.forEach(function (subscriber) { try { subscriber.onInteractionTraced(interaction); @@ -8411,7 +8327,6 @@ function onInteractionScheduledWorkCompleted(interaction) { var didCatchError = false; var caughtError = null; - subscribers.forEach(function (subscriber) { try { subscriber.onInteractionScheduledWorkCompleted(interaction); @@ -8431,7 +8346,6 @@ function onWorkScheduled(interactions, threadID) { var didCatchError = false; var caughtError = null; - subscribers.forEach(function (subscriber) { try { subscriber.onWorkScheduled(interactions, threadID); @@ -8451,7 +8365,6 @@ function onWorkStarted(interactions, threadID) { var didCatchError = false; var caughtError = null; - subscribers.forEach(function (subscriber) { try { subscriber.onWorkStarted(interactions, threadID); @@ -8471,7 +8384,6 @@ function onWorkStopped(interactions, threadID) { var didCatchError = false; var caughtError = null; - subscribers.forEach(function (subscriber) { try { subscriber.onWorkStopped(interactions, threadID); @@ -8491,7 +8403,6 @@ function onWorkCanceled(interactions, threadID) { var didCatchError = false; var caughtError = null; - subscribers.forEach(function (subscriber) { try { subscriber.onWorkCanceled(interactions, threadID); @@ -8548,8 +8459,8 @@ var React = React__default; var _assign = objectAssign; - var checkPropTypes = checkPropTypes_1; var Scheduler = scheduler; + var checkPropTypes = checkPropTypes_1; var tracing$1 = tracing; // Do not require this module directly! Use normal `invariant` calls with @@ -8559,7 +8470,6 @@ // Do not require this module directly! Use normal `invariant` calls with // template literal strings. The messages will be converted to ReactError during // build, and in production they will be minified. - function ReactError(error) { error.name = 'Invariant Violation'; return error; @@ -8579,7 +8489,7 @@ (function () { if (!React) { { - throw ReactError(Error('ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.')); + throw ReactError(Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.")); } } })(); @@ -8588,56 +8498,61 @@ * Injectable ordering of event plugins. */ var eventPluginOrder = null; - /** * Injectable mapping from names to event plugin modules. */ - var namesToPlugins = {}; + var namesToPlugins = {}; /** * Recomputes the plugin list using the injected plugins and plugin ordering. * * @private */ + function recomputePluginOrdering() { if (!eventPluginOrder) { // Wait until an `eventPluginOrder` is injected. return; } + for (var pluginName in namesToPlugins) { var pluginModule = namesToPlugins[pluginName]; var pluginIndex = eventPluginOrder.indexOf(pluginName); + (function () { if (!(pluginIndex > -1)) { { - throw ReactError(Error('EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `' + pluginName + '`.')); + throw ReactError(Error("EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`.")); } } })(); + if (plugins[pluginIndex]) { continue; } + (function () { if (!pluginModule.extractEvents) { { - throw ReactError(Error('EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `' + pluginName + '` does not.')); + throw ReactError(Error("EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not.")); } } })(); + plugins[pluginIndex] = pluginModule; var publishedEvents = pluginModule.eventTypes; + for (var eventName in publishedEvents) { (function () { if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) { { - throw ReactError(Error('EventPluginRegistry: Failed to publish event `' + eventName + '` for plugin `' + pluginName + '`.')); + throw ReactError(Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`.")); } } })(); } } } - /** * Publishes an event so that it can be dispatched by the supplied plugin. * @@ -8646,17 +8561,20 @@ * @return {boolean} True if the event was successfully published. * @private */ + + function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { (function () { if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) { { - throw ReactError(Error('EventPluginHub: More than one plugin attempted to publish the same event name, `' + eventName + '`.')); + throw ReactError(Error("EventPluginHub: More than one plugin attempted to publish the same event name, `" + eventName + "`.")); } } })(); - eventNameDispatchConfigs[eventName] = dispatchConfig; + eventNameDispatchConfigs[eventName] = dispatchConfig; var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + if (phasedRegistrationNames) { for (var phaseName in phasedRegistrationNames) { if (phasedRegistrationNames.hasOwnProperty(phaseName)) { @@ -8664,14 +8582,15 @@ publishRegistrationName(phasedRegistrationName, pluginModule, eventName); } } + return true; } else if (dispatchConfig.registrationName) { publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); return true; } + return false; } - /** * Publishes a registration name that is used to identify dispatched events. * @@ -8679,14 +8598,17 @@ * @param {object} PluginModule Plugin publishing the event. * @private */ + + function publishRegistrationName(registrationName, pluginModule, eventName) { (function () { if (!!registrationNameModules[registrationName]) { { - throw ReactError(Error('EventPluginHub: More than one plugin attempted to publish the same registration name, `' + registrationName + '`.')); + throw ReactError(Error("EventPluginHub: More than one plugin attempted to publish the same registration name, `" + registrationName + "`.")); } } })(); + registrationNameModules[registrationName] = pluginModule; registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; @@ -8699,7 +8621,6 @@ } } } - /** * Registers plugins so that they can extract and dispatch events. * @@ -8709,31 +8630,32 @@ /** * Ordered list of injected plugins. */ - var plugins = []; + + var plugins = []; /** * Mapping from event name to dispatch config */ - var eventNameDispatchConfigs = {}; + var eventNameDispatchConfigs = {}; /** * Mapping from registration name to plugin module */ - var registrationNameModules = {}; + var registrationNameModules = {}; /** * Mapping from registration name to event name */ - var registrationNameDependencies = {}; + var registrationNameDependencies = {}; /** * 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} */ - var possibleRegistrationNames = {}; - // Trust the developer to only use possibleRegistrationNames in true + + var possibleRegistrationNames = {}; // Trust the developer to only use possibleRegistrationNames in true /** * Injects an ordering of plugins (by plugin name). This allows the ordering @@ -8744,19 +8666,20 @@ * @internal * @see {EventPluginHub.injection.injectEventPluginOrder} */ + function injectEventPluginOrder(injectedEventPluginOrder) { (function () { if (!!eventPluginOrder) { { - throw ReactError(Error('EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.')); + throw ReactError(Error("EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.")); } } - })(); - // Clone the ordering so it cannot be dynamically mutated. + })(); // Clone the ordering so it cannot be dynamically mutated. + + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); recomputePluginOrdering(); } - /** * Injects plugins to be used by `EventPluginHub`. The plugin names must be * in the ordering injected by `injectEventPluginOrder`. @@ -8767,25 +8690,31 @@ * @internal * @see {EventPluginHub.injection.injectEventPluginsByName} */ + function injectEventPluginsByName(injectedNamesToPlugins) { var isOrderingDirty = false; + for (var pluginName in injectedNamesToPlugins) { if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { continue; } + var pluginModule = injectedNamesToPlugins[pluginName]; + if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { (function () { if (!!namesToPlugins[pluginName]) { { - throw ReactError(Error('EventPluginRegistry: Cannot inject two different event plugins using the same name, `' + pluginName + '`.')); + throw ReactError(Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`.")); } } })(); + namesToPlugins[pluginName] = pluginModule; isOrderingDirty = true; } } + if (isOrderingDirty) { recomputePluginOrdering(); } @@ -8793,6 +8722,7 @@ var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) { var funcArgs = Array.prototype.slice.call(arguments, 3); + try { func.apply(context, funcArgs); } catch (error) { @@ -8819,7 +8749,6 @@ // 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') { @@ -8833,53 +8762,48 @@ (function () { if (!(typeof document !== 'undefined')) { { - throw ReactError(Error('The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.')); + throw ReactError(Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.")); } } })(); - var evt = document.createEvent('Event'); - // Keeps track of whether the user-provided callback threw an error. We + var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We // set this to true at the beginning, then set it to false right after // calling the function. If the function errors, `didError` will never be // set to false. This strategy works even if the browser is flaky and // fails to call our global error handler, because it doesn't rely on // the error event at all. - var didError = true; - // Keeps track of the value of window.event so that we can reset it + var didError = true; // Keeps track of the value of window.event so that we can reset it // during the callback to let user code access window.event in the // browsers that support it. - var windowEvent = window.event; - // Keeps track of the descriptor of window.event to restore it after event + var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event // dispatching: https://github.com/facebook/react/issues/13688 - var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); - // Create an event handler for our fake event. We will synchronously + var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously // dispatch our fake event using `dispatchEvent`. Inside the handler, we // call the user-provided callback. + var funcArgs = Array.prototype.slice.call(arguments, 3); + function callCallback() { // We immediately remove the callback from event listeners so that // nested `invokeGuardedCallback` calls do not clash. Otherwise, a // nested call would trigger the fake event handlers of any call higher // in the stack. - fakeNode.removeEventListener(evtType, callCallback, false); - - // We check for window.hasOwnProperty('event') to prevent the + fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the // window.event assignment in both IE <= 10 as they throw an error // "Member not found" in strict mode, and in Firefox which does not // support window.event. + if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) { window.event = windowEvent; } func.apply(context, funcArgs); didError = false; - } - - // Create a global error event handler. We use this to capture the value + } // Create a global error event handler. We use this to capture the value // that was thrown. It's possible that this error handler will fire more // than once; for example, if non-React code also calls `dispatchEvent` // and a handler for that event throws. We should be resilient to most of @@ -8890,17 +8814,21 @@ // erroring and the code that follows the `dispatchEvent` call below. If // the callback doesn't error, but the error event was fired, we know to // ignore it because `didError` will be false, as described above. - var error = void 0; - // Use this to track whether the error event is ever called. + + + var error; // Use this to track whether the error event is ever called. + var didSetError = false; var isCrossOriginError = false; function handleWindowError(event) { error = event.error; didSetError = true; + if (error === null && event.colno === 0 && event.lineno === 0) { isCrossOriginError = true; } + if (event.defaultPrevented) { // Some other error handler has prevented default. // Browsers silence the error report if this happens. @@ -8908,22 +8836,19 @@ if (error != null && typeof error === 'object') { try { error._suppressLogging = true; - } catch (inner) { - // Ignore. + } catch (inner) {// Ignore. } } } - } + } // Create a fake event type. - // Create a fake event type. - var evtType = 'react-' + (name ? name : 'invokeguardedcallback'); - // Attach our event handlers + var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers + window.addEventListener('error', handleWindowError); - fakeNode.addEventListener(evtType, callCallback, false); - - // Synchronously dispatch our fake event. If the user-provided function + fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function // errors, it will trigger our global error handler. + evt.initEvent(evtType, false, false); fakeNode.dispatchEvent(evt); @@ -8938,10 +8863,11 @@ } else if (isCrossOriginError) { error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.'); } - this.onError(error); - } - // Remove our event listeners + this.onError(error); + } // Remove our event listeners + + window.removeEventListener('error', handleWindowError); }; @@ -8951,21 +8877,17 @@ var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; - // Used by Fiber to simulate a try-catch. var hasError = false; - var caughtError = null; + var caughtError = null; // Used by event system to capture/rethrow the first error. - // Used by event system to capture/rethrow the first error. var hasRethrowError = false; var rethrowError = null; - var reporter = { onError: function (error) { hasError = true; caughtError = error; } }; - /** * Call a function while guarding against errors that happens within it. * Returns an error if it throws, otherwise null. @@ -8979,12 +8901,12 @@ * @param {*} context The context to use when calling the function * @param {...*} args Arguments for function */ + function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { hasError = false; caughtError = null; invokeGuardedCallbackImpl$1.apply(reporter, arguments); } - /** * Same as invokeGuardedCallback, but instead of returning an error, it stores * it in a global so it can be rethrown by `rethrowCaughtError` later. @@ -8995,21 +8917,24 @@ * @param {*} context The context to use when calling the function * @param {...*} args Arguments for function */ + function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { invokeGuardedCallback.apply(this, arguments); + if (hasError) { var error = clearCaughtError(); + if (!hasRethrowError) { hasRethrowError = true; rethrowError = error; } } } - /** * During execution of guarded functions we will capture the first error which * we will rethrow to be handled by the top level error handler. */ + function rethrowCaughtError() { if (hasRethrowError) { var error = rethrowError; @@ -9018,11 +8943,9 @@ throw error; } } - function hasCaughtError() { return hasError; } - function clearCaughtError() { if (hasError) { var error = caughtError; @@ -9033,7 +8956,7 @@ (function () { { { - throw ReactError(Error('clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.')); + throw ReactError(Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.")); } } })(); @@ -9046,35 +8969,37 @@ * 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 = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + 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 + 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 @@ -9093,74 +9018,76 @@ var getFiberCurrentPropsFromNode = null; var getInstanceFromNode = null; var getNodeFromInstance = null; - function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; getInstanceFromNode = getInstanceFromNodeImpl; getNodeFromInstance = getNodeFromInstanceImpl; + { !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; } } + var validateEventDispatches; - var validateEventDispatches = 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; - !(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 */ + + function executeDispatch(event, listener, inst) { var type = event.type || 'unknown-event'; event.currentTarget = getNodeFromInstance(inst); invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); event.currentTarget = null; } - /** * Standard/simple iteration through an event's collected dispatches. */ + function executeDispatchesInOrder(event) { var dispatchListeners = event._dispatchListeners; var dispatchInstances = event._dispatchInstances; + { 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. + } // Listeners and Instances are two parallel arrays that are always in sync. + + executeDispatch(event, dispatchListeners[i], dispatchInstances[i]); } } else if (dispatchListeners) { executeDispatch(event, dispatchListeners, dispatchInstances); } + event._dispatchListeners = null; event._dispatchInstances = null; } - /** * @see executeDispatchesInOrderStopAtTrueImpl */ + /** * 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 @@ -9194,22 +9121,23 @@ (function () { if (!(next != null)) { { - throw ReactError(Error('accumulateInto(...): Accumulated items must not be null or undefined.')); + throw ReactError(Error("accumulateInto(...): Accumulated items must not be null or undefined.")); } } })(); if (current == null) { return next; - } - - // Both are not empty. Warning: Never call x.concat(y) when you are not + } // 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; } + current.push(next); return current; } @@ -9243,14 +9171,15 @@ * Internal queue of events that have accumulated their dispatches and are * waiting to have their dispatches executed. */ - var eventQueue = null; + var eventQueue = null; /** * Dispatches an event and releases it back into the pool, unless persistent. * * @param {?object} event Synthetic event to be dispatched. * @private */ + var executeDispatchesAndRelease = function (event) { if (event) { executeDispatchesInOrder(event); @@ -9260,6 +9189,7 @@ } } }; + var executeDispatchesAndReleaseTopLevel = function (e) { return executeDispatchesAndRelease(e); }; @@ -9267,10 +9197,10 @@ function runEventsInBatch(events) { if (events !== null) { eventQueue = accumulateInto(eventQueue, events); - } - - // Set `eventQueue` to null before processing it so that we can tell if more + } // Set `eventQueue` to null before processing it so that we can tell if more // events get enqueued while processing. + + var processingEventQueue = eventQueue; eventQueue = null; @@ -9279,14 +9209,16 @@ } forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); + (function () { if (!!eventQueue) { { - throw ReactError(Error('processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.')); + throw ReactError(Error("processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.")); } } - })(); - // This would be a good time to rethrow if any of the event handlers threw. + })(); // This would be a good time to rethrow if any of the event handlers threw. + + rethrowCaughtError(); } @@ -9307,11 +9239,11 @@ 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. * @@ -9338,6 +9270,8 @@ /** * Methods for injecting dependencies. */ + + var injection = { /** * @param {array} InjectedEventPluginOrder @@ -9350,41 +9284,46 @@ */ injectEventPluginsByName: injectEventPluginsByName }; - /** * @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 = void 0; - // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not + 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(stateNode); + if (!props) { // Work in progress. return null; } + listener = props[registrationName]; + if (shouldPreventMouseEvent(registrationName, inst.type, props)) { return null; } + (function () { if (!(!listener || typeof listener === 'function')) { { - throw ReactError(Error('Expected `' + registrationName + '` listener to be a function, instead got a value of `' + typeof listener + '` type.')); + throw ReactError(Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.")); } } })(); + return listener; } - /** * Allows registered plugins an opportunity to extract events from top-level * native browser events. @@ -9392,31 +9331,39 @@ * @return {*} An accumulation of synthetic events. * @internal */ - function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + + function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { var events = null; + for (var i = 0; i < plugins.length; i++) { // Not every plugin in the ordering may be loaded at runtime. var possiblePlugin = plugins[i]; + if (possiblePlugin) { - var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); + if (extractedEvents) { events = accumulateInto(events, extractedEvents); } } } + return events; } - function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { + var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); runEventsInBatch(events); } var FunctionComponent = 0; var ClassComponent = 1; var IndeterminateComponent = 2; // Before we know whether it is function or class + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + var HostComponent = 5; var HostText = 6; var Fragment = 7; @@ -9430,320 +9377,1989 @@ var SimpleMemoComponent = 15; var LazyComponent = 16; var IncompleteClassComponent = 17; - var DehydratedSuspenseComponent = 18; + var DehydratedFragment = 18; var SuspenseListComponent = 19; var FundamentalComponent = 20; + var ScopeComponent = 21; - var randomKey = Math.random().toString(36).slice(2); - var internalInstanceKey = '__reactInternalInstance$' + randomKey; - var internalEventHandlersKey = '__reactEventHandlers$' + randomKey; + 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. - function precacheFiberNode(hostInst, node) { - node[internalInstanceKey] = hostInst; + if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { + ReactSharedInternals.ReactCurrentDispatcher = { + current: null + }; } - /** - * Given a DOM node, return the closest ReactDOMComponent or - * ReactDOMTextComponent instance ancestor. - */ - function getClosestInstanceFromNode(node) { - if (node[internalInstanceKey]) { - return node[internalInstanceKey]; - } - - while (!node[internalInstanceKey]) { - if (node.parentNode) { - node = node.parentNode; - } else { - // Top of the tree. This node must not be part of a React tree (or is - // unmounted, potentially). - return null; - } - } - - var inst = node[internalInstanceKey]; - if (inst.tag === HostComponent || inst.tag === HostText) { - // In Fiber, this will always be the deepest root. - return inst; - } - - return null; + if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { + ReactSharedInternals.ReactCurrentBatchConfig = { + suspense: null + }; } - /** - * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent - * instance, or null if the node was not rendered by this React. - */ - function getInstanceFromNode$1(node) { - var inst = node[internalInstanceKey]; - if (inst) { - if (inst.tag === HostComponent || inst.tag === HostText) { - return inst; - } else { - return null; - } - } - return null; - } + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; + var describeComponentFrame = function (name, source, ownerName) { + var sourceInfo = ''; - /** - * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding - * DOM node. - */ - function getNodeFromInstance$1(inst) { - if (inst.tag === HostComponent || inst.tag === HostText) { - // In Fiber this, is just the state node right now. We assume it will be - // a host component or host text. - return inst.stateNode; - } + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); - // Without this first invariant, passing a non-DOM-component triggers the next - // invariant for a missing parent, which is super confusing. - (function () { { - { - throw ReactError(Error('getNodeFromInstance: Invalid argument.')); + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } } } - })(); - } - function getFiberCurrentPropsFromNode$1(node) { - return node[internalEventHandlersKey] || null; - } - - function updateFiberProps(node, props) { - node[internalEventHandlersKey] = props; - } - - 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; + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; } + + return '\n in ' + (name || 'Unknown') + sourceInfo; + }; + + // 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; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary + // (unstable) APIs that have been removed. Can we remove the symbols? + + + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; + var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== 'object') { + return null; + } + + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + return null; } /** - * Return the lowest common ancestor of A and B, or null if they are in - * different trees. + * 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. */ - function getLowestCommonAncestor(instA, instB) { - var depthA = 0; - for (var tempA = instA; tempA; tempA = getParent(tempA)) { - depthA++; - } - var depthB = 0; - for (var tempB = instB; tempB; tempB = getParent(tempB)) { - depthB++; - } - // If A is deeper, crawl up. - while (depthA - depthB > 0) { - instA = getParent(instA); - depthA--; - } + var warning = warningWithoutStack$1; - // If B is deeper, crawl up. - while (depthB - depthA > 0) { - instB = getParent(instB); - depthB--; - } - - // Walk in lockstep until we find a match. - var depth = depthA; - while (depth--) { - if (instA === instB || instA === instB.alternate) { - return instA; + { + warning = function (condition, format) { + if (condition) { + return; } - instA = getParent(instA); - instB = getParent(instB); - } - return null; + + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args + + for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack])); + }; } - /** - * Return if A is an ancestor of B. - */ + var warning$1 = warning; + var Uninitialized = -1; + var Pending = 0; + var Resolved = 1; + var Rejected = 2; + function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; + } + function initializeLazyComponentType(lazyComponent) { + if (lazyComponent._status === Uninitialized) { + lazyComponent._status = Pending; + var ctor = lazyComponent._ctor; + var thenable = ctor(); + lazyComponent._result = thenable; + thenable.then(function (moduleObject) { + if (lazyComponent._status === Pending) { + var defaultExport = moduleObject.default; - /** - * Return the parent instance of the passed-in instance. - */ + { + if (defaultExport === undefined) { + warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); + } + } - - /** - * Simulates the traversal of a two-phase, capture/bubble event dispatch. - */ - function traverseTwoPhase(inst, fn, arg) { - var path = []; - while (inst) { - path.push(inst); - inst = getParent(inst); - } - var i = void 0; - for (i = path.length; i-- > 0;) { - fn(path[i], 'captured', arg); - } - for (i = 0; i < path.length; i++) { - fn(path[i], 'bubbled', arg); + lazyComponent._status = Resolved; + lazyComponent._result = defaultExport; + } + }, function (error) { + if (lazyComponent._status === Pending) { + lazyComponent._status = Rejected; + lazyComponent._result = error; + } + }); } } - /** - * 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. - */ - function traverseEnterLeave(from, to, fn, argFrom, argTo) { - var common = from && to ? getLowestCommonAncestor(from, to) : null; - var pathFrom = []; - while (true) { - if (!from) { - break; - } - if (from === common) { - break; - } - var alternate = from.alternate; - if (alternate !== null && alternate === common) { - break; - } - pathFrom.push(from); - from = getParent(from); - } - var pathTo = []; - while (true) { - if (!to) { - break; - } - if (to === common) { - break; - } - var _alternate = to.alternate; - if (_alternate !== null && _alternate === common) { - break; - } - pathTo.push(to); - to = getParent(to); - } - for (var i = 0; i < pathFrom.length; i++) { - fn(pathFrom[i], 'bubbled', argFrom); - } - for (var _i = pathTo.length; _i-- > 0;) { - fn(pathTo[_i], 'captured', argTo); - } + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); } - /** - * 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); - } + function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } - /** - * 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. - */ - - /** - * 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 accumulateDirectionalDispatches(inst, phase, event) { { - !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0; - } - 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 accumulateTwoPhaseDispatchesSingle(event) { - if (event && event.dispatchConfig.phasedRegistrationNames) { - traverseTwoPhase(event._targetInst, 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. - */ - 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); + if (typeof type.tag === 'number') { + warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); } } + + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case REACT_FRAGMENT_TYPE: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; } - /** - * 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); + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + + function describeFiber(fiber) { + switch (fiber.tag) { + case HostRoot: + case HostPortal: + case HostText: + case Fragment: + case ContextProvider: + case ContextConsumer: + return ''; + + default: + var owner = fiber._debugOwner; + var source = fiber._debugSource; + var name = getComponentName(fiber.type); + var ownerName = null; + + if (owner) { + ownerName = getComponentName(owner.type); + } + + return describeComponentFrame(name, source, ownerName); } } - function accumulateTwoPhaseDispatches(events) { - forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle); + function getStackByFiberInDevAndProd(workInProgress) { + var info = ''; + var node = workInProgress; + + do { + info += describeFiber(node); + node = node.return; + } while (node); + + return info; } + var current = null; + var phase = null; + function getCurrentFiberOwnerNameInDevOrNull() { + { + if (current === null) { + return null; + } + var owner = current._debugOwner; + if (owner !== null && typeof owner !== 'undefined') { + return getComponentName(owner.type); + } + } - function accumulateEnterLeaveDispatches(leave, enter, from, to) { - traverseEnterLeave(from, to, accumulateDispatches, leave, enter); + return null; } + function getCurrentFiberStackInDev() { + { + if (current === null) { + return ''; + } // Safe because if current fiber exists, we are reconciling, + // and it is guaranteed to be the work-in-progress version. - function accumulateDirectDispatches(events) { - forEachAccumulated(events, accumulateDirectDispatchesSingle); + + return getStackByFiberInDevAndProd(current); + } + + return ''; + } + function resetCurrentFiber() { + { + ReactDebugCurrentFrame.getCurrentStack = null; + current = null; + phase = null; + } + } + function setCurrentFiber(fiber) { + { + ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev; + current = fiber; + phase = null; + } + } + function setCurrentPhase(lifeCyclePhase) { + { + phase = lifeCyclePhase; + } } var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); + var PLUGIN_EVENT_SYSTEM = 1; + var IS_REPLAYED = 1 << 5; + + var restoreImpl = null; + var restoreTarget = null; + var restoreQueue = null; + + function restoreStateOfTarget(target) { + // We perform this translation at the end of the event loop so that we + // always receive the correct fiber here + var internalInstance = getInstanceFromNode(target); + + if (!internalInstance) { + // Unmounted + return; + } + + (function () { + if (!(typeof restoreImpl === 'function')) { + { + throw ReactError(Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.")); + } + } + })(); + + var props = getFiberCurrentPropsFromNode(internalInstance.stateNode); + restoreImpl(internalInstance.stateNode, internalInstance.type, props); + } + + function setRestoreImplementation(impl) { + restoreImpl = impl; + } + function enqueueStateRestore(target) { + if (restoreTarget) { + if (restoreQueue) { + restoreQueue.push(target); + } else { + restoreQueue = [target]; + } + } else { + restoreTarget = target; + } + } + function needsStateRestore() { + return restoreTarget !== null || restoreQueue !== null; + } + function restoreStateIfNeeded() { + if (!restoreTarget) { + return; + } + + var target = restoreTarget; + var queuedTargets = restoreQueue; + restoreTarget = null; + restoreQueue = null; + restoreStateOfTarget(target); + + if (queuedTargets) { + for (var i = 0; i < queuedTargets.length; i++) { + restoreStateOfTarget(queuedTargets[i]); + } + } + } + + var enableProfilerTimer = true; // Trace which interactions trigger each commit. + // This is a flag so we can fix warnings in RN core before turning it on + + // Experimental React Flare event system and event components support. + + var enableFlareAPI = false; // Experimental Host Component support. + + var enableFundamentalAPI = false; // Experimental Scope support. + var warnAboutStringRefs = false; + + // the renderer. Such as when we're dispatching events or if third party + // libraries need to call batchedUpdates. Eventually, this API will go away when + // everything is batched by default. We'll then have a similar API to opt-out of + // scheduled work and instead do synchronous work. + // Defaults + + var batchedUpdatesImpl = function (fn, bookkeeping) { + return fn(bookkeeping); + }; + + var discreteUpdatesImpl = function (fn, a, b, c) { + return fn(a, b, c); + }; + + var flushDiscreteUpdatesImpl = function () {}; + + var batchedEventUpdatesImpl = batchedUpdatesImpl; + var isInsideEventHandler = false; + var isBatchingEventUpdates = false; + + function finishEventHandler() { + // Here we wait until all updates have propagated, which is important + // when using controlled components within layers: + // https://github.com/facebook/react/issues/1698 + // Then we restore state of any controlled component. + var controlledComponentsHavePendingUpdates = needsStateRestore(); + + if (controlledComponentsHavePendingUpdates) { + // If a controlled event was fired, we may need to restore the state of + // the DOM node back to the controlled value. This is necessary when React + // bails out of the update without touching the DOM. + flushDiscreteUpdatesImpl(); + restoreStateIfNeeded(); + } + } + + function batchedUpdates(fn, bookkeeping) { + if (isInsideEventHandler) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(bookkeeping); + } + + isInsideEventHandler = true; + + try { + return batchedUpdatesImpl(fn, bookkeeping); + } finally { + isInsideEventHandler = false; + finishEventHandler(); + } + } + function batchedEventUpdates(fn, a, b) { + if (isBatchingEventUpdates) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(a, b); + } + + isBatchingEventUpdates = true; + + try { + return batchedEventUpdatesImpl(fn, a, b); + } finally { + isBatchingEventUpdates = false; + finishEventHandler(); + } + } // This is for the React Flare event system + function discreteUpdates(fn, a, b, c) { + var prevIsInsideEventHandler = isInsideEventHandler; + isInsideEventHandler = true; + + try { + return discreteUpdatesImpl(fn, a, b, c); + } finally { + isInsideEventHandler = prevIsInsideEventHandler; + + if (!isInsideEventHandler) { + finishEventHandler(); + } + } + } + function flushDiscreteUpdatesIfNeeded(timeStamp) { + // event.timeStamp isn't overly reliable due to inconsistencies in + // how different browsers have historically provided the time stamp. + // Some browsers provide high-resolution time stamps for all events, + // some provide low-resolution time stamps for all events. FF < 52 + // even mixes both time stamps together. Some browsers even report + // negative time stamps or time stamps that are 0 (iOS9) in some cases. + // Given we are only comparing two time stamps with equality (!==), + // we are safe from the resolution differences. If the time stamp is 0 + // we bail-out of preventing the flush, which can affect semantics, + // such as if an earlier flush removes or adds event listeners that + // are fired in the subsequent flush. However, this is the same + // behaviour as we had before this change, so the risks are low. + if (!isInsideEventHandler && (!enableFlareAPI )) { + flushDiscreteUpdatesImpl(); + } + } + function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) { + batchedUpdatesImpl = _batchedUpdatesImpl; + discreteUpdatesImpl = _discreteUpdatesImpl; + flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl; + batchedEventUpdatesImpl = _batchedEventUpdatesImpl; + } + + var DiscreteEvent = 0; + var UserBlockingEvent = 1; + var ContinuousEvent = 2; + + // CommonJS interop named imports. + + var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; + var runWithPriority = Scheduler.unstable_runWithPriority; + + // A reserved attribute. + // It is handled by React separately and shouldn't be written to the DOM. + var RESERVED = 0; // A simple string attribute. + // Attributes that aren't in the whitelist are presumed to have this type. + + var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called + // "enumerated" attributes with "true" and "false" as possible values. + // When true, it should be set to a "true" string. + // When false, it should be set to a "false" string. + + var BOOLEANISH_STRING = 2; // A real boolean attribute. + // When true, it should be present (set either to an empty string or its name). + // When false, it should be omitted. + + var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. + // When true, it should be present (set either to an empty string or its name). + // When false, it should be omitted. + // For any other value, should be present with that value. + + var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. + // When falsy, it should be removed. + + var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. + // When falsy, it should be removed. + + var POSITIVE_NUMERIC = 6; + + /* eslint-disable max-len */ + var ATTRIBUTE_NAME_START_CHAR = ":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"; + /* eslint-enable max-len */ + + var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; + + var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; + var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); + var hasOwnProperty = Object.prototype.hasOwnProperty; + var illegalAttributeNameCache = {}; + var validatedAttributeNameCache = {}; + function isAttributeNameSafe(attributeName) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { + return true; + } + + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { + return false; + } + + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; + } + + illegalAttributeNameCache[attributeName] = true; + + { + warning$1(false, 'Invalid attribute name: `%s`', attributeName); + } + + return false; + } + function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null) { + return propertyInfo.type === RESERVED; + } + + if (isCustomComponentTag) { + return false; + } + + if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { + return true; + } + + return false; + } + function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { + if (propertyInfo !== null && propertyInfo.type === RESERVED) { + return false; + } + + switch (typeof value) { + case 'function': // $FlowIssue symbol is perfectly valid here + + case 'symbol': + // eslint-disable-line + return true; + + case 'boolean': + { + if (isCustomComponentTag) { + return false; + } + + if (propertyInfo !== null) { + return !propertyInfo.acceptsBooleans; + } else { + var prefix = name.toLowerCase().slice(0, 5); + return prefix !== 'data-' && prefix !== 'aria-'; + } + } + + default: + return false; + } + } + function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { + if (value === null || typeof value === 'undefined') { + return true; + } + + if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { + return true; + } + + if (isCustomComponentTag) { + return false; + } + + if (propertyInfo !== null) { + switch (propertyInfo.type) { + case BOOLEAN: + return !value; + + case OVERLOADED_BOOLEAN: + return value === false; + + case NUMERIC: + return isNaN(value); + + case POSITIVE_NUMERIC: + return isNaN(value) || value < 1; + } + } + + return false; + } + function getPropertyInfo(name) { + return properties.hasOwnProperty(name) ? properties[name] : null; + } + + function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) { + this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; + this.attributeName = attributeName; + this.attributeNamespace = attributeNamespace; + this.mustUseProperty = mustUseProperty; + this.propertyName = name; + this.type = type; + this.sanitizeURL = sanitizeURL; + } // When adding attributes to this list, be sure to also add them to + // the `possibleStandardNames` module to ensure casing and incorrect + // name warnings. + + + var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM. + + ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular + // elements (not just inputs). Now that ReactDOMInput assigns to the + // defaultValue property -- do we need this? + 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + }); // A few React string attributes have a different name. + // This is a mapping from React prop names to the attribute names. + + [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { + var name = _ref[0], + attributeName = _ref[1]; + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, // attributeName + null, // attributeNamespace + false); + }); // These are "enumerated" HTML attributes that accept "true" and "false". + // In React, we let users pass `true` and `false` even though technically + // these aren't boolean attributes (they are coerced to strings). + + ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); + }); // These are "enumerated" SVG attributes that accept "true" and "false". + // In React, we let users pass `true` and `false` even though technically + // these aren't boolean attributes (they are coerced to strings). + // Since these are SVG attributes, their attribute names are case-sensitive. + + ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + }); // These are HTML boolean attributes. + + ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM + // on the client side because the browsers are inconsistent. Instead we call focus(). + 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata + 'itemScope'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); + }); // These are the few React props that we set as DOM properties + // rather than attributes. These are all booleans. + + ['checked', // Note: `option.selected` is not updated if `select.multiple` is + // disabled with `removeAttribute`. We have special logic for handling this. + 'multiple', 'muted', 'selected'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + }); // These are HTML attributes that are "overloaded booleans": they behave like + // booleans, but can also accept a string value. + + ['capture', 'download'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + }); // These are HTML attributes that must be positive numbers. + + ['cols', 'rows', 'size', 'span'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); + }); // These are HTML attributes that must be numbers. + + ['rowSpan', 'start'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty + name.toLowerCase(), // attributeName + null, // attributeNamespace + false); + }); + var CAMELIZE = /[\-\:]([a-z])/g; + + var capitalize = function (token) { + return token[1].toUpperCase(); + }; // This is a list of all SVG attributes that need special casing, namespacing, + // or boolean value assignment. Regular attributes that just accept strings + // and have the same names are omitted, just like in the HTML whitelist. + // Some of these attributes can be hard to find. This list was created by + // scrapping the MDN documentation. + + + ['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'].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, null, // attributeNamespace + false); + }); // String SVG attributes with the xlink namespace. + + ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/1999/xlink', false); + }); // String SVG attributes with the xml namespace. + + ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/XML/1998/namespace', false); + }); // These attribute exists both in HTML and SVG. + // The attribute name is case-sensitive in SVG so we can't just use + // the React name like we do for attributes that exist only in HTML. + + ['tabIndex', 'crossOrigin'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + false); + }); // These attributes accept URLs. These must not allow javascript: URLS. + // These will also need to accept Trusted Types object in the future. + + var xlinkHref = 'xlinkHref'; + properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty + 'xlink:href', 'http://www.w3.org/1999/xlink', true); + ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + true); + }); + + var ReactDebugCurrentFrame$1 = null; + + { + ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + } // A javascript: URL can contain leading C0 control or \u0020 SPACE, + // and any newline or tab are filtered out as if they're not part of the URL. + // https://url.spec.whatwg.org/#url-parsing + // Tab or newline are defined as \r\n\t: + // https://infra.spec.whatwg.org/#ascii-tab-or-newline + // A C0 control is a code point in the range \u0000 NULL to \u001F + // INFORMATION SEPARATOR ONE, inclusive: + // https://infra.spec.whatwg.org/#c0-control-or-space + + /* eslint-disable max-len */ + + + var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; + var didWarn = false; + + function sanitizeURL(url) { + if ( !didWarn && isJavaScriptProtocol.test(url)) { + didWarn = true; + warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); + } + } + + // Flow does not allow string concatenation of most non-string types. To work + // around this limitation, we use an opaque type that can only be obtained by + // passing the value through getToStringValue first. + function toString(value) { + return '' + value; + } + function getToStringValue(value) { + switch (typeof value) { + case 'boolean': + case 'number': + case 'object': + case 'string': + case 'undefined': + return value; + + default: + // function, symbol are assigned as empty strings + return ''; + } + } + /** Trusted value is a wrapper for "safe" values which can be assigned to DOM execution sinks. */ + + /** + * We allow passing objects with toString method as element attributes or in dangerouslySetInnerHTML + * and we do validations that the value is safe. Once we do validation we want to use the validated + * value instead of the object (because object.toString may return something else on next call). + * + * If application uses Trusted Types we don't stringify trusted values, but preserve them as objects. + */ + var toStringOrTrustedType = toString; + + /** + * Set attribute for a node. The attribute value can be either string or + * Trusted value (if application uses Trusted Types). + */ + function setAttribute(node, attributeName, attributeValue) { + node.setAttribute(attributeName, attributeValue); + } + /** + * Set attribute with namespace for a node. The attribute value can be either string or + * Trusted value (if application uses Trusted Types). + */ + + function setAttributeNS(node, attributeNamespace, attributeName, attributeValue) { + node.setAttributeNS(attributeNamespace, attributeName, attributeValue); + } + + /** + * Get the value for a property on a node. Only used in DEV for SSR validation. + * The "expected" argument is used as a hint of what the expected value is. + * Some properties have multiple equivalent values. + */ + function getValueForProperty(node, name, expected, propertyInfo) { + { + if (propertyInfo.mustUseProperty) { + var propertyName = propertyInfo.propertyName; + return node[propertyName]; + } else { + if ( propertyInfo.sanitizeURL) { + // If we haven't fully disabled javascript: URLs, and if + // the hydration is successful of a javascript: URL, we + // still want to warn on the client. + sanitizeURL('' + expected); + } + + var attributeName = propertyInfo.attributeName; + var stringValue = null; + + if (propertyInfo.type === OVERLOADED_BOOLEAN) { + if (node.hasAttribute(attributeName)) { + var value = node.getAttribute(attributeName); + + if (value === '') { + return true; + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return value; + } + + if (value === '' + expected) { + return expected; + } + + return value; + } + } else if (node.hasAttribute(attributeName)) { + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + // We had an attribute but shouldn't have had one, so read it + // for the error message. + return node.getAttribute(attributeName); + } + + if (propertyInfo.type === BOOLEAN) { + // If this was a boolean, it doesn't matter what the value is + // the fact that we have it is the same as the expected. + return expected; + } // Even if this property uses a namespace we use getAttribute + // because we assume its namespaced name is the same as our config. + // To use getAttributeNS we need the local name which we don't have + // in our config atm. + + + stringValue = node.getAttribute(attributeName); + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return stringValue === null ? expected : stringValue; + } else if (stringValue === '' + expected) { + return expected; + } else { + return stringValue; + } + } + } + } + /** + * Get the value for a attribute on a node. Only used in DEV for SSR validation. + * The third argument is used as a hint of what the expected value is. Some + * attributes have multiple equivalent values. + */ + + function getValueForAttribute(node, name, expected) { + { + if (!isAttributeNameSafe(name)) { + return; + } + + if (!node.hasAttribute(name)) { + return expected === undefined ? undefined : null; + } + + var value = node.getAttribute(name); + + if (value === '' + expected) { + return expected; + } + + return value; + } + } + /** + * Sets the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + * @param {*} value + */ + + function setValueForProperty(node, name, value, isCustomComponentTag) { + var propertyInfo = getPropertyInfo(name); + + if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { + return; + } + + if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { + value = null; + } // If the prop isn't in the special list, treat it as a simple attribute. + + + if (isCustomComponentTag || propertyInfo === null) { + if (isAttributeNameSafe(name)) { + var _attributeName = name; + + if (value === null) { + node.removeAttribute(_attributeName); + } else { + setAttribute(node, _attributeName, toStringOrTrustedType(value)); + } + } + + return; + } + + var mustUseProperty = propertyInfo.mustUseProperty; + + if (mustUseProperty) { + var propertyName = propertyInfo.propertyName; + + if (value === null) { + var type = propertyInfo.type; + node[propertyName] = type === BOOLEAN ? false : ''; + } else { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. + node[propertyName] = value; + } + + return; + } // The rest are treated as attributes with special cases. + + + var attributeName = propertyInfo.attributeName, + attributeNamespace = propertyInfo.attributeNamespace; + + if (value === null) { + node.removeAttribute(attributeName); + } else { + var _type = propertyInfo.type; + var attributeValue; + + if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { + // If attribute type is boolean, we know for sure it won't be an execution sink + // and we won't require Trusted Type here. + attributeValue = ''; + } else { + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + attributeValue = toStringOrTrustedType(value); + + if (propertyInfo.sanitizeURL) { + sanitizeURL(attributeValue.toString()); + } + } + + if (attributeNamespace) { + setAttributeNS(node, attributeNamespace, attributeName, attributeValue); + } else { + setAttribute(node, attributeName, attributeValue); + } + } + } + + var ReactDebugCurrentFrame$2 = null; + var ReactControlledValuePropTypes = { + checkPropTypes: null + }; + + { + ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame; + var hasReadOnlyValue = { + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true + }; + var propTypes = { + value: function (props, propName, componentName) { + if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) { + return null; + } + + return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + }, + checked: function (props, propName, componentName) { + if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) { + return null; + } + + return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); + } + }; + /** + * Provide a linked `value` attribute for controlled forms. You should not use + * this outside of the ReactDOM controlled form components. + */ + + ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) { + checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum); + }; + } + + function isCheckable(elem) { + var type = elem.type; + var nodeName = elem.nodeName; + return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); + } + + function getTracker(node) { + return node._valueTracker; + } + + function detachTracker(node) { + node._valueTracker = null; + } + + function getValueFromNode(node) { + var value = ''; + + if (!node) { + return value; + } + + if (isCheckable(node)) { + value = node.checked ? 'true' : 'false'; + } else { + value = node.value; + } + + return value; + } + + function trackValueOnNode(node) { + var valueField = isCheckable(node) ? 'checked' : 'value'; + var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); + var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail + // and don't track value will cause over reporting of changes, + // but it's better then a hard failure + // (needed for certain tests that spyOn input values and Safari) + + if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { + return; + } + + var get = descriptor.get, + set = descriptor.set; + Object.defineProperty(node, valueField, { + configurable: true, + get: function () { + return get.call(this); + }, + set: function (value) { + currentValue = '' + value; + set.call(this, value); + } + }); // We could've passed this the first time + // but it triggers a bug in IE11 and Edge 14/15. + // Calling defineProperty() again should be equivalent. + // https://github.com/facebook/react/issues/11768 + + Object.defineProperty(node, valueField, { + enumerable: descriptor.enumerable + }); + var tracker = { + getValue: function () { + return currentValue; + }, + setValue: function (value) { + currentValue = '' + value; + }, + stopTracking: function () { + detachTracker(node); + delete node[valueField]; + } + }; + return tracker; + } + + function track(node) { + if (getTracker(node)) { + return; + } // TODO: Once it's just Fiber we can move this to node._wrapperState + + + node._valueTracker = trackValueOnNode(node); + } + function updateValueIfChanged(node) { + if (!node) { + return false; + } + + var tracker = getTracker(node); // if there is no tracker at this point it's unlikely + // that trying again will succeed + + if (!tracker) { + return true; + } + + var lastValue = tracker.getValue(); + var nextValue = getValueFromNode(node); + + if (nextValue !== lastValue) { + tracker.setValue(nextValue); + return true; + } + + return false; + } + + // TODO: direct imports like some-package/src/* are bad. Fix me. + var didWarnValueDefaultValue = false; + var didWarnCheckedDefaultChecked = false; + var didWarnControlledToUncontrolled = false; + var didWarnUncontrolledToControlled = false; + + function isControlled(props) { + var usesChecked = props.type === 'checkbox' || props.type === 'radio'; + return usesChecked ? props.checked != null : props.value != null; + } + /** + * Implements an host component that allows setting these optional + * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. + * + * If `checked` or `value` are not supplied (or null/undefined), user actions + * that affect the checked state or value will trigger updates to the element. + * + * If they are supplied (and not null/undefined), the rendered element will not + * trigger updates to the element. Instead, the props must change in order for + * the rendered element to be updated. + * + * The rendered element will be initialized as unchecked (or `defaultChecked`) + * with an empty value (or `defaultValue`). + * + * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html + */ + + + function getHostProps(element, props) { + var node = element; + var checked = props.checked; + + var hostProps = _assign({}, props, { + defaultChecked: undefined, + defaultValue: undefined, + value: undefined, + checked: checked != null ? checked : node._wrapperState.initialChecked + }); + + return hostProps; + } + function initWrapperState(element, props) { + { + ReactControlledValuePropTypes.checkPropTypes('input', props); + + if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { + warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + didWarnCheckedDefaultChecked = true; + } + + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { + warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); + didWarnValueDefaultValue = true; + } + } + + var node = element; + var defaultValue = props.defaultValue == null ? '' : props.defaultValue; + node._wrapperState = { + initialChecked: props.checked != null ? props.checked : props.defaultChecked, + initialValue: getToStringValue(props.value != null ? props.value : defaultValue), + controlled: isControlled(props) + }; + } + function updateChecked(element, props) { + var node = element; + var checked = props.checked; + + if (checked != null) { + setValueForProperty(node, 'checked', checked, false); + } + } + function updateWrapper(element, props) { + var node = element; + + { + var controlled = isControlled(props); + + if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { + warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); + didWarnUncontrolledToControlled = true; + } + + if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { + warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type); + didWarnControlledToUncontrolled = true; + } + } + + updateChecked(element, props); + var value = getToStringValue(props.value); + var type = props.type; + + if (value != null) { + if (type === 'number') { + if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible. + // eslint-disable-next-line + node.value != value) { + node.value = toString(value); + } + } else if (node.value !== toString(value)) { + node.value = toString(value); + } + } else if (type === 'submit' || type === 'reset') { + // Submit/reset inputs need the attribute removed completely to avoid + // blank-text buttons. + node.removeAttribute('value'); + return; + } + + { + // When syncing the value attribute, the value comes from a cascade of + // properties: + // 1. The value React property + // 2. The defaultValue React property + // 3. Otherwise there should be no change + if (props.hasOwnProperty('value')) { + setDefaultValue(node, props.type, value); + } else if (props.hasOwnProperty('defaultValue')) { + setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); + } + } + + { + // When syncing the checked attribute, it only changes when it needs + // to be removed, such as transitioning from a checkbox into a text input + if (props.checked == null && props.defaultChecked != null) { + node.defaultChecked = !!props.defaultChecked; + } + } + } + function postMountWrapper(element, props, isHydrating) { + var node = element; // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. + + if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { + var type = props.type; + var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the + // default value provided by the browser. See: #12872 + + if (isButton && (props.value === undefined || props.value === null)) { + return; + } + + var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. + + if (!isHydrating) { + { + // When syncing the value attribute, the value property should use + // the wrapperState._initialValue property. This uses: + // + // 1. The value React property when present + // 2. The defaultValue React property when present + // 3. An empty string + if (initialValue !== node.value) { + node.value = initialValue; + } + } + } + + { + // Otherwise, the value attribute is synchronized to the property, + // so we assign defaultValue to the same thing as the value property + // assignment step above. + node.defaultValue = initialValue; + } + } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug + // this is needed to work around a chrome bug where setting defaultChecked + // will sometimes influence the value of checked (even after detachment). + // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 + // We need to temporarily unset name to avoid disrupting radio button groups. + + + var name = node.name; + + if (name !== '') { + node.name = ''; + } + + { + // When syncing the checked attribute, both the checked property and + // attribute are assigned at the same time using defaultChecked. This uses: + // + // 1. The checked React property when present + // 2. The defaultChecked React property when present + // 3. Otherwise, false + node.defaultChecked = !node.defaultChecked; + node.defaultChecked = !!node._wrapperState.initialChecked; + } + + if (name !== '') { + node.name = name; + } + } + function restoreControlledState$1(element, props) { + var node = element; + updateWrapper(node, props); + updateNamedCousins(node, props); + } + + function updateNamedCousins(rootNode, props) { + var name = props.name; + + if (props.type === 'radio' && name != null) { + var queryRoot = rootNode; + + while (queryRoot.parentNode) { + queryRoot = queryRoot.parentNode; + } // If `rootNode.form` was non-null, then we could try `form.elements`, + // but that sometimes behaves strangely in IE8. We could also try using + // `form.getElementsByName`, but that will only return direct children + // and won't include inputs that use the HTML5 `form=` attribute. Since + // the input might not even be in a form. It might not even be in the + // document. Let's just use the local `querySelectorAll` to ensure we don't + // miss anything. + + + var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); + + for (var i = 0; i < group.length; i++) { + var otherNode = group[i]; + + if (otherNode === rootNode || otherNode.form !== rootNode.form) { + continue; + } // This will throw if radio buttons rendered by different copies of React + // and the same name are rendered into the same form (same as #1939). + // That's probably okay; we don't support it just as we don't support + // mixing React radio buttons with non-React ones. + + + var otherProps = getFiberCurrentPropsFromNode$1(otherNode); + + (function () { + if (!otherProps) { + { + throw ReactError(Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.")); + } + } + })(); // We need update the tracked value on the named cousin since the value + // was changed but the input saw no event or value set + + + updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that + // was previously checked to update will cause it to be come re-checked + // as appropriate. + + updateWrapper(otherNode, otherProps); + } + } + } // In Chrome, assigning defaultValue to certain input types triggers input validation. + // For number inputs, the display value loses trailing decimal points. For email inputs, + // Chrome raises "The specified value is not a valid email address". + // + // Here we check to see if the defaultValue has actually changed, avoiding these problems + // when the user is inputting text + // + // https://github.com/facebook/react/issues/7253 + + + function setDefaultValue(node, type, value) { + if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js + type !== 'number' || node.ownerDocument.activeElement !== node) { + if (value == null) { + node.defaultValue = toString(node._wrapperState.initialValue); + } else if (node.defaultValue !== toString(value)) { + node.defaultValue = toString(value); + } + } + } + + var didWarnSelectedSetOnOption = false; + var didWarnInvalidChild = false; + + function flattenChildren(children) { + var content = ''; // Flatten children. We'll warn if they are invalid + // during validateProps() which runs for hydration too. + // Note that this would throw on non-element objects. + // Elements are stringified (which is normally irrelevant + // but matters for ). + + React.Children.forEach(children, function (child) { + if (child == null) { + return; + } + + content += child; // Note: we don't warn about invalid children here. + // Instead, this is done separately below so that + // it happens during the hydration codepath too. + }); + return content; + } + /** + * Implements an