@rectify-dev/core 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -190,6 +190,48 @@ var listenToNativeEvent = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((domEventName
190
190
  // ../rectify-dom-binding/src/clients/RectifyDomProperties.ts
191
191
  var isEvent = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((k) => k.startsWith("on"), "isEvent");
192
192
  var isProperty = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((k) => k !== "children" && k !== "ref" && !isEvent(k), "isProperty");
193
+ var SVG_NS = "http://www.w3.org/2000/svg";
194
+ var SVG_CAMEL_ATTRS = /* @__PURE__ */ new Set([
195
+ "viewBox",
196
+ "preserveAspectRatio",
197
+ "gradientTransform",
198
+ "gradientUnits",
199
+ "patternTransform",
200
+ "patternUnits",
201
+ "patternContentUnits",
202
+ "clipPathUnits",
203
+ "markerUnits",
204
+ "markerWidth",
205
+ "markerHeight",
206
+ "refX",
207
+ "refY",
208
+ "textLength",
209
+ "startOffset",
210
+ "baseFrequency",
211
+ "numOctaves",
212
+ "stdDeviation",
213
+ "filterUnits",
214
+ "primitiveUnits",
215
+ "tableValues",
216
+ "kernelMatrix",
217
+ "kernelUnitLength",
218
+ "targetX",
219
+ "targetY",
220
+ "xChannelSelector",
221
+ "yChannelSelector",
222
+ "diffuseConstant",
223
+ "surfaceScale",
224
+ "specularConstant",
225
+ "specularExponent",
226
+ "limitingConeAngle",
227
+ "pointsAtX",
228
+ "pointsAtY",
229
+ "pointsAtZ",
230
+ "repeatX",
231
+ "repeatY"
232
+ ]);
233
+ var camelToKebab = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((s) => s.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase()), "camelToKebab");
234
+ var svgAttrName = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((k) => SVG_CAMEL_ATTRS.has(k) ? k : camelToKebab(k), "svgAttrName");
193
235
  var unitlessProperties = /* @__PURE__ */ new Set([
194
236
  "zIndex",
195
237
  "opacity",
@@ -212,14 +254,16 @@ function convertStyleObjectToString(styleObj) {
212
254
  chunkAJJIEZ7G_cjs.__name(convertStyleObjectToString, "convertStyleObjectToString");
213
255
  var applyPropsToDom = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((node, prevProps = {}, nextProps = {}) => {
214
256
  const element = node;
257
+ const isSvg = element.namespaceURI === SVG_NS;
215
258
  const eventNode = getEventHandlerListeners(element) || /* @__PURE__ */ new Map();
216
259
  for (const k in prevProps) {
217
260
  if (isEvent(k) && !(k in nextProps)) {
218
261
  eventNode.delete(k);
219
262
  }
220
263
  if (isProperty(k) && !(k in nextProps)) {
264
+ const attrName = isSvg ? svgAttrName(k) : k;
221
265
  element[k] = "";
222
- element.removeAttribute(k);
266
+ element.removeAttribute(attrName);
223
267
  }
224
268
  }
225
269
  for (const k in nextProps) {
@@ -229,13 +273,22 @@ var applyPropsToDom = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((node, prevProps
229
273
  eventNode.set(k, nextProps[k]);
230
274
  }
231
275
  } else if (k === "style") {
232
- element.setAttribute("style", convertStyleObjectToString(nextProps[k]));
276
+ if (typeof nextProps[k] === "string") {
277
+ element.setAttribute("style", nextProps[k]);
278
+ } else {
279
+ element.setAttribute("style", convertStyleObjectToString(nextProps[k]));
280
+ }
233
281
  } else {
234
282
  const v = nextProps[k];
235
- if (k === "className") element.setAttribute("class", v ?? "");
236
- else if (v === false || v === null || v === void 0)
237
- element.removeAttribute(k);
238
- else element.setAttribute(k, String(v));
283
+ if (k === "className") {
284
+ element.setAttribute("class", v ?? "");
285
+ } else if (v === false || v === null || v === void 0) {
286
+ const attrName = isSvg ? svgAttrName(k) : k;
287
+ element.removeAttribute(attrName);
288
+ } else {
289
+ const attrName = isSvg ? svgAttrName(k) : k;
290
+ element.setAttribute(attrName, String(v));
291
+ }
239
292
  }
240
293
  }
241
294
  setEventHandlerListeners(element, eventNode);
@@ -259,12 +312,15 @@ var IdleLane = 16;
259
312
 
260
313
  // ../rectify-reconciler/src/RectifyFiberWorkTags.ts
261
314
  var FunctionComponent = /* @__PURE__ */ Symbol.for("rectify.function_component");
315
+ var ClassComponent = /* @__PURE__ */ Symbol.for("rectify.class_component");
262
316
  var HostComponent = /* @__PURE__ */ Symbol.for("rectify.host_component");
263
317
  var HostText = /* @__PURE__ */ Symbol.for("rectify.host_text");
264
318
  var HostRoot = /* @__PURE__ */ Symbol.for("rectify.host_root");
265
319
  var FragmentComponent = /* @__PURE__ */ Symbol.for("rectify.fragment_component");
266
320
  var ContextProvider = /* @__PURE__ */ Symbol.for("rectify.context_provider");
267
321
  var MemoComponent = /* @__PURE__ */ Symbol.for("rectify.memo_component");
322
+ var LazyComponent = /* @__PURE__ */ Symbol.for("rectify.lazy_component");
323
+ var SuspenseComponent = /* @__PURE__ */ Symbol.for("rectify.suspense_component");
268
324
  var addFlagToFiber = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber, flag) => {
269
325
  if (hasFlagOnFiber(fiber, flag)) return;
270
326
  fiber.flags |= flag;
@@ -286,6 +342,15 @@ var getFiberTagFromElement = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((element)
286
342
  if (shared.isFunction(element.type) && element.type?._isMemo === true) {
287
343
  return MemoComponent;
288
344
  }
345
+ if (element.type?._isSuspense === true) {
346
+ return SuspenseComponent;
347
+ }
348
+ if (element.type?._isLazy === true) {
349
+ return LazyComponent;
350
+ }
351
+ if (element.type?._isClassComponent === true) {
352
+ return ClassComponent;
353
+ }
289
354
  return shared.isFunction(element.type) ? FunctionComponent : HostComponent;
290
355
  case shared.RECTIFY_TEXT_TYPE:
291
356
  return HostText;
@@ -295,12 +360,53 @@ var getFiberTagFromElement = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((element)
295
360
  return null;
296
361
  }
297
362
  }, "getFiberTagFromElement");
363
+ var SVG_TAGS = /* @__PURE__ */ new Set([
364
+ "svg",
365
+ "circle",
366
+ "ellipse",
367
+ "line",
368
+ "path",
369
+ "polygon",
370
+ "polyline",
371
+ "rect",
372
+ "g",
373
+ "defs",
374
+ "use",
375
+ "symbol",
376
+ "clipPath",
377
+ "mask",
378
+ "pattern",
379
+ "linearGradient",
380
+ "radialGradient",
381
+ "stop",
382
+ "marker",
383
+ "image",
384
+ "text",
385
+ "tspan",
386
+ "textPath",
387
+ "foreignObject",
388
+ "animate",
389
+ "animateMotion",
390
+ "animateTransform",
391
+ "feBlend",
392
+ "feColorMatrix",
393
+ "feComposite",
394
+ "feGaussianBlur",
395
+ "feOffset",
396
+ "feMerge",
397
+ "feMergeNode",
398
+ "feTurbulence",
399
+ "feFlood"
400
+ ]);
401
+ var SVG_NS2 = "http://www.w3.org/2000/svg";
298
402
  var createDomElementFromFiber = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
299
403
  switch (fiber.workTag) {
300
404
  case HostText:
301
405
  return document.createTextNode(fiber.pendingProps);
302
- default:
303
- return document.createElement(fiber.type);
406
+ default: {
407
+ const tag = fiber.type;
408
+ return SVG_TAGS.has(tag) ? document.createElementNS(SVG_NS2, tag) : document.createElement(tag);
409
+ }
304
410
  }
305
411
  }, "createDomElementFromFiber");
306
412
  var getParentDom = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
@@ -330,8 +436,10 @@ chunkAJJIEZ7G_cjs.__name(findFirstHostNode, "findFirstHostNode");
330
436
  function getHostSibling(fiber) {
331
437
  let sibling = fiber.sibling;
332
438
  while (sibling) {
333
- const node = findFirstHostNode(sibling);
334
- if (node) return node;
439
+ if (!(sibling.flags & PlacementFlag)) {
440
+ const node = findFirstHostNode(sibling);
441
+ if (node) return node;
442
+ }
335
443
  sibling = sibling.sibling;
336
444
  }
337
445
  return null;
@@ -362,6 +470,7 @@ var createFiber = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((workTag, pendingProp
362
470
  sibling: null,
363
471
  return: null,
364
472
  stateNode: null,
473
+ classInstance: null,
365
474
  deletions: null,
366
475
  alternate: null,
367
476
  lanes: NoLanes,
@@ -396,6 +505,7 @@ var createWorkInProgress = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((current, pe
396
505
  }
397
506
  wip.memoizedProps = current.memoizedProps;
398
507
  wip.memoizedState = current.memoizedState;
508
+ wip.classInstance = current.classInstance;
399
509
  wip.refCleanup = current.refCleanup;
400
510
  wip.return = current.return;
401
511
  wip.child = current.child;
@@ -422,6 +532,88 @@ var getScheduledFiberRoot = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
422
532
  return instance.fiberRoot;
423
533
  }, "getScheduledFiberRoot");
424
534
 
535
+ // ../rectify-reconciler/src/RectifyFiberScheduler.ts
536
+ var FRAME_BUDGET_MS = 5;
537
+ var frameStart = 0;
538
+ var shouldYield = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => performance.now() - frameStart > FRAME_BUDGET_MS, "shouldYield");
539
+ var doWork = null;
540
+ var setWorkCallback = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((cb) => {
541
+ doWork = cb;
542
+ }, "setWorkCallback");
543
+ var resumeCursor = null;
544
+ var setResumeCursor = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
545
+ resumeCursor = fiber;
546
+ }, "setResumeCursor");
547
+ var getResumeCursor = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => resumeCursor, "getResumeCursor");
548
+ var clearResumeCursor = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
549
+ resumeCursor = null;
550
+ }, "clearResumeCursor");
551
+ var pendingLanes = NoLanes;
552
+ var scheduleRenderLane = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((lane) => {
553
+ pendingLanes |= lane;
554
+ if (lane & (SyncLane | InputLane)) {
555
+ scheduleMicrotask();
556
+ } else if (lane & DefaultLane) {
557
+ scheduleMessageTask();
558
+ } else if (lane & TransitionLane) {
559
+ scheduleTimeout();
560
+ } else if (lane & IdleLane) {
561
+ scheduleIdle();
562
+ }
563
+ }, "scheduleRenderLane");
564
+ var flush = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((mask) => {
565
+ const lanes = pendingLanes & mask;
566
+ if (!lanes) return;
567
+ pendingLanes &= ~lanes;
568
+ frameStart = performance.now();
569
+ doWork?.(lanes);
570
+ }, "flush");
571
+ var MICROTASK_MASK = SyncLane | InputLane;
572
+ var microtaskScheduled = false;
573
+ var scheduleMicrotask = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
574
+ if (microtaskScheduled) return;
575
+ microtaskScheduled = true;
576
+ queueMicrotask(() => {
577
+ microtaskScheduled = false;
578
+ flush(MICROTASK_MASK);
579
+ });
580
+ }, "scheduleMicrotask");
581
+ var DEFAULT_MASK = DefaultLane;
582
+ var mc = new MessageChannel();
583
+ var mcScheduled = false;
584
+ mc.port1.onmessage = () => {
585
+ mcScheduled = false;
586
+ flush(DEFAULT_MASK);
587
+ };
588
+ var scheduleMessageTask = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
589
+ if (mcScheduled) return;
590
+ mcScheduled = true;
591
+ mc.port2.postMessage(null);
592
+ }, "scheduleMessageTask");
593
+ var TRANSITION_MASK = TransitionLane;
594
+ var timeoutHandle = null;
595
+ var scheduleTimeout = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
596
+ if (timeoutHandle !== null) return;
597
+ timeoutHandle = setTimeout(() => {
598
+ timeoutHandle = null;
599
+ flush(TRANSITION_MASK);
600
+ }, 0);
601
+ }, "scheduleTimeout");
602
+ var IDLE_MASK = IdleLane;
603
+ var idleHandle = null;
604
+ var scheduleIdle = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
605
+ if (idleHandle !== null) return;
606
+ const run = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
607
+ idleHandle = null;
608
+ flush(IDLE_MASK);
609
+ }, "run");
610
+ if (typeof requestIdleCallback !== "undefined") {
611
+ idleHandle = requestIdleCallback(run, { timeout: 300 });
612
+ } else {
613
+ idleHandle = setTimeout(run, 300);
614
+ }
615
+ }, "scheduleIdle");
616
+
425
617
  // ../rectify-hook/src/RectifyHookRenderingFiber.ts
