unframer 2.6.1 → 2.6.2

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/src/framer.js CHANGED
@@ -1,4 +1,4 @@
1
- // https :https://app.framerstatic.com/chunk-DUHOOT7P.js
1
+ // https :https://app.framerstatic.com/chunk-VBDYROES.js
2
2
  import { createContext, } from 'react';
3
3
  import { useEffect, useLayoutEffect, } from 'react';
4
4
  import { jsx, jsxs, } from 'react/jsx-runtime';
@@ -141,8 +141,23 @@ var MotionGlobalConfig = {
141
141
  skipAnimations: false,
142
142
  useManualTiming: false,
143
143
  };
144
- var LayoutGroupContext = createContext({},);
145
144
  var SwitchLayoutGroupContext = createContext({},);
145
+ var LayoutGroupContext = createContext({},);
146
+ var noop = (any) => any;
147
+ var warning = noop;
148
+ var invariant = noop;
149
+ if (false) {
150
+ warning = (check, message,) => {
151
+ if (!check && typeof console !== 'undefined') {
152
+ console.warn(message,);
153
+ }
154
+ };
155
+ invariant = (check, message,) => {
156
+ if (!check) {
157
+ throw new Error(message,);
158
+ }
159
+ };
160
+ }
146
161
  var LazyContext = createContext({
147
162
  strict: false,
148
163
  },);
@@ -298,7 +313,11 @@ var {
298
313
  schedule: microtask,
299
314
  cancel: cancelMicrotask,
300
315
  } = createRenderBatcher(queueMicrotask, false,);
301
- function useVisualElement(Component33, visualState, props, createVisualElement2,) {
316
+ function isRefObject(ref,) {
317
+ return ref && typeof ref === 'object' && Object.prototype.hasOwnProperty.call(ref, 'current',);
318
+ }
319
+ var scheduleHandoffComplete = false;
320
+ function useVisualElement(Component33, visualState, props, createVisualElement2, ProjectionNodeConstructor,) {
302
321
  const {
303
322
  visualElement: parent,
304
323
  } = useContext3(MotionContext,);
@@ -318,12 +337,20 @@ function useVisualElement(Component33, visualState, props, createVisualElement2,
318
337
  },);
319
338
  }
320
339
  const visualElement = visualElementRef.current;
340
+ const initialLayoutGroupConfig = useContext3(SwitchLayoutGroupContext,);
341
+ if (
342
+ visualElement && !visualElement.projection && ProjectionNodeConstructor &&
343
+ (visualElement.type === 'html' || visualElement.type === 'svg')
344
+ ) {
345
+ createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig,);
346
+ }
321
347
  useInsertionEffect(() => {
322
348
  visualElement && visualElement.update(props, presenceContext,);
323
349
  },);
324
350
  const wantsHandoff = useRef(Boolean(props[optimizedAppearDataAttribute] && !window.HandoffComplete,),);
