1import { n as __commonJSMin, t as require_react } from "/node_modules/.vite/deps/react-BH0yRK75.js?v=75125d19"; 2//#region node_modules/scheduler/cjs/scheduler.development.js 3/** 4* @license React 5* scheduler.development.js 6* 7* Copyright (c) Facebook, Inc. and its affiliates. 8* 9* This source code is licensed under the MIT license found in the 10* LICENSE file in the root directory of this source tree. 11*/ 12var require_scheduler_development = /* @__PURE__ */ __commonJSMin(((exports) => { 13 (function() { 14 "use strict"; 15 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(/* @__PURE__ */ new Error()); 16 var enableSchedulerDebugging = false; 17 var enableProfiling = false; 18 var frameYieldMs = 5; 19 function push(heap, node) { 20 var index = heap.length; 21 heap.push(node); 22 siftUp(heap, node, index); 23 } 24 function peek(heap) { 25 return heap.length === 0 ? null : heap[0]; 26 } 27 function pop(heap) { 28 if (heap.length === 0) return null; 29 var first = heap[0]; 30 var last = heap.pop(); 31 if (last !== first) { 32 heap[0] = last; 33 siftDown(heap, last, 0); 34 } 35 return first; 36 } 37 function siftUp(heap, node, i) { 38 var index = i; 39 while (index > 0) { 40 var parentIndex = index - 1 >>> 1; 41 var parent = heap[parentIndex]; 42 if (compare(parent, node) > 0) { 43 heap[parentIndex] = node; 44 heap[index] = parent; 45 index = parentIndex; 46 } else return; 47 } 48 } 49 function siftDown(heap, node, i) { 50 var index = i; 51 var length = heap.length; 52 var halfLength = length >>> 1; 53 while (index < halfLength) { 54 var leftIndex = (index + 1) * 2 - 1; 55 var left = heap[leftIndex]; 56 var rightIndex = leftIndex + 1; 57 var right = heap[rightIndex]; 58 if (compare(left, node) < 0) if (rightIndex < length && compare(right, left) < 0) { 59 heap[index] = right; 60 heap[rightIndex] = node; 61 index = rightIndex; 62 } else { 63 heap[index] = left; 64 heap[leftIndex] = node; 65 index = leftIndex; 66 } 67 else if (rightIndex < length && compare(right, node) < 0) { 68 heap[index] = right; 69 heap[rightIndex] = node; 70 index = rightIndex; 71 } else return; 72 } 73 } 74 function compare(a, b) { 75 var diff = a.sortIndex - b.sortIndex; 76 return diff !== 0 ? diff : a.id - b.id; 77 } 78 var ImmediatePriority = 1; 79 var UserBlockingPriority = 2; 80 var NormalPriority = 3; 81 var LowPriority = 4; 82 var IdlePriority = 5; 83 function markTaskErrored(task, ms) {} 84 if (typeof performance === "object" && typeof performance.now === "function") { 85 var localPerformance = performance; 86 exports.unstable_now = function() { 87 return localPerformance.now(); 88 }; 89 } else { 90 var localDate = Date; 91 var initialTime = localDate.now(); 92 exports.unstable_now = function() { 93 return localDate.now() - initialTime; 94 }; 95 } 96 var maxSigned31BitInt = 1073741823; 97 var IMMEDIATE_PRIORITY_TIMEOUT = -1; 98 var USER_BLOCKING_PRIORITY_TIMEOUT = 250; 99 var NORMAL_PRIORITY_TIMEOUT = 5e3; 100 var LOW_PRIORITY_TIMEOUT = 1e4; 101 var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; 102 var taskQueue = []; 103 var timerQueue = []; 104 var taskIdCounter = 1; 105 var currentTask = null; 106 var currentPriorityLevel = NormalPriority; 107 var isPerformingWork = false; 108 var isHostCallbackScheduled = false; 109 var isHostTimeoutScheduled = false; 110 var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null; 111 var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null; 112 var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null; 113 typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling); 114 function advanceTimers(currentTime) { 115 var timer = peek(timerQueue); 116 while (timer !== null) { 117 if (timer.callback === null) pop(timerQueue); 118 else if (timer.startTime <= currentTime) { 119 pop(timerQueue); 120 timer.sortIndex = timer.expirationTime; 121 push(taskQueue, timer); 122 } else return; 123 timer = peek(timerQueue); 124 } 125 } 126 function handleTimeout(currentTime) { 127 isHostTimeoutScheduled = false;
128 advanceTimers(currentTime); 129 if (!isHostCallbackScheduled) if (peek(taskQueue) !== null) { 130 isHostCallbackScheduled = true; 131 requestHostCallback(flushWork); 132 } else { 133 var firstTimer = peek(timerQueue); 134 if (firstTimer !== null) requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); 135 } 136 } 137 function flushWork(hasTimeRemaining, initialTime) { 138 isHostCallbackScheduled = false; 139 if (isHostTimeoutScheduled) { 140 isHostTimeoutScheduled = false; 141 cancelHostTimeout(); 142 } 143 isPerformingWork = true; 144 var previousPriorityLevel = currentPriorityLevel; 145 try { 146 if (enableProfiling) try { 147 return workLoop(hasTimeRemaining, initialTime); 148 } catch (error) { 149 if (currentTask !== null) { 150 var currentTime = exports.unstable_now(); 151 markTaskErrored(currentTask, currentTime); 152 currentTask.isQueued = false; 153 } 154 throw error; 155 } 156 else return workLoop(hasTimeRemaining, initialTime); 157 } finally { 158 currentTask = null; 159 currentPriorityLevel = previousPriorityLevel; 160 isPerformingWork = false; 161 } 162 } 163 function workLoop(hasTimeRemaining, initialTime) { 164 var currentTime = initialTime; 165 advanceTimers(currentTime); 166 currentTask = peek(taskQueue); 167 while (currentTask !== null && !enableSchedulerDebugging) { 168 if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) break; 169 var callback = currentTask.callback; 170 if (typeof callback === "function") { 171 currentTask.callback = null; 172 currentPriorityLevel = currentTask.priorityLevel; 173 var continuationCallback = callback(currentTask.expirationTime <= currentTime); 174 currentTime = exports.unstable_now(); 175 if (typeof continuationCallback === "function") currentTask.callback = continuationCallback; 176 else if (currentTask === peek(taskQueue)) pop(taskQueue); 177 advanceTimers(currentTime); 178 } else pop(taskQueue); 179 currentTask = peek(taskQueue); 180 } 181 if (currentTask !== null) return true; 182 else { 183 var firstTimer = peek(timerQueue); 184 if (firstTimer !== null) requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); 185 return false; 186 } 187 } 188 function unstable_runWithPriority(priorityLevel, eventHandler) { 189 switch (priorityLevel) { 190 case ImmediatePriority: 191 case UserBlockingPriority: 192 case NormalPriority: 193 case LowPriority: 194 case IdlePriority: break; 195 default: priorityLevel = NormalPriority; 196 } 197 var previousPriorityLevel = currentPriorityLevel; 198 currentPriorityLevel = priorityLevel; 199 try { 200 return eventHandler(); 201 } finally { 202 currentPriorityLevel = previousPriorityLevel; 203 } 204 } 205 function unstable_next(eventHandler) { 206 var priorityLevel; 207 switch (currentPriorityLevel) { 208 case ImmediatePriority: 209 case UserBlockingPriority: 210 case NormalPriority: 211 priorityLevel = NormalPriority; 212 break; 213 default: 214 priorityLevel = currentPriorityLevel; 215 break; 216 } 217 var previousPriorityLevel = currentPriorityLevel; 218 currentPriorityLevel = priorityLevel; 219 try { 220 return eventHandler(); 221 } finally { 222 currentPriorityLevel = previousPriorityLevel; 223 } 224 } 225 function unstable_wrapCallback(callback) { 226 var parentPriorityLevel = currentPriorityLevel; 227 return function() { 228 var previousPriorityLevel = currentPriorityLevel; 229 currentPriorityLevel = parentPriorityLevel; 230 try { 231 return callback.apply(this, arguments); 232 } finally { 233 currentPriorityLevel = previousPriorityLevel; 234 } 235 }; 236 } 237 function unstable_scheduleCallback(priorityLevel, callback, options) { 238 var currentTime = exports.unstable_now(); 239 var startTime; 240 if (typeof options === "object" && options !== null) { 241 var delay = options.delay; 242 if (typeof delay === "number" && delay > 0) startTime = currentTime + delay; 243 else startTime = currentTime; 244 } else startTime = currentTime; 245 var timeout; 246 switch (priorityLevel) { 247 case ImmediatePriority: 248 timeout = IMMEDIATE_PRIORITY_TIMEOUT;
249 break; 250 case UserBlockingPriority: 251 timeout = USER_BLOCKING_PRIORITY_TIMEOUT; 252 break; 253 case IdlePriority: 254 timeout = IDLE_PRIORITY_TIMEOUT; 255 break; 256 case LowPriority: 257 timeout = LOW_PRIORITY_TIMEOUT; 258 break; 259 case NormalPriority: 260 default: 261 timeout = NORMAL_PRIORITY_TIMEOUT; 262 break; 263 } 264 var expirationTime = startTime + timeout; 265 var newTask = { 266 id: taskIdCounter++, 267 callback, 268 priorityLevel, 269 startTime, 270 expirationTime, 271 sortIndex: -1 272 }; 273 if (startTime > currentTime) { 274 newTask.sortIndex = startTime; 275 push(timerQueue, newTask); 276 if (peek(taskQueue) === null && newTask === peek(timerQueue)) { 277 if (isHostTimeoutScheduled) cancelHostTimeout(); 278 else isHostTimeoutScheduled = true; 279 requestHostTimeout(handleTimeout, startTime - currentTime); 280 } 281 } else { 282 newTask.sortIndex = expirationTime; 283 push(taskQueue, newTask); 284 if (!isHostCallbackScheduled && !isPerformingWork) { 285 isHostCallbackScheduled = true; 286 requestHostCallback(flushWork); 287 } 288 } 289 return newTask; 290 } 291 function unstable_pauseExecution() {} 292 function unstable_continueExecution() { 293 if (!isHostCallbackScheduled && !isPerformingWork) { 294 isHostCallbackScheduled = true; 295 requestHostCallback(flushWork); 296 } 297 } 298 function unstable_getFirstCallbackNode() { 299 return peek(taskQueue); 300 } 301 function unstable_cancelCallback(task) { 302 task.callback = null; 303 } 304 function unstable_getCurrentPriorityLevel() { 305 return currentPriorityLevel; 306 } 307 var isMessageLoopRunning = false; 308 var scheduledHostCallback = null; 309 var taskTimeoutID = -1; 310 var frameInterval = frameYieldMs; 311 var startTime = -1; 312 function shouldYieldToHost() { 313 if (exports.unstable_now() - startTime < frameInterval) return false; 314 return true; 315 } 316 function requestPaint() {} 317 function forceFrameRate(fps) { 318 if (fps < 0 || fps > 125) { 319 console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"); 320 return; 321 } 322 if (fps > 0) frameInterval = Math.floor(1e3 / fps); 323 else frameInterval = frameYieldMs; 324 } 325 var performWorkUntilDeadline = function() { 326 if (scheduledHostCallback !== null) { 327 var currentTime = exports.unstable_now(); 328 startTime = currentTime; 329 var hasTimeRemaining = true; 330 var hasMoreWork = true; 331 try { 332 hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); 333 } finally { 334 if (hasMoreWork) schedulePerformWorkUntilDeadline(); 335 else { 336 isMessageLoopRunning = false; 337 scheduledHostCallback = null; 338 } 339 } 340 } else isMessageLoopRunning = false; 341 }; 342 var schedulePerformWorkUntilDeadline; 343 if (typeof localSetImmediate === "function") schedulePerformWorkUntilDeadline = function() { 344 localSetImmediate(performWorkUntilDeadline); 345 }; 346 else if (typeof MessageChannel !== "undefined") { 347 var channel = new MessageChannel(); 348 var port = channel.port2; 349 channel.port1.onmessage = performWorkUntilDeadline; 350 schedulePerformWorkUntilDeadline = function() { 351 port.postMessage(null); 352 }; 353 } else schedulePerformWorkUntilDeadline = function() { 354 localSetTimeout(performWorkUntilDeadline, 0); 355 }; 356 function requestHostCallback(callback) { 357 scheduledHostCallback = callback; 358 if (!isMessageLoopRunning) { 359 isMessageLoopRunning = true; 360 schedulePerformWorkUntilDeadline(); 361 } 362 } 363 function requestHostTimeout(callback, ms) { 364 taskTimeoutID = localSetTimeout(function() { 365 callback(exports.unstable_now()); 366 }, ms); 367 } 368 function cancelHostTimeout() { 369 localClearTimeout(taskTimeoutID); 370 taskTimeoutID = -1; 371 } 372 var unstable_requestPaint = requestPaint; 373 var unstable_Profiling = null; 374 exports.unstable_IdlePriority = IdlePriority; 375 exports.unstable_ImmediatePriority = ImmediatePriority; 376 exports.unstable_LowPriority = LowPriority; 377 exports.unstable_NormalPriority = NormalPriority; 378 exports.unstable_Profiling = unstable_Profiling; 379 exports.unstable_UserBlockingPriority = UserBlockingPriority; 380 exports.unstable_cancelCallback = unstable_cancelCallback; 381 exports.unstable_continueExecution = unstable_continueExecution; 382 exports.unstable_forceFrameRate = forceFrameRate; 383 exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; 384 exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode; 385 exports.unstable_next = unstable_next; 386 exports.unstable_pauseExecution = unstable_pauseExecution; 387 exports.unstable_requestPaint = unstable_requestPaint; 388 exports.unstable_runWithPriority = unstable_runWithPriority; 389 exports.unstable_scheduleCallback = unstable_scheduleCallback; 390 exports.unstable_shouldYield = shouldYieldToHost; 391 exports.unstable_wrapCallback = unstable_wrapCallback; 392 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(/* @__PURE__ */ new Error()); 393 })(); 394})); 395//#endregion 396//#region node_modules/scheduler/index.js 397var require_scheduler = /* @__PURE__ */ __commonJSMin(((exports, module) => { 398 module.exports = require_scheduler_development(); 399})); 400//#endregion 401//#region node_modules/react-dom/cjs/react-dom.development.js 402/** 403* @license React 404* react-dom.development.js 405* 406* Copyright (c) Facebook, Inc. and its affiliates. 407* 408* This source code is licensed under the MIT license found in the 409* LICENSE file in the root directory of this source tree. 410*/ 411var require_react_dom_development = /* @__PURE__ */ __commonJSMin(((exports) => { 412 (function() { 413 "use strict"; 414 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(/* @__PURE__ */ new Error()); 415 var React = require_react(); 416 var Scheduler = require_scheduler();
417 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; 418 var suppressWarning = false; 419 function setSuppressWarning(newSuppressWarning) { 420 suppressWarning = newSuppressWarning; 421 } 422 function warn(format) { 423 if (!suppressWarning) { 424 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key]; 425 printWarning("warn", format, args); 426 } 427 } 428 function error(format) { 429 if (!suppressWarning) { 430 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2]; 431 printWarning("error", format, args); 432 } 433 } 434 function printWarning(level, format, args) { 435 var stack = ReactSharedInternals.ReactDebugCurrentFrame.getStackAddendum(); 436 if (stack !== "") { 437 format += "%s"; 438 args = args.concat([stack]); 439 } 440 var argsWithFormat = args.map(function(item) { 441 return String(item); 442 }); 443 argsWithFormat.unshift("Warning: " + format); 444 Function.prototype.apply.call(console[level], console, argsWithFormat); 445 } 446 var FunctionComponent = 0; 447 var ClassComponent = 1; 448 var IndeterminateComponent = 2; 449 var HostRoot = 3; 450 var HostPortal = 4; 451 var HostComponent = 5; 452 var HostText = 6; 453 var Fragment = 7; 454 var Mode = 8; 455 var ContextConsumer = 9; 456 var ContextProvider = 10; 457 var ForwardRef = 11; 458 var Profiler = 12; 459 var SuspenseComponent = 13; 460 var MemoComponent = 14; 461 var SimpleMemoComponent = 15; 462 var LazyComponent = 16; 463 var IncompleteClassComponent = 17; 464 var DehydratedFragment = 18; 465 var SuspenseListComponent = 19; 466 var ScopeComponent = 21; 467 var OffscreenComponent = 22; 468 var LegacyHiddenComponent = 23; 469 var CacheComponent = 24; 470 var TracingMarkerComponent = 25; 471 var enableClientRenderFallbackOnTextMismatch = true; 472 var enableNewReconciler = false; 473 var enableLazyContextPropagation = false; 474 var enableLegacyHidden = false; 475 var enableSuspenseAvoidThisFallback = false; 476 var disableCommentsAsDOMContainers = true; 477 var enableCustomElementPropertySupport = false; 478 var warnAboutStringRefs = true; 479 var enableSchedulingProfiler = true; 480 var enableProfilerTimer = true; 481 var enableProfilerCommitHooks = true; 482 var allNativeEvents = /* @__PURE__ */ new Set(); 483 /** 484 * Mapping from registration name to event name 485 */ 486 var registrationNameDependencies = {}; 487 /** 488 * Mapping from lowercase registration names to the properly cased version, 489 * used to warn in the case of missing event handlers. Available 490 * only in true. 491 * @type {Object} 492 */ 493 var possibleRegistrationNames = {}; 494 function registerTwoPhaseEvent(registrationName, dependencies) { 495 registerDirectEvent(registrationName, dependencies); 496 registerDirectEvent(registrationName + "Capture", dependencies); 497 } 498 function registerDirectEvent(registrationName, dependencies) { 499 if (registrationNameDependencies[registrationName]) error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName); 500 registrationNameDependencies[registrationName] = dependencies; 501 var lowerCasedName = registrationName.toLowerCase(); 502 possibleRegistrationNames[lowerCasedName] = registrationName; 503 if (registrationName === "onDoubleClick") possibleRegistrationNames.ondblclick = registrationName; 504 for (var i = 0; i < dependencies.length; i++) allNativeEvents.add(dependencies[i]); 505 } 506 var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); 507 var hasOwnProperty = Object.prototype.hasOwnProperty; 508 function typeName(value) { 509 return typeof Symbol === "function" && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; 510 } 511 function willCoercionThrow(value) { 512 try { 513 testStringCoercion(value); 514 return false; 515 } catch (e) { 516 return true; 517 } 518 } 519 function testStringCoercion(value) { 520 return "" + value; 521 } 522 function checkAttributeStringCoercion(value, attributeName) { 523 if (willCoercionThrow(value)) { 524 error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", attributeName, typeName(value)); 525 return testStringCoercion(value); 526 } 527 } 528 function checkKeyStringCoercion(value) { 529 if (willCoercionThrow(value)) { 530 error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); 531 return testStringCoercion(value); 532 } 533 } 534 function checkPropStringCoercion(value, propName) { 535 if (willCoercionThrow(value)) { 536 error("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value)); 537 return testStringCoercion(value); 538 } 539 } 540 function checkCSSPropertyStringCoercion(value, propName) { 541 if (willCoercionThrow(value)) { 542 error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value)); 543 return testStringCoercion(value); 544 } 545 } 546 function checkHtmlStringCoercion(value) { 547 if (willCoercionThrow(value)) { 548 error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)); 549 return testStringCoercion(value); 550 } 551 } 552 function checkFormFieldValueStringCoercion(value) { 553 if (willCoercionThrow(value)) { 554 error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", typeName(value)); 555 return testStringCoercion(value); 556 } 557 } 558 var RESERVED = 0; 559 var STRING = 1; 560 var BOOLEANISH_STRING = 2; 561 var BOOLEAN = 3; 562 var OVERLOADED_BOOLEAN = 4; 563 var NUMERIC = 5; 564 var POSITIVE_NUMERIC = 6; 565 var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u
565037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; 566 var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; 567 var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$"); 568 var illegalAttributeNameCache = {}; 569 var validatedAttributeNameCache = {}; 570 function isAttributeNameSafe(attributeName) { 571 if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) return true; 572 if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return false; 573 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { 574 validatedAttributeNameCache[attributeName] = true; 575 return true; 576 } 577 illegalAttributeNameCache[attributeName] = true; 578 error("Invalid attribute name: `%s`", attributeName); 579 return false; 580 } 581 function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { 582 if (propertyInfo !== null) return propertyInfo.type === RESERVED; 583 if (isCustomComponentTag) return false; 584 if (name.length > 2 && (name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) return true; 585 return false; 586 } 587 function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { 588 if (propertyInfo !== null && propertyInfo.type === RESERVED) return false; 589 switch (typeof value) { 590 case "function": 591 case "symbol": return true; 592 case "boolean": 593 if (isCustomComponentTag) return false; 594 if (propertyInfo !== null) return !propertyInfo.acceptsBooleans; 595 else { 596 var prefix = name.toLowerCase().slice(0, 5); 597 return prefix !== "data-" && prefix !== "aria-"; 598 } 599 default: return false; 600 } 601 } 602 function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { 603 if (value === null || typeof value === "undefined") return true; 604 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) return true; 605 if (isCustomComponentTag) return false; 606 if (propertyInfo !== null) switch (propertyInfo.type) { 607 case BOOLEAN: return !value; 608 case OVERLOADED_BOOLEAN: return value === false; 609 case NUMERIC: return isNaN(value); 610 case POSITIVE_NUMERIC: return isNaN(value) || value < 1; 611 } 612 return false; 613 } 614 function getPropertyInfo(name) { 615 return properties.hasOwnProperty(name) ? properties[name] : null; 616 } 617 function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { 618 this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; 619 this.attributeName = attributeName; 620 this.attributeNamespace = attributeNamespace; 621 this.mustUseProperty = mustUseProperty; 622 this.propertyName = name; 623 this.type = type; 624 this.sanitizeURL = sanitizeURL; 625 this.removeEmptyString = removeEmptyString; 626 } 627 var properties = {}; 628 [ 629 "children", 630 "dangerouslySetInnerHTML", 631 "defaultValue", 632 "defaultChecked", 633 "innerHTML", 634 "suppressContentEditableWarning", 635 "suppressHydrationWarning", 636 "style" 637 ].forEach(function(name) { 638 properties[name] = new PropertyInfoRecord(name, RESERVED, false, name, null, false, false); 639 }); 640 [ 641 ["acceptCharset", "accept-charset"], 642 ["className", "class"], 643 ["htmlFor", "for"], 644 ["httpEquiv", "http-equiv"] 645 ].forEach(function(_ref) { 646 var name = _ref[0], attributeName = _ref[1]; 647 properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, null, false, false); 648 }); 649 [ 650 "contentEditable", 651 "draggable", 652 "spellCheck", 653 "value" 654 ].forEach(function(name) { 655 properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name.toLowerCase(), null, false, false); 656 }); 657 [ 658 "autoReverse", 659 "externalResourcesRequired", 660 "focusable", 661 "preserveAlpha" 662 ].forEach(function(name) { 663 properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name, null, false, false); 664 }); 665 [ 666 "allowFullScreen", 667 "async", 668 "autoFocus", 669 "autoPlay", 670 "controls", 671 "default", 672 "defer", 673 "disabled", 674 "disablePictureInPicture", 675 "disableRemotePlayback", 676 "formNoValidate", 677 "hidden", 678 "loop", 679 "noModule", 680 "noValidate", 681 "open",
682 "playsInline", 683 "readOnly", 684 "required", 685 "reversed", 686 "scoped", 687 "seamless", 688 "itemScope" 689 ].forEach(function(name) { 690 properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, name.toLowerCase(), null, false, false); 691 }); 692 [ 693 "checked", 694 "multiple", 695 "muted", 696 "selected" 697 ].forEach(function(name) { 698 properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, name, null, false, false); 699 }); 700 ["capture", "download"].forEach(function(name) { 701 properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, name, null, false, false); 702 }); 703 [ 704 "cols", 705 "rows", 706 "size", 707 "span" 708 ].forEach(function(name) { 709 properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, name, null, false, false); 710 }); 711 ["rowSpan", "start"].forEach(function(name) { 712 properties[name] = new PropertyInfoRecord(name, NUMERIC, false, name.toLowerCase(), null, false, false); 713 }); 714 var CAMELIZE = /[\-\:]([a-z])/g; 715 var capitalize = function(token) { 716 return token[1].toUpperCase(); 717 }; 718 [ 719 "accent-height", 720 "alignment-baseline", 721 "arabic-form", 722 "baseline-shift", 723 "cap-height", 724 "clip-path", 725 "clip-rule", 726 "color-interpolation", 727 "color-interpolation-filters", 728 "color-profile", 729 "color-rendering", 730 "dominant-baseline", 731 "enable-background", 732 "fill-opacity", 733 "fill-rule", 734 "flood-color", 735 "flood-opacity", 736 "font-family", 737 "font-size", 738 "font-size-adjust", 739 "font-stretch", 740 "font-style", 741 "font-variant", 742 "font-weight", 743 "glyph-name", 744 "glyph-orientation-horizontal", 745 "glyph-orientation-vertical", 746 "horiz-adv-x", 747 "horiz-origin-x", 748 "image-rendering", 749 "letter-spacing", 750 "lighting-color", 751 "marker-end", 752 "marker-mid", 753 "marker-start", 754 "overline-position", 755 "overline-thickness", 756 "paint-order", 757 "panose-1", 758 "pointer-events", 759 "rendering-intent", 760 "shape-rendering", 761 "stop-color", 762 "stop-opacity", 763 "strikethrough-position", 764 "strikethrough-thickness", 765 "stroke-dasharray", 766 "stroke-dashoffset", 767 "stroke-linecap", 768 "stroke-linejoin", 769 "stroke-miterlimit", 770 "stroke-opacity", 771 "stroke-width", 772 "text-anchor", 773 "text-decoration", 774 "text-rendering", 775 "underline-position", 776 "underline-thickness", 777 "unicode-bidi", 778 "unicode-range", 779 "units-per-em", 780 "v-alphabetic", 781 "v-hanging", 782 "v-ideographic", 783 "v-mathematical", 784 "vector-effect", 785 "vert-adv-y", 786 "vert-origin-x", 787 "vert-origin-y", 788 "word-spacing", 789 "writing-mode", 790 "xmlns:xlink", 791 "x-height" 792 ].forEach(function(attributeName) { 793 var name = attributeName.replace(CAMELIZE, capitalize); 794 properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, null, false, false); 795 }); 796 [ 797 "xlink:actuate", 798 "xlink:arcrole", 799 "xlink:role", 800 "xlink:show", 801 "xlink:title", 802 "xlink:type" 803 ].forEach(function(attributeName) { 804 var name = attributeName.replace(CAMELIZE, capitalize); 805 properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, "http://www.w3.org/1999/xlink", false, false); 806 }); 807 [ 808 "xml:base", 809 "xml:lang", 810 "xml:space" 811 ].forEach(function(attributeName) { 812 var name = attributeName.replace(CAMELIZE, capitalize); 813 properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, "http://www.w3.org/XML/1998/namespace", false, false); 814 }); 815 ["tabIndex", "crossOrigin"].forEach(function(attributeName) { 816 properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, false, false); 817 }); 818 var xlinkHref = "xlinkHref"; 819 properties[xlinkHref] = new PropertyInfoRecord("xlinkHref", STRING, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false); 820 [ 821 "src", 822 "href", 823 "action", 824 "formAction" 825 ].forEach(function(attributeName) { 826 properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, attributeName.toLowerCase(), null, true, true); 827 }); 828 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; 829 var didWarn = false;
830 function sanitizeURL(url) { 831 if (!didWarn && isJavaScriptProtocol.test(url)) { 832 didWarn = true; 833 error("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)); 834 } 835 } 836 /** 837 * Get the value for a property on a node. Only used in DEV for SSR validation. 838 * The "expected" argument is used as a hint of what the expected value is. 839 * Some properties have multiple equivalent values. 840 */ 841 function getValueForProperty(node, name, expected, propertyInfo) { 842 if (propertyInfo.mustUseProperty) return node[propertyInfo.propertyName]; 843 else { 844 checkAttributeStringCoercion(expected, name); 845 if (propertyInfo.sanitizeURL) sanitizeURL("" + expected); 846 var attributeName = propertyInfo.attributeName; 847 var stringValue = null; 848 if (propertyInfo.type === OVERLOADED_BOOLEAN) { 849 if (node.hasAttribute(attributeName)) { 850 var value = node.getAttribute(attributeName); 851 if (value === "") return true; 852 if (shouldRemoveAttribute(name, expected, propertyInfo, false)) return value; 853 if (value === "" + expected) return expected; 854 return value; 855 } 856 } else if (node.hasAttribute(attributeName)) { 857 if (shouldRemoveAttribute(name, expected, propertyInfo, false)) return node.getAttribute(attributeName); 858 if (propertyInfo.type === BOOLEAN) return expected; 859 stringValue = node.getAttribute(attributeName); 860 } 861 if (shouldRemoveAttribute(name, expected, propertyInfo, false)) return stringValue === null ? expected : stringValue; 862 else if (stringValue === "" + expected) return expected; 863 else return stringValue; 864 } 865 } 866 /** 867 * Get the value for a attribute on a node. Only used in DEV for SSR validation. 868 * The third argument is used as a hint of what the expected value is. Some 869 * attributes have multiple equivalent values. 870 */ 871 function getValueForAttribute(node, name, expected, isCustomComponentTag) { 872 if (!isAttributeNameSafe(name)) return; 873 if (!node.hasAttribute(name)) return expected === void 0 ? void 0 : null; 874 var value = node.getAttribute(name); 875 checkAttributeStringCoercion(expected, name); 876 if (value === "" + expected) return expected; 877 return value; 878 } 879 /** 880 * Sets the value for a property on a node. 881 * 882 * @param {DOMElement} node 883 * @param {string} name 884 * @param {*} value 885 */ 886 function setValueForProperty(node, name, value, isCustomComponentTag) { 887 var propertyInfo = getPropertyInfo(name); 888 if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) return; 889 if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) value = null; 890 if (isCustomComponentTag || propertyInfo === null) { 891 if (isAttributeNameSafe(name)) { 892 var _attributeName = name; 893 if (value === null) node.removeAttribute(_attributeName); 894 else { 895 checkAttributeStringCoercion(value, name); 896 node.setAttribute(_attributeName, "" + value); 897 } 898 } 899 return; 900 } 901 if (propertyInfo.mustUseProperty) { 902 var propertyName = propertyInfo.propertyName; 903 if (value === null) node[propertyName] = propertyInfo.type === BOOLEAN ? false : ""; 904 else node[propertyName] = value; 905 return; 906 } 907 var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace; 908 if (value === null) node.removeAttribute(attributeName); 909 else { 910 var _type = propertyInfo.type; 911 var attributeValue; 912 if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) attributeValue = ""; 913 else { 914 checkAttributeStringCoercion(value, attributeName); 915 attributeValue = "" + value; 916 if (propertyInfo.sanitizeURL) sanitizeURL(attributeValue.toString()); 917 } 918 if (attributeNamespace) node.setAttributeNS(attributeNamespace, attributeName, attributeValue); 919 else node.setAttribute(attributeName, attributeValue); 920 } 921 } 922 var REACT_ELEMENT_TYPE = Symbol.for("react.element"); 923 var REACT_PORTAL_TYPE = Symbol.for("react.portal"); 924 var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); 925 var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); 926 var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); 927 var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); 928 var REACT_CONTEXT_TYPE = Symbol.for("react.context"); 929 var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); 930 var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); 931 var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); 932 var REACT_MEMO_TYPE = Symbol.for("react.memo"); 933 var REACT_LAZY_TYPE = Symbol.for("react.lazy"); 934 var REACT_SCOPE_TYPE = Symbol.for("react.scope"); 935 var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); 936 var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); 937 var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); 938 var REACT_CACHE_TYPE = Symbol.for("react.cache"); 939 var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); 940 var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; 941 var FAUX_ITERATOR_SYMBOL = "@@iterator"; 942 function getIteratorFn(maybeIterable) { 943 if (maybeIterable === null || typeof maybeIterable !== "object") return null; 944 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; 945 if (typeof maybeIterator === "function") return maybeIterator; 946 return null; 947 } 948 var assign = Object.assign; 949 var disabledDepth = 0; 950 var prevLog; 951 var prevInfo; 952 var prevWarn; 953 var prevError; 954 var prevGroup; 955 var prevGroupCollapsed; 956 var prevGroupEnd; 957 function disabledLog() {} 958 disabledLog.__reactDisabledLog = true; 959 function disableLogs() { 960 if (disabledDepth === 0) { 961 prevLog = console.log; 962 prevInfo = console.info; 963 prevWarn = console.warn; 964 prevError = console.error; 965 prevGroup = console.group; 966 prevGroupCollapsed = console.groupCollapsed; 967 prevGroupEnd = console.groupEnd; 968 var props = { 969 configurable: true, 970 enumerable: true, 971 value: disabledLog, 972 writable: true 973 }; 974 Object.defineProperties(console, { 975 info: props, 976 log: props, 977 warn: props, 978 error: props, 979 group: props, 980 groupCollapsed: props, 981 groupEnd: props 982 }); 983 } 984 disabledDepth++; 985 } 986 function reenableLogs() { 987 disabledDepth--; 988 if (disabledDepth === 0) { 989 var props = { 990 configurable: true, 991 enumerable: true, 992 writable: true 993 }; 994 Object.defineProperties(console, { 995 log: assign({}, props, { value: prevLog }), 996 info: assign({}, props, { value: prevInfo }), 997 warn: assign({}, props, { value: prevWarn }), 998 error: assign({}, props, { value: prevError }), 999 group: assign({}, props, { value: prevGroup }), 1000 groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), 1001 groupEnd: assign({}, props, { value: prevGroupEnd }) 1002 }); 1003 } 1004 if (disabledDepth < 0) error("disabledDepth fell below zero. This is a bug in React. Please file an issue."); 1005 } 1006 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; 1007 var prefix; 1008 function describeBuiltInComponentFrame(name, source, ownerFn) { 1009 if (prefix === void 0) try { 1010 throw Error(); 1011 } catch (x) { 1012 var match = x.stack.trim().match(/\n( *(at )?)/); 1013 prefix = match && match[1] || ""; 1014 } 1015 return "\n" + prefix + name; 1016 } 1017 var reentry = false;
1018 var componentFrameCache = new (typeof WeakMap === "function" ? WeakMap : Map)(); 1019 function describeNativeComponentFrame(fn, construct) { 1020 if (!fn || reentry) return ""; 1021 var frame = componentFrameCache.get(fn); 1022 if (frame !== void 0) return frame; 1023 var control; 1024 reentry = true; 1025 var previousPrepareStackTrace = Error.prepareStackTrace; 1026 Error.prepareStackTrace = void 0; 1027 var previousDispatcher = ReactCurrentDispatcher.current; 1028 ReactCurrentDispatcher.current = null; 1029 disableLogs(); 1030 try { 1031 if (construct) { 1032 var Fake = function() { 1033 throw Error(); 1034 }; 1035 Object.defineProperty(Fake.prototype, "props", { set: function() { 1036 throw Error(); 1037 } }); 1038 if (typeof Reflect === "object" && Reflect.construct) { 1039 try { 1040 Reflect.construct(Fake, []); 1041 } catch (x) { 1042 control = x; 1043 } 1044 Reflect.construct(fn, [], Fake); 1045 } else { 1046 try { 1047 Fake.call(); 1048 } catch (x) { 1049 control = x; 1050 } 1051 fn.call(Fake.prototype); 1052 } 1053 } else { 1054 try { 1055 throw Error(); 1056 } catch (x) { 1057 control = x; 1058 } 1059 fn(); 1060 } 1061 } catch (sample) { 1062 if (sample && control && typeof sample.stack === "string") { 1063 var sampleLines = sample.stack.split("\n"); 1064 var controlLines = control.stack.split("\n"); 1065 var s = sampleLines.length - 1; 1066 var c = controlLines.length - 1; 1067 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) c--; 1068 for (; s >= 1 && c >= 0; s--, c--) if (sampleLines[s] !== controlLines[c]) { 1069 if (s !== 1 || c !== 1) do { 1070 s--; 1071 c--; 1072 if (c < 0 || sampleLines[s] !== controlLines[c]) { 1073 var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); 1074 if (fn.displayName && _frame.includes("<anonymous>")) _frame = _frame.replace("<anonymous>", fn.displayName); 1075 if (typeof fn === "function") componentFrameCache.set(fn, _frame); 1076 return _frame; 1077 } 1078 } while (s >= 1 && c >= 0); 1079 break; 1080 } 1081 } 1082 } finally { 1083 reentry = false; 1084 ReactCurrentDispatcher.current = previousDispatcher; 1085 reenableLogs(); 1086 Error.prepareStackTrace = previousPrepareStackTrace; 1087 } 1088 var name = fn ? fn.displayName || fn.name : ""; 1089 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; 1090 if (typeof fn === "function") componentFrameCache.set(fn, syntheticFrame); 1091 return syntheticFrame; 1092 } 1093 function describeClassComponentFrame(ctor, source, ownerFn) { 1094 return describeNativeComponentFrame(ctor, true); 1095 } 1096 function describeFunctionComponentFrame(fn, source, ownerFn) { 1097 return describeNativeComponentFrame(fn, false); 1098 } 1099 function shouldConstruct(Component) { 1100 var prototype = Component.prototype; 1101 return !!(prototype && prototype.isReactComponent); 1102 } 1103 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { 1104 if (type == null) return ""; 1105 if (typeof type === "function") return describeNativeComponentFrame(type, shouldConstruct(type)); 1106 if (typeof type === "string") return describeBuiltInComponentFrame(type); 1107 switch (type) { 1108 case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense"); 1109 case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList"); 1110 } 1111 if (typeof type === "object") switch (type.$$typeof) { 1112 case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); 1113 case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); 1114 case REACT_LAZY_TYPE: 1115 var lazyComponent = type; 1116 var payload = lazyComponent._payload; 1117 var init = lazyComponent._init; 1118 try { 1119 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); 1120 } catch (x) {} 1121 } 1122 return ""; 1123 } 1124 function describeFiber(fiber) { 1125 fiber._debugOwner && fiber._debugOwner.type; 1126 fiber._debugSource; 1127 switch (fiber.tag) { 1128 case HostComponent: return describeBuiltInComponentFrame(fiber.type); 1129 case LazyComponent: return describeBuiltInComponentFrame("Lazy"); 1130 case SuspenseComponent: return describeBuiltInComponentFrame("Suspense"); 1131 case SuspenseListComponent: return describeBuiltInComponentFrame("SuspenseList"); 1132 case FunctionComponent:
1133 case IndeterminateComponent: 1134 case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); 1135 case ForwardRef: return describeFunctionComponentFrame(fiber.type.render); 1136 case ClassComponent: return describeClassComponentFrame(fiber.type); 1137 default: return ""; 1138 } 1139 } 1140 function getStackByFiberInDevAndProd(workInProgress) { 1141 try { 1142 var info = ""; 1143 var node = workInProgress; 1144 do { 1145 info += describeFiber(node); 1146 node = node.return; 1147 } while (node); 1148 return info; 1149 } catch (x) { 1150 return "\nError generating stack: " + x.message + "\n" + x.stack; 1151 } 1152 } 1153 function getWrappedName(outerType, innerType, wrapperName) { 1154 var displayName = outerType.displayName; 1155 if (displayName) return displayName; 1156 var functionName = innerType.displayName || innerType.name || ""; 1157 return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName; 1158 } 1159 function getContextName(type) { 1160 return type.displayName || "Context"; 1161 } 1162 function getComponentNameFromType(type) { 1163 if (type == null) return null; 1164 if (typeof type.tag === "number") error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."); 1165 if (typeof type === "function") return type.displayName || type.name || null; 1166 if (typeof type === "string") return type; 1167 switch (type) { 1168 case REACT_FRAGMENT_TYPE: return "Fragment"; 1169 case REACT_PORTAL_TYPE: return "Portal"; 1170 case REACT_PROFILER_TYPE: return "Profiler"; 1171 case REACT_STRICT_MODE_TYPE: return "StrictMode"; 1172 case REACT_SUSPENSE_TYPE: return "Suspense"; 1173 case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; 1174 } 1175 if (typeof type === "object") switch (type.$$typeof) { 1176 case REACT_CONTEXT_TYPE: return getContextName(type) + ".Consumer"; 1177 case REACT_PROVIDER_TYPE: return getContextName(type._context) + ".Provider"; 1178 case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, "ForwardRef"); 1179 case REACT_MEMO_TYPE: 1180 var outerName = type.displayName || null; 1181 if (outerName !== null) return outerName; 1182 return getComponentNameFromType(type.type) || "Memo"; 1183 case REACT_LAZY_TYPE: 1184 var lazyComponent = type; 1185 var payload = lazyComponent._payload; 1186 var init = lazyComponent._init; 1187 try { 1188 return getComponentNameFromType(init(payload)); 1189 } catch (x) { 1190 return null; 1191 } 1192 } 1193 return null; 1194 } 1195 function getWrappedName$1(outerType, innerType, wrapperName) { 1196 var functionName = innerType.displayName || innerType.name || ""; 1197 return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); 1198 } 1199 function getContextName$1(type) { 1200 return type.displayName || "Context"; 1201 } 1202 function getComponentNameFromFiber(fiber) { 1203 var tag = fiber.tag, type = fiber.type; 1204 switch (tag) { 1205 case CacheComponent: return "Cache"; 1206 case ContextConsumer: return getContextName$1(type) + ".Consumer"; 1207 case ContextProvider: return getContextName$1(type._context) + ".Provider"; 1208 case DehydratedFragment: return "DehydratedFragment"; 1209 case ForwardRef: return getWrappedName$1(type, type.render, "ForwardRef"); 1210 case Fragment: return "Fragment"; 1211 case HostComponent: return type; 1212 case HostPortal: return "Portal"; 1213 case HostRoot: return "Root"; 1214 case HostText: return "Text"; 1215 case LazyComponent: return getComponentNameFromType(type); 1216 case Mode: 1217 if (type === REACT_STRICT_MODE_TYPE) return "StrictMode"; 1218 return "Mode"; 1219 case OffscreenComponent: return "Offscreen"; 1220 case Profiler: return "Profiler"; 1221 case ScopeComponent: return "Scope"; 1222 case SuspenseComponent: return "Suspense"; 1223 case SuspenseListComponent: return "SuspenseList"; 1224 case TracingMarkerComponent: return "TracingMarker"; 1225 case ClassComponent: 1226 case FunctionComponent: 1227 case IncompleteClassComponent: 1228 case IndeterminateComponent: 1229 case MemoComponent: 1230 case SimpleMemoComponent: 1231 if (typeof type === "function") return type.displayName || type.name || null; 1232 if (typeof type === "string") return type; 1233 break; 1234 } 1235 return null; 1236 } 1237 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; 1238 var current = null; 1239 var isRendering = false;
1240 function getCurrentFiberOwnerNameInDevOrNull() { 1241 if (current === null) return null; 1242 var owner = current._debugOwner; 1243 if (owner !== null && typeof owner !== "undefined") return getComponentNameFromFiber(owner); 1244 return null; 1245 } 1246 function getCurrentFiberStackInDev() { 1247 if (current === null) return ""; 1248 return getStackByFiberInDevAndProd(current); 1249 } 1250 function resetCurrentFiber() { 1251 ReactDebugCurrentFrame.getCurrentStack = null; 1252 current = null; 1253 isRendering = false; 1254 } 1255 function setCurrentFiber(fiber) { 1256 ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev; 1257 current = fiber; 1258 isRendering = false; 1259 } 1260 function getCurrentFiber() { 1261 return current; 1262 } 1263 function setIsRendering(rendering) { 1264 isRendering = rendering; 1265 } 1266 function toString(value) { 1267 return "" + value; 1268 } 1269 function getToStringValue(value) { 1270 switch (typeof value) { 1271 case "boolean": 1272 case "number": 1273 case "string": 1274 case "undefined": return value; 1275 case "object": 1276 checkFormFieldValueStringCoercion(value); 1277 return value; 1278 default: return ""; 1279 } 1280 } 1281 var hasReadOnlyValue = { 1282 button: true, 1283 checkbox: true, 1284 image: true, 1285 hidden: true, 1286 radio: true, 1287 reset: true, 1288 submit: true 1289 }; 1290 function checkControlledValueProps(tagName, props) { 1291 if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) 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`."); 1292 if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) 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`."); 1293 } 1294 function isCheckable(elem) { 1295 var type = elem.type; 1296 var nodeName = elem.nodeName; 1297 return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio"); 1298 } 1299 function getTracker(node) { 1300 return node._valueTracker; 1301 } 1302 function detachTracker(node) { 1303 node._valueTracker = null; 1304 } 1305 function getValueFromNode(node) { 1306 var value = ""; 1307 if (!node) return value; 1308 if (isCheckable(node)) value = node.checked ? "true" : "false"; 1309 else value = node.value; 1310 return value; 1311 } 1312 function trackValueOnNode(node) { 1313 var valueField = isCheckable(node) ? "checked" : "value"; 1314 var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); 1315 checkFormFieldValueStringCoercion(node[valueField]); 1316 var currentValue = "" + node[valueField]; 1317 if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") return; 1318 var get = descriptor.get, set = descriptor.set; 1319 Object.defineProperty(node, valueField, { 1320 configurable: true, 1321 get: function() { 1322 return get.call(this); 1323 }, 1324 set: function(value) { 1325 checkFormFieldValueStringCoercion(value); 1326 currentValue = "" + value; 1327 set.call(this, value); 1328 } 1329 }); 1330 Object.defineProperty(node, valueField, { enumerable: descriptor.enumerable }); 1331 return { 1332 getValue: function() { 1333 return currentValue; 1334 }, 1335 setValue: function(value) { 1336 checkFormFieldValueStringCoercion(value); 1337 currentValue = "" + value; 1338 }, 1339 stopTracking: function() { 1340 detachTracker(node); 1341 delete node[valueField]; 1342 } 1343 }; 1344 } 1345 function track(node) { 1346 if (getTracker(node)) return; 1347 node._valueTracker = trackValueOnNode(node); 1348 } 1349 function updateValueIfChanged(node) { 1350 if (!node) return false; 1351 var tracker = getTracker(node); 1352 if (!tracker) return true; 1353 var lastValue = tracker.getValue(); 1354 var nextValue = getValueFromNode(node); 1355 if (nextValue !== lastValue) { 1356 tracker.setValue(nextValue); 1357 return true; 1358 } 1359 return false;
1360 } 1361 function getActiveElement(doc) { 1362 doc = doc || (typeof document !== "undefined" ? document : void 0); 1363 if (typeof doc === "undefined") return null; 1364 try { 1365 return doc.activeElement || doc.body; 1366 } catch (e) { 1367 return doc.body; 1368 } 1369 } 1370 var didWarnValueDefaultValue = false; 1371 var didWarnCheckedDefaultChecked = false; 1372 var didWarnControlledToUncontrolled = false; 1373 var didWarnUncontrolledToControlled = false; 1374 function isControlled(props) { 1375 return props.type === "checkbox" || props.type === "radio" ? props.checked != null : props.value != null; 1376 } 1377 /** 1378 * Implements an <input> host component that allows setting these optional 1379 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. 1380 * 1381 * If `checked` or `value` are not supplied (or null/undefined), user actions 1382 * that affect the checked state or value will trigger updates to the element. 1383 * 1384 * If they are supplied (and not null/undefined), the rendered element will not 1385 * trigger updates to the element. Instead, the props must change in order for 1386 * the rendered element to be updated. 1387 * 1388 * The rendered element will be initialized as unchecked (or `defaultChecked`) 1389 * with an empty value (or `defaultValue`). 1390 * 1391 * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html 1392 */ 1393 function getHostProps(element, props) { 1394 var node = element; 1395 var checked = props.checked; 1396 return assign({}, props, { 1397 defaultChecked: void 0, 1398 defaultValue: void 0, 1399 value: void 0, 1400 checked: checked != null ? checked : node._wrapperState.initialChecked 1401 }); 1402 } 1403 function initWrapperState(element, props) { 1404 checkControlledValueProps("input", props); 1405 if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) { 1406 error("%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://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type); 1407 didWarnCheckedDefaultChecked = true; 1408 } 1409 if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) { 1410 error("%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://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type); 1411 didWarnValueDefaultValue = true; 1412 } 1413 var node = element; 1414 var defaultValue = props.defaultValue == null ? "" : props.defaultValue; 1415 node._wrapperState = { 1416 initialChecked: props.checked != null ? props.checked : props.defaultChecked, 1417 initialValue: getToStringValue(props.value != null ? props.value : defaultValue), 1418 controlled: isControlled(props) 1419 }; 1420 } 1421 function updateChecked(element, props) { 1422 var node = element; 1423 var checked = props.checked; 1424 if (checked != null) setValueForProperty(node, "checked", checked, false); 1425 } 1426 function updateWrapper(element, props) { 1427 var node = element; 1428 var controlled = isControlled(props); 1429 if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { 1430 error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"); 1431 didWarnUncontrolledToControlled = true; 1432 } 1433 if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { 1434 error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"); 1435 didWarnControlledToUncontrolled = true; 1436 } 1437 updateChecked(element, props); 1438 var value = getToStringValue(props.value); 1439 var type = props.type; 1440 if (value != null) { 1441 if (type === "number") { 1442 if (value === 0 && node.value === "" || node.value != value) node.value = toString(value); 1443 } else if (node.value !== toString(value)) node.value = toString(value); 1444 } else if (type === "submit" || type === "reset") { 1445 node.removeAttribute("value"); 1446 return; 1447 } 1448 if (props.hasOwnProperty("value")) setDefaultValue(node, props.type, value); 1449 else if (props.hasOwnProperty("defaultValue")) setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); 1450 if (props.checked == null && props.defaultChecked != null) node.defaultChecked = !!props.defaultChecked; 1451 } 1452 function postMountWrapper(element, props, isHydrating) { 1453 var node = element; 1454 if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) { 1455 var type = props.type; 1456 if ((type === "submit" || type === "reset") && (props.value === void 0 || props.value === null)) return; 1457 var initialValue = toString(node._wrapperState.initialValue); 1458 if (!isHydrating) { 1459 if (initialValue !== node.value) node.value = initialValue; 1460 } 1461 node.defaultValue = initialValue; 1462 } 1463 var name = node.name; 1464 if (name !== "") node.name = ""; 1465 node.defaultChecked = !node.defaultChecked; 1466 node.defaultChecked = !!node._wrapperState.initialChecked; 1467 if (name !== "") node.name = name; 1468 } 1469 function restoreControlledState(element, props) { 1470 var node = element; 1471 updateWrapper(node, props); 1472 updateNamedCousins(node, props); 1473 } 1474 function updateNamedCousins(rootNode, props) { 1475 var name = props.name; 1476 if (props.type === "radio" && name != null) { 1477 var queryRoot = rootNode; 1478 while (queryRoot.parentNode) queryRoot = queryRoot.parentNode; 1479 checkAttributeStringCoercion(name, "name"); 1480 var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + "][type=\"radio\"]"); 1481 for (var i = 0; i < group.length; i++) { 1482 var otherNode = group[i];
1483 if (otherNode === rootNode || otherNode.form !== rootNode.form) continue; 1484 var otherProps = getFiberCurrentPropsFromNode(otherNode); 1485 if (!otherProps) throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."); 1486 updateValueIfChanged(otherNode); 1487 updateWrapper(otherNode, otherProps); 1488 } 1489 } 1490 } 1491 function setDefaultValue(node, type, value) { 1492 if (type !== "number" || getActiveElement(node.ownerDocument) !== node) { 1493 if (value == null) node.defaultValue = toString(node._wrapperState.initialValue); 1494 else if (node.defaultValue !== toString(value)) node.defaultValue = toString(value); 1495 } 1496 } 1497 var didWarnSelectedSetOnOption = false; 1498 var didWarnInvalidChild = false; 1499 var didWarnInvalidInnerHTML = false; 1500 /** 1501 * Implements an <option> host component that warns when `selected` is set. 1502 */ 1503 function validateProps(element, props) { 1504 if (props.value == null) { 1505 if (typeof props.children === "object" && props.children !== null) React.Children.forEach(props.children, function(child) { 1506 if (child == null) return; 1507 if (typeof child === "string" || typeof child === "number") return; 1508 if (!didWarnInvalidChild) { 1509 didWarnInvalidChild = true; 1510 error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."); 1511 } 1512 }); 1513 else if (props.dangerouslySetInnerHTML != null) { 1514 if (!didWarnInvalidInnerHTML) { 1515 didWarnInvalidInnerHTML = true; 1516 error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."); 1517 } 1518 } 1519 } 1520 if (props.selected != null && !didWarnSelectedSetOnOption) { 1521 error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."); 1522 didWarnSelectedSetOnOption = true; 1523 } 1524 } 1525 function postMountWrapper$1(element, props) { 1526 if (props.value != null) element.setAttribute("value", toString(getToStringValue(props.value))); 1527 } 1528 var isArrayImpl = Array.isArray; 1529 function isArray(a) { 1530 return isArrayImpl(a); 1531 } 1532 var didWarnValueDefaultValue$1 = false; 1533 function getDeclarationErrorAddendum() { 1534 var ownerName = getCurrentFiberOwnerNameInDevOrNull(); 1535 if (ownerName) return "\n\nCheck the render method of `" + ownerName + "`."; 1536 return ""; 1537 } 1538 var valuePropNames = ["value", "defaultValue"]; 1539 /** 1540 * Validation function for `value` and `defaultValue`. 1541 */ 1542 function checkSelectPropTypes(props) { 1543 checkControlledValueProps("select", props); 1544 for (var i = 0; i < valuePropNames.length; i++) { 1545 var propName = valuePropNames[i]; 1546 if (props[propName] == null) continue; 1547 var propNameIsArray = isArray(props[propName]); 1548 if (props.multiple && !propNameIsArray) error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", propName, getDeclarationErrorAddendum()); 1549 else if (!props.multiple && propNameIsArray) error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", propName, getDeclarationErrorAddendum()); 1550 } 1551 } 1552 function updateOptions(node, multiple, propValue, setDefaultSelected) { 1553 var options = node.options; 1554 if (multiple) { 1555 var selectedValues = propValue; 1556 var selectedValue = {}; 1557 for (var i = 0; i < selectedValues.length; i++) selectedValue["$" + selectedValues[i]] = true; 1558 for (var _i = 0; _i < options.length; _i++) { 1559 var selected = selectedValue.hasOwnProperty("$" + options[_i].value); 1560 if (options[_i].selected !== selected) options[_i].selected = selected; 1561 if (selected && setDefaultSelected) options[_i].defaultSelected = true; 1562 } 1563 } else { 1564 var _selectedValue = toString(getToStringValue(propValue)); 1565 var defaultSelected = null; 1566 for (var _i2 = 0; _i2 < options.length; _i2++) { 1567 if (options[_i2].value === _selectedValue) { 1568 options[_i2].selected = true; 1569 if (setDefaultSelected) options[_i2].defaultSelected = true; 1570 return; 1571 } 1572 if (defaultSelected === null && !options[_i2].disabled) defaultSelected = options[_i2]; 1573 } 1574 if (defaultSelected !== null) defaultSelected.selected = true; 1575 } 1576 } 1577 /** 1578 * Implements a <select> host component that allows optionally setting the 1579 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a 1580 * stringable. If `multiple` is true, the prop must be an array of str
1580ingables. 1581 * 1582 * If `value` is not supplied (or null/undefined), user actions that change the 1583 * selected option will trigger updates to the rendered options. 1584 * 1585 * If it is supplied (and not null/undefined), the rendered options will not 1586 * update in response to user actions. Instead, the `value` prop must change in 1587 * order for the rendered options to update. 1588 * 1589 * If `defaultValue` is provided, any options with the supplied values will be 1590 * selected. 1591 */ 1592 function getHostProps$1(element, props) { 1593 return assign({}, props, { value: void 0 }); 1594 } 1595 function initWrapperState$1(element, props) { 1596 var node = element; 1597 checkSelectPropTypes(props); 1598 node._wrapperState = { wasMultiple: !!props.multiple }; 1599 if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue$1) { 1600 error("Select 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 select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"); 1601 didWarnValueDefaultValue$1 = true; 1602 } 1603 } 1604 function postMountWrapper$2(element, props) { 1605 var node = element; 1606 node.multiple = !!props.multiple; 1607 var value = props.value; 1608 if (value != null) updateOptions(node, !!props.multiple, value, false); 1609 else if (props.defaultValue != null) updateOptions(node, !!props.multiple, props.defaultValue, true); 1610 } 1611 function postUpdateWrapper(element, props) { 1612 var node = element; 1613 var wasMultiple = node._wrapperState.wasMultiple; 1614 node._wrapperState.wasMultiple = !!props.multiple; 1615 var value = props.value; 1616 if (value != null) updateOptions(node, !!props.multiple, value, false); 1617 else if (wasMultiple !== !!props.multiple) if (props.defaultValue != null) updateOptions(node, !!props.multiple, props.defaultValue, true); 1618 else updateOptions(node, !!props.multiple, props.multiple ? [] : "", false); 1619 } 1620 function restoreControlledState$1(element, props) { 1621 var node = element; 1622 var value = props.value; 1623 if (value != null) updateOptions(node, !!props.multiple, value, false); 1624 } 1625 var didWarnValDefaultVal = false; 1626 /** 1627 * Implements a <textarea> host component that allows setting `value`, and 1628 * `defaultValue`. This differs from the traditional DOM API because value is 1629 * usually set as PCDATA children. 1630 * 1631 * If `value` is not supplied (or null/undefined), user actions that affect the 1632 * value will trigger updates to the element. 1633 * 1634 * If `value` is supplied (and not null/undefined), the rendered element will 1635 * not trigger updates to the element. Instead, the `value` prop must change in 1636 * order for the rendered element to be updated. 1637 * 1638 * The rendered element will be initialized with an empty value, the prop 1639 * `defaultValue` if specified, or the children content (deprecated). 1640 */ 1641 function getHostProps$2(element, props) { 1642 var node = element; 1643 if (props.dangerouslySetInnerHTML != null) throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>."); 1644 return assign({}, props, { 1645 value: void 0, 1646 defaultValue: void 0, 1647 children: toString(node._wrapperState.initialValue) 1648 }); 1649 } 1650 function initWrapperState$2(element, props) { 1651 var node = element; 1652 checkControlledValueProps("textarea", props); 1653 if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValDefaultVal) { 1654 error("%s contains a textarea with both value and defaultValue props. Textarea 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 textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component"); 1655 didWarnValDefaultVal = true; 1656 } 1657 var initialValue = props.value; 1658 if (initialValue == null) { 1659 var children = props.children, defaultValue = props.defaultValue; 1660 if (children != null) { 1661 error("Use the `defaultValue` or `value` props instead of setting children on <textarea>."); 1662 if (defaultValue != null) throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children."); 1663 if (isArray(children)) { 1664 if (children.length > 1) throw new Error("<textarea> can only have at most one child."); 1665 children = children[0]; 1666 } 1667 defaultValue = children; 1668 } 1669 if (defaultValue == null) defaultValue = ""; 1670 initialValue = defaultValue; 1671 } 1672 node._wrapperState = { initialValue: getToStringValue(initialValue) }; 1673 } 1674 function updateWrapper$1(element, props) { 1675 var node = element; 1676 var value = getToStringValue(props.value); 1677 var defaultValue = getToStringValue(props.defaultValue); 1678 if (value != null) { 1679 var newValue = toString(value); 1680 if (newValue !== node.value) node.value = newValue; 1681 if (props.defaultValue == null && node.defaultValue !== newValue) node.defaultValue = newValue; 1682 } 1683 if (defaultValue != null) node.defaultValue = toString(defaultValue); 1684 } 1685 function postMountWrapper$3(element, props) { 1686 var node = element; 1687 var textContent = node.textContent; 1688 if (textContent === node._wrapperState.initialValue) { 1689 if (textContent !== "" && textContent !== null) node.value = textContent; 1690 } 1691 } 1692 function restoreControlledState$2(element, props) { 1693 updateWrapper$1(element, props); 1694 } 1695 var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; 1696 var MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML"; 1697 var SVG_NAMESPACE = "http://www.w3.org/2000/svg"; 1698 function getIntrinsicNamespace(type) { 1699 switch (type) { 1700 case "svg": return SVG_NAMESPACE; 1701 case "math": return MATH_NAMESPACE; 1702 default: return HTML_NAMESPACE; 1703 } 1704 } 1705 function getChildNamespace(parentNamespace, type) { 1706 if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) return getIntrinsicNamespace(type); 1707 if (parentNamespace === SVG_NAMESPACE && type === "foreignObject") return HTML_NAMESPACE; 1708 return parentNamespace; 1709 } 1710 /** 1711 * Create a function which has 'unsafe' privileges (required by windows8 apps) 1712 */ 1713 var createMicrosoftUnsafeLocalFunction = function(func) { 1714 if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) return function(arg0, arg1, arg2, arg3) { 1715 MSApp.execUnsafeLocalFunction(function() { 1716 return func(arg0, arg1, arg2, arg3); 1717 }); 1718 }; 1719 else return func; 1720 };
vendor: 7,629 bytes, lines 1721-2052
1721 var reusableSVGContainer; 1722 /** 1723 * Set the innerHTML property of a node 1724 * 1725 * @param {DOMElement} node 1726 * @param {string} html 1727 * @internal 1728 */ 1729 var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) { 1730 if (node.namespaceURI === SVG_NAMESPACE) { 1731 if (!("innerHTML" in node)) { 1732 reusableSVGContainer = reusableSVGContainer || document.createElement("div"); 1733 reusableSVGContainer.innerHTML = "<svg>" + html.valueOf().toString() + "</svg>"; 1734 var svgNode = reusableSVGContainer.firstChild; 1735 while (node.firstChild) node.removeChild(node.firstChild); 1736 while (svgNode.firstChild) node.appendChild(svgNode.firstChild); 1737 return; 1738 } 1739 } 1740 node.innerHTML = html; 1741 }); 1742 /** 1743 * HTML nodeType values that represent the type of the node 1744 */ 1745 var ELEMENT_NODE = 1; 1746 var TEXT_NODE = 3; 1747 var COMMENT_NODE = 8; 1748 var DOCUMENT_NODE = 9; 1749 var DOCUMENT_FRAGMENT_NODE = 11; 1750 /** 1751 * Set the textContent property of a node. For text updates, it's faster 1752 * to set the `nodeValue` of the Text node directly instead of using 1753 * `.textContent` which will remove the existing node and create a new one. 1754 * 1755 * @param {DOMElement} node 1756 * @param {string} text 1757 * @internal 1758 */ 1759 var setTextContent = function(node, text) { 1760 if (text) { 1761 var firstChild = node.firstChild; 1762 if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) { 1763 firstChild.nodeValue = text; 1764 return; 1765 } 1766 } 1767 node.textContent = text; 1768 }; 1769 var shorthandToLonghand = { 1770 animation: [ 1771 "animationDelay", 1772 "animationDirection", 1773 "animationDuration", 1774 "animationFillMode", 1775 "animationIterationCount", 1776 "animationName", 1777 "animationPlayState", 1778 "animationTimingFunction" 1779 ], 1780 background: [ 1781 "backgroundAttachment", 1782 "backgroundClip", 1783 "backgroundColor", 1784 "backgroundImage", 1785 "backgroundOrigin", 1786 "backgroundPositionX", 1787 "backgroundPositionY", 1788 "backgroundRepeat", 1789 "backgroundSize" 1790 ], 1791 backgroundPosition: ["backgroundPositionX", "backgroundPositionY"], 1792 border: [ 1793 "borderBottomColor", 1794 "borderBottomStyle", 1795 "borderBottomWidth", 1796 "borderImageOutset", 1797 "borderImageRepeat", 1798 "borderImageSlice", 1799 "borderImageSource", 1800 "borderImageWidth", 1801 "borderLeftColor", 1802 "borderLeftStyle", 1803 "borderLeftWidth", 1804 "borderRightColor", 1805 "borderRightStyle", 1806 "borderRightWidth", 1807 "borderTopColor", 1808 "borderTopStyle", 1809 "borderTopWidth" 1810 ], 1811 borderBlockEnd: [ 1812 "borderBlockEndColor", 1813 "borderBlockEndStyle", 1814 "borderBlockEndWidth" 1815 ], 1816 borderBlockStart: [ 1817 "borderBlockStartColor", 1818 "borderBlockStartStyle", 1819 "borderBlockStartWidth" 1820 ], 1821 borderBottom: [ 1822 "borderBottomColor", 1823 "borderBottomStyle", 1824 "borderBottomWidth" 1825 ], 1826 borderColor: [ 1827 "borderBottomColor", 1828 "borderLeftColor", 1829 "borderRightColor", 1830 "borderTopColor" 1831 ], 1832 borderImage: [ 1833 "borderImageOutset", 1834 "borderImageRepeat", 1835 "borderImageSlice", 1836 "borderImageSource", 1837 "borderImageWidth" 1838 ], 1839 borderInlineEnd: [ 1840 "borderInlineEndColor", 1841 "borderInlineEndStyle", 1842 "borderInlineEndWidth" 1843 ], 1844 borderInlineStart: [ 1845 "borderInlineStartColor", 1846 "borderInlineStartStyle", 1847 "borderInlineStartWidth" 1848 ], 1849 borderLeft: [ 1850 "borderLeftColor", 1851 "borderLeftStyle", 1852 "borderLeftWidth" 1853 ], 1854 borderRadius: [ 1855 "borderBottomLeftRadius", 1856 "borderBottomRightRadius", 1857 "borderTopLeftRadius", 1858 "borderTopRightRadius" 1859 ], 1860 borderRight: [ 1861 "borderRightColor", 1862 "borderRightStyle", 1863 "borderRightWidth" 1864 ], 1865 borderStyle: [ 1866 "borderBottomStyle", 1867 "borderLeftStyle", 1868 "borderRightStyle", 1869 "borderTopStyle" 1870 ], 1871 borderTop: [ 1872 "borderTopColor", 1873 "borderTopStyle", 1874 "borderTopWidth" 1875 ], 1876 borderWidth: [ 1877 "borderBottomWidth", 1878 "borderLeftWidth", 1879 "borderRightWidth", 1880 "borderTopWidth" 1881 ], 1882 columnRule: [ 1883 "columnRuleColor", 1884 "columnRuleStyle", 1885 "columnRuleWidth" 1886 ], 1887 columns: ["columnCount", "columnWidth"], 1888 flex: [ 1889 "flexBasis", 1890 "flexGrow", 1891 "flexShrink" 1892 ], 1893 flexFlow: ["flexDirection", "flexWrap"], 1894 font: [ 1895 "fontFamily", 1896 "fontFeatureSettings", 1897 "fontKerning", 1898 "fontLanguageOverride", 1899 "fontSize", 1900 "fontSizeAdjust", 1901 "fontStretch", 1902 "fontStyle", 1903 "fontVariant", 1904 "fontVariantAlternates", 1905 "fontVariantCaps", 1906 "fontVariantEastAsian", 1907 "fontVariantLigatures", 1908 "fontVariantNumeric", 1909 "fontVariantPosition", 1910 "fontWeight", 1911 "lineHeight" 1912 ], 1913 fontVariant: [ 1914 "fontVariantAlternates", 1915 "fontVariantCaps", 1916 "fontVariantEastAsian", 1917 "fontVariantLigatures", 1918 "fontVariantNumeric", 1919 "fontVariantPosition" 1920 ], 1921 gap: ["columnGap", "rowGap"], 1922 grid: [ 1923 "gridAutoColumns", 1924 "gridAutoFlow", 1925 "gridAutoRows", 1926 "gridTemplateAreas", 1927 "gridTemplateColumns", 1928 "gridTemplateRows" 1929 ], 1930 gridArea: [ 1931 "gridColumnEnd", 1932 "gridColumnStart", 1933 "gridRowEnd", 1934 "gridRowStart" 1935 ], 1936 gridColumn: ["gridColumnEnd", "gridColumnStart"], 1937 gridColumnGap: ["columnGap"], 1938 gridGap: ["columnGap", "rowGap"], 1939 gridRow: ["gridRowEnd", "gridRowStart"], 1940 gridRowGap: ["rowGap"], 1941 gridTemplate: [ 1942 "gridTemplateAreas", 1943 "gridTemplateColumns", 1944 "gridTemplateRows" 1945 ], 1946 listStyle: [ 1947 "listStyleImage", 1948 "listStylePosition", 1949 "listStyleType" 1950 ], 1951 margin: [ 1952 "marginBottom", 1953 "marginLeft", 1954 "marginRight", 1955 "marginTop" 1956 ], 1957 marker: [ 1958 "markerEnd", 1959 "markerMid", 1960 "markerStart" 1961 ], 1962 mask: [ 1963 "maskClip", 1964 "maskComposite", 1965 "maskImage", 1966 "maskMode", 1967 "maskOrigin", 1968 "maskPositionX", 1969 "maskPositionY", 1970 "maskRepeat", 1971 "maskSize" 1972 ], 1973 maskPosition: ["maskPositionX", "maskPositionY"], 1974 outline: [ 1975 "outlineColor", 1976 "outlineStyle", 1977 "outlineWidth" 1978 ], 1979 overflow: ["overflowX", "overflowY"], 1980 padding: [ 1981 "paddingBottom", 1982 "paddingLeft", 1983 "paddingRight", 1984 "paddingTop" 1985 ], 1986 placeContent: ["alignContent", "justifyContent"], 1987 placeItems: ["alignItems", "justifyItems"], 1988 placeSelf: ["alignSelf", "justifySelf"], 1989 textDecoration: [ 1990 "textDecorationColor", 1991 "textDecorationLine", 1992 "textDecorationStyle" 1993 ], 1994 textEmphasis: ["textEmphasisColor", "textEmphasisStyle"], 1995 transition: [ 1996 "transitionDelay", 1997 "transitionDuration", 1998 "transitionProperty", 1999 "transitionTimingFunction" 2000 ], 2001 wordWrap: ["overflowWrap"] 2002 }; 2003 /** 2004 * CSS properties which accept numbers but are not in units of "px". 2005 */ 2006 var isUnitlessNumber = { 2007 animationIterationCount: true, 2008 aspectRatio: true, 2009 borderImageOutset: true, 2010 borderImageSlice: true, 2011 borderImageWidth: true, 2012 boxFlex: true, 2013 boxFlexGroup: true, 2014 boxOrdinalGroup: true, 2015 columnCount: true, 2016 columns: true, 2017 flex: true, 2018 flexGrow: true, 2019 flexPositive: true, 2020 flexShrink: true, 2021 flexNegative: true, 2022 flexOrder: true, 2023 gridArea: true, 2024 gridRow: true, 2025 gridRowEnd: true, 2026 gridRowSpan: true, 2027 gridRowStart: true, 2028 gridColumn: true, 2029 gridColumnEnd: true, 2030 gridColumnSpan: true, 2031 gridColumnStart: true, 2032 fontWeight: true, 2033 lineClamp: true, 2034 lineHeight: true, 2035 opacity: true, 2036 order: true, 2037 orphans: true, 2038 tabSize: true, 2039 widows: true, 2040 zIndex: true, 2041 zoom: true, 2042 fillOpacity: true, 2043 floodOpacity: true, 2044 stopOpacity: true, 2045 strokeDasharray: true, 2046 strokeDashoffset: true, 2047 strokeMiterlimit: true, 2048 strokeOpacity: true, 2049 strokeWidth: true 2050 }; 2051 /** 2052 * @param {string}
2052 prefix vendor-specific prefix, eg: Webkit 2053 * @param {string} key style name, eg: transitionDuration 2054 * @return {string} style name prefixed with `prefix`, properly camelCased, eg: 2055 * WebkitTransitionDuration 2056 */ 2057 function prefixKey(prefix, key) { 2058 return prefix + key.charAt(0).toUpperCase() + key.substring(1); 2059 } 2060 /** 2061 * Support style names that may come passed in prefixed by adding permutations 2062 * of vendor prefixes. 2063 */ 2064 var prefixes = [ 2065 "Webkit", 2066 "ms", 2067 "Moz", 2068 "O" 2069 ]; 2070 Object.keys(isUnitlessNumber).forEach(function(prop) { 2071 prefixes.forEach(function(prefix) { 2072 isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; 2073 }); 2074 }); 2075 /** 2076 * Convert a value into the proper css writable value. The style name `name` 2077 * should be logical (no hyphens), as specified 2078 * in `CSSProperty.isUnitlessNumber`. 2079 * 2080 * @param {string} name CSS property name such as `topMargin`. 2081 * @param {*} value CSS property value such as `10px`. 2082 * @return {string} Normalized style value with dimensions applied. 2083 */ 2084 function dangerousStyleValue(name, value, isCustomProperty) { 2085 if (value == null || typeof value === "boolean" || value === "") return ""; 2086 if (!isCustomProperty && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + "px"; 2087 checkCSSPropertyStringCoercion(value, name); 2088 return ("" + value).trim(); 2089 } 2090 var uppercasePattern = /([A-Z])/g; 2091 var msPattern = /^ms-/; 2092 /** 2093 * Hyphenates a camelcased CSS property name, for example: 2094 * 2095 * > hyphenateStyleName('backgroundColor') 2096 * < "background-color" 2097 * > hyphenateStyleName('MozTransition') 2098 * < "-moz-transition" 2099 * > hyphenateStyleName('msTransition') 2100 * < "-ms-transition" 2101 * 2102 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix 2103 * is converted to `-ms-`. 2104 */ 2105 function hyphenateStyleName(name) { 2106 return name.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-"); 2107 } 2108 var warnValidStyle = function() {}; 2109 var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; 2110 var msPattern$1 = /^-ms-/; 2111 var hyphenPattern = /-(.)/g; 2112 var badStyleValueWithSemicolonPattern = /;\s*$/; 2113 var warnedStyleNames = {}; 2114 var warnedStyleValues = {}; 2115 var warnedForNaNValue = false; 2116 var warnedForInfinityValue = false; 2117 var camelize = function(string) { 2118 return string.replace(hyphenPattern, function(_, character) { 2119 return character.toUpperCase(); 2120 }); 2121 }; 2122 var warnHyphenatedStyleName = function(name) { 2123 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) return; 2124 warnedStyleNames[name] = true; 2125 error("Unsupported style property %s. Did you mean %s?", name, camelize(name.replace(msPattern$1, "ms-"))); 2126 }; 2127 var warnBadVendoredStyleName = function(name) { 2128 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) return; 2129 warnedStyleNames[name] = true; 2130 error("Unsupported vendor-prefixed style property %s. Did you mean %s?", name, name.charAt(0).toUpperCase() + name.slice(1)); 2131 }; 2132 var warnStyleValueWithSemicolon = function(name, value) { 2133 if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) return; 2134 warnedStyleValues[value] = true; 2135 error("Style property values shouldn't contain a semicolon. Try \"%s: %s\" instead.", name, value.replace(badStyleValueWithSemicolonPattern, "")); 2136 }; 2137 var warnStyleValueIsNaN = function(name, value) { 2138 if (warnedForNaNValue) return; 2139 warnedForNaNValue = true; 2140 error("`NaN` is an invalid value for the `%s` css style property.", name); 2141 }; 2142 var warnStyleValueIsInfinity = function(name, value) { 2143 if (warnedForInfinityValue) return; 2144 warnedForInfinityValue = true; 2145 error("`Infinity` is an invalid value for the `%s` css style property.", name); 2146 }; 2147 warnValidStyle = function(name, value) { 2148 if (name.indexOf("-") > -1) warnHyphenatedStyleName(name); 2149 else if (badVendoredStyleNamePattern.test(name)) warnBadVendoredStyleName(name); 2150 else if (badStyleValueWithSemicolonPattern.test(value)) warnStyleValueWithSemicolon(name, value); 2151 if (typeof value === "number") { 2152 if (isNaN(value)) warnStyleValueIsNaN(name, value); 2153 else if (!isFinite(value)) warnStyleValueIsInfinity(name, value); 2154 } 2155 }; 2156 var warnValidStyle$1 = warnValidStyle; 2157 /** 2158 * Operations for dealing with CSS properties. 2159 */ 2160 /** 2161 * This creates a string that is expected to be equivalent to the style 2162 * attribute generated by server-side rendering. It by-passes warnings and 2163 * security checks so it's not safe to use this value for anything other than 2164 * comparison. It is only used in DEV for SSR validation. 2165 */ 2166 function createDangerousStringForStyles(styles) { 2167 var serialized = ""; 2168 var delimiter = ""; 2169 for (var styleName in styles) { 2170 if (!styles.hasOwnProperty(styleName)) continue; 2171 var styleValue = styles[styleName]; 2172 if (styleValue != null) { 2173 var isCustomProperty = styleName.indexOf("--") === 0; 2174 serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ":"; 2175 serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty); 2176 delimiter = ";"; 2177 } 2178 } 2179 return serialized || null; 2180 } 2181 /** 2182 * Sets the value for multiple styles on a node. If a value is specified as 2183 * '' (empty string), the corresponding style property will be unset. 2184 * 2185 * @param {DOMElement} node 2186 * @param {object} styles 2187 */ 2188 function setValueForStyles(node, styles) { 2189 var style = node.style; 2190 for (var styleName in styles) { 2191 if (!styles.hasOwnProperty(styleName)) continue; 2192 var isCustomProperty = styleName.indexOf("--") === 0; 2193 if (!isCustomProperty) warnValidStyle$1(styleName, styles[styleName]); 2194 var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty); 2195 if (styleName === "float") styleName = "cssFloat";
2196 if (isCustomProperty) style.setProperty(styleName, styleValue); 2197 else style[styleName] = styleValue; 2198 } 2199 } 2200 function isValueEmpty(value) { 2201 return value == null || typeof value === "boolean" || value === ""; 2202 } 2203 /** 2204 * Given {color: 'red', overflow: 'hidden'} returns { 2205 * color: 'color', 2206 * overflowX: 'overflow', 2207 * overflowY: 'overflow', 2208 * }. This can be read as "the overflowY property was set by the overflow 2209 * shorthand". That is, the values are the property that each was derived from. 2210 */ 2211 function expandShorthandMap(styles) { 2212 var expanded = {}; 2213 for (var key in styles) { 2214 var longhands = shorthandToLonghand[key] || [key]; 2215 for (var i = 0; i < longhands.length; i++) expanded[longhands[i]] = key; 2216 } 2217 return expanded; 2218 } 2219 /** 2220 * When mixing shorthand and longhand property names, we warn during updates if 2221 * we expect an incorrect result to occur. In particular, we warn for: 2222 * 2223 * Updating a shorthand property (longhand gets overwritten): 2224 * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'} 2225 * becomes .style.font = 'baz' 2226 * Removing a shorthand property (longhand gets lost too): 2227 * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'} 2228 * becomes .style.font = '' 2229 * Removing a longhand property (should revert to shorthand; doesn't): 2230 * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'} 2231 * becomes .style.fontVariant = '' 2232 */ 2233 function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) { 2234 if (!nextStyles) return; 2235 var expandedUpdates = expandShorthandMap(styleUpdates); 2236 var expandedStyles = expandShorthandMap(nextStyles); 2237 var warnedAbout = {}; 2238 for (var key in expandedUpdates) { 2239 var originalKey = expandedUpdates[key]; 2240 var correctOriginalKey = expandedStyles[key]; 2241 if (correctOriginalKey && originalKey !== correctOriginalKey) { 2242 var warningKey = originalKey + "," + correctOriginalKey; 2243 if (warnedAbout[warningKey]) continue; 2244 warnedAbout[warningKey] = true; 2245 error("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", isValueEmpty(styleUpdates[originalKey]) ? "Removing" : "Updating", originalKey, correctOriginalKey); 2246 } 2247 } 2248 } 2249 var voidElementTags = assign({ menuitem: true }, { 2250 area: true, 2251 base: true, 2252 br: true, 2253 col: true, 2254 embed: true, 2255 hr: true, 2256 img: true, 2257 input: true, 2258 keygen: true, 2259 link: true, 2260 meta: true, 2261 param: true, 2262 source: true, 2263 track: true, 2264 wbr: true 2265 }); 2266 var HTML = "__html"; 2267 function assertValidProps(tag, props) { 2268 if (!props) return; 2269 if (voidElementTags[tag]) { 2270 if (props.children != null || props.dangerouslySetInnerHTML != null) throw new Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`."); 2271 } 2272 if (props.dangerouslySetInnerHTML != null) { 2273 if (props.children != null) throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`."); 2274 if (typeof props.dangerouslySetInnerHTML !== "object" || !(HTML in props.dangerouslySetInnerHTML)) throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information."); 2275 } 2276 if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."); 2277 if (props.style != null && typeof props.style !== "object") throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."); 2278 } 2279 function isCustomComponent(tagName, props) { 2280 if (tagName.indexOf("-") === -1) return typeof props.is === "string"; 2281 switch (tagName) { 2282 case "annotation-xml": 2283 case "color-profile": 2284 case "font-face": 2285 case "font-face-src":
vendor: 5,088 bytes, lines 2286-2483
2286 case "font-face-uri": 2287 case "font-face-format": 2288 case "font-face-name": 2289 case "missing-glyph": return false; 2290 default: return true; 2291 } 2292 } 2293 var possibleStandardNames = { 2294 accept: "accept", 2295 acceptcharset: "acceptCharset", 2296 "accept-charset": "acceptCharset", 2297 accesskey: "accessKey", 2298 action: "action", 2299 allowfullscreen: "allowFullScreen", 2300 alt: "alt", 2301 as: "as", 2302 async: "async", 2303 autocapitalize: "autoCapitalize", 2304 autocomplete: "autoComplete", 2305 autocorrect: "autoCorrect", 2306 autofocus: "autoFocus", 2307 autoplay: "autoPlay", 2308 autosave: "autoSave", 2309 capture: "capture", 2310 cellpadding: "cellPadding", 2311 cellspacing: "cellSpacing", 2312 challenge: "challenge", 2313 charset: "charSet", 2314 checked: "checked", 2315 children: "children", 2316 cite: "cite", 2317 class: "className", 2318 classid: "classID", 2319 classname: "className", 2320 cols: "cols", 2321 colspan: "colSpan", 2322 content: "content", 2323 contenteditable: "contentEditable", 2324 contextmenu: "contextMenu", 2325 controls: "controls", 2326 controlslist: "controlsList", 2327 coords: "coords", 2328 crossorigin: "crossOrigin", 2329 dangerouslysetinnerhtml: "dangerouslySetInnerHTML", 2330 data: "data", 2331 datetime: "dateTime", 2332 default: "default", 2333 defaultchecked: "defaultChecked", 2334 defaultvalue: "defaultValue", 2335 defer: "defer", 2336 dir: "dir", 2337 disabled: "disabled", 2338 disablepictureinpicture: "disablePictureInPicture", 2339 disableremoteplayback: "disableRemotePlayback", 2340 download: "download", 2341 draggable: "draggable", 2342 enctype: "encType", 2343 enterkeyhint: "enterKeyHint", 2344 for: "htmlFor", 2345 form: "form", 2346 formmethod: "formMethod", 2347 formaction: "formAction", 2348 formenctype: "formEncType", 2349 formnovalidate: "formNoValidate", 2350 formtarget: "formTarget", 2351 frameborder: "frameBorder", 2352 headers: "headers", 2353 height: "height", 2354 hidden: "hidden", 2355 high: "high", 2356 href: "href", 2357 hreflang: "hrefLang", 2358 htmlfor: "htmlFor", 2359 httpequiv: "httpEquiv", 2360 "http-equiv": "httpEquiv", 2361 icon: "icon", 2362 id: "id", 2363 imagesizes: "imageSizes", 2364 imagesrcset: "imageSrcSet", 2365 innerhtml: "innerHTML", 2366 inputmode: "inputMode", 2367 integrity: "integrity", 2368 is: "is", 2369 itemid: "itemID", 2370 itemprop: "itemProp", 2371 itemref: "itemRef", 2372 itemscope: "itemScope", 2373 itemtype: "itemType", 2374 keyparams: "keyParams", 2375 keytype: "keyType", 2376 kind: "kind", 2377 label: "label", 2378 lang: "lang", 2379 list: "list", 2380 loop: "loop", 2381 low: "low", 2382 manifest: "manifest", 2383 marginwidth: "marginWidth", 2384 marginheight: "marginHeight", 2385 max: "max", 2386 maxlength: "maxLength", 2387 media: "media", 2388 mediagroup: "mediaGroup", 2389 method: "method", 2390 min: "min", 2391 minlength: "minLength", 2392 multiple: "multiple", 2393 muted: "muted", 2394 name: "name", 2395 nomodule: "noModule", 2396 nonce: "nonce", 2397 novalidate: "noValidate", 2398 open: "open", 2399 optimum: "optimum", 2400 pattern: "pattern", 2401 placeholder: "placeholder", 2402 playsinline: "playsInline", 2403 poster: "poster", 2404 preload: "preload", 2405 profile: "profile", 2406 radiogroup: "radioGroup", 2407 readonly: "readOnly", 2408 referrerpolicy: "referrerPolicy", 2409 rel: "rel", 2410 required: "required", 2411 reversed: "reversed", 2412 role: "role", 2413 rows: "rows", 2414 rowspan: "rowSpan", 2415 sandbox: "sandbox", 2416 scope: "scope", 2417 scoped: "scoped", 2418 scrolling: "scrolling", 2419 seamless: "seamless", 2420 selected: "selected", 2421 shape: "shape", 2422 size: "size", 2423 sizes: "sizes", 2424 span: "span", 2425 spellcheck: "spellCheck", 2426 src: "src", 2427 srcdoc: "srcDoc", 2428 srclang: "srcLang", 2429 srcset: "srcSet", 2430 start: "start", 2431 step: "step", 2432 style: "style", 2433 summary: "summary", 2434 tabindex: "tabIndex", 2435 target: "target", 2436 title: "title", 2437 type: "type", 2438 usemap: "useMap", 2439 value: "value", 2440 width: "width", 2441 wmode: "wmode", 2442 wrap: "wrap", 2443 about: "about", 2444 accentheight: "accentHeight", 2445 "accent-height": "accentHeight", 2446 accumulate: "accumulate", 2447 additive: "additive", 2448 alignmentbaseline: "alignmentBaseline", 2449 "alignment-baseline": "alignmentBaseline", 2450 allowreorder: "allowReorder", 2451 alphabetic: "alphabetic", 2452 amplitude: "amplitude", 2453 arabicform: "arabicForm", 2454 "arabic-form": "arabicForm", 2455 ascent: "ascent", 2456 attributename: "attributeName", 2457 attributetype: "attributeType", 2458 autoreverse: "autoReverse", 2459 azimuth: "azimuth", 2460 basefrequency: "baseFrequency", 2461 baselineshift: "baselineShift", 2462 "baseline-shift": "baselineShift", 2463 baseprofile: "baseProfile", 2464 bbox: "bbox", 2465 begin: "begin", 2466 bias: "bias", 2467 by: "by", 2468 calcmode: "calcMode", 2469 capheight: "capHeight", 2470 "cap-height": "capHeight", 2471 clip: "clip", 2472 clippath: "clipPath", 2473 "clip-path": "clipPath", 2474 clippathunits: "clipPathUnits", 2475 cliprule: "clipRule", 2476 "clip-rule": "clipRule", 2477 color: "color", 2478 colorinterpolation: "colorInterpolation", 2479 "color-interpolation": "colorInterpolation", 2480 colorinterpolationfilters: "colorInterpolationFilters", 2481 "color-interpolation-filters": "colorInterpolationFilters", 2482 colorprofile: "colorProfile", 2483 "color-profile": "colorProfile",
2484 colorrendering: "colorRendering", 2485 "color-rendering": "colorRendering", 2486 contentscripttype: "contentScriptType", 2487 contentstyletype: "contentStyleType", 2488 cursor: "cursor", 2489 cx: "cx", 2490 cy: "cy", 2491 d: "d", 2492 datatype: "datatype", 2493 decelerate: "decelerate", 2494 descent: "descent", 2495 diffuseconstant: "diffuseConstant", 2496 direction: "direction", 2497 display: "display", 2498 divisor: "divisor", 2499 dominantbaseline: "dominantBaseline", 2500 "dominant-baseline": "dominantBaseline", 2501 dur: "dur", 2502 dx: "dx", 2503 dy: "dy", 2504 edgemode: "edgeMode", 2505 elevation: "elevation", 2506 enablebackground: "enableBackground", 2507 "enable-background": "enableBackground", 2508 end: "end", 2509 exponent: "exponent", 2510 externalresourcesrequired: "externalResourcesRequired", 2511 fill: "fill", 2512 fillopacity: "fillOpacity", 2513 "fill-opacity": "fillOpacity", 2514 fillrule: "fillRule", 2515 "fill-rule": "fillRule", 2516 filter: "filter", 2517 filterres: "filterRes", 2518 filterunits: "filterUnits", 2519 floodopacity: "floodOpacity", 2520 "flood-opacity": "floodOpacity", 2521 floodcolor: "floodColor", 2522 "flood-color": "floodColor", 2523 focusable: "focusable", 2524 fontfamily: "fontFamily", 2525 "font-family": "fontFamily", 2526 fontsize: "fontSize", 2527 "font-size": "fontSize", 2528 fontsizeadjust: "fontSizeAdjust", 2529 "font-size-adjust": "fontSizeAdjust", 2530 fontstretch: "fontStretch", 2531 "font-stretch": "fontStretch", 2532 fontstyle: "fontStyle", 2533 "font-style": "fontStyle", 2534 fontvariant: "fontVariant", 2535 "font-variant": "fontVariant", 2536 fontweight: "fontWeight", 2537 "font-weight": "fontWeight", 2538 format: "format", 2539 from: "from", 2540 fx: "fx", 2541 fy: "fy", 2542 g1: "g1", 2543 g2: "g2", 2544 glyphname: "glyphName", 2545 "glyph-name": "glyphName", 2546 glyphorientationhorizontal: "glyphOrientationHorizontal", 2547 "glyph-orientation-horizontal": "glyphOrientationHorizontal", 2548 glyphorientationvertical: "glyphOrientationVertical", 2549 "glyph-orientation-vertical": "glyphOrientationVertical", 2550 glyphref: "glyphRef", 2551 gradienttransform: "gradientTransform", 2552 gradientunits: "gradientUnits", 2553 hanging: "hanging", 2554 horizadvx: "horizAdvX", 2555 "horiz-adv-x": "horizAdvX", 2556 horizoriginx: "horizOriginX", 2557 "horiz-origin-x": "horizOriginX", 2558 ideographic: "ideographic", 2559 imagerendering: "imageRendering", 2560 "image-rendering": "imageRendering", 2561 in2: "in2", 2562 in: "in", 2563 inlist: "inlist", 2564 intercept: "intercept", 2565 k1: "k1", 2566 k2: "k2", 2567 k3: "k3", 2568 k4: "k4", 2569 k: "k", 2570 kernelmatrix: "kernelMatrix", 2571 kernelunitlength: "kernelUnitLength", 2572 kerning: "kerning", 2573 keypoints: "keyPoints", 2574 keysplines: "keySplines", 2575 keytimes: "keyTimes", 2576 lengthadjust: "lengthAdjust", 2577 letterspacing: "letterSpacing", 2578 "letter-spacing": "letterSpacing", 2579 lightingcolor: "lightingColor", 2580 "lighting-color": "lightingColor", 2581 limitingconeangle: "limitingConeAngle", 2582 local: "local", 2583 markerend: "markerEnd", 2584 "marker-end": "markerEnd", 2585 markerheight: "markerHeight", 2586 markermid: "markerMid", 2587 "marker-mid": "markerMid", 2588 markerstart: "markerStart", 2589 "marker-start": "markerStart", 2590 markerunits: "markerUnits", 2591 markerwidth: "markerWidth", 2592 mask: "mask", 2593 maskcontentunits: "maskContentUnits", 2594 maskunits: "maskUnits", 2595 mathematical: "mathematical", 2596 mode: "mode", 2597 numoctaves: "numOctaves", 2598 offset: "offset", 2599 opacity: "opacity", 2600 operator: "operator", 2601 order: "order", 2602 orient: "orient", 2603 orientation: "orientation", 2604 origin: "origin", 2605 overflow: "overflow", 2606 overlineposition: "overlinePosition", 2607 "overline-position": "overlinePosition", 2608 overlinethickness: "overlineThickness", 2609 "overline-thickness": "overlineThickness", 2610 paintorder: "paintOrder", 2611 "paint-order": "paintOrder", 2612 panose1: "panose1", 2613 "panose-1": "panose1", 2614 pathlength: "pathLength", 2615 patterncontentunits: "patternContentUnits", 2616 patterntransform: "patternTransform", 2617 patternunits: "patternUnits", 2618 pointerevents: "pointerEvents", 2619 "pointer-events": "pointerEvents", 2620 points: "points", 2621 pointsatx: "pointsAtX", 2622 pointsaty: "pointsAtY", 2623 pointsatz: "pointsAtZ", 2624 prefix: "prefix", 2625 preservealpha: "preserveAlpha", 2626 preserveaspectratio: "preserveAspectRatio", 2627 primitiveunits: "primitiveUnits", 2628 property: "property", 2629 r: "r", 2630 radius: "radius", 2631 refx: "refX", 2632 refy: "refY", 2633 renderingintent: "renderingIntent", 2634 "rendering-intent": "renderingIntent", 2635 repeatcount: "repeatCount", 2636 repeatdur: "repeatDur", 2637 requiredextensions: "requiredExtensions", 2638 requiredfeatures: "requiredFeatures", 2639 resource: "resource", 2640 restart: "restart", 2641 result: "result", 2642 results: "results", 2643 rotate: "rotate", 2644 rx: "rx", 2645 ry: "ry", 2646 scale: "scale", 2647 security: "security", 2648 seed: "seed", 2649 shaperendering: "shapeRendering", 2650 "shape-rendering": "shapeRendering", 2651 slope: "slope", 2652 spacing: "spacing", 2653 specularconstant: "specularConstant", 2654 specularexponent: "specularExponent", 2655 speed: "speed", 2656 spreadmethod: "spreadMethod", 2657 startoffset: "startOffset", 2658 stddeviation: "stdDeviation", 2659 stemh: "stemh", 2660 stemv: "stemv", 2661 stitchtiles: "stitchTiles", 2662 stopcolor: "stopColor", 2663 "stop-color": "stopColor", 2664 stopopacity: "stopOpacity", 2665 "stop-opacity": "stopOpacity", 2666 strikethroughposition: "strikethroughPosition", 2667 "strikethrough-position": "strikethroughPosition", 2668 strikethroughthickness: "strikethroughThickness", 2669 "strikethrough-thickness": "strikethroughThickness", 2670 string: "string", 2671 stroke: "stroke", 2672 strokedasharray: "strokeDasharray", 2673 "stroke-dasharray": "strokeDasharray", 2674 strokedashoffset: "strokeDashoffset", 2675 "stroke-dashoffset": "strokeDashoffset", 2676 strokelinecap: "strokeLinecap", 2677 "stroke-linecap": "strokeLinecap", 2678 strokelinejoin: "strokeLinejoin", 2679 "stroke-linejoin": "strokeLinejoin", 2680 strokemiterlimit: "strokeMiterlimit", 2681 "stroke-miterlimit": "strokeMiterlimit", 2682 strokewidth: "strokeWidth", 2683 "stroke-width": "strokeWidth", 2684 strokeopacity: "strokeOpacity", 2685 "stroke-opacity": "strokeOpacity", 2686 suppresscontenteditablewarning: "suppressContentEditableWarning", 2687 suppresshydrationwarning: "suppressHydrationWarning", 2688 surfacescale: "surfaceScale", 2689 systemlanguage: "systemLanguage", 2690 tablevalues: "tableValues", 2691 targetx: "targetX", 2692 targety: "targetY", 2693 textanchor: "textAnchor", 2694 "text-anchor": "textAnchor", 2695 textdecoration: "textDecoration", 2696 "text-decoration": "textDecoration", 2697 textlength: "textLength", 2698 textrendering: "textRendering", 2699 "text-rendering": "textRendering", 2700 to: "to", 2701 transform: "transform", 2702 typeof: "typeof", 2703 u1: "u1", 2704 u2: "u2", 2705 underlineposition: "underlinePosition", 2706 "underline-position": "underlinePosition", 2707 underlinethickness: "underlineThickness", 2708 "underline-thickness": "underlineThickness", 2709 unicode: "unicode", 2710 unicodebidi: "unicodeBidi",
vendor: 4,204 bytes, lines 2711-2855
2711 "unicode-bidi": "unicodeBidi", 2712 unicoderange: "unicodeRange", 2713 "unicode-range": "unicodeRange", 2714 unitsperem: "unitsPerEm", 2715 "units-per-em": "unitsPerEm", 2716 unselectable: "unselectable", 2717 valphabetic: "vAlphabetic", 2718 "v-alphabetic": "vAlphabetic", 2719 values: "values", 2720 vectoreffect: "vectorEffect", 2721 "vector-effect": "vectorEffect", 2722 version: "version", 2723 vertadvy: "vertAdvY", 2724 "vert-adv-y": "vertAdvY", 2725 vertoriginx: "vertOriginX", 2726 "vert-origin-x": "vertOriginX", 2727 vertoriginy: "vertOriginY", 2728 "vert-origin-y": "vertOriginY", 2729 vhanging: "vHanging", 2730 "v-hanging": "vHanging", 2731 videographic: "vIdeographic", 2732 "v-ideographic": "vIdeographic", 2733 viewbox: "viewBox", 2734 viewtarget: "viewTarget", 2735 visibility: "visibility", 2736 vmathematical: "vMathematical", 2737 "v-mathematical": "vMathematical", 2738 vocab: "vocab", 2739 widths: "widths", 2740 wordspacing: "wordSpacing", 2741 "word-spacing": "wordSpacing", 2742 writingmode: "writingMode", 2743 "writing-mode": "writingMode", 2744 x1: "x1", 2745 x2: "x2", 2746 x: "x", 2747 xchannelselector: "xChannelSelector", 2748 xheight: "xHeight", 2749 "x-height": "xHeight", 2750 xlinkactuate: "xlinkActuate", 2751 "xlink:actuate": "xlinkActuate", 2752 xlinkarcrole: "xlinkArcrole", 2753 "xlink:arcrole": "xlinkArcrole", 2754 xlinkhref: "xlinkHref", 2755 "xlink:href": "xlinkHref", 2756 xlinkrole: "xlinkRole", 2757 "xlink:role": "xlinkRole", 2758 xlinkshow: "xlinkShow", 2759 "xlink:show": "xlinkShow", 2760 xlinktitle: "xlinkTitle", 2761 "xlink:title": "xlinkTitle", 2762 xlinktype: "xlinkType", 2763 "xlink:type": "xlinkType", 2764 xmlbase: "xmlBase", 2765 "xml:base": "xmlBase", 2766 xmllang: "xmlLang", 2767 "xml:lang": "xmlLang", 2768 xmlns: "xmlns", 2769 "xml:space": "xmlSpace", 2770 xmlnsxlink: "xmlnsXlink", 2771 "xmlns:xlink": "xmlnsXlink", 2772 xmlspace: "xmlSpace", 2773 y1: "y1", 2774 y2: "y2", 2775 y: "y", 2776 ychannelselector: "yChannelSelector", 2777 z: "z", 2778 zoomandpan: "zoomAndPan" 2779 }; 2780 var ariaProperties = { 2781 "aria-current": 0, 2782 "aria-description": 0, 2783 "aria-details": 0, 2784 "aria-disabled": 0, 2785 "aria-hidden": 0, 2786 "aria-invalid": 0, 2787 "aria-keyshortcuts": 0, 2788 "aria-label": 0, 2789 "aria-roledescription": 0, 2790 "aria-autocomplete": 0, 2791 "aria-checked": 0, 2792 "aria-expanded": 0, 2793 "aria-haspopup": 0, 2794 "aria-level": 0, 2795 "aria-modal": 0, 2796 "aria-multiline": 0, 2797 "aria-multiselectable": 0, 2798 "aria-orientation": 0, 2799 "aria-placeholder": 0, 2800 "aria-pressed": 0, 2801 "aria-readonly": 0, 2802 "aria-required": 0, 2803 "aria-selected": 0, 2804 "aria-sort": 0, 2805 "aria-valuemax": 0, 2806 "aria-valuemin": 0, 2807 "aria-valuenow": 0, 2808 "aria-valuetext": 0, 2809 "aria-atomic": 0, 2810 "aria-busy": 0, 2811 "aria-live": 0, 2812 "aria-relevant": 0, 2813 "aria-dropeffect": 0, 2814 "aria-grabbed": 0, 2815 "aria-activedescendant": 0, 2816 "aria-colcount": 0, 2817 "aria-colindex": 0, 2818 "aria-colspan": 0, 2819 "aria-controls": 0, 2820 "aria-describedby": 0, 2821 "aria-errormessage": 0, 2822 "aria-flowto": 0, 2823 "aria-labelledby": 0, 2824 "aria-owns": 0, 2825 "aria-posinset": 0, 2826 "aria-rowcount": 0, 2827 "aria-rowindex": 0, 2828 "aria-rowspan": 0, 2829 "aria-setsize": 0 2830 }; 2831 var warnedProperties = {}; 2832 var rARIA = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$"); 2833 var rARIACamel = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$"); 2834 function validateProperty(tagName, name) { 2835 if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) return true; 2836 if (rARIACamel.test(name)) { 2837 var ariaName = "aria-" + name.slice(4).toLowerCase(); 2838 var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; 2839 if (correctName == null) { 2840 error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", name); 2841 warnedProperties[name] = true; 2842 return true; 2843 } 2844 if (name !== correctName) { 2845 error("Invalid ARIA attribute `%s`. Did you mean `%s`?", name, correctName); 2846 warnedProperties[name] = true; 2847 return true; 2848 } 2849 } 2850 if (rARIA.test(name)) { 2851 var lowerCasedName = name.toLowerCase(); 2852 var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; 2853 if (standardName == null) { 2854 warnedProperties[name] = true; 2855 return false;
2856 } 2857 if (name !== standardName) { 2858 error("Unknown ARIA attribute `%s`. Did you mean `%s`?", name, standardName); 2859 warnedProperties[name] = true; 2860 return true; 2861 } 2862 } 2863 return true; 2864 } 2865 function warnInvalidARIAProps(type, props) { 2866 var invalidProps = []; 2867 for (var key in props) if (!validateProperty(type, key)) invalidProps.push(key); 2868 var unknownPropString = invalidProps.map(function(prop) { 2869 return "`" + prop + "`"; 2870 }).join(", "); 2871 if (invalidProps.length === 1) error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type); 2872 else if (invalidProps.length > 1) error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type); 2873 } 2874 function validateProperties(type, props) { 2875 if (isCustomComponent(type, props)) return; 2876 warnInvalidARIAProps(type, props); 2877 } 2878 var didWarnValueNull = false; 2879 function validateProperties$1(type, props) { 2880 if (type !== "input" && type !== "textarea" && type !== "select") return; 2881 if (props != null && props.value === null && !didWarnValueNull) { 2882 didWarnValueNull = true; 2883 if (type === "select" && props.multiple) error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", type); 2884 else error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type); 2885 } 2886 } 2887 var validateProperty$1 = function() {}; 2888 var warnedProperties$1 = {}; 2889 var EVENT_NAME_REGEX = /^on./; 2890 var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/; 2891 var rARIA$1 = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$"); 2892 var rARIACamel$1 = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$"); 2893 validateProperty$1 = function(tagName, name, value, eventRegistry) { 2894 if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) return true; 2895 var lowerCasedName = name.toLowerCase(); 2896 if (lowerCasedName === "onfocusin" || lowerCasedName === "onfocusout") { 2897 error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."); 2898 warnedProperties$1[name] = true; 2899 return true; 2900 } 2901 if (eventRegistry != null) { 2902 var registrationNameDependencies = eventRegistry.registrationNameDependencies, possibleRegistrationNames = eventRegistry.possibleRegistrationNames; 2903 if (registrationNameDependencies.hasOwnProperty(name)) return true; 2904 var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null; 2905 if (registrationName != null) { 2906 error("Invalid event handler property `%s`. Did you mean `%s`?", name, registrationName); 2907 warnedProperties$1[name] = true; 2908 return true; 2909 } 2910 if (EVENT_NAME_REGEX.test(name)) { 2911 error("Unknown event handler property `%s`. It will be ignored.", name); 2912 warnedProperties$1[name] = true; 2913 return true; 2914 } 2915 } else if (EVENT_NAME_REGEX.test(name)) { 2916 if (INVALID_EVENT_NAME_REGEX.test(name)) error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", name); 2917 warnedProperties$1[name] = true; 2918 return true; 2919 } 2920 if (rARIA$1.test(name) || rARIACamel$1.test(name)) return true; 2921 if (lowerCasedName === "innerhtml") { 2922 error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."); 2923 warnedProperties$1[name] = true; 2924 return true; 2925 } 2926 if (lowerCasedName === "aria") { 2927 error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."); 2928 warnedProperties$1[name] = true; 2929 return true; 2930 } 2931 if (lowerCasedName === "is" && value !== null && value !== void 0 && typeof value !== "string") { 2932 error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof value); 2933 warnedProperties$1[name] = true; 2934 return true; 2935 } 2936 if (typeof value === "number" && isNaN(value)) { 2937 error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", name); 2938 warnedProperties$1[name] = true; 2939 return true; 2940 } 2941 var propertyInfo = getPropertyInfo(name); 2942 var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; 2943 if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { 2944 var standardName = possibleStandardNames[lowerCasedName]; 2945 if (standardName !== name) { 2946 error("Invalid DOM property `%s`. Did you mean `%s`?", name, standardName); 2947 warnedProperties$1[name] = true; 2948 return true; 2949 } 2950 } else if (!isReserved && name !== lowerCasedName) { 2951 error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", name, lowerCasedName); 2952 warnedProperties$1[name] = true; 2953 return true; 2954 } 2955 if (typeof value === "boolean" && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { 2956 if (value) error("Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s=\"%s\" or %s={value.toString()}.", value, name, name, value, name); 2957 else error("Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s=\"%s\" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", value, name, name, value, name, name, name); 2958 warnedProperties$1[name] = true; 2959 return true; 2960 } 2961 if (isReserved) return true; 2962 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { 2963 warnedProperties$1[name] = true; 2964 return false;
2965 } 2966 if ((value === "false" || value === "true") && propertyInfo !== null && propertyInfo.type === BOOLEAN) { 2967 error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", value, name, value === "false" ? "The browser will interpret it as a truthy value." : "Although this works, it will not work as expected if you pass the string \"false\".", name, value); 2968 warnedProperties$1[name] = true; 2969 return true; 2970 } 2971 return true; 2972 }; 2973 var warnUnknownProperties = function(type, props, eventRegistry) { 2974 var unknownProps = []; 2975 for (var key in props) if (!validateProperty$1(type, key, props[key], eventRegistry)) unknownProps.push(key); 2976 var unknownPropString = unknownProps.map(function(prop) { 2977 return "`" + prop + "`"; 2978 }).join(", "); 2979 if (unknownProps.length === 1) error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type); 2980 else if (unknownProps.length > 1) error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type); 2981 }; 2982 function validateProperties$2(type, props, eventRegistry) { 2983 if (isCustomComponent(type, props)) return; 2984 warnUnknownProperties(type, props, eventRegistry); 2985 } 2986 var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1; 2987 var IS_NON_DELEGATED = 2; 2988 var IS_CAPTURE_PHASE = 4; 2989 var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE; 2990 var currentReplayingEvent = null; 2991 function setReplayingEvent(event) { 2992 if (currentReplayingEvent !== null) error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."); 2993 currentReplayingEvent = event; 2994 } 2995 function resetReplayingEvent() { 2996 if (currentReplayingEvent === null) error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."); 2997 currentReplayingEvent = null; 2998 } 2999 function isReplayingEvent(event) { 3000 return event === currentReplayingEvent; 3001 } 3002 /** 3003 * Gets the target node from a native browser event by accounting for 3004 * inconsistencies in browser DOM APIs. 3005 * 3006 * @param {object} nativeEvent Native browser event. 3007 * @return {DOMEventTarget} Target node. 3008 */ 3009 function getEventTarget(nativeEvent) { 3010 var target = nativeEvent.target || nativeEvent.srcElement || window; 3011 if (target.correspondingUseElement) target = target.correspondingUseElement; 3012 return target.nodeType === TEXT_NODE ? target.parentNode : target; 3013 } 3014 var restoreImpl = null; 3015 var restoreTarget = null; 3016 var restoreQueue = null; 3017 function restoreStateOfTarget(target) { 3018 var internalInstance = getInstanceFromNode(target); 3019 if (!internalInstance) return; 3020 if (typeof restoreImpl !== "function") throw new 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."); 3021 var stateNode = internalInstance.stateNode; 3022 if (stateNode) { 3023 var _props = getFiberCurrentPropsFromNode(stateNode); 3024 restoreImpl(internalInstance.stateNode, internalInstance.type, _props); 3025 } 3026 } 3027 function setRestoreImplementation(impl) { 3028 restoreImpl = impl; 3029 } 3030 function enqueueStateRestore(target) { 3031 if (restoreTarget) if (restoreQueue) restoreQueue.push(target); 3032 else restoreQueue = [target]; 3033 else restoreTarget = target; 3034 } 3035 function needsStateRestore() { 3036 return restoreTarget !== null || restoreQueue !== null; 3037 } 3038 function restoreStateIfNeeded() { 3039 if (!restoreTarget) return; 3040 var target = restoreTarget; 3041 var queuedTargets = restoreQueue; 3042 restoreTarget = null; 3043 restoreQueue = null; 3044 restoreStateOfTarget(target); 3045 if (queuedTargets) for (var i = 0; i < queuedTargets.length; i++) restoreStateOfTarget(queuedTargets[i]); 3046 } 3047 var batchedUpdatesImpl = function(fn, bookkeeping) { 3048 return fn(bookkeeping); 3049 }; 3050 var flushSyncImpl = function() {}; 3051 var isInsideEventHandler = false;
3052 function finishEventHandler() { 3053 if (needsStateRestore()) { 3054 flushSyncImpl(); 3055 restoreStateIfNeeded(); 3056 } 3057 } 3058 function batchedUpdates(fn, a, b) { 3059 if (isInsideEventHandler) return fn(a, b); 3060 isInsideEventHandler = true; 3061 try { 3062 return batchedUpdatesImpl(fn, a, b); 3063 } finally { 3064 isInsideEventHandler = false; 3065 finishEventHandler(); 3066 } 3067 } 3068 function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushSyncImpl) { 3069 batchedUpdatesImpl = _batchedUpdatesImpl; 3070 flushSyncImpl = _flushSyncImpl; 3071 } 3072 function isInteractive(tag) { 3073 return tag === "button" || tag === "input" || tag === "select" || tag === "textarea"; 3074 } 3075 function shouldPreventMouseEvent(name, type, props) { 3076 switch (name) { 3077 case "onClick": 3078 case "onClickCapture": 3079 case "onDoubleClick": 3080 case "onDoubleClickCapture": 3081 case "onMouseDown": 3082 case "onMouseDownCapture": 3083 case "onMouseMove": 3084 case "onMouseMoveCapture": 3085 case "onMouseUp": 3086 case "onMouseUpCapture": 3087 case "onMouseEnter": return !!(props.disabled && isInteractive(type)); 3088 default: return false; 3089 } 3090 } 3091 /** 3092 * @param {object} inst The instance, which is the source of events. 3093 * @param {string} registrationName Name of listener (e.g. `onClick`). 3094 * @return {?function} The stored callback. 3095 */ 3096 function getListener(inst, registrationName) { 3097 var stateNode = inst.stateNode; 3098 if (stateNode === null) return null; 3099 var props = getFiberCurrentPropsFromNode(stateNode); 3100 if (props === null) return null; 3101 var listener = props[registrationName]; 3102 if (shouldPreventMouseEvent(registrationName, inst.type, props)) return null; 3103 if (listener && typeof listener !== "function") throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type."); 3104 return listener; 3105 } 3106 var passiveBrowserEventsSupported = false; 3107 if (canUseDOM) try { 3108 var options = {}; 3109 Object.defineProperty(options, "passive", { get: function() { 3110 passiveBrowserEventsSupported = true; 3111 } }); 3112 window.addEventListener("test", options, options); 3113 window.removeEventListener("test", options, options); 3114 } catch (e) { 3115 passiveBrowserEventsSupported = false; 3116 } 3117 function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) { 3118 var funcArgs = Array.prototype.slice.call(arguments, 3); 3119 try { 3120 func.apply(context, funcArgs); 3121 } catch (error) { 3122 this.onError(error); 3123 } 3124 } 3125 var invokeGuardedCallbackImpl = invokeGuardedCallbackProd; 3126 if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") { 3127 var fakeNode = document.createElement("react"); 3128 invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) { 3129 if (typeof document === "undefined" || document === null) throw new 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."); 3130 var evt = document.createEvent("Event"); 3131 var didCall = false; 3132 var didError = true; 3133 var windowEvent = window.event; 3134 var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event"); 3135 function restoreAfterDispatch() { 3136 fakeNode.removeEventListener(evtType, callCallback, false); 3137 if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) window.event = windowEvent; 3138 } 3139 var funcArgs = Array.prototype.slice.call(arguments, 3); 3140 function callCallback() { 3141 didCall = true; 3142 restoreAfterDispatch(); 3143 func.apply(context, funcArgs); 3144 didError = false; 3145 } 3146 var error; 3147 var didSetError = false;
3148 var isCrossOriginError = false; 3149 function handleWindowError(event) { 3150 error = event.error; 3151 didSetError = true; 3152 if (error === null && event.colno === 0 && event.lineno === 0) isCrossOriginError = true; 3153 if (event.defaultPrevented) { 3154 if (error != null && typeof error === "object") try { 3155 error._suppressLogging = true; 3156 } catch (inner) {} 3157 } 3158 } 3159 var evtType = "react-" + (name ? name : "invokeguardedcallback"); 3160 window.addEventListener("error", handleWindowError); 3161 fakeNode.addEventListener(evtType, callCallback, false); 3162 evt.initEvent(evtType, false, false); 3163 fakeNode.dispatchEvent(evt); 3164 if (windowEventDescriptor) Object.defineProperty(window, "event", windowEventDescriptor); 3165 if (didCall && didError) { 3166 if (!didSetError) error = /* @__PURE__ */ new Error("An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the \"Pause on exceptions\" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue."); 3167 else if (isCrossOriginError) error = /* @__PURE__ */ new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information."); 3168 this.onError(error); 3169 } 3170 window.removeEventListener("error", handleWindowError); 3171 if (!didCall) { 3172 restoreAfterDispatch(); 3173 return invokeGuardedCallbackProd.apply(this, arguments); 3174 } 3175 }; 3176 } 3177 var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; 3178 var hasError = false; 3179 var caughtError = null; 3180 var hasRethrowError = false; 3181 var rethrowError = null; 3182 var reporter = { onError: function(error) { 3183 hasError = true; 3184 caughtError = error; 3185 } }; 3186 /** 3187 * Call a function while guarding against errors that happens within it. 3188 * Returns an error if it throws, otherwise null. 3189 * 3190 * In production, this is implemented using a try-catch. The reason we don't 3191 * use a try-catch directly is so that we can swap out a different 3192 * implementation in DEV mode. 3193 * 3194 * @param {String} name of the guard to use for logging or debugging 3195 * @param {Function} func The function to invoke 3196 * @param {*} context The context to use when calling the function 3197 * @param {...*} args Arguments for function 3198 */ 3199 function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { 3200 hasError = false; 3201 caughtError = null; 3202 invokeGuardedCallbackImpl$1.apply(reporter, arguments); 3203 } 3204 /** 3205 * Same as invokeGuardedCallback, but instead of returning an error, it stores 3206 * it in a global so it can be rethrown by `rethrowCaughtError` later. 3207 * TODO: See if caughtError and rethrowError can be unified. 3208 * 3209 * @param {String} name of the guard to use for logging or debugging 3210 * @param {Function} func The function to invoke 3211 * @param {*} context The context to use when calling the function 3212 * @param {...*} args Arguments for function 3213 */ 3214 function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { 3215 invokeGuardedCallback.apply(this, arguments); 3216 if (hasError) { 3217 var error = clearCaughtError(); 3218 if (!hasRethrowError) { 3219 hasRethrowError = true; 3220 rethrowError = error; 3221 } 3222 } 3223 } 3224 /** 3225 * During execution of guarded functions we will capture the first error which 3226 * we will rethrow to be handled by the top level error handler. 3227 */ 3228 function rethrowCaughtError() { 3229 if (hasRethrowError) { 3230 var error = rethrowError; 3231 hasRethrowError = false; 3232 rethrowError = null; 3233 throw error; 3234 } 3235 } 3236 function hasCaughtError() { 3237 return hasError; 3238 } 3239 function clearCaughtError() { 3240 if (hasError) { 3241 var error = caughtError; 3242 hasError = false; 3243 caughtError = null; 3244 return error; 3245 } else throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."); 3246 } 3247 /** 3248 * `ReactInstanceMap` maintains a mapping from a public facing stateful 3249 * instance (key) and the internal representation (value). This allows public 3250 * methods to accept the user facing instance as an argument and map them back 3251 * to internal methods. 3252 * 3253 * Note that this module is currently shared and assumed to be stateless. 3254 * If this becomes an actual Map, that will break. 3255 */ 3256 function get(key) { 3257 return key._reactInternals; 3258 } 3259 function has(key) { 3260 return key._reactInternals !== void 0; 3261 } 3262 function set(key, value) { 3263 key._reactInternals = value; 3264 } 3265 var NoFlags = 0; 3266 var PerformedWork = 1; 3267 var Placement = 2; 3268 var Update = 4; 3269 var ChildDeletion = 16; 3270 var ContentReset = 32; 3271 var Callback = 64; 3272 var DidCapture = 128; 3273 var ForceClientRender = 256; 3274 var Ref = 512; 3275 var Snapshot = 1024; 3276 var Passive = 2048; 3277 var Hydrating = 4096; 3278 var Visibility = 8192; 3279 var StoreConsistency = 16384; 3280 var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency;
3281 var HostEffectMask = 32767; 3282 var Incomplete = 32768; 3283 var ShouldCapture = 65536; 3284 var ForceUpdateForLegacySuspense = 131072; 3285 var Forked = 1048576; 3286 var RefStatic = 2097152; 3287 var LayoutStatic = 4194304; 3288 var PassiveStatic = 8388608; 3289 var MountLayoutDev = 16777216; 3290 var MountPassiveDev = 33554432; 3291 var BeforeMutationMask = Update | Snapshot | 0; 3292 var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility; 3293 var LayoutMask = Update | Callback | Ref | Visibility; 3294 var PassiveMask = Passive | ChildDeletion; 3295 var StaticMask = LayoutStatic | PassiveStatic | RefStatic; 3296 var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; 3297 function getNearestMountedFiber(fiber) { 3298 var node = fiber; 3299 var nearestMounted = fiber; 3300 if (!fiber.alternate) { 3301 var nextNode = node; 3302 do { 3303 node = nextNode; 3304 if ((node.flags & (Placement | Hydrating)) !== NoFlags) nearestMounted = node.return; 3305 nextNode = node.return; 3306 } while (nextNode); 3307 } else while (node.return) node = node.return; 3308 if (node.tag === HostRoot) return nearestMounted; 3309 return null; 3310 } 3311 function getSuspenseInstanceFromFiber(fiber) { 3312 if (fiber.tag === SuspenseComponent) { 3313 var suspenseState = fiber.memoizedState; 3314 if (suspenseState === null) { 3315 var current = fiber.alternate; 3316 if (current !== null) suspenseState = current.memoizedState; 3317 } 3318 if (suspenseState !== null) return suspenseState.dehydrated; 3319 } 3320 return null; 3321 } 3322 function getContainerFromFiber(fiber) { 3323 return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null; 3324 } 3325 function isFiberMounted(fiber) { 3326 return getNearestMountedFiber(fiber) === fiber; 3327 } 3328 function isMounted(component) { 3329 var owner = ReactCurrentOwner.current; 3330 if (owner !== null && owner.tag === ClassComponent) { 3331 var ownerFiber = owner; 3332 var instance = ownerFiber.stateNode; 3333 if (!instance._warnedAboutRefsInRender) error("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentNameFromFiber(ownerFiber) || "A component"); 3334 instance._warnedAboutRefsInRender = true; 3335 } 3336 var fiber = get(component); 3337 if (!fiber) return false; 3338 return getNearestMountedFiber(fiber) === fiber; 3339 } 3340 function assertIsMounted(fiber) { 3341 if (getNearestMountedFiber(fiber) !== fiber) throw new Error("Unable to find node on an unmounted component."); 3342 } 3343 function findCurrentFiberUsingSlowPath(fiber) { 3344 var alternate = fiber.alternate; 3345 if (!alternate) { 3346 var nearestMounted = getNearestMountedFiber(fiber); 3347 if (nearestMounted === null) throw new Error("Unable to find node on an unmounted component."); 3348 if (nearestMounted !== fiber) return null; 3349 return fiber; 3350 } 3351 var a = fiber; 3352 var b = alternate; 3353 while (true) { 3354 var parentA = a.return; 3355 if (parentA === null) break; 3356 var parentB = parentA.alternate; 3357 if (parentB === null) { 3358 var nextParent = parentA.return; 3359 if (nextParent !== null) { 3360 a = b = nextParent; 3361 continue; 3362 } 3363 break; 3364 } 3365 if (parentA.child === parentB.child) { 3366 var child = parentA.child; 3367 while (child) { 3368 if (child === a) { 3369 assertIsMounted(parentA); 3370 return fiber; 3371 } 3372 if (child === b) { 3373 assertIsMounted(parentA); 3374 return alternate; 3375 } 3376 child = child.sibling; 3377 } 3378 throw new Error("Unable to find node on an unmounted component."); 3379 } 3380 if (a.return !== b.return) { 3381 a = parentA; 3382 b = parentB; 3383 } else { 3384 var didFindChild = false; 3385 var _child = parentA.child; 3386 while (_child) { 3387 if (_child === a) { 3388 didFindChild = true; 3389 a = parentA; 3390 b = parentB; 3391 break; 3392 } 3393 if (_child === b) { 3394 didFindChild = true; 3395 b = parentA; 3396 a = parentB; 3397 break; 3398 } 3399 _child = _child.sibling; 3400 } 3401 if (!didFindChild) { 3402 _child = parentB.child; 3403 while (_child) { 3404 if (_child === a) { 3405 didFindChild = true; 3406 a = parentB; 3407 b = parentA; 3408 break; 3409 } 3410 if (_child === b) { 3411 didFindChild = true; 3412 b = parentB; 3413 a = parentA; 3414 break; 3415 } 3416 _child = _child.sibling; 3417 } 3418 if (!didFindChild) throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."); 3419 } 3420 } 3421 if (a.alternate !== b) throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."); 3422 }
3423 if (a.tag !== HostRoot) throw new Error("Unable to find node on an unmounted component."); 3424 if (a.stateNode.current === a) return fiber; 3425 return alternate; 3426 } 3427 function findCurrentHostFiber(parent) { 3428 var currentParent = findCurrentFiberUsingSlowPath(parent); 3429 return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null; 3430 } 3431 function findCurrentHostFiberImpl(node) { 3432 if (node.tag === HostComponent || node.tag === HostText) return node; 3433 var child = node.child; 3434 while (child !== null) { 3435 var match = findCurrentHostFiberImpl(child); 3436 if (match !== null) return match; 3437 child = child.sibling; 3438 } 3439 return null; 3440 } 3441 function findCurrentHostFiberWithNoPortals(parent) { 3442 var currentParent = findCurrentFiberUsingSlowPath(parent); 3443 return currentParent !== null ? findCurrentHostFiberWithNoPortalsImpl(currentParent) : null; 3444 } 3445 function findCurrentHostFiberWithNoPortalsImpl(node) { 3446 if (node.tag === HostComponent || node.tag === HostText) return node; 3447 var child = node.child; 3448 while (child !== null) { 3449 if (child.tag !== HostPortal) { 3450 var match = findCurrentHostFiberWithNoPortalsImpl(child); 3451 if (match !== null) return match; 3452 } 3453 child = child.sibling; 3454 } 3455 return null; 3456 } 3457 var scheduleCallback = Scheduler.unstable_scheduleCallback; 3458 var cancelCallback = Scheduler.unstable_cancelCallback; 3459 var shouldYield = Scheduler.unstable_shouldYield; 3460 var requestPaint = Scheduler.unstable_requestPaint; 3461 var now = Scheduler.unstable_now; 3462 var getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel; 3463 var ImmediatePriority = Scheduler.unstable_ImmediatePriority; 3464 var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority; 3465 var NormalPriority = Scheduler.unstable_NormalPriority; 3466 var LowPriority = Scheduler.unstable_LowPriority; 3467 var IdlePriority = Scheduler.unstable_IdlePriority; 3468 var unstable_yieldValue = Scheduler.unstable_yieldValue; 3469 var unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue; 3470 var rendererID = null; 3471 var injectedHook = null; 3472 var injectedProfilingHooks = null; 3473 var hasLoggedError = false; 3474 var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined"; 3475 function injectInternals(internals) { 3476 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") return false; 3477 var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; 3478 if (hook.isDisabled) return true; 3479 if (!hook.supportsFiber) { 3480 error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"); 3481 return true; 3482 } 3483 try { 3484 if (enableSchedulingProfiler) internals = assign({}, internals, { 3485 getLaneLabelMap, 3486 injectProfilingHooks 3487 }); 3488 rendererID = hook.inject(internals); 3489 injectedHook = hook; 3490 } catch (err) { 3491 error("React instrumentation encountered an error: %s.", err); 3492 } 3493 if (hook.checkDCE) return true; 3494 else return false; 3495 } 3496 function onScheduleRoot(root, children) { 3497 if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") try { 3498 injectedHook.onScheduleFiberRoot(rendererID, root, children); 3499 } catch (err) { 3500 if (!hasLoggedError) { 3501 hasLoggedError = true; 3502 error("React instrumentation encountered an error: %s", err); 3503 } 3504 } 3505 } 3506 function onCommitRoot(root, eventPriority) { 3507 if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") try { 3508 var didError = (root.current.flags & DidCapture) === DidCapture; 3509 if (enableProfilerTimer) { 3510 var schedulerPriority; 3511 switch (eventPriority) { 3512 case DiscreteEventPriority: 3513 schedulerPriority = ImmediatePriority; 3514 break; 3515 case ContinuousEventPriority: 3516 schedulerPriority = UserBlockingPriority; 3517 break; 3518 case DefaultEventPriority: 3519 schedulerPriority = NormalPriority; 3520 break; 3521 case IdleEventPriority: 3522 schedulerPriority = IdlePriority; 3523 break; 3524 default: 3525 schedulerPriority = NormalPriority; 3526 break; 3527 } 3528 injectedHook.onCommitFiberRoot(rendererID, root, schedulerPriority, didError); 3529 } else injectedHook.onCommitFiberRoot(rendererID, root, void 0, didError); 3530 } catch (err) { 3531 if (!hasLoggedError) { 3532 hasLoggedError = true; 3533 error("React instrumentation encountered an error: %s", err); 3534 } 3535 } 3536 } 3537 function onPostCommitRoot(root) { 3538 if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === "function") try { 3539 injectedHook.onPostCommitFiberRoot(rendererID, root); 3540 } catch (err) { 3541 if (!hasLoggedError) { 3542 hasLoggedError = true; 3543 error("React instrumentation encountered an error: %s", err); 3544 } 3545 } 3546 } 3547 function onCommitUnmount(fiber) { 3548 if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") try { 3549 injectedHook.onCommitFiberUnmount(rendererID, fiber); 3550 } catch (err) { 3551 if (!hasLoggedError) { 3552 hasLoggedError = true; 3553 error("React instrumentation encountered an error: %s", err); 3554 } 3555 } 3556 } 3557 function setIsStrictModeForDevtools(newIsStrictMode) { 3558 if (typeof unstable_yieldValue === "function") { 3559 unstable_setDisableYieldValue(newIsStrictMode); 3560 setSuppressWarning(newIsStrictMode); 3561 } 3562 if (injectedHook && typeof injectedHook.setStrictMode === "function") try { 3563 injectedHook.setStrictMode(rendererID, newIsStrictMode); 3564 } catch (err) { 3565 if (!hasLoggedError) { 3566 hasLoggedError = true; 3567 error("React instrumentation encountered an error: %s", err); 3568 } 3569 } 3570 } 3571 function injectProfilingHooks(profilingHooks) { 3572 injectedProfilingHooks = profilingHooks; 3573 } 3574 function getLaneLabelMap() { 3575 var map = /* @__PURE__ */ new Map(); 3576 var lane = 1; 3577 for (var index = 0; index < TotalLanes; index++) { 3578 var label = getLabelForLane(lane); 3579 map.set(lane, label); 3580 lane *= 2; 3581 } 3582 return map; 3583 } 3584 function markCommitStarted(lanes) { 3585 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStarted === "function") injectedProfilingHooks.markCommitStarted(lanes); 3586 } 3587 function markCommitStopped() { 3588 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStopped === "function") injectedProfilingHooks.markCommitStopped(); 3589 } 3590 function markComponentRenderStarted(fiber) { 3591 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStarted === "function") injectedProfilingHooks.markComponentRenderStarted(fiber); 3592 } 3593 function markComponentRenderStopped() { 3594 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStopped === "function") injectedProfilingHooks.markComponentRenderStopped(); 3595 } 3596 function markComponentPassiveEffectMountStarted(fiber) { 3597 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted === "function") injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber); 3598 } 3599 function markComponentPassiveEffectMountStopped() { 3600 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped === "function") injectedProfilingHooks.markComponentPassiveEffectMountStopped(); 3601 } 3602 function markComponentPassiveEffectUnmountStarted(fiber) { 3603 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted === "function") injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber); 3604 } 3605 function markComponentPassiveEffectUnmountStopped() { 3606 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped === "function") injectedProfilingHooks.markComponentPassiveEffectUnmountStopped(); 3607 } 3608 function markComponentLayoutEffectMountStarted(fiber) { 3609 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted === "function") injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber); 3610 } 3611 function markComponentLayoutEffectMountStopped() { 3612 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped === "function") injectedProfilingHooks.markComponentLayoutEffectMountStopped(); 3613 } 3614 function markComponentLayoutEffectUnmountStarted(fiber) { 3615 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted === "function") injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber); 3616 } 3617 function markComponentLayoutEffectUnmountStopped() { 3618 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped === "function") injectedProfilingHooks.markComponentLayoutEffectUnmountStopped(); 3619 } 3620 function markComponentErrored(fiber, thrownValue, lanes) { 3621 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentErrored === "function") injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes); 3622 } 3623 function markComponentSuspended(fiber, wakeable, lanes) { 3624 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentSuspended === "function") injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes); 3625 } 3626 function markLayoutEffectsStarted(lanes) { 3627 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStarted === "function") injectedProfilingHooks.markLayoutEffectsStarted(lanes); 3628 } 3629 function markLayoutEffectsStopped() { 3630 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStopped === "function") injectedProfilingHooks.markLayoutEffectsStopped(); 3631 } 3632 function markPassiveEffectsStarted(lanes) { 3633 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStarted === "function") injectedProfilingHooks.markPassiveEffectsStarted(lanes); 3634 } 3635 function markPassiveEffectsStopped() { 3636 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStopped === "function") injectedProfilingHooks.markPassiveEffectsStopped(); 3637 } 3638 function markRenderStarted(lanes) { 3639 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStarted === "function") injectedProfilingHooks.markRenderStarted(lanes); 3640 } 3641 function markRenderYielded() { 3642 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderYielded === "function") injectedProfilingHooks.markRenderYielded(); 3643 } 3644 function markRenderStopped() { 3645 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStopped === "function") injectedProfilingHooks.markRenderStopped(); 3646 } 3647 function markRenderScheduled(lane) { 3648 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderScheduled === "function") injectedProfilingHooks.markRenderScheduled(lane); 3649 } 3650 function markForceUpdateScheduled(fiber, lane) { 3651 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markForceUpdateScheduled === "function") injectedProfilingHooks.markForceUpdateScheduled(fiber, lane); 3652 } 3653 function markStateUpdateScheduled(fiber, lane) { 3654 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markStateUpdateScheduled === "function") injectedProfilingHooks.markStateUpdateScheduled(fiber, lane); 3655 } 3656 var NoMode = 0; 3657 var ConcurrentMode = 1; 3658 var ProfileMode = 2; 3659 var StrictLegacyMode = 8; 3660 var StrictEffectsMode = 16;
3661 var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; 3662 var log = Math.log; 3663 var LN2 = Math.LN2; 3664 function clz32Fallback(x) { 3665 var asUint = x >>> 0; 3666 if (asUint === 0) return 32; 3667 return 31 - (log(asUint) / LN2 | 0) | 0; 3668 } 3669 var TotalLanes = 31; 3670 var NoLanes = 0; 3671 var NoLane = 0; 3672 var SyncLane = 1; 3673 var InputContinuousHydrationLane = 2; 3674 var InputContinuousLane = 4; 3675 var DefaultHydrationLane = 8; 3676 var DefaultLane = 16; 3677 var TransitionHydrationLane = 32; 3678 var TransitionLanes = 4194240; 3679 var TransitionLane1 = 64; 3680 var TransitionLane2 = 128; 3681 var TransitionLane3 = 256; 3682 var TransitionLane4 = 512; 3683 var TransitionLane5 = 1024; 3684 var TransitionLane6 = 2048; 3685 var TransitionLane7 = 4096; 3686 var TransitionLane8 = 8192; 3687 var TransitionLane9 = 16384; 3688 var TransitionLane10 = 32768; 3689 var TransitionLane11 = 65536; 3690 var TransitionLane12 = 131072; 3691 var TransitionLane13 = 262144; 3692 var TransitionLane14 = 524288; 3693 var TransitionLane15 = 1048576; 3694 var TransitionLane16 = 2097152; 3695 var RetryLanes = 130023424; 3696 var RetryLane1 = 4194304; 3697 var RetryLane2 = 8388608; 3698 var RetryLane3 = 16777216; 3699 var RetryLane4 = 33554432; 3700 var RetryLane5 = 67108864; 3701 var SomeRetryLane = RetryLane1; 3702 var SelectiveHydrationLane = 134217728; 3703 var NonIdleLanes = 268435455; 3704 var IdleHydrationLane = 268435456; 3705 var IdleLane = 536870912; 3706 var OffscreenLane = 1073741824; 3707 function getLabelForLane(lane) { 3708 if (lane & SyncLane) return "Sync"; 3709 if (lane & InputContinuousHydrationLane) return "InputContinuousHydration"; 3710 if (lane & InputContinuousLane) return "InputContinuous"; 3711 if (lane & DefaultHydrationLane) return "DefaultHydration"; 3712 if (lane & DefaultLane) return "Default"; 3713 if (lane & TransitionHydrationLane) return "TransitionHydration"; 3714 if (lane & TransitionLanes) return "Transition"; 3715 if (lane & RetryLanes) return "Retry"; 3716 if (lane & SelectiveHydrationLane) return "SelectiveHydration"; 3717 if (lane & IdleHydrationLane) return "IdleHydration"; 3718 if (lane & IdleLane) return "Idle"; 3719 if (lane & OffscreenLane) return "Offscreen"; 3720 } 3721 var NoTimestamp = -1; 3722 var nextTransitionLane = TransitionLane1; 3723 var nextRetryLane = RetryLane1; 3724 function getHighestPriorityLanes(lanes) { 3725 switch (getHighestPriorityLane(lanes)) { 3726 case SyncLane: return SyncLane; 3727 case InputContinuousHydrationLane: return InputContinuousHydrationLane; 3728 case InputContinuousLane: return InputContinuousLane; 3729 case DefaultHydrationLane: return DefaultHydrationLane; 3730 case DefaultLane: return DefaultLane; 3731 case TransitionHydrationLane: return TransitionHydrationLane; 3732 case TransitionLane1: 3733 case TransitionLane2: 3734 case TransitionLane3: 3735 case TransitionLane4: 3736 case TransitionLane5: 3737 case TransitionLane6: 3738 case TransitionLane7: 3739 case TransitionLane8: 3740 case TransitionLane9: 3741 case TransitionLane10: 3742 case TransitionLane11: 3743 case TransitionLane12: 3744 case TransitionLane13: 3745 case TransitionLane14: 3746 case TransitionLane15: 3747 case TransitionLane16: return lanes & TransitionLanes; 3748 case RetryLane1: 3749 case RetryLane2: 3750 case RetryLane3: 3751 case RetryLane4: 3752 case RetryLane5: return lanes & RetryLanes; 3753 case SelectiveHydrationLane: return SelectiveHydrationLane; 3754 case IdleHydrationLane: return IdleHydrationLane; 3755 case IdleLane: return IdleLane; 3756 case OffscreenLane: return OffscreenLane; 3757 default: 3758 error("Should have found matching lanes. This is a bug in React."); 3759 return lanes; 3760 } 3761 } 3762 function getNextLanes(root, wipLanes) { 3763 var pendingLanes = root.pendingLanes; 3764 if (pendingLanes === NoLanes) return NoLanes; 3765 var nextLanes = NoLanes; 3766 var suspendedLanes = root.suspendedLanes; 3767 var pingedLanes = root.pingedLanes; 3768 var nonIdlePendingLanes = pendingLanes & NonIdleLanes; 3769 if (nonIdlePendingLanes !== NoLanes) { 3770 var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes; 3771 if (nonIdleUnblockedLanes !== NoLanes) nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes); 3772 else { 3773 var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes; 3774 if (nonIdlePingedLanes !== NoLanes) nextLanes = getHighestPriorityLanes(nonIdlePingedLanes); 3775 } 3776 } else { 3777 var unblockedLanes = pendingLanes & ~suspendedLanes; 3778 if (unblockedLanes !== NoLanes) nextLanes = getHighestPriorityLanes(unblockedLanes); 3779 else if (pingedLanes !== NoLanes) nextLanes = getHighestPriorityLanes(pingedLanes); 3780 } 3781 if (nextLanes === NoLanes) return NoLanes; 3782 if (wipLanes !== NoLanes && wipLanes !== nextLanes && (wipLanes & suspendedLanes) === NoLanes) { 3783 var nextLane = getHighestPriorityLane(nextLanes); 3784 var wipLane = getHighestPriorityLane(wipLanes); 3785 if (nextLane >= wipLane || nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) return wipLanes; 3786 } 3787 if ((nextLanes & InputContinuousLane) !== NoLanes) nextLanes |= pendingLanes & DefaultLane; 3788 var entangledLanes = root.entangledLanes; 3789 if (entangledLanes !== NoLanes) { 3790 var entanglements = root.entanglements; 3791 var lanes = nextLanes & entangledLanes; 3792 while (lanes > 0) {
3793 var index = pickArbitraryLaneIndex(lanes); 3794 var lane = 1 << index; 3795 nextLanes |= entanglements[index]; 3796 lanes &= ~lane; 3797 } 3798 } 3799 return nextLanes; 3800 } 3801 function getMostRecentEventTime(root, lanes) { 3802 var eventTimes = root.eventTimes; 3803 var mostRecentEventTime = NoTimestamp; 3804 while (lanes > 0) { 3805 var index = pickArbitraryLaneIndex(lanes); 3806 var lane = 1 << index; 3807 var eventTime = eventTimes[index]; 3808 if (eventTime > mostRecentEventTime) mostRecentEventTime = eventTime; 3809 lanes &= ~lane; 3810 } 3811 return mostRecentEventTime; 3812 } 3813 function computeExpirationTime(lane, currentTime) { 3814 switch (lane) { 3815 case SyncLane: 3816 case InputContinuousHydrationLane: 3817 case InputContinuousLane: return currentTime + 250; 3818 case DefaultHydrationLane: 3819 case DefaultLane: 3820 case TransitionHydrationLane: 3821 case TransitionLane1: 3822 case TransitionLane2: 3823 case TransitionLane3: 3824 case TransitionLane4: 3825 case TransitionLane5: 3826 case TransitionLane6: 3827 case TransitionLane7: 3828 case TransitionLane8: 3829 case TransitionLane9: 3830 case TransitionLane10: 3831 case TransitionLane11: 3832 case TransitionLane12: 3833 case TransitionLane13: 3834 case TransitionLane14: 3835 case TransitionLane15: 3836 case TransitionLane16: return currentTime + 5e3; 3837 case RetryLane1: 3838 case RetryLane2: 3839 case RetryLane3: 3840 case RetryLane4: 3841 case RetryLane5: return NoTimestamp; 3842 case SelectiveHydrationLane: 3843 case IdleHydrationLane: 3844 case IdleLane: 3845 case OffscreenLane: return NoTimestamp; 3846 default: 3847 error("Should have found matching lanes. This is a bug in React."); 3848 return NoTimestamp; 3849 } 3850 } 3851 function markStarvedLanesAsExpired(root, currentTime) { 3852 var pendingLanes = root.pendingLanes; 3853 var suspendedLanes = root.suspendedLanes; 3854 var pingedLanes = root.pingedLanes; 3855 var expirationTimes = root.expirationTimes; 3856 var lanes = pendingLanes; 3857 while (lanes > 0) { 3858 var index = pickArbitraryLaneIndex(lanes); 3859 var lane = 1 << index; 3860 var expirationTime = expirationTimes[index]; 3861 if (expirationTime === NoTimestamp) { 3862 if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) expirationTimes[index] = computeExpirationTime(lane, currentTime); 3863 } else if (expirationTime <= currentTime) root.expiredLanes |= lane; 3864 lanes &= ~lane; 3865 } 3866 } 3867 function getHighestPriorityPendingLanes(root) { 3868 return getHighestPriorityLanes(root.pendingLanes); 3869 } 3870 function getLanesToRetrySynchronouslyOnError(root) { 3871 var everythingButOffscreen = root.pendingLanes & ~OffscreenLane; 3872 if (everythingButOffscreen !== NoLanes) return everythingButOffscreen; 3873 if (everythingButOffscreen & OffscreenLane) return OffscreenLane; 3874 return NoLanes; 3875 } 3876 function includesSyncLane(lanes) { 3877 return (lanes & SyncLane) !== NoLanes; 3878 } 3879 function includesNonIdleWork(lanes) { 3880 return (lanes & NonIdleLanes) !== NoLanes; 3881 } 3882 function includesOnlyRetries(lanes) { 3883 return (lanes & RetryLanes) === lanes; 3884 } 3885 function includesOnlyNonUrgentLanes(lanes) { 3886 return (lanes & (SyncLane | InputContinuousLane | DefaultLane)) === NoLanes; 3887 } 3888 function includesOnlyTransitions(lanes) { 3889 return (lanes & TransitionLanes) === lanes; 3890 } 3891 function includesBlockingLane(root, lanes) { 3892 return (lanes & (InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane)) !== NoLanes; 3893 } 3894 function includesExpiredLane(root, lanes) { 3895 return (lanes & root.expiredLanes) !== NoLanes; 3896 } 3897 function isTransitionLane(lane) { 3898 return (lane & TransitionLanes) !== NoLanes; 3899 } 3900 function claimNextTransitionLane() { 3901 var lane = nextTransitionLane; 3902 nextTransitionLane <<= 1; 3903 if ((nextTransitionLane & TransitionLanes) === NoLanes) nextTransitionLane = TransitionLane1; 3904 return lane; 3905 } 3906 function claimNextRetryLane() { 3907 var lane = nextRetryLane; 3908 nextRetryLane <<= 1; 3909 if ((nextRetryLane & RetryLanes) === NoLanes) nextRetryLane = RetryLane1; 3910 return lane; 3911 } 3912 function getHighestPriorityLane(lanes) { 3913 return lanes & -lanes; 3914 } 3915 function pickArbitraryLane(lanes) { 3916 return getHighestPriorityLane(lanes); 3917 }
3918 function pickArbitraryLaneIndex(lanes) { 3919 return 31 - clz32(lanes); 3920 } 3921 function laneToIndex(lane) { 3922 return pickArbitraryLaneIndex(lane); 3923 } 3924 function includesSomeLane(a, b) { 3925 return (a & b) !== NoLanes; 3926 } 3927 function isSubsetOfLanes(set, subset) { 3928 return (set & subset) === subset; 3929 } 3930 function mergeLanes(a, b) { 3931 return a | b; 3932 } 3933 function removeLanes(set, subset) { 3934 return set & ~subset; 3935 } 3936 function intersectLanes(a, b) { 3937 return a & b; 3938 } 3939 function laneToLanes(lane) { 3940 return lane; 3941 } 3942 function higherPriorityLane(a, b) { 3943 return a !== NoLane && a < b ? a : b; 3944 } 3945 function createLaneMap(initial) { 3946 var laneMap = []; 3947 for (var i = 0; i < TotalLanes; i++) laneMap.push(initial); 3948 return laneMap; 3949 } 3950 function markRootUpdated(root, updateLane, eventTime) { 3951 root.pendingLanes |= updateLane; 3952 if (updateLane !== IdleLane) { 3953 root.suspendedLanes = NoLanes; 3954 root.pingedLanes = NoLanes; 3955 } 3956 var eventTimes = root.eventTimes; 3957 var index = laneToIndex(updateLane); 3958 eventTimes[index] = eventTime; 3959 } 3960 function markRootSuspended(root, suspendedLanes) { 3961 root.suspendedLanes |= suspendedLanes; 3962 root.pingedLanes &= ~suspendedLanes; 3963 var expirationTimes = root.expirationTimes; 3964 var lanes = suspendedLanes; 3965 while (lanes > 0) { 3966 var index = pickArbitraryLaneIndex(lanes); 3967 var lane = 1 << index; 3968 expirationTimes[index] = NoTimestamp; 3969 lanes &= ~lane; 3970 } 3971 } 3972 function markRootPinged(root, pingedLanes, eventTime) { 3973 root.pingedLanes |= root.suspendedLanes & pingedLanes; 3974 } 3975 function markRootFinished(root, remainingLanes) { 3976 var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; 3977 root.pendingLanes = remainingLanes; 3978 root.suspendedLanes = NoLanes; 3979 root.pingedLanes = NoLanes; 3980 root.expiredLanes &= remainingLanes; 3981 root.mutableReadLanes &= remainingLanes; 3982 root.entangledLanes &= remainingLanes; 3983 var entanglements = root.entanglements; 3984 var eventTimes = root.eventTimes; 3985 var expirationTimes = root.expirationTimes; 3986 var lanes = noLongerPendingLanes; 3987 while (lanes > 0) { 3988 var index = pickArbitraryLaneIndex(lanes); 3989 var lane = 1 << index; 3990 entanglements[index] = NoLanes; 3991 eventTimes[index] = NoTimestamp; 3992 expirationTimes[index] = NoTimestamp; 3993 lanes &= ~lane; 3994 } 3995 } 3996 function markRootEntangled(root, entangledLanes) { 3997 var rootEntangledLanes = root.entangledLanes |= entangledLanes; 3998 var entanglements = root.entanglements; 3999 var lanes = rootEntangledLanes; 4000 while (lanes) { 4001 var index = pickArbitraryLaneIndex(lanes); 4002 var lane = 1 << index; 4003 if (lane & entangledLanes | entanglements[index] & entangledLanes) entanglements[index] |= entangledLanes; 4004 lanes &= ~lane; 4005 } 4006 } 4007 function getBumpedLaneForHydration(root, renderLanes) { 4008 var renderLane = getHighestPriorityLane(renderLanes); 4009 var lane; 4010 switch (renderLane) { 4011 case InputContinuousLane: 4012 lane = InputContinuousHydrationLane; 4013 break; 4014 case DefaultLane: 4015 lane = DefaultHydrationLane; 4016 break; 4017 case TransitionLane1: 4018 case TransitionLane2: 4019 case TransitionLane3: 4020 case TransitionLane4: 4021 case TransitionLane5: 4022 case TransitionLane6: 4023 case TransitionLane7: 4024 case TransitionLane8: 4025 case TransitionLane9: 4026 case TransitionLane10: 4027 case TransitionLane11: 4028 case TransitionLane12: 4029 case TransitionLane13: 4030 case TransitionLane14: 4031 case TransitionLane15: 4032 case TransitionLane16: 4033 case RetryLane1: 4034 case RetryLane2: 4035 case RetryLane3: 4036 case RetryLane4: 4037 case RetryLane5: 4038 lane = TransitionHydrationLane; 4039 break; 4040 case IdleLane: 4041 lane = IdleHydrationLane; 4042 break; 4043 default: 4044 lane = NoLane; 4045 break; 4046 } 4047 if ((lane & (root.suspendedLanes | renderLanes)) !== NoLane) return NoLane; 4048 return lane; 4049 } 4050 function addFiberToLanesMap(root, fiber, lanes) { 4051 if (!isDevToolsPresent) return; 4052 var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap; 4053 while (lanes > 0) { 4054 var index = laneToIndex(lanes); 4055 var lane = 1 << index; 4056 pendingUpdatersLaneMap[index].add(fiber); 4057 lanes &= ~lane; 4058 } 4059 } 4060 function movePendingFibersToMemoized(root, lanes) { 4061 if (!isDevToolsPresent) return; 4062 var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap; 4063 var memoizedUpdaters = root.memoizedUpdaters; 4064 while (lanes > 0) {
4065 var index = laneToIndex(lanes); 4066 var lane = 1 << index; 4067 var updaters = pendingUpdatersLaneMap[index]; 4068 if (updaters.size > 0) { 4069 updaters.forEach(function(fiber) { 4070 var alternate = fiber.alternate; 4071 if (alternate === null || !memoizedUpdaters.has(alternate)) memoizedUpdaters.add(fiber); 4072 }); 4073 updaters.clear(); 4074 } 4075 lanes &= ~lane; 4076 } 4077 } 4078 function getTransitionsForLanes(root, lanes) { 4079 return null; 4080 } 4081 var DiscreteEventPriority = SyncLane; 4082 var ContinuousEventPriority = InputContinuousLane; 4083 var DefaultEventPriority = DefaultLane; 4084 var IdleEventPriority = IdleLane; 4085 var currentUpdatePriority = NoLane; 4086 function getCurrentUpdatePriority() { 4087 return currentUpdatePriority; 4088 } 4089 function setCurrentUpdatePriority(newPriority) { 4090 currentUpdatePriority = newPriority; 4091 } 4092 function runWithPriority(priority, fn) { 4093 var previousPriority = currentUpdatePriority; 4094 try { 4095 currentUpdatePriority = priority; 4096 return fn(); 4097 } finally { 4098 currentUpdatePriority = previousPriority; 4099 } 4100 } 4101 function higherEventPriority(a, b) { 4102 return a !== 0 && a < b ? a : b; 4103 } 4104 function lowerEventPriority(a, b) { 4105 return a === 0 || a > b ? a : b; 4106 } 4107 function isHigherEventPriority(a, b) { 4108 return a !== 0 && a < b; 4109 } 4110 function lanesToEventPriority(lanes) { 4111 var lane = getHighestPriorityLane(lanes); 4112 if (!isHigherEventPriority(DiscreteEventPriority, lane)) return DiscreteEventPriority; 4113 if (!isHigherEventPriority(ContinuousEventPriority, lane)) return ContinuousEventPriority; 4114 if (includesNonIdleWork(lane)) return DefaultEventPriority; 4115 return IdleEventPriority; 4116 } 4117 function isRootDehydrated(root) { 4118 return root.current.memoizedState.isDehydrated; 4119 } 4120 var _attemptSynchronousHydration; 4121 function setAttemptSynchronousHydration(fn) { 4122 _attemptSynchronousHydration = fn; 4123 } 4124 function attemptSynchronousHydration(fiber) { 4125 _attemptSynchronousHydration(fiber); 4126 } 4127 var attemptContinuousHydration; 4128 function setAttemptContinuousHydration(fn) { 4129 attemptContinuousHydration = fn; 4130 } 4131 var attemptHydrationAtCurrentPriority; 4132 function setAttemptHydrationAtCurrentPriority(fn) { 4133 attemptHydrationAtCurrentPriority = fn; 4134 } 4135 var getCurrentUpdatePriority$1; 4136 function setGetCurrentUpdatePriority(fn) { 4137 getCurrentUpdatePriority$1 = fn; 4138 } 4139 var attemptHydrationAtPriority; 4140 function setAttemptHydrationAtPriority(fn) { 4141 attemptHydrationAtPriority = fn; 4142 } 4143 var hasScheduledReplayAttempt = false; 4144 var queuedDiscreteEvents = []; 4145 var queuedFocus = null; 4146 var queuedDrag = null; 4147 var queuedMouse = null; 4148 var queuedPointers = /* @__PURE__ */ new Map(); 4149 var queuedPointerCaptures = /* @__PURE__ */ new Map(); 4150 var queuedExplicitHydrationTargets = []; 4151 var discreteReplayableEvents = [ 4152 "mousedown", 4153 "mouseup", 4154 "touchcancel", 4155 "touchend", 4156 "touchstart", 4157 "auxclick", 4158 "dblclick", 4159 "pointercancel", 4160 "pointerdown", 4161 "pointerup", 4162 "dragend", 4163 "dragstart", 4164 "drop", 4165 "compositionend", 4166 "compositionstart", 4167 "keydown", 4168 "keypress", 4169 "keyup", 4170 "input", 4171 "textInput", 4172 "copy", 4173 "cut", 4174 "paste", 4175 "click", 4176 "change", 4177 "contextmenu", 4178 "reset", 4179 "submit" 4180 ]; 4181 function isDiscreteEventThatRequiresHydration(eventType) { 4182 return discreteReplayableEvents.indexOf(eventType) > -1; 4183 } 4184 function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) { 4185 return { 4186 blockedOn, 4187 domEventName, 4188 eventSystemFlags, 4189 nativeEvent, 4190 targetContainers: [targetContainer] 4191 }; 4192 } 4193 function clearIfContinuousEvent(domEventName, nativeEvent) { 4194 switch (domEventName) { 4195 case "focusin": 4196 case "focusout": 4197 queuedFocus = null; 4198 break; 4199 case "dragenter": 4200 case "dragleave": 4201 queuedDrag = null; 4202 break; 4203 case "mouseover": 4204 case "mouseout": 4205 queuedMouse = null; 4206 break; 4207 case "pointerover": 4208 case "pointerout": 4209 var pointerId = nativeEvent.pointerId; 4210 queuedPointers.delete(pointerId); 4211 break; 4212 case "gotpointercapture": 4213 case "lostpointercapture": 4214 var _pointerId = nativeEvent.pointerId; 4215 queuedPointerCaptures.delete(_pointerId); 4216 break; 4217 } 4218 } 4219 function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) { 4220 if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) { 4221 var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent); 4222 if (blockedOn !== null) { 4223 var _fiber2 = getInstanceFromNode(blockedOn); 4224 if (_fiber2 !== null) attemptContinuousHydration(_fiber2); 4225 } 4226 return queuedEvent; 4227 } 4228 existingQueuedEvent.eventSystemFlags |= eventSystemFlags; 4229 var targetContainers = existingQueuedEvent.targetContainers; 4230 if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) targetContainers.push(targetContainer); 4231 return existingQueuedEvent; 4232 } 4233 function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) { 4234 switch (domEventName) { 4235 case "focusin": 4236 queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent); 4237 return true; 4238 case "dragenter": 4239 queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent); 4240 return true; 4241 case "mouseover": 4242 queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent); 4243 return true; 4244 case "pointerover": 4245 var pointerEvent = nativeEvent; 4246 var pointerId = pointerEvent.pointerId; 4247 queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent)); 4248 return true; 4249 case "gotpointercapture": 4250 var _pointerEvent = nativeEvent; 4251 var _pointerId2 = _pointerEvent.pointerId; 4252 queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent)); 4253 return true; 4254 } 4255 return false;
4256 } 4257 function attemptExplicitHydrationTarget(queuedTarget) { 4258 var targetInst = getClosestInstanceFromNode(queuedTarget.target); 4259 if (targetInst !== null) { 4260 var nearestMounted = getNearestMountedFiber(targetInst); 4261 if (nearestMounted !== null) { 4262 var tag = nearestMounted.tag; 4263 if (tag === SuspenseComponent) { 4264 var instance = getSuspenseInstanceFromFiber(nearestMounted); 4265 if (instance !== null) { 4266 queuedTarget.blockedOn = instance; 4267 attemptHydrationAtPriority(queuedTarget.priority, function() { 4268 attemptHydrationAtCurrentPriority(nearestMounted); 4269 }); 4270 return; 4271 } 4272 } else if (tag === HostRoot) { 4273 var root = nearestMounted.stateNode; 4274 if (isRootDehydrated(root)) { 4275 queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); 4276 return; 4277 } 4278 } 4279 } 4280 } 4281 queuedTarget.blockedOn = null; 4282 } 4283 function queueExplicitHydrationTarget(target) { 4284 var updatePriority = getCurrentUpdatePriority$1(); 4285 var queuedTarget = { 4286 blockedOn: null, 4287 target, 4288 priority: updatePriority 4289 }; 4290 var i = 0; 4291 for (; i < queuedExplicitHydrationTargets.length; i++) if (!isHigherEventPriority(updatePriority, queuedExplicitHydrationTargets[i].priority)) break; 4292 queuedExplicitHydrationTargets.splice(i, 0, queuedTarget); 4293 if (i === 0) attemptExplicitHydrationTarget(queuedTarget); 4294 } 4295 function attemptReplayContinuousQueuedEvent(queuedEvent) { 4296 if (queuedEvent.blockedOn !== null) return false; 4297 var targetContainers = queuedEvent.targetContainers; 4298 while (targetContainers.length > 0) { 4299 var targetContainer = targetContainers[0]; 4300 var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent); 4301 if (nextBlockedOn === null) { 4302 var nativeEvent = queuedEvent.nativeEvent; 4303 var nativeEventClone = new nativeEvent.constructor(nativeEvent.type, nativeEvent); 4304 setReplayingEvent(nativeEventClone); 4305 nativeEvent.target.dispatchEvent(nativeEventClone); 4306 resetReplayingEvent(); 4307 } else { 4308 var _fiber3 = getInstanceFromNode(nextBlockedOn); 4309 if (_fiber3 !== null) attemptContinuousHydration(_fiber3); 4310 queuedEvent.blockedOn = nextBlockedOn; 4311 return false; 4312 } 4313 targetContainers.shift(); 4314 } 4315 return true; 4316 } 4317 function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) { 4318 if (attemptReplayContinuousQueuedEvent(queuedEvent)) map.delete(key); 4319 } 4320 function replayUnblockedEvents() { 4321 hasScheduledReplayAttempt = false; 4322 if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) queuedFocus = null; 4323 if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) queuedDrag = null; 4324 if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) queuedMouse = null; 4325 queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap); 4326 queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap); 4327 } 4328 function scheduleCallbackIfUnblocked(queuedEvent, unblocked) { 4329 if (queuedEvent.blockedOn === unblocked) { 4330 queuedEvent.blockedOn = null; 4331 if (!hasScheduledReplayAttempt) { 4332 hasScheduledReplayAttempt = true; 4333 Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents); 4334 } 4335 } 4336 } 4337 function retryIfBlockedOn(unblocked) { 4338 if (queuedDiscreteEvents.length > 0) { 4339 scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); 4340 for (var i = 1; i < queuedDiscreteEvents.length; i++) { 4341 var queuedEvent = queuedDiscreteEvents[i]; 4342 if (queuedEvent.blockedOn === unblocked) queuedEvent.blockedOn = null; 4343 } 4344 } 4345 if (queuedFocus !== null) scheduleCallbackIfUnblocked(queuedFocus, unblocked); 4346 if (queuedDrag !== null) scheduleCallbackIfUnblocked(queuedDrag, unblocked); 4347 if (queuedMouse !== null) scheduleCallbackIfUnblocked(queuedMouse, unblocked); 4348 var unblock = function(queuedEvent) { 4349 return scheduleCallbackIfUnblocked(queuedEvent, unblocked); 4350 }; 4351 queuedPointers.forEach(unblock);
4352 queuedPointerCaptures.forEach(unblock); 4353 for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) { 4354 var queuedTarget = queuedExplicitHydrationTargets[_i]; 4355 if (queuedTarget.blockedOn === unblocked) queuedTarget.blockedOn = null; 4356 } 4357 while (queuedExplicitHydrationTargets.length > 0) { 4358 var nextExplicitTarget = queuedExplicitHydrationTargets[0]; 4359 if (nextExplicitTarget.blockedOn !== null) break; 4360 else { 4361 attemptExplicitHydrationTarget(nextExplicitTarget); 4362 if (nextExplicitTarget.blockedOn === null) queuedExplicitHydrationTargets.shift(); 4363 } 4364 } 4365 } 4366 var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; 4367 var _enabled = true; 4368 function setEnabled(enabled) { 4369 _enabled = !!enabled; 4370 } 4371 function isEnabled() { 4372 return _enabled; 4373 } 4374 function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) { 4375 var eventPriority = getEventPriority(domEventName); 4376 var listenerWrapper; 4377 switch (eventPriority) { 4378 case DiscreteEventPriority: 4379 listenerWrapper = dispatchDiscreteEvent; 4380 break; 4381 case ContinuousEventPriority: 4382 listenerWrapper = dispatchContinuousEvent; 4383 break; 4384 case DefaultEventPriority: 4385 default: 4386 listenerWrapper = dispatchEvent; 4387 break; 4388 } 4389 return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer); 4390 } 4391 function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) { 4392 var previousPriority = getCurrentUpdatePriority(); 4393 var prevTransition = ReactCurrentBatchConfig.transition; 4394 ReactCurrentBatchConfig.transition = null; 4395 try { 4396 setCurrentUpdatePriority(DiscreteEventPriority); 4397 dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); 4398 } finally { 4399 setCurrentUpdatePriority(previousPriority); 4400 ReactCurrentBatchConfig.transition = prevTransition; 4401 } 4402 } 4403 function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) { 4404 var previousPriority = getCurrentUpdatePriority(); 4405 var prevTransition = ReactCurrentBatchConfig.transition; 4406 ReactCurrentBatchConfig.transition = null; 4407 try { 4408 setCurrentUpdatePriority(ContinuousEventPriority); 4409 dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); 4410 } finally { 4411 setCurrentUpdatePriority(previousPriority); 4412 ReactCurrentBatchConfig.transition = prevTransition; 4413 } 4414 } 4415 function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) { 4416 if (!_enabled) return; 4417 dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent); 4418 } 4419 function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent) { 4420 var blockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent); 4421 if (blockedOn === null) { 4422 dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer); 4423 clearIfContinuousEvent(domEventName, nativeEvent); 4424 return; 4425 } 4426 if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) { 4427 nativeEvent.stopPropagation(); 4428 return; 4429 } 4430 clearIfContinuousEvent(domEventName, nativeEvent); 4431 if (eventSystemFlags & IS_CAPTURE_PHASE && isDiscreteEventThatRequiresHydration(domEventName)) { 4432 while (blockedOn !== null) { 4433 var fiber = getInstanceFromNode(blockedOn); 4434 if (fiber !== null) attemptSynchronousHydration(fiber); 4435 var nextBlockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent); 4436 if (nextBlockedOn === null) dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer); 4437 if (nextBlockedOn === blockedOn) break; 4438 blockedOn = nextBlockedOn; 4439 } 4440 if (blockedOn !== null) nativeEvent.stopPropagation(); 4441 return; 4442 } 4443 dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer); 4444 } 4445 var return_targetInst = null; 4446 function findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) { 4447 return_targetInst = null; 4448 var targetInst = getClosestInstanceFromNode(getEventTarget(nativeEvent)); 4449 if (targetInst !== null) { 4450 var nearestMounted = getNearestMountedFiber(targetInst); 4451 if (nearestMounted === null) targetInst = null; 4452 else { 4453 var tag = nearestMounted.tag; 4454 if (tag === SuspenseComponent) { 4455 var instance = getSuspenseInstanceFromFiber(nearestMounted); 4456 if (instance !== null) return instance; 4457 targetInst = null; 4458 } else if (tag === HostRoot) { 4459 var root = nearestMounted.stateNode; 4460 if (isRootDehydrated(root)) return getContainerFromFiber(nearestMounted); 4461 targetInst = null; 4462 } else if (nearestMounted !== targetInst) targetInst = null; 4463 } 4464 } 4465 return_targetInst = targetInst; 4466 return null; 4467 } 4468 function getEventPriority(domEventName) { 4469 switch (domEventName) { 4470 case "cancel": 4471 case "click":
4472 case "close": 4473 case "contextmenu": 4474 case "copy": 4475 case "cut": 4476 case "auxclick": 4477 case "dblclick": 4478 case "dragend": 4479 case "dragstart": 4480 case "drop": 4481 case "focusin": 4482 case "focusout": 4483 case "input": 4484 case "invalid": 4485 case "keydown": 4486 case "keypress": 4487 case "keyup": 4488 case "mousedown": 4489 case "mouseup": 4490 case "paste": 4491 case "pause": 4492 case "play": 4493 case "pointercancel": 4494 case "pointerdown": 4495 case "pointerup": 4496 case "ratechange": 4497 case "reset": 4498 case "resize": 4499 case "seeked": 4500 case "submit": 4501 case "touchcancel": 4502 case "touchend": 4503 case "touchstart": 4504 case "volumechange": 4505 case "change": 4506 case "selectionchange": 4507 case "textInput": 4508 case "compositionstart": 4509 case "compositionend": 4510 case "compositionupdate": 4511 case "beforeblur": 4512 case "afterblur": 4513 case "beforeinput": 4514 case "blur": 4515 case "fullscreenchange": 4516 case "focus": 4517 case "hashchange": 4518 case "popstate": 4519 case "select": 4520 case "selectstart": return DiscreteEventPriority; 4521 case "drag": 4522 case "dragenter": 4523 case "dragexit": 4524 case "dragleave": 4525 case "dragover": 4526 case "mousemove": 4527 case "mouseout": 4528 case "mouseover": 4529 case "pointermove": 4530 case "pointerout": 4531 case "pointerover": 4532 case "scroll": 4533 case "toggle": 4534 case "touchmove": 4535 case "wheel": 4536 case "mouseenter": 4537 case "mouseleave": 4538 case "pointerenter": 4539 case "pointerleave": return ContinuousEventPriority; 4540 case "message": switch (getCurrentPriorityLevel()) { 4541 case ImmediatePriority: return DiscreteEventPriority; 4542 case UserBlockingPriority: return ContinuousEventPriority; 4543 case NormalPriority: 4544 case LowPriority: return DefaultEventPriority; 4545 case IdlePriority: return IdleEventPriority; 4546 default: return DefaultEventPriority; 4547 } 4548 default: return DefaultEventPriority; 4549 } 4550 } 4551 function addEventBubbleListener(target, eventType, listener) { 4552 target.addEventListener(eventType, listener, false); 4553 return listener; 4554 } 4555 function addEventCaptureListener(target, eventType, listener) { 4556 target.addEventListener(eventType, listener, true); 4557 return listener; 4558 } 4559 function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) { 4560 target.addEventListener(eventType, listener, { 4561 capture: true, 4562 passive 4563 }); 4564 return listener; 4565 } 4566 function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) { 4567 target.addEventListener(eventType, listener, { passive }); 4568 return listener; 4569 } 4570 /** 4571 * These variables store information about text content of a target node, 4572 * allowing comparison of content before and after a given event. 4573 * 4574 * Identify the node where selection currently begins, then observe 4575 * both its text content and its current position in the DOM. Since the 4576 * browser may natively replace the target node during composition, we can 4577 * use its position to find its replacement. 4578 * 4579 * 4580 */ 4581 var root = null; 4582 var startText = null; 4583 var fallbackText = null; 4584 function initialize(nativeEventTarget) { 4585 root = nativeEventTarget; 4586 startText = getText(); 4587 return true; 4588 } 4589 function reset() { 4590 root = null; 4591 startText = null; 4592 fallbackText = null; 4593 } 4594 function getData() { 4595 if (fallbackText) return fallbackText; 4596 var start; 4597 var startValue = startText; 4598 var startLength = startValue.length; 4599 var end; 4600 var endValue = getText(); 4601 var endLength = endValue.length; 4602 for (start = 0; start < startLength; start++) if (startValue[start] !== endValue[start]) break; 4603 var minEnd = startLength - start; 4604 for (end = 1; end <= minEnd; end++) if (startValue[startLength - end] !== endValue[endLength - end]) break; 4605 var sliceTail = end > 1 ? 1 - end : void 0; 4606 fallbackText = endValue.slice(start, sliceTail); 4607 return fallbackText; 4608 } 4609 function getText() { 4610 if ("value" in root) return root.value; 4611 return root.textContent; 4612 } 4613 /** 4614 * `charCode` represents the actual "character code" and is safe to use with 4615 * `String.fromCharCode`. As such, only keys that correspond to printable 4616 * characters produce a valid `charCode`, the only exception to this is Enter. 4617 * The Tab-key is considered non-printable and does not have a `charCode`, 4618 * presumably because it does not produce a tab-character in browsers. 4619 * 4620 * @param {object} nativeEvent Native browser event. 4621 * @return {number} Normalized `charCode` property. 4622 */
4623 function getEventCharCode(nativeEvent) { 4624 var charCode; 4625 var keyCode = nativeEvent.keyCode; 4626 if ("charCode" in nativeEvent) { 4627 charCode = nativeEvent.charCode; 4628 if (charCode === 0 && keyCode === 13) charCode = 13; 4629 } else charCode = keyCode; 4630 if (charCode === 10) charCode = 13; 4631 if (charCode >= 32 || charCode === 13) return charCode; 4632 return 0; 4633 } 4634 function functionThatReturnsTrue() { 4635 return true; 4636 } 4637 function functionThatReturnsFalse() { 4638 return false; 4639 } 4640 function createSyntheticEvent(Interface) { 4641 /** 4642 * Synthetic events are dispatched by event plugins, typically in response to a 4643 * top-level event delegation handler. 4644 * 4645 * These systems should generally use pooling to reduce the frequency of garbage 4646 * collection. The system should check `isPersistent` to determine whether the 4647 * event should be released into the pool after being dispatched. Users that 4648 * need a persisted event should invoke `persist`. 4649 * 4650 * Synthetic events (and subclasses) implement the DOM Level 3 Events API by 4651 * normalizing browser quirks. Subclasses do not necessarily have to implement a 4652 * DOM interface; custom application-specific events can also subclass this. 4653 */ 4654 function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) { 4655 this._reactName = reactName; 4656 this._targetInst = targetInst; 4657 this.type = reactEventType; 4658 this.nativeEvent = nativeEvent; 4659 this.target = nativeEventTarget; 4660 this.currentTarget = null; 4661 for (var _propName in Interface) { 4662 if (!Interface.hasOwnProperty(_propName)) continue; 4663 var normalize = Interface[_propName]; 4664 if (normalize) this[_propName] = normalize(nativeEvent); 4665 else this[_propName] = nativeEvent[_propName]; 4666 } 4667 if (nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false) this.isDefaultPrevented = functionThatReturnsTrue; 4668 else this.isDefaultPrevented = functionThatReturnsFalse; 4669 this.isPropagationStopped = functionThatReturnsFalse; 4670 return this; 4671 } 4672 assign(SyntheticBaseEvent.prototype, { 4673 preventDefault: function() { 4674 this.defaultPrevented = true; 4675 var event = this.nativeEvent; 4676 if (!event) return; 4677 if (event.preventDefault) event.preventDefault(); 4678 else if (typeof event.returnValue !== "unknown") event.returnValue = false; 4679 this.isDefaultPrevented = functionThatReturnsTrue; 4680 }, 4681 stopPropagation: function() { 4682 var event = this.nativeEvent; 4683 if (!event) return; 4684 if (event.stopPropagation) event.stopPropagation(); 4685 else if (typeof event.cancelBubble !== "unknown") event.cancelBubble = true; 4686 this.isPropagationStopped = functionThatReturnsTrue; 4687 }, 4688 persist: function() {}, 4689 isPersistent: functionThatReturnsTrue 4690 }); 4691 return SyntheticBaseEvent; 4692 } 4693 /** 4694 * @interface Event 4695 * @see http://www.w3.org/TR/DOM-Level-3-Events/ 4696 */ 4697 var EventInterface = { 4698 eventPhase: 0, 4699 bubbles: 0, 4700 cancelable: 0, 4701 timeStamp: function(event) { 4702 return event.timeStamp || Date.now(); 4703 }, 4704 defaultPrevented: 0, 4705 isTrusted: 0 4706 }; 4707 var SyntheticEvent = createSyntheticEvent(EventInterface); 4708 var UIEventInterface = assign({}, EventInterface, { 4709 view: 0, 4710 detail: 0 4711 }); 4712 var SyntheticUIEvent = createSyntheticEvent(UIEventInterface); 4713 var lastMovementX; 4714 var lastMovementY; 4715 var lastMouseEvent; 4716 function updateMouseMovementPolyfillState(event) { 4717 if (event !== lastMouseEvent) { 4718 if (lastMouseEvent && event.type === "mousemove") { 4719 lastMovementX = event.screenX - lastMouseEvent.screenX; 4720 lastMovementY = event.screenY - lastMouseEvent.screenY; 4721 } else { 4722 lastMovementX = 0; 4723 lastMovementY = 0; 4724 } 4725 lastMouseEvent = event; 4726 } 4727 } 4728 /** 4729 * @interface MouseEvent 4730 * @see http://www.w3.org/TR/DOM-Level-3-Events/ 4731 */ 4732 var MouseEventInterface = assign({}, UIEventInterface, { 4733 screenX: 0, 4734 screenY: 0, 4735 clientX: 0, 4736 clientY: 0, 4737 pageX: 0, 4738 pageY: 0, 4739 ctrlKey: 0, 4740 shiftKey: 0, 4741 altKey: 0, 4742 metaKey: 0, 4743 getModifierState: getEventModifierState, 4744 button: 0, 4745 buttons: 0, 4746 relatedTarget: function(event) { 4747 if (event.relatedTarget === void 0) return event.fromElement === event.srcElement ? event.toElement : event.fromElement; 4748 return event.relatedTarget; 4749 }, 4750 movementX: function(event) { 4751 if ("movementX" in event) return event.movementX; 4752 updateMouseMovementPolyfillState(event); 4753 return lastMovementX; 4754 }, 4755 movementY: function(event) { 4756 if ("movementY" in event) return event.movementY; 4757 return lastMovementY; 4758 } 4759 }); 4760 var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface); 4761 var SyntheticDragEvent = createSyntheticEvent(assign({}, MouseEventInterface, { dataTransfer: 0 })); 4762 var SyntheticFocusEvent = createSyntheticEvent(assign({}, UIEventInterface, { relatedTarget: 0 })); 4763 var SyntheticAnimationEvent = createSyntheticEvent(assign({}, EventInterface, { 4764 animationName: 0, 4765 elapsedTime: 0, 4766 pseudoElement: 0 4767 })); 4768 var SyntheticClipboardEvent = createSyntheticEvent(assign({}, EventInterface, { clipboardData: function(event) { 4769 return "clipboardData" in event ? event.clipboardData : window.clipboardData; 4770 } })); 4771 var SyntheticCompositionEvent = createSyntheticEvent(assign({}, EventInterface, { data: 0 })); 4772 /** 4773 * @interface Event 4774 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 4775 * /#events-inputevents 4776 */ 4777 var SyntheticInputEvent = SyntheticCompositionEvent; 4778 /** 4779 * Normalization of deprecated HTML5 `key` values 4780 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names 4781 */ 4782 var normalizeKey = { 4783 Esc: "Escape", 4784 Spacebar: " ", 4785 Left: "ArrowLeft", 4786 Up: "ArrowUp", 4787 Right: "ArrowRight", 4788 Down: "ArrowDown", 4789 Del: "Delete", 4790 Win: "OS", 4791 Menu: "ContextMenu", 4792 Apps: "ContextMenu", 4793 Scroll: "ScrollLock", 4794 MozPrintableKey: "Unidentified" 4795 }; 4796 /** 4797 * Translation from legacy `keyCode` to HTML5 `key`
4798 * Only special keys supported, all others depend on keyboard layout or browser 4799 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names 4800 */ 4801 var translateToKey = { 4802 "8": "Backspace", 4803 "9": "Tab", 4804 "12": "Clear", 4805 "13": "Enter", 4806 "16": "Shift", 4807 "17": "Control", 4808 "18": "Alt", 4809 "19": "Pause", 4810 "20": "CapsLock", 4811 "27": "Escape", 4812 "32": " ", 4813 "33": "PageUp", 4814 "34": "PageDown", 4815 "35": "End", 4816 "36": "Home", 4817 "37": "ArrowLeft", 4818 "38": "ArrowUp", 4819 "39": "ArrowRight", 4820 "40": "ArrowDown", 4821 "45": "Insert", 4822 "46": "Delete", 4823 "112": "F1", 4824 "113": "F2", 4825 "114": "F3", 4826 "115": "F4", 4827 "116": "F5", 4828 "117": "F6", 4829 "118": "F7", 4830 "119": "F8", 4831 "120": "F9", 4832 "121": "F10", 4833 "122": "F11", 4834 "123": "F12", 4835 "144": "NumLock", 4836 "145": "ScrollLock", 4837 "224": "Meta" 4838 }; 4839 /** 4840 * @param {object} nativeEvent Native browser event. 4841 * @return {string} Normalized `key` property. 4842 */ 4843 function getEventKey(nativeEvent) { 4844 if (nativeEvent.key) { 4845 var key = normalizeKey[nativeEvent.key] || nativeEvent.key; 4846 if (key !== "Unidentified") return key; 4847 } 4848 if (nativeEvent.type === "keypress") { 4849 var charCode = getEventCharCode(nativeEvent); 4850 return charCode === 13 ? "Enter" : String.fromCharCode(charCode); 4851 } 4852 if (nativeEvent.type === "keydown" || nativeEvent.type === "keyup") return translateToKey[nativeEvent.keyCode] || "Unidentified"; 4853 return ""; 4854 } 4855 /** 4856 * Translation from modifier key to the associated property in the event. 4857 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers 4858 */ 4859 var modifierKeyToProp = { 4860 Alt: "altKey", 4861 Control: "ctrlKey", 4862 Meta: "metaKey", 4863 Shift: "shiftKey" 4864 }; 4865 function modifierStateGetter(keyArg) { 4866 var nativeEvent = this.nativeEvent; 4867 if (nativeEvent.getModifierState) return nativeEvent.getModifierState(keyArg); 4868 var keyProp = modifierKeyToProp[keyArg]; 4869 return keyProp ? !!nativeEvent[keyProp] : false; 4870 } 4871 function getEventModifierState(nativeEvent) { 4872 return modifierStateGetter; 4873 } 4874 var SyntheticKeyboardEvent = createSyntheticEvent(assign({}, UIEventInterface, { 4875 key: getEventKey, 4876 code: 0, 4877 location: 0, 4878 ctrlKey: 0, 4879 shiftKey: 0, 4880 altKey: 0, 4881 metaKey: 0, 4882 repeat: 0, 4883 locale: 0, 4884 getModifierState: getEventModifierState, 4885 charCode: function(event) { 4886 if (event.type === "keypress") return getEventCharCode(event); 4887 return 0; 4888 }, 4889 keyCode: function(event) { 4890 if (event.type === "keydown" || event.type === "keyup") return event.keyCode; 4891 return 0; 4892 }, 4893 which: function(event) { 4894 if (event.type === "keypress") return getEventCharCode(event); 4895 if (event.type === "keydown" || event.type === "keyup") return event.keyCode; 4896 return 0; 4897 } 4898 })); 4899 var SyntheticPointerEvent = createSyntheticEvent(assign({}, MouseEventInterface, { 4900 pointerId: 0, 4901 width: 0, 4902 height: 0, 4903 pressure: 0, 4904 tangentialPressure: 0, 4905 tiltX: 0, 4906 tiltY: 0, 4907 twist: 0, 4908 pointerType: 0, 4909 isPrimary: 0 4910 })); 4911 var SyntheticTouchEvent = createSyntheticEvent(assign({}, UIEventInterface, { 4912 touches: 0, 4913 targetTouches: 0, 4914 changedTouches: 0, 4915 altKey: 0, 4916 metaKey: 0, 4917 ctrlKey: 0, 4918 shiftKey: 0, 4919 getModifierState: getEventModifierState 4920 })); 4921 var SyntheticTransitionEvent = createSyntheticEvent(assign({}, EventInterface, { 4922 propertyName: 0, 4923 elapsedTime: 0, 4924 pseudoElement: 0 4925 })); 4926 var SyntheticWheelEvent = createSyntheticEvent(assign({}, MouseEventInterface, { 4927 deltaX: function(event) { 4928 return "deltaX" in event ? event.deltaX : "wheelDeltaX" in event ? -event.wheelDeltaX : 0; 4929 }, 4930 deltaY: function(event) { 4931 return "deltaY" in event ? event.deltaY : "wheelDeltaY" in event ? -event.wheelDeltaY : "wheelDelta" in event ? -event.wheelDelta : 0; 4932 }, 4933 deltaZ: 0, 4934 deltaMode: 0 4935 })); 4936 var END_KEYCODES = [ 4937 9, 4938 13, 4939 27, 4940 32 4941 ]; 4942 var START_KEYCODE = 229; 4943 var canUseCompositionEvent = canUseDOM && "CompositionEvent" in window; 4944 var documentMode = null; 4945 if (canUseDOM && "documentMode" in document) documentMode = document.documentMode; 4946 var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode; 4947 var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11); 4948 var SPACEBAR_CODE = 32; 4949 var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); 4950 function registerEvents() { 4951 registerTwoPhaseEvent("onBeforeInput", [ 4952 "compositionend", 4953 "keypress", 4954 "textInput", 4955 "paste" 4956 ]); 4957 registerTwoPhaseEvent("onCompositionEnd", [ 4958 "compositionend", 4959 "focusout", 4960 "keydown", 4961 "keypress", 4962 "keyup", 4963 "mousedown" 4964 ]); 4965 registerTwoPhaseEvent("onCompositionStart", [ 4966 "compositionstart", 4967 "focusout", 4968 "keydown", 4969 "keypress", 4970 "keyup", 4971 "mousedown" 4972 ]); 4973 registerTwoPhaseEvent("onCompositionUpdate", [ 4974 "compositionupdate", 4975 "focusout", 4976 "keydown", 4977 "keypress", 4978 "keyup", 4979 "mousedown" 4980 ]); 4981 } 4982 var hasSpaceKeypress = false;
4983 /** 4984 * Return whether a native keypress event is assumed to be a command. 4985 * This is required because Firefox fires `keypress` events for key commands 4986 * (cut, copy, select-all, etc.) even though no character is inserted. 4987 */ 4988 function isKeypressCommand(nativeEvent) { 4989 return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && !(nativeEvent.ctrlKey && nativeEvent.altKey); 4990 } 4991 /** 4992 * Translate native top level events into event types. 4993 */ 4994 function getCompositionEventType(domEventName) { 4995 switch (domEventName) { 4996 case "compositionstart": return "onCompositionStart"; 4997 case "compositionend": return "onCompositionEnd"; 4998 case "compositionupdate": return "onCompositionUpdate"; 4999 } 5000 } 5001 /** 5002 * Does our fallback best-guess model think this event signifies that 5003 * composition has begun? 5004 */ 5005 function isFallbackCompositionStart(domEventName, nativeEvent) { 5006 return domEventName === "keydown" && nativeEvent.keyCode === START_KEYCODE; 5007 } 5008 /** 5009 * Does our fallback mode think that this event is the end of composition? 5010 */ 5011 function isFallbackCompositionEnd(domEventName, nativeEvent) { 5012 switch (domEventName) { 5013 case "keyup": return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; 5014 case "keydown": return nativeEvent.keyCode !== START_KEYCODE; 5015 case "keypress": 5016 case "mousedown": 5017 case "focusout": return true; 5018 default: return false; 5019 } 5020 } 5021 /** 5022 * Google Input Tools provides composition data via a CustomEvent, 5023 * with the `data` property populated in the `detail` object. If this 5024 * is available on the event object, use it. If not, this is a plain 5025 * composition event and we have nothing special to extract. 5026 * 5027 * @param {object} nativeEvent 5028 * @return {?string} 5029 */ 5030 function getDataFromCustomEvent(nativeEvent) { 5031 var detail = nativeEvent.detail; 5032 if (typeof detail === "object" && "data" in detail) return detail.data; 5033 return null; 5034 } 5035 /** 5036 * Check if a composition event was triggered by Korean IME. 5037 * Our fallback mode does not work well with IE's Korean IME, 5038 * so just use native composition events when Korean IME is used. 5039 * Although CompositionEvent.locale property is deprecated, 5040 * it is available in IE, where our fallback mode is enabled. 5041 * 5042 * @param {object} nativeEvent 5043 * @return {boolean} 5044 */ 5045 function isUsingKoreanIME(nativeEvent) { 5046 return nativeEvent.locale === "ko"; 5047 } 5048 var isComposing = false; 5049 /** 5050 * @return {?object} A SyntheticCompositionEvent. 5051 */ 5052 function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) { 5053 var eventType; 5054 var fallbackData; 5055 if (canUseCompositionEvent) eventType = getCompositionEventType(domEventName); 5056 else if (!isComposing) { 5057 if (isFallbackCompositionStart(domEventName, nativeEvent)) eventType = "onCompositionStart"; 5058 } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) eventType = "onCompositionEnd"; 5059 if (!eventType) return null; 5060 if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) { 5061 if (!isComposing && eventType === "onCompositionStart") isComposing = initialize(nativeEventTarget); 5062 else if (eventType === "onCompositionEnd") { 5063 if (isComposing) fallbackData = getData(); 5064 } 5065 } 5066 var listeners = accumulateTwoPhaseListeners(targetInst, eventType); 5067 if (listeners.length > 0) { 5068 var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget); 5069 dispatchQueue.push({ 5070 event, 5071 listeners 5072 }); 5073 if (fallbackData) event.data = fallbackData; 5074 else { 5075 var customData = getDataFromCustomEvent(nativeEvent); 5076 if (customData !== null) event.data = customData; 5077 } 5078 } 5079 } 5080 function getNativeBeforeInputChars(domEventName, nativeEvent) { 5081 switch (domEventName) { 5082 case "compositionend": return getDataFromCustomEvent(nativeEvent); 5083 case "keypress": 5084 if (nativeEvent.which !== SPACEBAR_CODE) return null; 5085 hasSpaceKeypress = true; 5086 return SPACEBAR_CHAR; 5087 case "textInput": 5088 var chars = nativeEvent.data; 5089 if (chars === SPACEBAR_CHAR && hasSpaceKeypress) return null; 5090 return chars; 5091 default: return null; 5092 } 5093 } 5094 /** 5095 * For browsers that do not provide the `textInput` event, extract the 5096 * appropriate string to use for SyntheticInputEvent. 5097 */ 5098 function getFallbackBeforeInputChars(domEventName, nativeEvent) { 5099 if (isComposing) { 5100 if (domEventName === "compositionend" || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) { 5101 var chars = getData(); 5102 reset(); 5103 isComposing = false;
5104 return chars; 5105 } 5106 return null; 5107 } 5108 switch (domEventName) { 5109 case "paste": return null; 5110 case "keypress": 5111 /** 5112 * As of v27, Firefox may fire keypress events even when no character 5113 * will be inserted. A few possibilities: 5114 * 5115 * - `which` is `0`. Arrow keys, Esc key, etc. 5116 * 5117 * - `which` is the pressed key code, but no char is available. 5118 * Ex: 'AltGr + d` in Polish. There is no modified character for 5119 * this key combination and no character is inserted into the 5120 * document, but FF fires the keypress for char code `100` anyway. 5121 * No `input` event will occur. 5122 * 5123 * - `which` is the pressed key code, but a command combination is 5124 * being used. Ex: `Cmd+C`. No character is inserted, and no 5125 * `input` event will occur. 5126 */ 5127 if (!isKeypressCommand(nativeEvent)) { 5128 if (nativeEvent.char && nativeEvent.char.length > 1) return nativeEvent.char; 5129 else if (nativeEvent.which) return String.fromCharCode(nativeEvent.which); 5130 } 5131 return null; 5132 case "compositionend": return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data; 5133 default: return null; 5134 } 5135 } 5136 /** 5137 * Extract a SyntheticInputEvent for `beforeInput`, based on either native 5138 * `textInput` or fallback behavior. 5139 * 5140 * @return {?object} A SyntheticInputEvent. 5141 */ 5142 function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) { 5143 var chars; 5144 if (canUseTextInputEvent) chars = getNativeBeforeInputChars(domEventName, nativeEvent); 5145 else chars = getFallbackBeforeInputChars(domEventName, nativeEvent); 5146 if (!chars) return null; 5147 var listeners = accumulateTwoPhaseListeners(targetInst, "onBeforeInput"); 5148 if (listeners.length > 0) { 5149 var event = new SyntheticInputEvent("onBeforeInput", "beforeinput", null, nativeEvent, nativeEventTarget); 5150 dispatchQueue.push({ 5151 event, 5152 listeners 5153 }); 5154 event.data = chars; 5155 } 5156 } 5157 /** 5158 * Create an `onBeforeInput` event to match 5159 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. 5160 * 5161 * This event plugin is based on the native `textInput` event 5162 * available in Chrome, Safari, Opera, and IE. This event fires after 5163 * `onKeyPress` and `onCompositionEnd`, but before `onInput`. 5164 * 5165 * `beforeInput` is spec'd but not implemented in any browsers, and 5166 * the `input` event does not provide any useful information about what has 5167 * actually been added, contrary to the spec. Thus, `textInput` is the best 5168 * available event to identify the characters that have actually been inserted 5169 * into the target node. 5170 * 5171 * This plugin is also responsible for emitting `composition` events, thus 5172 * allowing us to share composition fallback code for both `beforeInput` and 5173 * `composition` event types. 5174 */ 5175 function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { 5176 extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); 5177 extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); 5178 } 5179 /** 5180 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary 5181 */ 5182 var supportedInputTypes = { 5183 color: true, 5184 date: true, 5185 datetime: true, 5186 "datetime-local": true, 5187 email: true, 5188 month: true, 5189 number: true, 5190 password: true, 5191 range: true, 5192 search: true, 5193 tel: true, 5194 text: true, 5195 time: true, 5196 url: true, 5197 week: true 5198 }; 5199 function isTextInputElement(elem) { 5200 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); 5201 if (nodeName === "input") return !!supportedInputTypes[elem.type]; 5202 if (nodeName === "textarea") return true; 5203 return false; 5204 } 5205 /** 5206 * Checks if an event is supported in the current execution environment. 5207 * 5208 * NOTE: This will not work correctly for non-generic events such as `change`, 5209 * `reset`, `load`, `error`, and `select`. 5210 * 5211 * Borrows from Modernizr. 5212 * 5213 * @param {string} eventNameSuffix Event name, e.g. "click". 5214 * @return {boolean} True if the event is supported. 5215 * @internal 5216 * @license Modernizr 3.0.0pre (Custom Build) | MIT 5217 */ 5218 function isEventSupported(eventNameSuffix) { 5219 if (!canUseDOM) return false;
5220 var eventName = "on" + eventNameSuffix; 5221 var isSupported = eventName in document; 5222 if (!isSupported) { 5223 var element = document.createElement("div"); 5224 element.setAttribute(eventName, "return;"); 5225 isSupported = typeof element[eventName] === "function"; 5226 } 5227 return isSupported; 5228 } 5229 function registerEvents$1() { 5230 registerTwoPhaseEvent("onChange", [ 5231 "change", 5232 "click", 5233 "focusin", 5234 "focusout", 5235 "input", 5236 "keydown", 5237 "keyup", 5238 "selectionchange" 5239 ]); 5240 } 5241 function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) { 5242 enqueueStateRestore(target); 5243 var listeners = accumulateTwoPhaseListeners(inst, "onChange"); 5244 if (listeners.length > 0) { 5245 var event = new SyntheticEvent("onChange", "change", null, nativeEvent, target); 5246 dispatchQueue.push({ 5247 event, 5248 listeners 5249 }); 5250 } 5251 } 5252 /** 5253 * For IE shims 5254 */ 5255 var activeElement = null; 5256 var activeElementInst = null; 5257 /** 5258 * SECTION: handle `change` event 5259 */ 5260 function shouldUseChangeEvent(elem) { 5261 var nodeName = elem.nodeName && elem.nodeName.toLowerCase(); 5262 return nodeName === "select" || nodeName === "input" && elem.type === "file"; 5263 } 5264 function manualDispatchChangeEvent(nativeEvent) { 5265 var dispatchQueue = []; 5266 createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent)); 5267 batchedUpdates(runEventInBatch, dispatchQueue); 5268 } 5269 function runEventInBatch(dispatchQueue) {
5270 processDispatchQueue(dispatchQueue, 0); 5271 } 5272 function getInstIfValueChanged(targetInst) { 5273 if (updateValueIfChanged(getNodeFromInstance(targetInst))) return targetInst; 5274 } 5275 function getTargetInstForChangeEvent(domEventName, targetInst) { 5276 if (domEventName === "change") return targetInst; 5277 } 5278 /** 5279 * SECTION: handle `input` event 5280 */ 5281 var isInputEventSupported = false; 5282 if (canUseDOM) isInputEventSupported = isEventSupported("input") && (!document.documentMode || document.documentMode > 9); 5283 /** 5284 * (For IE <=9) Starts tracking propertychange events on the passed-in element 5285 * and override the value property so that we can distinguish user events from 5286 * value changes in JS. 5287 */ 5288 function startWatchingForValueChange(target, targetInst) { 5289 activeElement = target; 5290 activeElementInst = targetInst; 5291 activeElement.attachEvent("onpropertychange", handlePropertyChange); 5292 } 5293 /** 5294 * (For IE <=9) Removes the event listeners from the currently-tracked element, 5295 * if any exists. 5296 */ 5297 function stopWatchingForValueChange() { 5298 if (!activeElement) return; 5299 activeElement.detachEvent("onpropertychange", handlePropertyChange); 5300 activeElement = null; 5301 activeElementInst = null; 5302 } 5303 /** 5304 * (For IE <=9) Handles a propertychange event, sending a `change` event if 5305 * the value of the active element has changed. 5306 */ 5307 function handlePropertyChange(nativeEvent) { 5308 if (nativeEvent.propertyName !== "value") return; 5309 if (getInstIfValueChanged(activeElementInst)) manualDispatchChangeEvent(nativeEvent); 5310 } 5311 function handleEventsForInputEventPolyfill(domEventName, target, targetInst) { 5312 if (domEventName === "focusin") { 5313 stopWatchingForValueChange(); 5314 startWatchingForValueChange(target, targetInst); 5315 }
5315 else if (domEventName === "focusout") stopWatchingForValueChange(); 5316 } 5317 function getTargetInstForInputEventPolyfill(domEventName, targetInst) { 5318 if (domEventName === "selectionchange" || domEventName === "keyup" || domEventName === "keydown") return getInstIfValueChanged(activeElementInst); 5319 } 5320 /** 5321 * SECTION: handle `click` event 5322 */ 5323 function shouldUseClickEvent(elem) { 5324 var nodeName = elem.nodeName; 5325 return nodeName && nodeName.toLowerCase() === "input" && (elem.type === "checkbox" || elem.type === "radio"); 5326 } 5327 function getTargetInstForClickEvent(domEventName, targetInst) { 5328 if (domEventName === "click") return getInstIfValueChanged(targetInst); 5329 } 5330 function getTargetInstForInputOrChangeEvent(domEventName, targetInst) { 5331 if (domEventName === "input" || domEventName === "change") return getInstIfValueChanged(targetInst); 5332 } 5333 function handleControlledInputBlur(node) { 5334 var state = node._wrapperState; 5335 if (!state || !state.controlled || node.type !== "number") return; 5336 setDefaultValue(node, "number", node.value); 5337 } 5338 /** 5339 * This plugin creates an `onChange` event that normalizes change events 5340 * across form elements. This event fires at a time when it's possible to 5341 * change the element's value without seeing a flicker. 5342 * 5343 * Supported elements are: 5344 * - input (see `isTextInputElement`) 5345 * - textarea 5346 * - select 5347 */ 5348 function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { 5349 var targetNode = targetInst ? getNodeFromInstance(targetInst) : window; 5350 var getTargetInstFunc, handleEventFunc; 5351 if (shouldUseChangeEvent(targetNode)) getTargetInstFunc = getTargetInstForChangeEvent; 5352 else if (isTextInputElement(targetNode)) if (isInputEventSupported) getTargetInstFunc = getTargetInstForInputOrChangeEvent; 5353 else { 5354 getTargetInstFunc = getTargetInstForInputEventPolyfill; 5355 handleEventFunc = handleEventsForInputEventPolyfill; 5356 } 5357 else if (shouldUseClickEvent(targetNode)) getTargetInstFunc = getTargetInstForClickEvent; 5358 if (getTargetInstFunc) { 5359 var inst = getTargetInstFunc(domEventName, targetInst); 5360 if (inst) { 5361 createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget); 5362 return; 5363 } 5364 } 5365 if (handleEventFunc) handleEventFunc(domEventName, targetNode, targetInst); 5366 if (domEventName === "focusout") handleControlledInputBlur(targetNode); 5367 } 5368 function registerEvents$2() { 5369 registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]); 5370 registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]); 5371 registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]); 5372 registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]); 5373 } 5374 /** 5375 * For almost every interaction we care about, there will be both a top-level 5376 * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that 5377 * we do not extract duplicate events. However, moving the mouse into the 5378 * browser from outside will not fire a `mouseout` event. In this case, we use 5379 * the `mouseover` top-level event. 5380 */ 5381 function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { 5382 var isOverEvent = domEventName === "mouseover" || domEventName === "pointerover"; 5383 var isOutEvent = domEventName === "mouseout" || domEventName === "pointerout"; 5384 if (isOverEvent && !isReplayingEvent(nativeEvent)) { 5385 var related = nativeEvent.relatedTarget || nativeEvent.fromElement; 5386 if (related) { 5387 if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) return; 5388 } 5389 } 5390 if (!isOutEvent && !isOverEvent) return; 5391 var win; 5392 if (nativeEventTarget.window === nativeEventTarget) win = nativeEventTarget; 5393 else { 5394 var doc = nativeEventTarget.ownerDocument; 5395 if (doc) win = doc.defaultView || doc.parentWindow; 5396 else win = window; 5397 } 5398 var from; 5399 var to; 5400 if (isOutEvent) { 5401 var _related = nativeEvent.relatedTarget || nativeEvent.toElement; 5402 from = targetInst; 5403 to = _related ? getClosestInstanceFromNode(_related) : null; 5404 if (to !== null) { 5405 var nearestMounted = getNearestMountedFiber(to); 5406 if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) to = null; 5407 } 5408 } else { 5409 from = null; 5410 to = targetInst; 5411 } 5412 if (from === to) return; 5413 var SyntheticEventCtor = SyntheticMouseEvent; 5414 var leaveEventType = "onMouseLeave"; 5415 var enterEventType = "onMouseEnter"; 5416 var eventTypePrefix = "mouse"; 5417 if (domEventName === "pointerout" || domEventName === "pointerover") { 5418 SyntheticEventCtor = SyntheticPointerEvent; 5419 leaveEventType = "onPointerLeave"; 5420 enterEventType = "onPointerEnter"; 5421 eventTypePrefix = "pointer"; 5422 } 5423 var fromNode = from == null ? win : getNodeFromInstance(from); 5424 var toNode = to == null ? win : getNodeFromInstance(to); 5425 var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + "leave", from, nativeEvent, nativeEventTarget); 5426 leave.target = fromNode; 5427 leave.relatedTarget = toNode; 5428 var enter = null; 5429 if (getClosestInstanceFromNode(nativeEventTarget) === targetInst) { 5430 var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + "enter", to, nativeEvent, nativeEventTarget); 5431 enterEvent.target = toNode; 5432 enterEvent.relatedTarget = fromNode; 5433 enter = enterEvent; 5434 } 5435 accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to); 5436 } 5437 /** 5438 * inlined Object.is polyfill to avoid requiring consumers ship their own 5439 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is 5440 */ 5441 function is(x, y) { 5442 return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y; 5443 } 5444 var objectIs = typeof Object.is === "function" ? Object.is : is; 5445 /**
5446 * Performs equality by iterating through keys on an object and returning false 5447 * when any key has values which are not strictly equal between the arguments. 5448 * Returns true when the values of all keys are strictly equal. 5449 */ 5450 function shallowEqual(objA, objB) { 5451 if (objectIs(objA, objB)) return true; 5452 if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) return false; 5453 var keysA = Object.keys(objA); 5454 var keysB = Object.keys(objB); 5455 if (keysA.length !== keysB.length) return false; 5456 for (var i = 0; i < keysA.length; i++) { 5457 var currentKey = keysA[i]; 5458 if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) return false; 5459 } 5460 return true; 5461 } 5462 /** 5463 * Given any node return the first leaf node without children. 5464 * 5465 * @param {DOMElement|DOMTextNode} node 5466 * @return {DOMElement|DOMTextNode} 5467 */ 5468 function getLeafNode(node) { 5469 while (node && node.firstChild) node = node.firstChild; 5470 return node; 5471 } 5472 /** 5473 * Get the next sibling within a container. This will walk up the 5474 * DOM if a node's siblings have been exhausted. 5475 * 5476 * @param {DOMElement|DOMTextNode} node 5477 * @return {?DOMElement|DOMTextNode} 5478 */ 5479 function getSiblingNode(node) { 5480 while (node) { 5481 if (node.nextSibling) return node.nextSibling; 5482 node = node.parentNode; 5483 } 5484 } 5485 /** 5486 * Get object describing the nodes which contain characters at offset. 5487 * 5488 * @param {DOMElement|DOMTextNode} root 5489 * @param {number} offset 5490 * @return {?object} 5491 */ 5492 function getNodeForCharacterOffset(root, offset) { 5493 var node = getLeafNode(root); 5494 var nodeStart = 0; 5495 var nodeEnd = 0; 5496 while (node) { 5497 if (node.nodeType === TEXT_NODE) { 5498 nodeEnd = nodeStart + node.textContent.length; 5499 if (nodeStart <= offset && nodeEnd >= offset) return { 5500 node, 5501 offset: offset - nodeStart 5502 }; 5503 nodeStart = nodeEnd; 5504 } 5505 node = getLeafNode(getSiblingNode(node)); 5506 } 5507 } 5508 /** 5509 * @param {DOMElement} outerNode 5510 * @return {?object} 5511 */ 5512 function getOffsets(outerNode) { 5513 var ownerDocument = outerNode.ownerDocument; 5514 var win = ownerDocument && ownerDocument.defaultView || window; 5515 var selection = win.getSelection && win.getSelection(); 5516 if (!selection || selection.rangeCount === 0) return null; 5517 var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, focusNode = selection.focusNode, focusOffset = selection.focusOffset; 5518 try { 5519 anchorNode.nodeType; 5520 focusNode.nodeType; 5521 } catch (e) { 5522 return null; 5523 } 5524 return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset); 5525 } 5526 /** 5527 * Returns {start, end} where `start` is the character/codepoint index of 5528 * (anchorNode, anchorOffset) within the textContent of `outerNode`, and 5529 * `end` is the index of (focusNode, focusOffset). 5530 * 5531 * Returns null if you pass in garbage input but we should probably just crash. 5532 * 5533 * Exported only for testing. 5534 */ 5535 function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) { 5536 var length = 0; 5537 var start = -1; 5538 var end = -1; 5539 var indexWithinAnchor = 0; 5540 var indexWithinFocus = 0; 5541 var node = outerNode; 5542 var parentNode = null; 5543 outer: while (true) { 5544 var next = null; 5545 while (true) { 5546 if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) start = length + anchorOffset; 5547 if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) end = length + focusOffset; 5548 if (node.nodeType === TEXT_NODE) length += node.nodeValue.length; 5549 if ((next = node.firstChild) === null) break; 5550 parentNode = node; 5551 node = next; 5552 } 5553 while (true) { 5554 if (node === outerNode) break outer; 5555 if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) start = length; 5556 if (parentNode === focusNode && ++indexWithinFocus === focusOffset) end = length; 5557 if ((next = node.nextSibling) !== null) break; 5558 node = parentNode; 5559 parentNode = node.parentNode; 5560 } 5561 node = next; 5562 } 5563 if (start === -1 || end === -1) return null; 5564 return { 5565 start, 5566 end 5567 }; 5568 } 5569 /** 5570 * In modern non-IE browsers, we can support both forward and backward 5571 * selections. 5572 * 5573 * Note: IE10+ supports the Selection object, but it does not support 5574 * the `extend` method, which means that even in modern IE, it's not possible 5575 * to programmatically create a backward selection. Thus, for all IE
5576 * versions, we use the old IE API to create our selections. 5577 * 5578 * @param {DOMElement|DOMTextNode} node 5579 * @param {object} offsets 5580 */ 5581 function setOffsets(node, offsets) { 5582 var doc = node.ownerDocument || document; 5583 var win = doc && doc.defaultView || window; 5584 if (!win.getSelection) return; 5585 var selection = win.getSelection(); 5586 var length = node.textContent.length; 5587 var start = Math.min(offsets.start, length); 5588 var end = offsets.end === void 0 ? start : Math.min(offsets.end, length); 5589 if (!selection.extend && start > end) { 5590 var temp = end; 5591 end = start; 5592 start = temp; 5593 } 5594 var startMarker = getNodeForCharacterOffset(node, start); 5595 var endMarker = getNodeForCharacterOffset(node, end); 5596 if (startMarker && endMarker) { 5597 if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) return; 5598 var range = doc.createRange(); 5599 range.setStart(startMarker.node, startMarker.offset); 5600 selection.removeAllRanges(); 5601 if (start > end) { 5602 selection.addRange(range); 5603 selection.extend(endMarker.node, endMarker.offset); 5604 } else { 5605 range.setEnd(endMarker.node, endMarker.offset); 5606 selection.addRange(range); 5607 } 5608 } 5609 } 5610 function isTextNode(node) { 5611 return node && node.nodeType === TEXT_NODE; 5612 } 5613 function containsNode(outerNode, innerNode) { 5614 if (!outerNode || !innerNode) return false; 5615 else if (outerNode === innerNode) return true; 5616 else if (isTextNode(outerNode)) return false; 5617 else if (isTextNode(innerNode)) return containsNode(outerNode, innerNode.parentNode); 5618 else if ("contains" in outerNode) return outerNode.contains(innerNode); 5619 else if (outerNode.compareDocumentPosition) return !!(outerNode.compareDocumentPosition(innerNode) & 16); 5620 else return false; 5621 } 5622 function isInDocument(node) { 5623 return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node); 5624 } 5625 function isSameOriginFrame(iframe) { 5626 try { 5627 return typeof iframe.contentWindow.location.href === "string"; 5628 } catch (err) { 5629 return false; 5630 } 5631 } 5632 function getActiveElementDeep() { 5633 var win = window; 5634 var element = getActiveElement(); 5635 while (element instanceof win.HTMLIFrameElement) { 5636 if (isSameOriginFrame(element)) win = element.contentWindow; 5637 else return element; 5638 element = getActiveElement(win.document); 5639 } 5640 return element; 5641 } 5642 /** 5643 * @ReactInputSelection: React input selection module. Based on Selection.js, 5644 * but modified to be suitable for react and has a couple of bug fixes (doesn't 5645 * assume buttons have range selections allowed). 5646 * Input selection module for React. 5647 */ 5648 /** 5649 * @hasSelectionCapabilities: we get the element types that support selection 5650 * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart` 5651 * and `selectionEnd` rows. 5652 */ 5653 function hasSelectionCapabilities(elem) { 5654 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); 5655 return nodeName && (nodeName === "input" && (elem.type === "text" || elem.type === "search" || elem.type === "tel" || elem.type === "url" || elem.type === "password") || nodeName === "textarea" || elem.contentEditable === "true"); 5656 } 5657 function getSelectionInformation() { 5658 var focusedElem = getActiveElementDeep(); 5659 return { 5660 focusedElem, 5661 selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null 5662 }; 5663 } 5664 /** 5665 * @restoreSelection: If any selection information was potentially lost, 5666 * restore it. This is useful when performing operations that could remove dom 5667 * nodes and place them back in, resulting in focus being lost. 5668 */ 5669 function restoreSelection(priorSelectionInformation) { 5670 var curFocusedElem = getActiveElementDeep(); 5671 var priorFocusedElem = priorSelectionInformation.focusedElem; 5672 var priorSelectionRange = priorSelectionInformation.selectionRange; 5673 if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { 5674 if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) setSelection(priorFocusedElem, priorSelectionRange); 5675 var ancestors = []; 5676 var ancestor = priorFocusedElem; 5677 while (ancestor = ancestor.parentNode) if (ancestor.nodeType === ELEMENT_NODE) ancestors.push({ 5678 element: ancestor, 5679 left: ancestor.scrollLeft, 5680 top: ancestor.scrollTop 5681 }); 5682 if (typeof priorFocusedElem.focus === "function") priorFocusedElem.focus(); 5683 for (var i = 0; i < ancestors.length; i++) { 5684 var info = ancestors[i]; 5685 info.element.scrollLeft = info.left; 5686 info.element.scrollTop = info.top; 5687 } 5688 } 5689 } 5690 /** 5691 * @getSelection: Gets the selection bounds of a focused textarea, input or 5692 * contentEditable node. 5693 * -@input: Look up selection bounds of this input 5694 * -@return {start: selectionStart, end: selectionEnd} 5695 */ 5696 function getSelection(input) { 5697 var selection; 5698 if ("selectionStart" in input) selection = { 5699 start: input.selectionStart, 5700 end: input.selectionEnd 5701 }; 5702 else selection = getOffsets(input); 5703 return selection || { 5704 start: 0, 5705 end: 0 5706 }; 5707 } 5708 /** 5709 * @setSelection: Sets the selection bounds of a textarea or input and focuses 5710 * the input. 5711 * -@input Set selection bounds of this input or textarea 5712 * -@offsets Object of same form that is returned from get* 5713 */ 5714 function setSelection(input, offsets) { 5715 var start = offsets.start; 5716 var end = offsets.end; 5717 if (end === void 0) end = start; 5718 if ("selectionStart" in input) { 5719 input.selectionStart = start; 5720 input.selectionEnd = Math.min(end, input.value.length); 5721 } else setOffsets(input, offsets); 5722 } 5723 var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && document.documentMode <= 11; 5724 function registerEvents$3() { 5725 registerTwoPhaseEvent("onSelect", [ 5726 "focusout", 5727 "contextmenu", 5728 "dragend", 5729 "focusin", 5730 "keydown", 5731 "keyup", 5732 "mousedown", 5733 "mouseup", 5734 "selectionchange" 5735 ]); 5736 } 5737 var activeElement$1 = null; 5738 var activeElementInst$1 = null; 5739 var lastSelection = null; 5740 var mouseDown = false;
5741 /** 5742 * Get an object which is a unique representation of the current selection. 5743 * 5744 * The return value will not be consistent across nodes or browsers, but 5745 * two identical selections on the same node will return identical objects. 5746 */ 5747 function getSelection$1(node) { 5748 if ("selectionStart" in node && hasSelectionCapabilities(node)) return { 5749 start: node.selectionStart, 5750 end: node.selectionEnd 5751 }; 5752 else { 5753 var selection = (node.ownerDocument && node.ownerDocument.defaultView || window).getSelection(); 5754 return { 5755 anchorNode: selection.anchorNode, 5756 anchorOffset: selection.anchorOffset, 5757 focusNode: selection.focusNode, 5758 focusOffset: selection.focusOffset 5759 }; 5760 } 5761 } 5762 /** 5763 * Get document associated with the event target. 5764 */ 5765 function getEventTargetDocument(eventTarget) { 5766 return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument; 5767 } 5768 /** 5769 * Poll selection to see whether it's changed. 5770 * 5771 * @param {object} nativeEvent 5772 * @param {object} nativeEventTarget 5773 * @return {?SyntheticEvent} 5774 */ 5775 function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) { 5776 var doc = getEventTargetDocument(nativeEventTarget); 5777 if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) return; 5778 var currentSelection = getSelection$1(activeElement$1); 5779 if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) { 5780 lastSelection = currentSelection; 5781 var listeners = accumulateTwoPhaseListeners(activeElementInst$1, "onSelect"); 5782 if (listeners.length > 0) { 5783 var event = new SyntheticEvent("onSelect", "select", null, nativeEvent, nativeEventTarget); 5784 dispatchQueue.push({ 5785 event, 5786 listeners 5787 }); 5788 event.target = activeElement$1; 5789 } 5790 } 5791 } 5792 /** 5793 * This plugin creates an `onSelect` event that normalizes select events 5794 * across form elements. 5795 * 5796 * Supported elements are: 5797 * - input (see `isTextInputElement`) 5798 * - textarea 5799 * - contentEditable 5800 * 5801 * This differs from native browser implementations in the following ways: 5802 * - Fires on contentEditable fields as well as inputs. 5803 * - Fires for collapsed selection. 5804 * - Fires after user input. 5805 */ 5806 function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { 5807 var targetNode = targetInst ? getNodeFromInstance(targetInst) : window; 5808 switch (domEventName) { 5809 case "focusin": 5810 if (isTextInputElement(targetNode) || targetNode.contentEditable === "true") { 5811 activeElement$1 = targetNode; 5812 activeElementInst$1 = targetInst; 5813 lastSelection = null; 5814 } 5815 break; 5816 case "focusout": 5817 activeElement$1 = null; 5818 activeElementInst$1 = null; 5819 lastSelection = null; 5820 break; 5821 case "mousedown": 5822 mouseDown = true; 5823 break; 5824 case "contextmenu": 5825 case "mouseup": 5826 case "dragend": 5827 mouseDown = false; 5828 constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget); 5829 break; 5830 case "selectionchange": if (skipSelectionChangeEvent) break; 5831 case "keydown": 5832 case "keyup": constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget); 5833 } 5834 } 5835 /** 5836 * Generate a mapping of standard vendor prefixes using the defined style property and event name. 5837 * 5838 * @param {string} styleProp 5839 * @param {string} eventName 5840 * @returns {object} 5841 */ 5842 function makePrefixMap(styleProp, eventName) { 5843 var prefixes = {}; 5844 prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); 5845 prefixes["Webkit" + styleProp] = "webkit" + eventName; 5846 prefixes["Moz" + styleProp] = "moz" + eventName; 5847 return prefixes; 5848 } 5849 /** 5850 * A list of event names to a configurable list of vendor prefixes. 5851 */ 5852 var vendorPrefixes = { 5853 animationend: makePrefixMap("Animation", "AnimationEnd"), 5854 animationiteration: makePrefixMap("Animation", "AnimationIteration"), 5855 animationstart: makePrefixMap("Animation", "AnimationStart"), 5856 transitionend: makePrefixMap("Transition", "TransitionEnd") 5857 }; 5858 /** 5859 * Event names that have already been detected and prefixed (if applicable). 5860 */ 5861 var prefixedEventNames = {}; 5862 /** 5863 * Element to check for prefixes on. 5864 */ 5865 var style = {}; 5866 /** 5867 * Bootstrap if a DOM exists. 5868 */ 5869 if (canUseDOM) { 5870 style = document.createElement("div").style; 5871 if (!("AnimationEvent" in window)) { 5872 delete vendorPrefixes.animationend.animation; 5873 delete vendorPrefixes.animationiteration.animation; 5874 delete vendorPrefixes.animationstart.animation; 5875 } 5876 if (!("TransitionEvent" in window)) delete vendorPrefixes.transitionend.transition; 5877 } 5878 /** 5879 * Attempts to determine the correct vendor prefixed event name. 5880 * 5881 * @param {string} eventName 5882 * @returns {string} 5883 */ 5884 function getVendorPrefixedEventName(eventName) { 5885 if (prefixedEventNames[eventName]) return prefixedEventNames[eventName]; 5886 else if (!vendorPrefixes[eventName]) return eventName;
5887 var prefixMap = vendorPrefixes[eventName]; 5888 for (var styleProp in prefixMap) if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) return prefixedEventNames[eventName] = prefixMap[styleProp]; 5889 return eventName; 5890 } 5891 var ANIMATION_END = getVendorPrefixedEventName("animationend"); 5892 var ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration"); 5893 var ANIMATION_START = getVendorPrefixedEventName("animationstart"); 5894 var TRANSITION_END = getVendorPrefixedEventName("transitionend"); 5895 var topLevelEventsToReactNames = /* @__PURE__ */ new Map(); 5896 var simpleEventPluginEvents = [ 5897 "abort", 5898 "auxClick", 5899 "cancel", 5900 "canPlay", 5901 "canPlayThrough", 5902 "click", 5903 "close", 5904 "contextMenu", 5905 "copy", 5906 "cut", 5907 "drag", 5908 "dragEnd", 5909 "dragEnter", 5910 "dragExit", 5911 "dragLeave", 5912 "dragOver", 5913 "dragStart", 5914 "drop", 5915 "durationChange", 5916 "emptied", 5917 "encrypted", 5918 "ended", 5919 "error", 5920 "gotPointerCapture", 5921 "input", 5922 "invalid", 5923 "keyDown", 5924 "keyPress", 5925 "keyUp", 5926 "load", 5927 "loadedData", 5928 "loadedMetadata", 5929 "loadStart", 5930 "lostPointerCapture", 5931 "mouseDown", 5932 "mouseMove", 5933 "mouseOut", 5934 "mouseOver", 5935 "mouseUp", 5936 "paste", 5937 "pause", 5938 "play", 5939 "playing", 5940 "pointerCancel", 5941 "pointerDown", 5942 "pointerMove", 5943 "pointerOut", 5944 "pointerOver", 5945 "pointerUp", 5946 "progress", 5947 "rateChange", 5948 "reset", 5949 "resize", 5950 "seeked", 5951 "seeking", 5952 "stalled", 5953 "submit", 5954 "suspend", 5955 "timeUpdate", 5956 "touchCancel", 5957 "touchEnd", 5958 "touchStart", 5959 "volumeChange", 5960 "scroll", 5961 "toggle", 5962 "touchMove", 5963 "waiting", 5964 "wheel" 5965 ]; 5966 function registerSimpleEvent(domEventName, reactName) { 5967 topLevelEventsToReactNames.set(domEventName, reactName); 5968 registerTwoPhaseEvent(reactName, [domEventName]); 5969 } 5970 function registerSimpleEvents() { 5971 for (var i = 0; i < simpleEventPluginEvents.length; i++) { 5972 var eventName = simpleEventPluginEvents[i]; 5973 registerSimpleEvent(eventName.toLowerCase(), "on" + (eventName[0].toUpperCase() + eventName.slice(1))); 5974 } 5975 registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); 5976 registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
5977 registerSimpleEvent(ANIMATION_START, "onAnimationStart"); 5978 registerSimpleEvent("dblclick", "onDoubleClick"); 5979 registerSimpleEvent("focusin", "onFocus"); 5980 registerSimpleEvent("focusout", "onBlur"); 5981 registerSimpleEvent(TRANSITION_END, "onTransitionEnd"); 5982 } 5983 function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { 5984 var reactName = topLevelEventsToReactNames.get(domEventName); 5985 if (reactName === void 0) return; 5986 var SyntheticEventCtor = SyntheticEvent; 5987 var reactEventType = domEventName; 5988 switch (domEventName) { 5989 case "keypress": if (getEventCharCode(nativeEvent) === 0) return; 5990 case "keydown": 5991 case "keyup": 5992 SyntheticEventCtor = SyntheticKeyboardEvent; 5993 break; 5994 case "focusin": 5995 reactEventType = "focus"; 5996 SyntheticEventCtor = SyntheticFocusEvent; 5997 break; 5998 case "focusout": 5999 reactEventType = "blur"; 6000 SyntheticEventCtor = SyntheticFocusEvent; 6001 break; 6002 case "beforeblur": 6003 case "afterblur": 6004 SyntheticEventCtor = SyntheticFocusEvent; 6005 break; 6006 case "click": if (nativeEvent.button === 2) return; 6007 case "auxclick":
6008 case "dblclick": 6009 case "mousedown": 6010 case "mousemove": 6011 case "mouseup": 6012 case "mouseout": 6013 case "mouseover": 6014 case "contextmenu": 6015 SyntheticEventCtor = SyntheticMouseEvent; 6016 break; 6017 case "drag": 6018 case "dragend": 6019 case "dragenter": 6020 case "dragexit": 6021 case "dragleave": 6022 case "dragover": 6023 case "dragstart": 6024 case "drop": 6025 SyntheticEventCtor = SyntheticDragEvent; 6026 break; 6027 case "touchcancel": 6028 case "touchend": 6029 case "touchmove": 6030 case "touchstart": 6031 SyntheticEventCtor = SyntheticTouchEvent; 6032 break; 6033 case ANIMATION_END: 6034 case ANIMATION_ITERATION: 6035 case ANIMATION_START: 6036 SyntheticEventCtor = SyntheticAnimationEvent; 6037 break; 6038 case TRANSITION_END: 6039 SyntheticEventCtor = SyntheticTransitionEvent; 6040 break; 6041 case "scroll": 6042 SyntheticEventCtor = SyntheticUIEvent; 6043 break; 6044 case "wheel": 6045 SyntheticEventCtor = SyntheticWheelEvent; 6046 break; 6047 case "copy": 6048 case "cut": 6049 case "paste": 6050 SyntheticEventCtor = SyntheticClipboardEvent; 6051 break; 6052 case "gotpointercapture": 6053 case "lostpointercapture": 6054 case "pointercancel": 6055 case "pointerdown": 6056 case "pointermove": 6057 case "pointerout": 6058 case "pointerover": 6059 case "pointerup": 6060 SyntheticEventCtor = SyntheticPointerEvent; 6061 break; 6062 } 6063 var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0; 6064 var accumulateTargetOnly = !inCapturePhase && domEventName === "scroll"; 6065 var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly); 6066 if (_listeners.length > 0) { 6067 var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget); 6068 dispatchQueue.push({ 6069 event: _event, 6070 listeners: _listeners 6071 }); 6072 } 6073 } 6074 registerSimpleEvents(); 6075 registerEvents$2(); 6076 registerEvents$1(); 6077 registerEvents$3(); 6078 registerEvents(); 6079 function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { 6080 extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); 6081 if ((eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0) { 6082 extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); 6083 extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); 6084 extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); 6085 extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); 6086 } 6087 } 6088 var mediaEventTypes = [ 6089 "abort", 6090 "canplay", 6091 "canplaythrough", 6092 "durationchange", 6093 "emptied", 6094 "encrypted", 6095 "ended", 6096 "error", 6097 "loadeddata", 6098 "loadedmetadata", 6099 "loadstart", 6100 "pause", 6101 "play", 6102 "playing", 6103 "progress", 6104 "ratechange", 6105 "resize", 6106 "seeked", 6107 "seeking", 6108 "stalled", 6109 "suspend", 6110 "timeupdate", 6111 "volumechange", 6112 "waiting" 6113 ]; 6114 var nonDelegatedEvents = new Set([ 6115 "cancel", 6116 "close", 6117 "invalid", 6118 "load", 6119 "scroll", 6120 "toggle" 6121 ].concat(mediaEventTypes)); 6122 function executeDispatch(event, listener, currentTarget) { 6123 var type = event.type || "unknown-event"; 6124 event.currentTarget = currentTarget; 6125 invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event); 6126 event.currentTarget = null; 6127 } 6128 function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) { 6129 var previousInstance; 6130 if (inCapturePhase) for (var i = dispatchListeners.length - 1; i >= 0; i--) { 6131 var _dispatchListeners$i = dispatchListeners[i], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget, listener = _dispatchListeners$i.listener; 6132 if (instance !== previousInstance && event.isPropagationStopped()) return; 6133 executeDispatch(event, listener, currentTarget); 6134 previousInstance = instance; 6135 } 6136 else for (var _i = 0; _i < dispatchListeners.length; _i++) { 6137 var _dispatchListeners$_i = dispatchListeners[_i], _instance = _dispatchListeners$_i.instance, _currentTarget = _dispatchListeners$_i.currentTarget, _listener = _dispatchListeners$_i.listener; 6138 if (_instance !== previousInstance && event.isPropagationStopped()) return; 6139 executeDispatch(event, _listener, _currentTarget); 6140 previousInstance = _instance; 6141 } 6142 }
6143 function processDispatchQueue(dispatchQueue, eventSystemFlags) { 6144 var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0; 6145 for (var i = 0; i < dispatchQueue.length; i++) { 6146 var _dispatchQueue$i = dispatchQueue[i], event = _dispatchQueue$i.event, listeners = _dispatchQueue$i.listeners; 6147 processDispatchQueueItemsInOrder(event, listeners, inCapturePhase); 6148 } 6149 rethrowCaughtError(); 6150 } 6151 function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) { 6152 var nativeEventTarget = getEventTarget(nativeEvent); 6153 var dispatchQueue = []; 6154 extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); 6155 processDispatchQueue(dispatchQueue, eventSystemFlags); 6156 } 6157 function listenToNonDelegatedEvent(domEventName, targetElement) { 6158 if (!nonDelegatedEvents.has(domEventName)) error("Did not expect a listenToNonDelegatedEvent() call for \"%s\". This is a bug in React. Please file an issue.", domEventName); 6159 var isCapturePhaseListener = false;
6160 var listenerSet = getEventListenerSet(targetElement); 6161 var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener); 6162 if (!listenerSet.has(listenerSetKey)) { 6163 addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener); 6164 listenerSet.add(listenerSetKey); 6165 } 6166 } 6167 function listenToNativeEvent(domEventName, isCapturePhaseListener, target) { 6168 if (nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener) error("Did not expect a listenToNativeEvent() call for \"%s\" in the bubble phase. This is a bug in React. Please file an issue.", domEventName); 6169 var eventSystemFlags = 0; 6170 if (isCapturePhaseListener) eventSystemFlags |= IS_CAPTURE_PHASE; 6171 addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener); 6172 } 6173 var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2); 6174 function listenToAllSupportedEvents(rootContainerElement) { 6175 if (!rootContainerElement[listeningMarker]) { 6176 rootContainerElement[listeningMarker] = true; 6177 allNativeEvents.forEach(function(domEventName) { 6178 if (domEventName !== "selectionchange") { 6179 if (!nonDelegatedEvents.has(domEventName)) listenToNativeEvent(domEventName, false, rootContainerElement); 6180 listenToNativeEvent(domEventName, true, rootContainerElement); 6181 } 6182 }); 6183 var ownerDocument = rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument; 6184 if (ownerDocument !== null) { 6185 if (!ownerDocument[listeningMarker]) { 6186 ownerDocument[listeningMarker] = true; 6187 listenToNativeEvent("selectionchange", false, ownerDocument); 6188 } 6189 } 6190 } 6191 } 6192 function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) { 6193 var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags); 6194 var isPassiveListener = void 0; 6195 if (passiveBrowserEventsSupported) { 6196 if (domEventName === "touchstart" || domEventName === "touchmove" || domEventName === "wheel") isPassiveListener = true; 6197 } 6198 targetContainer = targetContainer; 6199 if (isCapturePhaseListener) if (isPassiveListener !== void 0) addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener); 6200 else addEventCaptureListener(targetContainer, domEventName, listener); 6201 else if (isPassiveListener !== void 0) addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener); 6202 else addEventBubbleListener(targetContainer, domEventName, listener); 6203 } 6204 function isMatchingRootContainer(grandContainer, targetContainer) { 6205 return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer; 6206 } 6207 function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) { 6208 var ancestorInst = targetInst; 6209 if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) { 6210 var targetContainerNode = targetContainer; 6211 if (targetInst !== null) { 6212 var node = targetInst; 6213 mainLoop: while (true) { 6214 if (node === null) return; 6215 var nodeTag = node.tag; 6216 if (nodeTag === HostRoot || nodeTag === HostPortal) { 6217 var container = node.stateNode.containerInfo; 6218 if (isMatchingRootContainer(container, targetContainerNode)) break; 6219 if (nodeTag === HostPortal) { 6220 var grandNode = node.return; 6221 while (grandNode !== null) { 6222 var grandTag = grandNode.tag; 6223 if (grandTag === HostRoot || grandTag === HostPortal) { 6224 var grandContainer = grandNode.stateNode.containerInfo; 6225 if (isMatchingRootContainer(grandContainer, targetContainerNode)) return; 6226 } 6227 grandNode = grandNode.return; 6228 } 6229 } 6230 while (container !== null) { 6231 var parentNode = getClosestInstanceFromNode(container); 6232 if (parentNode === null) return; 6233 var parentTag = parentNode.tag; 6234 if (parentTag === HostComponent || parentTag === HostText) { 6235 node = ancestorInst = parentNode; 6236 continue mainLoop; 6237 } 6238 container = container.parentNode; 6239 } 6240 } 6241 node = node.return; 6242 } 6243 } 6244 } 6245 batchedUpdates(function() {
6246 return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst); 6247 }); 6248 } 6249 function createDispatchListener(instance, listener, currentTarget) { 6250 return { 6251 instance, 6252 listener, 6253 currentTarget 6254 }; 6255 } 6256 function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly, nativeEvent) { 6257 var captureName = reactName !== null ? reactName + "Capture" : null; 6258 var reactEventName = inCapturePhase ? captureName : reactName; 6259 var listeners = []; 6260 var instance = targetFiber; 6261 var lastHostComponent = null; 6262 while (instance !== null) { 6263 var _instance2 = instance, stateNode = _instance2.stateNode; 6264 if (_instance2.tag === HostComponent && stateNode !== null) { 6265 lastHostComponent = stateNode; 6266 if (reactEventName !== null) { 6267 var listener = getListener(instance, reactEventName); 6268 if (listener != null) listeners.push(createDispatchListener(instance, listener, lastHostComponent)); 6269 } 6270 } 6271 if (accumulateTargetOnly) break; 6272 instance = instance.return; 6273 } 6274 return listeners; 6275 } 6276 function accumulateTwoPhaseListeners(targetFiber, reactName) { 6277 var captureName = reactName + "Capture"; 6278 var listeners = []; 6279 var instance = targetFiber; 6280 while (instance !== null) { 6281 var _instance3 = instance, stateNode = _instance3.stateNode; 6282 if (_instance3.tag === HostComponent && stateNode !== null) { 6283 var currentTarget = stateNode; 6284 var captureListener = getListener(instance, captureName); 6285 if (captureListener != null) listeners.unshift(createDispatchListener(instance, captureListener, currentTarget)); 6286 var bubbleListener = getListener(instance, reactName); 6287 if (bubbleListener != null) listeners.push(createDispatchListener(instance, bubbleListener, currentTarget)); 6288 } 6289 instance = instance.return; 6290 } 6291 return listeners; 6292 } 6293 function getParent(inst) { 6294 if (inst === null) return null; 6295 do 6296 inst = inst.return; 6297 while (inst && inst.tag !== HostComponent); 6298 if (inst) return inst; 6299 return null; 6300 } 6301 /** 6302 * Return the lowest common ancestor of A and B, or null if they are in 6303 * different trees. 6304 */ 6305 function getLowestCommonAncestor(instA, instB) { 6306 var nodeA = instA; 6307 var nodeB = instB; 6308 var depthA = 0; 6309 for (var tempA = nodeA; tempA; tempA = getParent(tempA)) depthA++; 6310 var depthB = 0; 6311 for (var tempB = nodeB; tempB; tempB = getParent(tempB)) depthB++; 6312 while (depthA - depthB > 0) { 6313 nodeA = getParent(nodeA); 6314 depthA--; 6315 } 6316 while (depthB - depthA > 0) { 6317 nodeB = getParent(nodeB); 6318 depthB--; 6319 } 6320 var depth = depthA; 6321 while (depth--) { 6322 if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) return nodeA; 6323 nodeA = getParent(nodeA); 6324 nodeB = getParent(nodeB); 6325 } 6326 return null; 6327 } 6328 function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) { 6329 var registrationName = event._reactName; 6330 var listeners = []; 6331 var instance = target; 6332 while (instance !== null) { 6333 if (instance === common) break; 6334 var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag; 6335 if (alternate !== null && alternate === common) break; 6336 if (tag === HostComponent && stateNode !== null) { 6337 var currentTarget = stateNode; 6338 if (inCapturePhase) { 6339 var captureListener = getListener(instance, registrationName); 6340 if (captureListener != null) listeners.unshift(createDispatchListener(instance, captureListener, currentTarget)); 6341 } else if (!inCapturePhase) { 6342 var bubbleListener = getListener(instance, registrationName); 6343 if (bubbleListener != null) listeners.push(createDispatchListener(instance, bubbleListener, currentTarget)); 6344 } 6345 } 6346 instance = instance.return; 6347 } 6348 if (listeners.length !== 0) dispatchQueue.push({ 6349 event, 6350 listeners 6351 }); 6352 } 6353 function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) { 6354 var common = from && to ? getLowestCommonAncestor(from, to) : null; 6355 if (from !== null) accumulateEnterLeaveListenersForEvent(dispat
6355chQueue, leaveEvent, from, common, false); 6356 if (to !== null && enterEvent !== null) accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true); 6357 } 6358 function getListenerSetKey(domEventName, capture) { 6359 return domEventName + "__" + (capture ? "capture" : "bubble"); 6360 } 6361 var didWarnInvalidHydration = false; 6362 var DANGEROUSLY_SET_INNER_HTML = "dangerouslySetInnerHTML"; 6363 var SUPPRESS_CONTENT_EDITABLE_WARNING = "suppressContentEditableWarning"; 6364 var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning"; 6365 var AUTOFOCUS = "autoFocus"; 6366 var CHILDREN = "children"; 6367 var STYLE = "style"; 6368 var HTML$1 = "__html"; 6369 var warnedUnknownTags; 6370 var validatePropertiesInDevelopment; 6371 var warnForPropDifference; 6372 var warnForExtraAttributes; 6373 var warnForInvalidEventListener; 6374 var canDiffStyleForHydrationWarning; 6375 var normalizeHTML; 6376 warnedUnknownTags = { 6377 dialog: true, 6378 webview: true 6379 }; 6380 validatePropertiesInDevelopment = function(type, props) { 6381 validateProperties(type, props); 6382 validateProperties$1(type, props); 6383 validateProperties$2(type, props, { 6384 registrationNameDependencies, 6385 possibleRegistrationNames 6386 }); 6387 }; 6388 canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; 6389 warnForPropDifference = function(propName, serverValue, clientValue) { 6390 if (didWarnInvalidHydration) return; 6391 var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue); 6392 var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue); 6393 if (normalizedServerValue === normalizedClientValue) return; 6394 didWarnInvalidHydration = true; 6395 error("Prop `%s` did not match. Server: %s Client: %s", propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue)); 6396 }; 6397 warnForExtraAttributes = function(attributeNames) { 6398 if (didWarnInvalidHydration) return; 6399 didWarnInvalidHydration = true; 6400 var names = []; 6401 attributeNames.forEach(function(name) { 6402 names.push(name); 6403 }); 6404 error("Extra attributes from the server: %s", names); 6405 }; 6406 warnForInvalidEventListener = function(registrationName, listener) { 6407 if (listener === false) error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", registrationName, registrationName, registrationName); 6408 else error("Expected `%s` listener to be a function, instead got a value of `%s` type.", registrationName, typeof listener); 6409 }; 6410 normalizeHTML = function(parent, html) { 6411 var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName); 6412 testElement.innerHTML = html; 6413 return testElement.innerHTML; 6414 }; 6415 var NORMALIZE_NEWLINES_REGEX = /\r\n?/g; 6416 var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g; 6417 function normalizeMarkupForTextOrAttribute(markup) { 6418 checkHtmlStringCoercion(markup); 6419 return (typeof markup === "string" ? markup : "" + markup).replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, ""); 6420 } 6421 function checkForUnmatchedText(serverText, clientText, isConcurrentMode, shouldWarnDev) { 6422 var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText); 6423 var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText); 6424 if (normalizedServerText === normalizedClientText) return; 6425 if (shouldWarnDev) { 6426 if (!didWarnInvalidHydration) { 6427 didWarnInvalidHydration = true; 6428 error("Text content did not match. Server: \"%s\" Client: \"%s\"", normalizedServerText, normalizedClientText); 6429 } 6430 } 6431 if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) throw new Error("Text content does not match server-rendered HTML."); 6432 } 6433 function getOwnerDocumentFromRootContainer(rootContainerElement) { 6434 return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument; 6435 } 6436 function noop() {} 6437 function trapClickOnNonInteractiveElement(node) { 6438 node.onclick = noop; 6439 } 6440 function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) { 6441 for (var propKey in nextProps) { 6442 if (!nextProps.hasOwnProperty(propKey)) continue; 6443 var nextProp = nextProps[propKey]; 6444 if (propKey === STYLE) { 6445 if (nextProp) Object.freeze(nextProp); 6446 setValueForStyles(domElement, nextProp); 6447 } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { 6448 var nextHtml = nextProp ? nextProp[HTML$1] : void 0; 6449 if (nextHtml != null) setInnerHTML(domElement, nextHtml); 6450 } else if (propKey === CHILDREN) { 6451 if (typeof nextProp === "string") {
6452 if (tag !== "textarea" || nextProp !== "") setTextContent(domElement, nextProp); 6453 } else if (typeof nextProp === "number") setTextContent(domElement, "" + nextProp); 6454 } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING); 6455 else if (propKey === AUTOFOCUS); 6456 else if (registrationNameDependencies.hasOwnProperty(propKey)) { 6457 if (nextProp != null) { 6458 if (typeof nextProp !== "function") warnForInvalidEventListener(propKey, nextProp); 6459 if (propKey === "onScroll") listenToNonDelegatedEvent("scroll", domElement); 6460 } 6461 } else if (nextProp != null) setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag); 6462 } 6463 } 6464 function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) { 6465 for (var i = 0; i < updatePayload.length; i += 2) { 6466 var propKey = updatePayload[i]; 6467 var propValue = updatePayload[i + 1]; 6468 if (propKey === STYLE) setValueForStyles(domElement, propValue); 6469 else if (propKey === DANGEROUSLY_SET_INNER_HTML) setInnerHTML(domElement, propValue); 6470 else if (propKey === CHILDREN) setTextContent(domElement, propValue); 6471 else setValueForProperty(domElement, propKey, propValue, isCustomComponentTag); 6472 } 6473 } 6474 function createElement(type, props, rootContainerElement, parentNamespace) { 6475 var isCustomComponentTag; 6476 var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement); 6477 var domElement; 6478 var namespaceURI = parentNamespace; 6479 if (namespaceURI === HTML_NAMESPACE) namespaceURI = getIntrinsicNamespace(type); 6480 if (namespaceURI === HTML_NAMESPACE) { 6481 isCustomComponentTag = isCustomComponent(type, props); 6482 if (!isCustomComponentTag && type !== type.toLowerCase()) error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type); 6483 if (type === "script") { 6484 var div = ownerDocument.createElement("div"); 6485 div.innerHTML = "<script><\/script>"; 6486 var firstChild = div.firstChild; 6487 domElement = div.removeChild(firstChild); 6488 } else if (typeof props.is === "string") domElement = ownerDocument.createElement(type, { is: props.is }); 6489 else { 6490 domElement = ownerDocument.createElement(type); 6491 if (type === "select") { 6492 var node = domElement; 6493 if (props.multiple) node.multiple = true; 6494 else if (props.size) node.size = props.size; 6495 } 6496 } 6497 } else domElement = ownerDocument.createElementNS(namespaceURI, type); 6498 if (namespaceURI === HTML_NAMESPACE) { 6499 if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !hasOwnProperty.call(warnedUnknownTags, type)) { 6500 warnedUnknownTags[type] = true; 6501 error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", type); 6502 } 6503 } 6504 return domElement; 6505 } 6506 function createTextNode(text, rootContainerElement) { 6507 return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text); 6508 } 6509 function setInitialProperties(domElement, tag, rawProps, rootContainerElement) { 6510 var isCustomComponentTag = isCustomComponent(tag, rawProps); 6511 validatePropertiesInDevelopment(tag, rawProps); 6512 var props; 6513 switch (tag) { 6514 case "dialog": 6515 listenToNonDelegatedEvent("cancel", domElement); 6516 listenToNonDelegatedEvent("close", domElement); 6517 props = rawProps; 6518 break; 6519 case "iframe": 6520 case "object": 6521 case "embed": 6522 listenToNonDelegatedEvent("load", domElement); 6523 props = rawProps; 6524 break; 6525 case "video": 6526 case "audio": 6527 for (var i = 0; i < mediaEventTypes.length; i++) listenToNonDelegatedEvent(mediaEventTypes[i], domElement); 6528 props = rawProps; 6529 break; 6530 case "source": 6531 listenToNonDelegatedEvent("error", domElement); 6532 props = rawProps; 6533 break; 6534 case "img": 6535 case "image": 6536 case "link": 6537 listenToNonDelegatedEvent("error", domElement); 6538 listenToNonDelegatedEvent("load", domElement); 6539 props = rawProps; 6540 break; 6541 case "details": 6542 listenToNonDelegatedEvent("toggle", domElement); 6543 props = rawProps; 6544 break; 6545 case "input": 6546 initWrapperState(domElement, rawProps); 6547 props = getHostProps(domElement, rawProps); 6548 listenToNonDelegatedEvent("invalid", domElement); 6549 break; 6550 case "option": 6551 validateProps(domElement, rawProps); 6552 props = rawProps; 6553 break; 6554 case "select": 6555 initWrapperState$1(domElement, rawProps); 6556 props = getHostProps$1(domElement, rawProps); 6557 listenToNonDelegatedEvent("invalid", domElement); 6558 break; 6559 case "textarea": 6560 initWrapperState$2(domElement, rawProps); 6561 props = getHostProps$2(domElement, rawProps); 6562 listenToNonDelegatedEvent("invalid", domElement); 6563 break; 6564 default: props = rawProps; 6565 } 6566 assertValidProps(tag, props); 6567 setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag); 6568 switch (tag) { 6569 case "input": 6570 track(domElement); 6571 postMountWrapper(domElement, rawProps, false); 6572 break; 6573 case "textarea": 6574 track(domElement); 6575 postMountWrapper$3(domElement); 6576 break; 6577 case "option": 6578 postMountWrapper$1(domElement, rawProps); 6579 break; 6580 case "select": 6581 postMountWrapper$2(domElement, rawProps); 6582 break; 6583 default: 6584 if (typeof props.onClick === "function") trapClickOnNonInteractiveElement(domElement); 6585 break; 6586 } 6587 } 6588 function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) { 6589 validatePropertiesInDevelopment(tag, nextRawProps); 6590 var updatePayload = null; 6591 var lastProps; 6592 var nextProps; 6593 switch (tag) { 6594 case "input": 6595 lastProps = getHostProps(domElement, lastRawProps); 6596 nextProps = getHostProps(domElement, nextRawProps); 6597 updatePayload = []; 6598 break; 6599 case "select": 6600 lastProps = getHostProps$1(domElement, lastRawProps); 6601 nextProps = getHostProps$1(domElement, nextRawProps); 6602 updatePayload = []; 6603 break; 6604 case "textarea": 6605 lastProps = getHostProps$2(domElement, lastRawProps); 6606 nextProps = getHostProps$2(domElement, nextRawProps); 6607 updatePayload = []; 6608 break; 6609 default: 6610 lastProps = lastRawProps; 6611 nextProps = nextRawProps; 6612 if (typeof lastProps.onClick !== "function" && typeof nextProps.onClick === "function") trapClickOnNonInteractiveElement(domElement); 6613 break; 6614 } 6615 assertValidProps(tag, nextProps); 6616 var propKey; 6617 var styleName; 6618 var styleUpdates = null; 6619 for (propKey in lastProps) { 6620 if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) continue; 6621 if (propKey === STYLE) { 6622 var lastStyle = lastProps[propKey]; 6623 for (styleName in lastStyle) if (lastStyle.hasOwnProperty(styleName)) { 6624 if (!styleUpdates) styleUpdates = {}; 6625 styleUpdates[styleName] = ""; 6626 } 6627 } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN); 6628 else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING); 6629 else if (propKey === AUTOFOCUS); 6630 else if (registrationNameDependencies.hasOwnProperty(propKey)) { 6631 if (!updatePayload) updatePayload = []; 6632 } else (updatePayload = updatePayload || []).push(propKey, null); 6633 } 6634 for (propKey in nextProps) { 6635 var nextProp = nextProps[propKey]; 6636 var lastProp = lastProps != null ? lastProps[propKey] : void 0; 6637 if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) continue; 6638 if (propKey === STYLE) { 6639 if (nextProp) Object.freeze(nextProp); 6640 if (lastProp) { 6641 for (styleName in lastProp) if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) { 6642 if (!styleUpdates) styleUpdates = {}; 6643 styleUpdates[styleName] = ""; 6644 } 6645 for (styleName in nextProp) if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) { 6646 if (!styleUpdates) styleUpdates = {}; 6647 styleUpdates[styleName] = nextProp[styleName]; 6648 } 6649 } else { 6650 if (!styleUpdates) { 6651 if (!updatePayload) updatePayload = []; 6652 updatePayload.push(propKey, styleUpdates); 6653 } 6654 styleUpdates = nextProp; 6655 } 6656 } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { 6657 var nextHtml = nextProp ? nextProp[HTML$1] : void 0; 6658 var lastHtml = lastProp ? lastProp[HTML$1] : void 0; 6659 if (nextHtml != null) { 6660 if (lastHtml !== nextHtml) (updatePayload = updatePayload || []).push(propKey, nextHtml); 6661 } 6662 } else if (propKey === CHILDREN) { 6663 if (typeof nextProp === "string" || typeof nextProp === "number") (updatePayload = updatePayload || []).push(propKey, "" + nextProp); 6664 } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING); 6665 else if (registrationNameDependencies.hasOwnProperty(propKey)) { 6666 if (nextProp != null) { 6667 if (typeof nextProp !== "function") warnForInvalidEventListener(propKey, nextProp); 6668 if (propKey === "onScroll") listenToNonDelegatedEvent("scroll", domElement); 6669 } 6670 if (!updatePayload && lastProp !== nextProp) updatePayload = []; 6671 } else (updatePayload = updatePayload || []).push(propKey, nextProp); 6672 } 6673 if (styleUpdates) { 6674 validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]); 6675 (updatePayload = updatePayload || []).push(STYLE, styleUpdates); 6676 } 6677 return updatePayload; 6678 } 6679 function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) { 6680 if (tag === "input" && nextRawProps.type === "radio" && nextRawProps.name != null) updateChecked(domElement, nextRawProps); 6681 updateDOMProperties(domElement, updatePayload, isCustomComponent(tag, lastRawProps), isCustomComponent(tag, nextRawProps)); 6682 switch (tag) { 6683 case "input": 6684 updateWrapper(domElement, nextRawProps); 6685 break; 6686 case "textarea": 6687 updateWrapper$1(domElement, nextRawProps); 6688 break; 6689 case "select": 6690 postUpdateWrapper(domElement, nextRawProps); 6691 break; 6692 } 6693 } 6694 function getPossibleStandardName(propName) { 6695 var lowerCasedName = propName.toLowerCase(); 6696 if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) return null; 6697 return possibleStandardNames[lowerCasedName] || null; 6698 } 6699 function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement, isConcurrentMode, shouldWarnDev) { 6700 var isCustomComponentTag; 6701 var extraAttributeNames; 6702 isCustomComponentTag = isCustomComponent(tag, rawProps); 6703 validatePropertiesInDevelopment(tag, rawProps); 6704 switch (tag) { 6705 case "dialog": 6706 listenToNonDelegatedEvent("cancel", domElement); 6707 listenToNonDelegatedEvent("close", domElement); 6708 break; 6709 case "iframe": 6710 case "object": 6711 case "embed": 6712 listenToNonDelegatedEvent("load", domElement); 6713 break; 6714 case "video":
6715 case "audio": 6716 for (var i = 0; i < mediaEventTypes.length; i++) listenToNonDelegatedEvent(mediaEventTypes[i], domElement); 6717 break; 6718 case "source": 6719 listenToNonDelegatedEvent("error", domElement); 6720 break; 6721 case "img": 6722 case "image": 6723 case "link": 6724 listenToNonDelegatedEvent("error", domElement); 6725 listenToNonDelegatedEvent("load", domElement); 6726 break; 6727 case "details": 6728 listenToNonDelegatedEvent("toggle", domElement); 6729 break; 6730 case "input": 6731 initWrapperState(domElement, rawProps); 6732 listenToNonDelegatedEvent("invalid", domElement); 6733 break; 6734 case "option": 6735 validateProps(domElement, rawProps); 6736 break; 6737 case "select": 6738 initWrapperState$1(domElement, rawProps); 6739 listenToNonDelegatedEvent("invalid", domElement); 6740 break; 6741 case "textarea": 6742 initWrapperState$2(domElement, rawProps); 6743 listenToNonDelegatedEvent("invalid", domElement); 6744 break; 6745 } 6746 assertValidProps(tag, rawProps); 6747 extraAttributeNames = /* @__PURE__ */ new Set(); 6748 var attributes = domElement.attributes; 6749 for (var _i = 0; _i < attributes.length; _i++) switch (attributes[_i].name.toLowerCase()) { 6750 case "value": break; 6751 case "checked": break; 6752 case "selected": break; 6753 default: extraAttributeNames.add(attributes[_i].name); 6754 } 6755 var updatePayload = null; 6756 for (var propKey in rawProps) { 6757 if (!rawProps.hasOwnProperty(propKey)) continue; 6758 var nextProp = rawProps[propKey]; 6759 if (propKey === CHILDREN) { 6760 if (typeof nextProp === "string") { 6761 if (domElement.textContent !== nextProp) { 6762 if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev); 6763 updatePayload = [CHILDREN, nextProp]; 6764 } 6765 } else if (typeof nextProp === "number") { 6766 if (domElement.textContent !== "" + nextProp) { 6767 if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev); 6768 updatePayload = [CHILDREN, "" + nextProp]; 6769 } 6770 } 6771 } else if (registrationNameDependencies.hasOwnProperty(propKey)) { 6772 if (nextProp != null) { 6773 if (typeof nextProp !== "function") warnForInvalidEventListener(propKey, nextProp); 6774 if (propKey === "onScroll") listenToNonDelegatedEvent("scroll", domElement); 6775 } 6776 } else if (shouldWarnDev && typeof isCustomComponentTag === "boolean") { 6777 var serverValue = void 0; 6778 var propertyInfo = isCustomComponentTag && enableCustomElementPropertySupport ? null : getPropertyInfo(propKey); 6779 if (rawProps[SUPPRESS_HYDRATION_WARNING] === true); 6780 else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || propKey === "value" || propKey === "checked" || propKey === "selected"); 6781 else if (propKey === DANGEROUSLY_SET_INNER_HTML) { 6782 var serverHTML = domElement.innerHTML; 6783 var nextHtml = nextProp ? nextProp[HTML$1] : void 0; 6784 if (nextHtml != null) { 6785 var expectedHTML = normalizeHTML(domElement, nextHtml); 6786 if (expectedHTML !== serverHTML) warnForPropDifference(propKey, serverHTML, expectedHTML); 6787 } 6788 } else if (propKey === STYLE) { 6789 extraAttributeNames.delete(propKey); 6790 if (canDiffStyleForHydrationWarning) { 6791 var expectedStyle = createDangerousStringForStyles(nextProp); 6792 serverValue = domElement.getAttribute("style"); 6793 if (expectedStyle !== serverValue) warnForPropDifference(propKey, serverValue, expectedStyle); 6794 } 6795 } else if (isCustomComponentTag && !enableCustomElementPropertySupport) { 6796 extraAttributeNames.delete(propKey.toLowerCase()); 6797 serverValue = getValueForAttribute(domElement, propKey, nextProp); 6798 if (nextProp !== serverValue) warnForPropDifference(propKey, serverValue, nextProp); 6799 } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) { 6800 var isMismatchDueToBadCasing = false; 6801 if (propertyInfo !== null) { 6802 extraAttributeNames.delete(propertyInfo.attributeName); 6803 serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo); 6804 } else { 6805 var ownNamespace = parentNamespace; 6806 if (ownNamespace === HTML_NAMESPACE) ownNamespace = getIntrinsicNamespace(tag); 6807 if (ownNamespace === HTML_NAMESPACE) extraAttributeNames.delete(propKey.toLowerCase()); 6808 else { 6809 var standardName = getPossibleStandardName(propKey); 6810 if (standardName !== null && standardName !== propKey) { 6811 isMismatchDueToBadCasing = true; 6812 extraAttributeNames.delete(standardName); 6813 } 6814 extraAttributeNames.delete(propKey); 6815 } 6816 serverValue = getValueForAttribute(domElement, propKey, nextProp); 6817 } 6818 if (!enableCustomElementPropertySupport && nextProp !== serverValue && !isMismatchDueToBadCasing) warnForPropDifference(propKey, serverValue, nextProp); 6819 } 6820 } 6821 } 6822 if (shouldWarnDev) { 6823 if (extraAttributeNames.size > 0 && rawProps[SUPPRESS_HYDRATION_WARNING] !== true) warnForExtraAttributes(extraAttributeNames); 6824 } 6825 switch (tag) { 6826 case "input": 6827 track(domElement); 6828 postMountWrapper(domElement, rawProps, true); 6829 break; 6830 case "textarea": 6831 track(domElement); 6832 postMountWrapper$3(domElement); 6833 break; 6834 case "select": 6835 case "option": break; 6836 default: 6837 if (typeof rawProps.onClick === "function") trapClickOnNonInteractiveElement(domElement); 6838 break; 6839 } 6840 return updatePayload; 6841 } 6842 function diffHydratedText(textNode, text, isConcurrentMode) { 6843 return textNode.nodeValue !== text; 6844 } 6845 function warnForDeletedHydratableElement(parentNode, child) {
6846 if (didWarnInvalidHydration) return; 6847 didWarnInvalidHydration = true; 6848 error("Did not expect server HTML to contain a <%s> in <%s>.", child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase()); 6849 } 6850 function warnForDeletedHydratableText(parentNode, child) { 6851 if (didWarnInvalidHydration) return; 6852 didWarnInvalidHydration = true; 6853 error("Did not expect server HTML to contain the text node \"%s\" in <%s>.", child.nodeValue, parentNode.nodeName.toLowerCase()); 6854 } 6855 function warnForInsertedHydratedElement(parentNode, tag, props) { 6856 if (didWarnInvalidHydration) return; 6857 didWarnInvalidHydration = true; 6858 error("Expected server HTML to contain a matching <%s> in <%s>.", tag, parentNode.nodeName.toLowerCase()); 6859 } 6860 function warnForInsertedHydratedText(parentNode, text) { 6861 if (text === "") return; 6862 if (didWarnInvalidHydration) return; 6863 didWarnInvalidHydration = true; 6864 error("Expected server HTML to contain a matching text node for \"%s\" in <%s>.", text, parentNode.nodeName.toLowerCase()); 6865 } 6866 function restoreControlledState$3(domElement, tag, props) { 6867 switch (tag) { 6868 case "input": 6869 restoreControlledState(domElement, props); 6870 return; 6871 case "textarea": 6872 restoreControlledState$2(domElement, props); 6873 return; 6874 case "select": 6875 restoreControlledState$1(domElement, props); 6876 return; 6877 } 6878 } 6879 var validateDOMNesting = function() {}; 6880 var updatedAncestorInfo = function() {}; 6881 var specialTags = [ 6882 "address", 6883 "applet", 6884 "area", 6885 "article", 6886 "aside", 6887 "base", 6888 "basefont", 6889 "bgsound", 6890 "blockquote", 6891 "body", 6892 "br", 6893 "button", 6894 "caption", 6895 "center", 6896 "col", 6897 "colgroup", 6898 "dd", 6899 "details", 6900 "dir", 6901 "div", 6902 "dl", 6903 "dt", 6904 "embed", 6905 "fieldset", 6906 "figcaption", 6907 "figure", 6908 "footer", 6909 "form", 6910 "frame", 6911 "frameset", 6912 "h1", 6913 "h2", 6914 "h3", 6915 "h4", 6916 "h5", 6917 "h6", 6918 "head", 6919 "header", 6920 "hgroup", 6921 "hr", 6922 "html", 6923 "iframe", 6924 "img", 6925 "input", 6926 "isindex", 6927 "li", 6928 "link", 6929 "listing", 6930 "main", 6931 "marquee", 6932 "menu", 6933 "menuitem", 6934 "meta", 6935 "nav", 6936 "noembed", 6937 "noframes", 6938 "noscript", 6939 "object", 6940 "ol", 6941 "p", 6942 "param", 6943 "plaintext", 6944 "pre", 6945 "script", 6946 "section", 6947 "select", 6948 "source", 6949 "style", 6950 "summary", 6951 "table", 6952 "tbody", 6953 "td", 6954 "template", 6955 "textarea", 6956 "tfoot", 6957 "th", 6958 "thead", 6959 "title", 6960 "tr", 6961 "track", 6962 "ul", 6963 "wbr", 6964 "xmp" 6965 ]; 6966 var inScopeTags = [ 6967 "applet", 6968 "caption", 6969 "html", 6970 "table", 6971 "td", 6972 "th", 6973 "marquee", 6974 "object", 6975 "template", 6976 "foreignObject", 6977 "desc", 6978 "title" 6979 ]; 6980 var buttonScopeTags = inScopeTags.concat(["button"]); 6981 var impliedEndTags = [ 6982 "dd", 6983 "dt", 6984 "li", 6985 "option", 6986 "optgroup", 6987 "p", 6988 "rp", 6989 "rt" 6990 ]; 6991 var emptyAncestorInfo = { 6992 current: null, 6993 formTag: null, 6994 aTagInScope: null, 6995 buttonTagInScope: null, 6996 nobrTagInScope: null, 6997 pTagInButtonScope: null, 6998 listItemTagAutoclosing: null, 6999 dlItemTagAutoclosing: null 7000 }; 7001 updatedAncestorInfo = function(oldInfo, tag) { 7002 var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo); 7003 var info = { tag }; 7004 if (inScopeTags.indexOf(tag) !== -1) { 7005 ancestorInfo.aTagInScope = null; 7006 ancestorInfo.buttonTagInScope = null; 7007 ancestorInfo.nobrTagInScope = null; 7008 } 7009 if (buttonScopeTags.indexOf(tag) !== -1) ancestorInfo.pTagInButtonScope = null; 7010 if (specialTags.indexOf(tag) !== -1 && tag !== "address" && tag !== "div" && tag !== "p") { 7011 ancestorInfo.listItemTagAutoclosing = null; 7012 ancestorInfo.dlItemTagAutoclosing = null; 7013 } 7014 ancestorInfo.current = info; 7015 if (tag === "form") ancestorInfo.formTag = info; 7016 if (tag === "a") ancestorInfo.aTagInScope = info; 7017 if (tag === "button") ancestorInfo.buttonTagInScope = info; 7018 if (tag === "nobr") ancestorInfo.nobrTagInScope = info; 7019 if (tag === "p") ancestorInfo.pTagInButtonScope = info; 7020 if (tag === "li") ancestorInfo.listItemTagAutoclosing = info; 7021 if (tag === "dd" || tag === "dt") ancestorInfo.dlItemTagAutoclosing = info; 7022 return ancestorInfo; 7023 }; 7024 /** 7025 * Returns whether 7026 */ 7027 var isTagValidWithParent = function(tag, parentTag) { 7028 switch (parentTag) { 7029 case "select": return tag === "option" || tag === "optgroup" || tag === "#text"; 7030 case "optgroup": return tag === "option" || tag === "#text"; 7031 case "option": return tag === "#text"; 7032 case "tr": return tag === "th" || tag === "td" || tag === "style" || tag === "script" || tag === "template"; 7033 case "tbody":
7034 case "thead": 7035 case "tfoot": return tag === "tr" || tag === "style" || tag === "script" || tag === "template"; 7036 case "colgroup": return tag === "col" || tag === "template"; 7037 case "table": return tag === "caption" || tag === "colgroup" || tag === "tbody" || tag === "tfoot" || tag === "thead" || tag === "style" || tag === "script" || tag === "template"; 7038 case "head": return tag === "base" || tag === "basefont" || tag === "bgsound" || tag === "link" || tag === "meta" || tag === "title" || tag === "noscript" || tag === "noframes" || tag === "style" || tag === "script" || tag === "template"; 7039 case "html": return tag === "head" || tag === "body" || tag === "frameset"; 7040 case "frameset": return tag === "frame"; 7041 case "#document": return tag === "html"; 7042 } 7043 switch (tag) { 7044 case "h1": 7045 case "h2": 7046 case "h3": 7047 case "h4": 7048 case "h5": 7049 case "h6": return parentTag !== "h1" && parentTag !== "h2" && parentTag !== "h3" && parentTag !== "h4" && parentTag !== "h5" && parentTag !== "h6"; 7050 case "rp": 7051 case "rt": return impliedEndTags.indexOf(parentTag) === -1; 7052 case "body":
7053 case "caption": 7054 case "col": 7055 case "colgroup": 7056 case "frameset": 7057 case "frame": 7058 case "head": 7059 case "html": 7060 case "tbody": 7061 case "td": 7062 case "tfoot": 7063 case "th": 7064 case "thead": 7065 case "tr": return parentTag == null; 7066 } 7067 return true; 7068 }; 7069 /** 7070 * Returns whether 7071 */ 7072 var findInvalidAncestorForTag = function(tag, ancestorInfo) { 7073 switch (tag) { 7074 case "address": 7075 case "article": 7076 case "aside": 7077 case "blockquote": 7078 case "center": 7079 case "details": 7080 case "dialog": 7081 case "dir": 7082 case "div": 7083 case "dl": 7084 case "fieldset": 7085 case "figcaption": 7086 case "figure": 7087 case "footer": 7088 case "header": 7089 case "hgroup": 7090 case "main": 7091 case "menu": 7092 case "nav": 7093 case "ol": 7094 case "p": 7095 case "section": 7096 case "summary": 7097 case "ul": 7098 case "pre": 7099 case "listing": 7100 case "table": 7101 case "hr": 7102 case "xmp": 7103 case "h1": 7104 case "h2": 7105 case "h3": 7106 case "h4": 7107 case "h5": 7108 case "h6": return ancestorInfo.pTagInButtonScope; 7109 case "form": return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope; 7110 case "li": return ancestorInfo.listItemTagAutoclosing; 7111 case "dd": 7112 case "dt": return ancestorInfo.dlItemTagAutoclosing; 7113 case "button": return ancestorInfo.buttonTagInScope; 7114 case "a": return ancestorInfo.aTagInScope; 7115 case "nobr": return ancestorInfo.nobrTagInScope; 7116 } 7117 return null; 7118 }; 7119 var didWarn$1 = {}; 7120 validateDOMNesting = function(childTag, childText, ancestorInfo) { 7121 ancestorInfo = ancestorInfo || emptyAncestorInfo; 7122 var parentInfo = ancestorInfo.current; 7123 var parentTag = parentInfo && parentInfo.tag; 7124 if (childText != null) { 7125 if (childTag != null) error("validateDOMNesting: when childText is passed, childTag should be null"); 7126 childTag = "#text"; 7127 } 7128 var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo; 7129 var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo); 7130 var invalidParentOrAncestor = invalidParent || invalidAncestor; 7131 if (!invalidParentOrAncestor) return; 7132 var ancestorTag = invalidParentOrAncestor.tag; 7133 var warnKey = !!invalidParent + "|" + childTag + "|" + ancestorTag; 7134 if (didWarn$1[warnKey]) return; 7135 didWarn$1[warnKey] = true; 7136 var tagDisplayName = childTag; 7137 var whitespaceInfo = ""; 7138 if (childTag === "#text") if (/\S/.test(childText)) tagDisplayName = "Text nodes"; 7139 else { 7140 tagDisplayName = "Whitespace text nodes"; 7141 whitespaceInfo = " Make sure you don't have any extra whitespace between tags on each line of your source code."; 7142 } 7143 else tagDisplayName = "<" + childTag + ">"; 7144 if (invalidParent) { 7145 var info = ""; 7146 if (ancestorTag === "table" && childTag === "tr") info += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."; 7147 error("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", tagDisplayName, ancestorTag, whitespaceInfo, info); 7148 } else error("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", tagDisplayName, ancestorTag); 7149 }; 7150 var SUPPRESS_HYDRATION_WARNING$1 = "suppressHydrationWarning"; 7151 var SUSPENSE_START_DATA = "$"; 7152 var SUSPENSE_END_DATA = "/$"; 7153 var SUSPENSE_PENDING_START_DATA = "$?"; 7154 var SUSPENSE_FALLBACK_START_DATA = "$!"; 7155 var STYLE$1 = "style"; 7156 var eventsEnabled = null; 7157 var selectionInformation = null; 7158 function getRootHostContext(rootContainerInstance) { 7159 var type; 7160 var namespace; 7161 var nodeType = rootContainerInstance.nodeType; 7162 switch (nodeType) { 7163 case DOCUMENT_NODE: 7164 case DOCUMENT_FRAGMENT_NODE: 7165 type = nodeType === DOCUMENT_NODE ? "#document" : "#fragment"; 7166 var root = rootContainerInstance.documentElement; 7167 namespace = root ? root.namespaceURI : getChildNamespace(null, ""); 7168 break; 7169 default: 7170 var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance; 7171 var ownNamespace = container.namespaceURI || null; 7172 type = container.tagName; 7173 namespace = getChildNamespace(ownNamespace, type); 7174 break; 7175 }
7176 var validatedTag = type.toLowerCase(); 7177 var ancestorInfo = updatedAncestorInfo(null, validatedTag); 7178 return { 7179 namespace, 7180 ancestorInfo 7181 }; 7182 } 7183 function getChildHostContext(parentHostContext, type, rootContainerInstance) { 7184 var parentHostContextDev = parentHostContext; 7185 return { 7186 namespace: getChildNamespace(parentHostContextDev.namespace, type), 7187 ancestorInfo: updatedAncestorInfo(parentHostContextDev.ancestorInfo, type) 7188 }; 7189 } 7190 function getPublicInstance(instance) { 7191 return instance; 7192 } 7193 function prepareForCommit(containerInfo) { 7194 eventsEnabled = isEnabled(); 7195 selectionInformation = getSelectionInformation(); 7196 var activeInstance = null; 7197 setEnabled(false); 7198 return activeInstance; 7199 } 7200 function resetAfterCommit(containerInfo) { 7201 restoreSelection(selectionInformation); 7202 setEnabled(eventsEnabled); 7203 eventsEnabled = null; 7204 selectionInformation = null; 7205 } 7206 function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) { 7207 var parentNamespace; 7208 var hostContextDev = hostContext; 7209 validateDOMNesting(type, null, hostContextDev.ancestorInfo); 7210 if (typeof props.children === "string" || typeof props.children === "number") { 7211 var string = "" + props.children; 7212 var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type); 7213 validateDOMNesting(null, string, ownAncestorInfo); 7214 } 7215 parentNamespace = hostContextDev.namespace; 7216 var domElement = createElement(type, props, rootContainerInstance, parentNamespace); 7217 precacheFiberNode(internalInstanceHandle, domElement); 7218 updateFiberProps(domElement, props); 7219 return domElement; 7220 } 7221 function appendInitialChild(parentInstance, child) { 7222 parentInstance.appendChild(child); 7223 } 7224 function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) { 7225 setInitialProperties(domElement, type, props, rootContainerInstance); 7226 switch (type) { 7227 case "button": 7228 case "input": 7229 case "select": 7230 case "textarea": return !!props.autoFocus; 7231 case "img": return true; 7232 default: return false; 7233 } 7234 } 7235 function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) { 7236 var hostContextDev = hostContext; 7237 if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === "string" || typeof newProps.children === "number")) { 7238 var string = "" + newProps.children; 7239 var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type); 7240 validateDOMNesting(null, string, ownAncestorInfo); 7241 } 7242 return diffProperties(domElement, type, oldProps, newProps); 7243 } 7244 function shouldSetTextContent(type, props) { 7245 return type === "textarea" || type === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null; 7246 } 7247 function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) { 7248 validateDOMNesting(null, text, hostContext.ancestorInfo); 7249 var textNode = createTextNode(text, rootContainerInstance); 7250 precacheFiberNode(internalInstanceHandle, textNode); 7251 return textNode; 7252 } 7253 function getCurrentEventPriority() { 7254 var currentEvent = window.event; 7255 if (currentEvent === void 0) return DefaultEventPriority; 7256 return getEventPriority(currentEvent.type); 7257 } 7258 var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0; 7259 var cancelTimeout = typeof clearTimeout === "function" ? clearTimeout : void 0; 7260 var noTimeout = -1; 7261 var localPromise = typeof Promise === "function" ? Promise : void 0; 7262 var scheduleMicrotask = typeof queueMicrotask === "function" ? queueMicrotask : typeof localPromise !== "undefined" ? function(callback) { 7263 return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick); 7264 } : scheduleTimeout; 7265 function handleErrorInNextTick(error) { 7266 setTimeout(function() { 7267 throw error; 7268 }); 7269 } 7270 function commitMount(domElement, type, newProps, internalInstanceHandle) { 7271 switch (type) { 7272 case "button":
7273 case "input": 7274 case "select": 7275 case "textarea": 7276 if (newProps.autoFocus) domElement.focus(); 7277 return; 7278 case "img": 7279 if (newProps.src) domElement.src = newProps.src; 7280 return; 7281 } 7282 } 7283 function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) { 7284 updateProperties(domElement, updatePayload, type, oldProps, newProps); 7285 updateFiberProps(domElement, newProps); 7286 } 7287 function resetTextContent(domElement) { 7288 setTextContent(domElement, ""); 7289 } 7290 function commitTextUpdate(textInstance, oldText, newText) { 7291 textInstance.nodeValue = newText; 7292 } 7293 function appendChild(parentInstance, child) { 7294 parentInstance.appendChild(child); 7295 } 7296 function appendChildToContainer(container, child) { 7297 var parentNode; 7298 if (container.nodeType === COMMENT_NODE) { 7299 parentNode = container.parentNode; 7300 parentNode.insertBefore(child, container); 7301 } else { 7302 parentNode = container; 7303 parentNode.appendChild(child); 7304 } 7305 var reactRootContainer = container._reactRootContainer; 7306 if ((reactRootContainer === null || reactRootContainer === void 0) && parentNode.onclick === null) trapClickOnNonInteractiveElement(parentNode); 7307 } 7308 function insertBefore(parentInstance, child, beforeChild) { 7309 parentInstance.insertBefore(child, beforeChild); 7310 } 7311 function insertInContainerBefore(container, child, beforeChild) { 7312 if (container.nodeType === COMMENT_NODE) container.parentNode.insertBefore(child, beforeChild); 7313 else container.insertBefore(child, beforeChild); 7314 } 7315 function removeChild(parentInstance, child) { 7316 parentInstance.removeChild(child); 7317 } 7318 function removeChildFromContainer(container, child) { 7319 if (container.nodeType === COMMENT_NODE) container.parentNode.removeChild(child); 7320 else container.removeChild(child); 7321 } 7322 function clearSuspenseBoundary(parentInstance, suspenseInstance) { 7323 var node = suspenseInstance; 7324 var depth = 0; 7325 do { 7326 var nextNode = node.nextSibling; 7327 parentInstance.removeChild(node); 7328 if (nextNode && nextNode.nodeType === COMMENT_NODE) { 7329 var data = nextNode.data; 7330 if (data === SUSPENSE_END_DATA) if (depth === 0) { 7331 parentInstance.removeChild(nextNode); 7332 retryIfBlockedOn(suspenseInstance); 7333 return; 7334 } else depth--; 7335 else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) depth++; 7336 } 7337 node = nextNode; 7338 } while (node); 7339 retryIfBlockedOn(suspenseInstance); 7340 } 7341 function clearSuspenseBoundaryFromContainer(container, suspenseInstance) { 7342 if (container.nodeType === COMMENT_NODE) clearSuspenseBoundary(container.parentNode, suspenseInstance); 7343 else if (container.nodeType === ELEMENT_NODE) clearSuspenseBoundary(container, suspenseInstance); 7344 retryIfBlockedOn(container); 7345 } 7346 function hideInstance(instance) { 7347 instance = instance; 7348 var style = instance.style; 7349 if (typeof style.setProperty === "function") style.setProperty("display", "none", "important"); 7350 else style.display = "none"; 7351 } 7352 function hideTextInstance(textInstance) { 7353 textInstance.nodeValue = ""; 7354 } 7355 function unhideInstance(instance, props) { 7356 instance = instance; 7357 var styleProp = props[STYLE$1]; 7358 var display = styleProp !== void 0 && styleProp !== null && styleProp.hasOwnProperty("display") ? styleProp.display : null; 7359 instance.style.display = dangerousStyleValue("display", display); 7360 } 7361 function unhideTextInstance(textInstance, text) { 7362 textInstance.nodeValue = text; 7363 } 7364 function clearContainer(container) { 7365 if (container.nodeType === ELEMENT_NODE) container.textContent = ""; 7366 else if (container.nodeType === DOCUMENT_NODE) { 7367 if (container.documentElement) container.removeChild(container.documentElement); 7368 } 7369 } 7370 function canHydrateInstance(instance, type, props) { 7371 if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) return null; 7372 return instance; 7373 } 7374 function canHydrateTextInstance(instance, text) { 7375 if (text === "" || instance.nodeType !== TEXT_NODE) return null; 7376 return instance; 7377 } 7378 function canHydrateSuspenseInstance(instance) { 7379 if (instance.nodeType !== COMMENT_NODE) return null; 7380 return instance; 7381 } 7382 function isSuspenseInstancePending(instance) { 7383 return instance.data === SUSPENSE_PENDING_START_DATA; 7384 } 7385 function isSuspenseInstanceFallback(instance) { 7386 return instance.data === SUSPENSE_FALLBACK_START_DATA; 7387 } 7388 function getSuspenseInstanceFallbackErrorDetails(instance) { 7389 var dataset = instance.nextSibling && instance.nextSibling.dataset; 7390 var digest, message, stack; 7391 if (dataset) { 7392 digest = dataset.dgst; 7393 message = dataset.msg; 7394 stack = dataset.stck; 7395 } 7396 return { 7397 message, 7398 digest, 7399 stack 7400 }; 7401 } 7402 function registerSuspenseInstanceRetry(instance, callback) { 7403 instance._reactRetry = callback; 7404 } 7405 function getNextHydratable(node) { 7406 for (; node != null; node = node.nextSibling) { 7407 var nodeType = node.nodeType; 7408 if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) break; 7409 if (nodeType === COMMENT_NODE) { 7410 var nodeData = node.data; 7411 if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) break; 7412 if (nodeData === SUSPENSE_END_DATA) return null; 7413 } 7414 } 7415 return node; 7416 } 7417 function getNextHydratableSibling(instance) { 7418 return getNextHydratable(instance.nextSibling); 7419 } 7420 function getFirstHydratableChild(parentInstance) { 7421 return getNextHydratable(parentInstance.firstChild); 7422 } 7423 function getFirstHydratableChildWithinContainer(parentContainer) { 7424 return getNextHydratable(parentContainer.firstChild); 7425 } 7426 function getFirstHydratableChildWithinSuspenseInstance(parentInstance) { 7427 return getNextHydratable(parentInstance.nextSibling); 7428 } 7429 function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle, shouldWarnDev) { 7430 precacheFiberNode(internalInstanceHandle, instance); 7431 updateFiberProps(instance, props); 7432 var parentNamespace = hostContext.namespace; 7433 return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance, (internalInstanceHandle.mode & ConcurrentMode) !== NoMode, shouldWarnDev); 7434 } 7435 function hydrateTextInstance(textInstance, text, internalInstanceHandle, shouldWarnDev) { 7436 precacheFiberNode(internalInstanceHandle, textInstance); 7437 internalInstanceHandle.mode & ConcurrentMode; 7438 return diffHydratedText(textInstance, text); 7439 } 7440 function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) { 7441 precacheFiberNode(internalInstanceHandle, suspenseInstance); 7442 } 7443 function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) { 7444 var node = suspenseInstance.nextSibling; 7445 var depth = 0; 7446 while (node) { 7447 if (node.nodeType === COMMENT_NODE) { 7448 var data = node.data; 7449 if (data === SUSPENSE_END_DATA) if (depth === 0) return getNextHydratableSibling(node); 7450 else depth--; 7451 else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) depth++; 7452 } 7453 node = node.nextSibling; 7454 } 7455 return null; 7456 } 7457 function getParentSuspenseInstance(targetInstance) { 7458 var node = targetInstance.previousSibling; 7459 var depth = 0; 7460 while (node) { 7461 if (node.nodeType === COMMENT_NODE) { 7462 var data = node.data; 7463 if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) if (depth === 0) return node; 7464 else depth--; 7465 else if (data === SUSPENSE_END_DATA) depth++; 7466 } 7467 node = node.previousSibling; 7468 } 7469 return null; 7470 } 7471 function commitHydratedContainer(container) { 7472 retryIfBlockedOn(container); 7473 } 7474 function commitHydratedSuspenseInstance(suspenseInstance) { 7475 retryIfBlockedOn(suspenseInstance); 7476 } 7477 function shouldDeleteUnhydratedTailInstances(parentType) { 7478 return parentType !== "head" && parentType !== "body"; 7479 } 7480 function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text, isConcurrentMode) { 7481 checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, true); 7482 } 7483 function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text, isConcurrentMode) { 7484 if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, true); 7485 } 7486 function didNotHydrateInstanceWithinContainer(parentContainer, instance) { 7487 if (instance.nodeType === ELEMENT_NODE) warnForDeletedHydratableElement(parentContainer, instance); 7488 else if (instance.nodeType === COMMENT_NODE); 7489 else warnForDeletedHydratableText(parentContainer, instance); 7490 } 7491 function didNotHydrateInstanceWithinSuspenseInstance(parentInstance, instance) { 7492 var parentNode = parentInstance.parentNode; 7493 if (parentNode !== null) if (instance.nodeType === ELEMENT_NODE) warnForDeletedHydratableElement(parentNode, instance); 7494 else if (instance.nodeType === COMMENT_NODE); 7495 else warnForDeletedHydratableText(parentNode, instance); 7496 } 7497 function didNotHydrateInstance(parentType, parentProps, parentInstance, instance, isConcurrentMode) { 7498 if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) if (instance.nodeType === ELEMENT_NODE) warnForDeletedHydratableElement(parentInstance, instance); 7499 else if (instance.nodeType === COMMENT_NODE); 7500 else warnForDeletedHydratableText(parentInstance, instance); 7501 } 7502 function didNotFindHydratableInstanceWithinContainer(parentContainer, type, props) { 7503 warnForInsertedHydratedElement(parentContainer, type); 7504 } 7505 function didNotFindHydratableTextInstanceWithinContainer(parentContainer, text) { 7506 warnForInsertedHydratedText(parentContainer, text); 7507 } 7508 function didNotFindHydratableInstanceWithinSuspenseInstance(parentInstance, type, props) { 7509 var parentNode = parentInstance.parentNode; 7510 if (parentNode !== null) warnForInsertedHydratedElement(parentNode, type); 7511 } 7512 function didNotFindHydratableTextInstanceWithinSuspenseInstance(parentInstance, text) { 7513 var parentNode = parentInstance.parentNode; 7514 if (parentNode !== null) warnForInsertedHydratedText(parentNode, text); 7515 } 7516 function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props, isConcurrentMode) { 7517 if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) warnForInsertedHydratedElement(parentInstance, type); 7518 } 7519 function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text, isConcurrentMode) { 7520 if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) warnForInsertedHydratedText(parentInstance, text); 7521 } 7522 function errorHydratingContainer(parentContainer) { 7523 error("An error occurred during hydration. The server HTML was replaced with client content in <%s>.", parentContainer.nodeName.toLowerCase()); 7524 } 7525 function preparePortalMount(portalInstance) { 7526 listenToAllSupportedEvents(portalInstance); 7527 } 7528 var randomKey = Math.random().toString(36).slice(2); 7529 var internalInstanceKey = "__reactFiber$" + randomKey; 7530 var internalPropsKey = "__reactProps$" + randomKey; 7531 var internalContainerInstanceKey = "__reactContainer$" + randomKey; 7532 var internalEventHandlersKey = "__reactEvents$" + randomKey; 7533 var internalEventHandlerListenersKey = "__reactListeners$" + randomKey; 7534 var internalEventHandlesSetKey = "__reactHandles$" + randomKey; 7535 function detachDeletedInstance(node) { 7536 delete node[internalInstanceKey]; 7537 delete node[internalPropsKey]; 7538 delete node[internalEventHandlersKey]; 7539 delete node[internalEventHandlerListenersKey]; 7540 delete node[internalEventHandlesSetKey]; 7541 } 7542 function precacheFiberNode(hostInst, node) { 7543 node[internalInstanceKey] = hostInst; 7544 } 7545 function markContainerAsRoot(hostRoot, node) { 7546 node[internalContainerInstanceKey] = hostRoot; 7547 } 7548 function unmarkContainerAsRoot(node) { 7549 node[internalContainerInstanceKey] = null; 7550 } 7551 function isContainerMarkedAsRoot(node) { 7552 return !!node[internalContainerInstanceKey]; 7553 } 7554 function getClosestInstanceFromNode(targetNode) { 7555 var targetInst = targetNode[internalInstanceKey]; 7556 if (targetInst) return targetInst; 7557 var parentNode = targetNode.parentNode; 7558 while (parentNode) { 7559 targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey]; 7560 if (targetInst) { 7561 var alternate = targetInst.alternate; 7562 if (targetInst.child !== null || alternate !== null && alternate.child !== null) { 7563 var suspenseInstance = getParentSuspenseInstance(targetNode); 7564 while (suspenseInstance !== null) { 7565 var targetSuspenseInst = suspenseInstance[internalInstanceKey];
7566 if (targetSuspenseInst) return targetSuspenseInst; 7567 suspenseInstance = getParentSuspenseInstance(suspenseInstance); 7568 } 7569 } 7570 return targetInst; 7571 } 7572 targetNode = parentNode; 7573 parentNode = targetNode.parentNode; 7574 } 7575 return null; 7576 } 7577 /** 7578 * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent 7579 * instance, or null if the node was not rendered by this React. 7580 */ 7581 function getInstanceFromNode(node) { 7582 var inst = node[internalInstanceKey] || node[internalContainerInstanceKey]; 7583 if (inst) if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) return inst; 7584 else return null; 7585 return null; 7586 } 7587 /** 7588 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding 7589 * DOM node. 7590 */ 7591 function getNodeFromInstance(inst) { 7592 if (inst.tag === HostComponent || inst.tag === HostText) return inst.stateNode; 7593 throw new Error("getNodeFromInstance: Invalid argument."); 7594 } 7595 function getFiberCurrentPropsFromNode(node) { 7596 return node[internalPropsKey] || null; 7597 } 7598 function updateFiberProps(node, props) { 7599 node[internalPropsKey] = props; 7600 } 7601 function getEventListenerSet(node) { 7602 var elementListenerSet = node[internalEventHandlersKey]; 7603 if (elementListenerSet === void 0) elementListenerSet = node[internalEventHandlersKey] = /* @__PURE__ */ new Set(); 7604 return elementListenerSet; 7605 } 7606 var loggedTypeFailures = {}; 7607 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; 7608 function setCurrentlyValidatingElement(element) { 7609 if (element) { 7610 var owner = element._owner; 7611 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); 7612 ReactDebugCurrentFrame$1.setExtraStackFrame(stack); 7613 } else ReactDebugCurrentFrame$1.setExtraStackFrame(null); 7614 } 7615 function checkPropTypes(typeSpecs, values, location, componentName, element) { 7616 var has = Function.call.bind(hasOwnProperty); 7617 for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) { 7618 var error$1 = void 0; 7619 try { 7620 if (typeof typeSpecs[typeSpecName] !== "function") { 7621 var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); 7622 err.name = "Invariant Violation"; 7623 throw err; 7624 } 7625 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); 7626 } catch (ex) { 7627 error$1 = ex; 7628 } 7629 if (error$1 && !(error$1 instanceof Error)) { 7630 setCurrentlyValidatingElement(element); 7631 error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1); 7632 setCurrentlyValidatingElement(null); 7633 } 7634 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { 7635 loggedTypeFailures[error$1.message] = true; 7636 setCurrentlyValidatingElement(element); 7637 error("Failed %s type: %s", location, error$1.message); 7638 setCurrentlyValidatingElement(null); 7639 } 7640 } 7641 } 7642 var valueStack = []; 7643 var fiberStack = []; 7644 var index = -1; 7645 function createCursor(defaultValue) { 7646 return { current: defaultValue }; 7647 } 7648 function pop(cursor, fiber) { 7649 if (index < 0) { 7650 error("Unexpected pop."); 7651 return; 7652 } 7653 if (fiber !== fiberStack[index]) error("Unexpected Fiber popped."); 7654 cursor.current = valueStack[index]; 7655 valueStack[index] = null; 7656 fiberStack[index] = null; 7657 index--; 7658 } 7659 function push(cursor, value, fiber) { 7660 index++; 7661 valueStack[index] = cursor.current; 7662 fiberStack[index] = fiber; 7663 cursor.current = value; 7664 } 7665 var warnedAboutMissingGetChildContext = {}; 7666 var emptyContextObject = {}; 7667 Object.freeze(emptyContextObject); 7668 var contextStackCursor = createCursor(emptyContextObject); 7669 var didPerformWorkStackCursor = createCursor(false); 7670 var previousContext = emptyContextObject; 7671 function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) { 7672 if (didPushOwnContextIfProvider && isContextProvider(Component)) return previousContext; 7673 return contextStackCursor.current; 7674 } 7675 function cacheContext(workInProgress, unmaskedContext, maskedContext) { 7676 var instance = workInProgress.stateNode; 7677 instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext; 7678 instance.__reactInternalMemoizedMaskedChildContext = maskedContext; 7679 } 7680 function getMaskedContext(workInProgress, unmaskedContext) { 7681 var contextTypes = workInProgress.type.contextTypes; 7682 if (!contextTypes) return emptyContextObject; 7683 var instance = workInProgress.stateNode; 7684 if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) return instance.__reactInternalMemoizedMaskedChildContext; 7685 var context = {}; 7686 for (var key in contextTypes) context[key] = unmaskedContext[key]; 7687 checkPropTypes(contextTypes, context, "context", getComponentNameFromFiber(workInProgress) || "Unknown"); 7688 if (instance) cacheContext(workInProgress, unmaskedContext, context); 7689 return context; 7690 } 7691 function hasContextChanged() { 7692 return didPerformWorkStackCursor.current; 7693 } 7694 function isContextProvider(type) { 7695 var childContextTypes = type.childContextTypes; 7696 return childContextTypes !== null && childContextTypes !== void 0; 7697 } 7698 function popContext(fiber) { 7699 pop(didPerformWorkStackCursor, fiber); 7700 pop(contextStackCursor, fiber); 7701 } 7702 function popTopLevelContextObject(fiber) { 7703 pop(didPerformWorkStackCursor, fiber); 7704 pop(contextStackCursor, fiber); 7705 } 7706 function pushTopLevelContextObject(fiber, context, didChange) { 7707 if (contextStackCursor.current !== emptyContextObject) throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue."); 7708 push(contextStackCursor, context, fiber); 7709 push(didPerformWorkStackCursor, didChange, fiber); 7710 } 7711 function processChildContext(fiber, type, parentContext) {
7712 var instance = fiber.stateNode; 7713 var childContextTypes = type.childContextTypes; 7714 if (typeof instance.getChildContext !== "function") { 7715 var componentName = getComponentNameFromFiber(fiber) || "Unknown"; 7716 if (!warnedAboutMissingGetChildContext[componentName]) { 7717 warnedAboutMissingGetChildContext[componentName] = true; 7718 error("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", componentName, componentName); 7719 } 7720 return parentContext; 7721 } 7722 var childContext = instance.getChildContext(); 7723 for (var contextKey in childContext) if (!(contextKey in childContextTypes)) throw new Error((getComponentNameFromFiber(fiber) || "Unknown") + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes."); 7724 checkPropTypes(childContextTypes, childContext, "child context", getComponentNameFromFiber(fiber) || "Unknown"); 7725 return assign({}, parentContext, childContext); 7726 } 7727 function pushContextProvider(workInProgress) { 7728 var instance = workInProgress.stateNode; 7729 var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; 7730 previousContext = contextStackCursor.current; 7731 push(contextStackCursor, memoizedMergedChildContext, workInProgress); 7732 push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress); 7733 return true; 7734 }
7735 function invalidateContextProvider(workInProgress, type, didChange) { 7736 var instance = workInProgress.stateNode; 7737 if (!instance) throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue."); 7738 if (didChange) { 7739 var mergedContext = processChildContext(workInProgress, type, previousContext); 7740 instance.__reactInternalMemoizedMergedChildContext = mergedContext; 7741 pop(didPerformWorkStackCursor, workInProgress); 7742 pop(contextStackCursor, workInProgress); 7743 push(contextStackCursor, mergedContext, workInProgress); 7744 push(didPerformWorkStackCursor, didChange, workInProgress); 7745 } else { 7746 pop(didPerformWorkStackCursor, workInProgress); 7747 push(didPerformWorkStackCursor, didChange, workInProgress); 7748 } 7749 } 7750 function findCurrentUnmaskedContext(fiber) { 7751 if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue."); 7752 var node = fiber; 7753 do { 7754 switch (node.tag) { 7755 case HostRoot: return node.stateNode.context; 7756 case ClassComponent: 7757 var Component = node.type; 7758 if (isContextProvider(Component)) return node.stateNode.__reactInternalMemoizedMergedChildContext; 7759 break; 7760 } 7761 node = node.return; 7762 } while (node !== null); 7763 throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue."); 7764 } 7765 var LegacyRoot = 0; 7766 var ConcurrentRoot = 1; 7767 var syncQueue = null; 7768 var includesLegacySyncCallbacks = false; 7769 var isFlushingSyncQueue = false; 7770 function scheduleSyncCallback(callback) { 7771 if (syncQueue === null) syncQueue = [callback]; 7772 else syncQueue.push(callback); 7773 } 7774 function scheduleLegacySyncCallback(callback) { 7775 includesLegacySyncCallbacks = true; 7776 scheduleSyncCallback(callback); 7777 } 7778 function flushSyncCallbacksOnlyInLegacyMode() { 7779 if (includesLegacySyncCallbacks) flushSyncCallbacks(); 7780 } 7781 function flushSyncCallbacks() { 7782 if (!isFlushingSyncQueue && syncQueue !== null) { 7783 isFlushingSyncQueue = true; 7784 var i = 0; 7785 var previousUpdatePriority = getCurrentUpdatePriority(); 7786 try { 7787 var isSync = true; 7788 var queue = syncQueue; 7789 setCurrentUpdatePriority(DiscreteEventPriority); 7790 for (; i < queue.length; i++) { 7791 var callback = queue[i]; 7792 do 7793 callback = callback(isSync); 7794 while (callback !== null); 7795 } 7796 syncQueue = null; 7797 includesLegacySyncCallbacks = false; 7798 } catch (error) { 7799 if (syncQueue !== null) syncQueue = syncQueue.slice(i + 1); 7800 scheduleCallback(ImmediatePriority, flushSyncCallbacks); 7801 throw error; 7802 } finally { 7803 setCurrentUpdatePriority(previousUpdatePriority); 7804 isFlushingSyncQueue = false; 7805 } 7806 } 7807 return null; 7808 } 7809 var forkStack = []; 7810 var forkStackIndex = 0; 7811 var treeForkProvider = null; 7812 var treeForkCount = 0; 7813 var idStack = []; 7814 var idStackIndex = 0; 7815 var treeContextProvider = null; 7816 var treeContextId = 1; 7817 var treeContextOverflow = ""; 7818 function isForkedChild(workInProgress) { 7819 warnIfNotHydrating(); 7820 return (workInProgress.flags & Forked) !== NoFlags; 7821 } 7822 function getForksAtLevel(workInProgress) { 7823 warnIfNotHydrating(); 7824 return treeForkCount; 7825 } 7826 function getTreeId() { 7827 var overflow = treeContextOverflow; 7828 var idWithLeadingBit = treeContextId; 7829 return (idWithLeadingBit & ~getLeadingBit(idWithLeadingBit)).toString(32) + overflow; 7830 } 7831 function pushTreeFork(workInProgress, totalChildren) { 7832 warnIfNotHydrating(); 7833 forkStack[forkStackIndex++] = treeForkCount; 7834 forkStack[forkStackIndex++] = treeForkProvider; 7835 treeForkProvider = workInProgress; 7836 treeForkCount = totalChildren; 7837 } 7838 function pushTreeId(workInProgress, totalChildren, index) { 7839 warnIfNotHydrating(); 7840 idStack[idStackIndex++] = treeContextId; 7841 idStack[idStackIndex++] = treeContextOverflow; 7842 idStack[idStackIndex++] = treeContextProvider; 7843 treeContextProvider = workInProgress; 7844 var baseIdWithLeadingBit = treeContextId; 7845 var baseOverflow = treeContextOverflow; 7846 var baseLength = getBitLength(baseIdWithLeadingBit) - 1; 7847 var baseId = baseIdWithLeadingBit & ~(1 << baseLength); 7848 var slot = index + 1; 7849 var length = getBitLength(totalChildren) + baseLength; 7850 if (length > 30) { 7851 var numberOfOverflowBits = baseLength - baseLength % 5; 7852 var newOverflow = (baseId & (1 << numberOfOverflowBits) - 1).toString(32); 7853 var restOfBaseId = baseId >> numberOfOverflowBits; 7854 var restOfBaseLength = baseLength - numberOfOverflowBits; 7855 var restOfLength = getBitLength(totalChildren) + restOfBaseLength; 7856 var id = slot << restOfBaseLength | restOfBaseId; 7857 var overflow = newOverflow + baseOverflow; 7858 treeContextId = 1 << restOfLength | id; 7859 treeContextOverflow = overflow; 7860 } else { 7861 var _id = slot << baseLength | baseId; 7862 var _overflow = baseOverflow; 7863 treeContextId = 1 << length | _id; 7864 treeContextOverflow = _overflow; 7865 } 7866 } 7867 function pushMaterializedTreeId(workInProgress) { 7868 warnIfNotHydrating(); 7869 if (workInProgress.return !== null) { 7870 var numberOfForks = 1; 7871 var slotIndex = 0; 7872 pushTreeFork(workInProgress, numberOfForks); 7873 pushTreeId(workInProgress, numberOfForks, slotIndex); 7874 } 7875 } 7876 function getBitLength(number) { 7877 return 32 - clz32(number); 7878 } 7879 function getLeadingBit(id) { 7880 return 1 << getBitLength(id) - 1; 7881 } 7882 function popTreeContext(workInProgress) { 7883 while (workInProgress === treeForkProvider) { 7884 treeForkProvider = forkStack[--forkStackIndex]; 7885 forkStack[forkStackIndex] = null; 7886 treeForkCount = forkStack[--forkStackIndex]; 7887 forkStack[forkStackIndex] = null; 7888 } 7889 while (workInProgress === treeContextProvider) { 7890 treeContextProvider = idStack[--idStackIndex]; 7891 idStack[idStackIndex] = null; 7892 treeContextOverflow = idStack[--idStackIndex]; 7893 idStack[idStackIndex] = null; 7894 treeContextId = idStack[--idStackIndex]; 7895 idStack[idStackIndex] = null; 7896 } 7897 } 7898 function getSuspendedTreeContext() { 7899 warnIfNotHydrating(); 7900 if (treeContextProvider !== null) return {
7901 id: treeContextId, 7902 overflow: treeContextOverflow 7903 }; 7904 else return null; 7905 } 7906 function restoreSuspendedTreeContext(workInProgress, suspendedContext) { 7907 warnIfNotHydrating(); 7908 idStack[idStackIndex++] = treeContextId; 7909 idStack[idStackIndex++] = treeContextOverflow; 7910 idStack[idStackIndex++] = treeContextProvider; 7911 treeContextId = suspendedContext.id; 7912 treeContextOverflow = suspendedContext.overflow; 7913 treeContextProvider = workInProgress; 7914 } 7915 function warnIfNotHydrating() { 7916 if (!getIsHydrating()) error("Expected to be hydrating. This is a bug in React. Please file an issue."); 7917 } 7918 var hydrationParentFiber = null; 7919 var nextHydratableInstance = null; 7920 var isHydrating = false; 7921 var didSuspendOrErrorDEV = false; 7922 var hydrationErrors = null; 7923 function warnIfHydrating() { 7924 if (isHydrating) error("We should not be hydrating here. This is a bug in React. Please file a bug."); 7925 } 7926 function markDidThrowWhileHydratingDEV() { 7927 didSuspendOrErrorDEV = true; 7928 } 7929 function didSuspendOrErrorWhileHydratingDEV() { 7930 return didSuspendOrErrorDEV; 7931 } 7932 function enterHydrationState(fiber) { 7933 var parentInstance = fiber.stateNode.containerInfo; 7934 nextHydratableInstance = getFirstHydratableChildWithinContainer(parentInstance); 7935 hydrationParentFiber = fiber; 7936 isHydrating = true; 7937 hydrationErrors = null; 7938 didSuspendOrErrorDEV = false; 7939 return true; 7940 } 7941 function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) { 7942 nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(suspenseInstance); 7943 hydrationParentFiber = fiber; 7944 isHydrating = true; 7945 hydrationErrors = null; 7946 didSuspendOrErrorDEV = false; 7947 if (treeContext !== null) restoreSuspendedTreeContext(fiber, treeContext); 7948 return true; 7949 } 7950 function warnUnhydratedInstance(returnFiber, instance) { 7951 switch (returnFiber.tag) { 7952 case HostRoot: 7953 didNotHydrateInstanceWithinContainer(returnFiber.stateNode.containerInfo, instance); 7954 break; 7955 case HostComponent: 7956 var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode; 7957 didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance, isConcurrentMode); 7958 break; 7959 case SuspenseComponent: 7960 var suspenseState = returnFiber.memoizedState; 7961 if (suspenseState.dehydrated !== null) didNotHydrateInstanceWithinSuspenseInstance(suspenseState.dehydrated, instance); 7962 break; 7963 } 7964 } 7965 function deleteHydratableInstance(returnFiber, instance) { 7966 warnUnhydratedInstance(returnFiber, instance); 7967 var childToDelete = createFiberFromHostInstanceForDeletion(); 7968 childToDelete.stateNode = instance; 7969 childToDelete.return = returnFiber; 7970 var deletions = returnFiber.deletions; 7971 if (deletions === null) { 7972 returnFiber.deletions = [childToDelete]; 7973 returnFiber.flags |= ChildDeletion; 7974 } else deletions.push(childToDelete); 7975 } 7976 function warnNonhydratedInstance(returnFiber, fiber) { 7977 if (didSuspendOrErrorDEV) return; 7978 switch (returnFiber.tag) { 7979 case HostRoot: 7980 var parentContainer = returnFiber.stateNode.containerInfo; 7981 switch (fiber.tag) { 7982 case HostComponent: 7983 var type = fiber.type; 7984 fiber.pendingProps; 7985 didNotFindHydratableInstanceWithinContainer(parentContainer, type); 7986 break; 7987 case HostText: 7988 var text = fiber.pendingProps; 7989 didNotFindHydratableTextInstanceWithinContainer(parentContainer, text); 7990 break; 7991 } 7992 break; 7993 case HostComponent: 7994 var parentType = returnFiber.type; 7995 var parentProps = returnFiber.memoizedProps; 7996 var parentInstance = returnFiber.stateNode; 7997 switch (fiber.tag) { 7998 case HostComponent: 7999 var _type = fiber.type; 8000 var _props = fiber.pendingProps; 8001 didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props, (returnFiber.mode & ConcurrentMode) !== NoMode); 8002 break; 8003 case HostText: 8004 var _text = fiber.pendingProps; 8005 didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text, (returnFiber.mode & ConcurrentMode) !== NoMode); 8006 break; 8007 } 8008 break; 8009 case SuspenseComponent: 8010 var _parentInstance = returnFiber.memoizedState.dehydrated; 8011 if (_parentInstance !== null) switch (fiber.tag) { 8012 case HostComponent: 8013 var _type2 = fiber.type; 8014 fiber.pendingProps; 8015 didNotFindHydratableInstanceWithinSuspenseInstance(_parentInstance, _type2); 8016 break; 8017 case HostText: 8018 var _text2 = fiber.pendingProps; 8019 didNotFindHydratableTextInstanceWithinSuspenseInstance(_parentInstance, _text2); 8020 break; 8021 } 8022 break; 8023 default: return; 8024 } 8025 }
8026 function insertNonHydratedInstance(returnFiber, fiber) { 8027 fiber.flags = fiber.flags & ~Hydrating | Placement; 8028 warnNonhydratedInstance(returnFiber, fiber); 8029 } 8030 function tryHydrate(fiber, nextInstance) { 8031 switch (fiber.tag) { 8032 case HostComponent: 8033 var type = fiber.type; 8034 fiber.pendingProps; 8035 var instance = canHydrateInstance(nextInstance, type); 8036 if (instance !== null) { 8037 fiber.stateNode = instance; 8038 hydrationParentFiber = fiber; 8039 nextHydratableInstance = getFirstHydratableChild(instance); 8040 return true; 8041 } 8042 return false; 8043 case HostText: 8044 var text = fiber.pendingProps; 8045 var textInstance = canHydrateTextInstance(nextInstance, text); 8046 if (textInstance !== null) { 8047 fiber.stateNode = textInstance; 8048 hydrationParentFiber = fiber; 8049 nextHydratableInstance = null; 8050 return true; 8051 } 8052 return false; 8053 case SuspenseComponent: 8054 var suspenseInstance = canHydrateSuspenseInstance(nextInstance); 8055 if (suspenseInstance !== null) { 8056 fiber.memoizedState = { 8057 dehydrated: suspenseInstance, 8058 treeContext: getSuspendedTreeContext(), 8059 retryLane: OffscreenLane 8060 }; 8061 var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance); 8062 dehydratedFragment.return = fiber; 8063 fiber.child = dehydratedFragment; 8064 hydrationParentFiber = fiber; 8065 nextHydratableInstance = null; 8066 return true; 8067 } 8068 return false; 8069 default: return false; 8070 } 8071 } 8072 function shouldClientRenderOnMismatch(fiber) { 8073 return (fiber.mode & ConcurrentMode) !== NoMode && (fiber.flags & DidCapture) === NoFlags; 8074 } 8075 function throwOnHydrationMismatch(fiber) { 8076 throw new Error("Hydration failed because the initial UI does not match what was rendered on the server."); 8077 } 8078 function tryToClaimNextHydratableInstance(fiber) { 8079 if (!isHydrating) return; 8080 var nextInstance = nextHydratableInstance; 8081 if (!nextInstance) { 8082 if (shouldClientRenderOnMismatch(fiber)) { 8083 warnNonhydratedInstance(hydrationParentFiber, fiber); 8084 throwOnHydrationMismatch(); 8085 } 8086 insertNonHydratedInstance(hydrationParentFiber, fiber); 8087 isHydrating = false; 8088 hydrationParentFiber = fiber; 8089 return; 8090 } 8091 var firstAttemptedInstance = nextInstance; 8092 if (!tryHydrate(fiber, nextInstance)) { 8093 if (shouldClientRenderOnMismatch(fiber)) { 8094 warnNonhydratedInstance(hydrationParentFiber, fiber); 8095 throwOnHydrationMismatch(); 8096 } 8097 nextInstance = getNextHydratableSibling(firstAttemptedInstance); 8098 var prevHydrationParentFiber = hydrationParentFiber; 8099 if (!nextInstance || !tryHydrate(fiber, nextInstance)) { 8100 insertNonHydratedInstance(hydrationParentFiber, fiber); 8101 isHydrating = false; 8102 hydrationParentFiber = fiber; 8103 return; 8104 } 8105 deleteHydratableInstance(prevHydrationParentFiber, firstAttemptedInstance); 8106 } 8107 } 8108 function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { 8109 var instance = fiber.stateNode; 8110 var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV; 8111 var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber, shouldWarnIfMismatchDev); 8112 fiber.updateQueue = updatePayload; 8113 if (updatePayload !== null) return true; 8114 return false; 8115 } 8116 function prepareToHydrateHostTextInstance(fiber) { 8117 var textInstance = fiber.stateNode; 8118 var textContent = fiber.memoizedProps; 8119 var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber); 8120 if (shouldUpdate) { 8121 var returnFiber = hydrationParentFiber; 8122 if (returnFiber !== null) switch (returnFiber.tag) { 8123 case HostRoot: 8124 var parentContainer = returnFiber.stateNode.containerInfo; 8125 didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent, (returnFiber.mode & ConcurrentMode) !== NoMode); 8126 break; 8127 case HostComponent: 8128 var parentType = returnFiber.type; 8129 var parentProps = returnFiber.memoizedProps; 8130 var parentInstance = returnFiber.stateNode; 8131 didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent, (returnFiber.mode & ConcurrentMode) !== NoMode); 8132 break; 8133 } 8134 } 8135 return shouldUpdate; 8136 } 8137 function prepareToHydrateHostSuspenseInstance(fiber) { 8138 var suspenseState = fiber.memoizedState; 8139 var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null; 8140 if (!suspenseInstance) throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."); 8141 hydrateSuspenseInstance(suspenseInstance, fiber); 8142 } 8143 function skipPastDehydratedSuspenseInstance(fiber) { 8144 var suspenseState = fiber.memoizedState; 8145 var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null; 8146 if (!suspenseInstance) throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."); 8147 return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance); 8148 } 8149 function popToNextHostParent(fiber) { 8150 var parent = fiber.return; 8151 while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) parent = parent.return; 8152 hydrationParentFiber = parent; 8153 } 8154 function popHydrationState(fiber) { 8155 if (fiber !== hydrationParentFiber) return false;
8156 if (!isHydrating) { 8157 popToNextHostParent(fiber); 8158 isHydrating = true; 8159 return false; 8160 } 8161 if (fiber.tag !== HostRoot && (fiber.tag !== HostComponent || shouldDeleteUnhydratedTailInstances(fiber.type) && !shouldSetTextContent(fiber.type, fiber.memoizedProps))) { 8162 var nextInstance = nextHydratableInstance; 8163 if (nextInstance) if (shouldClientRenderOnMismatch(fiber)) { 8164 warnIfUnhydratedTailNodes(fiber); 8165 throwOnHydrationMismatch(); 8166 } else while (nextInstance) { 8167 deleteHydratableInstance(fiber, nextInstance); 8168 nextInstance = getNextHydratableSibling(nextInstance); 8169 } 8170 } 8171 popToNextHostParent(fiber); 8172 if (fiber.tag === SuspenseComponent) nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber); 8173 else nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null; 8174 return true; 8175 } 8176 function hasUnhydratedTailNodes() { 8177 return isHydrating && nextHydratableInstance !== null; 8178 } 8179 function warnIfUnhydratedTailNodes(fiber) { 8180 var nextInstance = nextHydratableInstance; 8181 while (nextInstance) { 8182 warnUnhydratedInstance(fiber, nextInstance); 8183 nextInstance = getNextHydratableSibling(nextInstance); 8184 } 8185 } 8186 function resetHydrationState() { 8187 hydrationParentFiber = null; 8188 nextHydratableInstance = null; 8189 isHydrating = false; 8190 didSuspendOrErrorDEV = false; 8191 } 8192 function upgradeHydrationErrorsToRecoverable() { 8193 if (hydrationErrors !== null) { 8194 queueRecoverableErrors(hydrationErrors); 8195 hydrationErrors = null; 8196 } 8197 } 8198 function getIsHydrating() { 8199 return isHydrating; 8200 } 8201 function queueHydrationError(error) { 8202 if (hydrationErrors === null) hydrationErrors = [error]; 8203 else hydrationErrors.push(error); 8204 } 8205 var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig; 8206 var NoTransition = null; 8207 function requestCurrentTransition() { 8208 return ReactCurrentBatchConfig$1.transition; 8209 } 8210 var ReactStrictModeWarnings = { 8211 recordUnsafeLifecycleWarnings: function(fiber, instance) {}, 8212 flushPendingUnsafeLifecycleWarnings: function() {}, 8213 recordLegacyContextWarning: function(fiber, instance) {}, 8214 flushLegacyContextWarning: function() {}, 8215 discardPendingWarnings: function() {} 8216 }; 8217 var findStrictRoot = function(fiber) { 8218 var maybeStrictRoot = null; 8219 var node = fiber; 8220 while (node !== null) { 8221 if (node.mode & StrictLegacyMode) maybeStrictRoot = node; 8222 node = node.return; 8223 } 8224 return maybeStrictRoot; 8225 }; 8226 var setToSortedString = function(set) { 8227 var array = []; 8228 set.forEach(function(value) { 8229 array.push(value); 8230 }); 8231 return array.sort().join(", "); 8232 }; 8233 var pendingComponentWillMountWarnings = []; 8234 var pendingUNSAFE_ComponentWillMountWarnings = []; 8235 var pendingComponentWillReceivePropsWarnings = []; 8236 var pendingUNSAFE_ComponentWillReceivePropsWarnings = []; 8237 var pendingComponentWillUpdateWarnings = []; 8238 var pendingUNSAFE_ComponentWillUpdateWarnings = []; 8239 var didWarnAboutUnsafeLifecycles = /* @__PURE__ */ new Set(); 8240 ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function(fiber, instance) { 8241 if (didWarnAboutUnsafeLifecycles.has(fiber.type)) return; 8242 if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) pendingComponentWillMountWarnings.push(fiber); 8243 if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === "function") pendingUNSAFE_ComponentWillMountWarnings.push(fiber); 8244 if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) pendingComponentWillReceivePropsWarnings.push(fiber); 8245 if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber); 8246 if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) pendingComponentWillUpdateWarnings.push(fiber); 8247 if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillUpdate === "function") pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber); 8248 }; 8249 ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function() { 8250 var componentWillMountUniqueNames = /* @__PURE__ */ new Set(); 8251 if (pendingComponentWillMountWarnings.length > 0) {
8252 pendingComponentWillMountWarnings.forEach(function(fiber) { 8253 componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); 8254 didWarnAboutUnsafeLifecycles.add(fiber.type); 8255 }); 8256 pendingComponentWillMountWarnings = []; 8257 } 8258 var UNSAFE_componentWillMountUniqueNames = /* @__PURE__ */ new Set(); 8259 if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) { 8260 pendingUNSAFE_ComponentWillMountWarnings.forEach(function(fiber) { 8261 UNSAFE_componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); 8262 didWarnAboutUnsafeLifecycles.add(fiber.type); 8263 }); 8264 pendingUNSAFE_ComponentWillMountWarnings = []; 8265 } 8266 var componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set(); 8267 if (pendingComponentWillReceivePropsWarnings.length > 0) { 8268 pendingComponentWillReceivePropsWarnings.forEach(function(fiber) { 8269 componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); 8270 didWarnAboutUnsafeLifecycles.add(fiber.type); 8271 }); 8272 pendingComponentWillReceivePropsWarnings = []; 8273 } 8274 var UNSAFE_componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set(); 8275 if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
8276 pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function(fiber) { 8277 UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); 8278 didWarnAboutUnsafeLifecycles.add(fiber.type); 8279 }); 8280 pendingUNSAFE_ComponentWillReceivePropsWarnings = []; 8281 } 8282 var componentWillUpdateUniqueNames = /* @__PURE__ */ new Set(); 8283 if (pendingComponentWillUpdateWarnings.length > 0) { 8284 pendingComponentWillUpdateWarnings.forEach(function(fiber) { 8285 componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); 8286 didWarnAboutUnsafeLifecycles.add(fiber.type); 8287 }); 8288 pendingComponentWillUpdateWarnings = []; 8289 } 8290 var UNSAFE_componentWillUpdateUniqueNames = /* @__PURE__ */ new Set(); 8291 if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) { 8292 pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function(fiber) { 8293 UNSAFE_componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); 8294 didWarnAboutUnsafeLifecycles.add(fiber.type); 8295 }); 8296 pendingUNSAFE_ComponentWillUpdateWarnings = []; 8297 } 8298 if (UNSAFE_componentWillMountUniqueNames.size > 0) error("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s", setToSortedString(UNSAFE_componentWillMountUniqueNames)); 8299 if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) error("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s", setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames)); 8300 if (UNSAFE_componentWillUpdateUniqueNames.size > 0) error("Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s", setToSortedString(UNSAFE_componentWillUpdateUniqueNames)); 8301 if (componentWillMountUniqueNames.size > 0) warn("componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", setToSortedString(componentWillMountUniqueNames)); 8302 if (componentWillReceivePropsUniqueNames.size > 0) warn("componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", setToSortedString(componentWillReceivePropsUniqueNames)); 8303 if (componentWillUpdateUniqueNames.size > 0) warn("componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", setToSortedString(componentWillUpdateUniqueNames)); 8304 };
8305 var pendingLegacyContextWarning = /* @__PURE__ */ new Map(); 8306 var didWarnAboutLegacyContext = /* @__PURE__ */ new Set(); 8307 ReactStrictModeWarnings.recordLegacyContextWarning = function(fiber, instance) { 8308 var strictRoot = findStrictRoot(fiber); 8309 if (strictRoot === null) { 8310 error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."); 8311 return; 8312 } 8313 if (didWarnAboutLegacyContext.has(fiber.type)) return; 8314 var warningsForRoot = pendingLegacyContextWarning.get(strictRoot); 8315 if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === "function") { 8316 if (warningsForRoot === void 0) { 8317 warningsForRoot = []; 8318 pendingLegacyContextWarning.set(strictRoot, warningsForRoot); 8319 } 8320 warningsForRoot.push(fiber); 8321 } 8322 }; 8323 ReactStrictModeWarnings.flushLegacyContextWarning = function() { 8324 pendingLegacyContextWarning.forEach(function(fiberArray, strictRoot) { 8325 if (fiberArray.length === 0) return; 8326 var firstFiber = fiberArray[0]; 8327 var uniqueNames = /* @__PURE__ */ new Set(); 8328 fiberArray.forEach(function(fiber) { 8329 uniqueNames.add(getComponentNameFromFiber(fiber) || "Component"); 8330 didWarnAboutLegacyContext.add(fiber.type); 8331 }); 8332 var sortedNames = setToSortedString(uniqueNames); 8333 try { 8334 setCurrentFiber(firstFiber); 8335 error("Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", sortedNames); 8336 } finally { 8337 resetCurrentFiber(); 8338 } 8339 }); 8340 }; 8341 ReactStrictModeWarnings.discardPendingWarnings = function() { 8342 pendingComponentWillMountWarnings = []; 8343 pendingUNSAFE_ComponentWillMountWarnings = []; 8344 pendingComponentWillReceivePropsWarnings = []; 8345 pendingUNSAFE_ComponentWillReceivePropsWarnings = []; 8346 pendingComponentWillUpdateWarnings = []; 8347 pendingUNSAFE_ComponentWillUpdateWarnings = []; 8348 pendingLegacyContextWarning = /* @__PURE__ */ new Map(); 8349 }; 8350 var didWarnAboutMaps; 8351 var didWarnAboutGenerators; 8352 var didWarnAboutStringRefs; 8353 var ownerHasKeyUseWarning; 8354 var ownerHasFunctionTypeWarning; 8355 var warnForMissingKey = function(child, returnFiber) {}; 8356 didWarnAboutMaps = false; 8357 didWarnAboutGenerators = false; 8358 didWarnAboutStringRefs = {}; 8359 /** 8360 * Warn if there's no key explicitly set on dynamic arrays of children or 8361 * object keys are not valid. This allows us to keep track of children between 8362 * updates. 8363 */ 8364 ownerHasKeyUseWarning = {}; 8365 ownerHasFunctionTypeWarning = {}; 8366 warnForMissingKey = function(child, returnFiber) { 8367 if (child === null || typeof child !== "object") return; 8368 if (!child._store || child._store.validated || child.key != null) return; 8369 if (typeof child._store !== "object") throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue."); 8370 child._store.validated = true; 8371 var componentName = getComponentNameFromFiber(returnFiber) || "Component"; 8372 if (ownerHasKeyUseWarning[componentName]) return; 8373 ownerHasKeyUseWarning[componentName] = true; 8374 error("Each child in a list should have a unique \"key\" prop. See https://reactjs.org/link/warning-keys for more information."); 8375 }; 8376 function isReactClass(type) { 8377 return type.prototype && type.prototype.isReactComponent; 8378 } 8379 function coerceRef(returnFiber, current, element) { 8380 var mixedRef = element.ref; 8381 if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") { 8382 if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && !(element._owner && element._self && element._owner.stateNode !== element._self) && !(element._owner && element._owner.tag !== ClassComponent) && !(typeof element.type === "function" && !isReactClass(element.type)) && element._owner) { 8383 var componentName = getComponentNameFromFiber(returnFiber) || "Component"; 8384 if (!didWarnAboutStringRefs[componentName]) { 8385 error("Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref", componentName, mixedRef); 8386 didWarnAboutStringRefs[componentName] = true; 8387 } 8388 } 8389 if (element._owner) { 8390 var owner = element._owner; 8391 var inst; 8392 if (owner) { 8393 var ownerFiber = owner; 8394 if (ownerFiber.tag !== ClassComponent) throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref"); 8395 inst = ownerFiber.stateNode; 8396 } 8397 if (!inst) throw new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue."); 8398 var resolvedInst = inst; 8399 checkPropStringCoercion(mixedRef, "ref"); 8400 var stringRef = "" + mixedRef; 8401 if (current !== null && current.ref !== null && typeof current.ref === "function" && current.ref._stringRef === stringRef) return current.ref; 8402 var ref = function(value) { 8403 var refs = resolvedInst.refs; 8404 if (value === null) delete refs[stringRef]; 8405 else refs[stringRef] = value; 8406 }; 8407 ref._stringRef = stringRef; 8408 return ref; 8409 } else { 8410 if (typeof mixedRef !== "string") throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null."); 8411 if (!element._owner) throw new Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information."); 8412 } 8413 } 8414 return mixedRef; 8415 }
8416 function throwOnInvalidObjectType(returnFiber, newChild) { 8417 var childString = Object.prototype.toString.call(newChild); 8418 throw new Error("Objects are not valid as a React child (found: " + (childString === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : childString) + "). If you meant to render a collection of children, use an array instead."); 8419 } 8420 function warnOnFunctionType(returnFiber) { 8421 var componentName = getComponentNameFromFiber(returnFiber) || "Component"; 8422 if (ownerHasFunctionTypeWarning[componentName]) return; 8423 ownerHasFunctionTypeWarning[componentName] = true; 8424 error("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it."); 8425 } 8426 function resolveLazy(lazyType) { 8427 var payload = lazyType._payload; 8428 var init = lazyType._init; 8429 return init(payload); 8430 } 8431 function ChildReconciler(shouldTrackSideEffects) { 8432 function deleteChild(returnFiber, childToDelete) { 8433 if (!shouldTrackSideEffects) return; 8434 var deletions = returnFiber.deletions; 8435 if (deletions === null) { 8436 returnFiber.deletions = [childToDelete]; 8437 returnFiber.flags |= ChildDeletion; 8438 } else deletions.push(childToDelete); 8439 } 8440 function deleteRemainingChildren(returnFiber, currentFirstChild) { 8441 if (!shouldTrackSideEffects) return null; 8442 var childToDelete = currentFirstChild; 8443 while (childToDelete !== null) { 8444 deleteChild(returnFiber, childToDelete); 8445 childToDelete = childToDelete.sibling; 8446 } 8447 return null; 8448 } 8449 function mapRemainingChildren(returnFiber, currentFirstChild) { 8450 var existingChildren = /* @__PURE__ */ new Map(); 8451 var existingChild = currentFirstChild; 8452 while (existingChild !== null) { 8453 if (existingChild.key !== null) existingChildren.set(existingChild.key, existingChild); 8454 else existingChildren.set(existingChild.index, existingChild); 8455 existingChild = existingChild.sibling; 8456 } 8457 return existingChildren; 8458 } 8459 function useFiber(fiber, pendingProps) { 8460 var clone = createWorkInProgress(fiber, pendingProps); 8461 clone.index = 0; 8462 clone.sibling = null; 8463 return clone; 8464 } 8465 function placeChild(newFiber, lastPlacedIndex, newIndex) { 8466 newFiber.index = newIndex; 8467 if (!shouldTrackSideEffects) { 8468 newFiber.flags |= Forked; 8469 return lastPlacedIndex; 8470 } 8471 var current = newFiber.alternate; 8472 if (current !== null) { 8473 var oldIndex = current.index; 8474 if (oldIndex < lastPlacedIndex) { 8475 newFiber.flags |= Placement; 8476 return lastPlacedIndex; 8477 } else return oldIndex; 8478 } else { 8479 newFiber.flags |= Placement; 8480 return lastPlacedIndex; 8481 } 8482 } 8483 function placeSingleChild(newFiber) { 8484 if (shouldTrackSideEffects && newFiber.alternate === null) newFiber.flags |= Placement; 8485 return newFiber; 8486 } 8487 function updateTextNode(returnFiber, current, textContent, lanes) { 8488 if (current === null || current.tag !== HostText) { 8489 var created = createFiberFromText(textContent, returnFiber.mode, lanes); 8490 created.return = returnFiber; 8491 return created; 8492 } else { 8493 var existing = useFiber(current, textContent); 8494 existing.return = returnFiber; 8495 return existing; 8496 } 8497 } 8498 function updateElement(returnFiber, current, element, lanes) { 8499 var elementType = element.type; 8500 if (elementType === REACT_FRAGMENT_TYPE) return updateFragment(returnFiber, current, element.props.children, lanes, element.key); 8501 if (current !== null) { 8502 if (current.elementType === elementType || isCompatibleFamilyForHotReloading(current, element) || typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current.type) { 8503 var existing = useFiber(current, element.props); 8504 existing.ref = coerceRef(returnFiber, current, element); 8505 existing.return = returnFiber; 8506 existing._debugSource = element._source; 8507 existing._debugOwner = element._owner; 8508 return existing; 8509 } 8510 } 8511 var created = createFiberFromElement(element, returnFiber.mode, lanes); 8512 created.ref = coerceRef(returnFiber, current, element); 8513 created.return = returnFiber; 8514 return created; 8515 } 8516 function updatePortal(returnFiber, current, portal, lanes) { 8517 if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) { 8518 var created = createFiberFromPortal(portal, returnFiber.mode, lanes); 8519 created.return = returnFiber; 8520 return created; 8521 } else { 8522 var existing = useFiber(current, portal.children || []); 8523 existing.return = returnFiber; 8524 return existing; 8525 } 8526 } 8527 function updateFragment(returnFiber, current, fragment, lanes, key) { 8528 if (current === null || current.tag !== Fragment) { 8529 var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key); 8530 created.return = returnFiber; 8531 return created; 8532 } else { 8533 var existing = useFiber(current, fragment); 8534 existing.return = returnFiber; 8535 return existing; 8536 } 8537 } 8538 function createChild(returnFiber, newChild, lanes) { 8539 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") { 8540 var created = createFiberFromText("" + newChild, returnFiber.mode, lanes); 8541 created.return = returnFiber; 8542 return created; 8543 } 8544 if (typeof newChild === "object" && newChild !== null) { 8545 switch (newChild.$$typeof) { 8546 case REACT_ELEMENT_TYPE: 8547 var _created = createFiberFromElement(newChild, returnFiber.mode, lanes); 8548 _created.ref = coerceRef(returnFiber, null, newChild); 8549 _created.return = returnFiber; 8550 return _created; 8551 case REACT_PORTAL_TYPE: 8552 var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes); 8553 _created2.return = returnFiber; 8554 return _created2; 8555 case REACT_LAZY_TYPE: 8556 var payload = newChild._payload; 8557 var init = newChild._init; 8558 return createChild(returnFiber, init(payload), lanes); 8559 } 8560 if (isArray(newChild) || getIteratorFn(newChild)) { 8561 var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null); 8562 _created3.return = returnFiber; 8563 return _created3; 8564 }
8565 throwOnInvalidObjectType(returnFiber, newChild); 8566 } 8567 if (typeof newChild === "function") warnOnFunctionType(returnFiber); 8568 return null; 8569 } 8570 function updateSlot(returnFiber, oldFiber, newChild, lanes) { 8571 var key = oldFiber !== null ? oldFiber.key : null; 8572 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") { 8573 if (key !== null) return null; 8574 return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); 8575 } 8576 if (typeof newChild === "object" && newChild !== null) { 8577 switch (newChild.$$typeof) { 8578 case REACT_ELEMENT_TYPE: if (newChild.key === key) return updateElement(returnFiber, oldFiber, newChild, lanes); 8579 else return null; 8580 case REACT_PORTAL_TYPE: if (newChild.key === key) return updatePortal(returnFiber, oldFiber, newChild, lanes); 8581 else return null; 8582 case REACT_LAZY_TYPE: 8583 var payload = newChild._payload; 8584 var init = newChild._init; 8585 return updateSlot(returnFiber, oldFiber, init(payload), lanes); 8586 } 8587 if (isArray(newChild) || getIteratorFn(newChild)) { 8588 if (key !== null) return null; 8589 return updateFragment(returnFiber, oldFiber, newChild, lanes, null); 8590 } 8591 throwOnInvalidObjectType(returnFiber, newChild); 8592 } 8593 if (typeof newChild === "function") warnOnFunctionType(returnFiber); 8594 return null; 8595 } 8596 function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) { 8597 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") return updateTextNode(returnFiber, existingChildren.get(newIdx) || null, "" + newChild, lanes); 8598 if (typeof newChild === "object" && newChild !== null) { 8599 switch (newChild.$$typeof) { 8600 case REACT_ELEMENT_TYPE: return updateElement(returnFiber, existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null, newChild, lanes); 8601 case REACT_PORTAL_TYPE: return updatePortal(returnFiber, existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null, newChild, lanes); 8602 case REACT_LAZY_TYPE: 8603 var payload = newChild._payload; 8604 var init = newChild._init; 8605 return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes); 8606 } 8607 if (isArray(newChild) || getIteratorFn(newChild)) return updateFragment(returnFiber, existingChildren.get(newIdx) || null, newChild, lanes, null); 8608 throwOnInvalidObjectType(returnFiber, newChild); 8609 } 8610 if (typeof newChild === "function") warnOnFunctionType(returnFiber); 8611 return null; 8612 } 8613 /** 8614 * Warns if there is a duplicate or missing key 8615 */
8616 function warnOnInvalidKey(child, knownKeys, returnFiber) { 8617 if (typeof child !== "object" || child === null) return knownKeys; 8618 switch (child.$$typeof) { 8619 case REACT_ELEMENT_TYPE: 8620 case REACT_PORTAL_TYPE: 8621 warnForMissingKey(child, returnFiber); 8622 var key = child.key; 8623 if (typeof key !== "string") break; 8624 if (knownKeys === null) { 8625 knownKeys = /* @__PURE__ */ new Set(); 8626 knownKeys.add(key); 8627 break; 8628 } 8629 if (!knownKeys.has(key)) { 8630 knownKeys.add(key); 8631 break; 8632 } 8633 error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.", key); 8634 break; 8635 case REACT_LAZY_TYPE: 8636 var payload = child._payload; 8637 var init = child._init; 8638 warnOnInvalidKey(init(payload), knownKeys, returnFiber); 8639 break; 8640 } 8641 return knownKeys; 8642 } 8643 function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) { 8644 var knownKeys = null; 8645 for (var i = 0; i < newChildren.length; i++) { 8646 var child = newChildren[i];
8647 knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber); 8648 } 8649 var resultingFirstChild = null; 8650 var previousNewFiber = null; 8651 var oldFiber = currentFirstChild; 8652 var lastPlacedIndex = 0; 8653 var newIdx = 0; 8654 var nextOldFiber = null; 8655 for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) { 8656 if (oldFiber.index > newIdx) { 8657 nextOldFiber = oldFiber; 8658 oldFiber = null; 8659 } else nextOldFiber = oldFiber.sibling; 8660 var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes); 8661 if (newFiber === null) { 8662 if (oldFiber === null) oldFiber = nextOldFiber; 8663 break; 8664 } 8665 if (shouldTrackSideEffects) { 8666 if (oldFiber && newFiber.alternate === null) deleteChild(returnFiber, oldFiber); 8667 } 8668 lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); 8669 if (previousNewFiber === null) resultingFirstChild = newFiber; 8670 else previousNewFiber.sibling = newFiber; 8671 previousNewFiber = newFiber; 8672 oldFiber = nextOldFiber; 8673 } 8674 if (newIdx === newChildren.length) { 8675 deleteRemainingChildren(returnFiber, oldFiber); 8676 if (getIsHydrating()) pushTreeFork(returnFiber, newIdx); 8677 return resultingFirstChild; 8678 } 8679 if (oldFiber === null) { 8680 for (; newIdx < newChildren.length; newIdx++) { 8681 var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes); 8682 if (_newFiber === null) continue; 8683 lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx); 8684 if (previousNewFiber === null) resultingFirstChild = _newFiber; 8685 else previousNewFiber.sibling = _newFiber; 8686 previousNewFiber = _newFiber; 8687 } 8688 if (getIsHydrating()) pushTreeFork(returnFiber, newIdx); 8689 return resultingFirstChild; 8690 } 8691 var existingChildren = mapRemainingChildren(returnFiber, oldFiber); 8692 for (; newIdx < newChildren.length; newIdx++) { 8693 var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes); 8694 if (_newFiber2 !== null) { 8695 if (shouldTrackSideEffects) { 8696 if (_newFiber2.alternate !== null) existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key); 8697 } 8698 lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx); 8699 if (previousNewFiber === null) resultingFirstChild = _newFiber2; 8700 else previousNewFiber.sibling = _newFiber2; 8701 previousNewFiber = _newFiber2; 8702 } 8703 } 8704 if (shouldTrackSideEffects) existingChildren.forEach(function(child) { 8705 return deleteChild(returnFiber, child); 8706 }); 8707 if (getIsHydrating()) pushTreeFork(returnFiber, newIdx); 8708 return resultingFirstChild; 8709 } 8710 function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) { 8711 var iteratorFn = getIteratorFn(newChildrenIterable); 8712 if (typeof iteratorFn !== "function") throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."); 8713 if (typeof Symbol === "function" && newChildrenIterable[Symbol.toStringTag] === "Generator") { 8714 if (!didWarnAboutGenerators) error("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."); 8715 didWarnAboutGenerators = true; 8716 } 8717 if (newChildrenIterable.entries === iteratorFn) { 8718 if (!didWarnAboutMaps) error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."); 8719 didWarnAboutMaps = true; 8720 } 8721 var _newChildren = iteratorFn.call(newChildrenIterable); 8722 if (_newChildren) { 8723 var knownKeys = null; 8724 var _step = _newChildren.next(); 8725 for (; !_step.done; _step = _newChildren.next()) { 8726 var child = _step.value;
8727 knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber); 8728 } 8729 } 8730 var newChildren = iteratorFn.call(newChildrenIterable); 8731 if (newChildren == null) throw new Error("An iterable object provided no iterator."); 8732 var resultingFirstChild = null; 8733 var previousNewFiber = null; 8734 var oldFiber = currentFirstChild; 8735 var lastPlacedIndex = 0; 8736 var newIdx = 0; 8737 var nextOldFiber = null; 8738 var step = newChildren.next(); 8739 for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) { 8740 if (oldFiber.index > newIdx) { 8741 nextOldFiber = oldFiber; 8742 oldFiber = null; 8743 } else nextOldFiber = oldFiber.sibling; 8744 var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); 8745 if (newFiber === null) { 8746 if (oldFiber === null) oldFiber = nextOldFiber; 8747 break; 8748 } 8749 if (shouldTrackSideEffects) { 8750 if (oldFiber && newFiber.alternate === null) deleteChild(returnFiber, oldFiber); 8751 } 8752 lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); 8753 if (previousNewFiber === null) resultingFirstChild = newFiber; 8754 else previousNewFiber.sibling = newFiber; 8755 previousNewFiber = newFiber; 8756 oldFiber = nextOldFiber; 8757 } 8758 if (step.done) { 8759 deleteRemainingChildren(returnFiber, oldFiber); 8760 if (getIsHydrating()) pushTreeFork(returnFiber, newIdx); 8761 return resultingFirstChild; 8762 } 8763 if (oldFiber === null) { 8764 for (; !step.done; newIdx++, step = newChildren.next()) { 8765 var _newFiber3 = createChild(returnFiber, step.value, lanes); 8766 if (_newFiber3 === null) continue; 8767 lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx); 8768 if (previousNewFiber === null) resultingFirstChild = _newFiber3; 8769 else previousNewFiber.sibling = _newFiber3; 8770 previousNewFiber = _newFiber3; 8771 } 8772 if (getIsHydrating()) pushTreeFork(returnFiber, newIdx); 8773 return resultingFirstChild; 8774 } 8775 var existingChildren = mapRemainingChildren(returnFiber, oldFiber); 8776 for (; !step.done; newIdx++, step = newChildren.next()) { 8777 var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes); 8778 if (_newFiber4 !== null) { 8779 if (shouldTrackSideEffects) { 8780 if (_newFiber4.alternate !== null) existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key); 8781 } 8782 lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx); 8783 if (previousNewFiber === null) resultingFirstChild = _newFiber4; 8784 else previousNewFiber.sibling = _newFiber4; 8785 previousNewFiber = _newFiber4; 8786 } 8787 } 8788 if (shouldTrackSideEffects) existingChildren.forEach(function(child) { 8789 return deleteChild(returnFiber, child); 8790 }); 8791 if (getIsHydrating()) pushTreeFork(returnFiber, newIdx); 8792 return resultingFirstChild; 8793 } 8794 function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) { 8795 if (currentFirstChild !== null && currentFirstChild.tag === HostText) { 8796 deleteRemainingChildren(returnFiber, currentFirstChild.sibling); 8797 var existing = useFiber(currentFirstChild, textContent); 8798 existing.return = returnFiber; 8799 return existing; 8800 } 8801 deleteRemainingChildren(returnFiber, currentFirstChild); 8802 var created = createFiberFromText(textContent, returnFiber.mode, lanes); 8803 created.return = returnFiber; 8804 return created; 8805 } 8806 function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) { 8807 var key = element.key; 8808 var child = currentFirstChild; 8809 while (child !== null) { 8810 if (child.key === key) { 8811 var elementType = element.type; 8812 if (elementType === REACT_FRAGMENT_TYPE) { 8813 if (child.tag === Fragment) { 8814 deleteRemainingChildren(returnFiber, child.sibling); 8815 var existing = useFiber(child, element.props.children); 8816 existing.return = returnFiber; 8817 existing._debugSource = element._source; 8818 existing._debugOwner = element._owner; 8819 return existing; 8820 } 8821 } else if (child.elementType === elementType || isCompatibleFamilyForHotReloading(child, element) || typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) { 8822 deleteRemainingChildren(returnFiber, child.sibling); 8823 var _existing = useFiber(child, element.props); 8824 _existing.ref = coerceRef(returnFiber, child, element); 8825 _existing.return = returnFiber; 8826 _existing._debugSource = element._source; 8827 _existing._debugOwner = element._owner; 8828 return _existing; 8829 } 8830 deleteRemainingChildren(returnFiber, child); 8831 break; 8832 } else deleteChild(returnFiber, child); 8833 child = child.sibling; 8834 } 8835 if (element.type === REACT_FRAGMENT_TYPE) { 8836 var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key); 8837 created.return = returnFiber; 8838 return created; 8839 } else { 8840 var _created4 = createFiberFromElement(element, returnFiber.mode, lanes); 8841 _created4.ref = coerceRef(returnFiber, currentFirstChild, element); 8842 _created4.return = returnFiber; 8843 return _created4; 8844 } 8845 } 8846 function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) { 8847 var key = portal.key; 8848 var child = currentFirstChild; 8849 while (child !== null) { 8850 if (child.key === key) if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { 8851 deleteRemainingChildren(returnFiber, child.sibling); 8852 var existing = useFiber(child, portal.children || []); 8853 existing.return = returnFiber; 8854 return existing; 8855 } else { 8856 deleteRemainingChildren(returnFiber, child); 8857 break; 8858 } 8859 else deleteChild(returnFiber, child); 8860 child = child.sibling; 8861 } 8862 var created = createFiberFromPortal(portal, returnFiber.mode, lanes); 8863 created.return = returnFiber; 8864 return created; 8865 } 8866 function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) { 8867 if (typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) newChild = newChild.props.children; 8868 if (typeof newChild === "object" && newChild !== null) { 8869 switch (newChild.$$typeof) { 8870 case REACT_ELEMENT_TYPE: return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes)); 8871 case REACT_PORTAL_TYPE: return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes)); 8872 case REACT_LAZY_TYPE: 8873 var payload = newChild._payload; 8874 var init = newChild._init; 8875 return reconcileChildFibers(returnFiber, currentFirstChild, init(payload), lanes); 8876 } 8877 if (isArray(newChild)) return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes); 8878 if (getIteratorFn(newChild)) return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
8879 throwOnInvalidObjectType(returnFiber, newChild); 8880 } 8881 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes)); 8882 if (typeof newChild === "function") warnOnFunctionType(returnFiber); 8883 return deleteRemainingChildren(returnFiber, currentFirstChild); 8884 } 8885 return reconcileChildFibers; 8886 } 8887 var reconcileChildFibers = ChildReconciler(true); 8888 var mountChildFibers = ChildReconciler(false); 8889 function cloneChildFibers(current, workInProgress) { 8890 if (current !== null && workInProgress.child !== current.child) throw new Error("Resuming work not yet implemented."); 8891 if (workInProgress.child === null) return; 8892 var currentChild = workInProgress.child; 8893 var newChild = createWorkInProgress(currentChild, currentChild.pendingProps); 8894 workInProgress.child = newChild; 8895 newChild.return = workInProgress; 8896 while (currentChild.sibling !== null) { 8897 currentChild = currentChild.sibling; 8898 newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps); 8899 newChild.return = workInProgress; 8900 } 8901 newChild.sibling = null; 8902 } 8903 function resetChildFibers(workInProgress, lanes) { 8904 var child = workInProgress.child; 8905 while (child !== null) { 8906 resetWorkInProgress(child, lanes); 8907 child = child.sibling; 8908 } 8909 } 8910 var valueCursor = createCursor(null); 8911 var rendererSigil = {}; 8912 var currentlyRenderingFiber = null; 8913 var lastContextDependency = null; 8914 var lastFullyObservedContext = null; 8915 var isDisallowedContextReadInDEV = false; 8916 function resetContextDependencies() { 8917 currentlyRenderingFiber = null; 8918 lastContextDependency = null; 8919 lastFullyObservedContext = null; 8920 isDisallowedContextReadInDEV = false; 8921 } 8922 function enterDisallowedContextReadInDEV() { 8923 isDisallowedContextReadInDEV = true; 8924 } 8925 function exitDisallowedContextReadInDEV() { 8926 isDisallowedContextReadInDEV = false; 8927 } 8928 function pushProvider(providerFiber, context, nextValue) { 8929 push(valueCursor, context._currentValue, providerFiber); 8930 context._currentValue = nextValue; 8931 if (context._currentRenderer !== void 0 && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."); 8932 context._currentRenderer = rendererSigil; 8933 } 8934 function popProvider(context, providerFiber) { 8935 var currentValue = valueCursor.current; 8936 pop(valueCursor, providerFiber); 8937 context._currentValue = currentValue; 8938 } 8939 function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { 8940 var node = parent; 8941 while (node !== null) { 8942 var alternate = node.alternate; 8943 if (!isSubsetOfLanes(node.childLanes, renderLanes)) { 8944 node.childLanes = mergeLanes(node.childLanes, renderLanes); 8945 if (alternate !== null) alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes); 8946 } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes)) alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes); 8947 if (node === propagationRoot) break; 8948 node = node.return; 8949 } 8950 if (node !== propagationRoot) error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue."); 8951 } 8952 function propagateContextChange(workInProgress, context, renderLanes) { 8953 propagateContextChange_eager(workInProgress, context, renderLanes); 8954 } 8955 function propagateContextChange_eager(workInProgress, context, renderLanes) { 8956 var fiber = workInProgress.child; 8957 if (fiber !== null) fiber.return = workInProgress; 8958 while (fiber !== null) { 8959 var nextFiber = void 0; 8960 var list = fiber.dependencies; 8961 if (list !== null) { 8962 nextFiber = fiber.child; 8963 var dependency = list.firstContext; 8964 while (dependency !== null) { 8965 if (dependency.context === context) { 8966 if (fiber.tag === ClassComponent) { 8967 var update = createUpdate(NoTimestamp, pickArbitraryLane(renderLanes)); 8968 update.tag = ForceUpdate; 8969 var updateQueue = fiber.updateQueue; 8970 if (updateQueue === null); 8971 else { 8972 var sharedQueue = updateQueue.shared; 8973 var pending = sharedQueue.pending; 8974 if (pending === null) update.next = update; 8975 else { 8976 update.next = pending.next; 8977 pending.next = update; 8978 } 8979 sharedQueue.pending = update; 8980 } 8981 } 8982 fiber.lanes = mergeLanes(fiber.lanes, renderLanes); 8983 var alternate = fiber.alternate; 8984 if (alternate !== null) alternate.lanes = mergeLanes(alternate.lanes, renderLanes); 8985 scheduleContextWorkOnParentPath(fiber.return, renderLanes, workInProgress); 8986 list.lanes = mergeLanes(list.lanes, renderLanes); 8987 break; 8988 }
8989 dependency = dependency.next; 8990 } 8991 } else if (fiber.tag === ContextProvider) nextFiber = fiber.type === workInProgress.type ? null : fiber.child; 8992 else if (fiber.tag === DehydratedFragment) { 8993 var parentSuspense = fiber.return; 8994 if (parentSuspense === null) throw new Error("We just came from a parent so we must have had a parent. This is a bug in React."); 8995 parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes); 8996 var _alternate = parentSuspense.alternate; 8997 if (_alternate !== null) _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes); 8998 scheduleContextWorkOnParentPath(parentSuspense, renderLanes, workInProgress); 8999 nextFiber = fiber.sibling; 9000 } else nextFiber = fiber.child; 9001 if (nextFiber !== null) nextFiber.return = fiber; 9002 else { 9003 nextFiber = fiber; 9004 while (nextFiber !== null) { 9005 if (nextFiber === workInProgress) { 9006 nextFiber = null; 9007 break; 9008 } 9009 var sibling = nextFiber.sibling; 9010 if (sibling !== null) { 9011 sibling.return = nextFiber.return; 9012 nextFiber = sibling; 9013 break; 9014 } 9015 nextFiber = nextFiber.return; 9016 } 9017 } 9018 fiber = nextFiber; 9019 } 9020 } 9021 function prepareToReadContext(workInProgress, renderLanes) { 9022 currentlyRenderingFiber = workInProgress; 9023 lastContextDependency = null; 9024 lastFullyObservedContext = null; 9025 var dependencies = workInProgress.dependencies; 9026 if (dependencies !== null) { 9027 if (dependencies.firstContext !== null) { 9028 if (includesSomeLane(dependencies.lanes, renderLanes)) markWorkInProgressReceivedUpdate(); 9029 dependencies.firstContext = null; 9030 } 9031 } 9032 } 9033 function readContext(context) { 9034 if (isDisallowedContextReadInDEV) error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."); 9035 var value = context._currentValue; 9036 if (lastFullyObservedContext === context); 9037 else { 9038 var contextItem = { 9039 context, 9040 memoizedValue: value, 9041 next: null 9042 }; 9043 if (lastContextDependency === null) { 9044 if (currentlyRenderingFiber === null) throw new Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."); 9045 lastContextDependency = contextItem; 9046 currentlyRenderingFiber.dependencies = { 9047 lanes: NoLanes, 9048 firstContext: contextItem 9049 }; 9050 } else lastContextDependency = lastContextDependency.next = contextItem; 9051 } 9052 return value; 9053 } 9054 var concurrentQueues = null; 9055 function pushConcurrentUpdateQueue(queue) { 9056 if (concurrentQueues === null) concurrentQueues = [queue]; 9057 else concurrentQueues.push(queue); 9058 } 9059 function finishQueueingConcurrentUpdates() { 9060 if (concurrentQueues !== null) { 9061 for (var i = 0; i < concurrentQueues.length; i++) { 9062 var queue = concurrentQueues[i]; 9063 var lastInterleavedUpdate = queue.interleaved; 9064 if (lastInterleavedUpdate !== null) { 9065 queue.interleaved = null; 9066 var firstInterleavedUpdate = lastInterleavedUpdate.next; 9067 var lastPendingUpdate = queue.pending; 9068 if (lastPendingUpdate !== null) { 9069 var firstPendingUpdate = lastPendingUpdate.next; 9070 lastPendingUpdate.next = firstInterleavedUpdate; 9071 lastInterleavedUpdate.next = firstPendingUpdate; 9072 } 9073 queue.pending = lastInterleavedUpdate; 9074 } 9075 } 9076 concurrentQueues = null; 9077 } 9078 } 9079 function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { 9080 var interleaved = queue.interleaved; 9081 if (interleaved === null) { 9082 update.next = update; 9083 pushConcurrentUpdateQueue(queue); 9084 } else { 9085 update.next = interleaved.next; 9086 interleaved.next = update; 9087 } 9088 queue.interleaved = update; 9089 return markUpdateLaneFromFiberToRoot(fiber, lane); 9090 }
9091 function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) { 9092 var interleaved = queue.interleaved; 9093 if (interleaved === null) { 9094 update.next = update; 9095 pushConcurrentUpdateQueue(queue); 9096 } else { 9097 update.next = interleaved.next; 9098 interleaved.next = update; 9099 } 9100 queue.interleaved = update; 9101 } 9102 function enqueueConcurrentClassUpdate(fiber, queue, update, lane) { 9103 var interleaved = queue.interleaved; 9104 if (interleaved === null) { 9105 update.next = update; 9106 pushConcurrentUpdateQueue(queue); 9107 } else { 9108 update.next = interleaved.next; 9109 interleaved.next = update; 9110 } 9111 queue.interleaved = update; 9112 return markUpdateLaneFromFiberToRoot(fiber, lane); 9113 } 9114 function enqueueConcurrentRenderForLane(fiber, lane) { 9115 return markUpdateLaneFromFiberToRoot(fiber, lane); 9116 } 9117 var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot; 9118 function markUpdateLaneFromFiberToRoot(sourceFiber, lane) { 9119 sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane); 9120 var alternate = sourceFiber.alternate; 9121 if (alternate !== null) alternate.lanes = mergeLanes(alternate.lanes, lane); 9122 if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); 9123 var node = sourceFiber; 9124 var parent = sourceFiber.return; 9125 while (parent !== null) { 9126 parent.childLanes = mergeLanes(parent.childLanes, lane); 9127 alternate = parent.alternate; 9128 if (alternate !== null) alternate.childLanes = mergeLanes(alternate.childLanes, lane); 9129 else if ((parent.flags & (Placement | Hydrating)) !== NoFlags) warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); 9130 node = parent; 9131 parent = parent.return; 9132 } 9133 if (node.tag === HostRoot) return node.stateNode; 9134 else return null; 9135 } 9136 var UpdateState = 0; 9137 var ReplaceState = 1; 9138 var ForceUpdate = 2; 9139 var CaptureUpdate = 3; 9140 var hasForceUpdate = false; 9141 var didWarnUpdateInsideUpdate; 9142 var currentlyProcessingQueue; 9143 didWarnUpdateInsideUpdate = false; 9144 currentlyProcessingQueue = null; 9145 function initializeUpdateQueue(fiber) { 9146 fiber.updateQueue = { 9147 baseState: fiber.memoizedState, 9148 firstBaseUpdate: null, 9149 lastBaseUpdate: null, 9150 shared: { 9151 pending: null, 9152 interleaved: null, 9153 lanes: NoLanes 9154 }, 9155 effects: null 9156 }; 9157 } 9158 function cloneUpdateQueue(current, workInProgress) { 9159 var queue = workInProgress.updateQueue; 9160 var currentQueue = current.updateQueue; 9161 if (queue === currentQueue) workInProgress.updateQueue = { 9162 baseState: currentQueue.baseState, 9163 firstBaseUpdate: currentQueue.firstBaseUpdate, 9164 lastBaseUpdate: currentQueue.lastBaseUpdate, 9165 shared: currentQueue.shared, 9166 effects: currentQueue.effects 9167 }; 9168 } 9169 function createUpdate(eventTime, lane) { 9170 return { 9171 eventTime, 9172 lane, 9173 tag: UpdateState, 9174 payload: null, 9175 callback: null, 9176 next: null 9177 }; 9178 } 9179 function enqueueUpdate(fiber, update, lane) { 9180 var updateQueue = fiber.updateQueue; 9181 if (updateQueue === null) return null; 9182 var sharedQueue = updateQueue.shared; 9183 if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) { 9184 error("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."); 9185 didWarnUpdateInsideUpdate = true; 9186 } 9187 if (isUnsafeClassRenderPhaseUpdate()) { 9188 var pending = sharedQueue.pending; 9189 if (pending === null) update.next = update; 9190 else { 9191 update.next = pending.next; 9192 pending.next = update; 9193 } 9194 sharedQueue.pending = update; 9195 return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane); 9196 } else return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane); 9197 } 9198 function entangleTransitions(root, fiber, lane) { 9199 var updateQueue = fiber.updateQueue; 9200 if (updateQueue === null) return; 9201 var sharedQueue = updateQueue.shared; 9202 if (isTransitionLane(lane)) { 9203 var queueLanes = sharedQueue.lanes; 9204 queueLanes = intersectLanes(queueLanes, root.pendingLanes); 9205 var newQueueLanes = mergeLanes(queueLanes, lane); 9206 sharedQueue.lanes = newQueueLanes; 9207 markRootEntangled(root, newQueueLanes); 9208 } 9209 } 9210 function enqueueCapturedUpdate(workInProgress, capturedUpdate) { 9211 var queue = workInProgress.updateQueue; 9212 var current = workInProgress.alternate; 9213 if (current !== null) { 9214 var currentQueue = current.updateQueue; 9215 if (queue === currentQueue) { 9216 var newFirst = null; 9217 var newLast = null; 9218 var firstBaseUpdate = queue.firstBaseUpdate; 9219 if (firstBaseUpdate !== null) { 9220 var update = firstBaseUpdate; 9221 do { 9222 var clone = { 9223 eventTime: update.eventTime, 9224 lane: update.lane, 9225 tag: update.tag, 9226 payload: update.payload, 9227 callback: update.callback, 9228 next: null 9229 }; 9230 if (newLast === null) newFirst = newLast = clone; 9231 else { 9232 newLast.next = clone; 9233 newLast = clone; 9234 } 9235 update = update.next; 9236 } while (update !== null); 9237 if (newLast === null) newFirst = newLast = capturedUpdate; 9238 else { 9239 newLast.next = capturedUpdate; 9240 newLast = capturedUpdate; 9241 } 9242 } else newFirst = newLast = capturedUpdate; 9243 queue = { 9244 baseState: currentQueue.baseState, 9245 firstBaseUpdate: newFirst, 9246 lastBaseUpdate: newLast, 9247 shared: currentQueue.shared, 9248 effects: currentQueue.effects 9249 }; 9250 workInProgress.updateQueue = queue; 9251 return; 9252 } 9253 } 9254 var lastBaseUpdate = queue.lastBaseUpdate; 9255 if (lastBaseUpdate === null) queue.firstBaseUpdate = capturedUpdate; 9256 else lastBaseUpdate.next = capturedUpdate; 9257 queue.lastBaseUpdate = capturedUpdate; 9258 } 9259 function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) { 9260 switch (update.tag) { 9261 case ReplaceState: 9262 var payload = update.payload; 9263 if (typeof payload === "function") { 9264 enterDisallowedContextReadInDEV(); 9265 var nextState = payload.call(instance, prevState, nextProps); 9266 if (workInProgress.mode & StrictLegacyMode) { 9267 setIsStrictModeForDevtools(true); 9268 try { 9269 payload.call(instance, prevState, nextProps); 9270 } finally { 9271 setIsStrictModeForDevtools(false); 9272 } 9273 } 9274 exitDisallowedContextReadInDEV(); 9275 return nextState; 9276 } 9277 return payload; 9278 case CaptureUpdate: workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture; 9279 case UpdateState: 9280 var _payload = update.payload; 9281 var partialState; 9282 if (typeof _payload === "function") { 9283 enterDisallowedContextReadInDEV(); 9284 partialState = _payload.call(instance, prevState, nextProps); 9285 if (workInProgress.mode & StrictLegacyMode) { 9286 setIsStrictModeForDevtools(true); 9287 try { 9288 _payload.call(instance, prevState, nextProps); 9289 } finally { 9290 setIsStrictModeForDevtools(false); 9291 } 9292 } 9293 exitDisallowedContextReadInDEV(); 9294 } else partialState = _payload; 9295 if (partialState === null || partialState === void 0) return prevState; 9296 return assign({}, prevState, partialState); 9297 case ForceUpdate: 9298 hasForceUpdate = true; 9299 return prevState; 9300 } 9301 return prevState; 9302 } 9303 function processUpdateQueue(workInProgress, props, instance, renderLanes) { 9304 var queue = workInProgress.updateQueue; 9305 hasForceUpdate = false;
9306 currentlyProcessingQueue = queue.shared; 9307 var firstBaseUpdate = queue.firstBaseUpdate; 9308 var lastBaseUpdate = queue.lastBaseUpdate; 9309 var pendingQueue = queue.shared.pending; 9310 if (pendingQueue !== null) { 9311 queue.shared.pending = null; 9312 var lastPendingUpdate = pendingQueue; 9313 var firstPendingUpdate = lastPendingUpdate.next; 9314 lastPendingUpdate.next = null; 9315 if (lastBaseUpdate === null) firstBaseUpdate = firstPendingUpdate; 9316 else lastBaseUpdate.next = firstPendingUpdate; 9317 lastBaseUpdate = lastPendingUpdate; 9318 var current = workInProgress.alternate; 9319 if (current !== null) { 9320 var currentQueue = current.updateQueue; 9321 var currentLastBaseUpdate = currentQueue.lastBaseUpdate; 9322 if (currentLastBaseUpdate !== lastBaseUpdate) { 9323 if (currentLastBaseUpdate === null) currentQueue.firstBaseUpdate = firstPendingUpdate; 9324 else currentLastBaseUpdate.next = firstPendingUpdate; 9325 currentQueue.lastBaseUpdate = lastPendingUpdate; 9326 } 9327 } 9328 } 9329 if (firstBaseUpdate !== null) { 9330 var newState = queue.baseState; 9331 var newLanes = NoLanes; 9332 var newBaseState = null; 9333 var newFirstBaseUpdate = null; 9334 var newLastBaseUpdate = null; 9335 var update = firstBaseUpdate; 9336 do { 9337 var updateLane = update.lane; 9338 var updateEventTime = update.eventTime; 9339 if (!isSubsetOfLanes(renderLanes, updateLane)) { 9340 var clone = { 9341 eventTime: updateEventTime, 9342 lane: updateLane, 9343 tag: update.tag, 9344 payload: update.payload, 9345 callback: update.callback, 9346 next: null 9347 }; 9348 if (newLastBaseUpdate === null) { 9349 newFirstBaseUpdate = newLastBaseUpdate = clone; 9350 newBaseState = newState; 9351 } else newLastBaseUpdate = newLastBaseUpdate.next = clone; 9352 newLanes = mergeLanes(newLanes, updateLane); 9353 } else { 9354 if (newLastBaseUpdate !== null) { 9355 var _clone = { 9356 eventTime: updateEventTime, 9357 lane: NoLane, 9358 tag: update.tag, 9359 payload: update.payload, 9360 callback: update.callback, 9361 next: null 9362 }; 9363 newLastBaseUpdate = newLastBaseUpdate.next = _clone; 9364 } 9365 newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance); 9366 if (update.callback !== null && update.lane !== NoLane) { 9367 workInProgress.flags |= Callback; 9368 var effects = queue.effects; 9369 if (effects === null) queue.effects = [update]; 9370 else effects.push(update); 9371 } 9372 } 9373 update = update.next; 9374 if (update === null) { 9375 pendingQueue = queue.shared.pending; 9376 if (pendingQueue === null) break; 9377 else { 9378 var _lastPendingUpdate = pendingQueue; 9379 var _firstPendingUpdate = _lastPendingUpdate.next; 9380 _lastPendingUpdate.next = null; 9381 update = _firstPendingUpdate; 9382 queue.lastBaseUpdate = _lastPendingUpdate; 9383 queue.shared.pending = null; 9384 } 9385 } 9386 } while (true); 9387 if (newLastBaseUpdate === null) newBaseState = newState; 9388 queue.baseState = newBaseState; 9389 queue.firstBaseUpdate = newFirstBaseUpdate; 9390 queue.lastBaseUpdate = newLastBaseUpdate; 9391 var lastInterleaved = queue.shared.interleaved; 9392 if (lastInterleaved !== null) { 9393 var interleaved = lastInterleaved; 9394 do { 9395 newLanes = mergeLanes(newLanes, interleaved.lane); 9396 interleaved = interleaved.next; 9397 } while (interleaved !== lastInterleaved); 9398 } else if (firstBaseUpdate === null) queue.shared.lanes = NoLanes; 9399 markSkippedUpdateLanes(newLanes); 9400 workInProgress.lanes = newLanes; 9401 workInProgress.memoizedState = newState; 9402 } 9403 currentlyProcessingQueue = null; 9404 } 9405 function callCallback(callback, context) { 9406 if (typeof callback !== "function") throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + callback)); 9407 callback.call(context); 9408 } 9409 function resetHasForceUpdateBeforeProcessing() { 9410 hasForceUpdate = false; 9411 } 9412 function checkHasForceUpdateAfterProcessing() { 9413 return hasForceUpdate; 9414 } 9415 function commitUpdateQueue(finishedWork, finishedQueue, instance) { 9416 var effects = finishedQueue.effects; 9417 finishedQueue.effects = null; 9418 if (effects !== null) for (var i = 0; i < effects.length; i++) { 9419 var effect = effects[i]; 9420 var callback = effect.callback; 9421 if (callback !== null) { 9422 effect.callback = null; 9423 callCallback(callback, instance); 9424 } 9425 } 9426 } 9427 var NO_CONTEXT = {}; 9428 var contextStackCursor$1 = createCursor(NO_CONTEXT); 9429 var contextFiberStackCursor = createCursor(NO_CONTEXT); 9430 var rootInstanceStackCursor = createCursor(NO_CONTEXT); 9431 function requiredContext(c) { 9432 if (c === NO_CONTEXT) throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."); 9433 return c; 9434 } 9435 function getRootHostContainer() { 9436 return requiredContext(rootInstanceStackCursor.current); 9437 } 9438 function pushHostContainer(fiber, nextRootInstance) { 9439 push(rootInstanceStackCursor, nextRootInstance, fiber); 9440 push(contextFiberStackCursor, fiber, fiber); 9441 push(contextStackCursor$1, NO_CONTEXT, fiber); 9442 var nextRootContext = getRootHostContext(nextRootInstance); 9443 pop(contextStackCursor$1, fiber); 9444 push(contextStackCursor$1, nextRootContext, fiber); 9445 } 9446 function popHostContainer(fiber) { 9447 pop(contextStackCursor$1, fiber); 9448 pop(contextFiberStackCursor, fiber); 9449 pop(rootInstanceStackCursor, fiber); 9450 } 9451 function getHostContext() { 9452 return requiredContext(contextStackCursor$1.current); 9453 } 9454 function pushHostContext(fiber) { 9455 requiredContext(rootInstanceStackCursor.current); 9456 var context = requiredContext(contextStackCursor$1.current); 9457 var nextContext = getChildHostContext(context, fiber.type); 9458 if (context === nextContext) return; 9459 push(contextFiberStackCursor, fiber, fiber); 9460 push(contextStackCursor$1, nextContext, fiber); 9461 } 9462 function popHostContext(fiber) { 9463 if (contextFiberStackCursor.current !== fiber) return; 9464 pop(contextStackCursor$1, fiber); 9465 pop(contextFiberStackCursor, fiber); 9466 } 9467 var DefaultSuspenseContext = 0; 9468 var SubtreeSuspenseContextMask = 1; 9469 var InvisibleParentSuspenseContext = 1; 9470 var ForceSuspenseFallback = 2; 9471 var suspenseStackCursor = createCursor(DefaultSuspenseContext); 9472 function hasSuspenseContext(parentContext, flag) { 9473 return (parentContext & flag) !== 0; 9474 } 9475 function setDefaultShallowSuspenseContext(parentContext) { 9476 return parentContext & SubtreeSuspenseContextMask; 9477 } 9478 function setShallowSuspenseContext(parentContext, shallowContext) { 9479 return parentContext & SubtreeSuspenseContextMask | shallowContext; 9480 }
9481 function addSubtreeSuspenseContext(parentContext, subtreeContext) { 9482 return parentContext | subtreeContext; 9483 } 9484 function pushSuspenseContext(fiber, newContext) { 9485 push(suspenseStackCursor, newContext, fiber); 9486 } 9487 function popSuspenseContext(fiber) { 9488 pop(suspenseStackCursor, fiber); 9489 } 9490 function shouldCaptureSuspense(workInProgress, hasInvisibleParent) { 9491 var nextState = workInProgress.memoizedState; 9492 if (nextState !== null) { 9493 if (nextState.dehydrated !== null) return true; 9494 return false; 9495 } 9496 workInProgress.memoizedProps; 9497 return true; 9498 } 9499 function findFirstSuspended(row) { 9500 var node = row; 9501 while (node !== null) { 9502 if (node.tag === SuspenseComponent) { 9503 var state = node.memoizedState; 9504 if (state !== null) { 9505 var dehydrated = state.dehydrated; 9506 if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) return node; 9507 } 9508 } else if (node.tag === SuspenseListComponent && node.memoizedProps.revealOrder !== void 0) { 9509 if ((node.flags & DidCapture) !== NoFlags) return node; 9510 } else if (node.child !== null) { 9511 node.child.return = node; 9512 node = node.child; 9513 continue; 9514 } 9515 if (node === row) return null; 9516 while (node.sibling === null) { 9517 if (node.return === null || node.return === row) return null; 9518 node = node.return; 9519 } 9520 node.sibling.return = node.return; 9521 node = node.sibling; 9522 } 9523 return null; 9524 } 9525 var NoFlags$1 = 0; 9526 var HasEffect = 1; 9527 var Insertion = 2; 9528 var Layout = 4; 9529 var Passive$1 = 8; 9530 var workInProgressSources = []; 9531 function resetWorkInProgressVersions() { 9532 for (var i = 0; i < workInProgressSources.length; i++) { 9533 var mutableSource = workInProgressSources[i]; 9534 mutableSource._workInProgressVersionPrimary = null; 9535 } 9536 workInProgressSources.length = 0; 9537 } 9538 function registerMutableSourceForHydration(root, mutableSource) { 9539 var getVersion = mutableSource._getVersion; 9540 var version = getVersion(mutableSource._source); 9541 if (root.mutableSourceEagerHydrationData == null) root.mutableSourceEagerHydrationData = [mutableSource, version]; 9542 else root.mutableSourceEagerHydrationData.push(mutableSource, version); 9543 } 9544 var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig; 9545 var didWarnAboutMismatchedHooksForComponent; 9546 var didWarnUncachedGetSnapshot; 9547 didWarnAboutMismatchedHooksForComponent = /* @__PURE__ */ new Set(); 9548 var renderLanes = NoLanes; 9549 var currentlyRenderingFiber$1 = null; 9550 var currentHook = null; 9551 var workInProgressHook = null; 9552 var didScheduleRenderPhaseUpdate = false; 9553 var didScheduleRenderPhaseUpdateDuringThisPass = false; 9554 var localIdCounter = 0; 9555 var globalClientIdCounter = 0; 9556 var RE_RENDER_LIMIT = 25; 9557 var currentHookNameInDev = null; 9558 var hookTypesDev = null; 9559 var hookTypesUpdateIndexDev = -1; 9560 var ignorePreviousDependencies = false; 9561 function mountHookTypesDev() { 9562 var hookName = currentHookNameInDev; 9563 if (hookTypesDev === null) hookTypesDev = [hookName]; 9564 else hookTypesDev.push(hookName); 9565 } 9566 function updateHookTypesDev() { 9567 var hookName = currentHookNameInDev; 9568 if (hookTypesDev !== null) { 9569 hookTypesUpdateIndexDev++; 9570 if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) warnOnHookMismatchInDev(hookName); 9571 } 9572 } 9573 function checkDepsAreArrayDev(deps) { 9574 if (deps !== void 0 && deps !== null && !isArray(deps)) error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", currentHookNameInDev, typeof deps); 9575 } 9576 function warnOnHookMismatchInDev(currentHookName) { 9577 var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); 9578 if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) { 9579 didWarnAboutMismatchedHooksForComponent.add(componentName); 9580 if (hookTypesDev !== null) { 9581 var table = ""; 9582 var secondColumnStart = 30; 9583 for (var i = 0; i <= hookTypesUpdateIndexDev; i++) { 9584 var oldHookName = hookTypesDev[i]; 9585 var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName; 9586 var row = i + 1 + ". " + oldHookName; 9587 while (row.length < secondColumnStart) row += " "; 9588 row += newHookName + "\n"; 9589 table += row; 9590 } 9591 error("React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", componentName, table); 9592 } 9593 } 9594 } 9595 function throwInvalidHookError() { 9596 throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."); 9597 } 9598 function areHookInputsEqual(nextDeps, prevDeps) { 9599 if (ignorePreviousDependencies) return false;
9600 if (prevDeps === null) { 9601 error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", currentHookNameInDev); 9602 return false; 9603 } 9604 if (nextDeps.length !== prevDeps.length) error("The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", currentHookNameInDev, "[" + prevDeps.join(", ") + "]", "[" + nextDeps.join(", ") + "]"); 9605 for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { 9606 if (objectIs(nextDeps[i], prevDeps[i])) continue; 9607 return false; 9608 } 9609 return true; 9610 } 9611 function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) { 9612 renderLanes = nextRenderLanes; 9613 currentlyRenderingFiber$1 = workInProgress; 9614 hookTypesDev = current !== null ? current._debugHookTypes : null; 9615 hookTypesUpdateIndexDev = -1; 9616 ignorePreviousDependencies = current !== null && current.type !== workInProgress.type; 9617 workInProgress.memoizedState = null; 9618 workInProgress.updateQueue = null; 9619 workInProgress.lanes = NoLanes; 9620 if (current !== null && current.memoizedState !== null) ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV; 9621 else if (hookTypesDev !== null) ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV; 9622 else ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV; 9623 var children = Component(props, secondArg); 9624 if (didScheduleRenderPhaseUpdateDuringThisPass) { 9625 var numberOfReRenders = 0; 9626 do { 9627 didScheduleRenderPhaseUpdateDuringThisPass = false; 9628 localIdCounter = 0; 9629 if (numberOfReRenders >= RE_RENDER_LIMIT) throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop."); 9630 numberOfReRenders += 1; 9631 ignorePreviousDependencies = false; 9632 currentHook = null; 9633 workInProgressHook = null; 9634 workInProgress.updateQueue = null; 9635 hookTypesUpdateIndexDev = -1; 9636 ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV; 9637 children = Component(props, secondArg); 9638 } while (didScheduleRenderPhaseUpdateDuringThisPass); 9639 } 9640 ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; 9641 workInProgress._debugHookTypes = hookTypesDev; 9642 var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null; 9643 renderLanes = NoLanes; 9644 currentlyRenderingFiber$1 = null; 9645 currentHook = null; 9646 workInProgressHook = null; 9647 currentHookNameInDev = null; 9648 hookTypesDev = null; 9649 hookTypesUpdateIndexDev = -1; 9650 if (current !== null && (current.flags & StaticMask) !== (workInProgress.flags & StaticMask) && (current.mode & ConcurrentMode) !== NoMode) error("Internal React error: Expected static flag was missing. Please notify the React team."); 9651 didScheduleRenderPhaseUpdate = false; 9652 if (didRenderTooFewHooks) throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement."); 9653 return children; 9654 } 9655 function checkDidRenderIdHook() { 9656 var didRenderIdHook = localIdCounter !== 0; 9657 localIdCounter = 0; 9658 return didRenderIdHook; 9659 } 9660 function bailoutHooks(current, workInProgress, lanes) { 9661 workInProgress.updateQueue = current.updateQueue; 9662 if ((workInProgress.mode & StrictEffectsMode) !== NoMode) workInProgress.flags &= ~(MountPassiveDev | MountLayoutDev | Passive | Update); 9663 else workInProgress.flags &= ~(Passive | Update); 9664 current.lanes = removeLanes(current.lanes, lanes); 9665 } 9666 function resetHooksAfterThrow() { 9667 ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; 9668 if (didScheduleRenderPhaseUpdate) { 9669 var hook = currentlyRenderingFiber$1.memoizedState; 9670 while (hook !== null) { 9671 var queue = hook.queue; 9672 if (queue !== null) queue.pending = null; 9673 hook = hook.next; 9674 } 9675 didScheduleRenderPhaseUpdate = false; 9676 } 9677 renderLanes = NoLanes; 9678 currentlyRenderingFiber$1 = null; 9679 currentHook = null; 9680 workInProgressHook = null; 9681 hookTypesDev = null; 9682 hookTypesUpdateIndexDev = -1; 9683 currentHookNameInDev = null; 9684 isUpdatingOpaqueValueInRenderPhase = false;
9685 didScheduleRenderPhaseUpdateDuringThisPass = false; 9686 localIdCounter = 0; 9687 } 9688 function mountWorkInProgressHook() { 9689 var hook = { 9690 memoizedState: null, 9691 baseState: null, 9692 baseQueue: null, 9693 queue: null, 9694 next: null 9695 }; 9696 if (workInProgressHook === null) currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook; 9697 else workInProgressHook = workInProgressHook.next = hook; 9698 return workInProgressHook; 9699 } 9700 function updateWorkInProgressHook() { 9701 var nextCurrentHook; 9702 if (currentHook === null) { 9703 var current = currentlyRenderingFiber$1.alternate; 9704 if (current !== null) nextCurrentHook = current.memoizedState; 9705 else nextCurrentHook = null; 9706 } else nextCurrentHook = currentHook.next; 9707 var nextWorkInProgressHook; 9708 if (workInProgressHook === null) nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState; 9709 else nextWorkInProgressHook = workInProgressHook.next; 9710 if (nextWorkInProgressHook !== null) { 9711 workInProgressHook = nextWorkInProgressHook; 9712 nextWorkInProgressHook = workInProgressHook.next; 9713 currentHook = nextCurrentHook; 9714 } else { 9715 if (nextCurrentHook === null) throw new Error("Rendered more hooks than during the previous render."); 9716 currentHook = nextCurrentHook; 9717 var newHook = { 9718 memoizedState: currentHook.memoizedState, 9719 baseState: currentHook.baseState, 9720 baseQueue: currentHook.baseQueue, 9721 queue: currentHook.queue, 9722 next: null 9723 }; 9724 if (workInProgressHook === null) currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook; 9725 else workInProgressHook = workInProgressHook.next = newHook; 9726 } 9727 return workInProgressHook; 9728 } 9729 function createFunctionComponentUpdateQueue() { 9730 return { 9731 lastEffect: null, 9732 stores: null 9733 }; 9734 } 9735 function basicStateReducer(state, action) { 9736 return typeof action === "function" ? action(state) : action; 9737 } 9738 function mountReducer(reducer, initialArg, init) { 9739 var hook = mountWorkInProgressHook(); 9740 var initialState; 9741 if (init !== void 0) initialState = init(initialArg); 9742 else initialState = initialArg; 9743 hook.memoizedState = hook.baseState = initialState; 9744 var queue = { 9745 pending: null, 9746 interleaved: null, 9747 lanes: NoLanes, 9748 dispatch: null, 9749 lastRenderedReducer: reducer, 9750 lastRenderedState: initialState 9751 }; 9752 hook.queue = queue; 9753 var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue); 9754 return [hook.memoizedState, dispatch]; 9755 } 9756 function updateReducer(reducer, initialArg, init) { 9757 var hook = updateWorkInProgressHook(); 9758 var queue = hook.queue; 9759 if (queue === null) throw new Error("Should have a queue. This is likely a bug in React. Please file an issue."); 9760 queue.lastRenderedReducer = reducer; 9761 var current = currentHook; 9762 var baseQueue = current.baseQueue; 9763 var pendingQueue = queue.pending; 9764 if (pendingQueue !== null) { 9765 if (baseQueue !== null) { 9766 var baseFirst = baseQueue.next; 9767 var pendingFirst = pendingQueue.next; 9768 baseQueue.next = pendingFirst; 9769 pendingQueue.next = baseFirst; 9770 } 9771 if (current.baseQueue !== baseQueue) error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."); 9772 current.baseQueue = baseQueue = pendingQueue; 9773 queue.pending = null; 9774 } 9775 if (baseQueue !== null) { 9776 var first = baseQueue.next; 9777 var newState = current.baseState; 9778 var newBaseState = null; 9779 var newBaseQueueFirst = null; 9780 var newBaseQueueLast = null; 9781 var update = first; 9782 do { 9783 var updateLane = update.lane; 9784 if (!isSubsetOfLanes(renderLanes, updateLane)) { 9785 var clone = { 9786 lane: updateLane, 9787 action: update.action, 9788 hasEagerState: update.hasEagerState, 9789 eagerState: update.eagerState, 9790 next: null 9791 }; 9792 if (newBaseQueueLast === null) { 9793 newBaseQueueFirst = newBaseQueueLast = clone; 9794 newBaseState = newState; 9795 } else newBaseQueueLast = newBaseQueueLast.next = clone; 9796 currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
9797 markSkippedUpdateLanes(updateLane); 9798 } else { 9799 if (newBaseQueueLast !== null) { 9800 var _clone = { 9801 lane: NoLane, 9802 action: update.action, 9803 hasEagerState: update.hasEagerState, 9804 eagerState: update.eagerState, 9805 next: null 9806 }; 9807 newBaseQueueLast = newBaseQueueLast.next = _clone; 9808 } 9809 if (update.hasEagerState) newState = update.eagerState; 9810 else { 9811 var action = update.action; 9812 newState = reducer(newState, action); 9813 } 9814 } 9815 update = update.next; 9816 } while (update !== null && update !== first); 9817 if (newBaseQueueLast === null) newBaseState = newState; 9818 else newBaseQueueLast.next = newBaseQueueFirst; 9819 if (!objectIs(newState, hook.memoizedState)) markWorkInProgressReceivedUpdate(); 9820 hook.memoizedState = newState; 9821 hook.baseState = newBaseState; 9822 hook.baseQueue = newBaseQueueLast; 9823 queue.lastRenderedState = newState; 9824 } 9825 var lastInterleaved = queue.interleaved; 9826 if (lastInterleaved !== null) { 9827 var interleaved = lastInterleaved; 9828 do { 9829 var interleavedLane = interleaved.lane; 9830 currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane); 9831 markSkippedUpdateLanes(interleavedLane); 9832 interleaved = interleaved.next; 9833 } while (interleaved !== lastInterleaved); 9834 } else if (baseQueue === null) queue.lanes = NoLanes; 9835 var dispatch = queue.dispatch; 9836 return [hook.memoizedState, dispatch]; 9837 } 9838 function rerenderReducer(reducer, initialArg, init) { 9839 var hook = updateWorkInProgressHook(); 9840 var queue = hook.queue; 9841 if (queue === null) throw new Error("Should have a queue. This is likely a bug in React. Please file an issue."); 9842 queue.lastRenderedReducer = reducer; 9843 var dispatch = queue.dispatch; 9844 var lastRenderPhaseUpdate = queue.pending; 9845 var newState = hook.memoizedState; 9846 if (lastRenderPhaseUpdate !== null) { 9847 queue.pending = null; 9848 var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next; 9849 var update = firstRenderPhaseUpdate; 9850 do { 9851 var action = update.action; 9852 newState = reducer(newState, action); 9853 update = update.next; 9854 } while (update !== firstRenderPhaseUpdate); 9855 if (!objectIs(newState, hook.memoizedState)) markWorkInProgressReceivedUpdate(); 9856 hook.memoizedState = newState; 9857 if (hook.baseQueue === null) hook.baseState = newState; 9858 queue.lastRenderedState = newState; 9859 } 9860 return [newState, dispatch]; 9861 } 9862 function mountMutableSource(source, getSnapshot, subscribe) {} 9863 function updateMutableSource(source, getSnapshot, subscribe) {} 9864 function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { 9865 var fiber = currentlyRenderingFiber$1; 9866 var hook = mountWorkInProgressHook(); 9867 var nextSnapshot; 9868 if (getIsHydrating()) { 9869 if (getServerSnapshot === void 0) throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."); 9870 nextSnapshot = getServerSnapshot(); 9871 if (!didWarnUncachedGetSnapshot) { 9872 if (nextSnapshot !== getServerSnapshot()) { 9873 error("The result of getServerSnapshot should be cached to avoid an infinite loop"); 9874 didWarnUncachedGetSnapshot = true; 9875 } 9876 } 9877 } else { 9878 nextSnapshot = getSnapshot(); 9879 if (!didWarnUncachedGetSnapshot) { 9880 var cachedSnapshot = getSnapshot(); 9881 if (!objectIs(nextSnapshot, cachedSnapshot)) { 9882 error("The result of getSnapshot should be cached to avoid an infinite loop"); 9883 didWarnUncachedGetSnapshot = true; 9884 } 9885 } 9886 var root = getWorkInProgressRoot(); 9887 if (root === null) throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); 9888 if (!includesBlockingLane(root, renderLanes)) pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); 9889 } 9890 hook.memoizedState = nextSnapshot; 9891 var inst = { 9892 value: nextSnapshot, 9893 getSnapshot 9894 }; 9895 hook.queue = inst; 9896 mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); 9897 fiber.flags |= Passive; 9898 pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null); 9899 return nextSnapshot; 9900 } 9901 function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { 9902 var fiber = currentlyRenderingFiber$1; 9903 var hook = updateWorkInProgressHook(); 9904 var nextSnapshot = getSnapshot(); 9905 if (!didWarnUncachedGetSnapshot) { 9906 if (!objectIs(nextSnapshot, getSnapshot())) { 9907 error("The result of getSnapshot should be cached to avoid an infinite loop"); 9908 didWarnUncachedGetSnapshot = true; 9909 } 9910 } 9911 var prevSnapshot = hook.memoizedState; 9912 var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot); 9913 if (snapshotChanged) { 9914 hook.memoizedState = nextSnapshot; 9915 markWorkInProgressReceivedUpdate(); 9916 } 9917 var inst = hook.queue; 9918 updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); 9919 if (inst.getSnapshot !== getSnapshot || snapshotChanged || workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) { 9920 fiber.flags |= Passive; 9921 pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null); 9922 var root = getWorkInProgressRoot(); 9923 if (root === null) throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); 9924 if (!includesBlockingLane(root, renderLanes)) pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); 9925 } 9926 return nextSnapshot; 9927 } 9928 function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { 9929 fiber.flags |= StoreConsistency; 9930 var check = { 9931 getSnapshot, 9932 value: renderedSnapshot 9933 }; 9934 var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; 9935 if (componentUpdateQueue === null) { 9936 componentUpdateQueue = createFunctionComponentUpdateQueue(); 9937 currentlyRenderingFiber$1.updateQueue = componentUpdateQueue; 9938 componentUpdateQueue.stores = [check]; 9939 } else { 9940 var stores = componentUpdateQueue.stores; 9941 if (stores === null) componentUpdateQueue.stores = [check]; 9942 else stores.push(check); 9943 } 9944 } 9945 function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { 9946 inst.value = nextSnapshot; 9947 inst.getSnapshot = getSnapshot; 9948 if (checkIfSnapshotChanged(inst)) forceStoreRerender(fiber); 9949 } 9950 function subscribeToStore(fiber, inst, subscribe) { 9951 var handleStoreChange = function() { 9952 if (checkIfSnapshotChanged(inst)) forceStoreRerender(fiber); 9953 }; 9954 return subscribe(handleStoreChange); 9955 } 9956 function checkIfSnapshotChanged(inst) { 9957 var latestGetSnapshot = inst.getSnapshot; 9958 var prevValue = inst.value; 9959 try { 9960 return !objectIs(prevValue, latestGetSnapshot()); 9961 } catch (error) { 9962 return true; 9963 } 9964 } 9965 function forceStoreRerender(fiber) { 9966 var root = enqueueConcurrentRenderForLane(fiber, SyncLane); 9967 if (root !== null) scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); 9968 } 9969 function mountState(initialState) { 9970 var hook = mountWorkInProgressHook(); 9971 if (typeof initialState === "function") initialState = initialState(); 9972 hook.memoizedState = hook.baseState = initialState; 9973 var queue = { 9974 pending: null, 9975 interleaved: null, 9976 lanes: NoLanes, 9977 dispatch: null, 9978 lastRenderedReducer: basicStateReducer, 9979 lastRenderedState: initialState 9980 }; 9981 hook.queue = queue; 9982 var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); 9983 return [hook.memoizedState, dispatch]; 9984 } 9985 function updateState(initialState) { 9986 return updateReducer(basicStateReducer); 9987 } 9988 function rerenderState(initialState) { 9989 return rerenderReducer(basicStateReducer); 9990 } 9991 function pushEffect(tag, create, destroy, deps) { 9992 var effect = { 9993 tag, 9994 create, 9995 destroy, 9996 deps, 9997 next: null 9998 }; 9999 var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; 10000 if (componentUpdateQueue === null) { 10001 componentUpdateQueue = createFunctionComponentUpdateQueue(); 10002 currentlyRenderingFiber$1.updateQueue = componentUpdateQueue; 10003 componentUpdateQueue.lastEffect = effect.next = effect; 10004 } else { 10005 var lastEffect = componentUpdateQueue.lastEffect; 10006 if (lastEffect === null) componentUpdateQueue.lastEffect = effect.next = effect; 10007 else { 10008 var firstEffect = lastEffect.next; 10009 lastEffect.next = effect; 10010 effect.next = firstEffect; 10011 componentUpdateQueue.lastEffect = effect; 10012 } 10013 } 10014 return effect; 10015 } 10016 function mountRef(initialValue) { 10017 var hook = mountWorkInProgressHook(); 10018 var _ref2 = { current: initialValue }; 10019 hook.memoizedState = _ref2; 10020 return _ref2; 10021 } 10022 function updateRef(initialValue) { 10023 return updateWorkInProgressHook().memoizedState; 10024 } 10025 function mountEffectImpl(fiberFlags, hookFlags, create, deps) { 10026 var hook = mountWorkInProgressHook(); 10027 var nextDeps = deps === void 0 ? null : deps; 10028 currentlyRenderingFiber$1.flags |= fiberFlags; 10029 hook.memoizedState = pushEffect(HasEffect | hookFlags, create, void 0, nextDeps); 10030 } 10031 function updateEffectImpl(fiberFlags, hookFlags, create, deps) { 10032 var hook = updateWorkInProgressHook(); 10033 var nextDeps = deps === void 0 ? null : deps; 10034 var destroy = void 0; 10035 if (currentHook !== null) { 10036 var prevEffect = currentHook.memoizedState; 10037 destroy = prevEffect.destroy; 10038 if (nextDeps !== null) { 10039 var prevDeps = prevEffect.deps; 10040 if (areHookInputsEqual(nextDeps, prevDeps)) { 10041 hook.memoizedState = pushEffect(hookFlags, create, destroy, nextDeps); 10042 return; 10043 } 10044 } 10045 } 10046 currentlyRenderingFiber$1.flags |= fiberFlags; 10047 hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps); 10048 } 10049 function mountEffect(create, deps) { 10050 if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create, deps); 10051 else return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps); 10052 } 10053 function updateEffect(create, deps) { 10054 return updateEffectImpl(Passive, Passive$1, create, deps); 10055 } 10056 function mountInsertionEffect(create, deps) { 10057 return mountEffectImpl(Update, Insertion, create, deps); 10058 } 10059 function updateInsertionEffect(create, deps) { 10060 return updateEffectImpl(Update, Insertion, create, deps); 10061 } 10062 function mountLayoutEffect(create, deps) { 10063 var fiberFlags = Update; 10064 fiberFlags |= LayoutStatic; 10065 if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) fiberFlags |= MountLayoutDev; 10066 return mountEffectImpl(fiberFlags, Layout, create, deps); 10067 } 10068 function updateLayoutEffect(create, deps) { 10069 return updateEffectImpl(Update, Layout, create, deps); 10070 } 10071 function imperativeHandleEffect(create, ref) { 10072 if (typeof ref === "function") { 10073 var refCallback = ref; 10074 refCallback(create()); 10075 return function() { 10076 refCallback(null); 10077 }; 10078 } else if (ref !== null && ref !== void 0) { 10079 var refObject = ref; 10080 if (!refObject.hasOwnProperty("current")) error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(refObject).join(", ") + "}"); 10081 refObject.current = create(); 10082 return function() { 10083 refObject.current = null; 10084 }; 10085 } 10086 } 10087 function mountImperativeHandle(ref, create, deps) { 10088 if (typeof create !== "function") error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null"); 10089 var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null; 10090 var fiberFlags = Update; 10091 fiberFlags |= LayoutStatic; 10092 if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) fiberFlags |= MountLayoutDev; 10093 return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); 10094 } 10095 function updateImperativeHandle(ref, create, deps) { 10096 if (typeof create !== "function") error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null"); 10097 var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null; 10098 return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); 10099 } 10100 function mountDebugValue(value, formatterFn) {} 10101 var updateDebugValue = mountDebugValue; 10102 function mountCallback(callback, deps) { 10103 var hook = mountWorkInProgressHook(); 10104 hook.memoizedState = [callback, deps === void 0 ? null : deps]; 10105 return callback; 10106 } 10107 function updateCallback(callback, deps) { 10108 var hook = updateWorkInProgressHook(); 10109 var nextDeps = deps === void 0 ? null : deps; 10110 var prevState = hook.memoizedState; 10111 if (prevState !== null) { 10112 if (nextDeps !== null) { 10113 var prevDeps = prevState[1]; 10114 if (areHookInputsEqual(nextDeps, prevDeps)) return prevState[0]; 10115 } 10116 } 10117 hook.memoizedState = [callback, nextDeps]; 10118 return callback; 10119 } 10120 function mountMemo(nextCreate, deps) { 10121 var hook = mountWorkInProgressHook(); 10122 var nextDeps = deps === void 0 ? null : deps; 10123 var nextValue = nextCreate(); 10124 hook.memoizedState = [nextValue, nextDeps]; 10125 return nextValue; 10126 } 10127 function updateMemo(nextCreate, deps) { 10128 var hook = updateWorkInProgressHook(); 10129 var nextDeps = deps === void 0 ? null : deps; 10130 var prevState = hook.memoizedState; 10131 if (prevState !== null) { 10132 if (nextDeps !== null) { 10133 var prevDeps = prevState[1]; 10134 if (areHookInputsEqual(nextDeps, prevDeps)) return prevState[0]; 10135 } 10136 } 10137 var nextValue = nextCreate(); 10138 hook.memoizedState = [nextValue, nextDeps]; 10139 return nextValue; 10140 } 10141 function mountDeferredValue(value) { 10142 var hook = mountWorkInProgressHook(); 10143 hook.memoizedState = value; 10144 return value; 10145 } 10146 function updateDeferredValue(value) { 10147 var hook = updateWorkInProgressHook(); 10148 var prevValue = currentHook.memoizedState; 10149 return updateDeferredValueImpl(hook, prevValue, value); 10150 } 10151 function rerenderDeferredValue(value) { 10152 var hook = updateWorkInProgressHook(); 10153 if (currentHook === null) { 10154 hook.memoizedState = value; 10155 return value; 10156 } else { 10157 var prevValue = currentHook.memoizedState; 10158 return updateDeferredValueImpl(hook, prevValue, value); 10159 } 10160 } 10161 function updateDeferredValueImpl(hook, prevValue, value) { 10162 if (!includesOnlyNonUrgentLanes(renderLanes)) { 10163 if (!objectIs(value, prevValue)) { 10164 var deferredLane = claimNextTransitionLane(); 10165 currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane);
10166 markSkippedUpdateLanes(deferredLane); 10167 hook.baseState = true; 10168 } 10169 return prevValue; 10170 } else { 10171 if (hook.baseState) { 10172 hook.baseState = false; 10173 markWorkInProgressReceivedUpdate(); 10174 } 10175 hook.memoizedState = value; 10176 return value; 10177 } 10178 } 10179 function startTransition(setPending, callback, options) { 10180 var previousPriority = getCurrentUpdatePriority(); 10181 setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority)); 10182 setPending(true); 10183 var prevTransition = ReactCurrentBatchConfig$2.transition; 10184 ReactCurrentBatchConfig$2.transition = {}; 10185 var currentTransition = ReactCurrentBatchConfig$2.transition; 10186 ReactCurrentBatchConfig$2.transition._updatedFibers = /* @__PURE__ */ new Set(); 10187 try { 10188 setPending(false); 10189 callback(); 10190 } finally { 10191 setCurrentUpdatePriority(previousPriority); 10192 ReactCurrentBatchConfig$2.transition = prevTransition; 10193 if (prevTransition === null && currentTransition._updatedFibers) { 10194 if (currentTransition._updatedFibers.size > 10) warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."); 10195 currentTransition._updatedFibers.clear(); 10196 } 10197 } 10198 } 10199 function mountTransition() { 10200 var _mountState = mountState(false), isPending = _mountState[0], setPending = _mountState[1]; 10201 var start = startTransition.bind(null, setPending); 10202 var hook = mountWorkInProgressHook(); 10203 hook.memoizedState = start; 10204 return [isPending, start]; 10205 } 10206 function updateTransition() { 10207 return [updateState()[0], updateWorkInProgressHook().memoizedState]; 10208 } 10209 function rerenderTransition() { 10210 return [rerenderState()[0], updateWorkInProgressHook().memoizedState]; 10211 } 10212 var isUpdatingOpaqueValueInRenderPhase = false; 10213 function getIsUpdatingOpaqueValueInRenderPhaseInDEV() { 10214 return isUpdatingOpaqueValueInRenderPhase; 10215 } 10216 function mountId() { 10217 var hook = mountWorkInProgressHook(); 10218 var identifierPrefix = getWorkInProgressRoot().identifierPrefix; 10219 var id; 10220 if (getIsHydrating()) { 10221 var treeId = getTreeId(); 10222 id = ":" + identifierPrefix + "R" + treeId; 10223 var localId = localIdCounter++; 10224 if (localId > 0) id += "H" + localId.toString(32); 10225 id += ":"; 10226 } else { 10227 var globalClientId = globalClientIdCounter++; 10228 id = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; 10229 } 10230 hook.memoizedState = id; 10231 return id; 10232 } 10233 function updateId() { 10234 return updateWorkInProgressHook().memoizedState; 10235 } 10236 function dispatchReducerAction(fiber, queue, action) { 10237 if (typeof arguments[3] === "function") error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."); 10238 var lane = requestUpdateLane(fiber); 10239 var update = { 10240 lane, 10241 action, 10242 hasEagerState: false, 10243 eagerState: null, 10244 next: null 10245 }; 10246 if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); 10247 else { 10248 var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane); 10249 if (root !== null) { 10250 scheduleUpdateOnFiber(root, fiber, lane, requestEventTime()); 10251 entangleTransitionUpdate(root, queue, lane); 10252 } 10253 } 10254 markUpdateInDevTools(fiber, lane); 10255 } 10256 function dispatchSetState(fiber, queue, action) { 10257 if (typeof arguments[3] === "function") error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."); 10258 var lane = requestUpdateLane(fiber); 10259 var update = { 10260 lane, 10261 action, 10262 hasEagerState: false, 10263 eagerState: null, 10264 next: null 10265 }; 10266 if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); 10267 else { 10268 var alternate = fiber.alternate; 10269 if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) { 10270 var lastRenderedReducer = queue.lastRenderedReducer; 10271 if (lastRenderedReducer !== null) { 10272 var prevDispatcher = ReactCurrentDispatcher$1.current; 10273 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; 10274 try { 10275 var currentState = queue.lastRenderedState; 10276 var eagerState = lastRenderedReducer(currentState, action); 10277 update.hasEagerState = true; 10278 update.eagerState = eagerState; 10279 if (objectIs(eagerState, currentState)) {
10280 enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane); 10281 return; 10282 } 10283 } catch (error) {} finally { 10284 ReactCurrentDispatcher$1.current = prevDispatcher; 10285 } 10286 } 10287 } 10288 var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane); 10289 if (root !== null) { 10290 scheduleUpdateOnFiber(root, fiber, lane, requestEventTime()); 10291 entangleTransitionUpdate(root, queue, lane); 10292 } 10293 } 10294 markUpdateInDevTools(fiber, lane); 10295 } 10296 function isRenderPhaseUpdate(fiber) { 10297 var alternate = fiber.alternate; 10298 return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1; 10299 } 10300 function enqueueRenderPhaseUpdate(queue, update) { 10301 didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true; 10302 var pending = queue.pending; 10303 if (pending === null) update.next = update; 10304 else { 10305 update.next = pending.next; 10306 pending.next = update; 10307 } 10308 queue.pending = update; 10309 } 10310 function entangleTransitionUpdate(root, queue, lane) { 10311 if (isTransitionLane(lane)) { 10312 var queueLanes = queue.lanes; 10313 queueLanes = intersectLanes(queueLanes, root.pendingLanes); 10314 var newQueueLanes = mergeLanes(queueLanes, lane); 10315 queue.lanes = newQueueLanes; 10316 markRootEntangled(root, newQueueLanes); 10317 } 10318 } 10319 function markUpdateInDevTools(fiber, lane, action) { 10320 markStateUpdateScheduled(fiber, lane); 10321 } 10322 var ContextOnlyDispatcher = { 10323 readContext, 10324 useCallback: throwInvalidHookError, 10325 useContext: throwInvalidHookError, 10326 useEffect: throwInvalidHookError, 10327 useImperativeHandle: throwInvalidHookError, 10328 useInsertionEffect: throwInvalidHookError, 10329 useLayoutEffect: throwInvalidHookError, 10330 useMemo: throwInvalidHookError, 10331 useReducer: throwInvalidHookError, 10332 useRef: throwInvalidHookError, 10333 useState: throwInvalidHookError, 10334 useDebugValue: throwInvalidHookError, 10335 useDeferredValue: throwInvalidHookError, 10336 useTransition: throwInvalidHookError, 10337 useMutableSource: throwInvalidHookError, 10338 useSyncExternalStore: throwInvalidHookError, 10339 useId: throwInvalidHookError, 10340 unstable_isNewReconciler: enableNewReconciler 10341 }; 10342 var HooksDispatcherOnMountInDEV = null; 10343 var HooksDispatcherOnMountWithHookTypesInDEV = null; 10344 var HooksDispatcherOnUpdateInDEV = null; 10345 var HooksDispatcherOnRerenderInDEV = null; 10346 var InvalidNestedHooksDispatcherOnMountInDEV = null; 10347 var InvalidNestedHooksDispatcherOnUpdateInDEV = null; 10348 var InvalidNestedHooksDispatcherOnRerenderInDEV = null; 10349 var warnInvalidContextAccess = function() { 10350 error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."); 10351 }; 10352 var warnInvalidHookAccess = function() { 10353 error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks"); 10354 }; 10355 HooksDispatcherOnMountInDEV = { 10356 readContext: function(context) { 10357 return readContext(context); 10358 }, 10359 useCallback: function(callback, deps) { 10360 currentHookNameInDev = "useCallback"; 10361 mountHookTypesDev(); 10362 checkDepsAreArrayDev(deps); 10363 return mountCallback(callback, deps); 10364 }, 10365 useContext: function(context) { 10366 currentHookNameInDev = "useContext"; 10367 mountHookTypesDev(); 10368 return readContext(context); 10369 }, 10370 useEffect: function(create, deps) { 10371 currentHookNameInDev = "useEffect"; 10372 mountHookTypesDev(); 10373 checkDepsAreArrayDev(deps); 10374 return mountEffect(create, deps); 10375 }, 10376 useImperativeHandle: function(ref, create, deps) { 10377 currentHookNameInDev = "useImperativeHandle"; 10378 mountHookTypesDev(); 10379 checkDepsAreArrayDev(deps); 10380 return mountImperativeHandle(ref, create, deps); 10381 }, 10382 useInsertionEffect: function(create, deps) { 10383 currentHookNameInDev = "useInsertionEffect"; 10384 mountHookTypesDev(); 10385 checkDepsAreArrayDev(deps); 10386 return mountInsertionEffect(create, deps); 10387 }, 10388 useLayoutEffect: function(create, deps) { 10389 currentHookNameInDev = "useLayoutEffect"; 10390 mountHookTypesDev(); 10391 checkDepsAreArrayDev(deps); 10392 return mountLayoutEffect(create, deps); 10393 }, 10394 useMemo: function(create, deps) { 10395 currentHookNameInDev = "useMemo"; 10396 mountHookTypesDev(); 10397 checkDepsAreArrayDev(deps); 10398 var prevDispatcher = ReactCurrentDispatcher$1.current; 10399 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
vendor: 24,954 bytes, lines 10400-11161
10400 try { 10401 return mountMemo(create, deps); 10402 } finally { 10403 ReactCurrentDispatcher$1.current = prevDispatcher; 10404 } 10405 }, 10406 useReducer: function(reducer, initialArg, init) { 10407 currentHookNameInDev = "useReducer"; 10408 mountHookTypesDev(); 10409 var prevDispatcher = ReactCurrentDispatcher$1.current; 10410 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; 10411 try { 10412 return mountReducer(reducer, initialArg, init); 10413 } finally { 10414 ReactCurrentDispatcher$1.current = prevDispatcher; 10415 } 10416 }, 10417 useRef: function(initialValue) { 10418 currentHookNameInDev = "useRef"; 10419 mountHookTypesDev(); 10420 return mountRef(initialValue); 10421 }, 10422 useState: function(initialState) { 10423 currentHookNameInDev = "useState"; 10424 mountHookTypesDev(); 10425 var prevDispatcher = ReactCurrentDispatcher$1.current; 10426 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; 10427 try { 10428 return mountState(initialState); 10429 } finally { 10430 ReactCurrentDispatcher$1.current = prevDispatcher; 10431 } 10432 }, 10433 useDebugValue: function(value, formatterFn) { 10434 currentHookNameInDev = "useDebugValue"; 10435 mountHookTypesDev(); 10436 return mountDebugValue(); 10437 }, 10438 useDeferredValue: function(value) { 10439 currentHookNameInDev = "useDeferredValue"; 10440 mountHookTypesDev(); 10441 return mountDeferredValue(value); 10442 }, 10443 useTransition: function() { 10444 currentHookNameInDev = "useTransition"; 10445 mountHookTypesDev(); 10446 return mountTransition(); 10447 }, 10448 useMutableSource: function(source, getSnapshot, subscribe) { 10449 currentHookNameInDev = "useMutableSource"; 10450 mountHookTypesDev(); 10451 return mountMutableSource(); 10452 }, 10453 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) { 10454 currentHookNameInDev = "useSyncExternalStore"; 10455 mountHookTypesDev(); 10456 return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); 10457 }, 10458 useId: function() { 10459 currentHookNameInDev = "useId"; 10460 mountHookTypesDev(); 10461 return mountId(); 10462 }, 10463 unstable_isNewReconciler: enableNewReconciler 10464 }; 10465 HooksDispatcherOnMountWithHookTypesInDEV = { 10466 readContext: function(context) { 10467 return readContext(context); 10468 }, 10469 useCallback: function(callback, deps) { 10470 currentHookNameInDev = "useCallback"; 10471 updateHookTypesDev(); 10472 return mountCallback(callback, deps); 10473 }, 10474 useContext: function(context) { 10475 currentHookNameInDev = "useContext"; 10476 updateHookTypesDev(); 10477 return readContext(context); 10478 }, 10479 useEffect: function(create, deps) { 10480 currentHookNameInDev = "useEffect"; 10481 updateHookTypesDev(); 10482 return mountEffect(create, deps); 10483 }, 10484 useImperativeHandle: function(ref, create, deps) { 10485 currentHookNameInDev = "useImperativeHandle"; 10486 updateHookTypesDev(); 10487 return mountImperativeHandle(ref, create, deps); 10488 }, 10489 useInsertionEffect: function(create, deps) { 10490 currentHookNameInDev = "useInsertionEffect"; 10491 updateHookTypesDev(); 10492 return mountInsertionEffect(create, deps); 10493 }, 10494 useLayoutEffect: function(create, deps) { 10495 currentHookNameInDev = "useLayoutEffect"; 10496 updateHookTypesDev(); 10497 return mountLayoutEffect(create, deps); 10498 }, 10499 useMemo: function(create, deps) { 10500 currentHookNameInDev = "useMemo"; 10501 updateHookTypesDev(); 10502 var prevDispatcher = ReactCurrentDispatcher$1.current; 10503 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; 10504 try { 10505 return mountMemo(create, deps); 10506 } finally { 10507 ReactCurrentDispatcher$1.current = prevDispatcher; 10508 } 10509 }, 10510 useReducer: function(reducer, initialArg, init) { 10511 currentHookNameInDev = "useReducer"; 10512 updateHookTypesDev(); 10513 var prevDispatcher = ReactCurrentDispatcher$1.current; 10514 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; 10515 try { 10516 return mountReducer(reducer, initialArg, init); 10517 } finally { 10518 ReactCurrentDispatcher$1.current = prevDispatcher; 10519 } 10520 }, 10521 useRef: function(initialValue) { 10522 currentHookNameInDev = "useRef"; 10523 updateHookTypesDev(); 10524 return mountRef(initialValue); 10525 }, 10526 useState: function(initialState) { 10527 currentHookNameInDev = "useState"; 10528 updateHookTypesDev(); 10529 var prevDispatcher = ReactCurrentDispatcher$1.current; 10530 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; 10531 try { 10532 return mountState(initialState); 10533 } finally { 10534 ReactCurrentDispatcher$1.current = prevDispatcher; 10535 } 10536 }, 10537 useDebugValue: function(value, formatterFn) { 10538 currentHookNameInDev = "useDebugValue"; 10539 updateHookTypesDev(); 10540 return mountDebugValue(); 10541 }, 10542 useDeferredValue: function(value) { 10543 currentHookNameInDev = "useDeferredValue"; 10544 updateHookTypesDev(); 10545 return mountDeferredValue(value); 10546 }, 10547 useTransition: function() { 10548 currentHookNameInDev = "useTransition"; 10549 updateHookTypesDev(); 10550 return mountTransition(); 10551 }, 10552 useMutableSource: function(source, getSnapshot, subscribe) { 10553 currentHookNameInDev = "useMutableSource"; 10554 updateHookTypesDev(); 10555 return mountMutableSource(); 10556 }, 10557 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) { 10558 currentHookNameInDev = "useSyncExternalStore"; 10559 updateHookTypesDev(); 10560 return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); 10561 }, 10562 useId: function() { 10563 currentHookNameInDev = "useId"; 10564 updateHookTypesDev(); 10565 return mountId(); 10566 }, 10567 unstable_isNewReconciler: enableNewReconciler 10568 }; 10569 HooksDispatcherOnUpdateInDEV = { 10570 readContext: function(context) { 10571 return readContext(context); 10572 }, 10573 useCallback: function(callback, deps) { 10574 currentHookNameInDev = "useCallback"; 10575 updateHookTypesDev(); 10576 return updateCallback(callback, deps); 10577 }, 10578 useContext: function(context) { 10579 currentHookNameInDev = "useContext"; 10580 updateHookTypesDev(); 10581 return readContext(context); 10582 }, 10583 useEffect: function(create, deps) { 10584 currentHookNameInDev = "useEffect"; 10585 updateHookTypesDev(); 10586 return updateEffect(create, deps); 10587 }, 10588 useImperativeHandle: function(ref, create, deps) { 10589 currentHookNameInDev = "useImperativeHandle"; 10590 updateHookTypesDev(); 10591 return updateImperativeHandle(ref, create, deps); 10592 }, 10593 useInsertionEffect: function(create, deps) { 10594 currentHookNameInDev = "useInsertionEffect"; 10595 updateHookTypesDev(); 10596 return updateInsertionEffect(create, deps); 10597 }, 10598 useLayoutEffect: function(create, deps) { 10599 currentHookNameInDev = "useLayoutEffect"; 10600 updateHookTypesDev(); 10601 return updateLayoutEffect(create, deps); 10602 }, 10603 useMemo: function(create, deps) { 10604 currentHookNameInDev = "useMemo"; 10605 updateHookTypesDev(); 10606 var prevDispatcher = ReactCurrentDispatcher$1.current; 10607 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; 10608 try { 10609 return updateMemo(create, deps); 10610 } finally { 10611 ReactCurrentDispatcher$1.current = prevDispatcher; 10612 } 10613 }, 10614 useReducer: function(reducer, initialArg, init) { 10615 currentHookNameInDev = "useReducer"; 10616 updateHookTypesDev(); 10617 var prevDispatcher = ReactCurrentDispatcher$1.current; 10618 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; 10619 try { 10620 return updateReducer(reducer, initialArg, init); 10621 } finally { 10622 ReactCurrentDispatcher$1.current = prevDispatcher; 10623 } 10624 }, 10625 useRef: function(initialValue) { 10626 currentHookNameInDev = "useRef"; 10627 updateHookTypesDev(); 10628 return updateRef(); 10629 }, 10630 useState: function(initialState) { 10631 currentHookNameInDev = "useState"; 10632 updateHookTypesDev(); 10633 var prevDispatcher = ReactCurrentDispatcher$1.current; 10634 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; 10635 try { 10636 return updateState(initialState); 10637 } finally { 10638 ReactCurrentDispatcher$1.current = prevDispatcher; 10639 } 10640 }, 10641 useDebugValue: function(value, formatterFn) { 10642 currentHookNameInDev = "useDebugValue"; 10643 updateHookTypesDev(); 10644 return updateDebugValue(); 10645 }, 10646 useDeferredValue: function(value) { 10647 currentHookNameInDev = "useDeferredValue"; 10648 updateHookTypesDev(); 10649 return updateDeferredValue(value); 10650 }, 10651 useTransition: function() { 10652 currentHookNameInDev = "useTransition"; 10653 updateHookTypesDev(); 10654 return updateTransition(); 10655 }, 10656 useMutableSource: function(source, getSnapshot, subscribe) { 10657 currentHookNameInDev = "useMutableSource"; 10658 updateHookTypesDev(); 10659 return updateMutableSource(); 10660 }, 10661 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) { 10662 currentHookNameInDev = "useSyncExternalStore"; 10663 updateHookTypesDev(); 10664 return updateSyncExternalStore(subscribe, getSnapshot); 10665 }, 10666 useId: function() { 10667 currentHookNameInDev = "useId"; 10668 updateHookTypesDev(); 10669 return updateId(); 10670 }, 10671 unstable_isNewReconciler: enableNewReconciler 10672 }; 10673 HooksDispatcherOnRerenderInDEV = { 10674 readContext: function(context) { 10675 return readContext(context); 10676 }, 10677 useCallback: function(callback, deps) { 10678 currentHookNameInDev = "useCallback"; 10679 updateHookTypesDev(); 10680 return updateCallback(callback, deps); 10681 }, 10682 useContext: function(context) { 10683 currentHookNameInDev = "useContext"; 10684 updateHookTypesDev(); 10685 return readContext(context); 10686 }, 10687 useEffect: function(create, deps) { 10688 currentHookNameInDev = "useEffect"; 10689 updateHookTypesDev(); 10690 return updateEffect(create, deps); 10691 }, 10692 useImperativeHandle: function(ref, create, deps) { 10693 currentHookNameInDev = "useImperativeHandle"; 10694 updateHookTypesDev(); 10695 return updateImperativeHandle(ref, create, deps); 10696 }, 10697 useInsertionEffect: function(create, deps) { 10698 currentHookNameInDev = "useInsertionEffect"; 10699 updateHookTypesDev(); 10700 return updateInsertionEffect(create, deps); 10701 }, 10702 useLayoutEffect: function(create, deps) { 10703 currentHookNameInDev = "useLayoutEffect"; 10704 updateHookTypesDev(); 10705 return updateLayoutEffect(create, deps); 10706 }, 10707 useMemo: function(create, deps) { 10708 currentHookNameInDev = "useMemo"; 10709 updateHookTypesDev(); 10710 var prevDispatcher = ReactCurrentDispatcher$1.current; 10711 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; 10712 try { 10713 return updateMemo(create, deps); 10714 } finally { 10715 ReactCurrentDispatcher$1.current = prevDispatcher; 10716 } 10717 }, 10718 useReducer: function(reducer, initialArg, init) { 10719 currentHookNameInDev = "useReducer"; 10720 updateHookTypesDev(); 10721 var prevDispatcher = ReactCurrentDispatcher$1.current; 10722 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; 10723 try { 10724 return rerenderReducer(reducer, initialArg, init); 10725 } finally { 10726 ReactCurrentDispatcher$1.current = prevDispatcher; 10727 } 10728 }, 10729 useRef: function(initialValue) { 10730 currentHookNameInDev = "useRef"; 10731 updateHookTypesDev(); 10732 return updateRef(); 10733 }, 10734 useState: function(initialState) { 10735 currentHookNameInDev = "useState"; 10736 updateHookTypesDev(); 10737 var prevDispatcher = ReactCurrentDispatcher$1.current; 10738 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; 10739 try { 10740 return rerenderState(initialState); 10741 } finally { 10742 ReactCurrentDispatcher$1.current = prevDispatcher; 10743 } 10744 }, 10745 useDebugValue: function(value, formatterFn) { 10746 currentHookNameInDev = "useDebugValue"; 10747 updateHookTypesDev(); 10748 return updateDebugValue(); 10749 }, 10750 useDeferredValue: function(value) { 10751 currentHookNameInDev = "useDeferredValue"; 10752 updateHookTypesDev(); 10753 return rerenderDeferredValue(value); 10754 }, 10755 useTransition: function() { 10756 currentHookNameInDev = "useTransition"; 10757 updateHookTypesDev(); 10758 return rerenderTransition(); 10759 }, 10760 useMutableSource: function(source, getSnapshot, subscribe) { 10761 currentHookNameInDev = "useMutableSource"; 10762 updateHookTypesDev(); 10763 return updateMutableSource(); 10764 }, 10765 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) { 10766 currentHookNameInDev = "useSyncExternalStore"; 10767 updateHookTypesDev(); 10768 return updateSyncExternalStore(subscribe, getSnapshot); 10769 }, 10770 useId: function() { 10771 currentHookNameInDev = "useId"; 10772 updateHookTypesDev(); 10773 return updateId(); 10774 }, 10775 unstable_isNewReconciler: enableNewReconciler 10776 }; 10777 InvalidNestedHooksDispatcherOnMountInDEV = { 10778 readContext: function(context) { 10779 warnInvalidContextAccess(); 10780 return readContext(context); 10781 }, 10782 useCallback: function(callback, deps) { 10783 currentHookNameInDev = "useCallback"; 10784 warnInvalidHookAccess(); 10785 mountHookTypesDev(); 10786 return mountCallback(callback, deps); 10787 }, 10788 useContext: function(context) { 10789 currentHookNameInDev = "useContext"; 10790 warnInvalidHookAccess(); 10791 mountHookTypesDev(); 10792 return readContext(context); 10793 }, 10794 useEffect: function(create, deps) { 10795 currentHookNameInDev = "useEffect"; 10796 warnInvalidHookAccess(); 10797 mountHookTypesDev(); 10798 return mountEffect(create, deps); 10799 }, 10800 useImperativeHandle: function(ref, create, deps) { 10801 currentHookNameInDev = "useImperativeHandle"; 10802 warnInvalidHookAccess(); 10803 mountHookTypesDev(); 10804 return mountImperativeHandle(ref, create, deps); 10805 }, 10806 useInsertionEffect: function(create, deps) { 10807 currentHookNameInDev = "useInsertionEffect"; 10808 warnInvalidHookAccess(); 10809 mountHookTypesDev(); 10810 return mountInsertionEffect(create, deps); 10811 }, 10812 useLayoutEffect: function(create, deps) { 10813 currentHookNameInDev = "useLayoutEffect"; 10814 warnInvalidHookAccess(); 10815 mountHookTypesDev(); 10816 return mountLayoutEffect(create, deps); 10817 }, 10818 useMemo: function(create, deps) { 10819 currentHookNameInDev = "useMemo"; 10820 warnInvalidHookAccess(); 10821 mountHookTypesDev(); 10822 var prevDispatcher = ReactCurrentDispatcher$1.current; 10823 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; 10824 try { 10825 return mountMemo(create, deps); 10826 } finally { 10827 ReactCurrentDispatcher$1.current = prevDispatcher; 10828 } 10829 }, 10830 useReducer: function(reducer, initialArg, init) { 10831 currentHookNameInDev = "useReducer"; 10832 warnInvalidHookAccess(); 10833 mountHookTypesDev(); 10834 var prevDispatcher = ReactCurrentDispatcher$1.current; 10835 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; 10836 try { 10837 return mountReducer(reducer, initialArg, init); 10838 } finally { 10839 ReactCurrentDispatcher$1.current = prevDispatcher; 10840 } 10841 }, 10842 useRef: function(initialValue) { 10843 currentHookNameInDev = "useRef"; 10844 warnInvalidHookAccess(); 10845 mountHookTypesDev(); 10846 return mountRef(initialValue); 10847 }, 10848 useState: function(initialState) { 10849 currentHookNameInDev = "useState"; 10850 warnInvalidHookAccess(); 10851 mountHookTypesDev(); 10852 var prevDispatcher = ReactCurrentDispatcher$1.current; 10853 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; 10854 try { 10855 return mountState(initialState); 10856 } finally { 10857 ReactCurrentDispatcher$1.current = prevDispatcher; 10858 } 10859 }, 10860 useDebugValue: function(value, formatterFn) { 10861 currentHookNameInDev = "useDebugValue"; 10862 warnInvalidHookAccess(); 10863 mountHookTypesDev(); 10864 return mountDebugValue(); 10865 }, 10866 useDeferredValue: function(value) { 10867 currentHookNameInDev = "useDeferredValue"; 10868 warnInvalidHookAccess(); 10869 mountHookTypesDev(); 10870 return mountDeferredValue(value); 10871 }, 10872 useTransition: function() { 10873 currentHookNameInDev = "useTransition"; 10874 warnInvalidHookAccess(); 10875 mountHookTypesDev(); 10876 return mountTransition(); 10877 }, 10878 useMutableSource: function(source, getSnapshot, subscribe) { 10879 currentHookNameInDev = "useMutableSource"; 10880 warnInvalidHookAccess(); 10881 mountHookTypesDev(); 10882 return mountMutableSource(); 10883 }, 10884 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) { 10885 currentHookNameInDev = "useSyncExternalStore"; 10886 warnInvalidHookAccess(); 10887 mountHookTypesDev(); 10888 return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); 10889 }, 10890 useId: function() { 10891 currentHookNameInDev = "useId"; 10892 warnInvalidHookAccess(); 10893 mountHookTypesDev(); 10894 return mountId(); 10895 }, 10896 unstable_isNewReconciler: enableNewReconciler 10897 }; 10898 InvalidNestedHooksDispatcherOnUpdateInDEV = { 10899 readContext: function(context) { 10900 warnInvalidContextAccess(); 10901 return readContext(context); 10902 }, 10903 useCallback: function(callback, deps) { 10904 currentHookNameInDev = "useCallback"; 10905 warnInvalidHookAccess(); 10906 updateHookTypesDev(); 10907 return updateCallback(callback, deps); 10908 }, 10909 useContext: function(context) { 10910 currentHookNameInDev = "useContext"; 10911 warnInvalidHookAccess(); 10912 updateHookTypesDev(); 10913 return readContext(context); 10914 }, 10915 useEffect: function(create, deps) { 10916 currentHookNameInDev = "useEffect"; 10917 warnInvalidHookAccess(); 10918 updateHookTypesDev(); 10919 return updateEffect(create, deps); 10920 }, 10921 useImperativeHandle: function(ref, create, deps) { 10922 currentHookNameInDev = "useImperativeHandle"; 10923 warnInvalidHookAccess(); 10924 updateHookTypesDev(); 10925 return updateImperativeHandle(ref, create, deps); 10926 }, 10927 useInsertionEffect: function(create, deps) { 10928 currentHookNameInDev = "useInsertionEffect"; 10929 warnInvalidHookAccess(); 10930 updateHookTypesDev(); 10931 return updateInsertionEffect(create, deps); 10932 }, 10933 useLayoutEffect: function(create, deps) { 10934 currentHookNameInDev = "useLayoutEffect"; 10935 warnInvalidHookAccess(); 10936 updateHookTypesDev(); 10937 return updateLayoutEffect(create, deps); 10938 }, 10939 useMemo: function(create, deps) { 10940 currentHookNameInDev = "useMemo"; 10941 warnInvalidHookAccess(); 10942 updateHookTypesDev(); 10943 var prevDispatcher = ReactCurrentDispatcher$1.current; 10944 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; 10945 try { 10946 return updateMemo(create, deps); 10947 } finally { 10948 ReactCurrentDispatcher$1.current = prevDispatcher; 10949 } 10950 }, 10951 useReducer: function(reducer, initialArg, init) { 10952 currentHookNameInDev = "useReducer"; 10953 warnInvalidHookAccess(); 10954 updateHookTypesDev(); 10955 var prevDispatcher = ReactCurrentDispatcher$1.current; 10956 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; 10957 try { 10958 return updateReducer(reducer, initialArg, init); 10959 } finally { 10960 ReactCurrentDispatcher$1.current = prevDispatcher; 10961 } 10962 }, 10963 useRef: function(initialValue) { 10964 currentHookNameInDev = "useRef"; 10965 warnInvalidHookAccess(); 10966 updateHookTypesDev(); 10967 return updateRef(); 10968 }, 10969 useState: function(initialState) { 10970 currentHookNameInDev = "useState"; 10971 warnInvalidHookAccess(); 10972 updateHookTypesDev(); 10973 var prevDispatcher = ReactCurrentDispatcher$1.current; 10974 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; 10975 try { 10976 return updateState(initialState); 10977 } finally { 10978 ReactCurrentDispatcher$1.current = prevDispatcher; 10979 } 10980 }, 10981 useDebugValue: function(value, formatterFn) { 10982 currentHookNameInDev = "useDebugValue"; 10983 warnInvalidHookAccess(); 10984 updateHookTypesDev(); 10985 return updateDebugValue(); 10986 }, 10987 useDeferredValue: function(value) { 10988 currentHookNameInDev = "useDeferredValue"; 10989 warnInvalidHookAccess(); 10990 updateHookTypesDev(); 10991 return updateDeferredValue(value); 10992 }, 10993 useTransition: function() { 10994 currentHookNameInDev = "useTransition"; 10995 warnInvalidHookAccess(); 10996 updateHookTypesDev(); 10997 return updateTransition(); 10998 }, 10999 useMutableSource: function(source, getSnapshot, subscribe) { 11000 currentHookNameInDev = "useMutableSource"; 11001 warnInvalidHookAccess(); 11002 updateHookTypesDev(); 11003 return updateMutableSource(); 11004 }, 11005 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) { 11006 currentHookNameInDev = "useSyncExternalStore"; 11007 warnInvalidHookAccess(); 11008 updateHookTypesDev(); 11009 return updateSyncExternalStore(subscribe, getSnapshot); 11010 }, 11011 useId: function() { 11012 currentHookNameInDev = "useId"; 11013 warnInvalidHookAccess(); 11014 updateHookTypesDev(); 11015 return updateId(); 11016 }, 11017 unstable_isNewReconciler: enableNewReconciler 11018 }; 11019 InvalidNestedHooksDispatcherOnRerenderInDEV = { 11020 readContext: function(context) { 11021 warnInvalidContextAccess(); 11022 return readContext(context); 11023 }, 11024 useCallback: function(callback, deps) { 11025 currentHookNameInDev = "useCallback"; 11026 warnInvalidHookAccess(); 11027 updateHookTypesDev(); 11028 return updateCallback(callback, deps); 11029 }, 11030 useContext: function(context) { 11031 currentHookNameInDev = "useContext"; 11032 warnInvalidHookAccess(); 11033 updateHookTypesDev(); 11034 return readContext(context); 11035 }, 11036 useEffect: function(create, deps) { 11037 currentHookNameInDev = "useEffect"; 11038 warnInvalidHookAccess(); 11039 updateHookTypesDev(); 11040 return updateEffect(create, deps); 11041 }, 11042 useImperativeHandle: function(ref, create, deps) { 11043 currentHookNameInDev = "useImperativeHandle"; 11044 warnInvalidHookAccess(); 11045 updateHookTypesDev(); 11046 return updateImperativeHandle(ref, create, deps); 11047 }, 11048 useInsertionEffect: function(create, deps) { 11049 currentHookNameInDev = "useInsertionEffect"; 11050 warnInvalidHookAccess(); 11051 updateHookTypesDev(); 11052 return updateInsertionEffect(create, deps); 11053 }, 11054 useLayoutEffect: function(create, deps) { 11055 currentHookNameInDev = "useLayoutEffect"; 11056 warnInvalidHookAccess(); 11057 updateHookTypesDev(); 11058 return updateLayoutEffect(create, deps); 11059 }, 11060 useMemo: function(create, deps) { 11061 currentHookNameInDev = "useMemo"; 11062 warnInvalidHookAccess(); 11063 updateHookTypesDev(); 11064 var prevDispatcher = ReactCurrentDispatcher$1.current; 11065 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; 11066 try { 11067 return updateMemo(create, deps); 11068 } finally { 11069 ReactCurrentDispatcher$1.current = prevDispatcher; 11070 } 11071 }, 11072 useReducer: function(reducer, initialArg, init) { 11073 currentHookNameInDev = "useReducer"; 11074 warnInvalidHookAccess(); 11075 updateHookTypesDev(); 11076 var prevDispatcher = ReactCurrentDispatcher$1.current; 11077 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; 11078 try { 11079 return rerenderReducer(reducer, initialArg, init); 11080 } finally { 11081 ReactCurrentDispatcher$1.current = prevDispatcher; 11082 } 11083 }, 11084 useRef: function(initialValue) { 11085 currentHookNameInDev = "useRef"; 11086 warnInvalidHookAccess(); 11087 updateHookTypesDev(); 11088 return updateRef(); 11089 }, 11090 useState: function(initialState) { 11091 currentHookNameInDev = "useState"; 11092 warnInvalidHookAccess(); 11093 updateHookTypesDev(); 11094 var prevDispatcher = ReactCurrentDispatcher$1.current; 11095 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; 11096 try { 11097 return rerenderState(initialState); 11098 } finally { 11099 ReactCurrentDispatcher$1.current = prevDispatcher; 11100 } 11101 }, 11102 useDebugValue: function(value, formatterFn) { 11103 currentHookNameInDev = "useDebugValue"; 11104 warnInvalidHookAccess(); 11105 updateHookTypesDev(); 11106 return updateDebugValue(); 11107 }, 11108 useDeferredValue: function(value) { 11109 currentHookNameInDev = "useDeferredValue"; 11110 warnInvalidHookAccess(); 11111 updateHookTypesDev(); 11112 return rerenderDeferredValue(value); 11113 }, 11114 useTransition: function() { 11115 currentHookNameInDev = "useTransition"; 11116 warnInvalidHookAccess(); 11117 updateHookTypesDev(); 11118 return rerenderTransition(); 11119 }, 11120 useMutableSource: function(source, getSnapshot, subscribe) { 11121 currentHookNameInDev = "useMutableSource"; 11122 warnInvalidHookAccess(); 11123 updateHookTypesDev(); 11124 return updateMutableSource(); 11125 }, 11126 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) { 11127 currentHookNameInDev = "useSyncExternalStore"; 11128 warnInvalidHookAccess(); 11129 updateHookTypesDev(); 11130 return updateSyncExternalStore(subscribe, getSnapshot); 11131 }, 11132 useId: function() { 11133 currentHookNameInDev = "useId"; 11134 warnInvalidHookAccess(); 11135 updateHookTypesDev(); 11136 return updateId(); 11137 }, 11138 unstable_isNewReconciler: enableNewReconciler 11139 }; 11140 var now$1 = Scheduler.unstable_now; 11141 var commitTime = 0; 11142 var layoutEffectStartTime = -1; 11143 var profilerStartTime = -1; 11144 var passiveEffectStartTime = -1; 11145 /** 11146 * Tracks whether the current update was a nested/cascading update (scheduled from a layout effect). 11147 * 11148 * The overall sequence is: 11149 * 1. render 11150 * 2. commit (and call `onRender`, `onCommit`) 11151 * 3. check for nested updates 11152 * 4. flush passive effects (and call `onPostCommit`) 11153 * 11154 * Nested updates are identified in step 3 above, 11155 * but step 4 still applies to the work that was just committed. 11156 * We use two flags to track nested updates then: 11157 * one tracks whether the upcoming update is a nested update, 11158 * and the other tracks whether the current update was a nested update. 11159 * The first value gets synced to the second at the start of the render phase. 11160 */ 11161 var currentUpdateIsNested = false;
11162 var nestedUpdateScheduled = false; 11163 function isCurrentUpdateNested() { 11164 return currentUpdateIsNested; 11165 } 11166 function markNestedUpdateScheduled() { 11167 nestedUpdateScheduled = true; 11168 } 11169 function resetNestedUpdateFlag() { 11170 currentUpdateIsNested = false; 11171 nestedUpdateScheduled = false; 11172 } 11173 function syncNestedUpdateFlag() { 11174 currentUpdateIsNested = nestedUpdateScheduled; 11175 nestedUpdateScheduled = false; 11176 } 11177 function getCommitTime() { 11178 return commitTime; 11179 } 11180 function recordCommitTime() { 11181 commitTime = now$1(); 11182 } 11183 function startProfilerTimer(fiber) { 11184 profilerStartTime = now$1(); 11185 if (fiber.actualStartTime < 0) fiber.actualStartTime = now$1(); 11186 } 11187 function stopProfilerTimerIfRunning(fiber) { 11188 profilerStartTime = -1; 11189 } 11190 function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { 11191 if (profilerStartTime >= 0) { 11192 var elapsedTime = now$1() - profilerStartTime; 11193 fiber.actualDuration += elapsedTime; 11194 if (overrideBaseTime) fiber.selfBaseDuration = elapsedTime; 11195 profilerStartTime = -1; 11196 } 11197 } 11198 function recordLayoutEffectDuration(fiber) { 11199 if (layoutEffectStartTime >= 0) { 11200 var elapsedTime = now$1() - layoutEffectStartTime; 11201 layoutEffectStartTime = -1; 11202 var parentFiber = fiber.return; 11203 while (parentFiber !== null) { 11204 switch (parentFiber.tag) { 11205 case HostRoot: 11206 var root = parentFiber.stateNode; 11207 root.effectDuration += elapsedTime; 11208 return; 11209 case Profiler: 11210 var parentStateNode = parentFiber.stateNode; 11211 parentStateNode.effectDuration += elapsedTime; 11212 return; 11213 } 11214 parentFiber = parentFiber.return; 11215 } 11216 } 11217 } 11218 function recordPassiveEffectDuration(fiber) { 11219 if (passiveEffectStartTime >= 0) { 11220 var elapsedTime = now$1() - passiveEffectStartTime; 11221 passiveEffectStartTime = -1; 11222 var parentFiber = fiber.return; 11223 while (parentFiber !== null) { 11224 switch (parentFiber.tag) { 11225 case HostRoot: 11226 var root = parentFiber.stateNode; 11227 if (root !== null) root.passiveEffectDuration += elapsedTime; 11228 return; 11229 case Profiler: 11230 var parentStateNode = parentFiber.stateNode; 11231 if (parentStateNode !== null) parentStateNode.passiveEffectDuration += elapsedTime; 11232 return; 11233 } 11234 parentFiber = parentFiber.return; 11235 } 11236 } 11237 } 11238 function startLayoutEffectTimer() { 11239 layoutEffectStartTime = now$1(); 11240 } 11241 function startPassiveEffectTimer() { 11242 passiveEffectStartTime = now$1(); 11243 } 11244 function transferActualDuration(fiber) { 11245 var child = fiber.child; 11246 while (child) { 11247 fiber.actualDuration += child.actualDuration; 11248 child = child.sibling; 11249 } 11250 } 11251 function resolveDefaultProps(Component, baseProps) { 11252 if (Component && Component.defaultProps) { 11253 var props = assign({}, baseProps); 11254 var defaultProps = Component.defaultProps; 11255 for (var propName in defaultProps) if (props[propName] === void 0) props[propName] = defaultProps[propName]; 11256 return props; 11257 } 11258 return baseProps; 11259 } 11260 var fakeInternalInstance = {}; 11261 var didWarnAboutStateAssignmentForComponent; 11262 var didWarnAboutUninitializedState; 11263 var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate; 11264 var didWarnAboutLegacyLifecyclesAndDerivedState; 11265 var didWarnAboutUndefinedDerivedState; 11266 var warnOnUndefinedDerivedState;
11267 var warnOnInvalidCallback; 11268 var didWarnAboutDirectlyAssigningPropsToState; 11269 var didWarnAboutContextTypeAndContextTypes; 11270 var didWarnAboutInvalidateContextType; 11271 var didWarnAboutLegacyContext$1; 11272 didWarnAboutStateAssignmentForComponent = /* @__PURE__ */ new Set(); 11273 didWarnAboutUninitializedState = /* @__PURE__ */ new Set(); 11274 didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = /* @__PURE__ */ new Set(); 11275 didWarnAboutLegacyLifecyclesAndDerivedState = /* @__PURE__ */ new Set(); 11276 didWarnAboutDirectlyAssigningPropsToState = /* @__PURE__ */ new Set(); 11277 didWarnAboutUndefinedDerivedState = /* @__PURE__ */ new Set(); 11278 didWarnAboutContextTypeAndContextTypes = /* @__PURE__ */ new Set(); 11279 didWarnAboutInvalidateContextType = /* @__PURE__ */ new Set(); 11280 didWarnAboutLegacyContext$1 = /* @__PURE__ */ new Set(); 11281 var didWarnOnInvalidCallback = /* @__PURE__ */ new Set(); 11282 warnOnInvalidCallback = function(callback, callerName) { 11283 if (callback === null || typeof callback === "function") return; 11284 var key = callerName + "_" + callback; 11285 if (!didWarnOnInvalidCallback.has(key)) { 11286 didWarnOnInvalidCallback.add(key); 11287 error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback); 11288 } 11289 }; 11290 warnOnUndefinedDerivedState = function(type, partialState) { 11291 if (partialState === void 0) { 11292 var componentName = getComponentNameFromType(type) || "Component"; 11293 if (!didWarnAboutUndefinedDerivedState.has(componentName)) { 11294 didWarnAboutUndefinedDerivedState.add(componentName); 11295 error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", componentName); 11296 } 11297 } 11298 }; 11299 Object.defineProperty(fakeInternalInstance, "_processChildContext", { 11300 enumerable: false, 11301 value: function() { 11302 throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal)."); 11303 } 11304 }); 11305 Object.freeze(fakeInternalInstance); 11306 function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { 11307 var prevState = workInProgress.memoizedState; 11308 var partialState = getDerivedStateFromProps(nextProps, prevState); 11309 if (workInProgress.mode & StrictLegacyMode) { 11310 setIsStrictModeForDevtools(true); 11311 try { 11312 partialState = getDerivedStateFromProps(nextProps, prevState); 11313 } finally { 11314 setIsStrictModeForDevtools(false); 11315 } 11316 } 11317 warnOnUndefinedDerivedState(ctor, partialState); 11318 var memoizedState = partialState === null || partialState === void 0 ? prevState : assign({}, prevState, partialState); 11319 workInProgress.memoizedState = memoizedState; 11320 if (workInProgress.lanes === NoLanes) { 11321 var updateQueue = workInProgress.updateQueue; 11322 updateQueue.baseState = memoizedState; 11323 } 11324 } 11325 var classComponentUpdater = { 11326 isMounted, 11327 enqueueSetState: function(inst, payload, callback) { 11328 var fiber = get(inst); 11329 var eventTime = requestEventTime(); 11330 var lane = requestUpdateLane(fiber); 11331 var update = createUpdate(eventTime, lane); 11332 update.payload = payload; 11333 if (callback !== void 0 && callback !== null) {
11334 warnOnInvalidCallback(callback, "setState"); 11335 update.callback = callback; 11336 } 11337 var root = enqueueUpdate(fiber, update, lane); 11338 if (root !== null) { 11339 scheduleUpdateOnFiber(root, fiber, lane, eventTime); 11340 entangleTransitions(root, fiber, lane); 11341 } 11342 markStateUpdateScheduled(fiber, lane); 11343 }, 11344 enqueueReplaceState: function(inst, payload, callback) { 11345 var fiber = get(inst); 11346 var eventTime = requestEventTime(); 11347 var lane = requestUpdateLane(fiber); 11348 var update = createUpdate(eventTime, lane); 11349 update.tag = ReplaceState; 11350 update.payload = payload; 11351 if (callback !== void 0 && callback !== null) { 11352 warnOnInvalidCallback(callback, "replaceState"); 11353 update.callback = callback; 11354 } 11355 var root = enqueueUpdate(fiber, update, lane); 11356 if (root !== null) { 11357 scheduleUpdateOnFiber(root, fiber, lane, eventTime); 11358 entangleTransitions(root, fiber, lane); 11359 } 11360 markStateUpdateScheduled(fiber, lane); 11361 }, 11362 enqueueForceUpdate: function(inst, callback) { 11363 var fiber = get(inst); 11364 var eventTime = requestEventTime(); 11365 var lane = requestUpdateLane(fiber); 11366 var update = createUpdate(eventTime, lane); 11367 update.tag = ForceUpdate; 11368 if (callback !== void 0 && callback !== null) {
11369 warnOnInvalidCallback(callback, "forceUpdate"); 11370 update.callback = callback; 11371 } 11372 var root = enqueueUpdate(fiber, update, lane); 11373 if (root !== null) { 11374 scheduleUpdateOnFiber(root, fiber, lane, eventTime); 11375 entangleTransitions(root, fiber, lane); 11376 } 11377 markForceUpdateScheduled(fiber, lane); 11378 } 11379 }; 11380 function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { 11381 var instance = workInProgress.stateNode; 11382 if (typeof instance.shouldComponentUpdate === "function") { 11383 var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); 11384 if (workInProgress.mode & StrictLegacyMode) { 11385 setIsStrictModeForDevtools(true); 11386 try { 11387 shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); 11388 } finally { 11389 setIsStrictModeForDevtools(false); 11390 } 11391 } 11392 if (shouldUpdate === void 0) error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentNameFromType(ctor) || "Component"); 11393 return shouldUpdate; 11394 } 11395 if (ctor.prototype && ctor.prototype.isPureReactComponent) return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); 11396 return true; 11397 } 11398 function checkClassInstance(workInProgress, ctor, newProps) { 11399 var instance = workInProgress.stateNode; 11400 var name = getComponentNameFromType(ctor) || "Component"; 11401 if (!instance.render) if (ctor.prototype && typeof ctor.prototype.render === "function") error("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", name); 11402 else error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name); 11403 if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", name); 11404 if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", name); 11405 if (instance.propTypes) error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name); 11406 if (instance.contextType) error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name); 11407 if (ctor.childContextTypes && !didWarnAboutLegacyContext$1.has(ctor) && (workInProgress.mode & StrictLegacyMode) === NoMode) { 11408 didWarnAboutLegacyContext$1.add(ctor); 11409 error("%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead\n\n.Learn more about this warning here: https://reactjs.org/link/legacy-context", name); 11410 } 11411 if (ctor.contextTypes && !didWarnAboutLegacyContext$1.has(ctor) && (workInProgress.mode & StrictLegacyMode) === NoMode) { 11412 didWarnAboutLegacyContext$1.add(ctor); 11413 error("%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead.\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", name); 11414 } 11415 if (instance.contextTypes) error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name); 11416 if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) { 11417 didWarnAboutContextTypeAndContextTypes.add(ctor); 11418 error("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name); 11419 } 11420 if (typeof instance.componentShouldUpdate === "function") error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", name); 11421 if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", getComponentNameFromType(ctor) || "A pure component"); 11422 if (typeof instance.componentDidUnmount === "function") error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", name); 11423 if (typeof instance.componentDidReceiveProps === "function") error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", name); 11424 if (typeof instance.componentWillRecieveProps === "function") error("%s has a method called componentWillRecieveProps(). Did
11424you mean componentWillReceiveProps()?", name); 11425 if (typeof instance.UNSAFE_componentWillRecieveProps === "function") error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name); 11426 var hasMutatedProps = instance.props !== newProps; 11427 if (instance.props !== void 0 && hasMutatedProps) error("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", name, name); 11428 if (instance.defaultProps) error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", name, name); 11429 if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) { 11430 didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); 11431 error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", getComponentNameFromType(ctor)); 11432 } 11433 if (typeof instance.getDerivedStateFromProps === "function") error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name); 11434 if (typeof instance.getDerivedStateFromError === "function") error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name); 11435 if (typeof ctor.getSnapshotBeforeUpdate === "function") error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", name); 11436 var _state = instance.state; 11437 if (_state && (typeof _state !== "object" || isArray(_state))) error("%s.state: must be set to an object or null", name); 11438 if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name); 11439 } 11440 function adoptClassInstance(workInProgress, instance) { 11441 instance.updater = classComponentUpdater; 11442 workInProgress.stateNode = instance; 11443 set(instance, workInProgress); 11444 instance._reactInternalInstance = fakeInternalInstance; 11445 } 11446 function constructClassInstance(workInProgress, ctor, props) { 11447 var isLegacyContextConsumer = false; 11448 var unmaskedContext = emptyContextObject; 11449 var context = emptyContextObject; 11450 var contextType = ctor.contextType; 11451 if ("contextType" in ctor) { 11452 if (!(contextType === null || contextType !== void 0 && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === void 0) && !didWarnAboutInvalidateContextType.has(ctor)) { 11453 didWarnAboutInvalidateContextType.add(ctor); 11454 var addendum = ""; 11455 if (contextType === void 0) addendum = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file."; 11456 else if (typeof contextType !== "object") addendum = " However, it is set to a " + typeof contextType + "."; 11457 else if (contextType.$$typeof === REACT_PROVIDER_TYPE) addendum = " Did you accidentally pass the Context.Provider instead?"; 11458 else if (contextType._context !== void 0) addendum = " Did you accidentally pass the Context.Consumer instead?"; 11459 else addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}."; 11460 error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", addendum); 11461 } 11462 } 11463 if (typeof contextType === "object" && contextType !== null) context = readContext(contextType); 11464 else { 11465 unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); 11466 var contextTypes = ctor.contextTypes; 11467 isLegacyContextConsumer = contextTypes !== null && contextTypes !== void 0; 11468 context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject; 11469 } 11470 var instance = new ctor(props, context); 11471 if (workInProgress.mode & StrictLegacyMode) { 11472 setIsStrictModeForDevtools(true);
11473 try { 11474 instance = new ctor(props, context); 11475 } finally { 11476 setIsStrictModeForDevtools(false); 11477 } 11478 } 11479 var state = workInProgress.memoizedState = instance.state !== null && instance.state !== void 0 ? instance.state : null; 11480 adoptClassInstance(workInProgress, instance); 11481 if (typeof ctor.getDerivedStateFromProps === "function" && state === null) { 11482 var componentName = getComponentNameFromType(ctor) || "Component"; 11483 if (!didWarnAboutUninitializedState.has(componentName)) { 11484 didWarnAboutUninitializedState.add(componentName); 11485 error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", componentName, instance.state === null ? "null" : "undefined", componentName); 11486 } 11487 } 11488 if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") { 11489 var foundWillMountName = null; 11490 var foundWillReceivePropsName = null; 11491 var foundWillUpdateName = null; 11492 if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) foundWillMountName = "componentWillMount"; 11493 else if (typeof instance.UNSAFE_componentWillMount === "function") foundWillMountName = "UNSAFE_componentWillMount"; 11494 if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) foundWillReceivePropsName = "componentWillReceiveProps"; 11495 else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"; 11496 if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) foundWillUpdateName = "componentWillUpdate"; 11497 else if (typeof instance.UNSAFE_componentWillUpdate === "function") foundWillUpdateName = "UNSAFE_componentWillUpdate"; 11498 if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { 11499 var _componentName = getComponentNameFromType(ctor) || "Component"; 11500 var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()"; 11501 if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { 11502 didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); 11503 error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles", _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : "", foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : "", foundWillUpdateName !== null ? "\n " + foundWillUpdateName : ""); 11504 } 11505 } 11506 } 11507 if (isLegacyContextConsumer) cacheContext(workInProgress, unmaskedContext, context); 11508 return instance; 11509 } 11510 function callComponentWillMount(workInProgress, instance) { 11511 var oldState = instance.state; 11512 if (typeof instance.componentWillMount === "function") instance.componentWillMount(); 11513 if (typeof instance.UNSAFE_componentWillMount === "function") instance.UNSAFE_componentWillMount(); 11514 if (oldState !== instance.state) { 11515 error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", getComponentNameFromFiber(workInProgress) || "Component"); 11516 classComponentUpdater.enqueueReplaceState(instance, instance.state, null); 11517 } 11518 } 11519 function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { 11520 var oldState = instance.state; 11521 if (typeof instance.componentWillReceiveProps === "function") instance.componentWillReceiveProps(newProps, nextContext); 11522 if (typeof instance.UNSAFE_componentWillReceiveProps === "function") instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); 11523 if (instance.state !== oldState) { 11524 var componentName = getComponentNameFromFiber(workInProgress) || "Component"; 11525 if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { 11526 didWarnAboutStateAssignmentForComponent.add(componentName); 11527 error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", componentName); 11528 } 11529 classComponentUpdater.enqueueReplaceState(instance, instance.state, null); 11530 } 11531 } 11532 function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { 11533 checkClassInstance(workInProgress, ctor, newProps); 11534 var instance = workInProgress.stateNode; 11535 instance.props = newProps; 11536 instance.state = workInProgress.memoizedState; 11537 instance.refs = {}; 11538 initializeUpdateQueue(workInProgress); 11539 var contextType = ctor.contextType; 11540 if (typeof contextType === "object" && contextType !== null) instance.context = readContext(contextType); 11541 else instance.context = getMaskedContext(workInProgress, getUnmaskedContext(workInProgress, ctor, true)); 11542 if (instance.state === newProps) { 11543 var componentName = getComponentNameFromType(ctor) || "Component"; 11544 if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { 11545 didWarnAboutDirectlyAssigningPropsToState.add(componentName); 11546 error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", componentName); 11547 } 11548 } 11549 if (workInProgress.mode & StrictLegacyMode) ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);
11550 ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); 11551 instance.state = workInProgress.memoizedState; 11552 var getDerivedStateFromProps = ctor.getDerivedStateFromProps; 11553 if (typeof getDerivedStateFromProps === "function") { 11554 applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); 11555 instance.state = workInProgress.memoizedState; 11556 } 11557 if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) { 11558 callComponentWillMount(workInProgress, instance); 11559 processUpdateQueue(workInProgress, newProps, instance, renderLanes); 11560 instance.state = workInProgress.memoizedState; 11561 } 11562 if (typeof instance.componentDidMount === "function") { 11563 var fiberFlags = Update; 11564 fiberFlags |= LayoutStatic; 11565 if ((workInProgress.mode & StrictEffectsMode) !== NoMode) fiberFlags |= MountLayoutDev; 11566 workInProgress.flags |= fiberFlags; 11567 } 11568 } 11569 function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { 11570 var instance = workInProgress.stateNode; 11571 var oldProps = workInProgress.memoizedProps; 11572 instance.props = oldProps; 11573 var oldContext = instance.context; 11574 var contextType = ctor.contextType; 11575 var nextContext = emptyContextObject; 11576 if (typeof contextType === "object" && contextType !== null) nextContext = readContext(contextType); 11577 else nextContext = getMaskedContext(workInProgress, getUnmaskedContext(workInProgress, ctor, true)); 11578 var getDerivedStateFromProps = ctor.getDerivedStateFromProps; 11579 var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function"; 11580 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) { 11581 if (oldProps !== newProps || oldContext !== nextContext) callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); 11582 } 11583 resetHasForceUpdateBeforeProcessing(); 11584 var oldState = workInProgress.memoizedState; 11585 var newState = instance.state = oldState; 11586 processUpdateQueue(workInProgress, newProps, instance, renderLanes); 11587 newState = workInProgress.memoizedState; 11588 if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { 11589 if (typeof instance.componentDidMount === "function") { 11590 var fiberFlags = Update; 11591 fiberFlags |= LayoutStatic; 11592 if ((workInProgress.mode & StrictEffectsMode) !== NoMode) fiberFlags |= MountLayoutDev; 11593 workInProgress.flags |= fiberFlags; 11594 } 11595 return false; 11596 } 11597 if (typeof getDerivedStateFromProps === "function") { 11598 applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); 11599 newState = workInProgress.memoizedState; 11600 } 11601 var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); 11602 if (shouldUpdate) { 11603 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) { 11604 if (typeof instance.componentWillMount === "function") instance.componentWillMount(); 11605 if (typeof instance.UNSAFE_componentWillMount === "function") instance.UNSAFE_componentWillMount(); 11606 } 11607 if (typeof instance.componentDidMount === "function") { 11608 var _fiberFlags = Update; 11609 _fiberFlags |= LayoutStatic; 11610 if ((workInProgress.mode & StrictEffectsMode) !== NoMode) _fiberFlags |= MountLayoutDev; 11611 workInProgress.flags |= _fiberFlags; 11612 } 11613 } else { 11614 if (typeof instance.componentDidMount === "function") { 11615 var _fiberFlags2 = Update; 11616 _fiberFlags2 |= LayoutStatic; 11617 if ((workInProgress.mode & StrictEffectsMode) !== NoMode) _fiberFlags2 |= MountLayoutDev; 11618 workInProgress.flags |= _fiberFlags2; 11619 } 11620 workInProgress.memoizedProps = newProps; 11621 workInProgress.memoizedState = newState; 11622 } 11623 instance.props = newProps; 11624 instance.state = newState; 11625 instance.context = nextContext; 11626 return shouldUpdate; 11627 } 11628 function updateClassInstance(current, workInProgress, ctor, newProps, renderLanes) { 11629 var instance = workInProgress.stateNode; 11630 cloneUpdateQueue(current, workInProgress); 11631 var unresolvedOldProps = workInProgress.memoizedProps; 11632 var oldProps = workInProgress.type === workInProgress.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps); 11633 instance.props = oldProps; 11634 var unresolvedNewProps = workInProgress.pendingProps; 11635 var oldContext = instance.context; 11636 var contextType = ctor.contextType; 11637 var nextContext = emptyContextObject; 11638 if (typeof contextType === "object" && contextType !== null) nextContext = readContext(contextType); 11639 else nextContext = getMaskedContext(workInProgress, getUnmaskedContext(workInProgress, ctor, true)); 11640 var getDerivedStateFromProps = ctor.getDerivedStateFromProps; 11641 var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function"; 11642 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) { 11643 if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); 11644 } 11645 resetHasForceUpdateBeforeProcessing(); 11646 var oldState = workInProgress.memoizedState; 11647 var newState = instance.state = oldState; 11648 processUpdateQueue(workInProgress, newProps, instance, renderLanes); 11649 newState = workInProgress.memoizedState; 11650 if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !enableLazyContextPropagation) { 11651 if (typeof instance.componentDidUpdate === "function") { 11652 if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) workInProgress.flags |= Update; 11653 } 11654 if (typeof instance.getSnapshotBeforeUpdate === "function") { 11655 if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) workInProgress.flags |= Snapshot; 11656 } 11657 return false;
11658 } 11659 if (typeof getDerivedStateFromProps === "function") { 11660 applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); 11661 newState = workInProgress.memoizedState; 11662 } 11663 var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) || enableLazyContextPropagation; 11664 if (shouldUpdate) { 11665 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) { 11666 if (typeof instance.componentWillUpdate === "function") instance.componentWillUpdate(newProps, newState, nextContext); 11667 if (typeof instance.UNSAFE_componentWillUpdate === "function") instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext); 11668 } 11669 if (typeof instance.componentDidUpdate === "function") workInProgress.flags |= Update; 11670 if (typeof instance.getSnapshotBeforeUpdate === "function") workInProgress.flags |= Snapshot; 11671 } else { 11672 if (typeof instance.componentDidUpdate === "function") { 11673 if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) workInProgress.flags |= Update; 11674 } 11675 if (typeof instance.getSnapshotBeforeUpdate === "function") { 11676 if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) workInProgress.flags |= Snapshot; 11677 } 11678 workInProgress.memoizedProps = newProps; 11679 workInProgress.memoizedState = newState; 11680 } 11681 instance.props = newProps; 11682 instance.state = newState; 11683 instance.context = nextContext; 11684 return shouldUpdate; 11685 } 11686 function createCapturedValueAtFiber(value, source) { 11687 return { 11688 value, 11689 source, 11690 stack: getStackByFiberInDevAndProd(source), 11691 digest: null 11692 }; 11693 } 11694 function createCapturedValue(value, digest, stack) { 11695 return { 11696 value, 11697 source: null, 11698 stack: stack != null ? stack : null, 11699 digest: digest != null ? digest : null 11700 }; 11701 } 11702 function showErrorDialog(boundary, errorInfo) { 11703 return true; 11704 } 11705 function logCapturedError(boundary, errorInfo) { 11706 try { 11707 if (showErrorDialog(boundary, errorInfo) === false) return; 11708 var error = errorInfo.value; 11709 var source = errorInfo.source; 11710 var stack = errorInfo.stack; 11711 var componentStack = stack !== null ? stack : ""; 11712 if (error != null && error._suppressLogging) { 11713 if (boundary.tag === ClassComponent) return; 11714 console["error"](error); 11715 } 11716 var componentName = source ? getComponentNameFromFiber(source) : null; 11717 var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:"; 11718 var errorBoundaryMessage; 11719 if (boundary.tag === HostRoot) errorBoundaryMessage = "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries."; 11720 else errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + (getComponentNameFromFiber(boundary) || "Anonymous") + "."); 11721 var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage); 11722 console["error"](combinedMessage); 11723 } catch (e) { 11724 setTimeout(function() { 11725 throw e; 11726 }); 11727 } 11728 } 11729 var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map; 11730 function createRootErrorUpdate(fiber, errorInfo, lane) { 11731 var update = createUpdate(NoTimestamp, lane); 11732 update.tag = CaptureUpdate; 11733 update.payload = { element: null }; 11734 var error = errorInfo.value; 11735 update.callback = function() { 11736 onUncaughtError(error); 11737 logCapturedError(fiber, errorInfo); 11738 }; 11739 return update; 11740 } 11741 function createClassErrorUpdate(fiber, errorInfo, lane) { 11742 var update = createUpdate(NoTimestamp, lane); 11743 update.tag = CaptureUpdate; 11744 var getDerivedStateFromError = fiber.type.getDerivedStateFromError; 11745 if (typeof getDerivedStateFromError === "function") { 11746 var error$1 = errorInfo.value; 11747 update.payload = function() { 11748 return getDerivedStateFromError(error$1); 11749 }; 11750 update.callback = function() { 11751 markFailedErrorBoundaryForHotReloading(fiber); 11752 logCapturedError(fiber, errorInfo); 11753 }; 11754 } 11755 var inst = fiber.stateNode; 11756 if (inst !== null && typeof inst.componentDidCatch === "function") update.callback = function callback() { 11757 markFailedErrorBoundaryForHotReloading(fiber); 11758 logCapturedError(fiber, errorInfo); 11759 if (typeof getDerivedStateFromError !== "function") markLegacyErrorBoundaryAsFailed(this); 11760 var error$1 = errorInfo.value; 11761 var stack = errorInfo.stack; 11762 this.componentDidCatch(error$1, { componentStack: stack !== null ? stack : "" }); 11763 if (typeof getDerivedStateFromError !== "function") { 11764 if (!includesSomeLane(fiber.lanes, SyncLane)) error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown"); 11765 } 11766 }; 11767 return update; 11768 } 11769 function attachPingListener(root, wakeable, lanes) { 11770 var pingCache = root.pingCache; 11771 var threadIDs; 11772 if (pingCache === null) { 11773 pingCache = root.pingCache = new PossiblyWeakMap$1(); 11774 threadIDs = /* @__PURE__ */ new Set(); 11775 pingCache.set(wakeable, threadIDs); 11776 } else { 11777 threadIDs = pingCache.get(wakeable); 11778 if (threadIDs === void 0) { 11779 threadIDs = /* @__PURE__ */ new Set(); 11780 pingCache.set(wakeable, threadIDs); 11781 } 11782 } 11783 if (!threadIDs.has(lanes)) { 11784 threadIDs.add(lanes); 11785 var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes); 11786 if (isDevToolsPresent) restorePendingUpdaters(root, lanes); 11787 wakeable.then(ping, ping); 11788 } 11789 } 11790 function attachRetryListener(suspenseBoundary, root, wakeable, lanes) { 11791 var wakeables = suspenseBoundary.updateQueue; 11792 if (wakeables === null) { 11793 var updateQueue = /* @__PURE__ */ new Set(); 11794 updateQueue.add(wakeable); 11795 suspenseBoundary.updateQueue = updateQueue; 11796 } else wakeables.add(wakeable); 11797 }
11798 function resetSuspendedComponent(sourceFiber, rootRenderLanes) { 11799 var tag = sourceFiber.tag; 11800 if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) { 11801 var currentSource = sourceFiber.alternate; 11802 if (currentSource) { 11803 sourceFiber.updateQueue = currentSource.updateQueue; 11804 sourceFiber.memoizedState = currentSource.memoizedState; 11805 sourceFiber.lanes = currentSource.lanes; 11806 } else { 11807 sourceFiber.updateQueue = null; 11808 sourceFiber.memoizedState = null; 11809 } 11810 } 11811 } 11812 function getNearestSuspenseBoundaryToCapture(returnFiber) { 11813 var node = returnFiber; 11814 do { 11815 if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) return node; 11816 node = node.return; 11817 } while (node !== null); 11818 return null; 11819 } 11820 function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes) { 11821 if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) { 11822 if (suspenseBoundary === returnFiber) suspenseBoundary.flags |= ShouldCapture; 11823 else { 11824 suspenseBoundary.flags |= DidCapture; 11825 sourceFiber.flags |= ForceUpdateForLegacySuspense; 11826 sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete); 11827 if (sourceFiber.tag === ClassComponent) if (sourceFiber.alternate === null) sourceFiber.tag = IncompleteClassComponent; 11828 else { 11829 var update = createUpdate(NoTimestamp, SyncLane); 11830 update.tag = ForceUpdate; 11831 enqueueUpdate(sourceFiber, update, SyncLane); 11832 } 11833 sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane); 11834 } 11835 return suspenseBoundary; 11836 } 11837 suspenseBoundary.flags |= ShouldCapture; 11838 suspenseBoundary.lanes = rootRenderLanes; 11839 return suspenseBoundary; 11840 } 11841 function throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) { 11842 sourceFiber.flags |= Incomplete; 11843 if (isDevToolsPresent) restorePendingUpdaters(root, rootRenderLanes); 11844 if (value !== null && typeof value === "object" && typeof value.then === "function") { 11845 var wakeable = value; 11846 resetSuspendedComponent(sourceFiber); 11847 if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) markDidThrowWhileHydratingDEV(); 11848 var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber); 11849 if (suspenseBoundary !== null) { 11850 suspenseBoundary.flags &= ~ForceClientRender; 11851 markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes); 11852 if (suspenseBoundary.mode & ConcurrentMode) attachPingListener(root, wakeable, rootRenderLanes); 11853 attachRetryListener(suspenseBoundary, root, wakeable); 11854 return; 11855 } else { 11856 if (!includesSyncLane(rootRenderLanes)) { 11857 attachPingListener(root, wakeable, rootRenderLanes); 11858 renderDidSuspendDelayIfPossible(); 11859 return; 11860 } 11861 value = /* @__PURE__ */ new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition."); 11862 } 11863 } else if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) { 11864 markDidThrowWhileHydratingDEV(); 11865 var _suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber); 11866 if (_suspenseBoundary !== null) { 11867 if ((_suspenseBoundary.flags & ShouldCapture) === NoFlags) _suspenseBoundary.flags |= ForceClientRender; 11868 markSuspenseBoundaryShouldCapture(_suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes); 11869 queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)); 11870 return; 11871 } 11872 } 11873 value = createCapturedValueAtFiber(value, sourceFiber); 11874 renderDidError(value); 11875 var workInProgress = returnFiber; 11876 do { 11877 switch (workInProgress.tag) { 11878 case HostRoot: 11879 var _errorInfo = value; 11880 workInProgress.flags |= ShouldCapture; 11881 var lane = pickArbitraryLane(rootRenderLanes); 11882 workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); 11883 var update = createRootErrorUpdate(workInProgress, _errorInfo, lane); 11884 enqueueCapturedUpdate(workInProgress, update); 11885 return; 11886 case ClassComponent: 11887 var errorInfo = value; 11888 var ctor = workInProgress.type; 11889 var instance = workInProgress.stateNode; 11890 if ((workInProgress.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) { 11891 workInProgress.flags |= ShouldCapture; 11892 var _lane = pickArbitraryLane(rootRenderLanes); 11893 workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); 11894 var _update = createClassErrorUpdate(workInProgress, errorInfo, _lane); 11895 enqueueCapturedUpdate(workInProgress, _update); 11896 return; 11897 } 11898 break; 11899 } 11900 workInProgress = workInProgress.return; 11901 } while (workInProgress !== null); 11902 } 11903 function getSuspendedCache() { 11904 return null; 11905 } 11906 var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; 11907 var didReceiveUpdate = false;
11908 var didWarnAboutBadClass; 11909 var didWarnAboutModulePatternComponent; 11910 var didWarnAboutContextTypeOnFunctionComponent; 11911 var didWarnAboutGetDerivedStateOnFunctionComponent; 11912 var didWarnAboutFunctionRefs; 11913 var didWarnAboutReassigningProps; 11914 var didWarnAboutRevealOrder; 11915 var didWarnAboutTailOptions; 11916 var didWarnAboutDefaultPropsOnFunctionComponent; 11917 didWarnAboutBadClass = {}; 11918 didWarnAboutModulePatternComponent = {}; 11919 didWarnAboutContextTypeOnFunctionComponent = {}; 11920 didWarnAboutGetDerivedStateOnFunctionComponent = {}; 11921 didWarnAboutFunctionRefs = {}; 11922 didWarnAboutReassigningProps = false; 11923 didWarnAboutRevealOrder = {}; 11924 didWarnAboutTailOptions = {}; 11925 didWarnAboutDefaultPropsOnFunctionComponent = {}; 11926 function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { 11927 if (current === null) workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderLanes); 11928 else workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes); 11929 } 11930 function forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes) { 11931 workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes); 11932 workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes); 11933 } 11934 function updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) { 11935 if (workInProgress.type !== workInProgress.elementType) { 11936 var innerPropTypes = Component.propTypes; 11937 if (innerPropTypes) checkPropTypes(innerPropTypes, nextProps, "prop", getComponentNameFromType(Component)); 11938 } 11939 var render = Component.render; 11940 var ref = workInProgress.ref; 11941 var nextChildren; 11942 var hasId; 11943 prepareToReadContext(workInProgress, renderLanes); 11944 markComponentRenderStarted(workInProgress); 11945 ReactCurrentOwner$1.current = workInProgress; 11946 setIsRendering(true); 11947 nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes); 11948 hasId = checkDidRenderIdHook(); 11949 if (workInProgress.mode & StrictLegacyMode) { 11950 setIsStrictModeForDevtools(true); 11951 try { 11952 nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes); 11953 hasId = checkDidRenderIdHook(); 11954 } finally { 11955 setIsStrictModeForDevtools(false); 11956 } 11957 } 11958 setIsRendering(false); 11959 markComponentRenderStopped(); 11960 if (current !== null && !didReceiveUpdate) { 11961 bailoutHooks(current, workInProgress, renderLanes); 11962 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); 11963 } 11964 if (getIsHydrating() && hasId) pushMaterializedTreeId(workInProgress); 11965 workInProgress.flags |= PerformedWork; 11966 reconcileChildren(current, workInProgress, nextChildren, renderLanes); 11967 return workInProgress.child; 11968 } 11969 function updateMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { 11970 if (current === null) { 11971 var type = Component.type; 11972 if (isSimpleFunctionComponent(type) && Component.compare === null && Component.defaultProps === void 0) { 11973 var resolvedType = type; 11974 resolvedType = resolveFunctionForHotReloading(type); 11975 workInProgress.tag = SimpleMemoComponent; 11976 workInProgress.type = resolvedType; 11977 validateFunctionComponentInDev(workInProgress, type); 11978 return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, renderLanes); 11979 } 11980 var innerPropTypes = type.propTypes; 11981 if (innerPropTypes) checkPropTypes(innerPropTypes, nextProps, "prop", getComponentNameFromType(type)); 11982 if (Component.defaultProps !== void 0) { 11983 var componentName = getComponentNameFromType(type) || "Unknown"; 11984 if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) { 11985 error("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.", componentName); 11986 didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true; 11987 } 11988 } 11989 var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes); 11990 child.ref = workInProgress.ref;
11991 child.return = workInProgress; 11992 workInProgress.child = child; 11993 return child; 11994 } 11995 var _type = Component.type; 11996 var _innerPropTypes = _type.propTypes; 11997 if (_innerPropTypes) checkPropTypes(_innerPropTypes, nextProps, "prop", getComponentNameFromType(_type)); 11998 var currentChild = current.child; 11999 if (!checkScheduledUpdateOrContext(current, renderLanes)) { 12000 var prevProps = currentChild.memoizedProps; 12001 var compare = Component.compare; 12002 compare = compare !== null ? compare : shallowEqual; 12003 if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); 12004 } 12005 workInProgress.flags |= PerformedWork; 12006 var newChild = createWorkInProgress(currentChild, nextProps); 12007 newChild.ref = workInProgress.ref; 12008 newChild.return = workInProgress; 12009 workInProgress.child = newChild; 12010 return newChild; 12011 } 12012 function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { 12013 if (workInProgress.type !== workInProgress.elementType) { 12014 var outerMemoType = workInProgress.elementType; 12015 if (outerMemoType.$$typeof === REACT_LAZY_TYPE) { 12016 var lazyComponent = outerMemoType; 12017 var payload = lazyComponent._payload; 12018 var init = lazyComponent._init; 12019 try { 12020 outerMemoType = init(payload); 12021 } catch (x) { 12022 outerMemoType = null; 12023 } 12024 var outerPropTypes = outerMemoType && outerMemoType.propTypes; 12025 if (outerPropTypes) checkPropTypes(outerPropTypes, nextProps, "prop", getComponentNameFromType(outerMemoType)); 12026 } 12027 } 12028 if (current !== null) { 12029 var prevProps = current.memoizedProps; 12030 if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && workInProgress.type === current.type) { 12031 didReceiveUpdate = false; 12032 workInProgress.pendingProps = nextProps = prevProps; 12033 if (!checkScheduledUpdateOrContext(current, renderLanes)) { 12034 workInProgress.lanes = current.lanes; 12035 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); 12036 } else if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) didReceiveUpdate = true; 12037 } 12038 } 12039 return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes); 12040 } 12041 function updateOffscreenComponent(current, workInProgress, renderLanes) { 12042 var nextProps = workInProgress.pendingProps; 12043 var nextChildren = nextProps.children; 12044 var prevState = current !== null ? current.memoizedState : null;
12045 if (nextProps.mode === "hidden" || enableLegacyHidden) if ((workInProgress.mode & ConcurrentMode) === NoMode) { 12046 workInProgress.memoizedState = { 12047 baseLanes: NoLanes, 12048 cachePool: null, 12049 transitions: null 12050 }; 12051 pushRenderLanes(workInProgress, renderLanes); 12052 } else if (!includesSomeLane(renderLanes, OffscreenLane)) { 12053 var spawnedCachePool = null; 12054 var nextBaseLanes; 12055 if (prevState !== null) { 12056 var prevBaseLanes = prevState.baseLanes; 12057 nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes); 12058 } else nextBaseLanes = renderLanes; 12059 workInProgress.lanes = workInProgress.childLanes = laneToLanes(OffscreenLane); 12060 workInProgress.memoizedState = { 12061 baseLanes: nextBaseLanes, 12062 cachePool: spawnedCachePool, 12063 transitions: null 12064 }; 12065 workInProgress.updateQueue = null; 12066 pushRenderLanes(workInProgress, nextBaseLanes); 12067 return null; 12068 } else { 12069 workInProgress.memoizedState = { 12070 baseLanes: NoLanes, 12071 cachePool: null, 12072 transitions: null 12073 }; 12074 pushRenderLanes(workInProgress, prevState !== null ? prevState.baseLanes : renderLanes); 12075 } 12076 else { 12077 var _subtreeRenderLanes; 12078 if (prevState !== null) { 12079 _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes); 12080 workInProgress.memoizedState = null; 12081 } else _subtreeRenderLanes = renderLanes; 12082 pushRenderLanes(workInProgress, _subtreeRenderLanes); 12083 } 12084 reconcileChildren(current, workInProgress, nextChildren, renderLanes); 12085 return workInProgress.child; 12086 } 12087 function updateFragment(current, workInProgress, renderLanes) { 12088 var nextChildren = workInProgress.pendingProps; 12089 reconcileChildren(current, workInProgress, nextChildren, renderLanes); 12090 return workInProgress.child; 12091 } 12092 function updateMode(current, workInProgress, renderLanes) { 12093 var nextChildren = workInProgress.pendingProps.children; 12094 reconcileChildren(current, workInProgress, nextChildren, renderLanes); 12095 return workInProgress.child; 12096 } 12097 function updateProfiler(current, workInProgress, renderLanes) { 12098 workInProgress.flags |= Update; 12099 var stateNode = workInProgress.stateNode; 12100 stateNode.effectDuration = 0; 12101 stateNode.passiveEffectDuration = 0; 12102 var nextChildren = workInProgress.pendingProps.children; 12103 reconcileChildren(current, workInProgress, nextChildren, renderLanes); 12104 return workInProgress.child; 12105 } 12106 function markRef(current, workInProgress) { 12107 var ref = workInProgress.ref; 12108 if (current === null && ref !== null || current !== null && current.ref !== ref) { 12109 workInProgress.flags |= Ref; 12110 workInProgress.flags |= RefStatic; 12111 } 12112 } 12113 function updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) { 12114 if (workInProgress.type !== workInProgress.elementType) { 12115 var innerPropTypes = Component.propTypes; 12116 if (innerPropTypes) checkPropTypes(innerPropTypes, nextProps, "prop", getComponentNameFromType(Component)); 12117 } 12118 var context = getMaskedContext(workInProgress, getUnmaskedContext(workInProgress, Component, true)); 12119 var nextChildren; 12120 var hasId; 12121 prepareToReadContext(workInProgress, renderLanes); 12122 markComponentRenderStarted(workInProgress); 12123 ReactCurrentOwner$1.current = workInProgress; 12124 setIsRendering(true); 12125 nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes); 12126 hasId = checkDidRenderIdHook(); 12127 if (workInProgress.mode & StrictLegacyMode) { 12128 setIsStrictModeForDevtools(true); 12129 try { 12130 nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes); 12131 hasId = checkDidRenderIdHook(); 12132 } finally { 12133 setIsStrictModeForDevtools(false); 12134 } 12135 } 12136 setIsRendering(false); 12137 markComponentRenderStopped(); 12138 if (current !== null && !didReceiveUpdate) { 12139 bailoutHooks(current, workInProgress, renderLanes); 12140 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); 12141 } 12142 if (getIsHydrating() && hasId) pushMaterializedTreeId(workInProgress); 12143 workInProgress.flags |= PerformedWork; 12144 reconcileChildren(current, workInProgress, nextChildren, renderLanes); 12145 return workInProgress.child; 12146 } 12147 function updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) { 12148 switch (shouldError(workInProgress)) { 12149 case false: 12150 var _instance = workInProgress.stateNode; 12151 var ctor = workInProgress.type; 12152 var state = new ctor(workInProgress.memoizedProps, _instance.context).state; 12153 _instance.updater.enqueueSetState(_instance, state, null); 12154 break; 12155 case true: 12156 workInProgress.flags |= DidCapture; 12157 workInProgress.flags |= ShouldCapture; 12158 var error$1 = /* @__PURE__ */ new Error("Simulated error coming from DevTools"); 12159 var lane = pickArbitraryLane(renderLanes); 12160 workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); 12161 enqueueCapturedUpdate(workInProgress, createClassErrorUpdate(workInProgress, createCapturedValueAtFiber(error$1, workInProgress), lane)); 12162 break; 12163 } 12164 if (workInProgress.type !== workInProgress.elementType) { 12165 var innerPropTypes = Component.propTypes; 12166 if (innerPropTypes) checkPropTypes(innerPropTypes, nextProps, "prop", getComponentNameFromType(Component)); 12167 } 12168 var hasContext; 12169 if (isContextProvider(Component)) { 12170 hasContext = true; 12171 pushContextProvider(workInProgress); 12172 } else hasContext = false;
12173 prepareToReadContext(workInProgress, renderLanes); 12174 var instance = workInProgress.stateNode; 12175 var shouldUpdate; 12176 if (instance === null) { 12177 resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); 12178 constructClassInstance(workInProgress, Component, nextProps); 12179 mountClassInstance(workInProgress, Component, nextProps, renderLanes); 12180 shouldUpdate = true; 12181 } else if (current === null) shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderLanes); 12182 else shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderLanes); 12183 var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes); 12184 var inst = workInProgress.stateNode; 12185 if (shouldUpdate && inst.props !== nextProps) { 12186 if (!didWarnAboutReassigningProps) error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", getComponentNameFromFiber(workInProgress) || "a component"); 12187 didWarnAboutReassigningProps = true; 12188 } 12189 return nextUnitOfWork; 12190 } 12191 function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) { 12192 markRef(current, workInProgress); 12193 var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags; 12194 if (!shouldUpdate && !didCaptureError) { 12195 if (hasContext) invalidateContextProvider(workInProgress, Component, false); 12196 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); 12197 } 12198 var instance = workInProgress.stateNode; 12199 ReactCurrentOwner$1.current = workInProgress; 12200 var nextChildren; 12201 if (didCaptureError && typeof Component.getDerivedStateFromError !== "function") { 12202 nextChildren = null; 12203 stopProfilerTimerIfRunning(); 12204 } else { 12205 markComponentRenderStarted(workInProgress); 12206 setIsRendering(true); 12207 nextChildren = instance.render(); 12208 if (workInProgress.mode & StrictLegacyMode) { 12209 setIsStrictModeForDevtools(true); 12210 try { 12211 instance.render(); 12212 } finally { 12213 setIsStrictModeForDevtools(false); 12214 } 12215 } 12216 setIsRendering(false); 12217 markComponentRenderStopped(); 12218 } 12219 workInProgress.flags |= PerformedWork; 12220 if (current !== null && didCaptureError) forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes); 12221 else reconcileChildren(current, workInProgress, nextChildren, renderLanes); 12222 workInProgress.memoizedState = instance.state; 12223 if (hasContext) invalidateContextProvider(workInProgress, Component, true); 12224 return workInProgress.child; 12225 } 12226 function pushHostRootContext(workInProgress) { 12227 var root = workInProgress.stateNode; 12228 if (root.pendingContext) pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context); 12229 else if (root.context) pushTopLevelContextObject(workInProgress, root.context, false); 12230 pushHostContainer(workInProgress, root.containerInfo); 12231 } 12232 function updateHostRoot(current, workInProgress, renderLanes) { 12233 pushHostRootContext(workInProgress); 12234 if (current === null) throw new Error("Should have a current fiber. This is a bug in React."); 12235 var nextProps = workInProgress.pendingProps; 12236 var prevState = workInProgress.memoizedState; 12237 var prevChildren = prevState.element; 12238 cloneUpdateQueue(current, workInProgress); 12239 processUpdateQueue(workInProgress, nextProps, null, renderLanes); 12240 var nextState = workInProgress.memoizedState; 12241 workInProgress.stateNode; 12242 var nextChildren = nextState.element; 12243 if (prevState.isDehydrated) { 12244 var overrideState = { 12245 element: nextChildren, 12246 isDehydrated: false, 12247 cache: nextState.cache, 12248 pendingSuspenseBoundaries: nextState.pendingSuspenseBoundaries, 12249 transitions: nextState.transitions 12250 }; 12251 var updateQueue = workInProgress.updateQueue; 12252 updateQueue.baseState = overrideState; 12253 workInProgress.memoizedState = overrideState; 12254 if (workInProgress.flags & ForceClientRender) return mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, createCapturedValueAtFiber(/* @__PURE__ */ new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."), workInProgress)); 12255 else if (nextChildren !== prevChildren) return mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, createCapturedValueAtFiber(/* @__PURE__ */ new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."), workInProgress)); 12256 else { 12257 enterHydrationState(workInProgress); 12258 var child = mountChildFibers(workInProgress, null, nextChildren, renderLanes); 12259 workInProgress.child = child; 12260 var node = child; 12261 while (node) { 12262 node.flags = node.flags & ~Placement | Hydrating; 12263 node = node.sibling; 12264 } 12265 } 12266 } else { 12267 resetHydrationState(); 12268 if (nextChildren === prevChildren) return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); 12269 reconcileChildren(current, workInProgress, nextChildren, renderLanes); 12270 } 12271 return workInProgress.child; 12272 } 12273 function mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, recoverableError) { 12274 resetHydrationState(); 12275 queueHydrationError(recoverableError); 12276 workInProgress.flags |= ForceClientRender; 12277 reconcileChildren(current, workInProgress, nextChildren, renderLanes); 12278 return workInProgress.child; 12279 } 12280 function updateHostComponent(current, workInProgress, renderLanes) { 12281 pushHostContext(workInProgress); 12282 if (current === null) tryToClaimNextHydratableInstance(workInProgress); 12283 var type = workInProgress.type; 12284 var nextProps = workInProgress.pendingProps; 12285 var prevProps = current !== null ? current.memoizedProps : null; 12286 var nextChildren = nextProps.children; 12287 if (shouldSetTextContent(type, nextProps)) nextChildren = null; 12288 else if (prevProps !== null && shouldSetTextContent(type, prevProps)) workInProgress.flags |= ContentReset; 12289 markRef(current, workInProgress); 12290 reconcileChildren(current, workInProgress, nextChildren, renderLanes); 12291 return workInProgress.child; 12292 } 12293 function updateHostText(current, workInProgress) { 12294 if (current === null) tryToClaimNextHydratableInstance(workInProgress); 12295 return null; 12296 } 12297 function mountLazyComponent(_current, workInProgress, elementType, renderLanes) { 12298 resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); 12299 var props = workInProgress.pendingProps; 12300 var lazyComponent = elementType; 12301 var payload = lazyComponent._payload; 12302 var init = lazyComponent._init; 12303 var Component = init(payload); 12304 workInProgress.type = Component; 12305 var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component); 12306 var resolvedProps = resolveDefaultProps(Component, props); 12307 var child; 12308 switch (resolvedTag) { 12309 case FunctionComponent: 12310 validateFunctionComponentInDev(workInProgress, Component); 12311 workInProgress.type = Component = resolveFunctionForHotReloading(Component); 12312 child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderLanes); 12313 return child; 12314 case ClassComponent:
12315 workInProgress.type = Component = resolveClassForHotReloading(Component); 12316 child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderLanes); 12317 return child; 12318 case ForwardRef: 12319 workInProgress.type = Component = resolveForwardRefForHotReloading(Component); 12320 child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderLanes); 12321 return child; 12322 case MemoComponent: 12323 if (workInProgress.type !== workInProgress.elementType) { 12324 var outerPropTypes = Component.propTypes; 12325 if (outerPropTypes) checkPropTypes(outerPropTypes, resolvedProps, "prop", getComponentNameFromType(Component)); 12326 } 12327 child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), renderLanes); 12328 return child; 12329 } 12330 var hint = ""; 12331 if (Component !== null && typeof Component === "object" && Component.$$typeof === REACT_LAZY_TYPE) hint = " Did you wrap a component in React.lazy() more than once?"; 12332 throw new Error("Element type is invalid. Received a promise that resolves to: " + Component + ". " + ("Lazy element type must resolve to a class or function." + hint)); 12333 } 12334 function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderLanes) { 12335 resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); 12336 workInProgress.tag = ClassComponent; 12337 var hasContext; 12338 if (isContextProvider(Component)) { 12339 hasContext = true; 12340 pushContextProvider(workInProgress); 12341 } else hasContext = false; 12342 prepareToReadContext(workInProgress, renderLanes); 12343 constructClassInstance(workInProgress, Component, nextProps); 12344 mountClassInstance(workInProgress, Component, nextProps, renderLanes); 12345 return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes); 12346 } 12347 function mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) { 12348 resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); 12349 var props = workInProgress.pendingProps; 12350 var context = getMaskedContext(workInProgress, getUnmaskedContext(workInProgress, Component, false)); 12351 prepareToReadContext(workInProgress, renderLanes); 12352 var value; 12353 var hasId; 12354 markComponentRenderStarted(workInProgress); 12355 if (Component.prototype && typeof Component.prototype.render === "function") { 12356 var componentName = getComponentNameFromType(Component) || "Unknown"; 12357 if (!didWarnAboutBadClass[componentName]) { 12358 error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", componentName, componentName); 12359 didWarnAboutBadClass[componentName] = true; 12360 } 12361 } 12362 if (workInProgress.mode & StrictLegacyMode) ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null); 12363 setIsRendering(true); 12364 ReactCurrentOwner$1.current = workInProgress; 12365 value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes); 12366 hasId = checkDidRenderIdHook(); 12367 setIsRendering(false); 12368 markComponentRenderStopped(); 12369 workInProgress.flags |= PerformedWork; 12370 if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) { 12371 var _componentName = getComponentNameFromType(Component) || "Unknown"; 12372 if (!didWarnAboutModulePatternComponent[_componentName]) { 12373 error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName, _componentName, _componentName); 12374 didWarnAboutModulePatternComponent[_componentName] = true; 12375 } 12376 } 12377 if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) { 12378 var _componentName2 = getComponentNameFromType(Component) || "Unknown"; 12379 if (!didWarnAboutModulePatternComponent[_componentName2]) { 12380 error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2); 12381 didWarnAboutModulePatternComponent[_componentName2] = true; 12382 } 12383 workInProgress.tag = ClassComponent; 12384 workInProgress.memoizedState = null; 12385 workInProgress.updateQueue = null; 12386 var hasContext = false;
12387 if (isContextProvider(Component)) { 12388 hasContext = true; 12389 pushContextProvider(workInProgress); 12390 } else hasContext = false; 12391 workInProgress.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null; 12392 initializeUpdateQueue(workInProgress); 12393 adoptClassInstance(workInProgress, value); 12394 mountClassInstance(workInProgress, Component, props, renderLanes); 12395 return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes); 12396 } else { 12397 workInProgress.tag = FunctionComponent; 12398 if (workInProgress.mode & StrictLegacyMode) { 12399 setIsStrictModeForDevtools(true); 12400 try { 12401 value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes); 12402 hasId = checkDidRenderIdHook(); 12403 } finally { 12404 setIsStrictModeForDevtools(false); 12405 } 12406 } 12407 if (getIsHydrating() && hasId) pushMaterializedTreeId(workInProgress); 12408 reconcileChildren(null, workInProgress, value, renderLanes); 12409 validateFunctionComponentInDev(workInProgress, Component); 12410 return workInProgress.child; 12411 } 12412 } 12413 function validateFunctionComponentInDev(workInProgress, Component) { 12414 if (Component) { 12415 if (Component.childContextTypes) error("%s(...): childContextTypes cannot be defined on a function component.", Component.displayName || Component.name || "Component"); 12416 } 12417 if (workInProgress.ref !== null) { 12418 var info = ""; 12419 var ownerName = getCurrentFiberOwnerNameInDevOrNull(); 12420 if (ownerName) info += "\n\nCheck the render method of `" + ownerName + "`."; 12421 var warningKey = ownerName || ""; 12422 var debugSource = workInProgress._debugSource; 12423 if (debugSource) warningKey = debugSource.fileName + ":" + debugSource.lineNumber; 12424 if (!didWarnAboutFunctionRefs[warningKey]) { 12425 didWarnAboutFunctionRefs[warningKey] = true; 12426 error("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", info); 12427 } 12428 } 12429 if (Component.defaultProps !== void 0) { 12430 var componentName = getComponentNameFromType(Component) || "Unknown"; 12431 if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) { 12432 error("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.", componentName); 12433 didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true; 12434 } 12435 } 12436 if (typeof Component.getDerivedStateFromProps === "function") { 12437 var _componentName3 = getComponentNameFromType(Component) || "Unknown"; 12438 if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) { 12439 error("%s: Function components do not support getDerivedStateFromProps.", _componentName3); 12440 didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true; 12441 } 12442 } 12443 if (typeof Component.contextType === "object" && Component.contextType !== null) { 12444 var _componentName4 = getComponentNameFromType(Component) || "Unknown"; 12445 if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) { 12446 error("%s: Function components do not support contextType.", _componentName4); 12447 didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true; 12448 } 12449 } 12450 } 12451 var SUSPENDED_MARKER = { 12452 dehydrated: null, 12453 treeContext: null, 12454 retryLane: NoLane 12455 }; 12456 function mountSuspenseOffscreenState(renderLanes) { 12457 return { 12458 baseLanes: renderLanes, 12459 cachePool: getSuspendedCache(), 12460 transitions: null 12461 }; 12462 } 12463 function updateSuspenseOffscreenState(prevOffscreenState, renderLanes) { 12464 return { 12465 baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes), 12466 cachePool: null, 12467 transitions: prevOffscreenState.transitions 12468 }; 12469 } 12470 function shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) { 12471 if (current !== null) { 12472 if (current.memoizedState === null) return false; 12473 } 12474 return hasSuspenseContext(suspenseContext, ForceSuspenseFallback); 12475 } 12476 function getRemainingWorkInPrimaryTree(current, renderLanes) { 12477 return removeLanes(current.childLanes, renderLanes); 12478 } 12479 function updateSuspenseComponent(current, workInProgress, renderLanes) { 12480 var nextProps = workInProgress.pendingProps; 12481 if (shouldSuspend(workInProgress)) workInProgress.flags |= DidCapture; 12482 var suspenseContext = suspenseStackCursor.current; 12483 var showFallback = false;
12484 var didSuspend = (workInProgress.flags & DidCapture) !== NoFlags; 12485 if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) { 12486 showFallback = true; 12487 workInProgress.flags &= ~DidCapture; 12488 } else if (current === null || current.memoizedState !== null) suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext); 12489 suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); 12490 pushSuspenseContext(workInProgress, suspenseContext); 12491 if (current === null) { 12492 tryToClaimNextHydratableInstance(workInProgress); 12493 var suspenseState = workInProgress.memoizedState; 12494 if (suspenseState !== null) { 12495 var dehydrated = suspenseState.dehydrated; 12496 if (dehydrated !== null) return mountDehydratedSuspenseComponent(workInProgress, dehydrated); 12497 } 12498 var nextPrimaryChildren = nextProps.children; 12499 var nextFallbackChildren = nextProps.fallback; 12500 if (showFallback) { 12501 var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes); 12502 var primaryChildFragment = workInProgress.child; 12503 primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes); 12504 workInProgress.memoizedState = SUSPENDED_MARKER; 12505 return fallbackFragment; 12506 } else return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren); 12507 } else { 12508 var prevState = current.memoizedState; 12509 if (prevState !== null) { 12510 var _dehydrated = prevState.dehydrated; 12511 if (_dehydrated !== null) return updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, _dehydrated, prevState, renderLanes); 12512 } 12513 if (showFallback) { 12514 var _nextFallbackChildren = nextProps.fallback; 12515 var _nextPrimaryChildren = nextProps.children; 12516 var fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren, _nextFallbackChildren, renderLanes); 12517 var _primaryChildFragment2 = workInProgress.child; 12518 var prevOffscreenState = current.child.memoizedState; 12519 _primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes); 12520 _primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes); 12521 workInProgress.memoizedState = SUSPENDED_MARKER; 12522 return fallbackChildFragment; 12523 } else { 12524 var _nextPrimaryChildren2 = nextProps.children; 12525 var _primaryChildFragment3 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren2, renderLanes); 12526 workInProgress.memoizedState = null; 12527 return _primaryChildFragment3; 12528 } 12529 } 12530 } 12531 function mountSuspensePrimaryChildren(workInProgress, primaryChildren, renderLanes) { 12532 var mode = workInProgress.mode; 12533 var primaryChildFragment = mountWorkInProgressOffscreenFiber({ 12534 mode: "visible", 12535 children: primaryChildren 12536 }, mode); 12537 primaryChildFragment.return = workInProgress; 12538 workInProgress.child = primaryChildFragment; 12539 return primaryChildFragment; 12540 } 12541 function mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) { 12542 var mode = workInProgress.mode; 12543 var progressedPrimaryFragment = workInProgress.child; 12544 var primaryChildProps = { 12545 mode: "hidden", 12546 children: primaryChildren 12547 }; 12548 var primaryChildFragment; 12549 var fallbackChildFragment; 12550 if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) { 12551 primaryChildFragment = progressedPrimaryFragment; 12552 primaryChildFragment.childLanes = NoLanes; 12553 primaryChildFragment.pendingProps = primaryChildProps; 12554 if (workInProgress.mode & ProfileMode) { 12555 primaryChildFragment.actualDuration = 0; 12556 primaryChildFragment.actualStartTime = -1; 12557 primaryChildFragment.selfBaseDuration = 0; 12558 primaryChildFragment.treeBaseDuration = 0; 12559 } 12560 fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); 12561 } else { 12562 primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode); 12563 fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); 12564 }
12565 primaryChildFragment.return = workInProgress; 12566 fallbackChildFragment.return = workInProgress; 12567 primaryChildFragment.sibling = fallbackChildFragment; 12568 workInProgress.child = primaryChildFragment; 12569 return fallbackChildFragment; 12570 } 12571 function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes) { 12572 return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null); 12573 } 12574 function updateWorkInProgressOffscreenFiber(current, offscreenProps) { 12575 return createWorkInProgress(current, offscreenProps); 12576 } 12577 function updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) { 12578 var currentPrimaryChildFragment = current.child; 12579 var currentFallbackChildFragment = currentPrimaryChildFragment.sibling; 12580 var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, { 12581 mode: "visible", 12582 children: primaryChildren 12583 }); 12584 if ((workInProgress.mode & ConcurrentMode) === NoMode) primaryChildFragment.lanes = renderLanes; 12585 primaryChildFragment.return = workInProgress; 12586 primaryChildFragment.sibling = null; 12587 if (currentFallbackChildFragment !== null) { 12588 var deletions = workInProgress.deletions; 12589 if (deletions === null) { 12590 workInProgress.deletions = [currentFallbackChildFragment]; 12591 workInProgress.flags |= ChildDeletion; 12592 } else deletions.push(currentFallbackChildFragment); 12593 } 12594 workInProgress.child = primaryChildFragment; 12595 return primaryChildFragment; 12596 } 12597 function updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { 12598 var mode = workInProgress.mode; 12599 var currentPrimaryChildFragment = current.child; 12600 var currentFallbackChildFragment = currentPrimaryChildFragment.sibling; 12601 var primaryChildProps = { 12602 mode: "hidden", 12603 children: primaryChildren 12604 }; 12605 var primaryChildFragment; 12606 if ((mode & ConcurrentMode) === NoMode && workInProgress.child !== currentPrimaryChildFragment) { 12607 primaryChildFragment = workInProgress.child; 12608 primaryChildFragment.childLanes = NoLanes; 12609 primaryChildFragment.pendingProps = primaryChildProps; 12610 if (workInProgress.mode & ProfileMode) { 12611 primaryChildFragment.actualDuration = 0; 12612 primaryChildFragment.actualStartTime = -1; 12613 primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration; 12614 primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration; 12615 } 12616 workInProgress.deletions = null; 12617 } else { 12618 primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps); 12619 primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask; 12620 } 12621 var fallbackChildFragment; 12622 if (currentFallbackChildFragment !== null) fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren); 12623 else { 12624 fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); 12625 fallbackChildFragment.flags |= Placement; 12626 } 12627 fallbackChildFragment.return = workInProgress; 12628 primaryChildFragment.return = workInProgress; 12629 primaryChildFragment.sibling = fallbackChildFragment; 12630 workInProgress.child = primaryChildFragment; 12631 return fallbackChildFragment; 12632 } 12633 function retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, recoverableError) { 12634 if (recoverableError !== null) queueHydrationError(recoverableError); 12635 reconcileChildFibers(workInProgress, current.child, null, renderLanes); 12636 var primaryChildren = workInProgress.pendingProps.children; 12637 var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); 12638 primaryChildFragment.flags |= Placement; 12639 workInProgress.memoizedState = null; 12640 return primaryChildFragment; 12641 } 12642 function mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { 12643 var fiberMode = workInProgress.mode; 12644 var primaryChildFragment = mountWorkInProgressOffscreenFiber({ 12645 mode: "visible", 12646 children: primaryChildren 12647 }, fiberMode); 12648 var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes, null); 12649 fallbackChildFragment.flags |= Placement;
12650 primaryChildFragment.return = workInProgress; 12651 fallbackChildFragment.return = workInProgress; 12652 primaryChildFragment.sibling = fallbackChildFragment; 12653 workInProgress.child = primaryChildFragment; 12654 if ((workInProgress.mode & ConcurrentMode) !== NoMode) reconcileChildFibers(workInProgress, current.child, null, renderLanes); 12655 return fallbackChildFragment; 12656 } 12657 function mountDehydratedSuspenseComponent(workInProgress, suspenseInstance, renderLanes) { 12658 if ((workInProgress.mode & ConcurrentMode) === NoMode) { 12659 error("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components."); 12660 workInProgress.lanes = laneToLanes(SyncLane); 12661 } else if (isSuspenseInstanceFallback(suspenseInstance)) workInProgress.lanes = laneToLanes(DefaultHydrationLane); 12662 else workInProgress.lanes = laneToLanes(OffscreenLane); 12663 return null; 12664 } 12665 function updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes) { 12666 if (!didSuspend) { 12667 warnIfHydrating(); 12668 if ((workInProgress.mode & ConcurrentMode) === NoMode) return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, null); 12669 if (isSuspenseInstanceFallback(suspenseInstance)) { 12670 var digest, message, stack; 12671 var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(suspenseInstance); 12672 digest = _getSuspenseInstanceF.digest; 12673 message = _getSuspenseInstanceF.message; 12674 stack = _getSuspenseInstanceF.stack; 12675 var error; 12676 if (message) error = new Error(message); 12677 else error = /* @__PURE__ */ new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."); 12678 return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, createCapturedValue(error, digest, stack)); 12679 } 12680 var hasContextChanged = includesSomeLane(renderLanes, current.childLanes); 12681 if (didReceiveUpdate || hasContextChanged) { 12682 var root = getWorkInProgressRoot(); 12683 if (root !== null) { 12684 var attemptHydrationAtLane = getBumpedLaneForHydration(root, renderLanes); 12685 if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) { 12686 suspenseState.retryLane = attemptHydrationAtLane; 12687 var eventTime = NoTimestamp; 12688 enqueueConcurrentRenderForLane(current, attemptHydrationAtLane); 12689 scheduleUpdateOnFiber(root, current, attemptHydrationAtLane, eventTime); 12690 } 12691 } 12692 renderDidSuspendDelayIfPossible(); 12693 return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, createCapturedValue(/* @__PURE__ */ new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."))); 12694 } else if (isSuspenseInstancePending(suspenseInstance)) { 12695 workInProgress.flags |= DidCapture; 12696 workInProgress.child = current.child; 12697 registerSuspenseInstanceRetry(suspenseInstance, retryDehydratedSuspenseBoundary.bind(null, current)); 12698 return null; 12699 } else { 12700 reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress, suspenseInstance, suspenseState.treeContext); 12701 var primaryChildren = nextProps.children; 12702 var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); 12703 primaryChildFragment.flags |= Hydrating; 12704 return primaryChildFragment; 12705 } 12706 } else if (workInProgress.flags & ForceClientRender) { 12707 workInProgress.flags &= ~ForceClientRender; 12708 return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, createCapturedValue(/* @__PURE__ */ new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."))); 12709 } else if (workInProgress.memoizedState !== null) { 12710 workInProgress.child = current.child; 12711 workInProgress.flags |= DidCapture; 12712 return null; 12713 } else { 12714 var nextPrimaryChildren = nextProps.children; 12715 var nextFallbackChildren = nextProps.fallback; 12716 var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes); 12717 var _primaryChildFragment4 = workInProgress.child; 12718 _primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes); 12719 workInProgress.memoizedState = SUSPENDED_MARKER; 12720 return fallbackChildFragment; 12721 } 12722 } 12723 function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { 12724 fiber.lanes = mergeLanes(fiber.lanes, renderLanes); 12725 var alternate = fiber.alternate; 12726 if (alternate !== null) alternate.lanes = mergeLanes(alternate.lanes, renderLanes); 12727 scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); 12728 } 12729 function propagateSuspenseContextChange(workInProgress, firstChild, renderLanes) { 12730 var node = firstChild; 12731 while (node !== null) { 12732 if (node.tag === SuspenseComponent) { 12733 if (node.memoizedState !== null) scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress); 12734 } else if (node.tag === SuspenseListComponent) scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress); 12735 else if (node.child !== null) { 12736 node.child.return = node; 12737 node = node.child; 12738 continue; 12739 } 12740 if (node === workInProgress) return; 12741 while (node.sibling === null) { 12742 if (node.return === null || node.return === workInProgress) return; 12743 node = node.return; 12744 } 12745 node.sibling.return = node.return; 12746 node = node.sibling; 12747 } 12748 } 12749 function findLastContentRow(firstChild) { 12750 var row = firstChild; 12751 var lastContentRow = null; 12752 while (row !== null) { 12753 var currentRow = row.alternate; 12754 if (currentRow !== null && findFirstSuspended(currentRow) === null) lastContentRow = row; 12755 row = row.sibling; 12756 } 12757 return lastContentRow; 12758 } 12759 function validateRevealOrder(revealOrder) { 12760 if (revealOrder !== void 0 && revealOrder !== "forwards" && revealOrder !== "backwards" && revealOrder !== "together" && !didWarnAboutRevealOrder[revealOrder]) { 12761 didWarnAboutRevealOrder[revealOrder] = true; 12762 if (typeof revealOrder === "string") switch (revealOrder.toLowerCase()) { 12763 case "together": 12764 case "forwards": 12765 case "backwards": 12766 error("\"%s\" is not a valid value for revealOrder on <SuspenseList />. Use lowercase \"%s\" instead.", revealOrder, revealOrder.toLowerCase()); 12767 break; 12768 case "forward": 12769 case "backward": 12770 error("\"%s\" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use \"%ss\" instead.", revealOrder, revealOrder.toLowerCase()); 12771 break; 12772 default: 12773 error("\"%s\" is not a supported revealOrder on <SuspenseList />. Did you mean \"together\", \"forwards\" or \"backwards\"?", revealOrder); 12774 break; 12775 } 12776 else error("%s is not a supported value for revealOrder on <SuspenseList />. Did you mean \"together\", \"forwards\" or \"backwards\"?", revealOrder); 12777 } 12778 } 12779 function validateTailOptions(tailMode, revealOrder) { 12780 if (tailMode !== void 0 && !didWarnAboutTailOptions[tailMode]) { 12781 if (tailMode !== "collapsed" && tailMode !== "hidden") { 12782 didWarnAboutTailOptions[tailMode] = true; 12783 error("\"%s\" is not a supported value for tail on <SuspenseList />. Did you mean \"collapsed\" or \"hidden\"?", tailMode); 12784 } else if (revealOrder !== "forwards" && revealOrder !== "backwards") { 12785 didWarnAboutTailOptions[tailMode] = true; 12786 error("<SuspenseList tail=\"%s\" /> is only valid if revealOrder is \"forwards\" or \"backwards\". Did you mean to specify revealOrder=\"forwards\"?", tailMode); 12787 } 12788 } 12789 } 12790 function validateSuspenseListNestedChild(childSlot, index) { 12791 var isAnArray = isArray(childSlot); 12792 var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === "function"; 12793 if (isAnArray || isIterable) { 12794 var type = isAnArray ? "array" : "iterable"; 12795 error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", type, index, type); 12796 return false;
12797 } 12798 return true; 12799 } 12800 function validateSuspenseListChildren(children, revealOrder) { 12801 if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== void 0 && children !== null && children !== false) if (isArray(children)) { 12802 for (var i = 0; i < children.length; i++) if (!validateSuspenseListNestedChild(children[i], i)) return; 12803 } else { 12804 var iteratorFn = getIteratorFn(children); 12805 if (typeof iteratorFn === "function") { 12806 var childrenIterator = iteratorFn.call(children); 12807 if (childrenIterator) { 12808 var step = childrenIterator.next(); 12809 var _i = 0; 12810 for (; !step.done; step = childrenIterator.next()) { 12811 if (!validateSuspenseListNestedChild(step.value, _i)) return; 12812 _i++; 12813 } 12814 } 12815 } else error("A single row was passed to a <SuspenseList revealOrder=\"%s\" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?", revealOrder); 12816 } 12817 } 12818 function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode) { 12819 var renderState = workInProgress.memoizedState; 12820 if (renderState === null) workInProgress.memoizedState = { 12821 isBackwards, 12822 rendering: null, 12823 renderingStartTime: 0, 12824 last: lastContentRow, 12825 tail, 12826 tailMode 12827 }; 12828 else { 12829 renderState.isBackwards = isBackwards; 12830 renderState.rendering = null; 12831 renderState.renderingStartTime = 0; 12832 renderState.last = lastContentRow; 12833 renderState.tail = tail; 12834 renderState.tailMode = tailMode; 12835 } 12836 } 12837 function updateSuspenseListComponent(current, workInProgress, renderLanes) { 12838 var nextProps = workInProgress.pendingProps; 12839 var revealOrder = nextProps.revealOrder; 12840 var tailMode = nextProps.tail; 12841 var newChildren = nextProps.children; 12842 validateRevealOrder(revealOrder); 12843 validateTailOptions(tailMode, revealOrder); 12844 validateSuspenseListChildren(newChildren, revealOrder); 12845 reconcileChildren(current, workInProgress, newChildren, renderLanes); 12846 var suspenseContext = suspenseStackCursor.current; 12847 if (hasSuspenseContext(suspenseContext, ForceSuspenseFallback)) { 12848 suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); 12849 workInProgress.flags |= DidCapture; 12850 } else { 12851 if (current !== null && (current.flags & DidCapture) !== NoFlags) propagateSuspenseContextChange(workInProgress, workInProgress.child, renderLanes); 12852 suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); 12853 } 12854 pushSuspenseContext(workInProgress, suspenseContext); 12855 if ((workInProgress.mode & ConcurrentMode) === NoMode) workInProgress.memoizedState = null; 12856 else switch (revealOrder) { 12857 case "forwards": 12858 var lastContentRow = findLastContentRow(workInProgress.child); 12859 var tail; 12860 if (lastContentRow === null) { 12861 tail = workInProgress.child; 12862 workInProgress.child = null; 12863 } else { 12864 tail = lastContentRow.sibling; 12865 lastContentRow.sibling = null; 12866 } 12867 initSuspenseListRenderState(workInProgress, false, tail, lastContentRow, tailMode); 12868 break; 12869 case "backwards": 12870 var _tail = null; 12871 var row = workInProgress.child; 12872 workInProgress.child = null; 12873 while (row !== null) { 12874 var currentRow = row.alternate; 12875 if (currentRow !== null && findFirstSuspended(currentRow) === null) { 12876 workInProgress.child = row; 12877 break; 12878 } 12879 var nextRow = row.sibling; 12880 row.sibling = _tail; 12881 _tail = row;
12882 row = nextRow; 12883 } 12884 initSuspenseListRenderState(workInProgress, true, _tail, null, tailMode); 12885 break; 12886 case "together": 12887 initSuspenseListRenderState(workInProgress, false, null, null, void 0); 12888 break; 12889 default: workInProgress.memoizedState = null; 12890 } 12891 return workInProgress.child; 12892 } 12893 function updatePortalComponent(current, workInProgress, renderLanes) { 12894 pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); 12895 var nextChildren = workInProgress.pendingProps; 12896 if (current === null) workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes); 12897 else reconcileChildren(current, workInProgress, nextChildren, renderLanes); 12898 return workInProgress.child; 12899 } 12900 var hasWarnedAboutUsingNoValuePropOnContextProvider = false; 12901 function updateContextProvider(current, workInProgress, renderLanes) { 12902 var context = workInProgress.type._context; 12903 var newProps = workInProgress.pendingProps; 12904 var oldProps = workInProgress.memoizedProps; 12905 var newValue = newProps.value; 12906 if (!("value" in newProps)) { 12907 if (!hasWarnedAboutUsingNoValuePropOnContextProvider) { 12908 hasWarnedAboutUsingNoValuePropOnContextProvider = true; 12909 error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"); 12910 } 12911 } 12912 var providerPropTypes = workInProgress.type.propTypes; 12913 if (providerPropTypes) checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider"); 12914 pushProvider(workInProgress, context, newValue); 12915 if (oldProps !== null) { 12916 var oldValue = oldProps.value; 12917 if (objectIs(oldValue, newValue)) { 12918 if (oldProps.children === newProps.children && !hasContextChanged()) return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); 12919 } else propagateContextChange(workInProgress, context, renderLanes); 12920 } 12921 var newChildren = newProps.children; 12922 reconcileChildren(current, workInProgress, newChildren, renderLanes); 12923 return workInProgress.child; 12924 } 12925 var hasWarnedAboutUsingContextAsConsumer = false; 12926 function updateContextConsumer(current, workInProgress, renderLanes) { 12927 var context = workInProgress.type; 12928 if (context._context === void 0) { 12929 if (context !== context.Consumer) { 12930 if (!hasWarnedAboutUsingContextAsConsumer) { 12931 hasWarnedAboutUsingContextAsConsumer = true; 12932 error("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"); 12933 } 12934 } 12935 } else context = context._context; 12936 var render = workInProgress.pendingProps.children; 12937 if (typeof render !== "function") error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."); 12938 prepareToReadContext(workInProgress, renderLanes); 12939 var newValue = readContext(context); 12940 markComponentRenderStarted(workInProgress); 12941 var newChildren; 12942 ReactCurrentOwner$1.current = workInProgress; 12943 setIsRendering(true); 12944 newChildren = render(newValue); 12945 setIsRendering(false); 12946 markComponentRenderStopped(); 12947 workInProgress.flags |= PerformedWork; 12948 reconcileChildren(current, workInProgress, newChildren, renderLanes); 12949 return workInProgress.child; 12950 } 12951 function markWorkInProgressReceivedUpdate() { 12952 didReceiveUpdate = true; 12953 } 12954 function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { 12955 if ((workInProgress.mode & ConcurrentMode) === NoMode) { 12956 if (current !== null) { 12957 current.alternate = null; 12958 workInProgress.alternate = null; 12959 workInProgress.flags |= Placement; 12960 } 12961 } 12962 } 12963 function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { 12964 if (current !== null) workInProgress.dependencies = current.dependencies; 12965 stopProfilerTimerIfRunning(); 12966 markSkippedUpdateLanes(workInProgress.lanes); 12967 if (!includesSomeLane(renderLanes, workInProgress.childLanes)) return null; 12968 cloneChildFibers(current, workInProgress); 12969 return workInProgress.child; 12970 } 12971 function remountFiber(current, oldWorkInProgress, newWorkInProgress) { 12972 var returnFiber = oldWorkInProgress.return; 12973 if (returnFiber === null) throw new Error("Cannot swap the root fiber."); 12974 current.alternate = null; 12975 oldWorkInProgress.alternate = null; 12976 newWorkInProgress.index = oldWorkInProgress.index; 12977 newWorkInProgress.sibling = oldWorkInProgress.sibling; 12978 newWorkInProgress.return = oldWorkInProgress.return; 12979 newWorkInProgress.ref = oldWorkInProgress.ref; 12980 if (oldWorkInProgress === returnFiber.child) returnFiber.child = newWorkInProgress; 12981 else { 12982 var prevSibling = returnFiber.child; 12983 if (prevSibling === null) throw new Error("Expected parent to have a child."); 12984 while (prevSibling.sibling !== oldWorkInProgress) { 12985 prevSibling = prevSibling.sibling; 12986 if (prevSibling === null) throw new Error("Expected to find the previous sibling."); 12987 } 12988 prevSibling.sibling = newWorkInProgress; 12989 }
12990 var deletions = returnFiber.deletions; 12991 if (deletions === null) { 12992 returnFiber.deletions = [current]; 12993 returnFiber.flags |= ChildDeletion; 12994 } else deletions.push(current); 12995 newWorkInProgress.flags |= Placement; 12996 return newWorkInProgress; 12997 } 12998 function checkScheduledUpdateOrContext(current, renderLanes) { 12999 var updateLanes = current.lanes; 13000 if (includesSomeLane(updateLanes, renderLanes)) return true; 13001 return false; 13002 } 13003 function attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes) { 13004 switch (workInProgress.tag) { 13005 case HostRoot: 13006 pushHostRootContext(workInProgress); 13007 workInProgress.stateNode; 13008 resetHydrationState(); 13009 break; 13010 case HostComponent: 13011 pushHostContext(workInProgress); 13012 break; 13013 case ClassComponent: 13014 var Component = workInProgress.type; 13015 if (isContextProvider(Component)) pushContextProvider(workInProgress); 13016 break; 13017 case HostPortal: 13018 pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); 13019 break; 13020 case ContextProvider: 13021 var newValue = workInProgress.memoizedProps.value; 13022 var context = workInProgress.type._context; 13023 pushProvider(workInProgress, context, newValue); 13024 break; 13025 case Profiler: 13026 if (includesSomeLane(renderLanes, workInProgress.childLanes)) workInProgress.flags |= Update; 13027 var stateNode = workInProgress.stateNode; 13028 stateNode.effectDuration = 0; 13029 stateNode.passiveEffectDuration = 0; 13030 break; 13031 case SuspenseComponent: 13032 var state = workInProgress.memoizedState; 13033 if (state !== null) { 13034 if (state.dehydrated !== null) { 13035 pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); 13036 workInProgress.flags |= DidCapture; 13037 return null; 13038 } 13039 var primaryChildLanes = workInProgress.child.childLanes; 13040 if (includesSomeLane(renderLanes, primaryChildLanes)) return updateSuspenseComponent(current, workInProgress, renderLanes); 13041 else { 13042 pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); 13043 var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); 13044 if (child !== null) return child.sibling; 13045 else return null; 13046 } 13047 } else pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); 13048 break; 13049 case SuspenseListComponent: 13050 var didSuspendBefore = (current.flags & DidCapture) !== NoFlags; 13051 var _hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes); 13052 if (didSuspendBefore) { 13053 if (_hasChildWork) return updateSuspenseListComponent(current, workInProgress, renderLanes); 13054 workInProgress.flags |= DidCapture; 13055 } 13056 var renderState = workInProgress.memoizedState; 13057 if (renderState !== null) { 13058 renderState.rendering = null; 13059 renderState.tail = null; 13060 renderState.lastEffect = null; 13061 } 13062 pushSuspenseContext(workInProgress, suspenseStackCursor.current); 13063 if (_hasChildWork) break; 13064 else return null; 13065 case OffscreenComponent: 13066 case LegacyHiddenComponent: 13067 workInProgress.lanes = NoLanes; 13068 return updateOffscreenComponent(current, workInProgress, renderLanes); 13069 } 13070 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); 13071 } 13072 function beginWork(current, workInProgress, renderLanes) { 13073 if (workInProgress._debugNeedsRemount && current !== null) return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes)); 13074 if (current !== null) if (current.memoizedProps !== workInProgress.pendingProps || hasContextChanged() || workInProgress.type !== current.type) didReceiveUpdate = true; 13075 else { 13076 if (!checkScheduledUpdateOrContext(current, renderLanes) && (workInProgress.flags & DidCapture) === NoFlags) { 13077 didReceiveUpdate = false; 13078 return attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes); 13079 } 13080 if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) didReceiveUpdate = true; 13081 else didReceiveUpdate = false;
13082 } 13083 else { 13084 didReceiveUpdate = false; 13085 if (getIsHydrating() && isForkedChild(workInProgress)) { 13086 var slotIndex = workInProgress.index; 13087 pushTreeId(workInProgress, getForksAtLevel(), slotIndex); 13088 } 13089 } 13090 workInProgress.lanes = NoLanes; 13091 switch (workInProgress.tag) { 13092 case IndeterminateComponent: return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderLanes); 13093 case LazyComponent: 13094 var elementType = workInProgress.elementType; 13095 return mountLazyComponent(current, workInProgress, elementType, renderLanes); 13096 case FunctionComponent: 13097 var Component = workInProgress.type; 13098 var unresolvedProps = workInProgress.pendingProps; 13099 return updateFunctionComponent(current, workInProgress, Component, workInProgress.elementType === Component ? unresolvedProps : resolveDefaultProps(Component, unresolvedProps), renderLanes); 13100 case ClassComponent: 13101 var _Component = workInProgress.type; 13102 var _unresolvedProps = workInProgress.pendingProps; 13103 return updateClassComponent(current, workInProgress, _Component, workInProgress.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps), renderLanes); 13104 case HostRoot: return updateHostRoot(current, workInProgress, renderLanes); 13105 case HostComponent: return updateHostComponent(current, workInProgress, renderLanes); 13106 case HostText: return updateHostText(current, workInProgress); 13107 case SuspenseComponent: return updateSuspenseComponent(current, workInProgress, renderLanes); 13108 case HostPortal: return updatePortalComponent(current, workInProgress, renderLanes); 13109 case ForwardRef: 13110 var type = workInProgress.type; 13111 var _unresolvedProps2 = workInProgress.pendingProps; 13112 return updateForwardRef(current, workInProgress, type, workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2), renderLanes); 13113 case Fragment: return updateFragment(current, workInProgress, renderLanes); 13114 case Mode: return updateMode(current, workInProgress, renderLanes); 13115 case Profiler: return updateProfiler(current, workInProgress, renderLanes); 13116 case ContextProvider: return updateContextProvider(current, workInProgress, renderLanes); 13117 case ContextConsumer: return updateContextConsumer(current, workInProgress, renderLanes); 13118 case MemoComponent: 13119 var _type2 = workInProgress.type; 13120 var _unresolvedProps3 = workInProgress.pendingProps; 13121 var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3); 13122 if (workInProgress.type !== workInProgress.elementType) { 13123 var outerPropTypes = _type2.propTypes; 13124 if (outerPropTypes) checkPropTypes(outerPropTypes, _resolvedProps3, "prop", getComponentNameFromType(_type2)); 13125 } 13126 _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3); 13127 return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, renderLanes); 13128 case SimpleMemoComponent: return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, renderLanes); 13129 case IncompleteClassComponent: 13130 var _Component2 = workInProgress.type; 13131 var _unresolvedProps4 = workInProgress.pendingProps; 13132 return mountIncompleteClassComponent(current, workInProgress, _Component2, workInProgress.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4), renderLanes); 13133 case SuspenseListComponent: return updateSuspenseListComponent(current, workInProgress, renderLanes); 13134 case ScopeComponent: break; 13135 case OffscreenComponent: return updateOffscreenComponent(current, workInProgress, renderLanes); 13136 } 13137 throw new Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue."); 13138 } 13139 function markUpdate(workInProgress) { 13140 workInProgress.flags |= Update; 13141 }
13142 function markRef$1(workInProgress) { 13143 workInProgress.flags |= Ref; 13144 workInProgress.flags |= RefStatic; 13145 } 13146 var appendAllChildren; 13147 var updateHostContainer; 13148 var updateHostComponent$1; 13149 var updateHostText$1; 13150 appendAllChildren = function(parent, workInProgress, needsVisibilityToggle, isHidden) { 13151 var node = workInProgress.child; 13152 while (node !== null) { 13153 if (node.tag === HostComponent || node.tag === HostText) appendInitialChild(parent, node.stateNode); 13154 else if (node.tag === HostPortal); 13155 else if (node.child !== null) { 13156 node.child.return = node; 13157 node = node.child; 13158 continue; 13159 } 13160 if (node === workInProgress) return; 13161 while (node.sibling === null) { 13162 if (node.return === null || node.return === workInProgress) return; 13163 node = node.return; 13164 } 13165 node.sibling.return = node.return; 13166 node = node.sibling; 13167 } 13168 }; 13169 updateHostContainer = function(current, workInProgress) {}; 13170 updateHostComponent$1 = function(current, workInProgress, type, newProps, rootContainerInstance) { 13171 var oldProps = current.memoizedProps; 13172 if (oldProps === newProps) return; 13173 var instance = workInProgress.stateNode; 13174 var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, getHostContext()); 13175 workInProgress.updateQueue = updatePayload; 13176 if (updatePayload) markUpdate(workInProgress); 13177 }; 13178 updateHostText$1 = function(current, workInProgress, oldText, newText) { 13179 if (oldText !== newText) markUpdate(workInProgress); 13180 }; 13181 function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { 13182 if (getIsHydrating()) return; 13183 switch (renderState.tailMode) { 13184 case "hidden": 13185 var tailNode = renderState.tail; 13186 var lastTailNode = null; 13187 while (tailNode !== null) { 13188 if (tailNode.alternate !== null) lastTailNode = tailNode; 13189 tailNode = tailNode.sibling; 13190 } 13191 if (lastTailNode === null) renderState.tail = null; 13192 else lastTailNode.sibling = null; 13193 break; 13194 case "collapsed": 13195 var _tailNode = renderState.tail; 13196 var _lastTailNode = null; 13197 while (_tailNode !== null) {
13198 if (_tailNode.alternate !== null) _lastTailNode = _tailNode; 13199 _tailNode = _tailNode.sibling; 13200 } 13201 if (_lastTailNode === null) if (!hasRenderedATailFallback && renderState.tail !== null) renderState.tail.sibling = null; 13202 else renderState.tail = null; 13203 else _lastTailNode.sibling = null; 13204 break; 13205 } 13206 } 13207 function bubbleProperties(completedWork) { 13208 var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child; 13209 var newChildLanes = NoLanes; 13210 var subtreeFlags = NoFlags; 13211 if (!didBailout) { 13212 if ((completedWork.mode & ProfileMode) !== NoMode) { 13213 var actualDuration = completedWork.actualDuration; 13214 var treeBaseDuration = completedWork.selfBaseDuration; 13215 var child = completedWork.child; 13216 while (child !== null) { 13217 newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes)); 13218 subtreeFlags |= child.subtreeFlags; 13219 subtreeFlags |= child.flags; 13220 actualDuration += child.actualDuration; 13221 treeBaseDuration += child.treeBaseDuration; 13222 child = child.sibling; 13223 } 13224 completedWork.actualDuration = actualDuration; 13225 completedWork.treeBaseDuration = treeBaseDuration; 13226 } else { 13227 var _child = completedWork.child; 13228 while (_child !== null) { 13229 newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes)); 13230 subtreeFlags |= _child.subtreeFlags; 13231 subtreeFlags |= _child.flags; 13232 _child.return = completedWork; 13233 _child = _child.sibling; 13234 } 13235 } 13236 completedWork.subtreeFlags |= subtreeFlags; 13237 } else { 13238 if ((completedWork.mode & ProfileMode) !== NoMode) { 13239 var _treeBaseDuration = completedWork.selfBaseDuration; 13240 var _child2 = completedWork.child; 13241 while (_child2 !== null) { 13242 newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes)); 13243 subtreeFlags |= _child2.subtreeFlags & StaticMask; 13244 subtreeFlags |= _child2.flags & StaticMask; 13245 _treeBaseDuration += _child2.treeBaseDuration; 13246 _child2 = _child2.sibling; 13247 } 13248 completedWork.treeBaseDuration = _treeBaseDuration; 13249 } else { 13250 var _child3 = completedWork.child; 13251 while (_child3 !== null) { 13252 newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes)); 13253 subtreeFlags |= _child3.subtreeFlags & StaticMask; 13254 subtreeFlags |= _child3.flags & StaticMask; 13255 _child3.return = completedWork; 13256 _child3 = _child3.sibling; 13257 } 13258 } 13259 completedWork.subtreeFlags |= subtreeFlags; 13260 } 13261 completedWork.childLanes = newChildLanes; 13262 return didBailout; 13263 } 13264 function completeDehydratedSuspenseBoundary(current, workInProgress, nextState) { 13265 if (hasUnhydratedTailNodes() && (workInProgress.mode & ConcurrentMode) !== NoMode && (workInProgress.flags & DidCapture) === NoFlags) { 13266 warnIfUnhydratedTailNodes(workInProgress); 13267 resetHydrationState(); 13268 workInProgress.flags |= ForceClientRender | Incomplete | ShouldCapture; 13269 return false; 13270 } 13271 var wasHydrated = popHydrationState(workInProgress); 13272 if (nextState !== null && nextState.dehydrated !== null) if (current === null) { 13273 if (!wasHydrated) throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React."); 13274 prepareToHydrateHostSuspenseInstance(workInProgress); 13275 bubbleProperties(workInProgress); 13276 if ((workInProgress.mode & ProfileMode) !== NoMode) { 13277 if (nextState !== null) { 13278 var primaryChildFragment = workInProgress.child; 13279 if (primaryChildFragment !== null) workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration; 13280 } 13281 } 13282 return false; 13283 } else { 13284 resetHydrationState(); 13285 if ((workInProgress.flags & DidCapture) === NoFlags) workInProgress.memoizedState = null; 13286 workInProgress.flags |= Update; 13287 bubbleProperties(workInProgress); 13288 if ((workInProgress.mode & ProfileMode) !== NoMode) { 13289 if (nextState !== null) { 13290 var _primaryChildFragment = workInProgress.child; 13291 if (_primaryChildFragment !== null) workInProgress.treeBaseDuration -= _primaryChildFragment.treeBaseDuration; 13292 } 13293 } 13294 return false;
13295 } 13296 else { 13297 upgradeHydrationErrorsToRecoverable(); 13298 return true; 13299 } 13300 } 13301 function completeWork(current, workInProgress, renderLanes) { 13302 var newProps = workInProgress.pendingProps; 13303 popTreeContext(workInProgress); 13304 switch (workInProgress.tag) { 13305 case IndeterminateComponent: 13306 case LazyComponent: 13307 case SimpleMemoComponent: 13308 case FunctionComponent: 13309 case ForwardRef: 13310 case Fragment: 13311 case Mode: 13312 case Profiler: 13313 case ContextConsumer: 13314 case MemoComponent: 13315 bubbleProperties(workInProgress); 13316 return null; 13317 case ClassComponent: 13318 var Component = workInProgress.type; 13319 if (isContextProvider(Component)) popContext(workInProgress); 13320 bubbleProperties(workInProgress); 13321 return null; 13322 case HostRoot: 13323 var fiberRoot = workInProgress.stateNode; 13324 popHostContainer(workInProgress); 13325 popTopLevelContextObject(workInProgress); 13326 resetWorkInProgressVersions(); 13327 if (fiberRoot.pendingContext) { 13328 fiberRoot.context = fiberRoot.pendingContext; 13329 fiberRoot.pendingContext = null; 13330 } 13331 if (current === null || current.child === null) { 13332 if (popHydrationState(workInProgress)) markUpdate(workInProgress); 13333 else if (current !== null) { 13334 if (!current.memoizedState.isDehydrated || (workInProgress.flags & ForceClientRender) !== NoFlags) { 13335 workInProgress.flags |= Snapshot; 13336 upgradeHydrationErrorsToRecoverable(); 13337 } 13338 } 13339 } 13340 updateHostContainer(current, workInProgress); 13341 bubbleProperties(workInProgress); 13342 return null; 13343 case HostComponent: 13344 popHostContext(workInProgress); 13345 var rootContainerInstance = getRootHostContainer(); 13346 var type = workInProgress.type; 13347 if (current !== null && workInProgress.stateNode != null) { 13348 updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);
13349 if (current.ref !== workInProgress.ref) markRef$1(workInProgress); 13350 } else { 13351 if (!newProps) { 13352 if (workInProgress.stateNode === null) throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."); 13353 bubbleProperties(workInProgress); 13354 return null; 13355 } 13356 var currentHostContext = getHostContext(); 13357 if (popHydrationState(workInProgress)) { 13358 if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) markUpdate(workInProgress); 13359 } else { 13360 var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress); 13361 appendAllChildren(instance, workInProgress, false, false); 13362 workInProgress.stateNode = instance; 13363 if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) markUpdate(workInProgress); 13364 } 13365 if (workInProgress.ref !== null) markRef$1(workInProgress); 13366 } 13367 bubbleProperties(workInProgress); 13368 return null; 13369 case HostText: 13370 var newText = newProps; 13371 if (current && workInProgress.stateNode != null) { 13372 var oldText = current.memoizedProps; 13373 updateHostText$1(current, workInProgress, oldText, newText); 13374 } else { 13375 if (typeof newText !== "string") { 13376 if (workInProgress.stateNode === null) throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."); 13377 } 13378 var _rootContainerInstance = getRootHostContainer(); 13379 var _currentHostContext = getHostContext(); 13380 if (popHydrationState(workInProgress)) { 13381 if (prepareToHydrateHostTextInstance(workInProgress)) markUpdate(workInProgress); 13382 } else workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress); 13383 } 13384 bubbleProperties(workInProgress); 13385 return null; 13386 case SuspenseComponent: 13387 popSuspenseContext(workInProgress); 13388 var nextState = workInProgress.memoizedState; 13389 if (current === null || current.memoizedState !== null && current.memoizedState.dehydrated !== null) { 13390 if (!completeDehydratedSuspenseBoundary(current, workInProgress, nextState)) if (workInProgress.flags & ShouldCapture) return workInProgress; 13391 else return null; 13392 } 13393 if ((workInProgress.flags & DidCapture) !== NoFlags) { 13394 workInProgress.lanes = renderLanes; 13395 if ((workInProgress.mode & ProfileMode) !== NoMode) transferActualDuration(workInProgress); 13396 return workInProgress; 13397 } 13398 var nextDidTimeout = nextState !== null; 13399 if (nextDidTimeout !== (current !== null && current.memoizedState !== null)) { 13400 if (nextDidTimeout) { 13401 var _offscreenFiber2 = workInProgress.child; 13402 _offscreenFiber2.flags |= Visibility; 13403 if ((workInProgress.mode & ConcurrentMode) !== NoMode) if (current === null && (workInProgress.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback) || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) renderDidSuspend(); 13404 else renderDidSuspendDelayIfPossible(); 13405 } 13406 } 13407 if (workInProgress.updateQueue !== null) workInProgress.flags |= Update; 13408 bubbleProperties(workInProgress); 13409 if ((workInProgress.mode & ProfileMode) !== NoMode) { 13410 if (nextDidTimeout) { 13411 var primaryChildFragment = workInProgress.child; 13412 if (primaryChildFragment !== null) workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration; 13413 } 13414 } 13415 return null; 13416 case HostPortal: 13417 popHostContainer(workInProgress); 13418 updateHostContainer(current, workInProgress); 13419 if (current === null) preparePortalMount(workInProgress.stateNode.containerInfo); 13420 bubbleProperties(workInProgress); 13421 return null; 13422 case ContextProvider: 13423 var context = workInProgress.type._context; 13424 popProvider(context, workInProgress); 13425 bubbleProperties(workInProgress); 13426 return null; 13427 case IncompleteClassComponent: 13428 var _Component = workInProgress.type; 13429 if (isContextProvider(_Component)) popContext(workInProgress); 13430 bubbleProperties(workInProgress); 13431 return null; 13432 case SuspenseListComponent: 13433 popSuspenseContext(workInProgress); 13434 var renderState = workInProgress.memoizedState; 13435 if (renderState === null) { 13436 bubbleProperties(workInProgress); 13437 return null; 13438 } 13439 var didSuspendAlready = (workInProgress.flags & DidCapture) !== NoFlags; 13440 var renderedTail = renderState.rendering; 13441 if (renderedTail === null) if (!didSuspendAlready) { 13442 if (!(renderHasNotSuspendedYet() && (current === null || (current.flags & DidCapture) === NoFlags))) { 13443 var row = workInProgress.child; 13444 while (row !== null) { 13445 var suspended = findFirstSuspended(row); 13446 if (suspended !== null) { 13447 didSuspendAlready = true; 13448 workInProgress.flags |= DidCapture; 13449 cutOffTailIfNeeded(renderState, false); 13450 var newThenables = suspended.updateQueue; 13451 if (newThenables !== null) { 13452 workInProgress.updateQueue = newThenables; 13453 workInProgress.flags |= Update; 13454 } 13455 workInProgress.subtreeFlags = NoFlags; 13456 resetChildFibers(workInProgress, renderLanes); 13457 pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback)); 13458 return workInProgress.child; 13459 }
13460 row = row.sibling; 13461 } 13462 } 13463 if (renderState.tail !== null && now() > getRenderTargetTime()) { 13464 workInProgress.flags |= DidCapture; 13465 didSuspendAlready = true; 13466 cutOffTailIfNeeded(renderState, false); 13467 workInProgress.lanes = SomeRetryLane; 13468 } 13469 } else cutOffTailIfNeeded(renderState, false); 13470 else { 13471 if (!didSuspendAlready) { 13472 var _suspended = findFirstSuspended(renderedTail); 13473 if (_suspended !== null) { 13474 workInProgress.flags |= DidCapture; 13475 didSuspendAlready = true; 13476 var _newThenables = _suspended.updateQueue; 13477 if (_newThenables !== null) { 13478 workInProgress.updateQueue = _newThenables; 13479 workInProgress.flags |= Update; 13480 } 13481 cutOffTailIfNeeded(renderState, true); 13482 if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating()) { 13483 bubbleProperties(workInProgress); 13484 return null; 13485 } 13486 } else if (now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes !== OffscreenLane) { 13487 workInProgress.flags |= DidCapture; 13488 didSuspendAlready = true; 13489 cutOffTailIfNeeded(renderState, false); 13490 workInProgress.lanes = SomeRetryLane; 13491 } 13492 } 13493 if (renderState.isBackwards) { 13494 renderedTail.sibling = workInProgress.child; 13495 workInProgress.child = renderedTail; 13496 } else { 13497 var previousSibling = renderState.last; 13498 if (previousSibling !== null) previousSibling.sibling = renderedTail; 13499 else workInProgress.child = renderedTail; 13500 renderState.last = renderedTail; 13501 } 13502 } 13503 if (renderState.tail !== null) { 13504 var next = renderState.tail; 13505 renderState.rendering = next; 13506 renderState.tail = next.sibling; 13507 renderState.renderingStartTime = now(); 13508 next.sibling = null; 13509 var suspenseContext = suspenseStackCursor.current; 13510 if (didSuspendAlready) suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); 13511 else suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); 13512 pushSuspenseContext(workInProgress, suspenseContext); 13513 return next; 13514 } 13515 bubbleProperties(workInProgress); 13516 return null; 13517 case ScopeComponent: break; 13518 case OffscreenComponent: 13519 case LegacyHiddenComponent: 13520 popRenderLanes(workInProgress); 13521 var nextIsHidden = workInProgress.memoizedState !== null; 13522 if (current !== null) { 13523 if (current.memoizedState !== null !== nextIsHidden && !enableLegacyHidden
13523) workInProgress.flags |= Visibility; 13524 } 13525 if (!nextIsHidden || (workInProgress.mode & ConcurrentMode) === NoMode) bubbleProperties(workInProgress); 13526 else if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) { 13527 bubbleProperties(workInProgress); 13528 if (workInProgress.subtreeFlags & (Placement | Update)) workInProgress.flags |= Visibility; 13529 } 13530 return null; 13531 case CacheComponent: return null; 13532 case TracingMarkerComponent: return null; 13533 } 13534 throw new Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue."); 13535 } 13536 function unwindWork(current, workInProgress, renderLanes) { 13537 popTreeContext(workInProgress); 13538 switch (workInProgress.tag) { 13539 case ClassComponent: 13540 var Component = workInProgress.type; 13541 if (isContextProvider(Component)) popContext(workInProgress); 13542 var flags = workInProgress.flags; 13543 if (flags & ShouldCapture) { 13544 workInProgress.flags = flags & ~ShouldCapture | DidCapture; 13545 if ((workInProgress.mode & ProfileMode) !== NoMode) transferActualDuration(workInProgress); 13546 return workInProgress; 13547 } 13548 return null; 13549 case HostRoot: 13550 workInProgress.stateNode; 13551 popHostContainer(workInProgress); 13552 popTopLevelContextObject(workInProgress); 13553 resetWorkInProgressVersions(); 13554 var _flags = workInProgress.flags; 13555 if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) { 13556 workInProgress.flags = _flags & ~ShouldCapture | DidCapture; 13557 return workInProgress; 13558 } 13559 return null; 13560 case HostComponent: 13561 popHostContext(workInProgress); 13562 return null; 13563 case SuspenseComponent: 13564 popSuspenseContext(workInProgress); 13565 var suspenseState = workInProgress.memoizedState; 13566 if (suspenseState !== null && suspenseState.dehydrated !== null) { 13567 if (workInProgress.alternate === null) throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue."); 13568 resetHydrationState(); 13569 } 13570 var _flags2 = workInProgress.flags; 13571 if (_flags2 & ShouldCapture) { 13572 workInProgress.flags = _flags2 & ~ShouldCapture | DidCapture; 13573 if ((workInProgress.mode & ProfileMode) !== NoMode) transferActualDuration(workInProgress); 13574 return workInProgress; 13575 } 13576 return null; 13577 case SuspenseListComponent: 13578 popSuspenseContext(workInProgress); 13579 return null; 13580 case HostPortal: 13581 popHostContainer(workInProgress); 13582 return null; 13583 case ContextProvider: 13584 var context = workInProgress.type._context; 13585 popProvider(context, workInProgress); 13586 return null; 13587 case OffscreenComponent: 13588 case LegacyHiddenComponent: 13589 popRenderLanes(workInProgress); 13590 return null; 13591 case CacheComponent: return null; 13592 default: return null; 13593 } 13594 } 13595 function unwindInterruptedWork(current, interruptedWork, renderLanes) { 13596 popTreeContext(interruptedWork); 13597 switch (interruptedWork.tag) { 13598 case ClassComponent: 13599 var childContextTypes = interruptedWork.type.childContextTypes; 13600 if (childContextTypes !== null && childContextTypes !== void 0) popContext(interruptedWork); 13601 break; 13602 case HostRoot: 13603 interruptedWork.stateNode; 13604 popHostContainer(interruptedWork); 13605 popTopLevelContextObject(interruptedWork); 13606 resetWorkInProgressVersions(); 13607 break; 13608 case HostComponent: 13609 popHostContext(interruptedWork); 13610 break; 13611 case HostPortal: 13612 popHostContainer(interruptedWork); 13613 break; 13614 case SuspenseComponent: 13615 popSuspenseContext(interruptedWork); 13616 break; 13617 case SuspenseListComponent: 13618 popSuspenseContext(interruptedWork); 13619 break; 13620 case ContextProvider: 13621 var context = interruptedWork.type._context; 13622 popProvider(context, interruptedWork); 13623 break; 13624 case OffscreenComponent: 13625 case LegacyHiddenComponent: 13626 popRenderLanes(interruptedWork); 13627 break; 13628 } 13629 } 13630 var didWarnAboutUndefinedSnapshotBeforeUpdate = null; 13631 didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set(); 13632 var offscreenSubtreeIsHidden = false;
13633 var offscreenSubtreeWasHidden = false; 13634 var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set; 13635 var nextEffect = null; 13636 var inProgressLanes = null; 13637 var inProgressRoot = null; 13638 function reportUncaughtErrorInDEV(error) { 13639 invokeGuardedCallback(null, function() { 13640 throw error; 13641 }); 13642 clearCaughtError(); 13643 } 13644 var callComponentWillUnmountWithTimer = function(current, instance) { 13645 instance.props = current.memoizedProps; 13646 instance.state = current.memoizedState; 13647 if (current.mode & ProfileMode) try { 13648 startLayoutEffectTimer(); 13649 instance.componentWillUnmount(); 13650 } finally { 13651 recordLayoutEffectDuration(current); 13652 } 13653 else instance.componentWillUnmount(); 13654 }; 13655 function safelyCallCommitHookLayoutEffectListMount(current, nearestMountedAncestor) { 13656 try { 13657 commitHookEffectListMount(Layout, current); 13658 } catch (error) { 13659 captureCommitPhaseError(current, nearestMountedAncestor, error); 13660 } 13661 } 13662 function safelyCallComponentWillUnmount(current, nearestMountedAncestor, instance) { 13663 try { 13664 callComponentWillUnmountWithTimer(current, instance); 13665 } catch (error) { 13666 captureCommitPhaseError(current, nearestMountedAncestor, error); 13667 } 13668 } 13669 function safelyCallComponentDidMount(current, nearestMountedAncestor, instance) { 13670 try { 13671 instance.componentDidMount(); 13672 } catch (error) { 13673 captureCommitPhaseError(current, nearestMountedAncestor, error); 13674 } 13675 } 13676 function safelyAttachRef(current, nearestMountedAncestor) { 13677 try { 13678 commitAttachRef(current); 13679 } catch (error) { 13680 captureCommitPhaseError(current, nearestMountedAncestor, error); 13681 } 13682 } 13683 function safelyDetachRef(current, nearestMountedAncestor) { 13684 var ref = current.ref; 13685 if (ref !== null) if (typeof ref === "function") { 13686 var retVal; 13687 try { 13688 if (enableProfilerTimer && enableProfilerCommitHooks && current.mode & ProfileMode) try { 13689 startLayoutEffectTimer(); 13690 retVal = ref(null); 13691 } finally { 13692 recordLayoutEffectDuration(current); 13693 } 13694 else retVal = ref(null); 13695 } catch (error) { 13696 captureCommitPhaseError(current, nearestMountedAncestor, error); 13697 } 13698 if (typeof retVal === "function") error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(current)); 13699 } else ref.current = null; 13700 } 13701 function safelyCallDestroy(current, nearestMountedAncestor, destroy) { 13702 try { 13703 destroy(); 13704 } catch (error) { 13705 captureCommitPhaseError(current, nearestMountedAncestor, error); 13706 } 13707 } 13708 var shouldFireAfterActiveInstanceBlur = false; 13709 function commitBeforeMutationEffects(root, firstChild) { 13710 prepareForCommit(root.containerInfo); 13711 nextEffect = firstChild; 13712 commitBeforeMutationEffects_begin(); 13713 var shouldFire = shouldFireAfterActiveInstanceBlur; 13714 shouldFireAfterActiveInstanceBlur = false; 13715 return shouldFire; 13716 } 13717 function commitBeforeMutationEffects_begin() { 13718 while (nextEffect !== null) { 13719 var fiber = nextEffect; 13720 var child = fiber.child; 13721 if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) { 13722 child.return = fiber; 13723 nextEffect = child; 13724 } else commitBeforeMutationEffects_complete(); 13725 } 13726 } 13727 function commitBeforeMutationEffects_complete() { 13728 while (nextEffect !== null) { 13729 var fiber = nextEffect; 13730 setCurrentFiber(fiber); 13731 try { 13732 commitBeforeMutationEffectsOnFiber(fiber); 13733 } catch (error) { 13734 captureCommitPhaseError(fiber, fiber.return, error); 13735 } 13736 resetCurrentFiber(); 13737 var sibling = fiber.sibling; 13738 if (sibling !== null) { 13739 sibling.return = fiber.return; 13740 nextEffect = sibling; 13741 return; 13742 } 13743 nextEffect = fiber.return; 13744 } 13745 } 13746 function commitBeforeMutationEffectsOnFiber(finishedWork) { 13747 var current = finishedWork.alternate; 13748 if ((finishedWork.flags & Snapshot) !== NoFlags) { 13749 setCurrentFiber(finishedWork); 13750 switch (finishedWork.tag) { 13751 case FunctionComponent: 13752 case ForwardRef: 13753 case SimpleMemoComponent: break; 13754 case ClassComponent: 13755 if (current !== null) { 13756 var prevProps = current.memoizedProps; 13757 var prevState = current.memoizedState;
13758 var instance = finishedWork.stateNode; 13759 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { 13760 if (instance.props !== finishedWork.memoizedProps) error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); 13761 if (instance.state !== finishedWork.memoizedState) error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); 13762 } 13763 var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState); 13764 var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate; 13765 if (snapshot === void 0 && !didWarnSet.has(finishedWork.type)) { 13766 didWarnSet.add(finishedWork.type); 13767 error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", getComponentNameFromFiber(finishedWork)); 13768 } 13769 instance.__reactInternalSnapshotBeforeUpdate = snapshot; 13770 } 13771 break; 13772 case HostRoot: 13773 var root = finishedWork.stateNode; 13774 clearContainer(root.containerInfo); 13775 break; 13776 case HostComponent: 13777 case HostText: 13778 case HostPortal: 13779 case IncompleteClassComponent: break; 13780 default: throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."); 13781 } 13782 resetCurrentFiber(); 13783 } 13784 } 13785 function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) { 13786 var updateQueue = finishedWork.updateQueue; 13787 var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; 13788 if (lastEffect !== null) { 13789 var firstEffect = lastEffect.next; 13790 var effect = firstEffect; 13791 do { 13792 if ((effect.tag & flags) === flags) { 13793 var destroy = effect.destroy; 13794 effect.destroy = void 0; 13795 if (destroy !== void 0) { 13796 if ((flags & Passive$1) !== NoFlags$1) markComponentPassiveEffectUnmountStarted(finishedWork); 13797 else if ((flags & Layout) !== NoFlags$1) markComponentLayoutEffectUnmountStarted(finishedWork); 13798 if ((flags & Insertion) !== NoFlags$1) setIsRunningInsertionEffect(true); 13799 safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy); 13800 if ((flags & Insertion) !== NoFlags$1) setIsRunningInsertionEffect(false); 13801 if ((flags & Passive$1) !== NoFlags$1) markComponentPassiveEffectUnmountStopped(); 13802 else if ((flags & Layout) !== NoFlags$1) markComponentLayoutEffectUnmountStopped(); 13803 } 13804 } 13805 effect = effect.next; 13806 } while (effect !== firstEffect); 13807 } 13808 } 13809 function commitHookEffectListMount(flags, finishedWork) { 13810 var updateQueue = finishedWork.updateQueue; 13811 var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; 13812 if (lastEffect !== null) { 13813 var firstEffect = lastEffect.next; 13814 var effect = firstEffect; 13815 do { 13816 if ((effect.tag & flags) === flags) { 13817 if ((flags & Passive$1) !== NoFlags$1) markComponentPassiveEffectMountStarted(finishedWork); 13818 else if ((flags & Layout) !== NoFlags$1) markComponentLayoutEffectMountStarted(finishedWork); 13819 var create = effect.create; 13820 if ((flags & Insertion) !== NoFlags$1) setIsRunningInsertionEffect(true); 13821 effect.destroy = create(); 13822 if ((flags & Insertion) !== NoFlags$1) setIsRunningInsertionEffect(false); 13823 if ((flags & Passive$1) !== NoFlags$1) markComponentPassiveEffectMountStopped(); 13824 else if ((flags & Layout) !== NoFlags$1) markComponentLayoutEffectMountStopped(); 13825 var destroy = effect.destroy; 13826 if (destroy !== void 0 && typeof destroy !== "function") { 13827 var hookName = void 0; 13828 if ((effect.tag & Layout) !== NoFlags) hookName = "useLayoutEffect"; 13829 else if ((effect.tag & Insertion) !== NoFlags) hookName = "useInsertionEffect"; 13830 else hookName = "useEffect"; 13831 var addendum = void 0; 13832 if (destroy === null) addendum = " You returned null. If your effect does not require clean up, return undefined (or nothing)."; 13833 else if (typeof destroy.then === "function") addendum = "\n\nIt looks like you wrote " + hookName + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + hookName + "(() =>
13833 {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching"; 13834 else addendum = " You returned: " + destroy; 13835 error("%s must not return anything besides a function, which is used for clean-up.%s", hookName, addendum); 13836 } 13837 } 13838 effect = effect.next; 13839 } while (effect !== firstEffect); 13840 } 13841 } 13842 function commitPassiveEffectDurations(finishedRoot, finishedWork) { 13843 if ((finishedWork.flags & Update) !== NoFlags) switch (finishedWork.tag) { 13844 case Profiler: 13845 var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration; 13846 var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit; 13847 var commitTime = getCommitTime(); 13848 var phase = finishedWork.alternate === null ? "mount" : "update"; 13849 if (isCurrentUpdateNested()) phase = "nested-update"; 13850 if (typeof onPostCommit === "function") onPostCommit(id, phase, passiveEffectDuration, commitTime); 13851 var parentFiber = finishedWork.return; 13852 outer: while (parentFiber !== null) { 13853 switch (parentFiber.tag) { 13854 case HostRoot: 13855 var root = parentFiber.stateNode; 13856 root.passiveEffectDuration += passiveEffectDuration; 13857 break outer; 13858 case Profiler: 13859 var parentStateNode = parentFiber.stateNode; 13860 parentStateNode.passiveEffectDuration += passiveEffectDuration; 13861 break outer; 13862 } 13863 parentFiber = parentFiber.return; 13864 } 13865 break; 13866 } 13867 } 13868 function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committedLanes) { 13869 if ((finishedWork.flags & LayoutMask) !== NoFlags) switch (finishedWork.tag) { 13870 case FunctionComponent: 13871 case ForwardRef: 13872 case SimpleMemoComponent: 13873 if (!offscreenSubtreeWasHidden) if (finishedWork.mode & ProfileMode) try { 13874 startLayoutEffectTimer(); 13875 commitHookEffectListMount(Layout | HasEffect, finishedWork); 13876 } finally { 13877 recordLayoutEffectDuration(finishedWork); 13878 } 13879 else commitHookEffectListMount(Layout | HasEffect, finishedWork); 13880 break; 13881 case ClassComponent: 13882 var instance = finishedWork.stateNode; 13883 if (finishedWork.flags & Update) { 13884 if (!offscreenSubtreeWasHidden) if (current === null) { 13885 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { 13886 if (instance.props !== finishedWork.memoizedProps) error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); 13887 if (instance.state !== finishedWork.memoizedState) error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); 13888 } 13889 if (finishedWork.mode & ProfileMode) try { 13890 startLayoutEffectTimer(); 13891 instance.componentDidMount(); 13892 } finally { 13893 recordLayoutEffectDuration(finishedWork); 13894 } 13895 else instance.componentDidMount(); 13896 } else { 13897 var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps); 13898 var prevState = current.memoizedState; 13899 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { 13900 if (instance.props !== finishedWork.memoizedProps) error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); 13901 if (instance.state !== finishedWork.memoizedState) error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); 13902 } 13903 if (finishedWork.mode & ProfileMode) try { 13904 startLayoutEffectTimer(); 13905 instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); 13906 } finally { 13907 recordLayoutEffectDuration(finishedWork); 13908 } 13909 else instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); 13910 } 13911 } 13912 var updateQueue = finishedWork.updateQueue; 13913 if (updateQueue !== null) { 13914 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { 13915 if (instance.props !== finishedWork.memoizedProps) error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); 13916 if (instance.state !== finishedWork.memoizedState) error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance"); 13917 } 13918 commitUpdateQueue(finishedWork, updateQueue, instance); 13919 } 13920 break; 13921 case HostRoot: 13922 var _updateQueue = finishedWork.updateQueue; 13923 if (_updateQueue !== null) { 13924 var _instance = null; 13925 if (finishedWork.child !== null) switch (finishedWork.child.tag) { 13926 case HostComponent: 13927 _instance = getPublicInstance(finishedWork.child.stateNode); 13928 break; 13929 case ClassComponent:
13930 _instance = finishedWork.child.stateNode; 13931 break; 13932 } 13933 commitUpdateQueue(finishedWork, _updateQueue, _instance); 13934 } 13935 break; 13936 case HostComponent: 13937 var _instance2 = finishedWork.stateNode; 13938 if (current === null && finishedWork.flags & Update) { 13939 var type = finishedWork.type; 13940 var props = finishedWork.memoizedProps; 13941 commitMount(_instance2, type, props); 13942 } 13943 break; 13944 case HostText: break; 13945 case HostPortal: break; 13946 case Profiler: 13947 var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender; 13948 var effectDuration = finishedWork.stateNode.effectDuration; 13949 var commitTime = getCommitTime(); 13950 var phase = current === null ? "mount" : "update"; 13951 if (isCurrentUpdateNested()) phase = "nested-update"; 13952 if (typeof onRender === "function") onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime); 13953 if (typeof onCommit === "function") onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime); 13954 enqueuePendingPassiveProfilerEffect(finishedWork); 13955 var parentFiber = finishedWork.return; 13956 outer: while (parentFiber !== null) { 13957 switch (parentFiber.tag) { 13958 case HostRoot: 13959 var root = parentFiber.stateNode; 13960 root.effectDuration += effectDuration; 13961 break outer; 13962 case Profiler: 13963 var parentStateNode = parentFiber.stateNode; 13964 parentStateNode.effectDuration += effectDuration; 13965 break outer; 13966 } 13967 parentFiber = parentFiber.return; 13968 } 13969 break; 13970 case SuspenseComponent: 13971 commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); 13972 break; 13973 case SuspenseListComponent: 13974 case IncompleteClassComponent: 13975 case ScopeComponent: 13976 case OffscreenComponent: 13977 case LegacyHiddenComponent: 13978 case TracingMarkerComponent: break; 13979 default: throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."); 13980 } 13981 if (!offscreenSubtreeWasHidden) { 13982 if (finishedWork.flags & Ref) commitAttachRef(finishedWork); 13983 } 13984 } 13985 function reappearLayoutEffectsOnFiber(node) { 13986 switch (node.tag) { 13987 case FunctionComponent: 13988 case ForwardRef: 13989 case SimpleMemoComponent: 13990 if (node.mode & ProfileMode) try { 13991 startLayoutEffectTimer(); 13992 safelyCallCommitHookLayoutEffectListMount(node, node.return); 13993 } finally { 13994 recordLayoutEffectDuration(node); 13995 } 13996 else safelyCallCommitHookLayoutEffectListMount(node, node.return); 13997 break; 13998 case ClassComponent: 13999 var instance = node.stateNode; 14000 if (typeof instance.componentDidMount === "function") safelyCallComponentDidMount(node, node.return, instance); 14001 safelyAttachRef(node, node.return); 14002 break; 14003 case HostComponent: 14004 safelyAttachRef(node, node.return); 14005 break; 14006 } 14007 } 14008 function hideOrUnhideAllChildren(finishedWork, isHidden) { 14009 var hostSubtreeRoot = null; 14010 var node = finishedWork; 14011 while (true) { 14012 if (node.tag === HostComponent) { 14013 if (hostSubtreeRoot === null) { 14014 hostSubtreeRoot = node; 14015 try { 14016 var instance = node.stateNode; 14017 if (isHidden) hideInstance(instance); 14018 else unhideInstance(node.stateNode, node.memoizedProps); 14019 } catch (error) { 14020 captureCommitPhaseError(finishedWork, finishedWork.return, error); 14021 } 14022 } 14023 } else if (node.tag === HostText) { 14024 if (hostSubtreeRoot === null) try { 14025 var _instance3 = node.stateNode; 14026 if (isHidden) hideTextInstance(_instance3); 14027 else unhideTextInstance(_instance3, node.memoizedProps); 14028 } catch (error) { 14029 captureCommitPhaseError(finishedWork, finishedWork.return, error); 14030 } 14031 } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork); 14032 else if (node.child !== null) { 14033 node.child.return = node; 14034 node = node.child; 14035 continue; 14036 } 14037 if (node === finishedWork) return; 14038 while (node.sibling === null) { 14039 if (node.return === null || node.return === finishedWork) return; 14040 if (hostSubtreeRoot === node) hostSubtreeRoot = null; 14041 node = node.return; 14042 } 14043 if (hostSubtreeRoot === node) hostSubtreeRoot = null; 14044 node.sibling.return = node.return; 14045 node = node.sibling; 14046 } 14047 } 14048 function commitAttachRef(finishedWork) { 14049 var ref = finishedWork.ref; 14050 if (ref !== null) {
14051 var instance = finishedWork.stateNode; 14052 var instanceToUse; 14053 switch (finishedWork.tag) { 14054 case HostComponent: 14055 instanceToUse = getPublicInstance(instance); 14056 break; 14057 default: instanceToUse = instance; 14058 } 14059 if (typeof ref === "function") { 14060 var retVal; 14061 if (finishedWork.mode & ProfileMode) try { 14062 startLayoutEffectTimer(); 14063 retVal = ref(instanceToUse); 14064 } finally { 14065 recordLayoutEffectDuration(finishedWork); 14066 } 14067 else retVal = ref(instanceToUse); 14068 if (typeof retVal === "function") error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(finishedWork)); 14069 } else { 14070 if (!ref.hasOwnProperty("current")) error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", getComponentNameFromFiber(finishedWork)); 14071 ref.current = instanceToUse; 14072 } 14073 } 14074 } 14075 function detachFiberMutation(fiber) { 14076 var alternate = fiber.alternate; 14077 if (alternate !== null) alternate.return = null; 14078 fiber.return = null; 14079 } 14080 function detachFiberAfterEffects(fiber) { 14081 var alternate = fiber.alternate; 14082 if (alternate !== null) { 14083 fiber.alternate = null; 14084 detachFiberAfterEffects(alternate); 14085 } 14086 fiber.child = null; 14087 fiber.deletions = null; 14088 fiber.sibling = null; 14089 if (fiber.tag === HostComponent) { 14090 var hostInstance = fiber.stateNode; 14091 if (hostInstance !== null) detachDeletedInstance(hostInstance); 14092 } 14093 fiber.stateNode = null; 14094 fiber._debugOwner = null; 14095 fiber.return = null; 14096 fiber.dependencies = null; 14097 fiber.memoizedProps = null; 14098 fiber.memoizedState = null; 14099 fiber.pendingProps = null; 14100 fiber.stateNode = null; 14101 fiber.updateQueue = null; 14102 } 14103 function getHostParentFiber(fiber) { 14104 var parent = fiber.return; 14105 while (parent !== null) { 14106 if (isHostParent(parent)) return parent; 14107 parent = parent.return; 14108 } 14109 throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."); 14110 } 14111 function isHostParent(fiber) { 14112 return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal; 14113 } 14114 function getHostSibling(fiber) { 14115 var node = fiber; 14116 siblings: while (true) { 14117 while (node.sibling === null) { 14118 if (node.return === null || isHostParent(node.return)) return null; 14119 node = node.return; 14120 } 14121 node.sibling.return = node.return; 14122 node = node.sibling; 14123 while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) { 14124 if (node.flags & Placement) continue siblings; 14125 if (node.child === null || node.tag === HostPortal) continue siblings; 14126 else { 14127 node.child.return = node; 14128 node = node.child; 14129 } 14130 } 14131 if (!(node.flags & Placement)) return node.stateNode; 14132 } 14133 } 14134 function commitPlacement(finishedWork) { 14135 var parentFiber = getHostParentFiber(finishedWork); 14136 switch (parentFiber.tag) { 14137 case HostComponent: 14138 var parent = parentFiber.stateNode; 14139 if (parentFiber.flags & ContentReset) { 14140 resetTextContent(parent); 14141 parentFiber.flags &= ~ContentReset; 14142 } 14143 insertOrAppendPlacementNode(finishedWork, getHostSibling(finishedWork), parent); 14144 break; 14145 case HostRoot: 14146 case HostPortal: 14147 var _parent = parentFiber.stateNode.containerInfo; 14148 insertOrAppendPlacementNodeIntoContainer(finishedWork, getHostSibling(finishedWork), _parent); 14149 break; 14150 default: throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue."); 14151 } 14152 } 14153 function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { 14154 var tag = node.tag; 14155 if (tag === HostComponent || tag === HostText) { 14156 var stateNode = node.stateNode; 14157 if (before) insertInContainerBefore(parent, stateNode, before); 14158 else appendChildToContainer(parent, stateNode); 14159 } else if (tag === HostPortal); 14160 else { 14161 var child = node.child; 14162 if (child !== null) { 14163 insertOrAppendPlacementNodeIntoContainer(child, before, parent); 14164 var sibling = child.sibling; 14165 while (sibling !== null) { 14166 insertOrAppendPlacementNodeIntoContainer(sibling, before, parent); 14167 sibling = sibling.sibling; 14168 } 14169 } 14170 } 14171 } 14172 function insertOrAppendPlacementNode(node, before, parent) { 14173 var tag = node.tag; 14174 if (tag === HostComponent || tag === HostText) { 14175 var stateNode = node.stateNode; 14176 if (before) insertBefore(parent, stateNode, before); 14177 else appendChild(parent, stateNode); 14178 } else if (tag === HostPortal); 14179 else { 14180 var child = node.child; 14181 if (child !== null) { 14182 insertOrAppendPlacementNode(child, before, parent); 14183 var sibling = child.sibling; 14184 while (sibling !== null) { 14185 insertOrAppendPlacementNode(sibling, before, parent); 14186 sibling = sibling.sibling; 14187 } 14188 } 14189 } 14190 } 14191 var hostParent = null; 14192 var hostParentIsContainer = false;
14193 function commitDeletionEffects(root, returnFiber, deletedFiber) { 14194 var parent = returnFiber; 14195 findParent: while (parent !== null) { 14196 switch (parent.tag) { 14197 case HostComponent: 14198 hostParent = parent.stateNode; 14199 hostParentIsContainer = false; 14200 break findParent; 14201 case HostRoot: 14202 hostParent = parent.stateNode.containerInfo; 14203 hostParentIsContainer = true; 14204 break findParent; 14205 case HostPortal: 14206 hostParent = parent.stateNode.containerInfo; 14207 hostParentIsContainer = true; 14208 break findParent; 14209 } 14210 parent = parent.return; 14211 } 14212 if (hostParent === null) throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."); 14213 commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); 14214 hostParent = null; 14215 hostParentIsContainer = false; 14216 detachFiberMutation(deletedFiber); 14217 } 14218 function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) { 14219 var child = parent.child; 14220 while (child !== null) { 14221 commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child); 14222 child = child.sibling; 14223 } 14224 } 14225 function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) { 14226 onCommitUnmount(deletedFiber); 14227 switch (deletedFiber.tag) { 14228 case HostComponent: if (!offscreenSubtreeWasHidden) safelyDetachRef(deletedFiber, nearestMountedAncestor); 14229 case HostText: 14230 var prevHostParent = hostParent; 14231 var prevHostParentIsContainer = hostParentIsContainer; 14232 hostParent = null; 14233 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); 14234 hostParent = prevHostParent; 14235 hostParentIsContainer = prevHostParentIsContainer; 14236 if (hostParent !== null) if (hostParentIsContainer) removeChildFromContainer(hostParent, deletedFiber.stateNode); 14237 else removeChild(hostParent, deletedFiber.stateNode); 14238 return; 14239 case DehydratedFragment: 14240 if (hostParent !== null) if (hostParentIsContainer) clearSuspenseBoundaryFromContainer(hostParent, deletedFiber.stateNode); 14241 else clearSuspenseBoundary(hostParent, deletedFiber.stateNode); 14242 return; 14243 case HostPortal: 14244 var _prevHostParent = hostParent; 14245 var _prevHostParentIsContainer = hostParentIsContainer; 14246 hostParent = deletedFiber.stateNode.containerInfo; 14247 hostParentIsContainer = true; 14248 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); 14249 hostParent = _prevHostParent; 14250 hostParentIsContainer = _prevHostParentIsContainer; 14251 return; 14252 case FunctionComponent: 14253 case ForwardRef: 14254 case MemoComponent: 14255 case SimpleMemoComponent: 14256 if (!offscreenSubtreeWasHidden) { 14257 var updateQueue = deletedFiber.updateQueue; 14258 if (updateQueue !== null) { 14259 var lastEffect = updateQueue.lastEffect; 14260 if (lastEffect !== null) { 14261 var firstEffect = lastEffect.next; 14262 var effect = firstEffect; 14263 do { 14264 var _effect = effect, destroy = _effect.destroy, tag = _effect.tag; 14265 if (destroy !== void 0) { 14266 if ((tag & Insertion) !== NoFlags$1) safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); 14267 else if ((tag & Layout) !== NoFlags$1) { 14268 markComponentLayoutEffectUnmountStarted(deletedFiber); 14269 if (deletedFiber.mode & ProfileMode) { 14270 startLayoutEffectTimer(); 14271 safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); 14272 recordLayoutEffectDuration(deletedFiber); 14273 } else safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); 14274 markComponentLayoutEffectUnmountStopped(); 14275 } 14276 } 14277 effect = effect.next; 14278 } while (effect !== firstEffect); 14279 } 14280 } 14281 } 14282 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); 14283 return; 14284 case ClassComponent: 14285 if (!offscreenSubtreeWasHidden) { 14286 safelyDetachRef(deletedFiber, nearestMountedAncestor); 14287 var instance = deletedFiber.stateNode; 14288 if (typeof instance.componentWillUnmount === "function") safelyCallComponentWillUnmount(
14288deletedFiber, nearestMountedAncestor, instance); 14289 } 14290 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); 14291 return; 14292 case ScopeComponent: 14293 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); 14294 return; 14295 case OffscreenComponent: 14296 if (deletedFiber.mode & ConcurrentMode) { 14297 var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; 14298 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || deletedFiber.memoizedState !== null; 14299 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); 14300 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; 14301 } else recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); 14302 break; 14303 default: 14304 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); 14305 return; 14306 } 14307 } 14308 function commitSuspenseCallback(finishedWork) { 14309 finishedWork.memoizedState; 14310 } 14311 function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { 14312 if (finishedWork.memoizedState === null) { 14313 var current = finishedWork.alternate; 14314 if (current !== null) { 14315 var prevState = current.memoizedState; 14316 if (prevState !== null) { 14317 var suspenseInstance = prevState.dehydrated; 14318 if (suspenseInstance !== null) commitHydratedSuspenseInstance(suspenseInstance); 14319 } 14320 } 14321 } 14322 } 14323 function attachSuspenseRetryListeners(finishedWork) { 14324 var wakeables = finishedWork.updateQueue; 14325 if (wakeables !== null) { 14326 finishedWork.updateQueue = null; 14327 var retryCache = finishedWork.stateNode; 14328 if (retryCache === null) retryCache = finishedWork.stateNode = new PossiblyWeakSet(); 14329 wakeables.forEach(function(wakeable) { 14330 var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); 14331 if (!retryCache.has(wakeable)) { 14332 retryCache.add(wakeable); 14333 if (isDevToolsPresent) if (inProgressLanes !== null && inProgressRoot !== null) restorePendingUpdaters(inProgressRoot, inProgressLanes); 14334 else throw Error("Expected finished root and lanes to be set. This is a bug in React."); 14335 wakeable.then(retry, retry); 14336 } 14337 }); 14338 } 14339 } 14340 function commitMutationEffects(root, finishedWork, committedLanes) { 14341 inProgressLanes = committedLanes; 14342 inProgressRoot = root; 14343 setCurrentFiber(finishedWork); 14344 commitMutationEffectsOnFiber(finishedWork, root); 14345 setCurrentFiber(finishedWork); 14346 inProgressLanes = null; 14347 inProgressRoot = null; 14348 } 14349 function recursivelyTraverseMutationEffects(root, parentFiber, lanes) { 14350 var deletions = parentFiber.deletions; 14351 if (deletions !== null) for (var i = 0; i < deletions.length; i++) { 14352 var childToDelete = deletions[i]; 14353 try { 14354 commitDeletionEffects(root, parentFiber, childToDelete); 14355 } catch (error) { 14356 captureCommitPhaseError(childToDelete, parentFiber, error); 14357 } 14358 } 14359 var prevDebugFiber = getCurrentFiber(); 14360 if (parentFiber.subtreeFlags & MutationMask) { 14361 var child = parentFiber.child; 14362 while (child !== null) { 14363 setCurrentFiber(child); 14364 commitMutationEffectsOnFiber(child, root); 14365 child = child.sibling; 14366 } 14367 } 14368 setCurrentFiber(prevDebugFiber); 14369 } 14370 function commitMutationEffectsOnFiber(finishedWork, root, lanes) { 14371 var current = finishedWork.alternate; 14372 var flags = finishedWork.flags; 14373 switch (finishedWork.tag) { 14374 case FunctionComponent: 14375 case ForwardRef: 14376 case MemoComponent: 14377 case SimpleMemoComponent: 14378 recursivelyTraverseMutationEffects(root, finishedWork); 14379 commitReconciliationEffects(finishedWork); 14380 if (flags & Update) { 14381 try { 14382 commitHookEffectListUnmount(Insertion | HasEffect, finishedWork, finishedWork.return); 14383 commitHookEffectListMount(Insertion | HasEffect, finishedWork); 14384 } catch (error) { 14385 captureCommitPhaseError(finishedWork, finishedWork.return, error); 14386 } 14387 if (finishedWork.mode & ProfileMode) { 14388 try { 14389 startLayoutEffectTimer(); 14390 commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return); 14391 } catch (error) { 14392 captureCommitPhaseError(finishedWork, finishedWork.return, error); 14393 } 14394 recordLayoutEffectDuration(finishedWork); 14395 } else try { 14396 commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return); 14397 } catch (error) { 14398 captureCommitPhaseError(finishedWork, finishedWork.return, error); 14399 } 14400 } 14401 return; 14402 case ClassComponent: 14403 recursivelyTraverseMutationEffects(root, finishedWork); 14404 commitReconciliationEffects(finishedWork); 14405 if (flags & Ref) { 14406 if (current !== null) safelyDetachRef(current, current.return); 14407 } 14408 return; 14409 case HostComponent: 14410 recursivelyTraverseMutationEffects(root, finishedWork); 14411 commitReconciliationEffects(finishedWork); 14412 if (flags & Ref) { 14413 if (current !== null) safelyDetachRef(current, current.return); 14414 } 14415 if (finishedWork.flags & ContentReset) {
14416 var instance = finishedWork.stateNode; 14417 try { 14418 resetTextContent(instance); 14419 } catch (error) { 14420 captureCommitPhaseError(finishedWork, finishedWork.return, error); 14421 } 14422 } 14423 if (flags & Update) { 14424 var _instance4 = finishedWork.stateNode; 14425 if (_instance4 != null) { 14426 var newProps = finishedWork.memoizedProps; 14427 var oldProps = current !== null ? current.memoizedProps : newProps; 14428 var type = finishedWork.type; 14429 var updatePayload = finishedWork.updateQueue; 14430 finishedWork.updateQueue = null; 14431 if (updatePayload !== null) try { 14432 commitUpdate(_instance4, updatePayload, type, oldProps, newProps, finishedWork); 14433 } catch (error) { 14434 captureCommitPhaseError(finishedWork, finishedWork.return, error); 14435 } 14436 } 14437 } 14438 return; 14439 case HostText: 14440 recursivelyTraverseMutationEffects(root, finishedWork); 14441 commitReconciliationEffects(finishedWork); 14442 if (flags & Update) { 14443 if (finishedWork.stateNode === null) throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue."); 14444 var textInstance = finishedWork.stateNode; 14445 var newText = finishedWork.memoizedProps; 14446 var oldText = current !== null ? current.memoizedProps : newText; 14447 try { 14448 commitTextUpdate(textInstance, oldText, newText); 14449 } catch (error) { 14450 captureCommitPhaseError(finishedWork, finishedWork.return, error); 14451 } 14452 } 14453 return; 14454 case HostRoot: 14455 recursivelyTraverseMutationEffects(root, finishedWork); 14456 commitReconciliationEffects(finishedWork); 14457 if (flags & Update) { 14458 if (current !== null) { 14459 if (current.memoizedState.isDehydrated) try { 14460 commitHydratedContainer(root.containerInfo); 14461 } catch (error) { 14462 captureCommitPhaseError(finishedWork, finishedWork.return, error); 14463 } 14464 } 14465 } 14466 return; 14467 case HostPortal: 14468 recursivelyTraverseMutationEffects(root, finishedWork); 14469 commitReconciliationEffects(finishedWork); 14470 return; 14471 case SuspenseComponent: 14472 recursivelyTraverseMutationEffects(root, finishedWork); 14473 commitReconciliationEffects(finishedWork); 14474 var offscreenFiber = finishedWork.child; 14475 if (offscreenFiber.flags & Visibility) { 14476 var offscreenInstance = offscreenFiber.stateNode; 14477 var isHidden = offscreenFiber.memoizedState !== null; 14478 offscreenInstance.isHidden = isHidden; 14479 if (isHidden) { 14480 if (!(offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null)) markCommitTimeOfFallback(); 14481 } 14482 } 14483 if (flags & Update) { 14484 try { 14485 commitSuspenseCallback(finishedWork); 14486 } catch (error) { 14487 captureCommitPhaseError(finishedWork, finishedWork.return, error); 14488 } 14489 attachSuspenseRetryListeners(finishedWork); 14490 } 14491 return; 14492 case OffscreenComponent: 14493 var _wasHidden = current !== null && current.memoizedState !== null; 14494 if (finishedWork.mode & ConcurrentMode) { 14495 var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; 14496 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || _wasHidden; 14497 recursivelyTraverseMutationEffects(root, finishedWork); 14498 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; 14499 } else recursivelyTraverseMutationEffects(root, finishedWork); 14500 commitReconciliationEffects(finishedWork); 14501 if (flags & Visibility) { 14502 var _offscreenInstance = finishedWork.stateNode; 14503 var _isHidden = finishedWork.memoizedState !== null; 14504 var offscreenBoundary = finishedWork; 14505 _offscreenInstance.isHidden = _isHidden; 14506 if (_isHidden) { 14507 if (!_wasHidden) { 14508 if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) { 14509 nextEffect = offscreenBoundary; 14510 var offscreenChild = offscreenBoundary.child; 14511 while (offscreenChild !== null) { 14512 nextEffect = offscreenChild; 14513 disappearLayoutEffects_begin(offscreenChild); 14514 offscreenChild = offscreenChild.sibling; 14515 } 14516 } 14517 } 14518 } 14519 hideOrUnhideAllChildren(offscreenBoundary, _isHidden); 14520 } 14521 return; 14522 case SuspenseListComponent: 14523 recursivelyTraverseMutationEffects(root, finishedWork); 14524 commitReconciliationEffects(finishedWork); 14525 if (flags & Update) attachSuspenseRetryListeners(finishedWork); 14526 return; 14527 case ScopeComponent: return; 14528 default: 14529 recursivelyTraverseMutationEffects(root, finishedWork); 14530 commitReconciliationEffects(finishedWork); 14531 return; 14532 } 14533 } 14534 function commitReconciliationEffects(finishedWork) { 14535 var flags = finishedWork.flags; 14536 if (flags & Placement) { 14537 try { 14538 commitPlacement(finishedWork); 14539 } catch (error) { 14540 captureCommitPhaseError(finishedWork, finishedWork.return, error); 14541 } 14542 finishedWork.flags &= ~Placement; 14543 } 14544 if (flags & Hydrating) finishedWork.flags &= ~Hydrating; 14545 } 14546 function commitLayoutEffects(finishedWork, root, committedLanes) { 14547 inProgressLanes = committedLanes; 14548 inProgressRoot = root; 14549 nextEffect = finishedWork; 14550 commitLayoutEffects_begin(finishedWork, root, committedLanes); 14551 inProgressLanes = null; 14552 inProgressRoot = null; 14553 } 14554 function commitLayoutEffects_begin(subtreeRoot, root, committedLanes) { 14555 var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode; 14556 while (nextEffect !== null) { 14557 var fiber = nextEffect; 14558 var firstChild = fiber.child; 14559 if (fiber.tag === OffscreenComponent && isModernRoot) { 14560 var newOffscreenSubtreeIsHidden = fiber.memoizedState !== null || offscreenSubtreeIsHidden;
14561 if (newOffscreenSubtreeIsHidden) { 14562 commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes); 14563 continue; 14564 } else { 14565 var current = fiber.alternate; 14566 var newOffscreenSubtreeWasHidden = current !== null && current.memoizedState !== null || offscreenSubtreeWasHidden; 14567 var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden; 14568 var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; 14569 offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; 14570 offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden; 14571 if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) { 14572 nextEffect = fiber; 14573 reappearLayoutEffects_begin(fiber); 14574 } 14575 var child = firstChild; 14576 while (child !== null) { 14577 nextEffect = child; 14578 commitLayoutEffects_begin(child, root, committedLanes); 14579 child = child.sibling; 14580 } 14581 nextEffect = fiber; 14582 offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; 14583 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; 14584 commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes); 14585 continue; 14586 } 14587 } 14588 if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) { 14589 firstChild.return = fiber; 14590 nextEffect = firstChild; 14591 } else commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes); 14592 } 14593 } 14594 function commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes) { 14595 while (nextEffect !== null) { 14596 var fiber = nextEffect; 14597 if ((fiber.flags & LayoutMask) !== NoFlags) { 14598 var current = fiber.alternate; 14599 setCurrentFiber(fiber); 14600 try { 14601 commitLayoutEffectOnFiber(root, current, fiber, committedLanes); 14602 } catch (error) { 14603 captureCommitPhaseError(fiber, fiber.return, error); 14604 } 14605 resetCurrentFiber(); 14606 } 14607 if (fiber === subtreeRoot) { 14608 nextEffect = null; 14609 return; 14610 } 14611 var sibling = fiber.sibling; 14612 if (sibling !== null) { 14613 sibling.return = fiber.return; 14614 nextEffect = sibling; 14615 return; 14616 } 14617 nextEffect = fiber.return; 14618 } 14619 } 14620 function disappearLayoutEffects_begin(subtreeRoot) { 14621 while (nextEffect !== null) { 14622 var fiber = nextEffect; 14623 var firstChild = fiber.child; 14624 switch (fiber.tag) { 14625 case FunctionComponent: 14626 case ForwardRef: 14627 case MemoComponent: 14628 case SimpleMemoComponent: 14629 if (fiber.mode & ProfileMode) try { 14630 startLayoutEffectTimer(); 14631 commitHookEffectListUnmount(Layout, fiber, fiber.return); 14632 } finally { 14633 recordLayoutEffectDuration(fiber); 14634 } 14635 else commitHookEffectListUnmount(Layout, fiber, fiber.return); 14636 break; 14637 case ClassComponent: 14638 safelyDetachRef(fiber, fiber.return); 14639 var instance = fiber.stateNode; 14640 if (typeof instance.componentWillUnmount === "function") safelyCallComponentWillUnmount(fiber, fiber.return, instance); 14641 break; 14642 case HostComponent: 14643 safelyDetachRef(fiber, fiber.return); 14644 break; 14645 case OffscreenComponent: 14646 if (fiber.memoizedState !== null) { 14647 disappearLayoutEffects_complete(subtreeRoot); 14648 continue; 14649 } 14650 break; 14651 } 14652 if (firstChild !== null) { 14653 firstChild.return = fiber; 14654 nextEffect = firstChild; 14655 } else disappearLayoutEffects_complete(subtreeRoot); 14656 } 14657 } 14658 function disappearLayoutEffects_complete(subtreeRoot) { 14659 while (nextEffect !== null) { 14660 var fiber = nextEffect; 14661 if (fiber === subtreeRoot) { 14662 nextEffect = null; 14663 return; 14664 } 14665 var sibling = fiber.sibling; 14666 if (sibling !== null) { 14667 sibling.return = fiber.return; 14668 nextEffect = sibling; 14669 return; 14670 } 14671 nextEffect = fiber.return; 14672 } 14673 } 14674 function reappearLayoutEffects_begin(subtreeRoot) { 14675 while (nextEffect !== null) { 14676 var fiber = nextEffect; 14677 var firstChild = fiber.child; 14678 if (fiber.tag === OffscreenComponent) { 14679 if (fiber.memoizedState !== null) { 14680 reappearLayoutEffects_complete(subtreeRoot); 14681 continue; 14682 } 14683 } 14684 if (firstChild !== null) { 14685 firstChild.return = fiber; 14686 nextEffect = firstChild; 14687 } else reappearLayoutEffects_complete(subtreeRoot); 14688 } 14689 } 14690 function reappearLayoutEffects_complete(subtreeRoot) { 14691 while (nextEffect !== null) { 14692 var fiber = nextEffect; 14693 setCurrentFiber(fiber);
14694 try { 14695 reappearLayoutEffectsOnFiber(fiber); 14696 } catch (error) { 14697 captureCommitPhaseError(fiber, fiber.return, error); 14698 } 14699 resetCurrentFiber(); 14700 if (fiber === subtreeRoot) { 14701 nextEffect = null; 14702 return; 14703 } 14704 var sibling = fiber.sibling; 14705 if (sibling !== null) { 14706 sibling.return = fiber.return; 14707 nextEffect = sibling; 14708 return; 14709 } 14710 nextEffect = fiber.return; 14711 } 14712 } 14713 function commitPassiveMountEffects(root, finishedWork, committedLanes, committedTransitions) { 14714 nextEffect = finishedWork; 14715 commitPassiveMountEffects_begin(finishedWork, root, committedLanes, committedTransitions); 14716 } 14717 function commitPassiveMountEffects_begin(subtreeRoot, root, committedLanes, committedTransitions) { 14718 while (nextEffect !== null) { 14719 var fiber = nextEffect; 14720 var firstChild = fiber.child; 14721 if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) { 14722 firstChild.return = fiber; 14723 nextEffect = firstChild; 14724 } else commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions); 14725 } 14726 } 14727 function commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions) { 14728 while (nextEffect !== null) { 14729 var fiber = nextEffect; 14730 if ((fiber.flags & Passive) !== NoFlags) { 14731 setCurrentFiber(fiber); 14732 try { 14733 commitPassiveMountOnFiber(root, fiber, committedLanes, committedTransitions); 14734 } catch (error) { 14735 captureCommitPhaseError(fiber, fiber.return, error); 14736 } 14737 resetCurrentFiber(); 14738 } 14739 if (fiber === subtreeRoot) { 14740 nextEffect = null; 14741 return; 14742 } 14743 var sibling = fiber.sibling; 14744 if (sibling !== null) { 14745 sibling.return = fiber.return; 14746 nextEffect = sibling; 14747 return; 14748 } 14749 nextEffect = fiber.return; 14750 } 14751 } 14752 function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) { 14753 switch (finishedWork.tag) { 14754 case FunctionComponent: 14755 case ForwardRef: 14756 case SimpleMemoComponent: 14757 if (finishedWork.mode & ProfileMode) { 14758 startPassiveEffectTimer(); 14759 try { 14760 commitHookEffectListMount(Passive$1 | HasEffect, finishedWork); 14761 } finally { 14762 recordPassiveEffectDuration(finishedWork); 14763 } 14764 } else commitHookEffectListMount(Passive$1 | HasEffect, finishedWork); 14765 break; 14766 } 14767 } 14768 function commitPassiveUnmountEffects(firstChild) { 14769 nextEffect = firstChild; 14770 commitPassiveUnmountEffects_begin(); 14771 } 14772 function commitPassiveUnmountEffects_begin() { 14773 while (nextEffect !== null) { 14774 var fiber = nextEffect; 14775 var child = fiber.child; 14776 if ((nextEffect.flags & ChildDeletion) !== NoFlags) { 14777 var deletions = fiber.deletions; 14778 if (deletions !== null) { 14779 for (var i = 0; i < deletions.length; i++) { 14780 var fiberToDelete = deletions[i]; 14781 nextEffect = fiberToDelete; 14782 commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber); 14783 } 14784 var previousFiber = fiber.alternate; 14785 if (previousFiber !== null) { 14786 var detachedChild = previousFiber.child; 14787 if (detachedChild !== null) { 14788 previousFiber.child = null; 14789 do { 14790 var detachedSibling = detachedChild.sibling; 14791 detachedChild.sibling = null; 14792 detachedChild = detachedSibling; 14793 } while (detachedChild !== null); 14794 } 14795 } 14796 nextEffect = fiber; 14797 } 14798 } 14799 if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) { 14800 child.return = fiber; 14801 nextEffect = child; 14802 } else commitPassiveUnmountEffects_complete(); 14803 } 14804 } 14805 function commitPassiveUnmountEffects_complete() { 14806 while (nextEffect !== null) { 14807 var fiber = nextEffect; 14808 if ((fiber.flags & Passive) !== NoFlags) { 14809 setCurrentFiber(fiber); 14810 commitPassiveUnmountOnFiber(fiber); 14811 resetCurrentFiber(); 14812 } 14813 var sibling = fiber.sibling; 14814 if (sibling !== null) { 14815 sibling.return = fiber.return; 14816 nextEffect = sibling; 14817 return; 14818 } 14819 nextEffect = fiber.return; 14820 } 14821 } 14822 function commitPassiveUnmountOnFiber(finishedWork) { 14823 switch (finishedWork.tag) { 14824 case FunctionComponent:
14825 case ForwardRef: 14826 case SimpleMemoComponent: 14827 if (finishedWork.mode & ProfileMode) { 14828 startPassiveEffectTimer(); 14829 commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return); 14830 recordPassiveEffectDuration(finishedWork); 14831 } else commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return); 14832 break; 14833 } 14834 } 14835 function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) { 14836 while (nextEffect !== null) { 14837 var fiber = nextEffect; 14838 setCurrentFiber(fiber); 14839 commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor); 14840 resetCurrentFiber(); 14841 var child = fiber.child; 14842 if (child !== null) { 14843 child.return = fiber; 14844 nextEffect = child; 14845 } else commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot); 14846 } 14847 } 14848 function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) { 14849 while (nextEffect !== null) { 14850 var fiber = nextEffect; 14851 var sibling = fiber.sibling; 14852 var returnFiber = fiber.return; 14853 detachFiberAfterEffects(fiber); 14854 if (fiber === deletedSubtreeRoot) { 14855 nextEffect = null; 14856 return; 14857 } 14858 if (sibling !== null) { 14859 sibling.return = returnFiber; 14860 nextEffect = sibling; 14861 return; 14862 } 14863 nextEffect = returnFiber; 14864 } 14865 } 14866 function commitPassiveUnmountInsideDeletedTreeOnFiber(current, nearestMountedAncestor) { 14867 switch (current.tag) { 14868 case FunctionComponent: 14869 case ForwardRef: 14870 case SimpleMemoComponent: 14871 if (current.mode & ProfileMode) { 14872 startPassiveEffectTimer(); 14873 commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor); 14874 recordPassiveEffectDuration(current); 14875 } else commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor); 14876 break; 14877 } 14878 } 14879 function invokeLayoutEffectMountInDEV(fiber) { 14880 switch (fiber.tag) { 14881 case FunctionComponent: 14882 case ForwardRef: 14883 case SimpleMemoComponent: 14884 try { 14885 commitHookEffectListMount(Layout | HasEffect, fiber); 14886 } catch (error) { 14887 captureCommitPhaseError(fiber, fiber.return, error); 14888 } 14889 break; 14890 case ClassComponent: 14891 var instance = fiber.stateNode; 14892 try { 14893 instance.componentDidMount(); 14894 } catch (error) { 14895 captureCommitPhaseError(fiber, fiber.return, error); 14896 } 14897 break; 14898 } 14899 } 14900 function invokePassiveEffectMountInDEV(fiber) { 14901 switch (fiber.tag) { 14902 case FunctionComponent: 14903 case ForwardRef: 14904 case SimpleMemoComponent: 14905 try { 14906 commitHookEffectListMount(Passive$1 | HasEffect, fiber); 14907 } catch (error) { 14908 captureCommitPhaseError(fiber, fiber.return, error); 14909 } 14910 break; 14911 } 14912 } 14913 function invokeLayoutEffectUnmountInDEV(fiber) { 14914 switch (fiber.tag) { 14915 case FunctionComponent: 14916 case ForwardRef: 14917 case SimpleMemoComponent: 14918 try { 14919 commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return); 14920 } catch (error) { 14921 captureCommitPhaseError(fiber, fiber.return, error); 14922 } 14923 break; 14924 case ClassComponent: 14925 var instance = fiber.stateNode; 14926 if (typeof instance.componentWillUnmount === "function") safelyCallComponentWillUnmount(fiber, fiber.return, instance); 14927 break; 14928 } 14929 } 14930 function invokePassiveEffectUnmountInDEV(fiber) { 14931 switch (fiber.tag) { 14932 case FunctionComponent: 14933 case ForwardRef: 14934 case SimpleMemoComponent: try { 14935 commitHookEffectListUnmount(Passive$1 | HasEffect, fiber, fiber.return); 14936 } catch (error) { 14937 captureCommitPhaseError(fiber, fiber.return, error); 14938 } 14939 } 14940 } 14941 if (typeof Symbol === "function" && Symbol.for) { 14942 var symbolFor = Symbol.for; 14943 symbolFor("selector.component"); 14944 symbolFor("selector.has_pseudo_class"); 14945 symbolFor("selector.role"); 14946 symbolFor("selector.test_id"); 14947 symbolFor("selector.text"); 14948 } 14949 var commitHooks = []; 14950 function onCommitRoot$1() { 14951 commitHooks.forEach(function(commitHook) { 14952 return commitHook(); 14953 }); 14954 } 14955 var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue; 14956 function isLegacyActEnvironment(fiber) { 14957 var isReactActEnvironmentGlobal = typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0; 14958 return typeof jest !== "undefined" && isReactActEnvironmentGlobal !== false; 14959 }
14960 function isConcurrentActEnvironment() { 14961 var isReactActEnvironmentGlobal = typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0; 14962 if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) error("The current testing environment is not configured to support act(...)"); 14963 return isReactActEnvironmentGlobal; 14964 } 14965 var ceil = Math.ceil; 14966 var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue; 14967 var NoContext = 0; 14968 var BatchedContext = 1; 14969 var RenderContext = 2; 14970 var CommitContext = 4; 14971 var RootInProgress = 0; 14972 var RootFatalErrored = 1; 14973 var RootErrored = 2; 14974 var RootSuspended = 3; 14975 var RootSuspendedWithDelay = 4; 14976 var RootCompleted = 5; 14977 var RootDidNotComplete = 6; 14978 var executionContext = NoContext; 14979 var workInProgressRoot = null; 14980 var workInProgress = null; 14981 var workInProgressRootRenderLanes = NoLanes; 14982 var subtreeRenderLanes = NoLanes; 14983 var subtreeRenderLanesCursor = createCursor(NoLanes); 14984 var workInProgressRootExitStatus = RootInProgress; 14985 var workInProgressRootFatalError = null; 14986 var workInProgressRootIncludedLanes = NoLanes; 14987 var workInProgressRootSkippedLanes = NoLanes; 14988 var workInProgressRootInterleavedUpdatedLanes = NoLanes; 14989 var workInProgressRootPingedLanes = NoLanes; 14990 var workInProgressRootConcurrentErrors = null; 14991 var workInProgressRootRecoverableErrors = null; 14992 var globalMostRecentFallbackTime = 0; 14993 var FALLBACK_THROTTLE_MS = 500; 14994 var workInProgressRootRenderTargetTime = Infinity; 14995 var RENDER_TIMEOUT_MS = 500; 14996 var workInProgressTransitions = null; 14997 function resetRenderTimer() { 14998 workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS; 14999 } 15000 function getRenderTargetTime() { 15001 return workInProgressRootRenderTargetTime; 15002 } 15003 var hasUncaughtError = false; 15004 var firstUncaughtError = null; 15005 var legacyErrorBoundariesThatAlreadyFailed = null; 15006 var rootDoesHavePassiveEffects = false; 15007 var rootWithPendingPassiveEffects = null; 15008 var pendingPassiveEffectsLanes = NoLanes; 15009 var pendingPassiveProfilerEffects = []; 15010 var pendingPassiveTransitions = null; 15011 var NESTED_UPDATE_LIMIT = 50; 15012 var nestedUpdateCount = 0; 15013 var rootWithNestedUpdates = null; 15014 var isFlushingPassiveEffects = false; 15015 var didScheduleUpdateDuringPassiveEffects = false; 15016 var NESTED_PASSIVE_UPDATE_LIMIT = 50; 15017 var nestedPassiveUpdateCount = 0; 15018 var rootWithPassiveNestedUpdates = null; 15019 var currentEventTime = NoTimestamp; 15020 var currentEventTransitionLane = NoLanes; 15021 var isRunningInsertionEffect = false; 15022 function getWorkInProgressRoot() { 15023 return workInProgressRoot; 15024 } 15025 function requestEventTime() { 15026 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) return now(); 15027 if (currentEventTime !== NoTimestamp) return currentEventTime; 15028 currentEventTime = now(); 15029 return currentEventTime; 15030 } 15031 function requestUpdateLane(fiber) { 15032 if ((fiber.mode & ConcurrentMode) === NoMode) return SyncLane; 15033 else if ((executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) return pickArbitraryLane(workInProgressRootRenderLanes); 15034 if (requestCurrentTransition() !== NoTransition) { 15035 if (ReactCurrentBatchConfig$3.transition !== null) { 15036 var transition = ReactCurrentBatchConfig$3.transition; 15037 if (!transition._updatedFibers) transition._updatedFibers = /* @__PURE__ */ new Set(); 15038 transition._updatedFibers.add(fiber); 15039 } 15040 if (currentEventTransitionLane === NoLane) currentEventTransitionLane = claimNextTransitionLane(); 15041 return currentEventTransitionLane; 15042 } 15043 var updateLane = getCurrentUpdatePriority(); 15044 if (updateLane !== NoLane) return updateLane; 15045 return getCurrentEventPriority(); 15046 } 15047 function requestRetryLane(fiber) { 15048 if ((fiber.mode & ConcurrentMode) === NoMode) return SyncLane; 15049 return claimNextRetryLane(); 15050 } 15051 function scheduleUpdateOnFiber(root, fiber, lane, eventTime) { 15052 checkForNestedUpdates(); 15053 if (isRunningInsertionEffect) error("useInsertionEffect must not schedule updates."); 15054 if (isFlushingPassiveEffects) didScheduleUpdateDuringPassiveEffects = true; 15055 markRootUpdated(root, lane, eventTime); 15056 if ((executionContext & RenderContext) !== NoLanes && root === workInProgressRoot) warnAboutRenderPhaseUpdatesInDEV(fiber); 15057 else { 15058 if (isDevToolsPresent) addFiberToLanesMap(root, fiber, lane); 15059 warnIfUpdatesNotWrappedWithActDEV(fiber); 15060 if (root === workInProgressRoot) { 15061 if ((executionContext & RenderContext) === NoContext) workInProgressRootInterleavedU
15061pdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane); 15062 if (workInProgressRootExitStatus === RootSuspendedWithDelay) markRootSuspended$1(root, workInProgressRootRenderLanes); 15063 } 15064 ensureRootIsScheduled(root, eventTime); 15065 if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && !ReactCurrentActQueue$1.isBatchingLegacy) { 15066 resetRenderTimer(); 15067 flushSyncCallbacksOnlyInLegacyMode(); 15068 } 15069 } 15070 } 15071 function scheduleInitialHydrationOnRoot(root, lane, eventTime) { 15072 var current = root.current; 15073 current.lanes = lane; 15074 markRootUpdated(root, lane, eventTime); 15075 ensureRootIsScheduled(root, eventTime); 15076 } 15077 function isUnsafeClassRenderPhaseUpdate(fiber) { 15078 return (executionContext & RenderContext) !== NoContext; 15079 } 15080 function ensureRootIsScheduled(root, currentTime) { 15081 var existingCallbackNode = root.callbackNode; 15082 markStarvedLanesAsExpired(root, currentTime); 15083 var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); 15084 if (nextLanes === NoLanes) { 15085 if (existingCallbackNode !== null) cancelCallback$1(existingCallbackNode); 15086 root.callbackNode = null; 15087 root.callbackPriority = NoLane; 15088 return; 15089 } 15090 var newCallbackPriority = getHighestPriorityLane(nextLanes); 15091 var existingCallbackPriority = root.callbackPriority; 15092 if (existingCallbackPriority === newCallbackPriority && !(ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) { 15093 if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) error("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue."); 15094 return; 15095 } 15096 if (existingCallbackNode != null) cancelCallback$1(existingCallbackNode); 15097 var newCallbackNode; 15098 if (newCallbackPriority === SyncLane) { 15099 if (root.tag === LegacyRoot) { 15100 if (ReactCurrentActQueue$1.isBatchingLegacy !== null) ReactCurrentActQueue$1.didScheduleLegacyUpdate = true; 15101 scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root)); 15102 } else scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root)); 15103 if (ReactCurrentActQueue$1.current !== null) ReactCurrentActQueue$1.current.push(flushSyncCallbacks); 15104 else scheduleMicrotask(function() { 15105 if ((executionContext & (RenderContext | CommitContext)) === NoContext) flushSyncCallbacks(); 15106 }); 15107 newCallbackNode = null; 15108 } else { 15109 var schedulerPriorityLevel; 15110 switch (lanesToEventPriority(nextLanes)) { 15111 case DiscreteEventPriority: 15112 schedulerPriorityLevel = ImmediatePriority; 15113 break; 15114 case ContinuousEventPriority: 15115 schedulerPriorityLevel = UserBlockingPriority; 15116 break; 15117 case DefaultEventPriority: 15118 schedulerPriorityLevel = NormalPriority; 15119 break; 15120 case IdleEventPriority: 15121 schedulerPriorityLevel = IdlePriority; 15122 break; 15123 default: 15124 schedulerPriorityLevel = NormalPriority; 15125 break; 15126 } 15127 newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root)); 15128 } 15129 root.callbackPriority = newCallbackPriority; 15130 root.callbackNode = newCallbackNode; 15131 } 15132 function performConcurrentWorkOnRoot(root, didTimeout) { 15133 resetNestedUpdateFlag(); 15134 currentEventTime = NoTimestamp; 15135 currentEventTransitionLane = NoLanes; 15136 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw new Error("Should not already be working."); 15137 var originalCallbackNode = root.callbackNode; 15138 if (flushPassiveEffects()) { 15139 if (root.callbackNode !== originalCallbackNode) return null; 15140 } 15141 var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); 15142 if (lanes === NoLanes) return null; 15143 var exitStatus = !includesBlockingLane(root, lanes) && !includesExpiredLane(root, lanes) && !didTimeout ? renderRootConcurrent(root, lanes) : renderRootSync(root, lanes); 15144 if (exitStatus !== RootInProgress) { 15145 if (exitStatus === RootErrored) { 15146 var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); 15147 if (errorRetryLanes !== NoLanes) { 15148 lanes = errorRetryLanes; 15149 exitStatus = recoverFromConcurrentError(root, errorRetryLanes); 15150 } 15151 }
15152 if (exitStatus === RootFatalErrored) { 15153 var fatalError = workInProgressRootFatalError; 15154 prepareFreshStack(root, NoLanes); 15155 markRootSuspended$1(root, lanes); 15156 ensureRootIsScheduled(root, now()); 15157 throw fatalError; 15158 } 15159 if (exitStatus === RootDidNotComplete) markRootSuspended$1(root, lanes); 15160 else { 15161 var renderWasConcurrent = !includesBlockingLane(root, lanes); 15162 var finishedWork = root.current.alternate; 15163 if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) { 15164 exitStatus = renderRootSync(root, lanes); 15165 if (exitStatus === RootErrored) { 15166 var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); 15167 if (_errorRetryLanes !== NoLanes) { 15168 lanes = _errorRetryLanes; 15169 exitStatus = recoverFromConcurrentError(root, _errorRetryLanes); 15170 } 15171 } 15172 if (exitStatus === RootFatalErrored) { 15173 var _fatalError = workInProgressRootFatalError; 15174 prepareFreshStack(root, NoLanes); 15175 markRootSuspended$1(root, lanes); 15176 ensureRootIsScheduled(root, now()); 15177 throw _fatalError; 15178 } 15179 } 15180 root.finishedWork = finishedWork; 15181 root.finishedLanes = lanes; 15182 finishConcurrentRender(root, exitStatus, lanes); 15183 } 15184 } 15185 ensureRootIsScheduled(root, now()); 15186 if (root.callbackNode === originalCallbackNode) return performConcurrentWorkOnRoot.bind(null, root); 15187 return null; 15188 } 15189 function recoverFromConcurrentError(root, errorRetryLanes) { 15190 var errorsFromFirstAttempt = workInProgressRootConcurrentErrors; 15191 if (isRootDehydrated(root)) { 15192 var rootWorkInProgress = prepareFreshStack(root, errorRetryLanes); 15193 rootWorkInProgress.flags |= ForceClientRender; 15194 errorHydratingContainer(root.containerInfo); 15195 } 15196 var exitStatus = renderRootSync(root, errorRetryLanes); 15197 if (exitStatus !== RootErrored) { 15198 var errorsFromSecondAttempt = workInProgressRootRecoverableErrors; 15199 workInProgressRootRecoverableErrors = errorsFromFirstAttempt; 15200 if (errorsFromSecondAttempt !== null) queueRecoverableErrors(errorsFromSecondAttempt); 15201 } 15202 return exitStatus; 15203 } 15204 function queueRecoverableErrors(errors) { 15205 if (workInProgressRootRecoverableErrors === null) workInProgressRootRecoverableErrors = errors; 15206 else workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors); 15207 } 15208 function finishConcurrentRender(root, exitStatus, lanes) { 15209 switch (exitStatus) { 15210 case RootInProgress: 15211 case RootFatalErrored: throw new Error("Root did not complete. This is a bug in React."); 15212 case RootErrored: 15213 commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); 15214 break; 15215 case RootSuspended: 15216 markRootSuspended$1(root, lanes); 15217 if (includesOnlyRetries(lanes) && !shouldForceFlushFallbacksInDEV()) { 15218 var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); 15219 if (msUntilTimeout > 10) { 15220 if (getNextLanes(root, NoLanes) !== NoLanes) break; 15221 var suspendedLanes = root.suspendedLanes; 15222 if (!isSubsetOfLanes(suspendedLanes, lanes)) { 15223 requestEventTime(); 15224 markRootPinged(root, suspendedLanes); 15225 break; 15226 } 15227 root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout); 15228 break; 15229 } 15230 } 15231 commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); 15232 break; 15233 case RootSuspendedWithDelay: 15234 markRootSuspended$1(root, lanes); 15235 if (includesOnlyTransitions(lanes)) break; 15236 if (!shouldForceFlushFallbacksInDEV()) { 15237 var eventTimeMs = getMostRecentEventTime(root, lanes); 15238 var timeElapsedMs = now() - eventTimeMs; 15239 var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; 15240 if (_msUntilTimeout > 10) { 15241 root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout); 15242 break; 15243 } 15244 } 15245 commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); 15246 break; 15247 case RootCompleted: 15248 commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); 15249 break; 15250 default: throw new Error("Unknown root exit status."); 15251 } 15252 } 15253 function isRenderConsistentWithExternalStores(finishedWork) { 15254 var node = finishedWork; 15255 while (true) { 15256 if (node.flags & StoreConsistency) { 15257 var updateQueue = node.updateQueue; 15258 if (updateQueue !== null) { 15259 var checks = updateQueue.stores; 15260 if (checks !== null) for (var i = 0; i < checks.length; i++) { 15261 var check = checks[i];
15262 var getSnapshot = check.getSnapshot; 15263 var renderedValue = check.value; 15264 try { 15265 if (!objectIs(getSnapshot(), renderedValue)) return false; 15266 } catch (error) { 15267 return false; 15268 } 15269 } 15270 } 15271 } 15272 var child = node.child; 15273 if (node.subtreeFlags & StoreConsistency && child !== null) { 15274 child.return = node; 15275 node = child; 15276 continue; 15277 } 15278 if (node === finishedWork) return true; 15279 while (node.sibling === null) { 15280 if (node.return === null || node.return === finishedWork) return true; 15281 node = node.return; 15282 } 15283 node.sibling.return = node.return; 15284 node = node.sibling; 15285 } 15286 return true; 15287 } 15288 function markRootSuspended$1(root, suspendedLanes) { 15289 suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); 15290 suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes); 15291 markRootSuspended(root, suspendedLanes); 15292 } 15293 function performSyncWorkOnRoot(root) { 15294 syncNestedUpdateFlag(); 15295 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw new Error("Should not already be working."); 15296 flushPassiveEffects(); 15297 var lanes = getNextLanes(root, NoLanes); 15298 if (!includesSomeLane(lanes, SyncLane)) { 15299 ensureRootIsScheduled(root, now()); 15300 return null; 15301 } 15302 var exitStatus = renderRootSync(root, lanes); 15303 if (root.tag !== LegacyRoot && exitStatus === RootErrored) { 15304 var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); 15305 if (errorRetryLanes !== NoLanes) { 15306 lanes = errorRetryLanes; 15307 exitStatus = recoverFromConcurrentError(root, errorRetryLanes); 15308 } 15309 } 15310 if (exitStatus === RootFatalErrored) { 15311 var fatalError = workInProgressRootFatalError; 15312 prepareFreshStack(root, NoLanes); 15313 markRootSuspended$1(root, lanes); 15314 ensureRootIsScheduled(root, now()); 15315 throw fatalError; 15316 } 15317 if (exitStatus === RootDidNotComplete) throw new Error("Root did not complete. This is a bug in React."); 15318 root.finishedWork = root.current.alternate; 15319 root.finishedLanes = lanes; 15320 commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); 15321 ensureRootIsScheduled(root, now()); 15322 return null; 15323 } 15324 function flushRoot(root, lanes) { 15325 if (lanes !== NoLanes) { 15326 markRootEntangled(root, mergeLanes(lanes, SyncLane)); 15327 ensureRootIsScheduled(root, now()); 15328 if ((executionContext & (RenderContext | CommitContext)) === NoContext) { 15329 resetRenderTimer(); 15330 flushSyncCallbacks(); 15331 } 15332 } 15333 } 15334 function batchedUpdates$1(fn, a) { 15335 var prevExecutionContext = executionContext; 15336 executionContext |= BatchedContext; 15337 try { 15338 return fn(a); 15339 } finally { 15340 executionContext = prevExecutionContext; 15341 if (executionContext === NoContext && !ReactCurrentActQueue$1.isBatchingLegacy) { 15342 resetRenderTimer(); 15343 flushSyncCallbacksOnlyInLegacyMode(); 15344 } 15345 } 15346 } 15347 function discreteUpdates(fn, a, b, c, d) { 15348 var previousPriority = getCurrentUpdatePriority(); 15349 var prevTransition = ReactCurrentBatchConfig$3.transition; 15350 try { 15351 ReactCurrentBatchConfig$3.transition = null; 15352 setCurrentUpdatePriority(DiscreteEventPriority); 15353 return fn(a, b, c, d); 15354 } finally { 15355 setCurrentUpdatePriority(previousPriority); 15356 ReactCurrentBatchConfig$3.transition = prevTransition; 15357 if (executionContext === NoContext) resetRenderTimer(); 15358 } 15359 } 15360 function flushSync(fn) { 15361 if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) flushPassiveEffects(); 15362 var prevExecutionContext = executionContext; 15363 executionContext |= BatchedContext; 15364 var prevTransition = ReactCurrentBatchConfig$3.transition; 15365 var previousPriority = getCurrentUpdatePriority(); 15366 try { 15367 ReactCurrentBatchConfig$3.transition = null; 15368 setCurrentUpdatePriority(DiscreteEventPriority); 15369 if (fn) return fn(); 15370 else return; 15371 } finally { 15372 setCurrentUpdatePriority(previousPriority); 15373 ReactCurrentBatchConfig$3.transition = prevTransition; 15374 executionContext = prevExecutionContext; 15375 if ((executionContext & (RenderContext | CommitContext)) === NoContext) flushSyncCallbacks(); 15376 } 15377 } 15378 function isAlreadyRendering() { 15379 return (executionContext & (RenderContext | CommitContext)) !== NoContext; 15380 } 15381 function pushRenderLanes(fiber, lanes) { 15382 push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber); 15383 subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes); 15384 workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes); 15385 } 15386 function popRenderLanes(fiber) { 15387 subtreeRenderLanes = subtreeRenderLanesCursor.current; 15388 pop(subtreeRenderLanesCursor, fiber); 15389 } 15390 function prepareFreshStack(root, lanes) { 15391 root.finishedWork = null; 15392 root.finishedLanes = NoLanes; 15393 var timeoutHandle = root.timeoutHandle; 15394 if (timeoutHandle !== noTimeout) { 15395 root.timeoutHandle = noTimeout; 15396 cancelTimeout(timeoutHandle); 15397 } 15398 if (workInProgress !== null) { 15399 var interruptedWork = workInProgress.return; 15400 while (interruptedWork !== null) { 15401 var current = interruptedWork.alternate; 15402 unwindInterruptedWork(current, interruptedWork); 15403 interruptedWork = interruptedWork.return; 15404 } 15405 } 15406 workInProgressRoot = root; 15407 var rootWorkInProgress = createWorkInProgress(root.current, null); 15408 workInProgress = rootWorkInProgress;
15409 workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes; 15410 workInProgressRootExitStatus = RootInProgress; 15411 workInProgressRootFatalError = null; 15412 workInProgressRootSkippedLanes = NoLanes; 15413 workInProgressRootInterleavedUpdatedLanes = NoLanes; 15414 workInProgressRootPingedLanes = NoLanes; 15415 workInProgressRootConcurrentErrors = null; 15416 workInProgressRootRecoverableErrors = null; 15417 finishQueueingConcurrentUpdates(); 15418 ReactStrictModeWarnings.discardPendingWarnings(); 15419 return rootWorkInProgress; 15420 } 15421 function handleError(root, thrownValue) { 15422 do { 15423 var erroredWork = workInProgress; 15424 try { 15425 resetContextDependencies(); 15426 resetHooksAfterThrow(); 15427 resetCurrentFiber(); 15428 ReactCurrentOwner$2.current = null; 15429 if (erroredWork === null || erroredWork.return === null) { 15430 workInProgressRootExitStatus = RootFatalErrored; 15431 workInProgressRootFatalError = thrownValue; 15432 workInProgress = null; 15433 return; 15434 } 15435 if (enableProfilerTimer && erroredWork.mode & ProfileMode) stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true); 15436 if (enableSchedulingProfiler) { 15437 markComponentRenderStopped(); 15438 if (thrownValue !== null && typeof thrownValue === "object" && typeof thrownValue.then === "function") markComponentSuspended(erroredWork, thrownValue, workInProgressRootRenderLanes); 15439 else markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes); 15440 } 15441 throwException(root, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes); 15442 completeUnitOfWork(erroredWork); 15443 } catch (yetAnotherThrownValue) { 15444 thrownValue = yetAnotherThrownValue; 15445 if (workInProgress === erroredWork && erroredWork !== null) { 15446 erroredWork = erroredWork.return; 15447 workInProgress = erroredWork; 15448 } else erroredWork = workInProgress; 15449 continue; 15450 } 15451 return; 15452 } while (true); 15453 } 15454 function pushDispatcher() { 15455 var prevDispatcher = ReactCurrentDispatcher$2.current; 15456 ReactCurrentDispatcher$2.current = ContextOnlyDispatcher; 15457 if (prevDispatcher === null) return ContextOnlyDispatcher; 15458 else return prevDispatcher; 15459 } 15460 function popDispatcher(prevDispatcher) { 15461 ReactCurrentDispatcher$2.current = prevDispatcher; 15462 } 15463 function markCommitTimeOfFallback() { 15464 globalMostRecentFallbackTime = now(); 15465 } 15466 function markSkippedUpdateLanes(lane) { 15467 workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes); 15468 } 15469 function renderDidSuspend() { 15470 if (workInProgressRootExitStatus === RootInProgress) workInProgressRootExitStatus = RootSuspended; 15471 } 15472 function renderDidSuspendDelayIfPossible() { 15473 if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) workInProgressRootExitStatus = RootSuspendedWithDelay; 15474 if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes); 15475 } 15476 function renderDidError(error) { 15477 if (workInProgressRootExitStatus !== RootSuspendedWithDelay) workInProgressRootExitStatus = RootErrored; 15478 if (workInProgressRootConcurrentErrors === null) workInProgressRootConcurrentErrors = [error]; 15479 else workInProgressRootConcurrentErrors.push(error); 15480 } 15481 function renderHasNotSuspendedYet() { 15482 return workInProgressRootExitStatus === RootInProgress; 15483 } 15484 function renderRootSync(root, lanes) { 15485 var prevExecutionContext = executionContext; 15486 executionContext |= RenderContext; 15487 var prevDispatcher = pushDispatcher(); 15488 if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { 15489 if (isDevToolsPresent) { 15490 var memoizedUpdaters = root.memoizedUpdaters; 15491 if (memoizedUpdaters.size > 0) { 15492 restorePendingUpdaters(root, workInProgressRootRenderLanes); 15493 memoizedUpdaters.clear(); 15494 } 15495 movePendingFibersToMemoized(root, lanes); 15496 } 15497 workInProgressTransitions = getTransitionsForLanes(); 15498 prepareFreshStack(root, lanes); 15499 } 15500 markRenderStarted(lanes); 15501 do 15502 try { 15503 workLoopSync(); 15504 break; 15505 } catch (thrownValue) { 15506 handleError(root, thrownValue); 15507 } 15508 while (true); 15509 resetContextDependencies(); 15510 executionContext = prevExecutionContext;
15511 popDispatcher(prevDispatcher); 15512 if (workInProgress !== null) throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue."); 15513 markRenderStopped(); 15514 workInProgressRoot = null; 15515 workInProgressRootRenderLanes = NoLanes; 15516 return workInProgressRootExitStatus; 15517 } 15518 /** @noinline */ 15519 function workLoopSync() { 15520 while (workInProgress !== null) performUnitOfWork(workInProgress); 15521 } 15522 function renderRootConcurrent(root, lanes) { 15523 var prevExecutionContext = executionContext; 15524 executionContext |= RenderContext; 15525 var prevDispatcher = pushDispatcher(); 15526 if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { 15527 if (isDevToolsPresent) { 15528 var memoizedUpdaters = root.memoizedUpdaters; 15529 if (memoizedUpdaters.size > 0) { 15530 restorePendingUpdaters(root, workInProgressRootRenderLanes); 15531 memoizedUpdaters.clear(); 15532 } 15533 movePendingFibersToMemoized(root, lanes); 15534 } 15535 workInProgressTransitions = getTransitionsForLanes(); 15536 resetRenderTimer(); 15537 prepareFreshStack(root, lanes); 15538 } 15539 markRenderStarted(lanes); 15540 do 15541 try { 15542 workLoopConcurrent(); 15543 break; 15544 } catch (thrownValue) { 15545 handleError(root, thrownValue); 15546 } 15547 while (true); 15548 resetContextDependencies(); 15549 popDispatcher(prevDispatcher); 15550 executionContext = prevExecutionContext; 15551 if (workInProgress !== null) { 15552 markRenderYielded(); 15553 return RootInProgress; 15554 } else { 15555 markRenderStopped(); 15556 workInProgressRoot = null; 15557 workInProgressRootRenderLanes = NoLanes; 15558 return workInProgressRootExitStatus; 15559 } 15560 } 15561 /** @noinline */ 15562 function workLoopConcurrent() { 15563 while (workInProgress !== null && !shouldYield()) performUnitOfWork(workInProgress); 15564 } 15565 function performUnitOfWork(unitOfWork) { 15566 var current = unitOfWork.alternate; 15567 setCurrentFiber(unitOfWork); 15568 var next; 15569 if ((unitOfWork.mode & ProfileMode) !== NoMode) { 15570 startProfilerTimer(unitOfWork); 15571 next = beginWork$1(current, unitOfWork, subtreeRenderLanes); 15572 stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true); 15573 } else next = beginWork$1(current, unitOfWork, subtreeRenderLanes); 15574 resetCurrentFiber(); 15575 unitOfWork.memoizedProps = unitOfWork.pendingProps; 15576 if (next === null) completeUnitOfWork(unitOfWork); 15577 else workInProgress = next; 15578 ReactCurrentOwner$2.current = null; 15579 } 15580 function completeUnitOfWork(unitOfWork) { 15581 var completedWork = unitOfWork; 15582 do { 15583 var current = completedWork.alternate; 15584 var returnFiber = completedWork.return; 15585 if ((completedWork.flags & Incomplete) === NoFlags) { 15586 setCurrentFiber(completedWork); 15587 var next = void 0; 15588 if ((completedWork.mode & ProfileMode) === NoMode) next = completeWork(current, completedWork, subtreeRenderLanes); 15589 else { 15590 startProfilerTimer(completedWork); 15591 next = completeWork(current, completedWork, subtreeRenderLanes); 15592 stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); 15593 } 15594 resetCurrentFiber(); 15595 if (next !== null) { 15596 workInProgress = next; 15597 return; 15598 } 15599 } else { 15600 var _next = unwindWork(current, completedWork); 15601 if (_next !== null) { 15602 _next.flags &= HostEffectMask; 15603 workInProgress = _next; 15604 return; 15605 } 15606 if ((completedWork.mode & ProfileMode) !== NoMode) { 15607 stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); 15608 var actualDuration = completedWork.actualDuration; 15609 var child = completedWork.child; 15610 while (child !== null) { 15611 actualDuration += child.actualDuration; 15612 child = child.sibling; 15613 } 15614 completedWork.actualDuration = actualDuration; 15615 } 15616 if (returnFiber !== null) { 15617 returnFiber.flags |= Incomplete; 15618 returnFiber.subtreeFlags = NoFlags; 15619 returnFiber.deletions = null; 15620 } else { 15621 workInProgressRootExitStatus = RootDidNotComplete; 15622 workInProgress = null; 15623 return; 15624 } 15625 } 15626 var siblingFiber = completedWork.sibling; 15627 if (siblingFiber !== null) { 15628 workInProgress = siblingFiber; 15629 return; 15630 } 15631 completedWork = returnFiber; 15632 workInProgress = completedWork; 15633 } while (completedWork !== null); 15634 if (workInProgressRootExitStatus === RootInProgress) workInProgressRootExitStatus = RootCompleted; 15635 } 15636 function commitRoot(root, recoverableErrors, transitions) { 15637 var previousUpdateLanePriority = getCurrentUpdatePriority(); 15638 var prevTransition = ReactCurrentBatchConfig$3.transition; 15639 try { 15640 ReactCurrentBatchConfig$3.transition = null; 15641 setCurrentUpdatePriority(DiscreteEventPriority); 15642 commitRootImpl(root, recoverableErrors, transitions, previousUpdateLanePriority); 15643 } finally { 15644 ReactCurrentBatchConfig$3.transition = prevTransition; 15645 setCurrentUpdatePriority(previousUpdateLanePriority); 15646 } 15647 return null; 15648 } 15649 function commitRootImpl(root, recoverableErrors, transitions, renderPri
15649orityLevel) { 15650 do 15651 flushPassiveEffects(); 15652 while (rootWithPendingPassiveEffects !== null); 15653 flushRenderPhaseStrictModeWarningsInDEV(); 15654 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw new Error("Should not already be working."); 15655 var finishedWork = root.finishedWork; 15656 var lanes = root.finishedLanes; 15657 markCommitStarted(lanes); 15658 if (finishedWork === null) { 15659 markCommitStopped(); 15660 return null; 15661 } else if (lanes === NoLanes) error("root.finishedLanes should not be empty during a commit. This is a bug in React."); 15662 root.finishedWork = null; 15663 root.finishedLanes = NoLanes; 15664 if (finishedWork === root.current) throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."); 15665 root.callbackNode = null; 15666 root.callbackPriority = NoLane; 15667 var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes); 15668 markRootFinished(root, remainingLanes); 15669 if (root === workInProgressRoot) { 15670 workInProgressRoot = null; 15671 workInProgress = null; 15672 workInProgressRootRenderLanes = NoLanes; 15673 } 15674 if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) { 15675 if (!rootDoesHavePassiveEffects) { 15676 rootDoesHavePassiveEffects = true; 15677 pendingPassiveTransitions = transitions; 15678 scheduleCallback$1(NormalPriority, function() { 15679 flushPassiveEffects(); 15680 return null; 15681 }); 15682 } 15683 } 15684 var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags; 15685 var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags; 15686 if (subtreeHasEffects || rootHasEffect) { 15687 var prevTransition = ReactCurrentBatchConfig$3.transition; 15688 ReactCurrentBatchConfig$3.transition = null; 15689 var previousPriority = getCurrentUpdatePriority(); 15690 setCurrentUpdatePriority(DiscreteEventPriority); 15691 var prevExecutionContext = executionContext; 15692 executionContext |= CommitContext; 15693 ReactCurrentOwner$2.current = null; 15694 commitBeforeMutationEffects(root, finishedWork); 15695 recordCommitTime(); 15696 commitMutationEffects(root, finishedWork, lanes); 15697 resetAfterCommit(root.containerInfo); 15698 root.current = finishedWork; 15699 markLayoutEffectsStarted(lanes); 15700 commitLayoutEffects(finishedWork, root, lanes); 15701 markLayoutEffectsStopped(); 15702 requestPaint(); 15703 executionContext = prevExecutionContext; 15704 setCurrentUpdatePriority(previousPriority); 15705 ReactCurrentBatchConfig$3.transition = prevTransition; 15706 } else { 15707 root.current = finishedWork; 15708 recordCommitTime(); 15709 } 15710 var rootDidHavePassiveEffects = rootDoesHavePassiveEffects; 15711 if (rootDoesHavePassiveEffects) { 15712 rootDoesHavePassiveEffects = false; 15713 rootWithPendingPassiveEffects = root; 15714 pendingPassiveEffectsLanes = lanes; 15715 } else { 15716 nestedPassiveUpdateCount = 0; 15717 rootWithPassiveNestedUpdates = null; 15718 } 15719 remainingLanes = root.pendingLanes; 15720 if (remainingLanes === NoLanes) legacyErrorBoundariesThatAlreadyFailed = null; 15721 if (!rootDidHavePassiveEffects) commitDoubleInvokeEffectsInDEV(root.current, false); 15722 onCommitRoot(finishedWork.stateNode, renderPriorityLevel); 15723 if (isDevToolsPresent) root.memoizedUpdaters.clear(); 15724 onCommitRoot$1(); 15725 ensureRootIsScheduled(root, now()); 15726 if (recoverableErrors !== null) { 15727 var onRecoverableError = root.onRecoverableError; 15728 for (var i = 0; i < recoverableErrors.length; i++) { 15729 var recoverableError = recoverableErrors[i]; 15730 var componentStack = recoverableError.stack; 15731 var digest = recoverableError.digest; 15732 onRecoverableError(recoverableError.value, { 15733 componentStack, 15734 digest 15735 }); 15736 } 15737 } 15738 if (hasUncaughtError) { 15739 hasUncaughtError = false; 15740 var error$1 = firstUncaughtError; 15741 firstUncaughtError = null; 15742 throw error$1; 15743 } 15744 if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root.tag !== LegacyRoot) flushPassiveEffects(); 15745 remainingLanes = root.pendingLanes; 15746 if (includesSomeLane(remainingLanes, SyncLane)) { 15747 markNestedUpdateScheduled(); 15748 if (root === rootWithNestedUpdates) nestedUpdateCount++; 15749 else { 15750 nestedUpdateCount = 0; 15751 rootWithNestedUpdates = root; 15752 } 15753 } else nestedUpdateCount = 0; 15754 flushSyncCallbacks(); 15755 markCommitStopped(); 15756 return null; 15757 } 15758 function flushPassiveEffects() { 15759 if (rootWithPendingPassiveEffects !== null) { 15760 var priority = lowerEventPriority(DefaultEventPriority, lanesToEventPriority(pendingPassiveEffectsLanes)); 15761 var prevTransition = ReactCurrentBatchConfig$3.transition; 15762 var previousPriority = getCurrentUpdatePriority();
15763 try { 15764 ReactCurrentBatchConfig$3.transition = null; 15765 setCurrentUpdatePriority(priority); 15766 return flushPassiveEffectsImpl(); 15767 } finally { 15768 setCurrentUpdatePriority(previousPriority); 15769 ReactCurrentBatchConfig$3.transition = prevTransition; 15770 } 15771 } 15772 return false; 15773 } 15774 function enqueuePendingPassiveProfilerEffect(fiber) { 15775 pendingPassiveProfilerEffects.push(fiber); 15776 if (!rootDoesHavePassiveEffects) { 15777 rootDoesHavePassiveEffects = true; 15778 scheduleCallback$1(NormalPriority, function() { 15779 flushPassiveEffects(); 15780 return null; 15781 }); 15782 } 15783 } 15784 function flushPassiveEffectsImpl() { 15785 if (rootWithPendingPassiveEffects === null) return false; 15786 var transitions = pendingPassiveTransitions; 15787 pendingPassiveTransitions = null; 15788 var root = rootWithPendingPassiveEffects; 15789 var lanes = pendingPassiveEffectsLanes; 15790 rootWithPendingPassiveEffects = null; 15791 pendingPassiveEffectsLanes = NoLanes; 15792 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw new Error("Cannot flush passive effects while already rendering."); 15793 isFlushingPassiveEffects = true; 15794 didScheduleUpdateDuringPassiveEffects = false; 15795 markPassiveEffectsStarted(lanes); 15796 var prevExecutionContext = executionContext; 15797 executionContext |= CommitContext; 15798 commitPassiveUnmountEffects(root.current); 15799 commitPassiveMountEffects(root, root.current, lanes, transitions); 15800 var profilerEffects = pendingPassiveProfilerEffects; 15801 pendingPassiveProfilerEffects = []; 15802 for (var i = 0; i < profilerEffects.length; i++) { 15803 var _fiber = profilerEffects[i]; 15804 commitPassiveEffectDurations(root, _fiber); 15805 } 15806 markPassiveEffectsStopped(); 15807 commitDoubleInvokeEffectsInDEV(root.current, true); 15808 executionContext = prevExecutionContext; 15809 flushSyncCallbacks(); 15810 if (didScheduleUpdateDuringPassiveEffects) if (root === rootWithPassiveNestedUpdates) nestedPassiveUpdateCount++; 15811 else { 15812 nestedPassiveUpdateCount = 0; 15813 rootWithPassiveNestedUpdates = root; 15814 } 15815 else nestedPassiveUpdateCount = 0; 15816 isFlushingPassiveEffects = false; 15817 didScheduleUpdateDuringPassiveEffects = false; 15818 onPostCommitRoot(root); 15819 var stateNode = root.current.stateNode; 15820 stateNode.effectDuration = 0; 15821 stateNode.passiveEffectDuration = 0; 15822 return true; 15823 } 15824 function isAlreadyFailedLegacyErrorBoundary(instance) { 15825 return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance); 15826 } 15827 function markLegacyErrorBoundaryAsFailed(instance) { 15828 if (legacyErrorBoundariesThatAlreadyFailed === null) legacyErrorBoundariesThatAlreadyFailed = new Set([instance]); 15829 else legacyErrorBoundariesThatAlreadyFailed.add(instance); 15830 } 15831 function prepareToThrowUncaughtError(error) { 15832 if (!hasUncaughtError) { 15833 hasUncaughtError = true; 15834 firstUncaughtError = error; 15835 } 15836 } 15837 var onUncaughtError = prepareToThrowUncaughtError; 15838 function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { 15839 var root = enqueueUpdate(rootFiber, createRootErrorUpdate(rootFiber, createCapturedValueAtFiber(error, sourceFiber), SyncLane), SyncLane); 15840 var eventTime = requestEventTime(); 15841 if (root !== null) { 15842 markRootUpdated(root, SyncLane, eventTime); 15843 ensureRootIsScheduled(root, eventTime); 15844 } 15845 } 15846 function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { 15847 reportUncaughtErrorInDEV(error$1); 15848 setIsRunningInsertionEffect(false); 15849 if (sourceFiber.tag === HostRoot) { 15850 captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1); 15851 return; 15852 } 15853 var fiber = null; 15854 fiber = nearestMountedAncestor; 15855 while (fiber !== null) { 15856 if (fiber.tag === HostRoot) { 15857 captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1); 15858 return; 15859 } else if (fiber.tag === ClassComponent) { 15860 var ctor = fiber.type; 15861 var instance = fiber.stateNode; 15862 if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) { 15863 var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber); 15864 var update = createClassErrorUpdate(fiber, errorInfo, SyncLane); 15865 var root = enqueueUpdate(fiber, update, SyncLane); 15866 var eventTime = requestEventTime(); 15867 if (root !== null) { 15868 markRootUpdated(root, SyncLane, eventTime); 15869 ensureRootIsScheduled(root, eventTime); 15870 } 15871 return; 15872 } 15873 } 15874 fiber = fiber.return; 15875 } 15876 error("Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s", error$1); 15877 } 15878 function pingSuspendedRoot(root, wakeable, pingedLanes) { 15879 var pingCache = root.pingCache; 15880 if (pingCache !== null) pingCache.delete(wakeable); 15881 var eventTime = requestEventTime(); 15882 markRootPinged(root, pingedLanes); 15883 warnIfSuspenseResolutionNotWrappedWithActDEV(root); 15884 if (workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) prepareFreshStack(root, NoLanes); 15885 else workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes); 15886 ensureRootIsScheduled(root, eventTime); 15887 } 15888 function retryTimedOutBoundary(boundaryFiber, retryLane) { 15889 if (retryLane === NoLane) retryLane = requestRetryLane(boundaryFiber); 15890 var eventTime = requestEventTime(); 15891 var root = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); 15892 if (root !== null) { 15893 markRootUpdated(root, retryLane, eventTime); 15894 ensureRootIsScheduled(root, eventTime); 15895 } 15896 } 15897 function retryDehydratedSuspenseBoundary(boundaryFiber) { 15898 var suspenseState = boundaryFiber.memoizedState; 15899 var retryLane = NoLane; 15900 if (suspenseState !== null) retryLane = suspenseState.retryLane; 15901 retryTimedOutBoundary(boundaryFiber, retryLane); 15902 } 15903 function resolveRetryWakeable(boundaryFiber, wakeable) { 15904 var retryLane = NoLane; 15905 var retryCache; 15906 switch (boundaryFiber.tag) { 15907 case SuspenseComponent: 15908 retryCache = boundaryFiber.stateNode; 15909 var suspenseState = boundaryFiber.memoizedState; 15910 if (suspenseState !== null) retryLane = suspenseState.retryLane; 15911 break; 15912 case SuspenseListComponent: 15913 retryCache = boundaryFiber.stateNode; 15914 break; 15915 default: throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React."); 15916 } 15917 if (retryCache !== null) retryCache.delete(wakeable); 15918 retryTimedOutBoundary(boundaryFiber, retryLane); 15919 } 15920 function jnd(timeElapsed) { 15921 return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3e3 ? 3e3 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960; 15922 } 15923 function checkForNestedUpdates() { 15924 if (nestedUpdateCount > NESTED_UPDATE_LIMIT) { 15925 nestedUpdateCount = 0; 15926 rootWithNestedUpdates = null; 15927 throw new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops."); 15928 }
15929 if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) { 15930 nestedPassiveUpdateCount = 0; 15931 rootWithPassiveNestedUpdates = null; 15932 error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."); 15933 } 15934 } 15935 function flushRenderPhaseStrictModeWarningsInDEV() { 15936 ReactStrictModeWarnings.flushLegacyContextWarning(); 15937 ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); 15938 } 15939 function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) { 15940 setCurrentFiber(fiber); 15941 invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV); 15942 if (hasPassiveEffects) invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV); 15943 invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV); 15944 if (hasPassiveEffects) invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV); 15945 resetCurrentFiber(); 15946 } 15947 function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) { 15948 var current = firstChild; 15949 var subtreeRoot = null; 15950 while (current !== null) { 15951 var primarySubtreeFlag = current.subtreeFlags & fiberFlags; 15952 if (current !== subtreeRoot && current.child !== null && primarySubtreeFlag !== NoFlags) current = current.child; 15953 else { 15954 if ((current.flags & fiberFlags) !== NoFlags) invokeEffectFn(current); 15955 if (current.sibling !== null) current = current.sibling; 15956 else current = subtreeRoot = current.return; 15957 } 15958 } 15959 } 15960 var didWarnStateUpdateForNotYetMountedComponent = null; 15961 function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { 15962 if ((executionContext & RenderContext) !== NoContext) return; 15963 if (!(fiber.mode & ConcurrentMode)) return; 15964 var tag = fiber.tag; 15965 if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) return; 15966 var componentName = getComponentNameFromFiber(fiber) || "ReactComponent"; 15967 if (didWarnStateUpdateForNotYetMountedComponent !== null) { 15968 if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) return; 15969 didWarnStateUpdateForNotYetMountedComponent.add(componentName); 15970 } else didWarnStateUpdateForNotYetMountedComponent = new Set([componentName]); 15971 var previousFiber = current; 15972 try { 15973 setCurrentFiber(fiber); 15974 error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead."); 15975 } finally { 15976 if (previousFiber) setCurrentFiber(fiber); 15977 else resetCurrentFiber(); 15978 } 15979 } 15980 var beginWork$1; 15981 var dummyFiber = null; 15982 beginWork$1 = function(current, unitOfWork, lanes) { 15983 var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork); 15984 try { 15985 return beginWork(current, unitOfWork, lanes); 15986 } catch (originalError) { 15987 if (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") throw originalError; 15988 resetContextDependencies(); 15989 resetHooksAfterThrow(); 15990 unwindInterruptedWork(current, unitOfWork); 15991 assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); 15992 if (unitOfWork.mode & ProfileMode) startProfilerTimer(unitOfWork); 15993 invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes); 15994 if (hasCaughtError()) { 15995 var replayError = clearCaughtError(); 15996 if (typeof replayError === "object" && replayError !== null && replayError._suppressLogging && typeof originalError === "object" && originalError !== null && !originalError._suppressLogging) originalError._suppressLogging = true; 15997 } 15998 throw originalError; 15999 } 16000 }; 16001 var didWarnAboutUpdateInRender = false;
16002 var didWarnAboutUpdateInRenderForAnotherComponent = /* @__PURE__ */ new Set(); 16003 function warnAboutRenderPhaseUpdatesInDEV(fiber) { 16004 if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) switch (fiber.tag) { 16005 case FunctionComponent: 16006 case ForwardRef: 16007 case SimpleMemoComponent: 16008 var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown"; 16009 var dedupeKey = renderingComponentName; 16010 if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) { 16011 didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey); 16012 error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", getComponentNameFromFiber(fiber) || "Unknown", renderingComponentName, renderingComponentName); 16013 } 16014 break; 16015 case ClassComponent: 16016 if (!didWarnAboutUpdateInRender) { 16017 error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."); 16018 didWarnAboutUpdateInRender = true; 16019 } 16020 break; 16021 } 16022 } 16023 function restorePendingUpdaters(root, lanes) { 16024 if (isDevToolsPresent) root.memoizedUpdaters.forEach(function(schedulingFiber) { 16025 addFiberToLanesMap(root, schedulingFiber, lanes); 16026 }); 16027 } 16028 var fakeActCallbackNode = {}; 16029 function scheduleCallback$1(priorityLevel, callback) { 16030 var actQueue = ReactCurrentActQueue$1.current; 16031 if (actQueue !== null) { 16032 actQueue.push(callback); 16033 return fakeActCallbackNode; 16034 } else return scheduleCallback(priorityLevel, callback); 16035 } 16036 function cancelCallback$1(callbackNode) { 16037 if (callbackNode === fakeActCallbackNode) return; 16038 return cancelCallback(callbackNode); 16039 } 16040 function shouldForceFlushFallbacksInDEV() { 16041 return ReactCurrentActQueue$1.current !== null; 16042 } 16043 function warnIfUpdatesNotWrappedWithActDEV(fiber) { 16044 if (fiber.mode & ConcurrentMode) { 16045 if (!isConcurrentActEnvironment()) return; 16046 } else { 16047 if (!isLegacyActEnvironment()) return; 16048 if (executionContext !== NoContext) return; 16049 if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) return; 16050 } 16051 if (ReactCurrentActQueue$1.current === null) { 16052 var previousFiber = current; 16053 try { 16054 setCurrentFiber(fiber); 16055 error("An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act", getComponentNameFromFiber(fiber)); 16056 } finally { 16057 if (previousFiber) setCurrentFiber(fiber); 16058 else resetCurrentFiber(); 16059 } 16060 } 16061 } 16062 function warnIfSuspenseResolutionNotWrappedWithActDEV(root) { 16063 if (root.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) error("A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act"); 16064 } 16065 function setIsRunningInsertionEffect(isRunning) { 16066 isRunningInsertionEffect = isRunning; 16067 } 16068 var resolveFamily = null; 16069 var failedBoundaries = null; 16070 var setRefreshHandler = function(handler) { 16071 resolveFamily = handler; 16072 }; 16073 function resolveFunctionForHotReloading(type) { 16074 if (resolveFamily === null) return type; 16075 var family = resolveFamily(type); 16076 if (family === void 0) return type; 16077 return family.current; 16078 } 16079 function resolveClassForHotReloading(type) { 16080 return resolveFunctionForHotReloading(type); 16081 } 16082 function resolveForwardRefForHotReloading(type) { 16083 if (resolveFamily === null) return type; 16084 var family = resolveFamily(type); 16085 if (family === void 0) { 16086 if (type !== null && type !== void 0 && typeof type.render === "function") { 16087 var currentRender = resolveFunctionForHotReloading(type.render); 16088 if (type.render !== currentRender) { 16089 var syntheticType = { 16090 $$typeof: REACT_FORWARD_REF_TYPE, 16091 render: currentRender 16092 }; 16093 if (type.displayName !== void 0) syntheticType.displayName = type.displayName; 16094 return syntheticType; 16095 } 16096 } 16097 return type; 16098 } 16099 return family.current; 16100 } 16101 function isCompatibleFamilyForHotReloading(fiber, element) { 16102 if (resolveFamily === null) return false;
16103 var prevType = fiber.elementType; 16104 var nextType = element.type; 16105 var needsCompareFamilies = false; 16106 var $$typeofNextType = typeof nextType === "object" && nextType !== null ? nextType.$$typeof : null; 16107 switch (fiber.tag) { 16108 case ClassComponent: 16109 if (typeof nextType === "function") needsCompareFamilies = true; 16110 break; 16111 case FunctionComponent: 16112 if (typeof nextType === "function") needsCompareFamilies = true; 16113 else if ($$typeofNextType === REACT_LAZY_TYPE) needsCompareFamilies = true; 16114 break; 16115 case ForwardRef: 16116 if ($$typeofNextType === REACT_FORWARD_REF_TYPE) needsCompareFamilies = true; 16117 else if ($$typeofNextType === REACT_LAZY_TYPE) needsCompareFamilies = true; 16118 break; 16119 case MemoComponent: 16120 case SimpleMemoComponent: 16121 if ($$typeofNextType === REACT_MEMO_TYPE) needsCompareFamilies = true; 16122 else if ($$typeofNextType === REACT_LAZY_TYPE) needsCompareFamilies = true; 16123 break; 16124 default: return false; 16125 } 16126 if (needsCompareFamilies) { 16127 var prevFamily = resolveFamily(prevType); 16128 if (prevFamily !== void 0 && prevFamily === resolveFamily(nextType)) return true; 16129 } 16130 return false; 16131 } 16132 function markFailedErrorBoundaryForHotReloading(fiber) { 16133 if (resolveFamily === null) return; 16134 if (typeof WeakSet !== "function") return; 16135 if (failedBoundaries === null) failedBoundaries = /* @__PURE__ */ new WeakSet(); 16136 failedBoundaries.add(fiber); 16137 } 16138 var scheduleRefresh = function(root, update) { 16139 if (resolveFamily === null) return; 16140 var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies; 16141 flushPassiveEffects(); 16142 flushSync(function() { 16143 scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies); 16144 }); 16145 }; 16146 var scheduleRoot = function(root, element) { 16147 if (root.context !== emptyContextObject) return; 16148 flushPassiveEffects(); 16149 flushSync(function() { 16150 updateContainer(element, root, null, null); 16151 }); 16152 }; 16153 function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) { 16154 var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type; 16155 var candidateType = null; 16156 switch (tag) { 16157 case FunctionComponent: 16158 case SimpleMemoComponent: 16159 case ClassComponent: 16160 candidateType = type; 16161 break; 16162 case ForwardRef: 16163 candidateType = type.render; 16164 break; 16165 } 16166 if (resolveFamily === null) throw new Error("Expected resolveFamily to be set during hot reload."); 16167 var needsRender = false;
16168 var needsRemount = false; 16169 if (candidateType !== null) { 16170 var family = resolveFamily(candidateType); 16171 if (family !== void 0) { 16172 if (staleFamilies.has(family)) needsRemount = true; 16173 else if (updatedFamilies.has(family)) if (tag === ClassComponent) needsRemount = true; 16174 else needsRender = true; 16175 } 16176 } 16177 if (failedBoundaries !== null) { 16178 if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) needsRemount = true; 16179 } 16180 if (needsRemount) fiber._debugNeedsRemount = true; 16181 if (needsRemount || needsRender) { 16182 var _root = enqueueConcurrentRenderForLane(fiber, SyncLane); 16183 if (_root !== null) scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp); 16184 } 16185 if (child !== null && !needsRemount) scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies); 16186 if (sibling !== null) scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies); 16187 } 16188 var findHostInstancesForRefresh = function(root, families) { 16189 var hostInstances = /* @__PURE__ */ new Set(); 16190 var types = new Set(families.map(function(family) { 16191 return family.current; 16192 })); 16193 findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances); 16194 return hostInstances; 16195 }; 16196 function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) { 16197 var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type; 16198 var candidateType = null; 16199 switch (tag) { 16200 case FunctionComponent: 16201 case SimpleMemoComponent: 16202 case ClassComponent: 16203 candidateType = type; 16204 break; 16205 case ForwardRef: 16206 candidateType = type.render; 16207 break; 16208 } 16209 var didMatch = false; 16210 if (candidateType !== null) { 16211 if (types.has(candidateType)) didMatch = true; 16212 } 16213 if (didMatch) findHostInstancesForFiberShallowly(fiber, hostInstances); 16214 else if (child !== null) findHostInstancesForMatchingFibersRecursively(child, types, hostInstances); 16215 if (sibling !== null) findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances); 16216 } 16217 function findHostInstancesForFiberShallowly(fiber, hostInstances) { 16218 if (findChildHostInstancesForFiberShallowly(fiber, hostInstances)) return; 16219 var node = fiber; 16220 while (true) { 16221 switch (node.tag) { 16222 case HostComponent: 16223 hostInstances.add(node.stateNode); 16224 return; 16225 case HostPortal: 16226 hostInstances.add(node.stateNode.containerInfo); 16227 return; 16228 case HostRoot: 16229 hostInstances.add(node.stateNode.containerInfo); 16230 return; 16231 } 16232 if (node.return === null) throw new Error("Expected to reach root first."); 16233 node = node.return; 16234 } 16235 } 16236 function findChildHostInstancesForFiberShallowly(fiber, hostInstances) { 16237 var node = fiber; 16238 var foundHostInstances = false; 16239 while (true) { 16240 if (node.tag === HostComponent) { 16241 foundHostInstances = true; 16242 hostInstances.add(node.stateNode); 16243 } else if (node.child !== null) { 16244 node.child.return = node; 16245 node = node.child; 16246 continue; 16247 } 16248 if (node === fiber) return foundHostInstances; 16249 while (node.sibling === null) { 16250 if (node.return === null || node.return === fiber) return foundHostInstances; 16251 node = node.return; 16252 } 16253 node.sibling.return = node.return; 16254 node = node.sibling; 16255 } 16256 return false; 16257 } 16258 var hasBadMapPolyfill = false; 16259 try { 16260 var nonExtensibleObject = Object.preventExtensions({}); 16261 new Map([[nonExtensibleObject, null]]); 16262 new Set([nonExtensibleObject]); 16263 } catch (e) { 16264 hasBadMapPolyfill = true; 16265 } 16266 function FiberNode(tag, pendingProps, key, mode) { 16267 this.tag = tag; 16268 this.key = key; 16269 this.elementType = null; 16270 this.type = null; 16271 this.stateNode = null; 16272 this.return = null; 16273 this.child = null; 16274 this.sibling = null; 16275 this.index = 0; 16276 this.ref = null; 16277 this.pendingProps = pendingProps; 16278 this.memoizedProps = null; 16279 this.updateQueue = null; 16280 this.memoizedState = null; 16281 this.dependencies = null; 16282 this.mode = mode; 16283 this.flags = NoFlags; 16284 this.subtreeFlags = NoFlags; 16285 this.deletions = null; 16286 this.lanes = NoLanes; 16287 this.childLanes = NoLanes; 16288 this.alternate = null; 16289 this.actualDuration = NaN; 16290 this.actualStartTime = NaN; 16291 this.selfBaseDuration = NaN; 16292 this.treeBaseDuration = NaN; 16293 this.actualDuration = 0; 16294 this.actualStartTime = -1; 16295 this.selfBaseDuration = 0; 16296 this.treeBaseDuration = 0; 16297 this._debugSource = null; 16298 this._debugOwner = null; 16299 this._debugNeedsRemount = false;
16300 this._debugHookTypes = null; 16301 if (!hasBadMapPolyfill && typeof Object.preventExtensions === "function") Object.preventExtensions(this); 16302 } 16303 var createFiber = function(tag, pendingProps, key, mode) { 16304 return new FiberNode(tag, pendingProps, key, mode); 16305 }; 16306 function shouldConstruct$1(Component) { 16307 var prototype = Component.prototype; 16308 return !!(prototype && prototype.isReactComponent); 16309 } 16310 function isSimpleFunctionComponent(type) { 16311 return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0; 16312 } 16313 function resolveLazyComponentTag(Component) { 16314 if (typeof Component === "function") return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent; 16315 else if (Component !== void 0 && Component !== null) { 16316 var $$typeof = Component.$$typeof; 16317 if ($$typeof === REACT_FORWARD_REF_TYPE) return ForwardRef; 16318 if ($$typeof === REACT_MEMO_TYPE) return MemoComponent; 16319 } 16320 return IndeterminateComponent; 16321 } 16322 function createWorkInProgress(current, pendingProps) { 16323 var workInProgress = current.alternate; 16324 if (workInProgress === null) { 16325 workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode); 16326 workInProgress.elementType = current.elementType; 16327 workInProgress.type = current.type; 16328 workInProgress.stateNode = current.stateNode; 16329 workInProgress._debugSource = current._debugSource; 16330 workInProgress._debugOwner = current._debugOwner; 16331 workInProgress._debugHookTypes = current._debugHookTypes; 16332 workInProgress.alternate = current; 16333 current.alternate = workInProgress; 16334 } else { 16335 workInProgress.pendingProps = pendingProps; 16336 workInProgress.type = current.type; 16337 workInProgress.flags = NoFlags; 16338 workInProgress.subtreeFlags = NoFlags; 16339 workInProgress.deletions = null; 16340 workInProgress.actualDuration = 0; 16341 workInProgress.actualStartTime = -1; 16342 } 16343 workInProgress.flags = current.flags & StaticMask; 16344 workInProgress.childLanes = current.childLanes; 16345 workInProgress.lanes = current.lanes; 16346 workInProgress.child = current.child; 16347 workInProgress.memoizedProps = current.memoizedProps; 16348 workInProgress.memoizedState = current.memoizedState; 16349 workInProgress.updateQueue = current.updateQueue; 16350 var currentDependencies = current.dependencies; 16351 workInProgress.dependencies = currentDependencies === null ? null : { 16352 lanes: currentDependencies.lanes, 16353 firstContext: currentDependencies.firstContext 16354 }; 16355 workInProgress.sibling = current.sibling; 16356 workInProgress.index = current.index; 16357 workInProgress.ref = current.ref; 16358 workInProgress.selfBaseDuration = current.selfBaseDuration; 16359 workInProgress.treeBaseDuration = current.treeBaseDuration; 16360 workInProgress._debugNeedsRemount = current._debugNeedsRemount; 16361 switch (workInProgress.tag) { 16362 case IndeterminateComponent: 16363 case FunctionComponent: 16364 case SimpleMemoComponent: 16365 workInProgress.type = resolveFunctionForHotReloading(current.type); 16366 break; 16367 case ClassComponent: 16368 workInProgress.type = resolveClassForHotReloading(current.type); 16369 break; 16370 case ForwardRef: 16371 workInProgress.type = resolveForwardRefForHotReloading(current.type); 16372 break; 16373 } 16374 return workInProgress; 16375 } 16376 function resetWorkInProgress(workInProgress, renderLanes) { 16377 workInProgress.flags &= StaticMask | Placement; 16378 var current = workInProgress.alternate; 16379 if (current === null) { 16380 workInProgress.childLanes = NoLanes; 16381 workInProgress.lanes = renderLanes; 16382 workInProgress.child = null; 16383 workInProgress.subtreeFlags = NoFlags; 16384 workInProgress.memoizedProps = null; 16385 workInProgress.memoizedState = null; 16386 workInProgress.updateQueue = null; 16387 workInProgress.dependencies = null; 16388 workInProgress.stateNode = null; 16389 workInProgress.selfBaseDuration = 0; 16390 workInProgress.treeBaseDuration = 0; 16391 } else { 16392 workInProgress.childLanes = current.childLanes; 16393 workInProgress.lanes = current.lanes; 16394 workInProgress.child = current.child; 16395 workInProgress.subtreeFlags = NoFlags; 16396 workInProgress.deletions = null; 16397 workInProgress.memoizedProps = current.memoizedProps; 16398 workInProgress.memoizedState = current.memoizedState; 16399 workInProgress.updateQueue = current.updateQueue; 16400 workInProgress.type = current.type; 16401 var currentDependencies = current.dependencies; 16402 workInProgress.dependencies = currentDependencies === null ? null : { 16403 lanes: currentDependencies.lanes, 16404 firstContext: currentDependencies.firstContext 16405 }; 16406 workInProgress.selfBaseDuration = current.selfBaseDuration; 16407 workInProgress.treeBaseDuration = current.treeBaseDuration; 16408 } 16409 return workInProgress; 16410 } 16411 function createHostRootFiber(tag, isStrictMode, concurrentUpdatesByDefaultOverride) { 16412 var mode; 16413 if (tag === ConcurrentRoot) { 16414 mode = ConcurrentMode; 16415 if (isStrictMode === true) { 16416 mode |= StrictLegacyMode; 16417 mode |= StrictEffectsMode;
16418 } 16419 } else mode = NoMode; 16420 if (isDevToolsPresent) mode |= ProfileMode; 16421 return createFiber(HostRoot, null, null, mode); 16422 } 16423 function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) { 16424 var fiberTag = IndeterminateComponent; 16425 var resolvedType = type; 16426 if (typeof type === "function") if (shouldConstruct$1(type)) { 16427 fiberTag = ClassComponent; 16428 resolvedType = resolveClassForHotReloading(resolvedType); 16429 } else resolvedType = resolveFunctionForHotReloading(resolvedType); 16430 else if (typeof type === "string") fiberTag = HostComponent; 16431 else getTag: switch (type) { 16432 case REACT_FRAGMENT_TYPE: return createFiberFromFragment(pendingProps.children, mode, lanes, key); 16433 case REACT_STRICT_MODE_TYPE: 16434 fiberTag = Mode; 16435 mode |= StrictLegacyMode; 16436 if ((mode & ConcurrentMode) !== NoMode) mode |= StrictEffectsMode; 16437 break; 16438 case REACT_PROFILER_TYPE: return createFiberFromProfiler(pendingProps, mode, lanes, key); 16439 case REACT_SUSPENSE_TYPE: return createFiberFromSuspense(pendingProps, mode, lanes, key); 16440 case REACT_SUSPENSE_LIST_TYPE: return createFiberFromSuspenseList(pendingProps, mode, lanes, key); 16441 case REACT_OFFSCREEN_TYPE: return createFiberFromOffscreen(pendingProps, mode, lanes, key); 16442 case REACT_LEGACY_HIDDEN_TYPE: 16443 case REACT_SCOPE_TYPE: 16444 case REACT_CACHE_TYPE: 16445 case REACT_TRACING_MARKER_TYPE: 16446 case REACT_DEBUG_TRACING_MODE_TYPE: 16447 default: 16448 if (typeof type === "object" && type !== null) switch (type.$$typeof) { 16449 case REACT_PROVIDER_TYPE: 16450 fiberTag = ContextProvider; 16451 break getTag; 16452 case REACT_CONTEXT_TYPE: 16453 fiberTag = ContextConsumer; 16454 break getTag; 16455 case REACT_FORWARD_REF_TYPE: 16456 fiberTag = ForwardRef; 16457 resolvedType = resolveForwardRefForHotReloading(resolvedType); 16458 break getTag; 16459 case REACT_MEMO_TYPE: 16460 fiberTag = MemoComponent; 16461 break getTag; 16462 case REACT_LAZY_TYPE: 16463 fiberTag = LazyComponent; 16464 resolvedType = null; 16465 break getTag; 16466 } 16467 var info = ""; 16468 if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; 16469 var ownerName = owner ? getComponentNameFromFiber(owner) : null; 16470 if (ownerName) info += "\n\nCheck the render method of `" + ownerName + "`."; 16471 throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) " + ("but got: " + (type == null ? type : typeof type) + "." + info)); 16472 } 16473 var fiber = createFiber(fiberTag, pendingProps, key, mode); 16474 fiber.elementType = type; 16475 fiber.type = resolvedType; 16476 fiber.lanes = lanes; 16477 fiber._debugOwner = owner; 16478 return fiber; 16479 } 16480 function createFiberFromElement(element, mode, lanes) { 16481 var owner = null; 16482 owner = element._owner; 16483 var type = element.type; 16484 var key = element.key; 16485 var pendingProps = element.props; 16486 var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes); 16487 fiber._debugSource = element._source; 16488 fiber._debugOwner = element._owner; 16489 return fiber; 16490 } 16491 function createFiberFromFragment(elements, mode, lanes, key) { 16492 var fiber = createFiber(Fragment, elements, key, mode); 16493 fiber.lanes = lanes; 16494 return fiber; 16495 } 16496 function createFiberFromProfiler(pendingProps, mode, lanes, key) { 16497 if (typeof pendingProps.id !== "string") error("Profiler must specify an \"id\" of type `string` as a prop. Received the type `%s` instead.", typeof pendingProps.id); 16498 var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); 16499 fiber.elementType = REACT_PROFILER_TYPE; 16500 fiber.lanes = lanes; 16501 fiber.stateNode = { 16502 effectDuration: 0, 16503 passiveEffectDuration: 0 16504 }; 16505 return fiber; 16506 } 16507 function createFiberFromSuspense(pendingProps, mode, lanes, key) { 16508 var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); 16509 fiber.elementType = REACT_SUSPENSE_TYPE; 16510 fiber.lanes = lanes; 16511 return fiber; 16512 } 16513 function createFiberFromSuspenseList(pendingProps, mode, lanes, key) { 16514 var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode); 16515 fiber.elementType = REACT_SUSPENSE_LIST_TYPE; 16516 fiber.lanes = lanes; 16517 return fiber; 16518 } 16519 function createFiberFromOffscreen(pendingProps, mode, lanes, key) { 16520 var fiber = createFiber(OffscreenComponent, pendingProps, key, mode); 16521 fiber.elementType = REACT_OFFSCREEN_TYPE; 16522 fiber.lanes = lanes; 16523 fiber.stateNode = { isHidden: false }; 16524 return fiber; 16525 } 16526 function createFiberFromText(content, mode, lanes) { 16527 var fiber = createFiber(HostText, content, null, mode); 16528 fiber.lanes = lanes; 16529 return fiber; 16530 } 16531 function createFiberFromHostInstanceForDeletion() { 16532 var fiber = createFiber(HostComponent, null, null, NoMode); 16533 fiber.elementType = "DELETED"; 16534 return fiber; 16535 } 16536 function createFiberFromDehydratedFragment(dehydratedNode) { 16537 var fiber = createFiber(DehydratedFragment, null, null, NoMode); 16538 fiber.stateNode = dehydratedNode; 16539 return fiber; 16540 } 16541 function createFiberFromPortal(portal, mode, lanes) { 16542 var fiber = createFiber(HostPortal, portal.children !== null ? portal.children : [], portal.key, mode); 16543 fiber.lanes = lanes; 16544 fiber.stateNode = { 16545 containerInfo: portal.containerInfo, 16546 pendingChildren: null, 16547 implementation: portal.implementation 16548 }; 16549 return fiber; 16550 } 16551 function assignFiberPropertiesInDEV(target, source) { 16552 if (target === null) target = createFiber(IndeterminateComponent, null, null, NoMode); 16553 target.tag = source.tag; 16554 target.key = source.key; 16555 target.elementType = source.elementType; 16556 target.type = source.type; 16557 target.stateNode = source.stateNode; 16558 target.return = source.return; 16559 target.child = source.child; 16560 target.sibling = source.sibling; 16561 target.index = source.index; 16562 target.ref = source.ref; 16563 target.pendingProps = source.pendingProps; 16564 target.memoizedProps = source.memoizedProps; 16565 target.updateQueue = source.updateQueue; 16566 target.memoizedState = source.memoizedState;
16567 target.dependencies = source.dependencies; 16568 target.mode = source.mode; 16569 target.flags = source.flags; 16570 target.subtreeFlags = source.subtreeFlags; 16571 target.deletions = source.deletions; 16572 target.lanes = source.lanes; 16573 target.childLanes = source.childLanes; 16574 target.alternate = source.alternate; 16575 target.actualDuration = source.actualDuration; 16576 target.actualStartTime = source.actualStartTime; 16577 target.selfBaseDuration = source.selfBaseDuration; 16578 target.treeBaseDuration = source.treeBaseDuration; 16579 target._debugSource = source._debugSource; 16580 target._debugOwner = source._debugOwner; 16581 target._debugNeedsRemount = source._debugNeedsRemount; 16582 target._debugHookTypes = source._debugHookTypes; 16583 return target; 16584 } 16585 function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError) { 16586 this.tag = tag; 16587 this.containerInfo = containerInfo; 16588 this.pendingChildren = null; 16589 this.current = null; 16590 this.pingCache = null; 16591 this.finishedWork = null; 16592 this.timeoutHandle = noTimeout; 16593 this.context = null; 16594 this.pendingContext = null; 16595 this.callbackNode = null; 16596 this.callbackPriority = NoLane; 16597 this.eventTimes = createLaneMap(NoLanes); 16598 this.expirationTimes = createLaneMap(NoTimestamp); 16599 this.pendingLanes = NoLanes; 16600 this.suspendedLanes = NoLanes; 16601 this.pingedLanes = NoLanes; 16602 this.expiredLanes = NoLanes; 16603 this.mutableReadLanes = NoLanes; 16604 this.finishedLanes = NoLanes; 16605 this.entangledLanes = NoLanes; 16606 this.entanglements = createLaneMap(NoLanes); 16607 this.identifierPrefix = identifierPrefix; 16608 this.onRecoverableError = onRecoverableError; 16609 this.mutableSourceEagerHydrationData = null; 16610 this.effectDuration = 0; 16611 this.passiveEffectDuration = 0; 16612 this.memoizedUpdaters = /* @__PURE__ */ new Set(); 16613 var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = []; 16614 for (var _i = 0; _i < TotalLanes; _i++) pendingUpdatersLaneMap.push(/* @__PURE__ */ new Set()); 16615 switch (tag) { 16616 case ConcurrentRoot: 16617 this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; 16618 break; 16619 case LegacyRoot: 16620 this._debugRootType = hydrate ? "hydrate()" : "render()"; 16621 break; 16622 } 16623 } 16624 function createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) { 16625 var root = new FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError); 16626 var uninitializedFiber = createHostRootFiber(tag, isStrictMode); 16627 root.current = uninitializedFiber; 16628 uninitializedFiber.stateNode = root; 16629 uninitializedFiber.memoizedState = { 16630 element: initialChildren, 16631 isDehydrated: hydrate, 16632 cache: null, 16633 transitions: null, 16634 pendingSuspenseBoundaries: null 16635 }; 16636 initializeUpdateQueue(uninitializedFiber); 16637 return root; 16638 } 16639 var ReactVersion = "18.3.1"; 16640 function createPortal(children, containerInfo, implementation) { 16641 var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; 16642 checkKeyStringCoercion(key); 16643 return { 16644 $$typeof: REACT_PORTAL_TYPE, 16645 key: key == null ? null : "" + key, 16646 children, 16647 containerInfo, 16648 implementation 16649 }; 16650 } 16651 var didWarnAboutNestedUpdates; 16652 var didWarnAboutFindNodeInStrictMode; 16653 didWarnAboutNestedUpdates = false; 16654 didWarnAboutFindNodeInStrictMode = {}; 16655 function getContextForSubtree(parentComponent) { 16656 if (!parentComponent) return emptyContextObject; 16657 var fiber = get(parentComponent); 16658 var parentContext = findCurrentUnmaskedContext(fiber); 16659 if (fiber.tag === ClassComponent) { 16660 var Component = fiber.type; 16661 if (isContextProvider(Component)) return processChildContext(fiber, Component, parentContext); 16662 } 16663 return parentContext; 16664 } 16665 function findHostInstanceWithWarning(component, methodName) { 16666 var fiber = get(component); 16667 if (fiber === void 0) if (typeof component.render === "function") throw new Error("Unable to find node on an unmounted component."); 16668 else { 16669 var keys = Object.keys(component).join(","); 16670 throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys); 16671 } 16672 var hostFiber = findCurrentHostFiber(fiber); 16673 if (hostFiber === null) return null; 16674 if (hostFiber.mode & StrictLegacyMode) { 16675 var componentName = getComponentNameFromFiber(fiber) || "Component"; 16676 if (!didWarnAboutFindNodeInStrictMode[componentName]) { 16677 didWarnAboutFindNodeInStrictMode[componentName] = true; 16678 var previousFiber = current; 16679 try { 16680 setCurrentFiber(hostFiber); 16681 if (fiber.mode & StrictLegacyMode) error("%s is deprecated
16681in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName); 16682 else error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName); 16683 } finally { 16684 if (previousFiber) setCurrentFiber(previousFiber); 16685 else resetCurrentFiber(); 16686 } 16687 } 16688 } 16689 return hostFiber.stateNode; 16690 } 16691 function createContainer(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) { 16692 return createFiberRoot(containerInfo, tag, false, null, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); 16693 } 16694 function createHydrationContainer(initialChildren, callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) { 16695 var root = createFiberRoot(containerInfo, tag, true, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); 16696 root.context = getContextForSubtree(null); 16697 var current = root.current; 16698 var eventTime = requestEventTime(); 16699 var lane = requestUpdateLane(current); 16700 var update = createUpdate(eventTime, lane); 16701 update.callback = callback !== void 0 && callback !== null ? callback : null; 16702 enqueueUpdate(current, update, lane); 16703 scheduleInitialHydrationOnRoot(root, lane, eventTime); 16704 return root; 16705 } 16706 function updateContainer(element, container, parentComponent, callback) { 16707 onScheduleRoot(container, element); 16708 var current$1 = container.current; 16709 var eventTime = requestEventTime(); 16710 var lane = requestUpdateLane(current$1); 16711 markRenderScheduled(lane); 16712 var context = getContextForSubtree(parentComponent); 16713 if (container.context === null) container.context = context; 16714 else container.pendingContext = context; 16715 if (isRendering && current !== null && !didWarnAboutNestedUpdates) { 16716 didWarnAboutNestedUpdates = true; 16717 error("Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentNameFromFiber(current) || "Unknown"); 16718 } 16719 var update = createUpdate(eventTime, lane); 16720 update.payload = { element }; 16721 callback = callback === void 0 ? null : callback; 16722 if (callback !== null) { 16723 if (typeof callback !== "function") error("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callback); 16724 update.callback = callback; 16725 } 16726 var root = enqueueUpdate(current$1, update, lane); 16727 if (root !== null) { 16728 scheduleUpdateOnFiber(root, current$1, lane, eventTime); 16729 entangleTransitions(root, current$1, lane); 16730 } 16731 return lane; 16732 } 16733 function getPublicRootInstance(container) { 16734 var containerFiber = container.current; 16735 if (!containerFiber.child) return null; 16736 switch (containerFiber.child.tag) { 16737 case HostComponent: return getPublicInstance(containerFiber.child.stateNode); 16738 default: return containerFiber.child.stateNode; 16739 } 16740 } 16741 function attemptSynchronousHydration$1(fiber) { 16742 switch (fiber.tag) { 16743 case HostRoot: 16744 var root = fiber.stateNode; 16745 if (isRootDehydrated(root)) flushRoot(root, getHighestPriorityPendingLanes(root)); 16746 break; 16747 case SuspenseComponent: 16748 flushSync(function() { 16749 var root = enqueueConcurrentRenderForLane(fiber, SyncLane); 16750 if (root !== null) scheduleUpdateOnFiber(root, fiber, SyncLane, requestEventTime()); 16751 }); 16752 markRetryLaneIfNotHydrated(fiber, SyncLane); 16753 break; 16754 } 16755 } 16756 function markRetryLaneImpl(fiber, retryLane) { 16757 var suspenseState = fiber.memoizedState; 16758 if (suspenseState !== null && suspenseState.dehydrated !== null) suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane); 16759 } 16760 function markRetryLaneIfNotHydrated(fiber, retryLane) { 16761 markRetryLaneImpl(fiber, retryLane); 16762 var alternate = fiber.alternate; 16763 if (alternate) markRetryLaneImpl(alternate, retryLane); 16764 } 16765 function attemptContinuousHydration$1(fiber) { 16766 if (fiber.tag !== SuspenseComponent) return; 16767 var lane = SelectiveHydrationLane; 16768 var root = enqueueConcurrentRenderForLane(fiber, lane); 16769 if (root !== null) scheduleUpdateOnFiber(root, fiber, lane, requestEventTime()); 16770 markRetryLaneIfNotHydrated(fiber, lane); 16771 } 16772 function attemptHydrationAtCurrentPriority$1(fiber) { 16773 if (fiber.tag !== SuspenseComponent) return; 16774 var lane = requestUpdateLane(fiber); 16775 var root = enqueueConcurrentRenderForLane(fiber, lane); 16776 if (root !== null) scheduleUpdateOnFiber(root, fiber, lane, requestEventTime()); 16777 markRetryLaneIfNotHydrated(fiber, lane); 16778 } 16779 function findHostInstanceWithNoPortals(fiber) { 16780 var hostFiber = findCurrentHostFiberWithNoPortals(fiber); 16781 if (hostFiber === null) return null; 16782 return hostFiber.stateNode; 16783 } 16784 var shouldErrorImpl = function(fiber) { 16785 return null; 16786 }; 16787 function shouldError(fiber) { 16788 return shouldErrorImpl(fiber); 16789 } 16790 var shouldSuspendImpl = function(fiber) { 16791 return false;
16792 }; 16793 function shouldSuspend(fiber) { 16794 return shouldSuspendImpl(fiber); 16795 } 16796 var overrideHookState = null; 16797 var overrideHookStateDeletePath = null; 16798 var overrideHookStateRenamePath = null; 16799 var overrideProps = null; 16800 var overridePropsDeletePath = null; 16801 var overridePropsRenamePath = null; 16802 var scheduleUpdate = null; 16803 var setErrorHandler = null; 16804 var setSuspenseHandler = null; 16805 var copyWithDeleteImpl = function(obj, path, index) { 16806 var key = path[index]; 16807 var updated = isArray(obj) ? obj.slice() : assign({}, obj); 16808 if (index + 1 === path.length) { 16809 if (isArray(updated)) updated.splice(key, 1); 16810 else delete updated[key]; 16811 return updated; 16812 } 16813 updated[key] = copyWithDeleteImpl(obj[key], path, index + 1); 16814 return updated; 16815 }; 16816 var copyWithDelete = function(obj, path) { 16817 return copyWithDeleteImpl(obj, path, 0); 16818 }; 16819 var copyWithRenameImpl = function(obj, oldPath, newPath, index) { 16820 var oldKey = oldPath[index]; 16821 var updated = isArray(obj) ? obj.slice() : assign({}, obj); 16822 if (index + 1 === oldPath.length) { 16823 var newKey = newPath[index]; 16824 updated[newKey] = updated[oldKey]; 16825 if (isArray(updated)) updated.splice(oldKey, 1); 16826 else delete updated[oldKey]; 16827 } else updated[oldKey] = copyWithRenameImpl(obj[oldKey], oldPath, newPath, index + 1); 16828 return updated; 16829 }; 16830 var copyWithRename = function(obj, oldPath, newPath) { 16831 if (oldPath.length !== newPath.length) { 16832 warn("copyWithRename() expects paths of the same length"); 16833 return; 16834 } else for (var i = 0; i < newPath.length - 1; i++) if (oldPath[i] !== newPath[i]) { 16835 warn("copyWithRename() expects paths to be the same except for the deepest key"); 16836 return; 16837 } 16838 return copyWithRenameImpl(obj, oldPath, newPath, 0); 16839 }; 16840 var copyWithSetImpl = function(obj, path, index, value) { 16841 if (index >= path.length) return value; 16842 var key = path[index]; 16843 var updated = isArray(obj) ? obj.slice() : assign({}, obj); 16844 updated[key] = copyWithSetImpl(obj[key], path, index + 1, value); 16845 return updated; 16846 }; 16847 var copyWithSet = function(obj, path, value) { 16848 return copyWithSetImpl(obj, path, 0, value); 16849 }; 16850 var findHook = function(fiber, id) { 16851 var currentHook = fiber.memoizedState; 16852 while (currentHook !== null && id > 0) { 16853 currentHook = currentHook.next; 16854 id--; 16855 } 16856 return currentHook; 16857 }; 16858 overrideHookState = function(fiber, id, path, value) { 16859 var hook = findHook(fiber, id); 16860 if (hook !== null) { 16861 var newState = copyWithSet(hook.memoizedState, path, value); 16862 hook.memoizedState = newState; 16863 hook.baseState = newState; 16864 fiber.memoizedProps = assign({}, fiber.memoizedProps); 16865 var root = enqueueConcurrentRenderForLane(fiber, SyncLane); 16866 if (root !== null) scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); 16867 } 16868 }; 16869 overrideHookStateDeletePath = function(fiber, id, path) { 16870 var hook = findHook(fiber, id); 16871 if (hook !== null) { 16872 var newState = copyWithDelete(hook.memoizedState, path); 16873 hook.memoizedState = newState; 16874 hook.baseState = newState; 16875 fiber.memoizedProps = assign({}, fiber.memoizedProps); 16876 var root = enqueueConcurrentRenderForLane(fiber, SyncLane); 16877 if (root !== null) scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); 16878 } 16879 }; 16880 overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) { 16881 var hook = findHook(fiber, id); 16882 if (hook !== null) { 16883 var newState = copyWithRename(hook.memoizedState, oldPath, newPath); 16884 hook.memoizedState = newState; 16885 hook.baseState = newState; 16886 fiber.memoizedProps = assign({}, fiber.memoizedProps); 16887 var root = enqueueConcurrentRenderForLane(fiber, SyncLane); 16888 if (root !== null) scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); 16889 } 16890 }; 16891 overrideProps = function(fiber, path, value) { 16892 fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value); 16893 if (fiber.alternate) fiber.alternate.pendingProps = fiber.pendingProps; 16894 var root = enqueueConcurrentRenderForLane(fiber, SyncLane); 16895 if (root !== null) scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); 16896 }; 16897 overridePropsDeletePath = function(fiber, path) { 16898 fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path); 16899 if (fiber.alternate) fiber.alternate.pendingProps = fiber.pendingProps; 16900 var root = enqueueConcurrentRenderForLane(fiber, SyncLane); 16901 if (root !== null) scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); 16902 }; 16903 overridePropsRenamePath = function(fiber, oldPath, newPath) { 16904 fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath); 16905 if (fiber.alternate) fiber.alternate.pendingProps = fiber.pendingProps; 16906 var root = enqueueConcurrentRenderForLane(fiber, SyncLane); 16907 if (root !== null) scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); 16908 }; 16909 scheduleUpdate = function(fiber) { 16910 var root = enqueueConcurrentRenderForLane(fiber, SyncLane); 16911 if (root !== null) scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); 16912 }; 16913 setErrorHandler = function(newShouldErrorImpl) { 16914 shouldErrorImpl = newShouldErrorImpl; 16915 }; 16916 setSuspenseHandler = function(newShouldSuspendImpl) { 16917 shouldSuspendImpl = newShouldSuspendImpl; 16918 }; 16919 function findHostInstanceByFiber(fiber) { 16920 var hostFiber = findCurrentHostFiber(fiber); 16921 if (hostFiber === null) return null; 16922 return hostFiber.stateNode; 16923 } 16924 function emptyFindFiberByHostInstance(instance) { 16925 return null; 16926 } 16927 function getCurrentFiberForDevTools() { 16928 return current; 16929 } 16930 function injectIntoDevTools(devToolsConfig) { 16931 var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance; 16932 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; 16933 return injectInternals({ 16934 bundleType: devToolsConfig.bundleType, 16935 version: devToolsConfig.version, 16936 rendererPackageName: devToolsConfig.rendererPackageName, 16937 rendererConfig: devToolsConfig.rendererConfig, 16938 overrideHookState, 16939 overrideHookStateDeletePath, 16940 overrideHookStateRenamePath, 16941 overrideProps, 16942 overridePropsDeletePath, 16943 overridePropsRenamePath, 16944 setErrorHandler, 16945 setSuspenseHandler, 16946 scheduleUpdate, 16947 currentDispatcherRef: ReactCurrentDispatcher, 16948 findHostInstanceByFiber, 16949 findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance, 16950 findHostInstancesForRefresh, 16951 scheduleRefresh, 16952 scheduleRoot, 16953 setRefreshHandler, 16954 getCurrentFiber: getCurrentFiberForDevTools, 16955 reconcilerVersion: ReactVersion 16956 }); 16957 } 16958 var defaultOnRecoverableError = typeof reportError === "function" ? reportError : function(error) { 16959 console["error"](error); 16960 }; 16961 function ReactDOMRoot(internalRoot) { 16962 this._internalRoot = internalRoot; 16963 } 16964 ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children) { 16965 var root = this._internalRoot; 16966 if (root === null) throw new Error("Cannot update an unmounted root."); 16967 if (typeof arguments[1] === "function") error("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."); 16968 else if (isValidContainer(arguments[1])) error("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."); 16969 else if (typeof arguments[1] !== "undefined") error("You passed a second argument to root.render(...) but it only accepts one argument."); 16970 var container = root.containerInfo; 16971 if (container.nodeType !== COMMENT_NODE) {
16972 var hostInstance = findHostInstanceWithNoPortals(root.current); 16973 if (hostInstance) { 16974 if (hostInstance.parentNode !== container) error("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container."); 16975 } 16976 } 16977 updateContainer(children, root, null, null); 16978 }; 16979 ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function() { 16980 if (typeof arguments[0] === "function") error("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."); 16981 var root = this._internalRoot; 16982 if (root !== null) { 16983 this._internalRoot = null; 16984 var container = root.containerInfo; 16985 if (isAlreadyRendering()) error("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."); 16986 flushSync(function() { 16987 updateContainer(null, root, null, null); 16988 }); 16989 unmarkContainerAsRoot(container); 16990 } 16991 }; 16992 function createRoot(container, options) { 16993 if (!isValidContainer(container)) throw new Error("createRoot(...): Target container is not a DOM element."); 16994 warnIfReactDOMContainerInDEV(container); 16995 var isStrictMode = false; 16996 var concurrentUpdatesByDefaultOverride = false; 16997 var identifierPrefix = ""; 16998 var onRecoverableError = defaultOnRecoverableError; 16999 if (options !== null && options !== void 0) { 17000 if (options.hydrate) warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."); 17001 else if (typeof options === "object" && options !== null && options.$$typeof === REACT_ELEMENT_TYPE) error("You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:\n\n let root = createRoot(domContainer);\n root.render(<App />);"); 17002 if (options.unstable_strictMode === true) isStrictMode = true; 17003 if (options.identifierPrefix !== void 0) identifierPrefix = options.identifierPrefix; 17004 if (options.onRecoverableError !== void 0) onRecoverableError = options.onRecoverableError; 17005 if (options.transitionCallbacks !== void 0) options.transitionCallbacks; 17006 } 17007 var root = createContainer(container, ConcurrentRoot, null, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); 17008 markContainerAsRoot(root.current, container); 17009 listenToAllSupportedEvents(container.nodeType === COMMENT_NODE ? container.parentNode : container); 17010 return new ReactDOMRoot(root); 17011 } 17012 function ReactDOMHydrationRoot(internalRoot) { 17013 this._internalRoot = internalRoot; 17014 } 17015 function scheduleHydration(target) { 17016 if (target) queueExplicitHydrationTarget(target); 17017 } 17018 ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = scheduleHydration; 17019 function hydrateRoot(container, initialChildren, options) { 17020 if (!isValidContainer(container)) throw new Error("hydrateRoot(...): Target container is not a DOM element."); 17021 warnIfReactDOMContainerInDEV(container); 17022 if (initialChildren === void 0) error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)"); 17023 var hydrationCallbacks = options != null ? options : null; 17024 var mutableSources = options != null && options.hydratedSources || null; 17025 var isStrictMode = false; 17026 var concurrentUpdatesByDefaultOverride = false; 17027 var identifierPrefix = ""; 17028 var onRecoverableError = defaultOnRecoverableError; 17029 if (options !== null && options !== void 0) { 17030 if (options.unstable_strictMode === true) isStrictMode = true; 17031 if (options.identifierPrefix !== void 0) identifierPrefix = options.identifierPrefix; 17032 if (options.onRecoverableError !== void 0) onRecoverableError = options.onRecoverableError; 17033 } 17034 var root = createHydrationContainer(initialChildren, null, container, ConcurrentRoot, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); 17035 markContainerAsRoot(root.current, container); 17036 listenToAllSupportedEvents(container); 17037 if (mutableSources) for (var i = 0; i < mutableSources.length; i++) { 17038 var mutableSource = mutableSources[i]; 17039 registerMutableSourceForHydration(root, mutableSource); 17040 } 17041 return new ReactDOMHydrationRoot(root); 17042 } 17043 function isValidContainer(node) { 17044 return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || !disableCommentsAsDOMContainers
17044)); 17045 } 17046 function isValidContainerLegacy(node) { 17047 return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === " react-mount-point-unstable ")); 17048 } 17049 function warnIfReactDOMContainerInDEV(container) { 17050 if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") error("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app."); 17051 if (isContainerMarkedAsRoot(container)) if (container._reactRootContainer) error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."); 17052 else error("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."); 17053 } 17054 var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner; 17055 var topLevelUpdateWarnings = function(container) { 17056 if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) { 17057 var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer.current); 17058 if (hostInstance) { 17059 if (hostInstance.parentNode !== container) error("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container."); 17060 } 17061 }
17062 var isRootRenderedBySomeReact = !!container._reactRootContainer; 17063 var rootEl = getReactRootElementInContainer(container); 17064 if (!!(rootEl && getInstanceFromNode(rootEl)) && !isRootRenderedBySomeReact) error("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."); 17065 if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") error("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app."); 17066 }; 17067 function getReactRootElementInContainer(container) { 17068 if (!container) return null; 17069 if (container.nodeType === DOCUMENT_NODE) return container.documentElement; 17070 else return container.firstChild; 17071 } 17072 function noopOnRecoverableError() {} 17073 function legacyCreateRootFromDOMContainer(container, initialChildren, parentComponent, callback, isHydrationContainer) { 17074 if (isHydrationContainer) { 17075 if (typeof callback === "function") { 17076 var originalCallback = callback; 17077 callback = function() { 17078 var instance = getPublicRootInstance(root); 17079 originalCallback.call(instance); 17080 }; 17081 } 17082 var root = createHydrationContainer(initialChildren, callback, container, LegacyRoot, null, false, false, "", noopOnRecoverableError); 17083 container._reactRootContainer = root; 17084 markContainerAsRoot(root.current, container); 17085 listenToAllSupportedEvents(container.nodeType === COMMENT_NODE ? container.parentNode : container); 17086 flushSync(); 17087 return root; 17088 } else { 17089 var rootSibling; 17090 while (rootSibling = container.lastChild) container.removeChild(rootSibling); 17091 if (typeof callback === "function") { 17092 var _originalCallback = callback; 17093 callback = function() { 17094 var instance = getPublicRootInstance(_root); 17095 _originalCallback.call(instance); 17096 }; 17097 } 17098 var _root = createContainer(container, LegacyRoot, null, false, false, "", noopOnRecoverableError); 17099 container._reactRootContainer = _root; 17100 markContainerAsRoot(_root.current, container); 17101 listenToAllSupportedEvents(container.nodeType === COMMENT_NODE ? container.parentNode : container); 17102 flushSync(function() { 17103 updateContainer(initialChildren, _root, parentComponent, callback); 17104 }); 17105 return _root; 17106 } 17107 }
17108 function warnOnInvalidCallback$1(callback, callerName) { 17109 if (callback !== null && typeof callback !== "function") error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback); 17110 } 17111 function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) { 17112 topLevelUpdateWarnings(container); 17113 warnOnInvalidCallback$1(callback === void 0 ? null : callback, "render"); 17114 var maybeRoot = container._reactRootContainer; 17115 var root; 17116 if (!maybeRoot) root = legacyCreateRootFromDOMContainer(container, children, parentComponent, callback, forceHydrate); 17117 else { 17118 root = maybeRoot; 17119 if (typeof callback === "function") { 17120 var originalCallback = callback; 17121 callback = function() { 17122 var instance = getPublicRootInstance(root); 17123 originalCallback.call(instance); 17124 }; 17125 } 17126 updateContainer(children, root, parentComponent, callback); 17127 } 17128 return getPublicRootInstance(root); 17129 } 17130 var didWarnAboutFindDOMNode = false; 17131 function findDOMNode(componentOrElement) { 17132 if (!didWarnAboutFindDOMNode) { 17133 didWarnAboutFindDOMNode = true; 17134 error("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node"); 17135 } 17136 var owner = ReactCurrentOwner$3.current; 17137 if (owner !== null && owner.stateNode !== null) { 17138 if (!owner.stateNode._warnedAboutRefsInRender) error("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", getComponentNameFromType(owner.type) || "A component"); 17139 owner.stateNode._warnedAboutRefsInRender = true; 17140 } 17141 if (componentOrElement == null) return null; 17142 if (componentOrElement.nodeType === ELEMENT_NODE) return componentOrElement; 17143 return findHostInstanceWithWarning(componentOrElement, "findDOMNode"); 17144 } 17145 function hydrate(element, container, callback) { 17146 error("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"); 17147 if (!isValidContainerLegacy(container)) throw new Error("Target container is not a DOM element."); 17148 if (isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0) error("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?"); 17149 return legacyRenderSubtreeIntoContainer(null, element, container, true, callback); 17150 } 17151 function render(element, container, callback) { 17152 error("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"); 17153 if (!isValidContainerLegacy(container)) throw new Error("Target container is not a DOM element."); 17154 if (isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0) error("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?"); 17155 return legacyRenderSubtreeIntoContainer(null, element, container, false, callback); 17156 } 17157 function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) { 17158 error("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"); 17159 if (!isValidContainerLegacy(containerNode)) throw new Error("Target container is not a DOM element."); 17160 if (parentComponent == null || !has(parentComponent)) throw new Error("parentComponent must be a valid React Component"); 17161 return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback); 17162 } 17163 var didWarnAboutUnmountComponentAtNode = false;
17164 function unmountComponentAtNode(container) { 17165 if (!didWarnAboutUnmountComponentAtNode) { 17166 didWarnAboutUnmountComponentAtNode = true; 17167 error("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot"); 17168 } 17169 if (!isValidContainerLegacy(container)) throw new Error("unmountComponentAtNode(...): Target container is not a DOM element."); 17170 if (isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0) error("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?"); 17171 if (container._reactRootContainer) { 17172 var rootEl = getReactRootElementInContainer(container); 17173 if (rootEl && !getInstanceFromNode(rootEl)) error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React."); 17174 flushSync(function() { 17175 legacyRenderSubtreeIntoContainer(null, null, container, false, function() { 17176 container._reactRootContainer = null; 17177 unmarkContainerAsRoot(container); 17178 }); 17179 }); 17180 return true; 17181 } else { 17182 var _rootEl = getReactRootElementInContainer(container); 17183 var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl)); 17184 var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainerLegacy(container.parentNode) && !!container.parentNode._reactRootContainer; 17185 if (hasNonRootReactChild) error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", isContainerReactRoot ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component."); 17186 return false; 17187 } 17188 } 17189 setAttemptSynchronousHydration(attemptSynchronousHydration$1); 17190 setAttemptContinuousHydration(attemptContinuousHydration$1); 17191 setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1); 17192 setGetCurrentUpdatePriority(getCurrentUpdatePriority); 17193 setAttemptHydrationAtPriority(runWithPriority); 17194 if (typeof Map !== "function" || Map.prototype == null || typeof Map.prototype.forEach !== "function" || typeof Set !== "function" || Set.prototype == null || typeof Set.prototype.clear !== "function" || typeof Set.prototype.forEach !== "function") error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"); 17195 setRestoreImplementation(restoreControlledState$3); 17196 setBatchingImplementation(batchedUpdates$1, discreteUpdates, flushSync); 17197 function createPortal$1(children, container) { 17198 var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; 17199 if (!isValidContainer(container)) throw new Error("Target container is not a DOM element."); 17200 return createPortal(children, container, null, key); 17201 }
17202 function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) { 17203 return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback); 17204 } 17205 var Internals = { 17206 usingClientEntryPoint: false, 17207 Events: [ 17208 getInstanceFromNode, 17209 getNodeFromInstance, 17210 getFiberCurrentPropsFromNode, 17211 enqueueStateRestore, 17212 restoreStateIfNeeded, 17213 batchedUpdates$1 17214 ] 17215 }; 17216 function createRoot$1(container, options) { 17217 if (!Internals.usingClientEntryPoint && true) error("You are importing createRoot from \"react-dom\" which is not supported. You should instead import it from \"react-dom/client\"."); 17218 return createRoot(container, options); 17219 } 17220 function hydrateRoot$1(container, initialChildren, options) { 17221 if (!Internals.usingClientEntryPoint && true) error("You are importing hydrateRoot from \"react-dom\" which is not supported. You should instead import it from \"react-dom/client\"."); 17222 return hydrateRoot(container, initialChildren, options); 17223 } 17224 function flushSync$1(fn) { 17225 if (isAlreadyRendering()) error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."); 17226 return flushSync(fn); 17227 } 17228 if (!injectIntoDevTools({ 17229 findFiberByHostInstance: getClosestInstanceFromNode, 17230 bundleType: 1, 17231 version: ReactVersion, 17232 rendererPackageName: "react-dom" 17233 }) && canUseDOM && window.top === window.self) { 17234 if (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1) { 17235 var protocol = window.location.protocol; 17236 if (/^(https?|file):$/.test(protocol)) console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (protocol === "file:" ? "\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq" : ""), "font-weight:bold"); 17237 } 17238 } 17239 exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; 17240 exports.createPortal = createPortal$1; 17241 exports.createRoot = createRoot$1; 17242 exports.findDOMNode = findDOMNode; 17243 exports.flushSync = flushSync$1; 17244 exports.hydrate = hydrate; 17245 exports.hydrateRoot = hydrateRoot$1; 17246 exports.render = render; 17247 exports.unmountComponentAtNode = unmountComponentAtNode; 17248 exports.unstable_batchedUpdates = batchedUpdates$1; 17249 exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer; 17250 exports.version = ReactVersion; 17251 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(/* @__PURE__ */ new Error()); 17252 })(); 17253})); 17254//#endregion 17255//#region node_modules/react-dom/index.js 17256var require_react_dom = /* @__PURE__ */ __commonJSMin(((exports, module) => { 17257 module.exports = require_react_dom_development(); 17258})); 17259//#endregion 17260export { require_react_dom as t }; 17261 17262//# sourceMappingURL=react-dom-DXEfW_lE.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.