426
618
  var instance2 = {
427
619
  fiberRendering: null,
@@ -467,10 +659,10 @@ var prepareToUseHooks = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
467
659
  var finishUsingHooks = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
468
660
  setFiberRendering(null);
469
661
  }, "finishUsingHooks");
470
- var withHooks = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip, Component) => {
662
+ var withHooks = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip, Component2) => {
471
663
  const NewComponent = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((props) => {
472
664
  prepareToUseHooks(wip);
473
- const result = Component(props);
665
+ const result = Component2(props);
474
666
  finishUsingHooks();
475
667
  return result;
476
668
  }, "NewComponent");
@@ -773,6 +965,30 @@ function clearContextSubscriptions(fiber) {
773
965
  }
774
966
  chunkAJJIEZ7G_cjs.__name(clearContextSubscriptions, "clearContextSubscriptions");
775
967
 
968
+ // ../rectify-hook/src/RectifyHookUseId.ts
969
+ var _idCounter = 0;
970
+ var generateId = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => `_r${(_idCounter++).toString(36)}_`, "generateId");
971
+ var useId = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
972
+ const fiber = getFiberRendering();
973
+ if (!fiber) {
974
+ throw new Error("useId must be used within a function component.");
975
+ }
976
+ const hookIndex = getHookIndex();
977
+ nextHookIndex();
978
+ const { hook, prevHook } = getHookSlot(fiber, hookIndex);
979
+ if (!hook) {
980
+ const newHook = {
981
+ memoizedState: generateId(),
982
+ queue: null,
983
+ next: null
984
+ };
985
+ attachHook(fiber, newHook, prevHook);
986
+ return newHook.memoizedState;
987
+ }
988
+ return hook.memoizedState;
989
+ }, "useId");
990
+ var RectifyHookUseId_default = useId;
991
+
776
992
  // ../rectify-reconciler/src/RectifyFiberRenderPriority.ts
777
993
  var currentEventPriority = DefaultLane;
778
994
  var setCurrentEventPriority = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((lane) => {
@@ -787,156 +1003,228 @@ var setCurrentRenderingLanes = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((lanes)
787
1003
  currentRenderingLanes = lanes;
788
1004
  }, "setCurrentRenderingLanes");
789
1005
  var getCurrentLanePriority = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => currentRenderingLanes, "getCurrentLanePriority");