325
351
  useIsomorphicLayoutEffect(() => {
326
352
  if (!visualElement) return;
353
+ visualElement.updateFeatures();
327
354
  microtask.render(visualElement.render,);
328
355
  if (wantsHandoff.current && visualElement.animationState) {
329
356
  visualElement.animationState.animateChanges();
@@ -331,25 +358,66 @@ function useVisualElement(Component33, visualState, props, createVisualElement2,
331
358
  },);
332
359
  useEffect(() => {
333
360
  if (!visualElement) return;
334
- visualElement.updateFeatures();
335
361
  if (!wantsHandoff.current && visualElement.animationState) {
336
362
  visualElement.animationState.animateChanges();
337
363
  }
338
364
  if (wantsHandoff.current) {
339
365
  wantsHandoff.current = false;
340
- window.HandoffComplete = true;
366
+ if (!scheduleHandoffComplete) {
367
+ scheduleHandoffComplete = true;
368
+ queueMicrotask(completeHandoff,);
369
+ }
341
370
  }
342
371
  },);
343
372
  return visualElement;
344
373
  }
345
- function isRefObject(ref,) {
346
- return ref && typeof ref === 'object' && Object.prototype.hasOwnProperty.call(ref, 'current',);
374
+ function completeHandoff() {
375
+ window.HandoffComplete = true;
376
+ }
377
+ function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig,) {
378
+ const {
379
+ layoutId,
380
+ layout: layout2,
381
+ drag: drag2,
382
+ dragConstraints,
383
+ layoutScroll,
384
+ layoutRoot,
385
+ } = props;
386
+ visualElement.projection = new ProjectionNodeConstructor(
387
+ visualElement.latestValues,
388
+ props['data-framer-portal-id'] ? void 0 : getClosestProjectingNode(visualElement.parent,),
389
+ );
390
+ visualElement.projection.setOptions({
391
+ layoutId,
392
+ layout: layout2,
393
+ alwaysMeasureLayout: Boolean(drag2,) || dragConstraints && isRefObject(dragConstraints,),
394
+ visualElement,
395
+ scheduleRender: () => visualElement.scheduleRender(),
396
+ /**
397
+ * TODO: Update options in an effect. This could be tricky as it'll be too late
398
+ * to update by the time layout animations run.
399
+ * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
400
+ * ensuring it gets called if there's no potential layout animations.
401
+ */
402
+ animationType: typeof layout2 === 'string' ? layout2 : 'both',
403
+ initialPromotionConfig,
404
+ layoutScroll,
405
+ layoutRoot,
406
+ },);
407
+ }
408
+ function getClosestProjectingNode(visualElement,) {
409
+ if (!visualElement) return void 0;
410
+ return visualElement.options.allowProjection !== false ? visualElement.projection : getClosestProjectingNode(visualElement.parent,);
347
411
  }
348
412
  function useMotionRef(visualState, visualElement, externalRef,) {
349
413
  return useCallback((instance) => {
350
414
  instance && visualState.mount && visualState.mount(instance,);
351
415
  if (visualElement) {
352
- instance ? visualElement.mount(instance,) : visualElement.unmount();
416
+ if (instance) {
417
+ visualElement.mount(instance,);
418
+ } else {
419
+ visualElement.unmount();
420
+ }
353
421
  }
354
422
  if (externalRef) {
355
423
  if (typeof externalRef === 'function') {
@@ -452,18 +520,16 @@ function createMotionComponent({
452
520
  const context = useCreateMotionContext(props,);
453
521
  const visualState = useVisualState2(props, isStatic,);
454
522
  if (!isStatic && isBrowser) {
455
- context.visualElement = useVisualElement(Component33, visualState, configAndProps, createVisualElement2,);
456
- const initialLayoutGroupConfig = useContext3(SwitchLayoutGroupContext,);
457
- const isStrict = useContext3(LazyContext,).strict;
458
- if (context.visualElement) {
459
- MeasureLayout2 = context.visualElement.loadFeatures(
460
- // Note: Pass the full new combined props to correctly re-render dynamic feature components.
461
- configAndProps,
462
- isStrict,
463
- preloadedFeatures2,
464
- initialLayoutGroupConfig,
465
- );
466
- }
523
+ useStrictMode(configAndProps, preloadedFeatures2,);
524
+ const layoutProjection = getProjectionFunctionality(configAndProps,);
525
+ MeasureLayout2 = layoutProjection.MeasureLayout;
526
+ context.visualElement = useVisualElement(
527
+ Component33,
528
+ visualState,
529
+ configAndProps,
530
+ createVisualElement2,
531
+ layoutProjection.ProjectionNode,
532
+ );
467
533
  }
468
534
  return jsxs(MotionContext.Provider, {
469
535
  value: context,
@@ -495,6 +561,33 @@ function useLayoutId({
495
561
  const layoutGroupId = useContext3(LayoutGroupContext,).id;
496
562
  return layoutGroupId && layoutId !== void 0 ? layoutGroupId + '-' + layoutId : layoutId;
497
563
  }
564
+ function useStrictMode(configAndProps, preloadedFeatures2,) {
565
+ const isStrict = useContext3(LazyContext,).strict;
566
+ if (false) {
567
+ const strictMessage =
568
+ 'You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.';
569
+ configAndProps.ignoreStrict ? warning(false, strictMessage,) : invariant(false, strictMessage,);
570
+ }
571
+ }
572
+ function getProjectionFunctionality(props,) {
573
+ const {
574
+ drag: drag2,
575
+ layout: layout2,
576
+ } = featureDefinitions;
577
+ if (!drag2 && !layout2) return {};
578
+ const combined = {
579
+ ...drag2,
580
+ ...layout2,
581
+ };
582
+ return {
583
+ MeasureLayout:
584
+ (drag2 === null || drag2 === void 0 ? void 0 : drag2.isEnabled(props,)) ||
585
+ (layout2 === null || layout2 === void 0 ? void 0 : layout2.isEnabled(props,))
586
+ ? combined.MeasureLayout
587
+ : void 0,
588
+ ProjectionNode: combined.ProjectionNode,
589
+ };
590
+ }
498
591
  var scaleCorrectors = {};
499
592
  function addScaleCorrector(correctors,) {
500
593
  Object.assign(scaleCorrectors, correctors,);
@@ -568,6 +661,9 @@ var singleColorRegex =
568
661
  function isString(v,) {
569
662
  return typeof v === 'string';
570
663
  }
664
+ function isNullish(v,) {
665
+ return v == null;
666
+ }
571
667
  var createUnitType = (unit) => ({
572
668
  test: (v) => isString(v,) && v.endsWith(unit,) && v.split(' ',).length === 1,
573
669
  parse: parseFloat,
@@ -752,7 +848,6 @@ function makeLatestValues(props, context, presenceContext, scrapeMotionValues,)
752
848
  }
753
849
  return values;
754
850
  }
755
- var noop = (any) => any;
756
851
  var {
757
852
  schedule: frame,
758
853
  cancel: cancelFrame,
@@ -830,20 +925,6 @@ function isDragActive() {
830
925
  openGestureLock();
831
926
  return false;
832
927
  }
833
- var warning = noop;
834
- var invariant = noop;
835
- if (false) {
836
- warning = (check, message,) => {
837
- if (!check && typeof console !== 'undefined') {
838
- console.warn(message,);
839
- }
840
- };
841
- invariant = (check, message,) => {
842
- if (!check) {
843
- throw new Error(message,);
844
- }
845
- };
846
- }
847
928
  var number = {
848
929
  test: (v) => typeof v === 'number',
849
930
  parse: parseFloat,
@@ -859,7 +940,8 @@ var scale = {
859
940
  };
860
941
  var isColorString = (type, testProp,) => (v) => {
861
942
  return Boolean(
862
- isString(v,) && singleColorRegex.test(v,) && v.startsWith(type,) || testProp && Object.prototype.hasOwnProperty.call(v, testProp,),
943
+ isString(v,) && singleColorRegex.test(v,) && v.startsWith(type,) ||
944
+ testProp && !isNullish(v,) && Object.prototype.hasOwnProperty.call(v, testProp,),
863
945
  );
864
946
  };
865
947
  var splitColor = (aName, bName, cName,) => (v) => {
@@ -3018,7 +3100,7 @@ var MotionValue = class {
3018
3100
  * @internal
3019
3101
  */
3020
3102
  constructor(init, options = {},) {
3021
- this.version = '11.2.10';
3103
+ this.version = '11.2.13';
3022
3104
  this.canTrackVelocity = null;
3023
3105
  this.events = {};
3024
3106
  this.updateAndNotify = (v, render = true,) => {
@@ -3678,7 +3760,7 @@ function animateList(visualElement,) {
3678
3760
  }
3679
3761
  function createAnimationState(visualElement,) {
3680
3762
  let animate22 = animateList(visualElement,);
3681
- const state = createState();
3763
+ let state = createState();
3682
3764
  let isInitialRender = true;
3683
3765
  const buildResolvedTypeValues = (type) => (acc, definition,) => {
3684
3766
  var _a;
@@ -3842,6 +3924,10 @@ function createAnimationState(visualElement,) {
3842
3924
  setActive,
3843
3925
  setAnimateFunction,
3844
3926
  getState: () => state,
3927
+ reset: () => {
3928
+ state = createState();
3929
+ isInitialRender = true;
3930
+ },
3845
3931
  };
3846
3932
  }
3847
3933
  function checkVariantsDidChange(prev, next,) {
@@ -3892,9 +3978,8 @@ var AnimationFeature = class extends Feature {
3892
3978
  const {
3893
3979
  animate: animate22,
3894
3980
  } = this.node.getProps();
3895
- this.unmount();
3896
3981
  if (isAnimationControls(animate22,)) {
3897
- this.unmount = animate22.subscribe(this.node,);
3982
+ this.unmountControls = animate22.subscribe(this.node,);
3898
3983
  }
3899
3984
  }
3900
3985
  /**
@@ -3914,7 +3999,11 @@ var AnimationFeature = class extends Feature {
3914
3999
  this.updateAnimationControlsSubscription();
3915
4000
  }
3916
4001
  }
3917
- unmount() {}
4002
+ unmount() {
4003
+ var _a;
4004
+ this.node.animationState.reset();
4005
+ (_a = this.unmountControls) === null || _a === void 0 ? void 0 : _a.call(this,);
4006
+ }
3918
4007
  };
3919
4008
  var id = 0;
3920
4009
  var ExitAnimationFeature = class extends Feature {
@@ -4101,8 +4190,8 @@ function updateMotionValuesFromProps(element, next, prev,) {
4101
4190
  }
4102
4191
  if (false) {
4103
4192
  warnOnce(
4104
- nextValue.version === '11.2.10',
4105
- `Attempting to mix Framer Motion versions ${nextValue.version} with 11.2.10 may not work as expected.`,
4193
+ nextValue.version === '11.2.13',
4194
+ `Attempting to mix Framer Motion versions ${nextValue.version} with 11.2.13 may not work as expected.`,
4106
4195
  );
4107
4196
  }
4108
4197
  } else if (isMotionValue(prevValue,)) {
@@ -4141,8 +4230,6 @@ function updateMotionValuesFromProps(element, next, prev,) {
4141
4230
  }
4142
4231
  var valueTypes = [...dimensionValueTypes, color, complex,];
4143
4232
  var findValueType = (v) => valueTypes.find(testValueType(v,),);
4144
- var featureNames = Object.keys(featureDefinitions,);
4145
- var numFeatures = featureNames.length;
4146
4233
  var propEventHandlers = [
4147
4234
  'AnimationStart',
4148
4235
  'AnimationComplete',
@@ -4153,10 +4240,6 @@ var propEventHandlers = [
4153
4240
  'LayoutAnimationComplete',
4154
4241
  ];
4155
4242
  var numVariantProps = variantProps.length;
4156
- function getClosestProjectingNode(visualElement,) {
4157
- if (!visualElement) return void 0;
4158
- return visualElement.options.allowProjection !== false ? visualElement.projection : getClosestProjectingNode(visualElement.parent,);
4159
- }
4160
4243
  var VisualElement = class {
4161
4244
  /**
4162
4245
  * This method takes React props and returns found MotionValues. For example, HTML
@@ -4264,7 +4347,6 @@ var VisualElement = class {
4264
4347
  this.update(this.props, this.presenceContext,);
4265
4348
  }
4266
4349
  unmount() {
4267
- var _a;
4268
4350
  visualElementStore.delete(this.current,);
4269
4351
  this.projection && this.projection.unmount();
4270
4352
  cancelFrame(this.notifyUpdate,);
@@ -4276,7 +4358,11 @@ var VisualElement = class {
4276
4358
  this.events[key7].clear();
4277
4359
  }
4278
4360
  for (const key7 in this.features) {
4279
- (_a = this.features[key7]) === null || _a === void 0 ? void 0 : _a.unmount();
4361
+ const feature = this.features[key7];
4362
+ if (feature) {
4363
+ feature.unmount();
4364
+ feature.isMounted = false;
4365
+ }
4280
4366
  }
4281
4367
  this.current = null;
4282
4368
  }
@@ -4302,83 +4388,28 @@ var VisualElement = class {
4302
4388
  }
4303
4389
  return this.sortInstanceNodePosition(this.current, other.current,);
4304
4390
  }
4305
- loadFeatures(
4306
- {
4307
- children,
4308
- ...renderedProps
4309
- },
4310
- isStrict,
4311
- preloadedFeatures2,
4312
- initialLayoutGroupConfig,
4313
- ) {
4314
- let ProjectionNodeConstructor;
4315
- let MeasureLayout2;
4316
- if (false) {
4317
- const strictMessage =
4318
- 'You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.';
4319
- renderedProps.ignoreStrict ? warning(false, strictMessage,) : invariant(false, strictMessage,);
4320
- }
4321
- for (let i = 0; i < numFeatures; i++) {
4322
- const name = featureNames[i];
4391
+ updateFeatures() {
4392
+ let key7 = 'animation';
4393
+ for (key7 in featureDefinitions) {
4394
+ const featureDefinition = featureDefinitions[key7];
4395
+ if (!featureDefinition) continue;
4323
4396
  const {
4324
4397
  isEnabled,
4325
4398
  Feature: FeatureConstructor,
4326
- ProjectionNode,
4327
- MeasureLayout: MeasureLayoutComponent,
4328
- } = featureDefinitions[name];
4329
- if (ProjectionNode) ProjectionNodeConstructor = ProjectionNode;
4330
- if (isEnabled(renderedProps,)) {
4331
- if (!this.features[name] && FeatureConstructor) {
4332
- this.features[name] = new FeatureConstructor(this,);
4333
- }
4334
- if (MeasureLayoutComponent) {
4335
- MeasureLayout2 = MeasureLayoutComponent;
4399
+ } = featureDefinition;
4400
+ if (!this.features[key7] && FeatureConstructor && isEnabled(this.props,)) {
4401
+ this.features[key7] = new FeatureConstructor(this,);
4402
+ }
4403
+ if (this.features[key7]) {
4404
+ const feature = this.features[key7];
4405
+ if (feature.isMounted) {
4406
+ feature.update();
4407
+ } else {
4408
+ feature.mount();
4409
+ feature.isMounted = true;
4336
4410
  }
4337
4411
  }
4338
4412
  }
4339
- if ((this.type === 'html' || this.type === 'svg') && !this.projection && ProjectionNodeConstructor) {
4340
- const {
4341
- layoutId,
4342
- layout: layout2,
4343
- drag: drag2,
4344
- dragConstraints,
4345
- layoutScroll,
4346
- layoutRoot,
4347
- } = renderedProps;
4348
- this.projection = new ProjectionNodeConstructor(
4349
- this.latestValues,
4350
- renderedProps['data-framer-portal-id'] ? void 0 : getClosestProjectingNode(this.parent,),
4351
- );
4352
- this.projection.setOptions({
4353
- layoutId,
4354
- layout: layout2,
4355
- alwaysMeasureLayout: Boolean(drag2,) || dragConstraints && isRefObject(dragConstraints,),
4356
- visualElement: this,
4357
- scheduleRender: () => this.scheduleRender(),
4358
- /**
4359
- * TODO: Update options in an effect. This could be tricky as it'll be too late
4360
- * to update by the time layout animations run.
4361
- * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
4362
- * ensuring it gets called if there's no potential layout animations.
4363
- */
4364
- animationType: typeof layout2 === 'string' ? layout2 : 'both',
4365
- initialPromotionConfig: initialLayoutGroupConfig,
4366
- layoutScroll,
4367
- layoutRoot,
4368
- },);
4369
- }
4370
- return MeasureLayout2;
4371
- }
4372
- updateFeatures() {
4373
- for (const key7 in this.features) {
4374
- const feature = this.features[key7];
4375
- if (feature.isMounted) {
4376
- feature.update();
4377
- } else {
4378
- feature.mount();
4379
- feature.isMounted = true;
4380
- }
4381
- }
4382
4413
  }
4383
4414
  triggerBuild() {
4384
4415
  this.build(this.renderState, this.latestValues, this.options, this.props,);
@@ -6127,7 +6158,7 @@ var VisualElementDragControls = class {
6127
6158
  const {
6128
6159
  dragConstraints,
6129
6160
  } = this.getProps();
6130
- if (isRefObject(dragConstraints,)) {
6161
+ if (isRefObject(dragConstraints,) && dragConstraints.current) {
6131
6162
  this.constraints = this.resolveRefConstraints();
6132
6163
  }
6133
6164
  };
@@ -6139,7 +6170,7 @@ var VisualElementDragControls = class {
6139
6170
  projection.root && projection.root.updateScroll();
6140
6171
  projection.updateLayout();
6141
6172
  }
6142
- measureDragConstraints();
6173
+ frame.read(measureDragConstraints,);
6143
6174
  const stopResizeListener = addDomEvent(window, 'resize', () => this.scalePositionWithinConstraints(),);
6144
6175
  const stopLayoutUpdateListener = projection.addEventListener('didUpdate', ({
6145
6176
  delta,
@@ -6717,7 +6748,7 @@ function isOptimisedAppearTree(projectionNode,) {
6717
6748
  return false;
6718
6749
  }
6719
6750
  }
6720
- function createProjectionNode({
6751
+ function createProjectionNode2({
6721
6752
  attachResizeListener,
6722
6753
  defaultParent,
6723
6754
  measureScroll,
@@ -6750,6 +6781,7 @@ function createProjectionNode({
6750
6781
  this.eventHandlers = /* @__PURE__ */ new Map();
6751
6782
  this.hasTreeAnimated = false;
6752
6783
  this.updateScheduled = false;
6784
+ this.scheduleUpdate = () => this.update();
6753
6785
  this.projectionUpdateScheduled = false;
6754
6786
  this.checkUpdateFailed = () => {
6755
6787
  if (this.isUpdating) {
@@ -6973,7 +7005,7 @@ function createProjectionNode({
6973
7005
  didUpdate() {
6974
7006
  if (!this.updateScheduled) {
6975
7007
  this.updateScheduled = true;
6976
- microtask.read(() => this.update());
7008
+ microtask.read(this.scheduleUpdate,);
6977
7009
  }
6978
7010
  }
6979
7011
  clearAllSnapshots() {
@@ -7041,7 +7073,7 @@ function createProjectionNode({
7041
7073
  }
7042
7074
  resetTransform() {
7043
7075
  if (!resetTransform) return;
7044
- const isResetRequested = this.isLayoutDirty || this.shouldResetTransform;
7076
+ const isResetRequested = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout;
7045
7077
  const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta,);
7046
7078
  const transformTemplate2 = this.getTransformTemplate();
7047
7079
  const transformTemplateValue = transformTemplate2 ? transformTemplate2(this.latestValues, '',) : void 0;
@@ -7800,7 +7832,7 @@ function shouldAnimatePositionOnly(animationType, snapshot, layout2,) {
7800
7832
  return animationType === 'position' ||
7801
7833
  animationType === 'preserve-aspect' && !isNear(aspectRatio(snapshot,), aspectRatio(layout2,), 0.2,);
7802
7834
  }
7803
- var DocumentProjectionNode = createProjectionNode({
7835
+ var DocumentProjectionNode = createProjectionNode2({
7804
7836
  attachResizeListener: (ref, notify2,) => addDomEvent(ref, 'resize', notify2,),
7805
7837
  measureScroll: () => ({
7806
7838
  x: document.documentElement.scrollLeft || document.body.scrollLeft,
@@ -7811,7 +7843,7 @@ var DocumentProjectionNode = createProjectionNode({
7811
7843
  var rootProjectionNode = {
7812
7844
  current: void 0,
7813
7845
  };
7814
- var HTMLProjectionNode = createProjectionNode({
7846
+ var HTMLProjectionNode = createProjectionNode2({
7815
7847
  measureScroll: (instance) => ({
7816
7848
  x: instance.scrollLeft,
7817
7849
  y: instance.scrollTop,
@@ -9996,7 +10028,7 @@ var cancelSync = stepsOrder.reduce((acc, key7,) => {
9996
10028
  return acc;
9997
10029
  }, {},);
9998
10030
 
9999
- // https :https://app.framerstatic.com/framer.K4XHQ4DX.js
10031
+ // https :https://app.framerstatic.com/framer.E3XQPBSV.js
10000
10032
 
10001
10033
  import React4 from 'react';
10002
10034
  import { startTransition as startTransition2, } from 'react';
@@ -10644,16 +10676,16 @@ var require_browser = __commonJS({
10644
10676
  process5.argv = [];
10645
10677
  process5.version = '';
10646
10678
  process5.versions = {};
10647
- function noop2() {}
10648
- process5.on = noop2;
10649
- process5.addListener = noop2;
10650
- process5.once = noop2;
10651
- process5.off = noop2;
10652
- process5.removeListener = noop2;
10653
- process5.removeAllListeners = noop2;
10654
- process5.emit = noop2;
10655
- process5.prependListener = noop2;
10656
- process5.prependOnceListener = noop2;
10679
+ function noop3() {}
10680
+ process5.on = noop3;
10681
+ process5.addListener = noop3;
10682
+ process5.once = noop3;
10683
+ process5.off = noop3;
10684
+ process5.removeListener = noop3;
10685
+ process5.removeAllListeners = noop3;
10686
+ process5.emit = noop3;
10687
+ process5.prependListener = noop3;
10688
+ process5.prependOnceListener = noop3;
10657
10689
  process5.listeners = function (name,) {
10658
10690
  return [];
10659
10691
  };
@@ -11938,23 +11970,42 @@ function getRouteElementId(route, hash2,) {
11938
11970
  return void 0;
11939
11971
  }
11940
11972
  function isBot(userAgent,) {
11941
- return /bot|Mediapartners-Google|Google-PageRenderer|yandex|ia_archiver/iu.test(userAgent,);
11973
+ return /bot|-google|google-|yandex|ia_archiver/iu.test(userAgent,);
11942
11974
  }
11943
- function yieldToMain(isHighPriority,) {
11975
+ function yieldToMain(options,) {
11944
11976
  if ('scheduler' in window) {
11945
- const options = {
11946
- priority: isHighPriority ? 'user-blocking' : 'user-visible',
11947
- };
11948
11977
  if ('yield' in scheduler) return scheduler.yield(options,);
11949
11978
  if ('postTask' in scheduler) return scheduler.postTask(() => {}, options,);
11950
11979
  }
11951
- if (isHighPriority) {
11980
+ if ((options === null || options === void 0 ? void 0 : options.priority) === 'user-blocking') {
11952
11981
  return Promise.resolve();
11953
11982
  }
11954
11983
  return new Promise((resolve) => {
11955
- setTimeout(resolve, 0,);
11984
+ setTimeout(resolve,);
11985
+ },);
11986
+ }
11987
+ async function yieldBefore(fn, options,) {
11988
+ await yieldToMain(options,);
11989
+ return fn();
11990
+ }
11991
+ function interactionResponse(options, fallback = true,) {
11992
+ return new Promise((resolve) => {
11993
+ if (fallback) setTimeout(resolve, 100,);
11994
+ requestAnimationFrame(() => {
11995
+ void yieldBefore(resolve, options,);
11996
+ },);
11956
11997
  },);
11957
11998
  }
11999
+ function useAfterPaintEffect(fn, deps, options,) {
12000
+ useLayoutEffect(() => {
12001
+ const runAfterPaint = async () => {
12002
+ await interactionResponse(options, false,);
12003
+ fn();
12004
+ };
12005
+ void runAfterPaint();
12006
+ }, deps,);
12007
+ }
12008
+ var noop2 = () => {};
11958
12009
  async function replacePathVariables(path, currentLocale, nextLocale, defaultLocale, collectionId, pathVariables, collectionUtils,) {
11959
12010
  var _a, _b, _c;
11960
12011
  let resultPath = path;
@@ -12394,23 +12445,46 @@ function createViewTransitionStylesheet({
12394
12445
  document.head.appendChild(styleElement,);
12395
12446
  }
12396
12447
  function removeViewTransitionStylesheet() {
12397
- frame.render(() => {
12398
- const element = document.getElementById(VIEW_TRANSITION_STYLES_ID,);
12399
- if (element) {
12400
- document.head.removeChild(element,);
12401
- }
12448
+ requestIdleCallback(() => {
12449
+ frame.render(() => {
12450
+ performance.mark('framer-vt-remove',);
12451
+ const element = document.getElementById(VIEW_TRANSITION_STYLES_ID,);
12452
+ if (element) {
12453
+ document.head.removeChild(element,);
12454
+ }
12455
+ },);
12402
12456
  },);
12403
12457
  }
12404
12458
  function supportsViewTransitions() {
12405
12459
  return Boolean(document.startViewTransition,);
12406
12460
  }
12407
- function startViewTransition(updateView, effect,) {
12461
+ function addVTStylesheetAfterInRender(effect,) {
12462
+ return new Promise((resolve) => {
12463
+ frame.render(() => {
12464
+ performance.mark('framer-vt-style',);
12465
+ createViewTransitionStylesheet(effect,);
12466
+ resolve();
12467
+ },);
12468
+ },);
12469
+ }
12470
+ async function startViewTransition(updateView, effect, signal,) {
12408
12471
  if (!supportsViewTransitions()) {
12409
- return void updateView();
12472
+ void updateView();
12473
+ return;
12410
12474
  }
12411
- createViewTransitionStylesheet(effect,);
12412
- const transition = document.startViewTransition(updateView,);
12413
- Promise.all([transition.ready, transition.finished,],).then(removeViewTransitionStylesheet,).catch(() => {},);
12475
+ await addVTStylesheetAfterInRender(effect,);
12476
+ if (signal === null || signal === void 0 ? void 0 : signal.aborted) return;
12477
+ performance.mark('framer-vt',);
12478
+ const transition = document.startViewTransition(() => {
12479
+ performance.mark('framer-vt-freeze',);
12480
+ if (signal === null || signal === void 0 ? void 0 : signal.aborted) return;
12481
+ else signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', () => transition.skipTransition(),);
12482
+ void updateView();
12483
+ },);
12484
+ Promise.all([transition.ready, transition.finished,],).then(() => {
12485
+ performance.mark('framer-vt-unfreeze',);
12486
+ removeViewTransitionStylesheet();
12487
+ },).catch(() => {},);
12414
12488
  return transition;
12415
12489
  }
12416
12490
  function useViewTransition() {
@@ -12422,7 +12496,7 @@ function useViewTransition() {
12422
12496
  resolveHasPainted.current = void 0;
12423
12497
  }
12424
12498
  },);
12425
- return useCallback((currentRouteId, nextRouteId, update,) => {
12499
+ return useCallback((currentRouteId, nextRouteId, update, yieldBeforeFreezePeriod, signal,) => {
12426
12500
  const pageEffect = getPageEffectForRoute(currentRouteId, nextRouteId, sitePageEffects,);
12427
12501
  if (pageEffect) {
12428
12502
  const hasPainted = new Promise((resolve) => {
@@ -12432,20 +12506,34 @@ function useViewTransition() {
12432
12506
  update();
12433
12507
  await hasPainted;
12434
12508
  };
12509
+ const yieldBeforeViewTransition = async () => {
12510
+ await interactionResponse({
12511
+ priority: 'user-blocking',
12512
+ signal,
12513
+ }, false,).catch(noop2,);
12514
+ return startViewTransition(asyncUpdate, pageEffect, signal,);
12515
+ };
12516
+ if (yieldBeforeFreezePeriod) return yieldBeforeViewTransition();
12435
12517
  return startViewTransition(asyncUpdate, pageEffect,);
12436
12518
  } else {
12437
12519
  return update();
12438
12520
  }
12439
12521
  }, [sitePageEffects,],);
12440
12522
  }
12441
- function pushRouteState(routeId, route, {
12442
- currentRoutePath,
12443
- currentPathVariables,
12444
- hash: hash2,
12445
- pathVariables,
12446
- localeId,
12447
- preserveQueryParams,
12448
- },) {
12523
+ async function pushRouteState(
12524
+ routeId,
12525
+ route,
12526
+ {
12527
+ currentRoutePath,
12528
+ currentPathVariables,
12529
+ hash: hash2,
12530
+ pathVariables,
12531
+ localeId,
12532
+ preserveQueryParams,
12533
+ },
12534
+ enableAsyncURLUpdate = false,
12535
+ ignorePushStateWrapper = false,
12536
+ ) {
12449
12537
  const {
12450
12538
  path,
12451
12539
  } = route;
@@ -12458,12 +12546,18 @@ function pushRouteState(routeId, route, {
12458
12546
  pathVariables,
12459
12547
  preserveQueryParams,
12460
12548
  },);
12461
- pushHistoryState({
12462
- routeId,
12463
- hash: hash2,
12464
- pathVariables,
12465
- localeId,
12466
- }, newPath,);
12549
+ const urlUpdatePromise = pushHistoryState(
12550
+ {
12551
+ routeId,
12552
+ hash: hash2,
12553
+ pathVariables,
12554
+ localeId,
12555
+ },
12556
+ newPath,
12557
+ enableAsyncURLUpdate,
12558
+ ignorePushStateWrapper,
12559
+ );
12560
+ if (!enableAsyncURLUpdate) await urlUpdatePromise;
12467
12561
  } catch {}
12468
12562
  }
12469
12563
  function isHistoryState(data2,) {
@@ -12471,6 +12565,7 @@ function isHistoryState(data2,) {
12471
12565
  return isObject(data2,) && isString2(data2[routeIdKey],);
12472
12566
  }
12473
12567
  function replaceHistoryState(data2, url,) {
12568
+ performance.mark('framer-history-replace',);
12474
12569
  window.history.replaceState(
12475
12570
  data2,
12476
12571
  // Second arg is unused and exists for historical purposes only
@@ -12479,8 +12574,16 @@ function replaceHistoryState(data2, url,) {
12479
12574
  url,
12480
12575
  );
12481
12576
  }
12482
- function pushHistoryState(data2, url,) {
12483
- window.history.pushState(
12577
+ async function pushHistoryState(data2, url, awaitPaintBeforeUpdate = false, ignorePushStateWrapper = false,) {
12578
+ if (awaitPaintBeforeUpdate) {
12579
+ await interactionResponse({
12580
+ priority: 'user-blocking',
12581
+ },);
12582
+ }
12583
+ performance.mark('framer-history-push',);
12584
+ const pushState = ignorePushStateWrapper ? window.history.__proto__.pushState : window.history.pushState;
12585
+ pushState.call(
12586
+ window.history,
12484
12587
  data2,
12485
12588
  // Second arg is unused and exists for historical purposes only
12486
12589
  // https://developer.mozilla.org/en-US/docs/Web/API/History/pushState#unused
@@ -12494,8 +12597,9 @@ function useReplaceInitialState({
12494
12597
  initialPathVariables,
12495
12598
  initialLocaleId,
12496
12599
  },) {
12497
- React4.useLayoutEffect(() => {
12600
+ useLayoutEffect(() => {
12498
12601
  if (disabled) return;
12602
+ performance.mark('framer-history-set-initial-state',);
12499
12603
  replaceHistoryState({
12500
12604
  routeId,
12501
12605
  pathVariables: initialPathVariables,
@@ -12505,8 +12609,8 @@ function useReplaceInitialState({
12505
12609
  }
12506
12610
  function usePopStateHandler(currentRouteId, setCurrentRouteId,) {
12507
12611
  const startViewTransition2 = useViewTransition();
12508
- const viewTransitionReady = React4.useRef(void 0,);
12509
- const popStateHandler = React4.useCallback(({
12612
+ const viewTransitionReady = useRef(void 0,);
12613
+ const popStateHandler = useCallback(async ({
12510
12614
  state,
12511
12615
  },) => {
12512
12616
  var _a, _b, _c;
@@ -12528,7 +12632,7 @@ function usePopStateHandler(currentRouteId, setCurrentRouteId,) {
12528
12632
  true,
12529
12633
  );
12530
12634
  };
12531
- const transition = startViewTransition2(currentRouteId.current, routeId, changeRoute,);
12635
+ const transition = await startViewTransition2(currentRouteId.current, routeId, changeRoute, false,);
12532
12636
  if (transition) {
12533
12637
  void transition.updateCallbackDone.then((_a = viewTransitionReady.current) === null || _a === void 0 ? void 0 : _a.resolve,).catch(
12534
12638
  (_b = viewTransitionReady.current) === null || _b === void 0 ? void 0 : _b.reject,
@@ -12551,7 +12655,7 @@ function usePopStateHandler(currentRouteId, setCurrentRouteId,) {
12551
12655
  scroll: 'after-transition',
12552
12656
  },);
12553
12657
  }, [],);
12554
- React4.useEffect(() => {
12658
+ useEffect(() => {
12555
12659
  var _a;
12556
12660
  window.addEventListener('popstate', popStateHandler,);
12557
12661
  (_a = window.navigation) === null || _a === void 0 ? void 0 : _a.addEventListener('navigate', traversalHandler,);
@@ -12624,21 +12728,15 @@ async function switchLocale(options,) {
12624
12728
  if (!result) return;
12625
12729
  try {
12626
12730
  localStorage.setItem('preferredLocale', options.nextLocale.code,);
12627
- } catch (error) {}
12731
+ } catch {}
12628
12732
  try {
12629
- if (typeof result.path !== 'string') {
12733
+ if (!isString2(result.path,)) {
12630
12734
  throw new Error('Expected result.path to be a string',);
12631
12735
  }
12632
12736
  if (result.isMissingInLocale) {
12633
12737
  const hasRedirect = await handleRedirectForMissingSlugs(options.route, result.pathVariables, options.nextLocale,);
12634
12738
  if (hasRedirect) return;
12635
12739
  }
12636
- pushHistoryState({
12637
- routeId: options.routeId,
12638
- pathVariables: result.pathVariables,
12639
- localeId: options.nextLocale.id,
12640
- paginationInfo: window.history.state.paginationInfo,
12641
- }, result.path,);
12642
12740
  } catch {}
12643
12741
  return result;
12644
12742
  }
@@ -12656,14 +12754,193 @@ function pushLoadMoreHistory(hash2, paginationInfo,) {
12656
12754
  },);
12657
12755
  } catch {}
12658
12756
  }
12659
- function isSamePage(a, b,) {
12660
- if (a.routeId !== b.routeId) return false;
12661
- if (a.pathVariables === b.pathVariables) return true;
12662
- const aPathVariables = a.pathVariables || {};
12663
- const bPathVariables = b.pathVariables || {};
12664
- return aPathVariables.length === bPathVariables.length &&
12665
- Object.keys(aPathVariables,).every((key7) => aPathVariables[key7] === bPathVariables[key7]);
12757
+ function useNativeLoadingSpinner() {
12758
+ const navigationPromise = useRef(Promise.resolve(),);
12759
+ const navigationController = useRef();
12760
+ const navigateListener = useCallback((navigateEvent) => {
12761
+ if (
12762
+ // we want to intercept non-user triggered replaceState and pushState while the navigation is on-going
12763
+ // but we don't want to intercept e.g. 'traverse' (= browser back/forward) events, as we do this in the usePopStateHandler listener.
12764
+ navigateEvent.userInitiated
12765
+ ) return;
12766
+ const controller = navigationController.current;
12767
+ controller === null || controller === void 0 ? void 0 : controller.signal.addEventListener('abort', () => {
12768
+ controller.abort('user aborted',);
12769
+ },);
12770
+ navigateEvent.intercept({
12771
+ handler: () => navigationPromise.current,
12772
+ },);
12773
+ }, [],);
12774
+ return useCallback((promise, updateURL, controller,) => {
12775
+ if (!window.navigation) {
12776
+ void updateURL();
12777
+ return;
12778
+ }
12779
+ navigationPromise.current = promise;
12780
+ navigationController.current = controller;
12781
+ window.navigation.addEventListener('navigate', navigateListener,);
12782
+ void updateURL(true,);
12783
+ promise.catch(noop2,).finally(() => {
12784
+ window.navigation.removeEventListener('navigate', navigateListener,);
12785
+ },);
12786
+ }, [navigateListener,],);
12666
12787
  }
12788
+ function measureSafe(name, start, end,) {
12789
+ try {
12790
+ performance.measure(name, start, end,);
12791
+ } catch (e) {
12792
+ console.warn(`Could not measure ${name}`, e,);
12793
+ }
12794
+ }
12795
+ var shouldMark = false;
12796
+ function markHydrationStart() {
12797
+ shouldMark = true;
12798
+ performance.mark('framer-hydration-start',);
12799
+ }
12800
+ var routerHydrationInsertionEffectStartHasRun = false;
12801
+ var routerHydrationLayoutEffectStartHasRun = false;
12802
+ var routerHydrationEffectStartHasRun = false;
12803
+ function useMarkRouterEffects() {
12804
+ const hydrationMarkPrefix = 'framer-hydration-router';
12805
+ useInsertionEffect(() => {
12806
+ if (routerHydrationInsertionEffectStartHasRun || !shouldMark) return;
12807
+ routerHydrationInsertionEffectStartHasRun = true;
12808
+ performance.mark(`${hydrationMarkPrefix}-insertion-effect`,);
12809
+ }, [],);
12810
+ useLayoutEffect(() => {
12811
+ if (routerHydrationLayoutEffectStartHasRun || !shouldMark) return;
12812
+ routerHydrationLayoutEffectStartHasRun = true;
12813
+ performance.mark(`${hydrationMarkPrefix}-layout-effect`,);
12814
+ }, [],);
12815
+ useEffect(() => {
12816
+ if (routerHydrationEffectStartHasRun || !shouldMark) return;
12817
+ routerHydrationEffectStartHasRun = true;
12818
+ performance.mark(`${hydrationMarkPrefix}-effect`,);
12819
+ }, [],);
12820
+ }
12821
+ var hydrationInsertionEffectStartHasRun = false;
12822
+ var hydrationLayoutEffectStartHasRun = false;
12823
+ var hydrationEffectStartHasRun = false;
12824
+ function useMarkSuspenseEffectsStart() {
12825
+ const hydrationMarkPrefix = 'framer-hydration-';
12826
+ const hydrationLayoutEffectsEnd = `${hydrationMarkPrefix}layout-effects-end`;
12827
+ const hydrationEffectsEnd = `${hydrationMarkPrefix}effects-end`;
12828
+ const hydrationBrowserRenderStart = `${hydrationMarkPrefix}browser-render-start`;
12829
+ const hydrationRenderEnd = `${hydrationMarkPrefix}render-end`;
12830
+ useInsertionEffect(() => {
12831
+ if (hydrationInsertionEffectStartHasRun || !shouldMark) return;
12832
+ hydrationInsertionEffectStartHasRun = true;
12833
+ performance.mark(hydrationRenderEnd,);
12834
+ measureSafe(`${hydrationMarkPrefix}render`, `${hydrationMarkPrefix}start`, hydrationRenderEnd,);
12835
+ performance.mark(`${hydrationMarkPrefix}insertion-effects-start`,);
12836
+ }, [],);
12837
+ useLayoutEffect(() => {
12838
+ if (hydrationLayoutEffectStartHasRun || !shouldMark) return;
12839
+ hydrationLayoutEffectStartHasRun = true;
12840
+ performance.mark(`${hydrationMarkPrefix}layout-effects-start`,);
12841
+ requestAnimationFrame(() => {
12842
+ var _a, _b, _c;
12843
+ performance.mark(hydrationBrowserRenderStart,);
12844
+ measureSafe(
12845
+ `${hydrationMarkPrefix}uho`,
12846
+ (_b = (_a = performance.getEntriesByName(hydrationEffectsEnd,)[0]) === null || _a === void 0 ? void 0 : _a.name) !== null &&
12847
+ _b !== void 0
12848
+ ? _b
12849
+ : (_c = performance.getEntriesByName(hydrationLayoutEffectsEnd,)[0]) === null || _c === void 0
12850
+ ? void 0
12851
+ : _c.name,
12852
+ hydrationBrowserRenderStart,
12853
+ );
12854
+ },);
12855
+ }, [],);
12856
+ useEffect(() => {
12857
+ var _a;
12858
+ if (hydrationEffectStartHasRun || !shouldMark) return;
12859
+ hydrationEffectStartHasRun = true;
12860
+ const hydrationEffectsStart = `${hydrationMarkPrefix}effects-start`;
12861
+ performance.mark(hydrationEffectsStart,);
12862
+ const hasPaintStarted = (_a = performance.getEntriesByName(hydrationBrowserRenderStart,)[0]) === null || _a === void 0
12863
+ ? void 0
12864
+ : _a.name;
12865
+ if (!hasPaintStarted) {
12866
+ measureSafe(`${hydrationMarkPrefix}commit`, hydrationLayoutEffectsEnd, hydrationEffectsStart,);
12867
+ performance.mark(`${hydrationMarkPrefix}effects-sync`,);
12868
+ }
12869
+ }, [],);
12870
+ return null;
12871
+ }
12872
+ var hydrationInsertionEffectHasRun = false;
12873
+ var hydrationLayoutEffectHasRun = false;
12874
+ var hydrationEffectHasRun = false;
12875
+ var hydrationPaintEffectHasRun = false;
12876
+ function useMarkSuspenseEffectEnd() {
12877
+ const hydrationMarkPrefix = 'framer-hydration-';
12878
+ const hydrationLayoutEffectsEnd = `${hydrationMarkPrefix}layout-effects-end`;
12879
+ const hydrationEffectsEnd = `${hydrationMarkPrefix}effects-end`;
12880
+ const hydrationBrowserRenderStart = `${hydrationMarkPrefix}browser-render-start`;
12881
+ const hydrationStart = `${hydrationMarkPrefix}start`;
12882
+ const hydrationInsertionEffectsEnd = `${hydrationMarkPrefix}insertion-effects-end`;
12883
+ const hydrationFP = `${hydrationMarkPrefix}first-paint`;
12884
+ const hydrationAnimationFrameEnd = `${hydrationMarkPrefix}browser-raf-end`;
12885
+ useInsertionEffect(() => {
12886
+ if (hydrationInsertionEffectHasRun || !shouldMark) return;
12887
+ hydrationInsertionEffectHasRun = true;
12888
+ performance.mark(hydrationInsertionEffectsEnd,);
12889
+ measureSafe(`${hydrationMarkPrefix}insertion-effects`, `${hydrationMarkPrefix}insertion-effects-start`, hydrationInsertionEffectsEnd,);
12890
+ }, [],);
12891
+ useLayoutEffect(() => {
12892
+ if (hydrationLayoutEffectHasRun || !shouldMark) return;
12893
+ hydrationLayoutEffectHasRun = true;
12894
+ performance.mark(hydrationLayoutEffectsEnd,);
12895
+ measureSafe(`${hydrationMarkPrefix}layout-effects`, `${hydrationMarkPrefix}layout-effects-start`, hydrationLayoutEffectsEnd,);
12896
+ requestAnimationFrame(() => {
12897
+ performance.mark(hydrationAnimationFrameEnd,);
12898
+ measureSafe(`${hydrationMarkPrefix}raf`, hydrationBrowserRenderStart, hydrationAnimationFrameEnd,);
12899
+ },);
12900
+ }, [],);
12901
+ useEffect(() => {
12902
+ var _a, _b, _c;
12903
+ if (hydrationEffectHasRun || !shouldMark) return;
12904
+ hydrationEffectHasRun = true;
12905
+ performance.mark(hydrationEffectsEnd,);
12906
+ measureSafe(
12907
+ `${hydrationMarkPrefix}effects`,
12908
+ (_b = (_a = performance.getEntriesByName(hydrationFP,)[0]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0
12909
+ ? _b
12910
+ : (_c = performance.getEntriesByName(`${hydrationMarkPrefix}effects-start`,)[0]) === null || _c === void 0
12911
+ ? void 0
12912
+ : _c.name,
12913
+ hydrationEffectsEnd,
12914
+ );
12915
+ }, [],);
12916
+ useAfterPaintEffect(
12917
+ () => {
12918
+ if (hydrationPaintEffectHasRun || !shouldMark) return;
12919
+ hydrationPaintEffectHasRun = true;
12920
+ performance.mark(hydrationFP,);
12921
+ measureSafe(`${hydrationMarkPrefix}time-to-first-paint`, hydrationStart, hydrationFP,);
12922
+ measureSafe(`${hydrationMarkPrefix}browser-render`, hydrationAnimationFrameEnd, hydrationFP,);
12923
+ },
12924
+ [],
12925
+ // user-blocking ensures we get the correct timings here. Other priorites might delay this effect a little bit.
12926
+ {
12927
+ priority: 'user-blocking',
12928
+ },
12929
+ );
12930
+ return null;
12931
+ }
12932
+ function MarkSuspenseEffectsStart() {
12933
+ useMarkSuspenseEffectsStart();
12934
+ return null;
12935
+ }
12936
+ function MarkSuspenseEffectsEnd() {
12937
+ useMarkSuspenseEffectEnd();
12938
+ return null;
12939
+ }
12940
+ var MarkSuspenseEffects = {
12941
+ Start: MarkSuspenseEffectsStart,
12942
+ End: MarkSuspenseEffectsEnd,
12943
+ };
12667
12944
  var eventsToStop = [
12668
12945
  'mousedown',
12669
12946
  'mouseup',
@@ -12702,109 +12979,43 @@ var stopFn = (event) => {
12702
12979
  event.stopPropagation();
12703
12980
  performance.mark('framer-react-event-handling-prevented',);
12704
12981
  };
12705
- if (typeof window !== 'undefined') {
12706
- window.__FRAMER_TURN_OFF_REACT_EVENT_HANDLING__ = function () {
12707
- if (!eventsToStop) return;
12708
- const options = {
12709
- capture: true,
12710
- };
12711
- eventsToStop.forEach((event) => document.body.addEventListener(event, stopFn, options,));
12712
- window.__FRAMER_TURN_OFF_REACT_EVENT_HANDLING__ = void 0;
12713
- };
12714
- }
12715
- function turnOnReactEventHandling() {
12982
+ var shouldTurnOnEventHandling = false;
12983
+ function turnOffReactEventHandling() {
12716
12984
  if (!eventsToStop) return;
12985
+ shouldTurnOnEventHandling = true;
12986
+ performance.mark('framer-react-event-handling-start',);
12717
12987
  const options = {
12718
12988
  capture: true,
12719
12989
  };
12720
- eventsToStop.forEach((event) => document.body.removeEventListener(event, stopFn, options,));
12721
- eventsToStop = void 0;
12990
+ eventsToStop.forEach((event) => document.body.addEventListener(event, stopFn, options,));
12722
12991
  }
12723
- function measureSafe(name, start, end,) {
12724
- try {
12725
- performance.measure(name, start, end,);
12726
- } catch (e) {
12727
- console.warn(`Could not measure ${name}`, e,);
12728
- }
12729
- }
12730
- var hydrationEffectHasRun = false;
12731
- var hydrationInsertionEffectHasRun = false;
12732
- var hydrationLayoutEffectHasRun = false;
12733
- function OnHydrationEnd({
12734
- addHydrationMarkers,
12735
- turnOffEventHandlerHack,
12736
- },) {
12737
- const hydrationMarkPrefix = 'framer-hydration-';
12738
- const hydrationStart = `${hydrationMarkPrefix}start`;
12739
- const hydrationRenderEnd = `${hydrationMarkPrefix}render-end`;
12740
- const hydrationLayoutEffectsEnd = `${hydrationMarkPrefix}layout-effects-end`;
12741
- const hydrationEffectsEnd = `${hydrationMarkPrefix}effects-end`;
12742
- const hydrationFP = `${hydrationMarkPrefix}first-paint`;
12743
- useInsertionEffect(() => {
12744
- if (hydrationInsertionEffectHasRun) return;
12745
- hydrationInsertionEffectHasRun = true;
12746
- if (addHydrationMarkers) {
12747
- performance.mark(hydrationRenderEnd,);
12748
- measureSafe(`${hydrationMarkPrefix}render`, hydrationStart, hydrationRenderEnd,);
12749
- }
12750
- }, [],);
12751
- useLayoutEffect(() => {
12752
- if (hydrationLayoutEffectHasRun) return;
12753
- hydrationLayoutEffectHasRun = true;
12754
- if (addHydrationMarkers) {
12755
- performance.mark(hydrationLayoutEffectsEnd,);
12756
- measureSafe(`${hydrationMarkPrefix}layout-effects`, hydrationRenderEnd, hydrationLayoutEffectsEnd,);
12757
- }
12758
- requestAnimationFrame(() => {
12759
- var _a, _b, _c;
12760
- const browserRenderStart = `${hydrationMarkPrefix}browser-render-start`;
12761
- if (addHydrationMarkers) {
12762
- performance.mark(browserRenderStart,);
12763
- measureSafe(
12764
- `${hydrationMarkPrefix}uho`,
12765
- (_b = (_a = performance.getEntriesByName(hydrationEffectsEnd,)[0]) === null || _a === void 0 ? void 0 : _a.name) !== null &&
12766
- _b !== void 0
12767
- ? _b
12768
- : (_c = performance.getEntriesByName(hydrationLayoutEffectsEnd,)[0]) === null || _c === void 0
12769
- ? void 0
12770
- : _c.name,
12771
- browserRenderStart,
12772
- );
12773
- }
12774
- setTimeout(() => {
12775
- if (turnOffEventHandlerHack) {
12776
- turnOnReactEventHandling();
12777
- }
12778
- if (addHydrationMarkers) {
12779
- performance.mark(hydrationFP,);
12780
- measureSafe(`${hydrationMarkPrefix}time-to-first-paint`, hydrationStart, hydrationFP,);
12781
- measureSafe(`${hydrationMarkPrefix}browser-render`, browserRenderStart, hydrationFP,);
12782
- }
12783
- }, 0,);
12784
- },);
12785
- }, [],);
12786
- useEffect(() => {
12787
- var _a, _b, _c;
12788
- if (hydrationEffectHasRun) return;
12789
- hydrationEffectHasRun = true;
12790
- if (turnOffEventHandlerHack) {
12791
- turnOnReactEventHandling();
12792
- }
12793
- if (addHydrationMarkers) {
12794
- performance.mark(hydrationEffectsEnd,);
12795
- measureSafe(
12796
- `${hydrationMarkPrefix}effects`,
12797
- (_b = (_a = performance.getEntriesByName(hydrationFP,)[0]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0
12798
- ? _b
12799
- : (_c = performance.getEntriesByName(hydrationLayoutEffectsEnd,)[0]) === null || _c === void 0
12800
- ? void 0
12801
- : _c.name,
12802
- hydrationEffectsEnd,
12803
- );
12804
- }
12805
- }, [],);
12992
+ function TurnOnReactEventHandling() {
12993
+ useAfterPaintEffect(
12994
+ () => {
12995
+ if (!shouldTurnOnEventHandling || !eventsToStop) return;
12996
+ const options = {
12997
+ capture: true,
12998
+ };
12999
+ eventsToStop.forEach((event) => document.body.removeEventListener(event, stopFn, options,));
13000
+ eventsToStop = void 0;
13001
+ performance.mark('framer-react-event-handling-end',);
13002
+ },
13003
+ [],
13004
+ // user-blocking ensures this runs right after the paint, so users can interact asap.
13005
+ {
13006
+ priority: 'user-blocking',
13007
+ },
13008
+ );
12806
13009
  return null;
12807
13010
  }
13011
+ function isSamePage(a, b,) {
13012
+ if (a.routeId !== b.routeId) return false;
13013
+ if (a.pathVariables === b.pathVariables) return true;
13014
+ const aPathVariables = a.pathVariables || {};
13015
+ const bPathVariables = b.pathVariables || {};
13016
+ return aPathVariables.length === bPathVariables.length &&
13017
+ Object.keys(aPathVariables,).every((key7) => aPathVariables[key7] === bPathVariables[key7]);
13018
+ }
12808
13019
  function useGetRouteCallback(routes,) {
12809
13020
  return React4.useCallback((routeId) => routes[routeId], [routes,],);
12810
13021
  }
@@ -12914,25 +13125,34 @@ function useLocaleCode() {
12914
13125
  function useLocale() {
12915
13126
  return useLocaleCode();
12916
13127
  }
12917
- function useMonitorNextRender(label,) {
13128
+ function useMonitorNextPaintAfterRender(label,) {
12918
13129
  const startLabel = `start-${label}`;
12919
13130
  const endLabel = `end-${label}`;
12920
13131
  const resolveHasPainted = useRef(void 0,);
12921
- useEffect(() => {
12922
- if (resolveHasPainted.current) {
12923
- resolveHasPainted.current();
12924
- resolveHasPainted.current = void 0;
12925
- }
12926
- },);
13132
+ useAfterPaintEffect(
13133
+ () => {
13134
+ if (resolveHasPainted.current) {
13135
+ resolveHasPainted.current();
13136
+ resolveHasPainted.current = void 0;
13137
+ }
13138
+ },
13139
+ void 0,
13140
+ // user-blocking ensures we get the correct timings here. Other priorites might delay this effect a little bit.
13141
+ {
13142
+ priority: 'user-blocking',
13143
+ },
13144
+ );
12927
13145
  return useCallback(() => {
12928
13146
  const hasPainted = new Promise((resolve) => {
12929
13147
  resolveHasPainted.current = resolve;
12930
13148
  },);
12931
13149
  performance.mark(startLabel,);
12932
- hasPainted.then(() => {
13150
+ return hasPainted.finally(() => {
12933
13151
  performance.mark(endLabel,);
12934
13152
  performance.measure(label, startLabel, endLabel,);
12935
- },).catch(() => {},);
13153
+ },).catch((e) => {
13154
+ console.error(e,);
13155
+ },);
12936
13156
  }, [label, startLabel, endLabel,],);
12937
13157
  }
12938
13158
  function updateScrollPosition(hash2, smoothScroll, isHistoryTransition,) {
@@ -12945,17 +13165,62 @@ function updateScrollPosition(hash2, smoothScroll, isHistoryTransition,) {
12945
13165
  window.scrollTo(0, 0,);
12946
13166
  }
12947
13167
  function useScheduleRenderSideEffects(dep,) {
12948
- const actions = React4.useRef([],);
12949
- React4.useLayoutEffect(() => {
13168
+ const actions = useRef([],);
13169
+ useLayoutEffect(() => {
12950
13170
  var _a;
12951
13171
  if (!((_a = actions.current) === null || _a === void 0 ? void 0 : _a.length)) return;
12952
13172
  actions.current.forEach((action) => action());
12953
13173
  actions.current = [];
12954
13174
  }, [dep,],);
12955
- return React4.useCallback((cb) => {
13175
+ return useCallback((cb) => {
12956
13176
  actions.current.push(cb,);
12957
13177
  }, [],);
12958
13178
  }
13179
+ function useNavigationTransition(enableAsyncURLUpdates,) {
13180
+ const startNativeSpinner = useNativeLoadingSpinner();
13181
+ const monitorNextPaintAfterRender = useMonitorNextPaintAfterRender('route-change',);
13182
+ const navigationController = useRef(void 0,);
13183
+ return useCallback(async (transitionFn, updateURL, isAbortable = true,) => {
13184
+ var _a;
13185
+ if (!enableAsyncURLUpdates) {
13186
+ await (updateURL === null || updateURL === void 0 ? void 0 : updateURL());
13187
+ transitionFn();
13188
+ void monitorNextPaintAfterRender();
13189
+ return new Promise((resolve) => {
13190
+ resolve();
13191
+ },);
13192
+ }
13193
+ (_a = navigationController.current) === null || _a === void 0 ? void 0 : _a.abort();
13194
+ const controller = isAbortable ? new AbortController() : void 0;
13195
+ navigationController.current = controller;
13196
+ const signal = controller === null || controller === void 0 ? void 0 : controller.signal;
13197
+ const nextRender = monitorNextPaintAfterRender();
13198
+ if (!updateURL) {
13199
+ navigationController.current = void 0;
13200
+ transitionFn(signal,);
13201
+ return nextRender;
13202
+ }
13203
+ transitionFn(signal,);
13204
+ await interactionResponse({
13205
+ priority: 'user-visible',
13206
+ signal,
13207
+ },).catch(noop2,);
13208
+ await interactionResponse({
13209
+ priority: 'user-visible',
13210
+ signal,
13211
+ },).catch(noop2,);
13212
+ let resolveNavigationPromise;
13213
+ const navigationPromise = new Promise((resolve, reject,) => {
13214
+ resolveNavigationPromise = resolve;
13215
+ if (signal === null || signal === void 0 ? void 0 : signal.aborted) reject();
13216
+ else signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', reject,);
13217
+ },);
13218
+ startNativeSpinner(navigationPromise, updateURL, controller,);
13219
+ return nextRender.then(() => {
13220
+ resolveNavigationPromise();
13221
+ },);
13222
+ }, [enableAsyncURLUpdates, monitorNextPaintAfterRender, startNativeSpinner,],);
13223
+ }
12959
13224
  function Router({
12960
13225
  defaultPageStyle,
12961
13226
  disableHistory,
@@ -12967,9 +13232,9 @@ function Router({
12967
13232
  initialLocaleId,
12968
13233
  locales = [],
12969
13234
  preserveQueryParams = false,
12970
- enableImproveInpDuringHydration = false,
12971
- addHydrationMarkers = false,
13235
+ enableAsyncURLUpdates = false,
12972
13236
  },) {
13237
+ useMarkRouterEffects();
12973
13238
  useReplaceInitialState({
12974
13239
  disabled: disableHistory,
12975
13240
  routeId: initialRoute,
@@ -12977,12 +13242,14 @@ function Router({
12977
13242
  initialLocaleId,
12978
13243
  },);
12979
13244
  const startViewTransition2 = useViewTransition();
12980
- const monitorNextRender = useMonitorNextRender('route-change',);
12981
- const currentRouteRef = React4.useRef(initialRoute,);
12982
- const currentPathVariablesRef = React4.useRef(initialPathVariables,);
12983
- const currentLocaleIdRef = React4.useRef(initialLocaleId,);
13245
+ const [dep, forceUpdate,] = useForceUpdate2();
13246
+ const scheduleSideEffect = useScheduleRenderSideEffects(dep,);
13247
+ const startNavigation = useNavigationTransition(enableAsyncURLUpdates,);
13248
+ const currentRouteRef = useRef(initialRoute,);
13249
+ const currentPathVariablesRef = useRef(initialPathVariables,);
13250
+ const currentLocaleIdRef = useRef(initialLocaleId,);
12984
13251
  const currentLocaleId = currentLocaleIdRef.current;
12985
- const activeLocale = React4.useMemo(() => {
13252
+ const activeLocale = useMemo(() => {
12986
13253
  var _a;
12987
13254
  return (_a = locales.find(({
12988
13255
  id: id3,
@@ -12993,8 +13260,7 @@ function Router({
12993
13260
  ? _a
12994
13261
  : null;
12995
13262
  }, [currentLocaleId, locales,],);
12996
- const [dep, forceUpdate,] = useForceUpdate2();
12997
- const localeInfo = React4.useMemo(() => {
13263
+ const localeInfo = useMemo(() => {
12998
13264
  return {
12999
13265
  activeLocale,
13000
13266
  locales,
@@ -13027,30 +13293,65 @@ function Router({
13027
13293
  preserveQueryParams,
13028
13294
  },);
13029
13295
  if (!localeResult) return;
13296
+ const currentPathVariables2 = currentPathVariablesRef.current;
13297
+ const currentStatePaginationInfo = window.history.state.paginationInfo;
13298
+ const currentPath = localeResult.path;
13030
13299
  currentPathVariablesRef.current = localeResult.pathVariables;
13031
13300
  currentLocaleIdRef.current = nextLocale.id;
13032
- startViewTransition2(currentRouteRef.current, currentRouteId2, () => startTransition2(forceUpdate,),);
13033
- monitorNextRender();
13301
+ const updateURL = async (ignorePushStateWrapper = false,) => {
13302
+ if (!currentPath) return;
13303
+ return pushHistoryState(
13304
+ {
13305
+ routeId: currentRouteId2,
13306
+ pathVariables: currentPathVariables2,
13307
+ localeId: nextLocale.id,
13308
+ paginationInfo: currentStatePaginationInfo,
13309
+ },
13310
+ currentPath,
13311
+ // we yield in startNavigation before updating the URL, so yielding again is not needed.
13312
+ false,
13313
+ ignorePushStateWrapper,
13314
+ );
13315
+ };
13316
+ void startNavigation(
13317
+ () => {
13318
+ void startViewTransition2(currentRouteId2, currentRouteId2, () => startTransition2(forceUpdate,), enableAsyncURLUpdates,// no signal here, because we update the refs above immediately
13319
+ );
13320
+ },
13321
+ updateURL,
13322
+ false,
13323
+ );
13034
13324
  } catch {}
13035
13325
  },
13036
13326
  };
13037
- }, [activeLocale, collectionUtils, forceUpdate, locales, monitorNextRender, preserveQueryParams, routes, startViewTransition2,],);
13038
- const scheduleSideEffect = useScheduleRenderSideEffects(dep,);
13039
- const setCurrentRouteId = React4.useCallback(
13040
- (routeId, localeId, hash2, pathVariables, smoothScroll = false, isHistoryTransition = false,) => {
13327
+ }, [
13328
+ activeLocale,
13329
+ collectionUtils,
13330
+ enableAsyncURLUpdates,
13331
+ forceUpdate,
13332
+ locales,
13333
+ preserveQueryParams,
13334
+ routes,
13335
+ startNavigation,
13336
+ startViewTransition2,
13337
+ ],);
13338
+ const setCurrentRouteId = useCallback(
13339
+ (routeId, localeId, hash2, pathVariables, smoothScroll = false, isHistoryTransition = false, updateURL,) => {
13340
+ const currentRouteId2 = currentRouteRef.current;
13041
13341
  currentRouteRef.current = routeId;
13042
13342
  currentPathVariablesRef.current = pathVariables;
13043
13343
  currentLocaleIdRef.current = localeId;
13044
13344
  scheduleSideEffect(() => {
13045
13345
  updateScrollPosition(hash2, smoothScroll, isHistoryTransition,);
13046
13346
  },);
13047
- startTransition2(forceUpdate,);
13048
- monitorNextRender();
13347
+ void startNavigation((signal) => {
13348
+ void startViewTransition2(currentRouteId2, routeId, () => startTransition2(forceUpdate,), enableAsyncURLUpdates, signal,);
13349
+ }, updateURL,);
13049
13350
  },
13050
- [forceUpdate, monitorNextRender, scheduleSideEffect,],
13351
+ [enableAsyncURLUpdates, forceUpdate, scheduleSideEffect, startNavigation, startViewTransition2,],
13051
13352
  );
13052
13353
  usePopStateHandler(currentRouteRef, setCurrentRouteId,);
13053
- const navigate = React4.useCallback((routeId, hash2, pathVariables, smoothScroll,) => {
13354
+ const navigate = useCallback(async (routeId, hash2, pathVariables, smoothScroll,) => {
13054
13355
  var _a, _b;
13055
13356
  const newRoute = routes[routeId];
13056
13357
  if (pathVariables) {
@@ -13066,52 +13367,69 @@ function Router({
13066
13367
  pathVariables = Object.fromEntries(Object.entries(pathVariables,).filter(([key7,],) => inUse.has(key7,)),);
13067
13368
  }
13068
13369
  const routeElementId = getRouteElementId(newRoute, hash2,);
13370
+ const currentPathVariables2 = currentPathVariablesRef.current;
13371
+ const currentRouteLocaleId = currentLocaleIdRef.current;
13069
13372
  if (
13070
13373
  isSamePage({
13071
13374
  routeId: currentRouteRef.current,
13072
- pathVariables: currentPathVariablesRef.current,
13375
+ pathVariables: currentPathVariables2,
13073
13376
  }, {
13074
13377
  routeId,
13075
13378
  pathVariables,
13076
13379
  },)
13077
13380
  ) {
13078
- if (((_b = window.history.state) === null || _b === void 0 ? void 0 : _b.hash) !== hash2) {
13079
- if (!disableHistory) {
13080
- const route = routes[routeId];
13081
- if (route) {
13082
- pushRouteState(routeId, route, {
13083
- currentRoutePath: route.path,
13084
- currentPathVariables: currentPathVariablesRef.current,
13085
- pathVariables,
13086
- hash: hash2,
13087
- localeId: currentLocaleIdRef.current,
13088
- preserveQueryParams,
13089
- },);
13090
- }
13091
- }
13092
- }
13093
13381
  updateScrollPosition(routeElementId, smoothScroll, false,);
13382
+ const route = routes[routeId];
13383
+ if (((_b = window.history.state) === null || _b === void 0 ? void 0 : _b.hash) === hash2 || disableHistory || !route) return;
13384
+ const updateURLPromise = pushRouteState(
13385
+ routeId,
13386
+ route,
13387
+ {
13388
+ currentRoutePath: route.path,
13389
+ currentPathVariables: currentPathVariables2,
13390
+ pathVariables,
13391
+ hash: hash2,
13392
+ localeId: currentRouteLocaleId,
13393
+ preserveQueryParams,
13394
+ },
13395
+ // we want to yield as this is called synchronusly from an user interaction.
13396
+ enableAsyncURLUpdates,
13397
+ );
13398
+ if (!enableAsyncURLUpdates) return await updateURLPromise;
13094
13399
  return;
13095
13400
  }
13096
13401
  if (!newRoute) return;
13097
- if (!disableHistory) {
13098
- const currentRoute = routes[currentRouteRef.current];
13099
- pushRouteState(routeId, newRoute, {
13100
- currentRoutePath: currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.path,
13101
- currentPathVariables: currentPathVariablesRef.current,
13102
- hash: hash2,
13103
- pathVariables,
13104
- localeId: currentLocaleIdRef.current,
13105
- preserveQueryParams,
13106
- },);
13107
- }
13108
- const changeRoute = () => setCurrentRouteId(routeId, currentLocaleIdRef.current, routeElementId, pathVariables, smoothScroll, false,);
13109
- startViewTransition2(currentRouteRef.current, routeId, changeRoute,);
13110
- }, [routes, disableHistory, setCurrentRouteId, startViewTransition2, preserveQueryParams,],);
13402
+ const currentRoute = routes[currentRouteRef.current];
13403
+ const updateURL = async (ignorePushStateWrapper = false,) =>
13404
+ pushRouteState(
13405
+ routeId,
13406
+ newRoute,
13407
+ {
13408
+ currentRoutePath: currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.path,
13409
+ currentPathVariables: currentPathVariables2,
13410
+ hash: hash2,
13411
+ pathVariables,
13412
+ localeId: currentRouteLocaleId,
13413
+ preserveQueryParams,
13414
+ },
13415
+ // we yield in startNavigation before updating the URL, so yielding again is not needed.
13416
+ false,
13417
+ ignorePushStateWrapper,
13418
+ );
13419
+ setCurrentRouteId(
13420
+ routeId,
13421
+ currentRouteLocaleId,
13422
+ routeElementId,
13423
+ pathVariables,
13424
+ smoothScroll,
13425
+ false,
13426
+ disableHistory ? void 0 : updateURL,
13427
+ );
13428
+ }, [routes, setCurrentRouteId, disableHistory, preserveQueryParams, enableAsyncURLUpdates,],);
13111
13429
  const getRoute = useGetRouteCallback(routes,);
13112
13430
  const currentRouteId = currentRouteRef.current;
13113
13431
  const currentPathVariables = currentPathVariablesRef.current;
13114
- const api = React4.useMemo(() => ({
13432
+ const api = useMemo(() => ({
13115
13433
  navigate,
13116
13434
  getRoute,
13117
13435
  currentRouteId,
@@ -13139,16 +13457,17 @@ function Router({
13139
13457
  notFoundPage,
13140
13458
  defaultPageStyle,
13141
13459
  forceUpdateKey: dep,
13142
- children: jsx(React4.Fragment, {
13143
- children: pageExistsInCurrentLocale
13144
- ? renderPage(current.page, defaultPageStyle,)
13145
- : notFoundPage && renderPage(notFoundPage, defaultPageStyle,),
13460
+ children: jsxs(Fragment, {
13461
+ children: [
13462
+ jsx(MarkSuspenseEffects.Start, {},),
13463
+ pageExistsInCurrentLocale
13464
+ ? renderPage(current.page, defaultPageStyle,)
13465
+ : notFoundPage && renderPage(notFoundPage, defaultPageStyle,),
13466
+ ],
13146
13467
  }, remountKey,),
13147
13468
  },),
13148
- jsx(OnHydrationEnd, {
13149
- addHydrationMarkers,
13150
- turnOffEventHandlerHack: enableImproveInpDuringHydration,
13151
- },),
13469
+ jsx(TurnOnReactEventHandling, {},),
13470
+ jsx(MarkSuspenseEffects.End, {},),
13152
13471
  ],
13153
13472
  },),
13154
13473
  },),
@@ -15379,8 +15698,8 @@ var ObjectInterpolation = (valueInterpolation) => {
15379
15698
  difference(from, to,) {
15380
15699
  let sum = 0;
15381
15700
  for (const key7 in from) {
15382
- const difference = valueInterpolation.difference(from[key7], to[key7],);
15383
- sum += Math.pow(difference, 2,);
15701
+ const difference2 = valueInterpolation.difference(from[key7], to[key7],);
15702
+ sum += Math.pow(difference2, 2,);
15384
15703
  }
15385
15704
  return Math.sqrt(sum,);
15386
15705
  },
@@ -18533,6 +18852,7 @@ var richTextCSSRules = [
18533
18852
  h6.framer-text:not(:first-child),
18534
18853
  ol.framer-text:not(:first-child),
18535
18854
  ul.framer-text:not(:first-child),
18855
+ blockquote.framer-text:not(:first-child),
18536
18856
  .framer-image.framer-text:not(:first-child) {
18537
18857
  margin-top: var(--framer-blockquote-paragraph-spacing, var(--framer-paragraph-spacing, 0));
18538
18858
  }
@@ -18570,13 +18890,13 @@ var richTextCSSRules = [
18570
18890
  `
18571
18891
  code.framer-text,
18572
18892
  code.framer-text span.framer-text:not([data-text-fill]) {
18573
- font-family: var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif));
18574
- font-style: var(--framer-code-font-style, var(--framer-font-style, normal));
18575
- font-weight: var(--framer-code-font-weight, var(--framer-font-weight, 400));
18576
- color: var(--framer-code-text-color, var(--framer-text-color, #000));
18577
- font-size: calc(var(--framer-font-size, 16px) * var(--framer-font-size-scale, 1));
18578
- letter-spacing: var(--framer-letter-spacing, 0);
18579
- line-height: var(--framer-line-height, 1.2em);
18893
+ font-family: var(--framer-blockquote-font-family, var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)));
18894
+ font-style: var(--framer-blockquote-font-style, var(--framer-code-font-style, var(--framer-font-style, normal)));
18895
+ font-weight: var(--framer-blockquote-font-weight, var(--framer-code-font-weight, var(--framer-font-weight, 400)));
18896
+ color: var(--framer-blockquote-text-color, var(--framer-code-text-color, var(--framer-text-color, #000)));
18897
+ font-size: calc(var(--framer-blockquote-font-size, var(--framer-font-size, 16px)) * var(--framer-font-size-scale, 1));
18898
+ letter-spacing: var(--framer-blockquote-letter-spacing, var(--framer-letter-spacing, 0));
18899
+ line-height: var(--framer-blockquote-line-height, var(--framer-line-height, 1.2em));
18580
18900
  }
18581
18901
  `, /* css */
18582
18902
  `
@@ -18591,13 +18911,13 @@ var richTextCSSRules = [
18591
18911
  `
18592
18912
  a.framer-text,
18593
18913
  a.framer-text span.framer-text:not([data-text-fill]) {
18594
- font-family: var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif));
18595
- font-style: var(--framer-link-font-style, var(--framer-font-style, normal));
18596
- font-weight: var(--framer-link-font-weight, var(--framer-font-weight, 400));
18597
- color: var(--framer-link-text-color, var(--framer-text-color, #000));
18598
- font-size: calc(var(--framer-link-font-size, var(--framer-font-size, 16px)) * var(--framer-font-size-scale, 1));
18599
- text-transform: var(--framer-link-text-transform, var(--framer-text-transform, none));
18600
- text-decoration: var(--framer-link-text-decoration, var(--framer-text-decoration, none));
18914
+ font-family: var(--framer-blockquote-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)));
18915
+ font-style: var(--framer-blockquote-font-style, var(--framer-link-font-style, var(--framer-font-style, normal)));
18916
+ font-weight: var(--framer-blockquote-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400)));
18917
+ color: var(--framer-blockquote-text-color, var(--framer-link-text-color, var(--framer-text-color, #000)));
18918
+ font-size: calc(var(--framer-blockquote-font-size, var(--framer-font-size, 16px)) * var(--framer-font-size-scale, 1));
18919
+ text-transform: var(--framer-blockquote-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none)));
18920
+ text-decoration: var(--framer-blockquote-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none)));
18601
18921
  /* Cursor inherit to overwrite the user agent stylesheet on rich text links. */
18602
18922
  cursor: var(--framer-custom-cursors, pointer);
18603
18923
  }
@@ -18605,33 +18925,33 @@ var richTextCSSRules = [
18605
18925
  `
18606
18926
  code.framer-text a.framer-text,
18607
18927
  code.framer-text a.framer-text span.framer-text:not([data-text-fill]) {
18608
- font-family: var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif));
18609
- font-style: var(--framer-code-font-style, var(--framer-font-style, normal));
18610
- font-weight: var(--framer-code-font-weight, var(--framer-font-weight, 400));
18611
- color: var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000)));
18612
- font-size: calc(var(--framer-link-font-size, var(--framer-font-size, 16px)) * var(--framer-font-size-scale, 1));
18928
+ font-family: var(--framer-blockquote-font-family, var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)));
18929
+ font-style: var(--framer-blockquote-font-style, var(--framer-code-font-style, var(--framer-font-style, normal)));
18930
+ font-weight: var(--framer-blockquote-font-weight, var(--framer-code-font-weight, var(--framer-font-weight, 400)));
18931
+ color: var(--framer-blockquote-text-color, var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000))));
18932
+ font-size: calc(var(--framer-blockquote-font-size, var(--framer-font-size, 16px)) * var(--framer-font-size-scale, 1));
18613
18933
  }
18614
18934
  `, /* css */
18615
18935
  `
18616
18936
  a.framer-text:hover,
18617
18937
  a.framer-text:hover span.framer-text:not([data-text-fill]) {
18618
- font-family: var(--framer-link-hover-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)));
18619
- font-style: var(--framer-link-hover-font-style, var(--framer-link-font-style, var(--framer-font-style, normal)));
18620
- font-weight: var(--framer-link-hover-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400)));
18621
- color: var(--framer-link-hover-text-color, var(--framer-link-text-color, var(--framer-text-color, #000)));
18622
- font-size: calc(var(--framer-link-hover-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px))) * var(--framer-font-size-scale, 1));
18623
- text-transform: var(--framer-link-hover-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none)));
18624
- text-decoration: var(--framer-link-hover-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none)));
18938
+ font-family: var(--framer-link-hover-font-family, var(--framer-blockquote-font-family, var(--framer-link-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif))));
18939
+ font-style: var(--framer-link-hover-font-style, var(--framer-blockquote-font-style, var(--framer-link-font-style, var(--framer-font-style, normal))));
18940
+ font-weight: var(--framer-link-hover-font-weight, var(--framer-blockquote-font-weight, var(--framer-link-font-weight, var(--framer-font-weight, 400))));
18941
+ color: var(--framer-link-hover-text-color, var(--framer-blockquote-text-color, var(--framer-link-text-color, var(--framer-text-color, #000))));
18942
+ font-size: calc(var(--framer-link-hover-font-size, var(--framer-blockquote-font-size, var(--framer-font-size, 16px))) * var(--framer-font-size-scale, 1));
18943
+ text-transform: var(--framer-link-hover-text-transform, var(--framer-blockquote-text-transform, var(--framer-link-text-transform, var(--framer-text-transform, none))));
18944
+ text-decoration: var(--framer-link-hover-text-decoration, var(--framer-blockquote-text-decoration, var(--framer-link-text-decoration, var(--framer-text-decoration, none))));
18625
18945
  }
18626
18946
  `, /* css */
18627
18947
  `
18628
18948
  code.framer-text a.framer-text:hover,
18629
18949
  code.framer-text a.framer-text:hover span.framer-text:not([data-text-fill]) {
18630
- font-family: var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif));
18631
- font-style: var(--framer-code-font-style, var(--framer-font-style, normal));
18632
- font-weight: var(--framer-code-font-weight, var(--framer-font-weight, 400));
18633
- color: var(--framer-link-hover-text-color, var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000))));
18634
- font-size: calc(var(--framer-link-hover-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px))) * var(--framer-font-size-scale, 1));
18950
+ font-family: var(--framer-blockquote-font-family, var(--framer-code-font-family, var(--framer-font-family, Inter, Inter Placeholder, sans-serif)));
18951
+ font-style: var(--framer-blockquote-font-style, var(--framer-code-font-style, var(--framer-font-style, normal)));
18952
+ font-weight: var(--framer-blockquote-font-weight, var(--framer-code-font-weight, var(--framer-font-weight, 400)));
18953
+ color: var(--framer-link-hover-text-color, var(--framer-blockquote-text-color, var(--framer-link-text-color, var(--framer-code-text-color, var(--framer-text-color, #000)))));
18954
+ font-size: calc(var(--framer-link-hover-font-size, var(--framer-blockquote-font-size, var(--framer-link-font-size, var(--framer-font-size, 16px)))) * var(--framer-font-size-scale, 1));
18635
18955
  }
18636
18956
  `, /* css */
18637
18957
  `
@@ -19120,8 +19440,8 @@ function isUndefined(value,) {
19120
19440
  function isNull(value,) {
19121
19441
  return value === null;
19122
19442
  }
19123
- function isNullish(value,) {
19124
- return isUndefined(value,) || isNull(value,);
19443
+ function isNullish2(value,) {
19444
+ return value == null;
19125
19445
  }
19126
19446
  function isValidDate(value,) {
19127
19447
  return value instanceof Date && !isNaN(value.getTime(),);
@@ -20828,131 +21148,6 @@ var isPropValid = /* @__PURE__ */ memoize((prop) =>
20828
21148
  reactPropsRegex.test(prop,) || prop.charCodeAt(0,) === 111 && prop.charCodeAt(1,) === 110 && prop.charCodeAt(2,) < 91
20829
21149
  /* Z+1 */
20830
21150
  );
20831
- var LibraryFeaturesContext = /* @__PURE__ */ React4.createContext(void 0,);
20832
- var LibraryFeaturesProvider = /* @__PURE__ */ (() => LibraryFeaturesContext.Provider)();
20833
- var useLibraryFeatures = () => {
20834
- const context = React4.useContext(LibraryFeaturesContext,);
20835
- return context ?? {};
20836
- };
20837
- var import_process = __toESM(require_browser(), 1,);
20838
- var safeNavigator = typeof navigator !== 'undefined' ? navigator : void 0;
20839
- var isBrowser2 = () => typeof document === 'object';
20840
- var isWebKit = () => {
20841
- var _a;
20842
- return ((_a = safeNavigator) == null ? void 0 : _a.userAgent.includes('AppleWebKit/',)) && !isChrome() && !isEdge();
20843
- };
20844
- var webkitVersion = () => {
20845
- let version2 = -1;
20846
- const regexp = /AppleWebKit\/([\d.]+)/;
20847
- const result = safeNavigator && regexp.exec(safeNavigator.userAgent,);
20848
- if (result && result[1]) {
20849
- version2 = parseFloat(result[1],);
20850
- }
20851
- return version2;
20852
- };
20853
- var safariVersion = () => {
20854
- let version2 = -1;
20855
- const regexp = /Version\/([\d.]+)/;
20856
- const result = safeNavigator && regexp.exec(safeNavigator.userAgent,);
20857
- if (result && result[1]) {
20858
- version2 = parseFloat(result[1],);
20859
- }
20860
- return version2;
20861
- };
20862
- var isChrome = () => safeNavigator && /Chrome/.test(safeNavigator.userAgent,) && /Google Inc/.test(safeNavigator.vendor,) && !isEdge();
20863
- var isSafari = () => safeNavigator && /Safari/.test(safeNavigator.userAgent,) && /Apple Computer/.test(safeNavigator.vendor,);
20864
- var isFirefox = () => safeNavigator && /Firefox\/\d+\.\d+$/.test(safeNavigator.userAgent,);
20865
- var isFramerX = () => safeNavigator && /FramerX/.test(safeNavigator.userAgent,);
20866
- var isEdge = () => safeNavigator && /Edg\//.test(safeNavigator.userAgent,);
20867
- var isAndroid = () => safeNavigator && /android/i.test(safeNavigator.userAgent,);
20868
- var isIOS = () => safeNavigator && /iPhone|iPod|iPad/i.test(safeNavigator.platform,);
20869
- var isMacOS = () => safeNavigator && /Mac/.test(safeNavigator.platform,);
20870
- var isWindows = () => safeNavigator && /Win/.test(safeNavigator.platform,);
20871
- var isTouch = () => safeWindow.ontouchstart === null && safeWindow.ontouchmove === null && safeWindow.ontouchend === null;
20872
- var isDesktop = () => deviceType() === 'desktop';
20873
- var isPhone = () => deviceType() === 'phone';
20874
- var isTablet = () => deviceType() === 'tablet';
20875
- var isMobile = () => isPhone() || isTablet();
20876
- var isFileUrl = (url) => url.startsWith('file://',);
20877
- var isDataUrl = (url) => url.startsWith('data:',);
20878
- var isTest = () => import_process.default.env.NODE_ENV === 'test';
20879
- var isRelativeUrl = (url) => !/^[a-z]{1,8}:\/\/.*$/i.test(url,);
20880
- var isLocalServerUrl = (url) => /[a-z]{1,8}:\/\/127\.0\.0\.1/i.test(url,) || /[a-zA-Z]{1,8}:\/\/localhost/.test(url,);
20881
- var isLocalUrl = (url) => {
20882
- if (isFileUrl(url,)) return true;
20883
- if (isLocalServerUrl(url,)) return true;
20884
- return false;
20885
- };
20886
- var isLocalAssetUrl = (url, baseUrl,) => {
20887
- if (baseUrl === null) baseUrl = safeWindow.location.href;
20888
- if (isDataUrl(url,)) return false;
20889
- if (isLocalUrl(url,)) return true;
20890
- if (isRelativeUrl(url,) && isLocalUrl(baseUrl,)) return true;
20891
- return false;
20892
- };
20893
- var devicePixelRatio2 = () => safeWindow.devicePixelRatio;
20894
- var isJP2Supported = function () {
20895
- if (isFirefox()) return false;
20896
- return isWebKit();
20897
- };
20898
- var isWebPSupported = () => isChrome();
20899
- var deviceType = () => {
20900
- if (safeNavigator && /tablet|iPad|Nexus 9/i.test(safeNavigator.userAgent,)) return 'tablet';
20901
- if (safeNavigator && /mobi/i.test(safeNavigator.userAgent,)) return 'phone';
20902
- return 'desktop';
20903
- };
20904
- var deviceOS = () => {
20905
- if (isMacOS()) return 'macos';
20906
- if (isIOS()) return 'ios';
20907
- if (isAndroid()) return 'android';
20908
- if (isWindows()) return 'windows';
20909
- };
20910
- var deviceFont = (os) => {
20911
- if (!os) {
20912
- os = deviceOS();
20913
- }
20914
- const fonts = {
20915
- apple: '-apple-system, BlinkMacSystemFont, SF Pro Text, SF UI Text, Helvetica Neue',
20916
- google: 'Roboto, Helvetica Neue',
20917
- microsoft: 'Segoe UI, Helvetica Neue',
20918
- };
20919
- if (os === 'macos') return fonts.apple;
20920
- if (os === 'ios') return fonts.apple;
20921
- if (os === 'android') return fonts.google;
20922
- if (os === 'windows') return fonts.microsoft;
20923
- return fonts.apple;
20924
- };
20925
- var environment = {
20926
- isWebKit,
20927
- webkitVersion,
20928
- isChrome,
20929
- isSafari,
20930
- isFirefox,
20931
- isFramerX,
20932
- isEdge,
20933
- isAndroid,
20934
- isIOS,
20935
- isMacOS,
20936
- isWindows,
20937
- isTouch,
20938
- isDesktop,
20939
- isPhone,
20940
- isTablet,
20941
- isMobile,
20942
- isFileUrl,
20943
- isDataUrl,
20944
- isRelativeUrl,
20945
- isLocalServerUrl,
20946
- isLocalUrl,
20947
- isLocalAssetUrl,
20948
- devicePixelRatio: devicePixelRatio2,
20949
- isJP2Supported,
20950
- isWebPSupported,
20951
- deviceType,
20952
- deviceOS,
20953
- deviceFont,
20954
- safariVersion,
20955
- };
20956
21151
  var mockWithWarning = (message) => {
20957
21152
  return () => {
20958
21153
  warnOnce2(message,);
@@ -21088,35 +21283,12 @@ function StaticImage({
21088
21283
  },) {
21089
21284
  const source = runtime.useImageSource(image, containerSize, nodeId,);
21090
21285
  const imageStyle = getImageStyle(image, containerSize,);
21091
- const [measuredSizes, setMeasuredSizes,] = React4.useState();
21092
21286
  const imageRef = React4.useRef(null,);
21093
- const libraryFeatures = useLibraryFeatures();
21094
- React4.useEffect(() => {
21095
- if (!libraryFeatures.imgSizesWorkaroundEnabled) return;
21096
- const imageElement = imageRef.current;
21097
- if (!imageElement) return;
21098
- if (isTest()) return;
21099
- if (!image.sizes) return;
21100
- const smartComponentParent = imageElement.closest('[data-framer-name]',);
21101
- if (!smartComponentParent) return;
21102
- const imageNodeWidth = imageElement.clientWidth;
21103
- const currentSizes = Number(image.sizes.replace('px', '',),);
21104
- if (
21105
- // If we successfully parsed `sizes`, and...
21106
- !isNaN(currentSizes,) &&
21107
- // ...if the image node is smaller than the currently set `sizes`
21108
- // attribute,..
21109
- imageNodeWidth < currentSizes
21110
- ) {
21111
- return;
21112
- }
21113
- setMeasuredSizes(imageNodeWidth + 'px',);
21114
- }, [image.sizes,],);
21115
21287
  return /* @__PURE__ */ jsx('img', {
21116
21288
  ref: imageRef,
21117
21289
  decoding: 'async',
21118
21290
  loading: image.loading,
21119
- sizes: measuredSizes ?? image.sizes,
21291
+ sizes: image.sizes,
21120
21292
  srcSet: image.srcSet,
21121
21293
  src: source,
21122
21294
  alt: alt ?? image.alt,
@@ -21336,6 +21508,125 @@ function Border(props,) {
21336
21508
  function htmlElementAsMotionComponent(asElem,) {
21337
21509
  return asElem && asElem !== 'search' && asElem !== 'slot' && asElem !== 'template' ? motion[asElem] : motion['div'];
21338
21510
  }
21511
+ var import_process = __toESM(require_browser(), 1,);
21512
+ var safeNavigator = typeof navigator !== 'undefined' ? navigator : void 0;
21513
+ var isBrowser2 = () => typeof document === 'object';
21514
+ var isWebKit = () => {
21515
+ var _a;
21516
+ return ((_a = safeNavigator) == null ? void 0 : _a.userAgent.includes('AppleWebKit/',)) && !isChrome() && !isEdge();
21517
+ };
21518
+ var webkitVersion = () => {
21519
+ let version2 = -1;
21520
+ const regexp = /AppleWebKit\/([\d.]+)/;
21521
+ const result = safeNavigator && regexp.exec(safeNavigator.userAgent,);
21522
+ if (result && result[1]) {
21523
+ version2 = parseFloat(result[1],);
21524
+ }
21525
+ return version2;
21526
+ };
21527
+ var safariVersion = () => {
21528
+ let version2 = -1;
21529
+ const regexp = /Version\/([\d.]+)/;
21530
+ const result = safeNavigator && regexp.exec(safeNavigator.userAgent,);
21531
+ if (result && result[1]) {
21532
+ version2 = parseFloat(result[1],);
21533
+ }
21534
+ return version2;
21535
+ };
21536
+ var isChrome = () => safeNavigator && /Chrome/.test(safeNavigator.userAgent,) && /Google Inc/.test(safeNavigator.vendor,) && !isEdge();
21537
+ var isSafari = () => safeNavigator && /Safari/.test(safeNavigator.userAgent,) && /Apple Computer/.test(safeNavigator.vendor,);
21538
+ var isFirefox = () => safeNavigator && /Firefox\/\d+\.\d+$/.test(safeNavigator.userAgent,);
21539
+ var isFramerX = () => safeNavigator && /FramerX/.test(safeNavigator.userAgent,);
21540
+ var isEdge = () => safeNavigator && /Edg\//.test(safeNavigator.userAgent,);
21541
+ var isAndroid = () => safeNavigator && /android/i.test(safeNavigator.userAgent,);
21542
+ var isIOS = () => safeNavigator && /iPhone|iPod|iPad/i.test(safeNavigator.platform,);
21543
+ var isMacOS = () => safeNavigator && /Mac/.test(safeNavigator.platform,);
21544
+ var isWindows = () => safeNavigator && /Win/.test(safeNavigator.platform,);
21545
+ var isTouch = () => safeWindow.ontouchstart === null && safeWindow.ontouchmove === null && safeWindow.ontouchend === null;
21546
+ var isDesktop = () => deviceType() === 'desktop';
21547
+ var isPhone = () => deviceType() === 'phone';
21548
+ var isTablet = () => deviceType() === 'tablet';
21549
+ var isMobile = () => isPhone() || isTablet();
21550
+ var isFileUrl = (url) => url.startsWith('file://',);
21551
+ var isDataUrl = (url) => url.startsWith('data:',);
21552
+ var isTest = () => import_process.default.env.NODE_ENV === 'test';
21553
+ var isRelativeUrl = (url) => !/^[a-z]{1,8}:\/\/.*$/i.test(url,);
21554
+ var isLocalServerUrl = (url) => /[a-z]{1,8}:\/\/127\.0\.0\.1/i.test(url,) || /[a-zA-Z]{1,8}:\/\/localhost/.test(url,);
21555
+ var isLocalUrl = (url) => {
21556
+ if (isFileUrl(url,)) return true;
21557
+ if (isLocalServerUrl(url,)) return true;
21558
+ return false;
21559
+ };
21560
+ var isLocalAssetUrl = (url, baseUrl,) => {
21561
+ if (baseUrl === null) baseUrl = safeWindow.location.href;
21562
+ if (isDataUrl(url,)) return false;
21563
+ if (isLocalUrl(url,)) return true;
21564
+ if (isRelativeUrl(url,) && isLocalUrl(baseUrl,)) return true;
21565
+ return false;
21566
+ };
21567
+ var devicePixelRatio2 = () => safeWindow.devicePixelRatio;
21568
+ var isJP2Supported = function () {
21569
+ if (isFirefox()) return false;
21570
+ return isWebKit();
21571
+ };
21572
+ var isWebPSupported = () => isChrome();
21573
+ var deviceType = () => {
21574
+ if (safeNavigator && /tablet|iPad|Nexus 9/i.test(safeNavigator.userAgent,)) return 'tablet';
21575
+ if (safeNavigator && /mobi/i.test(safeNavigator.userAgent,)) return 'phone';
21576
+ return 'desktop';
21577
+ };
21578
+ var deviceOS = () => {
21579
+ if (isMacOS()) return 'macos';
21580
+ if (isIOS()) return 'ios';
21581
+ if (isAndroid()) return 'android';
21582
+ if (isWindows()) return 'windows';
21583
+ };
21584
+ var deviceFont = (os) => {
21585
+ if (!os) {
21586
+ os = deviceOS();
21587
+ }
21588
+ const fonts = {
21589
+ apple: '-apple-system, BlinkMacSystemFont, SF Pro Text, SF UI Text, Helvetica Neue',
21590
+ google: 'Roboto, Helvetica Neue',
21591
+ microsoft: 'Segoe UI, Helvetica Neue',
21592
+ };
21593
+ if (os === 'macos') return fonts.apple;
21594
+ if (os === 'ios') return fonts.apple;
21595
+ if (os === 'android') return fonts.google;
21596
+ if (os === 'windows') return fonts.microsoft;
21597
+ return fonts.apple;
21598
+ };
21599
+ var environment = {
21600
+ isWebKit,
21601
+ webkitVersion,
21602
+ isChrome,
21603
+ isSafari,
21604
+ isFirefox,
21605
+ isFramerX,
21606
+ isEdge,
21607
+ isAndroid,
21608
+ isIOS,
21609
+ isMacOS,
21610
+ isWindows,
21611
+ isTouch,
21612
+ isDesktop,
21613
+ isPhone,
21614
+ isTablet,
21615
+ isMobile,
21616
+ isFileUrl,
21617
+ isDataUrl,
21618
+ isRelativeUrl,
21619
+ isLocalServerUrl,
21620
+ isLocalUrl,
21621
+ isLocalAssetUrl,
21622
+ devicePixelRatio: devicePixelRatio2,
21623
+ isJP2Supported,
21624
+ isWebPSupported,
21625
+ deviceType,
21626
+ deviceOS,
21627
+ deviceFont,
21628
+ safariVersion,
21629
+ };
21339
21630
  var isChrome2 = /* @__PURE__ */ isChrome();
21340
21631
  function layoutHintDataPropsForCenter(center,) {
21341
21632
  const props = {};
@@ -31451,6 +31742,9 @@ var LazyValue = class {
31451
31742
  };
31452
31743
  return promise;
31453
31744
  }
31745
+ waitFor() {
31746
+ return this.resolver();
31747
+ }
31454
31748
  /** Synchronously read the value after calling preload() before. */
31455
31749
  read() {
31456
31750
  const status = this.status;
@@ -31469,6 +31763,12 @@ var LazyValue = class {
31469
31763
  }
31470
31764
  }
31471
31765
  };
31766
+ var LibraryFeaturesContext = /* @__PURE__ */ React4.createContext(void 0,);
31767
+ var LibraryFeaturesProvider = /* @__PURE__ */ (() => LibraryFeaturesContext.Provider)();
31768
+ var useLibraryFeatures = () => {
31769
+ const context = React4.useContext(LibraryFeaturesContext,);
31770
+ return context ?? {};
31771
+ };
31472
31772
  function findAnchorElement(target, withinElement,) {
31473
31773
  if (target instanceof HTMLAnchorElement) {
31474
31774
  return target;
@@ -31786,7 +32086,7 @@ function createOnClickLinkHandler(router, routeId, elementId, combinedPathVariab
31786
32086
  event.preventDefault();
31787
32087
  const route = (_a = router.getRoute) == null ? void 0 : _a.call(router, routeId,);
31788
32088
  if (route && isLazyComponentType(route == null ? void 0 : route.page,)) {
31789
- await route.page.preload();
32089
+ void route.page.preload();
31790
32090
  }
31791
32091
  (_b = router.navigate) == null ? void 0 : _b.call(router, routeId, elementId, combinedPathVariables, smoothScroll,);
31792
32092
  };
@@ -32281,6 +32581,284 @@ function responseHasError(response,) {
32281
32581
  return typeof response === 'object' && response !== null && 'error' in response && isObject2(response.error,) &&
32282
32582
  'message' in response.error && typeof response.error.message === 'string';
32283
32583
  }
32584
+ var loadingFetchResult = {
32585
+ status: 'loading',
32586
+ data: void 0,
32587
+ };
32588
+ function isValidURL2(href,) {
32589
+ try {
32590
+ const url = new URL(href,);
32591
+ return Boolean(url.protocol,);
32592
+ } catch {}
32593
+ }
32594
+ function isCacheExpired(insertionTimestamp, cacheDuration,) {
32595
+ const cacheDurationMs = cacheDuration * 1e3;
32596
+ const currentTimestamp = Date.now();
32597
+ const expirationTimestamp = insertionTimestamp + cacheDurationMs;
32598
+ return currentTimestamp >= expirationTimestamp;
32599
+ }
32600
+ var noop22 = () => {};
32601
+ var _responseValues;
32602
+ var _subscribers;
32603
+ var _cacheDurations;
32604
+ var _cachedAt;
32605
+ var _staleQueriesInterval;
32606
+ var _FetchClient = class {
32607
+ constructor() {
32608
+ __privateAdd(this, _responseValues, /* @__PURE__ */ new Map(),);
32609
+ __privateAdd(this, _subscribers, /* @__PURE__ */ new Map(),);
32610
+ __privateAdd(this, _cacheDurations, /* @__PURE__ */ new Map(),);
32611
+ __privateAdd(this, _cachedAt, /* @__PURE__ */ new Map(),);
32612
+ __privateAdd(this, _staleQueriesInterval, void 0,);
32613
+ __publicField(this, 'checkForStaleQueries', () => {
32614
+ const activeURLS = __privateGet(this, _subscribers,).keys();
32615
+ for (const url of activeURLS) {
32616
+ const cachedAt = __privateGet(this, _cachedAt,).get(url,);
32617
+ const cacheDuration = __privateGet(this, _cacheDurations,).get(url,);
32618
+ if (!cacheDuration || !cachedAt) continue;
32619
+ void this.fetchWithCache(url, cacheDuration,);
32620
+ }
32621
+ },);
32622
+ __publicField(
32623
+ this,
32624
+ 'persistCache',
32625
+ debounce(() => {
32626
+ const data2 = {};
32627
+ for (const [url, responseValue,] of __privateGet(this, _responseValues,)) {
32628
+ if (!responseValue) continue;
32629
+ if (responseValue.status !== 'success') continue;
32630
+ const cacheConfig = __privateGet(this, _cacheDurations,).get(url,);
32631
+ if (!cacheConfig || cacheConfig === 0) continue;
32632
+ const storedAt = __privateGet(this, _cachedAt,).get(url,);
32633
+ if (!storedAt) continue;
32634
+ if (storedAt && isCacheExpired(storedAt, cacheConfig,)) {
32635
+ continue;
32636
+ }
32637
+ data2[url] = [storedAt, cacheConfig, responseValue.data,];
32638
+ }
32639
+ localStorage.setItem(_FetchClient.cacheKey, JSON.stringify(data2,),);
32640
+ }, 500,),
32641
+ );
32642
+ this.hydrateCache();
32643
+ }
32644
+ hydrateCache() {
32645
+ try {
32646
+ const rawData = localStorage.getItem(_FetchClient.cacheKey,);
32647
+ if (!rawData) return;
32648
+ const data2 = JSON.parse(rawData,);
32649
+ if (typeof data2 !== 'object') throw new Error('Invalid cache data',);
32650
+ for (const url in data2) {
32651
+ const cached = data2[url];
32652
+ if (!Array.isArray(cached,) || cached.length !== 3) throw new Error('Invalid cache data',);
32653
+ const [storedAt, cacheDuration, cachedData,] = cached;
32654
+ if (isCacheExpired(storedAt, cacheDuration,)) continue;
32655
+ __privateGet(this, _cachedAt,).set(url, storedAt,);
32656
+ __privateGet(this, _cacheDurations,).set(url, cacheDuration,);
32657
+ __privateGet(this, _responseValues,).set(url, {
32658
+ status: 'success',
32659
+ data: cachedData,
32660
+ },);
32661
+ }
32662
+ } catch (error) {
32663
+ localStorage.removeItem(_FetchClient.cacheKey,);
32664
+ }
32665
+ }
32666
+ setResponseValue(url, value,) {
32667
+ __privateGet(this, _responseValues,).set(url, value,);
32668
+ this.persistCache();
32669
+ const subscribers = __privateGet(this, _subscribers,).get(url,);
32670
+ if (!subscribers) return;
32671
+ for (const subscriber of subscribers) {
32672
+ subscriber();
32673
+ }
32674
+ }
32675
+ async prefetch(url, cacheDuration,) {
32676
+ if (!isValidURL2(url,)) return;
32677
+ return this.fetchWithCache(url, cacheDuration,);
32678
+ }
32679
+ async fetchWithCache(url, cacheDuration,) {
32680
+ try {
32681
+ const cachedAt = __privateGet(this, _cachedAt,).get(url,);
32682
+ const hasExpiredCache = cachedAt && isCacheExpired(cachedAt, cacheDuration,);
32683
+ if (__privateGet(this, _responseValues,).has(url,) && !hasExpiredCache) {
32684
+ return;
32685
+ }
32686
+ const currentValue = __privateGet(this, _responseValues,).get(url,);
32687
+ if (!currentValue) {
32688
+ this.setResponseValue(url, loadingFetchResult,);
32689
+ }
32690
+ const response = await fetch(url, {
32691
+ method: 'GET',
32692
+ headers: {
32693
+ // Default to JSON always or no?
32694
+ 'Content-Type': 'application/json',
32695
+ },
32696
+ },);
32697
+ if (!response.ok) {
32698
+ this.setResponseValue(url, {
32699
+ status: 'error',
32700
+ error: new Error('Invalid Response Status',),
32701
+ data: void 0,
32702
+ },);
32703
+ return;
32704
+ }
32705
+ const value = await response.json();
32706
+ this.setResponseValue(url, {
32707
+ status: 'success',
32708
+ data: value,
32709
+ },);
32710
+ __privateGet(this, _cachedAt,).set(url, Date.now(),);
32711
+ } catch (error) {
32712
+ this.setResponseValue(url, {
32713
+ status: 'error',
32714
+ error,
32715
+ data: void 0,
32716
+ },);
32717
+ }
32718
+ }
32719
+ getValue(url,) {
32720
+ return __privateGet(this, _responseValues,).get(url,);
32721
+ }
32722
+ subscribe(url, callback, cacheDuration,) {
32723
+ if (!isValidURL2(url,)) return noop22;
32724
+ const cacheDurationForUrl = __privateGet(this, _cacheDurations,).get(url,);
32725
+ if (!cacheDurationForUrl || cacheDuration < cacheDurationForUrl) {
32726
+ __privateGet(this, _cacheDurations,).set(url, cacheDuration,);
32727
+ }
32728
+ if (!__privateGet(this, _staleQueriesInterval,)) {
32729
+ __privateSet(this, _staleQueriesInterval, safeWindow.setInterval(this.checkForStaleQueries, 5e3,),);
32730
+ }
32731
+ void this.fetchWithCache(url, cacheDuration,);
32732
+ const subscribers = __privateGet(this, _subscribers,).get(url,) ?? /* @__PURE__ */ new Set();
32733
+ subscribers.add(callback,);
32734
+ __privateGet(this, _subscribers,).set(url, subscribers,);
32735
+ return () => {
32736
+ const nextSubscribers = __privateGet(this, _subscribers,).get(url,);
32737
+ if (!nextSubscribers) return;
32738
+ nextSubscribers.delete(callback,);
32739
+ if (nextSubscribers.size === 0) {
32740
+ __privateGet(this, _subscribers,).delete(url,);
32741
+ }
32742
+ if (__privateGet(this, _subscribers,).size === 0) {
32743
+ safeWindow.clearInterval(__privateGet(this, _staleQueriesInterval,),);
32744
+ __privateSet(this, _staleQueriesInterval, void 0,);
32745
+ }
32746
+ };
32747
+ }
32748
+ };
32749
+ var FetchClient = _FetchClient;
32750
+ _responseValues = /* @__PURE__ */ new WeakMap();
32751
+ _subscribers = /* @__PURE__ */ new WeakMap();
32752
+ _cacheDurations = /* @__PURE__ */ new WeakMap();
32753
+ _cachedAt = /* @__PURE__ */ new WeakMap();
32754
+ _staleQueriesInterval = /* @__PURE__ */ new WeakMap();
32755
+ __publicField(FetchClient, 'cacheKey', 'framer-fetch-cache',);
32756
+ var FetchClientContext = React2.createContext(void 0,);
32757
+ var FetchClientProvider = ({
32758
+ children,
32759
+ },) => {
32760
+ const [client,] = React2.useState(() => new FetchClient());
32761
+ return /* @__PURE__ */ jsx(FetchClientContext.Provider, {
32762
+ value: client,
32763
+ children,
32764
+ },);
32765
+ };
32766
+ function difference(array1, array2,) {
32767
+ return array1.filter((x) => !array2.includes(x,));
32768
+ }
32769
+ var _subscriptions;
32770
+ var _subscribers2;
32771
+ var _cachedResults;
32772
+ var _queryResult;
32773
+ var RequestsObserver = class {
32774
+ constructor(client,) {
32775
+ this.client = client;
32776
+ __privateAdd(this, _subscriptions, /* @__PURE__ */ new Map(),);
32777
+ __privateAdd(this, _subscribers2, /* @__PURE__ */ new Set(),);
32778
+ __privateAdd(this, _cachedResults, /* @__PURE__ */ new WeakSet(),);
32779
+ __privateAdd(this, _queryResult, /* @__PURE__ */ new Map(),);
32780
+ __publicField(this, 'onFetchResultUpdate', () => {
32781
+ const results = /* @__PURE__ */ new Map();
32782
+ let hasChange = false;
32783
+ const subscribedUrls = __privateGet(this, _subscriptions,).keys();
32784
+ for (const url of subscribedUrls) {
32785
+ const result = this.client.getValue(url,);
32786
+ if (!result) return;
32787
+ results.set(url, result,);
32788
+ if (!__privateGet(this, _cachedResults,).has(result,)) {
32789
+ __privateGet(this, _cachedResults,).add(result,);
32790
+ hasChange = true;
32791
+ }
32792
+ }
32793
+ if (!hasChange) {
32794
+ return;
32795
+ }
32796
+ __privateSet(this, _queryResult, results,);
32797
+ for (const subscriber of __privateGet(this, _subscribers2,)) {
32798
+ subscriber();
32799
+ }
32800
+ },);
32801
+ __publicField(this, 'subscribe', (callback) => {
32802
+ __privateGet(this, _subscribers2,).add(callback,);
32803
+ return () => {
32804
+ __privateGet(this, _subscribers2,).delete(callback,);
32805
+ };
32806
+ },);
32807
+ __publicField(this, 'getResults', () => {
32808
+ return __privateGet(this, _queryResult,);
32809
+ },);
32810
+ }
32811
+ setRequests(requests,) {
32812
+ var _a;
32813
+ const requestsByURL = new Map(requests.map((query) => [query.url, query,]),);
32814
+ const nextSubscribedURLs = Array.from(requestsByURL.keys(),);
32815
+ const hasSubscriptionChange = nextSubscribedURLs.some((url) => !__privateGet(this, _subscriptions,).has(url,));
32816
+ if (nextSubscribedURLs.length !== __privateGet(this, _subscriptions,).size && !hasSubscriptionChange) {
32817
+ return;
32818
+ }
32819
+ const currentSubscribedURLs = Array.from(__privateGet(this, _subscriptions,).keys(),);
32820
+ const unsubscribeURLs = difference(currentSubscribedURLs, nextSubscribedURLs,);
32821
+ for (const url of unsubscribeURLs) {
32822
+ (_a = __privateGet(this, _subscriptions,).get(url,)) == null ? void 0 : _a();
32823
+ __privateGet(this, _subscriptions,).delete(url,);
32824
+ }
32825
+ const toSubscribeURLs = difference(nextSubscribedURLs, currentSubscribedURLs,);
32826
+ for (const url of toSubscribeURLs) {
32827
+ const requestConfig = requestsByURL.get(url,);
32828
+ const unsubscribe = this.client.subscribe(
32829
+ url,
32830
+ this.onFetchResultUpdate,
32831
+ (requestConfig == null ? void 0 : requestConfig.cacheDuration) ?? 0,
32832
+ );
32833
+ __privateGet(this, _subscriptions,).set(url, unsubscribe,);
32834
+ }
32835
+ __privateSet(this, _cachedResults, /* @__PURE__ */ new WeakSet(),);
32836
+ this.onFetchResultUpdate();
32837
+ }
32838
+ };
32839
+ _subscriptions = /* @__PURE__ */ new WeakMap();
32840
+ _subscribers2 = /* @__PURE__ */ new WeakMap();
32841
+ _cachedResults = /* @__PURE__ */ new WeakMap();
32842
+ _queryResult = /* @__PURE__ */ new WeakMap();
32843
+ function useFetchRequests(requests, disabled,) {
32844
+ const fetchClient = React2.useContext(FetchClientContext,);
32845
+ if (!fetchClient) {
32846
+ throw new Error('useFetchRequest must be used within a FetchClientProvider',);
32847
+ }
32848
+ const [observer2,] = React2.useState(() => new RequestsObserver(fetchClient,));
32849
+ React2.useLayoutEffect(() => {
32850
+ if (disabled) return;
32851
+ observer2.setRequests(requests,);
32852
+ }, [requests, observer2, disabled,],);
32853
+ return React2.useSyncExternalStore(observer2.subscribe, observer2.getResults, observer2.getResults,);
32854
+ }
32855
+ function usePrefetch() {
32856
+ const fetchClient = React2.useContext(FetchClientContext,);
32857
+ if (!fetchClient) {
32858
+ throw new Error('useFetchRequest must be used within a FetchClientProvider',);
32859
+ }
32860
+ return React2.useCallback((url, cacheDuration,) => fetchClient.prefetch(url, cacheDuration,), [fetchClient,],);
32861
+ }
32284
32862
  function PageRoot({
32285
32863
  RootComponent,
32286
32864
  isWebsite,
@@ -32295,9 +32873,10 @@ function PageRoot({
32295
32873
  localeId,
32296
32874
  locales,
32297
32875
  preserveQueryParams,
32298
- enableImproveInpDuringHydration,
32299
- addHydrationMarkers = false,
32300
32876
  },) {
32877
+ const {
32878
+ enableAsyncURLUpdates,
32879
+ } = useLibraryFeatures();
32301
32880
  React4.useEffect(() => {
32302
32881
  if (isWebsite) return;
32303
32882
  MainLoop.start();
@@ -32308,21 +32887,22 @@ function PageRoot({
32308
32887
  children: /* @__PURE__ */ jsx(CustomCursorHost, {
32309
32888
  children: /* @__PURE__ */ jsx(FormContext.Provider, {
32310
32889
  value: framerSiteId,
32311
- children: /* @__PURE__ */ jsx(Router, {
32312
- initialRoute: routeId,
32313
- initialPathVariables: pathVariables,
32314
- initialLocaleId: localeId,
32315
- routes,
32316
- collectionUtils,
32317
- notFoundPage,
32318
- locales,
32319
- defaultPageStyle: {
32320
- minHeight: '100vh',
32321
- width: 'auto',
32322
- },
32323
- preserveQueryParams,
32324
- enableImproveInpDuringHydration,
32325
- addHydrationMarkers,
32890
+ children: /* @__PURE__ */ jsx(FetchClientProvider, {
32891
+ children: /* @__PURE__ */ jsx(Router, {
32892
+ initialRoute: routeId,
32893
+ initialPathVariables: pathVariables,
32894
+ initialLocaleId: localeId,
32895
+ routes,
32896
+ collectionUtils,
32897
+ notFoundPage,
32898
+ locales,
32899
+ defaultPageStyle: {
32900
+ minHeight: '100vh',
32901
+ width: 'auto',
32902
+ },
32903
+ preserveQueryParams,
32904
+ enableAsyncURLUpdates,
32905
+ },),
32326
32906
  },),
32327
32907
  },),
32328
32908
  },),
@@ -32605,6 +33185,89 @@ var ResolveLinks = /* @__PURE__ */ React2.forwardRef(function ResolveLinksInner(
32605
33185
  const childrenWithLinks = children(resolvedLinks,);
32606
33186
  return cloneWithPropsAndRef(childrenWithLinks, rest,);
32607
33187
  },);
33188
+ function isObjectOrArray(value,) {
33189
+ return typeof value === 'object' && value !== null;
33190
+ }
33191
+ function getPropertyByPath(input, keyPath,) {
33192
+ if (keyPath === '') {
33193
+ return input;
33194
+ }
33195
+ const keyParts = keyPath.split(/[.[\]]+/u,).filter((part) => part.length > 0);
33196
+ let current = input;
33197
+ for (const part of keyParts) {
33198
+ if (!isObjectOrArray(current,)) {
33199
+ return void 0;
33200
+ }
33201
+ current = current[part];
33202
+ }
33203
+ return current;
33204
+ }
33205
+ function isValidFetchDataValueResult(type, value,) {
33206
+ switch (type) {
33207
+ case 'string':
33208
+ return isString22(value,) || isNumber2(value,);
33209
+ case 'boolean':
33210
+ return isBoolean(value,);
33211
+ case 'number':
33212
+ return isNumber2(value,);
33213
+ default: {
33214
+ const _ = type;
33215
+ return false;
33216
+ }
33217
+ }
33218
+ }
33219
+ function resolveFetchDataValue(result, request,) {
33220
+ if (result.status === 'loading') {
33221
+ return request.fallbackValue;
33222
+ }
33223
+ if (result.status === 'error') {
33224
+ return request.fallbackValue;
33225
+ }
33226
+ const resolvedValue = getPropertyByPath(result.data, request.resultKeyPath,);
33227
+ if (!isValidFetchDataValueResult(request.resultOutputType, resolvedValue,)) {
33228
+ return request.fallbackValue;
33229
+ }
33230
+ return resolvedValue;
33231
+ }
33232
+ function useFetchDataValues(requests, disabled,) {
33233
+ const fetchResults = useFetchRequests(requests, disabled,);
33234
+ const data2 = React2.useMemo(() => {
33235
+ return requests.map((request) => {
33236
+ const fetchResult = fetchResults.get(request.url,);
33237
+ if (!fetchResult) {
33238
+ return request.fallbackValue;
33239
+ }
33240
+ return resolveFetchDataValue(fetchResult, request,);
33241
+ },);
33242
+ }, [fetchResults, requests,],);
33243
+ const status = React2.useMemo(() => {
33244
+ const statuses = /* @__PURE__ */ new Set();
33245
+ for (const fetchResult of fetchResults.values()) {
33246
+ statuses.add(fetchResult.status,);
33247
+ }
33248
+ if (statuses.has('error',)) return 'error';
33249
+ if (statuses.has('loading',)) return 'loading';
33250
+ return 'success';
33251
+ }, [fetchResults,],);
33252
+ return {
33253
+ status,
33254
+ data: data2,
33255
+ };
33256
+ }
33257
+ var Fetcher = /* @__PURE__ */ React2.forwardRef(function Fetcher2({
33258
+ requests,
33259
+ disabled,
33260
+ children,
33261
+ ...rest
33262
+ }, ref,) {
33263
+ const cloneWithPropsAndRef = useCloneChildrenWithPropsAndRef(ref,);
33264
+ const {
33265
+ data: data2,
33266
+ status,
33267
+ } = useFetchDataValues(requests, disabled,);
33268
+ const childrenWithValues = children(data2, status,);
33269
+ return cloneWithPropsAndRef(childrenWithValues, rest,);
33270
+ },);
32608
33271
  var callEach = (...fns) => fns.forEach((fn) => fn && fn());
32609
33272
  var import_archy = __toESM(require_archy(), 1,);
32610
33273
  function getLogger(name,) {
@@ -32681,7 +33344,7 @@ var CompatibilityDatabaseCollection = class {
32681
33344
  const data2 = {};
32682
33345
  for (const key7 in this.schema) {
32683
33346
  const value = item[key7];
32684
- if (isNullish(value,)) continue;
33347
+ if (isNullish2(value,)) continue;
32685
33348
  const definition = this.schema[key7];
32686
33349
  if (isUndefined(definition,)) continue;
32687
33350
  data2[key7] = {
@@ -34232,10 +34895,10 @@ var SortItemsPlan = class extends QueryPlan {
34232
34895
  if (DatabaseValue.equal(left, right, collation,)) {
34233
34896
  continue;
34234
34897
  }
34235
- if (DatabaseValue.lessThan(left, right, collation,) || isNullish(left,)) {
34898
+ if (DatabaseValue.lessThan(left, right, collation,) || isNullish2(left,)) {
34236
34899
  return isAscending ? -1 : 1;
34237
34900
  }
34238
- if (DatabaseValue.greaterThan(left, right, collation,) || isNullish(right,)) {
34901
+ if (DatabaseValue.greaterThan(left, right, collation,) || isNullish2(right,)) {
34239
34902
  return isAscending ? 1 : -1;
34240
34903
  }
34241
34904
  throw new Error('Invalid comparison result.',);
@@ -34272,13 +34935,13 @@ var SliceItemsPlan = class extends QueryPlan {
34272
34935
  getOffset() {
34273
34936
  var _a;
34274
34937
  const value = (_a = this.offsetExpression) == null ? void 0 : _a.evaluate();
34275
- if (isNullish(value,) || value.type !== 'number') return;
34938
+ if (isNullish2(value,) || value.type !== 'number') return;
34276
34939
  return value.value;
34277
34940
  }
34278
34941
  getLimit() {
34279
34942
  var _a;
34280
34943
  const value = (_a = this.limitExpression) == null ? void 0 : _a.evaluate();
34281
- if (isNullish(value,) || value.type !== 'number') return;
34944
+ if (isNullish2(value,) || value.type !== 'number') return;
34282
34945
  return value.value;
34283
34946
  }
34284
34947
  async _execute() {
@@ -34538,7 +35201,7 @@ function getSelectKey(expression,) {
34538
35201
  throw new Error('Can\'t serialize expression',);
34539
35202
  }
34540
35203
  async function resolveValue(richTextResolver, value,) {
34541
- if (isNullish(value,)) {
35204
+ if (isNullish2(value,)) {
34542
35205
  return null;
34543
35206
  }
34544
35207
  if (value.type === 'richtext') {
@@ -35379,6 +36042,14 @@ function useQueryCount(query,) {
35379
36042
  const collection = useQueryData(countQuery,);
35380
36043
  return collection.length;
35381
36044
  }
36045
+ function usePreloadQuery() {
36046
+ const {
36047
+ activeLocale,
36048
+ } = useLocaleInfo();
36049
+ return useCallback(async (query) => {
36050
+ return queryCache.get(query, activeLocale,).waitFor();
36051
+ }, [activeLocale,],);
36052
+ }
35382
36053
  function getWhereExpressionFromPathVariables(pathVariables,) {
35383
36054
  const entries = Object.entries(pathVariables,).filter(([, value,],) => {
35384
36055
  if (isUndefined(value,)) return false;
@@ -35499,11 +36170,13 @@ var VariantSelector = /* @__PURE__ */ ((VariantSelector2) => {
35499
36170
  VariantSelector2['Variant'] = 'v';
35500
36171
  return VariantSelector2;
35501
36172
  })(VariantSelector || {},);
35502
- function getGesture(enabledGestures, isHovered, isPressed,) {
36173
+ function getGesture(enabledGestures, isHovered, isPressed, isLoading,) {
35503
36174
  const {
35504
36175
  hover,
35505
36176
  pressed,
36177
+ loading,
35506
36178
  } = enabledGestures || {};
36179
+ if (loading && isLoading) return 'loading';
35507
36180
  if (pressed && isPressed) return 'pressed';
35508
36181
  if (hover && isHovered) return 'hover';
35509
36182
  }
@@ -35528,6 +36201,7 @@ function useVariantState({
35528
36201
  variantClassNames = {},
35529
36202
  },) {
35530
36203
  const forceUpdate = useForceUpdate3();
36204
+ const isCanvas = useIsOnFramerCanvas();
35531
36205
  const validBaseVariants = useConstant2(() => new Set(externalCycleOrder,));
35532
36206
  const internalState = React4.useRef({
35533
36207
  isHovered: false,
@@ -35536,6 +36210,7 @@ function useVariantState({
35536
36210
  baseVariant: safeBaseVariant(variant, externalDefaultVariant, validBaseVariants,),
35537
36211
  lastVariant: variant,
35538
36212
  gestureVariant: void 0,
36213
+ loadedBaseVariant: {},
35539
36214
  // When used in generated components, these are static values defined
35540
36215
  // outside of the component function that also need to not result in
35541
36216
  // memoized values being recalculated, so we dump them into the ref.
@@ -35552,13 +36227,14 @@ function useVariantState({
35552
36227
  defaultVariant: defaultVariant2,
35553
36228
  } = internalState.current;
35554
36229
  const nextBaseVariant = safeBaseVariant(targetBaseVariant, defaultVariant2, validBaseVariants,);
35555
- const gesture = getGesture(enabledGestures2 == null ? void 0 : enabledGestures2[nextBaseVariant], isHovered2, isPressed2,);
36230
+ const gesture = getGesture(enabledGestures2 == null ? void 0 : enabledGestures2[nextBaseVariant], isHovered2, isPressed2, false,);
35556
36231
  const nextGestureVariant = gesture ? createGestureVariant(nextBaseVariant, gesture,) : void 0;
35557
36232
  return [nextBaseVariant, nextGestureVariant,];
35558
36233
  }, [validBaseVariants,],);
35559
36234
  const setGestureState = React4.useCallback(({
35560
36235
  isHovered: isHovered2,
35561
36236
  isPressed: isPressed2,
36237
+ isLoading,
35562
36238
  },) => {
35563
36239
  if (isHovered2 !== void 0) internalState.current.isHovered = isHovered2;
35564
36240
  if (isPressed2 !== void 0) internalState.current.isPressed = isPressed2;
@@ -35591,6 +36267,13 @@ function useVariantState({
35591
36267
  forceUpdate();
35592
36268
  }
35593
36269
  }, [resolveNextVariant, forceUpdate,],);
36270
+ const clearLoadingGesture = React4.useCallback(() => {
36271
+ const {
36272
+ baseVariant: baseVariant2,
36273
+ } = internalState.current;
36274
+ internalState.current.loadedBaseVariant[baseVariant2] = true;
36275
+ forceUpdate();
36276
+ }, [forceUpdate,],);
35594
36277
  if (variant !== internalState.current.lastVariant) {
35595
36278
  const [nextBase, nextGesture,] = resolveNextVariant(variant,);
35596
36279
  internalState.current.lastVariant = nextBase;
@@ -35606,12 +36289,17 @@ function useVariantState({
35606
36289
  enabledGestures,
35607
36290
  isHovered,
35608
36291
  isPressed,
36292
+ loadedBaseVariant,
35609
36293
  } = internalState.current;
35610
36294
  const addVariantProps = useAddVariantProps(internalState.current.baseVariant, internalState.current.gestureVariant, variantProps2,);
35611
36295
  return React4.useMemo(() => {
36296
+ var _a;
35612
36297
  const variants = [];
35613
36298
  if (baseVariant !== defaultVariant) variants.push(baseVariant,);
35614
- if (gestureVariant) variants.push(gestureVariant,);
36299
+ const hasLoadingVariant = (_a = enabledGestures == null ? void 0 : enabledGestures[baseVariant]) == null ? void 0 : _a.loading;
36300
+ const isLoading = !isCanvas && !!hasLoadingVariant && !loadedBaseVariant[baseVariant];
36301
+ const gesture = isLoading ? createGestureVariant(baseVariant, 'loading',) : gestureVariant;
36302
+ if (gesture) variants.push(gesture,);
35615
36303
  const gestures = enabledGestures == null ? void 0 : enabledGestures[baseVariant];
35616
36304
  const gestureHandlers = {
35617
36305
  onMouseEnter: () =>
@@ -35642,24 +36330,28 @@ function useVariantState({
35642
36330
  return {
35643
36331
  variants,
35644
36332
  baseVariant,
35645
- gestureVariant,
36333
+ gestureVariant: gesture,
36334
+ isLoading,
35646
36335
  transition: activeTransition(internalState.current.transitions, baseVariant,),
35647
36336
  setVariant,
35648
36337
  setGestureState,
36338
+ clearLoadingGesture,
35649
36339
  addVariantProps,
35650
36340
  gestureHandlers,
35651
- classNames: cx(createVariantClassName(baseVariant, variantClassNames,), getGesture(gestures, isHovered, isPressed,),),
36341
+ classNames: cx(createVariantClassName(baseVariant, variantClassNames,), getGesture(gestures, isHovered, isPressed, isLoading,),),
35652
36342
  };
35653
36343
  }, [
35654
36344
  baseVariant,
35655
36345
  gestureVariant,
35656
36346
  isHovered,
35657
36347
  isPressed,
36348
+ loadedBaseVariant,
35658
36349
  addVariantProps,
35659
36350
  setVariant,
35660
36351
  defaultVariant,
35661
36352
  enabledGestures,
35662
36353
  setGestureState,
36354
+ clearLoadingGesture,
35663
36355
  variantClassNames,
35664
36356
  ],);
35665
36357
  }
@@ -41184,6 +41876,14 @@ function upgradeComponentFontV1(font,) {
41184
41876
  source,
41185
41877
  };
41186
41878
  }
41879
+ function withPerformanceMarks(prefix2, callback,) {
41880
+ const markStart = `${prefix2}-start`;
41881
+ performance.mark(markStart,);
41882
+ callback();
41883
+ const markEnd = `${prefix2}-end`;
41884
+ performance.mark(markEnd,);
41885
+ performance.measure(prefix2, markStart, markEnd,);
41886
+ }
41187
41887
  function loadJSON(url,) {
41188
41888
  return fetch(url, {
41189
41889
  mode: 'cors',
@@ -41357,7 +42057,7 @@ var package_default = {
41357
42057
  yargs: '^17.6.2',
41358
42058
  },
41359
42059
  peerDependencies: {
41360
- 'framer-motion': '11.2.10',
42060
+ 'framer-motion': '11.2.13',
41361
42061
  react: '^18.2.0',
41362
42062
  'react-dom': '^18.2.0',
41363
42063
  },
@@ -41492,6 +42192,7 @@ export {
41492
42192
  environment,
41493
42193
  ErrorPlaceholder,
41494
42194
  executeInRenderEnvironment,
42195
+ Fetcher,
41495
42196
  filterProps,
41496
42197
  finiteNumber,
41497
42198
  FlatTree,
@@ -41578,6 +42279,7 @@ export {
41578
42279
  MainLoop,
41579
42280
  makePaddingString,
41580
42281
  makeUseVisualState,
42282
+ markHydrationStart,
41581
42283
  memoize2 as memoize,
41582
42284
  mirrorEasing,
41583
42285
  mix,
@@ -41665,6 +42367,7 @@ export {
41665
42367
  transform,
41666
42368
  transformString,
41667
42369
  transformTemplate,
42370
+ turnOffReactEventHandling,
41668
42371
  unwrapMotionComponent,
41669
42372
  useActiveTargetCallback,
41670
42373
  useActiveVariantCallback,
@@ -41718,6 +42421,8 @@ export {
41718
42421
  useOnVariantChange,
41719
42422
  useOverlayState,
41720
42423
  usePageEffects,
42424
+ usePrefetch,
42425
+ usePreloadQuery,
41721
42426
  usePresence,
41722
42427
  usePrototypeNavigate,
41723
42428
  useProvidedWindow,
@@ -41761,6 +42466,7 @@ export {
41761
42466
  WithOverride,
41762
42467
  withParallaxTransform,
41763
42468
  withPath,
42469
+ withPerformanceMarks,
41764
42470
  withShape,
41765
42471
  withStyleAppearEffect,
41766
42472
  withVariantAppearEffect,