790
-
791
- // ../rectify-reconciler/src/RectifyFiberScheduler.ts
792
- var FRAME_BUDGET_MS = 5;
793
- var frameStart = 0;
794
- var shouldYield = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => performance.now() - frameStart > FRAME_BUDGET_MS, "shouldYield");
795
- var doWork = null;
796
- var setWorkCallback = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((cb) => {
797
- doWork = cb;
798
- }, "setWorkCallback");
799
- var resumeCursor = null;
800
- var setResumeCursor = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
801
- resumeCursor = fiber;
802
- }, "setResumeCursor");
803
- var getResumeCursor = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => resumeCursor, "getResumeCursor");
804
- var clearResumeCursor = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
805
- resumeCursor = null;
806
- }, "clearResumeCursor");
807
- var pendingLanes = NoLanes;
808
- var scheduleRenderLane = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((lane) => {
809
- pendingLanes |= lane;
810
- if (lane & (SyncLane | InputLane)) {
811
- scheduleMicrotask();
812
- } else if (lane & DefaultLane) {
813
- scheduleMessageTask();
814
- } else if (lane & TransitionLane) {
815
- scheduleTimeout();
816
- } else if (lane & IdleLane) {
817
- scheduleIdle();
818
- }
819
- }, "scheduleRenderLane");
820
- var flush = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((mask) => {
821
- const lanes = pendingLanes & mask;
822
- if (!lanes) return;
823
- pendingLanes &= ~lanes;
824
- frameStart = performance.now();
825
- doWork?.(lanes);
826
- }, "flush");
827
- var MICROTASK_MASK = SyncLane | InputLane;
828
- var microtaskScheduled = false;
829
- var scheduleMicrotask = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
830
- if (microtaskScheduled) return;
831
- microtaskScheduled = true;
832
- queueMicrotask(() => {
833
- microtaskScheduled = false;
834
- flush(MICROTASK_MASK);
835
- });
836
- }, "scheduleMicrotask");
837
- var DEFAULT_MASK = DefaultLane;
838
- var mc = new MessageChannel();
839
- var mcScheduled = false;
840
- mc.port1.onmessage = () => {
841
- mcScheduled = false;
842
- flush(DEFAULT_MASK);
843
- };
844
- var scheduleMessageTask = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
845
- if (mcScheduled) return;
846
- mcScheduled = true;
847
- mc.port2.postMessage(null);
848
- }, "scheduleMessageTask");
849
- var TRANSITION_MASK = TransitionLane;
850
- var timeoutHandle = null;
851
- var scheduleTimeout = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
852
- if (timeoutHandle !== null) return;
853
- timeoutHandle = setTimeout(() => {
854
- timeoutHandle = null;
855
- flush(TRANSITION_MASK);
856
- }, 0);
857
- }, "scheduleTimeout");
858
- var IDLE_MASK = IdleLane;
859
- var idleHandle = null;
860
- var scheduleIdle = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
861
- if (idleHandle !== null) return;
862
- const run = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
863
- idleHandle = null;
864
- flush(IDLE_MASK);
865
- }, "run");
866
- if (typeof requestIdleCallback !== "undefined") {
867
- idleHandle = requestIdleCallback(run, { timeout: 300 });
868
- } else {
869
- idleHandle = setTimeout(run, 300);
870
- }
871
- }, "scheduleIdle");
872
-
873
- // ../rectify-reconciler/src/RectifyFiberWorkLoop.ts
874
- var swapCurrentForWip = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((current, wip) => {
875
- const parent = wip.return;
876
- if (!parent) return;
877
- if (parent.child === current) {
878
- parent.child = wip;
879
- return;
1006
+ var reuseOrCreate = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((oldFiber, element, wip) => {
1007
+ const newFiber = createWorkInProgress(oldFiber, element.props);
1008
+ if (hasPropsChanged(oldFiber.memoizedProps, element.props)) {
1009
+ addFlagToFiber(newFiber, UpdateFlag);
880
1010
  }
881
- let prevSibling = parent.child;
882
- while (prevSibling && prevSibling.sibling !== current) {
883
- prevSibling = prevSibling.sibling;
1011
+ if ((oldFiber.memoizedProps?.ref ?? null) !== (element.props?.ref ?? null)) {
1012
+ addFlagToFiber(newFiber, RefFlag);
884
1013
  }
885
- if (prevSibling) prevSibling.sibling = wip;
886
- }, "swapCurrentForWip");
887
- var workLoop = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wipRoot) => {
888
- let workInProgress = wipRoot;
889
- while (workInProgress) {
890
- const next = beginWork(workInProgress);
891
- if (next) {
892
- workInProgress = next;
1014
+ newFiber.return = wip;
1015
+ return newFiber;
1016
+ }, "reuseOrCreate");
1017
+ var createAndPlace = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((element, wip) => {
1018
+ const newFiber = createFiberFromRectifyElement(element);
1019
+ newFiber.type = element.type;
1020
+ addFlagToFiber(newFiber, PlacementFlag);
1021
+ newFiber.return = wip;
1022
+ return newFiber;
1023
+ }, "createAndPlace");
1024
+ var appendFiber = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber, prev, index, wip) => {
1025
+ fiber.index = index;
1026
+ if (!prev) wip.child = fiber;
1027
+ else prev.sibling = fiber;
1028
+ return fiber;
1029
+ }, "appendFiber");
1030
+ var buildOldFiberStructures = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((firstRemaining) => {
1031
+ const keyedMap = /* @__PURE__ */ new Map();
1032
+ const unkeyedByType = /* @__PURE__ */ new Map();
1033
+ let fiber = firstRemaining;
1034
+ while (fiber) {
1035
+ if (fiber.key !== null && fiber.key !== void 0) {
1036
+ keyedMap.set(fiber.key, fiber);
893
1037
  } else {
894
- workInProgress = completeUnitOfWork(workInProgress, wipRoot);
1038
+ const pool = unkeyedByType.get(fiber.type);
1039
+ if (pool) pool.push(fiber);
1040
+ else unkeyedByType.set(fiber.type, [fiber]);
895
1041
  }
1042
+ fiber = fiber.sibling;
896
1043
  }
897
- }, "workLoop");
898
- var workLoopConcurrent = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wipRoot) => {
899
- let workInProgress = getResumeCursor() ?? wipRoot;
900
- clearResumeCursor();
901
- while (workInProgress && !shouldYield()) {
902
- const next = beginWork(workInProgress);
903
- if (next) {
904
- workInProgress = next;
1044
+ return { keyedMap, unkeyedByType };
1045
+ }, "buildOldFiberStructures");
1046
+ var reconcileSequential = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((state, firstOldFiber) => {
1047
+ let oldFiber = firstOldFiber;
1048
+ for (let i = 0; i < state.newElements.length; i++) {
1049
+ const element = state.newElements[i];
1050
+ const { key: elementKey = null, type: elementType } = element;
1051
+ if (!oldFiber) return { stoppedAt: i, oldFiber: null };
1052
+ if (oldFiber.key !== elementKey) return { stoppedAt: i, oldFiber };
1053
+ if (oldFiber.type === elementType) {
1054
+ state.prev = appendFiber(
1055
+ reuseOrCreate(oldFiber, element, state.wip),
1056
+ state.prev,
1057
+ state.index++,
1058
+ state.wip
1059
+ );
1060
+ } else if (elementKey !== null) {
1061
+ addFlagToFiber(oldFiber, DeletionFlag);
1062
+ state.deletions.push(oldFiber);
1063
+ state.prev = appendFiber(
1064
+ createAndPlace(element, state.wip),
1065
+ state.prev,
1066
+ state.index++,
1067
+ state.wip
1068
+ );
905
1069
  } else {
906
- workInProgress = completeUnitOfWork(workInProgress, wipRoot);
1070
+ return { stoppedAt: i, oldFiber };
907
1071
  }
1072
+ oldFiber = oldFiber.sibling;
908
1073
  }
909
- if (workInProgress !== null) {
910
- setResumeCursor(workInProgress);
911
- return false;
912
- }
913
- return true;
914
- }, "workLoopConcurrent");
915
- var workLoopOnFiberLanes = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wipRoot, renderLanes) => {
916
- if (wipRoot.lanes & renderLanes) {
917
- const wip = createWorkInProgress(wipRoot, wipRoot.pendingProps);
918
- swapCurrentForWip(wipRoot, wip);
919
- const isSync = !!(renderLanes & (SyncLane | InputLane));
920
- let completed;
921
- if (isSync) {
922
- workLoop(wip);
923
- completed = true;
924
- } else {
925
- completed = workLoopConcurrent(wip);
1074
+ return { stoppedAt: state.newElements.length, oldFiber };
1075
+ }, "reconcileSequential");
1076
+ var reconcileKeyed = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((state, startAt, remainingOldFiber) => {
1077
+ const { keyedMap, unkeyedByType } = buildOldFiberStructures(remainingOldFiber);
1078
+ let lastPlacedIndex = 0;
1079
+ for (let i = startAt; i < state.newElements.length; i++) {
1080
+ const element = state.newElements[i];
1081
+ const { key: elementKey = null, type: elementType } = element;
1082
+ let matched = null;
1083
+ if (elementKey !== null) {
1084
+ const candidate = keyedMap.get(elementKey) ?? null;
1085
+ if (candidate && candidate.type === elementType) {
1086
+ keyedMap.delete(elementKey);
1087
+ matched = candidate;
1088
+ }
1089
+ } else {
1090
+ const pool = unkeyedByType.get(elementType);
1091
+ if (pool?.length) matched = pool.shift();
1092
+ }
1093
+ if (matched) {
1094
+ const newFiber = reuseOrCreate(matched, element, state.wip);
1095
+ if (matched.index < lastPlacedIndex) {
1096
+ addFlagToFiber(newFiber, MoveFlag);
1097
+ } else {
1098
+ lastPlacedIndex = matched.index;
1099
+ }
1100
+ state.prev = appendFiber(newFiber, state.prev, state.index++, state.wip);
1101
+ } else {
1102
+ state.prev = appendFiber(
1103
+ createAndPlace(element, state.wip),
1104
+ state.prev,
1105
+ state.index++,
1106
+ state.wip
1107
+ );
926
1108
  }
927
- if (completed) bubbleFlagsToRoot(wip);
928
- return completed;
929
1109
  }
930
- if (wipRoot.childLanes & renderLanes) {
931
- let child = wipRoot.child;
932
- while (child) {
933
- const done = workLoopOnFiberLanes(child, renderLanes);
934
- if (!done) return false;
935
- child = child.sibling;
1110
+ for (const orphan of keyedMap.values()) {
1111
+ addFlagToFiber(orphan, DeletionFlag);
1112
+ state.deletions.push(orphan);
1113
+ }
1114
+ for (const pool of unkeyedByType.values()) {
1115
+ for (const orphan of pool) {
1116
+ addFlagToFiber(orphan, DeletionFlag);
1117
+ state.deletions.push(orphan);
936
1118
  }
937
1119
  }
938
- return true;
939
- }, "workLoopOnFiberLanes");
1120
+ }, "reconcileKeyed");
1121
+ var toChildArray = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((children) => {
1122
+ if (children == null || typeof children === "boolean") return [];
1123
+ if (shared.isArray(children)) return children;
1124
+ return [children];
1125
+ }, "toChildArray");
1126
+ var reconcileChildren = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip, children) => {
1127
+ const newElements = toChildArray(children).map(shared.createElementFromRectifyNode).filter(shared.isValidRectifyElement);
1128
+ const state = {
1129
+ wip,
1130
+ newElements,
1131
+ deletions: [],
1132
+ prev: null,
1133
+ index: 0
1134
+ };
1135
+ const firstOldFiber = wip.alternate?.child ?? null;
1136
+ const { stoppedAt, oldFiber } = reconcileSequential(state, firstOldFiber);
1137
+ if (stoppedAt < newElements.length) {
1138
+ reconcileKeyed(state, stoppedAt, oldFiber);
1139
+ } else {
1140
+ let leftover = oldFiber;
1141
+ while (leftover) {
1142
+ addFlagToFiber(leftover, DeletionFlag);
1143
+ state.deletions.push(leftover);
1144
+ leftover = leftover.sibling;
1145
+ }
1146
+ }
1147
+ if (state.prev) state.prev.sibling = null;
1148
+ if (state.deletions.length) wip.deletions = state.deletions;
1149
+ }, "reconcileChildren");
1150
+
1151
+ // ../rectify-reconciler/src/RectifyFiberConcurrentUpdate.ts
1152
+ var instance3 = {
1153
+ head: null,
1154
+ tail: null
1155
+ };
1156
+ var enqueueUpdate = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((update) => {
1157
+ update.next = null;
1158
+ if (instance3.tail === null) {
1159
+ instance3.head = update;
1160
+ instance3.tail = update;
1161
+ return;
1162
+ }
1163
+ instance3.tail.next = update;
1164
+ instance3.tail = update;
1165
+ }, "enqueueUpdate");
1166
+ var dequeueUpdate = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
1167
+ const first = instance3.head;
1168
+ if (first === null) {
1169
+ return null;
1170
+ }
1171
+ instance3.head = first.next;
1172
+ if (instance3.head === null) {
1173
+ instance3.tail = null;
1174
+ }
1175
+ first.next = null;
1176
+ return first;
1177
+ }, "dequeueUpdate");
1178
+ var hasUpdate = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => instance3.head !== null, "hasUpdate");
1179
+
1180
+ // ../rectify-reconciler/src/RectifyFiberSuspense.ts
1181
+ var suspendedBoundaries = /* @__PURE__ */ new WeakSet();
1182
+ var stableFiber = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => fiber.alternate ?? fiber, "stableFiber");
1183
+ var isSuspendedBoundary = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => suspendedBoundaries.has(stableFiber(fiber)), "isSuspendedBoundary");
1184
+ var findNearestSuspenseBoundary = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
1185
+ let current = fiber.return;
1186
+ while (current) {
1187
+ if (current.workTag === SuspenseComponent) return current;
1188
+ current = current.return;
1189
+ }
1190
+ return null;
1191
+ }, "findNearestSuspenseBoundary");
1192
+ var handleSuspendedWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((boundary, thenable) => {
1193
+ const stable = stableFiber(boundary);
1194
+ if (suspendedBoundaries.has(stable)) return;
1195
+ suspendedBoundaries.add(stable);
1196
+ boundary.child = null;
1197
+ boundary.deletions = null;
1198
+ thenable.then(
1199
+ () => {
1200
+ suspendedBoundaries.delete(stable);
1201
+ enqueueUpdate({ lanes: DefaultLane, fiber: stable, next: null });
1202
+ scheduleRenderLane(DefaultLane);
1203
+ },
1204
+ () => {
1205
+ suspendedBoundaries.delete(stable);
1206
+ }
1207
+ );
1208
+ }, "handleSuspendedWork");
1209
+ var isThenable = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((value) => value !== null && typeof value === "object" && typeof value.then === "function", "isThenable");
1210
+
1211
+ // ../rectify-reconciler/src/RectifyFiberBeginWork.ts
1212
+ var hasNoPendingWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => !(wip.lanes & getCurrentLanePriority()), "hasNoPendingWork");
1213
+ var isUpdate = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => wip.alternate !== null, "isUpdate");
1214
+ var flushStateQueue = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((currentState, props, queue) => {
1215
+ let state = currentState;
1216
+ for (const update of queue) {
1217
+ const partial = typeof update === "function" ? update(state, props) : update;
1218
+ state = { ...state, ...partial };
1219
+ }
1220
+ return state;
1221
+ }, "flushStateQueue");
1222
+ var renderFunctionComponent = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip, Component2) => {
1223
+ const ComponentWithHooks = withHooks(wip, Component2);
1224
+ const children = ComponentWithHooks(wip.pendingProps);
1225
+ reconcileChildren(wip, children);
1226
+ }, "renderFunctionComponent");
1227
+ var getProviderContext = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => wip.type._context, "getProviderContext");
940
1228
  var cloneChildFibers = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
941
1229
  const currentChild = wip.alternate?.child ?? null;
942
1230
  if (!currentChild) {
@@ -959,14 +1247,6 @@ var cloneChildFibers = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
959
1247
  if (prevNewChild) prevNewChild.sibling = null;
960
1248
  return wip.child;
961
1249
  }, "cloneChildFibers");
962
- var hasNoPendingWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => !(wip.lanes & getCurrentLanePriority()), "hasNoPendingWork");
963
- var isUpdate = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => wip.alternate !== null, "isUpdate");
964
- var renderFunctionComponent = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip, Component) => {
965
- const ComponentWithHooks = withHooks(wip, Component);
966
- const children = ComponentWithHooks(wip.pendingProps);
967
- reconcileChildren(wip, children);
968
- }, "renderFunctionComponent");
969
- var getProviderContext = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => wip.type._context, "getProviderContext");
970
1250
  var beginWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
971
1251
  switch (wip.workTag) {
972
1252
  case MemoComponent: {
@@ -981,12 +1261,12 @@ var beginWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
981
1261
  break;
982
1262
  }
983
1263
  case FunctionComponent: {
984
- const Component = wip.type;
985
- if (!shared.isFunction(Component)) break;
1264
+ const Component2 = wip.type;
1265
+ if (!shared.isFunction(Component2)) break;
986
1266
  if (isUpdate(wip) && hasNoPendingWork(wip) && shared.shallowEqual(wip.memoizedProps, wip.pendingProps)) {
987
1267
  return cloneChildFibers(wip);
988
1268
  }
989
- renderFunctionComponent(wip, Component);
1269
+ renderFunctionComponent(wip, Component2);
990
1270
  break;
991
1271
  }
992
1272
  case FragmentComponent:
@@ -1009,33 +1289,80 @@ var beginWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
1009
1289
  }
1010
1290
  break;
1011
1291
  }
1012
- }
1013
- return wip.child;
1014
- }, "beginWork");
1015
- var completeUnitOfWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((unit, stopAt) => {
1016
- let completed = unit;
1017
- while (completed) {
1018
- bubbleProperties(completed);
1019
- if (completed === stopAt) {
1020
- return null;
1292
+ case SuspenseComponent: {
1293
+ const children = isSuspendedBoundary(wip) ? wip.pendingProps?.fallback : wip.pendingProps?.children;
1294
+ reconcileChildren(wip, children);
1295
+ break;
1021
1296
  }
1022
- if (completed.sibling) {
1023
- return completed.sibling;
1297
+ case ClassComponent: {
1298
+ const Ctor = wip.type;
1299
+ const isMount = !wip.classInstance;
1300
+ if (isMount) {
1301
+ const instance4 = new Ctor(wip.pendingProps);
1302
+ instance4._fiber = wip;
1303
+ wip.classInstance = instance4;
1304
+ if (instance4._pendingStateQueue?.length) {
1305
+ instance4.state = flushStateQueue(
1306
+ instance4.state,
1307
+ instance4.props,
1308
+ instance4._pendingStateQueue
1309
+ );
1310
+ instance4._pendingStateQueue = [];
1311
+ }
1312
+ } else {
1313
+ const instance4 = wip.classInstance;
1314
+ if (hasNoPendingWork(wip) && !instance4._pendingStateQueue?.length && shared.shallowEqual(instance4.props, wip.pendingProps)) {
1315
+ return cloneChildFibers(wip);
1316
+ }
1317
+ instance4._prevProps = instance4.props;
1318
+ instance4._prevState = { ...instance4.state };
1319
+ if (instance4._pendingStateQueue?.length) {
1320
+ instance4.state = flushStateQueue(
1321
+ instance4.state,
1322
+ wip.pendingProps,
1323
+ instance4._pendingStateQueue
1324
+ );
1325
+ instance4._pendingStateQueue = [];
1326
+ }
1327
+ instance4.props = wip.pendingProps;
1328
+ instance4._fiber = wip;
1329
+ if (isUpdate(wip) && typeof instance4.shouldComponentUpdate === "function" && !instance4.shouldComponentUpdate(wip.pendingProps, instance4.state)) {
1330
+ return cloneChildFibers(wip);
1331
+ }
1332
+ }
1333
+ const children = wip.classInstance.render();
1334
+ reconcileChildren(wip, children);
1335
+ break;
1336
+ }
1337
+ case LazyComponent: {
1338
+ const lazy2 = wip.type;
1339
+ if (lazy2._status === "resolved") {
1340
+ renderFunctionComponent(wip, lazy2._result);
1341
+ break;
1342
+ }
1343
+ if (lazy2._status === "rejected") {
1344
+ throw lazy2._result;
1345
+ }
1346
+ if (lazy2._status === "uninitialized") {
1347
+ lazy2._status = "pending";
1348
+ lazy2._promise = lazy2._factory().then(
1349
+ (module) => {
1350
+ lazy2._status = "resolved";
1351
+ lazy2._result = module?.default ?? module;
1352
+ },
1353
+ (error) => {
1354
+ lazy2._status = "rejected";
1355
+ lazy2._result = error;
1356
+ }
1357
+ );
1358
+ }
1359
+ throw lazy2._promise;
1024
1360
  }
1025
- completed = completed.return;
1026
- }
1027
- return null;
1028
- }, "completeUnitOfWork");
1029
- var bubbleFlagsToRoot = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
1030
- let current = wip;
1031
- let parent = current.return;
1032
- while (parent) {
1033
- parent.subtreeFlags |= current.flags | current.subtreeFlags;
1034
- parent.childLanes |= current.lanes | current.childLanes;
1035
- current = parent;
1036
- parent = parent.return;
1037
1361
  }
1038
- }, "bubbleFlagsToRoot");
1362
+ return wip.child;
1363
+ }, "beginWork");
1364
+
1365
+ // ../rectify-reconciler/src/RectifyFiberCompleteWork.ts
1039
1366
  var bubbleProperties = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
1040
1367
  wip.lanes &= ~getCurrentLanePriority();
1041
1368
  let subtreeFlags = NoFlags;
@@ -1050,140 +1377,109 @@ var bubbleProperties = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
1050
1377
  wip.subtreeFlags = subtreeFlags;
1051
1378
  wip.childLanes = childLanes;
1052
1379
  }, "bubbleProperties");
1053
- var reuseOrCreate = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((oldFiber, element, wip) => {
1054
- const newFiber = createWorkInProgress(oldFiber, element.props);
1055
- if (hasPropsChanged(oldFiber.memoizedProps, element.props)) {
1056
- addFlagToFiber(newFiber, UpdateFlag);
1380
+ var bubbleFlagsToRoot = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
1381
+ let current = wip;
1382
+ let parent = current.return;
1383
+ while (parent) {
1384
+ parent.subtreeFlags |= current.flags | current.subtreeFlags;
1385
+ parent.childLanes |= current.lanes | current.childLanes;
1386
+ current = parent;
1387
+ parent = parent.return;
1057
1388
  }
1058
- if ((oldFiber.memoizedProps?.ref ?? null) !== (element.props?.ref ?? null)) {
1059
- addFlagToFiber(newFiber, RefFlag);
1389
+ }, "bubbleFlagsToRoot");
1390
+ var completeUnitOfWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((unit, stopAt) => {
1391
+ let completed = unit;
1392
+ while (completed) {
1393
+ bubbleProperties(completed);
1394
+ if (completed === stopAt) return null;
1395
+ if (completed.sibling) return completed.sibling;
1396
+ completed = completed.return;
1060
1397
  }
1061
- newFiber.return = wip;
1062
- return newFiber;
1063
- }, "reuseOrCreate");
1064
- var createAndPlace = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((element, wip) => {
1065
- const newFiber = createFiberFromRectifyElement(element);
1066
- newFiber.type = element.type;
1067
- addFlagToFiber(newFiber, PlacementFlag);
1068
- newFiber.return = wip;
1069
- return newFiber;
1070
- }, "createAndPlace");
1071
- var appendFiber = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber, prev, index, wip) => {
1072
- fiber.index = index;
1073
- if (!prev) wip.child = fiber;
1074
- else prev.sibling = fiber;
1075
- return fiber;
1076
- }, "appendFiber");
1077
- var buildOldFiberMap = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((firstRemaining, startIndex) => {
1078
- const map = /* @__PURE__ */ new Map();
1079
- let fiber = firstRemaining;
1080
- let i = startIndex;
1081
- while (fiber) {
1082
- map.set(fiber.key ?? i, fiber);
1083
- fiber = fiber.sibling;
1084
- i++;
1398
+ return null;
1399
+ }, "completeUnitOfWork");
1400
+
1401
+ // ../rectify-reconciler/src/RectifyFiberWorkLoop.ts
1402
+ var swapCurrentForWip = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((current, wip) => {
1403
+ const parent = wip.return;
1404
+ if (!parent) return;
1405
+ if (parent.child === current) {
1406
+ parent.child = wip;
1407
+ return;
1085
1408
  }
1086
- return map;
1087
- }, "buildOldFiberMap");
1088
- var reconcileSequential = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((state, firstOldFiber) => {
1089
- let oldFiber = firstOldFiber;
1090
- let i = 0;
1091
- for (; i < state.newElements.length; i++) {
1092
- const element = state.newElements[i];
1093
- const { key: elementKey = null, type: elementType } = element;
1094
- if (!oldFiber) break;
1095
- if (oldFiber.key !== elementKey) break;
1096
- if (oldFiber.type === elementType) {
1097
- state.prev = appendFiber(reuseOrCreate(oldFiber, element, state.wip), state.prev, state.index++, state.wip);
1098
- } else {
1099
- addFlagToFiber(oldFiber, DeletionFlag);
1100
- state.deletions.push(oldFiber);
1101
- state.prev = appendFiber(createAndPlace(element, state.wip), state.prev, state.index++, state.wip);
1102
- }
1103
- oldFiber = oldFiber.sibling;
1409
+ let prevSibling = parent.child;
1410
+ while (prevSibling && prevSibling.sibling !== current) {
1411
+ prevSibling = prevSibling.sibling;
1104
1412
  }
1105
- return { stoppedAt: i, oldFiber };
1106
- }, "reconcileSequential");
1107
- var reconcileKeyed = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((state, startAt, remainingOldFiber) => {
1108
- const oldFiberMap = buildOldFiberMap(remainingOldFiber, startAt);
1109
- let lastPlacedIndex = 0;
1110
- for (let i = startAt; i < state.newElements.length; i++) {
1111
- const element = state.newElements[i];
1112
- const { key: elementKey = null, type: elementType } = element;
1113
- const mapKey = elementKey ?? i;
1114
- const matched = oldFiberMap.get(mapKey) ?? null;
1115
- if (matched && matched.type === elementType) {
1116
- oldFiberMap.delete(mapKey);
1117
- const newFiber = reuseOrCreate(matched, element, state.wip);
1118
- if (matched.index < lastPlacedIndex) {
1119
- addFlagToFiber(newFiber, MoveFlag);
1120
- } else {
1121
- lastPlacedIndex = matched.index;
1413
+ if (prevSibling) prevSibling.sibling = wip;
1414
+ }, "swapCurrentForWip");
1415
+ var workLoop = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wipRoot) => {
1416
+ let workInProgress = wipRoot;
1417
+ while (workInProgress) {
1418
+ try {
1419
+ const next = beginWork(workInProgress);
1420
+ workInProgress = next ?? completeUnitOfWork(workInProgress, wipRoot);
1421
+ } catch (thrown) {
1422
+ if (isThenable(thrown) && workInProgress) {
1423
+ const boundary = findNearestSuspenseBoundary(workInProgress);
1424
+ if (boundary) {
1425
+ handleSuspendedWork(boundary, thrown);
1426
+ workInProgress = boundary;
1427
+ continue;
1428
+ }
1122
1429
  }
1123
- state.prev = appendFiber(newFiber, state.prev, state.index++, state.wip);
1124
- } else {
1125
- state.prev = appendFiber(createAndPlace(element, state.wip), state.prev, state.index++, state.wip);
1430
+ throw thrown;
1126
1431
  }
1127
1432
  }
1128
- for (const orphan of oldFiberMap.values()) {
1129
- addFlagToFiber(orphan, DeletionFlag);
1130
- state.deletions.push(orphan);
1131
- }
1132
- }, "reconcileKeyed");
1133
- var toChildArray = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((children) => {
1134
- if (children == null || typeof children === "boolean") return [];
1135
- if (shared.isArray(children)) return children;
1136
- return [children];
1137
- }, "toChildArray");
1138
- var reconcileChildren = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip, children) => {
1139
- const newElements = toChildArray(children).map(shared.createElementFromRectifyNode).filter(shared.isValidRectifyElement);
1140
- const state = { wip, newElements, deletions: [], prev: null, index: 0 };
1141
- const firstOldFiber = wip.alternate?.child ?? null;
1142
- const { stoppedAt, oldFiber } = reconcileSequential(state, firstOldFiber);
1143
- if (stoppedAt < newElements.length) {
1144
- reconcileKeyed(state, stoppedAt, oldFiber);
1145
- } else {
1146
- let leftover = oldFiber;
1147
- while (leftover) {
1148
- addFlagToFiber(leftover, DeletionFlag);
1149
- state.deletions.push(leftover);
1150
- leftover = leftover.sibling;
1433
+ }, "workLoop");
1434
+ var workLoopConcurrent = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wipRoot) => {
1435
+ let workInProgress = getResumeCursor() ?? wipRoot;
1436
+ clearResumeCursor();
1437
+ while (workInProgress && !shouldYield()) {
1438
+ try {
1439
+ const next = beginWork(workInProgress);
1440
+ workInProgress = next ?? completeUnitOfWork(workInProgress, wipRoot);
1441
+ } catch (thrown) {
1442
+ if (isThenable(thrown) && workInProgress) {
1443
+ const boundary = findNearestSuspenseBoundary(workInProgress);
1444
+ if (boundary) {
1445
+ handleSuspendedWork(boundary, thrown);
1446
+ workInProgress = boundary;
1447
+ continue;
1448
+ }
1449
+ }
1450
+ throw thrown;
1151
1451
  }
1152
1452
  }
1153
- if (state.prev) state.prev.sibling = null;
1154
- if (state.deletions.length) wip.deletions = state.deletions;
1155
- }, "reconcileChildren");
1156
-
1157
- // ../rectify-reconciler/src/RectifyFiberCommitWork.ts
1158
- var MutationMask = PlacementFlag | UpdateFlag | MoveFlag | RefFlag;
1159
- var commitWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((finishedWork) => {
1160
- if (finishedWork.deletions?.length) {
1161
- finishedWork.deletions.forEach(removeHostTree);
1162
- finishedWork.deletions = null;
1453
+ if (workInProgress !== null) {
1454
+ setResumeCursor(workInProgress);
1455
+ return false;
1163
1456
  }
1164
- if (finishedWork.flags & MutationMask) {
1165
- commitMutation(finishedWork);
1166
- syncMemoizedProps(finishedWork);
1457
+ return true;
1458
+ }, "workLoopConcurrent");
1459
+ var workLoopOnFiberLanes = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wipRoot, renderLanes) => {
1460
+ if (wipRoot.lanes & renderLanes) {
1461
+ const wip = createWorkInProgress(wipRoot, wipRoot.pendingProps);
1462
+ swapCurrentForWip(wipRoot, wip);
1463
+ const isSync = !!(renderLanes & (SyncLane | InputLane));
1464
+ const completed = isSync ? (workLoop(wip), true) : workLoopConcurrent(wip);
1465
+ if (completed) bubbleFlagsToRoot(wip);
1466
+ return completed;
1167
1467
  }
1168
- if (finishedWork.subtreeFlags & MutationMask) {
1169
- let child = finishedWork.child;
1468
+ if (wipRoot.childLanes & renderLanes) {
1469
+ let child = wipRoot.child;
1170
1470
  while (child) {
1171
- commitWork(child);
1471
+ if (!workLoopOnFiberLanes(child, renderLanes)) return false;
1172
1472
  child = child.sibling;
1173
1473
  }
1174
1474
  }
1175
- finishedWork.flags = NoFlags;
1176
- finishedWork.subtreeFlags = NoFlags;
1177
- }, "commitWork");
1178
- var syncMemoizedProps = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
1179
- wip.memoizedProps = wip.pendingProps;
1180
- }, "syncMemoizedProps");
1475
+ return true;
1476
+ }, "workLoopOnFiberLanes");
1181
1477
  var attachRef = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
1182
1478
  const ref = wip.pendingProps?.ref;
1183
1479
  if (!ref) return;
1184
- if (typeof ref === "function") {
1480
+ if (shared.isFunction(ref)) {
1185
1481
  const cleanup = ref(wip.stateNode);
1186
- wip.refCleanup = typeof cleanup === "function" ? cleanup : null;
1482
+ wip.refCleanup = shared.isFunction(cleanup) ? cleanup : null;
1187
1483
  } else if (typeof ref === "object" && "current" in ref) {
1188
1484
  ref.current = wip.stateNode;
1189
1485
  }
@@ -1202,27 +1498,30 @@ var detachRef = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
1202
1498
  ref.current = null;
1203
1499
  }
1204
1500
  }, "detachRef");
1501
+
1502
+ // ../rectify-reconciler/src/RectifyFiberCommitPlacement.ts
1205
1503
  var insertIntoParent = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip, node) => {
1206
1504
  const parentDom = getParentDom(wip);
1207
- const before = getHostSibling(wip) ?? (wip.return ? getHostSibling(wip.return) : null);
1208
- if (before) parentDom.insertBefore(node, before);
1209
- else parentDom.appendChild(node);
1505
+ let cursor = wip;
1506
+ while (cursor) {
1507
+ const before = getHostSibling(cursor);
1508
+ if (before) {
1509
+ parentDom.insertBefore(node, before);
1510
+ return;
1511
+ }
1512
+ const parent = cursor.return;
1513
+ if (!parent || parent.workTag === HostComponent || parent.workTag === HostRoot) break;
1514
+ cursor = parent;
1515
+ }
1516
+ parentDom.appendChild(node);
1210
1517
  }, "insertIntoParent");
1211
1518
  var placeNode = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip, node) => {
1212
1519
  insertIntoParent(wip, node);
1213
1520
  precacheFiberNode(wip, node);
1214
1521
  attachRef(wip);
1215
1522
  }, "placeNode");
1216
- var commitMutation = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((childFiber) => {
1217
- switch (childFiber.workTag) {
1218
- case HostComponent:
1219
- commitMutationHostComponent(childFiber);
1220
- break;
1221
- case HostText:
1222
- commitMutationHostText(childFiber);
1223
- break;
1224
- }
1225
- }, "commitMutation");
1523
+
1524
+ // ../rectify-reconciler/src/RectifyFiberCommitMutation.ts
1226
1525
  var commitMutationHostComponent = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
1227
1526
  if (!wip.stateNode) {
1228
1527
  const node = createDomElementFromFiber(wip);
@@ -1273,7 +1572,22 @@ var commitMutationHostText = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((wip) => {
1273
1572
  removeFlagFromFiber(wip, UpdateFlag);
1274
1573
  }
1275
1574
  }, "commitMutationHostText");
1575
+ var commitMutation = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
1576
+ switch (fiber.workTag) {
1577
+ case HostComponent:
1578
+ commitMutationHostComponent(fiber);
1579
+ break;
1580
+ case HostText:
1581
+ commitMutationHostText(fiber);
1582
+ break;
1583
+ }
1584
+ }, "commitMutation");
1585
+
1586
+ // ../rectify-reconciler/src/RectifyFiberCommitRemoval.ts
1276
1587
  var removeHostTree = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
1588
+ if (fiber.workTag === ClassComponent) {
1589
+ fiber.classInstance?.componentWillUnmount?.();
1590
+ }
1277
1591
  if (fiber.memoizedState) {
1278
1592
  runEffectCleanups(fiber);
1279
1593
  }
@@ -1289,96 +1603,48 @@ var removeHostTree = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
1289
1603
  }
1290
1604
  }, "removeHostTree");
1291
1605
 
1292
- // ../rectify-reconciler/src/RectifyFiberConcurrentUpdate.ts
1293
- var instance3 = {
1294
- head: null,
1295
- tail: null
1296
- };
1297
- var enqueueUpdate = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((update) => {
1298
- update.next = null;
1299
- if (instance3.tail === null) {
1300
- instance3.head = update;
1301
- instance3.tail = update;
1302
- return;
1303
- }
1304
- instance3.tail.next = update;
1305
- instance3.tail = update;
1306
- }, "enqueueUpdate");
1307
- var dequeueUpdate = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
1308
- const first = instance3.head;
1309
- if (first === null) {
1310
- return null;
1311
- }
1312
- instance3.head = first.next;
1313
- if (instance3.head === null) {
1314
- instance3.tail = null;
1606
+ // ../rectify-reconciler/src/RectifyFiberCommitWork.ts
1607
+ var MutationMask = PlacementFlag | UpdateFlag | MoveFlag | RefFlag;
1608
+ var commitWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((finishedWork) => {
1609
+ if (finishedWork.deletions?.length) {
1610
+ finishedWork.deletions.forEach(removeHostTree);
1611
+ finishedWork.deletions = null;
1315
1612
  }
1316
- first.next = null;
1317
- return first;
1318
- }, "dequeueUpdate");
1319
- var hasUpdate = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => instance3.head !== null, "hasUpdate");
1320
-
1321
- // ../rectify-reconciler/src/RectifyFiberReconciler.ts
1322
- injectEventPriorityCallbacks(
1323
- setCurrentEventPriority,
1324
- resetCurrentEventPriority
1325
- );
1326
- var isFlushingLayoutEffects = false;
1327
- var performWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((lanes) => {
1328
- const fiberRoot = getScheduledFiberRoot();
1329
- if (!fiberRoot) return;
1330
- if (!getResumeCursor()) flushPendingUpdates();
1331
- setCurrentRenderingLanes(lanes);
1332
- const completed = workLoopOnFiberLanes(fiberRoot.root, lanes);
1333
- if (!completed) {
1334
- scheduleRenderLane(lanes);
1335
- return;
1613
+ if (finishedWork.flags & MutationMask) {
1614
+ commitMutation(finishedWork);
1615
+ finishedWork.memoizedProps = finishedWork.pendingProps;
1336
1616
  }
1337
- clearResumeCursor();
1338
- commitWork(fiberRoot.root);
1339
- markContainerAsRoot(fiberRoot.root, fiberRoot.containerDom);
1340
- flushLayoutPhase(fiberRoot);
1341
- schedulePassiveEffects();
1342
- }, "performWork");
1343
- setWorkCallback(performWork);
1344
- var onScheduleRerender = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
1345
- const lane = isFlushingLayoutEffects ? SyncLane : requestUpdateLane();
1346
- enqueueUpdate({ lanes: lane, fiber, next: null });
1347
- if (!isFlushingLayoutEffects) {
1348
- scheduleRenderLane(lane);
1617
+ if (finishedWork.subtreeFlags & MutationMask) {
1618
+ let child = finishedWork.child;
1619
+ while (child) {
1620
+ commitWork(child);
1621
+ child = child.sibling;
1622
+ }
1349
1623
  }
1350
- }, "onScheduleRerender");
1351
- var onMarkFiberDirty = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
1352
- const lane = getCurrentLanePriority();
1353
- fiber.lanes |= lane;
1354
- const wip = fiber.alternate;
1355
- if (!wip) return;
1356
- wip.lanes |= lane;
1357
- let parent = wip.return;
1358
- while (parent) {
1359
- if ((parent.childLanes & lane) === lane) break;
1360
- parent.childLanes |= lane;
1361
- parent = parent.return;
1624
+ if (finishedWork.workTag === ClassComponent && finishedWork.classInstance) {
1625
+ const instance4 = finishedWork.classInstance;
1626
+ const isMount = finishedWork.alternate === null;
1627
+ if (isMount) {
1628
+ instance4.componentDidMount?.();
1629
+ } else if (instance4._prevState !== void 0) {
1630
+ instance4.componentDidUpdate?.(
1631
+ instance4._prevProps,
1632
+ instance4._prevState
1633
+ );
1634
+ instance4._prevProps = void 0;
1635
+ instance4._prevState = void 0;
1636
+ }
1362
1637
  }
1363
- }, "onMarkFiberDirty");
1364
- setScheduleRerender(onScheduleRerender);
1365
- setMarkFiberDirty(onMarkFiberDirty);
1366
- var createContainer = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((container) => {
1367
- return createHostRootFiber(container);
1368
- }, "createContainer");
1369
- var updateContainer = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((children, fiberRoot) => {
1370
- fiberRoot.children = children;
1371
- setScheduledFiberRoot(fiberRoot);
1372
- const wipRoot = createWorkInProgress(fiberRoot.root, { children });
1373
- setCurrentRenderingLanes(SyncLane);
1374
- workLoop(wipRoot);
1375
- commitWork(wipRoot);
1376
- fiberRoot.root = wipRoot;
1377
- markContainerAsRoot(wipRoot, fiberRoot.containerDom);
1378
- setScheduledFiberRoot(fiberRoot);
1379
- flushLayoutPhase(fiberRoot);
1380
- schedulePassiveEffects();
1381
- }, "updateContainer");
1638
+ finishedWork.flags = NoFlags;
1639
+ finishedWork.subtreeFlags = NoFlags;
1640
+ }, "commitWork");
1641
+
1642
+ // ../rectify-reconciler/src/RectifyFiberFlushPhase.ts
1643
+ var _isFlushingLayoutEffects = false;
1644
+ var getIsFlushingLayoutEffects = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => _isFlushingLayoutEffects, "getIsFlushingLayoutEffects");
1645
+ var setIsFlushingLayoutEffects = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((value) => {
1646
+ _isFlushingLayoutEffects = value;
1647
+ }, "setIsFlushingLayoutEffects");
1382
1648
  var passiveChannel = new MessageChannel();
1383
1649
  var schedulePassiveEffects = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
1384
1650
  passiveChannel.port1.onmessage = () => {
@@ -1389,10 +1655,10 @@ var schedulePassiveEffects = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(() => {
1389
1655
  }, "schedulePassiveEffects");
1390
1656
  var flushLayoutPhase = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiberRoot) => {
1391
1657
  while (true) {
1392
- isFlushingLayoutEffects = true;
1658
+ setIsFlushingLayoutEffects(true);
1393
1659
  flushLayoutEffectCleanups();
1394
1660
  flushLayoutEffects();
1395
- isFlushingLayoutEffects = false;
1661
+ setIsFlushingLayoutEffects(false);
1396
1662
  if (!hasUpdate()) break;
1397
1663
  flushPendingUpdates();
1398
1664
  setCurrentRenderingLanes(SyncLane);
@@ -1423,6 +1689,71 @@ var propagateLaneToAncestors = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((updateQ
1423
1689
  }
1424
1690
  }, "propagateLaneToAncestors");
1425
1691
 
1692
+ // ../rectify-reconciler/src/RectifyFiberHookBridge.ts
1693
+ var onScheduleRerender = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
1694
+ const lane = getIsFlushingLayoutEffects() ? SyncLane : requestUpdateLane();
1695
+ enqueueUpdate({ lanes: lane, fiber, next: null });
1696
+ if (!getIsFlushingLayoutEffects()) {
1697
+ scheduleRenderLane(lane);
1698
+ }
1699
+ }, "onScheduleRerender");
1700
+ var onMarkFiberDirty = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((fiber) => {
1701
+ const lane = getCurrentLanePriority();
1702
+ fiber.lanes |= lane;
1703
+ const wip = fiber.alternate;
1704
+ if (!wip) return;
1705
+ wip.lanes |= lane;
1706
+ let parent = wip.return;
1707
+ while (parent) {
1708
+ if ((parent.childLanes & lane) === lane) break;
1709
+ parent.childLanes |= lane;
1710
+ parent = parent.return;
1711
+ }
1712
+ }, "onMarkFiberDirty");
1713
+ setScheduleRerender(onScheduleRerender);
1714
+ setMarkFiberDirty(onMarkFiberDirty);
1715
+
1716
+ // ../rectify-reconciler/src/RectifyFiberBootstrap.ts
1717
+ injectEventPriorityCallbacks(
1718
+ setCurrentEventPriority,
1719
+ resetCurrentEventPriority
1720
+ );
1721
+ var performWork = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((lanes) => {
1722
+ const fiberRoot = getScheduledFiberRoot();
1723
+ if (!fiberRoot) return;
1724
+ if (!getResumeCursor()) flushPendingUpdates();
1725
+ setCurrentRenderingLanes(lanes);
1726
+ const completed = workLoopOnFiberLanes(fiberRoot.root, lanes);
1727
+ if (!completed) {
1728
+ scheduleRenderLane(lanes);
1729
+ return;
1730
+ }
1731
+ clearResumeCursor();
1732
+ commitWork(fiberRoot.root);
1733
+ markContainerAsRoot(fiberRoot.root, fiberRoot.containerDom);
1734
+ flushLayoutPhase(fiberRoot);
1735
+ schedulePassiveEffects();
1736
+ }, "performWork");
1737
+ setWorkCallback(performWork);
1738
+
1739
+ // ../rectify-reconciler/src/RectifyFiberReconciler.ts
1740
+ var createContainer = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((container) => {
1741
+ return createHostRootFiber(container);
1742
+ }, "createContainer");
1743
+ var updateContainer = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((children, fiberRoot) => {
1744
+ fiberRoot.children = children;
1745
+ setScheduledFiberRoot(fiberRoot);
1746
+ const wipRoot = createWorkInProgress(fiberRoot.root, { children });
1747
+ setCurrentRenderingLanes(SyncLane);
1748
+ workLoop(wipRoot);
1749
+ commitWork(wipRoot);
1750
+ fiberRoot.root = wipRoot;
1751
+ markContainerAsRoot(wipRoot, fiberRoot.containerDom);
1752
+ setScheduledFiberRoot(fiberRoot);
1753
+ flushLayoutPhase(fiberRoot);
1754
+ schedulePassiveEffects();
1755
+ }, "updateContainer");
1756
+
1426
1757
  // ../rectify-dom/src/RectifyDomRoot.ts
1427
1758
  var createRoot = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((container) => {
1428
1759
  const hostRoot = createContainer(container);
@@ -1439,15 +1770,80 @@ var createRoot = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((container) => {
1439
1770
  }, "createRoot");
1440
1771
 
1441
1772
  // src/RectifyMemo.ts
1442
- function memo(Component, compare) {
1773
+ function memo(Component2, compare) {
1443
1774
  const wrapper = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name(((_props) => null), "wrapper");
1444
1775
  wrapper._isMemo = true;
1445
- wrapper._render = Component;
1776
+ wrapper._render = Component2;
1446
1777
  wrapper._compare = compare ?? null;
1447
1778
  return wrapper;
1448
1779
  }
1449
1780
  chunkAJJIEZ7G_cjs.__name(memo, "memo");
1450
1781
 
1782
+ // src/RectifyLazy.ts
1783
+ var lazy = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((factory) => {
1784
+ const stub = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((() => null), "stub");
1785
+ return Object.assign(stub, {
1786
+ _isLazy: true,
1787
+ _status: "uninitialized",
1788
+ _result: null,
1789
+ _promise: null,
1790
+ _factory: factory
1791
+ });
1792
+ }, "lazy");
1793
+
1794
+ // src/RectifySuspense.ts
1795
+ var Suspense = /* @__PURE__ */ chunkAJJIEZ7G_cjs.__name((_props) => null, "Suspense");
1796
+ Suspense._isSuspense = true;
1797
+
1798
+ // src/RectifyComponent.ts
1799
+ var _Component = class _Component {
1800
+ constructor(props) {
1801
+ this.state = {};
1802
+ /**
1803
+ * @internal Set by the reconciler when the instance is created so
1804
+ * `setState` can enqueue a re-render on the correct fiber.
1805
+ */
1806
+ this._fiber = null;
1807
+ /**
1808
+ * @internal Snapshots taken by the reconciler in beginWork before each
1809
+ * update render so that `componentDidUpdate` receives the correct prev values.
1810
+ * Cleared after `componentDidUpdate` is called.
1811
+ */
1812
+ this._prevProps = void 0;
1813
+ this._prevState = void 0;
1814
+ /**
1815
+ * @internal Queue of pending setState updates, flushed by the reconciler
1816
+ * during beginWork so that prevState snapshots can be taken first.
1817
+ */
1818
+ this._pendingStateQueue = [];
1819
+ this.props = props;
1820
+ }
1821
+ // ---------------------------------------------------------------------------
1822
+ // Core API
1823
+ // ---------------------------------------------------------------------------
1824
+ /**
1825
+ * Merges `partialState` into the current state and schedules a re-render.
1826
+ * Accepts either a plain partial state object or an updater function.
1827
+ */
1828
+ setState(partialState) {
1829
+ this._pendingStateQueue.push(partialState);
1830
+ if (this._fiber) {
1831
+ scheduleRerender(this._fiber);
1832
+ }
1833
+ }
1834
+ /**
1835
+ * Must be implemented by every class component.
1836
+ * Returns the subtree to render.
1837
+ */
1838
+ render() {
1839
+ return null;
1840
+ }
1841
+ };
1842
+ chunkAJJIEZ7G_cjs.__name(_Component, "Component");
1843
+ /** Marks this as a class component for the reconciler. */
1844
+ _Component._isClassComponent = true;
1845
+ var Component = _Component;
1846
+
1451
1847
  Object.defineProperty(exports, "Fragment", {
1452
1848
  enumerable: true,
1453
1849
  get: function () { return chunkAJJIEZ7G_cjs.Fragment; }
@@ -1456,13 +1852,17 @@ Object.defineProperty(exports, "jsx", {
1456
1852
  enumerable: true,
1457
1853
  get: function () { return chunkAJJIEZ7G_cjs.jsx; }
1458
1854
  });
1855
+ exports.Component = Component;
1856
+ exports.Suspense = Suspense;
1459
1857
  exports.SyntheticEvent = SyntheticEvent_default;
1460
1858
  exports.createContext = createContext;
1461
1859
  exports.createRoot = createRoot;
1860
+ exports.lazy = lazy;
1462
1861
  exports.memo = memo;
1463
1862
  exports.useCallback = RectifyHookUseCallback_default;
1464
1863
  exports.useContext = useContext;
1465
1864
  exports.useEffect = RectifyHookUseEffect_default;
1865
+ exports.useId = RectifyHookUseId_default;
1466
1866
  exports.useLayoutEffect = RectifyHookUseLayoutEffect_default;
1467
1867
  exports.useMemo = RectifyHookUseMemo_default;
1468
1868
  exports.useReducer = RectifyHookUseReducer_default;